"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8367],{95857:function(e,t,n){n.d(t,{Z:function(){return N}});var r=n(61155),i=n(17610),o=n(7653),s=n(10607),a=n(91891),u=n(3838),c=n(3717),l=n(67624),f=n(71533),h=n(1878),p=n(52197),d=n(46401),g=n(14573),m=n(37501);function v(e){return(0,m.ZP)("MuiButton",e)}let y=(0,g.Z)("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]);var S=n(49721),b=n(29112),T=n(27573);let E=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],_=e=>{let{color:t,disableElevation:n,fullWidth:r,size:o,variant:s,classes:a}=e,c={root:["root",s,"".concat(s).concat((0,d.Z)(t)),"size".concat((0,d.Z)(o)),"".concat(s,"Size").concat((0,d.Z)(o)),"color".concat((0,d.Z)(t)),n&&"disableElevation",r&&"fullWidth"],label:["label"],startIcon:["icon","startIcon","iconSize".concat((0,d.Z)(o))],endIcon:["icon","endIcon","iconSize".concat((0,d.Z)(o))]},l=(0,u.Z)(c,v,a);return(0,i.Z)({},a,l)},R=e=>(0,i.Z)({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}}),k=(0,l.ZP)(p.Z,{shouldForwardProp:e=>(0,f.Z)(e)||"classes"===e,name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.root,t[n.variant],t["".concat(n.variant).concat((0,d.Z)(n.color))],t["size".concat((0,d.Z)(n.size))],t["".concat(n.variant,"Size").concat((0,d.Z)(n.size))],"inherit"===n.color&&t.colorInherit,n.disableElevation&&t.disableElevation,n.fullWidth&&t.fullWidth]}})(e=>{var t,n;let{theme:r,ownerState:o}=e,s="light"===r.palette.mode?r.palette.grey[300]:r.palette.grey[800],a="light"===r.palette.mode?r.palette.grey.A100:r.palette.grey[700];return(0,i.Z)({},r.typography.button,{minWidth:64,padding:"6px 16px",borderRadius:(r.vars||r).shape.borderRadius,transition:r.transitions.create(["background-color","box-shadow","border-color","color"],{duration:r.transitions.duration.short}),"&:hover":(0,i.Z)({textDecoration:"none",backgroundColor:r.vars?"rgba(".concat(r.vars.palette.text.primaryChannel," / ").concat(r.vars.palette.action.hoverOpacity,")"):(0,c.Fq)(r.palette.text.primary,r.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===o.variant&&"inherit"!==o.color&&{backgroundColor:r.vars?"rgba(".concat(r.vars.palette[o.color].mainChannel," / ").concat(r.vars.palette.action.hoverOpacity,")"):(0,c.Fq)(r.palette[o.color].main,r.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===o.variant&&"inherit"!==o.color&&{border:"1px solid ".concat((r.vars||r).palette[o.color].main),backgroundColor:r.vars?"rgba(".concat(r.vars.palette[o.color].mainChannel," / ").concat(r.vars.palette.action.hoverOpacity,")"):(0,c.Fq)(r.palette[o.color].main,r.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===o.variant&&{backgroundColor:r.vars?r.vars.palette.Button.inheritContainedHoverBg:a,boxShadow:(r.vars||r).shadows[4],"@media (hover: none)":{boxShadow:(r.vars||r).shadows[2],backgroundColor:(r.vars||r).palette.grey[300]}},"contained"===o.variant&&"inherit"!==o.color&&{backgroundColor:(r.vars||r).palette[o.color].dark,"@media (hover: none)":{backgroundColor:(r.vars||r).palette[o.color].main}}),"&:active":(0,i.Z)({},"contained"===o.variant&&{boxShadow:(r.vars||r).shadows[8]}),["&.".concat(y.focusVisible)]:(0,i.Z)({},"contained"===o.variant&&{boxShadow:(r.vars||r).shadows[6]}),["&.".concat(y.disabled)]:(0,i.Z)({color:(r.vars||r).palette.action.disabled},"outlined"===o.variant&&{border:"1px solid ".concat((r.vars||r).palette.action.disabledBackground)},"contained"===o.variant&&{color:(r.vars||r).palette.action.disabled,boxShadow:(r.vars||r).shadows[0],backgroundColor:(r.vars||r).palette.action.disabledBackground})},"text"===o.variant&&{padding:"6px 8px"},"text"===o.variant&&"inherit"!==o.color&&{color:(r.vars||r).palette[o.color].main},"outlined"===o.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===o.variant&&"inherit"!==o.color&&{color:(r.vars||r).palette[o.color].main,border:r.vars?"1px solid rgba(".concat(r.vars.palette[o.color].mainChannel," / 0.5)"):"1px solid ".concat((0,c.Fq)(r.palette[o.color].main,.5))},"contained"===o.variant&&{color:r.vars?r.vars.palette.text.primary:null==(t=(n=r.palette).getContrastText)?void 0:t.call(n,r.palette.grey[300]),backgroundColor:r.vars?r.vars.palette.Button.inheritContainedBg:s,boxShadow:(r.vars||r).shadows[2]},"contained"===o.variant&&"inherit"!==o.color&&{color:(r.vars||r).palette[o.color].contrastText,backgroundColor:(r.vars||r).palette[o.color].main},"inherit"===o.color&&{color:"inherit",borderColor:"currentColor"},"small"===o.size&&"text"===o.variant&&{padding:"4px 5px",fontSize:r.typography.pxToRem(13)},"large"===o.size&&"text"===o.variant&&{padding:"8px 11px",fontSize:r.typography.pxToRem(15)},"small"===o.size&&"outlined"===o.variant&&{padding:"3px 9px",fontSize:r.typography.pxToRem(13)},"large"===o.size&&"outlined"===o.variant&&{padding:"7px 21px",fontSize:r.typography.pxToRem(15)},"small"===o.size&&"contained"===o.variant&&{padding:"4px 10px",fontSize:r.typography.pxToRem(13)},"large"===o.size&&"contained"===o.variant&&{padding:"8px 22px",fontSize:r.typography.pxToRem(15)},o.fullWidth&&{width:"100%"})},e=>{let{ownerState:t}=e;return t.disableElevation&&{boxShadow:"none","&:hover":{boxShadow:"none"},["&.".concat(y.focusVisible)]:{boxShadow:"none"},"&:active":{boxShadow:"none"},["&.".concat(y.disabled)]:{boxShadow:"none"}}}),C=(0,l.ZP)("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.startIcon,t["iconSize".concat((0,d.Z)(n.size))]]}})(e=>{let{ownerState:t}=e;return(0,i.Z)({display:"inherit",marginRight:8,marginLeft:-4},"small"===t.size&&{marginLeft:-2},R(t))}),w=(0,l.ZP)("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{let{ownerState:n}=e;return[t.endIcon,t["iconSize".concat((0,d.Z)(n.size))]]}})(e=>{let{ownerState:t}=e;return(0,i.Z)({display:"inherit",marginRight:-4,marginLeft:8},"small"===t.size&&{marginRight:-2},R(t))});var N=o.forwardRef(function(e,t){let n=o.useContext(S.Z),u=o.useContext(b.Z),c=(0,a.Z)(n,e),l=(0,h.i)({props:c,name:"MuiButton"}),{children:f,color:p="primary",component:d="button",className:g,disabled:m=!1,disableElevation:v=!1,disableFocusRipple:y=!1,endIcon:R,focusVisibleClassName:N,fullWidth:A=!1,size:O="medium",startIcon:I,type:F,variant:L="text"}=l,x=(0,r.Z)(l,E),D=(0,i.Z)({},l,{color:p,component:d,disabled:m,disableElevation:v,disableFocusRipple:y,fullWidth:A,size:O,type:F,variant:L}),M=_(D),K=I&&(0,T.jsx)(C,{className:M.startIcon,ownerState:D,children:I}),U=R&&(0,T.jsx)(w,{className:M.endIcon,ownerState:D,children:R});return(0,T.jsxs)(k,(0,i.Z)({ownerState:D,className:(0,s.Z)(n.className,M.root,g,u||""),component:d,disabled:m,focusRipple:!y,focusVisibleClassName:(0,s.Z)(M.focusVisible,N),ref:t,type:F},x,{classes:M,children:[K,f,U]}))})},29112:function(e,t,n){let r=n(7653).createContext(void 0);t.Z=r},49721:function(e,t,n){let r=n(7653).createContext({});t.Z=r},56296:function(e,t,n){var r=n(17610),i=n(61155),o=n(7653),s=n(10607),a=n(3838),u=n(47792),c=n(67624),l=n(1878),f=n(52631),h=n(23441),p=n(27573);let d=["className","id"],g=e=>{let{classes:t}=e;return(0,a.Z)({root:["root"]},f.a,t)},m=(0,c.ZP)(u.Z,{name:"MuiDialogTitle",slot:"Root",overridesResolver:(e,t)=>t.root})({padding:"16px 24px",flex:"0 0 auto"}),v=o.forwardRef(function(e,t){let n=(0,l.i)({props:e,name:"MuiDialogTitle"}),{className:a,id:u}=n,c=(0,i.Z)(n,d),f=g(n),{titleId:v=u}=o.useContext(h.Z);return(0,p.jsx)(m,(0,r.Z)({component:"h2",className:(0,s.Z)(f.root,a),ownerState:n,ref:t,variant:"h6",id:null!=u?u:v},c))});t.Z=v},92541:function(e,t,n){n.d(t,{b:function(){return a},c:function(){return u}});var r=n(83780),i=n(7653),o=n(72792),s=n(87226),a={updateOnSdkUpdate:!1,updateOnSdkTimedout:!1,updateOnSdkReady:!0,updateOnSdkReadyFromCache:!0};function u(e){var t=(0,r.pi)((0,r.pi)({},a),e),n=t.updateOnSdkReady,u=t.updateOnSdkReadyFromCache,c=t.updateOnSdkTimedout,l=t.updateOnSdkUpdate,f=t.splitKey,h=t.trafficType,p=t.attributes,d=i.useContext(o.G),g=d.client,m=d.factory,v=g;f&&m&&(v=(0,s.w$)(m,f,h)),(0,s.zE)(v,p);var y=(0,s.lR)(v),S=i.useState(y.lastUpdate)[1];return i.useEffect(function(){if(v){var e=function(){return S(v.__getStatus().lastUpdate)},t=(0,s.lR)(v);return n&&(t.isReady?y.isReady||e():v.once(v.Event.SDK_READY,e)),u&&(t.isReadyFromCache?y.isReadyFromCache||e():v.once(v.Event.SDK_READY_FROM_CACHE,e)),c&&(t.hasTimedout?y.hasTimedout||e():v.once(v.Event.SDK_READY_TIMED_OUT,e)),l&&v.on(v.Event.SDK_UPDATE,e),function(){v.off(v.Event.SDK_READY,e),v.off(v.Event.SDK_READY_FROM_CACHE,e),v.off(v.Event.SDK_READY_TIMED_OUT,e),v.off(v.Event.SDK_UPDATE,e)}}},[v,n,u,c,l,y]),(0,r.pi)({factory:m,client:v},y)}},87226:function(e,t,n){n.d(t,{wf:function(){return ie},w$:function(){return r9},R0:function(){return r7},lR:function(){return it},zE:function(){return ir},uG:function(){return io}});var r,i,o,s,a,u,c,l,f,h,p,d,g,m,v=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function y(e,t){if(e.length!==t.length)return!1;for(var n,r,i=0;i<e.length;i++)if(!((n=e[i])===(r=t[i])||v(n)&&v(r)))return!1;return!0}var S=function(e,t){void 0===t&&(t=y);var n,r,i=[],o=!1;return function(){for(var s=[],a=0;a<arguments.length;a++)s[a]=arguments[a];return o&&n===this&&t(s,i)||(r=e.apply(this,s),o=!0,n=this,i=s),r}},b=n(28874),T=n.n(b),E=Object.getOwnPropertySymbols,_=Object.prototype.hasOwnProperty,R=Object.prototype.propertyIsEnumerable,k=!function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;var r=Object.getOwnPropertyNames(t).map(function(e){return t[e]});if("0123456789"!==r.join(""))return!1;var i={};if("abcdefghijklmnopqrst".split("").forEach(function(e){i[e]=e}),"abcdefghijklmnopqrst"!==Object.keys(Object.assign({},i)).join(""))return!1;return!0}catch(e){return!1}}()?function(e,t){for(var n,r,i=function(e){if(null==e)throw TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),o=1;o<arguments.length;o++){for(var s in n=Object(arguments[o]))_.call(n,s)&&(i[s]=n[s]);if(E){r=E(n);for(var a=0;a<r.length;a++)R.call(n,r[a])&&(i[r[a]]=n[r[a]])}}return i}:Object.assign,C="settings",w="Factory instantiation",N="Client instantiation",A="engine",O=A+":combiner: ",I=A+":matcher: ",F=A+":value: ",L="sync",x=L+":sync-manager: ",D=L+":offline: ",M=L+":streaming: ",K=L+":featureflag-changes: ",U=L+":polling-manager: ",P=L+":submitter: ",B="impressions-tracker: ",z="events-tracker: ",j="cleanup: ",q=function(){function e(e){var t=this;this.__setData__=[],Array.isArray(e)&&e.forEach(function(e){t.add(e)})}return e.prototype.clear=function(){this.__setData__.length&&(this.__setData__.length=0)},e.prototype.add=function(e){return this.has(e)||this.__setData__.push(e),this},e.prototype.delete=function(e){var t=this.__setData__.indexOf(e);return -1!==t&&(this.__setData__.splice(t,1),!0)},e.prototype.has=function(e){return -1!==this.__setData__.indexOf(e)},e.prototype.forEach=function(e,t){if("function"!=typeof e)throw TypeError(e+" is not a function");for(var n=0;n<this.__setData__.length;n++){var r=this.__setData__[n];e.call(t,r,r,this)}},Object.defineProperty(e.prototype,"size",{get:function(){return this.__setData__.length},enumerable:!1,configurable:!0}),e}();function W(e){return e instanceof q?e.__setData__.slice():Array.from(e)}var G="function"==typeof Array.from&&"function"==typeof Set&&Set.prototype&&Set.prototype.values?Set:q,H=new G(["splitsdkclientkey","splitsdkversion","splitsdkmachineip","splitsdkmachinename","splitsdkimpressionsmode","host","referrer","content-type","content-length","content-encoding","accept","keep-alive","x-fastly-debug"]);function Z(e,t){var n;if(null===(n=e.sync.requestOptions)||void 0===n?void 0:n.getHeaderOverrides)try{var r=e.sync.requestOptions.getHeaderOverrides({headers:k({},t)});Object.keys(r).filter(function(e){return!H.has(e.toLowerCase())}).forEach(function(e){return t[e]=r[e]})}catch(t){e.log.error("Problem adding custom headers to request decorator: "+t)}return t}var Q="Global fetch API is not available.",V="control",Y={treatment:V,config:null},J="IMPRESSION",$="EVENT",X="DEBUG",ee="OPTIMIZED",et="NONE",en="localhost",er="standalone",ei="consumer",eo="consumer_partial",es="MEMORY",ea="LOCALSTORAGE",eu="GRANTED",ec="DECLINED",el="UNKNOWN",ef="getTreatment",eh="getTreatments",ep="getTreatmentWithConfig",ed="getTreatmentsWithConfig",eg="getTreatmentsByFlagSet",em="getTreatmentsByFlagSets",ev="getTreatmentsWithConfigByFlagSet",ey="getTreatmentsWithConfigByFlagSets",eS="track",eb="split",eT="splits",eE="names",e_="IN_SEGMENT",eR={headers:{"Cache-Control":"no-cache"}};function ek(e){return"users="+encodeURIComponent(e)}function eC(e,t,n){var r,i,o,s,a,u,c,l,f,h,p,d=e.urls,g=e.sync.__splitFiltersValidation&&e.sync.__splitFiltersValidation.queryString,m=e.sync.impressionsMode,v=e.sync.flagSpecVersion,y=(r=t.getOptions,i=t.getFetch,o=e.log,s=e.core.authorizationKey,a=e.version,c=(u=e.runtime).ip,l=u.hostname,f=r&&r(e),(h=i&&i(e))||o.error(303,[Q]),p={Accept:"application/json","Content-Type":"application/json",Authorization:"Bearer "+s,SplitSDKVersion:a},c&&(p.SplitSDKMachineIP=c),l&&(p.SplitSDKMachineName=l),function(t,n,r,i){void 0===n&&(n={}),void 0===r&&(r=function(){}),void 0===i&&(i=!1);var s=k({headers:Z(e,k({},p,n.headers||{})),method:n.method||"GET",body:n.body},f);return h?h(t,s).then(function(e){return e.ok?(r(),e):e.text().then(function(t){return Promise.reject({response:e,message:t})})}).catch(function(e){var n=e&&e.response,s="";s=n?404===n.status?"Invalid SDK key or resource not found.":e.message:e.message||"Network Error",n&&403===n.status||o[i?"info":"error"](322,[n?n.status:"NO_STATUS",t,s]);var a=Error(s);throw a.statusCode=n&&n.status,r(a),a}):Promise.reject(Error(Q))});return{getSdkAPIHealthCheck:function(){return y(d.sdk+"/version").then(function(){return!0}).catch(function(){return!1})},getEventsAPIHealthCheck:function(){return y(d.events+"/version").then(function(){return!0}).catch(function(){return!1})},fetchAuth:function(e){var t=d.auth+"/v2/auth?s="+v;if(e){var r=e.map(ek).join("&");r&&(t+="&"+r)}return y(t,void 0,n.trackHttp("to"))},fetchSplitChanges:function(t,r,i){return y(d.sdk+"/splitChanges?s="+v+"&since="+t+(g||"")+(i?"&till="+i:""),r?eR:void 0,n.trackHttp("sp")).catch(function(t){throw 414===t.statusCode&&e.log.error(327),t})},fetchSegmentChanges:function(e,t,r,i){return y(d.sdk+"/segmentChanges/"+t+"?since="+e+(i?"&till="+i:""),r?eR:void 0,n.trackHttp("se"))},fetchMySegments:function(e,t){return y(d.sdk+"/mySegments/"+encodeURIComponent(e),t?eR:void 0,n.trackHttp("ms"))},postEventsBulk:function(e,t){return y(d.events+"/events/bulk",{method:"POST",body:e,headers:t},n.trackHttp("ev"))},postTestImpressionsBulk:function(e,t){return y(d.events+"/testImpressions/bulk",{method:"POST",body:e,headers:k({SplitSDKImpressionsMode:m},t)},n.trackHttp("im"))},postTestImpressionsCount:function(e,t){return y(d.events+"/testImpressions/count",{method:"POST",body:e,headers:t},n.trackHttp("ic"))},postUniqueKeysBulkCs:function(e,t){return y(d.telemetry+"/v1/keys/cs",{method:"POST",body:e,headers:t},n.trackHttp("te"))},postUniqueKeysBulkSs:function(e,t){return y(d.telemetry+"/v1/keys/ss",{method:"POST",body:e,headers:t},n.trackHttp("te"))},postMetricsConfig:function(e,t){return y(d.telemetry+"/v1/metrics/config",{method:"POST",body:e,headers:t},n.trackHttp("te"),!0)},postMetricsUsage:function(e,t){return y(d.telemetry+"/v1/metrics/usage",{method:"POST",body:e,headers:t},n.trackHttp("te"),!0)}}}function ew(e,t,n,r){void 0===r&&(r="task");var i,o,s,a=0,u=!1,c=0;function l(){for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];return a++,e.debug(37,[r]),i=(i?i.then(function(){return t.apply(void 0,n)}):t.apply(void 0,n)).then(function(e){return a--,e})}return{execute:l,isExecuting:function(){return a>0},start:function(){for(var t=[],i=0;i<arguments.length;i++)t[i]=arguments[i];if(!u)return u=!0,c++,o=t,e.debug(36,[r,n]),function e(t){return l.apply(void 0,o).then(function(r){return u&&t===c&&(s=setTimeout(e,n,t)),r})}(c)},stop:function(){u=!1,s&&(e.debug(38,[r]),clearTimeout(s),s=void 0)},isRunning:function(){return u}}}function eN(e,t,n,r,i,o,s,a){void 0===s&&(s=0);var u,c=0;return ew(e,function(){if(n.isEmpty()&&!u)return Promise.resolve();var r="number"==typeof(u=n.pop(u)).length?u.length+" "+i:i;e[a?"debug":"info"](116,[r]);var l=JSON.stringify(o?o(u):u);return s||(u=void 0),t(l).then(function(){c=0,u=void 0}).catch(function(t){s?c===s?(c=0,u=void 0,e[a?"debug":"warn"](209,[r,t])):(c++,e[a?"debug":"warn"](210,[r,t])):e[a?"debug":"warn"](209,[r,t])})},r,i+" submitter")}function eA(e,t){var n,r=!1,i=e.start;e.start=function(){r=!0,n=setTimeout(i,t)};var o=e.stop;return e.stop=function(){r=!1,clearTimeout(n),o()},e.isRunning=function(){return r},e}var eO="events",eI=n(83780);function eF(e,t){var n;if(eP(e))for(var r=Object.keys(e),i=0;i<r.length&&!n;i++){var o=r[i],s=t(e[o],o,e);s&&(n=e[o])}else if(Array.isArray(e))for(var i=0;i<e.length&&!n;i++){var s=t(e[i],i,e);s&&(n=e[i])}return n}function eL(e,t){if(Array.isArray(e)&&"function"==typeof t){for(var n=0;n<e.length;n++)if(!0===t(e[n],n,e))return n}return -1}function ex(e,t){return Object.keys(e).forEach(function(n){return t(e[n],n,e)}),e}function eD(e,t,n){var r=n;try{var i=t.split("."),o=e;i.forEach(function(e){return o=o[e]}),void 0!==o&&(r=o)}catch(e){}return r}function eM(e){return!0===e||!1===e}function eK(e){return e instanceof Number&&(e=e.valueOf()),"number"==typeof e&&(Number.isFinite?Number.isFinite(e):isFinite(e))}function eU(e){return e instanceof Number&&(e=e.valueOf()),e!=e}function eP(e){return null!==e&&"object"==typeof e&&(e.constructor===Object||null!=e.constructor&&"Object"===e.constructor.name)}function eB(e){return"string"==typeof e||e instanceof String}function ez(e){return eB(e)?e.toUpperCase():e}function ej(e,t){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];var i=e;if(eP(t)&&Object.keys(t).forEach(function(e){var n=t[e];eP(n)&&(n=i[e]&&eP(i[e])?ej({},i[e],n):ej({},n)),void 0!==n&&(i[e]=n)}),n&&n.length){var o=n.splice(0,1)[0];i=ej.apply(void 0,(0,eI.ev)([i,o],n,!1))}return i}function eq(e,t){return!!(eB(e)&&eB(t))&&e.slice(0,t.length)===t}function eW(e){if("number"==typeof e)return e;if(eP(e)&&"function"==typeof e.valueOf){var t=e.valueOf();e=eP(t)?t+"":t}return"string"!=typeof e?0===e?e:+e:+(e=e.replace(/^\s+|\s+$/g,""))}function eG(e){if(null==e)return"";if("string"==typeof e)return e;if(Array.isArray(e))return e.map(function(e){return eB(e)?e:""})+"";var t=e+"";return"0"===t&&1/e===Number.NEGATIVE_INFINITY?"-0":t}function eH(e){var t={};return e.filter(function(e){return!Object.prototype.hasOwnProperty.call(t,e)&&(t[e]=!0)})}var eZ="impressions";function eQ(e,t){var n=function(e,t){var n={};if(Array.isArray(e)&&eB(t))for(var r=0;r<e.length;r++){var i=e[r][t];eB(i)&&(n[i]||(n[i]=[]),n[i].push(e[r]))}return n}(t,"feature"),r=[];return ex(n,function(t,n){r.push({f:n,i:t.map(function(t){return{k:t.keyName,t:t.treatment,m:t.time,c:t.changeNumber,r:e?t.label:void 0,b:t.bucketingKey?t.bucketingKey:void 0,pt:t.pt?t.pt:void 0}})})}),r}function eV(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++){var i=n[r].split("::");if(2===i.length){var o={f:i[0],m:Number(i[1]),rc:e[n[r]]};t.push(o)}}return{pf:t}}var eY="state::splits-arrived",eJ="state::splits-cache-loaded",e$="state::segments-arrived",eX="init::timeout",e0="init::ready",e1="init::cache-ready",e2="state::update";function e3(e){return ei===e||eo===e}var e5=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/;function e6(e,t,n,r){if(void 0===r&&(r="feature flag name"),void 0==t)e.error(315,[n,r]);else if(eB(t)){if(e5.test(t)&&(e.warn(214,[n,r,t]),t=t.trim()),t.length>0)return t;e.error(319,[n,r])}else e.error(318,[n,r]);return!1}function e4(e,t,n,r,i){if(void 0===r&&(r="feature flag names"),void 0===i&&(i="feature flag name"),Array.isArray(t)&&t.length>0){var o=[];if(t.forEach(function(t){var r=e6(e,t,n,i);r&&o.push(r)}),o.length)return eH(o)}return e.error(320,[n,r]),!1}var e8=[{type:"bySet",maxLength:50,queryParam:"sets="},{type:"byName",maxLength:400,queryParam:"names="},{type:"byPrefix",maxLength:50,queryParam:"prefixes="}],e7=/^[a-z0-9][_a-z0-9]{0,49}$/,e9=/[A-Z]/;function te(e,t,n){return eH(t.map(function(t){return e9.test(t)&&(e.warn(226,[n,t]),t=t.toLowerCase()),t}).filter(function(t){return e7.test(t)?"string"==typeof t:(e.warn(225,[n,t,e7,t]),!1)}))}function tt(e,t){return eF(e,function(e){return e.type===t&&e.values.length>0})}function tn(e,t,n,r){if(void 0==t)return e.error(315,[n,r]),!1;if(eK(t))return e.warn(213,[n,r,t]),eG(t);if(eB(t)){if((t=t.trim()).length>0&&t.length<=250)return t;0===t.length?e.error(319,[n,r]):t.length>250&&e.error(316,[n,r])}else e.error(318,[n,r]);return!1}function tr(e,t,n){if(!eP(t))return tn(e,t,n,"key");var r=tn(e,t.matchingKey,n,"matchingKey"),i=tn(e,t.bucketingKey,n,"bucketingKey");return r&&i?{matchingKey:r,bucketingKey:i}:(e.error(317,[n]),!1)}var ti=/[A-Z]/,to="traffic_type";function ts(e,t,n){if(void 0==t)e.error(315,[n,to]);else if(eB(t)){if(0!==t.length)return ti.test(t)&&(e.warn(216,[n]),t=t.toLowerCase()),t;e.error(319,[n,to])}else e.error(318,[n,to]);return!1}var ta={mode:er,core:{authorizationKey:void 0,key:void 0,trafficType:void 0,labelsEnabled:!0,IPAddressesEnabled:void 0},scheduler:{featuresRefreshRate:60,segmentsRefreshRate:60,telemetryRefreshRate:3600,impressionsRefreshRate:300,offlineRefreshRate:15,eventsPushRate:60,eventsQueueSize:500,impressionsQueueSize:3e4,pushRetryBackoffBase:1},urls:{sdk:"https://sdk.split.io/api",events:"https://events.split.io/api",auth:"https://auth.split.io/api",streaming:"https://streaming.split.io",telemetry:"https://telemetry.split.io/api"},storage:void 0,debug:void 0,impressionListener:void 0,version:void 0,integrations:void 0,streamingEnabled:!0,sync:{splitFilters:void 0,impressionsMode:ee,localhostMode:void 0,enabled:!0,flagSpecVersion:"1.1"},log:void 0};function tu(e){return Math.round(1e3*e)}var tc="sdk_key",tl={};function tf(e){var t=e();return function(){return Math.round(e()-t)}}var th=((l={})[er]=0,l[ei]=1,l[eo]=2,l),tp=((f={})[ee]=0,f[X]=1,f[et]=2,f),td=((h={})[el]=1,h[eu]=2,h[ec]=3,h),tg="unique keys",tm="PUSH_NONRETRYABLE_ERROR",tv="PUSH_RETRYABLE_ERROR",ty="PUSH_SUBSYSTEM_UP",tS="PUSH_SUBSYSTEM_DOWN",tb="MY_SEGMENTS_UPDATE",tT="MY_SEGMENTS_UPDATE_V2",tE="SEGMENT_UPDATE",t_="SPLIT_KILL",tR="SPLIT_UPDATE",tk="CONTROL",tC="OCCUPANCY";function tw(e){var t=e.userConsent;return!t||t===eu}(r=p||(p={})).STREAMING_DISABLED="STREAMING_DISABLED",r.STREAMING_PAUSED="STREAMING_PAUSED",r.STREAMING_RESUMED="STREAMING_RESUMED",r.STREAMING_RESET="STREAMING_RESET";var tN=function(){function e(t,n,r){this.baseMillis=e.__TEST__BASE_MILLIS||n||e.DEFAULT_BASE_MILLIS,this.maxMillis=e.__TEST__MAX_MILLIS||r||e.DEFAULT_MAX_MILLIS,this.attempts=0,this.cb=t}return e.prototype.scheduleCall=function(){var e=this,t=Math.min(this.baseMillis*Math.pow(2,this.attempts),this.maxMillis);return this.timeoutID&&clearTimeout(this.timeoutID),this.timeoutID=setTimeout(function(){e.timeoutID=void 0,e.cb()},t),this.attempts++,t},e.prototype.reset=function(){this.attempts=0,this.timeoutID&&(clearTimeout(this.timeoutID),this.timeoutID=void 0)},e.DEFAULT_BASE_MILLIS=1e3,e.DEFAULT_MAX_MILLIS=18e5,e}(),tA=[/control_pri$/,/control_sec$/],tO=[10,20],tI="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function tF(e){var t=String(e).replace(/[=]+$/,"");if(t.length%4==1)throw Error("'atob' failed: The string to be decoded is not correctly encoded.");for(var n="",r=0,i=void 0,o=void 0,s=0;o=t.charAt(s++);~o&&(i=r%4?64*i+o:o,r++%4)&&(n+=String.fromCharCode(255&i>>(-2*r&6))))o=tI.indexOf(o);return n}var tL=String.fromCharCode;function tx(e){var t,n,r,i,o;return i=function(e){if("string"!=typeof e)throw TypeError("Illegal argument: "+typeof e);var t=0;return function(){return t>=e.length?null:e.charCodeAt(t++)}}(e),n=[],r=[],o=t=function(){if(0==arguments.length)return r.join("")+tL.apply(String,n);n.length+arguments.length>1024&&(r.push(tL.apply(String,n)),n.length=0),Array.prototype.push.apply(n,arguments)},function(e,t){for(var n,r=null;null!==(n=null!==r?r:e());){if(n>=55296&&n<=57343&&null!==(r=e())&&r>=56320&&r<=57343){t((n-55296)*1024+r-56320+65536),r=null;continue}t(n)}null!==r&&t(r)}(i,function(e){!function(e,t){var n=null;for("number"==typeof e&&(n=e,e=function(){return null});null!==n||null!==(n=e());)n<128?t(127&n):(n<2048?t(n>>6&31|192):(n<65536?t(n>>12&15|224):(t(n>>18&7|240),t(n>>12&63|128)),t(n>>6&63|128)),t(63&n|128)),n=null}(e,o)}),t()}function tD(e,t){return(65535&e)*t+(((e>>>16)*t&65535)<<16)}function tM(e,t){return e<<t|e>>>32-t}function tK(e,t){return function(e,t){t=t||0;for(var n,r=(e=e||"").length%4,i=e.length-r,o=t,s=0,a=0;a<i;a+=4)s=tM(s=tD(s=255&e.charCodeAt(a)|(255&e.charCodeAt(a+1))<<8|(255&e.charCodeAt(a+2))<<16|(255&e.charCodeAt(a+3))<<24,3432918353),15),o^=s=tD(s,461845907),o=tD(o=tM(o,13),5)+3864292196;switch(s=0,r){case 3:s^=(255&e.charCodeAt(a+2))<<16;case 2:s^=(255&e.charCodeAt(a+1))<<8;case 1:s^=255&e.charCodeAt(a),s=tM(s=tD(s,3432918353),15),o^=s=tD(s,461845907)}return o^=e.length,n=o,n^=n>>>16,n=tD(n,2246822507),n^=n>>>13,n=tD(n,3266489909),(o=n^=n>>>16)>>>0}(tx(e),t>>>0)}function tU(e,t){return Math.abs(tK(e,t)%100)+1}function tP(e){return function(e){for(var t=String(e),n="",r=void 0,i=void 0,o=0,s=tI;t.charAt(0|o)||(s="=",o%1);n+=s.charAt(63&r>>8-o%1*8)){if((i=t.charCodeAt(o+=3/4))>255)throw Error("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");r=r<<8|i}return n}(tK(e,0).toString())}var tB=/^control_/,tz=function(){function e(e,t){var n,r,i,o,s=t.getEventSource,a=t.getOptions;if(this.settings=e,this.eventSource=s&&s(e),!this.eventSource)throw Error("EventSource API is not available.");this.headers=(n={SplitSDKClientKey:eB(e.core.authorizationKey)?e.core.authorizationKey.slice(-4):"",SplitSDKVersion:e.version},i=(r=e.runtime).ip,o=r.hostname,i&&(n.SplitSDKMachineIP=i),o&&(n.SplitSDKMachineName=o),n),this.options=a&&a(e)}return e.prototype.setEventHandler=function(e){this.handler=e},e.prototype.open=function(e){this.close();var t,n=Object.keys(e.channels).map(function(e){return encodeURIComponent((tB.test(e)?"[?occupancy=metrics.publishers]":"")+e)}).join(","),r=this.settings.urls.streaming+"/sse?channels="+n+"&accessToken="+e.token+"&v=1.1&heartbeats=true",i=!this.settings.core.key;this.connection=new this.eventSource(i?r:r+"&SplitSDKVersion="+this.headers.SplitSDKVersion+"&SplitSDKClientKey="+this.headers.SplitSDKClientKey,k(i?{headers:Z(this.settings,this.headers)}:(null===(t=this.settings.sync.requestOptions)||void 0===t?void 0:t.getHeaderOverrides)?{headers:Z(this.settings,{})}:{},this.options)),this.handler&&(this.connection.addEventListener("open",this.handler.handleOpen),this.connection.addEventListener("message",this.handler.handleMessage),this.connection.addEventListener("error",this.handler.handleError))},e.prototype.close=function(){this.connection&&this.connection.close()},e}();function tj(e){return eP(e)?e.matchingKey:e}function tq(e){return eP(e)?{matchingKey:e.matchingKey,bucketingKey:e.bucketingKey}:{matchingKey:e,bucketingKey:e}}(i=d||(d={}))[i.None=0]="None",i[i.Gzip=1]="Gzip",i[i.Zlib=2]="Zlib",(o=g||(g={}))[o.UnboundedFetchRequest=0]="UnboundedFetchRequest",o[o.BoundedFetchRequest=1]="BoundedFetchRequest",o[o.KeyList=2]="KeyList",o[o.SegmentRemoval=3]="SegmentRemoval";var tW=function(){if([typeof Uint8Array,typeof Uint16Array,typeof Uint32Array].some(function(e){return"function"!=e}))return"global Uint8Array object is not available for gzip/zlib decompression";var e=Uint8Array,t=Uint16Array,n=Uint32Array,r=new e([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new e([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),o=new e([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(e,r){for(var i=new t(31),o=0;o<31;++o)i[o]=r+=1<<e[o-1];for(var s=new n(i[30]),o=1;o<30;++o)for(var a=i[o];a<i[o+1];++a)s[a]=a-i[o]<<5|o;return[i,s]},a=s(r,2),u=a[0],c=a[1];u[28]=258,c[258]=28;for(var l=s(i,0)[0],f=new t(32768),h=0;h<32768;++h){var p=(43690&h)>>>1|(21845&h)<<1;p=(61680&(p=(52428&p)>>>2|(13107&p)<<2))>>>4|(3855&p)<<4,f[h]=((65280&p)>>>8|(255&p)<<8)>>>1}for(var d=function(e,n,r){for(var i,o=e.length,s=0,a=new t(n);s<o;++s)++a[e[s]-1];var u=new t(n);for(s=0;s<n;++s)u[s]=u[s-1]+a[s-1]<<1;if(r){i=new t(1<<n);var c=15-n;for(s=0;s<o;++s)if(e[s])for(var l=s<<4|e[s],h=n-e[s],p=u[e[s]-1]++<<h,d=p|(1<<h)-1;p<=d;++p)i[f[p]>>>c]=l}else for(s=0,i=new t(o);s<o;++s)e[s]&&(i[s]=f[u[e[s]-1]++]>>>15-e[s]);return i},g=new e(288),h=0;h<144;++h)g[h]=8;for(var h=144;h<256;++h)g[h]=9;for(var h=256;h<280;++h)g[h]=7;for(var h=280;h<288;++h)g[h]=8;for(var m=new e(32),h=0;h<32;++h)m[h]=5;var v=d(g,9,1),y=d(m,5,1),S=function(e){for(var t=e[0],n=1;n<e.length;++n)e[n]>t&&(t=e[n]);return t},b=function(e,t,n){var r=t/8|0;return(e[r]|e[r+1]<<8)>>(7&t)&n},T=function(e,t){var n=t/8|0;return(e[n]|e[n+1]<<8|e[n+2]<<16)>>(7&t)},E=function(r,i,o){(null==i||i<0)&&(i=0),(null==o||o>r.length)&&(o=r.length);var s=new(r instanceof t?t:r instanceof n?n:e)(o-i);return s.set(r.subarray(i,o)),s},_=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],R=function(e,t,n){var r=Error(t||_[e]);if(r.code=e,Error.captureStackTrace&&Error.captureStackTrace(r,R),!n)throw r;return r},k=function(t,n,s){var a=t.length;if(!a||s&&s.f&&!s.l)return n||new e(0);var c=!n||s,f=!s||s.i;s||(s={}),n||(n=new e(3*a));var h=function(t){var r=n.length;if(t>r){var i=new e(Math.max(2*r,t));i.set(n),n=i}},p=s.f||0,g=s.p||0,m=s.b||0,_=s.l,k=s.d,C=s.m,w=s.n,N=8*a;do{if(!_){p=b(t,g,1);var A=b(t,g+1,3);if(g+=3,A){if(1==A)_=v,k=y,C=9,w=5;else if(2==A){var O=b(t,g,31)+257,I=b(t,g+10,15)+4,F=O+b(t,g+5,31)+1;g+=14;for(var L=new e(F),x=new e(19),D=0;D<I;++D)x[o[D]]=b(t,g+3*D,7);g+=3*I;for(var M=S(x),K=(1<<M)-1,U=d(x,M,1),D=0;D<F;){var P=U[b(t,g,K)];g+=15&P;var B=P>>>4;if(B<16)L[D++]=B;else{var z=0,j=0;for(16==B?(j=3+b(t,g,3),g+=2,z=L[D-1]):17==B?(j=3+b(t,g,7),g+=3):18==B&&(j=11+b(t,g,127),g+=7);j--;)L[D++]=z}}var q=L.subarray(0,O),W=L.subarray(O);C=S(q),w=S(W),_=d(q,C,1),k=d(W,w,1)}else R(1)}else{var B=((g+7)/8|0)+4,G=t[B-4]|t[B-3]<<8,H=B+G;if(H>a){f&&R(0);break}c&&h(m+G),n.set(t.subarray(B,H),m),s.b=m+=G,s.p=g=8*H,s.f=p;continue}if(g>N){f&&R(0);break}}c&&h(m+131072);for(var Z=(1<<C)-1,Q=(1<<w)-1,V=g;;V=g){var z=_[T(t,g)&Z],Y=z>>>4;if((g+=15&z)>N){f&&R(0);break}if(z||R(2),Y<256)n[m++]=Y;else if(256==Y){V=g,_=null;break}else{var J=Y-254;if(Y>264){var D=Y-257,$=r[D];J=b(t,g,(1<<$)-1)+u[D],g+=$}var X=k[T(t,g)&Q],ee=X>>>4;X||R(3),g+=15&X;var W=l[ee];if(ee>3){var $=i[ee];W+=T(t,g)&(1<<$)-1,g+=$}if(g>N){f&&R(0);break}c&&h(m+131072);for(var et=m+J;m<et;m+=4)n[m]=n[m-W],n[m+1]=n[m+1-W],n[m+2]=n[m+2-W],n[m+3]=n[m+3-W];m=et}}s.l=_,s.p=V,s.b=m,s.f=p,_&&(p=1,s.m=C,s.d=k,s.n=w)}while(!p);return m==n.length?n:E(n,0,m)},C=function(e){(31!=e[0]||139!=e[1]||8!=e[2])&&R(6,"invalid gzip data");var t=e[3],n=10;4&t&&(n+=e[10]|(e[11]<<8)+2);for(var r=(t>>3&1)+(t>>4&1);r>0;r-=!e[n++]);return n+(2&t)},w=function(e){var t=e.length;return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0},N=function(e){((15&e[0])!=8||e[0]>>>4>7||(e[0]<<8|e[1])%31)&&R(6,"invalid zlib data"),32&e[1]&&R(6,"invalid zlib data: preset dictionaries not supported")};return{gunzipSync:function(t,n){return k(t.subarray(C(t),-8),n||new e(w(t)))},unzlibSync:function(e,t){return k((N(e),e.subarray(2,-4)),t)}}}();function tG(e,t){var n=new Uint8Array(tF(e).split("").map(function(e){return e.charCodeAt(0)}));if("string"==typeof tW)throw Error(tW);if(1===t)return tW.gunzipSync(n);if(2===t)return tW.unzlibSync(n);throw Error("Invalid compression algorithm #"+t)}function tH(e,t,n){void 0===n&&(n=!0);var r,i=(r=tG(e,t),String.fromCharCode.apply(null,r));return n&&(i=i.replace(/\d+/g,'"$&"')),JSON.parse(i)}function tZ(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]+t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]+t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]+t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]+t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function tQ(e,t){e=[e[0]>>>16,65535&e[0],e[1]>>>16,65535&e[1]],t=[t[0]>>>16,65535&t[0],t[1]>>>16,65535&t[1]];var n=[0,0,0,0];return n[3]+=e[3]*t[3],n[2]+=n[3]>>>16,n[3]&=65535,n[2]+=e[2]*t[3],n[1]+=n[2]>>>16,n[2]&=65535,n[2]+=e[3]*t[2],n[1]+=n[2]>>>16,n[2]&=65535,n[1]+=e[1]*t[3],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[2]*t[2],n[0]+=n[1]>>>16,n[1]&=65535,n[1]+=e[3]*t[1],n[0]+=n[1]>>>16,n[1]&=65535,n[0]+=e[0]*t[3]+e[1]*t[2]+e[2]*t[1]+e[3]*t[0],n[0]&=65535,[n[0]<<16|n[1],n[2]<<16|n[3]]}function tV(e,t){return 32==(t%=64)?[e[1],e[0]]:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t|e[0]>>>32-t]:(t-=32,[e[1]<<t|e[0]>>>32-t,e[0]<<t|e[1]>>>32-t])}function tY(e,t){return 0==(t%=64)?e:t<32?[e[0]<<t|e[1]>>>32-t,e[1]<<t]:[e[1]<<t-32,0]}function tJ(e,t){return[e[0]^t[0],e[1]^t[1]]}function t$(e){return e=tQ(e=tJ(e,[0,e[0]>>>1]),[4283543511,3981806797]),e=tQ(e=tJ(e,[0,e[0]>>>1]),[3301882366,444984403]),e=tJ(e,[0,e[0]>>>1])}function tX(e,t){return e<1?t:new Promise(function(n,r){var i=setTimeout(function(){r(Error("Operation timed out because it exceeded the configured time limit of "+e+" ms."))},e);t.then(function(e){clearTimeout(i),n(e)},function(e){clearTimeout(i),r(e)})})}var t0=function(){function e(e){void 0===e&&(e=0),this.maxQueue=e,this.queue=[]}return e.prototype.setOnFullQueueCb=function(e){this.onFullQueue=e},e.prototype.track=function(e){var t;(t=this.queue).push.apply(t,e),this.maxQueue>0&&this.queue.length>=this.maxQueue&&this.onFullQueue&&this.onFullQueue()},e.prototype.clear=function(){this.queue=[]},e.prototype.pop=function(e){var t=this.queue;return this.clear(),e?e.concat(t):t},e.prototype.isEmpty=function(){return 0===this.queue.length},e}();function t1(e){return e-e%36e5}var t2=function(){function e(e){void 0===e&&(e=3e4),this.cache={},this.cacheSize=0,this.maxStorage=e}return e.prototype._makeKey=function(e,t){return e+"::"+t1(t)},e.prototype.track=function(e,t,n){var r=this._makeKey(e,t),i=this.cache[r];this.cache[r]=i?i+n:n,this.onFullQueue&&(this.cacheSize=this.cacheSize+n,this.cacheSize>=this.maxStorage&&this.onFullQueue())},e.prototype.pop=function(e){var t=this.cache;return(this.clear(),e)?(Object.keys(t).forEach(function(n){e[n]?e[n]+=t[n]:e[n]=t[n]}),e):t},e.prototype.clear=function(){this.cache={},this.cacheSize=0},e.prototype.isEmpty=function(){return 0===Object.keys(this.cache).length},e}(),t3=function(){function e(e){void 0===e&&(e=0),this.maxQueue=e,this.queue=[],this.queueByteSize=0}return e.prototype.setOnFullQueueCb=function(e){this.onFullQueue=e},e.prototype.track=function(e,t){return void 0===t&&(t=0),this.queueByteSize+=t,this.queue.push(e),this._checkForFlush(),!0},e.prototype.clear=function(){this.queue=[],this.queueByteSize=0},e.prototype.pop=function(e){var t=this.queue;return this.clear(),e?e.concat(t):t},e.prototype.isEmpty=function(){return 0===this.queue.length},e.prototype._checkForFlush=function(){(this.queueByteSize>5242880||this.maxQueue>0&&this.queue.length>=this.maxQueue)&&this.onFullQueue&&this.onFullQueue()},e}(),t5=/[^.]+$/,t6=function(e){function t(t,n){var r=e.call(this,t)||this;return r.matchingKey=n,r.regexSplitsCacheKey=RegExp("^"+t+"\\.(splits?|trafficType|flagSet)\\."),r}return(0,eI.ZT)(t,e),t.prototype.buildSegmentNameKey=function(e){return this.prefix+"."+this.matchingKey+".segment."+e},t.prototype.extractSegmentName=function(e){var t=this.prefix+"."+this.matchingKey+".segment.";if(eq(e,t))return e.substr(t.length)},t.prototype.buildOldSegmentNameKey=function(e){return this.matchingKey+"."+this.prefix+".segment."+e},t.prototype.extractOldSegmentKey=function(e){var t=this.matchingKey+"."+this.prefix+".segment.";if(eq(e,t))return e.substr(t.length)},t.prototype.buildLastUpdatedKey=function(){return this.prefix+".splits.lastUpdated"},t.prototype.isSplitsCacheKey=function(e){return this.regexSplitsCacheKey.test(e)},t}(function(){function e(e){void 0===e&&(e="SPLITIO"),this.prefix=e}return e.prototype.buildTrafficTypeKey=function(e){return this.prefix+".trafficType."+e},e.prototype.buildFlagSetKey=function(e){return this.prefix+".flagSet."+e},e.prototype.buildSplitKey=function(e){return this.prefix+".split."+e},e.prototype.buildSplitsTillKey=function(){return this.prefix+".splits.till"},e.prototype.isSplitKey=function(e){return eq(e,this.prefix+".split.")},e.prototype.buildSplitKeyPrefix=function(){return this.prefix+".split."},e.prototype.buildSplitsWithSegmentCountKey=function(){return this.prefix+".splits.usingSegments"},e.prototype.buildSegmentNameKey=function(e){return this.prefix+".segment."+e},e.prototype.buildSegmentTillKey=function(e){return this.prefix+".segment."+e+".till"},e.prototype.extractKey=function(e){var t=e.match(t5);if(t&&t.length)return t[0];throw Error("Invalid latency key provided")},e.prototype.buildHashKey=function(){return this.prefix+".hash"},e}());function t4(){var e="__SPLITSOFTWARE__";try{return localStorage.setItem(e,e),localStorage.removeItem(e),!0}catch(e){return!1}}var t8=function(){function e(){}return e.prototype.addSplits=function(e){var t=this;return e.map(function(e){return t.addSplit(e[0],e[1])})},e.prototype.removeSplits=function(e){var t=this;return e.map(function(e){return t.removeSplit(e)})},e.prototype.getSplits=function(e){var t=this,n={};return e.forEach(function(e){n[e]=t.getSplit(e)}),n},e.prototype.getAll=function(){var e=this;return this.getSplitNames().map(function(t){return e.getSplit(t)})},e.prototype.checkCache=function(){return!1},e.prototype.killLocally=function(e,t,n){var r=this.getSplit(e);if(r&&(!r.changeNumber||r.changeNumber<n)){var i=k({},r);return i.killed=!0,i.defaultTreatment=t,i.changeNumber=n,this.addSplit(e,i)}return!1},e}();function t7(e){for(var t=e.conditions||[],n=0;n<t.length;n++)for(var r=t[n].matcherGroup.matchers,i=0;i<r.length;i++)if(r[i].matcherType===e_)return!0;return!1}var t9="storage:localstorage: ",ne=function(e){function t(t,n,r){var i=e.call(this)||this;return i.keys=n,i.log=t.log,i.storageHash=tK(t.core.authorizationKey+"::"+t.sync.__splitFiltersValidation.queryString+"::"+t.sync.flagSpecVersion).toString(16),i.flagSetsFilter=t.sync.__splitFiltersValidation.groupedFilters.bySet,i._checkExpiration(r),i._checkFilterQuery(),i}return(0,eI.ZT)(t,e),t.prototype._decrementCount=function(e){var t=eW(localStorage.getItem(e))-1;t>0?localStorage.setItem(e,t):localStorage.removeItem(e)},t.prototype._decrementCounts=function(e){try{if(e){var t=this.keys.buildTrafficTypeKey(e.trafficTypeName);if(this._decrementCount(t),t7(e)){var n=this.keys.buildSplitsWithSegmentCountKey();this._decrementCount(n)}}}catch(e){this.log.error(t9+e)}},t.prototype._incrementCounts=function(e){try{if(e){var t=this.keys.buildTrafficTypeKey(e.trafficTypeName);if(localStorage.setItem(t,eW(localStorage.getItem(t))+1),t7(e)){var n=this.keys.buildSplitsWithSegmentCountKey();localStorage.setItem(n,eW(localStorage.getItem(n))+1)}}}catch(e){this.log.error(t9+e)}},t.prototype.clear=function(){this.log.info(t9+"Flushing Splits data from localStorage");for(var e=localStorage.length,t=[],n=0;n<e;n++){var r=localStorage.key(n);null!=r&&this.keys.isSplitsCacheKey(r)&&t.push(r)}t.forEach(function(e){localStorage.removeItem(e)}),this.hasSync=!1},t.prototype.addSplit=function(e,t){try{var n=this.keys.buildSplitKey(e),r=localStorage.getItem(n),i=r?JSON.parse(r):null;return localStorage.setItem(n,JSON.stringify(t)),this._incrementCounts(t),this._decrementCounts(i),i&&this.removeFromFlagSets(i.name,i.sets),this.addToFlagSets(t),!0}catch(e){return this.log.error(t9+e),!1}},t.prototype.removeSplit=function(e){try{var t=this.getSplit(e);return localStorage.removeItem(this.keys.buildSplitKey(e)),this._decrementCounts(t),t&&this.removeFromFlagSets(t.name,t.sets),!0}catch(e){return this.log.error(t9+e),!1}},t.prototype.getSplit=function(e){var t=localStorage.getItem(this.keys.buildSplitKey(e));return t&&JSON.parse(t)},t.prototype.setChangeNumber=function(e){if(this.updateNewFilter){this.log.info(t9+"SDK key, flags filter criteria or flags spec version was modified. Updating cache");var t=this.keys.buildHashKey();try{localStorage.setItem(t,this.storageHash)}catch(e){this.log.error(t9+e)}this.updateNewFilter=!1}try{return localStorage.setItem(this.keys.buildSplitsTillKey(),e+""),localStorage.setItem(this.keys.buildLastUpdatedKey(),Date.now()+""),this.hasSync=!0,!0}catch(e){return this.log.error(t9+e),!1}},t.prototype.getChangeNumber=function(){var e=localStorage.getItem(this.keys.buildSplitsTillKey());return null!==e?eU(e=parseInt(e,10))?-1:e:-1},t.prototype.getSplitNames=function(){for(var e=localStorage.length,t=[],n=0;n<e;){var r=localStorage.key(n);null!=r&&this.keys.isSplitKey(r)&&t.push(this.keys.extractKey(r)),n++}return t},t.prototype.trafficTypeExists=function(e){var t=eW(localStorage.getItem(this.keys.buildTrafficTypeKey(e)));return eK(t)&&t>0},t.prototype.usesSegments=function(){if(!this.hasSync)return!0;var e=localStorage.getItem(this.keys.buildSplitsWithSegmentCountKey()),t=null===e?0:eW(e);return!eK(t)||t>0},t.prototype.checkCache=function(){return this.getChangeNumber()>-1},t.prototype._checkExpiration=function(e){var t=localStorage.getItem(this.keys.buildLastUpdatedKey());null!==t&&!eU(t=parseInt(t,10))&&e&&t<e&&this.clear()},t.prototype._checkFilterQuery=function(){var e=this.keys.buildHashKey();if(localStorage.getItem(e)!==this.storageHash)try{this.updateNewFilter=!0,this.checkCache()&&this.clear()}catch(e){this.log.error(t9+e)}},t.prototype.getNamesByFlagSets=function(e){var t=this;return e.map(function(e){var n=t.keys.buildFlagSetKey(e),r=localStorage.getItem(n);return new G(r?JSON.parse(r):[])})},t.prototype.addToFlagSets=function(e){var t=this;e.sets&&e.sets.forEach(function(n){if(!(t.flagSetsFilter.length>0)||t.flagSetsFilter.some(function(e){return e===n})){var r=t.keys.buildFlagSetKey(n),i=localStorage.getItem(r),o=new G(i?JSON.parse(i):[]);o.add(e.name),localStorage.setItem(r,JSON.stringify(W(o)))}})},t.prototype.removeFromFlagSets=function(e,t){var n=this;t&&t.forEach(function(t){n.removeNames(t,e)})},t.prototype.removeNames=function(e,t){var n=this.keys.buildFlagSetKey(e),r=localStorage.getItem(n);if(r){var i=new G(JSON.parse(r));if(i.delete(t),0===i.size){localStorage.removeItem(n);return}localStorage.setItem(n,JSON.stringify(W(i)))}},t}(t8),nt=function(){function e(){}return e.prototype.registerSegments=function(e){return!1},e.prototype.setChangeNumber=function(e,t){return!0},e.prototype.getChangeNumber=function(e){return -1},e.prototype.resetSegments=function(e){return!0},e}(),nn=function(e){function t(t,n){var r=e.call(this)||this;return r.log=t,r.keys=n,r}return(0,eI.ZT)(t,e),t.prototype.clear=function(){this.log.info(t9+"Flushing MySegments data from localStorage"),this.resetSegments([])},t.prototype.addToSegment=function(e){var t=this.keys.buildSegmentNameKey(e);try{return localStorage.setItem(t,"1"),!0}catch(e){return this.log.error(t9+e),!1}},t.prototype.removeFromSegment=function(e){var t=this.keys.buildSegmentNameKey(e);try{return localStorage.removeItem(t),!0}catch(e){return this.log.error(t9+e),!1}},t.prototype.isInSegment=function(e){return"1"===localStorage.getItem(this.keys.buildSegmentNameKey(e))},t.prototype.resetSegments=function(e){var t,n=this,r=!1,i=Object.keys(localStorage).reduce(function(t,r){var i=n.keys.extractSegmentName(r);if(i)t.push(i);else if(i=n.keys.extractOldSegmentKey(r)){var o=n.keys.buildSegmentNameKey(i);try{!localStorage.getItem(o)&&e.indexOf(i)>-1&&(localStorage.setItem(o,"1"),t.push(i)),localStorage.removeItem(r)}catch(e){n.log.error(e)}}return t},[]);if(0===e.length&&i.length===e.length)return r;if(i.length!==e.length)r=!0,i.forEach(function(e){return n.removeFromSegment(e)}),e.forEach(function(e){return n.addToSegment(e)});else{for(t=0;t<e.length&&-1!==i.indexOf(e[t]);t++);t<e.length&&(r=!0,i.forEach(function(e){return n.removeFromSegment(e)}),e.forEach(function(e){return n.addToSegment(e)}))}return r},t.prototype.getRegisteredSegments=function(){var e=this;return Object.keys(localStorage).reduce(function(t,n){var r=e.keys.extractSegmentName(n);return r&&t.push(r),t},[])},t.prototype.getKeysCount=function(){return 1},t}(nt),nr=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.segmentCache={},t}return(0,eI.ZT)(t,e),t.prototype.clear=function(){this.segmentCache={}},t.prototype.addToSegment=function(e){return this.segmentCache[e]=!0,!0},t.prototype.removeFromSegment=function(e){return delete this.segmentCache[e],!0},t.prototype.isInSegment=function(e){return!0===this.segmentCache[e]},t.prototype.resetSegments=function(e){var t,n=this,r=!1,i=Object.keys(this.segmentCache);if(0===e.length&&i.length===e.length)return r;if(i.length!==e.length)r=!0,this.segmentCache={},e.forEach(function(e){n.addToSegment(e)});else{for(t=0;t<e.length&&this.isInSegment(e[t]);t++);t<e.length&&(r=!0,this.segmentCache={},e.forEach(function(e){n.addToSegment(e)}))}return r},t.prototype.getRegisteredSegments=function(){return Object.keys(this.segmentCache)},t.prototype.getKeysCount=function(){return 1},t}(nt),ni=function(e){function t(t){var n=e.call(this)||this;return n.splitsCache={},n.ttCache={},n.changeNumber=-1,n.splitsWithSegmentsCount=0,n.flagSetsCache={},n.flagSetsFilter=t?t.groupedFilters.bySet:[],n}return(0,eI.ZT)(t,e),t.prototype.clear=function(){this.splitsCache={},this.ttCache={},this.changeNumber=-1,this.splitsWithSegmentsCount=0},t.prototype.addSplit=function(e,t){var n=this.getSplit(e);if(n){var r=n.trafficTypeName;this.ttCache[r]--,this.ttCache[r]||delete this.ttCache[r],this.removeFromFlagSets(n.name,n.sets),t7(n)&&this.splitsWithSegmentsCount--}if(!t)return!1;this.splitsCache[e]=t;var i=t.trafficTypeName;return this.ttCache[i]=(this.ttCache[i]||0)+1,this.addToFlagSets(t),t7(t)&&this.splitsWithSegmentsCount++,!0},t.prototype.removeSplit=function(e){var t=this.getSplit(e);if(!t)return!1;delete this.splitsCache[e];var n=t.trafficTypeName;return this.ttCache[n]--,this.ttCache[n]||delete this.ttCache[n],this.removeFromFlagSets(t.name,t.sets),t7(t)&&this.splitsWithSegmentsCount--,!0},t.prototype.getSplit=function(e){return this.splitsCache[e]||null},t.prototype.setChangeNumber=function(e){return this.changeNumber=e,!0},t.prototype.getChangeNumber=function(){return this.changeNumber},t.prototype.getSplitNames=function(){return Object.keys(this.splitsCache)},t.prototype.trafficTypeExists=function(e){return eK(this.ttCache[e])&&this.ttCache[e]>0},t.prototype.usesSegments=function(){return -1===this.getChangeNumber()||this.splitsWithSegmentsCount>0},t.prototype.getNamesByFlagSets=function(e){var t=this;return e.map(function(e){return t.flagSetsCache[e]||new G})},t.prototype.addToFlagSets=function(e){var t=this;e.sets&&e.sets.forEach(function(n){(!(t.flagSetsFilter.length>0)||t.flagSetsFilter.some(function(e){return e===n}))&&(t.flagSetsCache[n]||(t.flagSetsCache[n]=new G([])),t.flagSetsCache[n].add(e.name))})},t.prototype.removeFromFlagSets=function(e,t){var n=this;t&&t.forEach(function(t){n.removeNames(t,e)})},t.prototype.removeNames=function(e,t){this.flagSetsCache[e]&&(this.flagSetsCache[e].delete(t),0===this.flagSetsCache[e].size&&delete this.flagSetsCache[e])},t}(t8),no="GOOGLE_ANALYTICS_TO_SPLIT",ns="SPLIT_TO_GOOGLE_ANALYTICS";function na(e){var t=Math.min(22,Math.max(0,Math.ceil(Math.log(e)/Math.log(1.5))));return eU(t)?0:t}function nu(){return[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}function nc(e){var t=e.settings;return t.mode!==en&&(void 0===t.core.key||.001>=Math.random())}var nl=function(){function e(e,t){this.splits=e,this.segments=t,this.e=!0,this.notReadyUsage=0,this.impressionStats=[0,0,0],this.eventStats=[0,0],this.lastSync={},this.httpErrors={},this.httpLatencies={},this.authRejections=0,this.tokenRefreshes=0,this.streamingEvents=[],this.tags=[],this.exceptions={},this.latencies={},this.updatesFromSSE={sp:0,ms:0}}return e.prototype.isEmpty=function(){return this.e},e.prototype.clear=function(){},e.prototype.pop=function(){return this.e=!0,{lS:this.getLastSynchronization(),mL:this.popLatencies(),mE:this.popExceptions(),hE:this.popHttpErrors(),hL:this.popHttpLatencies(),tR:this.popTokenRefreshes(),aR:this.popAuthRejections(),iQ:this.getImpressionStats(0),iDe:this.getImpressionStats(2),iDr:this.getImpressionStats(1),spC:this.splits&&this.splits.getSplitNames().length,seC:this.segments&&this.segments.getRegisteredSegments().length,skC:this.segments&&this.segments.getKeysCount(),sL:this.getSessionLength(),eQ:this.getEventStats(0),eD:this.getEventStats(1),sE:this.popStreamingEvents(),t:this.popTags(),ufs:this.popUpdatesFromSSE()}},e.prototype.getTimeUntilReady=function(){return this.timeUntilReady},e.prototype.recordTimeUntilReady=function(e){this.timeUntilReady=e},e.prototype.getTimeUntilReadyFromCache=function(){return this.timeUntilReadyFromCache},e.prototype.recordTimeUntilReadyFromCache=function(e){this.timeUntilReadyFromCache=e},e.prototype.getNonReadyUsage=function(){return this.notReadyUsage},e.prototype.recordNonReadyUsage=function(){this.notReadyUsage++},e.prototype.getImpressionStats=function(e){return this.impressionStats[e]},e.prototype.recordImpressionStats=function(e,t){this.impressionStats[e]+=t,this.e=!1},e.prototype.getEventStats=function(e){return this.eventStats[e]},e.prototype.recordEventStats=function(e,t){this.eventStats[e]+=t,this.e=!1},e.prototype.getLastSynchronization=function(){return this.lastSync},e.prototype.recordSuccessfulSync=function(e,t){this.lastSync[e]=t,this.e=!1},e.prototype.popHttpErrors=function(){var e=this.httpErrors;return this.httpErrors={},e},e.prototype.recordHttpError=function(e,t){var n=this.httpErrors[e]=this.httpErrors[e]||{};n[t]=(n[t]||0)+1,this.e=!1},e.prototype.popHttpLatencies=function(){var e=this.httpLatencies;return this.httpLatencies={},e},e.prototype.recordHttpLatency=function(e,t){var n=this.httpLatencies[e]=this.httpLatencies[e]||nu();n[na(t)]++,this.e=!1},e.prototype.popAuthRejections=function(){var e=this.authRejections;return this.authRejections=0,e},e.prototype.recordAuthRejections=function(){this.authRejections++,this.e=!1},e.prototype.popTokenRefreshes=function(){var e=this.tokenRefreshes;return this.tokenRefreshes=0,e},e.prototype.recordTokenRefreshes=function(){this.tokenRefreshes++,this.e=!1},e.prototype.popStreamingEvents=function(){return this.streamingEvents.splice(0)},e.prototype.recordStreamingEvents=function(e){this.streamingEvents.length<20&&this.streamingEvents.push(e),this.e=!1},e.prototype.popTags=function(){return this.tags.splice(0)},e.prototype.addTag=function(e){this.tags.length<10&&this.tags.push(e),this.e=!1},e.prototype.getSessionLength=function(){return this.sessionLength},e.prototype.recordSessionLength=function(e){this.sessionLength=e,this.e=!1},e.prototype.popExceptions=function(){var e=this.exceptions;return this.exceptions={},e},e.prototype.recordException=function(e){this.exceptions[e]=(this.exceptions[e]||0)+1,this.e=!1},e.prototype.popLatencies=function(){var e=this.latencies;return this.latencies={},e},e.prototype.recordLatency=function(e,t){var n=this.latencies[e]=this.latencies[e]||nu();n[na(t)]++,this.e=!1},e.prototype.popUpdatesFromSSE=function(){var e=this.updatesFromSSE;return this.updatesFromSSE={sp:0,ms:0},e},e.prototype.recordUpdatesFromSSE=function(e){this.updatesFromSSE[e]++,this.e=!1},e}(),nf=function(){function e(e){void 0===e&&(e=3e4),this.uniqueTrackerSize=0,this.uniqueKeysTracker={},this.maxStorage=e}return e.prototype.setOnFullQueueCb=function(e){this.onFullQueue=e},e.prototype.track=function(e,t){this.uniqueKeysTracker[e]||(this.uniqueKeysTracker[e]=new G);var n=this.uniqueKeysTracker[e];!n.has(t)&&(n.add(t),this.uniqueTrackerSize++),this.uniqueTrackerSize>=this.maxStorage&&this.onFullQueue&&this.onFullQueue()},e.prototype.clear=function(){this.uniqueTrackerSize=0,this.uniqueKeysTracker={}},e.prototype.pop=function(){var e=this.uniqueKeysTracker;return this.clear(),this.fromUniqueKeysCollector(e)},e.prototype.isEmpty=function(){return 0===Object.keys(this.uniqueKeysTracker).length},e.prototype.fromUniqueKeysCollector=function(e){for(var t=[],n=Object.keys(e),r=0;r<n.length;r++){var i=n[r],o=W(e[i]),s={k:i,fs:o};t.push(s)}return{keys:t}},e}();function nh(e){var t=e.settings,n=t.scheduler,r=n.impressionsQueueSize,i=n.eventsQueueSize,o=t.sync,s=o.impressionsMode,a=o.__splitFiltersValidation,u=new ni(a),c=new nr,l={splits:u,segments:c,impressions:new t0(r),impressionCounts:s!==X?new t2:void 0,events:new t3(i),telemetry:nc(e)?new nl(u,c):void 0,uniqueKeys:s===et?new nf:void 0,destroy:function(){this.splits.clear(),this.segments.clear(),this.impressions.clear(),this.impressionCounts&&this.impressionCounts.clear(),this.events.clear(),this.uniqueKeys&&this.uniqueKeys.clear()},shared:function(){return{splits:this.splits,segments:new nr,impressions:this.impressions,impressionCounts:this.impressionCounts,events:this.events,telemetry:this.telemetry,destroy:function(){this.splits=new ni(a),this.segments.clear()}}}};if(e.settings.mode===en){var f=function(){return!0};l.impressions.track=f,l.events.track=f,l.impressionCounts&&(l.impressionCounts.track=f),l.uniqueKeys&&(l.uniqueKeys.track=f)}return l}function np(e){return null!=e&&"function"==typeof e.then}function nd(e,t,n){return!t.isDestroyed()||(e.error(314,[n]),!1)}function ng(e,t,n,r){return!!(t.isReady()||t.isReadyFromCache())||(e.warn(203,[n,r?" for feature flag "+r.toString():""]),!1)}nh.type=es;var nm="definition not found",nv="not ready",ny="exception";function nS(e,t,n,r,i){return!t.isReady()||r!==nm&&null!=r||(e.warn(215,[i,n]),!1)}function nb(e){var t,n;return e?{name:e.name,trafficType:e.trafficTypeName,killed:e.killed,changeNumber:e.changeNumber||0,treatments:((n=eF(t=e.conditions,function(e){return"ROLLOUT"===e.conditionType}))||(n=t[0]),n?n.partitions.map(function(e){return e.treatment}):[]),configs:e.configurations||{},sets:e.sets||[],defaultTreatment:e.defaultTreatment}:null}function nT(e){var t=[];return e.forEach(function(e){var n=nb(e);n&&t.push(n)}),t}function nE(e,t,n){var r=n.readinessManager,i=n.sdkStatus,o=e.log,s=e3(e.mode);return k(Object.create(i),{split:function(e){var n=e6(o,e,eb);if(!nd(o,r,eb)||!ng(o,r,eb)||!n)return s?Promise.resolve(null):null;var i=t.getSplit(n);return np(i)?i.catch(function(){return null}).then(function(e){return nS(o,r,n,e,eb),nb(e)}):(nS(o,r,n,i,eb),nb(i))},splits:function(){if(!nd(o,r,eT)||!ng(o,r,eT))return s?Promise.resolve([]):[];var e=t.getAll();return np(e)?e.catch(function(){return[]}).then(nT):nT(e)},names:function(){if(!nd(o,r,eE)||!ng(o,r,eE))return s?Promise.resolve([]):[];var e=t.getSplitNames();return np(e)?e.catch(function(){return[]}):e}})}var n_=function(){function e(){this.attributesCache={}}return e.prototype.setAttribute=function(e,t){return this.attributesCache[e]=t,!0},e.prototype.getAttribute=function(e){return this.attributesCache[e]},e.prototype.setAttributes=function(e){return this.attributesCache=k(this.attributesCache,e),!0},e.prototype.getAll=function(){return this.attributesCache},e.prototype.removeAttribute=function(e){return Object.keys(this.attributesCache).indexOf(e)>=0&&(delete this.attributesCache[e],!0)},e.prototype.clear=function(){return this.attributesCache={},!0},e}();function nR(e,t,n){return void 0==t||eP(t)?t:(e.error(311,[n,"attributes"]),!1)}function nk(e,t,n){if(!nR(e,t,n))return!1;var r=!0;return Object.keys(t).forEach(function(i){!function(e,t,n,r){if(!eB(t)||0===t.length)return e.warn(r+": you passed an invalid attribute name, attribute name must be a non-empty string."),!1;var i=eB(n),o=eK(n),s=eM(n),a=Array.isArray(n);return!!i||!!o||!!s||!!a||(e.warn(r+": you passed an invalid attribute value for "+t+". Acceptable types are: string, number, boolean and array of strings."),!1)}(e,i,t[i],n)&&(r=!1)}),r}function nC(e,t,n,r){var i=function(e,t){var n=new n_,r=t.getTreatment,i=t.getTreatmentWithConfig,o=t.getTreatments,s=t.getTreatmentsWithConfig,a=t.getTreatmentsByFlagSets,u=t.getTreatmentsWithConfigByFlagSets,c=t.getTreatmentsByFlagSet,l=t.getTreatmentsWithConfigByFlagSet,f=t.track;function h(e){var t=n.getAll();return Object.keys(t).length>0?k({},t,e):e}return k(t,{getTreatment:function(e,t,n){return r(e,t,h(n))},getTreatmentWithConfig:function(e,t,n){return i(e,t,h(n))},getTreatments:function(e,t,n){return o(e,t,h(n))},getTreatmentsWithConfig:function(e,t,n){return s(e,t,h(n))},getTreatmentsByFlagSets:function(e,t,n){return a(e,t,h(n))},getTreatmentsWithConfigByFlagSets:function(e,t,n){return u(e,t,h(n))},getTreatmentsByFlagSet:function(e,t,n){return c(e,t,h(n))},getTreatmentsWithConfigByFlagSet:function(e,t,n){return l(e,t,h(n))},track:function(e,t,n,r,i){return f(e,t,n,r,i)},setAttribute:function(t,r){var i={};return i[t]=r,!!nk(e,i,"setAttribute")&&(e.debug("stored "+r+" for attribute "+t),n.setAttribute(t,r))},getAttribute:function(t){return e.debug("retrieved attribute "+t),n.getAttribute(t+"")},setAttributes:function(t){return!!nk(e,t,"setAttributes")&&n.setAttributes(t)},getAttributes:function(){return n.getAll()},removeAttribute:function(t){return e.debug("removed attribute "+t),n.removeAttribute(t+"")},clearAttributes:function(){return n.clear()}})}(e,t);return k(i,{getTreatment:i.getTreatment.bind(i,n),getTreatmentWithConfig:i.getTreatmentWithConfig.bind(i,n),getTreatments:i.getTreatments.bind(i,n),getTreatmentsWithConfig:i.getTreatmentsWithConfig.bind(i,n),getTreatmentsByFlagSets:i.getTreatmentsByFlagSets.bind(i,n),getTreatmentsWithConfigByFlagSets:i.getTreatmentsWithConfigByFlagSets.bind(i,n),getTreatmentsByFlagSet:i.getTreatmentsByFlagSet.bind(i,n),getTreatmentsWithConfigByFlagSet:i.getTreatmentsWithConfigByFlagSet.bind(i,n),track:r?i.track.bind(i,n,r):i.track.bind(i,n),isClientSide:!0,key:n,trafficType:r})}var nw={UNDEFINED:0,ALL_KEYS:1,IN_SEGMENT:2,WHITELIST:3,EQUAL_TO:4,GREATER_THAN_OR_EQUAL_TO:5,LESS_THAN_OR_EQUAL_TO:6,BETWEEN:7,EQUAL_TO_SET:8,CONTAINS_ANY_OF_SET:9,CONTAINS_ALL_OF_SET:10,PART_OF_SET:11,ENDS_WITH:12,STARTS_WITH:13,CONTAINS_STRING:14,IN_SPLIT_TREATMENT:15,EQUAL_TO_BOOLEAN:16,MATCHES_STRING:17,EQUAL_TO_SEMVER:18,GREATER_THAN_OR_EQUAL_TO_SEMVER:19,LESS_THAN_OR_EQUAL_TO_SEMVER:20,BETWEEN_SEMVER:21,IN_LIST_SEMVER:22},nN={BOOLEAN:"BOOLEAN",STRING:"STRING",NUMBER:"NUMBER",SET:"SET",DATETIME:"DATETIME",NOT_SPECIFIED:"NOT_SPECIFIED"};function nA(e){return e&&e.whitelist}function nO(e){return new Date(e).setUTCHours(0,0,0,0)}function nI(e){return new Date(e).setUTCSeconds(0,0)}var nF=function(){function e(e,t){if(100!==e[e.length-1])throw RangeError("Provided invalid dataset as input");this._ranges=e,this._treatments=t}return e.parse=function(t){var n=t.reduce(function(e,t){var n=t.size,r=t.treatment;return e.ranges.push(e.inc+=n),e.treatments.push(r),e},{inc:0,ranges:[],treatments:[]});return new e(n.ranges,n.treatments)},e.prototype.getTreatmentFor=function(e){if(e<0||e>100)throw RangeError("Please provide a value between 0 and 100");var t=eL(this._ranges,function(t){return e<=t});return this._treatments[t]},e}(),nL=/^[0-9]+$/;function nx(e,t){if(nL.test(e)&&nL.test(t)){var n=e.length-t.length;if(0!==n)return n}return e<t?-1:e>t?1:0}function nD(e){return e.replace(/^0+(?=\d)/,"")}function nM(e){throw Error("Unable to convert to Semver, incorrect format: "+e)}var nK=function(){function e(e){eB(e)||nM(e);var t=e.indexOf("+"),n=-1===t?[e]:[e.slice(0,t),e.slice(t+1)],r=n[0],i=n[1];""===i&&nM(e),-1===(t=r.indexOf("-"))?(this._isStable=!0,this._preRelease=[]):(this._isStable=!1,this._preRelease=r.slice(t+1).split(".").map(function(t){return t||nM(e),nL.test(t)?nD(t):t}),r=r.slice(0,t));var o=r.split(".").map(function(t){return t&&nL.test(t)||nM(e),nD(t)});3!==o.length&&nM(e),this._major=o[0],this._minor=o[1],this._patch=o[2],this.version=o.join("."),this._preRelease.length&&(this.version+="-"+this._preRelease.join(".")),i&&(this.version+="+"+i)}return e.prototype.compare=function(e){if(this.version===e.version)return 0;var t=nx(this._major,e._major);if(0!==t||0!==(t=nx(this._minor,e._minor))||0!==(t=nx(this._patch,e._patch)))return t;if(!this._isStable&&e._isStable)return -1;if(this._isStable&&!e._isStable)return 1;for(var n=0,r=Math.min(this._preRelease.length,e._preRelease.length);n<r;n++){var i=nx(this._preRelease[n],e._preRelease[n]);if(0!==i)return i}return this._preRelease.length-e._preRelease.length},e}(),nU=[void 0,function(){return function(e){return null!=e}},function(e,t){return function(n){var r=t.segments.isInSegment(e,n);return np(r)&&r.then(function(e){return e}),r}},function(e){var t=new G(e);return function(e){return t.has(e)}},function(e){return function(t){return t===e}},function(e){return function(t){return t>=e}},function(e){return function(t){return t<=e}},function(e){return function(t){return t>=e.start&&t<=e.end}},function(e){return function(t){for(var n=t.length===e.length,r=function(r){0>eL(e,function(e){return e===t[r]})&&(n=!1)},i=0;i<t.length&&n;i++)r(i);return n}},function(e){return function(t){for(var n=!1,r=function(r){eL(t,function(t){return t===e[r]})>=0&&(n=!0)},i=0;i<e.length&&!n;i++)r(i);return n}},function(e){return function(t){var n=!0;if(t.length<e.length)n=!1;else for(var r=function(r){0>eL(t,function(t){return t===e[r]})&&(n=!1)},i=0;i<e.length&&n;i++)r(i);return n}},function(e){return function(t){for(var n=t.length<=e.length,r=function(r){0>eL(e,function(e){return e===t[r]})&&(n=!1)},i=0;i<t.length&&n;i++)r(i);return n}},function(e){return function(t){return e.some(function(e){var n,r,i;return n=t,r=e,void 0===i&&(i=!1),!!(eB(n)&&eB(r))&&(i&&(n=n.toLowerCase(),r=r.toLowerCase()),n.slice(n.length-r.length)===r)})}},function(e){return function(t){return e.some(function(e){return eq(t,e)})}},function(e){return function(t){return e.some(function(e){return eB(t)&&t.indexOf(e)>-1})}},function(e,t,n){var r=e.split,i=e.treatments;function o(e,t,r){var i=!1;return Array.isArray(t)&&(i=-1!==t.indexOf(e.treatment)),n.debug(10,[r,e.treatment,e.label,r,t,i]),i}return function(e,s){var a=e.key,u=e.attributes;n.debug(11,[r,JSON.stringify(a),u?"\n attributes: "+JSON.stringify(u):""]);var c=s(n,a,r,u,t);return np(c)?c.then(function(e){return o(e,i,r)}):o(c,i,r)}},function(e){return function(t){return e===t}},function(e){var t=new RegExp(e);return function(e){return t.test(e)}},function(e){var t=new nK(e);return function(e){var n=new nK(e);return t.version===n.version}},function(e){var t=new nK(e);return function(e){return new nK(e).compare(t)>=0}},function(e){var t=new nK(e);return function(e){return 0>=new nK(e).compare(t)}},function(e){var t=new nK(e.start),n=new nK(e.end);return function(e){var r=new nK(e);return 0>=t.compare(r)&&n.compare(r)>=0}},function(e){if(!e||0===e.length)throw Error("whitelistMatcherData is required for IN_LIST_SEMVER matcher type");var t=new G(e.map(function(e){return new nK(e).version}));return function(e){var n=new nK(e).version;return t.has(n)}}];function nP(e,t){return{key:e,attributes:t}}function nB(e,t,n,r,i,o){if(t){var s,a;return{treatment:(s=tU(n,r),a=i.getTreatmentFor(s),e.debug(3,[s,n,r,a]),a),label:o}}}function nz(e,t){return{treatment:eD(e,"treatment",t),label:eD(e,"label","default rule")}}var nj=function(){function e(e,t){this.baseInfo=e,this.evaluator=t,"string"!=typeof this.baseInfo.defaultTreatment&&(this.baseInfo.defaultTreatment=V)}return e.parse=function(t,n,r){var i=function(e,t,n){for(var r=[],i=0;i<t.length;i++){var o=t[i],s=o.matcherGroup,a=o.partitions,u=o.label,c=o.conditionType,l=(function(e){var t=e.map(function(e){var t,n=e.matcherType,r=e.negate,i=e.keySelector,o=e.userDefinedSegmentMatcherData,s=e.whitelistMatcherData,a=e.unaryNumericMatcherData,u=e.betweenMatcherData,c=e.dependencyMatcherData,l=e.booleanMatcherData,f=e.stringMatcherData,h=e.betweenStringMatcherData,p=i&&i.attribute,d=(t=nw[n])?t:nw.UNDEFINED,g=nN.STRING,m=void 0;return d===nw.IN_SEGMENT?m=o?o.segmentName:void 0:d===nw.EQUAL_TO?(m=a.value,g=nN.NUMBER,"DATETIME"===a.dataType&&(m=nO(m),g=nN.DATETIME)):d===nw.GREATER_THAN_OR_EQUAL_TO||d===nw.LESS_THAN_OR_EQUAL_TO?(m=a.value,g=nN.NUMBER,"DATETIME"===a.dataType&&(m=nI(m),g=nN.DATETIME)):d===nw.BETWEEN?(m=u,g=nN.NUMBER,"DATETIME"===m.dataType&&(m.start=nI(m.start),m.end=nI(m.end),g=nN.DATETIME)):d===nw.BETWEEN_SEMVER?m=h:d===nw.EQUAL_TO_SET||d===nw.CONTAINS_ANY_OF_SET||d===nw.CONTAINS_ALL_OF_SET||d===nw.PART_OF_SET?(m=nA(s),g=nN.SET):d===nw.WHITELIST||d===nw.IN_LIST_SEMVER||d===nw.STARTS_WITH||d===nw.ENDS_WITH||d===nw.CONTAINS_STRING?m=nA(s):d===nw.IN_SPLIT_TREATMENT?(m=c,g=nN.NOT_SPECIFIED):d===nw.EQUAL_TO_BOOLEAN?(g=nN.BOOLEAN,m=l):(d===nw.MATCHES_STRING||d===nw.EQUAL_TO_SEMVER||d===nw.GREATER_THAN_OR_EQUAL_TO_SEMVER||d===nw.LESS_THAN_OR_EQUAL_TO_SEMVER)&&(m=f),{attribute:p,negate:r,type:d,name:n,value:m,dataType:g}});return -1===eL(t,function(e){return e.type===nw.UNDEFINED})?t:[]})(s.matchers).map(function(t){var r;try{r=function(e,t,n){var r,i=t.type,o=t.value;return nU[i]&&(r=nU[i](o,n,e)),r}(e,t,n)}catch(n){e.error(329,[t.name,n])}return function(n,i,o){var s=function(e,t,n,r){var i,o=n.attribute,s=(i=void 0,o?r?(i=r[o],e.debug(23,[o,i])):e.warn(201,[o]):i=t,i),a=function(e,t,n,r,i){var o,s,a,u,c=function(e,t){switch(e){case nw.EQUAL_TO:return"DATETIME"===t?nO:void 0;case nw.GREATER_THAN_OR_EQUAL_TO:case nw.LESS_THAN_OR_EQUAL_TO:case nw.BETWEEN:return"DATETIME"===t?nI:void 0;case nw.IN_SPLIT_TREATMENT:return nP;default:return}}(t,r);switch(r){case nN.NUMBER:case nN.DATETIME:u=isNaN(o=eW(n))?void 0:o;break;case nN.STRING:s=n,eP(n)&&(s=n.matchingKey?n.matchingKey:void 0),u=eG(s)||void 0;break;case nN.SET:u=(a=Array.isArray(n)?eH(n.map(function(e){return e+""})):[]).length?a:void 0;break;case nN.BOOLEAN:u=function(e){if(!0===e||!1===e)return e;if("string"==typeof e){var t=e.toLocaleLowerCase();if("true"===t)return!0;if("false"===t)return!1}}(n);break;case nN.NOT_SPECIFIED:u=n;break;default:u=void 0}return c&&(u=c(u,i)),e.debug(24,[n,r,u instanceof Object?JSON.stringify(u):u]),u}(e,n.type,s,n.dataType,r);if(void 0!==a)return a;e.warn(200,[s+(o?" for attribute "+o:"")])}(e,n,t,i),a=!1;if(void 0!==s&&r)try{a=r(s,o)}catch(n){e.error(329,[t.name,n])}function u(n){return e.debug(40,[t.name,n,t.value,s]),!!(n^t.negate)}return np(a)?a.then(u):u(a)}});if(0===l.length){r=[];break}r.push(function(e,t,n,r,i){return function(o,s,a,u,c,l){if("ROLLOUT"===i&&(f=o.bucketingKey,a<100&&tU(f,u)>a))return{treatment:void 0,label:"not in split"};var f,h=t(o,c,l);return np(h)?h.then(function(t){return nB(e,t,o.bucketingKey,s,n,r)}):nB(e,h,o.bucketingKey,s,n,r)}}(e,function(e,t){function n(t){var n=t.every(function(e){return e});return e.debug(0,[n]),n}return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];var i=t.map(function(t){return t.apply(void 0,e)});return -1!==eL(i,np)?Promise.all(i).then(n):n(i)}}(e,l),nF.parse(a),u,c))}return function(e,t){function n(t){for(var n=t.length,r=0;r<n;r++){var i=t[r];if(void 0!==i)return e.debug(1,[i.treatment]),i}e.debug(2)}return Array.isArray(t)&&0!==t.length?function(e,r,i,o,s,a){var u=t.map(function(t){return t(e,r,i,o,s,a)});return -1!==eL(u,np)?Promise.all(u).then(function(e){return n(e)}):n(u)}:function(){return e.error(300),{treatment:V,label:"targeting rule type unsupported by sdk"}}}(e,r)}(t,n.conditions,r);return new e(n,i)},e.prototype.getKey=function(){return this.baseInfo.name},e.prototype.getTreatment=function(e,t,n){var r,i,o,s=this.baseInfo,a=s.killed,u=s.seed,c=s.defaultTreatment,l=s.trafficAllocation,f=s.trafficAllocationSeed;try{r=tq(e)}catch(e){return{treatment:V,label:ny}}if(this.isGarbage())i=V,o="archived";else if(a)i=c,o="killed";else{var h=this.evaluator(r,u,l,f,t,n);return np(h)?h.then(function(e){return nz(e,c)}):nz(h,c)}return{treatment:i,label:o}},e.prototype.isGarbage=function(){return"ARCHIVED"===this.baseInfo.status},e.prototype.getChangeNumber=function(){return this.baseInfo.changeNumber},e}(),nq={treatment:V,label:ny,config:null};function nW(e){var t={};return e.forEach(function(e){t[e]=nq}),t}function nG(e,t,n,r,i){var o;try{o=i.splits.getSplit(n)}catch(e){return nq}return np(o)?o.then(function(n){return nZ(e,n,t,r,i)}).catch(function(){return nq}):nZ(e,o,t,r,i)}function nH(e,t,n,r,i){var o;try{o=i.splits.getSplits(n)}catch(e){return nW(n)}return np(o)?o.then(function(o){return nQ(e,n,o,t,r,i)}).catch(function(){return nW(n)}):nQ(e,n,o,t,r,i)}function nZ(e,t,n,r,i){var o={treatment:V,label:nm,config:null};if(t){var s=nj.parse(e,t,i);if(np(o=s.getTreatment(n,r,nG)))return o.then(function(e){return e.changeNumber=s.getChangeNumber(),e.config=t.configurations&&t.configurations[e.treatment]||null,e});o.changeNumber=s.getChangeNumber(),o.config=t.configurations&&t.configurations[o.treatment]||null}return o}function nQ(e,t,n,r,i,o){var s={},a=[];return t.forEach(function(t){var u=nZ(e,n[t],r,i,o);np(u)?a.push(u.then(function(e){s[t]=e})):s[t]=u}),a.length>0?Promise.all(a).then(function(){return s}):s}function nV(e,t,n){e.warn(217,[n,t])}var nY={treatment:V,label:nv};function nJ(e){var t={};return e.forEach(function(e){t[e]=nY}),t}var n$=/^[a-zA-Z0-9][-_.:a-zA-Z0-9]{0,79}$/,nX="event_type";function n0(e,t,n){if(void 0==t)e.error(315,[n,nX]);else if(eB(t)){if(0===t.length)e.error(319,[n,nX]);else{if(n$.test(t))return t;e.error(310,[n,t])}}else e.error(318,[n,nX]);return!1}function n1(e,t,n){return eK(t)||void 0==t?t:(e.error(313,[n]),!1)}var n2={NULL:0,STRING:2,BOOLEAN:4,NUMBER:8};function n3(e,t,n){if(void 0==t)return{properties:null,size:1024};if(!eP(t))return e.error(311,[n,"properties"]),{properties:!1,size:1024};var r=Object.keys(t),i=k({},t),o={properties:i,size:1024};r.length>300&&e.warn(212,[n]);for(var s=0;s<r.length;s++){o.size+=r[s].length*n2.STRING;var a=i[r[s]],u=eB(a),c=eK(a),l=eM(a),f=null===a;if(u||c||l||f||(i[r[s]]=null,a=null,f=!0,e.warn(211,[n,r[s]])),f?o.size+=n2.NULL:c?o.size+=n2.NUMBER:l?o.size+=n2.BOOLEAN:u&&(o.size+=a.length*n2.STRING),o.size>32768){e.error(312,[n]),o.properties=!1;break}}return o}function n5(e,t){var n=e.sdkReadinessManager,r=e.syncManager,i=e.storage,o=e.signalListener,s=e.settings,a=e.telemetryTracker,u=e.uniqueKeysTracker,c=0;function l(){return r?r.flush():Promise.resolve()}return k(Object.create(n.sdkStatus),function(e,t,n){var r=e.log,i=e3(e.mode);function o(t,i,o,s){var a,u,c,l=tr(r,t,s),f=s.indexOf("ByFlagSet")>-1?(a=e.sync.__splitFiltersValidation.groupedFilters.bySet,c=(u=e4(r,i,s,"flag sets","flag set"))?te(r,u,s):[],a.length>0&&(c=c.filter(function(e){return a.indexOf(e)>-1||(r.warn(227,[s,e]),!1)})),!!c.length&&c):eq(s,eh)?e4(r,i,s):e6(r,i,s),h=nR(r,o,s),p=nd(r,n,s);return ng(r,n,s,f),{valid:p&&l&&f&&!1!==h,key:l,nameOrNames:f,attributes:h}}function s(e){return i?Promise.resolve(e):e}return{getTreatment:function(e,n,r){var i=o(e,n,r,ef);return i.valid?t.getTreatment(i.key,i.nameOrNames,i.attributes):s(V)},getTreatmentWithConfig:function(e,n,r){var i=o(e,n,r,ep);return i.valid?t.getTreatmentWithConfig(i.key,i.nameOrNames,i.attributes):s(k({},Y))},getTreatments:function(e,n,r){var i=o(e,n,r,eh);if(i.valid)return t.getTreatments(i.key,i.nameOrNames,i.attributes);var a={};return i.nameOrNames&&i.nameOrNames.forEach(function(e){return a[e]=V}),s(a)},getTreatmentsWithConfig:function(e,n,r){var i=o(e,n,r,ed);if(i.valid)return t.getTreatmentsWithConfig(i.key,i.nameOrNames,i.attributes);var a={};return i.nameOrNames&&i.nameOrNames.forEach(function(e){return a[e]=k({},Y)}),s(a)},getTreatmentsByFlagSets:function(e,n,r){var i=o(e,n,r,em);return i.valid?t.getTreatmentsByFlagSets(i.key,i.nameOrNames,i.attributes):s({})},getTreatmentsWithConfigByFlagSets:function(e,n,r){var i=o(e,n,r,ey);return i.valid?t.getTreatmentsWithConfigByFlagSets(i.key,i.nameOrNames,i.attributes):s({})},getTreatmentsByFlagSet:function(e,n,r){var i=o(e,[n],r,eg);return i.valid?t.getTreatmentsByFlagSet(i.key,i.nameOrNames[0],i.attributes):s({})},getTreatmentsWithConfigByFlagSet:function(e,n,r){var i=o(e,[n],r,ev);return i.valid?t.getTreatmentsWithConfigByFlagSet(i.key,i.nameOrNames[0],i.attributes):s({})},track:function(e,o,s,a,u){var c=tr(r,e,eS),l=ts(r,o,eS),f=n0(r,s,eS),h=n1(r,a,eS),p=n3(r,u,eS),d=p.properties,g=p.size;return nd(r,n,eS)&&c&&l&&f&&!1!==h&&!1!==d?t.track(c,l,f,h,d,g):!!i&&Promise.resolve(!1)}}}(s,function(e){var t=e.sdkReadinessManager.readinessManager,n=e.storage,r=e.settings,i=e.impressionsTracker,o=e.eventTracker,s=e.telemetryTracker,a=r.log,u=r.mode,c=e3(u);function l(e,r,o,u,l){void 0===u&&(u=!1),void 0===l&&(l=ef);var f=s.trackEval(u?"tc":"t"),h=function(t){var n=[],s=p(t,r,e,o,u,l,n);return i.track(n,o),f(n[0]&&n[0].label),s},d=t.isReady()||t.isReadyFromCache()?nG(a,e,r,o,n):c?Promise.resolve(nY):nY;return np(d)?d.then(function(e){return h(e)}):h(d)}function f(e,r,o,u,l){void 0===u&&(u=!1),void 0===l&&(l=eh);var f=s.trackEval(u?"tcs":"ts"),h=function(t){var n=[],r={};return Object.keys(t).forEach(function(i){r[i]=p(t[i],i,e,o,u,l,n)}),i.track(n,o),f(n[0]&&n[0].label),r},d=t.isReady()||t.isReadyFromCache()?nH(a,e,r,o,n):c?Promise.resolve(nJ(r)):nJ(r);return np(d)?d.then(function(e){return h(e)}):h(d)}function h(e,r,o,u,l,f){void 0===u&&(u=!1),void 0===l&&(l="tfs"),void 0===f&&(f=em);var h=s.trackEval(l),d=function(t){var n=[],r={};return Object.keys(t).forEach(function(i){r[i]=p(t[i],i,e,o,u,f,n)}),i.track(n,o),h(n[0]&&n[0].label),r},g=t.isReady()||t.isReadyFromCache()?function(e,t,n,r,i,o){var s;function a(s){for(var a=new G,u=0;u<n.length;u++){var c=s[u];c.size?a=function(e,t){var n=new G(W(e));return t.forEach(function(e){n.add(e)}),n}(a,c):e.warn(228,[o,n[u]])}return a.size?nH(e,t,W(a),r,i):{}}try{s=i.splits.getNamesByFlagSets(n)}catch(e){return{}}return np(s)?s.then(function(e){return a(e)}).catch(function(){return{}}):a(s)}(a,e,r,o,n,f):c?Promise.resolve({}):{};return np(g)?g.then(function(e){return d(e)}):d(g)}function p(e,n,r,i,o,s,u){var c=tj(r),l=eP(r)?r.bucketingKey:void 0,f=e.treatment,h=e.label,p=e.changeNumber,d=e.config;return(a.info(102,[n,c,f,h]),nS(a,t,n,h,s)&&(a.info(103),u.push({feature:n,keyName:c,treatment:f,time:Date.now(),bucketingKey:l,label:h,changeNumber:p})),o)?{treatment:f,config:void 0===d?null:d}:f}return{getTreatment:l,getTreatmentWithConfig:function(e,t,n){return l(e,t,n,!0,ep)},getTreatments:f,getTreatmentsWithConfig:function(e,t,n){return f(e,t,n,!0,ed)},getTreatmentsByFlagSets:h,getTreatmentsWithConfigByFlagSets:function(e,t,n){return h(e,t,n,!0,"tcfs",ey)},getTreatmentsByFlagSet:function(e,t,n){return h(e,[t],n,!1,"tf",eg)},getTreatmentsWithConfigByFlagSet:function(e,t,n){return h(e,[t],n,!0,"tcf",ev)},track:function(e,r,i,c,l,f){void 0===f&&(f=1024);var h=s.trackEval("tr"),p=tj(e),d=Date.now();!function(e,t,n,r,i,o){if(t.isReady()&&r!==en){var s=n.trafficTypeExists(i);np(s)?s.then(function(t){return t||nV(e,i,o),t}):s||nV(e,i,o)}}(a,t,n.splits,u,r,eS);var g=o.track({eventTypeId:i,trafficTypeName:r,value:c,timestamp:d,key:p,properties:l},f);return np(g)?g.then(function(e){return h(),e}):(h(),g)},isClientSide:!1}}(e),n.readinessManager),{flush:function(){var e,t;return(t=(e=Date.now())-c)<1e3?(s.log.warn("Flush cooldown, remaining time "+(1e3-t)/1e3+" seconds"),Promise.resolve()):(c=e,l())},destroy:function(){if(n.readinessManager.destroy(),!t){var e;tl[e=s.core.authorizationKey]&&tl[e]--,0===tl[e]&&delete tl[e],a.sessionLength()}return r&&r.stop(),l().then(function(){return o&&o.stop(),u&&u.stop(),i.destroy()})}})}function n6(e,t){return(e.matchingKey?e.matchingKey:e)+"-"+(e.bucketingKey?e.bucketingKey:e)+"-"+(void 0!==t?t:"")}function n4(e){var t=e.storage,n=e.syncManager,r=e.sdkReadinessManager,i=e.settings,o=i.core,s=o.key,a=o.trafficType,u=i.startup.readyTimeout,c=i.log,l=nC(c,n5(e),s,a),f=n6(tq(s),a),h={};return h[f]=l,function(i,o){if(void 0===i)return c.debug(27),l;var s,a=tr(c,i,N);if(!1===a)throw Error("Shared Client needs a valid key.");if(void 0!==o&&!1===(s=ts(c,o,N)))throw Error("Shared Client needs a valid traffic type or no traffic type at all.");var f=n6(a,s);if(h[f])c.debug(28);else{var p=tj(a),d=r.shared(u),g=t.shared&&t.shared(p,function(e){if(e){d.readinessManager.timeout();return}d.readinessManager.segments.emit(e$)}),m=n&&g&&n.shared(p,d.readinessManager,g);h[f]=nC(c,n5(k({},e,{sdkReadinessManager:d,storage:g||t,syncManager:m,signalListener:void 0}),!0),a,s),m&&m.start(),c.info(104)}return h[f]}}var n8=function(){function e(e){var t=this;this.__mapKeysData__=[],this.__mapValuesData__=[],Array.isArray(e)&&e.forEach(function(e){t.set(e[0],e[1])})}return e.prototype.clear=function(){this.__mapKeysData__.length&&(this.__mapKeysData__.length=0,this.__mapValuesData__.length=0)},e.prototype.delete=function(e){var t=this.__mapKeysData__.indexOf(e);return -1!==t&&(this.__mapKeysData__.splice(t,1),this.__mapValuesData__.splice(t,1),!0)},e.prototype.forEach=function(e,t){for(var n=0;n<this.__mapKeysData__.length;n++)e.call(t,this.__mapValuesData__[n],this.__mapKeysData__[n],this)},e.prototype.get=function(e){var t=this.__mapKeysData__.indexOf(e);if(-1!==t)return this.__mapValuesData__[t]},e.prototype.has=function(e){return -1!==this.__mapKeysData__.indexOf(e)},e.prototype.set=function(e,t){var n=this.__mapKeysData__.indexOf(e);return -1===n&&(n=this.__mapKeysData__.push(e)-1),this.__mapValuesData__[n]=t,this},Object.defineProperty(e.prototype,"size",{get:function(){return this.__mapKeysData__.length},enumerable:!1,configurable:!0}),e}(),n7="function"==typeof Array.from&&"function"==typeof Map&&Map.prototype&&Map.prototype.values?Map:n8,n9=function(e,t,n,r){this.list=r,this.value=e,t?(t.next=this,this.prev=t):this.prev=null,n?(n.prev=this,this.next=n):this.next=null},re=function(){function e(){this.tail=null,this.head=null,this.length=0}return e.prototype.removeNode=function(e){if(e&&e instanceof n9){if(e.list!==this)throw Error("removing node which does not belong to this list");var t=e.next,n=e.prev;return t&&(t.prev=n),n&&(n.next=t),e===this.head&&(this.head=t),e===this.tail&&(this.tail=n),e.list.length--,e.next=null,e.prev=null,e.list=null,t}},e.prototype.unshiftNode=function(e){if(e&&e instanceof n9&&e!==this.head){e.list&&e.list.removeNode(e);var t=this.head;e.list=this,e.next=t,t&&(t.prev=e),this.head=e,this.tail||(this.tail=e),this.length++}},e.prototype.unshift=function(){for(var e=0,t=arguments.length;e<t;e++)this.head=new n9(arguments[e],null,this.head,this),this.tail||(this.tail=this.head),this.length++;return this.length},e}(),rt=function(){function e(e){this.maxLen=e||1,this.items=new n7,this.lru=new re}return e.prototype.get=function(e){var t=this.items.get(e);if(t&&t instanceof n9)return this.lru.unshiftNode(t),t.value.value},e.prototype.set=function(e,t){var n=this.items.get(e);if(n){if(!(n instanceof n9))return!1;this.lru.unshiftNode(n),this.lru.head.value.value=t}else{if(this.lru.length===this.maxLen){var r=this.lru.tail;if(!r)return!1;this.items.delete(r.value.key),this.lru.removeNode(this.lru.tail)}this.lru.unshift({key:e,value:t}),this.items.set(e,this.lru.head)}return!0},e}(),rn=function(){function e(e,t){this.cache=new rt(e),this.hasher=t}return e.prototype.testAndSet=function(e){var t=this.hasher(e),n=this.cache.get(t);return this.cache.set(t,e.time),n},e}();function rr(e){return tK(e.keyName+":"+e.feature+":"+e.treatment+":"+e.label+":"+e.changeNumber)}function ri(){return new rn(500,rr)}var ro="ga-to-split: ",rs="ga-to-split:mapper",ra=(s={eventTypeId:{event:"eventAction",social:"socialAction"},eventValue:{event:"eventValue",timing:"timingValue"},eventProperties:{pageview:["page"],screenview:["screenName"],event:["eventCategory","eventLabel"],social:["socialNetwork","socialTarget"],timing:["timingCategory","timingVar","timingLabel"],exception:["exDescription","exFatal"]}},function(e){var t=e.get("hitType"),n=e.get(s.eventTypeId[t]||"hitType"),r=e.get(s.eventValue[t]),i={},o=s.eventProperties[t];if(o)for(var a=0;a<o.length;a++){var u=e.get(o[a]);void 0!==u&&(i[o[a]]=u)}return{eventTypeId:n,value:r,properties:i,timestamp:Date.now()}}),ru=/^[^a-zA-Z0-9]+/,rc=/[^-_.:a-zA-Z0-9]+/g,rl="split-to-ga: ",rf="`ga` command queue not found.",rh="No hit was sent.",rp=function(){function e(t,n){this.trackerNames=e.defaultTrackerNames,this.log=t,n&&("function"==typeof n.filter&&(this.filter=n.filter),"function"==typeof n.mapper&&(this.mapper=n.mapper),Array.isArray(n.trackerNames)&&(this.trackerNames=eH(n.trackerNames)),this.impressions=n.impressions,this.events=n.events),t.info(rl+"integration started"),"function"!=typeof e.getGa()&&t.warn(rl+(rf+" No hits will be sent until it is available."))}return e.defaultMapper=function(e){var t=e.type,n=e.payload;switch(t){case J:return{hitType:"event",eventCategory:"split-impression",eventAction:"Evaluate "+n.impression.feature,eventLabel:"Treatment: "+n.impression.treatment+". Targeting rule: "+n.impression.label+".",nonInteraction:!0};case $:return{hitType:"event",eventCategory:"split-event",eventAction:n.eventTypeId,eventValue:n.value,nonInteraction:!0}}},e.getGa=function(){return"undefined"!=typeof window?window[window.GoogleAnalyticsObject||"ga"]:void 0},e.validateFieldsObject=function(e,t){return!!t&&!!t.hitType||(e.warn(rl+"your custom mapper returned an invalid FieldsObject instance. It must be an object with at least a `hitType` field."),!1)},e.prototype.queue=function(t){var n,r=e.getGa();if(r){if(!1===this.impressions&&t.type===J||!1===this.events&&t.type===$)return;try{if(this.filter&&!this.filter(t)||(n=e.defaultMapper(t),this.mapper&&(!(n=this.mapper(t,n))||!e.validateFieldsObject(this.log,n))))return}catch(e){this.log.warn(rl+"queue method threw: "+e+". "+rh);return}this.trackerNames.forEach(function(e){n.splitHit=!0,r(e?e+".send":"send",n)})}else this.log.warn(rl+(rf+" ")+rh)},e.defaultTrackerNames=[""],e}();function rd(e,t){return function(e,t){var n=[];if(e.forEach(function(e){var r=e(t);r&&r.queue&&n.push(r)}),0!==n.length)return{handleImpression:function(e){n.forEach(function(t){return t.queue({type:J,payload:e})})},handleEvent:function(e){n.forEach(function(t){return t.queue({type:$,payload:e})})}}}(e.map(function(e){switch(e.type){case no:return function(e){function t(t){var n,r,i,o,s,a,u,c,l,f,h,p,d;return n=e,r=t.storage,o=(i=t.settings).core,s=i.log,a=t.telemetryTracker,u={prefix:"ga",identities:o.key&&o.trafficType?[{key:o.key,trafficType:o.trafficType}]:void 0},void(c=window,l="splitTracker",f=function(e,t){var i,o,a,c=k({},u,n,t);this.tracker=e;var l=Array.isArray(i=c.identities)?(void 0===o&&(o=JSON.stringify),a={},i.filter(function(e){var t=o(e);return!Object.prototype.hasOwnProperty.call(a,t)&&(a[t]=!0)})).filter(function(e){if(!e)return!1;var t=e.key,n=e.trafficType;return!!((eB(t)||eK(t))&&eB(n))}):[];if(0===l.length){s.warn(ro+"No valid identities were provided. Please check that you are passing a valid list of identities or providing a traffic type at the SDK configuration.");return}var f=l.length-c.identities.length;f&&s.warn(ro+(f+" identities were discarded because they are invalid or duplicated. Identities must be an array of objects with key and trafficType.")),c.identities=l,eB(c.prefix)||(s.warn(ro+"The provided `prefix` was ignored since it is invalid. Please check that you are passing a string object as `prefix`."),c.prefix=void 0);var h=e.get("sendHitTask");e.set("sendHitTask",function(e){if(h(e),!(!1===c.hits||e.get("splitHit"))){try{if(c.filter&&!c.filter(e))return}catch(e){s.warn(ro+"custom filter threw: "+e);return}var t,n=ra(e);if(c.mapper){try{n=c.mapper(e,n)}catch(e){s.warn(ro+"custom mapper threw: "+e);return}if(!n)return}c.prefix&&(n.eventTypeId=c.prefix+"."+n.eventTypeId),n.eventTypeId=function(e,t){if(!eB(t)||0===t.length)return t;var n=t.replace(ru,"").replace(rc,"_"),r=n.slice(0,80);return r.length<n.length&&e.warn(ro+"EventTypeId was truncated because it cannot be more than 80 characters long."),r}(s,n.eventTypeId),n0(s,(t=n).eventTypeId,rs)&&!1!==n1(s,t.value,rs)&&!1!==n3(s,t.properties,rs).properties&&(!t.timestamp||eK(t.timestamp))&&(!t.key||!1!==tr(s,t.key,rs))&&(!t.trafficTypeName||!1!==ts(s,t.trafficTypeName,rs))&&(n.key&&n.trafficTypeName?r.events.track(n):c.identities.forEach(function(e){var t=k({key:e.key,trafficTypeName:e.trafficType},n);r.events.track(t)}))}}),s.info(ro+"integration started")},h=!0===n.autoRequire,p=c.GoogleAnalyticsObject||"ga",c[p]=c[p]||function(){(c[p].q=c[p].q||[]).push(arguments)},c[p]("provide",l,f),d=c[p].q&&c[p].q.push!==[].push,h&&!d&&s.error(ro+"integration is configured to autorequire the splitTracker plugin, but the necessary script does not seem to have run. Please check the docs."),a&&d&&a.addTag("integration:ga-autorequire"))}return void 0===e&&(e={}),t.type="GOOGLE_ANALYTICS_TO_SPLIT",t}(e);case ns:return function(e){function t(t){return new rp(t.settings.log,e)}return void 0===e&&(e={}),t.type="SPLIT_TO_GOOGLE_ANALYTICS",t}(e)}}).filter(function(e){return e&&"function"==typeof e}),t)}function rg(e){var t=nh(e);return t.splits.checkCache=function(){return!0},t}function rm(e,t){var n=!1,r=!1,i=function e(i){var o=new Promise(function(e,n){return i.then(e,function(e){r?n(e):t(e)})}),s=o.then;return Object.defineProperty(o,"then",{value:function(t,i){var a=s.call(o,t,i);return("function"==typeof t&&(n=!0),"function"==typeof i)?(r=!0,a):e(a)}}),o}(e);return i.hasOnFulfilled=function(){return n},i}rg.type=es;var rv={DEBUG:"DEBUG",INFO:"INFO",WARN:"WARN",ERROR:"ERROR",NONE:"NONE"},ry={DEBUG:1,INFO:2,WARN:3,ERROR:4,NONE:5};function rS(e){return!!eF(rv,function(t){return e===t})}function rb(e,t){void 0===e&&(e=""),void 0===t&&(t=[]);var n=0;return e.replace(/%s/g,function(){var e=t[n++];if(eP(e)||Array.isArray(e))try{e=JSON.stringify(e)}catch(e){}return e})}var rT={prefix:"splitio",logLevel:rv.NONE,showLevel:!0},rE=function(){function e(e,t){this.options=k({},rT,e),this.codes=t||new n7,this.logLevel=ry[this.options.logLevel]}return e.prototype.setLogLevel=function(e){this.options.logLevel=e,this.logLevel=ry[e]},e.prototype.debug=function(e,t){this._shouldLog(ry.DEBUG)&&this._log(rv.DEBUG,e,t)},e.prototype.info=function(e,t){this._shouldLog(ry.INFO)&&this._log(rv.INFO,e,t)},e.prototype.warn=function(e,t){this._shouldLog(ry.WARN)&&this._log(rv.WARN,e,t)},e.prototype.error=function(e,t){this._shouldLog(ry.ERROR)&&this._log(rv.ERROR,e,t)},e.prototype._log=function(e,t,n){if("number"==typeof t){var r=this.codes.get(t);t=r?rb(r,n):"Message code "+t+(n?", with args: "+n.toString():"")}else n&&(t=rb(t,n));console.log(this._generateLogMessage(e,t))},e.prototype._generateLogMessage=function(e,t){var n="";return this.options.showLevel&&(n+="["+e+"]"+(e===rv.INFO||e===rv.WARN?" ":"")+" "),this.options.prefix&&(n+=this.options.prefix+" => "),n+t},e.prototype._shouldLog=function(e){return e>=this.logLevel},e}(),r_={add:function(){return!0},contains:function(){return!0},clear:function(){}},rR={GRANTED:eu,DECLINED:ec,UNKNOWN:el},rk=n(68571),rC=void 0!==rk&&void 0!==rk.version&&!!rk.version,rw=[[300,O+"Invalid feature flag, no valid rules or unsupported targeting rule type found"],[329,I+"[%s] %s"],[301,"logger: Invalid Log Level - No changes to the logs will be applied."],[303,"The SDK will not get ready. Reason: %s"],[307,B+"Could not store impressions bulk with %s impression(s). Error: %s"],[308,B+"Impression listener logImpression method threw: %s."],[309,z+"Failed to queue %s"],[304,D+"There was an issue loading the mock feature flags data. No changes will be applied to the current cache. %s"],[305,M+"Failed to connect or error on streaming connection, with error message: %s"],[306,M+"Failed to authenticate for streaming. Error: %s."],[322,"Response status is not OK. Status: %s. URL: %s. Message: %s"],[302,"A listener was added for %s on the SDK, which has already fired and won't be emitted again. The callback won't be executed."],[314,"%s: Client has already been destroyed - no calls possible."],[310,'%s: you passed "%s", event_type must adhere to the regular expression /^[a-zA-Z0-9][-_.:a-zA-Z0-9]{0,79}$/g. This means an event_type must be alphanumeric, cannot be more than 80 characters long, and can only include a dash, underscore, period, or colon as separators of alphanumeric characters.'],[311,"%s: %s must be a plain object."],[312,"%s: the maximum size allowed for the properties is 32768 bytes, which was exceeded. Event not queued."],[313,"%s: value must be a finite number."],[315,"%s: you passed a null or undefined %s. It must be a non-empty string."],[316,"%s: %s too long. It must have 250 characters or less."],[317,"%s: Key must be an object with bucketingKey and matchingKey with valid string properties."],[318,"%s: you passed an invalid %s. It must be a non-empty string."],[319,"%s: you passed an empty %s. It must be a non-empty string."],[320,"%s: %s must be a non-empty array."],[325,"%s: provided param must be a boolean value."],[321,C+': you passed an invalid "%s" config param. It should be one of the following values: %s. Defaulting to "%s".'],[323,C+': an invalid value was received for "sync.localhostMode" config. A valid entity should be provided for localhost mode.'],[324,C+": the provided storage is invalid.%s Falling back into default MEMORY storage"],[326,C+': the provided "%s" config param is lower than allowed. Setting to the minimum value %s seconds'],[327,C+": the amount of flag sets provided are big causing uri length error."],[328,C+": the Set filter is exclusive and cannot be used simultaneously with names or prefix filters. Ignoring names and prefixes."]].concat([[200,F+"Value %s doesn't match with expected type."],[201,F+"Defined attribute `%s`. No attributes received."],[204,L+":my-segments: Retrying download of segments #%s. Reason: %s"],[205,K+"Error while doing fetch of feature flags. %s"],[206,M+"Error parsing SSE error notification: %s"],[207,M+"Error parsing SSE message notification: %s"],[208,M+"Falling back to polling mode. Reason: %s"],[209,P+"Dropping %s after retry. Reason: %s."],[210,P+"Failed to push %s, keeping data to retry on next iteration. Reason: %s."],[203,"%s: the SDK is not ready, results may be incorrect%s. Make sure to wait for SDK readiness before using this method."],[202,"No listeners for SDK Readiness detected. Incorrect control treatments could have been logged if you called getTreatment/s while the SDK was not yet ready."],[211,'%s: Property "%s" is of invalid type. Setting value to null.'],[212,"%s: Event has more than 300 properties. Some of them will be trimmed when processed."],[213,'%s: %s "%s" is not of type string, converting.'],[214,'%s: %s "%s" has extra whitespace, trimming.'],[215,'%s: feature flag "%s" does not exist in this environment. Please double check what feature flags exist in the Split user interface.'],[216,"%s: traffic_type_name should be all lowercase - converting string to lowercase."],[217,'%s: traffic type "%s" does not have any corresponding feature flag in this environment, make sure you\'re tracking your events to a valid traffic type defined in the Split user interface.'],[227,"%s: you passed %s which is not part of the configured FlagSetsFilter, ignoring Flag Set."],[218,C+": %s integration item(s) at settings is invalid. %s"],[219,C+": feature flag filters are not applicable for Consumer modes where the SDK does not keep rollout data in sync. Filters were discarded"],[220,C+': feature flag filter at position %s is invalid. It must be an object with a valid filter type ("bySet", "byName" or "byPrefix") and a list of "values".'],[221,C+": feature flag filter configuration must be a non-empty array of filter objects."],[222,C+": You already have %s. We recommend keeping only one instance of the factory at all times (Singleton pattern) and reusing it throughout your application"],[223,M+"Fetching MySegments due to an error processing %s notification: %s"],[224,M+"Fetching SplitChanges due to an error processing SPLIT_UPDATE notification: %s"],[225,"%s: you passed %s, flag set must adhere to the regular expressions %s. This means a flag set must start with a letter or number, be in lowercase, alphanumeric and have a max length of 50 characters. %s was discarded."],[226,"%s: flag set %s should be all lowercase - converting string to lowercase."],[228,"%s: you passed %s flag set that does not contain cached feature flag names. Please double check what flag sets are in use in the Split user interface."]]),rN="Split SDK client is ready",rA=rw.concat([[100,rN+" from cache"],[101,rN],[102,B+"Feature flag: %s. Key: %s. Evaluation: %s. Label: %s"],[103,B+"Queueing corresponding impression."],[104,"New shared client instance created."],[105,"New Split SDK instance created."],[120,z+"Successfully queued %s"],[121,B+"Successfully stored %s impression(s)."],[122,"UserConsent: consent status changed from %s to %s."],[123,"UserConsent: call had no effect because it was the current consent status (%s)."],[124,"Starting the SDK with %s user consent. No data will be sent."],[106,U+"Turning segments data polling %s."],[107,U+"Starting polling"],[108,U+"Stopping polling"],[109,K+"Retrying download of feature flags #%s. Reason: %s"],[115,P+"Flushing full %s queue and reseting timer."],[116,P+"Pushing %s."],[110,M+"Refreshing streaming token in %s seconds, and connecting streaming in %s seconds."],[111,M+"Attempting to reconnect streaming in %s seconds."],[112,M+"Connecting streaming."],[113,M+"Streaming is disabled for given SDK key. Switching to polling mode."],[114,M+"Disconnecting streaming."],[117,x+"Streaming not available. Starting polling."],[118,x+"Streaming couldn't connect. Continue polling."],[119,x+"Streaming connected. Syncing and stopping polling."]]).concat([[0,O+"[andCombiner] evaluates to %s"],[1,O+"Treatment found: %s"],[2,O+"All predicates evaluated, no treatment found."],[3,A+': using algo "murmur" bucket %s for key %s using seed %s - treatment %s'],[10,I+'[IN_SPLIT_TREATMENT] parent feature flag "%s" evaluated to "%s" with label "%s". %s evaluated treatment is part of %s ? %s.'],[11,I+'[IN_SPLIT_TREATMENT] will evaluate parent feature flag: "%s" with key: %s %s'],[23,F+"Extracted attribute `%s`. %s will be used for matching."],[24,A+":sanitize: Attempted to sanitize %s which should be of type %s. Sanitized and processed value => %s"],[40,I+"[%s] Result: %s. Rule value: %s. Evaluation value: %s"],[25,j+"Registering cleanup handler %s"],[26,j+"Deregistering cleanup handler %s"],[27,"Retrieving default SDK client."],[28,"Retrieving existing SDK client."],[29,"Retrieving manager instance."],[30,D+"Feature flags data: \n%s"],[31,K+"Spin up feature flags update using since = %s"],[32,K+"New feature flags %s"],[33,K+"Removed feature flags %s"],[34,K+"Segment names collected %s"],[35,M+"New SSE message received, with data: %s."],[36,L+": Starting %s. Running each %s millis"],[37,L+": Running %s"],[38,L+": Stopping %s"],[39,C+': feature flags filtering criteria is "%s".']]),rO=n(68571),rI=new n7(rA),rF=String(rC?rO.env.SPLITIO_DEBUG:t4()?localStorage.getItem("splitio_debug"):""),rL=rv.NONE;function rx(){return Promise.resolve()}/^(enabled?|on)/i.test(rF)?rL=rv.DEBUG:rS(rF)&&(rL=rF);var rD=(a=function(){var e={emptyMock:"1"};return function(t){var n,r=t.features||{};if(!((n=Object.keys(r)).length!==Object.keys(e).length?(e=ej({},r),!0):n.some(function(t){var n,i,o=!e[t],s=typeof(n=e[t])!=typeof(i=r[t])||("string"==typeof n?n!==i:n.treatment!==i.treatment||n.config!==i.config),a=o||s;return a&&(e=ej({},r)),a})))return!1;var i={};return ex(r,function(e,t){var n,r,o=e,s=null;eP(e)&&(o=e.treatment,s=e.config||s);var a={};null!==s&&(a[o]=s),i[t]={trafficTypeName:"localhost",conditions:[(r=(n={treatment:o}).treatment,n.keys?{conditionType:"WHITELIST",matcherGroup:{combiner:"AND",matchers:[{keySelector:null,matcherType:"WHITELIST",negate:!1,whitelistMatcherData:{whitelist:eB(n.keys)?[n.keys]:n.keys}}]},partitions:[{treatment:r,size:100}],label:"whitelisted "+r}:{conditionType:"ROLLOUT",matcherGroup:{combiner:"AND",matchers:[{keySelector:null,matcherType:"ALL_KEYS",negate:!1}]},partitions:[{treatment:r,size:100}],label:"default rule"})],configurations:a}}),i}},function(e){var t,n,r,i,o=e.settings,s=e.readiness,u=e.storage;return k((t=a(),ew(o.log,(n=o.log,r=u.splits,i=!0,function(){var e=[],a=null,u={};try{u=t(o)}catch(e){a=e,n.error(304,[e])}return!a&&u?(n.debug(30,[JSON.stringify(u)]),ex(u,function(t,n){e.push([n,{name:n,status:"ACTIVE",killed:!1,trafficAllocation:100,defaultTreatment:V,conditions:t.conditions||[],configurations:t.configurations,trafficTypeName:t.trafficTypeName}])}),Promise.all([r.clear(),r.addSplits(e)]).then(function(){return s.splits.emit(eY),i&&(i=!1,Promise.resolve(r.checkCache()).then(function(e){e&&s.splits.emit(eJ),s.segments.emit(e$)})),!0})):Promise.resolve(!0)}),o.scheduler.offlineRefreshRate,"offlineUpdater")),{flush:rx,shared:function(e,t){return{start:function(){setTimeout(function(){t.segments.emit(e$)},0)},stop:function(){},isRunning:function(){return!0},flush:rx}}})});rD.type="LocalhostFromObject";var rM=[ec,eu,el],rK="LOCALSTORAGE",rU={defaults:{startup:{requestTimeoutBeforeReady:5,retriesOnFailureBeforeReady:1,readyTimeout:10,eventsFirstPushWindow:10},userConsent:eu,version:"javascript-10.28.0"},acceptKey:!0,acceptTT:!0,runtime:function(){return{ip:!1,hostname:!1}},storage:function(e){var t,n=e.log,r=e.mode,i=e.storage,o=void 0===i?{type:es}:i,s=o.type,a=o.options,u=o.prefix,c=function(){t=s,s=es};return r===en&&s===rK&&c(),(s===es||s===rK)&&(s!==rK||t4())||(c(),n.error("Invalid or unavailable storage. Fallbacking into MEMORY storage")),{type:s,options:void 0===a?{}:a,prefix:u,__originalType:t}},integrations:function(e){var t;return t=[no,ns],function(e,t,n){var r=e.integrations,i=e.log;if(!Array.isArray(r)||0===r.length)return[];var o=r.filter(t),s=r.length-o.length;return s&&i.warn(218,[s,n||""]),o}(e,function(e){return e&&eB(e.type)&&t.indexOf(e.type)>-1},'Integration items must have a valid "type" value')},logger:function(e){var t=e.debug,n=void 0!==t?"boolean"==typeof t?t?rv.DEBUG:rv.NONE:"string"==typeof t&&rS(t)?t:void 0:rL,r=new rE({logLevel:n||rL},rI);return n||r._log(rv.ERROR,"Invalid Log Level - No changes to the logs will be applied."),r},localhost:function(){return rD},consent:function(e){var t=e.userConsent,n=e.log;return(t=ez(t),rM.indexOf(t)>-1)?t:(n.error(321,["userConsent",rM,eu]),eu)}},rP="object"==typeof Reflect?Reflect:null,rB=rP&&"function"==typeof rP.apply?rP.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};m=rP&&"function"==typeof rP.ownKeys?rP.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var rz=Number.isNaN||function(e){return e!=e};function rj(){rj.init.call(this)}rj.prototype._events=void 0,rj.prototype._eventsCount=0,rj.prototype._maxListeners=void 0;var rq=10;function rW(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function rG(e){return void 0===e._maxListeners?rj.defaultMaxListeners:e._maxListeners}function rH(e,t,n,r){if(rW(n),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),o=e._events),s=o[t]),void 0===s)s=o[t]=n,++e._eventsCount;else if("function"==typeof s?s=o[t]=r?[n,s]:[s,n]:r?s.unshift(n):s.push(n),(i=rG(e))>0&&s.length>i&&!s.warned){s.warned=!0;var i,o,s,a=Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=t,a.count=s.length,console&&console.warn&&console.warn(a)}return e}function rZ(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function rQ(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},i=rZ.bind(r);return i.listener=n,r.wrapFn=i,i}function rV(e,t,n){var r=e._events;if(void 0===r)return[];var i=r[t];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(e){for(var t=Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(i):rJ(i,i.length)}function rY(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function rJ(e,t){for(var n=Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(rj,"defaultMaxListeners",{enumerable:!0,get:function(){return rq},set:function(e){if("number"!=typeof e||e<0||rz(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");rq=e}}),rj.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},rj.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||rz(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},rj.prototype.getMaxListeners=function(){return rG(this)},rj.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){if(t.length>0&&(o=t[0]),o instanceof Error)throw o;var o,s=Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[e];if(void 0===a)return!1;if("function"==typeof a)rB(a,this,t);else for(var u=a.length,c=rJ(a,u),n=0;n<u;++n)rB(c[n],this,t);return!0},rj.prototype.addListener=function(e,t){return rH(this,e,t,!1)},rj.prototype.on=rj.prototype.addListener,rj.prototype.prependListener=function(e,t){return rH(this,e,t,!0)},rj.prototype.once=function(e,t){return rW(t),this.on(e,rQ(this,e,t)),this},rj.prototype.prependOnceListener=function(e,t){return rW(t),this.prependListener(e,rQ(this,e,t)),this},rj.prototype.removeListener=function(e,t){var n,r,i,o,s;if(rW(t),void 0===(r=this._events)||void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(i=-1,o=n.length-1;o>=0;o--)if(n[o]===t||n[o].listener===t){s=n[o].listener,i=o;break}if(i<0)return this;0===i?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,i),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,s||t)}return this},rj.prototype.off=rj.prototype.removeListener,rj.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0==arguments.length){var i,o=Object.keys(n);for(r=0;r<o.length;++r)"removeListener"!==(i=o[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},rj.prototype.listeners=function(e){return rV(this,e,!0)},rj.prototype.rawListeners=function(e){return rV(this,e,!1)},rj.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):rY.call(e,t)},rj.prototype.listenerCount=rY,rj.prototype.eventNames=function(){return this._eventsCount>0?m(this._events):[]};var r$=n(33836),rX=n.n(r$),r0="visibilitychange",r1="pagehide",r2="for visibilitychange and pagehide events.",r3=function(){function e(e,t,n,r){this.syncManager=e,this.settings=t,this.storage=n,this.serviceApi=r,this.flushData=this.flushData.bind(this),this.flushDataIfHidden=this.flushDataIfHidden.bind(this),this.fromImpressionsCollector=eQ.bind(void 0,t.core.labelsEnabled)}return e.prototype.start=function(){this.settings.log.debug(25,[r2]),"undefined"!=typeof document&&document.addEventListener&&document.addEventListener(r0,this.flushDataIfHidden),"undefined"!=typeof window&&window.addEventListener&&window.addEventListener(r1,this.flushData)},e.prototype.stop=function(){this.settings.log.debug(26,[r2]),"undefined"!=typeof document&&document.removeEventListener&&document.removeEventListener(r0,this.flushDataIfHidden),"undefined"!=typeof window&&window.removeEventListener&&window.removeEventListener(r1,this.flushData)},e.prototype.flushData=function(){if(this.syncManager){var e=this.settings.urls,t=e.events,n=e.telemetry;if(tw(this.settings)){var r=this.settings.sync.impressionsMode;this._flushData(t+"/testImpressions/beacon",this.storage.impressions,this.serviceApi.postTestImpressionsBulk,this.fromImpressionsCollector,{sim:r===ee?ee:r===X?X:et}),this._flushData(t+"/events/beacon",this.storage.events,this.serviceApi.postEventsBulk),this.storage.impressionCounts&&this._flushData(t+"/testImpressions/count/beacon",this.storage.impressionCounts,this.serviceApi.postTestImpressionsCount,eV),this.storage.uniqueKeys&&this._flushData(n+"/v1/keys/cs/beacon",this.storage.uniqueKeys,this.serviceApi.postUniqueKeysBulkCs)}this.storage.telemetry&&this._flushData(n+"/v1/metrics/usage/beacon",this.storage.telemetry,this.serviceApi.postMetricsUsage)}},e.prototype.flushDataIfHidden=function(){"hidden"===document.visibilityState&&this.flushData()},e.prototype._flushData=function(e,t,n,r,i){if(!t.isEmpty()){var o=r?r(t.pop()):t.pop();this._sendBeacon(e,o,i)||n(JSON.stringify(o)).catch(function(){})}},e.prototype._sendBeacon=function(e,t,n){if("undefined"!=typeof navigator&&navigator.sendBeacon){var r={entries:t,token:this.settings.core.authorizationKey,sdk:this.settings.version};n&&k(r,n);var i=JSON.stringify(r);try{return navigator.sendBeacon(e,i)}catch(e){}}return!1},e}(),r5={getFetch:function(){return"function"==typeof fetch?fetch:rX()},getEventSource:function(){return"function"==typeof EventSource?EventSource:void 0},EventEmitter:rj,now:"object"==typeof performance&&"function"==typeof performance.now?performance.now.bind(performance):Date.now},r6=(u=function(e){var t,n=e.splitApi,r=e.storage,i=e.readiness,o=e.settings,s=o.log,a=(t=n.fetchSplitChanges,ew(o.log,function(e,t,n,r,i,o,s,a,u){void 0===s&&(s=0),void 0===a&&(a=0);var c=!0;function l(e){return c&&s&&(e=tX(s,e)),e}return function(s,f,h){return Promise.resolve(n.getChangeNumber()).then(function p(d,g){void 0===g&&(g=0),e.debug(31,[d]);var m=Promise.resolve(h?{splits:[h.payload],till:h.changeNumber}:t(d,s,f,l)).then(function(t){c=!1;var s,a,l,f=(s=t.splits,a=new G,(l=s.reduce(function(e,t){return"ACTIVE"===t.status&&function(e,t){var n=t.groupedFilters,r=n.bySet,i=n.byName,o=n.byPrefix;if(r.length>0)return e.sets&&e.sets.some(function(e){return r.indexOf(e)>-1});var s=i.length>0,a=o.length>0;if(!s&&!a)return!0;var u=s&&i.indexOf(e.name)>-1,c=a&&o.some(function(t){return eq(e.name,t)});return u||c}(t,i)?(e.added.push([t.name,t]),(function(e){for(var t=e.conditions,n=new G,r=0;r<t.length;r++)t[r].matcherGroup.matchers.forEach(function(e){e.matcherType===e_&&n.add(e.userDefinedSegmentMatcherData.segmentName)});return n})(t).forEach(function(e){a.add(e)})):e.removed.push(t.name),e},{added:[],removed:[],segments:[]})).segments=W(a),l);return e.debug(32,[f.added.length]),e.debug(33,[f.removed.length]),e.debug(34,[f.segments.length]),Promise.all([n.setChangeNumber(t.till),n.addSplits(f.added),n.removeSplits(f.removed),r.registerSegments(f.segments)]).then(function(e){if(o){var n,i;return Promise.resolve(!o.splitsArrived||d!==t.till&&(n=e[1],i=e[2],!!(n&&n.some(function(e){return e})||i&&i.some(function(e){return e})))&&(u||Promise.resolve(r.getRegisteredSegments()).then(function(e){return Promise.all(e.map(function(e){return r.getChangeNumber(e)})).then(function(e){return e.every(function(e){return -1!==e})})}))).catch(function(){return!1}).then(function(e){return e&&o.emit(eY),!0})}return!0})}).catch(function(t){return(e.warn(205,[t]),c&&a>g)?(g+=1,e.info(109,[g,t]),p(d,g)):(c=!1,!1)});return o&&c&&Promise.resolve(n.checkCache()).then(function(e){e&&o.emit(eJ)}),m})}}(o.log,function(e,n,r,i){var o=t(e,n,r);return i&&(o=i(o)),o.then(function(e){return e.json()})},r.splits,r.segments,o.sync.__splitFiltersValidation,i.splits,o.startup.requestTimeoutBeforeReady,o.startup.retriesOnFailureBeforeReady,!0),o.scheduler.featuresRefreshRate,"splitChangesUpdater")),u={},c=h(tj(o.core.key),i,r);function l(){ex(u,function(e){e.start()})}function f(){ex(u,function(e){e.isRunning()&&e.stop()})}function h(e,t,r){var i,s=(i=n.fetchMySegments,ew(o.log,function(e,t,n,r,i,o,s,a){var u=!0,c=!0;function l(e){return c&&(e=tX(o,e)),e}function f(e){var t;if(Array.isArray(e))t=r.resetSegments(e);else{var o=e.name,s=e.add;r.isInSegment(o)!==s?(t=!0,s?r.addToSegment(o):r.removeFromSegment(o)):t=!1}n.usesSegments()&&(t||u)&&(u=!1,i.emit(e$))}return function(n,r){return function n(r,i,o){return(i?new Promise(function(e){f(i),e(!0)}):t(a,o,l).then(function(e){return c=!1,f(e),!0})).catch(function(t){return c&&s>r?(r+=1,e.warn(204,[r,t]),n(r)):(c=!1,!1)})}(0,n,r)}}(o.log,function(e,t,n){var r=i(e,t);return n&&(r=n(r)),r.then(function(e){return e.json()}).then(function(e){return e.mySegments.map(function(e){return e.name})})},r.splits,r.segments,t.segments,o.startup.requestTimeoutBeforeReady,o.startup.retriesOnFailureBeforeReady,e),o.scheduler.segmentsRefreshRate,"mySegmentsUpdater"));function a(){t.isReady()||r.splits.usesSegments()||t.segments.emit(e$)}return r.splits.usesSegments()?t.splits.once(eY,a):setTimeout(a,0),u[e]=s,s}return i.splits.on(eY,function(){if(a.isRunning()){var e=r.splits.usesSegments();e!==c.isRunning()&&(s.info(106,[e?"ON":"OFF"]),e?l():f())}}),{splitsSyncTask:a,segmentsSyncTask:c,start:function(){s.info(107),a.start(),r.splits.usesSegments()&&l()},stop:function(){s.info(108),a.isRunning()&&a.stop(),f()},isRunning:a.isRunning,syncAll:function(){var e=[a.execute()];return ex(u,function(t){e.push(t.execute())}),Promise.all(e)},add:h,remove:function(e){delete u[e]},get:function(e){return u[e]}}},c=function(e,t){var n,r,i,o,s,a,u,c,l,f,h,d,m,v=e.settings,y=e.storage,S=e.splitApi,b=e.readiness,T=e.platform,E=e.telemetryTracker,_=v.core.key?tj(v.core.key):void 0,R=v.log;try{l=new tz(v,T)}catch(e){R.warn(208,[e]);return}var C=(n=S.fetchAuth,function(e){return n(e).then(function(e){return e.json()}).then(function(e){if(e.token){var t=JSON.parse(decodeURIComponent(tF(e.token.split(".")[1].replace(/-/g,"+").replace(/_/g,"/")).split("").map(function(e){return"%"+("00"+e.charCodeAt(0).toString(16)).slice(-2)}).join("")));if("number"!=typeof t.iat||"number"!=typeof t.exp)throw Error('token properties "issuedAt" (iat) or "expiration" (exp) are missing or invalid');var n=JSON.parse(t["x-ably-capability"]);return k({decodedToken:t,channels:n},e)}return e})}),w=new T.EventEmitter,N=(r=tA.map(function(e){return{regex:e,hasPublishers:!0,oTime:-1,cTime:-1}}),i=!0,o=!0,s={handleOpen:function(){E.streamingEvent(0),w.emit(ty)},isStreamingUp:function(){return o&&i},handleOccupancyEvent:function(e,t,n){for(var s=0;s<r.length;s++){var a=r[s];if(a.regex.test(t)){if(E.streamingEvent(tO[s],e),n>a.oTime){a.oTime=n,a.hasPublishers=0!==e;var u=r.some(function(e){return e.hasPublishers});o&&(!u&&i?w.emit(tS):u&&!i&&w.emit(ty)),i=u}return}}},handleControlEvent:function(e,t,n){if(e===p.STREAMING_RESET){w.emit(e);return}for(var s=0;s<r.length;s++){var a=r[s];if(a.regex.test(t)){n>a.cTime&&(a.cTime=n,e===p.STREAMING_DISABLED?(E.streamingEvent(30,0),w.emit(tm)):i&&(e===p.STREAMING_PAUSED&&o?(E.streamingEvent(30,2),w.emit(tS)):e!==p.STREAMING_RESUMED||o||(E.streamingEvent(30,1),w.emit(ty))),o=e===p.STREAMING_RESUMED);return}}}},{handleOpen:function(){s.handleOpen()},handleError:function(e){var t=e;try{eB(e.data)&&(e.parsedData=JSON.parse(e.data)),t=e}catch(e){R.warn(206,[e])}var n=t.parsedData&&t.parsedData.message||t.message;R.error(305,[n]),function(e){if(e.parsedData&&e.parsedData.code){var t=e.parsedData.code;if(E.streamingEvent(60,t),40140<=t&&t<=40149)return!0;if(4e4<=t&&t<=49999)return!1}else E.streamingEvent(40,1);return!0}(t)?w.emit(tv):w.emit(tm)},handleMessage:function(e){try{if(!(t=function(e){if(e.data){var t=JSON.parse(e.data);return t.parsedData=JSON.parse(t.data),t.name&&"[meta]occupancy"===t.name&&(t.parsedData.type=tC),t}}(e)))return}catch(e){R.warn(207,[e]);return}var t,n=t.parsedData,r=t.data,i=t.channel,o=t.timestamp;if(R.debug(35,[r]),s.isStreamingUp()||-1!==[tC,tk].indexOf(n.type))switch(n.type){case tR:case tE:case tT:case t_:w.emit(n.type,n);break;case tb:w.emit(n.type,n,i);break;case tC:s.handleOccupancyEvent(n.metrics.publishers,i,o);break;case tk:s.handleControlEvent(n.controlType,i,o)}}});l.setEventHandler(N);var A=_?void 0:(a=t.segmentsSyncTask,u=y.segments,c={},{put:function(e){var t=e.changeNumber,n=e.segmentName;c[n]||(c[n]=function(e){var t,n,r=0,i=!1,o=new tN(s,1e4,6e4);function s(){t=!0,r>u.getChangeNumber(e)?(i=!1,a.execute(!1,e,!0,n?r:void 0).then(function(){if(t){if(i)s();else{var a=o.attempts+1;if(r<=u.getChangeNumber(e)){R.debug("Refresh completed"+(n?" bypassing the CDN":"")+" in "+a+" attempts."),t=!1;return}if(a<10){o.scheduleCall();return}n?(R.debug("No changes fetched after "+a+" attempts with CDN bypassed."),t=!1):(o.reset(),n=!0,s())}}})):t=!1}return{put:function(a){a<=u.getChangeNumber(e)||a<=r||(r=a,i=!0,n=!1,(o.timeoutID||!t)&&s(),o.reset())},stop:function(){t=!1,o.reset()}}}(n)),c[n].put(t)},stop:function(){Object.keys(c).forEach(function(e){return c[e].stop()})}}),O=function(e,t,n,r,i,o){var s,a,u,c=0,l=!1,f=new tN(h,1e4,6e4);function h(){if(s=!0,c>t.getChangeNumber()){l=!1;var r=u?{payload:u,changeNumber:c}:void 0;n.execute(!0,a?c:void 0,r).then(function(){if(s){if(l)h();else{r&&i.trackUpdatesFromSSE("sp"),o&&o.execute(!0);var n=f.attempts+1;if(c<=t.getChangeNumber()){e.debug("Refresh completed"+(a?" bypassing the CDN":"")+" in "+n+" attempts."),s=!1;return}if(n<10){f.scheduleCall();return}a?(e.debug("No changes fetched after "+n+" attempts with CDN bypassed."),s=!1):(f.reset(),a=!0,h())}}})}else s=!1}function p(e,n){var r=e.changeNumber,i=e.pcn,o=t.getChangeNumber();r<=o||r<=c||(c=r,l=!0,a=!1,u=void 0,n&&o===i&&(u=n),(f.timeoutID||!s)&&h(),f.reset())}return{put:p,killSplit:function(e){var n=e.changeNumber,i=e.splitName,o=e.defaultTreatment;t.killLocally(i,o,n)&&r.emit(eY,!0),p({changeNumber:n})},stop:function(){s=!1,f.reset()}}}(R,y.splits,t.splitsSyncTask,b.splits,E,_?void 0:t.segmentsSyncTask),I={},F={},L=!1,x=new tN(D,v.scheduler.pushRetryBackoffBase);function D(){if(!f){R.info(112),f=!1;var e=_?Object.keys(F):void 0;C(e).then(function(t){if(!f){if(!t.pushEnabled){R.info(113),w.emit(tm);return}if(!e||!(e.length<Object.keys(F).length)){var n,r,i;d&&clearTimeout(d),m&&clearTimeout(m),r=(n=t.decodedToken).exp-n.iat-600,i="number"==typeof t.connDelay&&t.connDelay>=0?t.connDelay:60,R.info(110,[r,i]),d=setTimeout(D,1e3*r),m=setTimeout(function(){f||l.open(t)},1e3*i),E.streamingEvent(50,n.exp)}}}).catch(function(e){if(!f){if(R.error(306,[e.message]),e.statusCode>=400&&e.statusCode<500){E.streamingEvent(80),w.emit(tm);return}w.emit(tv)}})}}function M(){f||(f=!0,l.close(),R.info(114),d&&clearTimeout(d),m&&clearTimeout(m),x.reset(),K())}function K(){O.stop(),_?ex(F,function(e){return e.worker.stop()}):A.stop()}return w.on(tS,K),w.on(ty,function(){x.reset()}),w.on(tm,function(){h=!0,M(),w.emit(tS)}),w.on(tv,function(){l.close();var e=x.scheduleCall();R.info(111,[e/1e3]),w.emit(tS)}),w.on(p.STREAMING_RESET,function(){f||(d&&clearTimeout(d),D())}),w.on(t_,O.killSplit),w.on(tR,function(e){if(e.d&&void 0!==e.c)try{var t,n,r=(t=e.c,n=e.d,t>0?tH(n,t,!1):JSON.parse(tF(n)));if(r){O.put(e,r);return}}catch(e){R.warn(224,[e])}O.put(e)}),_?(w.on(tb,function(e,t){var n=I[t.split("_")[2]];n&&F[n]&&F[n].worker.put(e.changeNumber,e.includesPayload?e.segmentList?e.segmentList:[]:void 0)}),w.on(tT,function(e){switch(e.u){case g.BoundedFetchRequest:var t,n,r;try{n=e.d,r=e.c,t=tG(n,r)}catch(e){R.warn(223,["BoundedFetchRequest",e]);break}ex(F,function(n){var r,i,o=n.hash64,s=n.worker;r=t,i=parseInt(o.hex.slice(8),16)%(8*r.length),(r[Math.floor(i/8)]&1<<i%8)>0&&s.put(e.changeNumber)});return;case g.KeyList:var i,o,s=void 0;try{s=tH(e.d,e.c),i=new G(s.a),o=new G(s.r)}catch(e){R.warn(223,["KeyList",e]);break}ex(F,function(t){var n=t.hash64,r=t.worker,s=!!i.has(n.dec)||!o.has(n.dec)&&void 0;void 0!==s&&r.put(e.changeNumber,{name:e.segmentName,add:s})});return;case g.SegmentRemoval:if(!e.segmentName){R.warn(223,["SegmentRemoval","No segment name was provided"]);break}ex(F,function(t){return t.worker.put(e.changeNumber,{name:e.segmentName,add:!1})});return}ex(F,function(t){t.worker.put(e.changeNumber)})})):w.on(tE,A.put),k(Object.create(w),{stop:function(){M(),_&&this.remove(_)},start:function(){h||!1===f||(f=!1,_?this.add(_,t.segmentsSyncTask):setTimeout(D))},isRunning:function(){return!1===f},add:function(e,t){var n,r=tP(e);I[r]||(I[r]=e,F[e]={hash64:{hex:n=(function(e,t){t=t||0;for(var n=(e=e||"").length%16,r=e.length-n,i=[0,t],o=[0,t],s=[0,0],a=[0,0],u=[2277735313,289559509],c=[1291169091,658871167],l=0;l<r;l+=16)s=[255&e.charCodeAt(l+4)|(255&e.charCodeAt(l+5))<<8|(255&e.charCodeAt(l+6))<<16|(255&e.charCodeAt(l+7))<<24,255&e.charCodeAt(l)|(255&e.charCodeAt(l+1))<<8|(255&e.charCodeAt(l+2))<<16|(255&e.charCodeAt(l+3))<<24],a=[255&e.charCodeAt(l+12)|(255&e.charCodeAt(l+13))<<8|(255&e.charCodeAt(l+14))<<16|(255&e.charCodeAt(l+15))<<24,255&e.charCodeAt(l+8)|(255&e.charCodeAt(l+9))<<8|(255&e.charCodeAt(l+10))<<16|(255&e.charCodeAt(l+11))<<24],s=tV(s=tQ(s,u),31),i=tZ(i=tV(i=tJ(i,s=tQ(s,c)),27),o),i=tZ(tQ(i,[0,5]),[0,1390208809]),a=tV(a=tQ(a,c),33),o=tZ(o=tV(o=tJ(o,a=tQ(a,u)),31),i),o=tZ(tQ(o,[0,5]),[0,944331445]);switch(s=[0,0],a=[0,0],n){case 15:a=tJ(a,tY([0,e.charCodeAt(l+14)],48));case 14:a=tJ(a,tY([0,e.charCodeAt(l+13)],40));case 13:a=tJ(a,tY([0,e.charCodeAt(l+12)],32));case 12:a=tJ(a,tY([0,e.charCodeAt(l+11)],24));case 11:a=tJ(a,tY([0,e.charCodeAt(l+10)],16));case 10:a=tJ(a,tY([0,e.charCodeAt(l+9)],8));case 9:a=tV(a=tQ(a=tJ(a,[0,e.charCodeAt(l+8)]),c),33),o=tJ(o,a=tQ(a,u));case 8:s=tJ(s,tY([0,e.charCodeAt(l+7)],56));case 7:s=tJ(s,tY([0,e.charCodeAt(l+6)],48));case 6:s=tJ(s,tY([0,e.charCodeAt(l+5)],40));case 5:s=tJ(s,tY([0,e.charCodeAt(l+4)],32));case 4:s=tJ(s,tY([0,e.charCodeAt(l+3)],24));case 3:s=tJ(s,tY([0,e.charCodeAt(l+2)],16));case 2:s=tJ(s,tY([0,e.charCodeAt(l+1)],8));case 1:s=tV(s=tQ(s=tJ(s,[0,e.charCodeAt(l)]),u),31),i=tJ(i,s=tQ(s,c))}return i=tZ(i=tJ(i,[0,e.length]),o=tJ(o,[0,e.length])),o=tZ(o,i),i=tZ(i=t$(i),o=t$(o)),o=tZ(o,i),("00000000"+(i[0]>>>0).toString(16)).slice(-8)+("00000000"+(i[1]>>>0).toString(16)).slice(-8)+("00000000"+(o[0]>>>0).toString(16)).slice(-8)+("00000000"+(o[1]>>>0).toString(16)).slice(-8)})(tx(e),(void 0)>>>0).slice(0,16),dec:function(e){var t,n,r,i=[0];for(t=0;t<e.length;t+=1){for(r=parseInt(e.charAt(t),16),n=i.length-1;n>=0;n-=1)i[n]=16*i[n]+r,r=i[n]/10|0,i[n]%=10;for(;r>0;)i.unshift(r%10),r=r/10|0}return i.join("")}(n)},worker:function(e,t){var n,r,i=0,o=-1,s=!1,a=new tN(u);function u(){if(n=!0,i>o){s=!1;var c=i;e.execute(r,!0).then(function(e){n&&(!1!==e&&(r&&t.trackUpdatesFromSSE("ms"),o=Math.max(o,c)),s?u():a.scheduleCall())})}else n=!1}return{put:function(e,t){e<=o||e<=i||(i=e,s=!0,r=t,(a.timeoutID||!n)&&u(),a.reset())},stop:function(){n=!1,a.reset()}}}(t,E)},L=!0,setTimeout(function(){L&&(L=!1,D())},0))},remove:function(e){var t=tP(e);delete I[t],delete F[e]}})},function(e){var t,n,r,i,o,s,a,l,f,h,p,d,g,m,v,y,S,b,T,E,_,R,C,w,N=e.settings,A=e.settings,O=A.log,I=A.streamingEnabled,F=A.sync.enabled,L=e.telemetryTracker,x=u&&u(e),D=F&&I&&x&&c?c(e,x):void 0,M=(R=[(r=(n=(t=e).settings).log,i=n.scheduler.impressionsRefreshRate,o=n.core.labelsEnabled,a=eN(r,t.splitApi.postTestImpressionsBulk,s=t.storage.impressions,i,eZ,eQ.bind(void 0,o),1),s.setOnFullQueueCb(function(){a.isRunning()&&(r.info(115,[eZ]),a.execute())}),a),(f=(l=t.settings).log,h=l.scheduler.eventsPushRate,p=l.startup.eventsFirstPushWindow,g=eN(f,t.splitApi.postEventsBulk,d=t.storage.events,h,eO),p>0&&(g=eA(g,p)),d.setOnFullQueueCb(function(){g.isRunning()&&(f.info(115,[eO]),g.execute())}),g)],(C=function(e){var t=e.settings.log,n=e.splitApi.postTestImpressionsCount,r=e.storage.impressionCounts;if(r)return eN(t,n,r,18e5,"impression counts",eV,1)}(t))&&R.push(C),w=function(e){var t=e.storage.telemetry,n=e.platform.now;if(t&&n){var r=e.settings,i=e.settings,o=i.log,s=i.scheduler.telemetryRefreshRate,a=e.splitApi,u=e.readiness,c=e.sdkReadinessManager,l=tf(n),f=eA(eN(o,a.postMetricsUsage,t,s,"telemetry stats",void 0,0,!0),s);return u.gate.once(e1,function(){t.recordTimeUntilReadyFromCache(l())}),c.incInternalReadyCbCount(),u.gate.once(e0,function(){t.recordTimeUntilReady(l()),f.isRunning()&&eN(o,a.postMetricsConfig,{isEmpty:function(){return!1},clear:function(){},pop:function(){var e,n,i=r.urls,o=r.scheduler,s=void 0!==r.core.key,a=function(e){var t=0;e.validFilters.forEach(function(e){"bySet"===e.type&&(t+=e.values.length)});var n=e.groupedFilters.bySet.length,r=t-n;return{flagSetsTotal:t,flagSetsIgnored:r}}(r.sync.__splitFiltersValidation),u=a.flagSetsTotal,c=a.flagSetsIgnored;return k((e=r.mode,n=r.storage.type,{oM:th[e],st:n.toLowerCase(),aF:Object.keys(tl).length,rF:Object.keys(tl).reduce(function(e,t){return e+tl[t]-1},0)}),{sE:r.streamingEnabled,rR:{sp:o.featuresRefreshRate/1e3,se:s?void 0:o.segmentsRefreshRate/1e3,ms:s?o.segmentsRefreshRate/1e3:void 0,im:o.impressionsRefreshRate/1e3,ev:o.eventsPushRate/1e3,te:o.telemetryRefreshRate/1e3},uO:{s:i.sdk!==ta.urls.sdk,e:i.events!==ta.urls.events,a:i.auth!==ta.urls.auth,st:i.streaming!==ta.urls.streaming,t:i.telemetry!==ta.urls.telemetry},iQ:o.impressionsQueueSize,eQ:o.eventsQueueSize,iM:tp[r.sync.impressionsMode],iL:!!r.impressionListener,hP:!1,tR:t.getTimeUntilReady(),tC:t.getTimeUntilReadyFromCache(),nR:t.getNonReadyUsage(),t:t.popTags(),i:r.integrations&&r.integrations.map(function(e){return e.type}),uC:r.userConsent?td[r.userConsent]:0,fsT:u,fsI:c})}},0,"telemetry config",void 0,0,!0).execute()}),f}}(t),t.storage.uniqueKeys&&R.push((v=(m=t.settings).log,y=m.core.key,b=(S=t.splitApi).postUniqueKeysBulkCs,T=S.postUniqueKeysBulkSs,_=eN(v,void 0!==y?b:T,E=t.storage.uniqueKeys,9e5,tg),E.setOnFullQueueCb(function(){_.isRunning()&&(v.info(115,[tg]),_.execute())}),_)),{start:function(e){e||R.forEach(function(e){return e.start()}),w&&w.start()},stop:function(e){R.forEach(function(e){return e.stop()}),!e&&w&&w.stop()},isRunning:function(){return R.some(function(e){return e.isRunning()})},execute:function(e){var t=e?[]:R.map(function(e){return e.execute()});return w&&t.push(w.execute()),Promise.all(t)},isExecuting:function(){return R.some(function(e){return e.isExecuting()})}});D&&(D.on(ty,function(){O.info(119),x.isRunning()&&(x.stop(),L.streamingEvent(70,0)),x.syncAll()}),D.on(tS,function(){x.isRunning()?O.info(118):(O.info(117),x.start(),L.streamingEvent(70,1))}));var K=!1,U=!0;return{pollingManager:x,pushManager:D,submitterManager:M,start:function(){K=!0,x&&(F?D?(U&&(x.syncAll(),U=!1),D.start()):x.start():U&&(x.syncAll(),U=!1)),M.start(!tw(N))},stop:function(){K=!1,D&&D.stop(),x&&x.isRunning()&&x.stop(),M.stop()},isRunning:function(){return K},flush:function(){return M.execute(!tw(N))},shared:function(e,t,n){if(x){var r=x.add(e,t,n);return{isRunning:r.isRunning,start:function(){F?D?(x.isRunning()?n.splits.usesSegments()&&r.start():r.execute(),D.add(e,r)):n.splits.usesSegments()&&r.start():t.isReady()||r.execute()},stop:function(){var t=x.get(e);t&&(D&&D.remove(e),t.isRunning()&&t.stop(),x.remove(e))},flush:function(){return Promise.resolve()}}}}}}),r4=n(93356),r8=new Map;function r7(e){if(!r8.has(e)){var t,n,r,i,o=(r=function(e){e.settings.version=r4.q4},n={settings:t=function(e,t){var n,r,i,o,s,a,u,c,l=t.defaults,f=t.runtime,h=t.storage,p=t.integrations,d=t.logger,g=t.localhost,m=t.consent,v=t.flagSpec,y=ej({},ta,l,e);y.features=eD(e,"features");var S=d(y);y.log=S;var b=y.sync;b.impressionsMode=[X,ee,et].indexOf(a=ez(a=b.impressionsMode))>-1?a:(S.error(321,["impressionsMode",[X,ee,et],ee]),ee);var T=y.scheduler,E=y.startup;T.featuresRefreshRate=tu(T.featuresRefreshRate),T.segmentsRefreshRate=tu(T.segmentsRefreshRate),T.offlineRefreshRate=tu(T.offlineRefreshRate),T.eventsPushRate=tu(T.eventsPushRate),T.telemetryRefreshRate=tu((u="telemetryRefreshRate",(c=T.telemetryRefreshRate)>=60?c:(S.error(326,[u,60]),60))),void 0===eD(e,"scheduler.impressionsRefreshRate")&&b.impressionsMode===X&&(T.impressionsRefreshRate=60),T.impressionsRefreshRate=tu(T.impressionsRefreshRate),T.metricsRefreshRate&&S.warn("`metricsRefreshRate` will be deprecated soon. For configuring telemetry rates, update `telemetryRefreshRate` value in configs"),E.requestTimeoutBeforeReady=tu(E.requestTimeoutBeforeReady),E.readyTimeout=tu(E.readyTimeout),E.eventsFirstPushWindow=tu(E.eventsFirstPushWindow),y.mode=function(e,t){if("localhost"===e)return en;if(-1===[er,"producer",ei,eo].indexOf(t))throw Error("Invalid mode provided");return t}(y.core.authorizationKey,y.mode),h&&(y.storage=h(y));var _=y.core.key;if(t.acceptKey){if(y.mode===en&&void 0===_?y.core.key="localhost_key":y.core.key=tr(S,_,N),t.acceptTT){var R=y.core.trafficType;void 0!==R&&(y.core.trafficType=ts(S,R,N))}}else void 0!==_&&S.warn("Provided `key` is ignored in server-side SDK."),y.core.key=void 0;y.runtime=f(y),p&&(y.integrations=p(y)),g&&(b.localhostMode=g(y)),!1!==y.streamingEnabled&&(y.streamingEnabled=!0,T.pushRetryBackoffBase=tu(T.pushRetryBackoffBase)),!1!==b.enabled&&(b.enabled=!0);var w=(n=b.splitFilters,r=y.mode,s={validFilters:[],queryString:null,groupedFilters:{bySet:[],byName:[],byPrefix:[]}},n&&(e3(r)?S.warn(219):Array.isArray(n)&&0!==n.length?(s.validFilters=n.filter(function(e,t){var n;return e&&(n=e.type,e8.some(function(e){return e.type===n}))&&Array.isArray(e.values)?(s.groupedFilters[e.type]=s.groupedFilters[e.type].concat(e.values),!0):(S.warn(220,[t]),!1)}),e8.forEach(function(e){var t=e.type,n=e.maxLength;s.groupedFilters[t].length>0&&(s.groupedFilters[t]=function(e,t,n,r){var i=e4(e,n,C,t+" filter",t+" filter value");if(i){if("bySet"===t&&(i=te(e,i,C)),i.length>r)throw Error(r+" unique values can be specified at most for '"+t+"' filter. You passed "+i.length+". Please consider reducing the amount or using other filter.");i.sort()}return i||[]}(S,t,s.groupedFilters[t],n))}),tt(s.validFilters,"bySet")&&((tt(s.validFilters,"byName")||tt(s.validFilters,"byPrefix"))&&S.error(328),k(s.groupedFilters,{byName:[],byPrefix:[]})),s.queryString=(i=s.groupedFilters,o=[],e8.forEach(function(e){var t=e.type,n=e.queryParam,r=i[t];r.length>0&&o.push(n+r.map(function(e){return encodeURIComponent(e)}).join(","))}),o.length>0?"&"+o.join("&"):null),S.debug(39,[s.queryString])):S.warn(221)),s);return b.splitFilters=w.validFilters,b.__splitFiltersValidation=w,b.flagSpecVersion=v?v(y):"1.1",y.userConsent=m(y),y}(e,rU),platform:r5,storageFactory:t.storage.type===ea?function(e){void 0===e&&(e={});var t,n=(t=e.prefix)?t+".SPLITIO":"SPLITIO";function r(e){if(!t4())return e.settings.log.warn(t9+"LocalStorage API is unavailable. Falling back to default MEMORY storage"),nh(e);var t=e.settings,r=e.settings,i=r.log,o=r.scheduler,s=o.impressionsQueueSize,a=o.eventsQueueSize,u=r.sync,c=u.impressionsMode,l=u.__splitFiltersValidation,f=new t6(n,tj(t.core.key)),h=new ne(t,f,Date.now()-864e6),p=new nn(i,f);return{splits:h,segments:p,impressions:new t0(s),impressionCounts:c!==X?new t2:void 0,events:new t3(a),telemetry:nc(e)?new nl(h,p):void 0,uniqueKeys:c===et?new nf:void 0,destroy:function(){var e;this.splits=new ni(l),this.segments=new nr,this.impressions.clear(),this.impressionCounts&&this.impressionCounts.clear(),this.events.clear(),null===(e=this.uniqueKeys)||void 0===e||e.clear()},shared:function(e){var t=new t6(n,e);return{splits:this.splits,segments:new nn(i,t),impressions:this.impressions,impressionCounts:this.impressionCounts,events:this.events,telemetry:this.telemetry,destroy:function(){this.splits=new ni(l),this.segments=new nr}}}}}return r.type=ea,r}(t.storage):t.storage.__originalType===ea?rg:nh,splitApiFactory:eC,syncManagerFactory:r6,sdkManagerFactory:nE,sdkClientMethodFactory:n4,SignalListener:r3,integrationsManagerFactory:t.integrations&&t.integrations.length>0?rd.bind(null,t.integrations):void 0,impressionsObserverFactory:ri,extraProps:function(e){var t,n,r,i,o,s,a;return{UserConsent:(t=e.settings,n=e.settings.log,r=e.syncManager,o=(i=e.storage).events,s=i.impressions,a=i.impressionCounts,tw(t)||n.info(124,[t.userConsent]),{setStatus:function(e){if(!eM(e))return n.warn(325,["UserConsent.setStatus"]),!1;var i,u,c=e?eu:ec;return t.userConsent!==c?(n.info(122,[t.userConsent,c]),t.userConsent=c,e?null===(i=null==r?void 0:r.submitterManager)||void 0===i||i.start():(null===(u=null==r?void 0:r.submitterManager)||void 0===u||u.stop(!0),o.clear&&o.clear(),s.clear&&s.clear(),a&&a.clear&&a.clear())):n.info(123,[c]),!0},getStatus:function(){return t.userConsent},Status:rR})}}},t.mode===en&&(n.splitApiFactory=void 0,n.syncManagerFactory=t.sync.localhostMode,n.SignalListener=void 0),i=n,r&&r(i),function(e){var t,n,r,i,o,s,a,u,c,l,f,h,p,d,g,m,v,y,S=e.settings,b=e.platform,T=e.storageFactory,E=e.splitApiFactory,_=e.extraProps,R=e.syncManagerFactory,C=e.SignalListener,N=e.impressionsObserverFactory,A=e.integrationsManagerFactory,O=e.sdkManagerFactory,I=e.sdkClientMethodFactory,F=e.filterAdapterFactory,L=S.log,x=S.sync.impressionsMode;n=!1,void 0==(t=S.core.authorizationKey)?L.error(315,[w,tc]):eB(t)?t.length>0?n=t:L.error(319,[w,tc]):L.error(318,[w,tc]),(r=n)&&(tl[r]?(L.warn(222,[tl[r]+" factory/ies with this SDK Key"]),tl[r]++):(tl[r]=1,Object.keys(tl).length>1&&L.warn(222,["an instance of the Split factory"])));var D=function e(t,n,r,i){void 0===r&&(r=0),void 0===i&&(i=function e(t,n,r){void 0===n&&(n=0),void 0===r&&((i=k(new t,{splitsArrived:!1,splitsCacheLoaded:!1})).on(eY,function(e){e||(i.splitsArrived=!0)}),i.once(eJ,function(){i.splitsCacheLoaded=!0}),r=i);var i,o,s,a=((o=k(new t,{segmentsArrived:!1})).once(e$,function(){o.segmentsArrived=!0}),o),u=new t,c=0;function l(){var e=Date.now();c=e>c?e:c+1}var f=!1;r.splitsCacheLoaded?f=!0:r.once(eJ,function(){if(f=!0,!d)try{l(),u.emit(e1)}catch(e){setTimeout(function(){throw e},0)}});var h=!1;function p(){h||(h=!0,l(),u.emit(eX,"Split SDK emitted SDK_READY_TIMED_OUT event."))}n>0&&(s=setTimeout(p,n));var d=!1;r.on(eY,m),a.on(e$,m);var g=!1;function m(e){if(d)try{l(),u.emit(e2,e)}catch(e){setTimeout(function(){throw e},0)}else if(r.splitsArrived&&a.segmentsArrived){clearTimeout(s),d=!0;try{l(),u.emit(e0)}catch(e){setTimeout(function(){throw e},0)}}}var v=1;return{splits:r,segments:a,gate:u,shared:function(n){return void 0===n&&(n=0),v++,e(t,n,r)},timeout:p,setDestroyed:function(){g=!0},destroy:function(){g=!0,l(),a.removeAllListeners(),u.removeAllListeners(),clearTimeout(s),v>0&&v--,0===v&&r.removeAllListeners()},isReady:function(){return d},isReadyFromCache:function(){return f},isTimedout:function(){return h&&!d},hasTimedout:function(){return h},isDestroyed:function(){return g},isOperational:function(){return(d||f)&&!g},lastUpdate:function(){return c}}}(n,r));var o,s=0,a=0;i.gate.on("removeListener",function(e){e===e0&&a--}),i.gate.on("newListener",function(e){(e===e0||e===eX)&&(i.isReady()?t.error(302,[e===e0?"SDK_READY":"SDK_READY_TIMED_OUT"]):e===e0&&a++)});var u=o=rm(new Promise(function(e,n){i.gate.once(e0,function(){t.info(101),a!==s||o.hasOnFulfilled()||t.warn(202),e()}),i.gate.once(eX,function(e){n(Error(e))})}),c);function c(e){t.error(e&&e.message)}return i.gate.once(e1,function(){t.info(100)}),{readinessManager:i,shared:function(r){return void 0===r&&(r=0),e(t,n,r,i.shared(r))},incInternalReadyCbCount:function(){s++},sdkStatus:k(Object.create(i.gate),{Event:{SDK_READY:e0,SDK_READY_FROM_CACHE:e1,SDK_UPDATE:e2,SDK_READY_TIMED_OUT:eX},ready:function(){return i.hasTimedout()?i.isReady()?Promise.resolve():rm(Promise.reject(Error("Split SDK has emitted SDK_READY_TIMED_OUT event.")),c):u},__getStatus:function(){return{isReady:i.isReady(),isReadyFromCache:i.isReadyFromCache(),isTimedout:i.isTimedout(),hasTimedout:i.hasTimedout(),isDestroyed:i.isDestroyed(),isOperational:i.isOperational(),lastUpdate:i.lastUpdate()}}})}}(L,b.EventEmitter,S.startup.readyTimeout),M=D.readinessManager,K=T({settings:S,onReadyCb:function(e){if(e){M.timeout();return}M.splits.emit(eY),M.segments.emit(e$)}}),U=function(e,t){if(e&&t){var n=tf(t);return{trackEval:function(n){var r=tf(t);return function(t){switch(t){case ny:e.recordException(n);return;case nv:e.recordNonReadyUsage&&e.recordNonReadyUsage()}e.recordLatency(n,r())}},trackHttp:function(n){var r=tf(t);return function(t){e.recordHttpLatency(n,r()),t&&t.statusCode?e.recordHttpError(n,t.statusCode):e.recordSuccessfulSync(n,Date.now())}},sessionLength:function(){e.recordSessionLength&&e.recordSessionLength(n())},streamingEvent:function(t,n){80===t?e.recordAuthRejections():(e.recordStreamingEvents({e:t,d:n,t:Date.now()}),50===t&&e.recordTokenRefreshes())},addTag:function(t){e.addTag&&e.addTag(t)},trackUpdatesFromSSE:function(t){e.recordUpdatesFromSSE(t)}}}var r=function(){return function(){}};return{trackEval:r,trackHttp:r,sessionLength:function(){},streamingEvent:function(){},addTag:function(){},trackUpdatesFromSSE:function(){}}}(K.telemetry,b.now),P=A&&A({settings:S,storage:K,telemetryTracker:U}),B=N(),z=x===et?(i=K.uniqueKeys,void 0===(o=F&&F())&&(o=r_),o.refreshRate&&(s=setInterval(o.clear,o.refreshRate)),{track:function(e,t){if(!o.add(e,t)){L.debug("unique-keys-tracker: The feature "+t+" and key "+e+" exist in the filter");return}i.track(e,t)},stop:function(){clearInterval(s)}}):void 0;switch(x){case ee:a=K.impressionCounts,y={process:function(e){var t=[];return e.forEach(function(e){e.pt=B.testAndSet(e);var n=Date.now();e.pt&&a.track(e.feature,n,1),(!e.pt||e.pt<t1(n))&&t.push(e)}),{impressionsToStore:t,impressionsToListener:e,deduped:e.length-t.length}}};break;case et:u=K.impressionCounts,y={process:function(e){return e.forEach(function(e){var t=Date.now();u.track(e.feature,t,1),z.track(e.keyName,e.feature)}),{impressionsToStore:[],impressionsToListener:e,deduped:0}}};break;default:y={process:function(e){return e.forEach(function(e){e.pt=B.testAndSet(e)}),{impressionsToStore:e,impressionsToListener:e,deduped:0}}}}var j=(c=K.impressions,l=y,f=K.telemetry,h=S.log,p=S.impressionListener,g=(d=S.runtime).ip,m=d.hostname,v=S.version,{track:function(e,t){if(S.userConsent!==ec){var n=e.length,r=l.process(e),i=r.impressionsToStore,o=r.impressionsToListener,s=r.deduped,a=o.length;if(i.length>0){var u=c.track(i);np(u)?u.then(function(){h.info(121,[n])}).catch(function(e){h.error(307,[n,e])}):f&&(f.recordImpressionStats(0,i.length),f.recordImpressionStats(2,s))}if(p||P)for(var d=0;d<a;d++)!function(e){var n={impression:k({},o[e]),attributes:t,ip:g,hostname:m,sdkLanguageVersion:v};setTimeout(function(){P&&P.handleImpression(n);try{p&&p.logImpression(n)}catch(e){h.error(308,[e])}},0)}(d)}}}),q=function(e,t,n,r){var i=e.log,o=e3(e.mode);function s(e,t){var r=e.eventTypeId,o=e.trafficTypeName,s=e.key,a=e.value,u=e.timestamp,c=e.properties,l='event of type "'+r+'" for traffic type "'+o+'". Key: '+s+". Value: "+a+". Timestamp: "+u+". "+(c?"With properties.":"With no properties.");return t?(i.info(120,[l]),n&&setTimeout(function(){var t=k({},e);c&&(t.properties=k({},c)),n.handleEvent(t)},0)):i.error(309,[l]),t}return{track:function(n,i){if(e.userConsent===ec)return!!o&&Promise.resolve(!1);var a=t.track(n,i);return np(a)?a.then(s.bind(null,n)):(r&&r.recordEventStats(a?0:1,1),s(n,a))}}}(S,K.events,P,K.telemetry),W=E&&E(S,b,U),G={splitApi:W,eventTracker:q,impressionsTracker:j,telemetryTracker:U,uniqueKeysTracker:z,sdkReadinessManager:D,readiness:M,settings:S,storage:K,platform:b},H=R&&R(G);G.syncManager=H;var Z=C&&new C(H,S,K,W);G.signalListener=Z;var Q=I(G),V=O(S,K.splits,D);return H&&H.start(),Z&&Z.start(),L.info(105),k({client:Q,manager:function(){return L.debug(29),V},Logger:function(e){function t(t){rS(t)?e.setLogLevel(t):e.error(301)}return{enable:function(){t(rv.DEBUG)},setLogLevel:t,disable:function(){t(rv.NONE)},LogLevel:rv}}(L),settings:S},_&&_(G))}(i));o.clientInstances=new Set,o.config=e,r8.set(e,o)}return r8.get(e)}function r9(e,t,n){var r=void 0!==t?e.client(t,n):e.client();return r.setMaxListeners(0),e.clientInstances&&e.clientInstances.add(r),r}function ie(e){var t=[];return e.clientInstances.forEach(function(e){return t.push(e.destroy())}),e.clientInstances.clear(),r8.delete(e.config),Promise.all(t)}function it(e){var t=e&&e.__getStatus();return{isReady:!!t&&t.isReady,isReadyFromCache:!!t&&t.isReadyFromCache,isTimedout:!!t&&t.isTimedout,hasTimedout:!!t&&t.hasTimedout,isDestroyed:!!t&&t.isDestroyed,lastUpdate:t?t.lastUpdate:0}}function ir(e,t){e&&t&&e.setAttributes(t)}var ii=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/;function io(){return S(ia,is)}function is(e,t){return e[0]===t[0]&&e[1]===t[1]&&T()(e[2],t[2])&&T()(e[3],t[3])&&T()(e[4],t[4])&&T()(e[5],t[5])}function ia(e,t,n,r,i,o){var s;return n&&o&&console.log(r4.Jg),e&&e.__getStatus().isOperational&&(n||o)?n?e.getTreatmentsWithConfig(n,r):e.getTreatmentsWithConfigByFlagSets(o,r):n&&(s=function(e,t){if(void 0===t&&(t="feature flag names"),Array.isArray(e)&&e.length>0){var n,r=[];if(e.forEach(function(e){var t=function(e,t){if(void 0===t&&(t="feature flag name"),void 0==e)console.log("[ERROR] you passed a null or undefined "+t+", "+t+" must be a non-empty string.");else{var n;if("string"==typeof(n=e)||n instanceof String){if(ii.test(e)&&(console.log("[WARN] "+t+' "'+e+'" has extra whitespace, trimming.'),e=e.trim()),e.length>0)return e;console.log("[ERROR] you passed an empty "+t+", "+t+" must be a non-empty string.")}else console.log("[ERROR] you passed an invalid "+t+", "+t+" must be a non-empty string.")}return!1}(e);t&&r.push(t)}),r.length)return n={},r.filter(function(e){return!Object.prototype.hasOwnProperty.call(n,e)&&(n[e]=!0)})}return console.log("[ERROR] "+t+" must be a non-empty array."),!1}(n))?s.reduce(function(e,t){return e[t]=r4.oV,e},{}):{}}}}]);
//# sourceMappingURL=8367-c11328b336054df4.js.map