@jolibox/implement 1.1.20-beta.1 → 1.1.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +12 -10
- package/dist/common/rewards/fetch-reward.d.ts +1 -0
- package/dist/common/rewards/index.d.ts +2 -0
- package/dist/common/rewards/reward-emitter.d.ts +24 -0
- package/dist/common/rewards/reward-helper.d.ts +3 -0
- package/dist/index.js +8 -8
- package/dist/index.native.js +41 -35
- package/dist/native/api/storage.d.ts +5 -0
- package/dist/native/rewards/check-frequency.d.ts +21 -0
- package/dist/native/rewards/utils.d.ts +1 -0
- package/implement.build.log +2 -2
- package/package.json +5 -5
- package/src/common/rewards/fetch-reward.ts +27 -1
- package/src/common/rewards/index.ts +2 -1
- package/src/common/rewards/reward-emitter.ts +28 -0
- package/src/common/rewards/reward-helper.ts +23 -0
- package/src/native/api/ads.ts +4 -0
- package/src/native/api/navigate.ts +21 -0
- package/src/native/api/storage.ts +45 -0
- package/src/native/bootstrap/init-env.ts +17 -0
- package/src/native/rewards/check-frequency.ts +70 -0
- package/src/native/rewards/index.ts +36 -2
- package/src/native/rewards/utils.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var fc=Object.create;var Bn=Object.defineProperty,hc=Object.defineProperties,pc=Object.getOwnPropertyDescriptor,mc=Object.getOwnPropertyDescriptors,vc=Object.getOwnPropertyNames,Gi=Object.getOwnPropertySymbols,_c=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty,gc=Object.prototype.propertyIsEnumerable;var Ki=(e,t,r)=>t in e?Bn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z=(e,t)=>{for(var r in t||(t={}))Wi.call(t,r)&&Ki(e,r,t[r]);if(Gi)for(var r of Gi(t))gc.call(t,r)&&Ki(e,r,t[r]);return e},pe=(e,t)=>hc(e,mc(t));var kt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var lr=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var yc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of vc(t))!Wi.call(e,o)&&o!==r&&Bn(e,o,{get:()=>t[o],enumerable:!(n=pc(t,o))||n.enumerable});return e};var ur=(e,t,r)=>(r=e!=null?fc(_c(e)):{},yc(t||!e||!e.__esModule?Bn(r,"default",{value:e,enumerable:!0}):r,e));var L=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});function xc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Kn(e){return typeof e=="string"}function ea(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ta(e){return typeof e=="object"&&Array.isArray(e)}function Cc(e){return typeof e=="undefined"}function Oc(e){return Cc(e)||e===null}function kc(e){return typeof e=="function"}function ra(e){let t=e,r=null,n=function(...o){return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function na(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(o,i){for(let a in i)if(Object.prototype.hasOwnProperty.call(i,a)){let l=o[a],c=i[a],f=r(l,c,a,o,i);f!==void 0?o[a]=f:Yi(c)&&Yi(l)?o[a]=n(Xi({},l),c):Array.isArray(c)&&Array.isArray(l)?o[a]=[...l,...c]:o[a]=c}return o}return n(e,t)}function Yi(e){return e&&typeof e=="object"&&e.constructor===Object}function oa(e,t){if(Array.isArray(e))return e.concat(t)}function Lt(e,t,r={}){let n=null,o,i,a,{leading:l=!1,trailing:c=!0}=r,f=()=>(a=e.apply(i,o),o=void 0,i=void 0,a),y=function(...p){o=p,i=this;let g=l&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,c&&!g&&f()},t),g)return f()};return y.cancel=()=>{n&&clearTimeout(n),n=null,o=i=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,f()},y}function Nc(e,t){return(...r)=>t(e,...r)}function ua(e){return t=>Nc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(o){e(new Dc(`${o}`))}})}function Pt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function cr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((o,i)=>(o[i]=String(n[i]),o),{})}return e[r]})}function Fc(e){let t=e.location?cr(e.location,Qi):null,r=e.target?cr(e.target,Qi):null;return cr(Sc(Xi({},e),{location:t,target:r}),Mc)}function Qn(e){let t=e.events.map(n=>Fc(n)),r=cr(e.device,Bc);return[e.protocolVersion,t,r,e.project]}function jc(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Yc(e){return new Promise(t=>fa(e)(t))}function fa(e){return(t,r=null)=>{let n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Qc(e,t){return(r=>{let n,o={onWillAddFirstListener(){n=r(i.fire,i)}},i=new Nt(o);return i.event})((r,n=null)=>e(o=>t(o)&&r.call(n,o),null))}function Zc(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)ed(e[n],t[n])}function ed(e,t){if(Kn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(kc(t)){try{if(e instanceof t)return}catch(r){}if(!Oc(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function td(){return typeof globalThis!="undefined"?globalThis[ha]:void 0}function rd(e){typeof globalThis!="undefined"&&(globalThis[ha]=e)}function Te(){let e=td();if(e)return e;let t=new dr,r=new Hn,n={registerCommand(o,i,a){t.registerCommand({id:o,handler:i,metadata:a})},executeCommand(o,...i){return r.executeCommand(o,...i)},excuteCommandSync(o,...i){return r.executeCommandThowErr(o,...i)}};return rd(n),n}var Gn,bc,Ec,wc,qi,Ic,Ac,zi,Xi,Sc,Rc,Zi,Tc,Pc,Wn,qn,ia,aa,Dc,sa,la,fr,zn,ke,jn,Lc,Yn,Ut,ut,Uc,Qi,Mc,Bc,ct,Vc,Re,Jc,$c,Hc,ca,Xn,Zn,Gc,Kc,da,Vn,X,Wc,qc,Dt,Nt,Ne,$n,zc,Fn,Xc,Mt,dr,Hn,ha,W=j(()=>{"use strict";Gn=Object.defineProperty,bc=Object.defineProperties,Ec=Object.getOwnPropertyDescriptor,wc=Object.getOwnPropertyDescriptors,qi=Object.getOwnPropertySymbols,Ic=Object.prototype.hasOwnProperty,Ac=Object.prototype.propertyIsEnumerable,zi=(e,t,r)=>t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Xi=(e,t)=>{for(var r in t||(t={}))Ic.call(t,r)&&zi(e,r,t[r]);if(qi)for(var r of qi(t))Ac.call(t,r)&&zi(e,r,t[r]);return e},Sc=(e,t)=>bc(e,wc(t)),Rc=(e,t)=>{for(var r in t)Gn(e,r,{get:t[r],enumerable:!0})},Zi=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ec(t,r):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(n?a(t,r,o):a(o))||o);return n&&o&&Gn(t,r,o),o},Tc=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Pc=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(Pc||{}),Wn=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},qn=class extends Wn{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},ia=class extends Wn{constructor(){super(...arguments),this.kind="USER_ERROR"}},aa=class extends ia{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Dc=class extends ia{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},sa=class extends qn{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},la=class extends qn{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},fr=class extends Wn{constructor(e,t,r,n,o){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),o&&(this.priority=o)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},zn=class extends qn{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};ke={log:Pt("log"),warn:Pt("warn"),info:Pt("info"),error:Pt("error"),debug:Pt("debug")};Object.assign(globalThis,{logger:ke});jn=Symbol.for("Jolibox.canIUseMap"),Lc={};globalThis[jn]||(globalThis[jn]=Lc);Yn={get config(){return globalThis[jn]}},Ut=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Ut||{}),ut=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(ut||{}),Uc=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(Uc||{}),Qi=["name","params"],Mc=["name","type","location","target","extra","timestamp","userId"],Bc=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ct=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});jc();Vc=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Re={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Jc=()=>Re.isiOS?"iOS":Re.isAndroid?"Android":Re.isMac?"Mac":Re.isFacebook?"Facebook":"PC",$c="device_id",Hc="advertising_id",ca=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ct()),window.__joliboxLocalStorage__.getItem(e)),Xn=()=>new URLSearchParams(window.location.search).get("deviceId")||ca($c),Zn=()=>new URLSearchParams(window.location.search).get("advertisingId")||ca(Hc),Gc=e=>e.charAt(0).toUpperCase()+e.slice(1),Kc=()=>{var e;let t=new URLSearchParams(window.location.search);return Gc((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},da=e=>{if(Vc())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Jc(),n=navigator.language,o=Xn(),i=Zn();return`${t} (${Kc()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${o} adid/${i} version/${e||""}`},Vn=class Jn{constructor(t){this.element=t,this.next=Jn.Undefined,this.prev=Jn.Undefined}};Vn.Undefined=new Vn(void 0);X=Vn,Wc=class{constructor(){this._first=X.Undefined,this._last=X.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===X.Undefined}clear(){let e=this._first;for(;e!==X.Undefined;){let t=e.next;e.prev=X.Undefined,e.next=X.Undefined,e=t}this._first=X.Undefined,this._last=X.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new X(e);if(this._first===X.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==X.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==X.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==X.Undefined&&e.next!==X.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===X.Undefined&&e.next===X.Undefined?(this._first=X.Undefined,this._last=X.Undefined):e.next===X.Undefined?(this._last=this._last.prev,this._last.next=X.Undefined):e.prev===X.Undefined&&(this._first=this._first.next,this._first.prev=X.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==X.Undefined;)yield e.element,e=e.next}},qc=0,Dt=class{constructor(e){this.value=e,this.id=qc++}},Nt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Dt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,o,i,a,l,c;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let f=new Dt(t);return this._listeners?this._listeners instanceof Dt?this._listeners=[this._listeners,f]:this._listeners.push(f):((o=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||o.call(n,this),this._listeners=f,(a=(i=this.options)==null?void 0:i.onDidFirstListener)==null||a.call(i,this)),(c=(l=this.options)==null?void 0:l.onDidAddListener)==null||c.call(l,this),this._size++,()=>{var y,p,g,_;if(!this._disposed){if(this._listeners instanceof Dt)this._listeners.id===f.id&&(this._listeners=void 0,this._size=0,(p=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||p.call(y));else if(this._listeners){let w=this._listeners.indexOf(f);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((_=(g=this.options)==null?void 0:g.onDidRemoveLastListener)==null||_.call(g)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof Dt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ne=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let o=(n=this.listeners.get(e))!=null?n:new Nt,i=c=>t(...c.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let l=this.cachedEventQueue.get(e);if(l&&r)for(let c of l)t(...c.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new Wc,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},$n={};Rc($n,{None:()=>zc,filter:()=>Qc,once:()=>fa,toPromise:()=>Yc});zc=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Fn=Symbol.for("Jolibox.hostEmitter"),Xc=()=>{let e=new Ne;return globalThis[Fn]||(globalThis[Fn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Fn]},Mt=Xc();dr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Nt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(...o){return Zc(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};dr=Zi([ra],dr);Hn=class{constructor(){this._onWillExecuteCommand=new Nt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Nt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new dr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=xc(3e4)),this._starActivation}executeCommand(e,...t){return Tc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),$n.toPromise($n.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};Hn=Zi([ra],Hn);ha=Symbol.for("Jolibox.commands")});function Pe(e,t={}){eo.emit("ERROR_REPORT",{error:e,options:t})}var eo,Ze,ze=j(()=>{"use strict";W();W();eo=new Ne,Ze=new Ne;Pe.debounce=Lt(Pe,50,{leading:!0})});var to,nd,pa,ma,va=j(()=>{"use strict";W();ze();to=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(o){return{}}},nd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},pa=e=>{var t;try{let o=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(o!=null&&o.length){let[i,a,l]=o;return{headerJson:to(i),payloadJson:to(a),signature:to(l)}}else throw"joli_source is missing"}catch(r){return Pe(new sa(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},ma=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],o=nd(e),i=r[2];return`${n}.${o}.${i}`}return t}});var od,hr,_a,ro=j(()=>{"use strict";W();od="1.1.20-beta.1",hr=()=>od,_a=()=>{let e=hr();return`${da(e)}`}});var id,ga,no,ya,ce,ad,P,ge=j(()=>{"use strict";W();va();ro();W();id={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Xn(),adId:Zn(),pixelRatio:window.devicePixelRatio||1,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:hr()},schema:window.location.href,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5"},no=(ga=globalThis.joliboxJSCore)==null?void 0:ga.env,ce=Object.assign({},(ya=no==null?void 0:no())!=null?ya:id),ad=()=>{var g,_,w,I,C,b,k,N,G,Q,R;let{payloadJson:e,headerJson:t,signature:r}=ce.schema.length?pa(ce.schema):{},n=`${ce.deviceInfo.did}-${new Date().getTime()}`,i=new URL(ce.schema.length?ce.schema:window.location.href).searchParams,a=(w=(_=(g=i.get("mpId"))!=null?g:i.get("appId"))!=null?_:i.get("gameId"))!=null?w:"",l=(b=(C=(I=ce.clientSessionId)!=null?I:e==null?void 0:e.sessionId)!=null?C:i.get("sessionId"))!=null?b:n,c=!!((N=(k=e==null?void 0:e.testAdsMode)!=null?k:e==null?void 0:e.__testAdsMode)!=null?N:i.get("testAdsMode")==="true"),f=(R=(Q=(G=e==null?void 0:e.joliboxEnv)!=null?G:e==null?void 0:e.__joliboxEnv)!=null?Q:i.get("joliboxEnv"))!=null?R:"production",y=f==="staging",p=t==null?void 0:t.channel;return{get testMode(){return y},get testAdsMode(){return c},get joliboxEnv(){return f},get joliSource(){var x;return(x=i.get("joliSource"))!=null?x:null},get mpId(){var x;return(x=a!=null?a:e==null?void 0:e.id)!=null?x:""},get mpVersion(){var x;return(x=t==null?void 0:t.ver)!=null?x:hr()},get mpType(){var x,M;return(M=(x=t==null?void 0:t.__mpType)!=null?x:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var x;return((x=ce.platform)!=null?x:ce.deviceInfo.platform).toLowerCase()},get deviceInfo(){return ce.deviceInfo},get sdkInfo(){return ce.sdkInfo},get hostInfo(){return ce.hostInfo},get hostUserInfo(){return ce.hostUserInfo},get sessionId(){var x,M;return(M=(x=ce.clientSessionId)!=null?x:l)!=null?M:n},get channel(){return p},get webviewId(){var x;return(x=ce.webviewId)!=null?x:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var x;return(x=ce.deviceInfo.adId)!=null?x:ce.deviceInfo.did},onEnvConfigChanged:x=>{na(ce,x,oa)},encodeJoliSourceQuery:x=>{var M,V;return t&&r?ma(z(z({},e),x),(M=i.get("joliSource"))!=null?M:""):(V=i.get("joliSource"))!=null?V:""}}},P=ad()});var oo,Ea,sd,ld,ba,ud,wa=j(()=>{"use strict";W();ze();ge();W();oo=!1,Ea=(e,t)=>e==null?!1:t in e,sd=e=>Ea(e,"kind"),ld=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},ba=(e,t={},r)=>{var i,a,l;let n={user_id:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:"",device_id:(l=P.deviceInfo.did)!=null?l:"",timestamp:Date.now(),tag:ld(e.name)},o=pe(z({},n),{env:t.environment,isFromUser:r});r?Ze.emit("GLOBAL_USER_ERROR",e,o):Ze.emit("GLOBAL_ERROR",e,o)},ud=e=>Ea(e,"kind")&&e.kind==="USER_ERROR";eo.on("ERROR_REPORT",({error:e,options:t})=>{if(oo)return;oo=!0;let r=sd(e)&&e.raw?e.raw:e;try{let n=ud(e);ba(e,t,n)}catch(n){let o=n instanceof Error?n.message:String(n),i=new zn(`${o}, origin error: ${r.message}`);ke.error(i),ba(new zn(i.message),{environment:t.environment},!1)}finally{oo=!1}})});var io,ao=j(()=>{"use strict";ze();W();ze();io=e=>new aa(e)});function Ia(e,t){let r=(n,o,i)=>{let a=pe(z({tag:n},t),{extra:z({},o)});n=="globalJsError"?Pe(new la(JSON.stringify(a))):e("systemLog",a,i)};return r.debounce=Lt(r,500,{leading:!0}),r}function Aa(e){let t=(r,n,o)=>{var l;let i=(l=o&&JSON.stringify(o))!=null?l:0,a={speed_value_type:r,total_duration:n};i&&Object.assign(a,{extra:i}),e("joliboxSpeedAnalysis",a)};return t.debounce=Lt(t,500,{leading:!0}),t}var Sa=j(()=>{"use strict";W();W();ze()});function Ra(e,t){let r=Ia(e,t),n=Aa(r);return{track:r,trackPerformance:n}}var Ta=j(()=>{"use strict";Sa()});var so=j(()=>{"use strict"});var pr,xa=j(()=>{"use strict";ge();W();W();pr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return L(this,null,function*(){let r=`${P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,o]of Object.entries(r))if(o.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,o,i,a,l;let{nativeSDKVersion:t,jssdkVersion:r}=P.sdkInfo;return{platform:1e3,os:P.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(i=(o=P.hostInfo)==null?void 0:o.aid)!=null?i:"1",model:(a=P.deviceInfo.model)!=null?a:"UnknownModel",brand:(l=P.deviceInfo.brand)!=null?l:"UnknownBrand",uuid:P.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,o)=>{r[o]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return L(this,null,function*(){if(this.checkIsSampled(t))return;let o=t.location?t.location:yield this.getLocation(),i=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let l=this.deviceInfo,f={protocolVersion:"1.0.0",events:[pe(z({},t),{location:o,target:i,extra:a,timestamp:Date.now(),userId:null})],device:l,project:r};try{n?yield this.doReport(Qn(f),n):yield this.doReport(Qn(f))}catch(y){ke.log("[Jolibox SDK] report API error",y)}})}}});var lo=j(()=>{"use strict";Ta();so();xa()});var uo,Ca,je,mr,Ve,Bt=j(()=>{"use strict";ro();ge();uo=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Ca=AbortSignal.timeout)!=null||(AbortSignal.timeout=uo);je=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new mr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},mr=class{constructor(t){this.xua=_a();this.getJoliSource=()=>P.joliSource;var n;let r=P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return L(this,null,function*(){try{let{query:n,timeout:o}=r!=null?r:{},{headers:i}=r!=null?r:{},a=n?new URLSearchParams(n):null,l=a==null?void 0:a.toString(),c=`${this.baseUrl}${t}${l?`?${l}`:""}`,f=this.xua,y=this.getJoliSource();i=Object.assign({},i!=null?i:{},f?{"x-user-agent":f}:{},y?{"x-joli-source":y}:{});let p=yield fetch(c,{method:"GET",headers:i,credentials:"include",signal:uo(o!=null?o:3e4)});return je.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw je.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return L(this,null,function*(){try{let{data:n,query:o,timeout:i}=r!=null?r:{},{headers:a}=r!=null?r:{},l=o?new URLSearchParams(o):null,c=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${c?`?${c}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"POST",headers:a,body:JSON.stringify(n),signal:uo(i!=null?i:3e4),credentials:"include"});je.getInstance().recordNetworkRequest(!0);let _=g.headers.get("content-type");if(_!=null&&_.includes("application/octet-stream"))try{return g.blob()}catch(w){return yield g.arrayBuffer()}if(_!=null&&_.includes("multipart/form-data")||_!=null&&_.includes("application/x-www-form-urlencoded"))try{return g.formData()}catch(w){return yield g.text()}if(_!=null&&_.includes("application/json"))try{return yield g.json()}catch(w){return yield g.text()}return g}catch(n){throw je.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return L(this,null,function*(){try{let{data:n,query:o,timeout:i}=r!=null?r:{},{headers:a}=r!=null?r:{},l=o?new URLSearchParams(o):null,c=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${c?`?${c}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!g.ok)throw je.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${g.status}`);return je.getInstance().recordNetworkRequest(!0),yield g.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=mr;Ve=je.getInstance()});var co,vr,fo=j(()=>{"use strict";ge();lo();Bt();co=class extends pr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Ve.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,o;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(o=P.testMode)!=null&&o?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},vr=new co});var cd,Oa=j(()=>{"use strict";wa();W();ao();W();fo();ge();cd=(e,t)=>{var o,i,a;let r={message:t.message,stack:(o=t.stack)!=null?o:"",errorType:t.name,source:0},n={name:e,type:Ut.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:null};vr.trackEvent(n,ut.WebSDK)};Ze.on("GLOBAL_ERROR",(e,t)=>{cd(t.tag,e)});Ze.on("GLOBAL_USER_ERROR",(e,t)=>{ke.log("UserError",e,t)})});var _r,ka=j(()=>{"use strict";_r=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,o,i=!1,a=0,l=()=>{if(!i)return;let _=Date.now(),w=_-r;w>=this.interval&&(this.visible&&(a+=w,t(a)),r=_),n=requestAnimationFrame(l)},c=()=>{y(),r=Date.now(),o=window.setInterval(()=>{if(!i)return;let _=Date.now();_-r>=this.interval&&(r=_)},this.interval)},f=()=>{p(),r=Date.now(),n=requestAnimationFrame(l)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},p=()=>{o&&(clearInterval(o),o=0)};this.eventEmitter.on("visible",_=>{i&&(console.log("visible",_),_?f():c())});let g=this.visible;return{start(){i||(i=!0,g?f():c())},stop(){i=!1,y(),p()}}}}});var gr,Pa=j(()=>{"use strict";ge();ka();Bt();gr=class extends _r{constructor(r,n,o){super(n,o);this.httpClient=Ve.create();this.gameId=P.mpId,this.sessionId=P.sessionId,this.track=r}reporter(r){return L(this,null,function*(){let{event:n,params:o}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:z({gameId:this.gameId,sessionId:this.sessionId},o)}})})}tracker(r,n=null){this.track(r,n)}}});var Da,dd,Le,fd,ho,De,et=j(()=>{"use strict";Oa();W();W();lo();fo();Pa();ge();so();Da=Te(),dd={type:ut.WebSDK,platform:"h5",jssdk_version:P.sdkInfo.jssdkVersion,mp_id:P.mpId,mp_version:P.mpVersion},{track:Le,trackPerformance:fd}=Ra((...e)=>{var a,l,c,f;let[,t]=e,r=t,n=ea(r.extra)?r.extra:Kn(r.extra)?JSON.parse(r.extra):{},o=pe(z({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(l=r.mp_version)!=null?l:""}),i={name:t.tag,type:Ut.System,location:null,target:null,extra:o,timestamp:Date.now(),userId:(f=(c=P.hostUserInfo)==null?void 0:c.uid)!=null?f:null};vr.trackEvent(i,ut.WebSDK)},dd);Da.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{fd(e,t,r)});Da.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});ho=new Ne,De=new gr(Le,ho)});function Na(e){let t=Yn.config[e];return t||(t={},Yn.config[e]=t),(r,n)=>{if(t[r]){ke.warn(`[can i use] ${r} already registered`);return}t[r]=z({},n)}}var La=j(()=>{"use strict";W()});function po(e){Ua=e}function yr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>yr(t)):Object.keys(e).reduce((t,r)=>(t[r]=yr(e[r]),t),{})}function Je(e){return typeof e=="number"}function mo(e){let t=vo(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function vo(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ua,oe,br,Er,wr,Ir,dt,Ar,Sr,Rr,Tr,xr,Cr,Or,kr,Pr,Dr,Nr,Lr,_o=j(()=>{"use strict";Ua=!1;oe=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ua)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${mo(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return yr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:yr(this._default)}optional(){return this._optional=!0,this}};br=class extends oe{validate(t){return this._optional&&t===void 0?!0:Je(t)?Je(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Je(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Je(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},Er=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},wr=class extends oe{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Je(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Je(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},Ir=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},dt=class extends oe{validate(t){return!0}},Ar=class extends oe{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Sr=class extends oe{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Rr=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Tr=class extends oe{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${mo(t)}`)}return!0}},xr=class extends oe{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(Je(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Je(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Je(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let o=!0;if(r.forEach((i,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,i===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(i)||(n.hasFallback?r[a]=n.fallbackValue:o=!1)}),this._uniqueItems){let i=new Map;for(let a in r)i.has(r[a])?o=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(r[a])}] and ${this.path}[${a}] are identical)`):i.set(r[a],a)}return o}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Cr=class extends oe{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(vo(r)!=="object")return this.fail({expect:"object",actual:r});let o=r,i=this._value;i.errors=this.errors;let a=!0;for(let l in o){let c=o[l];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(l)?i.path=`${this.path}.${l}`:i.path=`${this.path}["${l}"]`,!(c===void 0&&i._optional)){if(c===void 0&&i.hasDefault){o[l]=i.defaultValue;continue}i.validate(c)||(i.hasFallback?o[l]=i.fallbackValue:a=!1)}}return a}},Or=class extends oe{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(vo(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,o=!0;for(let i in this._object){let a=n[i],l=this._object[i];if(l.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?l.path=`${this.path}.${i}`:l.path=`${this.path}["${i}"]`,!(l._optional&&a===void 0)){if(a===void 0&&l.hasDefault){n[i]=l.defaultValue;continue}l.validate(a)||(l.hasFallback?n[i]=l.fallbackValue:o=!1)}}return o}},kr=class extends oe{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:mo(this.value),actual:r}):!0}},Pr=class extends oe{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,o=this._items.length;for(let i=0;i<o;i++){let a=this._items[i];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let i=r.join(`
|
|
2
|
-
or `);this.errors.push(i)}return n}},
|
|
3
|
-
`);throw e.errors.length=0,po(!1),new TypeError(n)}}var U,yo=j(()=>{"use strict";_o();_o();U={object(e){return new Or(e)},array(e){return new xr(e)},tuple(...e){return new Dr(...e)},literal(e){return new kr(e)},or(...e){return new Pr(...e)},symbol(){return new Ir},record(e){return new Cr(e)},function(){return new Rr},boolean(){return new Er},string(){return new wr},number(){return new br},undefined(){return new Ar},null(){return new Sr},unknown(){return new dt},any(){return new dt},as(){return new dt},arraybuffer(){return new Nr},enum(...e){return new Tr(...e)},typedarray(e){return new Lr(e)}}});var Ur,Ma,Ba=j(()=>{"use strict";W();ze();yo();ao();Ur=1,Ma=e=>{function t(n,o){return(...i)=>{var p,g,_,w;let a=Date.now(),l={method:n,trace_id:Ur};Ur+=1;let c="SUCCESS",f=`${n}:ok`,y=0;try{if(o.paramsSchema)try{go(o.paramsSchema,i,"params")}catch(k){throw io(`${n}:fail ${k.message}`)}let I=o.implement(...i),C=I,b=`${n}:ok`;if(I&&"code"in I){let{code:k,data:N,message:G}=I;c=k,C=N,b=G}return{code:c,message:b,data:C}}catch(I){let C=I;y=(g=(p=C.code)!=null?p:C.errNo)!=null?g:2e3,c="FAILURE";let b=(w=(_=C.message)!=null?_:C.errMsg)!=null?w:`${I}`;return f=`${n}:${c} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Pe(new fr(f,y)),{code:c,message:f}}finally{let I=Date.now()-a;e("apiInvoked",pe(z({},l),{duration:I,status:c}))}}}function r(n,o){return(...i)=>L(this,null,function*(){var g,_,w,I;let a=ta(i)?i:[i],l=Date.now(),c={method:n,trace_id:Ur};Ur+=1;let f=`${n}:ok`,y="SUCCESS",p={code:y,message:f};try{if(o.paramsSchema)try{go(o.paramsSchema,a,"params")}catch(k){throw io(k.message)}let b=yield o.implement(...a);if(b&&"code"in b){let{code:k,data:N,message:G}=b;y=k,f=G,b=N}return Object.assign(p,{code:y,message:f,data:b}),p}catch(C){let b=C,k=(_=(g=b.code)!=null?g:b.errNo)!=null?_:2e3;y="FAILURE";let N=(I=(w=b.message)!=null?w:b.errMsg)!=null?I:`${C}`,G=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(p,{code:y,message:G}),Pe(new fr(G,k)),p}finally{let C=Date.now()-l;e("apiInvoked",pe(z({},c),{duration:C,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var xe,tt,se,Ft=j(()=>{"use strict";La();et();Ba();yo();({createAPI:xe,createSyncAPI:tt}=Ma(Le)),se=Na("h5")});var Ja=lr((Va,Io)=>{(function(e){if(typeof Va=="object"&&typeof Io!="undefined")Io.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(o,i,a){function l(y,p){if(!i[y]){if(!o[y]){var g=typeof kt=="function"&&kt;if(!p&&g)return g(y,!0);if(c)return c(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var w=i[y]={exports:{}};o[y][0].call(w.exports,function(I){var C=o[y][1][I];return l(C||I)},w,w.exports,n,o,i,a)}return i[y].exports}for(var c=typeof kt=="function"&&kt,f=0;f<a.length;f++)l(a[f]);return l}({1:[function(n,o,i){(function(a){"use strict";var l=a.MutationObserver||a.WebKitMutationObserver,c;if(l){var f=0,y=new l(I),p=a.document.createTextNode("");y.observe(p,{characterData:!0}),c=function(){p.data=f=++f%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var g=new a.MessageChannel;g.port1.onmessage=I,c=function(){g.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?c=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){I(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:c=function(){setTimeout(I,0)};var _,w=[];function I(){_=!0;for(var b,k,N=w.length;N;){for(k=w,w=[],b=-1;++b<N;)k[b]();N=w.length}_=!1}o.exports=C;function C(b){w.push(b)===1&&!_&&c()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,o,i){"use strict";var a=n(1);function l(){}var c={},f=["REJECTED"],y=["FULFILLED"],p=["PENDING"];o.exports=g;function g(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,R!==l&&C(this,R)}g.prototype.catch=function(R){return this.then(null,R)},g.prototype.then=function(R,x){if(typeof R!="function"&&this.state===y||typeof x!="function"&&this.state===f)return this;var M=new this.constructor(l);if(this.state!==p){var V=this.state===y?R:x;w(M,V,this.outcome)}else this.queue.push(new _(M,R,x));return M};function _(R,x,M){this.promise=R,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof M=="function"&&(this.onRejected=M,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(R){c.resolve(this.promise,R)},_.prototype.otherCallFulfilled=function(R){w(this.promise,this.onFulfilled,R)},_.prototype.callRejected=function(R){c.reject(this.promise,R)},_.prototype.otherCallRejected=function(R){w(this.promise,this.onRejected,R)};function w(R,x,M){a(function(){var V;try{V=x(M)}catch(ee){return c.reject(R,ee)}V===R?c.reject(R,new TypeError("Cannot resolve promise with itself")):c.resolve(R,V)})}c.resolve=function(R,x){var M=b(I,x);if(M.status==="error")return c.reject(R,M.value);var V=M.value;if(V)C(R,V);else{R.state=y,R.outcome=x;for(var ee=-1,Y=R.queue.length;++ee<Y;)R.queue[ee].callFulfilled(x)}return R},c.reject=function(R,x){R.state=f,R.outcome=x;for(var M=-1,V=R.queue.length;++M<V;)R.queue[M].callRejected(x);return R};function I(R){var x=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof x=="function")return function(){x.apply(R,arguments)}}function C(R,x){var M=!1;function V(Ae){M||(M=!0,c.reject(R,Ae))}function ee(Ae){M||(M=!0,c.resolve(R,Ae))}function Y(){x(ee,V)}var le=b(Y);le.status==="error"&&V(le.value)}function b(R,x){var M={};try{M.value=R(x),M.status="success"}catch(V){M.status="error",M.value=V}return M}g.resolve=k;function k(R){return R instanceof this?R:c.resolve(new this(l),R)}g.reject=N;function N(R){var x=new this(l);return c.reject(x,R)}g.all=G;function G(R){var x=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=R.length,V=!1;if(!M)return this.resolve([]);for(var ee=new Array(M),Y=0,le=-1,Ae=new this(l);++le<M;)Be(R[le],le);return Ae;function Be(xt,ir){x.resolve(xt).then(xn,function(st){V||(V=!0,c.reject(Ae,st))});function xn(st){ee[ir]=st,++Y===M&&!V&&(V=!0,c.resolve(Ae,ee))}}}g.race=Q;function Q(R){var x=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=R.length,V=!1;if(!M)return this.resolve([]);for(var ee=-1,Y=new this(l);++ee<M;)le(R[ee]);return Y;function le(Ae){x.resolve(Ae).then(function(Be){V||(V=!0,c.resolve(Y,Be))},function(Be){V||(V=!0,c.reject(Y,Be))})}}},{1:1}],3:[function(n,o,i){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,o,i){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function l(s,d){if(!(s instanceof d))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(s){return}}var f=c();function y(){try{if(!f||!f.open)return!1;var s=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!s||d)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(u){return!1}}function p(s,d){s=s||[],d=d||{};try{return new Blob(s,d)}catch(h){if(h.name!=="TypeError")throw h;for(var u=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,m=new u,v=0;v<s.length;v+=1)m.append(s[v]);return m.getBlob(d.type)}}typeof Promise=="undefined"&&n(3);var g=Promise;function _(s,d){d&&s.then(function(u){d(null,u)},function(u){d(u)})}function w(s,d,u){typeof d=="function"&&s.then(d),typeof u=="function"&&s.catch(u)}function I(s){return typeof s!="string"&&(console.warn(s+" used as a key, but it is not a string."),s=String(s)),s}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",k=void 0,N={},G=Object.prototype.toString,Q="readonly",R="readwrite";function x(s){for(var d=s.length,u=new ArrayBuffer(d),m=new Uint8Array(u),v=0;v<d;v++)m[v]=s.charCodeAt(v);return u}function M(s){return new g(function(d){var u=s.transaction(b,R),m=p([""]);u.objectStore(b).put(m,"key"),u.onabort=function(v){v.preventDefault(),v.stopPropagation(),d(!1)},u.oncomplete=function(){var v=navigator.userAgent.match(/Chrome\/(\d+)/),h=navigator.userAgent.match(/Edge\//);d(h||!v||parseInt(v[1],10)>=43)}}).catch(function(){return!1})}function V(s){return typeof k=="boolean"?g.resolve(k):M(s).then(function(d){return k=d,k})}function ee(s){var d=N[s.name],u={};u.promise=new g(function(m,v){u.resolve=m,u.reject=v}),d.deferredOperations.push(u),d.dbReady?d.dbReady=d.dbReady.then(function(){return u.promise}):d.dbReady=u.promise}function Y(s){var d=N[s.name],u=d.deferredOperations.pop();if(u)return u.resolve(),u.promise}function le(s,d){var u=N[s.name],m=u.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Ae(s,d){return new g(function(u,m){if(N[s.name]=N[s.name]||Si(),s.db)if(d)ee(s),s.db.close();else return u(s.db);var v=[s.name];d&&v.push(s.version);var h=f.open.apply(f,v);d&&(h.onupgradeneeded=function(E){var A=h.result;try{A.createObjectStore(s.storeName),E.oldVersion<=1&&A.createObjectStore(b)}catch(S){if(S.name==="ConstraintError")console.warn('The database "'+s.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+s.storeName+'" already exists.');else throw S}}),h.onerror=function(E){E.preventDefault(),m(h.error)},h.onsuccess=function(){var E=h.result;E.onversionchange=function(A){A.target.close()},u(E),Y(s)}})}function Be(s){return Ae(s,!1)}function xt(s){return Ae(s,!0)}function ir(s,d){if(!s.db)return!0;var u=!s.db.objectStoreNames.contains(s.storeName),m=s.version<s.db.version,v=s.version>s.db.version;if(m&&(s.version!==d&&console.warn('The database "'+s.name+`" can't be downgraded from version `+s.db.version+" to version "+s.version+"."),s.version=s.db.version),v||u){if(u){var h=s.db.version+1;h>s.version&&(s.version=h)}return!0}return!1}function xn(s){return new g(function(d,u){var m=new FileReader;m.onerror=u,m.onloadend=function(v){var h=btoa(v.target.result||"");d({__local_forage_encoded_blob:!0,data:h,type:s.type})},m.readAsBinaryString(s)})}function st(s){var d=x(atob(s.data));return p([d],{type:s.type})}function Ai(s){return s&&s.__local_forage_encoded_blob}function hu(s){var d=this,u=d._initReady().then(function(){var m=N[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(u,s,s),u}function pu(s){ee(s);for(var d=N[s.name],u=d.forages,m=0;m<u.length;m++){var v=u[m];v._dbInfo.db&&(v._dbInfo.db.close(),v._dbInfo.db=null)}return s.db=null,Be(s).then(function(h){return s.db=h,ir(s)?xt(s):h}).then(function(h){s.db=d.db=h;for(var E=0;E<u.length;E++)u[E]._dbInfo.db=h}).catch(function(h){throw le(s,h),h})}function Fe(s,d,u,m){m===void 0&&(m=1);try{var v=s.db.transaction(s.storeName,d);u(null,v)}catch(h){if(m>0&&(!s.db||h.name==="InvalidStateError"||h.name==="NotFoundError"))return g.resolve().then(function(){if(!s.db||h.name==="NotFoundError"&&!s.db.objectStoreNames.contains(s.storeName)&&s.version<=s.db.version)return s.db&&(s.version=s.db.version+1),xt(s)}).then(function(){return pu(s).then(function(){Fe(s,d,u,m-1)})}).catch(u);u(h)}}function Si(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function mu(s){var d=this,u={db:null};if(s)for(var m in s)u[m]=s[m];var v=N[u.name];v||(v=Si(),N[u.name]=v),v.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=hu);var h=[];function E(){return g.resolve()}for(var A=0;A<v.forages.length;A++){var S=v.forages[A];S!==d&&h.push(S._initReady().catch(E))}var T=v.forages.slice(0);return g.all(h).then(function(){return u.db=v.db,Be(u)}).then(function(O){return u.db=O,ir(u,d._defaultConfig.version)?xt(u):O}).then(function(O){u.db=v.db=O,d._dbInfo=u;for(var D=0;D<T.length;D++){var F=T[D];F!==d&&(F._dbInfo.db=u.db,F._dbInfo.version=u.version)}})}function vu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){Fe(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var S=A.objectStore(u._dbInfo.storeName),T=S.get(s);T.onsuccess=function(){var O=T.result;O===void 0&&(O=null),Ai(O)&&(O=st(O)),v(O)},T.onerror=function(){h(T.error)}}catch(O){h(O)}})}).catch(h)});return _(m,d),m}function _u(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){Fe(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var S=A.objectStore(u._dbInfo.storeName),T=S.openCursor(),O=1;T.onsuccess=function(){var D=T.result;if(D){var F=D.value;Ai(F)&&(F=st(F));var H=s(F,D.key,O++);H!==void 0?v(H):D.continue()}else v()},T.onerror=function(){h(T.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function gu(s,d,u){var m=this;s=I(s);var v=new g(function(h,E){var A;m.ready().then(function(){return A=m._dbInfo,G.call(d)==="[object Blob]"?V(A.db).then(function(S){return S?d:xn(d)}):d}).then(function(S){Fe(m._dbInfo,R,function(T,O){if(T)return E(T);try{var D=O.objectStore(m._dbInfo.storeName);S===null&&(S=void 0);var F=D.put(S,s);O.oncomplete=function(){S===void 0&&(S=null),h(S)},O.onabort=O.onerror=function(){var H=F.error?F.error:F.transaction.error;E(H)}}catch(H){E(H)}})}).catch(E)});return _(v,u),v}function yu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){Fe(u._dbInfo,R,function(E,A){if(E)return h(E);try{var S=A.objectStore(u._dbInfo.storeName),T=S.delete(s);A.oncomplete=function(){v()},A.onerror=function(){h(T.error)},A.onabort=function(){var O=T.error?T.error:T.transaction.error;h(O)}}catch(O){h(O)}})}).catch(h)});return _(m,d),m}function bu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Fe(d._dbInfo,R,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),S=A.clear();E.oncomplete=function(){m()},E.onabort=E.onerror=function(){var T=S.error?S.error:S.transaction.error;v(T)}}catch(T){v(T)}})}).catch(v)});return _(u,s),u}function Eu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Fe(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),S=A.count();S.onsuccess=function(){m(S.result)},S.onerror=function(){v(S.error)}}catch(T){v(T)}})}).catch(v)});return _(u,s),u}function wu(s,d){var u=this,m=new g(function(v,h){if(s<0){v(null);return}u.ready().then(function(){Fe(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var S=A.objectStore(u._dbInfo.storeName),T=!1,O=S.openKeyCursor();O.onsuccess=function(){var D=O.result;if(!D){v(null);return}s===0||T?v(D.key):(T=!0,D.advance(s))},O.onerror=function(){h(O.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function Iu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Fe(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),S=A.openKeyCursor(),T=[];S.onsuccess=function(){var O=S.result;if(!O){m(T);return}T.push(O.key),O.continue()},S.onerror=function(){v(S.error)}}catch(O){v(O)}})}).catch(v)});return _(u,s),u}function Au(s,d){d=C.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var m=this,v;if(!s.name)v=g.reject("Invalid arguments");else{var h=s.name===u.name&&m._dbInfo.db,E=h?g.resolve(m._dbInfo.db):Be(s).then(function(A){var S=N[s.name],T=S.forages;S.db=A;for(var O=0;O<T.length;O++)T[O]._dbInfo.db=A;return A});s.storeName?v=E.then(function(A){if(A.objectStoreNames.contains(s.storeName)){var S=A.version+1;ee(s);var T=N[s.name],O=T.forages;A.close();for(var D=0;D<O.length;D++){var F=O[D];F._dbInfo.db=null,F._dbInfo.version=S}var H=new g(function(K,ne){var te=f.open(s.name,S);te.onerror=function(Se){var Ot=te.result;Ot.close(),ne(Se)},te.onupgradeneeded=function(){var Se=te.result;Se.deleteObjectStore(s.storeName)},te.onsuccess=function(){var Se=te.result;Se.close(),K(Se)}});return H.then(function(K){T.db=K;for(var ne=0;ne<O.length;ne++){var te=O[ne];te._dbInfo.db=K,Y(te._dbInfo)}}).catch(function(K){throw(le(s,K)||g.resolve()).catch(function(){}),K})}}):v=E.then(function(A){ee(s);var S=N[s.name],T=S.forages;A.close();for(var O=0;O<T.length;O++){var D=T[O];D._dbInfo.db=null}var F=new g(function(H,K){var ne=f.deleteDatabase(s.name);ne.onerror=function(){var te=ne.result;te&&te.close(),K(ne.error)},ne.onblocked=function(){console.warn('dropInstance blocked for database "'+s.name+'" until all open connections are closed')},ne.onsuccess=function(){var te=ne.result;te&&te.close(),H(te)}});return F.then(function(H){S.db=H;for(var K=0;K<T.length;K++){var ne=T[K];Y(ne._dbInfo)}}).catch(function(H){throw(le(s,H)||g.resolve()).catch(function(){}),H})})}return _(v,d),v}var Su={_driver:"asyncStorage",_initStorage:mu,_support:y(),iterate:_u,getItem:vu,setItem:gu,removeItem:yu,clear:bu,length:Eu,key:wu,keys:Iu,dropInstance:Au};function Ru(){return typeof openDatabase=="function"}var We="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tu="~~local_forage_type~",Ri=/^~~local_forage_type~([^~]+)~/,ar="__lfsc__:",Cn=ar.length,On="arbf",kn="blob",Ti="si08",xi="ui08",Ci="uic8",Oi="si16",ki="si32",Pi="ur16",Di="ui32",Ni="fl32",Li="fl64",Ui=Cn+On.length,Mi=Object.prototype.toString;function Bi(s){var d=s.length*.75,u=s.length,m,v=0,h,E,A,S;s[s.length-1]==="="&&(d--,s[s.length-2]==="="&&d--);var T=new ArrayBuffer(d),O=new Uint8Array(T);for(m=0;m<u;m+=4)h=We.indexOf(s[m]),E=We.indexOf(s[m+1]),A=We.indexOf(s[m+2]),S=We.indexOf(s[m+3]),O[v++]=h<<2|E>>4,O[v++]=(E&15)<<4|A>>2,O[v++]=(A&3)<<6|S&63;return T}function Pn(s){var d=new Uint8Array(s),u="",m;for(m=0;m<d.length;m+=3)u+=We[d[m]>>2],u+=We[(d[m]&3)<<4|d[m+1]>>4],u+=We[(d[m+1]&15)<<2|d[m+2]>>6],u+=We[d[m+2]&63];return d.length%3===2?u=u.substring(0,u.length-1)+"=":d.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function xu(s,d){var u="";if(s&&(u=Mi.call(s)),s&&(u==="[object ArrayBuffer]"||s.buffer&&Mi.call(s.buffer)==="[object ArrayBuffer]")){var m,v=ar;s instanceof ArrayBuffer?(m=s,v+=On):(m=s.buffer,u==="[object Int8Array]"?v+=Ti:u==="[object Uint8Array]"?v+=xi:u==="[object Uint8ClampedArray]"?v+=Ci:u==="[object Int16Array]"?v+=Oi:u==="[object Uint16Array]"?v+=Pi:u==="[object Int32Array]"?v+=ki:u==="[object Uint32Array]"?v+=Di:u==="[object Float32Array]"?v+=Ni:u==="[object Float64Array]"?v+=Li:d(new Error("Failed to get type for BinaryArray"))),d(v+Pn(m))}else if(u==="[object Blob]"){var h=new FileReader;h.onload=function(){var E=Tu+s.type+"~"+Pn(this.result);d(ar+kn+E)},h.readAsArrayBuffer(s)}else try{d(JSON.stringify(s))}catch(E){console.error("Couldn't convert value into a JSON string: ",s),d(null,E)}}function Cu(s){if(s.substring(0,Cn)!==ar)return JSON.parse(s);var d=s.substring(Ui),u=s.substring(Cn,Ui),m;if(u===kn&&Ri.test(d)){var v=d.match(Ri);m=v[1],d=d.substring(v[0].length)}var h=Bi(d);switch(u){case On:return h;case kn:return p([h],{type:m});case Ti:return new Int8Array(h);case xi:return new Uint8Array(h);case Ci:return new Uint8ClampedArray(h);case Oi:return new Int16Array(h);case Pi:return new Uint16Array(h);case ki:return new Int32Array(h);case Di:return new Uint32Array(h);case Ni:return new Float32Array(h);case Li:return new Float64Array(h);default:throw new Error("Unkown type: "+u)}}var Dn={serialize:xu,deserialize:Cu,stringToBuffer:Bi,bufferToString:Pn};function Fi(s,d,u,m){s.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,m)}function Ou(s){var d=this,u={db:null};if(s)for(var m in s)u[m]=typeof s[m]!="string"?s[m].toString():s[m];var v=new g(function(h,E){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(A){return E(A)}u.db.transaction(function(A){Fi(A,u,function(){d._dbInfo=u,h()},function(S,T){E(T)})},E)});return u.serializer=Dn,v}function qe(s,d,u,m,v,h){s.executeSql(u,m,v,function(E,A){A.code===A.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(S,T){T.rows.length?h(S,A):Fi(S,d,function(){S.executeSql(u,m,v,h)},h)},h):h(E,A)},h)}function ku(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){qe(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[s],function(S,T){var O=T.rows.length?T.rows.item(0).value:null;O&&(O=E.serializer.deserialize(O)),v(O)},function(S,T){h(T)})})}).catch(h)});return _(m,d),m}function Pu(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){qe(A,E,"SELECT * FROM "+E.storeName,[],function(S,T){for(var O=T.rows,D=O.length,F=0;F<D;F++){var H=O.item(F),K=H.value;if(K&&(K=E.serializer.deserialize(K)),K=s(K,H.key,F+1),K!==void 0){v(K);return}}v()},function(S,T){h(T)})})}).catch(h)});return _(m,d),m}function ji(s,d,u,m){var v=this;s=I(s);var h=new g(function(E,A){v.ready().then(function(){d===void 0&&(d=null);var S=d,T=v._dbInfo;T.serializer.serialize(d,function(O,D){D?A(D):T.db.transaction(function(F){qe(F,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[s,O],function(){E(S)},function(H,K){A(K)})},function(F){if(F.code===F.QUOTA_ERR){if(m>0){E(ji.apply(v,[s,S,u,m-1]));return}A(F)}})})}).catch(A)});return _(h,u),h}function Du(s,d,u){return ji.apply(this,[s,d,u,1])}function Nu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){qe(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[s],function(){v()},function(S,T){h(T)})})}).catch(h)});return _(m,d),m}function Lu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){qe(E,h,"DELETE FROM "+h.storeName,[],function(){m()},function(A,S){v(S)})})}).catch(v)});return _(u,s),u}function Uu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){qe(E,h,"SELECT COUNT(key) as c FROM "+h.storeName,[],function(A,S){var T=S.rows.item(0).c;m(T)},function(A,S){v(S)})})}).catch(v)});return _(u,s),u}function Mu(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){qe(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[s+1],function(S,T){var O=T.rows.length?T.rows.item(0).key:null;v(O)},function(S,T){h(T)})})}).catch(h)});return _(m,d),m}function Bu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){qe(E,h,"SELECT key FROM "+h.storeName,[],function(A,S){for(var T=[],O=0;O<S.rows.length;O++)T.push(S.rows.item(O).key);m(T)},function(A,S){v(S)})})}).catch(v)});return _(u,s),u}function Fu(s){return new g(function(d,u){s.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(v,h){for(var E=[],A=0;A<h.rows.length;A++)E.push(h.rows.item(A).name);d({db:s,storeNames:E})},function(v,h){u(h)})},function(m){u(m)})})}function ju(s,d){d=C.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var m=this,v;return s.name?v=new g(function(h){var E;s.name===u.name?E=m._dbInfo.db:E=openDatabase(s.name,"","",0),s.storeName?h({db:E,storeNames:[s.storeName]}):h(Fu(E))}).then(function(h){return new g(function(E,A){h.db.transaction(function(S){function T(H){return new g(function(K,ne){S.executeSql("DROP TABLE IF EXISTS "+H,[],function(){K()},function(te,Se){ne(Se)})})}for(var O=[],D=0,F=h.storeNames.length;D<F;D++)O.push(T(h.storeNames[D]));g.all(O).then(function(){E()}).catch(function(H){A(H)})},function(S){A(S)})})}):v=g.reject("Invalid arguments"),_(v,d),v}var Vu={_driver:"webSQLStorage",_initStorage:Ou,_support:Ru(),iterate:Pu,getItem:ku,setItem:Du,removeItem:Nu,clear:Lu,length:Uu,key:Mu,keys:Bu,dropInstance:ju};function Ju(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(s){return!1}}function Vi(s,d){var u=s.name+"/";return s.storeName!==d.storeName&&(u+=s.storeName+"/"),u}function $u(){var s="_localforage_support_test";try{return localStorage.setItem(s,!0),localStorage.removeItem(s),!1}catch(d){return!0}}function Hu(){return!$u()||localStorage.length>0}function Gu(s){var d=this,u={};if(s)for(var m in s)u[m]=s[m];return u.keyPrefix=Vi(s,d._defaultConfig),Hu()?(d._dbInfo=u,u.serializer=Dn,g.resolve()):g.reject()}function Ku(s){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,v=localStorage.length-1;v>=0;v--){var h=localStorage.key(v);h.indexOf(m)===0&&localStorage.removeItem(h)}});return _(u,s),u}function Wu(s,d){var u=this;s=I(s);var m=u.ready().then(function(){var v=u._dbInfo,h=localStorage.getItem(v.keyPrefix+s);return h&&(h=v.serializer.deserialize(h)),h});return _(m,d),m}function qu(s,d){var u=this,m=u.ready().then(function(){for(var v=u._dbInfo,h=v.keyPrefix,E=h.length,A=localStorage.length,S=1,T=0;T<A;T++){var O=localStorage.key(T);if(O.indexOf(h)===0){var D=localStorage.getItem(O);if(D&&(D=v.serializer.deserialize(D)),D=s(D,O.substring(E),S++),D!==void 0)return D}}});return _(m,d),m}function zu(s,d){var u=this,m=u.ready().then(function(){var v=u._dbInfo,h;try{h=localStorage.key(s)}catch(E){h=null}return h&&(h=h.substring(v.keyPrefix.length)),h});return _(m,d),m}function Yu(s){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo,v=localStorage.length,h=[],E=0;E<v;E++){var A=localStorage.key(E);A.indexOf(m.keyPrefix)===0&&h.push(A.substring(m.keyPrefix.length))}return h});return _(u,s),u}function Qu(s){var d=this,u=d.keys().then(function(m){return m.length});return _(u,s),u}function Xu(s,d){var u=this;s=I(s);var m=u.ready().then(function(){var v=u._dbInfo;localStorage.removeItem(v.keyPrefix+s)});return _(m,d),m}function Zu(s,d,u){var m=this;s=I(s);var v=m.ready().then(function(){d===void 0&&(d=null);var h=d;return new g(function(E,A){var S=m._dbInfo;S.serializer.serialize(d,function(T,O){if(O)A(O);else try{localStorage.setItem(S.keyPrefix+s,T),E(h)}catch(D){(D.name==="QuotaExceededError"||D.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(D),A(D)}})})});return _(v,u),v}function ec(s,d){if(d=C.apply(this,arguments),s=typeof s!="function"&&s||{},!s.name){var u=this.config();s.name=s.name||u.name,s.storeName=s.storeName||u.storeName}var m=this,v;return s.name?v=new g(function(h){s.storeName?h(Vi(s,m._defaultConfig)):h(s.name+"/")}).then(function(h){for(var E=localStorage.length-1;E>=0;E--){var A=localStorage.key(E);A.indexOf(h)===0&&localStorage.removeItem(A)}}):v=g.reject("Invalid arguments"),_(v,d),v}var tc={_driver:"localStorageWrapper",_initStorage:Gu,_support:Ju(),iterate:qu,getItem:Wu,setItem:Zu,removeItem:Xu,clear:Ku,length:Qu,key:zu,keys:Yu,dropInstance:ec},rc=function(d,u){return d===u||typeof d=="number"&&typeof u=="number"&&isNaN(d)&&isNaN(u)},nc=function(d,u){for(var m=d.length,v=0;v<m;){if(rc(d[v],u))return!0;v++}return!1},Ji=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},Ct={},$i={},lt={INDEXEDDB:Su,WEBSQL:Vu,LOCALSTORAGE:tc},oc=[lt.INDEXEDDB._driver,lt.WEBSQL._driver,lt.LOCALSTORAGE._driver],sr=["dropInstance"],Nn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(sr),ic={description:"",driver:oc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ac(s,d){s[d]=function(){var u=arguments;return s.ready().then(function(){return s[d].apply(s,u)})}}function Ln(){for(var s=1;s<arguments.length;s++){var d=arguments[s];if(d)for(var u in d)d.hasOwnProperty(u)&&(Ji(d[u])?arguments[0][u]=d[u].slice():arguments[0][u]=d[u])}return arguments[0]}var sc=function(){function s(d){l(this,s);for(var u in lt)if(lt.hasOwnProperty(u)){var m=lt[u],v=m._driver;this[u]=v,Ct[v]||this.defineDriver(m)}this._defaultConfig=Ln({},ic),this._config=Ln({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return s.prototype.config=function(u){if((typeof u=="undefined"?"undefined":a(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in u){if(m==="storeName"&&(u[m]=u[m].replace(/\W/g,"_")),m==="version"&&typeof u[m]!="number")return new Error("Database version must be a number.");this._config[m]=u[m]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},s.prototype.defineDriver=function(u,m,v){var h=new g(function(E,A){try{var S=u._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){A(T);return}for(var O=Nn.concat("_initStorage"),D=0,F=O.length;D<F;D++){var H=O[D],K=!nc(sr,H);if((K||u[H])&&typeof u[H]!="function"){A(T);return}}var ne=function(){for(var Ot=function(cc){return function(){var dc=new Error("Method "+cc+" is not implemented by the current driver"),Hi=g.reject(dc);return _(Hi,arguments[arguments.length-1]),Hi}},Un=0,uc=sr.length;Un<uc;Un++){var Mn=sr[Un];u[Mn]||(u[Mn]=Ot(Mn))}};ne();var te=function(Ot){Ct[S]&&console.info("Redefining LocalForage driver: "+S),Ct[S]=u,$i[S]=Ot,E()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(te,A):te(!!u._support):te(!0)}catch(Se){A(Se)}});return w(h,m,v),h},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(u,m,v){var h=Ct[u]?g.resolve(Ct[u]):g.reject(new Error("Driver not found."));return w(h,m,v),h},s.prototype.getSerializer=function(u){var m=g.resolve(Dn);return w(m,u),m},s.prototype.ready=function(u){var m=this,v=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(v,u,u),v},s.prototype.setDriver=function(u,m,v){var h=this;Ji(u)||(u=[u]);var E=this._getSupportedDrivers(u);function A(){h._config.driver=h.driver()}function S(D){return h._extend(D),A(),h._ready=h._initStorage(h._config),h._ready}function T(D){return function(){var F=0;function H(){for(;F<D.length;){var K=D[F];return F++,h._dbInfo=null,h._ready=null,h.getDriver(K).then(S).catch(H)}A();var ne=new Error("No available storage method found.");return h._driverSet=g.reject(ne),h._driverSet}return H()}}var O=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=O.then(function(){var D=E[0];return h._dbInfo=null,h._ready=null,h.getDriver(D).then(function(F){h._driver=F._driver,A(),h._wrapLibraryMethodsWithReady(),h._initDriver=T(E)})}).catch(function(){A();var D=new Error("No available storage method found.");return h._driverSet=g.reject(D),h._driverSet}),w(this._driverSet,m,v),this._driverSet},s.prototype.supports=function(u){return!!$i[u]},s.prototype._extend=function(u){Ln(this,u)},s.prototype._getSupportedDrivers=function(u){for(var m=[],v=0,h=u.length;v<h;v++){var E=u[v];this.supports(E)&&m.push(E)}return m},s.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,m=Nn.length;u<m;u++)ac(this,Nn[u])},s.prototype.createInstance=function(u){return new s(u)},s}(),lc=new sc;o.exports=lc},{3:3}]},{},[4])(4)})});var Ha=lr(rt=>{"use strict";W();Ft();et();var ft=Te(),Od=xe("levelFinished",{paramsSchema:U.tuple(U.string(),U.object({result:U.boolean(),duration:U.number()})),implement:(e,t)=>L(rt,null,function*(){let{result:r,duration:n}=t;ke.info("onLevelFinished",r,n),yield Promise.all([De.reporter({event:"COMPLETE_GAME_LEVEL"}),De.tracker("LevelFinished",{levelId:e,result:r,duration:n})])})}),kd=xe("taskFinished",{paramsSchema:U.tuple(U.string(),U.object({duration:U.number()})),implement:(e,t)=>L(rt,null,function*(){let{duration:r}=t;yield De.tracker("TaskFinished",{duration:r,taskId:e})})}),Pd=xe("levelUpgrade",{paramsSchema:U.tuple(U.string(),U.string()),implement:(e,t)=>L(rt,null,function*(){return yield De.tracker("LevelUpgrade",{name:t,levelId:e})})}),Dd=xe("onHistoryUserLevel",{paramsSchema:U.tuple(U.number()),implement:e=>L(rt,null,function*(){return yield De.tracker("HistoryUserLevel",{level:e})})}),Nd=xe("onHistoryUserScore",{paramsSchema:U.tuple(U.number()),implement:e=>L(rt,null,function*(){return yield De.tracker("HistoryUserScore",{score:e})})}),Ld=xe("taskEvent",{paramsSchema:U.tuple(U.string(),U.object({tools:U.array(U.object({id:U.string(),name:U.string(),count:U.number(),description:U.string().optional(),price:U.object({amount:U.number(),unit:U.string()}).optional()})).optional(),awards:U.array(U.object({id:U.string(),name:U.string()})).optional()})),implement:(e,t)=>L(rt,null,function*(){var r;(r=t.tools)!=null&&r.length&&(yield Promise.all([De.reporter({event:"USE_GAME_ITEM"}),De.tracker("UseGameItem",z({taskId:e},t))]))})});ft.registerCommand("TaskTrackerSDK.levelFinished",Od);ft.registerCommand("TaskTrackerSDK.taskFinished",kd);ft.registerCommand("TaskTrackerSDK.levelUpgrade",Pd);ft.registerCommand("TaskTrackerSDK.historyUserLevel",Dd);ft.registerCommand("TaskTrackerSDK.historyUserScore",Nd);ft.registerCommand("TaskTrackerSDK.taskEvent",Ld);se("TaskTrackerSDK.onLevelFinished",{version:"1.0.0",properties:{levelId:"1.0.0",params:{result:"1.0.0",duration:"1.0.0"}}});se("TaskTrackerSDK.onTaskFinished",{version:"1.0.0",properties:{taskId:"1.0.0",duration:"1.0.0"}});se("TaskTrackerSDK.onLevelUpgrade",{version:"1.0.0",properties:{levelId:"1.0.0",name:"1.0.0"}});se("TaskTrackerSDK.onHistoryUserLevel",{version:"1.0.0",properties:{level:"1.0.0"}});se("TaskTrackerSDK.onHistoryUserScore",{version:"1.0.0",properties:{score:"1.0.0"}});se("TaskTrackerSDK.onTaskEvent",{version:"1.0.0",properties:{taskId:"1.0.0",params:{tools:{id:"1.0.0",name:"1.0.0",count:"1.0.0",description:"1.0.0",price:{amount:"1.0.0",unit:"1.0.0"}},awards:{id:"1.0.0",name:"1.0.0"}}}})});var pt,ht,Ga,So,Ud,Ro,To=j(()=>{"use strict";pt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},ht=new Map,Ga=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=ht.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(o){console.warn("Callback execution failed:",o)}})}}catch(t){console.warn("Failed to parse message:",t)}},So=!1,Ud=()=>{So||(window.addEventListener("message",Ga),So=!0)},Ro=(e,t)=>{Ud(),ht.has(e)||ht.set(e,new Set);let r=ht.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&ht.delete(e),ht.size===0&&(window.removeEventListener("message",Ga),So=!1)}}});function Wa(){let e=new Map,t;return{registerRewardHandler(n,o){e.set(n,o)},handleReward(n,...o){return L(this,null,function*(){return yield n.reduce((a,l)=>L(this,null,function*(){let c=yield a;if(c===!0)return!0;Ka&&console.log(`handleReward ${l}`);let f=e.get(l),y=f?yield f(...o):c;return Ka&&console.log(`handleReward ${l} ${y}`),y}),Promise.resolve(!1))})},registerRewardsFetcher(n){return L(this,null,function*(){t=(...o)=>L(this,null,function*(){try{return yield n(...o)}catch(i){return console.error("getRewardOptions error:",i),["ADS"]}})})},getRewardsTypes(...n){return L(this,null,function*(){return t?yield t(...n):["ADS"]})}}}var Ka,qa=j(()=>{"use strict";ge();Ka=P.testMode});var vt,Vr,Jr,$r,Hr,mt,Md,me,_t=j(()=>{"use strict";W();vt="UNLOCK_OPTIONS_CHANGED",Vr="INVOKE_PAYMENT",Jr="ON_PAYMENT_RESULT",$r="ON_USE_MODAL_EVENT",Hr="ON_USE_MODAL_RESULT",mt=new Ne,Md=()=>({on:mt.on.bind(mt),off:mt.off.bind(mt),emit:mt.emit.bind(mt)}),me=Md()});var Bd,Fd,za,Ya=j(()=>{"use strict";_t();Bd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,Fd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Bd()):["ADS"],za=e=>{e.registerRewardsFetcher(t=>L(void 0,null,function*(){var n,o,i,a;let r=["ADS"];try{let l=yield t.post("/api/games/unlock-options",{});if(l.code!=="SUCCESS")return r;me.emit(vt,{options:((n=l.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((o=l.extra)==null?void 0:o.joliCoin)||{balance:0,enableAutoDeduct:!1}});let c=((a=(i=l.data)==null?void 0:i.unlockOptions)==null?void 0:a.map(f=>f.type))||Array.from(r);return Fd(c)}catch(l){return console.error("getRewardOptions error:",l),r}}))}});var Qa,Xa=j(()=>{"use strict";Qa=e=>t=>L(void 0,null,function*(){return e.adBreak(t),!0})});function nt(e,t){let r=null,n=null,o=null,i=()=>{if(o){r=Promise.resolve(o);return}r=new Promise(a=>{n=a})};return i(),e.on(t,(...a)=>{let l=a[0];o=l,n&&(n(l),n=null)}),{getData:()=>(r||i(),r),getCachedData:()=>o,clearCache:()=>{o=null,r=null},getFreshData:()=>(o=null,r=null,i(),r)}}var Gr=j(()=>{"use strict"});var Za,es=j(()=>{"use strict";Za=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var o;return n.joliCoinQuantity<=((o=t==null?void 0:t.balance)!=null?o:0)}))});var Kr,Wr,ts,qr,zr=j(()=>{"use strict";ge();W();_t();es();Gr();Kr=(e,t)=>r=>L(void 0,null,function*(){let n=nt(me,Jr);return me.emit(Vr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),Wr=(e,t)=>r=>L(void 0,null,function*(){let n=nt(me,Hr);return me.emit($r,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult}),ts=e=>{if(e=="CANCEL")throw new Error("CANCEL")},qr=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i}})=>a=>L(void 0,null,function*(){var l,c,f,y,p,g,_;try{let w=!1,I=yield n.getData(),C=(f=(c=(l=I==null?void 0:I.options)==null?void 0:l.find(N=>N.type==="JOLI_COIN"))==null?void 0:c.joliCoinChoices[0].joliCoinQuantity)!=null?f:0;if(!Za((I==null?void 0:I.options)||[],I==null?void 0:I.userJoliCoin)){let N=yield o({userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:C});if(ts(N),N!=="SUCCESS")return r==null||r(a),!1;w=!0}let b=!!((y=I==null?void 0:I.userJoliCoin)!=null&&y.enableAutoDeduct);if(!w){let N=yield i({enableAutoDeduct:b,userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:C});if(ts(N),N!=="CONFIRM")return r==null||r(a),!1}let k=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ct()}-${P.mpType}-${Date.now()}`,gameInfo:{gameId:P.mpId}}});return k.code=="SUCCESS"?((g=a.adBreakDone)==null||g.call(a,{breakType:a.type,breakName:"name"in a&&(p=a.name)!=null?p:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((_=a.adViewed)==null||_.call(a)),t==null||t({quantity:k.data.quantity,balance:k.data.balance}),!0):(r==null||r(a),!1)}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(a),!1}finally{n.clearCache()}})});var rs,ns=j(()=>{"use strict";_t();Gr();zr();zr();rs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=nt(me,vt),o=()=>{r==null||r()},i=Wr("ADS-JOLI_COIN",{confirmButtonText:"Use Jolicoin",cancelButtonText:"No watch ads"}),a=Kr("ADS-JOLI_COIN",{confirmButtonText:"Pay and unlock",cancelButtonText:"No watch ads"});return qr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:i}})}});var os,is=j(()=>{"use strict";_t();zr();Gr();os=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=nt(me,vt),o=c=>{var f;r==null||r(),(f=c.adBreakDone)==null||f.call(c,{breakType:c.type,breakFormat:c.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Wr("JOLI_COIN",{confirmButtonText:"Use Jolicoin",cancelButtonText:"No thanks"}),a=Kr("JOLI_COIN",{confirmButtonText:"Pay and unlock",cancelButtonText:"No thanks"});return qr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:i}})}});var ot,as=j(()=>{"use strict";qa();Ya();Xa();ns();is();ot=Wa();za(ot)});function $e(e,t){for(var r in t)e[r]=t[r];return e}function Po(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function $t(e,t,r){var n,o,i,a={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?Zr.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Qr(e,a,n,o,null)}function Qr(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o==null?++ds:o,__i:-1,__u:0};return o==null&&B.vnode!=null&&B.vnode(i),i}function Ye(e){return e.children}function we(e,t){this.props=e,this.context=t}function gt(e,t){if(t==null)return e.__?gt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?gt(e):null}function vs(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return vs(e)}}function ls(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!Xr.__r++||ss!==B.debounceRendering)&&((ss=B.debounceRendering)||fs)(Xr)}function Xr(){for(var e,t,r,n,o,i,a,l=1;it.length;)it.length>l&&it.sort(hs),e=it.shift(),l=it.length,e.__d&&(r=void 0,o=(n=(t=e).__v).__e,i=[],a=[],t.__P&&((r=$e({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),Do(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[o]:null,i,o==null?gt(n):o,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,ys(i,r,a),r.__e!=o&&vs(r)));Xr.__r=0}function _s(e,t,r,n,o,i,a,l,c,f,y){var p,g,_,w,I,C,b=n&&n.__k||ms,k=t.length;for(c=Jd(r,t,b,c,k),p=0;p<k;p++)(_=r.__k[p])!=null&&(g=_.__i===-1?Vt:b[_.__i]||Vt,_.__i=p,C=Do(e,_,g,o,i,a,l,c,f,y),w=_.__e,_.ref&&g.ref!=_.ref&&(g.ref&&No(g.ref,null,_),y.push(_.ref,_.__c||w,_)),I==null&&w!=null&&(I=w),4&_.__u||g.__k===_.__k?c=gs(_,c,e):typeof _.type=="function"&&C!==void 0?c=C:w&&(c=w.nextSibling),_.__u&=-7);return r.__e=I,c}function Jd(e,t,r,n,o){var i,a,l,c,f,y=r.length,p=y,g=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=i+g,(a=e.__k[i]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Qr(null,a,null,null,null):Jt(a)?Qr(Ye,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Qr(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(f=a.__i=$d(a,r,c,p))!==-1&&(p--,(l=r[f])&&(l.__u|=2)),l==null||l.__v===null?(f==-1&&(o>y?g--:o<y&&g++),typeof a.type!="function"&&(a.__u|=4)):f!=c&&(f==c-1?g--:f==c+1?g++:(f>c?g--:g++,a.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<y;i++)(l=r[i])!=null&&!(2&l.__u)&&(l.__e==n&&(n=gt(l)),Es(l,l));return n}function gs(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=gs(n[o],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=gt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Ht(e,t){return t=t||[],e==null||typeof e=="boolean"||(Jt(e)?e.some(function(r){Ht(r,t)}):t.push(e)),t}function $d(e,t,r,n){var o,i,a=e.key,l=e.type,c=t[r];if(c===null&&e.key==null||c&&a==c.key&&l===c.type&&!(2&c.__u))return r;if(n>(c!=null&&!(2&c.__u)?1:0))for(o=r-1,i=r+1;o>=0||i<t.length;){if(o>=0){if((c=t[o])&&!(2&c.__u)&&a==c.key&&l===c.type)return o;o--}if(i<t.length){if((c=t[i])&&!(2&c.__u)&&a==c.key&&l===c.type)return i;i++}}return-1}function us(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Vd.test(t)?r:r+"px"}function Yr(e,t,r,n,o){var i;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||us(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||us(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(ps,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.t=n.t:(r.t=ko,e.addEventListener(t,i?Co:xo,i)):e.removeEventListener(t,i?Co:xo,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function cs(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=ko++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function Do(e,t,r,n,o,i,a,l,c,f){var y,p,g,_,w,I,C,b,k,N,G,Q,R,x,M,V,ee,Y=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[l=t.__e=r.__e]),(y=B.__b)&&y(t);e:if(typeof Y=="function")try{if(b=t.props,k="prototype"in Y&&Y.prototype.render,N=(y=Y.contextType)&&n[y.__c],G=y?N?N.props.value:y.__:n,r.__c?C=(p=t.__c=r.__c).__=p.__E:(k?t.__c=p=new Y(b,G):(t.__c=p=new we(b,G),p.constructor=Y,p.render=Gd),N&&N.sub(p),p.props=b,p.state||(p.state={}),p.context=G,p.__n=n,g=p.__d=!0,p.__h=[],p._sb=[]),k&&p.__s==null&&(p.__s=p.state),k&&Y.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=$e({},p.__s)),$e(p.__s,Y.getDerivedStateFromProps(b,p.__s))),_=p.props,w=p.state,p.__v=t,g)k&&Y.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),k&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(k&&Y.getDerivedStateFromProps==null&&b!==_&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(b,G),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(b,p.__s,G)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(le){le&&(le.__=t)}),Q=0;Q<p._sb.length;Q++)p.__h.push(p._sb[Q]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(b,p.__s,G),k&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(_,w,I)})}if(p.context=G,p.props=b,p.__P=e,p.__e=!1,R=B.__r,x=0,k){for(p.state=p.__s,p.__d=!1,R&&R(t),y=p.render(p.props,p.state,p.context),M=0;M<p._sb.length;M++)p.__h.push(p._sb[M]);p._sb=[]}else do p.__d=!1,R&&R(t),y=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++x<25);p.state=p.__s,p.getChildContext!=null&&(n=$e($e({},n),p.getChildContext())),k&&!g&&p.getSnapshotBeforeUpdate!=null&&(I=p.getSnapshotBeforeUpdate(_,w)),V=y,y!=null&&y.type===Ye&&y.key==null&&(V=bs(y.props.children)),l=_s(e,Jt(V)?V:[V],t,r,n,o,i,a,l,c,f),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),C&&(p.__E=p.__=null)}catch(le){if(t.__v=null,c||i!=null)if(le.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,t.__e=l}else for(ee=i.length;ee--;)Po(i[ee]);else t.__e=r.__e,t.__k=r.__k;B.__e(le,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=Hd(r.__e,t,r,n,o,i,a,c,f);return(y=B.diffed)&&y(t),128&t.__u?void 0:l}function ys(e,t,r){for(var n=0;n<r.length;n++)No(r[n],r[++n],r[++n]);B.__c&&B.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){B.__e(i,o.__v)}})}function bs(e){return typeof e!="object"||e==null?e:Jt(e)?e.map(bs):$e({},e)}function Hd(e,t,r,n,o,i,a,l,c){var f,y,p,g,_,w,I,C=r.props,b=t.props,k=t.type;if(k=="svg"?o="http://www.w3.org/2000/svg":k=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((_=i[f])&&"setAttribute"in _==!!k&&(k?_.localName==k:_.nodeType==3)){e=_,i[f]=null;break}}if(e==null){if(k==null)return document.createTextNode(b);e=document.createElementNS(o,k,b.is&&b),l&&(B.__m&&B.__m(t,i),l=!1),i=null}if(k===null)C===b||l&&e.data===b||(e.data=b);else{if(i=i&&Zr.call(e.childNodes),C=r.props||Vt,!l&&i!=null)for(C={},f=0;f<e.attributes.length;f++)C[(_=e.attributes[f]).name]=_.value;for(f in C)if(_=C[f],f!="children"){if(f=="dangerouslySetInnerHTML")p=_;else if(!(f in b)){if(f=="value"&&"defaultValue"in b||f=="checked"&&"defaultChecked"in b)continue;Yr(e,f,null,_,o)}}for(f in b)_=b[f],f=="children"?g=_:f=="dangerouslySetInnerHTML"?y=_:f=="value"?w=_:f=="checked"?I=_:l&&typeof _!="function"||C[f]===_||Yr(e,f,_,C[f],o);if(y)l||p&&(y.__html===p.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(p&&(e.innerHTML=""),_s(t.type==="template"?e.content:e,Jt(g)?g:[g],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:r.__k&>(r,0),l,c),i!=null)for(f=i.length;f--;)Po(i[f]);l||(f="value",k=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[f]||k=="progress"&&!w||k=="option"&&w!==C[f])&&Yr(e,f,w,C[f],o),f="checked",I!==void 0&&I!==e[f]&&Yr(e,f,I,C[f],o))}return e}function No(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(o){B.__e(o,r)}}function Es(e,t,r){var n,o;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||No(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){B.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&Es(n[o],t,r||typeof e.type!="function");r||Po(e.__e),e.__c=e.__=e.__e=void 0}function Gd(e,t,r){return this.constructor(e,r)}function ws(e,t,r){var n,o,i,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],Do(t,e=(!n&&r||t).__k=$t(Ye,null,[e]),o||Vt,Vt,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?Zr.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),ys(i,e,a)}var Zr,B,ds,Oo,it,ss,fs,hs,ps,ko,xo,Co,jd,Vt,ms,Vd,Jt,Gt=j(()=>{Vt={},ms=[],Vd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Jt=Array.isArray;Zr=ms.slice,B={__e:function(e,t,r,n){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(l){e=l}throw e}},ds=0,Oo=function(e){return e!=null&&e.constructor==null},we.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$e({},this.state),typeof e=="function"&&(e=e($e({},r),this.props)),e&&$e(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),ls(this))},we.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ls(this))},we.prototype.render=Ye,it=[],fs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,hs=function(e,t){return e.__v.__b-t.__v.__b},Xr.__r=0,ps=/(PointerCapture)$|Capture$/i,ko=0,xo=cs(!1),Co=cs(!0),jd=0});function Bo(e,t){re.__h&&re.__h(_e,e,Uo||t),Uo=0;var r=_e.__H||(_e.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Fo(e,t){var r=Bo(Kt++,3);!re.__s&&Jo(r.__H,t)&&(r.__=e,r.u=t,_e.__H.__h.push(r))}function jo(e,t){var r=Bo(Kt++,4);!re.__s&&Jo(r.__H,t)&&(r.__=e,r.u=t,_e.__h.push(r))}function Vo(e){return Uo=5,tn(function(){return{current:e}},[])}function tn(e,t){var r=Bo(Kt++,7);return Jo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Kd(){for(var e;e=ks.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(en),e.__H.__h.forEach(Mo),e.__H.__h=[]}catch(t){e.__H.__h=[],re.__e(t,e.__v)}}function Wd(e){var t,r=function(){clearTimeout(n),Os&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Os&&(t=requestAnimationFrame(r))}function en(e){var t=_e,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),_e=t}function Mo(e){var t=_e;e.__c=e.__(),_e=t}function Jo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var Kt,_e,Lo,Is,Uo,ks,re,As,Ss,Rs,Ts,xs,Cs,Os,$o=j(()=>{Gt();Uo=0,ks=[],re=B,As=re.__b,Ss=re.__r,Rs=re.diffed,Ts=re.__c,xs=re.unmount,Cs=re.__;re.__b=function(e){_e=null,As&&As(e)},re.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cs&&Cs(e,t)},re.__r=function(e){Ss&&Ss(e),Kt=0;var t=(_e=e.__c).__H;t&&(Lo===_e?(t.__h=[],_e.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(en),t.__h.forEach(Mo),t.__h=[],Kt=0)),Lo=_e},re.diffed=function(e){Rs&&Rs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ks.push(t)!==1&&Is===re.requestAnimationFrame||((Is=re.requestAnimationFrame)||Wd)(Kd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Lo=_e=null},re.__c=function(e,t){t.some(function(r){try{r.__h.forEach(en),r.__h=r.__h.filter(function(n){return!n.__||Mo(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],re.__e(n,r.__v)}}),Ts&&Ts(e,t)},re.unmount=function(e){xs&&xs(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{en(n)}catch(o){t=o}}),r.__H=void 0,t&&re.__e(t,r.__v))};Os=typeof requestAnimationFrame=="function"});function zd(e,t){for(var r in t)e[r]=t[r];return e}function Ps(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Ds(e,t){this.props=e,this.context=t}function Js(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=zd({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Js(n,t,r)})),e}function $s(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return $s(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function Ho(){this.__u=0,this.o=null,this.__b=null}function Hs(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function rn(){this.i=null,this.l=null}function Gs(e,t,r){return t.__k==null&&(t.textContent=""),ws(e,t),typeof r=="function"&&r(),e?e.__c:null}function nf(){}function of(){return this.cancelBubble}function af(){return this.defaultPrevented}var Ns,tg,Yd,Ls,Us,Qd,Xd,Zd,ef,tf,rf,Ms,Ks,sf,Bs,Fs,js,Ws=j(()=>{Gt();Gt();$o();$o();(Ds.prototype=new we).isPureReactComponent=!0,Ds.prototype.shouldComponentUpdate=function(e,t){return Ps(this.props,e)||Ps(this.state,t)};Ns=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ns&&Ns(e)};tg=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,Yd=B.__e;B.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}Yd(e,t,r,n)};Ls=B.unmount;B.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Ls&&Ls(e)},(Ho.prototype=new we).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=Hs(n.__v),i=!1,a=function(){i||(i=!0,r.__R=null,o?o(l):l())};r.__R=a;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=$s(c,c.__c.__P,c.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.o.pop();)f.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},Ho.prototype.componentWillUnmount=function(){this.o=[]},Ho.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=Js(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&$t(Ye,null,e.fallback);return o&&(o.__u&=-33),[$t(Ye,null,t.__a?null:e.children),o]};Us=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(rn.prototype=new we).__a=function(e){var t=this,r=Hs(t.__v),n=t.l.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Us(t,e,n)):o()};r?r(i):i()}},rn.prototype.render=function(e){this.i=null,this.l=new Map;var t=Ht(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},rn.prototype.componentDidUpdate=rn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Us(e,r,t)})};Qd=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Xd=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,Zd=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,ef=/[A-Z0-9]/g,tf=typeof document!="undefined",rf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};we.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(we.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});Ms=B.event;B.event=function(e){return Ms&&(e=Ms(e)),e.persist=nf,e.isPropagationStopped=of,e.isDefaultPrevented=af,e.nativeEvent=e};sf={enumerable:!1,configurable:!0,get:function(){return this.class}},Bs=B.vnode;B.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={},i=n.indexOf("-")===-1;for(var a in r){var l=r[a];if(!(a==="value"&&"defaultValue"in r&&l==null||tf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var c=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?a="ondblclick":c!=="onchange"||n!=="input"&&n!=="textarea"||rf(r.type)?c==="onfocus"?a="onfocusin":c==="onblur"?a="onfocusout":Zd.test(a)&&(a=c):c=a="oninput":i&&Xd.test(a)?a=a.replace(ef,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[a=c]&&(a="oninputCapture"),o[a]=l}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=Ht(r.children).forEach(function(f){f.props.selected=o.value.indexOf(f.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=Ht(r.children).forEach(function(f){f.props.selected=o.multiple?o.defaultValue.indexOf(f.props.value)!=-1:o.defaultValue==f.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",sf)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=Qd,Bs&&Bs(e)};Fs=B.__r;B.__r=function(e){Fs&&Fs(e),Ks=e.__c};js=B.diffed;B.diffed=function(e){js&&js(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),Ks=null}});function Ce(e,t,r){return(t=df(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function df(e){var t=ff(e,"string");return typeof t=="symbol"?t:t+""}function ff(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function nn(e,t,r){return(t=hf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hf(e){var t=pf(e,"string");return typeof t=="symbol"?t:t+""}function pf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function If(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Af(e){return typeof e=="string"}function Sf(e){return typeof e=="undefined"}function Rf(e){return Sf(e)||e===null}function Tf(e){return typeof e=="function"}function gl(e){let t=e,r=null,n=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Wt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function sn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((o,i)=>(o[i]=String(n[i]),o),{})}return e[r]})}function Df(e){let t=e.location?sn(e.location,Xs):null,r=e.target?sn(e.target,Xs):null;return sn(bf(yf({},e),{location:t,target:r}),kf)}function Nf(e){let t=e.events.map(n=>Df(n)),r=sn(e.device,Pf);return[e.protocolVersion,t,r,e.project]}function Lf(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function jf(e){return new Promise(t=>wl(e)(t))}function wl(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Vf(e,t){return(r=>{let n={onWillAddFirstListener(){r(o.fire,o)}},o=new Xt(n);return o.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(o=>t(o)&&r.call(n,o),null)})}function $f(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Hf(e[n],t[n])}function Hf(e,t){if(Af(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Tf(t)){try{if(e instanceof t)return}catch(r){}if(!Rf(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Ko(e,t,r){return(t=Gf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Gf(e){var t=Kf(e,"string");return typeof t=="symbol"?t:t+""}function Kf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function on(e,t,r){return(t=Wf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wf(e){var t=qf(e,"string");return typeof t=="symbol"?t:t+""}function qf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function He(e,t,r){return(t=zf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function zf(e){var t=Yf(e,"string");return typeof t=="symbol"?t:t+""}function Yf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Qf(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function Xf(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}function oh(e,t){return fe(e,0)^45?(((t<<2^fe(e,0))<<2^fe(e,1))<<2^fe(e,2))<<2^fe(e,3):0}function Sl(e){return e.trim()}function ih(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function ai(e,t){return e.indexOf(t)}function fe(e,t){return e.charCodeAt(t)|0}function Zt(e,t,r){return e.slice(t,r)}function Ue(e){return e.length}function vi(e){return e.length}function an(e,t){return t.push(e),e}function ah(e,t){return e.map(t).join("")}function En(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:bn,column:bt,length:a,return:""}}function zt(e,t){return nh(En("",null,null,"",null,null,0),e,{length:-e.length},t)}function sh(){return ae}function lh(){return ae=Ee>0?fe(Et,--Ee):0,bt--,ae===10&&(bt=1,bn--),ae}function Ie(){return ae=Ee<Rl?fe(Et,Ee++):0,bt++,ae===10&&(bt=1,bn++),ae}function Me(){return fe(Et,Ee)}function ln(){return Ee}function tr(e,t){return Zt(Et,e,t)}function er(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Tl(e){return bn=bt=1,Rl=Ue(Et=e),Ee=0,[]}function xl(e){return Et="",e}function un(e){return Sl(tr(Ee-1,si(e===91?e+2:e===40?e+1:e)))}function uh(e){for(;(ae=Me())&&ae<33;)Ie();return er(e)>2||er(ae)>3?"":" "}function ch(e,t){for(;--t&&Ie()&&!(ae<48||ae>102||ae>57&&ae<65||ae>70&&ae<97););return tr(e,ln()+(t<6&&Me()==32&&Ie()==32))}function si(e){for(;Ie();)switch(ae){case e:return Ee;case 34:case 39:e!==34&&e!==39&&si(ae);break;case 40:e===41&&si(e);break;case 92:Ie();break}return Ee}function dh(e,t){for(;Ie()&&e+ae!==57&&!(e+ae===84&&Me()===47););return"/*"+tr(t,Ee-1)+"*"+yn(e===47?e:Ie())}function fh(e){for(;!er(Me());)Ie();return tr(e,Ee)}function hh(e){return xl(cn("",null,null,null,[""],e=Tl(e),0,[0],e))}function cn(e,t,r,n,o,i,a,l,c){for(var f=0,y=0,p=a,g=0,_=0,w=0,I=1,C=1,b=1,k=0,N="",G=o,Q=i,R=n,x=N;C;)switch(w=k,k=Ie()){case 40:if(w!=108&&fe(x,p-1)==58){ai(x+=$(un(k),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=un(k);break;case 9:case 10:case 13:case 32:x+=uh(w);break;case 92:x+=ch(ln()-1,7);continue;case 47:switch(Me()){case 42:case 47:an(ph(dh(Ie(),ln()),t,r),c);break;default:x+="/"}break;case 123*I:l[f++]=Ue(x)*b;case 125*I:case 59:case 0:switch(k){case 0:case 125:C=0;case 59+y:b==-1&&(x=$(x,/\f/g,"")),_>0&&Ue(x)-p&&an(_>32?tl(x+";",n,r,p-1):tl($(x," ","")+";",n,r,p-2),c);break;case 59:x+=";";default:if(an(R=el(x,t,r,f,y,o,l,N,G=[],Q=[],p),i),k===123)if(y===0)cn(x,t,R,R,G,i,p,l,Q);else switch(g===99&&fe(x,3)===110?100:g){case 100:case 108:case 109:case 115:cn(e,R,R,n&&an(el(e,R,R,0,0,o,l,N,o,G=[],p),Q),o,Q,p,l,n?G:Q);break;default:cn(x,R,R,R,[""],Q,0,l,Q)}}f=y=_=0,I=b=1,N=x="",p=a;break;case 58:p=1+Ue(x),_=w;default:if(I<1){if(k==123)--I;else if(k==125&&I++==0&&lh()==125)continue}switch(x+=yn(k),k*I){case 38:b=y>0?1:(x+="\f",-1);break;case 44:l[f++]=(Ue(x)-1)*b,b=1;break;case 64:Me()===45&&(x+=un(Ie())),g=Me(),y=p=Ue(N=x+=fh(ln())),k++;break;case 45:w===45&&Ue(x)==2&&(I=0)}}return i}function el(e,t,r,n,o,i,a,l,c,f,y){for(var p=o-1,g=o===0?i:[""],_=vi(g),w=0,I=0,C=0;w<n;++w)for(var b=0,k=Zt(e,p+1,p=rh(I=a[w])),N=e;b<_;++b)(N=Sl(I>0?g[b]+" "+k:$(k,/&\f/g,g[b])))&&(c[C++]=N);return En(e,t,r,o===0?pi:l,c,f,y)}function ph(e,t,r){return En(e,t,r,Il,yn(sh()),Zt(e,2,-2),0)}function tl(e,t,r,n){return En(e,t,r,mi,Zt(e,0,n),Zt(e,n+1,-1),n)}function yt(e,t){for(var r="",n=vi(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function mh(e,t,r,n){switch(e.type){case th:if(e.children.length)break;case eh:case mi:return e.return=e.return||e.value;case Il:return"";case Al:return e.return=e.value+"{"+yt(e.children,n)+"}";case pi:e.value=e.props.join(",")}return Ue(r=yt(e.children,n))?e.return=e.value+"{"+r+"}":""}function vh(e){var t=vi(e);return function(r,n,o,i){for(var a="",l=0;l<t;l++)a+=e[l](r,n,o,i)||"";return a}}function _h(e){return function(t){t.root||(t=t.return)&&e(t)}}function gh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function Cl(e,t){switch(oh(e,t)){case 5103:return J+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return J+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return J+e+hn+e+ve+e+e;case 6828:case 4268:return J+e+ve+e+e;case 6165:return J+e+ve+"flex-"+e+e;case 5187:return J+e+$(e,/(\w+).+(:[^]+)/,J+"box-$1$2"+ve+"flex-$1$2")+e;case 5443:return J+e+ve+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return J+e+ve+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return J+e+ve+$(e,"shrink","negative")+e;case 5292:return J+e+ve+$(e,"basis","preferred-size")+e;case 6060:return J+"box-"+$(e,"-grow","")+J+e+ve+$(e,"grow","positive")+e;case 4554:return J+$(e,/([^-])(transform)/g,"$1"+J+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,J+"$1"),/(image-set)/,J+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,J+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,J+"box-pack:$3"+ve+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+J+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,J+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ue(e)-1-t>6)switch(fe(e,t+1)){case 109:if(fe(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+hn+(fe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ai(e,"stretch")?Cl($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(fe(e,t+1)!==115)break;case 6444:switch(fe(e,Ue(e)-3-(~ai(e,"!important")&&10))){case 107:return $(e,":",":"+J)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(fe(e,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+ve+"$2box$3")+e}break;case 5936:switch(fe(e,t+11)){case 114:return J+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return J+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return J+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return J+e+ve+e+e}return e}function Th(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function pn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return Qe={name:o.name,styles:o.styles,next:Qe},o.name;var i=r;if(i.styles!==void 0){var a=i.next;if(a!==void 0)for(;a!==void 0;)Qe={name:a.name,styles:a.styles,next:Qe},a=a.next;var l=i.styles+";";return l}return kh(e,t,r)}}var c=r;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function kh(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=pn(e,t,r[o])+";";else for(var i in r){var a=r[i];if(typeof a!="object"){var l=a;t!=null&&t[l]!==void 0?n+=i+"{"+t[l]+"}":nl(l)&&(n+=Wo(i)+":"+ol(i,l)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var c=0;c<a.length;c++)nl(a[c])&&(n+=Wo(i)+":"+ol(i,a[c])+";");else{var f=pn(e,t,a);switch(i){case"animation":case"animationName":{n+=Wo(i)+":"+f+";";break}default:n+=i+"{"+f+"}"}}}return n}function qo(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";Qe=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,o+=pn(r,t,i);else{var a=i;o+=a[0]}for(var l=1;l<e.length;l++)if(o+=pn(r,t,e[l]),n){var c=i;o+=c[l]}il.lastIndex=0;for(var f="",y;(y=il.exec(o))!==null;)f+="-"+y[1];var p=Th(o)+f;return{name:p,styles:o,next:Qe}}function kl(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}function al(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function sl(e,t,r){var n=[],o=kl(e,n,r);return n.length<2?r:o+t(n)}function Dl(e,t){ie.__h&&ie.__h(be,e,li||t),li=0;var r=be.__H||(be.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Mh(e,t){var r=Dl(mn++,3);!ie.__s&&Nl(r.__H,t)&&(r.__=e,r.u=t,be.__H.__h.push(r))}function Bh(e){return li=5,_i(function(){return{current:e}},[])}function _i(e,t){var r=Dl(mn++,7);return Nl(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Fh(){for(var e;e=Pl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(dn),e.__H.__h.forEach(ui),e.__H.__h=[]}catch(t){e.__H.__h=[],ie.__e(t,e.__v)}}function jh(e){var t,r=function(){clearTimeout(n),ml&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);ml&&(t=requestAnimationFrame(r))}function dn(e){var t=be,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),be=t}function ui(e){var t=be;e.__c=e.__(),be=t}function Nl(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function wn(){if(Xe>1)Xe--;else{for(var e,t=!1;Yt!==void 0;){var r=Yt;for(Yt=void 0,ci++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Ul(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(ci=0,Xe--,t)throw e}}function Oe(e){if(Xe>0)return e();Xe++;try{return e()}finally{wn()}}function Ll(e){if(q!==void 0){var t=e.n;if(t===void 0||t.t!==q)return t={i:0,S:e,p:q.s,n:void 0,t:q,e:void 0,x:void 0,r:t},q.s!==void 0&&(q.s.n=t),q.s=t,e.n=t,32&q.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=q.s,t.n=void 0,q.s.n=t,q.s=t),t}}function he(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function de(e){return new he(e)}function Ul(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function Ml(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Bl(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function wt(e){he.call(this,void 0),this.x=e,this.s=void 0,this.g=vn-1,this.f=4}function Qt(e){return new wt(e)}function Fl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Xe++;var r=q;q=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,gi(e),n}finally{q=r,wn()}}}function gi(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Fl(e)}function Jh(e){if(q!==this)throw new Error("Out-of-order effect");Bl(this),q=e,this.f&=-2,8&this.f&&gi(this),wn()}function nr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function It(e){var t=new nr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function At(e,t){B[e]=t.bind(null,B[e]||function(){})}function _n(e){Yo&&Yo(),Yo=e&&e.S()}function Jl(e){var t=this,r=e.data,n=$l(r);n.value=r;var o=_i(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var f=Qt(function(){var _=n.value.value;return _===0?0:_===!0?"":_||""}),y=Qt(function(){return!Array.isArray(f.value)&&!Oo(f.value)}),p=It(function(){if(this.N=Hl,y.value){var _=f.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=_)}}),g=t.__$u.d;return t.__$u.d=function(){p(),g.call(this)},[y,f]},[]),i=o[0],a=o[1];return i.value?a.peek():a.value}function $h(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,i=de(r);return{o:function(a,l){i.value=a,n=l},d:It(function(){this.N=Hl;var a=i.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function $l(e){return _i(function(){return de(e)},[])}function Kh(){Oe(function(){for(var e;e=jl.shift();)yi.call(e)})}function Wh(){jl.push(this)===1&&(B.requestAnimationFrame||Hh)(Kh)}function qh(){Oe(function(){for(var e;e=Vl.shift();)yi.call(e)})}function Hl(){Vl.push(this)===1&&(B.requestAnimationFrame||Gh)(qh)}function zh(e){var t=Bh(e);t.current=e,Mh(function(){return It(function(){return this.N=Wh,t.current()})},[])}function Yh(e,t){let r=Vo(e);jo(()=>{r.current=e},[e]),Fo(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function ue(e,t,r,n,o,i){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?a=t[l]:c[l]=t[l];var f={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Qh,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)c[l]===void 0&&(c[l]=a[l]);return B.vnode&&B.vnode(f),f}function Ge(e,t,r){return(t=up(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function up(e){var t=cp(e,"string");return typeof t=="symbol"?t:t+""}function cp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function at(e,t,r){return(t=dp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function dp(e){var t=fp(e,"string");return typeof t=="symbol"?t:t+""}function fp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var qs,lf,uf,cf,Qo,Xo,vl,mf,vf,zs,_f,gf,Ys,yf,bf,Ef,_l,wf,xf,Cf,Qs,Of,yl,bl,El,Xs,kf,Pf,Zo,Z,Uf,Mf,qt,Xt,Bf,ti,Ff,Go,Jf,ri,Zs,ni,oi,ii,Zf,ve,hn,J,Il,pi,mi,eh,Al,th,rh,yn,nh,bn,bt,Rl,Ee,ae,Et,yh,bh,Eh,rl,wh,Ih,Ah,Sh,Rh,xh,Ch,Oh,Ol,nl,Wo,ol,il,Qe,Ph,Dh,Nh,Lh,Uh,rr,mn,be,zo,ll,li,Pl,ie,ul,cl,dl,fl,hl,pl,ml,Vh,q,Yt,Xe,ci,vn,yi,Yo,jl,Vl,Hh,Gh,ye,Qh,Xh,Ke,di,fi,fn,Zh,ep,tp,rp,np,op,ip,ap,sp,lp,hi,gn,sg,Gl=j(()=>{"use strict";Gt();Ws();qs=Object.getOwnPropertySymbols,lf=Object.prototype.hasOwnProperty,uf=Object.prototype.propertyIsEnumerable,cf=(e,t)=>{var r={};for(var n in e)lf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qs)for(var n of qs(e))t.indexOf(n)<0&&uf.call(e,n)&&(r[n]=e[n]);return r};Qo=class{constructor(t){Ce(this,"context",void 0),Ce(this,"continueCallback",void 0),Ce(this,"isBeforeAdCalled",!1),Ce(this,"isBeforeRewardCalled",!1),Ce(this,"isAdDismissedCalled",!1),Ce(this,"isAdViewedCalled",!1),Ce(this,"isAfterAdCalled",!1),Ce(this,"currentProvider",void 0),Ce(this,"currentClientParams",void 0),Ce(this,"adsHasResponse",!1),Ce(this,"videoChecker",window.document.createElement("video")),Ce(this,"wrapShowAdFn",r=>()=>{this.adsHasResponse=!0;let n=!1;this.videoChecker.play().catch(()=>{n=!1}),n=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:n},this.paramsToTrack)),r()}),this.context=t}get paramsToTrack(){var t,r,n,o,i,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((o=this.currentClientParams)==null?void 0:o.type)==="preroll"?null:(a=(i=this.currentClientParams)==null?void 0:i.name)!=null?a:""}}wrapBeforeAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t())}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,o,i,a,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(o=(n=this.currentProvider)==null?void 0:n.name)!=null?o:null,breakType:r.breakType,breakName:(i=r.breakName)!=null?i:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.continueCallback)==null||a.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n){return L(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o;let i;switch(r.type){case"preroll":{i={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{i={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{i={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var a,l,c,f;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(a=this.currentProvider)==null?void 0:a.name)!=null?l:null}),(f=this.continueCallback)==null||f.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(c=r.name)!=null?c:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(i,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};Xo=class{constructor(t){nn(this,"context",void 0),nn(this,"adBreakIsShowing",!1),nn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),nn(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}},vl=Object.defineProperty,mf=Object.defineProperties,vf=Object.getOwnPropertyDescriptors,zs=Object.getOwnPropertySymbols,_f=Object.prototype.hasOwnProperty,gf=Object.prototype.propertyIsEnumerable,Ys=(e,t,r)=>t in e?vl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,yf=(e,t)=>{for(var r in t||(t={}))_f.call(t,r)&&Ys(e,r,t[r]);if(zs)for(var r of zs(t))gf.call(t,r)&&Ys(e,r,t[r]);return e},bf=(e,t)=>mf(e,vf(t)),Ef=(e,t)=>{for(var r in t)vl(e,r,{get:t[r],enumerable:!0})},_l=(e,t,r,n)=>{for(var o=t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=a(o)||o);return o},wf=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}xf=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(xf||{});Cf={log:Wt("log"),warn:Wt("warn"),info:Wt("info"),error:Wt("error"),debug:Wt("debug")};Object.assign(globalThis,{logger:Cf});Qs=Symbol.for("Jolibox.canIUseMap"),Of={};globalThis[Qs]||(globalThis[Qs]=Of);yl=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(yl||{}),bl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(bl||{}),El=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(El||{}),Xs=["name","params"],kf=["name","type","location","target","extra","timestamp","userId"],Pf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Lf();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");Zo=class ei{constructor(t){this.element=t,this.next=ei.Undefined,this.prev=ei.Undefined}};Zo.Undefined=new Zo(void 0);Z=Zo,Uf=class{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let e=this._first;for(;e!==Z.Undefined;){let t=e.next;e.prev=Z.Undefined,e.next=Z.Undefined,e=t}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Z(e);if(this._first===Z.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==Z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Z.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Z.Undefined&&e.next!==Z.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Z.Undefined&&e.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):e.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):e.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Z.Undefined;)yield e.element,e=e.next}},Mf=0,qt=class{constructor(e){this.value=e,this.id=Mf++}},Xt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof qt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,o,i,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let c=new qt(e);return this._listeners?this._listeners instanceof qt?this._listeners=[this._listeners,c]:this._listeners.push(c):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=c,(i=(o=this.options)==null?void 0:o.onDidFirstListener)==null||i.call(o,this)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++,()=>{var f,y,p,g;if(!this._disposed){if(this._listeners instanceof qt)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(y=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||y.call(f));else if(this._listeners){let _=this._listeners.indexOf(c);_>=0&&(this._listeners.splice(_,1),this._size--,this._size===0&&((g=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||g.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof qt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Bf=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let o=(n=this.listeners.get(e))!=null?n:new Xt,i=c=>t(...c.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let l=this.cachedEventQueue.get(e);if(l&&r)for(let c of l)t(...c.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];r||(r=new Uf,this.cachedEventQueue.set(e,r)),r.push({args:o}),t&&t.fire({event:e,args:o})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},ti={};Ef(ti,{None:()=>Ff,filter:()=>Vf,once:()=>wl,toPromise:()=>jf});Ff=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Go=Symbol.for("Jolibox.hostEmitter"),Jf=()=>{let e=new Bf;return globalThis[Go]||(globalThis[Go]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Go]};Jf();ri=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Xt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return $f(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};ri=_l([gl],ri);Zs=class{constructor(){this._onWillExecuteCommand=new Xt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Xt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ri,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=If(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return wf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ti.toPromise(ti.filter(this.registry.onDidRegisterCommand,o=>o===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];this._onWillExecuteCommand.fire({commandId:e,args:n});let i=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),i}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};Zs=_l([gl],Zs);ni=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Ko(this,"context",void 0),Ko(this,"placement","GAME"),Ko(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,o)=>{r[o]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,o;return{platform:(t=this.contextInfo.platform)!=null?t:El.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(o=this.contextInfo.deviceBrand)!=null?o:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let o={protocolVersion:"1.0.0",events:[{name:t,type:yl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:bl.WebSDK};return Nf(o)}};oi=class{constructor(t){on(this,"configs",null),on(this,"firstRun",!0),on(this,"context",void 0),on(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return L(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let o=(t=this.contextInfo.channel)!=null?t:"",i=this.configs[o],a=(r=i==null?void 0:i.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};ii=class{constructor(t,r){He(this,"name","ADSENSE"),He(this,"context",void 0),He(this,"contextInfo",void 0),He(this,"configured",!1),He(this,"initParams",void 0),He(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),He(this,"adConfig",n=>{let o=n,{onReady:i}=o,a=cf(o,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),He(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),He(this,"adUnit",n=>L(this,null,function*(){var o,i,a,l;if(this.context.track("CallAdUnit",{adFormat:(i=(o=n.adFormat)==null?void 0:o.toString())!=null?i:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:c,slot:f,adFormat:y,fullWidthResponsive:p,style:g}=n,_;if(!c)throw new Error("targeting element is required");if(typeof c=="string"?_=document.querySelector(c):_=c,!_)throw new Error("targeting element not found");let w=f;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let I=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,C=document.createElement("ins");if(C.className="adsbygoogle",C.id="jolibox-ads",C.style.display="block",C.setAttribute("data-ad-client",this.initParams.clientId),C.setAttribute("data-ad-slot",w),I&&C.setAttribute("data-ad-format",I),p&&C.setAttribute("data-full-width-responsive",p),g&&C.setAttribute("style",g),(l=this.contextInfo.testAdsMode)!=null?l:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",C.style.position="relative",_.appendChild(C),C.appendChild(b)}else _.appendChild(C),new MutationObserver(b=>{b.forEach(k=>{if(k.type==="attributes"&&k.attributeName==="data-ad-status"){let N=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return L(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let o=document.createElement("script");o.id=r,o.async=!0,o.crossOrigin="anonymous",o.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&o.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&o.setAttribute("data-ad-channel",this.initParams.channelId),document.head.appendChild(o),this.context.track("LoadAdsenseCompleted",null)}})}};Zf=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(Xf(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=Qf(n);try{o.insertRule(r,o.cssRules.length)}catch(i){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),ve="-ms-",hn="-moz-",J="-webkit-",Il="comm",pi="rule",mi="decl",eh="@import",Al="@keyframes",th="@layer",rh=Math.abs,yn=String.fromCharCode,nh=Object.assign;bn=1,bt=1,Rl=0,Ee=0,ae=0,Et="";yh=function(e,t,r){for(var n=0,o=0;n=o,o=Me(),n===38&&o===12&&(t[r]=1),!er(o);)Ie();return tr(e,Ee)},bh=function(e,t){var r=-1,n=44;do switch(er(n)){case 0:n===38&&Me()===12&&(t[r]=1),e[r]+=yh(Ee-1,t,r);break;case 2:e[r]+=un(n);break;case 4:if(n===44){e[++r]=Me()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=yn(n)}while(n=Ie());return e},Eh=function(e,t){return xl(bh(Tl(e),t))},rl=new WeakMap,wh=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!rl.get(r))&&!n){rl.set(e,!0);for(var o=[],i=Eh(t,o),a=r.props,l=0,c=0;l<i.length;l++)for(var f=0;f<a.length;f++,c++)e.props[c]=o[l]?i[l].replace(/&\f/g,a[f]):a[f]+" "+i[l]}}},Ih=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};Ah=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case mi:e.return=Cl(e.value,e.length);break;case Al:return yt([zt(e,{value:$(e.value,"@","@"+J)})],n);case pi:if(e.length)return ah(e.props,function(o){switch(ih(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return yt([zt(e,{props:[$(o,/:(read-\w+)/,":"+hn+"$1")]})],n);case"::placeholder":return yt([zt(e,{props:[$(o,/:(plac\w+)/,":"+J+"input-$1")]}),zt(e,{props:[$(o,/:(plac\w+)/,":"+hn+"$1")]}),zt(e,{props:[$(o,/:(plac\w+)/,ve+"input-$1")]})],n)}return""})}},Sh=[Ah],Rh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var I=w.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||Sh,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var I=w.getAttribute("data-emotion").split(" "),C=1;C<I.length;C++)o[I[C]]=!0;a.push(w)});var l,c=[wh,Ih];{var f,y=[mh,_h(function(w){f.insert(w)})],p=vh(c.concat(n,y)),g=function(w){return yt(hh(w),p)};l=function(w,I,C,b){f=C,g(w?w+"{"+I.styles+"}":I.styles),b&&(_.inserted[I.name]=!0)}}var _={key:t,sheet:new Zf({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return _.sheet.hydrate(a),_};xh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ch=/[A-Z]|^ms/g,Oh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Ol=function(e){return e.charCodeAt(1)===45},nl=function(e){return e!=null&&typeof e!="boolean"},Wo=gh(function(e){return Ol(e)?e:e.replace(Ch,"-$&").toLowerCase()}),ol=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Oh,function(r,n,o){return Qe={name:n,styles:o,next:Qe},n})}return xh[e]!==1&&!Ol(e)&&typeof t=="number"&&t!==0?t+"px":t};il=/label:\s*([^\s;{]+)\s*(;|$)/g;Ph=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Dh=function(e,t,r){Ph(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};Nh=function(e){var t=Rh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=qo(l,t.registered,void 0);return Dh(t,f),t.key+"-"+f.name},n=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=qo(l,t.registered),y="animation-"+f.name;return al(t,{name:f.name,styles:"@keyframes "+y+"{"+f.styles+"}"}),y},o=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=qo(l,t.registered);al(t,f)},i=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return sl(t.registered,r,Lh(l))};return{css:r,cx:i,injectGlobal:o,keyframes:n,hydrate:function(a){a.forEach(function(l){t.inserted[l]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:kl.bind(null,t.registered),merge:sl.bind(null,t.registered,r)}},Lh=function e(t){for(var r="",n=0;n<t.length;n++){var o=t[n];if(o!=null){var i=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))i=e(o);else{i="";for(var a in o)o[a]&&a&&(i&&(i+=" "),i+=a)}break}default:i=o}i&&(r&&(r+=" "),r+=i)}}return r},Uh=Nh({key:"css"}),rr=Uh.css,li=0,Pl=[],ie=B,ul=ie.__b,cl=ie.__r,dl=ie.diffed,fl=ie.__c,hl=ie.unmount,pl=ie.__;ie.__b=function(e){be=null,ul&&ul(e)},ie.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),pl&&pl(e,t)},ie.__r=function(e){cl&&cl(e),mn=0;var t=(be=e.__c).__H;t&&(zo===be?(t.__h=[],be.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(dn),t.__h.forEach(ui),t.__h=[],mn=0)),zo=be},ie.diffed=function(e){dl&&dl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Pl.push(t)!==1&&ll===ie.requestAnimationFrame||((ll=ie.requestAnimationFrame)||jh)(Fh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),zo=be=null},ie.__c=function(e,t){t.some(function(r){try{r.__h.forEach(dn),r.__h=r.__h.filter(function(n){return!n.__||ui(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ie.__e(n,r.__v)}}),fl&&fl(e,t)},ie.unmount=function(e){hl&&hl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{dn(n)}catch(o){t=o}}),r.__H=void 0,t&&ie.__e(t,r.__v))};ml=typeof requestAnimationFrame=="function";Vh=Symbol.for("preact-signals");q=void 0,Yt=void 0,Xe=0,ci=0,vn=0;he.prototype.brand=Vh;he.prototype.h=function(){return!0};he.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};he.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};he.prototype.subscribe=function(e){var t=this;return It(function(){var r=t.value,n=q;q=void 0;try{e(r)}finally{q=n}})};he.prototype.valueOf=function(){return this.value};he.prototype.toString=function(){return this.value+""};he.prototype.toJSON=function(){return this.value};he.prototype.peek=function(){var e=q;q=void 0;try{return this.value}finally{q=e}};Object.defineProperty(he.prototype,"value",{get:function(){var e=Ll(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ci>100)throw new Error("Cycle detected");this.v=e,this.i++,vn++,Xe++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{wn()}}}});(wt.prototype=new he).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===vn))return!0;if(this.g=vn,this.f|=1,this.i>0&&!Ul(this))return this.f&=-2,!0;var e=q;try{Ml(this),q=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return q=e,Bl(this),this.f&=-2,!0};wt.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}he.prototype.S.call(this,e)};wt.prototype.U=function(e){if(this.t!==void 0&&(he.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};wt.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(wt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ll(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});nr.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};nr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Fl(this),Ml(this),Xe++;var e=q;return q=this,Jh.bind(this,e)};nr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Yt,Yt=this)};nr.prototype.d=function(){this.f|=8,1&this.f||gi(this)};jl=[],Vl=[];It(function(){yi=this.N})();Jl.displayName="_st";Object.defineProperties(he.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Jl},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});At("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var o in n)if(o!=="children"){var i=n[o];i instanceof he&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)});At("__r",function(e,t){_n();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return It(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),_n(r),e(t)});At("__e",function(e,t,r,n){_n(),e(t,r,n)});At("diffed",function(e,t){_n();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,o=t.props;if(n){var i=r.U;if(i)for(var a in i){var l=i[a];l!==void 0&&!(a in n)&&(l.d(),i[a]=void 0)}else i={},r.U=i;for(var c in n){var f=i[c],y=n[c];f===void 0?(f=$h(r,c,y,o),i[c]=f):f.o(y,o)}}}e(t)});At("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var i=n[o];i&&i.d()}}}}else{var a=t.__c;if(a){var l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});At("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});we.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(n||i||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};Hh=typeof requestAnimationFrame=="undefined"?setTimeout:function(e){var t=function(){clearTimeout(r),cancelAnimationFrame(n),e()},r=setTimeout(t,100),n=requestAnimationFrame(t)},Gh=function(e){queueMicrotask(function(){queueMicrotask(e)})};ye=rr`
|
|
1
|
+
var mc=Object.create;var Fn=Object.defineProperty,vc=Object.defineProperties,_c=Object.getOwnPropertyDescriptor,gc=Object.getOwnPropertyDescriptors,yc=Object.getOwnPropertyNames,Gi=Object.getOwnPropertySymbols,bc=Object.getPrototypeOf,Wi=Object.prototype.hasOwnProperty,Ec=Object.prototype.propertyIsEnumerable;var Ki=(e,t,r)=>t in e?Fn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z=(e,t)=>{for(var r in t||(t={}))Wi.call(t,r)&&Ki(e,r,t[r]);if(Gi)for(var r of Gi(t))Ec.call(t,r)&&Ki(e,r,t[r]);return e},me=(e,t)=>vc(e,gc(t));var Pt=(e=>typeof require!="undefined"?require:typeof Proxy!="undefined"?new Proxy(e,{get:(t,r)=>(typeof require!="undefined"?require:t)[r]}):e)(function(e){if(typeof require!="undefined")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var j=(e,t)=>()=>(e&&(t=e(e=0)),t);var ur=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var wc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of yc(t))!Wi.call(e,o)&&o!==r&&Fn(e,o,{get:()=>t[o],enumerable:!(n=_c(t,o))||n.enumerable});return e};var cr=(e,t,r)=>(r=e!=null?mc(bc(e)):{},wc(t||!e||!e.__esModule?Fn(r,"default",{value:e,enumerable:!0}):r,e));var N=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});function kc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Kn(e){return typeof e=="string"}function ta(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ra(e){return typeof e=="object"&&Array.isArray(e)}function Pc(e){return typeof e=="undefined"}function Dc(e){return Pc(e)||e===null}function Nc(e){return typeof e=="function"}function na(e){let t=e,r=null,n=function(...o){return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}function oa(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(o,i){for(let a in i)if(Object.prototype.hasOwnProperty.call(i,a)){let l=o[a],c=i[a],f=r(l,c,a,o,i);f!==void 0?o[a]=f:Qi(c)&&Qi(l)?o[a]=n(Zi({},l),c):Array.isArray(c)&&Array.isArray(l)?o[a]=[...l,...c]:o[a]=c}return o}return n(e,t)}function Qi(e){return e&&typeof e=="object"&&e.constructor===Object}function ia(e,t){if(Array.isArray(e))return e.concat(t)}function Ut(e,t,r={}){let n=null,o,i,a,{leading:l=!1,trailing:c=!0}=r,f=()=>(a=e.apply(i,o),o=void 0,i=void 0,a),y=function(...p){o=p,i=this;let g=l&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,c&&!g&&f()},t),g)return f()};return y.cancel=()=>{n&&clearTimeout(n),n=null,o=i=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,f()},y}function Mc(e,t){return(...r)=>t(e,...r)}function ca(e){return t=>Mc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(o){e(new Uc(`${o}`))}})}function Dt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function dr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((o,i)=>(o[i]=String(n[i]),o),{})}return e[r]})}function Vc(e){let t=e.location?dr(e.location,Xi):null,r=e.target?dr(e.target,Xi):null;return dr(xc(Zi({},e),{location:t,target:r}),jc)}function Xn(e){let t=e.events.map(n=>Vc(n)),r=dr(e.device,Jc);return[e.protocolVersion,t,r,e.project]}function $c(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function Zc(e){return new Promise(t=>ha(e)(t))}function ha(e){return(t,r=null)=>{let n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function ed(e,t){return(r=>{let n,o={onWillAddFirstListener(){n=r(i.fire,i)}},i=new Lt(o);return i.event})((r,n=null)=>e(o=>t(o)&&r.call(n,o),null))}function rd(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)nd(e[n],t[n])}function nd(e,t){if(Kn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Nc(t)){try{if(e instanceof t)return}catch(r){}if(!Dc(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function od(){return typeof globalThis!="undefined"?globalThis[pa]:void 0}function id(e){typeof globalThis!="undefined"&&(globalThis[pa]=e)}function Te(){let e=od();if(e)return e;let t=new fr,r=new qn,n={registerCommand(o,i,a){t.registerCommand({id:o,handler:i,metadata:a})},executeCommand(o,...i){return r.executeCommand(o,...i)},excuteCommandSync(o,...i){return r.executeCommandThowErr(o,...i)}};return id(n),n}var Gn,Ic,Ac,Rc,zi,Sc,Tc,Yi,Zi,xc,Cc,ea,Oc,Lc,Wn,zn,aa,sa,Uc,la,ua,hr,Yn,ke,Jn,Bc,Qn,Mt,dt,Fc,Xi,jc,Jc,ft,Hc,Se,qc,Gc,Kc,da,Zn,eo,Wc,zc,fa,Vn,X,Yc,Qc,Nt,Lt,Ne,Hn,Xc,jn,td,Bt,fr,qn,pa,K=j(()=>{"use strict";Gn=Object.defineProperty,Ic=Object.defineProperties,Ac=Object.getOwnPropertyDescriptor,Rc=Object.getOwnPropertyDescriptors,zi=Object.getOwnPropertySymbols,Sc=Object.prototype.hasOwnProperty,Tc=Object.prototype.propertyIsEnumerable,Yi=(e,t,r)=>t in e?Gn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Zi=(e,t)=>{for(var r in t||(t={}))Sc.call(t,r)&&Yi(e,r,t[r]);if(zi)for(var r of zi(t))Tc.call(t,r)&&Yi(e,r,t[r]);return e},xc=(e,t)=>Ic(e,Rc(t)),Cc=(e,t)=>{for(var r in t)Gn(e,r,{get:t[r],enumerable:!0})},ea=(e,t,r,n)=>{for(var o=n>1?void 0:n?Ac(t,r):t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=(n?a(t,r,o):a(o))||o);return n&&o&&Gn(t,r,o),o},Oc=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}Lc=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(Lc||{}),Wn=class extends Error{constructor(e){if(typeof e=="string"){super(e),this.priority="P1";return}super(e.message),this.priority="P1",this.stack=e.stack,this.raw=e}},zn=class extends Wn{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},aa=class extends Wn{constructor(){super(...arguments),this.kind="USER_ERROR"}},sa=class extends aa{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Uc=class extends aa{constructor(e,t,r){super(e),this.message=e,this.errNo=t,this.name="USER_CUSTOM_ERROR",this.errMsg=e,r&&(this.extra=Object.assign({},this.extra,r))}},la=class extends zn{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},ua=class extends zn{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},hr=class extends Wn{constructor(e,t,r,n,o){super(e),this.message=e,this.code=t,this.kind="API_ERROR",this.name="API_ERROR",r&&(this.errorType=r),n!==void 0&&(this.stack=n),o&&(this.priority=o)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},Yn=class extends zn{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};ke={log:Dt("log"),warn:Dt("warn"),info:Dt("info"),error:Dt("error"),debug:Dt("debug")};Object.assign(globalThis,{logger:ke});Jn=Symbol.for("Jolibox.canIUseMap"),Bc={};globalThis[Jn]||(globalThis[Jn]=Bc);Qn={get config(){return globalThis[Jn]}},Mt=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Mt||{}),dt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(dt||{}),Fc=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(Fc||{}),Xi=["name","params"],jc=["name","type","location","target","extra","timestamp","userId"],Jc=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];ft=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});$c();Hc=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Se={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},qc=()=>Se.isiOS?"iOS":Se.isAndroid?"Android":Se.isMac?"Mac":Se.isFacebook?"Facebook":"PC",Gc="device_id",Kc="advertising_id",da=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ft()),window.__joliboxLocalStorage__.getItem(e)),Zn=()=>new URLSearchParams(window.location.search).get("deviceId")||da(Gc),eo=()=>new URLSearchParams(window.location.search).get("advertisingId")||da(Kc),Wc=e=>e.charAt(0).toUpperCase()+e.slice(1),zc=()=>{var e;let t=new URLSearchParams(window.location.search);return Wc((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},fa=e=>{if(Hc())return window.navigator.userAgent;let t="JoliboxWebSDK",r=qc(),n=navigator.language,o=Zn(),i=eo();return`${t} (${zc()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${o} adid/${i} version/${e||""}`},Vn=class $n{constructor(t){this.element=t,this.next=$n.Undefined,this.prev=$n.Undefined}};Vn.Undefined=new Vn(void 0);X=Vn,Yc=class{constructor(){this._first=X.Undefined,this._last=X.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===X.Undefined}clear(){let e=this._first;for(;e!==X.Undefined;){let t=e.next;e.prev=X.Undefined,e.next=X.Undefined,e=t}this._first=X.Undefined,this._last=X.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new X(e);if(this._first===X.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==X.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==X.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==X.Undefined&&e.next!==X.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===X.Undefined&&e.next===X.Undefined?(this._first=X.Undefined,this._last=X.Undefined):e.next===X.Undefined?(this._last=this._last.prev,this._last.next=X.Undefined):e.prev===X.Undefined&&(this._first=this._first.next,this._first.prev=X.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==X.Undefined;)yield e.element,e=e.next}},Qc=0,Nt=class{constructor(e){this.value=e,this.id=Qc++}},Lt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Nt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){var e;return(e=this._event)!=null||(this._event=(t,r)=>{var n,o,i,a,l,c;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let f=new Nt(t);return this._listeners?this._listeners instanceof Nt?this._listeners=[this._listeners,f]:this._listeners.push(f):((o=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||o.call(n,this),this._listeners=f,(a=(i=this.options)==null?void 0:i.onDidFirstListener)==null||a.call(i,this)),(c=(l=this.options)==null?void 0:l.onDidAddListener)==null||c.call(l,this),this._size++,()=>{var y,p,g,_;if(!this._disposed){if(this._listeners instanceof Nt)this._listeners.id===f.id&&(this._listeners=void 0,this._size=0,(p=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||p.call(y));else if(this._listeners){let w=this._listeners.indexOf(f);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((_=(g=this.options)==null?void 0:g.onDidRemoveLastListener)==null||_.call(g)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof Nt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ne=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let o=(n=this.listeners.get(e))!=null?n:new Lt,i=c=>t(...c.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let l=this.cachedEventQueue.get(e);if(l&&r)for(let c of l)t(...c.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e,...t){let r=this.listeners.get(e),n=this.cachedEventQueue.get(e);n||(n=new Yc,this.cachedEventQueue.set(e,n)),n.push({args:t}),r&&r.fire({event:e,args:t})}once(e,t){let r=(...n)=>{t(...n),this.off(e,r)};this.on(e,r,!1)}},Hn={};Cc(Hn,{None:()=>Xc,filter:()=>ed,once:()=>ha,toPromise:()=>Zc});Xc=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});jn=Symbol.for("Jolibox.hostEmitter"),td=()=>{let e=new Ne;return globalThis[jn]||(globalThis[jn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[jn]},Bt=td();fr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Lt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(...o){return rd(o,r),n(...o)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};fr=ea([na],fr);qn=class{constructor(){this._onWillExecuteCommand=new Lt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Lt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new fr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=kc(3e4)),this._starActivation}executeCommand(e,...t){return Oc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Hn.toPromise(Hn.filter(this.registry.onDidRegisterCommand,r=>r===e))])]),this._tryExecuteCommand(e,t))})}executeCommandThowErr(e,...t){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let r=this.registry.getCommand(e);this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),n}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e,...t){let r=!1;try{return e(...t)}finally{r=!0}}};qn=ea([na],qn);pa=Symbol.for("Jolibox.commands")});function Pe(e,t={}){to.emit("ERROR_REPORT",{error:e,options:t})}var to,et,ze=j(()=>{"use strict";K();K();to=new Ne,et=new Ne;Pe.debounce=Ut(Pe,50,{leading:!0})});var ro,ad,ma,va,_a=j(()=>{"use strict";K();ze();ro=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(o){return{}}},ad=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},ma=e=>{var t;try{let o=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(o!=null&&o.length){let[i,a,l]=o;return{headerJson:ro(i),payloadJson:ro(a),signature:ro(l)}}else throw"joli_source is missing"}catch(r){return Pe(new la(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},va=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],o=ad(e),i=r[2];return`${n}.${o}.${i}`}return t}});var sd,pr,ga,no=j(()=>{"use strict";K();sd="1.1.21",pr=()=>sd,ga=()=>{let e=pr();return`${fa(e)}`}});var ld,ya,oo,ba,ce,ud,P,ge=j(()=>{"use strict";K();_a();no();K();ld={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Zn(),adId:eo(),pixelRatio:window.devicePixelRatio||1,platform:Se.isAndroid?"android":Se.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:pr()},schema:window.location.href,platform:Se.isAndroid?"android":Se.isiOS?"ios":"h5"},oo=(ya=globalThis.joliboxJSCore)==null?void 0:ya.env,ce=Object.assign({},(ba=oo==null?void 0:oo())!=null?ba:ld),ud=()=>{var g,_,w,I,C,b,k,L,q,Q,S;let{payloadJson:e,headerJson:t,signature:r}=ce.schema.length?ma(ce.schema):{},n=`${ce.deviceInfo.did}-${new Date().getTime()}`,i=new URL(ce.schema.length?ce.schema:window.location.href).searchParams,a=(w=(_=(g=i.get("mpId"))!=null?g:i.get("appId"))!=null?_:i.get("gameId"))!=null?w:"",l=(b=(C=(I=ce.clientSessionId)!=null?I:e==null?void 0:e.sessionId)!=null?C:i.get("sessionId"))!=null?b:n,c=!!((L=(k=e==null?void 0:e.testAdsMode)!=null?k:e==null?void 0:e.__testAdsMode)!=null?L:i.get("testAdsMode")==="true"),f=(S=(Q=(q=e==null?void 0:e.joliboxEnv)!=null?q:e==null?void 0:e.__joliboxEnv)!=null?Q:i.get("joliboxEnv"))!=null?S:"production",y=f==="staging",p=t==null?void 0:t.channel;return{get testMode(){return y},get testAdsMode(){return c},get joliboxEnv(){return f},get joliSource(){var x;return(x=i.get("joliSource"))!=null?x:null},get mpId(){var x;return(x=a!=null?a:e==null?void 0:e.id)!=null?x:""},get mpVersion(){var x;return(x=t==null?void 0:t.ver)!=null?x:pr()},get mpType(){var x,M;return(M=(x=t==null?void 0:t.__mpType)!=null?x:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var x;return((x=ce.platform)!=null?x:ce.deviceInfo.platform).toLowerCase()},get deviceInfo(){return ce.deviceInfo},get sdkInfo(){return ce.sdkInfo},get hostInfo(){return ce.hostInfo},get hostUserInfo(){return ce.hostUserInfo},get sessionId(){var x,M;return(M=(x=ce.clientSessionId)!=null?x:l)!=null?M:n},get channel(){return p},get webviewId(){var x;return(x=ce.webviewId)!=null?x:-1},get shouldInterupt(){return e==null?void 0:e.__shouldInterupt},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var x;return(x=ce.deviceInfo.adId)!=null?x:ce.deviceInfo.did},onEnvConfigChanged:x=>{oa(ce,x,ia)},encodeJoliSourceQuery:x=>{var M,J;return t&&r?va(z(z({},e),x),(M=i.get("joliSource"))!=null?M:""):(J=i.get("joliSource"))!=null?J:""}}},P=ud()});var io,wa,cd,dd,Ea,fd,Ia=j(()=>{"use strict";K();ze();ge();K();io=!1,wa=(e,t)=>e==null?!1:t in e,cd=e=>wa(e,"kind"),dd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Ea=(e,t={},r)=>{var i,a,l;let n={user_id:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:"",device_id:(l=P.deviceInfo.did)!=null?l:"",timestamp:Date.now(),tag:dd(e.name)},o=me(z({},n),{env:t.environment,isFromUser:r});r?et.emit("GLOBAL_USER_ERROR",e,o):et.emit("GLOBAL_ERROR",e,o)},fd=e=>wa(e,"kind")&&e.kind==="USER_ERROR";to.on("ERROR_REPORT",({error:e,options:t})=>{if(io)return;io=!0;let r=cd(e)&&e.raw?e.raw:e;try{let n=fd(e);Ea(e,t,n)}catch(n){let o=n instanceof Error?n.message:String(n),i=new Yn(`${o}, origin error: ${r.message}`);ke.error(i),Ea(new Yn(i.message),{environment:t.environment},!1)}finally{io=!1}})});var ao,so=j(()=>{"use strict";ze();K();ze();ao=e=>new sa(e)});function Aa(e,t){let r=(n,o,i)=>{let a=me(z({tag:n},t),{extra:z({},o)});n=="globalJsError"?Pe(new ua(JSON.stringify(a))):e("systemLog",a,i)};return r.debounce=Ut(r,500,{leading:!0}),r}function Ra(e){let t=(r,n,o)=>{var l;let i=(l=o&&JSON.stringify(o))!=null?l:0,a={speed_value_type:r,total_duration:n};i&&Object.assign(a,{extra:i}),e("joliboxSpeedAnalysis",a)};return t.debounce=Ut(t,500,{leading:!0}),t}var Sa=j(()=>{"use strict";K();K();ze()});function Ta(e,t){let r=Aa(e,t),n=Ra(r);return{track:r,trackPerformance:n}}var xa=j(()=>{"use strict";Sa()});var lo=j(()=>{"use strict"});var mr,Ca=j(()=>{"use strict";ge();K();K();mr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return N(this,null,function*(){let r=`${P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,o]of Object.entries(r))if(o.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,o,i,a,l;let{nativeSDKVersion:t,jssdkVersion:r}=P.sdkInfo;return{platform:1e3,os:P.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(i=(o=P.hostInfo)==null?void 0:o.aid)!=null?i:"1",model:(a=P.deviceInfo.model)!=null?a:"UnknownModel",brand:(l=P.deviceInfo.brand)!=null?l:"UnknownBrand",uuid:P.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,o)=>{r[o]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return N(this,null,function*(){if(this.checkIsSampled(t))return;let o=t.location?t.location:yield this.getLocation(),i=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let l=this.deviceInfo,f={protocolVersion:"1.0.0",events:[me(z({},t),{location:o,target:i,extra:a,timestamp:Date.now(),userId:null})],device:l,project:r};try{n?yield this.doReport(Xn(f),n):yield this.doReport(Xn(f))}catch(y){ke.log("[Jolibox SDK] report API error",y)}})}}});var uo=j(()=>{"use strict";xa();lo();Ca()});var co,Oa,je,vr,Je,Ft=j(()=>{"use strict";no();ge();co=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Oa=AbortSignal.timeout)!=null||(AbortSignal.timeout=co);je=class e{constructor(){this.httpClients=new WeakSet;this.networkRequests=[];this.maxRequestsToTrack=20;this.getNetworkStatus=()=>this.networkRequests.length===0?!0:this.networkRequests.filter(n=>n).length/this.networkRequests.length>=.6}static getInstance(){return e._instance||(e._instance=new e),e._instance}create(t){let r=new vr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},vr=class{constructor(t){this.xua=ga();this.getJoliSource=()=>P.joliSource;var n;let r=P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return N(this,null,function*(){try{let{query:n,timeout:o}=r!=null?r:{},{headers:i}=r!=null?r:{},a=n?new URLSearchParams(n):null,l=a==null?void 0:a.toString(),c=`${this.baseUrl}${t}${l?`?${l}`:""}`,f=this.xua,y=this.getJoliSource();i=Object.assign({},i!=null?i:{},f?{"x-user-agent":f}:{},y?{"x-joli-source":y}:{});let p=yield fetch(c,{method:"GET",headers:i,credentials:"include",signal:co(o!=null?o:3e4)});return je.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw je.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return N(this,null,function*(){try{let{data:n,query:o,timeout:i}=r!=null?r:{},{headers:a}=r!=null?r:{},l=o?new URLSearchParams(o):null,c=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${c?`?${c}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"POST",headers:a,body:JSON.stringify(n),signal:co(i!=null?i:3e4),credentials:"include"});je.getInstance().recordNetworkRequest(!0);let _=g.headers.get("content-type");if(_!=null&&_.includes("application/octet-stream"))try{return g.blob()}catch(w){return yield g.arrayBuffer()}if(_!=null&&_.includes("multipart/form-data")||_!=null&&_.includes("application/x-www-form-urlencoded"))try{return g.formData()}catch(w){return yield g.text()}if(_!=null&&_.includes("application/json"))try{return yield g.json()}catch(w){return yield g.text()}return g}catch(n){throw je.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return N(this,null,function*(){try{let{data:n,query:o,timeout:i}=r!=null?r:{},{headers:a}=r!=null?r:{},l=o?new URLSearchParams(o):null,c=l==null?void 0:l.toString(),f=`${this.baseUrl}${t}${c?`?${c}`:""}`,y=this.xua,p=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},p?{"x-joli-source":p}:{});let g=yield fetch(f,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!g.ok)throw je.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${g.status}`);return je.getInstance().recordNetworkRequest(!0),yield g.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=vr;Je=je.getInstance()});var fo,_r,ho=j(()=>{"use strict";ge();uo();Ft();fo=class extends mr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Je.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,o;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(o=P.testMode)!=null&&o?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},_r=new fo});var hd,ka=j(()=>{"use strict";Ia();K();so();K();ho();ge();hd=(e,t)=>{var o,i,a;let r={message:t.message,stack:(o=t.stack)!=null?o:"",errorType:t.name,source:0},n={name:e,type:Mt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:null};_r.trackEvent(n,dt.WebSDK)};et.on("GLOBAL_ERROR",(e,t)=>{hd(t.tag,e)});et.on("GLOBAL_USER_ERROR",(e,t)=>{ke.log("UserError",e,t)})});var gr,Pa=j(()=>{"use strict";gr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,o,i=!1,a=0,l=()=>{if(!i)return;let _=Date.now(),w=_-r;w>=this.interval&&(this.visible&&(a+=w,t(a)),r=_),n=requestAnimationFrame(l)},c=()=>{y(),r=Date.now(),o=window.setInterval(()=>{if(!i)return;let _=Date.now();_-r>=this.interval&&(r=_)},this.interval)},f=()=>{p(),r=Date.now(),n=requestAnimationFrame(l)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},p=()=>{o&&(clearInterval(o),o=0)};this.eventEmitter.on("visible",_=>{i&&(console.log("visible",_),_?f():c())});let g=this.visible;return{start(){i||(i=!0,g?f():c())},stop(){i=!1,y(),p()}}}}});var yr,Da=j(()=>{"use strict";ge();Pa();Ft();yr=class extends gr{constructor(r,n,o){super(n,o);this.httpClient=Je.create();this.gameId=P.mpId,this.sessionId=P.sessionId,this.track=r}reporter(r){return N(this,null,function*(){let{event:n,params:o}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:z({gameId:this.gameId,sessionId:this.sessionId},o)}})})}tracker(r,n=null){this.track(r,n)}}});var Na,pd,Le,md,po,De,tt=j(()=>{"use strict";ka();K();K();uo();ho();Da();ge();lo();Na=Te(),pd={type:dt.WebSDK,platform:"h5",jssdk_version:P.sdkInfo.jssdkVersion,mp_id:P.mpId,mp_version:P.mpVersion},{track:Le,trackPerformance:md}=Ta((...e)=>{var a,l,c,f;let[,t]=e,r=t,n=ta(r.extra)?r.extra:Kn(r.extra)?JSON.parse(r.extra):{},o=me(z({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(l=r.mp_version)!=null?l:""}),i={name:t.tag,type:Mt.System,location:null,target:null,extra:o,timestamp:Date.now(),userId:(f=(c=P.hostUserInfo)==null?void 0:c.uid)!=null?f:null};_r.trackEvent(i,dt.WebSDK)},pd);Na.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{md(e,t,r)});Na.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});po=new Ne,De=new yr(Le,po)});function La(e){let t=Qn.config[e];return t||(t={},Qn.config[e]=t),(r,n)=>{if(t[r]){ke.warn(`[can i use] ${r} already registered`);return}t[r]=z({},n)}}var Ua=j(()=>{"use strict";K()});function mo(e){Ma=e}function br(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>br(t)):Object.keys(e).reduce((t,r)=>(t[r]=br(e[r]),t),{})}function Ve(e){return typeof e=="number"}function vo(e){let t=_o(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function _o(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ma,oe,Er,wr,Ir,Ar,ht,Rr,Sr,Tr,xr,Cr,Or,kr,Pr,Dr,Nr,Lr,Ur,go=j(()=>{"use strict";Ma=!1;oe=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ma)if(typeof t=="string")this.errors.push(t);else{let r=`${this.path} should be ${t.expect}`;this._optional&&t.expect!=="undefined"?r+=" or undefined, ":r+=", ",r+=`but got ${vo(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return br(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:br(this._default)}optional(){return this._optional=!0,this}};Er=class extends oe{validate(t){return this._optional&&t===void 0?!0:Ve(t)?Ve(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Ve(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Ve(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},wr=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Ir=class extends oe{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Ve(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Ve(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},Ar=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ht=class extends oe{validate(t){return!0}},Rr=class extends oe{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Sr=class extends oe{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Tr=class extends oe{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},xr=class extends oe{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${vo(t)}`)}return!0}},Cr=class extends oe{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(Ve(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Ve(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Ve(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let o=!0;if(r.forEach((i,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,i===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(i)||(n.hasFallback?r[a]=n.fallbackValue:o=!1)}),this._uniqueItems){let i=new Map;for(let a in r)i.has(r[a])?o=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${i.get(r[a])}] and ${this.path}[${a}] are identical)`):i.set(r[a],a)}return o}minItems(r){return this._minItems=r,this}maxItems(r){return this._maxItems=r,this}uniqueItems(){return this._uniqueItems=!0,this}length(r){return this._length=r,this}},Or=class extends oe{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(_o(r)!=="object")return this.fail({expect:"object",actual:r});let o=r,i=this._value;i.errors=this.errors;let a=!0;for(let l in o){let c=o[l];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(l)?i.path=`${this.path}.${l}`:i.path=`${this.path}["${l}"]`,!(c===void 0&&i._optional)){if(c===void 0&&i.hasDefault){o[l]=i.defaultValue;continue}i.validate(c)||(i.hasFallback?o[l]=i.fallbackValue:a=!1)}}return a}},kr=class extends oe{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(_o(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,o=!0;for(let i in this._object){let a=n[i],l=this._object[i];if(l.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(i)?l.path=`${this.path}.${i}`:l.path=`${this.path}["${i}"]`,!(l._optional&&a===void 0)){if(a===void 0&&l.hasDefault){n[i]=l.defaultValue;continue}l.validate(a)||(l.hasFallback?n[i]=l.fallbackValue:o=!1)}}return o}},Pr=class extends oe{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:vo(this.value),actual:r}):!0}},Dr=class extends oe{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,o=this._items.length;for(let i=0;i<o;i++){let a=this._items[i];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let i=r.join(`
|
|
2
|
+
or `);this.errors.push(i)}return n}},Nr=class extends oe{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let o=t[n];if(o._optional||o.hasDefault)r+=1;else break}this._minItems=t.length-r}validate(t){if(t===void 0&&this._optional)return!0;if(!Array.isArray(t))return this.fail({expect:"array",actual:t});if(t.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);let r=!0;return this._items.forEach((n,o)=>{if(n.path=`${this.path}[${o}]`,n.errors=this.errors,t[o]===void 0&&n.hasDefault){t[o]=n.defaultValue;return}n.validate(t[o])||(n.hasFallback?t[o]=n._fallback:r=!1)}),r}},Lr=class extends oe{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Ur=class extends oe{constructor(t){super(),this._ctor=t}validate(t){return t===void 0&&this._optional||t instanceof this._ctor?!0:this.fail({expect:`typedarray of ${this._ctor.name}`,actual:t})}}});function yo(e,t,r="param"){if(e.errors=[],e.path=r,mo(!0),!e.validate(t)){let n=e.errors.join(`
|
|
3
|
+
`);throw e.errors.length=0,mo(!1),new TypeError(n)}}var U,bo=j(()=>{"use strict";go();go();U={object(e){return new kr(e)},array(e){return new Cr(e)},tuple(...e){return new Nr(...e)},literal(e){return new Pr(e)},or(...e){return new Dr(...e)},symbol(){return new Ar},record(e){return new Or(e)},function(){return new Tr},boolean(){return new wr},string(){return new Ir},number(){return new Er},undefined(){return new Rr},null(){return new Sr},unknown(){return new ht},any(){return new ht},as(){return new ht},arraybuffer(){return new Lr},enum(...e){return new xr(...e)},typedarray(e){return new Ur(e)}}});var Mr,Ba,Fa=j(()=>{"use strict";K();ze();bo();so();Mr=1,Ba=e=>{function t(n,o){return(...i)=>{var p,g,_,w;let a=Date.now(),l={method:n,trace_id:Mr};Mr+=1;let c="SUCCESS",f=`${n}:ok`,y=0;try{if(o.paramsSchema)try{yo(o.paramsSchema,i,"params")}catch(k){throw ao(`${n}:fail ${k.message}`)}let I=o.implement(...i),C=I,b=`${n}:ok`;if(I&&"code"in I){let{code:k,data:L,message:q}=I;c=k,C=L,b=q}return{code:c,message:b,data:C}}catch(I){let C=I;y=(g=(p=C.code)!=null?p:C.errNo)!=null?g:2e3,c="FAILURE";let b=(w=(_=C.message)!=null?_:C.errMsg)!=null?w:`${I}`;return f=`${n}:${c} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Pe(new hr(f,y)),{code:c,message:f}}finally{let I=Date.now()-a;e("apiInvoked",me(z({},l),{duration:I,status:c}))}}}function r(n,o){return(...i)=>N(this,null,function*(){var g,_,w,I;let a=ra(i)?i:[i],l=Date.now(),c={method:n,trace_id:Mr};Mr+=1;let f=`${n}:ok`,y="SUCCESS",p={code:y,message:f};try{if(o.paramsSchema)try{yo(o.paramsSchema,a,"params")}catch(k){throw ao(k.message)}let b=yield o.implement(...a);if(b&&"code"in b){let{code:k,data:L,message:q}=b;y=k,f=q,b=L}return Object.assign(p,{code:y,message:f,data:b}),p}catch(C){let b=C,k=(_=(g=b.code)!=null?g:b.errNo)!=null?_:2e3;y="FAILURE";let L=(I=(w=b.message)!=null?w:b.errMsg)!=null?I:`${C}`,q=`${n}:${y} ${L.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(p,{code:y,message:q}),Pe(new hr(q,k)),p}finally{let C=Date.now()-l;e("apiInvoked",me(z({},c),{duration:C,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var xe,rt,se,jt=j(()=>{"use strict";Ua();tt();Fa();bo();({createAPI:xe,createSyncAPI:rt}=Ba(Le)),se=La("h5")});var $a=ur((Va,Ao)=>{(function(e){if(typeof Va=="object"&&typeof Ao!="undefined")Ao.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window!="undefined"?t=window:typeof global!="undefined"?t=global:typeof self!="undefined"?t=self:t=this,t.localforage=e()}})(function(){var e,t,r;return function n(o,i,a){function l(y,p){if(!i[y]){if(!o[y]){var g=typeof Pt=="function"&&Pt;if(!p&&g)return g(y,!0);if(c)return c(y,!0);var _=new Error("Cannot find module '"+y+"'");throw _.code="MODULE_NOT_FOUND",_}var w=i[y]={exports:{}};o[y][0].call(w.exports,function(I){var C=o[y][1][I];return l(C||I)},w,w.exports,n,o,i,a)}return i[y].exports}for(var c=typeof Pt=="function"&&Pt,f=0;f<a.length;f++)l(a[f]);return l}({1:[function(n,o,i){(function(a){"use strict";var l=a.MutationObserver||a.WebKitMutationObserver,c;if(l){var f=0,y=new l(I),p=a.document.createTextNode("");y.observe(p,{characterData:!0}),c=function(){p.data=f=++f%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var g=new a.MessageChannel;g.port1.onmessage=I,c=function(){g.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?c=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){I(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:c=function(){setTimeout(I,0)};var _,w=[];function I(){_=!0;for(var b,k,L=w.length;L;){for(k=w,w=[],b=-1;++b<L;)k[b]();L=w.length}_=!1}o.exports=C;function C(b){w.push(b)===1&&!_&&c()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,o,i){"use strict";var a=n(1);function l(){}var c={},f=["REJECTED"],y=["FULFILLED"],p=["PENDING"];o.exports=g;function g(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,S!==l&&C(this,S)}g.prototype.catch=function(S){return this.then(null,S)},g.prototype.then=function(S,x){if(typeof S!="function"&&this.state===y||typeof x!="function"&&this.state===f)return this;var M=new this.constructor(l);if(this.state!==p){var J=this.state===y?S:x;w(M,J,this.outcome)}else this.queue.push(new _(M,S,x));return M};function _(S,x,M){this.promise=S,typeof x=="function"&&(this.onFulfilled=x,this.callFulfilled=this.otherCallFulfilled),typeof M=="function"&&(this.onRejected=M,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(S){c.resolve(this.promise,S)},_.prototype.otherCallFulfilled=function(S){w(this.promise,this.onFulfilled,S)},_.prototype.callRejected=function(S){c.reject(this.promise,S)},_.prototype.otherCallRejected=function(S){w(this.promise,this.onRejected,S)};function w(S,x,M){a(function(){var J;try{J=x(M)}catch(ee){return c.reject(S,ee)}J===S?c.reject(S,new TypeError("Cannot resolve promise with itself")):c.resolve(S,J)})}c.resolve=function(S,x){var M=b(I,x);if(M.status==="error")return c.reject(S,M.value);var J=M.value;if(J)C(S,J);else{S.state=y,S.outcome=x;for(var ee=-1,Y=S.queue.length;++ee<Y;)S.queue[ee].callFulfilled(x)}return S},c.reject=function(S,x){S.state=f,S.outcome=x;for(var M=-1,J=S.queue.length;++M<J;)S.queue[M].callRejected(x);return S};function I(S){var x=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof x=="function")return function(){x.apply(S,arguments)}}function C(S,x){var M=!1;function J(Ae){M||(M=!0,c.reject(S,Ae))}function ee(Ae){M||(M=!0,c.resolve(S,Ae))}function Y(){x(ee,J)}var le=b(Y);le.status==="error"&&J(le.value)}function b(S,x){var M={};try{M.value=S(x),M.status="success"}catch(J){M.status="error",M.value=J}return M}g.resolve=k;function k(S){return S instanceof this?S:c.resolve(new this(l),S)}g.reject=L;function L(S){var x=new this(l);return c.reject(x,S)}g.all=q;function q(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=S.length,J=!1;if(!M)return this.resolve([]);for(var ee=new Array(M),Y=0,le=-1,Ae=new this(l);++le<M;)Be(S[le],le);return Ae;function Be(Ct,ar){x.resolve(Ct).then(Cn,function(ut){J||(J=!0,c.reject(Ae,ut))});function Cn(ut){ee[ar]=ut,++Y===M&&!J&&(J=!0,c.resolve(Ae,ee))}}}g.race=Q;function Q(S){var x=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var M=S.length,J=!1;if(!M)return this.resolve([]);for(var ee=-1,Y=new this(l);++ee<M;)le(S[ee]);return Y;function le(Ae){x.resolve(Ae).then(function(Be){J||(J=!0,c.resolve(Y,Be))},function(Be){J||(J=!0,c.reject(Y,Be))})}}},{1:1}],3:[function(n,o,i){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,o,i){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(s){return typeof s}:function(s){return s&&typeof Symbol=="function"&&s.constructor===Symbol&&s!==Symbol.prototype?"symbol":typeof s};function l(s,d){if(!(s instanceof d))throw new TypeError("Cannot call a class as a function")}function c(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(s){return}}var f=c();function y(){try{if(!f||!f.open)return!1;var s=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!s||d)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(u){return!1}}function p(s,d){s=s||[],d=d||{};try{return new Blob(s,d)}catch(h){if(h.name!=="TypeError")throw h;for(var u=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,m=new u,v=0;v<s.length;v+=1)m.append(s[v]);return m.getBlob(d.type)}}typeof Promise=="undefined"&&n(3);var g=Promise;function _(s,d){d&&s.then(function(u){d(null,u)},function(u){d(u)})}function w(s,d,u){typeof d=="function"&&s.then(d),typeof u=="function"&&s.catch(u)}function I(s){return typeof s!="string"&&(console.warn(s+" used as a key, but it is not a string."),s=String(s)),s}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",k=void 0,L={},q=Object.prototype.toString,Q="readonly",S="readwrite";function x(s){for(var d=s.length,u=new ArrayBuffer(d),m=new Uint8Array(u),v=0;v<d;v++)m[v]=s.charCodeAt(v);return u}function M(s){return new g(function(d){var u=s.transaction(b,S),m=p([""]);u.objectStore(b).put(m,"key"),u.onabort=function(v){v.preventDefault(),v.stopPropagation(),d(!1)},u.oncomplete=function(){var v=navigator.userAgent.match(/Chrome\/(\d+)/),h=navigator.userAgent.match(/Edge\//);d(h||!v||parseInt(v[1],10)>=43)}}).catch(function(){return!1})}function J(s){return typeof k=="boolean"?g.resolve(k):M(s).then(function(d){return k=d,k})}function ee(s){var d=L[s.name],u={};u.promise=new g(function(m,v){u.resolve=m,u.reject=v}),d.deferredOperations.push(u),d.dbReady?d.dbReady=d.dbReady.then(function(){return u.promise}):d.dbReady=u.promise}function Y(s){var d=L[s.name],u=d.deferredOperations.pop();if(u)return u.resolve(),u.promise}function le(s,d){var u=L[s.name],m=u.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Ae(s,d){return new g(function(u,m){if(L[s.name]=L[s.name]||Si(),s.db)if(d)ee(s),s.db.close();else return u(s.db);var v=[s.name];d&&v.push(s.version);var h=f.open.apply(f,v);d&&(h.onupgradeneeded=function(E){var A=h.result;try{A.createObjectStore(s.storeName),E.oldVersion<=1&&A.createObjectStore(b)}catch(R){if(R.name==="ConstraintError")console.warn('The database "'+s.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+s.storeName+'" already exists.');else throw R}}),h.onerror=function(E){E.preventDefault(),m(h.error)},h.onsuccess=function(){var E=h.result;E.onversionchange=function(A){A.target.close()},u(E),Y(s)}})}function Be(s){return Ae(s,!1)}function Ct(s){return Ae(s,!0)}function ar(s,d){if(!s.db)return!0;var u=!s.db.objectStoreNames.contains(s.storeName),m=s.version<s.db.version,v=s.version>s.db.version;if(m&&(s.version!==d&&console.warn('The database "'+s.name+`" can't be downgraded from version `+s.db.version+" to version "+s.version+"."),s.version=s.db.version),v||u){if(u){var h=s.db.version+1;h>s.version&&(s.version=h)}return!0}return!1}function Cn(s){return new g(function(d,u){var m=new FileReader;m.onerror=u,m.onloadend=function(v){var h=btoa(v.target.result||"");d({__local_forage_encoded_blob:!0,data:h,type:s.type})},m.readAsBinaryString(s)})}function ut(s){var d=x(atob(s.data));return p([d],{type:s.type})}function Ri(s){return s&&s.__local_forage_encoded_blob}function vu(s){var d=this,u=d._initReady().then(function(){var m=L[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(u,s,s),u}function _u(s){ee(s);for(var d=L[s.name],u=d.forages,m=0;m<u.length;m++){var v=u[m];v._dbInfo.db&&(v._dbInfo.db.close(),v._dbInfo.db=null)}return s.db=null,Be(s).then(function(h){return s.db=h,ar(s)?Ct(s):h}).then(function(h){s.db=d.db=h;for(var E=0;E<u.length;E++)u[E]._dbInfo.db=h}).catch(function(h){throw le(s,h),h})}function Fe(s,d,u,m){m===void 0&&(m=1);try{var v=s.db.transaction(s.storeName,d);u(null,v)}catch(h){if(m>0&&(!s.db||h.name==="InvalidStateError"||h.name==="NotFoundError"))return g.resolve().then(function(){if(!s.db||h.name==="NotFoundError"&&!s.db.objectStoreNames.contains(s.storeName)&&s.version<=s.db.version)return s.db&&(s.version=s.db.version+1),Ct(s)}).then(function(){return _u(s).then(function(){Fe(s,d,u,m-1)})}).catch(u);u(h)}}function Si(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function gu(s){var d=this,u={db:null};if(s)for(var m in s)u[m]=s[m];var v=L[u.name];v||(v=Si(),L[u.name]=v),v.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=vu);var h=[];function E(){return g.resolve()}for(var A=0;A<v.forages.length;A++){var R=v.forages[A];R!==d&&h.push(R._initReady().catch(E))}var T=v.forages.slice(0);return g.all(h).then(function(){return u.db=v.db,Be(u)}).then(function(O){return u.db=O,ar(u,d._defaultConfig.version)?Ct(u):O}).then(function(O){u.db=v.db=O,d._dbInfo=u;for(var D=0;D<T.length;D++){var F=T[D];F!==d&&(F._dbInfo.db=u.db,F._dbInfo.version=u.version)}})}function yu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){Fe(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=R.get(s);T.onsuccess=function(){var O=T.result;O===void 0&&(O=null),Ri(O)&&(O=ut(O)),v(O)},T.onerror=function(){h(T.error)}}catch(O){h(O)}})}).catch(h)});return _(m,d),m}function bu(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){Fe(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=R.openCursor(),O=1;T.onsuccess=function(){var D=T.result;if(D){var F=D.value;Ri(F)&&(F=ut(F));var H=s(F,D.key,O++);H!==void 0?v(H):D.continue()}else v()},T.onerror=function(){h(T.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function Eu(s,d,u){var m=this;s=I(s);var v=new g(function(h,E){var A;m.ready().then(function(){return A=m._dbInfo,q.call(d)==="[object Blob]"?J(A.db).then(function(R){return R?d:Cn(d)}):d}).then(function(R){Fe(m._dbInfo,S,function(T,O){if(T)return E(T);try{var D=O.objectStore(m._dbInfo.storeName);R===null&&(R=void 0);var F=D.put(R,s);O.oncomplete=function(){R===void 0&&(R=null),h(R)},O.onabort=O.onerror=function(){var H=F.error?F.error:F.transaction.error;E(H)}}catch(H){E(H)}})}).catch(E)});return _(v,u),v}function wu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){Fe(u._dbInfo,S,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=R.delete(s);A.oncomplete=function(){v()},A.onerror=function(){h(T.error)},A.onabort=function(){var O=T.error?T.error:T.transaction.error;h(O)}}catch(O){h(O)}})}).catch(h)});return _(m,d),m}function Iu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Fe(d._dbInfo,S,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),R=A.clear();E.oncomplete=function(){m()},E.onabort=E.onerror=function(){var T=R.error?R.error:R.transaction.error;v(T)}}catch(T){v(T)}})}).catch(v)});return _(u,s),u}function Au(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Fe(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),R=A.count();R.onsuccess=function(){m(R.result)},R.onerror=function(){v(R.error)}}catch(T){v(T)}})}).catch(v)});return _(u,s),u}function Ru(s,d){var u=this,m=new g(function(v,h){if(s<0){v(null);return}u.ready().then(function(){Fe(u._dbInfo,Q,function(E,A){if(E)return h(E);try{var R=A.objectStore(u._dbInfo.storeName),T=!1,O=R.openKeyCursor();O.onsuccess=function(){var D=O.result;if(!D){v(null);return}s===0||T?v(D.key):(T=!0,D.advance(s))},O.onerror=function(){h(O.error)}}catch(D){h(D)}})}).catch(h)});return _(m,d),m}function Su(s){var d=this,u=new g(function(m,v){d.ready().then(function(){Fe(d._dbInfo,Q,function(h,E){if(h)return v(h);try{var A=E.objectStore(d._dbInfo.storeName),R=A.openKeyCursor(),T=[];R.onsuccess=function(){var O=R.result;if(!O){m(T);return}T.push(O.key),O.continue()},R.onerror=function(){v(R.error)}}catch(O){v(O)}})}).catch(v)});return _(u,s),u}function Tu(s,d){d=C.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var m=this,v;if(!s.name)v=g.reject("Invalid arguments");else{var h=s.name===u.name&&m._dbInfo.db,E=h?g.resolve(m._dbInfo.db):Be(s).then(function(A){var R=L[s.name],T=R.forages;R.db=A;for(var O=0;O<T.length;O++)T[O]._dbInfo.db=A;return A});s.storeName?v=E.then(function(A){if(A.objectStoreNames.contains(s.storeName)){var R=A.version+1;ee(s);var T=L[s.name],O=T.forages;A.close();for(var D=0;D<O.length;D++){var F=O[D];F._dbInfo.db=null,F._dbInfo.version=R}var H=new g(function(G,ne){var te=f.open(s.name,R);te.onerror=function(Re){var kt=te.result;kt.close(),ne(Re)},te.onupgradeneeded=function(){var Re=te.result;Re.deleteObjectStore(s.storeName)},te.onsuccess=function(){var Re=te.result;Re.close(),G(Re)}});return H.then(function(G){T.db=G;for(var ne=0;ne<O.length;ne++){var te=O[ne];te._dbInfo.db=G,Y(te._dbInfo)}}).catch(function(G){throw(le(s,G)||g.resolve()).catch(function(){}),G})}}):v=E.then(function(A){ee(s);var R=L[s.name],T=R.forages;A.close();for(var O=0;O<T.length;O++){var D=T[O];D._dbInfo.db=null}var F=new g(function(H,G){var ne=f.deleteDatabase(s.name);ne.onerror=function(){var te=ne.result;te&&te.close(),G(ne.error)},ne.onblocked=function(){console.warn('dropInstance blocked for database "'+s.name+'" until all open connections are closed')},ne.onsuccess=function(){var te=ne.result;te&&te.close(),H(te)}});return F.then(function(H){R.db=H;for(var G=0;G<T.length;G++){var ne=T[G];Y(ne._dbInfo)}}).catch(function(H){throw(le(s,H)||g.resolve()).catch(function(){}),H})})}return _(v,d),v}var xu={_driver:"asyncStorage",_initStorage:gu,_support:y(),iterate:bu,getItem:yu,setItem:Eu,removeItem:wu,clear:Iu,length:Au,key:Ru,keys:Su,dropInstance:Tu};function Cu(){return typeof openDatabase=="function"}var Ke="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Ou="~~local_forage_type~",Ti=/^~~local_forage_type~([^~]+)~/,sr="__lfsc__:",On=sr.length,kn="arbf",Pn="blob",xi="si08",Ci="ui08",Oi="uic8",ki="si16",Pi="si32",Di="ur16",Ni="ui32",Li="fl32",Ui="fl64",Mi=On+kn.length,Bi=Object.prototype.toString;function Fi(s){var d=s.length*.75,u=s.length,m,v=0,h,E,A,R;s[s.length-1]==="="&&(d--,s[s.length-2]==="="&&d--);var T=new ArrayBuffer(d),O=new Uint8Array(T);for(m=0;m<u;m+=4)h=Ke.indexOf(s[m]),E=Ke.indexOf(s[m+1]),A=Ke.indexOf(s[m+2]),R=Ke.indexOf(s[m+3]),O[v++]=h<<2|E>>4,O[v++]=(E&15)<<4|A>>2,O[v++]=(A&3)<<6|R&63;return T}function Dn(s){var d=new Uint8Array(s),u="",m;for(m=0;m<d.length;m+=3)u+=Ke[d[m]>>2],u+=Ke[(d[m]&3)<<4|d[m+1]>>4],u+=Ke[(d[m+1]&15)<<2|d[m+2]>>6],u+=Ke[d[m+2]&63];return d.length%3===2?u=u.substring(0,u.length-1)+"=":d.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function ku(s,d){var u="";if(s&&(u=Bi.call(s)),s&&(u==="[object ArrayBuffer]"||s.buffer&&Bi.call(s.buffer)==="[object ArrayBuffer]")){var m,v=sr;s instanceof ArrayBuffer?(m=s,v+=kn):(m=s.buffer,u==="[object Int8Array]"?v+=xi:u==="[object Uint8Array]"?v+=Ci:u==="[object Uint8ClampedArray]"?v+=Oi:u==="[object Int16Array]"?v+=ki:u==="[object Uint16Array]"?v+=Di:u==="[object Int32Array]"?v+=Pi:u==="[object Uint32Array]"?v+=Ni:u==="[object Float32Array]"?v+=Li:u==="[object Float64Array]"?v+=Ui:d(new Error("Failed to get type for BinaryArray"))),d(v+Dn(m))}else if(u==="[object Blob]"){var h=new FileReader;h.onload=function(){var E=Ou+s.type+"~"+Dn(this.result);d(sr+Pn+E)},h.readAsArrayBuffer(s)}else try{d(JSON.stringify(s))}catch(E){console.error("Couldn't convert value into a JSON string: ",s),d(null,E)}}function Pu(s){if(s.substring(0,On)!==sr)return JSON.parse(s);var d=s.substring(Mi),u=s.substring(On,Mi),m;if(u===Pn&&Ti.test(d)){var v=d.match(Ti);m=v[1],d=d.substring(v[0].length)}var h=Fi(d);switch(u){case kn:return h;case Pn:return p([h],{type:m});case xi:return new Int8Array(h);case Ci:return new Uint8Array(h);case Oi:return new Uint8ClampedArray(h);case ki:return new Int16Array(h);case Di:return new Uint16Array(h);case Pi:return new Int32Array(h);case Ni:return new Uint32Array(h);case Li:return new Float32Array(h);case Ui:return new Float64Array(h);default:throw new Error("Unkown type: "+u)}}var Nn={serialize:ku,deserialize:Pu,stringToBuffer:Fi,bufferToString:Dn};function ji(s,d,u,m){s.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,m)}function Du(s){var d=this,u={db:null};if(s)for(var m in s)u[m]=typeof s[m]!="string"?s[m].toString():s[m];var v=new g(function(h,E){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(A){return E(A)}u.db.transaction(function(A){ji(A,u,function(){d._dbInfo=u,h()},function(R,T){E(T)})},E)});return u.serializer=Nn,v}function We(s,d,u,m,v,h){s.executeSql(u,m,v,function(E,A){A.code===A.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(R,T){T.rows.length?h(R,A):ji(R,d,function(){R.executeSql(u,m,v,h)},h)},h):h(E,A)},h)}function Nu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[s],function(R,T){var O=T.rows.length?T.rows.item(0).value:null;O&&(O=E.serializer.deserialize(O)),v(O)},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Lu(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT * FROM "+E.storeName,[],function(R,T){for(var O=T.rows,D=O.length,F=0;F<D;F++){var H=O.item(F),G=H.value;if(G&&(G=E.serializer.deserialize(G)),G=s(G,H.key,F+1),G!==void 0){v(G);return}}v()},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Ji(s,d,u,m){var v=this;s=I(s);var h=new g(function(E,A){v.ready().then(function(){d===void 0&&(d=null);var R=d,T=v._dbInfo;T.serializer.serialize(d,function(O,D){D?A(D):T.db.transaction(function(F){We(F,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[s,O],function(){E(R)},function(H,G){A(G)})},function(F){if(F.code===F.QUOTA_ERR){if(m>0){E(Ji.apply(v,[s,R,u,m-1]));return}A(F)}})})}).catch(A)});return _(h,u),h}function Uu(s,d,u){return Ji.apply(this,[s,d,u,1])}function Mu(s,d){var u=this;s=I(s);var m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){We(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[s],function(){v()},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Bu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){We(E,h,"DELETE FROM "+h.storeName,[],function(){m()},function(A,R){v(R)})})}).catch(v)});return _(u,s),u}function Fu(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){We(E,h,"SELECT COUNT(key) as c FROM "+h.storeName,[],function(A,R){var T=R.rows.item(0).c;m(T)},function(A,R){v(R)})})}).catch(v)});return _(u,s),u}function ju(s,d){var u=this,m=new g(function(v,h){u.ready().then(function(){var E=u._dbInfo;E.db.transaction(function(A){We(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[s+1],function(R,T){var O=T.rows.length?T.rows.item(0).key:null;v(O)},function(R,T){h(T)})})}).catch(h)});return _(m,d),m}function Ju(s){var d=this,u=new g(function(m,v){d.ready().then(function(){var h=d._dbInfo;h.db.transaction(function(E){We(E,h,"SELECT key FROM "+h.storeName,[],function(A,R){for(var T=[],O=0;O<R.rows.length;O++)T.push(R.rows.item(O).key);m(T)},function(A,R){v(R)})})}).catch(v)});return _(u,s),u}function Vu(s){return new g(function(d,u){s.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(v,h){for(var E=[],A=0;A<h.rows.length;A++)E.push(h.rows.item(A).name);d({db:s,storeNames:E})},function(v,h){u(h)})},function(m){u(m)})})}function $u(s,d){d=C.apply(this,arguments);var u=this.config();s=typeof s!="function"&&s||{},s.name||(s.name=s.name||u.name,s.storeName=s.storeName||u.storeName);var m=this,v;return s.name?v=new g(function(h){var E;s.name===u.name?E=m._dbInfo.db:E=openDatabase(s.name,"","",0),s.storeName?h({db:E,storeNames:[s.storeName]}):h(Vu(E))}).then(function(h){return new g(function(E,A){h.db.transaction(function(R){function T(H){return new g(function(G,ne){R.executeSql("DROP TABLE IF EXISTS "+H,[],function(){G()},function(te,Re){ne(Re)})})}for(var O=[],D=0,F=h.storeNames.length;D<F;D++)O.push(T(h.storeNames[D]));g.all(O).then(function(){E()}).catch(function(H){A(H)})},function(R){A(R)})})}):v=g.reject("Invalid arguments"),_(v,d),v}var Hu={_driver:"webSQLStorage",_initStorage:Du,_support:Cu(),iterate:Lu,getItem:Nu,setItem:Uu,removeItem:Mu,clear:Bu,length:Fu,key:ju,keys:Ju,dropInstance:$u};function qu(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(s){return!1}}function Vi(s,d){var u=s.name+"/";return s.storeName!==d.storeName&&(u+=s.storeName+"/"),u}function Gu(){var s="_localforage_support_test";try{return localStorage.setItem(s,!0),localStorage.removeItem(s),!1}catch(d){return!0}}function Ku(){return!Gu()||localStorage.length>0}function Wu(s){var d=this,u={};if(s)for(var m in s)u[m]=s[m];return u.keyPrefix=Vi(s,d._defaultConfig),Ku()?(d._dbInfo=u,u.serializer=Nn,g.resolve()):g.reject()}function zu(s){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,v=localStorage.length-1;v>=0;v--){var h=localStorage.key(v);h.indexOf(m)===0&&localStorage.removeItem(h)}});return _(u,s),u}function Yu(s,d){var u=this;s=I(s);var m=u.ready().then(function(){var v=u._dbInfo,h=localStorage.getItem(v.keyPrefix+s);return h&&(h=v.serializer.deserialize(h)),h});return _(m,d),m}function Qu(s,d){var u=this,m=u.ready().then(function(){for(var v=u._dbInfo,h=v.keyPrefix,E=h.length,A=localStorage.length,R=1,T=0;T<A;T++){var O=localStorage.key(T);if(O.indexOf(h)===0){var D=localStorage.getItem(O);if(D&&(D=v.serializer.deserialize(D)),D=s(D,O.substring(E),R++),D!==void 0)return D}}});return _(m,d),m}function Xu(s,d){var u=this,m=u.ready().then(function(){var v=u._dbInfo,h;try{h=localStorage.key(s)}catch(E){h=null}return h&&(h=h.substring(v.keyPrefix.length)),h});return _(m,d),m}function Zu(s){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo,v=localStorage.length,h=[],E=0;E<v;E++){var A=localStorage.key(E);A.indexOf(m.keyPrefix)===0&&h.push(A.substring(m.keyPrefix.length))}return h});return _(u,s),u}function ec(s){var d=this,u=d.keys().then(function(m){return m.length});return _(u,s),u}function tc(s,d){var u=this;s=I(s);var m=u.ready().then(function(){var v=u._dbInfo;localStorage.removeItem(v.keyPrefix+s)});return _(m,d),m}function rc(s,d,u){var m=this;s=I(s);var v=m.ready().then(function(){d===void 0&&(d=null);var h=d;return new g(function(E,A){var R=m._dbInfo;R.serializer.serialize(d,function(T,O){if(O)A(O);else try{localStorage.setItem(R.keyPrefix+s,T),E(h)}catch(D){(D.name==="QuotaExceededError"||D.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(D),A(D)}})})});return _(v,u),v}function nc(s,d){if(d=C.apply(this,arguments),s=typeof s!="function"&&s||{},!s.name){var u=this.config();s.name=s.name||u.name,s.storeName=s.storeName||u.storeName}var m=this,v;return s.name?v=new g(function(h){s.storeName?h(Vi(s,m._defaultConfig)):h(s.name+"/")}).then(function(h){for(var E=localStorage.length-1;E>=0;E--){var A=localStorage.key(E);A.indexOf(h)===0&&localStorage.removeItem(A)}}):v=g.reject("Invalid arguments"),_(v,d),v}var oc={_driver:"localStorageWrapper",_initStorage:Wu,_support:qu(),iterate:Qu,getItem:Yu,setItem:rc,removeItem:tc,clear:zu,length:ec,key:Xu,keys:Zu,dropInstance:nc},ic=function(d,u){return d===u||typeof d=="number"&&typeof u=="number"&&isNaN(d)&&isNaN(u)},ac=function(d,u){for(var m=d.length,v=0;v<m;){if(ic(d[v],u))return!0;v++}return!1},$i=Array.isArray||function(s){return Object.prototype.toString.call(s)==="[object Array]"},Ot={},Hi={},ct={INDEXEDDB:xu,WEBSQL:Hu,LOCALSTORAGE:oc},sc=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],lr=["dropInstance"],Ln=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(lr),lc={description:"",driver:sc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function uc(s,d){s[d]=function(){var u=arguments;return s.ready().then(function(){return s[d].apply(s,u)})}}function Un(){for(var s=1;s<arguments.length;s++){var d=arguments[s];if(d)for(var u in d)d.hasOwnProperty(u)&&($i(d[u])?arguments[0][u]=d[u].slice():arguments[0][u]=d[u])}return arguments[0]}var cc=function(){function s(d){l(this,s);for(var u in ct)if(ct.hasOwnProperty(u)){var m=ct[u],v=m._driver;this[u]=v,Ot[v]||this.defineDriver(m)}this._defaultConfig=Un({},lc),this._config=Un({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return s.prototype.config=function(u){if((typeof u=="undefined"?"undefined":a(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in u){if(m==="storeName"&&(u[m]=u[m].replace(/\W/g,"_")),m==="version"&&typeof u[m]!="number")return new Error("Database version must be a number.");this._config[m]=u[m]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},s.prototype.defineDriver=function(u,m,v){var h=new g(function(E,A){try{var R=u._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){A(T);return}for(var O=Ln.concat("_initStorage"),D=0,F=O.length;D<F;D++){var H=O[D],G=!ac(lr,H);if((G||u[H])&&typeof u[H]!="function"){A(T);return}}var ne=function(){for(var kt=function(hc){return function(){var pc=new Error("Method "+hc+" is not implemented by the current driver"),qi=g.reject(pc);return _(qi,arguments[arguments.length-1]),qi}},Mn=0,fc=lr.length;Mn<fc;Mn++){var Bn=lr[Mn];u[Bn]||(u[Bn]=kt(Bn))}};ne();var te=function(kt){Ot[R]&&console.info("Redefining LocalForage driver: "+R),Ot[R]=u,Hi[R]=kt,E()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(te,A):te(!!u._support):te(!0)}catch(Re){A(Re)}});return w(h,m,v),h},s.prototype.driver=function(){return this._driver||null},s.prototype.getDriver=function(u,m,v){var h=Ot[u]?g.resolve(Ot[u]):g.reject(new Error("Driver not found."));return w(h,m,v),h},s.prototype.getSerializer=function(u){var m=g.resolve(Nn);return w(m,u),m},s.prototype.ready=function(u){var m=this,v=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(v,u,u),v},s.prototype.setDriver=function(u,m,v){var h=this;$i(u)||(u=[u]);var E=this._getSupportedDrivers(u);function A(){h._config.driver=h.driver()}function R(D){return h._extend(D),A(),h._ready=h._initStorage(h._config),h._ready}function T(D){return function(){var F=0;function H(){for(;F<D.length;){var G=D[F];return F++,h._dbInfo=null,h._ready=null,h.getDriver(G).then(R).catch(H)}A();var ne=new Error("No available storage method found.");return h._driverSet=g.reject(ne),h._driverSet}return H()}}var O=this._driverSet!==null?this._driverSet.catch(function(){return g.resolve()}):g.resolve();return this._driverSet=O.then(function(){var D=E[0];return h._dbInfo=null,h._ready=null,h.getDriver(D).then(function(F){h._driver=F._driver,A(),h._wrapLibraryMethodsWithReady(),h._initDriver=T(E)})}).catch(function(){A();var D=new Error("No available storage method found.");return h._driverSet=g.reject(D),h._driverSet}),w(this._driverSet,m,v),this._driverSet},s.prototype.supports=function(u){return!!Hi[u]},s.prototype._extend=function(u){Un(this,u)},s.prototype._getSupportedDrivers=function(u){for(var m=[],v=0,h=u.length;v<h;v++){var E=u[v];this.supports(E)&&m.push(E)}return m},s.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,m=Ln.length;u<m;u++)uc(this,Ln[u])},s.prototype.createInstance=function(u){return new s(u)},s}(),dc=new cc;o.exports=dc},{3:3}]},{},[4])(4)})});var qa=ur(nt=>{"use strict";K();jt();tt();var pt=Te(),Dd=xe("levelFinished",{paramsSchema:U.tuple(U.string(),U.object({result:U.boolean(),duration:U.number()})),implement:(e,t)=>N(nt,null,function*(){let{result:r,duration:n}=t;ke.info("onLevelFinished",r,n),yield Promise.all([De.reporter({event:"COMPLETE_GAME_LEVEL"}),De.tracker("LevelFinished",{levelId:e,result:r,duration:n})])})}),Nd=xe("taskFinished",{paramsSchema:U.tuple(U.string(),U.object({duration:U.number()})),implement:(e,t)=>N(nt,null,function*(){let{duration:r}=t;yield De.tracker("TaskFinished",{duration:r,taskId:e})})}),Ld=xe("levelUpgrade",{paramsSchema:U.tuple(U.string(),U.string()),implement:(e,t)=>N(nt,null,function*(){return yield De.tracker("LevelUpgrade",{name:t,levelId:e})})}),Ud=xe("onHistoryUserLevel",{paramsSchema:U.tuple(U.number()),implement:e=>N(nt,null,function*(){return yield De.tracker("HistoryUserLevel",{level:e})})}),Md=xe("onHistoryUserScore",{paramsSchema:U.tuple(U.number()),implement:e=>N(nt,null,function*(){return yield De.tracker("HistoryUserScore",{score:e})})}),Bd=xe("taskEvent",{paramsSchema:U.tuple(U.string(),U.object({tools:U.array(U.object({id:U.string(),name:U.string(),count:U.number(),description:U.string().optional(),price:U.object({amount:U.number(),unit:U.string()}).optional()})).optional(),awards:U.array(U.object({id:U.string(),name:U.string()})).optional()})),implement:(e,t)=>N(nt,null,function*(){var r;(r=t.tools)!=null&&r.length&&(yield Promise.all([De.reporter({event:"USE_GAME_ITEM"}),De.tracker("UseGameItem",z({taskId:e},t))]))})});pt.registerCommand("TaskTrackerSDK.levelFinished",Dd);pt.registerCommand("TaskTrackerSDK.taskFinished",Nd);pt.registerCommand("TaskTrackerSDK.levelUpgrade",Ld);pt.registerCommand("TaskTrackerSDK.historyUserLevel",Ud);pt.registerCommand("TaskTrackerSDK.historyUserScore",Md);pt.registerCommand("TaskTrackerSDK.taskEvent",Bd);se("TaskTrackerSDK.onLevelFinished",{version:"1.0.0",properties:{levelId:"1.0.0",params:{result:"1.0.0",duration:"1.0.0"}}});se("TaskTrackerSDK.onTaskFinished",{version:"1.0.0",properties:{taskId:"1.0.0",duration:"1.0.0"}});se("TaskTrackerSDK.onLevelUpgrade",{version:"1.0.0",properties:{levelId:"1.0.0",name:"1.0.0"}});se("TaskTrackerSDK.onHistoryUserLevel",{version:"1.0.0",properties:{level:"1.0.0"}});se("TaskTrackerSDK.onHistoryUserScore",{version:"1.0.0",properties:{score:"1.0.0"}});se("TaskTrackerSDK.onTaskEvent",{version:"1.0.0",properties:{taskId:"1.0.0",params:{tools:{id:"1.0.0",name:"1.0.0",count:"1.0.0",description:"1.0.0",price:{amount:"1.0.0",unit:"1.0.0"}},awards:{id:"1.0.0",name:"1.0.0"}}}})});var vt,mt,Ga,So,Fd,To,xo=j(()=>{"use strict";vt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},mt=new Map,Ga=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=mt.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(o){console.warn("Callback execution failed:",o)}})}}catch(t){console.warn("Failed to parse message:",t)}},So=!1,Fd=()=>{So||(window.addEventListener("message",Ga),So=!0)},To=(e,t)=>{Fd(),mt.has(e)||mt.set(e,new Set);let r=mt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&mt.delete(e),mt.size===0&&(window.removeEventListener("message",Ga),So=!1)}}});var gt,Vr,$r,Hr,qr,Ka,_t,jd,de,ot,it=j(()=>{"use strict";K();gt="UNLOCK_OPTIONS_CHANGED",Vr="INVOKE_PAYMENT",$r="ON_PAYMENT_RESULT",Hr="ON_USE_MODAL_EVENT",qr="ON_USE_MODAL_RESULT",Ka="ON_USE_MODAL_FREQUENCY",_t=new Ne,jd=()=>({on:_t.on.bind(_t),off:_t.off.bind(_t),emit:_t.emit.bind(_t)}),de=jd(),ot={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});function za(){let e=new Map,t,r;return{registerRewardHandler(o,i){e.set(o,i)},handleReward(o,...i){return N(this,null,function*(){return yield o.reduce((l,c)=>N(this,null,function*(){let f=yield l;if(f===!0)return!0;Wa&&console.log(`handleReward ${c}`);let y=e.get(c),p=y?yield y(...i):f;return Wa&&console.log(`handleReward ${c} ${p}`),p}),Promise.resolve(!1))})},registerRewardsFetcher(o){return N(this,null,function*(){t=(...i)=>N(this,null,function*(){try{return yield o(...i)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(o){return N(this,null,function*(){r=(...i)=>N(this,null,function*(){try{return yield o(...i)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:ot}}})})},getRewardsTypes(...o){return N(this,null,function*(){return t?yield t(...o):["ADS"]})},getRewardFrequencyConfig(...o){return N(this,null,function*(){return r?yield r(...o):{joliCoinUseAndCharge:ot}})}}}var Wa,Ya=j(()=>{"use strict";ge();it();Wa=P.testMode});var Jd,Vd,Qa,Xa,Za=j(()=>{"use strict";it();Jd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,Vd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Jd()):["ADS"],Qa=e=>{e.registerRewardsFetcher(t=>N(void 0,null,function*(){var n,o,i,a;let r=["ADS"];try{let l=yield t.post("/api/games/unlock-options",{});if(l.code!=="SUCCESS")return r;de.emit(gt,{options:((n=l.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((o=l.extra)==null?void 0:o.joliCoin)||{balance:0,enableAutoDeduct:!1}});let c=((a=(i=l.data)==null?void 0:i.unlockOptions)==null?void 0:a.map(f=>f.type))||Array.from(r);return Vd(c)}catch(l){return console.error("getRewardOptions error:",l),r}}))},Xa=e=>{e.registerRewardFrequencyConfigFetcher(t=>N(void 0,null,function*(){var n,o;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return r.code!=="SUCCESS"?{joliCoinUseAndCharge:ot}:(de.emit(Ka,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||ot}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||ot})}))}});var es,ts=j(()=>{"use strict";es=e=>t=>N(void 0,null,function*(){return e.adBreak(t),!0})});function at(e,t){let r=null,n=null,o=null,i=()=>{if(o){r=Promise.resolve(o);return}r=new Promise(a=>{n=a})};return i(),e.on(t,(...a)=>{let l=a[0];o=l,n&&(n(l),n=null)}),{getData:()=>(r||i(),r),getCachedData:()=>o,clearCache:()=>{o=null,r=null},getFreshData:()=>(o=null,r=null,i(),r)}}var Gr=j(()=>{"use strict"});var rs,ns=j(()=>{"use strict";rs=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var o;return n.joliCoinQuantity<=((o=t==null?void 0:t.balance)!=null?o:0)}))});var Kr,Wr,os,zr,Yr=j(()=>{"use strict";ge();K();it();ns();Gr();Kr=(e,t)=>r=>N(void 0,null,function*(){let n=at(de,$r);return de.emit(Vr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),Wr=(e,t)=>r=>N(void 0,null,function*(){let n=at(de,qr);return de.emit(Hr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult}),os=e=>{if(e=="CANCEL")throw new Error("CANCEL")},zr=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i}})=>a=>N(void 0,null,function*(){var l,c,f,y,p,g,_;try{let w=!1,I=yield n.getData(),C=(f=(c=(l=I==null?void 0:I.options)==null?void 0:l.find(L=>L.type==="JOLI_COIN"))==null?void 0:c.joliCoinChoices[0].joliCoinQuantity)!=null?f:0;if(!rs((I==null?void 0:I.options)||[],I==null?void 0:I.userJoliCoin)){let L=yield o({userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:C});if(os(L),L!=="SUCCESS")return r==null||r(a),!1;w=!0}let b=!!((y=I==null?void 0:I.userJoliCoin)!=null&&y.enableAutoDeduct);if(!w){let L=yield i({enableAutoDeduct:b,userJoliCoin:I==null?void 0:I.userJoliCoin,joliCoinQuantity:C});if(os(L),L!=="CONFIRM")return r==null||r(a),!1}let k=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ft()}-${P.mpType}-${Date.now()}`,gameInfo:{gameId:P.mpId}}});return k.code=="SUCCESS"?((g=a.adBreakDone)==null||g.call(a,{breakType:a.type,breakName:"name"in a&&(p=a.name)!=null?p:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((_=a.adViewed)==null||_.call(a)),t==null||t({quantity:k.data.quantity,balance:k.data.balance}),!0):(r==null||r(a),!1)}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return r==null||r(a),!1}finally{n.clearCache()}})});var is,as=j(()=>{"use strict";it();Gr();Yr();Yr();is=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=at(de,gt),o=()=>{r==null||r()},i=Wr("ADS-JOLI_COIN",{confirmButtonText:"Use Jolicoin",cancelButtonText:"No watch ads"}),a=Kr("ADS-JOLI_COIN",{confirmButtonText:"Pay and unlock",cancelButtonText:"No watch ads"});return zr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:i}})}});var ss,ls=j(()=>{"use strict";it();Yr();Gr();ss=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=at(de,gt),o=c=>{var f;r==null||r(),(f=c.adBreakDone)==null||f.call(c,{breakType:c.type,breakFormat:c.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=Wr("JOLI_COIN",{confirmButtonText:"Use Jolicoin",cancelButtonText:"No thanks"}),a=Kr("JOLI_COIN",{confirmButtonText:"Pay and unlock",cancelButtonText:"No thanks"});return zr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:o,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:i}})}});var Ye,us=j(()=>{"use strict";Ya();Za();ts();as();ls();Ye=za();Qa(Ye);Xa(Ye)});function $e(e,t){for(var r in t)e[r]=t[r];return e}function Do(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Ht(e,t,r){var n,o,i,a={};for(i in t)i=="key"?n=t[i]:i=="ref"?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?en.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)a[i]===void 0&&(a[i]=e.defaultProps[i]);return Xr(e,a,n,o,null)}function Xr(e,t,r,n,o){var i={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:o==null?++ps:o,__i:-1,__u:0};return o==null&&B.vnode!=null&&B.vnode(i),i}function Qe(e){return e.children}function we(e,t){this.props=e,this.context=t}function yt(e,t){if(t==null)return e.__?yt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?yt(e):null}function ys(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return ys(e)}}function ds(e){(!e.__d&&(e.__d=!0)&&st.push(e)&&!Zr.__r++||cs!==B.debounceRendering)&&((cs=B.debounceRendering)||ms)(Zr)}function Zr(){for(var e,t,r,n,o,i,a,l=1;st.length;)st.length>l&&st.sort(vs),e=st.shift(),l=st.length,e.__d&&(r=void 0,o=(n=(t=e).__v).__e,i=[],a=[],t.__P&&((r=$e({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),No(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[o]:null,i,o==null?yt(n):o,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,ws(i,r,a),r.__e!=o&&ys(r)));Zr.__r=0}function bs(e,t,r,n,o,i,a,l,c,f,y){var p,g,_,w,I,C,b=n&&n.__k||gs,k=t.length;for(c=qd(r,t,b,c,k),p=0;p<k;p++)(_=r.__k[p])!=null&&(g=_.__i===-1?Vt:b[_.__i]||Vt,_.__i=p,C=No(e,_,g,o,i,a,l,c,f,y),w=_.__e,_.ref&&g.ref!=_.ref&&(g.ref&&Lo(g.ref,null,_),y.push(_.ref,_.__c||w,_)),I==null&&w!=null&&(I=w),4&_.__u||g.__k===_.__k?c=Es(_,c,e):typeof _.type=="function"&&C!==void 0?c=C:w&&(c=w.nextSibling),_.__u&=-7);return r.__e=I,c}function qd(e,t,r,n,o){var i,a,l,c,f,y=r.length,p=y,g=0;for(e.__k=new Array(o),i=0;i<o;i++)(a=t[i])!=null&&typeof a!="boolean"&&typeof a!="function"?(c=i+g,(a=e.__k[i]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Xr(null,a,null,null,null):$t(a)?Xr(Qe,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Xr(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,l=null,(f=a.__i=Gd(a,r,c,p))!==-1&&(p--,(l=r[f])&&(l.__u|=2)),l==null||l.__v===null?(f==-1&&(o>y?g--:o<y&&g++),typeof a.type!="function"&&(a.__u|=4)):f!=c&&(f==c-1?g--:f==c+1?g++:(f>c?g--:g++,a.__u|=4))):e.__k[i]=null;if(p)for(i=0;i<y;i++)(l=r[i])!=null&&!(2&l.__u)&&(l.__e==n&&(n=yt(l)),As(l,l));return n}function Es(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=Es(n[o],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=yt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function qt(e,t){return t=t||[],e==null||typeof e=="boolean"||($t(e)?e.some(function(r){qt(r,t)}):t.push(e)),t}function Gd(e,t,r,n){var o,i,a=e.key,l=e.type,c=t[r];if(c===null&&e.key==null||c&&a==c.key&&l===c.type&&!(2&c.__u))return r;if(n>(c!=null&&!(2&c.__u)?1:0))for(o=r-1,i=r+1;o>=0||i<t.length;){if(o>=0){if((c=t[o])&&!(2&c.__u)&&a==c.key&&l===c.type)return o;o--}if(i<t.length){if((c=t[i])&&!(2&c.__u)&&a==c.key&&l===c.type)return i;i++}}return-1}function fs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Hd.test(t)?r:r+"px"}function Qr(e,t,r,n,o){var i;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||fs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||fs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")i=t!=(t=t.replace(_s,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=r,r?n?r.t=n.t:(r.t=Po,e.addEventListener(t,i?Oo:Co,i)):e.removeEventListener(t,i?Oo:Co,i);else{if(o=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r==null?"":r;break e}catch(a){}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function hs(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Po++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function No(e,t,r,n,o,i,a,l,c,f){var y,p,g,_,w,I,C,b,k,L,q,Q,S,x,M,J,ee,Y=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(c=!!(32&r.__u),i=[l=t.__e=r.__e]),(y=B.__b)&&y(t);e:if(typeof Y=="function")try{if(b=t.props,k="prototype"in Y&&Y.prototype.render,L=(y=Y.contextType)&&n[y.__c],q=y?L?L.props.value:y.__:n,r.__c?C=(p=t.__c=r.__c).__=p.__E:(k?t.__c=p=new Y(b,q):(t.__c=p=new we(b,q),p.constructor=Y,p.render=Wd),L&&L.sub(p),p.props=b,p.state||(p.state={}),p.context=q,p.__n=n,g=p.__d=!0,p.__h=[],p._sb=[]),k&&p.__s==null&&(p.__s=p.state),k&&Y.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=$e({},p.__s)),$e(p.__s,Y.getDerivedStateFromProps(b,p.__s))),_=p.props,w=p.state,p.__v=t,g)k&&Y.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),k&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(k&&Y.getDerivedStateFromProps==null&&b!==_&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(b,q),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(b,p.__s,q)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(p.props=b,p.state=p.__s,p.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(le){le&&(le.__=t)}),Q=0;Q<p._sb.length;Q++)p.__h.push(p._sb[Q]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(b,p.__s,q),k&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(_,w,I)})}if(p.context=q,p.props=b,p.__P=e,p.__e=!1,S=B.__r,x=0,k){for(p.state=p.__s,p.__d=!1,S&&S(t),y=p.render(p.props,p.state,p.context),M=0;M<p._sb.length;M++)p.__h.push(p._sb[M]);p._sb=[]}else do p.__d=!1,S&&S(t),y=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++x<25);p.state=p.__s,p.getChildContext!=null&&(n=$e($e({},n),p.getChildContext())),k&&!g&&p.getSnapshotBeforeUpdate!=null&&(I=p.getSnapshotBeforeUpdate(_,w)),J=y,y!=null&&y.type===Qe&&y.key==null&&(J=Is(y.props.children)),l=bs(e,$t(J)?J:[J],t,r,n,o,i,a,l,c,f),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),C&&(p.__E=p.__=null)}catch(le){if(t.__v=null,c||i!=null)if(le.then){for(t.__u|=c?160:128;l&&l.nodeType==8&&l.nextSibling;)l=l.nextSibling;i[i.indexOf(l)]=null,t.__e=l}else for(ee=i.length;ee--;)Do(i[ee]);else t.__e=r.__e,t.__k=r.__k;B.__e(le,t,r)}else i==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):l=t.__e=Kd(r.__e,t,r,n,o,i,a,c,f);return(y=B.diffed)&&y(t),128&t.__u?void 0:l}function ws(e,t,r){for(var n=0;n<r.length;n++)Lo(r[n],r[++n],r[++n]);B.__c&&B.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(i){i.call(o)})}catch(i){B.__e(i,o.__v)}})}function Is(e){return typeof e!="object"||e==null?e:$t(e)?e.map(Is):$e({},e)}function Kd(e,t,r,n,o,i,a,l,c){var f,y,p,g,_,w,I,C=r.props,b=t.props,k=t.type;if(k=="svg"?o="http://www.w3.org/2000/svg":k=="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),i!=null){for(f=0;f<i.length;f++)if((_=i[f])&&"setAttribute"in _==!!k&&(k?_.localName==k:_.nodeType==3)){e=_,i[f]=null;break}}if(e==null){if(k==null)return document.createTextNode(b);e=document.createElementNS(o,k,b.is&&b),l&&(B.__m&&B.__m(t,i),l=!1),i=null}if(k===null)C===b||l&&e.data===b||(e.data=b);else{if(i=i&&en.call(e.childNodes),C=r.props||Vt,!l&&i!=null)for(C={},f=0;f<e.attributes.length;f++)C[(_=e.attributes[f]).name]=_.value;for(f in C)if(_=C[f],f!="children"){if(f=="dangerouslySetInnerHTML")p=_;else if(!(f in b)){if(f=="value"&&"defaultValue"in b||f=="checked"&&"defaultChecked"in b)continue;Qr(e,f,null,_,o)}}for(f in b)_=b[f],f=="children"?g=_:f=="dangerouslySetInnerHTML"?y=_:f=="value"?w=_:f=="checked"?I=_:l&&typeof _!="function"||C[f]===_||Qr(e,f,_,C[f],o);if(y)l||p&&(y.__html===p.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(p&&(e.innerHTML=""),bs(t.type==="template"?e.content:e,$t(g)?g:[g],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":o,i,a,i?i[0]:r.__k&&yt(r,0),l,c),i!=null)for(f=i.length;f--;)Do(i[f]);l||(f="value",k=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[f]||k=="progress"&&!w||k=="option"&&w!==C[f])&&Qr(e,f,w,C[f],o),f="checked",I!==void 0&&I!==e[f]&&Qr(e,f,I,C[f],o))}return e}function Lo(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(o){B.__e(o,r)}}function As(e,t,r){var n,o;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Lo(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){B.__e(i,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&As(n[o],t,r||typeof e.type!="function");r||Do(e.__e),e.__c=e.__=e.__e=void 0}function Wd(e,t,r){return this.constructor(e,r)}function Rs(e,t,r){var n,o,i,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,i=[],a=[],No(t,e=(!n&&r||t).__k=Ht(Qe,null,[e]),o||Vt,Vt,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?en.call(t.childNodes):null,i,!n&&r?r:o?o.__e:t.firstChild,n,a),ws(i,e,a)}var en,B,ps,ko,st,cs,ms,vs,_s,Po,Co,Oo,$d,Vt,gs,Hd,$t,Gt=j(()=>{Vt={},gs=[],Hd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,$t=Array.isArray;en=gs.slice,B={__e:function(e,t,r,n){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&i.getDerivedStateFromError!=null&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),a=o.__d),a)return o.__E=o}catch(l){e=l}throw e}},ps=0,ko=function(e){return e!=null&&e.constructor==null},we.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=$e({},this.state),typeof e=="function"&&(e=e($e({},r),this.props)),e&&$e(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),ds(this))},we.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ds(this))},we.prototype.render=Qe,st=[],ms=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,vs=function(e,t){return e.__v.__b-t.__v.__b},Zr.__r=0,_s=/(PointerCapture)$|Capture$/i,Po=0,Co=hs(!1),Oo=hs(!0),$d=0});function Fo(e,t){re.__h&&re.__h(_e,e,Mo||t),Mo=0;var r=_e.__H||(_e.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function jo(e,t){var r=Fo(Kt++,3);!re.__s&&$o(r.__H,t)&&(r.__=e,r.u=t,_e.__H.__h.push(r))}function Jo(e,t){var r=Fo(Kt++,4);!re.__s&&$o(r.__H,t)&&(r.__=e,r.u=t,_e.__h.push(r))}function Vo(e){return Mo=5,rn(function(){return{current:e}},[])}function rn(e,t){var r=Fo(Kt++,7);return $o(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function zd(){for(var e;e=Ns.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(tn),e.__H.__h.forEach(Bo),e.__H.__h=[]}catch(t){e.__H.__h=[],re.__e(t,e.__v)}}function Yd(e){var t,r=function(){clearTimeout(n),Ds&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ds&&(t=requestAnimationFrame(r))}function tn(e){var t=_e,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),_e=t}function Bo(e){var t=_e;e.__c=e.__(),_e=t}function $o(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var Kt,_e,Uo,Ss,Mo,Ns,re,Ts,xs,Cs,Os,ks,Ps,Ds,Ho=j(()=>{Gt();Mo=0,Ns=[],re=B,Ts=re.__b,xs=re.__r,Cs=re.diffed,Os=re.__c,ks=re.unmount,Ps=re.__;re.__b=function(e){_e=null,Ts&&Ts(e)},re.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ps&&Ps(e,t)},re.__r=function(e){xs&&xs(e),Kt=0;var t=(_e=e.__c).__H;t&&(Uo===_e?(t.__h=[],_e.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(tn),t.__h.forEach(Bo),t.__h=[],Kt=0)),Uo=_e},re.diffed=function(e){Cs&&Cs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ns.push(t)!==1&&Ss===re.requestAnimationFrame||((Ss=re.requestAnimationFrame)||Yd)(zd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Uo=_e=null},re.__c=function(e,t){t.some(function(r){try{r.__h.forEach(tn),r.__h=r.__h.filter(function(n){return!n.__||Bo(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],re.__e(n,r.__v)}}),Os&&Os(e,t)},re.unmount=function(e){ks&&ks(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{tn(n)}catch(o){t=o}}),r.__H=void 0,t&&re.__e(t,r.__v))};Ds=typeof requestAnimationFrame=="function"});function Xd(e,t){for(var r in t)e[r]=t[r];return e}function Ls(e,t){for(var r in e)if(r!=="__source"&&!(r in t))return!0;for(var n in t)if(n!=="__source"&&e[n]!==t[n])return!0;return!1}function Us(e,t){this.props=e,this.context=t}function qs(e,t,r){return e&&(e.__c&&e.__c.__H&&(e.__c.__H.__.forEach(function(n){typeof n.__c=="function"&&n.__c()}),e.__c.__H=null),(e=Xd({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return qs(n,t,r)})),e}function Gs(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Gs(n,t,r)}),e.__c&&e.__c.__P===t&&(e.__e&&r.appendChild(e.__e),e.__c.__e=!0,e.__c.__P=r)),e}function qo(){this.__u=0,this.o=null,this.__b=null}function Ks(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function nn(){this.i=null,this.l=null}function Ws(e,t,r){return t.__k==null&&(t.textContent=""),Rs(e,t),typeof r=="function"&&r(),e?e.__c:null}function sf(){}function lf(){return this.cancelBubble}function uf(){return this.defaultPrevented}var Ms,sg,Zd,Bs,Fs,ef,tf,rf,nf,of,af,js,zs,cf,Js,Vs,$s,Ys=j(()=>{Gt();Gt();Ho();Ho();(Us.prototype=new we).isPureReactComponent=!0,Us.prototype.shouldComponentUpdate=function(e,t){return Ls(this.props,e)||Ls(this.state,t)};Ms=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ms&&Ms(e)};sg=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911,Zd=B.__e;B.__e=function(e,t,r,n){if(e.then){for(var o,i=t;i=i.__;)if((o=i.__c)&&o.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),o.__c(e,t)}Zd(e,t,r,n)};Bs=B.unmount;B.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Bs&&Bs(e)},(qo.prototype=new we).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var o=Ks(n.__v),i=!1,a=function(){i||(i=!0,r.__R=null,o?o(l):l())};r.__R=a;var l=function(){if(!--n.__u){if(n.state.__a){var c=n.state.__a;n.__v.__k[0]=Gs(c,c.__c.__P,c.__c.__O)}var f;for(n.setState({__a:n.__b=null});f=n.o.pop();)f.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},qo.prototype.componentWillUnmount=function(){this.o=[]},qo.prototype.render=function(e,t){if(this.__b){if(this.__v.__k){var r=document.createElement("div"),n=this.__v.__k[0].__c;this.__v.__k[0]=qs(this.__b,r,n.__O=n.__P)}this.__b=null}var o=t.__a&&Ht(Qe,null,e.fallback);return o&&(o.__u&=-33),[Ht(Qe,null,t.__a?null:e.children),o]};Fs=function(e,t,r){if(++r[1]===r[0]&&e.l.delete(t),e.props.revealOrder&&(e.props.revealOrder[0]!=="t"||!e.l.size))for(r=e.i;r;){for(;r.length>3;)r.pop()();if(r[1]<r[0])break;e.i=r=r[2]}};(nn.prototype=new we).__a=function(e){var t=this,r=Ks(t.__v),n=t.l.get(e);return n[0]++,function(o){var i=function(){t.props.revealOrder?(n.push(o),Fs(t,e,n)):o()};r?r(i):i()}},nn.prototype.render=function(e){this.i=null,this.l=new Map;var t=qt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},nn.prototype.componentDidUpdate=nn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Fs(e,r,t)})};ef=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,tf=/^(?:accent|alignment|arabic|baseline|cap|clip(?!PathU)|color|dominant|fill|flood|font|glyph(?!R)|horiz|image(!S)|letter|lighting|marker(?!H|W|U)|overline|paint|pointer|shape|stop|strikethrough|stroke|text(?!L)|transform|underline|unicode|units|v|vector|vert|word|writing|x(?!C))[A-Z]/,rf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,nf=/[A-Z0-9]/g,of=typeof document!="undefined",af=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};we.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(we.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});js=B.event;B.event=function(e){return js&&(e=js(e)),e.persist=sf,e.isPropagationStopped=lf,e.isDefaultPrevented=uf,e.nativeEvent=e};cf={enumerable:!1,configurable:!0,get:function(){return this.class}},Js=B.vnode;B.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,o={},i=n.indexOf("-")===-1;for(var a in r){var l=r[a];if(!(a==="value"&&"defaultValue"in r&&l==null||of&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var c=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&l===!0?l="":c==="translate"&&l==="no"?l=!1:c[0]==="o"&&c[1]==="n"?c==="ondoubleclick"?a="ondblclick":c!=="onchange"||n!=="input"&&n!=="textarea"||af(r.type)?c==="onfocus"?a="onfocusin":c==="onblur"?a="onfocusout":rf.test(a)&&(a=c):c=a="oninput":i&&tf.test(a)?a=a.replace(nf,"-$&").toLowerCase():l===null&&(l=void 0),c==="oninput"&&o[a=c]&&(a="oninputCapture"),o[a]=l}}n=="select"&&o.multiple&&Array.isArray(o.value)&&(o.value=qt(r.children).forEach(function(f){f.props.selected=o.value.indexOf(f.props.value)!=-1})),n=="select"&&o.defaultValue!=null&&(o.value=qt(r.children).forEach(function(f){f.props.selected=o.multiple?o.defaultValue.indexOf(f.props.value)!=-1:o.defaultValue==f.props.value})),r.class&&!r.className?(o.class=r.class,Object.defineProperty(o,"className",cf)):(r.className&&!r.class||r.class&&r.className)&&(o.class=o.className=r.className),t.props=o}(e),e.$$typeof=ef,Js&&Js(e)};Vs=B.__r;B.__r=function(e){Vs&&Vs(e),zs=e.__c};$s=B.diffed;B.diffed=function(e){$s&&$s(e);var t=e.props,r=e.__e;r!=null&&e.type==="textarea"&&"value"in t&&t.value!==r.value&&(r.value=t.value==null?"":t.value),zs=null}});function Ce(e,t,r){return(t=pf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pf(e){var t=mf(e,"string");return typeof t=="symbol"?t:t+""}function mf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function on(e,t,r){return(t=vf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function vf(e){var t=_f(e,"string");return typeof t=="symbol"?t:t+""}function _f(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function Sf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Tf(e){return typeof e=="string"}function xf(e){return typeof e=="undefined"}function Cf(e){return xf(e)||e===null}function Of(e){return typeof e=="function"}function El(e){let t=e,r=null,n=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function Wt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}function ln(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((o,i)=>(o[i]=String(n[i]),o),{})}return e[r]})}function Uf(e){let t=e.location?ln(e.location,tl):null,r=e.target?ln(e.target,tl):null;return ln(If(wf({},e),{location:t,target:r}),Nf)}function Mf(e){let t=e.events.map(n=>Uf(n)),r=ln(e.device,Lf);return[e.protocolVersion,t,r,e.project]}function Bf(){try{if(window.__joliboxLocalStorage__)return window.__joliboxLocalStorage__;let e=Object.getOwnPropertyDescriptor(window,"localStorage");if(e&&e.get){let n=e.get.call(window);return window.__joliboxLocalStorage__=n,n}if(e=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(window),"localStorage"),e&&e.get)return e.get.call(window);let t=Window.prototype,r=Object.getOwnPropertyDescriptor(t,"localStorage");if(r&&r.get){let n=r.get.call(window);return window.__joliboxLocalStorage__=n,n}return localStorage}catch(e){return console.warn("Failed to get original localStorage, fallback to default implementation",e),localStorage}}function $f(e){return new Promise(t=>Rl(e)(t))}function Rl(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(o=>{if(!n)return n=!0,t.call(r,o)},null)}}function Hf(e,t){return(r=>{let n={onWillAddFirstListener(){r(o.fire,o)}},o=new Zt(n);return o.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(o=>t(o)&&r.call(n,o),null)})}function Gf(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Kf(e[n],t[n])}function Kf(e,t){if(Tf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Of(t)){try{if(e instanceof t)return}catch(r){}if(!Cf(e)&&e.constructor===t||t.length===1&&t.call(void 0,e)===!0)return;throw new Error("[Jolibox SDK]argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function Ko(e,t,r){return(t=Wf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wf(e){var t=zf(e,"string");return typeof t=="symbol"?t:t+""}function zf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function an(e,t,r){return(t=Yf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Yf(e){var t=Qf(e,"string");return typeof t=="symbol"?t:t+""}function Qf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function He(e,t,r){return(t=Xf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xf(e){var t=Zf(e,"string");return typeof t=="symbol"?t:t+""}function Zf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function eh(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function th(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}function sh(e,t){return he(e,0)^45?(((t<<2^he(e,0))<<2^he(e,1))<<2^he(e,2))<<2^he(e,3):0}function xl(e){return e.trim()}function lh(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function si(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function er(e,t,r){return e.slice(t,r)}function Ue(e){return e.length}function _i(e){return e.length}function sn(e,t){return t.push(e),e}function uh(e,t){return e.map(t).join("")}function wn(e,t,r,n,o,i,a){return{value:e,root:t,parent:r,type:n,props:o,children:i,line:En,column:Et,length:a,return:""}}function Yt(e,t){return ah(wn("",null,null,"",null,null,0),e,{length:-e.length},t)}function ch(){return ae}function dh(){return ae=Ee>0?he(wt,--Ee):0,Et--,ae===10&&(Et=1,En--),ae}function Ie(){return ae=Ee<Cl?he(wt,Ee++):0,Et++,ae===10&&(Et=1,En++),ae}function Me(){return he(wt,Ee)}function un(){return Ee}function rr(e,t){return er(wt,e,t)}function tr(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ol(e){return En=Et=1,Cl=Ue(wt=e),Ee=0,[]}function kl(e){return wt="",e}function cn(e){return xl(rr(Ee-1,li(e===91?e+2:e===40?e+1:e)))}function fh(e){for(;(ae=Me())&&ae<33;)Ie();return tr(e)>2||tr(ae)>3?"":" "}function hh(e,t){for(;--t&&Ie()&&!(ae<48||ae>102||ae>57&&ae<65||ae>70&&ae<97););return rr(e,un()+(t<6&&Me()==32&&Ie()==32))}function li(e){for(;Ie();)switch(ae){case e:return Ee;case 34:case 39:e!==34&&e!==39&&li(ae);break;case 40:e===41&&li(e);break;case 92:Ie();break}return Ee}function ph(e,t){for(;Ie()&&e+ae!==57&&!(e+ae===84&&Me()===47););return"/*"+rr(t,Ee-1)+"*"+bn(e===47?e:Ie())}function mh(e){for(;!tr(Me());)Ie();return rr(e,Ee)}function vh(e){return kl(dn("",null,null,null,[""],e=Ol(e),0,[0],e))}function dn(e,t,r,n,o,i,a,l,c){for(var f=0,y=0,p=a,g=0,_=0,w=0,I=1,C=1,b=1,k=0,L="",q=o,Q=i,S=n,x=L;C;)switch(w=k,k=Ie()){case 40:if(w!=108&&he(x,p-1)==58){si(x+=$(cn(k),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=cn(k);break;case 9:case 10:case 13:case 32:x+=fh(w);break;case 92:x+=hh(un()-1,7);continue;case 47:switch(Me()){case 42:case 47:sn(_h(ph(Ie(),un()),t,r),c);break;default:x+="/"}break;case 123*I:l[f++]=Ue(x)*b;case 125*I:case 59:case 0:switch(k){case 0:case 125:C=0;case 59+y:b==-1&&(x=$(x,/\f/g,"")),_>0&&Ue(x)-p&&sn(_>32?ol(x+";",n,r,p-1):ol($(x," ","")+";",n,r,p-2),c);break;case 59:x+=";";default:if(sn(S=nl(x,t,r,f,y,o,l,L,q=[],Q=[],p),i),k===123)if(y===0)dn(x,t,S,S,q,i,p,l,Q);else switch(g===99&&he(x,3)===110?100:g){case 100:case 108:case 109:case 115:dn(e,S,S,n&&sn(nl(e,S,S,0,0,o,l,L,o,q=[],p),Q),o,Q,p,l,n?q:Q);break;default:dn(x,S,S,S,[""],Q,0,l,Q)}}f=y=_=0,I=b=1,L=x="",p=a;break;case 58:p=1+Ue(x),_=w;default:if(I<1){if(k==123)--I;else if(k==125&&I++==0&&dh()==125)continue}switch(x+=bn(k),k*I){case 38:b=y>0?1:(x+="\f",-1);break;case 44:l[f++]=(Ue(x)-1)*b,b=1;break;case 64:Me()===45&&(x+=cn(Ie())),g=Me(),y=p=Ue(L=x+=mh(un())),k++;break;case 45:w===45&&Ue(x)==2&&(I=0)}}return i}function nl(e,t,r,n,o,i,a,l,c,f,y){for(var p=o-1,g=o===0?i:[""],_=_i(g),w=0,I=0,C=0;w<n;++w)for(var b=0,k=er(e,p+1,p=ih(I=a[w])),L=e;b<_;++b)(L=xl(I>0?g[b]+" "+k:$(k,/&\f/g,g[b])))&&(c[C++]=L);return wn(e,t,r,o===0?mi:l,c,f,y)}function _h(e,t,r){return wn(e,t,r,Sl,bn(ch()),er(e,2,-2),0)}function ol(e,t,r,n){return wn(e,t,r,vi,er(e,0,n),er(e,n+1,-1),n)}function bt(e,t){for(var r="",n=_i(e),o=0;o<n;o++)r+=t(e[o],o,e,t)||"";return r}function gh(e,t,r,n){switch(e.type){case oh:if(e.children.length)break;case nh:case vi:return e.return=e.return||e.value;case Sl:return"";case Tl:return e.return=e.value+"{"+bt(e.children,n)+"}";case mi:e.value=e.props.join(",")}return Ue(r=bt(e.children,n))?e.return=e.value+"{"+r+"}":""}function yh(e){var t=_i(e);return function(r,n,o,i){for(var a="",l=0;l<t;l++)a+=e[l](r,n,o,i)||"";return a}}function bh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Eh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}function Pl(e,t){switch(sh(e,t)){case 5103:return V+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return V+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return V+e+pn+e+ve+e+e;case 6828:case 4268:return V+e+ve+e+e;case 6165:return V+e+ve+"flex-"+e+e;case 5187:return V+e+$(e,/(\w+).+(:[^]+)/,V+"box-$1$2"+ve+"flex-$1$2")+e;case 5443:return V+e+ve+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return V+e+ve+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return V+e+ve+$(e,"shrink","negative")+e;case 5292:return V+e+ve+$(e,"basis","preferred-size")+e;case 6060:return V+"box-"+$(e,"-grow","")+V+e+ve+$(e,"grow","positive")+e;case 4554:return V+$(e,/([^-])(transform)/g,"$1"+V+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,V+"$1"),/(image-set)/,V+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,V+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,V+"box-pack:$3"+ve+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+V+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,V+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ue(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+V+"$2-$3$1"+pn+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~si(e,"stretch")?Pl($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,Ue(e)-3-(~si(e,"!important")&&10))){case 107:return $(e,":",":"+V)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+V+(he(e,14)===45?"inline-":"")+"box$3$1"+V+"$2$3$1"+ve+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return V+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return V+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return V+e+ve+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return V+e+ve+e+e}return e}function Oh(e){for(var t=0,r,n=0,o=e.length;o>=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}function mn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return Xe={name:o.name,styles:o.styles,next:Xe},o.name;var i=r;if(i.styles!==void 0){var a=i.next;if(a!==void 0)for(;a!==void 0;)Xe={name:a.name,styles:a.styles,next:Xe},a=a.next;var l=i.styles+";";return l}return Nh(e,t,r)}}var c=r;if(t==null)return c;var f=t[c];return f!==void 0?f:c}function Nh(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o<r.length;o++)n+=mn(e,t,r[o])+";";else for(var i in r){var a=r[i];if(typeof a!="object"){var l=a;t!=null&&t[l]!==void 0?n+=i+"{"+t[l]+"}":al(l)&&(n+=Wo(i)+":"+sl(i,l)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var c=0;c<a.length;c++)al(a[c])&&(n+=Wo(i)+":"+sl(i,a[c])+";");else{var f=mn(e,t,a);switch(i){case"animation":case"animationName":{n+=Wo(i)+":"+f+";";break}default:n+=i+"{"+f+"}"}}}return n}function zo(e,t,r){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var n=!0,o="";Xe=void 0;var i=e[0];if(i==null||i.raw===void 0)n=!1,o+=mn(r,t,i);else{var a=i;o+=a[0]}for(var l=1;l<e.length;l++)if(o+=mn(r,t,e[l]),n){var c=i;o+=c[l]}ll.lastIndex=0;for(var f="",y;(y=ll.exec(o))!==null;)f+="-"+y[1];var p=Oh(o)+f;return{name:p,styles:o,next:Xe}}function Nl(e,t,r){var n="";return r.split(" ").forEach(function(o){e[o]!==void 0?t.push(e[o]+";"):o&&(n+=o+" ")}),n}function ul(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function cl(e,t,r){var n=[],o=Nl(e,n,r);return n.length<2?r:o+t(n)}function Ul(e,t){ie.__h&&ie.__h(be,e,ui||t),ui=0;var r=be.__H||(be.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function jh(e,t){var r=Ul(vn++,3);!ie.__s&&Ml(r.__H,t)&&(r.__=e,r.u=t,be.__H.__h.push(r))}function Jh(e){return ui=5,gi(function(){return{current:e}},[])}function gi(e,t){var r=Ul(vn++,7);return Ml(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Vh(){for(var e;e=Ll.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(fn),e.__H.__h.forEach(ci),e.__H.__h=[]}catch(t){e.__H.__h=[],ie.__e(t,e.__v)}}function $h(e){var t,r=function(){clearTimeout(n),gl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);gl&&(t=requestAnimationFrame(r))}function fn(e){var t=be,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),be=t}function ci(e){var t=be;e.__c=e.__(),be=t}function Ml(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function In(){if(Ze>1)Ze--;else{for(var e,t=!1;Qt!==void 0;){var r=Qt;for(Qt=void 0,di++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Fl(r))try{r.c()}catch(o){t||(e=o,t=!0)}r=n}}if(di=0,Ze--,t)throw e}}function Oe(e){if(Ze>0)return e();Ze++;try{return e()}finally{In()}}function Bl(e){if(W!==void 0){var t=e.n;if(t===void 0||t.t!==W)return t={i:0,S:e,p:W.s,n:void 0,t:W,e:void 0,x:void 0,r:t},W.s!==void 0&&(W.s.n=t),W.s=t,e.n=t,32&W.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=W.s,t.n=void 0,W.s.n=t,W.s=t),t}}function pe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}function fe(e){return new pe(e)}function Fl(e){for(var t=e.s;t!==void 0;t=t.n)if(t.S.i!==t.i||!t.S.h()||t.S.i!==t.i)return!0;return!1}function jl(e){for(var t=e.s;t!==void 0;t=t.n){var r=t.S.n;if(r!==void 0&&(t.r=r),t.S.n=t,t.i=-1,t.n===void 0){e.s=t;break}}}function Jl(e){for(var t=e.s,r=void 0;t!==void 0;){var n=t.p;t.i===-1?(t.S.U(t),n!==void 0&&(n.n=t.n),t.n!==void 0&&(t.n.p=n)):r=t,t.S.n=t.r,t.r!==void 0&&(t.r=void 0),t=n}e.s=r}function It(e){pe.call(this,void 0),this.x=e,this.s=void 0,this.g=_n-1,this.f=4}function Xt(e){return new It(e)}function Vl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){Ze++;var r=W;W=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,yi(e),n}finally{W=r,In()}}}function yi(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Vl(e)}function qh(e){if(W!==this)throw new Error("Out-of-order effect");Jl(this),W=e,this.f&=-2,8&this.f&&yi(this),In()}function or(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function At(e){var t=new or(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}function Rt(e,t){B[e]=t.bind(null,B[e]||function(){})}function gn(e){Qo&&Qo(),Qo=e&&e.S()}function ql(e){var t=this,r=e.data,n=Gl(r);n.value=r;var o=gi(function(){for(var l=t,c=t.__v;c=c.__;)if(c.__c){c.__c.__$f|=4;break}var f=Xt(function(){var _=n.value.value;return _===0?0:_===!0?"":_||""}),y=Xt(function(){return!Array.isArray(f.value)&&!ko(f.value)}),p=At(function(){if(this.N=Kl,y.value){var _=f.value;l.__v&&l.__v.__e&&l.__v.__e.nodeType===3&&(l.__v.__e.data=_)}}),g=t.__$u.d;return t.__$u.d=function(){p(),g.call(this)},[y,f]},[]),i=o[0],a=o[1];return i.value?a.peek():a.value}function Gh(e,t,r,n){var o=t in e&&e.ownerSVGElement===void 0,i=fe(r);return{o:function(a,l){i.value=a,n=l},d:At(function(){this.N=Kl;var a=i.value.value;n[t]!==a&&(n[t]=a,o?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}function Gl(e){return gi(function(){return fe(e)},[])}function zh(){Oe(function(){for(var e;e=$l.shift();)bi.call(e)})}function Yh(){$l.push(this)===1&&(B.requestAnimationFrame||Kh)(zh)}function Qh(){Oe(function(){for(var e;e=Hl.shift();)bi.call(e)})}function Kl(){Hl.push(this)===1&&(B.requestAnimationFrame||Wh)(Qh)}function Xh(e){var t=Jh(e);t.current=e,jh(function(){return At(function(){return this.N=Yh,t.current()})},[])}function Zh(e,t){let r=Vo(e);Jo(()=>{r.current=e},[e]),jo(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}function ue(e,t,r,n,o,i){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)l=="ref"?a=t[l]:c[l]=t[l];var f={type:e,props:c,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--ep,__i:-1,__u:0,__source:o,__self:i};if(typeof e=="function"&&(a=e.defaultProps))for(l in a)c[l]===void 0&&(c[l]=a[l]);return B.vnode&&B.vnode(f),f}function qe(e,t,r){return(t=fp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fp(e){var t=hp(e,"string");return typeof t=="symbol"?t:t+""}function hp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function lt(e,t,r){return(t=pp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function pp(e){var t=mp(e,"string");return typeof t=="symbol"?t:t+""}function mp(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Qs,df,ff,hf,Xo,Zo,yl,gf,yf,Xs,bf,Ef,Zs,wf,If,Af,bl,Rf,kf,Pf,el,Df,wl,Il,Al,tl,Nf,Lf,ei,Z,Ff,jf,zt,Zt,Jf,ri,Vf,Go,qf,ni,rl,oi,ii,ai,rh,ve,pn,V,Sl,mi,vi,nh,Tl,oh,ih,bn,ah,En,Et,Cl,Ee,ae,wt,wh,Ih,Ah,il,Rh,Sh,Th,xh,Ch,kh,Ph,Dh,Dl,al,Wo,sl,ll,Xe,Lh,Uh,Mh,Bh,Fh,nr,vn,be,Yo,dl,ui,Ll,ie,fl,hl,pl,ml,vl,_l,gl,Hh,W,Qt,Ze,di,_n,bi,Qo,$l,Hl,Kh,Wh,ye,ep,tp,Ge,fi,hi,hn,rp,np,op,ip,ap,sp,lp,up,cp,dp,pi,yn,hg,Wl=j(()=>{"use strict";Gt();Ys();Qs=Object.getOwnPropertySymbols,df=Object.prototype.hasOwnProperty,ff=Object.prototype.propertyIsEnumerable,hf=(e,t)=>{var r={};for(var n in e)df.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Qs)for(var n of Qs(e))t.indexOf(n)<0&&ff.call(e,n)&&(r[n]=e[n]);return r};Xo=class{constructor(t){Ce(this,"context",void 0),Ce(this,"continueCallback",void 0),Ce(this,"isBeforeAdCalled",!1),Ce(this,"isBeforeRewardCalled",!1),Ce(this,"isAdDismissedCalled",!1),Ce(this,"isAdViewedCalled",!1),Ce(this,"isAfterAdCalled",!1),Ce(this,"currentProvider",void 0),Ce(this,"currentClientParams",void 0),Ce(this,"adsHasResponse",!1),Ce(this,"videoChecker",window.document.createElement("video")),Ce(this,"wrapShowAdFn",r=>()=>{this.adsHasResponse=!0;let n=!1;this.videoChecker.play().catch(()=>{n=!1}),n=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:n},this.paramsToTrack)),r()}),this.context=t}get paramsToTrack(){var t,r,n,o,i,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((o=this.currentClientParams)==null?void 0:o.type)==="preroll"?null:(a=(i=this.currentClientParams)==null?void 0:i.name)!=null?a:""}}wrapBeforeAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t())}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,o,i,a,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(o=(n=this.currentProvider)==null?void 0:n.name)!=null?o:null,breakType:r.breakType,breakName:(i=r.breakName)!=null?i:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.continueCallback)==null||a.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n){return N(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o;let i;switch(r.type){case"preroll":{i={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{i={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),beforeReward:this.wrapBeforeReward(r.beforeReward),adDismissed:this.wrapAdDismissed(r.adDismissed),adViewed:this.wrapAdViewed(r.adViewed),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}default:{i={name:r.name,type:r.type,beforeAd:this.wrapBeforeAd(r.beforeAd),afterAd:this.wrapAfterAd(r.afterAd),adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}}window.setTimeout(()=>{var a,l,c,f;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(a=this.currentProvider)==null?void 0:a.name)!=null?l:null}),(f=this.continueCallback)==null||f.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(c=r.name)!=null?c:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(i,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};Zo=class{constructor(t){on(this,"context",void 0),on(this,"adBreakIsShowing",!1),on(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),on(this,"reportPageHide",()=>{this.context.track("AdBreakHide",{context:"AdsActionDetection"})}),this.context=t,window.addEventListener("visibilitychange",()=>{document.hidden&&this.adBreakIsShowing&&this.reportPageHide()}),window.addEventListener("beforeunload",r=>{this.adBreakIsShowing&&this.reportPageJumpOut()})}},yl=Object.defineProperty,gf=Object.defineProperties,yf=Object.getOwnPropertyDescriptors,Xs=Object.getOwnPropertySymbols,bf=Object.prototype.hasOwnProperty,Ef=Object.prototype.propertyIsEnumerable,Zs=(e,t,r)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wf=(e,t)=>{for(var r in t||(t={}))bf.call(t,r)&&Zs(e,r,t[r]);if(Xs)for(var r of Xs(t))Ef.call(t,r)&&Zs(e,r,t[r]);return e},If=(e,t)=>gf(e,yf(t)),Af=(e,t)=>{for(var r in t)yl(e,r,{get:t[r],enumerable:!0})},bl=(e,t,r,n)=>{for(var o=t,i=e.length-1,a;i>=0;i--)(a=e[i])&&(o=a(o)||o);return o},Rf=(e,t,r)=>new Promise((n,o)=>{var i=c=>{try{l(r.next(c))}catch(f){o(f)}},a=c=>{try{l(r.throw(c))}catch(f){o(f)}},l=c=>c.done?n(c.value):Promise.resolve(c.value).then(i,a);l((r=r.apply(e,t)).next())});if(typeof window!="undefined"&&!window.AbortController){let e=function(){this.signal=new t};e.prototype.abort=function(){this.signal._aborted=!0,typeof this.signal.onabort=="function"&&this.signal.onabort(new Event("abort"));let r=new Event("abort");this.signal.dispatchEvent(r)};let t=function(){this._aborted=!1,this.aborted=!1,this.onabort=null,this._eventListeners={}};Object.defineProperty(t.prototype,"aborted",{get:function(){return this._aborted}}),t.prototype.addEventListener=function(r,n){this._eventListeners[r]||(this._eventListeners[r]=[]),this._eventListeners[r].push(n)},t.prototype.removeEventListener=function(r,n){if(!this._eventListeners[r])return;let o=this._eventListeners[r].indexOf(n);o!==-1&&this._eventListeners[r].splice(o,1)},t.prototype.dispatchEvent=function(r){if(this._eventListeners[r.type])for(let n of this._eventListeners[r.type])n.call(this,r)},window.AbortController=e,window.AbortSignal=t}kf=(e=>(e[e.DEVELOPER_FILE_NOT_FOUND=0]="DEVELOPER_FILE_NOT_FOUND",e[e.INTERNAL_IOS_CAN_NOT_FOUND_PKG=1]="INTERNAL_IOS_CAN_NOT_FOUND_PKG",e[e.USER_IOS_LOAD_TIMEOUT=2]="USER_IOS_LOAD_TIMEOUT",e[e.INTERNAL_IOS_PKG_LOAD_ERROR=3]="INTERNAL_IOS_PKG_LOAD_ERROR",e[e.INTERNAL_IOS_PKG_PARSE_FAIL=4]="INTERNAL_IOS_PKG_PARSE_FAIL",e[e.USER_IOS_GET_EMPTY_DATA=5]="USER_IOS_GET_EMPTY_DATA",e[e.USER_ANDROID_GET_PKG_FAIL=6]="USER_ANDROID_GET_PKG_FAIL",e[e.DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE=7]="DEVELOPER_ANDROID_PACKAGE_FILE_UNEXPECTED_REQUIRE",e))(kf||{});Pf={log:Wt("log"),warn:Wt("warn"),info:Wt("info"),error:Wt("error"),debug:Wt("debug")};Object.assign(globalThis,{logger:Pf});el=Symbol.for("Jolibox.canIUseMap"),Df={};globalThis[el]||(globalThis[el]=Df);wl=(e=>(e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(wl||{}),Il=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Il||{}),Al=(e=>(e[e.App=0]="App",e[e.H5=1]="H5",e[e.Weapp=2]="Weapp",e[e.Alipay=3]="Alipay",e[e.Gcash=4]="Gcash",e[e.Dana=5]="Dana",e[e.Umma=6]="Umma",e[e.WebSDK=1e3]="WebSDK",e[e.AppSDK=1001]="AppSDK",e[e.Other=9999]="Other",e))(Al||{}),tl=["name","params"],Nf=["name","type","location","target","extra","timestamp","userId"],Lf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Bf();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");ei=class ti{constructor(t){this.element=t,this.next=ti.Undefined,this.prev=ti.Undefined}};ei.Undefined=new ei(void 0);Z=ei,Ff=class{constructor(){this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===Z.Undefined}clear(){let e=this._first;for(;e!==Z.Undefined;){let t=e.next;e.prev=Z.Undefined,e.next=Z.Undefined,e=t}this._first=Z.Undefined,this._last=Z.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new Z(e);if(this._first===Z.Undefined)this._first=r,this._last=r;else if(t){let o=this._last;this._last=r,r.prev=o,o.next=r}else{let o=this._first;this._first=r,r.next=o,o.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==Z.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==Z.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==Z.Undefined&&e.next!==Z.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===Z.Undefined&&e.next===Z.Undefined?(this._first=Z.Undefined,this._last=Z.Undefined):e.next===Z.Undefined?(this._last=this._last.prev,this._last.next=Z.Undefined):e.prev===Z.Undefined&&(this._first=this._first.next,this._first.prev=Z.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==Z.Undefined;)yield e.element,e=e.next}},jf=0,zt=class{constructor(e){this.value=e,this.id=jf++}},Zt=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof zt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){return this._event!=null||(this._event=(e,t)=>{var r,n,o,i,a,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let c=new zt(e);return this._listeners?this._listeners instanceof zt?this._listeners=[this._listeners,c]:this._listeners.push(c):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=c,(i=(o=this.options)==null?void 0:o.onDidFirstListener)==null||i.call(o,this)),(l=(a=this.options)==null?void 0:a.onDidAddListener)==null||l.call(a,this),this._size++,()=>{var f,y,p,g;if(!this._disposed){if(this._listeners instanceof zt)this._listeners.id===c.id&&(this._listeners=void 0,this._size=0,(y=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||y.call(f));else if(this._listeners){let _=this._listeners.indexOf(c);_>=0&&(this._listeners.splice(_,1),this._size--,this._size===0&&((g=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||g.call(p)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(o){n(o)}}fire(e){this._listeners&&(this._listeners instanceof zt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Jf=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;var n;let o=(n=this.listeners.get(e))!=null?n:new Zt,i=c=>t(...c.args),a=o.event(i);this.listerHandlerMap.set(t,{handler:i,dispose:a}),this.listeners.set(e,o);let l=this.cachedEventQueue.get(e);if(l&&r)for(let c of l)t(...c.args)}flushCachedEvent(e){e?this.cachedEventQueue.delete(e):this.cachedEventQueue.clear()}off(e,t){let r=this.listerHandlerMap.get(t);r&&(r.dispose(),this.listerHandlerMap.delete(t))}emit(e){let t=this.listeners.get(e),r=this.cachedEventQueue.get(e);for(var n=arguments.length,o=new Array(n>1?n-1:0),i=1;i<n;i++)o[i-1]=arguments[i];r||(r=new Ff,this.cachedEventQueue.set(e,r)),r.push({args:o}),t&&t.fire({event:e,args:o})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},ri={};Af(ri,{None:()=>Vf,filter:()=>Hf,once:()=>Rl,toPromise:()=>$f});Vf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Go=Symbol.for("Jolibox.hostEmitter"),qf=()=>{let e=new Jf;return globalThis[Go]||(globalThis[Go]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Go]};qf();ni=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Zt,this.onDidRegisterCommand=this._onDidRegisterCommand.event,console.log("[Jolibox SDK] command registry")}registerCommand(e){if(!e)throw new Error("invalid command");if(e.metadata&&Array.isArray(e.metadata.args)){let r=[];for(let o of e.metadata.args)r.push(o.constraint);let n=e.handler;e.handler=function(){for(var o=arguments.length,i=new Array(o),a=0;a<o;a++)i[a]=arguments[a];return Gf(i,r),n(...i)}}let{id:t}=e;this._commands.get(t)&&console.info(`[Jolibox SDK] duplicated command is registered ${t}`),this._commands.set(t,e),this._onDidRegisterCommand.fire(t)}getCommand(e){return this._commands.get(e)}getCommands(){let e=new Map;for(let t of this._commands.keys()){let r=this.getCommand(t);r&&e.set(t,r)}return e}};ni=bl([El],ni);rl=class{constructor(){this._onWillExecuteCommand=new Zt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Zt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ni,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Sf(3e4)),this._starActivation}executeCommand(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Rf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ri.toPromise(ri.filter(this.registry.onDidRegisterCommand,o=>o===e))])]),this._tryExecuteCommand(e,r))})}executeCommandThowErr(e){if(!this.registry.getCommand(e))throw new Error(`command '${e}' not found`);let t=this.registry.getCommand(e);for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];this._onWillExecuteCommand.fire({commandId:e,args:n});let i=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),i}_tryExecuteCommand(e,t){let r=this.registry.getCommand(e);if(!r)return Promise.reject(new Error(`command '${e}' not found`));try{this._onWillExecuteCommand.fire({commandId:e,args:t});let n=this.invokeFunction(r.handler,...t);return this._onDidExecuteCommand.fire({commandId:e,args:t}),Promise.resolve(n)}catch(n){return Promise.reject(n)}}invokeFunction(e){try{for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return e(...r)}finally{}}};rl=bl([El],rl);oi=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Ko(this,"context",void 0),Ko(this,"placement","GAME"),Ko(this,"contextInfo",void 0),this.context=t,this.placement=r,this.contextInfo=this.context.getContextInfo()}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,o)=>{r[o]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,o;return{platform:(t=this.contextInfo.platform)!=null?t:Al.WebSDK,os:this.contextInfo.osType+"_"+this.contextInfo.runtimeType,appVersion:"1.0.0",appId:(r=this.contextInfo.hostAppId)!=null?r:"1",model:(n=this.contextInfo.deviceModel)!=null?n:"UnknownModel",brand:(o=this.contextInfo.deviceBrand)!=null?o:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let o={protocolVersion:"1.0.0",events:[{name:t,type:wl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Il.WebSDK};return Mf(o)}};ii=class{constructor(t){an(this,"configs",null),an(this,"firstRun",!0),an(this,"context",void 0),an(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return N(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let o=(t=this.contextInfo.channel)!=null?t:"",i=this.configs[o],a=(r=i==null?void 0:i.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};ai=class{constructor(t,r){He(this,"name","ADSENSE"),He(this,"context",void 0),He(this,"contextInfo",void 0),He(this,"configured",!1),He(this,"initParams",void 0),He(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),He(this,"adConfig",n=>{let o=n,{onReady:i}=o,a=hf(o,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),He(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),He(this,"adUnit",n=>N(this,null,function*(){var o,i,a,l;if(this.context.track("CallAdUnit",{adFormat:(i=(o=n.adFormat)==null?void 0:o.toString())!=null?i:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:c,slot:f,adFormat:y,fullWidthResponsive:p,style:g}=n,_;if(!c)throw new Error("targeting element is required");if(typeof c=="string"?_=document.querySelector(c):_=c,!_)throw new Error("targeting element not found");let w=f;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let I=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,C=document.createElement("ins");if(C.className="adsbygoogle",C.id="jolibox-ads",C.style.display="block",C.setAttribute("data-ad-client",this.initParams.clientId),C.setAttribute("data-ad-slot",w),I&&C.setAttribute("data-ad-format",I),p&&C.setAttribute("data-full-width-responsive",p),g&&C.setAttribute("style",g),(l=this.contextInfo.testAdsMode)!=null?l:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",C.style.position="relative",_.appendChild(C),C.appendChild(b)}else _.appendChild(C),new MutationObserver(b=>{b.forEach(k=>{if(k.type==="attributes"&&k.attributeName==="data-ad-status"){let L=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:L!=null?L:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return N(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let o=document.createElement("script");o.id=r,o.async=!0,o.crossOrigin="anonymous",o.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&o.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&o.setAttribute("data-ad-channel",this.initParams.channelId),document.head.appendChild(o),this.context.track("LoadAdsenseCompleted",null)}})}};rh=function(){function e(r){var n=this;this._insertTag=function(o){var i;n.tags.length===0?n.insertionPoint?i=n.insertionPoint.nextSibling:n.prepend?i=n.container.firstChild:i=n.before:i=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(o,i),n.tags.push(o)},this.isSpeedy=r.speedy===void 0?!0:r.speedy,this.tags=[],this.ctr=0,this.nonce=r.nonce,this.key=r.key,this.container=r.container,this.prepend=r.prepend,this.insertionPoint=r.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(r){r.forEach(this._insertTag)},t.insert=function(r){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(th(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var o=eh(n);try{o.insertRule(r,o.cssRules.length)}catch(i){}}else n.appendChild(document.createTextNode(r));this.ctr++},t.flush=function(){this.tags.forEach(function(r){var n;return(n=r.parentNode)==null?void 0:n.removeChild(r)}),this.tags=[],this.ctr=0},e}(),ve="-ms-",pn="-moz-",V="-webkit-",Sl="comm",mi="rule",vi="decl",nh="@import",Tl="@keyframes",oh="@layer",ih=Math.abs,bn=String.fromCharCode,ah=Object.assign;En=1,Et=1,Cl=0,Ee=0,ae=0,wt="";wh=function(e,t,r){for(var n=0,o=0;n=o,o=Me(),n===38&&o===12&&(t[r]=1),!tr(o);)Ie();return rr(e,Ee)},Ih=function(e,t){var r=-1,n=44;do switch(tr(n)){case 0:n===38&&Me()===12&&(t[r]=1),e[r]+=wh(Ee-1,t,r);break;case 2:e[r]+=cn(n);break;case 4:if(n===44){e[++r]=Me()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=bn(n)}while(n=Ie());return e},Ah=function(e,t){return kl(Ih(Ol(e),t))},il=new WeakMap,Rh=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!il.get(r))&&!n){il.set(e,!0);for(var o=[],i=Ah(t,o),a=r.props,l=0,c=0;l<i.length;l++)for(var f=0;f<a.length;f++,c++)e.props[c]=o[l]?i[l].replace(/&\f/g,a[f]):a[f]+" "+i[l]}}},Sh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};Th=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case vi:e.return=Pl(e.value,e.length);break;case Tl:return bt([Yt(e,{value:$(e.value,"@","@"+V)})],n);case mi:if(e.length)return uh(e.props,function(o){switch(lh(o,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return bt([Yt(e,{props:[$(o,/:(read-\w+)/,":"+pn+"$1")]})],n);case"::placeholder":return bt([Yt(e,{props:[$(o,/:(plac\w+)/,":"+V+"input-$1")]}),Yt(e,{props:[$(o,/:(plac\w+)/,":"+pn+"$1")]}),Yt(e,{props:[$(o,/:(plac\w+)/,ve+"input-$1")]})],n)}return""})}},xh=[Th],Ch=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var I=w.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||xh,o={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var I=w.getAttribute("data-emotion").split(" "),C=1;C<I.length;C++)o[I[C]]=!0;a.push(w)});var l,c=[Rh,Sh];{var f,y=[gh,bh(function(w){f.insert(w)})],p=yh(c.concat(n,y)),g=function(w){return bt(vh(w),p)};l=function(w,I,C,b){f=C,g(w?w+"{"+I.styles+"}":I.styles),b&&(_.inserted[I.name]=!0)}}var _={key:t,sheet:new rh({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:o,registered:{},insert:l};return _.sheet.hydrate(a),_};kh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Ph=/[A-Z]|^ms/g,Dh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Dl=function(e){return e.charCodeAt(1)===45},al=function(e){return e!=null&&typeof e!="boolean"},Wo=Eh(function(e){return Dl(e)?e:e.replace(Ph,"-$&").toLowerCase()}),sl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Dh,function(r,n,o){return Xe={name:n,styles:o,next:Xe},n})}return kh[e]!==1&&!Dl(e)&&typeof t=="number"&&t!==0?t+"px":t};ll=/label:\s*([^\s;{]+)\s*(;|$)/g;Lh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Uh=function(e,t,r){Lh(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var o=t;do e.insert(t===o?"."+n:"",o,e.sheet,!0),o=o.next;while(o!==void 0)}};Mh=function(e){var t=Ch(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=zo(l,t.registered,void 0);return Uh(t,f),t.key+"-"+f.name},n=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=zo(l,t.registered),y="animation-"+f.name;return ul(t,{name:f.name,styles:"@keyframes "+y+"{"+f.styles+"}"}),y},o=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];var f=zo(l,t.registered);ul(t,f)},i=function(){for(var a=arguments.length,l=new Array(a),c=0;c<a;c++)l[c]=arguments[c];return cl(t.registered,r,Bh(l))};return{css:r,cx:i,injectGlobal:o,keyframes:n,hydrate:function(a){a.forEach(function(l){t.inserted[l]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Nl.bind(null,t.registered),merge:cl.bind(null,t.registered,r)}},Bh=function e(t){for(var r="",n=0;n<t.length;n++){var o=t[n];if(o!=null){var i=void 0;switch(typeof o){case"boolean":break;case"object":{if(Array.isArray(o))i=e(o);else{i="";for(var a in o)o[a]&&a&&(i&&(i+=" "),i+=a)}break}default:i=o}i&&(r&&(r+=" "),r+=i)}}return r},Fh=Mh({key:"css"}),nr=Fh.css,ui=0,Ll=[],ie=B,fl=ie.__b,hl=ie.__r,pl=ie.diffed,ml=ie.__c,vl=ie.unmount,_l=ie.__;ie.__b=function(e){be=null,fl&&fl(e)},ie.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_l&&_l(e,t)},ie.__r=function(e){hl&&hl(e),vn=0;var t=(be=e.__c).__H;t&&(Yo===be?(t.__h=[],be.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(fn),t.__h.forEach(ci),t.__h=[],vn=0)),Yo=be},ie.diffed=function(e){pl&&pl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ll.push(t)!==1&&dl===ie.requestAnimationFrame||((dl=ie.requestAnimationFrame)||$h)(Vh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Yo=be=null},ie.__c=function(e,t){t.some(function(r){try{r.__h.forEach(fn),r.__h=r.__h.filter(function(n){return!n.__||ci(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ie.__e(n,r.__v)}}),ml&&ml(e,t)},ie.unmount=function(e){vl&&vl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{fn(n)}catch(o){t=o}}),r.__H=void 0,t&&ie.__e(t,r.__v))};gl=typeof requestAnimationFrame=="function";Hh=Symbol.for("preact-signals");W=void 0,Qt=void 0,Ze=0,di=0,_n=0;pe.prototype.brand=Hh;pe.prototype.h=function(){return!0};pe.prototype.S=function(e){this.t!==e&&e.e===void 0&&(e.x=this.t,this.t!==void 0&&(this.t.e=e),this.t=e)};pe.prototype.U=function(e){if(this.t!==void 0){var t=e.e,r=e.x;t!==void 0&&(t.x=r,e.e=void 0),r!==void 0&&(r.e=t,e.x=void 0),e===this.t&&(this.t=r)}};pe.prototype.subscribe=function(e){var t=this;return At(function(){var r=t.value,n=W;W=void 0;try{e(r)}finally{W=n}})};pe.prototype.valueOf=function(){return this.value};pe.prototype.toString=function(){return this.value+""};pe.prototype.toJSON=function(){return this.value};pe.prototype.peek=function(){var e=W;W=void 0;try{return this.value}finally{W=e}};Object.defineProperty(pe.prototype,"value",{get:function(){var e=Bl(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(di>100)throw new Error("Cycle detected");this.v=e,this.i++,_n++,Ze++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{In()}}}});(It.prototype=new pe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===_n))return!0;if(this.g=_n,this.f|=1,this.i>0&&!Fl(this))return this.f&=-2,!0;var e=W;try{jl(this),W=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return W=e,Jl(this),this.f&=-2,!0};It.prototype.S=function(e){if(this.t===void 0){this.f|=36;for(var t=this.s;t!==void 0;t=t.n)t.S.S(t)}pe.prototype.S.call(this,e)};It.prototype.U=function(e){if(this.t!==void 0&&(pe.prototype.U.call(this,e),this.t===void 0)){this.f&=-33;for(var t=this.s;t!==void 0;t=t.n)t.S.U(t)}};It.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var e=this.t;e!==void 0;e=e.x)e.t.N()}};Object.defineProperty(It.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Bl(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});or.prototype.c=function(){var e=this.S();try{if(8&this.f||this.x===void 0)return;var t=this.x();typeof t=="function"&&(this.u=t)}finally{e()}};or.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Vl(this),jl(this),Ze++;var e=W;return W=this,qh.bind(this,e)};or.prototype.N=function(){2&this.f||(this.f|=2,this.o=Qt,Qt=this)};or.prototype.d=function(){this.f|=8,1&this.f||yi(this)};$l=[],Hl=[];At(function(){bi=this.N})();ql.displayName="_st";Object.defineProperties(pe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:ql},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Rt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var o in n)if(o!=="children"){var i=n[o];i instanceof pe&&(r||(t.__np=r={}),r[o]=i,n[o]=i.peek())}}e(t)});Rt("__r",function(e,t){gn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(o){var i;return At(function(){i=this}),i.c=function(){n.__$f|=1,n.setState({})},i}())),gn(r),e(t)});Rt("__e",function(e,t,r,n){gn(),e(t,r,n)});Rt("diffed",function(e,t){gn();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,o=t.props;if(n){var i=r.U;if(i)for(var a in i){var l=i[a];l!==void 0&&!(a in n)&&(l.d(),i[a]=void 0)}else i={},r.U=i;for(var c in n){var f=i[c],y=n[c];f===void 0?(f=Gh(r,c,y,o),i[c]=f):f.o(y,o)}}}e(t)});Rt("unmount",function(e,t){if(typeof t.type=="string"){var r=t.__e;if(r){var n=r.U;if(n){r.U=void 0;for(var o in n){var i=n[o];i&&i.d()}}}}else{var a=t.__c;if(a){var l=a.__$u;l&&(a.__$u=void 0,l.d())}}e(t)});Rt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});we.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var o in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var i=2&this.__$f;if(!(n||i||4&this.__$f)||1&this.__$f)return!0}else if(!(n||4&this.__$f)||3&this.__$f)return!0;for(var a in e)if(a!=="__source"&&e[a]!==this.props[a])return!0;for(var l in this.props)if(!(l in e))return!0;return!1};Kh=typeof requestAnimationFrame=="undefined"?setTimeout:function(e){var t=function(){clearTimeout(r),cancelAnimationFrame(n),e()},r=setTimeout(t,100),n=requestAnimationFrame(t)},Wh=function(e){queueMicrotask(function(){queueMicrotask(e)})};ye=nr`
|
|
4
4
|
inset: 0;
|
|
5
5
|
clear: none;
|
|
6
6
|
float: none;
|
|
@@ -18,7 +18,7 @@ or `);this.errors.push(i)}return n}},Dr=class extends oe{constructor(...t){super
|
|
|
18
18
|
text-decoration: none;
|
|
19
19
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
20
20
|
'Helvetica Neue', sans-serif;
|
|
21
|
-
`;
|
|
21
|
+
`;ep=0;tp=nr`
|
|
22
22
|
${ye}
|
|
23
23
|
position: fixed;
|
|
24
24
|
top: 0;
|
|
@@ -93,7 +93,7 @@ or `);this.errors.push(i)}return n}},Dr=class extends oe{constructor(...t){super
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
96
|
+
`,Ge=fe(null),fi=fe(""),hi=fe(""),hn=fe(!1),rp=()=>{var e;(e=Ge.value)==null||e.call(Ge,!1)},np=()=>{var e;(e=Ge.value)==null||e.call(Ge,!0)},op=e=>N(void 0,null,function*(){let{title:t,content:r}=e;return Ge.value&&(Ge.value(!1),Oe(()=>{Ge.value=null,hn.value=!1})),Oe(()=>{fi.value=t||"",hi.value=r||"",hn.value=!0}),new Promise(n=>{Ge.value=o=>{Oe(()=>{Ge.value=null,hn.value=!1,fi.value="",hi.value=""}),n(o)}})}),ip=()=>hn.value?ue("div",{className:tp,children:ue("div",{className:"card-wrapper",children:[ue("div",{className:"body",children:[ue("div",{className:"title",children:fi.value}),ue("div",{className:"content",children:hi.value})]}),ue("div",{className:"footer",children:[ue("button",{onClick:rp,className:"cancel-btn",children:"Cancel"}),ue("button",{onClick:np,className:"confirm-btm",children:"Confirm"})]})]})}):null,ap=nr`
|
|
97
97
|
${ye}
|
|
98
98
|
position: relative;
|
|
99
99
|
display: flex;
|
|
@@ -126,7 +126,7 @@ or `);this.errors.push(i)}return n}},Dr=class extends oe{constructor(...t){super
|
|
|
126
126
|
cursor: not-allowed;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
`,
|
|
129
|
+
`,sp=()=>{let e=fe(!1),t=fe(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Oe(()=>{t.value=Date.now(),e.value=!1})}}},lp=e=>{let{countdown:t=0,mode:r,onClose:n,state:o}=e,{startTimestamp:i,timerPaused:a}=o,l=Gl(t);Xh(()=>{i.value&&(l.value=t)}),Zh(()=>{l.value>0?l.value-=1:Oe(()=>{a.value=!0,l.value=0})},a.value?null:1e3);let c=Xt(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!i.value)return!1;let _=Date.now()-i.value;return l.value>0&&t-l.value>=5&&_>=5e3}),f=Xt(()=>{if(r==="interstitial")return!0;if(!i.value)return!1;let _=Date.now()-i.value;return l.value<=0&&_>=(t-1)*1e3&&t>5}),y=Xt(()=>r==="interstitial"?!1:!c.value&&!f.value),p=()=>N(void 0,null,function*(){if(a.value=!0,!(yield op({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Oe(()=>{a.value=!0,l.value=0,i.value=null})}),g=()=>{n("viewed"),Oe(()=>{a.value=!0,l.value=0,i.value=null})};return ue("div",{className:ap,children:[l.value>0&&r!=="interstitial"&&ue("div",{className:"timer",children:[l.value,"s"]}),ue("button",{onClick:c.value?p:f.value?g:void 0,disabled:y.value,children:ue("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:ue("path",{d:"M13.3 0.710215C12.91 0.320215 12.28 0.320215 11.89 0.710215L6.99997 5.59022L2.10997 0.700215C1.71997 0.310215 1.08997 0.310215 0.699971 0.700215C0.309971 1.09021 0.309971 1.72022 0.699971 2.11022L5.58997 7.00022L0.699971 11.8902C0.309971 12.2802 0.309971 12.9102 0.699971 13.3002C1.08997 13.6902 1.71997 13.6902 2.10997 13.3002L6.99997 8.41021L11.89 13.3002C12.28 13.6902 12.91 13.6902 13.3 13.3002C13.69 12.9102 13.69 12.2802 13.3 11.8902L8.40997 7.00022L13.3 2.11022C13.68 1.73022 13.68 1.09022 13.3 0.710215Z",fill:"white"})})})]})},up=()=>{let e=fe(),t=fe(),r=fe(),n=fe(),o=fe(),i=fe(!1),a=fe(15),l=fe(""),c=fe("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:o,visible:i,countdown:a,src:l,mode:c}},cp=nr`
|
|
130
130
|
${ye}
|
|
131
131
|
position: fixed;
|
|
132
132
|
z-index: 2147483647;
|
|
@@ -145,7 +145,7 @@ or `);this.errors.push(i)}return n}},Dr=class extends oe{constructor(...t){super
|
|
|
145
145
|
width: 100%;
|
|
146
146
|
height: 100%;
|
|
147
147
|
}
|
|
148
|
-
`,
|
|
148
|
+
`,dp=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:o,adBreakDone:i,adLoaded:a,visible:l,countdown:c,src:f,mode:y}=t,p=rn(()=>sp(),[]),g=w=>{var I,C,b,k;l.value=!1,w==="dismiss"?(I=n.value)==null||I.call(n):w==="viewed"&&((C=o.value)==null||C.call(o)),(b=r.value)==null||b.call(r),(k=i.value)==null||k.call(i)},_=()=>{var w;(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{p.startTimer()},100),(w=a.value)==null||w.call(a)};return l.value?ue("div",{className:cp,children:[ue(lp,{mode:y.value,onClose:g,countdown:c.value,state:p}),l.value&&ue("iframe",{src:f.value,onLoad:_,sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"}),ue(ip,{})]}):null};pi=class{constructor(t,r){qe(this,"name","OKSPIN"),qe(this,"initialized",!1),qe(this,"initCompleter",null),qe(this,"context",void 0),qe(this,"initParams",void 0),qe(this,"adsOverlay",null),qe(this,"adsIsShowing",!1),qe(this,"lastUnDisplayedAdBreak",null),qe(this,"state",up()),this.context=t,this.initParams=r}init(){return N(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Ws(ue(dp,{state:this.state}),this.adsOverlay),document.documentElement.appendChild(this.adsOverlay),this.initialized=!0,(t=this.initCompleter)==null||t.call(this)})}adConfig(t){var r;if(this.initialized){(r=t.onReady)==null||r.call(t);return}this.initCompleter=()=>{var n;(n=t.onReady)==null||n.call(t)}}adBreak(t,r){return N(this,null,function*(){var n,o,i,a,l,c,f,y;if(!this.initialized||!this.adsOverlay||!r.params.url){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"});return}if(this.adsIsShowing){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}switch(t.type){case"preroll":{(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let p=()=>{var _;this.adsIsShowing=!1,(_=t.afterAd)==null||_.call(t)},g=()=>{var _;this.adsIsShowing=!1,(_=t.adBreakDone)==null||_.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Oe(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=g,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((c=(l=this.lastUnDisplayedAdBreak).adBreakDone)==null||c.call(l,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(f=t.beforeAd)==null||f.call(t);let p=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},g={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},_=()=>{var b;this.adsIsShowing=!1,g.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,g.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},I=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,g)};Oe(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=_,this.state.adViewed.value=w,this.state.adBreakDone.value=I});let C=()=>{var b;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Oe(()=>{var k;this.state.countdown.value=(k=r.params.countdown)!=null?k:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,C);break}}})}};yn=class{constructor(t){if(lt(this,"context",void 0),lt(this,"contextInfo",void 0),lt(this,"providers",{}),lt(this,"channelPolicy",void 0),lt(this,"adsActionDetection",void 0),lt(this,"adsTrackSerializer",void 0),lt(this,"initialized",!1),t)this.context=t,this.channelPolicy=new ii(this.context),this.adsActionDetection=new Zo(this.context),this.adsTrackSerializer=new oi(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand"}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return N(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"ADSENSE":{let o=new ai(this.context,n.params);yield o.init(),this.providers.ADSENSE=o;break}case"OKSPIN":{let o=new pi(this.context,n.params);yield o.init(),this.providers.OKSPIN=o;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return N(this,null,function*(){var r,n,o,i,a,l,c,f,y;if((r=this.context.eventEmitter)==null||r.emit("isAdShowing",!0),this.adsActionDetection.adBreakIsShowing=!0,this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}this.context.checkNetwork()||(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"NETWORK_NOT_OK",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});try{let{data:p,code:g}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(g!=="SUCCESS"){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:"UNKNOWN_ERROR",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let _=p;if(_.length===0){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:"NO_ADS",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let w=!0,I=null,C=new Xo(this.context);for(;_.length>0;){let b=_.shift(),k=this.providers[b.provider];if(k){let[L,q]=yield C.callAdBreakAndContinue(k,t,b);w=L,I=q}else w=!0,I={breakType:t.type,breakName:t.type==="preroll"?"":(l=t.name)!=null?l:"",breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!w)break}w&&I&&((c=t.adBreakDone)==null||c.call(t,I))}}catch(p){(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{(y=this.context.eventEmitter)==null||y.emit("isAdShowing",!1),this.adsActionDetection.adBreakIsShowing=!1}})}adUnit(t){console.warn("This method has been deprecated. We will not support AdSense AdUnit in the future.")}},hg=nr`
|
|
149
149
|
${ye}
|
|
150
150
|
position: fixed;
|
|
151
151
|
left: 0;
|
|
@@ -194,7 +194,7 @@ or `);this.errors.push(i)}return n}},Dr=class extends oe{constructor(...t){super
|
|
|
194
194
|
cursor: pointer;
|
|
195
195
|
}
|
|
196
196
|
}
|
|
197
|
-
`});var ql=lr(Wl=>{"use strict";_t();To();W();var Kl={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Ro("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",Kl[e.result],e.result),me.emit(Hr,{useModalResult:Kl[e.result]})});me.on($r,(e,t)=>{var r;pt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ct()})});Ro("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{me.emit(Jr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});me.on(Vr,(e,t)=>L(Wl,null,function*(){var r;pt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ct()})}))});var Ql=lr(bi=>{"use strict";et();W();Bt();To();as();Gl();ge();var kg=ur(ql()),In=Te(),zl=new Ne,An=Ve.create(),hp={httpClient:An,checkNetwork:()=>Ve.getNetworkStatus(),track:Le,eventEmitter:zl,getContextInfo:()=>{var e,t,r,n,o,i,a,l;return{hostAppId:(t=(e=P.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=P.deviceInfo.did)!=null?r:"",adId:(n=P.deviceInfo.adId)!=null?n:"",sessionId:(o=P.sessionId)!=null?o:"",userId:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:"",objectType:"GAME",objectId:P.mpId,testAdsMode:P.testAdsMode,channel:(l=P.joliSource)!=null?l:"",deviceBrand:P.deviceInfo.brand,deviceModel:P.deviceInfo.model,osType:Re.isAndroid?"ANDROID":Re.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3}}},Yl=e=>{pt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},or=new gn(hp);ot.registerRewardHandler("ADS",Qa(or));ot.registerRewardHandler("JOLI_COIN",rs(An,{onUnlockSuccess:Yl.bind(bi)}));ot.registerRewardHandler("JOLI_COIN_ONLY",os(An,{onUnlockSuccess:Yl.bind(bi)}));zl.on("isAdShowing",e=>{pt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});In.registerCommand("AdsSDK.init",e=>{or.init(e)});In.registerCommand("AdsSDK.adConfig",e=>{or.adConfig(e)});In.registerCommand("AdsSDK.adBreak",e=>{e.type==="reward"?ot.getRewardsTypes(An).then(t=>{ot.handleReward(t,e).catch(r=>{var n;console.info("handleReward failed",r),(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})})}):or.adBreak(e)});In.registerCommand("AdsSDK.adUnit",e=>{or.adUnit(e)})});et();ge();Ft();W();var Fa=Te(),pd="env",md="getSystemInfoSync",vd=()=>{var o,i,a,l;let e={system:P.deviceInfo.system,platform:P.deviceInfo.platform.toLowerCase(),brand:P.deviceInfo.brand,pixelRatio:P.deviceInfo.pixelRatio,language:P.deviceInfo.lang,version:P.sdkInfo.jssdkVersion,appName:(o=P.hostInfo)==null?void 0:o.appName,SDKVersion:P.sdkInfo.nativeSDKVersion},t=(i=P.hostInfo)==null?void 0:i.version;t&&(e=pe(z({},e),{version:t}));let r=(a=P.hostInfo)==null?void 0:a.appName;r&&(e=pe(z({},e),{appName:r}));let n=(l=P.sdkInfo)==null?void 0:l.jssdkVersion;return n&&(e=pe(z({},e),{SDKVersion:n})),e},_d=tt(md,{implement:vd}),gd=tt(pd,{implement:()=>pe(z({},P.hostInfo),{sdkInfo:P.sdkInfo,platform:P.platform,deviceInfo:P.deviceInfo})});Fa.registerCommand("API.env",gd);Fa.registerCommand("API.getSystemInfoSync",_d);se("env",{version:"1.0.0"});se("getSystemInfoSync",{version:"1.0.0"});W();Ft();ze();et();var yd="onJoliboxShow",bd="onJoliboxHide",Ed="onReady",Eo=Te(),wo=ua(Pe),bo=!0,jt=!0,Mr=0,Br=ho;function wd(){let e=Date.now();if(e-Mr<100)return;Mr=e;let t=document.visibilityState==="visible";t!==bo&&(bo=t,Br.emit("visible",bo))}function ja(e){let t=Date.now();t-Mr<100||(Mr=t,e==="focus"&&!jt?jt=!0:e==="blur"&&jt&&(jt=!1),Br.emit("visible",jt))}document.addEventListener("visibilitychange",wd);window.addEventListener("focus",()=>ja("focus"));window.addEventListener("blur",()=>ja("blur"));var Id=tt(yd,{paramsSchema:U.tuple(U.function()),implement(e){let t=wo(e);Br.on("visible",r=>{r&&t()})}}),Ad=tt(bd,{paramsSchema:U.tuple(U.function()),implement(e){let t=wo(e);Br.on("visible",r=>{!r&&t()})}}),Sd=tt(Ed,{paramsSchema:U.tuple(U.function()),implement(e){let t=wo(e);Mt.on("LifecycleEvent.onReady",r=>{t(r)})}});Eo.registerCommand("LifecycleSDK.onReady",Sd);Eo.registerCommand("LifecycleSDK.onJoliboxShow",Id);Eo.registerCommand("LifecycleSDK.onJoliboxHide",Ad);se("lifeCycle.onReady",{version:"1.0.0"});se("lifeCycle.onJoliboxShow",{version:"1.0.0"});se("lifeCycle.onJoliboxHide",{version:"1.0.0"});Ft();W();Bt();ge();var $a=ur(Ja());var Fr=Te(),Ao=class{constructor(){this.httpClient=Ve.create({baseUrl:P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>P.mpId;this.getItem=t=>L(this,null,function*(){let{code:r,data:n,message:o}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),i=n==null?void 0:n.value,a=o;return r!=="SUCCESS"&&(i=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",i),a+="fallback to localstorage"),{code:r,message:a,data:i&&i!=="undefined"?i:null}});this.setItem=(t,r)=>L(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:o,message:i}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:o,message:i}});this.removeItem=t=>L(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>L(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=$a.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},jr=new Ao,Rd=xe("getLocalStorage",{paramsSchema:U.tuple(U.string()),implement(e){return L(this,null,function*(){return yield jr.getItem(e)})}});Fr.registerCommand("StorageSDK.getItem",Rd);se("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Td=xe("setStorage",{paramsSchema:U.tuple(U.string(),U.or(U.string(),U.boolean(),U.number())),implement(e,t){return L(this,null,function*(){return yield jr.setItem(e,t)})}});Fr.registerCommand("StorageSDK.setItem",Td);se("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var xd=xe("removeStorage",{paramsSchema:U.tuple(U.string()),implement(e){return L(this,null,function*(){return yield jr.removeItem(e)})}});Fr.registerCommand("StorageSDK.removeItem",xd);se("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Cd=xe("clearStorage",{implement(){return L(this,null,function*(){return yield jr.clear()})}});Fr.registerCommand("StorageSDK.clear",Cd);se("storage.clear",{version:"1.0.0"});var Ug=ur(Ha()),Mg=ur(Ql());W();et();var nu=-1,Rn=function(e){addEventListener("pageshow",function(t){t.persisted&&(nu=t.timeStamp,e(t))},!0)},wi=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Tn=function(){var e=wi();return e&&e.activationStart||0},Rt=function(e,t){var r=wi(),n="navigate";return nu>=0?n="back-forward-cache":r&&(document.prerendering||Tn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},ou=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(o){Promise.resolve().then(function(){t(o.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(o){}},Tt=function(e,t,r,n){var o,i;return function(a){t.value>=0&&(a||n)&&((i=t.value-(o||0))||o===void 0)&&(o=t.value,t.delta=i,t.rating=function(l,c){return l>c[1]?"poor":l>c[0]?"needs-improvement":"good"}(t.value,r),e(t))}},iu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},au=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},su=function(e){var t=!1;return function(){t||(e(),t=!0)}},St=-1,Xl=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Sn=function(e){document.visibilityState==="hidden"&&St>-1&&(St=e.type==="visibilitychange"?e.timeStamp:0,pp())},Zl=function(){addEventListener("visibilitychange",Sn,!0),addEventListener("prerenderingchange",Sn,!0)},pp=function(){removeEventListener("visibilitychange",Sn,!0),removeEventListener("prerenderingchange",Sn,!0)},lu=function(){return St<0&&(St=Xl(),Zl(),Rn(function(){setTimeout(function(){St=Xl(),Zl()},0)})),{get firstHiddenTime(){return St}}},Ii=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},eu=[1800,3e3],uu=function(e,t){t=t||{},Ii(function(){var r,n=lu(),o=Rt("FCP"),i=ou("paint",function(a){a.forEach(function(l){l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(o.value=Math.max(l.startTime-Tn(),0),o.entries.push(l),r(!0)))})});i&&(r=Tt(e,o,eu,t.reportAllChanges),Rn(function(a){o=Rt("FCP"),r=Tt(e,o,eu,t.reportAllChanges),iu(function(){o.value=performance.now()-a.timeStamp,r(!0)})}))})};var mp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=su(e),document.visibilityState==="hidden"?e():(r=t(e),au(e)),r};var tu=[2500,4e3],Ei={},cu=function(e,t){t=t||{},Ii(function(){var r,n=lu(),o=Rt("LCP"),i=function(c){t.reportAllChanges||(c=c.slice(-1)),c.forEach(function(f){f.startTime<n.firstHiddenTime&&(o.value=Math.max(f.startTime-Tn(),0),o.entries=[f],r())})},a=ou("largest-contentful-paint",i);if(a){r=Tt(e,o,tu,t.reportAllChanges);var l=su(function(){Ei[o.id]||(i(a.takeRecords()),a.disconnect(),Ei[o.id]=!0,r(!0))});["keydown","click"].forEach(function(c){addEventListener(c,function(){return mp(l)},{once:!0,capture:!0})}),au(l),Rn(function(c){o=Rt("LCP"),r=Tt(e,o,tu,t.reportAllChanges),iu(function(){o.value=performance.now()-c.timeStamp,Ei[o.id]=!0,r(!0)})})}})},ru=[800,1800],vp=function e(t){document.prerendering?Ii(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},du=function(e,t){t=t||{};var r=Rt("TTFB"),n=Tt(e,r,ru,t.reportAllChanges);vp(function(){var o=wi();o&&(r.value=Math.max(o.responseStart-Tn(),0),r.entries=[o],n(!0),Rn(function(){r=Rt("TTFB",0),(n=Tt(e,r,ru,t.reportAllChanges))(!0)}))})};ge();function _p(){uu(e=>{Le("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),cu(e=>{Le("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),du(e=>{Le("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function gp(){Mt.on("onDocumentReady",e=>{Mt.emit("LifecycleEvent.onReady",{isLogin:!1}),P.mpType==="game"&&De.start(Date.now()-e)})}function fu(){gp(),_p()}fu();
|
|
197
|
+
`});var Ql=ur(Yl=>{"use strict";it();xo();K();var zl={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};To("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",zl[e.result],e.result),de.emit(qr,{useModalResult:zl[e.result]})});de.on(Hr,(e,t)=>{var r;vt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})});To("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{de.emit($r,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});de.on(Vr,(e,t)=>N(Yl,null,function*(){var r;vt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})}))});var eu=ur(Ei=>{"use strict";tt();K();Ft();xo();us();Wl();ge();var Mg=cr(Ql()),An=Te(),Xl=new Ne,Rn=Je.create(),vp={httpClient:Rn,checkNetwork:()=>Je.getNetworkStatus(),track:Le,eventEmitter:Xl,getContextInfo:()=>{var e,t,r,n,o,i,a,l;return{hostAppId:(t=(e=P.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=P.deviceInfo.did)!=null?r:"",adId:(n=P.deviceInfo.adId)!=null?n:"",sessionId:(o=P.sessionId)!=null?o:"",userId:(a=(i=P.hostUserInfo)==null?void 0:i.uid)!=null?a:"",objectType:"GAME",objectId:P.mpId,testAdsMode:P.testAdsMode,channel:(l=P.joliSource)!=null?l:"",deviceBrand:P.deviceInfo.brand,deviceModel:P.deviceInfo.model,osType:Se.isAndroid?"ANDROID":Se.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3}}},Zl=e=>{vt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},ir=new yn(vp);Ye.registerRewardHandler("ADS",es(ir));Ye.registerRewardHandler("JOLI_COIN",is(Rn,{onUnlockSuccess:Zl.bind(Ei)}));Ye.registerRewardHandler("JOLI_COIN_ONLY",ss(Rn,{onUnlockSuccess:Zl.bind(Ei)}));Xl.on("isAdShowing",e=>{vt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});An.registerCommand("AdsSDK.init",e=>{ir.init(e)});An.registerCommand("AdsSDK.adConfig",e=>{ir.adConfig(e)});An.registerCommand("AdsSDK.adBreak",e=>{e.type==="reward"?Ye.getRewardsTypes(Rn).then(t=>{Ye.handleReward(t,e).catch(r=>{var n;console.info("handleReward failed",r),(n=e.adBreakDone)==null||n.call(e,{breakType:e.type,breakFormat:e.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})})}):ir.adBreak(e)});An.registerCommand("AdsSDK.adUnit",e=>{ir.adUnit(e)})});tt();ge();jt();K();var ja=Te(),_d="env",gd="getSystemInfoSync",yd=()=>{var o,i,a,l;let e={system:P.deviceInfo.system,platform:P.deviceInfo.platform.toLowerCase(),brand:P.deviceInfo.brand,pixelRatio:P.deviceInfo.pixelRatio,language:P.deviceInfo.lang,version:P.sdkInfo.jssdkVersion,appName:(o=P.hostInfo)==null?void 0:o.appName,SDKVersion:P.sdkInfo.nativeSDKVersion},t=(i=P.hostInfo)==null?void 0:i.version;t&&(e=me(z({},e),{version:t}));let r=(a=P.hostInfo)==null?void 0:a.appName;r&&(e=me(z({},e),{appName:r}));let n=(l=P.sdkInfo)==null?void 0:l.jssdkVersion;return n&&(e=me(z({},e),{SDKVersion:n})),e},bd=rt(gd,{implement:yd}),Ed=rt(_d,{implement:()=>me(z({},P.hostInfo),{sdkInfo:P.sdkInfo,platform:P.platform,deviceInfo:P.deviceInfo})});ja.registerCommand("API.env",Ed);ja.registerCommand("API.getSystemInfoSync",bd);se("env",{version:"1.0.0"});se("getSystemInfoSync",{version:"1.0.0"});K();jt();ze();tt();var wd="onJoliboxShow",Id="onJoliboxHide",Ad="onReady",wo=Te(),Io=ca(Pe),Eo=!0,Jt=!0,Br=0,Fr=po;function Rd(){let e=Date.now();if(e-Br<100)return;Br=e;let t=document.visibilityState==="visible";t!==Eo&&(Eo=t,Fr.emit("visible",Eo))}function Ja(e){let t=Date.now();t-Br<100||(Br=t,e==="focus"&&!Jt?Jt=!0:e==="blur"&&Jt&&(Jt=!1),Fr.emit("visible",Jt))}document.addEventListener("visibilitychange",Rd);window.addEventListener("focus",()=>Ja("focus"));window.addEventListener("blur",()=>Ja("blur"));var Sd=rt(wd,{paramsSchema:U.tuple(U.function()),implement(e){let t=Io(e);Fr.on("visible",r=>{r&&t()})}}),Td=rt(Id,{paramsSchema:U.tuple(U.function()),implement(e){let t=Io(e);Fr.on("visible",r=>{!r&&t()})}}),xd=rt(Ad,{paramsSchema:U.tuple(U.function()),implement(e){let t=Io(e);Bt.on("LifecycleEvent.onReady",r=>{t(r)})}});wo.registerCommand("LifecycleSDK.onReady",xd);wo.registerCommand("LifecycleSDK.onJoliboxShow",Sd);wo.registerCommand("LifecycleSDK.onJoliboxHide",Td);se("lifeCycle.onReady",{version:"1.0.0"});se("lifeCycle.onJoliboxShow",{version:"1.0.0"});se("lifeCycle.onJoliboxHide",{version:"1.0.0"});jt();K();Ft();ge();var Ha=cr($a());var jr=Te(),Ro=class{constructor(){this.httpClient=Je.create({baseUrl:P.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>P.mpId;this.getItem=t=>N(this,null,function*(){let{code:r,data:n,message:o}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),i=n==null?void 0:n.value,a=o;return r!=="SUCCESS"&&(i=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",i),a+="fallback to localstorage"),{code:r,message:a,data:i&&i!=="undefined"?i:null}});this.setItem=(t,r)=>N(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:o,message:i}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:o,message:i}});this.removeItem=t=>N(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>N(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=Ha.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Jr=new Ro,Cd=xe("getLocalStorage",{paramsSchema:U.tuple(U.string()),implement(e){return N(this,null,function*(){return yield Jr.getItem(e)})}});jr.registerCommand("StorageSDK.getItem",Cd);se("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Od=xe("setStorage",{paramsSchema:U.tuple(U.string(),U.or(U.string(),U.boolean(),U.number())),implement(e,t){return N(this,null,function*(){return yield Jr.setItem(e,t)})}});jr.registerCommand("StorageSDK.setItem",Od);se("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var kd=xe("removeStorage",{paramsSchema:U.tuple(U.string()),implement(e){return N(this,null,function*(){return yield Jr.removeItem(e)})}});jr.registerCommand("StorageSDK.removeItem",kd);se("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Pd=xe("clearStorage",{implement(){return N(this,null,function*(){return yield Jr.clear()})}});jr.registerCommand("StorageSDK.clear",Pd);se("storage.clear",{version:"1.0.0"});var Vg=cr(qa()),$g=cr(eu());K();tt();var au=-1,Tn=function(e){addEventListener("pageshow",function(t){t.persisted&&(au=t.timeStamp,e(t))},!0)},Ii=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},xn=function(){var e=Ii();return e&&e.activationStart||0},Tt=function(e,t){var r=Ii(),n="navigate";return au>=0?n="back-forward-cache":r&&(document.prerendering||xn()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},su=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(o){Promise.resolve().then(function(){t(o.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(o){}},xt=function(e,t,r,n){var o,i;return function(a){t.value>=0&&(a||n)&&((i=t.value-(o||0))||o===void 0)&&(o=t.value,t.delta=i,t.rating=function(l,c){return l>c[1]?"poor":l>c[0]?"needs-improvement":"good"}(t.value,r),e(t))}},lu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},uu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},cu=function(e){var t=!1;return function(){t||(e(),t=!0)}},St=-1,tu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Sn=function(e){document.visibilityState==="hidden"&&St>-1&&(St=e.type==="visibilitychange"?e.timeStamp:0,_p())},ru=function(){addEventListener("visibilitychange",Sn,!0),addEventListener("prerenderingchange",Sn,!0)},_p=function(){removeEventListener("visibilitychange",Sn,!0),removeEventListener("prerenderingchange",Sn,!0)},du=function(){return St<0&&(St=tu(),ru(),Tn(function(){setTimeout(function(){St=tu(),ru()},0)})),{get firstHiddenTime(){return St}}},Ai=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},nu=[1800,3e3],fu=function(e,t){t=t||{},Ai(function(){var r,n=du(),o=Tt("FCP"),i=su("paint",function(a){a.forEach(function(l){l.name==="first-contentful-paint"&&(i.disconnect(),l.startTime<n.firstHiddenTime&&(o.value=Math.max(l.startTime-xn(),0),o.entries.push(l),r(!0)))})});i&&(r=xt(e,o,nu,t.reportAllChanges),Tn(function(a){o=Tt("FCP"),r=xt(e,o,nu,t.reportAllChanges),lu(function(){o.value=performance.now()-a.timeStamp,r(!0)})}))})};var gp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=cu(e),document.visibilityState==="hidden"?e():(r=t(e),uu(e)),r};var ou=[2500,4e3],wi={},hu=function(e,t){t=t||{},Ai(function(){var r,n=du(),o=Tt("LCP"),i=function(c){t.reportAllChanges||(c=c.slice(-1)),c.forEach(function(f){f.startTime<n.firstHiddenTime&&(o.value=Math.max(f.startTime-xn(),0),o.entries=[f],r())})},a=su("largest-contentful-paint",i);if(a){r=xt(e,o,ou,t.reportAllChanges);var l=cu(function(){wi[o.id]||(i(a.takeRecords()),a.disconnect(),wi[o.id]=!0,r(!0))});["keydown","click"].forEach(function(c){addEventListener(c,function(){return gp(l)},{once:!0,capture:!0})}),uu(l),Tn(function(c){o=Tt("LCP"),r=xt(e,o,ou,t.reportAllChanges),lu(function(){o.value=performance.now()-c.timeStamp,wi[o.id]=!0,r(!0)})})}})},iu=[800,1800],yp=function e(t){document.prerendering?Ai(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},pu=function(e,t){t=t||{};var r=Tt("TTFB"),n=xt(e,r,iu,t.reportAllChanges);yp(function(){var o=Ii();o&&(r.value=Math.max(o.responseStart-xn(),0),r.entries=[o],n(!0),Tn(function(){r=Tt("TTFB",0),(n=xt(e,r,iu,t.reportAllChanges))(!0)}))})};ge();function bp(){fu(e=>{Le("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),hu(e=>{Le("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),pu(e=>{Le("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Ep(){Bt.on("onDocumentReady",e=>{Bt.emit("LifecycleEvent.onReady",{isLogin:!1}),P.mpType==="game"&&De.start(Date.now()-e)})}function mu(){Ep(),bp()}mu();
|
|
198
198
|
/*! Bundled license information:
|
|
199
199
|
|
|
200
200
|
localforage/dist/localforage.js:
|