@hackler/react-sdk 3.4.2 → 3.4.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../src/Provider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,UAAU,aAAa;IACrB,YAAY,EAAE,oBAAoB,CAAA;IAClC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,OAAc,EAAE,QAAQ,EAAE,EAAE,aAAa,sBAyB7F"}
1
+ {"version":3,"file":"Provider.d.ts","sourceRoot":"","sources":["../src/Provider.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,SAAS,EAAuB,MAAM,OAAO,CAAA;AAC7D,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAA;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAA;AAE/C,UAAU,aAAa;IACrB,YAAY,EAAE,oBAAoB,CAAA;IAClC,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,QAAQ,CAAC,EAAE,SAAS,CAAA;CACrB;AAED,wBAAgB,cAAc,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,OAAc,EAAE,QAAQ,EAAE,EAAE,aAAa,sBA4B7F"}
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.4.2";
2
+ export declare const SDK_VERSION_HEADER = "3.4.3";
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.4.2";
51
+ var SDK_VERSION_HEADER = "3.4.3";
52
52
 
53
53
  var HackleReactSDKClient = /** @class */ (function () {
54
54
  function HackleReactSDKClient(sdkKey, config) {
@@ -104,10 +104,14 @@ function HackleProvider(_a) {
104
104
  return __assign(__assign({}, prevState), { user: user });
105
105
  });
106
106
  }, [user]);
107
- hackleClient.onInitialized({ timeout: timeout })
108
- .then(function () {
109
- setReady(true);
110
- });
107
+ useEffect(function () {
108
+ hackleClient.onInitialized({ timeout: timeout })
109
+ .then(function () {
110
+ setReady(true);
111
+ }, function () {
112
+ setReady(true);
113
+ });
114
+ }, [hackleClient]);
111
115
  return ready ? React__default.createElement(HackleContextProvider, { value: value }, children) : null;
112
116
  }
113
117
 
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.4.2";
77
+ var SDK_VERSION_HEADER = "3.4.3";
78
78
 
79
79
  var HackleReactSDKClient = /** @class */ (function () {
80
80
  function HackleReactSDKClient(sdkKey, config) {
@@ -130,10 +130,14 @@ function HackleProvider(_a) {
130
130
  return __assign(__assign({}, prevState), { user: user });
131
131
  });
132
132
  }, [user]);
133
- hackleClient.onInitialized({ timeout: timeout })
134
- .then(function () {
135
- setReady(true);
136
- });
133
+ React.useEffect(function () {
134
+ hackleClient.onInitialized({ timeout: timeout })
135
+ .then(function () {
136
+ setReady(true);
137
+ }, function () {
138
+ setReady(true);
139
+ });
140
+ }, [hackleClient]);
137
141
  return ready ? React__default["default"].createElement(HackleContextProvider, { value: value }, children) : null;
138
142
  }
139
143
 
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,F){"use strict";function U(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 j=U(F),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 f(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}e.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},e.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},e.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},e.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},e.prototype.track=function(e,t){this.client.track(e,t)},e.prototype.trackPageView=function(e){this.client.trackPageView(e)},e.prototype.onReady=function(e,t){this.client.onReady(e,t)},e.prototype.onInitialized=function(e){return this.client.onInitialized(e)};var L=e;function e(e,t){this.client=j.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.4.2"}))}var l={exports:{}},r={},V=Object.getOwnPropertySymbols,H=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var G=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]))H.call(r,i)&&(n[i]=r[i]);if(V)for(var u=V(r),a=0;a<u.length;a++)$.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},B=G,n="function"==typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,K=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,Y=n?Symbol.for("react.provider"):60109,z=n?Symbol.for("react.context"):60110,q=n?Symbol.for("react.forward_ref"):60112,W=n?Symbol.for("react.suspense"):60113,X=n?Symbol.for("react.memo"):60115,Z=n?Symbol.for("react.lazy"):60116,Q="function"==typeof Symbol&&Symbol.iterator;function h(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 J={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ee={};function a(e,t,r){this.props=e,this.context=t,this.refs=ee,this.updater=r||J}function te(){}function re(e,t,r){this.props=e,this.context=t,this.refs=ee,this.updater=r||J}a.prototype.isReactComponent={},a.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(h(85));this.updater.enqueueSetState(this,e,t,"setState")},a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},te.prototype=a.prototype;var n=re.prototype=new te,ne=(n.constructor=re,B(n,a.prototype),n.isPureReactComponent=!0,{current:null}),oe=Object.prototype.hasOwnProperty,ie={key:!0,ref:!0,__self:!0,__source:!0};function ue(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)oe.call(t,n)&&!ie.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:p,type:e,key:i,ref:u,props:o,_owner:ne.current}}function ae(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var se=/\/+/g,ce=[];function fe(e,t,r,n){var o;return ce.length?((o=ce.pop()).result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o):{result:e,keyPrefix:t,func:r,context:n,count:0}}function le(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ce.length<10&&ce.push(e)}function pe(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?t:null))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case p:case K:i=!0}}if(i)return n(o,t,""===r?"."+he(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+he(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=Q&&t[Q]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+he(a,u++),n,o);else if("object"===a)throw n=""+t,Error(h(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function he(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 ye(e,t){e.func.call(e.context,t,e.count++)}function de(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?me(e,n,r,function(e){return e}):null!=e&&(ae(e)&&(t=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(se,"$&/")+"/")+r,e={$$typeof:p,type:o.type,key:t,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function me(e,t,r,n,o){var i="";pe(e,de,t=fe(t,i=null!=r?(""+r).replace(se,"$&/")+"/":i,n,o)),le(t)}var ve={current:null};function s(){var e=ve.current;if(null===e)throw Error(h(321));return e}var Ee,Te,ge,n={ReactCurrentDispatcher:ve,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:ne,IsSomeRendererActing:{current:!1},assign:B},o=(r.Children={map:function(e,t,r){if(null==e)return e;var n=[];return me(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;pe(e,ye,t=fe(null,null,t,r)),le(t)},count:function(e){return pe(e,function(){return null},null)},toArray:function(e){var t=[];return me(e,t,null,function(e){return e}),t},only:function(e){if(ae(e))return e;throw Error(h(143))}},r.Component=a,r.Fragment=o,r.Profiler=u,r.PureComponent=re,r.StrictMode=i,r.Suspense=W,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n,r.cloneElement=function(e,t,r){if(null==e)throw Error(h(267,e));var n=B({},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=ne.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)oe.call(t,a)&&!ie.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:p,type:e.type,key:o,ref:i,props:n,_owner:u}},r.createContext=function(e,t){return(e={$$typeof:z,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:Y,_context:e},e.Consumer=e},r.createElement=ue,r.createFactory=function(e){var t=ue.bind(null,e);return t.type=e,t},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:q,render:e}},r.isValidElement=ae,r.lazy=function(e){return{$$typeof:Z,_ctor:e,_status:-1,_result:null}},r.memo=function(e,t){return{$$typeof:X,type:e,compare:void 0===t?null:t}},r.useCallback=function(e,t){return s().useCallback(e,t)},r.useContext=function(e,t){return s().useContext(e,t)},r.useDebugValue=function(){},r.useEffect=function(e,t){return s().useEffect(e,t)},r.useImperativeHandle=function(e,t,r){return s().useImperativeHandle(e,t,r)},r.useLayoutEffect=function(e,t){return s().useLayoutEffect(e,t)},r.useMemo=function(e,t){return s().useMemo(e,t)},r.useReducer=function(e,t,r){return s().useReducer(e,t,r)},r.useRef=function(e){return s().useRef(e)},r.useState=function(e){return s().useState(e)},r.version="16.14.0",{}),u=Function.call.bind(Object.prototype.hasOwnProperty),_e=function(){};function be(e,t,r,n,o){if("production"!==production)for(var i in e)if(ge(e,i)){var u,a;try{if("function"!=typeof e[i])throw(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]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",a;u=e[i](t,i,n,r,null,Ee)}catch(e){u=e}!u||u instanceof Error||_e((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 Te)&&(Te[u.message]=!0,i=o?o():"",_e("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}if("production"!==production&&(Ee="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Te={},ge=u,_e=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),be.resetWarningCache=function(){"production"!==production&&(Te={})},"production"!==production){var Re=G,we=be,i="function"==typeof Symbol&&Symbol.for,Oe=i?Symbol.for("react.element"):60103,Ne=i?Symbol.for("react.portal"):60106,Ae=i?Symbol.for("react.fragment"):60107,Ie=i?Symbol.for("react.strict_mode"):60108,Ce=i?Symbol.for("react.profiler"):60114,ke=i?Symbol.for("react.provider"):60109,Se=i?Symbol.for("react.context"):60110,Pe=i?Symbol.for("react.concurrent_mode"):60111,xe=i?Symbol.for("react.forward_ref"):60112,Me=i?Symbol.for("react.suspense"):60113,De=i?Symbol.for("react.suspense_list"):60120,y=i?Symbol.for("react.memo"):60115,Fe=i?Symbol.for("react.lazy"):60116,Ue=i?Symbol.for("react.block"):60121,je=i?Symbol.for("react.fundamental"):60117,Le=i?Symbol.for("react.responder"):60118,Ve=i?Symbol.for("react.scope"):60119,He="function"==typeof Symbol&&Symbol.iterator,$e="@@iterator";function Ge(e){if(null===e||"object"!=typeof e)return null;e=He&&e[He]||e[$e];return"function"==typeof e?e:null}var Be={current:null},T={current:null},Ke=/^(.*)[\\\/]/,Ye=1;function g(e){if(null==e)return null;if("number"==typeof e.tag&&_("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 Ae:return"Fragment";case Ne:return"Portal";case Ce:return"Profiler";case Ie:return"StrictMode";case Me:return"Suspense";case De:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case Se:return"Context.Consumer";case ke:return"Context.Provider";case xe:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case y:return g(e.type);case Ue:return g(e.render);case Fe:r=(t=e)._status===Ye?t._result:null;if(r)return g(r)}var t,r;return null}var d={},m=null;function v(e){m=e}d.getCurrentStack=null,d.getStackAddendum=function(){var e,t,r,n,o,i="",u=(m&&(e=g(m.type),r=m._owner,i+=(e=e,t=m._source,r=r&&g(r.type),o="",t?(n=(u=t.fileName).replace(Ke,""),o=" (at "+(n=/^index\./.test(n)&&(u=u.match(Ke))&&(u=u[1])?u.replace(Ke,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(o=" (created by "+r+")"),"\n in "+(e||"Unknown")+o)),d.getCurrentStack);return u&&(i+=u()||""),i};var ze={ReactCurrentDispatcher:Be,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:T,IsSomeRendererActing:{current:!1},assign:Re};function qe(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];We("warn",e,r)}function _(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];We("error",e,r)}function We(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=ze.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){}}Re(ze,{ReactDebugCurrentFrame:d,ReactComponentTreeHook:{}});var Xe={};function Ze(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;Xe[r]||(_("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),Xe[r]=!0)}var Qe={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){Ze(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){Ze(e,"replaceState")},enqueueSetState:function(e,t,r,n){Ze(e,"setState")}},Je={};function E(e,t,r){this.props=e,this.context=t,this.refs=Je,this.updater=r||Qe}Object.freeze(Je),E.prototype.isReactComponent={},E.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")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var et,tt={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(et in tt)tt.hasOwnProperty(et)&&!function(e,t){Object.defineProperty(E.prototype,e,{get:function(){qe("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(et,tt[et]);function rt(){}function nt(e,t,r){this.props=e,this.context=t,this.refs=Je,this.updater=r||Qe}rt.prototype=E.prototype,(i=nt.prototype=new rt).constructor=nt,Re(i,E.prototype),i.isPureReactComponent=!0;var ot,it,ut=Object.prototype.hasOwnProperty,at={key:!0,ref:!0,__self:!0,__source:!0};function st(e){if(ut.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function ct(e){if(ut.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var ft={},lt=function(e,t,r,n,o,i,u){e={$$typeof:Oe,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(e,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(e,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e};function pt(e,t,r){var n,o={},i=null,u=null,a=null,s=null;if(null!=t)for(n in st(t)&&(u=t.ref,"string"==typeof(c=t).ref&&T.current&&c.__self&&T.current.stateNode!==c.__self&&(l=g(T.current.type),ft[l]||(_('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',g(T.current.type),c.ref),ft[l]=!0))),ct(t)&&(i=""+t.key),a=void 0===t.__self?null:t.__self,s=void 0===t.__source?null:t.__source,t)ut.call(t,n)&&!at.hasOwnProperty(n)&&(o[n]=t[n]);var c,f,l,p,h=arguments.length-2;if(1==h)o.children=r;else if(1<h){for(var y=Array(h),d=0;d<h;d++)y[d]=arguments[d+2];Object.freeze&&Object.freeze(y),o.children=y}if(e&&e.defaultProps){var m=e.defaultProps;for(n in m)void 0===o[n]&&(o[n]=m[n])}function v(){it||(it=!0,_("%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 E(){ot||(ot=!0,_("%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)",p))}return(i||u)&&(c="function"==typeof e?e.displayName||e.name||"Unknown":e,i&&(l=o,p=c,E.isReactWarning=!0,Object.defineProperty(l,"key",{get:E,configurable:!0})),u&&(r=o,f=c,v.isReactWarning=!0,Object.defineProperty(r,"ref",{get:v,configurable:!0}))),lt(e,i,u,a,s,T.current,o)}function b(e){return"object"==typeof e&&null!==e&&e.$$typeof===Oe}var ht=".",yt=":",dt=!1,mt=/\/+/g;function vt(e){return(""+e).replace(mt,"$&/")}var Et=10,Tt=[];function gt(e,t,r,n){var o;return Tt.length?((o=Tt.pop()).result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o):{result:e,keyPrefix:t,func:r,context:n,count:0}}function _t(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,Tt.length<Et&&Tt.push(e)}function bt(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?t:null))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Oe:case Ne:a=!0}}if(a)return n(o,t,""===r?ht+Rt(t,0):r),1;var s=0,c=""===r?ht:r+yt;if(Array.isArray(t))for(var f=0;f<t.length;f++)s+=e(i=t[f],c+Rt(i,f),n,o);else if("function"==typeof(r=Ge(t))){r===t.entries&&(dt||qe("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."),dt=!0);for(var l,p=r.call(t),h=0;!(l=p.next()).done;)s+=e(i=l.value,c+Rt(i,h++),n,o)}else if("object"==u)throw r="",r=" If you meant to render a collection of children, use an array instead."+d.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 Rt(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 wt(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function Ot(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,i=i.call(u,t,e.count++);Array.isArray(i)?Nt(i,n,r,function(e){return e}):null!=i&&(b(i)&&(e=o+(!(u=i).key||t&&t.key===i.key?"":vt(i.key)+"/")+r,i=lt(u.type,e,u.ref,u._self,u._source,u._owner,u.props)),n.push(i))}function Nt(e,t,r,n,o){var i="",t=gt(t,i=null!=r?vt(r)+"/":i,n,o);bt(e,Ot,t),_t(t)}function At(e){return"string"==typeof e||"function"==typeof e||e===Ae||e===Pe||e===Ce||e===Ie||e===Me||e===De||"object"==typeof e&&null!==e&&(e.$$typeof===Fe||e.$$typeof===y||e.$$typeof===ke||e.$$typeof===Se||e.$$typeof===xe||e.$$typeof===je||e.$$typeof===Le||e.$$typeof===Ve||e.$$typeof===Ue)}function R(){var e=Be.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 It(){if(T.current){var e=g(T.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var Ct=!1,kt={};function St(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=It())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),kt[t=r]||(kt[t]=!0,r="",e&&e._owner&&e._owner!==T.current&&(r=" It was passed a child from "+g(e._owner.type)+"."),v(e),_('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',t,r),v(null)))}function Pt(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];b(n)&&St(n,t)}else if(b(e))e._store&&(e._store.validated=!0);else if(e){var o=Ge(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)b(i.value)&&St(i.value,t)}}function xt(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=g(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==xe&&t.$$typeof!==y)return;r=t.propTypes}r?(v(e),we(r,e.props,"prop",n,d.getStackAddendum),v(null)):void 0===t.PropTypes||Ct||(Ct=!0,_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Mt(e,t,r){var n,o=At(e),t=(o||(n="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n+=(null!=(t=t)&&void 0!==(t=t.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"")||It(),null===e?u="null":Array.isArray(e)?u="array":void 0!==e&&e.$$typeof===Oe?(u="<"+(g(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,_("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,n)),pt.apply(this,arguments));if(null==t)return t;if(o)for(var i=2;i<arguments.length;i++)Pt(arguments[i],e);if(e===Ae){var u=t;v(u);for(var a=Object.keys(u.props),s=0;s<a.length;s++){var c=a[s];if("children"!==c&&"key"!==c){_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==u.ref&&_("Invalid attribute `ref` supplied to `React.Fragment`."),v(null)}else xt(t);return t}var Dt=!1;try{var Ft=Object.freeze({}),Ut=new Map([[Ft,null]]),jt=new Set([Ft]);Ut.set(0,0),jt.add(0)}catch(e){}function Lt(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=Re({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=t)for(n in st(t)&&(a=t.ref,f=T.current),ct(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)ut.call(t,n)&&!at.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var l=arguments.length-2;if(1==l)i.children=r;else if(1<l){for(var p=Array(l),h=0;h<l;h++)p[h]=arguments[h+2];i.children=p}return lt(e.type,u,a,s,c,f,i)}.apply(this,arguments),o=2;o<arguments.length;o++)Pt(arguments[o],n.type);return xt(n),n}function Vt(e){var t=Mt.bind(null,e);return t.type=e,Dt||(Dt=!0,qe("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 qe("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}i=Mt,o.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Nt(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=gt(null,null,t,r),bt(e,wt,t),_t(t)},count:function(e){return bt(e,function(){return null},null)},toArray:function(e){var t=[];return Nt(e,t,null,function(e){return e}),t},only:function(e){if(b(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},o.Component=E,o.Fragment=Ae,o.Profiler=Ce,o.PureComponent=nt,o.StrictMode=Ie,o.Suspense=Me,o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ze,o.cloneElement=Lt,o.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&_("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:Se,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:ke,_context:r}),o=!1,t={$$typeof:Se,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return o||(o=!0,_("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,_("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=t,r._currentRenderer=null,r._currentRenderer2=null,r},o.createElement=i,o.createFactory=Vt,o.createRef=function(){var e={current:null};return Object.seal(e),e},o.forwardRef=function(e){return null!=e&&e.$$typeof===y?_("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?_("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&_("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||_("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:xe,render:e}},o.isValidElement=b,o.lazy=function(e){var t,r,n={$$typeof:Fe,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){_("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){_("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},o.memo=function(e,t){return At(e)||_("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:y,type:e,compare:void 0===t?null:t}},o.useCallback=function(e,t){return R().useCallback(e,t)},o.useContext=function(e,t){var r,n=R();return void 0!==t&&_("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?_("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&&_("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},o.useDebugValue=function(e,t){return R().useDebugValue(e,t)},o.useEffect=function(e,t){return R().useEffect(e,t)},o.useImperativeHandle=function(e,t,r){return R().useImperativeHandle(e,t,r)},o.useLayoutEffect=function(e,t){return R().useLayoutEffect(e,t)},o.useMemo=function(e,t){return R().useMemo(e,t)},o.useReducer=function(e,t,r){return R().useReducer(e,t,r)},o.useRef=function(e){return R().useRef(e)},o.useState=function(e){return R().useState(e)},o.version="16.14.0"}"production"===production?l.exports=r:l.exports=o;var Ht=l.exports,w=l.exports.createContext({hackle:void 0,user:void 0}),W=w.Consumer,$t=w.Provider;var O,Gt,Bt,Kt,N,A,I,Yt,zt,qt,Wt,Xt,Zt,Qt,Jt,er,tr,rr,nr,or,ir,ur,ar,sr,cr,fr,lr,pr,hr,C,k,S,yr,dr,P,mr,vr,Er,Tr,gr,_r,br,Rr,wr,Or,Nr,Ar,Ir,Cr,kr,Sr,Pr,xr,Mr,Dr,Fr,Ur,jr,Lr,Vr,Hr,$r,Gr,Br,Kr,Yr,zr,qr,Wr,Xr,Zr,Qr,Jr,x,en,tn,rn,M={exports:{}};function nn(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}Gt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function on(e,t){return e.timestamp==t.timestamp&&e.user.identifiers==t.user.identifiers&&e.user.properties==t.user.properties}n=n=M.exports,O={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},u=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?O.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=O.INFO,t.log={error:function(e){O.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){O.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){O.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){O.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),Gt=function(e,t){return(Gt=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)},Bt=function(){return(Bt=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)},Kt=u.log,N=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),A=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}(),I=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}(),Yt=function(){function e(e,t,r,n,o,i,u,a,s,c,f,l,p){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.status=o,this.version=i,this.variations=u,this.userOverrides=a,this.segmentOverrides=s,this.targetAudiences=c,this.targetRules=f,this.defaultRule=l,this._winnerVariationId=p}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}(),zt=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},qt=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},Wt=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}(),Xt=function(e,t){this.id=e,this.key=t},Zt=function(){function e(){}return e.ID="$id",e.USER="$userId",e.DEVICE="$deviceId",e}(),G=function(){function e(){this.identifiers={}}return e.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},e.prototype.add=function(e,t){return t&&this._isValid(e,t)?this.identifiers[e]=t:Kt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},e.prototype._isValid=function(e,t){return!(!e||"string"!=typeof e||128<e.length||!t||"string"!=typeof t||512<t.length)},e.prototype.build=function(){return this.identifiers},e}(),Qt=function(e){this.conditions=e},Jt=function(e,t){this.key=e,this.match=t},er=function(e,t){this.type=e,this.name=t},tr=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},rr=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},nr=function(e,t){this.target=e,this.action=t},or=function(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n},ir=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var t,r,n,o,u=i.regExp.exec(e);if(u)return(e=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))[0],t=e[1],r=void 0===(r=e[2])?"0":r,n=void 0===(n=e[3])?"0":n,o=e[4],e=e[5],new i(new ur(parseInt(t,10),parseInt(r,10),parseInt(n,10)),ar.parse(o),ar.parse(e))},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}(),ur=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}(),ar=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}(),sr=["MATCH","NOT_MATCH"],cr=["STRING","NUMBER","BOOLEAN","VERSION"],fr=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],lr=["VARIATION","BUCKET"],pr=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT"],hr=["USER_ID","USER_PROPERTY"],C=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}(),k=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 Bt(Bt({},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}(),S=function(){function e(e,t){this.timestamp=e,this.user=t}return e.exposure=function(e,t,r){return new yr((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason)},e.track=function(e,t,r){return new dr((new Date).getTime(),r,e,t)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),yr=function(u){function e(e,t,r,n,o,i){e=u.call(this,e,t)||this;return e.experiment=r,e.variationId=n,e.variationKey=o,e.decisionReason=i,e}return nn(e,u),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.identifiers[Zt.ID],identifiers:this.user.identifiers,userProperties:k.filteredProperties(this.user.properties||{}),hackleProperties:k.filteredProperties(this.user.hackleProperties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,experimentVersion:this.experiment.version,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString()}},e}(S),dr=function(o){function e(e,t,r,n){e=o.call(this,e,t)||this;return e.eventType=r,e.event=n,e}return nn(e,o),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.identifiers[Zt.ID],identifiers:this.user.identifiers,userProperties:k.filteredProperties(this.user.properties||{}),hackleProperties:k.filteredProperties(this.user.hackleProperties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:k.filteredProperties(this.event.properties||{})}},e}(S),P=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}(),mr=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n)},e}(),vr=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r){var n=this;return e.conditions.every(function(e){return n._matches(e,t,r)})},e.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r)},e}(),Er=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}(),Tr=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}(),gr=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}(),_r=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}(),br=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}(),Rr=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}(),wr=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}(),Or=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}(),Nr=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}(),Ar=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 Tr,t.CONTAINS_MATCHER=new gr,t.STARTS_WITH_MATCHER=new _r,t.ENDS_WITH_MATCHER=new br,t.GT_MATCHER=new Rr,t.GTE_MATCHER=new wr,t.LT_MATCHER=new Or,t.LTE_MATCHER=new Nr,t}(),Ir=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),Cr=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),kr=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),Sr=function(){function e(){}return e.prototype.matches=function(e,t,r){t=ir.tryParse(t),r=ir.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),Pr=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 Ir,t.NUMBER_MATCHER=new Cr,t.BOOLEAN_MATCHER=new kr,t.VERSION_MATCHER=new Sr,t}(),xr=function(){function e(e,t){this.userValueResolver=e,this.valueOperatorMatcher=t}return e.prototype.matches=function(e,t,r){r=this.userValueResolver.resolveOrNull(r,e.key);return!!r&&this.valueOperatorMatcher.matches(r,e.match)},e}(),Mr=function(){function e(){}return e.prototype.resolveOrNull=function(e,t){switch(t.type){case"USER_ID":return e.identifiers[t.name];case"USER_PROPERTY":return e.properties[t.name];case"HACKLE_PROPERTY":return e.hackleProperties[t.name];case"SEGMENT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}},e}(),Dr=function(){function e(e){this.segmentMatcher=e}return e.prototype.matches=function(e,t,r){var n=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var o=e.match.values.some(function(e){return n._matches(e,t,r)});switch(e.match.type){case"MATCH":return o;case"NOT_MATCH":return!o}},e.prototype._matches=function(e,t,r){if("string"!=typeof e)throw new Error("SegmentKey[".concat(e,"]"));var n=t.getSegmentOrNull(e);if(n)return this.segmentMatcher.matches(n,t,r);throw new Error("Segment[".concat(e,"]"))},e}(),Fr=function(){function e(e){this.userConditionMatcher=e}return e.prototype.matches=function(e,t,r){var n=this;return e.targets.some(function(e){return n._matches(e,t,r)})},e.prototype._matches=function(e,t,r){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(e,t,r)})},e}(),Ur=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 xr(new Mr,new Er(new Pr,new Ar)),t.SEGMENT_CONDITION_MATCHER=new Dr(new Fr(t.USER_CONDITION_MATCHER)),t}(),jr=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){t=t.getBucketOrNull(e.bucketId),e=n.identifiers[r.identifierType];if(e){n=this.bucketer.bucketing(t,e);if(n)return r._getVariationByIdOrNull(n.variationId)}},e}(),Lr={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=this.mul32(s=(s^=n)^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}},Vr=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){r=Lr.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},e}(),Hr=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){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,this.nextFlow):P.of(t,n,I.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}(),$r=function(){function e(e){this.overrideResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){var i=this.overrideResolver.resolveOrNull(e,t,r);if(!i)return o.evaluate(e,t,r,n);switch(t.type){case"AB_TEST":return P.withVariation(i,I.OVERRIDDEN);case"FEATURE_FLAG":return P.withVariation(i,I.INDIVIDUAL_TARGET_MATCH)}},e}(),Gr=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){return"DRAFT"===t.status?P.of(t,n,I.EXPERIMENT_DRAFT):o.evaluate(e,t,r,n)},e}(),Br=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){if("PAUSED"!==t.status)return o.evaluate(e,t,r,n);switch(t.type){case"AB_TEST":return P.of(t,n,I.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return P.of(t,n,I.FEATURE_FLAG_INACTIVE)}},e}(),Kr=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){if("COMPLETED"!==t.status)return o.evaluate(e,t,r,n);o=t._winnerVariationOrNull();if(o)return P.withVariation(o,I.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(t.id,"]"))},e}(),Yr=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o){if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r)?o.evaluate(e,t,r,n):P.of(t,n,I.NOT_IN_EXPERIMENT_TARGET)},e}(),zr=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){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,"]"));e=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return e?e.isDropped?P.of(t,n,I.VARIATION_DROPPED):P.withVariation(e,I.TRAFFIC_ALLOCATED):P.of(t,n,I.TRAFFIC_NOT_ALLOCATED)},e}(),qr=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o){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,"]"));if(!r.identifiers[t.identifierType])return o.evaluate(e,t,r,n);var i=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r);if(!i)return o.evaluate(e,t,r,n);o=this.actionResolver.resolveOrNull(i.action,e,t,r);if(o)return P.withVariation(o,I.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"))},e}(),Wr=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){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,"]"));if(!r.identifiers[t.identifierType])return P.of(t,n,I.DEFAULT_RULE);n=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(n)return P.withVariation(n,I.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"))},e}(),Xr=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r){var n=this;return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return n.targetMatcher.matches(e,t,r)})},e}(),Zr=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r){var n=this;return e.targetRules.find(function(e){return n.targetMatcher.matches(e.target,t,r)})},e}(),Qr=function(){function e(e,t){this.targetMatcher=e,this.actionResolver=t}return e.prototype.resolveOrNull=function(e,t,r){return this._resolveUserOverride(t,r)||this._resolveSegmentOverride(e,t,r)},e.prototype._resolveUserOverride=function(e,t){t=t.identifiers[e.identifierType];if(t){t=e.userOverrides.get(t);if(t)return e._getVariationByIdOrNull(t)}},e.prototype._resolveSegmentOverride=function(t,e,r){var n=this,o=e.segmentOverrides.find(function(e){return n.targetMatcher.matches(e.target,t,r)});if(o)return this.actionResolver.resolveOrNull(o.action,t,e,r)},e}(),Jr=function(){function e(){var e=new vr(new Ur),t=new jr(new Vr),r=new Qr(e,t);this.abTestFlow=Hr.of(new $r(r),new Yr(new Xr(e)),new Gr,new Br,new Kr,new zr(t)),this.featureFlagFlow=Hr.of(new Gr,new Br,new Kr,new $r(r),new qr(new Zr(e),t),new Wr(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),x=u.log,Ft=function(){function e(e,t,r){this.evaluator=new mr(new Jr),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){if(!e)return x.error("experimentKey must not be empty"),N.of(r,I.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return x.warn("SDK not ready."),N.of(r,I.SDK_NOT_READY);e=n.getExperimentOrNull(e);if(!e)return x.warn("Experiment does not exist."),N.of(r,I.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r);return this.eventProcessor.process(S.exposure(e,t,n)),N.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t){if(!e)return x.error("featureKey must not be empty"),A.off(I.INVALID_INPUT);var r=this.workspaceFetcher.get();if(!r)return x.warn("SDK not ready."),A.off(I.SDK_NOT_READY);e=r.getFeatureFlagOrNull(e);if(!e)return x.warn("FeatureFlag does not exist."),A.off(I.FEATURE_FLAG_NOT_FOUND);r=this.evaluator.evaluate(r,e,t,"A");return this.eventProcessor.process(S.exposure(e,t,r)),"A"===r.variationKey?A.off(r.reason):A.on(r.reason)},e.prototype._track=function(e,t){var r;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?(r=(null==(r=this.workspaceFetcher.get())?void 0:r.getEventTypeOrNull(e.key))||new Xt(0,e.key),this.eventProcessor.process(S.track(r,e,t))):x.warn("Event key must be not null. or event key must be string type."):x.warn("Event must be event type."):x.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,e=e.timeout,e=void 0===e?3e3:e,r=(x.debug("Start HackleClient initializing"),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 x.debug("HackleClient onInitialized"),Promise.resolve({success:e.success})})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),en=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}(),tn=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 en({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}(),Ut=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 tn(this.drainQueue.bind(this),on,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 n=this,o=function(e){return this.queue.start(),[2]},s={label:0,sent:function(){if(1&a[0])throw a[1];return a[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(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((a=0<(a=s.trys).length&&a[a.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}var n,o,i,u,a,t,s},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}(),rn=u.log,jt=function(){function f(e,t,r,n,o){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n,this.segments=o}return f.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},f.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},f.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},f.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},f.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},f.from=function(e){var t=this,r=f.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=f.associateBy(f.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=f.associateBy(f.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),i=f.associate(e.events,function(e){return[e.key,new Xt(e.id,e.key)]}),e=f.associateBy(f.mapNotUndefined(e.segments,function(e){return t.toSegmentOrNull(e)}),function(e){return e.key});return new f(n,o,r,i,e)},f.toBucket=function(e){return new qt(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new Wt(t,r,e)}))},f.toExperimentOrNull=function(e,t){var r=this,n=this.experimentStatusOrNull(t.execution.status),o=t.variations.map(function(e){return new zt(e.id,e.key,"DROPPED"===e.status)}),i=f.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),u=f.mapNotUndefined(t.execution.segmentOverrides,function(e){return r.toTargetRuleOrNull(e,C.IDENTIFIER)}),a=f.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e,C.PROPERTY)}),s=f.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e,C.PROPERTY)}),c=this.toTargetActionOrNull(t.execution.defaultRule);return n&&c&&new Yt(t.id,t.key,e,t.identifierType,n,t.version,o,i,u,a,s,c,t.winnerVariationId)},f.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void rn.debug("Unsupported status [".concat(e,"]"))}},f.toTargetRuleOrNull=function(e,t){t=this.toTargetOrNull(e.target,t),e=this.toTargetActionOrNull(e.action);return t&&e&&new nr(t,e)},f.toTargetActionOrNull=function(e){var t=this.parseOrNull(lr,e.type);return t&&new rr(t,e.variationId,e.bucketId)},f.toTargetOrNull=function(e,t){var r=this,e=f.mapNotUndefined(e.conditions,function(e){return r.toConditionOrNull(e,t)});return new Qt(e)},f.toConditionOrNull=function(e,t){var r=this.toTargetKeyOrNull(e.key);if(r&&t.supports(r.type))return(t=this.toTargetMatchOrNull(e.match))&&new Jt(r,t)},f.toTargetKeyOrNull=function(e){var t=this.parseOrNull(pr,e.type);return t&&new er(t,e.name)},f.toTargetMatchOrNull=function(e){var t=this.parseOrNull(sr,e.type),r=this.parseOrNull(fr,e.operator),n=this.parseOrNull(cr,e.valueType);return t&&r&&n&&new tr(t,r,n,e.values)},f.toSegmentOrNull=function(e){var t=this,r=this.parseOrNull(hr,e.type);return r&&new or(e.id,e.key,r,this.mapNotUndefined(e.targets,function(e){return t.toTargetOrNull(e,C.SEGMENT)}))},f.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||rn.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},f.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},f.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},f.associate=function(e,t){return f.associateTo(e,new Map,t)},f.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},f}(),n.Bucket=qt,n.CoreVersion=ur,n.DEFAULT_ON_READY_TIMEOUT=3e3,n.Decision=N,n.DecisionReason=I,n.DefaultEventQueue=tn,n.Event=S,n.EventProcessor=Ut,n.EventType=Xt,n.Experiment=Yt,n.Exposure=yr,n.FeatureFlagDecision=A,n.HackleInternalClient=Ft,n.IdentifierType=Zt,n.IdentifiersBuilder=G,n.Logger=u,n.MATCH_OPERATORS=fr,n.MATCH_TYPES=sr,n.MATCH_VALUE_TYPES=cr,n.MetaVersion=ar,n.SEGMENT_TYPES=hr,n.Segment=or,n.Slot=Wt,n.TARGET_ACTION_TYPES=lr,n.TARGET_KEY_TYPES=pr,n.Target=Qt,n.TargetAction=rr,n.TargetCondition=Jt,n.TargetKey=er,n.TargetMatch=tr,n.TargetRule=nr,n.TargetingType=C,n.Track=dr,n.Variation=zt,n.Version=ir,n.Workspace=jt,n.logLevels=O,n.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){S.isExposure(e)?t.push(e.toDto()):S.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(n,"__esModule",{value:!0});var D=M.exports.Logger.log;function un(e,t){void 0===t&&(t="A");var r=l.exports.useContext(w),n=r.hackle,o=r.user,i=l.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),r=f(l.exports.useState(function(){return n?i():("undefined"!=typeof window&&D.error("HackleClient is not existed"),t)}),2),u=r[0],r=r[1],a={key:e,user:o},s=f(l.exports.useState(a),2),c=s[0],s=s[1];return sn(c,a)||(s(a),r(i())),u}function an(e){var t=l.exports.useContext(w),r=t.hackle,n=t.user,o=l.exports.useCallback(function(){return(null==r?void 0:r.isFeatureOn(e,n))||!1},[e,n,r]),t=f(l.exports.useState(function(){return r?o():("undefined"!=typeof window&&D.error("HackleClient is not existed"),!1)}),2),i=t[0],t=t[1],u={key:e,user:n},a=f(l.exports.useState(u),2),s=a[0],a=a[1];return sn(s,u)||(a(u),t(o())),i}function sn(e,t){var r,n,o;return e.key===t.key&&(null==(r=e.user)?void 0:r.id)===(null==(r=t.user)?void 0:r.id)&&(e=null==(r=e.user)?void 0:r.properties,t=null==(r=t.user)?void 0:r.properties,n=cn(e),o=cn(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 cn(e){return"object"==typeof e&&null!==e?e:{}}function fn(e){var t,r=e.experimentKey,e=e.children,n=un(r);return e&&"function"==typeof e?e(n):(l.exports.Children.forEach(e,function(e){l.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?l.exports.cloneElement(t,{variation:n}):null)}function ln(e){return e.variation,e=e.children,l.exports.createElement(l.exports.Fragment,null,e)}function pn(e){var t=an(e.featureKey);return Ht.createElement(Ht.Fragment,null,e.children(t))}t.HackleContext=w,t.HackleContextConsumer=W,t.HackleContextProvider=$t,t.HackleExperiment=fn,t.HackleFeature=pn,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=void 0===(n=e.timeout)?3e3:n,e=e.children,o={hackle:t,user:r},i=f(l.exports.useState(!1),2),u=i[0],a=i[1],o=(i=f(l.exports.useState(o),2))[0],s=i[1];return l.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),t.onInitialized({timeout:n}).then(function(){a(!0)}),u?Ht.createElement($t,{value:o},e):null},t.HackleVariation=ln,t.createInstance=function(e,t){return new L(e,t)},t.useFeature=an,t.useFeatureFlagDetail=function(e){var t=(i=l.exports.useContext(w)).hackle,r=i.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||M.exports.FeatureFlagDecision.off(M.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(i=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&D.error("HackleClient is not existed"),M.exports.FeatureFlagDecision.off(M.exports.DecisionReason.EXCEPTION))}),2))[0],i=i[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return sn(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=l.exports.useContext(w),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&D.error("HackleClient is not existed"),function(){})},t.useVariation=un,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(u=l.exports.useContext(w)).hackle,n=u.user,o=l.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||M.exports.Decision.of(t,M.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(u=f(l.exports.useState(function(){return r?o():("undefined"!=typeof window&&D.error("HackleClient is not existed"),M.exports.Decision.of(t,M.exports.DecisionReason.EXCEPTION))}),2))[0],u=u[1],a={key:e,user:n},s=(c=f(l.exports.useState(a),2))[0],c=c[1];return sn(s,a)||(c(a),u(o())),i},Object.keys(F).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return F[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,F){"use strict";function U(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 j=U(F),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 f(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}e.prototype.variation=function(e,t,r){return this.client.variation(e,t,r)},e.prototype.variationDetail=function(e,t,r){return this.client.variationDetail(e,t,r)},e.prototype.isFeatureOn=function(e,t){return this.client.isFeatureOn(e,t)},e.prototype.featureFlagDetail=function(e,t){return this.client.featureFlagDetail(e,t)},e.prototype.track=function(e,t){this.client.track(e,t)},e.prototype.trackPageView=function(e){this.client.trackPageView(e)},e.prototype.onReady=function(e,t){this.client.onReady(e,t)},e.prototype.onInitialized=function(e){return this.client.onInitialized(e)};var L=e;function e(e,t){this.client=j.createInstance(e,c(c({},t),{SDK_NAME_HEADER:"react-sdk",SDK_VERSION_HEADER:"3.4.3"}))}var l={exports:{}},r={},H=Object.getOwnPropertySymbols,V=Object.prototype.hasOwnProperty,$=Object.prototype.propertyIsEnumerable;var G=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]))V.call(r,i)&&(n[i]=r[i]);if(H)for(var u=H(r),a=0;a<u.length;a++)$.call(r,u[a])&&(n[u[a]]=r[u[a]])}return n},B=G,n="function"==typeof Symbol&&Symbol.for,p=n?Symbol.for("react.element"):60103,K=n?Symbol.for("react.portal"):60106,o=n?Symbol.for("react.fragment"):60107,i=n?Symbol.for("react.strict_mode"):60108,u=n?Symbol.for("react.profiler"):60114,Y=n?Symbol.for("react.provider"):60109,z=n?Symbol.for("react.context"):60110,q=n?Symbol.for("react.forward_ref"):60112,W=n?Symbol.for("react.suspense"):60113,X=n?Symbol.for("react.memo"):60115,Z=n?Symbol.for("react.lazy"):60116,Q="function"==typeof Symbol&&Symbol.iterator;function h(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 J={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},ee={};function a(e,t,r){this.props=e,this.context=t,this.refs=ee,this.updater=r||J}function te(){}function re(e,t,r){this.props=e,this.context=t,this.refs=ee,this.updater=r||J}a.prototype.isReactComponent={},a.prototype.setState=function(e,t){if("object"!=typeof e&&"function"!=typeof e&&null!=e)throw Error(h(85));this.updater.enqueueSetState(this,e,t,"setState")},a.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},te.prototype=a.prototype;var n=re.prototype=new te,ne=(n.constructor=re,B(n,a.prototype),n.isPureReactComponent=!0,{current:null}),oe=Object.prototype.hasOwnProperty,ie={key:!0,ref:!0,__self:!0,__source:!0};function ue(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)oe.call(t,n)&&!ie.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:p,type:e,key:i,ref:u,props:o,_owner:ne.current}}function ae(e){return"object"==typeof e&&null!==e&&e.$$typeof===p}var se=/\/+/g,ce=[];function fe(e,t,r,n){var o;return ce.length?((o=ce.pop()).result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o):{result:e,keyPrefix:t,func:r,context:n,count:0}}function le(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,ce.length<10&&ce.push(e)}function pe(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?t:null))i=!0;else switch(a){case"string":case"number":i=!0;break;case"object":switch(t.$$typeof){case p:case K:i=!0}}if(i)return n(o,t,""===r?"."+he(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+he(a=t[u],u);i+=e(a,s,n,o)}else if("function"==typeof(s=null!==t&&"object"==typeof t&&"function"==typeof(s=Q&&t[Q]||t["@@iterator"])?s:null))for(t=s.call(t),u=0;!(a=t.next()).done;)i+=e(a=a.value,s=r+he(a,u++),n,o);else if("object"===a)throw n=""+t,Error(h(31,"[object Object]"===n?"object with keys {"+Object.keys(t).join(", ")+"}":n,""));return i}(e,"",t,r)}function he(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 ye(e,t){e.func.call(e.context,t,e.count++)}function de(e,t,r){var n=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?me(e,n,r,function(e){return e}):null!=e&&(ae(e)&&(t=o+(!(o=e).key||t&&t.key===e.key?"":(""+e.key).replace(se,"$&/")+"/")+r,e={$$typeof:p,type:o.type,key:t,ref:o.ref,props:o.props,_owner:o._owner}),n.push(e))}function me(e,t,r,n,o){var i="";pe(e,de,t=fe(t,i=null!=r?(""+r).replace(se,"$&/")+"/":i,n,o)),le(t)}var ve={current:null};function s(){var e=ve.current;if(null===e)throw Error(h(321));return e}var Ee,Te,ge,n={ReactCurrentDispatcher:ve,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:ne,IsSomeRendererActing:{current:!1},assign:B},o=(r.Children={map:function(e,t,r){if(null==e)return e;var n=[];return me(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;pe(e,ye,t=fe(null,null,t,r)),le(t)},count:function(e){return pe(e,function(){return null},null)},toArray:function(e){var t=[];return me(e,t,null,function(e){return e}),t},only:function(e){if(ae(e))return e;throw Error(h(143))}},r.Component=a,r.Fragment=o,r.Profiler=u,r.PureComponent=re,r.StrictMode=i,r.Suspense=W,r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=n,r.cloneElement=function(e,t,r){if(null==e)throw Error(h(267,e));var n=B({},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=ne.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps&&(s=e.type.defaultProps),t)oe.call(t,a)&&!ie.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:p,type:e.type,key:o,ref:i,props:n,_owner:u}},r.createContext=function(e,t){return(e={$$typeof:z,_calculateChangedBits:t=void 0===t?null:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null}).Provider={$$typeof:Y,_context:e},e.Consumer=e},r.createElement=ue,r.createFactory=function(e){var t=ue.bind(null,e);return t.type=e,t},r.createRef=function(){return{current:null}},r.forwardRef=function(e){return{$$typeof:q,render:e}},r.isValidElement=ae,r.lazy=function(e){return{$$typeof:Z,_ctor:e,_status:-1,_result:null}},r.memo=function(e,t){return{$$typeof:X,type:e,compare:void 0===t?null:t}},r.useCallback=function(e,t){return s().useCallback(e,t)},r.useContext=function(e,t){return s().useContext(e,t)},r.useDebugValue=function(){},r.useEffect=function(e,t){return s().useEffect(e,t)},r.useImperativeHandle=function(e,t,r){return s().useImperativeHandle(e,t,r)},r.useLayoutEffect=function(e,t){return s().useLayoutEffect(e,t)},r.useMemo=function(e,t){return s().useMemo(e,t)},r.useReducer=function(e,t,r){return s().useReducer(e,t,r)},r.useRef=function(e){return s().useRef(e)},r.useState=function(e){return s().useState(e)},r.version="16.14.0",{}),u=Function.call.bind(Object.prototype.hasOwnProperty),_e=function(){};function be(e,t,r,n,o){if("production"!==production)for(var i in e)if(ge(e,i)){var u,a;try{if("function"!=typeof e[i])throw(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]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.")).name="Invariant Violation",a;u=e[i](t,i,n,r,null,Ee)}catch(e){u=e}!u||u instanceof Error||_e((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 Te)&&(Te[u.message]=!0,i=o?o():"",_e("Failed "+r+" type: "+u.message+(null!=i?i:"")))}}if("production"!==production&&(Ee="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",Te={},ge=u,_e=function(e){e="Warning: "+e;"undefined"!=typeof console&&console.error(e);try{throw new Error(e)}catch(e){}}),be.resetWarningCache=function(){"production"!==production&&(Te={})},"production"!==production){var Re=G,we=be,i="function"==typeof Symbol&&Symbol.for,Oe=i?Symbol.for("react.element"):60103,Ne=i?Symbol.for("react.portal"):60106,Ae=i?Symbol.for("react.fragment"):60107,Ie=i?Symbol.for("react.strict_mode"):60108,Ce=i?Symbol.for("react.profiler"):60114,ke=i?Symbol.for("react.provider"):60109,Se=i?Symbol.for("react.context"):60110,Pe=i?Symbol.for("react.concurrent_mode"):60111,xe=i?Symbol.for("react.forward_ref"):60112,Me=i?Symbol.for("react.suspense"):60113,De=i?Symbol.for("react.suspense_list"):60120,y=i?Symbol.for("react.memo"):60115,Fe=i?Symbol.for("react.lazy"):60116,Ue=i?Symbol.for("react.block"):60121,je=i?Symbol.for("react.fundamental"):60117,Le=i?Symbol.for("react.responder"):60118,He=i?Symbol.for("react.scope"):60119,Ve="function"==typeof Symbol&&Symbol.iterator,$e="@@iterator";function Ge(e){if(null===e||"object"!=typeof e)return null;e=Ve&&e[Ve]||e[$e];return"function"==typeof e?e:null}var Be={current:null},T={current:null},Ke=/^(.*)[\\\/]/,Ye=1;function g(e){if(null==e)return null;if("number"==typeof e.tag&&_("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 Ae:return"Fragment";case Ne:return"Portal";case Ce:return"Profiler";case Ie:return"StrictMode";case Me:return"Suspense";case De:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case Se:return"Context.Consumer";case ke:return"Context.Provider";case xe:return t=e.render,r="ForwardRef",t=t.displayName||t.name||"",e.displayName||(""!==t?r+"("+t+")":r);case y:return g(e.type);case Ue:return g(e.render);case Fe:r=(t=e)._status===Ye?t._result:null;if(r)return g(r)}var t,r;return null}var d={},m=null;function v(e){m=e}d.getCurrentStack=null,d.getStackAddendum=function(){var e,t,r,n,o,i="",u=(m&&(e=g(m.type),r=m._owner,i+=(e=e,t=m._source,r=r&&g(r.type),o="",t?(n=(u=t.fileName).replace(Ke,""),o=" (at "+(n=/^index\./.test(n)&&(u=u.match(Ke))&&(u=u[1])?u.replace(Ke,"")+"/"+n:n)+":"+t.lineNumber+")"):r&&(o=" (created by "+r+")"),"\n in "+(e||"Unknown")+o)),d.getCurrentStack);return u&&(i+=u()||""),i};var ze={ReactCurrentDispatcher:Be,ReactCurrentBatchConfig:{suspense:null},ReactCurrentOwner:T,IsSomeRendererActing:{current:!1},assign:Re};function qe(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];We("warn",e,r)}function _(e){for(var t=arguments.length,r=new Array(1<t?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];We("error",e,r)}function We(e,t,r){0<r.length&&"string"==typeof r[r.length-1]&&0===r[r.length-1].indexOf("\n in")||""!==(n=ze.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){}}Re(ze,{ReactDebugCurrentFrame:d,ReactComponentTreeHook:{}});var Xe={};function Ze(e,t){var e=e.constructor,e=e&&(e.displayName||e.name)||"ReactClass",r=e+"."+t;Xe[r]||(_("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),Xe[r]=!0)}var Qe={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,r){Ze(e,"forceUpdate")},enqueueReplaceState:function(e,t,r,n){Ze(e,"replaceState")},enqueueSetState:function(e,t,r,n){Ze(e,"setState")}},Je={};function E(e,t,r){this.props=e,this.context=t,this.refs=Je,this.updater=r||Qe}Object.freeze(Je),E.prototype.isReactComponent={},E.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")},E.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var et,tt={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(et in tt)tt.hasOwnProperty(et)&&!function(e,t){Object.defineProperty(E.prototype,e,{get:function(){qe("%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})}(et,tt[et]);function rt(){}function nt(e,t,r){this.props=e,this.context=t,this.refs=Je,this.updater=r||Qe}rt.prototype=E.prototype,(i=nt.prototype=new rt).constructor=nt,Re(i,E.prototype),i.isPureReactComponent=!0;var ot,it,ut=Object.prototype.hasOwnProperty,at={key:!0,ref:!0,__self:!0,__source:!0};function st(e){if(ut.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return}return void 0!==e.ref}function ct(e){if(ut.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return}return void 0!==e.key}var ft={},lt=function(e,t,r,n,o,i,u){e={$$typeof:Oe,type:e,key:t,ref:r,props:u,_owner:i,_store:{}};return Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(e,"_self",{configurable:!1,enumerable:!1,writable:!1,value:n}),Object.defineProperty(e,"_source",{configurable:!1,enumerable:!1,writable:!1,value:o}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e};function pt(e,t,r){var n,o={},i=null,u=null,a=null,s=null;if(null!=t)for(n in st(t)&&(u=t.ref,"string"==typeof(c=t).ref&&T.current&&c.__self&&T.current.stateNode!==c.__self&&(l=g(T.current.type),ft[l]||(_('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',g(T.current.type),c.ref),ft[l]=!0))),ct(t)&&(i=""+t.key),a=void 0===t.__self?null:t.__self,s=void 0===t.__source?null:t.__source,t)ut.call(t,n)&&!at.hasOwnProperty(n)&&(o[n]=t[n]);var c,f,l,p,h=arguments.length-2;if(1==h)o.children=r;else if(1<h){for(var y=Array(h),d=0;d<h;d++)y[d]=arguments[d+2];Object.freeze&&Object.freeze(y),o.children=y}if(e&&e.defaultProps){var m=e.defaultProps;for(n in m)void 0===o[n]&&(o[n]=m[n])}function v(){it||(it=!0,_("%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 E(){ot||(ot=!0,_("%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)",p))}return(i||u)&&(c="function"==typeof e?e.displayName||e.name||"Unknown":e,i&&(l=o,p=c,E.isReactWarning=!0,Object.defineProperty(l,"key",{get:E,configurable:!0})),u&&(r=o,f=c,v.isReactWarning=!0,Object.defineProperty(r,"ref",{get:v,configurable:!0}))),lt(e,i,u,a,s,T.current,o)}function b(e){return"object"==typeof e&&null!==e&&e.$$typeof===Oe}var ht=".",yt=":",dt=!1,mt=/\/+/g;function vt(e){return(""+e).replace(mt,"$&/")}var Et=10,Tt=[];function gt(e,t,r,n){var o;return Tt.length?((o=Tt.pop()).result=e,o.keyPrefix=t,o.func=r,o.context=n,o.count=0,o):{result:e,keyPrefix:t,func:r,context:n,count:0}}function _t(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,Tt.length<Et&&Tt.push(e)}function bt(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?t:null))a=!0;else switch(u){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case Oe:case Ne:a=!0}}if(a)return n(o,t,""===r?ht+Rt(t,0):r),1;var s=0,c=""===r?ht:r+yt;if(Array.isArray(t))for(var f=0;f<t.length;f++)s+=e(i=t[f],c+Rt(i,f),n,o);else if("function"==typeof(r=Ge(t))){r===t.entries&&(dt||qe("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."),dt=!0);for(var l,p=r.call(t),h=0;!(l=p.next()).done;)s+=e(i=l.value,c+Rt(i,h++),n,o)}else if("object"==u)throw r="",r=" If you meant to render a collection of children, use an array instead."+d.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 Rt(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 wt(e,t,r){var n=e.func,o=e.context;n.call(o,t,e.count++)}function Ot(e,t,r){var n=e.result,o=e.keyPrefix,i=e.func,u=e.context,i=i.call(u,t,e.count++);Array.isArray(i)?Nt(i,n,r,function(e){return e}):null!=i&&(b(i)&&(e=o+(!(u=i).key||t&&t.key===i.key?"":vt(i.key)+"/")+r,i=lt(u.type,e,u.ref,u._self,u._source,u._owner,u.props)),n.push(i))}function Nt(e,t,r,n,o){var i="",t=gt(t,i=null!=r?vt(r)+"/":i,n,o);bt(e,Ot,t),_t(t)}function At(e){return"string"==typeof e||"function"==typeof e||e===Ae||e===Pe||e===Ce||e===Ie||e===Me||e===De||"object"==typeof e&&null!==e&&(e.$$typeof===Fe||e.$$typeof===y||e.$$typeof===ke||e.$$typeof===Se||e.$$typeof===xe||e.$$typeof===je||e.$$typeof===Le||e.$$typeof===He||e.$$typeof===Ue)}function R(){var e=Be.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 It(){if(T.current){var e=g(T.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}var Ct=!1,kt={};function St(e,t){var r;e._store&&!e._store.validated&&null==e.key&&(e._store.validated=!0,t=t,(r=It())||(t="string"==typeof t?t:t.displayName||t.name)&&(r="\n\nCheck the top-level render call using <"+t+">."),kt[t=r]||(kt[t]=!0,r="",e&&e._owner&&e._owner!==T.current&&(r=" It was passed a child from "+g(e._owner.type)+"."),v(e),_('Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',t,r),v(null)))}function Pt(e,t){if("object"==typeof e)if(Array.isArray(e))for(var r=0;r<e.length;r++){var n=e[r];b(n)&&St(n,t)}else if(b(e))e._store&&(e._store.validated=!0);else if(e){var o=Ge(e);if("function"==typeof o&&o!==e.entries)for(var i,u=o.call(e);!(i=u.next()).done;)b(i.value)&&St(i.value,t)}}function xt(e){var t=e.type;if(null!=t&&"string"!=typeof t){var r,n=g(t);if("function"==typeof t)r=t.propTypes;else{if("object"!=typeof t||t.$$typeof!==xe&&t.$$typeof!==y)return;r=t.propTypes}r?(v(e),we(r,e.props,"prop",n,d.getStackAddendum),v(null)):void 0===t.PropTypes||Ct||(Ct=!0,_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",n||"Unknown")),"function"!=typeof t.getDefaultProps||t.getDefaultProps.isReactClassApproved||_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Mt(e,t,r){var n,o=At(e),t=(o||(n="",(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(n+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),n+=(null!=(t=t)&&void 0!==(t=t.__source)?"\n\nCheck your code at "+t.fileName.replace(/^.*[\\\/]/,"")+":"+t.lineNumber+".":"")||It(),null===e?u="null":Array.isArray(e)?u="array":void 0!==e&&e.$$typeof===Oe?(u="<"+(g(e.type)||"Unknown")+" />",n=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,_("React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,n)),pt.apply(this,arguments));if(null==t)return t;if(o)for(var i=2;i<arguments.length;i++)Pt(arguments[i],e);if(e===Ae){var u=t;v(u);for(var a=Object.keys(u.props),s=0;s<a.length;s++){var c=a[s];if("children"!==c&&"key"!==c){_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",c);break}}null!==u.ref&&_("Invalid attribute `ref` supplied to `React.Fragment`."),v(null)}else xt(t);return t}var Dt=!1;try{var Ft=Object.freeze({}),Ut=new Map([[Ft,null]]),jt=new Set([Ft]);Ut.set(0,0),jt.add(0)}catch(e){}function Lt(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=Re({},e.props),u=e.key,a=e.ref,s=e._self,c=e._source,f=e._owner;if(null!=t)for(n in st(t)&&(a=t.ref,f=T.current),ct(t)&&(u=""+t.key),e.type&&e.type.defaultProps&&(o=e.type.defaultProps),t)ut.call(t,n)&&!at.hasOwnProperty(n)&&(void 0===t[n]&&void 0!==o?i[n]=o[n]:i[n]=t[n]);var l=arguments.length-2;if(1==l)i.children=r;else if(1<l){for(var p=Array(l),h=0;h<l;h++)p[h]=arguments[h+2];i.children=p}return lt(e.type,u,a,s,c,f,i)}.apply(this,arguments),o=2;o<arguments.length;o++)Pt(arguments[o],n.type);return xt(n),n}function Ht(e){var t=Mt.bind(null,e);return t.type=e,Dt||(Dt=!0,qe("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 qe("Factory.type is deprecated. Access the class directly before passing it to createFactory."),Object.defineProperty(this,"type",{value:e}),e}}),t}i=Mt,o.Children={map:function(e,t,r){if(null==e)return e;var n=[];return Nt(e,n,null,t,r),n},forEach:function(e,t,r){if(null==e)return e;t=gt(null,null,t,r),bt(e,wt,t),_t(t)},count:function(e){return bt(e,function(){return null},null)},toArray:function(e){var t=[];return Nt(e,t,null,function(e){return e}),t},only:function(e){if(b(e))return e;throw Error("React.Children.only expected to receive a single React element child.")}},o.Component=E,o.Fragment=Ae,o.Profiler=Ce,o.PureComponent=nt,o.StrictMode=Ie,o.Suspense=Me,o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ze,o.cloneElement=Lt,o.createContext=function(e,t){void 0===t?t=null:null!==t&&"function"!=typeof t&&_("createContext: Expected the optional second argument to be a function. Instead received: %s",t);var r={$$typeof:Se,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},n=!(r.Provider={$$typeof:ke,_context:r}),o=!1,t={$$typeof:Se,_context:r,_calculateChangedBits:r._calculateChangedBits};return Object.defineProperties(t,{Provider:{get:function(){return o||(o=!0,_("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,_("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=t,r._currentRenderer=null,r._currentRenderer2=null,r},o.createElement=i,o.createFactory=Ht,o.createRef=function(){var e={current:null};return Object.seal(e),e},o.forwardRef=function(e){return null!=e&&e.$$typeof===y?_("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?_("forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&_("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||_("forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:xe,render:e}},o.isValidElement=b,o.lazy=function(e){var t,r,n={$$typeof:Fe,_ctor:e,_status:-1,_result:null};return Object.defineProperties(n,{defaultProps:{configurable:!0,get:function(){return t},set:function(e){_("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){_("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},o.memo=function(e,t){return At(e)||_("memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:y,type:e,compare:void 0===t?null:t}},o.useCallback=function(e,t){return R().useCallback(e,t)},o.useContext=function(e,t){var r,n=R();return void 0!==t&&_("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?_("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&&_("Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")),n.useContext(e,t)},o.useDebugValue=function(e,t){return R().useDebugValue(e,t)},o.useEffect=function(e,t){return R().useEffect(e,t)},o.useImperativeHandle=function(e,t,r){return R().useImperativeHandle(e,t,r)},o.useLayoutEffect=function(e,t){return R().useLayoutEffect(e,t)},o.useMemo=function(e,t){return R().useMemo(e,t)},o.useReducer=function(e,t,r){return R().useReducer(e,t,r)},o.useRef=function(e){return R().useRef(e)},o.useState=function(e){return R().useState(e)},o.version="16.14.0"}"production"===production?l.exports=r:l.exports=o;var Vt=l.exports,w=l.exports.createContext({hackle:void 0,user:void 0}),W=w.Consumer,$t=w.Provider;var O,Gt,Bt,Kt,N,A,I,Yt,zt,qt,Wt,Xt,Zt,Qt,Jt,er,tr,rr,nr,or,ir,ur,ar,sr,cr,fr,lr,pr,hr,C,k,S,yr,dr,P,mr,vr,Er,Tr,gr,_r,br,Rr,wr,Or,Nr,Ar,Ir,Cr,kr,Sr,Pr,xr,Mr,Dr,Fr,Ur,jr,Lr,Hr,Vr,$r,Gr,Br,Kr,Yr,zr,qr,Wr,Xr,Zr,Qr,Jr,x,en,tn,rn,M={exports:{}};function nn(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}Gt(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function on(e,t){return e.timestamp==t.timestamp&&e.user.identifiers==t.user.identifiers&&e.user.properties==t.user.properties}n=n=M.exports,O={DISABLE:0,ERROR:1,WARN:2,INFO:3,DEBUG:4},u=function(){function t(){}return t.setLogLevel=function(e){this.logLevel=e=void 0===e?O.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=O.INFO,t.log={error:function(e){O.ERROR<=t.logLevel&&t._log("ERROR",e)},warn:function(e){O.WARN<=t.logLevel&&t._log("WARN",e)},info:function(e){O.INFO<=t.logLevel&&t._log("INFO",e)},debug:function(e){O.DEBUG<=t.logLevel&&t._log("DEBUG",e)}},t}(),Gt=function(e,t){return(Gt=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)},Bt=function(){return(Bt=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)},Kt=u.log,N=function(){function r(e,t){this.variation=e,this.reason=t}return r.of=function(e,t){return new r(e,t)},r}(),A=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}(),I=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}(),Yt=function(){function e(e,t,r,n,o,i,u,a,s,c,f,l,p){this.id=e,this.key=t,this.type=r,this.identifierType=n,this.status=o,this.version=i,this.variations=u,this.userOverrides=a,this.segmentOverrides=s,this.targetAudiences=c,this.targetRules=f,this.defaultRule=l,this._winnerVariationId=p}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}(),zt=function(e,t,r){this.id=e,this.key=t,this.isDropped=r},qt=function(e,t,r){this.seed=e,this.slotSize=t,this.slots=r},Wt=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}(),Xt=function(e,t){this.id=e,this.key=t},Zt=function(){function e(){}return e.ID="$id",e.USER="$userId",e.DEVICE="$deviceId",e}(),G=function(){function e(){this.identifiers={}}return e.prototype.addIdentifiers=function(e){for(var t in e)this.add(t,e[t]);return this},e.prototype.add=function(e,t){return t&&this._isValid(e,t)?this.identifiers[e]=t:Kt.warn("Invalid user identifier [type=".concat(e,", value=").concat(t,"]")),this},e.prototype._isValid=function(e,t){return!(!e||"string"!=typeof e||128<e.length||!t||"string"!=typeof t||512<t.length)},e.prototype.build=function(){return this.identifiers},e}(),Qt=function(e){this.conditions=e},Jt=function(e,t){this.key=e,this.match=t},er=function(e,t){this.type=e,this.name=t},tr=function(e,t,r,n){this.type=e,this.operator=t,this.valueType=r,this.values=n},rr=function(e,t,r){this.type=e,this.variationId=t,this.bucketId=r},nr=function(e,t){this.target=e,this.action=t},or=function(e,t,r,n){this.id=e,this.key=t,this.type=r,this.targets=n},ir=function(){function i(e,t,r){this.coreVersion=e,this.prerelease=t,this.build=r}return i.tryParse=function(e){var t,r,n,o,u=i.regExp.exec(e);if(u)return(e=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))[0],t=e[1],r=void 0===(r=e[2])?"0":r,n=void 0===(n=e[3])?"0":n,o=e[4],e=e[5],new i(new ur(parseInt(t,10),parseInt(r,10),parseInt(n,10)),ar.parse(o),ar.parse(e))},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}(),ur=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}(),ar=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}(),sr=["MATCH","NOT_MATCH"],cr=["STRING","NUMBER","BOOLEAN","VERSION"],fr=["IN","CONTAINS","STARTS_WITH","ENDS_WITH","GT","GTE","LT","LTE"],lr=["VARIATION","BUCKET"],pr=["USER_ID","USER_PROPERTY","HACKLE_PROPERTY","SEGMENT"],hr=["USER_ID","USER_PROPERTY"],C=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}(),k=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 Bt(Bt({},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}(),S=function(){function e(e,t){this.timestamp=e,this.user=t}return e.exposure=function(e,t,r){return new yr((new Date).getTime(),t,e,r.variationId,r.variationKey,r.reason)},e.track=function(e,t,r){return new dr((new Date).getTime(),r,e,t)},e.isExposure=function(e){return void 0!==e.experiment},e.isTrack=function(e){return void 0!==e.eventType},e}(),yr=function(u){function e(e,t,r,n,o,i){e=u.call(this,e,t)||this;return e.experiment=r,e.variationId=n,e.variationKey=o,e.decisionReason=i,e}return nn(e,u),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.identifiers[Zt.ID],identifiers:this.user.identifiers,userProperties:k.filteredProperties(this.user.properties||{}),hackleProperties:k.filteredProperties(this.user.hackleProperties||{}),experimentId:this.experiment.id,experimentKey:this.experiment.key,experimentType:this.experiment.type,experimentVersion:this.experiment.version,variationId:this.variationId,variationKey:this.variationKey,decisionReason:this.decisionReason.toString()}},e}(S),dr=function(o){function e(e,t,r,n){e=o.call(this,e,t)||this;return e.eventType=r,e.event=n,e}return nn(e,o),e.prototype.toDto=function(){return{timestamp:this.timestamp,userId:this.user.identifiers[Zt.ID],identifiers:this.user.identifiers,userProperties:k.filteredProperties(this.user.properties||{}),hackleProperties:k.filteredProperties(this.user.hackleProperties||{}),eventTypeId:this.eventType.id,eventTypeKey:this.eventType.key,value:this.event.value||0,properties:k.filteredProperties(this.event.properties||{})}},e}(S),P=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}(),mr=function(){function e(e){this.evaluationFlowFactory=e}return e.prototype.evaluate=function(e,t,r,n){return this.evaluationFlowFactory.getFlow(t.type).evaluate(e,t,r,n)},e}(),vr=function(){function e(e){this.conditionMatcherFactory=e}return e.prototype.matches=function(e,t,r){var n=this;return e.conditions.every(function(e){return n._matches(e,t,r)})},e.prototype._matches=function(e,t,r){return this.conditionMatcherFactory.getMatcher(e.key.type).matches(e,t,r)},e}(),Er=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}(),Tr=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}(),gr=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}(),_r=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}(),br=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}(),Rr=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}(),wr=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}(),Or=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}(),Nr=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}(),Ar=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 Tr,t.CONTAINS_MATCHER=new gr,t.STARTS_WITH_MATCHER=new _r,t.ENDS_WITH_MATCHER=new br,t.GT_MATCHER=new Rr,t.GTE_MATCHER=new wr,t.LT_MATCHER=new Or,t.LTE_MATCHER=new Nr,t}(),Ir=function(){function e(){}return e.prototype.matches=function(e,t,r){return"string"==typeof t&&"string"==typeof r&&e.stringMatches(t,r)},e}(),Cr=function(){function e(){}return e.prototype.matches=function(e,t,r){return"number"==typeof t&&"number"==typeof r&&e.numberMatches(t,r)},e}(),kr=function(){function e(){}return e.prototype.matches=function(e,t,r){return"boolean"==typeof t&&"boolean"==typeof r&&e.booleanMatches(t,r)},e}(),Sr=function(){function e(){}return e.prototype.matches=function(e,t,r){t=ir.tryParse(t),r=ir.tryParse(r);return!(!t||!r)&&e.versionMatches(t,r)},e}(),Pr=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 Ir,t.NUMBER_MATCHER=new Cr,t.BOOLEAN_MATCHER=new kr,t.VERSION_MATCHER=new Sr,t}(),xr=function(){function e(e,t){this.userValueResolver=e,this.valueOperatorMatcher=t}return e.prototype.matches=function(e,t,r){r=this.userValueResolver.resolveOrNull(r,e.key);return!!r&&this.valueOperatorMatcher.matches(r,e.match)},e}(),Mr=function(){function e(){}return e.prototype.resolveOrNull=function(e,t){switch(t.type){case"USER_ID":return e.identifiers[t.name];case"USER_PROPERTY":return e.properties[t.name];case"HACKLE_PROPERTY":return e.hackleProperties[t.name];case"SEGMENT":throw new Error("Unsupported TargetKeyType [".concat(t.type,"]"))}},e}(),Dr=function(){function e(e){this.segmentMatcher=e}return e.prototype.matches=function(e,t,r){var n=this;if("SEGMENT"!=e.key.type)throw new Error("Unsupported TargetKeyType [".concat(e.key.type,"]"));var o=e.match.values.some(function(e){return n._matches(e,t,r)});switch(e.match.type){case"MATCH":return o;case"NOT_MATCH":return!o}},e.prototype._matches=function(e,t,r){if("string"!=typeof e)throw new Error("SegmentKey[".concat(e,"]"));var n=t.getSegmentOrNull(e);if(n)return this.segmentMatcher.matches(n,t,r);throw new Error("Segment[".concat(e,"]"))},e}(),Fr=function(){function e(e){this.userConditionMatcher=e}return e.prototype.matches=function(e,t,r){var n=this;return e.targets.some(function(e){return n._matches(e,t,r)})},e.prototype._matches=function(e,t,r){var n=this;return e.conditions.every(function(e){return n.userConditionMatcher.matches(e,t,r)})},e}(),Ur=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 xr(new Mr,new Er(new Pr,new Ar)),t.SEGMENT_CONDITION_MATCHER=new Dr(new Fr(t.USER_CONDITION_MATCHER)),t}(),jr=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){t=t.getBucketOrNull(e.bucketId),e=n.identifiers[r.identifierType];if(e){n=this.bucketer.bucketing(t,e);if(n)return r._getVariationByIdOrNull(n.variationId)}},e}(),Lr={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=this.mul32(s=(s^=n)^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}},Hr=function(){function e(){}return e.prototype.bucketing=function(e,t){var r=this.calculateSlotNumber(e.seed,e.slotSize,t);return e.slots.find(function(e){return e.contains(r)})},e.prototype.calculateSlotNumber=function(e,t,r){r=Lr.murmurhash3_x86_32(r,e);return Math.abs(r)%Math.abs(t)},e}(),Vr=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){return this.flowEvaluator&&this.nextFlow?this.flowEvaluator.evaluate(e,t,r,n,this.nextFlow):P.of(t,n,I.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}(),$r=function(){function e(e){this.overrideResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){var i=this.overrideResolver.resolveOrNull(e,t,r);if(!i)return o.evaluate(e,t,r,n);switch(t.type){case"AB_TEST":return P.withVariation(i,I.OVERRIDDEN);case"FEATURE_FLAG":return P.withVariation(i,I.INDIVIDUAL_TARGET_MATCH)}},e}(),Gr=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){return"DRAFT"===t.status?P.of(t,n,I.EXPERIMENT_DRAFT):o.evaluate(e,t,r,n)},e}(),Br=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){if("PAUSED"!==t.status)return o.evaluate(e,t,r,n);switch(t.type){case"AB_TEST":return P.of(t,n,I.EXPERIMENT_PAUSED);case"FEATURE_FLAG":return P.of(t,n,I.FEATURE_FLAG_INACTIVE)}},e}(),Kr=function(){function e(){}return e.prototype.evaluate=function(e,t,r,n,o){if("COMPLETED"!==t.status)return o.evaluate(e,t,r,n);o=t._winnerVariationOrNull();if(o)return P.withVariation(o,I.EXPERIMENT_COMPLETED);throw new Error("winner variation [".concat(t.id,"]"))},e}(),Yr=function(){function e(e){this.experimentTargetDeterminer=e}return e.prototype.evaluate=function(e,t,r,n,o){if("AB_TEST"!==t.type)throw new Error("experiment type bust be AB_TEST [".concat(t.id,"]"));return this.experimentTargetDeterminer.isUserInExperimentTarget(e,t,r)?o.evaluate(e,t,r,n):P.of(t,n,I.NOT_IN_EXPERIMENT_TARGET)},e}(),zr=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){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,"]"));e=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);return e?e.isDropped?P.of(t,n,I.VARIATION_DROPPED):P.withVariation(e,I.TRAFFIC_ALLOCATED):P.of(t,n,I.TRAFFIC_NOT_ALLOCATED)},e}(),qr=function(){function e(e,t){this.targetRuleDeterminer=e,this.actionResolver=t}return e.prototype.evaluate=function(e,t,r,n,o){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,"]"));if(!r.identifiers[t.identifierType])return o.evaluate(e,t,r,n);var i=this.targetRuleDeterminer.determineTargetRuleOrNull(e,t,r);if(!i)return o.evaluate(e,t,r,n);o=this.actionResolver.resolveOrNull(i.action,e,t,r);if(o)return P.withVariation(o,I.TARGET_RULE_MATCH);throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"))},e}(),Wr=function(){function e(e){this.actionResolver=e}return e.prototype.evaluate=function(e,t,r,n,o){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,"]"));if(!r.identifiers[t.identifierType])return P.of(t,n,I.DEFAULT_RULE);n=this.actionResolver.resolveOrNull(t.defaultRule,e,t,r);if(n)return P.withVariation(n,I.DEFAULT_RULE);throw new Error("FeatureFlag must decide the Variation [".concat(t.id,"]"))},e}(),Xr=function(){function e(e){this.targetMatcher=e}return e.prototype.isUserInExperimentTarget=function(t,e,r){var n=this;return 0===e.targetAudiences.length||e.targetAudiences.some(function(e){return n.targetMatcher.matches(e,t,r)})},e}(),Zr=function(){function e(e){this.targetMatcher=e}return e.prototype.determineTargetRuleOrNull=function(t,e,r){var n=this;return e.targetRules.find(function(e){return n.targetMatcher.matches(e.target,t,r)})},e}(),Qr=function(){function e(e,t){this.targetMatcher=e,this.actionResolver=t}return e.prototype.resolveOrNull=function(e,t,r){return this._resolveUserOverride(t,r)||this._resolveSegmentOverride(e,t,r)},e.prototype._resolveUserOverride=function(e,t){t=t.identifiers[e.identifierType];if(t){t=e.userOverrides.get(t);if(t)return e._getVariationByIdOrNull(t)}},e.prototype._resolveSegmentOverride=function(t,e,r){var n=this,o=e.segmentOverrides.find(function(e){return n.targetMatcher.matches(e.target,t,r)});if(o)return this.actionResolver.resolveOrNull(o.action,t,e,r)},e}(),Jr=function(){function e(){var e=new vr(new Ur),t=new jr(new Hr),r=new Qr(e,t);this.abTestFlow=Vr.of(new $r(r),new Yr(new Xr(e)),new Gr,new Br,new Kr,new zr(t)),this.featureFlagFlow=Vr.of(new Gr,new Br,new Kr,new $r(r),new qr(new Zr(e),t),new Wr(t))}return e.prototype.getFlow=function(e){switch(e){case"AB_TEST":return this.abTestFlow;case"FEATURE_FLAG":return this.featureFlagFlow}},e}(),x=u.log,Ft=function(){function e(e,t,r){this.evaluator=new mr(new Jr),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(e){return{success:!1,error:e}})}return e.prototype._experiment=function(e,t,r){if(!e)return x.error("experimentKey must not be empty"),N.of(r,I.INVALID_INPUT);var n=this.workspaceFetcher.get();if(!n)return x.warn("SDK not ready."),N.of(r,I.SDK_NOT_READY);e=n.getExperimentOrNull(e);if(!e)return x.warn("Experiment does not exist."),N.of(r,I.EXPERIMENT_NOT_FOUND);n=this.evaluator.evaluate(n,e,t,r);return this.eventProcessor.process(S.exposure(e,t,n)),N.of(n.variationKey,n.reason)},e.prototype._featureFlag=function(e,t){if(!e)return x.error("featureKey must not be empty"),A.off(I.INVALID_INPUT);var r=this.workspaceFetcher.get();if(!r)return x.warn("SDK not ready."),A.off(I.SDK_NOT_READY);e=r.getFeatureFlagOrNull(e);if(!e)return x.warn("FeatureFlag does not exist."),A.off(I.FEATURE_FLAG_NOT_FOUND);r=this.evaluator.evaluate(r,e,t,"A");return this.eventProcessor.process(S.exposure(e,t,r)),"A"===r.variationKey?A.off(r.reason):A.on(r.reason)},e.prototype._track=function(e,t){var r;e?"object"==typeof e?"object"!=typeof e||e.key&&"string"==typeof e.key?(r=(null==(r=this.workspaceFetcher.get())?void 0:r.getEventTypeOrNull(e.key))||new Xt(0,e.key),this.eventProcessor.process(S.track(r,e,t))):x.warn("Event key must be not null. or event key must be string type."):x.warn("Event must be event type."):x.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,e=e.timeout,e=void 0===e?3e3:e,r=(x.debug("Start HackleClient initializing"),new Promise(function(e){t=e})),n=setTimeout(function(){t({success:!1})},e);return this.readyPromise.then(function(){clearTimeout(n),t({success:!0})},function(e){clearTimeout(n),t({success:!1,error:e})}),Promise.race([this.readyPromise,r]).then(function(e){return e.success?x.debug("HackleClient onInitialized Success"):e.error instanceof Error?x.error("HackleClient onInitialized Failed. ".concat(e.error.message)):x.error("HackleClient onInitialized Failed. ".concat(e.error)),Promise.resolve({success:e.success})})},e.prototype._close=function(){this.workspaceFetcher.close(),this.eventProcessor.close()},e}(),en=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}(),tn=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 en({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}(),Ut=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 tn(this.drainQueue.bind(this),on,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 n=this,o=function(e){return this.queue.start(),[2]},s={label:0,sent:function(){if(1&a[0])throw a[1];return a[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(r){return function(e){var t=[r,e];if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,u&&(a=2&t[0]?u.return:t[0]?u.throw||((a=u.return)&&a.call(u),0):u.next)&&!(a=a.call(u,t[1])).done)return a;switch(u=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return s.label++,{value:t[1],done:!1};case 5:s.label++,u=t[1],t=[0];continue;case 7:t=s.ops.pop(),s.trys.pop();continue;default:if(!((a=0<(a=s.trys).length&&a[a.length-1])||6!==t[0]&&2!==t[0])){s=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3])){s.label=t[1];break}if(6===t[0]&&s.label<a[1]){s.label=a[1],a=t;break}if(a&&s.label<a[2]){s.label=a[2],s.ops.push(t);break}a[2]&&s.ops.pop(),s.trys.pop();continue}t=o.call(n,s)}catch(e){t=[6,e],u=0}finally{i=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}var n,o,i,u,a,t,s},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}(),rn=u.log,jt=function(){function f(e,t,r,n,o){this.experiments=e,this.featureFlags=t,this.buckets=r,this.eventTypes=n,this.segments=o}return f.prototype.getExperimentOrNull=function(e){return this.experiments.get(e)},f.prototype.getFeatureFlagOrNull=function(e){return this.featureFlags.get(e)},f.prototype.getBucketOrNull=function(e){return this.buckets.get(e)},f.prototype.getEventTypeOrNull=function(e){return this.eventTypes.get(e)},f.prototype.getSegmentOrNull=function(e){return this.segments.get(e)},f.from=function(e){var t=this,r=f.associate(e.buckets,function(e){return[e.id,t.toBucket(e)]}),n=f.associateBy(f.mapNotUndefined(e.experiments,function(e){return t.toExperimentOrNull("AB_TEST",e)}),function(e){return e.key}),o=f.associateBy(f.mapNotUndefined(e.featureFlags,function(e){return t.toExperimentOrNull("FEATURE_FLAG",e)}),function(e){return e.key}),i=f.associate(e.events,function(e){return[e.key,new Xt(e.id,e.key)]}),e=f.associateBy(f.mapNotUndefined(e.segments,function(e){return t.toSegmentOrNull(e)}),function(e){return e.key});return new f(n,o,r,i,e)},f.toBucket=function(e){return new qt(e.seed,e.slotSize,e.slots.map(function(e){var t=e.startInclusive,r=e.endExclusive,e=e.variationId;return new Wt(t,r,e)}))},f.toExperimentOrNull=function(e,t){var r=this,n=this.experimentStatusOrNull(t.execution.status),o=t.variations.map(function(e){return new zt(e.id,e.key,"DROPPED"===e.status)}),i=f.associate(t.execution.userOverrides,function(e){return[e.userId,e.variationId]}),u=f.mapNotUndefined(t.execution.segmentOverrides,function(e){return r.toTargetRuleOrNull(e,C.IDENTIFIER)}),a=f.mapNotUndefined(t.execution.targetAudiences,function(e){return r.toTargetOrNull(e,C.PROPERTY)}),s=f.mapNotUndefined(t.execution.targetRules,function(e){return r.toTargetRuleOrNull(e,C.PROPERTY)}),c=this.toTargetActionOrNull(t.execution.defaultRule);return n&&c&&new Yt(t.id,t.key,e,t.identifierType,n,t.version,o,i,u,a,s,c,t.winnerVariationId)},f.experimentStatusOrNull=function(e){switch(e){case"READY":return"DRAFT";case"RUNNING":return"RUNNING";case"PAUSED":return"PAUSED";case"STOPPED":return"COMPLETED";default:return void rn.debug("Unsupported status [".concat(e,"]"))}},f.toTargetRuleOrNull=function(e,t){t=this.toTargetOrNull(e.target,t),e=this.toTargetActionOrNull(e.action);return t&&e&&new nr(t,e)},f.toTargetActionOrNull=function(e){var t=this.parseOrNull(lr,e.type);return t&&new rr(t,e.variationId,e.bucketId)},f.toTargetOrNull=function(e,t){var r=this,e=f.mapNotUndefined(e.conditions,function(e){return r.toConditionOrNull(e,t)});return new Qt(e)},f.toConditionOrNull=function(e,t){var r=this.toTargetKeyOrNull(e.key);if(r&&t.supports(r.type))return(t=this.toTargetMatchOrNull(e.match))&&new Jt(r,t)},f.toTargetKeyOrNull=function(e){var t=this.parseOrNull(pr,e.type);return t&&new er(t,e.name)},f.toTargetMatchOrNull=function(e){var t=this.parseOrNull(sr,e.type),r=this.parseOrNull(fr,e.operator),n=this.parseOrNull(cr,e.valueType);return t&&r&&n&&new tr(t,r,n,e.values)},f.toSegmentOrNull=function(e){var t=this,r=this.parseOrNull(hr,e.type);return r&&new or(e.id,e.key,r,this.mapNotUndefined(e.targets,function(e){return t.toTargetOrNull(e,C.SEGMENT)}))},f.parseOrNull=function(e,t){e=e.find(function(e){return e===t});return e||rn.debug("Unsupported type [".concat(t,"]. Please use the latest version of sdk.")),e},f.mapNotUndefined=function(e,r){return e.reduce(function(e,t){t=r(t);return t&&e.push(t),e},Array())},f.associateTo=function(e,t,r){return e.reduce(function(e,t){t=r(t);return e.set(t[0],t[1]),e},t)},f.associate=function(e,t){return f.associateTo(e,new Map,t)},f.associateBy=function(e,t){return this.associateTo(e,new Map,function(e){return[t(e),e]})},f}(),n.Bucket=qt,n.CoreVersion=ur,n.DEFAULT_ON_READY_TIMEOUT=3e3,n.Decision=N,n.DecisionReason=I,n.DefaultEventQueue=tn,n.Event=S,n.EventProcessor=Ut,n.EventType=Xt,n.Experiment=Yt,n.Exposure=yr,n.FeatureFlagDecision=A,n.HackleInternalClient=Ft,n.IdentifierType=Zt,n.IdentifiersBuilder=G,n.Logger=u,n.MATCH_OPERATORS=fr,n.MATCH_TYPES=sr,n.MATCH_VALUE_TYPES=cr,n.MetaVersion=ar,n.SEGMENT_TYPES=hr,n.Segment=or,n.Slot=Wt,n.TARGET_ACTION_TYPES=lr,n.TARGET_KEY_TYPES=pr,n.Target=Qt,n.TargetAction=rr,n.TargetCondition=Jt,n.TargetKey=er,n.TargetMatch=tr,n.TargetRule=nr,n.TargetingType=C,n.Track=dr,n.Variation=zt,n.Version=ir,n.Workspace=jt,n.logLevels=O,n.toPayload=function(e){var t=new Array,r=new Array;return e.forEach(function(e){S.isExposure(e)?t.push(e.toDto()):S.isTrack(e)&&r.push(e.toDto())}),{exposureEvents:t,trackEvents:r}},Object.defineProperty(n,"__esModule",{value:!0});var D=M.exports.Logger.log;function un(e,t){void 0===t&&(t="A");var r=l.exports.useContext(w),n=r.hackle,o=r.user,i=l.exports.useCallback(function(){return(null==n?void 0:n.variation(e,o))||t},[t,e,o,n]),r=f(l.exports.useState(function(){return n?i():("undefined"!=typeof window&&D.error("HackleClient is not existed"),t)}),2),u=r[0],r=r[1],a={key:e,user:o},s=f(l.exports.useState(a),2),c=s[0],s=s[1];return sn(c,a)||(s(a),r(i())),u}function an(e){var t=l.exports.useContext(w),r=t.hackle,n=t.user,o=l.exports.useCallback(function(){return(null==r?void 0:r.isFeatureOn(e,n))||!1},[e,n,r]),t=f(l.exports.useState(function(){return r?o():("undefined"!=typeof window&&D.error("HackleClient is not existed"),!1)}),2),i=t[0],t=t[1],u={key:e,user:n},a=f(l.exports.useState(u),2),s=a[0],a=a[1];return sn(s,u)||(a(u),t(o())),i}function sn(e,t){var r,n,o;return e.key===t.key&&(null==(r=e.user)?void 0:r.id)===(null==(r=t.user)?void 0:r.id)&&(e=null==(r=e.user)?void 0:r.properties,t=null==(r=t.user)?void 0:r.properties,n=cn(e),o=cn(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 cn(e){return"object"==typeof e&&null!==e?e:{}}function fn(e){var t,r=e.experimentKey,e=e.children,n=un(r);return e&&"function"==typeof e?e(n):(l.exports.Children.forEach(e,function(e){l.exports.isValidElement(e)&&(e.props.variation?n===e.props.variation&&(t=e):e.props.default&&(t=e))}),t?l.exports.cloneElement(t,{variation:n}):null)}function ln(e){return e.variation,e=e.children,l.exports.createElement(l.exports.Fragment,null,e)}function pn(e){var t=an(e.featureKey);return Vt.createElement(Vt.Fragment,null,e.children(t))}t.HackleContext=w,t.HackleContextConsumer=W,t.HackleContextProvider=$t,t.HackleExperiment=fn,t.HackleFeature=pn,t.HackleProvider=function(e){var t=e.hackleClient,r=e.user,n=void 0===(o=e.timeout)?3e3:o,o=e.children,e={hackle:t,user:r},i=f(l.exports.useState(!1),2),u=i[0],a=i[1],e=(i=f(l.exports.useState(e),2))[0],s=i[1];return l.exports.useEffect(function(){s(function(e){return c(c({},e),{user:r})})},[r]),l.exports.useEffect(function(){t.onInitialized({timeout:n}).then(function(){a(!0)},function(){a(!0)})},[t]),u?Vt.createElement($t,{value:e},o):null},t.HackleVariation=ln,t.createInstance=function(e,t){return new L(e,t)},t.useFeature=an,t.useFeatureFlagDetail=function(e){var t=(i=l.exports.useContext(w)).hackle,r=i.user,n=l.exports.useCallback(function(){return(null==t?void 0:t.featureFlagDetail(e,r))||M.exports.FeatureFlagDecision.off(M.exports.DecisionReason.EXCEPTION)},[e,r,t]),o=(i=f(l.exports.useState(function(){return t?n():("undefined"!=typeof window&&D.error("HackleClient is not existed"),M.exports.FeatureFlagDecision.off(M.exports.DecisionReason.EXCEPTION))}),2))[0],i=i[1],u={key:e,user:r},a=(s=f(l.exports.useState(u),2))[0],s=s[1];return sn(a,u)||(s(u),i(n())),o},t.useTrack=function(){var e=l.exports.useContext(w),t=e.hackle,r=e.user;return t?function(e){return null==t?void 0:t.track(e,r)}:("undefined"!=typeof window&&D.error("HackleClient is not existed"),function(){})},t.useVariation=un,t.useVariationDetail=function(e,t){void 0===t&&(t="A");var r=(u=l.exports.useContext(w)).hackle,n=u.user,o=l.exports.useCallback(function(){return(null==r?void 0:r.variationDetail(e,n))||M.exports.Decision.of(t,M.exports.DecisionReason.EXCEPTION)},[t,e,n,r]),i=(u=f(l.exports.useState(function(){return r?o():("undefined"!=typeof window&&D.error("HackleClient is not existed"),M.exports.Decision.of(t,M.exports.DecisionReason.EXCEPTION))}),2))[0],u=u[1],a={key:e,user:n},s=(c=f(l.exports.useState(a),2))[0],c=c[1];return sn(s,a)||(c(a),u(o())),i},Object.keys(F).forEach(function(e){"default"===e||t.hasOwnProperty(e)||Object.defineProperty(t,e,{enumerable:!0,get:function(){return F[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.4.2",
3
+ "version": "3.4.3",
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.4.2",
43
- "@hackler/js-client-sdk": "3.4.2"
42
+ "@hackler/sdk-core": "3.4.3",
43
+ "@hackler/js-client-sdk": "3.4.3"
44
44
  },
45
45
  "peerDependencies": {
46
46
  "react": ">=16.8.0"