@hackler/react-sdk 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/config.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export declare const SDK_NAME_HEADER = "react-sdk";
2
- export declare const SDK_VERSION_HEADER = "3.2.0";
2
+ export declare const SDK_VERSION_HEADER = "3.3.0";
3
3
  //# sourceMappingURL=config.d.ts.map
package/lib/index.es.js CHANGED
@@ -48,7 +48,7 @@ function __read(o, n) {
48
48
  }
49
49
 
50
50
  var SDK_NAME_HEADER = "react-sdk";
51
- var SDK_VERSION_HEADER = "3.2.0";
51
+ var SDK_VERSION_HEADER = "3.3.0";
52
52
 
53
53
  var HackleReactSDKClient = /** @class */ (function () {
54
54
  function HackleReactSDKClient(sdkKey, config) {
package/lib/index.js CHANGED
@@ -74,7 +74,7 @@ function __read(o, n) {
74
74
  }
75
75
 
76
76
  var SDK_NAME_HEADER = "react-sdk";
77
- var SDK_VERSION_HEADER = "3.2.0";
77
+ var SDK_VERSION_HEADER = "3.3.0";
78
78
 
79
79
  var HackleReactSDKClient = /** @class */ (function () {
80
80
  function HackleReactSDKClient(sdkKey, config) {
package/lib/index.umd.js CHANGED
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hackler/js-client-sdk")):"function"==typeof define&&define.amd?define(["exports","@hackler/js-client-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={},e.Hackle)}(this,function(t,r){"use strict";function e(r){if(r&&r.__esModule)return r;var n=Object.create(null);return r&&Object.keys(r).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(r,e),Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}}))}),n.default=r,Object.freeze(n)}var n=e(r),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}var o=(i.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},i.prototype.track=function(e,t){this.client.track(e,t)},i.prototype.trackPageView=function(e){this.client.trackPageView(e)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i.prototype.onInitialized=function(e){return this.client.onInitialized(e)},i);function i(e,t){this.client=n.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.2.0"}))}var f={exports:{}},u={},s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var ke=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))p.call(r,i)&&(n[i]=r[i]);if(s)for(var u=s(r),a=0;a<u.length;a++)h.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},y=ke,a="function"==typeof Symbol&&Symbol.for,d=a?Symbol.for("react.element"):60103,v=a?Symbol.for("react.portal"):60106,m=a?Symbol.for("react.fragment"):60107,E=a?Symbol.for("react.strict_mode"):60108,g=a?Symbol.for("react.profiler"):60114,T=a?Symbol.for("react.provider"):60109,b=a?Symbol.for("react.context"):60110,_=a?Symbol.for("react.forward_ref"):60112,R=a?Symbol.for("react.suspense"):60113,w=a?Symbol.for("react.memo"):60115,O=a?Symbol.for("react.lazy"):60116,A="function"==typeof Symbol&&Symbol.iterator;function N(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k={};function C(e,t,r){this.props=e,this.context=t,this.refs=k,this.updater=r||I}function P(){}function x(e,t,r){this.props=e,this.context=t,this.refs=k,this.updater=r||I}C.prototype.isReactComponent={},C.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(N(85));this.updater.enqueueSetState(this,e,t,"setState")},C.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},P.prototype=C.prototype;a=x.prototype=new P;a.constructor=x,y(a,C.prototype),a.isPureReactComponent=!0;var S={current:null},D=Object.prototype.hasOwnProperty,F={key:!0,ref:!0,__self:!0,__source:!0};function M(e,t,r){var n,o={},i=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)D.call(t,n)&&!F.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:d,type:e,key:i,ref:u,props:o,_owner:S.current}}function j(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var L=/\/+/g,U=[];function V(e,t,r,n){if(U.length){var o=U.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function H(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,U.length<10&&U.push(e)}function $(e,t,r){return null==e?0:function e(t,r,n,o){var i=!1;if(null===(t="undefined"==(a=typeof t)||"boolean"===a?null:t))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case d:case v:i=!0}}if(i)return n(o,t,""===r?"."+G(t,0):r),1;if(i=0,r=""===r?".":r+":",Array.isArray(t))for(var u=0;u<t.length;u++){var a,s=r+G(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=A&&t[A]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+G(a,u++),n,o);else if("object"===a)throw n=""+t,Error(N(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function G(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function B(e,t){e.func.call(e.context,t,e.count++)}function K(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?z(e,n,r,function(e){return e}):null!=e&&(j(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(L,"$&/")+"/")+r,e={$$typeof:d,type:o.type,key:r,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function z(e,t,r,n,o){var i="";$(e,K,t=V(t,i=null!=r?(""+r).replace(L,"$&/")+"/":i,n,o)),H(t)}var q={current:null};function Y(){var e=q.current;if(null===e)throw Error(N(321));return e}a={ReactCurrentDispatcher:q,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:S,IsSomeRendererActing:{current:!1},assign:y};u.Children={map:function(e,t,r){if(null==e)return e;var n=[];return z(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;$(e,B,t=V(null,null,t,r)),H(t)},count:function(e){return $(e,function(){return null},null)},toArray:function(e){var t=[];return z(e,t,null,function(e){return e}),t},only:function(e){if(!j(e))throw Error(N(143));return e}},u.Component=C,u.Fragment=m,u.Profiler=g,u.PureComponent=x,u.StrictMode=E,u.Suspense=R,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a,u.cloneElement=function(e,t,r){if(null==e)throw Error(N(267,e));var n=y({},e.props),o=e.key,i=e.ref,u=e._owner;if(null!=t)for(a in void 0!==t.ref&&(i=t.ref,u=S.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)D.call(t,a)&&!F.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==s?s:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];n.children=s}return{$$typeof:d,type:e.type,key:o,ref:i,props:n,_owner:u}},u.createContext=function(e,t){return(e={$$typeof:b,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:T,_context:e},e.Consumer=e},u.createElement=M,u.createFactory=function(e){var t=M.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:_,render:e}},u.isValidElement=j,u.lazy=function(e){return{$$typeof:O,_ctor:e,_status:-1,_result:null}},u.memo=function(e,t){return{$$typeof:w,type:e,compare:void 0===t?null:t}},u.useCallback=function(e,t){return Y().useCallback(e,t)},u.useContext=function(e,t){return Y().useContext(e,t)},u.useDebugValue=function(){},u.useEffect=function(e,t){return Y().useEffect(e,t)},u.useImperativeHandle=function(e,t,r){return Y().useImperativeHandle(e,t,r)},u.useLayoutEffect=function(e,t){return Y().useLayoutEffect(e,t)},u.useMemo=function(e,t){return Y().useMemo(e,t)},u.useReducer=function(e,t,r){return Y().useReducer(e,t,r)},u.useRef=function(e){return Y().useRef(e)},u.useState=function(e){return Y().useState(e)},u.version="16.14.0";var W,X,Z,Ce={},Q=function(){};function J(e,t,r,n,o){if("production"!==production)for(var i in e)if(Z(e,i)){var u;try{if("function"!=typeof e[i]){var a=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw a.name="Invariant Violation",a}u=e[i](t,i,n,r,null,W)}catch(e){u=e}!u||u instanceof Error||Q((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in X)&&(X[u.message]=!0,i=o?o():"",Q("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}"production"!==production&&(W="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",X={},Z=Function.call.bind(Object.prototype.hasOwnProperty),Q=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),J.resetWarningCache=function(){"production"!==production&&(X={})};var Pe=J;"production"!==production&&function(){var y=ke,o=Pe,e="function"==typeof Symbol&&Symbol.for,d=e?Symbol.for("react.element"):60103,v=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,t=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,r=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,g=e?Symbol.for("react.scope"):60119,T="function"==typeof Symbol&&Symbol.iterator,b="@@iterator";function _(e){if(null===e||"object"!=typeof e)return null;e=T&&e[T]||e[b];return"function"==typeof e?e:null}var R={current:null},w={current:null},O=/^(.*)[\\\/]/;var A=1;function N(e){if(null==e)return null;if("number"==typeof e.tag&&S("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case v:return"Portal";case i:return"Profiler";case n:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return"Context.Consumer";case u:return"Context.Provider";case c:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case p:return N(e.type);case m:return N(e.render);case h:r=(r=e)._status===A?r._result:null;if(r)return N(r)}var t,r;return null}var I={},k=null;function C(e){k=e}I.getCurrentStack=null,I.getStackAddendum=function(){var e,t,r,n,o,i="";k&&(n=N(k.type),o=k._owner,i+=(e=n,t=k._source,r=o&&N(o.type),u="",t?(o=(n=t.fileName).replace(O,""),/^index\./.test(o)&&(!(n=n.match(O))||(n=n[1])&&(o=n.replace(O,"")+"/"+o)),u=" (at "+o+":"+t.lineNumber+")"):r&&(u=" (created by "+r+")"),"\n in "+(e||"Unknown")+u));var u=I.getCurrentStack;return u&&(i+=u()||""),i};var P={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:y};function x(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];D("warn",e,r)}function S(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];D("error",e,r)}function D(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=P.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var o=0,i="Warning: "+t.replace(/%s/g,function(){return r[o++]});throw new Error(i)}catch(e){}}y(P,{ReactDebugCurrentFrame:I,ReactComponentTreeHook:{}});var F={};function M(e,t){var r=e.constructor,e=r&&(r.displayName||r.name)||"ReactClass",r=e+"."+t;F[r]||(S("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),F[r]=!0)}var j={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){M(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){M(e,"replaceState")},enqueueSetState:function(e,t,r,n){M(e,"setState")}},L={};function U(e,t,r){this.props=e,this.context=t,this.refs=L,this.updater=r||j}Object.freeze(L),U.prototype.isReactComponent={},U.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},U.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var V,H={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(V in H)H.hasOwnProperty(V)&&function(e,t){Object.defineProperty(U.prototype,e,{get:function(){x("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(V,H[V]);function $(){}function G(e,t,r){this.props=e,this.context=t,this.refs=L,this.updater=r||j}$.prototype=U.prototype;e=G.prototype=new $;e.constructor=G,y(e,U.prototype),e.isPureReactComponent=!0;var B,K,z=Object.prototype.hasOwnProperty,q={key:!0,ref:!0,__self:!0,__source:!0};function Y(e){if(z.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function W(e){if(z.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var X={},Z=function(e,t,r,n,o,i,u){i={$$typeof:d,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function Q(e,t,r){var n,o,i,u={},a=null,s=null,c=null,l=null;if(null!=t)for(n in Y(t)&&(s=t.ref,"string"==typeof(o=t).ref&&w.current&&o.__self&&w.current.stateNode!==o.__self&&(i=N(w.current.type),X[i]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',N(w.current.type),o.ref),X[i]=!0))),W(t)&&(a=""+t.key),c=void 0===t.__self?null:t.__self,l=void 0===t.__source?null:t.__source,t)z.call(t,n)&&!q.hasOwnProperty(n)&&(u[n]=t[n]);var f,p,h,y=arguments.length-2;if(1==y)u.children=r;else if(1<y){for(var d=Array(y),v=0;v<y;v++)d[v]=arguments[v+2];Object.freeze&&Object.freeze(d),u.children=d}if(e&&e.defaultProps){var m=e.defaultProps;for(n in m)void 0===u[n]&&(u[n]=m[n])}function E(){K||(K=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",f))}function g(){B||(B=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",h))}return(a||s)&&(r="function"==typeof e?e.displayName||e.name||"Unknown":e,a&&(p=u,h=r,g.isReactWarning=!0,Object.defineProperty(p,"key",{get:g,configurable:!0})),s&&(p=u,f=r,E.isReactWarning=!0,Object.defineProperty(p,"ref",{get:E,configurable:!0}))),Z(e,a,s,c,l,w.current,u)}function J(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var ee=".",te=":";var re=!1,ne=/\/+/g;function oe(e){return(""+e).replace(ne,"$&/")}var ie=10,ue=[];function ae(e,t,r,n){if(ue.length){var o=ue.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function se(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ue.length<ie&&ue.push(e)}function ce(e,t,r){return null==e?0:function e(t,r,n,o){var i,u=typeof t,a=!1;if(null===(t="undefined"==u||"boolean"==u?null:t))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case d:case v:a=!0}}if(a)return n(o,t,""===r?ee+le(t,0):r),1;var s=0,c=""===r?ee:r+te;if(Array.isArray(t))for(var l=0;l<t.length;l++)s+=e(i=t[l],c+le(i,l),n,o);else if("function"==typeof(r=_(t))){r===t.entries&&(re||x("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),re=!0);for(var f,p=r.call(t),h=0;!(f=p.next()).done;)s+=e(i=f.value,c+le(i,h++),n,o)}else if("object"==u)throw r=" If you meant to render a collection of children, use an array instead."+I.getStackAddendum(),u=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==u?"object with keys {"+Object.keys(t).join(", ")+"}":u)+")."+r);return s}(e,"",t,r)}function le(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function fe(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function pe(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,e=i.call(u,t,e.count++);Array.isArray(e)?he(e,n,r,function(e){return e}):null!=e&&(J(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":oe(e.key)+"/")+r,e=Z(o.type,r,o.ref,o._self,o._source,o._owner,o.props)),n.push(e))}function he(e,t,r,n,o){var i="",o=ae(t,i=null!=r?oe(r)+"/":i,n,o);ce(e,pe,o),se(o)}function ye(e){return"string"==typeof e||"function"==typeof e||e===a||e===t||e===i||e===n||e===l||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===u||e.$$typeof===s||e.$$typeof===c||e.$$typeof===r||e.$$typeof===E||e.$$typeof===g||e.$$typeof===m)}function de(){var e=R.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function ve(){if(w.current){var e=N(w.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var me=!1,Ee={};function ge(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,r=t,(t=ve())||(r="string"==typeof r?r:r.displayName||r.name)&&(t="\n\nCheck the top-level render call using <"+r+">."),Ee[r=t]||(Ee[r]=!0,t="",e&&e._owner&&e._owner!==w.current&&(t=" It was passed a child from "+N(e._owner.type)+"."),C(e),S('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,t),C(null)))}function Te(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];J(n)&&ge(n,t)}else if(J(e))e._store&&(e._store.validated=!0);else if(e){var o=_(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)J(i.value)&&ge(i.value,t)}}function be(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=N(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==c&&t.$$typeof!==p)return;r=t.propTypes}r?(C(e),o(r,e.props,"prop",n,I.getStackAddendum),C(null)):void 0===t.PropTypes||me||(me=!0,S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function _e(e,t,r){var n,o=ye(e);o||(i="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i+=(null==(t=t)||void 0===(t=t.__source)?"":"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".")||ve(),null===e?n="null":Array.isArray(e)?n="array":void 0!==e&&e.$$typeof===d?(n="<"+(N(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,S("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,i));var i=Q.apply(this,arguments);if(null==i)return i;if(o)for(var u=2;u<arguments.length;u++)Te(arguments[u],e);return(e===a?function(e){C(e);for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n);break}}null!==e.ref&&S("Invalid attribute `ref` supplied to `React.Fragment`."),C(null)}:be)(i),i}var Re=!1;try{var we=Object.freeze({}),Oe=new Map([[we,null]]),Ae=new Set([we]);Oe.set(0,0),Ae.add(0)}catch(e){}function Ne(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,i=y({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,l=e._owner;if(null!=t)for(n in Y(t)&&(a=t.ref,l=w.current),W(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)z.call(t,n)&&!q.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var f=arguments.length-2;if(1==f)i.children=r;else if(1<f){for(var p=Array(f),h=0;h<f;h++)p[h]=arguments[h+2];i.children=p}return Z(e.type,u,a,s,c,l,i)}.apply(this,arguments),o=2;o<arguments.length;o++)Te(arguments[o],n.type);return be(n),n}function Ie(e){var t=_e.bind(null,e);return t.type=e,Re||(Re=!0,x("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return x("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}Ae=_e;Ce.Children={map:function(e,t,r){if(null==e)return e;var n=[];return he(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;r=ae(null,null,t,r),ce(e,fe,r),se(r)},count:function(e){return ce(e,function(){return null},null)},toArray:function(e){var t=[];return he(e,t,null,function(e){return e}),t},only:function(e){if(!J(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},Ce.Component=U,Ce.Fragment=a,Ce.Profiler=i,Ce.PureComponent=G,Ce.StrictMode=n,Ce.Suspense=l,Ce.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=P,Ce.cloneElement=Ne,Ce.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&S("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:u,_context:r}),o=!1,e={$$typeof:s,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(e,{Provider:{get:function(){return o||(o=!0,S("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,S("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=e,r._currentRenderer=null,r._currentRenderer2=null,r},Ce.createElement=Ae,Ce.createFactory=Ie,Ce.createRef=function(){var e={current:null};return Object.seal(e),e},Ce.forwardRef=function(e){return null!=e&&e.$$typeof===p?S("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?S("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&S("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||S("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")),{$$typeof:c,render:e}},Ce.isValidElement=J,Ce.lazy=function(e){var t,r,n={$$typeof:h,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){S("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){S("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},Ce.memo=function(e,t){return ye(e)||S("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:p,type:e,compare:void 0===t?null:t}},Ce.useCallback=function(e,t){return de().useCallback(e,t)},Ce.useContext=function(e,t){var r,n=de();return void 0!==t&&S("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?S("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&S("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},Ce.useDebugValue=function(e,t){return de().useDebugValue(e,t)},Ce.useEffect=function(e,t){return de().useEffect(e,t)},Ce.useImperativeHandle=function(e,t,r){return de().useImperativeHandle(e,t,r)},Ce.useLayoutEffect=function(e,t){return de().useLayoutEffect(e,t)},Ce.useMemo=function(e,t){return de().useMemo(e,t)},Ce.useReducer=function(e,t,r){return de().useReducer(e,t,r)},Ce.useRef=function(e){return de().useRef(e)},Ce.useState=function(e){return de().useState(e)},Ce.version="16.14.0"}(),"production"===production?f.exports=u:f.exports=Ce;var ee=f.exports,te=f.exports.createContext({hackle:void 0,user:void 0}),m=te.Consumer,re=te.Provider;var ne,oe,ie,ue,ae,se,ce,le,fe,pe,he,ye,de,ve,me,Ee,ge,Te,be,_e,Re,we,Oe,Ae,Ne,Ie,xe,Se,De,Fe,Me,je,Le,Ue,Ve,He,$e,Ge,Be,Ke,ze,qe,Ye,We,Xe,Ze,Qe,Je,et,tt,rt,nt,ot,it,ut,at,st,ct,lt,ft,pt,ht,yt,dt,vt,mt,Et,gt,Tt={exports:{}};function bt(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function _t(e,t){return e.timestamp==t.timestamp&&e.user.id==t.user.id&&e.user.properties==t.user.properties}g=Tt.exports,E=g,ne={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},R=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?ne.INFO:e},t._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}try{console.log("%c[".concat(e,"] Hackle: ").concat(t),"color: ".concat(r))}catch(e){}},t.logLevel=ne.INFO,t.log={error:function(e){ne.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){ne.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){ne.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){ne.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),oe=function(e,t){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},ie=function(){return(ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ue=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),ae=function(){function t(e,t){this.isOn=e,this.reason=t}return t.on=function(e){return new t(!0,e)},t.off=function(e){return new t(!1,e)},t}(),se=function(){function e(){}return e.SDK_NOT_READY="SDK_NOT_READY",e.EXCEPTION="EXCEPTION",e.INVALID_INPUT="INVALID_INPUT",e.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",e.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",e.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",e.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",e.OVERRIDDEN="OVERRIDDEN",e.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",e.VARIATION_DROPPED="VARIATION_DROPPED",e.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",e.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",e.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",e.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",e.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",e.TARGET_RULE_MATCH="TARGET_RULE_MATCH",e.DEFAULT_RULE="DEFAULT_RULE",e}(),ce=function(){function e(e,t,r,n,o,i,u,a,s,c){this.id=e,this.key=t,this.type=r,this.status=n,this.variations=o,this.overrides=i,this.targetAudiences=u,this.targetRules=a,this.defaultRule=s,this._winnerVariationId=c}return e.prototype._winnerVariationOrNull=function(){if(this._winnerVariationId)return this._getVariationByIdOrNull(this._winnerVariationId)},e.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},e.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},e.prototype._getOverriddenVariation=function(e){e=this.overrides.get(e.id);return e?this._getVariationByIdOrNull(e):void 0},e}(),le=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},fe=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},pe=function(){function e(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}return e.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive},e}(),he=function(e,t){this.id=e,this.key=t},ye=function(e){this.conditions=e},de=function(e,t){this.key=e,this.match=t},ve=function(e,t){this.type=e,this.name=t},me=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},Ee=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},ge=function(e,t){this.target=e,this.action=t},Te=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var u=i.regExp.exec(e);if(u){var t=function(e){var t="function"==typeof Symbol&&u[Symbol.iterator];if(!t)return u;var r,n,o=t.call(u),i=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)i.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(n)throw n.error}}return i}(6);t[0];var r=t[1],n=t[2],o=void 0===n?"0":n,e=t[3],n=void 0===e?"0":e,e=t[4],t=t[5];return new i(new be(parseInt(r,10),parseInt(o,10),parseInt(n,10)),_e.parse(e),_e.parse(t))}},i.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},i.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},i.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},i.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},i.prototype.isLessThan=function(e){return this.compareTo(e)<0},i.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},i.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,i}(),be=function(){function e(e,t,r){this.major=e,this.minor=t,this.patch=r}return e.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch},e}(),_e=function(){function o(e){this.identifiers=e}return o.parse=function(e){return e?new o(e.split(".")):o.EMPTY},o.prototype.isEmpty=function(){return 0===this.identifiers.length},o.prototype.isNotEmpty=function(){return!this.isEmpty()},o.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},o.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=o.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},o.compareIdentifiers=function(e,t){return o.numericIdentifierRegExp.test(e)&&o.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},o.EMPTY=new o([]),o.numericIdentifierRegExp=/^(0|[1-9]\d*)$/,o}(),Re=["MATCH","NOT_MATCH"],we=["STRING","NUMBER","BOOLEAN","VERSION"],Oe=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],Ae=["VARIATION","BUCKET"],Ne=["HACKLE_PROPERTY","USER_PROPERTY"],Ie=function(){function e(){}return e.validate=function(e){if(e){if("object"!=typeof e)return!1;for(var t in e)if(!this.validProperty(t,e[t]))return!1}return!0},e.filteredProperties=function(r){var n=this;return Object.keys(r).filter(function(e){return n.validProperty(e,r[e])}).reduce(function(e,t){return ie(ie({},e),((e={})[t]=n.filteredPropertiesValue(r[t]),e))},{})},e.filteredPropertiesValue=function(e){return"string"==typeof e&&1024<e.length?e.slice(0,1024):e},e.validProperty=function(e,t){return!!e&&"string"==typeof e&&!(128<e.length)&&("string"==typeof t||"boolean"==typeof t||"number"==typeof t&&!isNaN(t)&&isFinite(t))},e}(),xe=function(){function e(e,t,r){this.timestamp=e,this.user=t,this.hackleProperties=r}return e.exposure=function(e,t,r,n){return void 0===n&&(n={}),new Se((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason,n)},e.track=function(e,t,r,n){return void 0===n&&(n={}),new De((new Date).getTime(),r,e,t,n)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),Se=function(a){function e(e,t,r,n,o,i,u){u=a.call(this,e,t,u)||this;return u.experiment=r,u.variationId=n,u.variationKey=o,u.decisionReason=i,u}return bt(e,a),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Ie.filteredProperties(this.user.properties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString(),hackleProperties:Ie.filteredProperties(this.hackleProperties||{})}},e}(xe),De=function(i){function e(e,t,r,n,o){o=i.call(this,e,t,o)||this;return o.eventType=r,o.event=n,o}return bt(e,i),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Ie.filteredProperties(this.user.properties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Ie.filteredProperties(this.event.properties||{}),hackleProperties:Ie.filteredProperties(this.hackleProperties||{})}},e}(xe),Fe=function(){function n(e,t,r){this.variationId=e,this.variationKey=t,this.reason=r}return n.withVariation=function(e,t){return new n(e.id,e.key,t)},n.withKey=function(e,t){return new n(void 0,e,t)},n.of=function(e,t,r){e=e._getVariationByKeyOrNull(t);return e?n.withVariation(e,r):n.withKey(t,r)},n}(),Me=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n,o){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n,o)},e}(),je=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r,n){var o=this;return e.conditions.every(function(e){return o._matches(e,t,r,n)})},e.prototype._matches=function(e,t,r,n){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r,n)},e}(),Le=function(){function e(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}return e.prototype.matches=function(t,e){var r=this.valueMatcherFactory.getMatcher(e.valueType),n=this.operatorMatcherFactory.getMatcher(e.operator),o=e.values.some(function(e){return r.matches(n,t,e)});return this._matches(e.type,o)},e.prototype._matches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}},e}(),Ue=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return e===t},e.prototype.numberMatches=function(e,t){return e===t},e.prototype.stringMatches=function(e,t){return e===t},e.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},e}(),Ve=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.includes(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),He=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.startsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),$e=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.endsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Ge=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},e}(),Be=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<=e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},e}(),Ke=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThan(t)},e}(),ze=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<=t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},e}(),qe=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"IN":return t.IN_MATCHER;case"CONTAINS":return t.CONTAINS_MATCHER;case"STARTS_WITH":return t.STARTS_WITH_MATCHER;case"ENDS_WITH":return t.ENDS_WITH_MATCHER;case"GT":return t.GT_MATCHER;case"GTE":return t.GTE_MATCHER;case"LT":return t.LT_MATCHER;case"LTE":return t.LTE_MATCHER}},t.IN_MATCHER=new Ue,t.CONTAINS_MATCHER=new Ve,t.STARTS_WITH_MATCHER=new He,t.ENDS_WITH_MATCHER=new $e,t.GT_MATCHER=new Ge,t.GTE_MATCHER=new Be,t.LT_MATCHER=new Ke,t.LTE_MATCHER=new ze,t}(),Ye=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),We=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),Xe=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),Ze=function(){function e(){}return e.prototype.matches=function(e,t,r){t=Te.tryParse(t),r=Te.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),Qe=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"STRING":return t.STRING_MATCHER;case"NUMBER":return t.NUMBER_MATCHER;case"BOOLEAN":return t.BOOLEAN_MATCHER;case"VERSION":return t.VERSION_MATCHER}},t.STRING_MATCHER=new Ye,t.NUMBER_MATCHER=new We,t.BOOLEAN_MATCHER=new Xe,t.VERSION_MATCHER=new Ze,t}(),Je=function(){function e(e){this.valueOperatorMatcher=e}return e.prototype.matches=function(e,t,r,n){n=this._resolveProperty(r,n,e.key);return!!n&&this.valueOperatorMatcher.matches(n,e.match)},e.prototype._resolveProperty=function(e,t,r){switch(r.type){case"HACKLE_PROPERTY":return t[r.name];case"USER_PROPERTY":return e.properties&&e.properties[r.name]}},e}(),et=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"USER_PROPERTY":case"HACKLE_PROPERTY":return t.PROPERTY_CONDITION_MATCHER}},t.PROPERTY_CONDITION_MATCHER=new Je(new Le(new Qe,new qe)),t}(),tt=function(){function e(e){this.bucketer=e}return e.prototype.resolveOrNull=function(e,t,r,n){switch(e.type){case"VARIATION":return this._resolveVariation(e,r);case"BUCKET":return this._resolveBucket(e,t,r,n)}},e.prototype._resolveVariation=function(e,t){return t._getVariationByIdOrNull(e.variationId)},e.prototype._resolveBucket=function(e,t,r,n){e=t.getBucketOrNull(e.bucketId),n=this.bucketer.bucketing(e,n);if(n)return r._getVariationByIdOrNull(n.variationId)},e}(),rt={murmurhash3_x86_32:function(e,t,r,n){for(var o,i=3432918353,u=461845907,a=-4&(n=void 0===n?e.length:n),s=t,c=0;c<a;c+=4)o=255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24,o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s=5*((524287&(s^=o=this.mul32(o,u)))<<13|s>>>19)+3864292196|0;switch(o=0,n%4){case 3:o=(255&e.charCodeAt(2+a))<<16;case 2:o|=(255&e.charCodeAt(1+a))<<8;case 1:o|=255&e.charCodeAt(a),o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s^=o=this.mul32(o,u)}return s^=n,s=this.mul32(s^=s>>>16,2246822507),(s=this.mul32(s^=s>>>13,3266489909))^s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},nt=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t.id);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){e=rt.murmurhash3_x86_32(r,e);return Math.abs(e)%Math.abs(t)},e}(),ot=function(){function a(e,t){void 0===t&&(t=void 0),this.flowEvaluator=e=void 0===e?void 0:e,this.nextFlow=t}return a.prototype.evaluate=function(e,t,r,n,o){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,o,this.nextFlow):Fe.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},a.of=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=new a;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.reverse()),u=i.next();!u.done;u=i.next())o=new a(u.value,o)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return o},a}(),it=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){var u=t._getOverriddenVariation(r);if(!u)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return Fe.withVariation(u,se.OVERRIDDEN);case"FEATURE_FLAG":return Fe.withVariation(u,se.INDIVIDUAL_TARGET_MATCH)}},e}(),ut=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){return"DRAFT"===t.status?Fe.of(t,o,se.EXPERIMENT_DRAFT):i.evaluate(e,t,r,n,o)},e}(),at=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if("PAUSED"!==t.status)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return Fe.of(t,o,se.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return Fe.of(t,o,se.FEATURE_FLAG_INACTIVE)}},e}(),st=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if("COMPLETED"!==t.status)return i.evaluate(e,t,r,n,o);o=t._winnerVariationOrNull();if(!o)throw new Error("winner variation [".concat(t.id,"]"));return Fe.withVariation(o,se.EXPERIMENT_COMPLETED)},e}(),ct=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r,n)?i.evaluate(e,t,r,n,o):Fe.of(t,o,se.NOT_IN_EXPERIMENT_TARGET)},e}(),lt=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return r?r.isDropped?Fe.of(t,o,se.VARIATION_DROPPED):Fe.withVariation(r,se.TRAFFIC_ALLOCATED):Fe.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},e}(),ft=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));var u=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r,n);if(!u)return i.evaluate(e,t,r,n,o);r=this.actionResolver.resolveOrNull(u.action,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return Fe.withVariation(r,se.TARGET_RULE_MATCH)},e}(),pt=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return Fe.withVariation(r,se.DEFAULT_RULE)},e}(),ht=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r,n){var o=this;return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return o.targetMatcher.matches(e,t,r,n)})},e}(),yt=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r,n){var o=this;return e.targetRules.find(function(e){return o.targetMatcher.matches(e.target,t,r,n)})},e}(),dt=function(){function e(){var e=new je(new et),t=new tt(new nt);this.abTestFlow=ot.of(new it,new ct(new ht(e)),new ut,new at,new st,new lt(t)),this.featureFlagFlow=ot.of(new ut,new at,new st,new it,new ft(new yt(e),t),new pt(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),vt=R.log,a=function(){function e(e,t,r){this.evaluator=new Me(new dt),this.workspaceFetcher=e,this.eventProcessor=t,this.eventEmitter=r,this.workspaceFetcher.start(),this.eventProcessor.start(),this.readyPromise=this.workspaceFetcher.onReady().then(function(){return{success:!0}},function(){return{success:!1}})}return e.prototype._experiment=function(e,t,r,n){if(!e)return vt.error("experimentKey must not be empty"),ue.of(n,se.INVALID_INPUT);if(!t)return vt.error("user must not be null."),ue.of(n,se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return vt.error("user.id must not be null and must be string type"),ue.of(n,se.INVALID_INPUT);var o=this.workspaceFetcher.get();if(!o)return vt.warn("SDK not ready."),ue.of(n,se.SDK_NOT_READY);e=o.getExperimentOrNull(e);if(!e)return vt.warn("Experiment does not exist."),ue.of(n,se.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(o,e,t,r,n);return this.eventProcessor.process(xe.exposure(e,t,n,r)),ue.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t,r){if(!e)return vt.error("featureKey must not be empty"),ae.off(se.INVALID_INPUT);if(!t)return vt.error("user must not be null."),ae.off(se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return vt.error("user.id must not be null and must be string type"),ae.off(se.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return vt.warn("SDK not ready."),ae.off(se.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return vt.warn("FeatureFlag does not exist."),ae.off(se.FEATURE_FLAG_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r,"A");return this.eventProcessor.process(xe.exposure(e,t,n,r)),"A"===n.variationKey?ae.off(n.reason):ae.on(n.reason)},e.prototype._track=function(e,t,r){var n;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?t?t.id&&"string"==typeof t.id?(n=this.workspaceFetcher.get())?(n=n.getEventTypeOrNull(e.key),this.eventProcessor.process(xe.track(n,e,t,r))):vt.warn("SDK not ready"):vt.error("Id must not be null. or Id must be string type"):vt.error("User must not be null."):vt.warn("Event key must be not null. or event key must be string type."):vt.warn("Event must be event type."):vt.warn("event must not be null.")},e.prototype._onReady=function(e,t){this._onInitialized({timeout:t=void 0===t?3e3:t}).then(function(){return e()})},e.prototype._onInitialized=function(e){var t,r=e.timeout,e=void 0===r?3e3:r;vt.debug("Start HackleClient initializing");var r=new Promise(function(e){t=e}),n=setTimeout(function(){t({success:!1})},e);return this.readyPromise.then(function(){clearTimeout(n),t({success:!0})}),Promise.race([this.readyPromise,r]).then(function(e){return vt.debug("HackleClient onInitialized"),Promise.resolve({success:e.success})})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),mt=function(){function e(e){var t=e.timeout,e=e.callback;this.timeout=Math.max(t,0),this.callback=e}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),Et=function(){function e(e,t,r,n){void 0===r&&(r=1e3),void 0===n&&(n=1e4),this.buffer=[],this.sink=e,this.maxQueueSize=r,this.batchComparator=t,this.timer=new mt({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var e=this.sink(this.buffer,!0);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){this.started&&(0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush())},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e.prototype.close=function(){this.stop()},e}(),u=function(){function n(e,t,r){void 0===t&&(t=1e3),void 0===r&&(r=n.DEFAULT_FLUSH_INTERVAL),this.flushInterval=n.DEFAULT_FLUSH_INTERVAL,this.eventDispatcher=e,this.flushInterval=r,this.queue=new Et(this.drainQueue.bind(this),_t,t,r)}return n.prototype.drainQueue=function(t,r){var n=this;return new Promise(function(e){0!==t.length?r?n.eventDispatcher.dispatchXhrOrBeacon(t,function(){e()}):n.eventDispatcher.dispatch(t,function(){e()}):e()})},n.prototype.process=function(e){this.queue.enqueue(e)},n.prototype.start=function(){return e=this,s=function(){return r=this,n=function(e){return this.queue.start(),[2]},a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!((u=0<(u=a.trys).length&&u[u.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}var r,n,o,i,u,t,a},new(a=(a=u=void 0)||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())});var e,u,a,s},n.prototype.stop=function(){try{this.queue.close()}catch(e){}return Promise.resolve()},n.prototype.close=function(){this.stop()},n.DEFAULT_FLUSH_INTERVAL=1e4,n}(),gt=R.log,g=function(){function c(e,t,r,n){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n}return c.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},c.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},c.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},c.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)||new he(0,e)},c.from=function(e){var t=this,r=c.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=c.associateBy(c.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=c.associateBy(c.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),e=c.associate(e.events,function(e){return[e.key,new he(e.id,e.key)]});return new c(n,o,r,e)},c.toBucket=function(e){return new fe(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new pe(t,r,e)}))},c.toExperimentOrNull=function(e,t){var r=this,n=this.experimentStatusOrNull(t.execution.status),o=t.variations.map(function(e){return new le(e.id,e.key,"DROPPED"===e.status)}),i=c.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),u=c.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e)}),a=c.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e)}),s=this.toTargetActionOrNull(t.execution.defaultRule);return n&&s&&new ce(t.id,t.key,e,n,o,i,u,a,s,t.winnerVariationId)},c.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void gt.debug("Unsupported status [".concat(e,"]"))}},c.toTargetRuleOrNull=function(e){var t=this.toTargetOrNull(e.target),e=this.toTargetActionOrNull(e.action);return t&&e&&new ge(t,e)},c.toTargetActionOrNull=function(e){var t=this.parseOrNull(Ae,e.type);return t&&new Ee(t,e.variationId,e.bucketId)},c.toTargetOrNull=function(e){var t=this,e=c.mapNotUndefined(e.conditions,function(e){return t.toConditionOrNull(e)});return new ye(e)},c.toConditionOrNull=function(e){var t=this.toTargetKeyOrNull(e.key),e=this.toTargetMatchOrNull(e.match);return t&&e&&new de(t,e)},c.toTargetKeyOrNull=function(e){var t=this.parseOrNull(Ne,e.type);return t&&new ve(t,e.name)},c.toTargetMatchOrNull=function(e){var t=this.parseOrNull(Re,e.type),r=this.parseOrNull(Oe,e.operator),n=this.parseOrNull(we,e.valueType);return t&&r&&n&&new me(t,r,n,e.values)},c.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||gt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},c.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},c.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},c.associate=function(e,t){return c.associateTo(e,new Map,t)},c.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},c}(),E.Bucket=fe,E.CoreVersion=be,E.DEFAULT_ON_READY_TIMEOUT=3e3,E.Decision=ue,E.DecisionReason=se,E.DefaultEventQueue=Et,E.Event=xe,E.EventProcessor=u,E.EventType=he,E.Experiment=ce,E.Exposure=Se,E.FeatureFlagDecision=ae,E.HackleInternalClient=a,E.Logger=R,E.MATCH_OPERATORS=Oe,E.MATCH_TYPES=Re,E.MATCH_VALUE_TYPES=we,E.MetaVersion=_e,E.Slot=pe,E.TARGET_ACTION_TYPES=Ae,E.TARGET_KEY_TYPES=Ne,E.Target=ye,E.TargetAction=Ee,E.TargetCondition=de,E.TargetKey=ve,E.TargetMatch=me,E.TargetRule=ge,E.Track=De,E.Variation=le,E.Version=Te,E.Workspace=g,E.logLevels=ne,E.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){xe.isExposure(e)?t.push(e.toDto()):xe.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(E,"__esModule",{value:!0});var Rt=Tt.exports.Logger.log;function wt(e,t){void 0===t&&(t="A");var r=f.exports.useContext(te),n=r.hackle,o=r.user,i=f.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),u=l(f.exports.useState(function(){return n?i():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),t)}),2),a=u[0],s=u[1],c={key:e,user:o},r=l(f.exports.useState(c),2),u=r[0],r=r[1];return Ot(u,c)||(r(c),s(i())),a}function Ot(e,t){var r,n,o;return e.key===t.key&&(null===(r=e.user)||void 0===r?void 0:r.id)===(null===(r=t.user)||void 0===r?void 0:r.id)&&(e=null===(e=e.user)||void 0===e?void 0:e.properties,t=null===(t=t.user)||void 0===t?void 0:t.properties,n=At(e),o=At(t),e=Object.keys(n),t=Object.keys(o),e.length===t.length&&e.every(function(e){return e in o&&n[e]===o[e]}))}function At(e){return"object"==typeof e&&null!==e?e:{}}function Nt(e){var t,r=e.experimentKey,e=e.children,n=wt(r);return e&&"function"==typeof e?e(n):(f.exports.Children.forEach(e,function(e){f.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?f.exports.cloneElement(t,{variation:n}):null)}function It(e){return e.variation,e=e.children,f.exports.createElement(f.exports.Fragment,null,e)}t.HackleContext=te,t.HackleContextConsumer=m,t.HackleContextProvider=re,t.HackleExperiment=Nt,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=e.timeout,o=void 0===n?3e3:n,i=e.children,u={hackle:t,user:r},e=(n=l(f.exports.useState(!1),2))[0],a=n[1],u=(n=l(f.exports.useState(u),2))[0],s=n[1];return f.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),t.onInitialized({timeout:o}).then(function(){a(!0)}),e?ee.createElement(re,{value:u},i):null},t.HackleVariation=It,t.createInstance=function(e,t){return new o(e,t)},t.useFeature=function(e){var t=(s=f.exports.useContext(te)).hackle,r=s.user,n=f.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e,r))||!1},[e,r,t]),o=(a=l(f.exports.useState(function(){return t?n():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),!1)}),2))[0],i=a[1],u={key:e,user:r},a=(s=l(f.exports.useState(u),2))[0],s=s[1];return Ot(a,u)||(s(u),i(n())),o},t.useFeatureFlagDetail=function(e){var t=(s=f.exports.useContext(te)).hackle,r=s.user,n=f.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||Tt.exports.FeatureFlagDecision.off(Tt.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(a=l(f.exports.useState(function(){return t?n():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),Tt.exports.FeatureFlagDecision.off(Tt.exports.DecisionReason.EXCEPTION))}),2))[0],i=a[1],u={key:e,user:r},a=(s=l(f.exports.useState(u),2))[0],s=s[1];return Ot(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=f.exports.useContext(te),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),function(){})},t.useVariation=wt,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(c=f.exports.useContext(te)).hackle,n=c.user,o=f.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||Tt.exports.Decision.of(t,Tt.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(s=l(f.exports.useState(function(){return r?o():("undefined"!=typeof window&&Rt.error("HackleClient is not existed"),Tt.exports.Decision.of(t,Tt.exports.DecisionReason.EXCEPTION))}),2))[0],u=s[1],a={key:e,user:n},s=(c=l(f.exports.useState(a),2))[0],c=c[1];return Ot(s,a)||(c(a),u(o())),i},Object.keys(r).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),Object.defineProperty(t,"__esModule",{value:!0})});
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@hackler/js-client-sdk")):"function"==typeof define&&define.amd?define(["exports","@hackler/js-client-sdk"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).hackleReactSDK={},e.Hackle)}(this,function(t,r){"use strict";function e(r){if(r&&r.__esModule)return r;var n=Object.create(null);return r&&Object.keys(r).forEach(function(e){var t;"default"!==e&&(t=Object.getOwnPropertyDescriptor(r,e),Object.defineProperty(n,e,t.get?t:{enumerable:!0,get:function(){return r[e]}}))}),n.default=r,Object.freeze(n)}var n=e(r),c=function(){return(c=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,i=r.call(e),u=[];try{for(;(void 0===t||0<t--)&&!(n=i.next()).done;)u.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return u}var o=(i.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},i.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},i.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},i.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},i.prototype.track=function(e,t){this.client.track(e,t)},i.prototype.trackPageView=function(e){this.client.trackPageView(e)},i.prototype.onReady=function(e,t){this.client.onReady(e,t)},i.prototype.onInitialized=function(e){return this.client.onInitialized(e)},i);function i(e,t){this.client=n.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.3.0"}))}var f={exports:{}},u={},s=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable;var Ce=function(){try{if(!Object.assign)return;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return;for(var t={},r=0;r<10;r++)t["_"+String.fromCharCode(r)]=r;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return;var n={};return"abcdefghijklmnopqrst".split("").forEach(function(e){n[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},n)).join("")?void 0:1}catch(e){return}}()?Object.assign:function(e,t){for(var r,n=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var i in r=Object(arguments[o]))p.call(r,i)&&(n[i]=r[i]);if(s)for(var u=s(r),a=0;a<u.length;a++)h.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},y=Ce,a="function"==typeof Symbol&&Symbol.for,d=a?Symbol.for("react.element"):60103,m=a?Symbol.for("react.portal"):60106,v=a?Symbol.for("react.fragment"):60107,E=a?Symbol.for("react.strict_mode"):60108,T=a?Symbol.for("react.profiler"):60114,g=a?Symbol.for("react.provider"):60109,_=a?Symbol.for("react.context"):60110,b=a?Symbol.for("react.forward_ref"):60112,R=a?Symbol.for("react.suspense"):60113,w=a?Symbol.for("react.memo"):60115,O=a?Symbol.for("react.lazy"):60116,N="function"==typeof Symbol&&Symbol.iterator;function A(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C={};function k(e,t,r){this.props=e,this.context=t,this.refs=C,this.updater=r||I}function S(){}function P(e,t,r){this.props=e,this.context=t,this.refs=C,this.updater=r||I}k.prototype.isReactComponent={},k.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(A(85));this.updater.enqueueSetState(this,e,t,"setState")},k.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},S.prototype=k.prototype;a=P.prototype=new S;a.constructor=P,y(a,k.prototype),a.isPureReactComponent=!0;var x={current:null},M=Object.prototype.hasOwnProperty,D={key:!0,ref:!0,__self:!0,__source:!0};function F(e,t,r){var n,o={},i=null,u=null;if(null!=t)for(n in void 0!==t.ref&&(u=t.ref),void 0!==t.key&&(i=""+t.key),t)M.call(t,n)&&!D.hasOwnProperty(n)&&(o[n]=t[n]);var a=arguments.length-2;if(1===a)o.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];o.children=s}if(e&&e.defaultProps)for(n in a=e.defaultProps)void 0===o[n]&&(o[n]=a[n]);return{$$typeof:d,type:e,key:i,ref:u,props:o,_owner:x.current}}function U(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var j=/\/+/g,L=[];function V(e,t,r,n){if(L.length){var o=L.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function H(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,L.length<10&&L.push(e)}function $(e,t,r){return null==e?0:function e(t,r,n,o){var i=!1;if(null===(t="undefined"==(a=typeof t)||"boolean"===a?null:t))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case d:case m:i=!0}}if(i)return n(o,t,""===r?"."+G(t,0):r),1;if(i=0,r=""===r?".":r+":",Array.isArray(t))for(var u=0;u<t.length;u++){var a,s=r+G(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=N&&t[N]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+G(a,u++),n,o);else if("object"===a)throw n=""+t,Error(A(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function G(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function B(e,t){e.func.call(e.context,t,e.count++)}function K(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?Y(e,n,r,function(e){return e}):null!=e&&(U(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(j,"$&/")+"/")+r,e={$$typeof:d,type:o.type,key:r,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function Y(e,t,r,n,o){var i="";$(e,K,t=V(t,i=null!=r?(""+r).replace(j,"$&/")+"/":i,n,o)),H(t)}var z={current:null};function q(){var e=z.current;if(null===e)throw Error(A(321));return e}a={ReactCurrentDispatcher:z,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:x,IsSomeRendererActing:{current:!1},assign:y};u.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Y(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;$(e,B,t=V(null,null,t,r)),H(t)},count:function(e){return $(e,function(){return null},null)},toArray:function(e){var t=[];return Y(e,t,null,function(e){return e}),t},only:function(e){if(!U(e))throw Error(A(143));return e}},u.Component=k,u.Fragment=v,u.Profiler=T,u.PureComponent=P,u.StrictMode=E,u.Suspense=R,u.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=a,u.cloneElement=function(e,t,r){if(null==e)throw Error(A(267,e));var n=y({},e.props),o=e.key,i=e.ref,u=e._owner;if(null!=t)for(a in void 0!==t.ref&&(i=t.ref,u=x.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)M.call(t,a)&&!D.hasOwnProperty(a)&&(n[a]=(void 0===t[a]&&void 0!==s?s:t)[a]);var a=arguments.length-2;if(1===a)n.children=r;else if(1<a){for(var s=Array(a),c=0;c<a;c++)s[c]=arguments[c+2];n.children=s}return{$$typeof:d,type:e.type,key:o,ref:i,props:n,_owner:u}},u.createContext=function(e,t){return(e={$$typeof:_,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:g,_context:e},e.Consumer=e},u.createElement=F,u.createFactory=function(e){var t=F.bind(null,e);return t.type=e,t},u.createRef=function(){return{current:null}},u.forwardRef=function(e){return{$$typeof:b,render:e}},u.isValidElement=U,u.lazy=function(e){return{$$typeof:O,_ctor:e,_status:-1,_result:null}},u.memo=function(e,t){return{$$typeof:w,type:e,compare:void 0===t?null:t}},u.useCallback=function(e,t){return q().useCallback(e,t)},u.useContext=function(e,t){return q().useContext(e,t)},u.useDebugValue=function(){},u.useEffect=function(e,t){return q().useEffect(e,t)},u.useImperativeHandle=function(e,t,r){return q().useImperativeHandle(e,t,r)},u.useLayoutEffect=function(e,t){return q().useLayoutEffect(e,t)},u.useMemo=function(e,t){return q().useMemo(e,t)},u.useReducer=function(e,t,r){return q().useReducer(e,t,r)},u.useRef=function(e){return q().useRef(e)},u.useState=function(e){return q().useState(e)},u.version="16.14.0";var W,X,Z,ke={},Q=function(){};function J(e,t,r,n,o){if("production"!==production)for(var i in e)if(Z(e,i)){var u;try{if("function"!=typeof e[i]){var a=Error((n||"React class")+": "+r+" type `"+i+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[i]+"`.");throw a.name="Invariant Violation",a}u=e[i](t,i,n,r,null,W)}catch(e){u=e}!u||u instanceof Error||Q((n||"React class")+": type specification of "+r+" `"+i+"` is invalid; the type checker function must return `null` or an `Error` but returned a "+typeof u+". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."),u instanceof Error&&!(u.message in X)&&(X[u.message]=!0,i=o?o():"",Q("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}"production"!==production&&(W="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",X={},Z=Function.call.bind(Object.prototype.hasOwnProperty),Q=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),J.resetWarningCache=function(){"production"!==production&&(X={})};var Se=J;"production"!==production&&function(){var y=Ce,o=Se,e="function"==typeof Symbol&&Symbol.for,d=e?Symbol.for("react.element"):60103,m=e?Symbol.for("react.portal"):60106,a=e?Symbol.for("react.fragment"):60107,n=e?Symbol.for("react.strict_mode"):60108,i=e?Symbol.for("react.profiler"):60114,u=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,t=e?Symbol.for("react.concurrent_mode"):60111,c=e?Symbol.for("react.forward_ref"):60112,l=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,v=e?Symbol.for("react.block"):60121,r=e?Symbol.for("react.fundamental"):60117,E=e?Symbol.for("react.responder"):60118,T=e?Symbol.for("react.scope"):60119,g="function"==typeof Symbol&&Symbol.iterator,_="@@iterator";function b(e){if(null===e||"object"!=typeof e)return null;e=g&&e[g]||e[_];return"function"==typeof e?e:null}var R={current:null},w={current:null},O=/^(.*)[\\\/]/;var N=1;function A(e){if(null==e)return null;if("number"==typeof e.tag&&x("Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case a:return"Fragment";case m:return"Portal";case i:return"Profiler";case n:return"StrictMode";case l:return"Suspense";case f:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return"Context.Consumer";case u:return"Context.Provider";case c:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case p:return A(e.type);case v:return A(e.render);case h:r=(r=e)._status===N?r._result:null;if(r)return A(r)}var t,r;return null}var I={},C=null;function k(e){C=e}I.getCurrentStack=null,I.getStackAddendum=function(){var e,t,r,n,o,i="";C&&(n=A(C.type),o=C._owner,i+=(e=n,t=C._source,r=o&&A(o.type),u="",t?(o=(n=t.fileName).replace(O,""),/^index\./.test(o)&&(!(n=n.match(O))||(n=n[1])&&(o=n.replace(O,"")+"/"+o)),u=" (at "+o+":"+t.lineNumber+")"):r&&(u=" (created by "+r+")"),"\n in "+(e||"Unknown")+u));var u=I.getCurrentStack;return u&&(i+=u()||""),i};var S={ReactCurrentDispatcher:R,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:w,IsSomeRendererActing:{current:!1},assign:y};function P(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];M("warn",e,r)}function x(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];M("error",e,r)}function M(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=S.ReactDebugCurrentFrame.getStackAddendum())&&(t+="%s",r=r.concat([n]));var n=r.map(function(e){return""+e});n.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,n);try{var o=0,i="Warning: "+t.replace(/%s/g,function(){return r[o++]});throw new Error(i)}catch(e){}}y(S,{ReactDebugCurrentFrame:I,ReactComponentTreeHook:{}});var D={};function F(e,t){var r=e.constructor,e=r&&(r.displayName||r.name)||"ReactClass",r=e+"."+t;D[r]||(x("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,e),D[r]=!0)}var U={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){F(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){F(e,"replaceState")},enqueueSetState:function(e,t,r,n){F(e,"setState")}},j={};function L(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||U}Object.freeze(j),L.prototype.isReactComponent={},L.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},L.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var V,H={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]};for(V in H)H.hasOwnProperty(V)&&function(e,t){Object.defineProperty(L.prototype,e,{get:function(){P("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(V,H[V]);function $(){}function G(e,t,r){this.props=e,this.context=t,this.refs=j,this.updater=r||U}$.prototype=L.prototype;e=G.prototype=new $;e.constructor=G,y(e,L.prototype),e.isPureReactComponent=!0;var B,K,Y=Object.prototype.hasOwnProperty,z={key:!0,ref:!0,__self:!0,__source:!0};function q(e){if(Y.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function W(e){if(Y.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var X={},Z=function(e,t,r,n,o,i,u){i={$$typeof:d,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(i._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(i,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(i,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(i.props),Object.freeze(i)),i};function Q(e,t,r){var n,o,i,u={},a=null,s=null,c=null,l=null;if(null!=t)for(n in q(t)&&(s=t.ref,"string"==typeof(o=t).ref&&w.current&&o.__self&&w.current.stateNode!==o.__self&&(i=A(w.current.type),X[i]||(x('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://fb.me/react-strict-mode-string-ref',A(w.current.type),o.ref),X[i]=!0))),W(t)&&(a=""+t.key),c=void 0===t.__self?null:t.__self,l=void 0===t.__source?null:t.__source,t)Y.call(t,n)&&!z.hasOwnProperty(n)&&(u[n]=t[n]);var f,p,h,y=arguments.length-2;if(1==y)u.children=r;else if(1<y){for(var d=Array(y),m=0;m<y;m++)d[m]=arguments[m+2];Object.freeze&&Object.freeze(d),u.children=d}if(e&&e.defaultProps){var v=e.defaultProps;for(n in v)void 0===u[n]&&(u[n]=v[n])}function E(){K||(K=!0,x("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",f))}function T(){B||(B=!0,x("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://fb.me/react-special-props)",h))}return(a||s)&&(r="function"==typeof e?e.displayName||e.name||"Unknown":e,a&&(p=u,h=r,T.isReactWarning=!0,Object.defineProperty(p,"key",{get:T,configurable:!0})),s&&(p=u,f=r,E.isReactWarning=!0,Object.defineProperty(p,"ref",{get:E,configurable:!0}))),Z(e,a,s,c,l,w.current,u)}function J(e){return"object"==typeof e&&null!==e&&e.$$typeof===d}var ee=".",te=":";var re=!1,ne=/\/+/g;function oe(e){return(""+e).replace(ne,"$&/")}var ie=10,ue=[];function ae(e,t,r,n){if(ue.length){var o=ue.pop();return o.result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o}return{result:e,keyPrefix:t,func:r,context:n,count:0}}function se(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ue.length<ie&&ue.push(e)}function ce(e,t,r){return null==e?0:function e(t,r,n,o){var i,u=typeof t,a=!1;if(null===(t="undefined"==u||"boolean"==u?null:t))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case d:case m:a=!0}}if(a)return n(o,t,""===r?ee+le(t,0):r),1;var s=0,c=""===r?ee:r+te;if(Array.isArray(t))for(var l=0;l<t.length;l++)s+=e(i=t[l],c+le(i,l),n,o);else if("function"==typeof(r=b(t))){r===t.entries&&(re||P("Using Maps as children is deprecated and will be removed in a future major release. Consider converting children to an array of keyed ReactElements instead."),re=!0);for(var f,p=r.call(t),h=0;!(f=p.next()).done;)s+=e(i=f.value,c+le(i,h++),n,o)}else if("object"==u)throw r=" If you meant to render a collection of children, use an array instead."+I.getStackAddendum(),u=""+t,Error("Objects are not valid as a React child (found: "+("[object Object]"==u?"object with keys {"+Object.keys(t).join(", ")+"}":u)+")."+r);return s}(e,"",t,r)}function le(e,t){return"object"==typeof e&&null!==e&&null!=e.key?(e=e.key,r={"=":"=0",":":"=2"},"$"+(""+e).replace(/[=:]/g,function(e){return r[e]})):t.toString(36);var r}function fe(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function pe(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,e=i.call(u,t,e.count++);Array.isArray(e)?he(e,n,r,function(e){return e}):null!=e&&(J(e)&&(r=o+(!(o=e).key||t&&t.key===e.key?"":oe(e.key)+"/")+r,e=Z(o.type,r,o.ref,o._self,o._source,o._owner,o.props)),n.push(e))}function he(e,t,r,n,o){var i="",o=ae(t,i=null!=r?oe(r)+"/":i,n,o);ce(e,pe,o),se(o)}function ye(e){return"string"==typeof e||"function"==typeof e||e===a||e===t||e===i||e===n||e===l||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===u||e.$$typeof===s||e.$$typeof===c||e.$$typeof===r||e.$$typeof===E||e.$$typeof===T||e.$$typeof===v)}function de(){var e=R.current;if(null===e)throw Error("Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://fb.me/react-invalid-hook-call for tips about how to debug and fix this problem.");return e}function me(){if(w.current){var e=A(w.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var ve=!1,Ee={};function Te(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,r=t,(t=me())||(r="string"==typeof r?r:r.displayName||r.name)&&(t="\n\nCheck the top-level render call using <"+r+">."),Ee[r=t]||(Ee[r]=!0,t="",e&&e._owner&&e._owner!==w.current&&(t=" It was passed a child from "+A(e._owner.type)+"."),k(e),x('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',r,t),k(null)))}function ge(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];J(n)&&Te(n,t)}else if(J(e))e._store&&(e._store.validated=!0);else if(e){var o=b(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)J(i.value)&&Te(i.value,t)}}function _e(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=A(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==c&&t.$$typeof!==p)return;r=t.propTypes}r?(k(e),o(r,e.props,"prop",n,I.getStackAddendum),k(null)):void 0===t.PropTypes||ve||(ve=!0,x("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||x("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function be(e,t,r){var n,o=ye(e);o||(i="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(i+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i+=(null==(t=t)||void 0===(t=t.__source)?"":"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".")||me(),null===e?n="null":Array.isArray(e)?n="array":void 0!==e&&e.$$typeof===d?(n="<"+(A(e.type)||"Unknown")+" />",i=" Did you accidentally export a JSX literal instead of a component?"):n=typeof e,x("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",n,i));var i=Q.apply(this,arguments);if(null==i)return i;if(o)for(var u=2;u<arguments.length;u++)ge(arguments[u],e);return(e===a?function(e){k(e);for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){x("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n);break}}null!==e.ref&&x("Invalid attribute `ref` supplied to `React.Fragment`."),k(null)}:_e)(i),i}var Re=!1;try{var we=Object.freeze({}),Oe=new Map([[we,null]]),Ne=new Set([we]);Oe.set(0,0),Ne.add(0)}catch(e){}function Ae(e,t,r){for(var n=function(e,t,r){if(null==e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var n,o,i=y({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,l=e._owner;if(null!=t)for(n in q(t)&&(a=t.ref,l=w.current),W(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)Y.call(t,n)&&!z.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var f=arguments.length-2;if(1==f)i.children=r;else if(1<f){for(var p=Array(f),h=0;h<f;h++)p[h]=arguments[h+2];i.children=p}return Z(e.type,u,a,s,c,l,i)}.apply(this,arguments),o=2;o<arguments.length;o++)ge(arguments[o],n.type);return _e(n),n}function Ie(e){var t=be.bind(null,e);return t.type=e,Re||(Re=!0,P("React.createFactory() is deprecated and will be removed in a future major release. Consider using JSX or use React.createElement() directly instead.")),Object.defineProperty(t,"type",{enumerable:!1,get:function(){return P("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}Ne=be;ke.Children={map:function(e,t,r){if(null==e)return e;var n=[];return he(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;r=ae(null,null,t,r),ce(e,fe,r),se(r)},count:function(e){return ce(e,function(){return null},null)},toArray:function(e){var t=[];return he(e,t,null,function(e){return e}),t},only:function(e){if(!J(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},ke.Component=L,ke.Fragment=a,ke.Profiler=i,ke.PureComponent=G,ke.StrictMode=n,ke.Suspense=l,ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=S,ke.cloneElement=Ae,ke.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&x("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:s,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:u,_context:r}),o=!1,e={$$typeof:s,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(e,{Provider:{get:function(){return o||(o=!0,x("Rendering <Context.Consumer.Provider> is not supported and will be removed in a future major release. Did you mean to render <Context.Provider> instead?")),r.Provider},set:function(e){r.Provider=e}},_currentValue:{get:function(){return r._currentValue},set:function(e){r._currentValue=e}},_currentValue2:{get:function(){return r._currentValue2},set:function(e){r._currentValue2=e}},_threadCount:{get:function(){return r._threadCount},set:function(e){r._threadCount=e}},Consumer:{get:function(){return n||(n=!0,x("Rendering <Context.Consumer.Consumer> is not supported and will be removed in a future major release. Did you mean to render <Context.Consumer> instead?")),r.Consumer}}}),r.Consumer=e,r._currentRenderer=null,r._currentRenderer2=null,r},ke.createElement=Ne,ke.createFactory=Ie,ke.createRef=function(){var e={current:null};return Object.seal(e),e},ke.forwardRef=function(e){return null!=e&&e.$$typeof===p?x("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?x("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&x("forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null==e.defaultProps&&null==e.propTypes||x("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?")),{$$typeof:c,render:e}},ke.isValidElement=J,ke.lazy=function(e){var t,r,n={$$typeof:h,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){x("React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),t=e,Object.defineProperty(n,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){x("React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(n,"propTypes",{enumerable:!0})}}}),n},ke.memo=function(e,t){return ye(e)||x("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:p,type:e,compare:void 0===t?null:t}},ke.useCallback=function(e,t){return de().useCallback(e,t)},ke.useContext=function(e,t){var r,n=de();return void 0!==t&&x("useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context&&((r=e._context).Consumer===e?x("Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&x("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},ke.useDebugValue=function(e,t){return de().useDebugValue(e,t)},ke.useEffect=function(e,t){return de().useEffect(e,t)},ke.useImperativeHandle=function(e,t,r){return de().useImperativeHandle(e,t,r)},ke.useLayoutEffect=function(e,t){return de().useLayoutEffect(e,t)},ke.useMemo=function(e,t){return de().useMemo(e,t)},ke.useReducer=function(e,t,r){return de().useReducer(e,t,r)},ke.useRef=function(e){return de().useRef(e)},ke.useState=function(e){return de().useState(e)},ke.version="16.14.0"}(),"production"===production?f.exports=u:f.exports=ke;var ee=f.exports,te=f.exports.createContext({hackle:void 0,user:void 0}),v=te.Consumer,re=te.Provider;var ne,oe,ie,ue,ae,se,ce,le,fe,pe,he,ye,de,me,ve,Ee,Te,ge,_e,be,Re,we,Oe,Ne,Ae,Ie,Pe,xe,Me,De,Fe,Ue,je,Le,Ve,He,$e,Ge,Be,Ke,Ye,ze,qe,We,Xe,Ze,Qe,Je,et,tt,rt,nt,ot,it,ut,at,st,ct,lt,ft,pt,ht,yt,dt,mt,vt,Et,Tt,gt,_t,bt,Rt,wt,Ot,Nt,At={exports:{}};function It(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}oe(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function Ct(e,t){return e.timestamp==t.timestamp&&e.user.id==t.user.id&&e.user.properties==t.user.properties}T=At.exports,E=T,ne={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},R=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?ne.INFO:e},t._log=function(e,t){var r;switch(e){case"WARN":r="orange";break;case"ERROR":r="red";break;default:r="#AAAAAA"}try{console.log("%c[".concat(e,"] Hackle: ").concat(t),"color: ".concat(r))}catch(e){}},t.logLevel=ne.INFO,t.log={error:function(e){ne.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){ne.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){ne.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){ne.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),oe=function(e,t){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)},ie=function(){return(ie=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},ue=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),ae=function(){function t(e,t){this.isOn=e,this.reason=t}return t.on=function(e){return new t(!0,e)},t.off=function(e){return new t(!1,e)},t}(),se=function(){function e(){}return e.SDK_NOT_READY="SDK_NOT_READY",e.EXCEPTION="EXCEPTION",e.INVALID_INPUT="INVALID_INPUT",e.EXPERIMENT_NOT_FOUND="EXPERIMENT_NOT_FOUND",e.EXPERIMENT_DRAFT="EXPERIMENT_DRAFT",e.EXPERIMENT_PAUSED="EXPERIMENT_PAUSED",e.EXPERIMENT_COMPLETED="EXPERIMENT_COMPLETED",e.OVERRIDDEN="OVERRIDDEN",e.TRAFFIC_NOT_ALLOCATED="TRAFFIC_NOT_ALLOCATED",e.VARIATION_DROPPED="VARIATION_DROPPED",e.TRAFFIC_ALLOCATED="TRAFFIC_ALLOCATED",e.NOT_IN_EXPERIMENT_TARGET="NOT_IN_EXPERIMENT_TARGET",e.FEATURE_FLAG_NOT_FOUND="FEATURE_FLAG_NOT_FOUND",e.FEATURE_FLAG_INACTIVE="FEATURE_FLAG_INACTIVE",e.INDIVIDUAL_TARGET_MATCH="INDIVIDUAL_TARGET_MATCH",e.TARGET_RULE_MATCH="TARGET_RULE_MATCH",e.DEFAULT_RULE="DEFAULT_RULE",e}(),ce=function(){function e(e,t,r,n,o,i,u,a,s,c,l){this.id=e,this.key=t,this.type=r,this.status=n,this.variations=o,this.userOverrides=i,this.segmentOverrides=u,this.targetAudiences=a,this.targetRules=s,this.defaultRule=c,this._winnerVariationId=l}return e.prototype._winnerVariationOrNull=function(){if(this._winnerVariationId)return this._getVariationByIdOrNull(this._winnerVariationId)},e.prototype._getVariationByIdOrNull=function(t){return this.variations.find(function(e){return e.id===t})},e.prototype._getVariationByKeyOrNull=function(t){return this.variations.find(function(e){return e.key===t})},e}(),le=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},fe=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},pe=function(){function e(e,t,r){this.startInclusive=e,this.endExclusive=t,this.variationId=r}return e.prototype.contains=function(e){return this.startInclusive<=e&&e<this.endExclusive},e}(),he=function(e,t){this.id=e,this.key=t},ye=function(e){this.conditions=e},de=function(e,t){this.key=e,this.match=t},me=function(e,t){this.type=e,this.name=t},ve=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},Ee=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},Te=function(e,t){this.target=e,this.action=t},ge=function(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n},_e=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var u=i.regExp.exec(e);if(u){var t=function(e){var t="function"==typeof Symbol&&u[Symbol.iterator];if(!t)return u;var r,n,o=t.call(u),i=[];try{for(;(void 0===e||0<e--)&&!(r=o.next()).done;)i.push(r.value)}catch(e){n={error:e}}finally{try{r&&!r.done&&(t=o.return)&&t.call(o)}finally{if(n)throw n.error}}return i}(6);t[0];var r=t[1],n=t[2],o=void 0===n?"0":n,e=t[3],n=void 0===e?"0":e,e=t[4],t=t[5];return new i(new be(parseInt(r,10),parseInt(o,10),parseInt(n,10)),Re.parse(e),Re.parse(t))}},i.prototype.compareTo=function(e){return this.coreVersion.compareTo(e.coreVersion)||this.prerelease.compareTo(e.prerelease)},i.prototype.isEqualTo=function(e){return 0===this.compareTo(e)},i.prototype.isGreaterThan=function(e){return 0<this.compareTo(e)},i.prototype.isGreaterThanOrEqualTo=function(e){return 0<=this.compareTo(e)},i.prototype.isLessThan=function(e){return this.compareTo(e)<0},i.prototype.isLessThanOrEqualTo=function(e){return this.compareTo(e)<=0},i.regExp=/^(0|[1-9]\d*)(?:\.(0|[1-9]\d*))?(?:\.(0|[1-9]\d*))?(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,i}(),be=function(){function e(e,t,r){this.major=e,this.minor=t,this.patch=r}return e.prototype.compareTo=function(e){return this.major-e.major||this.minor-e.minor||this.patch-e.patch},e}(),Re=function(){function o(e){this.identifiers=e}return o.parse=function(e){return e?new o(e.split(".")):o.EMPTY},o.prototype.isEmpty=function(){return 0===this.identifiers.length},o.prototype.isNotEmpty=function(){return!this.isEmpty()},o.prototype.compareTo=function(e){return this.isEmpty()&&e.isEmpty()?0:this.isEmpty()&&e.isNotEmpty()?1:this.isNotEmpty()&&e.isEmpty()?-1:this.compareIdentifiers(e)},o.prototype.compareIdentifiers=function(e){for(var t=Math.min(this.identifiers.length,e.identifiers.length),r=0;r<t;r++){var n=o.compareIdentifiers(this.identifiers[r],e.identifiers[r]);if(0!==n)return n}return this.identifiers.length-e.identifiers.length},o.compareIdentifiers=function(e,t){return o.numericIdentifierRegExp.test(e)&&o.numericIdentifierRegExp.test(t)?+e-+t:e===t?0:e<t?-1:1},o.EMPTY=new o([]),o.numericIdentifierRegExp=/^(0|[1-9]\d*)$/,o}(),we=["MATCH","NOT_MATCH"],Oe=["STRING","NUMBER","BOOLEAN","VERSION"],Ne=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],Ae=["VARIATION","BUCKET"],Ie=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT"],Pe=["USER_ID","USER_PROPERTY"],xe=function(){function e(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.supportedKeyTypes=e}return e.prototype.supports=function(e){return this.supportedKeyTypes.includes(e)},e.IDENTIFIER=new e("SEGMENT"),e.PROPERTY=new e("SEGMENT","USER_PROPERTY","HACKLE_PROPERTY"),e.SEGMENT=new e("USER_ID","USER_PROPERTY","HACKLE_PROPERTY"),e}(),Me=function(){function e(){}return e.validate=function(e){if(e){if("object"!=typeof e)return!1;for(var t in e)if(!this.validProperty(t,e[t]))return!1}return!0},e.filteredProperties=function(r){var n=this;return Object.keys(r).filter(function(e){return n.validProperty(e,r[e])}).reduce(function(e,t){return ie(ie({},e),((e={})[t]=n.filteredPropertiesValue(r[t]),e))},{})},e.filteredPropertiesValue=function(e){return"string"==typeof e&&1024<e.length?e.slice(0,1024):e},e.validProperty=function(e,t){return!!e&&"string"==typeof e&&!(128<e.length)&&("string"==typeof t||"boolean"==typeof t||"number"==typeof t&&!isNaN(t)&&isFinite(t))},e}(),De=function(){function e(e,t,r){this.timestamp=e,this.user=t,this.hackleProperties=r}return e.exposure=function(e,t,r,n){return void 0===n&&(n={}),new Fe((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason,n)},e.track=function(e,t,r,n){return void 0===n&&(n={}),new Ue((new Date).getTime(),r,e,t,n)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),Fe=function(a){function e(e,t,r,n,o,i,u){u=a.call(this,e,t,u)||this;return u.experiment=r,u.variationId=n,u.variationKey=o,u.decisionReason=i,u}return It(e,a),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Me.filteredProperties(this.user.properties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString(),hackleProperties:Me.filteredProperties(this.hackleProperties||{})}},e}(De),Ue=function(i){function e(e,t,r,n,o){o=i.call(this,e,t,o)||this;return o.eventType=r,o.event=n,o}return It(e,i),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.id,userProperties:Me.filteredProperties(this.user.properties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:Me.filteredProperties(this.event.properties||{}),hackleProperties:Me.filteredProperties(this.hackleProperties||{})}},e}(De),je=function(){function n(e,t,r){this.variationId=e,this.variationKey=t,this.reason=r}return n.withVariation=function(e,t){return new n(e.id,e.key,t)},n.withKey=function(e,t){return new n(void 0,e,t)},n.of=function(e,t,r){e=e._getVariationByKeyOrNull(t);return e?n.withVariation(e,r):n.withKey(t,r)},n}(),Le=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n,o){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n,o)},e}(),Ve=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r,n){var o=this;return e.conditions.every(function(e){return o._matches(e,t,r,n)})},e.prototype._matches=function(e,t,r,n){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r,n)},e}(),He=function(){function e(e,t){this.valueMatcherFactory=e,this.operatorMatcherFactory=t}return e.prototype.matches=function(t,e){var r=this.valueMatcherFactory.getMatcher(e.valueType),n=this.operatorMatcherFactory.getMatcher(e.operator),o=e.values.some(function(e){return r.matches(n,t,e)});return this._matches(e.type,o)},e.prototype._matches=function(e,t){switch(e){case"MATCH":return t;case"NOT_MATCH":return!t}},e}(),$e=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return e===t},e.prototype.numberMatches=function(e,t){return e===t},e.prototype.stringMatches=function(e,t){return e===t},e.prototype.versionMatches=function(e,t){return e.isEqualTo(t)},e}(),Ge=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.includes(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Be=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.startsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Ke=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return!1},e.prototype.stringMatches=function(e,t){return e.endsWith(t)},e.prototype.versionMatches=function(e,t){return!1},e}(),Ye=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThan(t)},e}(),ze=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return t<=e},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isGreaterThanOrEqualTo(t)},e}(),qe=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThan(t)},e}(),We=function(){function e(){}return e.prototype.booleanMatches=function(e,t){return!1},e.prototype.numberMatches=function(e,t){return e<=t},e.prototype.stringMatches=function(e,t){return!1},e.prototype.versionMatches=function(e,t){return e.isLessThanOrEqualTo(t)},e}(),Xe=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"IN":return t.IN_MATCHER;case"CONTAINS":return t.CONTAINS_MATCHER;case"STARTS_WITH":return t.STARTS_WITH_MATCHER;case"ENDS_WITH":return t.ENDS_WITH_MATCHER;case"GT":return t.GT_MATCHER;case"GTE":return t.GTE_MATCHER;case"LT":return t.LT_MATCHER;case"LTE":return t.LTE_MATCHER}},t.IN_MATCHER=new $e,t.CONTAINS_MATCHER=new Ge,t.STARTS_WITH_MATCHER=new Be,t.ENDS_WITH_MATCHER=new Ke,t.GT_MATCHER=new Ye,t.GTE_MATCHER=new ze,t.LT_MATCHER=new qe,t.LTE_MATCHER=new We,t}(),Ze=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),Qe=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),Je=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),et=function(){function e(){}return e.prototype.matches=function(e,t,r){t=_e.tryParse(t),r=_e.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),tt=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"STRING":return t.STRING_MATCHER;case"NUMBER":return t.NUMBER_MATCHER;case"BOOLEAN":return t.BOOLEAN_MATCHER;case"VERSION":return t.VERSION_MATCHER}},t.STRING_MATCHER=new Ze,t.NUMBER_MATCHER=new Qe,t.BOOLEAN_MATCHER=new Je,t.VERSION_MATCHER=new et,t}(),rt=function(){function e(e,t){this.userValueResolver=e,this.valueOperatorMatcher=t}return e.prototype.matches=function(e,t,r,n){n=this.userValueResolver.resolveOrNull(r,n,e.key);return!!n&&this.valueOperatorMatcher.matches(n,e.match)},e}(),nt=function(){function e(){}return e.prototype.resolveOrNull=function(e,t,r){switch(r.type){case"USER_ID":return e.id;case"USER_PROPERTY":return e.properties&&e.properties[r.name];case"HACKLE_PROPERTY":return t[r.name];case"SEGMENT":throw new Error("Unsupported TargetKeyType [".concat(r.type,"]"))}},e}(),ot=function(){function e(e){this.segmentMatcher=e}return e.prototype.matches=function(e,t,r,n){var o=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var i=e.match.values.some(function(e){return o._matches(e,t,r,n)});switch(e.match.type){case"MATCH":return i;case"NOT_MATCH":return!i}},e.prototype._matches=function(e,t,r,n){if("string"!=typeof e)throw new Error("SegmentKey[".concat(e,"]"));var o=t.getSegmentOrNull(e);if(!o)throw new Error("Segment[".concat(e,"]"));return this.segmentMatcher.matches(o,t,r,n)},e}(),it=function(){function e(e){this.userConditionMatcher=e}return e.prototype.matches=function(e,t,r,n){var o=this;return e.targets.some(function(e){return o._matches(e,t,r,n)})},e.prototype._matches=function(e,t,r,n){var o=this;return e.conditions.every(function(e){return o.userConditionMatcher.matches(e,t,r,n)})},e}(),ut=function(){function t(){}return t.prototype.getMatcher=function(e){switch(e){case"USER_ID":case"USER_PROPERTY":case"HACKLE_PROPERTY":return t.USER_CONDITION_MATCHER;case"SEGMENT":return t.SEGMENT_CONDITION_MATCHER}},t.USER_CONDITION_MATCHER=new rt(new nt,new He(new tt,new Xe)),t.SEGMENT_CONDITION_MATCHER=new ot(new it(t.USER_CONDITION_MATCHER)),t}(),at=function(){function e(e){this.bucketer=e}return e.prototype.resolveOrNull=function(e,t,r,n){switch(e.type){case"VARIATION":return this._resolveVariation(e,r);case"BUCKET":return this._resolveBucket(e,t,r,n)}},e.prototype._resolveVariation=function(e,t){return t._getVariationByIdOrNull(e.variationId)},e.prototype._resolveBucket=function(e,t,r,n){e=t.getBucketOrNull(e.bucketId),n=this.bucketer.bucketing(e,n);if(n)return r._getVariationByIdOrNull(n.variationId)},e}(),st={murmurhash3_x86_32:function(e,t,r,n){for(var o,i=3432918353,u=461845907,a=-4&(n=void 0===n?e.length:n),s=t,c=0;c<a;c+=4)o=255&e.charCodeAt(c)|(255&e.charCodeAt(c+1))<<8|(255&e.charCodeAt(c+2))<<16|(255&e.charCodeAt(c+3))<<24,o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s=5*((524287&(s^=o=this.mul32(o,u)))<<13|s>>>19)+3864292196|0;switch(o=0,n%4){case 3:o=(255&e.charCodeAt(2+a))<<16;case 2:o|=(255&e.charCodeAt(1+a))<<8;case 1:o|=255&e.charCodeAt(a),o=(131071&(o=this.mul32(o,i)))<<15|o>>>17,s^=o=this.mul32(o,u)}return s^=n,s=this.mul32(s^=s>>>16,2246822507),(s=this.mul32(s^=s>>>13,3266489909))^s>>>16},mul32:function(e,t){var r=65535&t;return((t-r)*e|0)+(r*e|0)|0}},ct=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t.id);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){e=st.murmurhash3_x86_32(r,e);return Math.abs(e)%Math.abs(t)},e}(),lt=function(){function a(e,t){void 0===t&&(t=void 0),this.flowEvaluator=e=void 0===e?void 0:e,this.nextFlow=t}return a.prototype.evaluate=function(e,t,r,n,o){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,o,this.nextFlow):je.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},a.of=function(){for(var t,e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var o=new a;try{for(var i=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return{value:(e=e&&n>=e.length?void 0:e)&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(r.reverse()),u=i.next();!u.done;u=i.next())o=new a(u.value,o)}catch(e){t={error:e}}finally{try{u&&!u.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return o},a}(),ft=function(){function e(e){this.overrideResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){var u=this.overrideResolver.resolveOrNull(e,t,r,n);if(!u)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return je.withVariation(u,se.OVERRIDDEN);case"FEATURE_FLAG":return je.withVariation(u,se.INDIVIDUAL_TARGET_MATCH)}},e}(),pt=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){return"DRAFT"===t.status?je.of(t,o,se.EXPERIMENT_DRAFT):i.evaluate(e,t,r,n,o)},e}(),ht=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if("PAUSED"!==t.status)return i.evaluate(e,t,r,n,o);switch(t.type){case"AB_TEST":return je.of(t,o,se.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return je.of(t,o,se.FEATURE_FLAG_INACTIVE)}},e}(),yt=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o,i){if("COMPLETED"!==t.status)return i.evaluate(e,t,r,n,o);o=t._winnerVariationOrNull();if(!o)throw new Error("winner variation [".concat(t.id,"]"));return je.withVariation(o,se.EXPERIMENT_COMPLETED)},e}(),dt=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r,n)?i.evaluate(e,t,r,n,o):je.of(t,o,se.NOT_IN_EXPERIMENT_TARGET)},e}(),mt=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return r?r.isDropped?je.of(t,o,se.VARIATION_DROPPED):je.withVariation(r,se.TRAFFIC_ALLOCATED):je.of(t,o,se.TRAFFIC_NOT_ALLOCATED)},e}(),vt=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));var u=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r,n);if(!u)return i.evaluate(e,t,r,n,o);r=this.actionResolver.resolveOrNull(u.action,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return je.withVariation(r,se.TARGET_RULE_MATCH)},e}(),Et=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o,i){if("RUNNING"!==t.status)throw new Error("experiment status must be RUNNING [".concat(t.id,"]"));if("FEATURE_FLAG"!==t.type)throw new Error("experiment type bust be FEATURE_FLAG [".concat(t.id,"]"));r=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(!r)throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"));return je.withVariation(r,se.DEFAULT_RULE)},e}(),Tt=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r,n){var o=this;return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return o.targetMatcher.matches(e,t,r,n)})},e}(),gt=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r,n){var o=this;return e.targetRules.find(function(e){return o.targetMatcher.matches(e.target,t,r,n)})},e}(),_t=function(){function e(e,t){this.targetMatcher=e,this.actionResolver=t}return e.prototype.resolveOrNull=function(t,e,r,n){var o=this,i=e.userOverrides.get(r.id);if(i)return e._getVariationByIdOrNull(i);i=e.segmentOverrides.find(function(e){return o.targetMatcher.matches(e.target,t,r,n)});return i?this.actionResolver.resolveOrNull(i.action,t,e,r):void 0},e}(),bt=function(){function e(){var e=new Ve(new ut),t=new at(new ct),r=new _t(e,t);this.abTestFlow=lt.of(new ft(r),new dt(new Tt(e)),new pt,new ht,new yt,new mt(t)),this.featureFlagFlow=lt.of(new pt,new ht,new yt,new ft(r),new vt(new gt(e),t),new Et(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),Rt=R.log,a=function(){function e(e,t,r){this.evaluator=new Le(new bt),this.workspaceFetcher=e,this.eventProcessor=t,this.eventEmitter=r,this.workspaceFetcher.start(),this.eventProcessor.start(),this.readyPromise=this.workspaceFetcher.onReady().then(function(){return{success:!0}},function(){return{success:!1}})}return e.prototype._experiment=function(e,t,r,n){if(!e)return Rt.error("experimentKey must not be empty"),ue.of(n,se.INVALID_INPUT);if(!t)return Rt.error("user must not be null."),ue.of(n,se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return Rt.error("user.id must not be null and must be string type"),ue.of(n,se.INVALID_INPUT);var o=this.workspaceFetcher.get();if(!o)return Rt.warn("SDK not ready."),ue.of(n,se.SDK_NOT_READY);e=o.getExperimentOrNull(e);if(!e)return Rt.warn("Experiment does not exist."),ue.of(n,se.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(o,e,t,r,n);return this.eventProcessor.process(De.exposure(e,t,n,r)),ue.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t,r){if(!e)return Rt.error("featureKey must not be empty"),ae.off(se.INVALID_INPUT);if(!t)return Rt.error("user must not be null."),ae.off(se.INVALID_INPUT);if(!t.id||"string"!=typeof t.id)return Rt.error("user.id must not be null and must be string type"),ae.off(se.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return Rt.warn("SDK not ready."),ae.off(se.SDK_NOT_READY);e=n.getFeatureFlagOrNull(e);if(!e)return Rt.warn("FeatureFlag does not exist."),ae.off(se.FEATURE_FLAG_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r,"A");return this.eventProcessor.process(De.exposure(e,t,n,r)),"A"===n.variationKey?ae.off(n.reason):ae.on(n.reason)},e.prototype._track=function(e,t,r){var n;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?t?t.id&&"string"==typeof t.id?(n=this.workspaceFetcher.get())?(n=n.getEventTypeOrNull(e.key),this.eventProcessor.process(De.track(n,e,t,r))):Rt.warn("SDK not ready"):Rt.error("Id must not be null. or Id must be string type"):Rt.error("User must not be null."):Rt.warn("Event key must be not null. or event key must be string type."):Rt.warn("Event must be event type."):Rt.warn("event must not be null.")},e.prototype._onReady=function(e,t){this._onInitialized({timeout:t=void 0===t?3e3:t}).then(function(){return e()})},e.prototype._onInitialized=function(e){var t,r=e.timeout,e=void 0===r?3e3:r;Rt.debug("Start HackleClient initializing");var r=new Promise(function(e){t=e}),n=setTimeout(function(){t({success:!1})},e);return this.readyPromise.then(function(){clearTimeout(n),t({success:!0})}),Promise.race([this.readyPromise,r]).then(function(e){return Rt.debug("HackleClient onInitialized"),Promise.resolve({success:e.success})})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),wt=function(){function e(e){var t=e.timeout,e=e.callback;this.timeout=Math.max(t,0),this.callback=e}return e.prototype.start=function(){this.timeoutId=setTimeout(this.callback,this.timeout)},e.prototype.refresh=function(){this.stop(),this.start()},e.prototype.stop=function(){this.timeoutId&&clearTimeout(this.timeoutId)},e}(),Ot=function(){function e(e,t,r,n){void 0===r&&(r=1e3),void 0===n&&(n=1e4),this.buffer=[],this.sink=e,this.maxQueueSize=r,this.batchComparator=t,this.timer=new wt({callback:this.flush.bind(this),timeout:n}),this.started=!1}return e.prototype.start=function(){this.started=!0},e.prototype.stop=function(){this.started=!1;var e=this.sink(this.buffer,!0);return this.buffer=[],this.timer.stop(),e},e.prototype.enqueue=function(e){this.started&&(0===this.buffer.length&&this.timer.refresh(),this.buffer.push(e),this.buffer.length>=this.maxQueueSize&&this.flush())},e.prototype.flush=function(){this.sink(this.buffer),this.buffer=[],this.timer.stop()},e.prototype.close=function(){this.stop()},e}(),u=function(){function n(e,t,r){void 0===t&&(t=1e3),void 0===r&&(r=n.DEFAULT_FLUSH_INTERVAL),this.flushInterval=n.DEFAULT_FLUSH_INTERVAL,this.eventDispatcher=e,this.flushInterval=r,this.queue=new Ot(this.drainQueue.bind(this),Ct,t,r)}return n.prototype.drainQueue=function(t,r){var n=this;return new Promise(function(e){0!==t.length?r?n.eventDispatcher.dispatchXhrOrBeacon(t,function(){e()}):n.eventDispatcher.dispatch(t,function(){e()}):e()})},n.prototype.process=function(e){this.queue.enqueue(e)},n.prototype.start=function(){return e=this,s=function(){return r=this,n=function(e){return this.queue.start(),[2]},a={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]},t={next:e(0),throw:e(1),return:e(2)},"function"==typeof Symbol&&(t[Symbol.iterator]=function(){return this}),t;function e(t){return function(e){return function(t){if(o)throw new TypeError("Generator is already executing.");for(;a;)try{if(o=1,i&&(u=2&t[0]?i.return:t[0]?i.throw||((u=i.return)&&u.call(i),0):i.next)&&!(u=u.call(i,t[1])).done)return u;switch(i=0,(t=u?[2&t[0],u.value]:t)[0]){case 0:case 1:u=t;break;case 4:return a.label++,{value:t[1],done:!1};case 5:a.label++,i=t[1],t=[0];continue;case 7:t=a.ops.pop(),a.trys.pop();continue;default:if(!((u=0<(u=a.trys).length&&u[u.length-1])||6!==t[0]&&2!==t[0])){a=0;continue}if(3===t[0]&&(!u||t[1]>u[0]&&t[1]<u[3])){a.label=t[1];break}if(6===t[0]&&a.label<u[1]){a.label=u[1],u=t;break}if(u&&a.label<u[2]){a.label=u[2],a.ops.push(t);break}u[2]&&a.ops.pop(),a.trys.pop();continue}t=n.call(r,a)}catch(e){t=[6,e],i=0}finally{o=u=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}([t,e])}}var r,n,o,i,u,t,a},new(a=(a=u=void 0)||Promise)(function(r,t){function n(e){try{i(s.next(e))}catch(e){t(e)}}function o(e){try{i(s.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?r(e.value):((t=e.value)instanceof a?t:new a(function(e){e(t)})).then(n,o)}i((s=s.apply(e,u||[])).next())});var e,u,a,s},n.prototype.stop=function(){try{this.queue.close()}catch(e){}return Promise.resolve()},n.prototype.close=function(){this.stop()},n.DEFAULT_FLUSH_INTERVAL=1e4,n}(),Nt=R.log,T=function(){function l(e,t,r,n,o){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n,this.segments=o}return l.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},l.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},l.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},l.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)||new he(0,e)},l.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},l.from=function(e){var t=this,r=l.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=l.associateBy(l.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=l.associateBy(l.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),i=l.associate(e.events,function(e){return[e.key,new he(e.id,e.key)]}),e=l.associateBy(l.mapNotUndefined(e.segments,function(e){return t.toSegmentOrNull(e)}),function(e){return e.key});return new l(n,o,r,i,e)},l.toBucket=function(e){return new fe(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new pe(t,r,e)}))},l.toExperimentOrNull=function(e,t){var r=this,n=this.experimentStatusOrNull(t.execution.status),o=t.variations.map(function(e){return new le(e.id,e.key,"DROPPED"===e.status)}),i=l.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),u=l.mapNotUndefined(t.execution.segmentOverrides,function(e){return r.toTargetRuleOrNull(e,xe.IDENTIFIER)}),a=l.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e,xe.PROPERTY)}),s=l.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e,xe.PROPERTY)}),c=this.toTargetActionOrNull(t.execution.defaultRule);return n&&c&&new ce(t.id,t.key,e,n,o,i,u,a,s,c,t.winnerVariationId)},l.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void Nt.debug("Unsupported status [".concat(e,"]"))}},l.toTargetRuleOrNull=function(e,t){t=this.toTargetOrNull(e.target,t),e=this.toTargetActionOrNull(e.action);return t&&e&&new Te(t,e)},l.toTargetActionOrNull=function(e){var t=this.parseOrNull(Ae,e.type);return t&&new Ee(t,e.variationId,e.bucketId)},l.toTargetOrNull=function(e,t){var r=this,e=l.mapNotUndefined(e.conditions,function(e){return r.toConditionOrNull(e,t)});return new ye(e)},l.toConditionOrNull=function(e,t){var r=this.toTargetKeyOrNull(e.key);if(r&&t.supports(r.type)){e=this.toTargetMatchOrNull(e.match);return e&&new de(r,e)}},l.toTargetKeyOrNull=function(e){var t=this.parseOrNull(Ie,e.type);return t&&new me(t,e.name)},l.toTargetMatchOrNull=function(e){var t=this.parseOrNull(we,e.type),r=this.parseOrNull(Ne,e.operator),n=this.parseOrNull(Oe,e.valueType);return t&&r&&n&&new ve(t,r,n,e.values)},l.toSegmentOrNull=function(e){var t=this,r=this.parseOrNull(Pe,e.type);return r&&new ge(e.id,e.key,r,this.mapNotUndefined(e.targets,function(e){return t.toTargetOrNull(e,xe.SEGMENT)}))},l.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||Nt.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},l.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},l.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},l.associate=function(e,t){return l.associateTo(e,new Map,t)},l.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},l}(),E.Bucket=fe,E.CoreVersion=be,E.DEFAULT_ON_READY_TIMEOUT=3e3,E.Decision=ue,E.DecisionReason=se,E.DefaultEventQueue=Ot,E.Event=De,E.EventProcessor=u,E.EventType=he,E.Experiment=ce,E.Exposure=Fe,E.FeatureFlagDecision=ae,E.HackleInternalClient=a,E.Logger=R,E.MATCH_OPERATORS=Ne,E.MATCH_TYPES=we,E.MATCH_VALUE_TYPES=Oe,E.MetaVersion=Re,E.SEGMENT_TYPES=Pe,E.Segment=ge,E.Slot=pe,E.TARGET_ACTION_TYPES=Ae,E.TARGET_KEY_TYPES=Ie,E.Target=ye,E.TargetAction=Ee,E.TargetCondition=de,E.TargetKey=me,E.TargetMatch=ve,E.TargetRule=Te,E.TargetingType=xe,E.Track=Ue,E.Variation=le,E.Version=_e,E.Workspace=T,E.logLevels=ne,E.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){De.isExposure(e)?t.push(e.toDto()):De.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(E,"__esModule",{value:!0});var kt=At.exports.Logger.log;function St(e,t){void 0===t&&(t="A");var r=f.exports.useContext(te),n=r.hackle,o=r.user,i=f.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),u=l(f.exports.useState(function(){return n?i():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),t)}),2),a=u[0],s=u[1],c={key:e,user:o},r=l(f.exports.useState(c),2),u=r[0],r=r[1];return Pt(u,c)||(r(c),s(i())),a}function Pt(e,t){var r,n,o;return e.key===t.key&&(null===(r=e.user)||void 0===r?void 0:r.id)===(null===(r=t.user)||void 0===r?void 0:r.id)&&(e=null===(e=e.user)||void 0===e?void 0:e.properties,t=null===(t=t.user)||void 0===t?void 0:t.properties,n=xt(e),o=xt(t),e=Object.keys(n),t=Object.keys(o),e.length===t.length&&e.every(function(e){return e in o&&n[e]===o[e]}))}function xt(e){return"object"==typeof e&&null!==e?e:{}}function Mt(e){var t,r=e.experimentKey,e=e.children,n=St(r);return e&&"function"==typeof e?e(n):(f.exports.Children.forEach(e,function(e){f.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?f.exports.cloneElement(t,{variation:n}):null)}function Dt(e){return e.variation,e=e.children,f.exports.createElement(f.exports.Fragment,null,e)}t.HackleContext=te,t.HackleContextConsumer=v,t.HackleContextProvider=re,t.HackleExperiment=Mt,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=e.timeout,o=void 0===n?3e3:n,i=e.children,u={hackle:t,user:r},e=(n=l(f.exports.useState(!1),2))[0],a=n[1],u=(n=l(f.exports.useState(u),2))[0],s=n[1];return f.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),t.onInitialized({timeout:o}).then(function(){a(!0)}),e?ee.createElement(re,{value:u},i):null},t.HackleVariation=Dt,t.createInstance=function(e,t){return new o(e,t)},t.useFeature=function(e){var t=(s=f.exports.useContext(te)).hackle,r=s.user,n=f.exports.useCallback(function(){return(null==t?void 0:t.isFeatureOn(e,r))||!1},[e,r,t]),o=(a=l(f.exports.useState(function(){return t?n():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),!1)}),2))[0],i=a[1],u={key:e,user:r},a=(s=l(f.exports.useState(u),2))[0],s=s[1];return Pt(a,u)||(s(u),i(n())),o},t.useFeatureFlagDetail=function(e){var t=(s=f.exports.useContext(te)).hackle,r=s.user,n=f.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||At.exports.FeatureFlagDecision.off(At.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(a=l(f.exports.useState(function(){return t?n():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),At.exports.FeatureFlagDecision.off(At.exports.DecisionReason.EXCEPTION))}),2))[0],i=a[1],u={key:e,user:r},a=(s=l(f.exports.useState(u),2))[0],s=s[1];return Pt(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=f.exports.useContext(te),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&kt.error("HackleClient is not existed"),function(){})},t.useVariation=St,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(c=f.exports.useContext(te)).hackle,n=c.user,o=f.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||At.exports.Decision.of(t,At.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(s=l(f.exports.useState(function(){return r?o():("undefined"!=typeof window&&kt.error("HackleClient is not existed"),At.exports.Decision.of(t,At.exports.DecisionReason.EXCEPTION))}),2))[0],u=s[1],a={key:e,user:n},s=(c=l(f.exports.useState(a),2))[0],c=c[1];return Pt(s,a)||(c(a),u(o())),i},Object.keys(r).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})}),Object.defineProperty(t,"__esModule",{value:!0})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hackler/react-sdk",
3
- "version": "3.2.0",
3
+ "version": "3.3.0",
4
4
  "description": "React SDK for Hackle",
5
5
  "author": {
6
6
  "name": "Hackle",
@@ -39,8 +39,8 @@
39
39
  "url": "https://github.com/hackle-io/hackle-javascript-sdk/issues"
40
40
  },
41
41
  "dependencies": {
42
- "@hackler/sdk-core": "3.2.0",
43
- "@hackler/js-client-sdk": "3.2.0"
42
+ "@hackler/sdk-core": "3.3.0",
43
+ "@hackler/js-client-sdk": "3.3.0"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=16.8.0"