@jolibox/implement 1.1.34 → 1.1.36-beta.1

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/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
- var fc=Object.create;var Vn=Object.defineProperty,hc=Object.defineProperties,pc=Object.getOwnPropertyDescriptor,mc=Object.getOwnPropertyDescriptors,vc=Object.getOwnPropertyNames,pr=Object.getOwnPropertySymbols,_c=Object.getPrototypeOf,Jn=Object.prototype.hasOwnProperty,Xo=Object.prototype.propertyIsEnumerable;var Yo=(e,t,r)=>t in e?Vn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W=(e,t)=>{for(var r in t||(t={}))Jn.call(t,r)&&Yo(e,r,t[r]);if(pr)for(var r of pr(t))Xo.call(t,r)&&Yo(e,r,t[r]);return e},me=(e,t)=>hc(e,mc(t));var Lt=(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 Zo=(e,t)=>{var r={};for(var n in e)Jn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pr)for(var n of pr(e))t.indexOf(n)<0&&Xo.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var $n=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var gc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of vc(t))!Jn.call(e,i)&&i!==r&&Vn(e,i,{get:()=>t[i],enumerable:!(n=pc(t,i))||n.enumerable});return e};var qn=(e,t,r)=>(r=e!=null?fc(_c(e)):{},gc(t||!e||!e.__esModule?Vn(r,"default",{value:e,enumerable:!0}):r,e));var U=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function Tc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Zn(e){return typeof e=="string"}function sa(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function la(e){return typeof e=="object"&&Array.isArray(e)}function kc(e){return typeof e=="undefined"}function xc(e){return kc(e)||e===null}function Cc(e){return typeof e=="function"}function ua(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function ca(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:ra(u)&&ra(s)?i[a]=n(oa({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function ra(e){return e&&typeof e=="object"&&e.constructor===Object}function da(e,t){if(Array.isArray(e))return e.concat(t)}function Ft(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...p){i=p,o=this;let v=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!v&&d()},t),v)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function Dc(e,t){return(...r)=>t(e,...r)}function va(e){return t=>Dc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new Pc(`${i}`))}})}function Ut(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function mr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Fc(e){let t=e.location?mr(e.location,ia):null,r=e.target?mr(e.target,ia):null;return mr(Ic(oa({},e),{location:t,target:r}),Mc)}function ii(e){let t=e.events.map(n=>Fc(n)),r=mr(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 Qc(e){return new Promise(t=>ya(e)(t))}function ya(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Yc(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Bt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),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(Zn(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Cc(t)){try{if(e instanceof t)return}catch(r){}if(!xc(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[ba]:void 0}function rd(e){typeof globalThis!="undefined"&&(globalThis[ba]=e)}function Ce(){let e=td();if(e)return e;let t=new vr,r=new Yn,n={registerCommand(i,o,a){t.registerCommand({id:i,handler:o,metadata:a})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return rd(n),n}var Xn,yc,bc,wc,ea,Ec,Ac,ta,oa,Ic,Sc,aa,Rc,Oc,ei,ti,fa,ha,Pc,pa,ma,_r,ri,xe,Kn,Nc,ni,na,Lc,tt,dt,Uc,ia,Mc,Bc,ft,Hc,be,Vc,Jc,$c,_a,oi,ai,qc,Gc,ga,zn,ee,Kc,zc,Mt,Bt,Pe,Qn,Wc,Gn,Xc,jt,vr,Yn,ba,q=Z(()=>{"use strict";Xn=Object.defineProperty,yc=Object.defineProperties,bc=Object.getOwnPropertyDescriptor,wc=Object.getOwnPropertyDescriptors,ea=Object.getOwnPropertySymbols,Ec=Object.prototype.hasOwnProperty,Ac=Object.prototype.propertyIsEnumerable,ta=(e,t,r)=>t in e?Xn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,oa=(e,t)=>{for(var r in t||(t={}))Ec.call(t,r)&&ta(e,r,t[r]);if(ea)for(var r of ea(t))Ac.call(t,r)&&ta(e,r,t[r]);return e},Ic=(e,t)=>yc(e,wc(t)),Sc=(e,t)=>{for(var r in t)Xn(e,r,{get:t[r],enumerable:!0})},aa=(e,t,r,n)=>{for(var i=n>1?void 0:n?bc(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&Xn(t,r,i),i},Rc=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((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 i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,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}Oc=(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))(Oc||{}),ei=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}},ti=class extends ei{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},fa=class extends ei{constructor(){super(...arguments),this.kind="USER_ERROR"}},ha=class extends fa{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Pc=class extends fa{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))}},pa=class extends ti{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},ma=class extends ti{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},_r=class extends ei{constructor(e,t,r,n,i){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),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},ri=class extends ti{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};xe={log:Ut("log"),warn:Ut("warn"),info:Ut("info"),error:Ut("error"),debug:Ut("debug")};Object.assign(globalThis,{logger:xe});Kn=Symbol.for("Jolibox.canIUseMap"),Nc={};globalThis[Kn]||(globalThis[Kn]=Nc);ni={get config(){return globalThis[Kn]}},na=Symbol.for("Jolibox.canIUseMap.native"),Lc={};globalThis[na]||(globalThis[na]=Lc);tt=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(tt||{}),dt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(dt||{}),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||{}),ia=["name","params"],Mc=["name","type","location","target","extra","timestamp","userId"],Bc=["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)});jc();Hc=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),be={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")},Vc=()=>be.isiOS?"iOS":be.isAndroid?"Android":be.isMac?"Mac":be.isFacebook?"Facebook":"PC",Jc="device_id",$c="advertising_id",_a=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ft()),window.__joliboxLocalStorage__.getItem(e)),oi=()=>new URLSearchParams(window.location.search).get("deviceId")||_a(Jc),ai=()=>new URLSearchParams(window.location.search).get("advertisingId")||_a($c),qc=e=>e.charAt(0).toUpperCase()+e.slice(1),Gc=()=>{var e;let t=new URLSearchParams(window.location.search);return qc((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},ga=e=>{if(Hc())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Vc(),n=navigator.language,i=oi(),o=ai();return`${t} (${Gc()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},zn=class Wn{constructor(t){this.element=t,this.next=Wn.Undefined,this.prev=Wn.Undefined}};zn.Undefined=new zn(void 0);ee=zn,Kc=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},zc=0,Mt=class{constructor(e){this.value=e,this.id=zc++}},Bt=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 Mt&&(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,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Mt(t);return this._listeners?this._listeners instanceof Mt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,p,v,f;if(!this._disposed){if(this._listeners instanceof Mt)this._listeners.id===d.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 E=this._listeners.indexOf(d);E>=0&&(this._listeners.splice(E,1),this._size--,this._size===0&&((f=(v=this.options)==null?void 0:v.onDidRemoveLastListener)==null||f.call(v)))}}}}),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(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Mt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Bt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.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 Kc,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)}},Qn={};Sc(Qn,{None:()=>Wc,filter:()=>Yc,once:()=>ya,toPromise:()=>Qc});Wc=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Gn=Symbol.for("Jolibox.hostEmitter"),Xc=()=>{let e=new Pe;return globalThis[Gn]||(globalThis[Gn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Gn]},jt=Xc();vr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Bt,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 i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return Zc(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}};vr=aa([ua],vr);Yn=class{constructor(){this._onWillExecuteCommand=new Bt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Bt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new vr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Tc(3e4)),this._starActivation}executeCommand(e,...t){return Rc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Qn.toPromise(Qn.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}}};Yn=aa([ua],Yn);ba=Symbol.for("Jolibox.commands")});function Oe(e,t={}){si.emit("ERROR_REPORT",{error:e,options:t})}var si,rt,Qe=Z(()=>{"use strict";q();q();si=new Pe,rt=new Pe;Oe.debounce=Ft(Oe,50,{leading:!0})});var li,nd,wa,Ea,Aa=Z(()=>{"use strict";q();Qe();li=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(i){return{}}},nd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},wa=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:li(o),payloadJson:li(a),signature:li(s)}}else throw"joli_source is missing"}catch(r){return Oe(new pa(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ea=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=nd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var id,gr,Ia,ui=Z(()=>{"use strict";q();id="1.1.34",gr=()=>id,Ia=()=>{let e=gr();return`${ga(e)}`}});function ad(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var od,Sa,ci,Ra,oe,sd,N,we=Z(()=>{"use strict";q();Aa();ui();q();od={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:oi(),adId:ai(),pixelRatio:window.devicePixelRatio||1,platform:be.isAndroid?"android":be.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:gr()},schema:window.location.href,platform:be.isAndroid?"android":be.isiOS?"ios":"h5"},ci=(Sa=globalThis.joliboxJSCore)==null?void 0:Sa.env,oe=Object.assign({},(Ra=ci==null?void 0:ci())!=null?Ra:od);sd=()=>{var f,E,w,S,b,x,P,H,X,R,D;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?wa(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(w=(E=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?E:o.get("gameId"))!=null?w:"",s=(x=(b=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?x:n,u=!!((H=(P=e==null?void 0:e.testAdsMode)!=null?P:e==null?void 0:e.__testAdsMode)!=null?H:o.get("testAdsMode")==="true"),d=(D=(R=(X=e==null?void 0:e.joliboxEnv)!=null?X:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?D:"production",y=d==="staging",p=t==null?void 0:t.channel,v=e==null?void 0:e.__shouldInterupt;return{get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:gr()},get mpType(){var O,B;return(B=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,B;return(B=(O=oe.clientSessionId)!=null?O:s)!=null?B:n},get channel(){return p},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-1},get shouldInterupt(){return v},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 O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return ad("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":"jolibox"},get viewport(){var z,ne,ye;let O=(z=oe.deviceInfo.pixelRatio)!=null?z:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,K=(ye=oe.deviceInfo.navigationBarHeight)!=null?ye:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/O:20,navigationBarHeight:K!==void 0?K/O:10}},onEnvConfigChanged:O=>{ca(oe,O,da)},encodeJoliSourceQuery:O=>{var B,K;return t&&r?Ea(W(W({},e),O),(B=o.get("joliSource"))!=null?B:""):(K=o.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{v=!1}}},N=sd()});var di,ka,ld,ud,Ta,cd,xa=Z(()=>{"use strict";q();Qe();we();q();di=!1,ka=(e,t)=>e==null?!1:t in e,ld=e=>ka(e,"kind"),ud=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Ta=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=N.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:ud(e.name)},i=me(W({},n),{env:t.environment,isFromUser:r});r?rt.emit("GLOBAL_USER_ERROR",e,i):rt.emit("GLOBAL_ERROR",e,i)},cd=e=>ka(e,"kind")&&e.kind==="USER_ERROR";si.on("ERROR_REPORT",({error:e,options:t})=>{if(di)return;di=!0;let r=ld(e)&&e.raw?e.raw:e;try{let n=cd(e);Ta(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new ri(`${i}, origin error: ${r.message}`);xe.error(o),Ta(new ri(o.message),{environment:t.environment},!1)}finally{di=!1}})});var fi,hi=Z(()=>{"use strict";Qe();q();Qe();fi=e=>new ha(e)});function Ca(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Zo(d,["eventType"]),u=me(W({tag:n,eventType:a!=null?a:tt.Other},t),{extra:W({},s)});n=="globalJsError"?Oe(new ma(JSON.stringify(u))):e("systemLog",u,o)};return r.debounce=Ft(r,500,{leading:!0}),r}function Oa(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Ft(t,500,{leading:!0}),t}var Pa=Z(()=>{"use strict";q();q();Qe()});function Da(e,t){let r=Ca(e,t),n=Oa(r);return{track:r,trackPerformance:n}}var Na=Z(()=>{"use strict";Pa()});var pi=Z(()=>{"use strict"});var yr,La=Z(()=>{"use strict";we();q();q();yr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return U(this,null,function*(){let r=`${N.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,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=N.sdkInfo;return{platform:1e3,os:N.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=N.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=N.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=N.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:N.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return U(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[me(W({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(ii(d),n):yield this.doReport(ii(d))}catch(y){xe.log("[Jolibox SDK] report API error",y)}})}}});var mi=Z(()=>{"use strict";Na();pi();La()});var vi,Ua,Fe,br,je,Ht=Z(()=>{"use strict";ui();we();q();vi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Ua=AbortSignal.timeout)!=null||(AbortSignal.timeout=vi);Fe=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 br(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},br=class{constructor(t){this.xua=Ia();this.getJoliSource=()=>N.joliSource;var n;let r=N.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 U(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let p=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:vi(i!=null?i:3e4)});return Fe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,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}:{},{"x-os-type":be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let v=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:vi(o!=null?o:3e4),credentials:"include"});Fe.getInstance().recordNetworkRequest(!0);let f=v.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return v.blob()}catch(E){return yield v.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return v.formData()}catch(E){return yield v.text()}if(f!=null&&f.includes("application/json"))try{return yield v.json()}catch(E){return yield v.text()}return v}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,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 v=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!v.ok)throw Fe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${v.status}`);return Fe.getInstance().recordNetworkRequest(!0),yield v.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=br;je=Fe.getInstance()});var _i,wr,gi=Z(()=>{"use strict";we();mi();Ht();_i=class extends yr{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,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=N.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},wr=new _i});var dd,Ma=Z(()=>{"use strict";xa();q();hi();q();gi();we();dd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:tt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:null};wr.trackEvent(n,dt.WebSDK)};rt.on("GLOBAL_ERROR",(e,t)=>{dd(t.tag,e)});rt.on("GLOBAL_USER_ERROR",(e,t)=>{xe.log("UserError",e,t)})});var Er,Ba=Z(()=>{"use strict";Er=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,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),E=f-r;E>=this.interval&&(this.visible&&(a+=Math.min(E,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{p(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},p=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let v=this.visible;return{start(){o||(o=!0,v?d():u())},stop(){o=!1,y(),p()}}}}});var Ar,Fa=Z(()=>{"use strict";we();Ba();Ht();Ar=class extends Er{constructor(r,n,i){super(n,i);this.httpClient=je.create();this.gameId=N.mpId,this.sessionId=N.sessionId,this.track=r}reporter(r){return U(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:W({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var ja,fd,De,hd,yi,nt,it=Z(()=>{"use strict";Ma();q();q();mi();gi();Fa();we();pi();ja=Ce(),fd={type:dt.WebSDK,platform:"h5",jssdk_version:N.sdkInfo.jssdkVersion,mp_id:N.mpId,mp_version:N.mpVersion},{track:De,trackPerformance:hd}=Da((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=sa(r.extra)?r.extra:Zn(r.extra)?JSON.parse(r.extra):{},i=me(W({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:tt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=N.hostUserInfo)==null?void 0:u.uid)!=null?d:null};wr.trackEvent(o,dt.WebSDK)},fd);ja.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{hd(e,t,r)});ja.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{De(e,t)});yi=new Pe,nt=new Ar(De,yi)});function Ha(e){let t=ni.config[e];return t||(t={},ni.config[e]=t),(r,n)=>{if(t[r]){xe.warn(`[can i use] ${r} already registered`);return}t[r]=W({},n)}}var Va=Z(()=>{"use strict";q()});function bi(e){Ja=e}function Ir(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Ir(t)):Object.keys(e).reduce((t,r)=>(t[r]=Ir(e[r]),t),{})}function He(e){return typeof e=="number"}function wi(e){let t=Ei(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Ei(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ja,ue,Sr,Rr,Tr,kr,ht,xr,Cr,Or,Pr,Dr,Nr,Lr,Ur,Mr,Br,Fr,jr,Ai=Z(()=>{"use strict";Ja=!1;ue=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ja)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 ${wi(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Ir(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Ir(this._default)}optional(){return this._optional=!0,this}};Sr=class extends ue{validate(t){return this._optional&&t===void 0?!0:He(t)?He(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):He(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):He(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}},Rr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Tr=class extends ue{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(He(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(He(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}},kr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ht=class extends ue{validate(t){return!0}},xr=class extends ue{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Cr=class extends ue{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Or=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Pr=class extends ue{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 ${wi(t)}`)}return!0}},Dr=class extends ue{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(He(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(He(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(He(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 i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}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}},Nr=class extends ue{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ei(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Lr=class extends ue{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ei(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},Ur=class extends ue{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:wi(this.value),actual:r}):!0}},Mr=class extends ue{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
2
- or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let i=t[n];if(i._optional||i.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,i)=>{if(n.path=`${this.path}[${i}]`,n.errors=this.errors,t[i]===void 0&&n.hasDefault){t[i]=n.defaultValue;return}n.validate(t[i])||(n.hasFallback?t[i]=n._fallback:r=!1)}),r}},Fr=class extends ue{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},jr=class extends ue{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 Ii(e,t,r="param"){if(e.errors=[],e.path=r,bi(!0),!e.validate(t)){let n=e.errors.join(`
3
- `);throw e.errors.length=0,bi(!1),new TypeError(n)}}var F,Si=Z(()=>{"use strict";Ai();Ai();F={object(e){return new Lr(e)},array(e){return new Dr(e)},tuple(...e){return new Br(...e)},literal(e){return new Ur(e)},or(...e){return new Mr(...e)},symbol(){return new kr},record(e){return new Nr(e)},function(){return new Or},boolean(){return new Rr},string(){return new Tr},number(){return new Sr},undefined(){return new xr},null(){return new Cr},unknown(){return new ht},any(){return new ht},as(){return new ht},arraybuffer(){return new Fr},enum(...e){return new Pr(...e)},typedarray(e){return new jr(e)}}});var Hr,$a,qa=Z(()=>{"use strict";q();Qe();Si();hi();Hr=1,$a=e=>{function t(n,i){return(...o)=>{var p,v,f,E;let a=Date.now(),s={method:n,trace_id:Hr};Hr+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Ii(i.paramsSchema,o,"params")}catch(x){throw fi(`${n}:fail ${x.message}`)}let w=i.implement(...o),S=w,b=`${n}:ok`;if(w&&"code"in w){let{code:x,data:P,message:H}=w;u=x,S=P,b=H}return{code:u,message:b,data:S}}catch(w){let S=w;y=(v=(p=S.code)!=null?p:S.errNo)!=null?v:2e3,u="FAILURE";let b=(E=(f=S.message)!=null?f:S.errMsg)!=null?E:`${w}`;return d=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Oe(new _r(d,y)),{code:u,message:d}}finally{let w=Date.now()-a;e("apiInvoked",me(W({},s),{duration:w,status:u}))}}}function r(n,i){return(...o)=>U(this,null,function*(){var v,f,E,w;let a=la(o)?o:[o],s=Date.now(),u={method:n,trace_id:Hr};Hr+=1;let d=`${n}:ok`,y="SUCCESS",p={code:y,message:d};try{if(i.paramsSchema)try{Ii(i.paramsSchema,a,"params")}catch(x){throw fi(x.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:x,data:P,message:H}=b;y=x,d=H,b=P}return Object.assign(p,{code:y,message:d,data:b}),p}catch(S){let b=S,x=(f=(v=b.code)!=null?v:b.errNo)!=null?f:2e3;y="FAILURE";let P=(w=(E=b.message)!=null?E:b.errMsg)!=null?w:`${S}`,H=`${n}:${y} ${P.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(p,{code:y,message:H}),Oe(new _r(H,x)),p}finally{let S=Date.now()-s;e("apiInvoked",me(W({},u),{duration:S,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Ve,ot,ve,Vt=Z(()=>{"use strict";Va();it();qa();Si();({createAPI:Ve,createSyncAPI:ot}=$a(De)),ve=Ha("h5")});var Wa=$n((za,xi)=>{(function(e){if(typeof za=="object"&&typeof xi!="undefined")xi.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(i,o,a){function s(y,p){if(!o[y]){if(!i[y]){var v=typeof Lt=="function"&&Lt;if(!p&&v)return v(y,!0);if(u)return u(y,!0);var f=new Error("Cannot find module '"+y+"'");throw f.code="MODULE_NOT_FOUND",f}var E=o[y]={exports:{}};i[y][0].call(E.exports,function(w){var S=i[y][1][w];return s(S||w)},E,E.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Lt=="function"&&Lt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(w),p=a.document.createTextNode("");y.observe(p,{characterData:!0}),u=function(){p.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var v=new a.MessageChannel;v.port1.onmessage=w,u=function(){v.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){w(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:u=function(){setTimeout(w,0)};var f,E=[];function w(){f=!0;for(var b,x,P=E.length;P;){for(x=E,E=[],b=-1;++b<P;)x[b]();P=E.length}f=!1}i.exports=S;function S(b){E.push(b)===1&&!f&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],p=["PENDING"];i.exports=v;function v(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,R!==s&&S(this,R)}v.prototype.catch=function(R){return this.then(null,R)},v.prototype.then=function(R,D){if(typeof R!="function"&&this.state===y||typeof D!="function"&&this.state===d)return this;var O=new this.constructor(s);if(this.state!==p){var B=this.state===y?R:D;E(O,B,this.outcome)}else this.queue.push(new f(O,R,D));return O};function f(R,D,O){this.promise=R,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(R){u.resolve(this.promise,R)},f.prototype.otherCallFulfilled=function(R){E(this.promise,this.onFulfilled,R)},f.prototype.callRejected=function(R){u.reject(this.promise,R)},f.prototype.otherCallRejected=function(R){E(this.promise,this.onRejected,R)};function E(R,D,O){a(function(){var B;try{B=D(O)}catch(K){return u.reject(R,K)}B===R?u.reject(R,new TypeError("Cannot resolve promise with itself")):u.resolve(R,B)})}u.resolve=function(R,D){var O=b(w,D);if(O.status==="error")return u.reject(R,O.value);var B=O.value;if(B)S(R,B);else{R.state=y,R.outcome=D;for(var K=-1,z=R.queue.length;++K<z;)R.queue[K].callFulfilled(D)}return R},u.reject=function(R,D){R.state=d,R.outcome=D;for(var O=-1,B=R.queue.length;++O<B;)R.queue[O].callRejected(D);return R};function w(R){var D=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof D=="function")return function(){D.apply(R,arguments)}}function S(R,D){var O=!1;function B(ye){O||(O=!0,u.reject(R,ye))}function K(ye){O||(O=!0,u.resolve(R,ye))}function z(){D(K,B)}var ne=b(z);ne.status==="error"&&B(ne.value)}function b(R,D){var O={};try{O.value=R(D),O.status="success"}catch(B){O.status="error",O.value=B}return O}v.resolve=x;function x(R){return R instanceof this?R:u.resolve(new this(s),R)}v.reject=P;function P(R){var D=new this(s);return u.reject(D,R)}v.all=H;function H(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var K=new Array(O),z=0,ne=-1,ye=new this(s);++ne<O;)Me(R[ne],ne);return ye;function Me(Pt,dr){D.resolve(Pt).then(Pn,function(ut){B||(B=!0,u.reject(ye,ut))});function Pn(ut){K[dr]=ut,++z===O&&!B&&(B=!0,u.resolve(ye,K))}}}v.race=X;function X(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var K=-1,z=new this(s);++K<O;)ne(R[K]);return z;function ne(ye){D.resolve(ye).then(function(Me){B||(B=!0,u.resolve(z,Me))},function(Me){B||(B=!0,u.reject(z,Me))})}}},{1:1}],3:[function(n,i,o){(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,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}function u(){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(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),h=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||h)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function p(l,h){l=l||[],h=h||{};try{return new Blob(l,h)}catch(m){if(m.name!=="TypeError")throw m;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new c,g=0;g<l.length;g+=1)_.append(l[g]);return _.getBlob(h.type)}}typeof Promise=="undefined"&&n(3);var v=Promise;function f(l,h){h&&l.then(function(c){h(null,c)},function(c){h(c)})}function E(l,h,c){typeof h=="function"&&l.then(h),typeof c=="function"&&l.catch(c)}function w(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function S(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",x=void 0,P={},H=Object.prototype.toString,X="readonly",R="readwrite";function D(l){for(var h=l.length,c=new ArrayBuffer(h),_=new Uint8Array(c),g=0;g<h;g++)_[g]=l.charCodeAt(g);return c}function O(l){return new v(function(h){var c=l.transaction(b,R),_=p([""]);c.objectStore(b).put(_,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),h(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),m=navigator.userAgent.match(/Edge\//);h(m||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function B(l){return typeof x=="boolean"?v.resolve(x):O(l).then(function(h){return x=h,x})}function K(l){var h=P[l.name],c={};c.promise=new v(function(_,g){c.resolve=_,c.reject=g}),h.deferredOperations.push(c),h.dbReady?h.dbReady=h.dbReady.then(function(){return c.promise}):h.dbReady=c.promise}function z(l){var h=P[l.name],c=h.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ne(l,h){var c=P[l.name],_=c.deferredOperations.pop();if(_)return _.reject(h),_.promise}function ye(l,h){return new v(function(c,_){if(P[l.name]=P[l.name]||Oo(),l.db)if(h)K(l),l.db.close();else return c(l.db);var g=[l.name];h&&g.push(l.version);var m=d.open.apply(d,g);h&&(m.onupgradeneeded=function(A){var I=m.result;try{I.createObjectStore(l.storeName),A.oldVersion<=1&&I.createObjectStore(b)}catch(T){if(T.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+A.oldVersion+" to version "+A.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw T}}),m.onerror=function(A){A.preventDefault(),_(m.error)},m.onsuccess=function(){var A=m.result;A.onversionchange=function(I){I.target.close()},c(A),z(l)}})}function Me(l){return ye(l,!1)}function Pt(l){return ye(l,!0)}function dr(l,h){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),_=l.version<l.db.version,g=l.version>l.db.version;if(_&&(l.version!==h&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var m=l.db.version+1;m>l.version&&(l.version=m)}return!0}return!1}function Pn(l){return new v(function(h,c){var _=new FileReader;_.onerror=c,_.onloadend=function(g){var m=btoa(g.target.result||"");h({__local_forage_encoded_blob:!0,data:m,type:l.type})},_.readAsBinaryString(l)})}function ut(l){var h=D(atob(l.data));return p([h],{type:l.type})}function Co(l){return l&&l.__local_forage_encoded_blob}function hu(l){var h=this,c=h._initReady().then(function(){var _=P[h._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return E(c,l,l),c}function pu(l){K(l);for(var h=P[l.name],c=h.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,Me(l).then(function(m){return l.db=m,dr(l)?Pt(l):m}).then(function(m){l.db=h.db=m;for(var A=0;A<c.length;A++)c[A]._dbInfo.db=m}).catch(function(m){throw ne(l,m),m})}function Be(l,h,c,_){_===void 0&&(_=1);try{var g=l.db.transaction(l.storeName,h);c(null,g)}catch(m){if(_>0&&(!l.db||m.name==="InvalidStateError"||m.name==="NotFoundError"))return v.resolve().then(function(){if(!l.db||m.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Pt(l)}).then(function(){return pu(l).then(function(){Be(l,h,c,_-1)})}).catch(c);c(m)}}function Oo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function mu(l){var h=this,c={db:null};if(l)for(var _ in l)c[_]=l[_];var g=P[c.name];g||(g=Oo(),P[c.name]=g),g.forages.push(h),h._initReady||(h._initReady=h.ready,h.ready=hu);var m=[];function A(){return v.resolve()}for(var I=0;I<g.forages.length;I++){var T=g.forages[I];T!==h&&m.push(T._initReady().catch(A))}var k=g.forages.slice(0);return v.all(m).then(function(){return c.db=g.db,Me(c)}).then(function(C){return c.db=C,dr(c,h._defaultConfig.version)?Pt(c):C}).then(function(C){c.db=g.db=C,h._dbInfo=c;for(var L=0;L<k.length;L++){var j=k[L];j!==h&&(j._dbInfo.db=c.db,j._dbInfo.version=c.version)}})}function vu(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){Be(c._dbInfo,X,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=T.get(l);k.onsuccess=function(){var C=k.result;C===void 0&&(C=null),Co(C)&&(C=ut(C)),g(C)},k.onerror=function(){m(k.error)}}catch(C){m(C)}})}).catch(m)});return f(_,h),_}function _u(l,h){var c=this,_=new v(function(g,m){c.ready().then(function(){Be(c._dbInfo,X,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=T.openCursor(),C=1;k.onsuccess=function(){var L=k.result;if(L){var j=L.value;Co(j)&&(j=ut(j));var $=l(j,L.key,C++);$!==void 0?g($):L.continue()}else g()},k.onerror=function(){m(k.error)}}catch(L){m(L)}})}).catch(m)});return f(_,h),_}function gu(l,h,c){var _=this;l=w(l);var g=new v(function(m,A){var I;_.ready().then(function(){return I=_._dbInfo,H.call(h)==="[object Blob]"?B(I.db).then(function(T){return T?h:Pn(h)}):h}).then(function(T){Be(_._dbInfo,R,function(k,C){if(k)return A(k);try{var L=C.objectStore(_._dbInfo.storeName);T===null&&(T=void 0);var j=L.put(T,l);C.oncomplete=function(){T===void 0&&(T=null),m(T)},C.onabort=C.onerror=function(){var $=j.error?j.error:j.transaction.error;A($)}}catch($){A($)}})}).catch(A)});return f(g,c),g}function yu(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){Be(c._dbInfo,R,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=T.delete(l);I.oncomplete=function(){g()},I.onerror=function(){m(k.error)},I.onabort=function(){var C=k.error?k.error:k.transaction.error;m(C)}}catch(C){m(C)}})}).catch(m)});return f(_,h),_}function bu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){Be(h._dbInfo,R,function(m,A){if(m)return g(m);try{var I=A.objectStore(h._dbInfo.storeName),T=I.clear();A.oncomplete=function(){_()},A.onabort=A.onerror=function(){var k=T.error?T.error:T.transaction.error;g(k)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function wu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){Be(h._dbInfo,X,function(m,A){if(m)return g(m);try{var I=A.objectStore(h._dbInfo.storeName),T=I.count();T.onsuccess=function(){_(T.result)},T.onerror=function(){g(T.error)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function Eu(l,h){var c=this,_=new v(function(g,m){if(l<0){g(null);return}c.ready().then(function(){Be(c._dbInfo,X,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=!1,C=T.openKeyCursor();C.onsuccess=function(){var L=C.result;if(!L){g(null);return}l===0||k?g(L.key):(k=!0,L.advance(l))},C.onerror=function(){m(C.error)}}catch(L){m(L)}})}).catch(m)});return f(_,h),_}function Au(l){var h=this,c=new v(function(_,g){h.ready().then(function(){Be(h._dbInfo,X,function(m,A){if(m)return g(m);try{var I=A.objectStore(h._dbInfo.storeName),T=I.openKeyCursor(),k=[];T.onsuccess=function(){var C=T.result;if(!C){_(k);return}k.push(C.key),C.continue()},T.onerror=function(){g(T.error)}}catch(C){g(C)}})}).catch(g)});return f(c,l),c}function Iu(l,h){h=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;if(!l.name)g=v.reject("Invalid arguments");else{var m=l.name===c.name&&_._dbInfo.db,A=m?v.resolve(_._dbInfo.db):Me(l).then(function(I){var T=P[l.name],k=T.forages;T.db=I;for(var C=0;C<k.length;C++)k[C]._dbInfo.db=I;return I});l.storeName?g=A.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var T=I.version+1;K(l);var k=P[l.name],C=k.forages;I.close();for(var L=0;L<C.length;L++){var j=C[L];j._dbInfo.db=null,j._dbInfo.version=T}var $=new v(function(G,le){var ie=d.open(l.name,T);ie.onerror=function(ke){var Nt=ie.result;Nt.close(),le(ke)},ie.onupgradeneeded=function(){var ke=ie.result;ke.deleteObjectStore(l.storeName)},ie.onsuccess=function(){var ke=ie.result;ke.close(),G(ke)}});return $.then(function(G){k.db=G;for(var le=0;le<C.length;le++){var ie=C[le];ie._dbInfo.db=G,z(ie._dbInfo)}}).catch(function(G){throw(ne(l,G)||v.resolve()).catch(function(){}),G})}}):g=A.then(function(I){K(l);var T=P[l.name],k=T.forages;I.close();for(var C=0;C<k.length;C++){var L=k[C];L._dbInfo.db=null}var j=new v(function($,G){var le=d.deleteDatabase(l.name);le.onerror=function(){var ie=le.result;ie&&ie.close(),G(le.error)},le.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},le.onsuccess=function(){var ie=le.result;ie&&ie.close(),$(ie)}});return j.then(function($){T.db=$;for(var G=0;G<k.length;G++){var le=k[G];z(le._dbInfo)}}).catch(function($){throw(ne(l,$)||v.resolve()).catch(function(){}),$})})}return f(g,h),g}var Su={_driver:"asyncStorage",_initStorage:mu,_support:y(),iterate:_u,getItem:vu,setItem:gu,removeItem:yu,clear:bu,length:wu,key:Eu,keys:Au,dropInstance:Iu};function Ru(){return typeof openDatabase=="function"}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Tu="~~local_forage_type~",Po=/^~~local_forage_type~([^~]+)~/,fr="__lfsc__:",Dn=fr.length,Nn="arbf",Ln="blob",Do="si08",No="ui08",Lo="uic8",Uo="si16",Mo="si32",Bo="ur16",Fo="ui32",jo="fl32",Ho="fl64",Vo=Dn+Nn.length,Jo=Object.prototype.toString;function $o(l){var h=l.length*.75,c=l.length,_,g=0,m,A,I,T;l[l.length-1]==="="&&(h--,l[l.length-2]==="="&&h--);var k=new ArrayBuffer(h),C=new Uint8Array(k);for(_=0;_<c;_+=4)m=ze.indexOf(l[_]),A=ze.indexOf(l[_+1]),I=ze.indexOf(l[_+2]),T=ze.indexOf(l[_+3]),C[g++]=m<<2|A>>4,C[g++]=(A&15)<<4|I>>2,C[g++]=(I&3)<<6|T&63;return k}function Un(l){var h=new Uint8Array(l),c="",_;for(_=0;_<h.length;_+=3)c+=ze[h[_]>>2],c+=ze[(h[_]&3)<<4|h[_+1]>>4],c+=ze[(h[_+1]&15)<<2|h[_+2]>>6],c+=ze[h[_+2]&63];return h.length%3===2?c=c.substring(0,c.length-1)+"=":h.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function ku(l,h){var c="";if(l&&(c=Jo.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&Jo.call(l.buffer)==="[object ArrayBuffer]")){var _,g=fr;l instanceof ArrayBuffer?(_=l,g+=Nn):(_=l.buffer,c==="[object Int8Array]"?g+=Do:c==="[object Uint8Array]"?g+=No:c==="[object Uint8ClampedArray]"?g+=Lo:c==="[object Int16Array]"?g+=Uo:c==="[object Uint16Array]"?g+=Bo:c==="[object Int32Array]"?g+=Mo:c==="[object Uint32Array]"?g+=Fo:c==="[object Float32Array]"?g+=jo:c==="[object Float64Array]"?g+=Ho:h(new Error("Failed to get type for BinaryArray"))),h(g+Un(_))}else if(c==="[object Blob]"){var m=new FileReader;m.onload=function(){var A=Tu+l.type+"~"+Un(this.result);h(fr+Ln+A)},m.readAsArrayBuffer(l)}else try{h(JSON.stringify(l))}catch(A){console.error("Couldn't convert value into a JSON string: ",l),h(null,A)}}function xu(l){if(l.substring(0,Dn)!==fr)return JSON.parse(l);var h=l.substring(Vo),c=l.substring(Dn,Vo),_;if(c===Ln&&Po.test(h)){var g=h.match(Po);_=g[1],h=h.substring(g[0].length)}var m=$o(h);switch(c){case Nn:return m;case Ln:return p([m],{type:_});case Do:return new Int8Array(m);case No:return new Uint8Array(m);case Lo:return new Uint8ClampedArray(m);case Uo:return new Int16Array(m);case Bo:return new Uint16Array(m);case Mo:return new Int32Array(m);case Fo:return new Uint32Array(m);case jo:return new Float32Array(m);case Ho:return new Float64Array(m);default:throw new Error("Unkown type: "+c)}}var Mn={serialize:ku,deserialize:xu,stringToBuffer:$o,bufferToString:Un};function qo(l,h,c,_){l.executeSql("CREATE TABLE IF NOT EXISTS "+h.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function Cu(l){var h=this,c={db:null};if(l)for(var _ in l)c[_]=typeof l[_]!="string"?l[_].toString():l[_];var g=new v(function(m,A){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return A(I)}c.db.transaction(function(I){qo(I,c,function(){h._dbInfo=c,m()},function(T,k){A(k)})},A)});return c.serializer=Mn,g}function We(l,h,c,_,g,m){l.executeSql(c,_,g,function(A,I){I.code===I.SYNTAX_ERR?A.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[h.storeName],function(T,k){k.rows.length?m(T,I):qo(T,h,function(){T.executeSql(c,_,g,m)},m)},m):m(A,I)},m)}function Ou(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"SELECT * FROM "+A.storeName+" WHERE key = ? LIMIT 1",[l],function(T,k){var C=k.rows.length?k.rows.item(0).value:null;C&&(C=A.serializer.deserialize(C)),g(C)},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Pu(l,h){var c=this,_=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"SELECT * FROM "+A.storeName,[],function(T,k){for(var C=k.rows,L=C.length,j=0;j<L;j++){var $=C.item(j),G=$.value;if(G&&(G=A.serializer.deserialize(G)),G=l(G,$.key,j+1),G!==void 0){g(G);return}}g()},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Go(l,h,c,_){var g=this;l=w(l);var m=new v(function(A,I){g.ready().then(function(){h===void 0&&(h=null);var T=h,k=g._dbInfo;k.serializer.serialize(h,function(C,L){L?I(L):k.db.transaction(function(j){We(j,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[l,C],function(){A(T)},function($,G){I(G)})},function(j){if(j.code===j.QUOTA_ERR){if(_>0){A(Go.apply(g,[l,T,c,_-1]));return}I(j)}})})}).catch(I)});return f(m,c),m}function Du(l,h,c){return Go.apply(this,[l,h,c,1])}function Nu(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"DELETE FROM "+A.storeName+" WHERE key = ?",[l],function(){g()},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Lu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var m=h._dbInfo;m.db.transaction(function(A){We(A,m,"DELETE FROM "+m.storeName,[],function(){_()},function(I,T){g(T)})})}).catch(g)});return f(c,l),c}function Uu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var m=h._dbInfo;m.db.transaction(function(A){We(A,m,"SELECT COUNT(key) as c FROM "+m.storeName,[],function(I,T){var k=T.rows.item(0).c;_(k)},function(I,T){g(T)})})}).catch(g)});return f(c,l),c}function Mu(l,h){var c=this,_=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"SELECT key FROM "+A.storeName+" WHERE id = ? LIMIT 1",[l+1],function(T,k){var C=k.rows.length?k.rows.item(0).key:null;g(C)},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Bu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var m=h._dbInfo;m.db.transaction(function(A){We(A,m,"SELECT key FROM "+m.storeName,[],function(I,T){for(var k=[],C=0;C<T.rows.length;C++)k.push(T.rows.item(C).key);_(k)},function(I,T){g(T)})})}).catch(g)});return f(c,l),c}function Fu(l){return new v(function(h,c){l.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,m){for(var A=[],I=0;I<m.rows.length;I++)A.push(m.rows.item(I).name);h({db:l,storeNames:A})},function(g,m){c(m)})},function(_){c(_)})})}function ju(l,h){h=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;return l.name?g=new v(function(m){var A;l.name===c.name?A=_._dbInfo.db:A=openDatabase(l.name,"","",0),l.storeName?m({db:A,storeNames:[l.storeName]}):m(Fu(A))}).then(function(m){return new v(function(A,I){m.db.transaction(function(T){function k($){return new v(function(G,le){T.executeSql("DROP TABLE IF EXISTS "+$,[],function(){G()},function(ie,ke){le(ke)})})}for(var C=[],L=0,j=m.storeNames.length;L<j;L++)C.push(k(m.storeNames[L]));v.all(C).then(function(){A()}).catch(function($){I($)})},function(T){I(T)})})}):g=v.reject("Invalid arguments"),f(g,h),g}var Hu={_driver:"webSQLStorage",_initStorage:Cu,_support:Ru(),iterate:Pu,getItem:Ou,setItem:Du,removeItem:Nu,clear:Lu,length:Uu,key:Mu,keys:Bu,dropInstance:ju};function Vu(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function Ko(l,h){var c=l.name+"/";return l.storeName!==h.storeName&&(c+=l.storeName+"/"),c}function Ju(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(h){return!0}}function $u(){return!Ju()||localStorage.length>0}function qu(l){var h=this,c={};if(l)for(var _ in l)c[_]=l[_];return c.keyPrefix=Ko(l,h._defaultConfig),$u()?(h._dbInfo=c,c.serializer=Mn,v.resolve()):v.reject()}function Gu(l){var h=this,c=h.ready().then(function(){for(var _=h._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var m=localStorage.key(g);m.indexOf(_)===0&&localStorage.removeItem(m)}});return f(c,l),c}function Ku(l,h){var c=this;l=w(l);var _=c.ready().then(function(){var g=c._dbInfo,m=localStorage.getItem(g.keyPrefix+l);return m&&(m=g.serializer.deserialize(m)),m});return f(_,h),_}function zu(l,h){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,m=g.keyPrefix,A=m.length,I=localStorage.length,T=1,k=0;k<I;k++){var C=localStorage.key(k);if(C.indexOf(m)===0){var L=localStorage.getItem(C);if(L&&(L=g.serializer.deserialize(L)),L=l(L,C.substring(A),T++),L!==void 0)return L}}});return f(_,h),_}function Wu(l,h){var c=this,_=c.ready().then(function(){var g=c._dbInfo,m;try{m=localStorage.key(l)}catch(A){m=null}return m&&(m=m.substring(g.keyPrefix.length)),m});return f(_,h),_}function Qu(l){var h=this,c=h.ready().then(function(){for(var _=h._dbInfo,g=localStorage.length,m=[],A=0;A<g;A++){var I=localStorage.key(A);I.indexOf(_.keyPrefix)===0&&m.push(I.substring(_.keyPrefix.length))}return m});return f(c,l),c}function Yu(l){var h=this,c=h.keys().then(function(_){return _.length});return f(c,l),c}function Xu(l,h){var c=this;l=w(l);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return f(_,h),_}function Zu(l,h,c){var _=this;l=w(l);var g=_.ready().then(function(){h===void 0&&(h=null);var m=h;return new v(function(A,I){var T=_._dbInfo;T.serializer.serialize(h,function(k,C){if(C)I(C);else try{localStorage.setItem(T.keyPrefix+l,k),A(m)}catch(L){(L.name==="QuotaExceededError"||L.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(L),I(L)}})})});return f(g,c),g}function ec(l,h){if(h=S.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var _=this,g;return l.name?g=new v(function(m){l.storeName?m(Ko(l,_._defaultConfig)):m(l.name+"/")}).then(function(m){for(var A=localStorage.length-1;A>=0;A--){var I=localStorage.key(A);I.indexOf(m)===0&&localStorage.removeItem(I)}}):g=v.reject("Invalid arguments"),f(g,h),g}var tc={_driver:"localStorageWrapper",_initStorage:qu,_support:Vu(),iterate:zu,getItem:Ku,setItem:Zu,removeItem:Xu,clear:Gu,length:Yu,key:Wu,keys:Qu,dropInstance:ec},rc=function(h,c){return h===c||typeof h=="number"&&typeof c=="number"&&isNaN(h)&&isNaN(c)},nc=function(h,c){for(var _=h.length,g=0;g<_;){if(rc(h[g],c))return!0;g++}return!1},zo=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Dt={},Wo={},ct={INDEXEDDB:Su,WEBSQL:Hu,LOCALSTORAGE:tc},ic=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],hr=["dropInstance"],Bn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(hr),oc={description:"",driver:ic.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function ac(l,h){l[h]=function(){var c=arguments;return l.ready().then(function(){return l[h].apply(l,c)})}}function Fn(){for(var l=1;l<arguments.length;l++){var h=arguments[l];if(h)for(var c in h)h.hasOwnProperty(c)&&(zo(h[c])?arguments[0][c]=h[c].slice():arguments[0][c]=h[c])}return arguments[0]}var sc=function(){function l(h){s(this,l);for(var c in ct)if(ct.hasOwnProperty(c)){var _=ct[c],g=_._driver;this[c]=g,Dt[g]||this.defineDriver(_)}this._defaultConfig=Fn({},oc),this._config=Fn({},this._defaultConfig,h),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in c){if(_==="storeName"&&(c[_]=c[_].replace(/\W/g,"_")),_==="version"&&typeof c[_]!="number")return new Error("Database version must be a number.");this._config[_]=c[_]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,_,g){var m=new v(function(A,I){try{var T=c._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(k);return}for(var C=Bn.concat("_initStorage"),L=0,j=C.length;L<j;L++){var $=C[L],G=!nc(hr,$);if((G||c[$])&&typeof c[$]!="function"){I(k);return}}var le=function(){for(var Nt=function(cc){return function(){var dc=new Error("Method "+cc+" is not implemented by the current driver"),Qo=v.reject(dc);return f(Qo,arguments[arguments.length-1]),Qo}},jn=0,uc=hr.length;jn<uc;jn++){var Hn=hr[jn];c[Hn]||(c[Hn]=Nt(Hn))}};le();var ie=function(Nt){Dt[T]&&console.info("Redefining LocalForage driver: "+T),Dt[T]=c,Wo[T]=Nt,A()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,I):ie(!!c._support):ie(!0)}catch(ke){I(ke)}});return E(m,_,g),m},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,_,g){var m=Dt[c]?v.resolve(Dt[c]):v.reject(new Error("Driver not found."));return E(m,_,g),m},l.prototype.getSerializer=function(c){var _=v.resolve(Mn);return E(_,c),_},l.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return E(g,c,c),g},l.prototype.setDriver=function(c,_,g){var m=this;zo(c)||(c=[c]);var A=this._getSupportedDrivers(c);function I(){m._config.driver=m.driver()}function T(L){return m._extend(L),I(),m._ready=m._initStorage(m._config),m._ready}function k(L){return function(){var j=0;function $(){for(;j<L.length;){var G=L[j];return j++,m._dbInfo=null,m._ready=null,m.getDriver(G).then(T).catch($)}I();var le=new Error("No available storage method found.");return m._driverSet=v.reject(le),m._driverSet}return $()}}var C=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=C.then(function(){var L=A[0];return m._dbInfo=null,m._ready=null,m.getDriver(L).then(function(j){m._driver=j._driver,I(),m._wrapLibraryMethodsWithReady(),m._initDriver=k(A)})}).catch(function(){I();var L=new Error("No available storage method found.");return m._driverSet=v.reject(L),m._driverSet}),E(this._driverSet,_,g),this._driverSet},l.prototype.supports=function(c){return!!Wo[c]},l.prototype._extend=function(c){Fn(this,c)},l.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,m=c.length;g<m;g++){var A=c[g];this.supports(A)&&_.push(A)}return _},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=Bn.length;c<_;c++)ac(this,Bn[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),lc=new sc;i.exports=lc},{3:3}]},{},[4])(4)})});var Ya=$n(Gr=>{"use strict";q();Vt();it();var Oi=Ce(),Od=Ve("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>U(Gr,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;xe.info("onLevelFinished",r,n,i),yield Promise.all([nt.reporter({event:"COMPLETE_GAME_LEVEL"}),nt.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),Pd=Ve("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>U(Gr,null,function*(){let{duration:t,rating:r,score:n}=e;return xe.info("onGamePlayEnded",t,r,n),nt.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Dd=Ve("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>U(Gr,[r],function*({levelId:e,name:t}){return nt.tracker("LevelUpgrade",{name:t,levelId:e})})});Oi.registerCommand("TaskTrackerSDK.levelFinished",Od);Oi.registerCommand("TaskTrackerSDK.gamePlayEnded",Pd);Oi.registerCommand("TaskTrackerSDK.levelUpgrade",Dd);ve("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var mt,pt,Xa,Pi,Nd,Di,Ni=Z(()=>{"use strict";mt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},pt=new Map,Xa=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=pt.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},Pi=!1,Nd=()=>{Pi||(window.addEventListener("message",Xa),Pi=!0)},Di=(e,t)=>{Nd(),pt.has(e)||pt.set(e,new Set);let r=pt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&pt.delete(e),pt.size===0&&(window.removeEventListener("message",Xa),Pi=!1)}}});var _t,Kr,zr,Wr,Qr,Za,vt,Ld,fe,gt,at=Z(()=>{"use strict";q();_t="UNLOCK_OPTIONS_CHANGED",Kr="INVOKE_PAYMENT",zr="ON_PAYMENT_RESULT",Wr="ON_USE_MODAL_EVENT",Qr="ON_USE_MODAL_RESULT",Za="ON_USE_MODAL_FREQUENCY",vt=new Pe,Ld=()=>({on:vt.on.bind(vt),off:vt.off.bind(vt),emit:vt.emit.bind(vt)}),fe=Ld(),gt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});var Wl=$n(zl=>{"use strict";at();Ni();q();var Kl={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Di("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",Kl[e.result],e.result),fe.emit(Qr,{useModalResult:Kl[e.result]})});fe.on(Wr,(e,t)=>{var r;mt("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()})});Di("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{fe.emit(zr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});fe.on(Kr,(e,t)=>U(zl,null,function*(){var r;mt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})}))});it();we();Vt();q();var Ga=Ce(),md="env",vd="getSystemInfoSync",_d=()=>{var i,o,a,s;let e={system:N.deviceInfo.system,platform:N.deviceInfo.platform.toLowerCase(),brand:N.deviceInfo.brand,pixelRatio:N.deviceInfo.pixelRatio,language:N.deviceInfo.lang,version:N.sdkInfo.jssdkVersion,appName:(i=N.hostInfo)==null?void 0:i.appName,SDKVersion:N.sdkInfo.nativeSDKVersion},t=(o=N.hostInfo)==null?void 0:o.version;t&&(e=me(W({},e),{version:t}));let r=(a=N.hostInfo)==null?void 0:a.appName;r&&(e=me(W({},e),{appName:r}));let n=(s=N.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=me(W({},e),{SDKVersion:n})),e},gd=ot(vd,{implement:_d}),yd=ot(md,{implement:()=>me(W({},N.hostInfo),{sdkInfo:N.sdkInfo,platform:N.platform,deviceInfo:N.deviceInfo})});Ga.registerCommand("API.env",yd);Ga.registerCommand("API.getSystemInfoSync",gd);ve("env",{version:"1.0.0"});ve("getSystemInfoSync",{version:"1.0.0"});q();Vt();Qe();it();var bd="onJoliboxShow",wd="onJoliboxHide",Ed="onReady",Ti=Ce(),ki=va(Oe),Ri=!0,Jt=!0,Vr=0,Jr=yi;function Ad(){let e=Date.now();if(e-Vr<100)return;Vr=e;let t=document.visibilityState==="visible";t!==Ri&&(Ri=t,Jr.emit("visible",Ri))}function Ka(e){let t=Date.now();t-Vr<100||(Vr=t,e==="focus"&&!Jt?Jt=!0:e==="blur"&&Jt&&(Jt=!1),Jr.emit("visible",Jt))}document.addEventListener("visibilitychange",Ad);window.addEventListener("focus",()=>Ka("focus"));window.addEventListener("blur",()=>Ka("blur"));var Id=ot(bd,{paramsSchema:F.tuple(F.function()),implement(e){let t=ki(e);Jr.on("visible",r=>{r&&t()})}}),Sd=ot(wd,{paramsSchema:F.tuple(F.function()),implement(e){let t=ki(e);Jr.on("visible",r=>{!r&&t()})}}),Rd=ot(Ed,{paramsSchema:F.tuple(F.function()),implement(e){let t=ki(e);jt.on("LifecycleEvent.onReady",r=>{t(r)})}});Ti.registerCommand("LifecycleSDK.onReady",Rd);Ti.registerCommand("LifecycleSDK.onJoliboxShow",Id);Ti.registerCommand("LifecycleSDK.onJoliboxHide",Sd);ve("lifeCycle.onReady",{version:"1.0.0"});ve("lifeCycle.onJoliboxShow",{version:"1.0.0"});ve("lifeCycle.onJoliboxHide",{version:"1.0.0"});Vt();q();Ht();we();var Qa=qn(Wa());var $r=Ce(),Ci=class{constructor(){this.httpClient=je.create({baseUrl:N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>N.mpId;this.getItem=t=>U(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>U(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>U(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=()=>U(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=Qa.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},qr=new Ci,Td=Ve("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield qr.getItem(e)})}});$r.registerCommand("StorageSDK.getItem",Td);ve("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var kd=Ve("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return U(this,null,function*(){return yield qr.setItem(e,t)})}});$r.registerCommand("StorageSDK.setItem",kd);ve("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var xd=Ve("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield qr.removeItem(e)})}});$r.registerCommand("StorageSDK.removeItem",xd);ve("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Cd=Ve("clearStorage",{implement(){return U(this,null,function*(){return yield qr.clear()})}});$r.registerCommand("StorageSDK.clear",Cd);ve("storage.clear",{version:"1.0.0"});var $g=qn(Ya());it();q();Ht();Ni();we();at();var es=N.testMode;function ts(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return U(this,null,function*(){return yield i.reduce((s,u)=>U(this,null,function*(){let d=yield s;if(d===!0)return!0;es&&console.log(`handleReward ${u}`);let y=e.get(u),p=y?yield y(...o):d;return es&&console.log(`handleReward ${u} ${p}`),p}),Promise.resolve(!1))})},registerRewardsFetcher(i){return U(this,null,function*(){t=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return U(this,null,function*(){r=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:gt}}})})},getRewardsTypes(...i){return U(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return U(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:gt}})}}}at();var Ud=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,Md=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Ud()):["ADS"],rs=e=>{e.registerRewardsFetcher(t=>U(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;fe.emit(_t,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return Md(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},ns=e=>{e.registerRewardFrequencyConfigFetcher(t=>U(void 0,null,function*(){var n,i;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return fe.emit(Za,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||gt}),{joliCoinUseAndCharge:((i=r.data)==null?void 0:i.joliCoinUseAndCharge)||gt}}))};var is=e=>t=>U(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0});at();function st(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r)}}we();q();at();var os=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}));var Yr=(e,t)=>r=>U(void 0,null,function*(){let n=st(fe,zr);return fe.emit(Kr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),Xr=(e,t)=>r=>U(void 0,null,function*(){let n=st(fe,Qr);return fe.emit(Wr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var Zr=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:i,showUnlockWithJolicoinModal:o}})=>a=>U(void 0,null,function*(){var s,u,d,y,p,v,f;try{let E=!1,w=yield n.getData(),S=(d=(u=(s=w==null?void 0:w.options)==null?void 0:s.find(P=>P.type==="JOLI_COIN"))==null?void 0:u.joliCoinChoices[0].joliCoinQuantity)!=null?d:0;if(!os((w==null?void 0:w.options)||[],w==null?void 0:w.userJoliCoin)){if((yield i({userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:S}))!=="SUCCESS")return r==null||r(a),!1;E=!0}let b=!!((y=w==null?void 0:w.userJoliCoin)!=null&&y.enableAutoDeduct);if(!E&&(yield o({enableAutoDeduct:b,userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:S}))!=="CONFIRM")return r==null||r(a),!1;let x=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ft()}-${N.mpType}-${Date.now()}`,gameInfo:{gameId:N.mpId}}});return x.code=="SUCCESS"?((v=a.adBreakDone)==null||v.call(a,{breakType:a.type,breakName:"name"in a&&(p=a.name)!=null?p:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((f=a.adViewed)==null||f.call(a)),t==null||t({quantity:x.data.quantity,balance:x.data.balance}),!0):(r==null||r(a),!1)}catch(E){if(console.info("JolicoinRewardHandler error:",E),E instanceof Error&&E.message=="CANCEL")throw E;return r==null||r(a),!1}finally{n.clearCache()}});var as=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=()=>{r==null||r()},o=Xr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=Yr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"});return Zr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})};at();var ss=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},o=Xr("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=Yr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"});return Zr(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})};var Ye=ts();rs(Ye);ns(Ye);var nn,M,fs,Mi,lt,ls,hs,ps,ms,Bi,Li,Ui,Bd,$t={},vs=[],Fd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qt=Array.isArray;function Je(e,t){for(var r in t)e[r]=t[r];return e}function Fi(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Gt(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?nn.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return tn(e,a,n,i,null)}function tn(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++fs:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function Xe(e){return e.children}function Ie(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 _s(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 _s(e)}}function us(e){(!e.__d&&(e.__d=!0)&&lt.push(e)&&!rn.__r++||ls!==M.debounceRendering)&&((ls=M.debounceRendering)||hs)(rn)}function rn(){for(var e,t,r,n,i,o,a,s=1;lt.length;)lt.length>s&&lt.sort(ps),e=lt.shift(),s=lt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Je({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),ji(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?yt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,bs(o,r,a),r.__e!=i&&_s(r)));rn.__r=0}function gs(e,t,r,n,i,o,a,s,u,d,y){var p,v,f,E,w,S,b=n&&n.__k||vs,x=t.length;for(u=jd(r,t,b,u,x),p=0;p<x;p++)(f=r.__k[p])!=null&&(v=f.__i===-1?$t:b[f.__i]||$t,f.__i=p,S=ji(e,f,v,i,o,a,s,u,d,y),E=f.__e,f.ref&&v.ref!=f.ref&&(v.ref&&Hi(v.ref,null,f),y.push(f.ref,f.__c||E,f)),w==null&&E!=null&&(w=E),4&f.__u||v.__k===f.__k?u=ys(f,u,e):typeof f.type=="function"&&S!==void 0?u=S:E&&(u=E.nextSibling),f.__u&=-7);return r.__e=w,u}function jd(e,t,r,n,i){var o,a,s,u,d,y=r.length,p=y,v=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+v,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?tn(null,a,null,null,null):qt(a)?tn(Xe,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?tn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=Hd(a,r,u,p))!==-1&&(p--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?v--:i<y&&v++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?v--:d==u+1?v++:(d>u?v--:v++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=yt(s)),Es(s,s));return n}function ys(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=ys(n[i],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 Kt(e,t){return t=t||[],e==null||typeof e=="boolean"||(qt(e)?e.some(function(r){Kt(r,t)}):t.push(e)),t}function Hd(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}return-1}function cs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Fd.test(t)?r:r+"px"}function en(e,t,r,n,i){var o;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||cs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||cs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(ms,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+o]=r,r?n?r.t=n.t:(r.t=Bi,e.addEventListener(t,o?Ui:Li,o)):e.removeEventListener(t,o?Ui:Li,o);else{if(i=="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 ds(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Bi++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function ji(e,t,r,n,i,o,a,s,u,d){var y,p,v,f,E,w,S,b,x,P,H,X,R,D,O,B,K,z=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof z=="function")try{if(b=t.props,x="prototype"in z&&z.prototype.render,P=(y=z.contextType)&&n[y.__c],H=y?P?P.props.value:y.__:n,r.__c?S=(p=t.__c=r.__c).__=p.__E:(x?t.__c=p=new z(b,H):(t.__c=p=new Ie(b,H),p.constructor=z,p.render=Jd),P&&P.sub(p),p.props=b,p.state||(p.state={}),p.context=H,p.__n=n,v=p.__d=!0,p.__h=[],p._sb=[]),x&&p.__s==null&&(p.__s=p.state),x&&z.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Je({},p.__s)),Je(p.__s,z.getDerivedStateFromProps(b,p.__s))),f=p.props,E=p.state,p.__v=t,v)x&&z.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),x&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(x&&z.getDerivedStateFromProps==null&&b!==f&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(b,H),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(b,p.__s,H)===!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(ne){ne&&(ne.__=t)}),X=0;X<p._sb.length;X++)p.__h.push(p._sb[X]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(b,p.__s,H),x&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(f,E,w)})}if(p.context=H,p.props=b,p.__P=e,p.__e=!1,R=M.__r,D=0,x){for(p.state=p.__s,p.__d=!1,R&&R(t),y=p.render(p.props,p.state,p.context),O=0;O<p._sb.length;O++)p.__h.push(p._sb[O]);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&&++D<25);p.state=p.__s,p.getChildContext!=null&&(n=Je(Je({},n),p.getChildContext())),x&&!v&&p.getSnapshotBeforeUpdate!=null&&(w=p.getSnapshotBeforeUpdate(f,E)),B=y,y!=null&&y.type===Xe&&y.key==null&&(B=ws(y.props.children)),s=gs(e,qt(B)?B:[B],t,r,n,i,o,a,s,u,d),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),S&&(p.__E=p.__=null)}catch(ne){if(t.__v=null,u||o!=null)if(ne.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(K=o.length;K--;)Fi(o[K]);else t.__e=r.__e,t.__k=r.__k;M.__e(ne,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=Vd(r.__e,t,r,n,i,o,a,u,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function bs(e,t,r){for(var n=0;n<r.length;n++)Hi(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function ws(e){return typeof e!="object"||e==null?e:qt(e)?e.map(ws):Je({},e)}function Vd(e,t,r,n,i,o,a,s,u){var d,y,p,v,f,E,w,S=r.props,b=t.props,x=t.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(i,x,b.is&&b),s&&(M.__m&&M.__m(t,o),s=!1),o=null}if(x===null)S===b||s&&e.data===b||(e.data=b);else{if(o=o&&nn.call(e.childNodes),S=r.props||$t,!s&&o!=null)for(S={},d=0;d<e.attributes.length;d++)S[(f=e.attributes[d]).name]=f.value;for(d in S)if(f=S[d],d!="children"){if(d=="dangerouslySetInnerHTML")p=f;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;en(e,d,null,f,i)}}for(d in b)f=b[d],d=="children"?v=f:d=="dangerouslySetInnerHTML"?y=f:d=="value"?E=f:d=="checked"?w=f:s&&typeof f!="function"||S[d]===f||en(e,d,f,S[d],i);if(y)s||p&&(y.__html===p.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(p&&(e.innerHTML=""),gs(t.type==="template"?e.content:e,qt(v)?v:[v],t,r,n,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&yt(r,0),s,u),o!=null)for(d=o.length;d--;)Fi(o[d]);s||(d="value",x=="progress"&&E==null?e.removeAttribute("value"):E!==void 0&&(E!==e[d]||x=="progress"&&!E||x=="option"&&E!==S[d])&&en(e,d,E,S[d],i),d="checked",w!==void 0&&w!==e[d]&&en(e,d,w,S[d],i))}return e}function Hi(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(i){M.__e(i,r)}}function Es(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Hi(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Es(n[i],t,r||typeof e.type!="function");r||Fi(e.__e),e.__c=e.__=e.__e=void 0}function Jd(e,t,r){return this.constructor(e,r)}function As(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],ji(t,e=(!n&&r||t).__k=Gt(Xe,null,[e]),i||$t,$t,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?nn.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),bs(o,e,a)}nn=vs.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},fs=0,Mi=function(e){return e!=null&&e.constructor==null},Ie.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Je({},this.state),typeof e=="function"&&(e=e(Je({},r),this.props)),e&&Je(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),us(this))},Ie.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),us(this))},Ie.prototype.render=Xe,lt=[],hs=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ps=function(e,t){return e.__v.__b-t.__v.__b},rn.__r=0,ms=/(PointerCapture)$|Capture$/i,Bi=0,Li=ds(!1),Ui=ds(!0),Bd=0;var bt,re,Vi,Is,zt=0,Ps=[],ae=M,Ss=ae.__b,Rs=ae.__r,Ts=ae.diffed,ks=ae.__c,xs=ae.unmount,Cs=ae.__;function an(e,t){ae.__h&&ae.__h(re,e,zt||t),zt=0;var r=re.__H||(re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function sn(e){return zt=1,Ds(Ns,e)}function Ds(e,t,r){var n=an(bt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Ns(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=re,!re.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(v){return!!v.__c});if(y.every(function(v){return!v.__N}))return!o||o.call(this,s,u,d);var p=n.__c.props!==s;return y.forEach(function(v){if(v.__N){var f=v.__[0];v.__=v.__N,v.__N=void 0,f!==v.__[0]&&(p=!0)}}),o&&o.call(this,s,u,d)||p};re.__f=!0;var o=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},re.shouldComponentUpdate=i}return n.__N||n.__}function Wt(e,t){var r=an(bt++,3);!ae.__s&&Ki(r.__H,t)&&(r.__=e,r.u=t,re.__H.__h.push(r))}function $i(e,t){var r=an(bt++,4);!ae.__s&&Ki(r.__H,t)&&(r.__=e,r.u=t,re.__h.push(r))}function qi(e){return zt=5,Qt(function(){return{current:e}},[])}function Qt(e,t){var r=an(bt++,7);return Ki(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Gi(e,t){return zt=8,Qt(function(){return e},t)}function $d(){for(var e;e=Ps.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(on),e.__H.__h.forEach(Ji),e.__H.__h=[]}catch(t){e.__H.__h=[],ae.__e(t,e.__v)}}ae.__b=function(e){re=null,Ss&&Ss(e)},ae.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Cs&&Cs(e,t)},ae.__r=function(e){Rs&&Rs(e),bt=0;var t=(re=e.__c).__H;t&&(Vi===re?(t.__h=[],re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(on),t.__h.forEach(Ji),t.__h=[],bt=0)),Vi=re},ae.diffed=function(e){Ts&&Ts(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ps.push(t)!==1&&Is===ae.requestAnimationFrame||((Is=ae.requestAnimationFrame)||qd)($d)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Vi=re=null},ae.__c=function(e,t){t.some(function(r){try{r.__h.forEach(on),r.__h=r.__h.filter(function(n){return!n.__||Ji(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ae.__e(n,r.__v)}}),ks&&ks(e,t)},ae.unmount=function(e){xs&&xs(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{on(n)}catch(i){t=i}}),r.__H=void 0,t&&ae.__e(t,r.__v))};var Os=typeof requestAnimationFrame=="function";function qd(e){var t,r=function(){clearTimeout(n),Os&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Os&&(t=requestAnimationFrame(r))}function on(e){var t=re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),re=t}function Ji(e){var t=re;e.__c=e.__(),re=t}function Ki(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Ns(e,t){return typeof t=="function"?t(e):t}function Kd(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}(Us.prototype=new Ie).isPureReactComponent=!0,Us.prototype.shouldComponentUpdate=function(e,t){return Ls(this.props,e)||Ls(this.state,t)};var Ms=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Ms&&Ms(e)};var ng=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var zd=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}zd(e,t,r,n)};var Bs=M.unmount;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=Kd({},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 zi(){this.__u=0,this.o=null,this.__b=null}function Ks(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function ln(){this.i=null,this.l=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Bs&&Bs(e)},(zi.prototype=new Ie).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=Ks(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=Gs(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},zi.prototype.componentWillUnmount=function(){this.o=[]},zi.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 i=t.__a&&Gt(Xe,null,e.fallback);return i&&(i.__u&=-33),[Gt(Xe,null,t.__a?null:e.children),i]};var 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]}};(ln.prototype=new Ie).__a=function(e){var t=this,r=Ks(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Fs(t,e,n)):i()};r?r(o):o()}},ln.prototype.render=function(e){this.i=null,this.l=new Map;var t=Kt(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},ln.prototype.componentDidUpdate=ln.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Fs(e,r,t)})};var Wd=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Qd=/^(?: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]/,Yd=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Xd=/[A-Z0-9]/g,Zd=typeof document!="undefined",ef=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Wi(e,t,r){return t.__k==null&&(t.textContent=""),As(e,t),typeof r=="function"&&r(),e?e.__c:null}Ie.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ie.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var js=M.event;function tf(){}function rf(){return this.cancelBubble}function nf(){return this.defaultPrevented}M.event=function(e){return js&&(e=js(e)),e.persist=tf,e.isPropagationStopped=rf,e.isDefaultPrevented=nf,e.nativeEvent=e};var zs,of={enumerable:!1,configurable:!0,get:function(){return this.class}},Hs=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||Zd&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||ef(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":Yd.test(a)&&(a=u):u=a="oninput":o&&Qd.test(a)?a=a.replace(Xd,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",of)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Wd,Hs&&Hs(e)};var Vs=M.__r;M.__r=function(e){Vs&&Vs(e),zs=e.__c};var Js=M.diffed;M.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),zs=null};var Ws=Object.getOwnPropertySymbols,af=Object.prototype.hasOwnProperty,sf=Object.prototype.propertyIsEnumerable,lf=(e,t)=>{var r={};for(var n in e)af.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ws)for(var n of Ws(e))t.indexOf(n)<0&&sf.call(e,n)&&(r[n]=e[n]);return r};function Se(e,t,r){return(t=uf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function uf(e){var t=cf(e,"string");return typeof t=="symbol"?t:t+""}function cf(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 ro=class{constructor(t){Se(this,"context",void 0),Se(this,"continueCallback",void 0),Se(this,"adIsShowingCallback",void 0),Se(this,"isBeforeAdCalled",!1),Se(this,"isBeforeRewardCalled",!1),Se(this,"isAdDismissedCalled",!1),Se(this,"isAdViewedCalled",!1),Se(this,"isAfterAdCalled",!1),Se(this,"currentProvider",void 0),Se(this,"currentClientParams",void 0),Se(this,"adsHasResponse",!1),Se(this,"videoChecker",window.document.createElement("video")),Se(this,"wrapShowAdFn",r=>()=>{var n;this.adsHasResponse=!0;let i=!1;this.videoChecker.play().catch(()=>{i=!1}),i=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:i},this.paramsToTrack)),(n=this.adIsShowingCallback)==null||n.call(this,!0),r()}),this.context=t}get paramsToTrack(){var t,r,n,i,o,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:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0)))}}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,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return U(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={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:{a={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 s,u,d,y,p;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(p=this.adIsShowingCallback)==null||p.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function un(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)}var no=class{constructor(t){un(this,"context",void 0),un(this,"adBreakIsShowing",!1),un(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),un(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,hf=Object.defineProperties,pf=Object.getOwnPropertyDescriptors,Qs=Object.getOwnPropertySymbols,mf=Object.prototype.hasOwnProperty,vf=Object.prototype.propertyIsEnumerable,Ys=(e,t,r)=>t in e?yl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,_f=(e,t)=>{for(var r in t||(t={}))mf.call(t,r)&&Ys(e,r,t[r]);if(Qs)for(var r of Qs(t))vf.call(t,r)&&Ys(e,r,t[r]);return e},gf=(e,t)=>hf(e,pf(t)),yf=(e,t)=>{for(var r in t)yl(e,r,{get:t[r],enumerable:!0})},bl=(e,t,r,n)=>{for(var i=t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},bf=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((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 i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,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}function wf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Ef(e){return typeof e=="string"}function Af(e){return typeof e=="undefined"}function If(e){return Af(e)||e===null}function Sf(e){return typeof e=="function"}function wl(e){let t=e,r=null,n=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}var Rf=(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))(Rf||{});function Yt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Tf={log:Yt("log"),warn:Yt("warn"),info:Yt("info"),error:Yt("error"),debug:Yt("debug")};Object.assign(globalThis,{logger:Tf});var Xs=Symbol.for("Jolibox.canIUseMap"),kf={};globalThis[Xs]||(globalThis[Xs]=kf);var Zs=Symbol.for("Jolibox.canIUseMap.native"),xf={};globalThis[Zs]||(globalThis[Zs]=xf);var El=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(El||{}),Al=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Al||{}),Il=(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))(Il||{}),el=["name","params"],Cf=["name","type","location","target","extra","timestamp","userId"],Of=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function fn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Pf(e){let t=e.location?fn(e.location,el):null,r=e.target?fn(e.target,el):null;return fn(gf(_f({},e),{location:t,target:r}),Cf)}function Df(e){let t=e.events.map(n=>Pf(n)),r=fn(e.device,Of);return[e.protocolVersion,t,r,e.project]}function Nf(){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}}Nf();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");var io=class oo{constructor(t){this.element=t,this.next=oo.Undefined,this.prev=oo.Undefined}};io.Undefined=new io(void 0);var te=io,Lf=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},Uf=0,Xt=class{constructor(e){this.value=e,this.id=Uf++}},rr=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 Xt&&(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,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new Xt(e);return this._listeners?this._listeners instanceof Xt?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,p,v;if(!this._disposed){if(this._listeners instanceof Xt)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let f=this._listeners.indexOf(u);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((v=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||v.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(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Xt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Mf=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 i=(n=this.listeners.get(e))!=null?n:new rr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.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,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new Lf,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},ao={};yf(ao,{None:()=>Bf,filter:()=>jf,once:()=>Sl,toPromise:()=>Ff});var Bf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Ff(e){return new Promise(t=>Sl(e)(t))}function Sl(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function jf(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new rr(n);return i.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(i=>t(i)&&r.call(n,i),null)})}var Qi=Symbol.for("Jolibox.hostEmitter"),Hf=()=>{let e=new Mf;return globalThis[Qi]||(globalThis[Qi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Qi]};Hf();function Vf(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Jf(e[n],t[n])}function Jf(e,t){if(Ef(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Sf(t)){try{if(e instanceof t)return}catch(r){}if(!If(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")}}var so=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new rr,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 i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return Vf(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}};so=bl([wl],so);var tl=class{constructor(){this._onWillExecuteCommand=new rr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new rr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new so,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=wf(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 bf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ao.toPromise(ao.filter(this.registry.onDidRegisterCommand,i=>i===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),i=1;i<r;i++)n[i-1]=arguments[i];this._onWillExecuteCommand.fire({commandId:e,args:n});let o=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),o}_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{}}};tl=bl([wl],tl);function Yi(e,t,r){return(t=$f(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function $f(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)}var lo=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Yi(this,"context",void 0),Yi(this,"placement","GAME"),Yi(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,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:Il.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:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:El.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Al.WebSDK};return Df(i)}};function cn(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)}var uo=class{constructor(t){cn(this,"configs",null),cn(this,"firstRun",!0),cn(this,"context",void 0),cn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return U(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 i=(t=this.contextInfo.channel)!=null?t:"",o=this.configs[i],a=(r=o==null?void 0:o.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};function $e(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=Wf(e,"string");return typeof t=="symbol"?t:t+""}function Wf(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 co=class{constructor(t,r){$e(this,"name","ADSENSE"),$e(this,"context",void 0),$e(this,"contextInfo",void 0),$e(this,"configured",!1),$e(this,"initParams",void 0),$e(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),$e(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=lf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),$e(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),$e(this,"adUnit",n=>U(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:y,fullWidthResponsive:p,style:v}=n,f;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?f=document.querySelector(u):f=u,!f)throw new Error("targeting element not found");let E=d;if(E||(E=this.initParams.unitId),!E)throw new Error("slot is required");let w=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,S=document.createElement("ins");if(S.className="adsbygoogle",S.id="jolibox-ads",S.style.display="block",S.setAttribute("data-ad-client",this.initParams.clientId),S.setAttribute("data-ad-slot",E),w&&S.setAttribute("data-ad-format",w),p&&S.setAttribute("data-full-width-responsive",p),v&&S.setAttribute("style",v),(s=this.contextInfo.testAdsMode)!=null?s:!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",S.style.position="relative",f.appendChild(S),S.appendChild(b)}else f.appendChild(S),new MutationObserver(b=>{b.forEach(x=>{if(x.type==="attributes"&&x.attributeName==="data-ad-status"){let P=S.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:P!=null?P:"null"})}})}).observe(S,{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 U(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 i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&this.initParams.admobRewardedSlot&&(i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on")),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};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 Yf(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}var Xf=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},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(Yf(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Qf(n);try{i.insertRule(r,i.cssRules.length)}catch(o){}}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}(),_e="-ms-",gn="-moz-",V="-webkit-",Rl="comm",wo="rule",Eo="decl",Zf="@import",Tl="@keyframes",eh="@layer",th=Math.abs,An=String.fromCharCode,rh=Object.assign;function nh(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 kl(e){return e.trim()}function ih(e,t){return(e=t.exec(e))?e[0]:e}function J(e,t,r){return e.replace(t,r)}function fo(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function nr(e,t,r){return e.slice(t,r)}function Le(e){return e.length}function Ao(e){return e.length}function dn(e,t){return t.push(e),e}function oh(e,t){return e.map(t).join("")}var In=1,It=1,xl=0,Ae=0,ce=0,St="";function Sn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:In,column:It,length:a,return:""}}function Zt(e,t){return rh(Sn("",null,null,"",null,null,0),e,{length:-e.length},t)}function ah(){return ce}function sh(){return ce=Ae>0?he(St,--Ae):0,It--,ce===10&&(It=1,In--),ce}function Te(){return ce=Ae<xl?he(St,Ae++):0,It++,ce===10&&(It=1,In++),ce}function Ue(){return he(St,Ae)}function hn(){return Ae}function or(e,t){return nr(St,e,t)}function ir(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 Cl(e){return In=It=1,xl=Le(St=e),Ae=0,[]}function Ol(e){return St="",e}function pn(e){return kl(or(Ae-1,ho(e===91?e+2:e===40?e+1:e)))}function lh(e){for(;(ce=Ue())&&ce<33;)Te();return ir(e)>2||ir(ce)>3?"":" "}function uh(e,t){for(;--t&&Te()&&!(ce<48||ce>102||ce>57&&ce<65||ce>70&&ce<97););return or(e,hn()+(t<6&&Ue()==32&&Te()==32))}function ho(e){for(;Te();)switch(ce){case e:return Ae;case 34:case 39:e!==34&&e!==39&&ho(ce);break;case 40:e===41&&ho(e);break;case 92:Te();break}return Ae}function ch(e,t){for(;Te()&&e+ce!==57&&!(e+ce===84&&Ue()===47););return"/*"+or(t,Ae-1)+"*"+An(e===47?e:Te())}function dh(e){for(;!ir(Ue());)Te();return or(e,Ae)}function fh(e){return Ol(mn("",null,null,null,[""],e=Cl(e),0,[0],e))}function mn(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,p=a,v=0,f=0,E=0,w=1,S=1,b=1,x=0,P="",H=i,X=o,R=n,D=P;S;)switch(E=x,x=Te()){case 40:if(E!=108&&he(D,p-1)==58){fo(D+=J(pn(x),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:D+=pn(x);break;case 9:case 10:case 13:case 32:D+=lh(E);break;case 92:D+=uh(hn()-1,7);continue;case 47:switch(Ue()){case 42:case 47:dn(hh(ch(Te(),hn()),t,r),u);break;default:D+="/"}break;case 123*w:s[d++]=Le(D)*b;case 125*w:case 59:case 0:switch(x){case 0:case 125:S=0;case 59+y:b==-1&&(D=J(D,/\f/g,"")),f>0&&Le(D)-p&&dn(f>32?nl(D+";",n,r,p-1):nl(J(D," ","")+";",n,r,p-2),u);break;case 59:D+=";";default:if(dn(R=rl(D,t,r,d,y,i,s,P,H=[],X=[],p),o),x===123)if(y===0)mn(D,t,R,R,H,o,p,s,X);else switch(v===99&&he(D,3)===110?100:v){case 100:case 108:case 109:case 115:mn(e,R,R,n&&dn(rl(e,R,R,0,0,i,s,P,i,H=[],p),X),i,X,p,s,n?H:X);break;default:mn(D,R,R,R,[""],X,0,s,X)}}d=y=f=0,w=b=1,P=D="",p=a;break;case 58:p=1+Le(D),f=E;default:if(w<1){if(x==123)--w;else if(x==125&&w++==0&&sh()==125)continue}switch(D+=An(x),x*w){case 38:b=y>0?1:(D+="\f",-1);break;case 44:s[d++]=(Le(D)-1)*b,b=1;break;case 64:Ue()===45&&(D+=pn(Te())),v=Ue(),y=p=Le(P=D+=dh(hn())),x++;break;case 45:E===45&&Le(D)==2&&(w=0)}}return o}function rl(e,t,r,n,i,o,a,s,u,d,y){for(var p=i-1,v=i===0?o:[""],f=Ao(v),E=0,w=0,S=0;E<n;++E)for(var b=0,x=nr(e,p+1,p=th(w=a[E])),P=e;b<f;++b)(P=kl(w>0?v[b]+" "+x:J(x,/&\f/g,v[b])))&&(u[S++]=P);return Sn(e,t,r,i===0?wo:s,u,d,y)}function hh(e,t,r){return Sn(e,t,r,Rl,An(ah()),nr(e,2,-2),0)}function nl(e,t,r,n){return Sn(e,t,r,Eo,nr(e,0,n),nr(e,n+1,-1),n)}function At(e,t){for(var r="",n=Ao(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function ph(e,t,r,n){switch(e.type){case eh:if(e.children.length)break;case Zf:case Eo:return e.return=e.return||e.value;case Rl:return"";case Tl:return e.return=e.value+"{"+At(e.children,n)+"}";case wo:e.value=e.props.join(",")}return Le(r=At(e.children,n))?e.return=e.value+"{"+r+"}":""}function mh(e){var t=Ao(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function vh(e){return function(t){t.root||(t=t.return)&&e(t)}}function _h(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var gh=function(e,t,r){for(var n=0,i=0;n=i,i=Ue(),n===38&&i===12&&(t[r]=1),!ir(i);)Te();return or(e,Ae)},yh=function(e,t){var r=-1,n=44;do switch(ir(n)){case 0:n===38&&Ue()===12&&(t[r]=1),e[r]+=gh(Ae-1,t,r);break;case 2:e[r]+=pn(n);break;case 4:if(n===44){e[++r]=Ue()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=An(n)}while(n=Te());return e},bh=function(e,t){return Ol(yh(Cl(e),t))},il=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&&!il.get(r))&&!n){il.set(e,!0);for(var i=[],o=bh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Eh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Pl(e,t){switch(nh(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+gn+e+_e+e+e;case 6828:case 4268:return V+e+_e+e+e;case 6165:return V+e+_e+"flex-"+e+e;case 5187:return V+e+J(e,/(\w+).+(:[^]+)/,V+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return V+e+_e+"flex-item-"+J(e,/flex-|-self/,"")+e;case 4675:return V+e+_e+"flex-line-pack"+J(e,/align-content|flex-|-self/,"")+e;case 5548:return V+e+_e+J(e,"shrink","negative")+e;case 5292:return V+e+_e+J(e,"basis","preferred-size")+e;case 6060:return V+"box-"+J(e,"-grow","")+V+e+_e+J(e,"grow","positive")+e;case 4554:return V+J(e,/([^-])(transform)/g,"$1"+V+"$2")+e;case 6187:return J(J(J(e,/(zoom-|grab)/,V+"$1"),/(image-set)/,V+"$1"),e,"")+e;case 5495:case 3959:return J(e,/(image-set\([^]*)/,V+"$1$`$1");case 4968:return J(J(e,/(.+:)(flex-)?(.*)/,V+"box-pack:$3"+_e+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+V+e+e;case 4095:case 3583:case 4068:case 2532:return J(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(Le(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return J(e,/(.+:)(.+)-([^]+)/,"$1"+V+"$2-$3$1"+gn+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~fo(e,"stretch")?Pl(J(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,Le(e)-3-(~fo(e,"!important")&&10))){case 107:return J(e,":",":"+V)+e;case 101:return J(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+V+(he(e,14)===45?"inline-":"")+"box$3$1"+V+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return V+e+_e+J(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return V+e+_e+J(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return V+e+_e+J(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return V+e+_e+e+e}return e}var Ah=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Eo:e.return=Pl(e.value,e.length);break;case Tl:return At([Zt(e,{value:J(e.value,"@","@"+V)})],n);case wo:if(e.length)return oh(e.props,function(i){switch(ih(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return At([Zt(e,{props:[J(i,/:(read-\w+)/,":"+gn+"$1")]})],n);case"::placeholder":return At([Zt(e,{props:[J(i,/:(plac\w+)/,":"+V+"input-$1")]}),Zt(e,{props:[J(i,/:(plac\w+)/,":"+gn+"$1")]}),Zt(e,{props:[J(i,/:(plac\w+)/,_e+"input-$1")]})],n)}return""})}},Ih=[Ah],Sh=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(E){var w=E.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(E),E.setAttribute("data-s",""))})}var n=e.stylisPlugins||Ih,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(E){for(var w=E.getAttribute("data-emotion").split(" "),S=1;S<w.length;S++)i[w[S]]=!0;a.push(E)});var s,u=[wh,Eh];{var d,y=[ph,vh(function(E){d.insert(E)})],p=mh(u.concat(n,y)),v=function(E){return At(fh(E),p)};s=function(E,w,S,b){d=S,v(E?E+"{"+w.styles+"}":w.styles),b&&(f.inserted[w.name]=!0)}}var f={key:t,sheet:new Xf({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};function Rh(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=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(i){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)}var Th={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},kh=/[A-Z]|^ms/g,xh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Dl=function(e){return e.charCodeAt(1)===45},ol=function(e){return e!=null&&typeof e!="boolean"},Xi=_h(function(e){return Dl(e)?e:e.replace(kh,"-$&").toLowerCase()}),al=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(xh,function(r,n,i){return Ze={name:n,styles:i,next:Ze},n})}return Th[e]!==1&&!Dl(e)&&typeof t=="number"&&t!==0?t+"px":t};function yn(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 i=r;if(i.anim===1)return Ze={name:i.name,styles:i.styles,next:Ze},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Ze={name:a.name,styles:a.styles,next:Ze},a=a.next;var s=o.styles+";";return s}return Ch(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function Ch(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=yn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":ol(s)&&(n+=Xi(o)+":"+al(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)ol(a[u])&&(n+=Xi(o)+":"+al(o,a[u])+";");else{var d=yn(e,t,a);switch(o){case"animation":case"animationName":{n+=Xi(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var sl=/label:\s*([^\s;{]+)\s*(;|$)/g,Ze;function Zi(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,i="";Ze=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=yn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=yn(r,t,e[s]),n){var u=o;i+=u[s]}sl.lastIndex=0;for(var d="",y;(y=sl.exec(i))!==null;)d+="-"+y[1];var p=Rh(i)+d;return{name:p,styles:i,next:Ze}}function Nl(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var Oh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Ph=function(e,t,r){Oh(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function ll(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function ul(e,t,r){var n=[],i=Nl(e,n,r);return n.length<2?r:i+t(n)}var Dh=function(e){var t=Sh(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered,void 0);return Ph(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered),y="animation-"+d.name;return ll(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=Zi(s,t.registered);ll(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return ul(t.registered,r,Nh(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Nl.bind(null,t.registered),merge:ul.bind(null,t.registered,r)}},Nh=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},Lh=Dh({key:"css"}),Rt=Lh.css,po,Re,eo,cl,dl=0,Ll=[],de=M,fl=de.__b,hl=de.__r,pl=de.diffed,ml=de.__c,vl=de.unmount,_l=de.__;function Uh(e,t){de.__h&&de.__h(Re,e,dl||t),dl=0;var r=Re.__H||(Re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ul(e,t){var r=Uh(po++,7);return Fh(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Mh(){for(var e;e=Ll.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(vn),e.__H.__h.forEach(mo),e.__H.__h=[]}catch(t){e.__H.__h=[],de.__e(t,e.__v)}}de.__b=function(e){Re=null,fl&&fl(e)},de.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_l&&_l(e,t)},de.__r=function(e){hl&&hl(e),po=0;var t=(Re=e.__c).__H;t&&(eo===Re?(t.__h=[],Re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(vn),t.__h.forEach(mo),t.__h=[],po=0)),eo=Re},de.diffed=function(e){pl&&pl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ll.push(t)!==1&&cl===de.requestAnimationFrame||((cl=de.requestAnimationFrame)||Bh)(Mh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),eo=Re=null},de.__c=function(e,t){t.some(function(r){try{r.__h.forEach(vn),r.__h=r.__h.filter(function(n){return!n.__||mo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],de.__e(n,r.__v)}}),ml&&ml(e,t)},de.unmount=function(e){vl&&vl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{vn(n)}catch(i){t=i}}),r.__H=void 0,t&&de.__e(t,r.__v))};var gl=typeof requestAnimationFrame=="function";function Bh(e){var t,r=function(){clearTimeout(n),gl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);gl&&(t=requestAnimationFrame(r))}function vn(e){var t=Re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Re=t}function mo(e){var t=Re;e.__c=e.__(),Re=t}function Fh(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var jh=Symbol.for("preact-signals");function Rn(){if(et>1)et--;else{for(var e,t=!1;er!==void 0;){var r=er;for(er=void 0,vo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Bl(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(vo=0,et--,t)throw e}}function Ee(e){if(et>0)return e();et++;try{return e()}finally{Rn()}}var Q=void 0,er=void 0,et=0,vo=0,bn=0;function Ml(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 pe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}pe.prototype.brand=jh;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 sr(function(){var r=t.value,n=Q;Q=void 0;try{e(r)}finally{Q=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=Q;Q=void 0;try{return this.value}finally{Q=e}};Object.defineProperty(pe.prototype,"value",{get:function(){var e=Ml(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(vo>100)throw new Error("Cycle detected");this.v=e,this.i++,bn++,et++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Rn()}}}});function Y(e){return new pe(e)}function Bl(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 Fl(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 Tt(e){pe.call(this,void 0),this.x=e,this.s=void 0,this.g=bn-1,this.f=4}(Tt.prototype=new pe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===bn))return!0;if(this.g=bn,this.f|=1,this.i>0&&!Bl(this))return this.f&=-2,!0;var e=Q;try{Fl(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,jl(this),this.f&=-2,!0};Tt.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)};Tt.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)}};Tt.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(Tt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Ml(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function tr(e){return new Tt(e)}function Hl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){et++;var r=Q;Q=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Io(e),n}finally{Q=r,Rn()}}}function Io(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Hl(e)}function Hh(e){if(Q!==this)throw new Error("Out-of-order effect");jl(this),Q=e,this.f&=-2,8&this.f&&Io(this),Rn()}function ar(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ar.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()}};ar.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Hl(this),Fl(this),et++;var e=Q;return Q=this,Hh.bind(this,e)};ar.prototype.N=function(){2&this.f||(this.f|=2,this.o=er,er=this)};ar.prototype.d=function(){this.f|=8,1&this.f||Io(this)};function sr(e){var t=new ar(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Vl,to,Jl=[];sr(function(){Vl=this.N})();function kt(e,t){M[e]=t.bind(null,M[e]||function(){})}function wn(e){to&&to(),to=e&&e.S()}function $l(e){var t=this,r=e.data,n=ql(r);n.value=r;var i=Ul(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=tr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=tr(function(){return!Array.isArray(d.value)&&!Mi(d.value)}),p=sr(function(){if(this.N=Gl,y.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),v=t.__$u.d;return t.__$u.d=function(){p(),v.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}$l.displayName="_st";Object.defineProperties(pe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:$l},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});kt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof pe&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});kt("__r",function(e,t){wn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return sr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),wn(r),e(t)});kt("__e",function(e,t,r,n){wn(),e(t,r,n)});kt("diffed",function(e,t){wn();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],y=n[u];d===void 0?(d=Vh(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});function Vh(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=Y(r);return{o:function(a,s){o.value=a,n=s},d:sr(function(){this.N=Gl;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}kt("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 i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});kt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Ie.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||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 s in this.props)if(!(s in e))return!0;return!1};function ql(e){return Ul(function(){return Y(e)},[])}var Jh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function $h(){Ee(function(){for(var e;e=Jl.shift();)Vl.call(e)})}function Gl(){Jl.push(this)===1&&(M.requestAnimationFrame||Jh)($h)}var ge=Rt`
1
+ var mc=Object.create;var Jn=Object.defineProperty,vc=Object.defineProperties,_c=Object.getOwnPropertyDescriptor,gc=Object.getOwnPropertyDescriptors,yc=Object.getOwnPropertyNames,mr=Object.getOwnPropertySymbols,bc=Object.getPrototypeOf,$n=Object.prototype.hasOwnProperty,Zo=Object.prototype.propertyIsEnumerable;var Xo=(e,t,r)=>t in e?Jn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,W=(e,t)=>{for(var r in t||(t={}))$n.call(t,r)&&Xo(e,r,t[r]);if(mr)for(var r of mr(t))Zo.call(t,r)&&Xo(e,r,t[r]);return e},me=(e,t)=>vc(e,gc(t));var Lt=(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 ea=(e,t)=>{var r={};for(var n in e)$n.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&mr)for(var n of mr(e))t.indexOf(n)<0&&Zo.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var qn=(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 i of yc(t))!$n.call(e,i)&&i!==r&&Jn(e,i,{get:()=>t[i],enumerable:!(n=_c(t,i))||n.enumerable});return e};var Gn=(e,t,r)=>(r=e!=null?mc(bc(e)):{},wc(t||!e||!e.__esModule?Jn(r,"default",{value:e,enumerable:!0}):r,e));var U=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((r=r.apply(e,t)).next())});function Cc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function ei(e){return typeof e=="string"}function la(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function ua(e){return typeof e=="object"&&Array.isArray(e)}function Oc(e){return typeof e=="undefined"}function Pc(e){return Oc(e)||e===null}function Dc(e){return typeof e=="function"}function ca(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function da(e,t,r){if(typeof r!="function")throw new Error("[Jolibox SDK]Customizer must be a function");function n(i,o){for(let a in o)if(Object.prototype.hasOwnProperty.call(o,a)){let s=i[a],u=o[a],d=r(s,u,a,i,o);d!==void 0?i[a]=d:na(u)&&na(s)?i[a]=n(aa({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function na(e){return e&&typeof e=="object"&&e.constructor===Object}function fa(e,t){if(Array.isArray(e))return e.concat(t)}function Ft(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:u=!0}=r,d=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),y=function(...p){i=p,o=this;let v=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!v&&d()},t),v)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function Uc(e,t){return(...r)=>t(e,...r)}function _a(e){return t=>Uc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new Lc(`${i}`))}})}function Ut(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function vr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Vc(e){let t=e.location?vr(e.location,oa):null,r=e.target?vr(e.target,oa):null;return vr(Tc(aa({},e),{location:t,target:r}),jc)}function oi(e){let t=e.events.map(n=>Vc(n)),r=vr(e.device,Hc);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 Zc(e){return new Promise(t=>ba(e)(t))}function ba(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function ed(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Bt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),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(ei(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Dc(t)){try{if(e instanceof t)return}catch(r){}if(!Pc(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 id(){return typeof globalThis!="undefined"?globalThis[wa]:void 0}function od(e){typeof globalThis!="undefined"&&(globalThis[wa]=e)}function we(){let e=id();if(e)return e;let t=new _r,r=new Xn,n={registerCommand(i,o,a){t.registerCommand({id:i,handler:o,metadata:a})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return od(n),n}var Zn,Ec,Ac,Ic,ta,Sc,Rc,ra,aa,Tc,kc,sa,xc,Nc,ti,ri,ha,pa,Lc,ma,va,gr,ni,Ce,zn,Mc,ii,ia,Bc,tt,dt,Fc,oa,jc,Hc,ft,$c,be,qc,Gc,Kc,ga,ai,si,zc,Wc,ya,Wn,ee,Qc,Yc,Mt,Bt,Pe,Yn,Xc,Kn,td,jt,_r,Xn,wa,V=Z(()=>{"use strict";Zn=Object.defineProperty,Ec=Object.defineProperties,Ac=Object.getOwnPropertyDescriptor,Ic=Object.getOwnPropertyDescriptors,ta=Object.getOwnPropertySymbols,Sc=Object.prototype.hasOwnProperty,Rc=Object.prototype.propertyIsEnumerable,ra=(e,t,r)=>t in e?Zn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,aa=(e,t)=>{for(var r in t||(t={}))Sc.call(t,r)&&ra(e,r,t[r]);if(ta)for(var r of ta(t))Rc.call(t,r)&&ra(e,r,t[r]);return e},Tc=(e,t)=>Ec(e,Ic(t)),kc=(e,t)=>{for(var r in t)Zn(e,r,{get:t[r],enumerable:!0})},sa=(e,t,r,n)=>{for(var i=n>1?void 0:n?Ac(t,r):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=(n?a(t,r,i):a(i))||i);return n&&i&&Zn(t,r,i),i},xc=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((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 i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,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}Nc=(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))(Nc||{}),ti=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}},ri=class extends ti{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},ha=class extends ti{constructor(){super(...arguments),this.kind="USER_ERROR"}},pa=class extends ha{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Lc=class extends ha{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))}},ma=class extends ri{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},va=class extends ri{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},gr=class extends ti{constructor(e,t,r,n,i){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),i&&(this.priority=i)}toJSON(){return{message:this.message,stack:this.stack,name:this.name,code:this.code,errorType:this.errorType}}},ni=class extends ri{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ce={log:Ut("log"),warn:Ut("warn"),info:Ut("info"),error:Ut("error"),debug:Ut("debug")};Object.assign(globalThis,{logger:Ce});zn=Symbol.for("Jolibox.canIUseMap"),Mc={};globalThis[zn]||(globalThis[zn]=Mc);ii={get config(){return globalThis[zn]}},ia=Symbol.for("Jolibox.canIUseMap.native"),Bc={};globalThis[ia]||(globalThis[ia]=Bc);tt=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(tt||{}),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||{}),oa=["name","params"],jc=["name","type","location","target","extra","timestamp","userId"],Hc=["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)});Jc();$c=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),be={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=()=>be.isiOS?"iOS":be.isAndroid?"Android":be.isMac?"Mac":be.isFacebook?"Facebook":"PC",Gc="device_id",Kc="advertising_id",ga=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,ft()),window.__joliboxLocalStorage__.getItem(e)),ai=()=>new URLSearchParams(window.location.search).get("deviceId")||ga(Gc),si=()=>new URLSearchParams(window.location.search).get("advertisingId")||ga(Kc),zc=e=>e.charAt(0).toUpperCase()+e.slice(1),Wc=()=>{var e;let t=new URLSearchParams(window.location.search);return zc((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},ya=e=>{if($c())return window.navigator.userAgent;let t="JoliboxWebSDK",r=qc(),n=navigator.language,i=ai(),o=si();return`${t} (${Wc()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},Wn=class Qn{constructor(t){this.element=t,this.next=Qn.Undefined,this.prev=Qn.Undefined}};Wn.Undefined=new Wn(void 0);ee=Wn,Qc=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},Yc=0,Mt=class{constructor(e){this.value=e,this.id=Yc++}},Bt=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 Mt&&(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,i,o,a,s,u;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let d=new Mt(t);return this._listeners?this._listeners instanceof Mt?this._listeners=[this._listeners,d]:this._listeners.push(d):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=d,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(u=(s=this.options)==null?void 0:s.onDidAddListener)==null||u.call(s,this),this._size++,()=>{var y,p,v,f;if(!this._disposed){if(this._listeners instanceof Mt)this._listeners.id===d.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 E=this._listeners.indexOf(d);E>=0&&(this._listeners.splice(E,1),this._size--,this._size===0&&((f=(v=this.options)==null?void 0:v.onDidRemoveLastListener)==null||f.call(v)))}}}}),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(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Mt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Pe=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Bt,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.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 Qc,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)}},Yn={};kc(Yn,{None:()=>Xc,filter:()=>ed,once:()=>ba,toPromise:()=>Zc});Xc=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Kn=Symbol.for("Jolibox.hostEmitter"),td=()=>{let e=new Pe;return globalThis[Kn]||(globalThis[Kn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Kn]},jt=td();_r=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Bt,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 i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(...i){return rd(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}};_r=sa([ca],_r);Xn=class{constructor(){this._onWillExecuteCommand=new Bt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Bt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new _r,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Cc(3e4)),this._starActivation}executeCommand(e,...t){return xc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Yn.toPromise(Yn.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}}};Xn=sa([ca],Xn);wa=Symbol.for("Jolibox.commands")});function Oe(e,t={}){li.emit("ERROR_REPORT",{error:e,options:t})}var li,rt,Qe=Z(()=>{"use strict";V();V();li=new Pe,rt=new Pe;Oe.debounce=Ft(Oe,50,{leading:!0})});var ui,ad,Ea,Aa,Ia=Z(()=>{"use strict";V();Qe();ui=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(i){return{}}},ad=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Ea=e=>{var t;try{let i=(t=new URL(e).searchParams.get("joliSource"))==null?void 0:t.split(".");if(i!=null&&i.length){let[o,a,s]=i;return{headerJson:ui(o),payloadJson:ui(a),signature:ui(s)}}else throw"joli_source is missing"}catch(r){return Oe(new ma(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Aa=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=ad(e),o=r[2];return`${n}.${i}.${o}`}return t}});var sd,yr,Sa,ci=Z(()=>{"use strict";V();sd="1.1.36-beta.1",yr=()=>sd,Sa=()=>{let e=yr();return`${ya(e)}`}});function Ra(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var ld,Ta,di,ka,oe,ud,N,Ee=Z(()=>{"use strict";V();Ia();ci();V();ld={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ai(),adId:si(),pixelRatio:window.devicePixelRatio||1,platform:be.isAndroid?"android":be.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:yr()},schema:window.location.href,platform:be.isAndroid?"android":be.isiOS?"ios":"h5"},di=(Ta=globalThis.joliboxJSCore)==null?void 0:Ta.env,oe=Object.assign({},(ka=di==null?void 0:di())!=null?ka:ld);ud=()=>{var f,E,w,S,b,x,P,H,X,R,D;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?Ea(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(w=(E=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?E:o.get("gameId"))!=null?w:"",s=(x=(b=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?x:n,u=!!((H=(P=e==null?void 0:e.testAdsMode)!=null?P:e==null?void 0:e.__testAdsMode)!=null?H:o.get("testAdsMode")==="true"),d=(D=(R=(X=e==null?void 0:e.joliboxEnv)!=null?X:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?D:"production",y=d==="staging",p=t==null?void 0:t.channel,v=e==null?void 0:e.__shouldInterupt;return{get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:yr()},get mpType(){var O,B;return(B=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,B;return(B=(O=oe.clientSessionId)!=null?O:s)!=null?B:n},get channel(){return p},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-1},get shouldInterupt(){return v},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 O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return Ra("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Ra("gamedistribution","jolibox")?"gamedistribution":"jolibox"},get viewport(){var z,ne,ye;let O=(z=oe.deviceInfo.pixelRatio)!=null?z:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,K=(ye=oe.deviceInfo.navigationBarHeight)!=null?ye:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/O:20,navigationBarHeight:K!==void 0?K/O:10}},onEnvConfigChanged:O=>{da(oe,O,fa)},encodeJoliSourceQuery:O=>{var B,K;return t&&r?Aa(W(W({},e),O),(B=o.get("joliSource"))!=null?B:""):(K=o.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{v=!1}}},N=ud()});var fi,Ca,cd,dd,xa,fd,Oa=Z(()=>{"use strict";V();Qe();Ee();V();fi=!1,Ca=(e,t)=>e==null?!1:t in e,cd=e=>Ca(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("")},xa=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=N.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:dd(e.name)},i=me(W({},n),{env:t.environment,isFromUser:r});r?rt.emit("GLOBAL_USER_ERROR",e,i):rt.emit("GLOBAL_ERROR",e,i)},fd=e=>Ca(e,"kind")&&e.kind==="USER_ERROR";li.on("ERROR_REPORT",({error:e,options:t})=>{if(fi)return;fi=!0;let r=cd(e)&&e.raw?e.raw:e;try{let n=fd(e);xa(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new ni(`${i}, origin error: ${r.message}`);Ce.error(o),xa(new ni(o.message),{environment:t.environment},!1)}finally{fi=!1}})});var hi,pi=Z(()=>{"use strict";Qe();V();Qe();hi=e=>new pa(e)});function Pa(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=ea(d,["eventType"]),u=me(W({tag:n,eventType:a!=null?a:tt.Other},t),{extra:W({},s)});n=="globalJsError"?Oe(new va(JSON.stringify(u))):e("systemLog",u,o)};return r.debounce=Ft(r,500,{leading:!0}),r}function Da(e){let t=(r,n,i)=>{var s;let o=(s=i&&JSON.stringify(i))!=null?s:0,a={speed_value_type:r,total_duration:n};o&&Object.assign(a,{extra:o}),e("joliboxSpeedAnalysis",a)};return t.debounce=Ft(t,500,{leading:!0}),t}var Na=Z(()=>{"use strict";V();V();Qe()});function La(e,t){let r=Pa(e,t),n=Da(r);return{track:r,trackPerformance:n}}var Ua=Z(()=>{"use strict";Na()});var mi=Z(()=>{"use strict"});var br,Ma=Z(()=>{"use strict";Ee();V();V();br=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return U(this,null,function*(){let r=`${N.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,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=N.sdkInfo;return{platform:1e3,os:N.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=N.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=N.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=N.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:N.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return U(this,null,function*(){if(this.checkIsSampled(t))return;let i=t.location?t.location:yield this.getLocation(),o=t.target||null,a=t.extra||null;this.deviceInfo||(this.deviceInfo=yield this.getDevice());let s=this.deviceInfo,d={protocolVersion:"1.0.0",events:[me(W({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(oi(d),n):yield this.doReport(oi(d))}catch(y){Ce.log("[Jolibox SDK] report API error",y)}})}}});var vi=Z(()=>{"use strict";Ua();mi();Ma()});var _i,Ba,Fe,wr,je,Ht=Z(()=>{"use strict";ci();Ee();V();_i=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(Ba=AbortSignal.timeout)!=null||(AbortSignal.timeout=_i);Fe=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 wr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},wr=class{constructor(t){this.xua=Sa();this.getJoliSource=()=>N.joliSource;var n;let r=N.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 U(this,null,function*(){try{let{query:n,timeout:i}=r!=null?r:{},{headers:o}=r!=null?r:{},a=n?new URLSearchParams(n):null,s=a==null?void 0:a.toString(),u=`${this.baseUrl}${t}${s?`?${s}`:""}`,d=this.xua,y=this.getJoliSource();o=Object.assign({},o!=null?o:{},d?{"x-user-agent":d}:{},y?{"x-joli-source":y}:{});let p=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:_i(i!=null?i:3e4)});return Fe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,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}:{},{"x-os-type":be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let v=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:_i(o!=null?o:3e4),credentials:"include"});Fe.getInstance().recordNetworkRequest(!0);let f=v.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return v.blob()}catch(E){return yield v.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return v.formData()}catch(E){return yield v.text()}if(f!=null&&f.includes("application/json"))try{return yield v.json()}catch(E){return yield v.text()}return v}catch(n){throw Fe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return U(this,null,function*(){try{let{data:n,query:i,timeout:o}=r!=null?r:{},{headers:a}=r!=null?r:{},s=i?new URLSearchParams(i):null,u=s==null?void 0:s.toString(),d=`${this.baseUrl}${t}${u?`?${u}`:""}`,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 v=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!v.ok)throw Fe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${v.status}`);return Fe.getInstance().recordNetworkRequest(!0),yield v.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=wr;je=Fe.getInstance()});var gi,Er,yi=Z(()=>{"use strict";Ee();vi();Ht();gi=class extends br{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,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=N.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Er=new gi});var hd,Fa=Z(()=>{"use strict";Oa();V();pi();V();yi();Ee();hd=(e,t)=>{var i,o,a;let r={message:t.message,stack:(i=t.stack)!=null?i:"",errorType:t.name,source:0},n={name:e,type:tt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Er.trackEvent(n,dt.WebSDK)};rt.on("GLOBAL_ERROR",(e,t)=>{hd(t.tag,e)});rt.on("GLOBAL_USER_ERROR",(e,t)=>{Ce.log("UserError",e,t)})});var Ar,ja=Z(()=>{"use strict";Ar=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,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),E=f-r;E>=this.interval&&(this.visible&&(a+=Math.min(E,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{p(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},p=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let v=this.visible;return{start(){o||(o=!0,v?d():u())},stop(){o=!1,y(),p()}}}}});var Ir,Ha=Z(()=>{"use strict";Ee();ja();Ht();Ir=class extends Ar{constructor(r,n,i){super(n,i);this.httpClient=je.create();this.gameId=N.mpId,this.sessionId=N.sessionId,this.track=r}reporter(r){return U(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:W({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var Va,pd,De,md,bi,nt,it=Z(()=>{"use strict";Fa();V();V();vi();yi();Ha();Ee();mi();Va=we(),pd={type:dt.WebSDK,platform:"h5",jssdk_version:N.sdkInfo.jssdkVersion,mp_id:N.mpId,mp_version:N.mpVersion},{track:De,trackPerformance:md}=La((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=la(r.extra)?r.extra:ei(r.extra)?JSON.parse(r.extra):{},i=me(W({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:tt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=N.hostUserInfo)==null?void 0:u.uid)!=null?d:null};Er.trackEvent(o,dt.WebSDK)},pd);Va.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{md(e,t,r)});Va.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{De(e,t)});bi=new Pe,nt=new Ir(De,bi)});function Ja(e){let t=ii.config[e];return t||(t={},ii.config[e]=t),(r,n)=>{if(t[r]){Ce.warn(`[can i use] ${r} already registered`);return}t[r]=W({},n)}}var $a=Z(()=>{"use strict";V()});function wi(e){qa=e}function Sr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Sr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Sr(e[r]),t),{})}function He(e){return typeof e=="number"}function Ei(e){let t=Ai(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Ai(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var qa,ue,Rr,Tr,kr,xr,ht,Cr,Or,Pr,Dr,Nr,Lr,Ur,Mr,Br,Fr,jr,Hr,Ii=Z(()=>{"use strict";qa=!1;ue=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(qa)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 ${Ei(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Sr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Sr(this._default)}optional(){return this._optional=!0,this}};Rr=class extends ue{validate(t){return this._optional&&t===void 0?!0:He(t)?He(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):He(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):He(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}},Tr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},kr=class extends ue{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(He(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(He(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}},xr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},ht=class extends ue{validate(t){return!0}},Cr=class extends ue{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Or=class extends ue{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Pr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Dr=class extends ue{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 ${Ei(t)}`)}return!0}},Nr=class extends ue{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(He(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(He(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(He(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 i=!0;if(r.forEach((o,a)=>{if(n.path=`${this.path}[${a}]`,n.errors=this.errors,o===void 0&&n.hasDefault){r[a]=n.defaultValue;return}n.validate(o)||(n.hasFallback?r[a]=n.fallbackValue:i=!1)}),this._uniqueItems){let o=new Map;for(let a in r)o.has(r[a])?i=this.fail(`${this.path} should NOT have duplicate items (${this.path}[${o.get(r[a])}] and ${this.path}[${a}] are identical)`):o.set(r[a],a)}return i}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}},Lr=class extends ue{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ai(r)!=="object")return this.fail({expect:"object",actual:r});let i=r,o=this._value;o.errors=this.errors;let a=!0;for(let s in i){let u=i[s];if(/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(s)?o.path=`${this.path}.${s}`:o.path=`${this.path}["${s}"]`,!(u===void 0&&o._optional)){if(u===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(u)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},Ur=class extends ue{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ai(r)!=="object")return this.fail({expect:"object",actual:r});let n=r,i=!0;for(let o in this._object){let a=n[o],s=this._object[o];if(s.errors=this.errors,/^[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*$/.test(o)?s.path=`${this.path}.${o}`:s.path=`${this.path}["${o}"]`,!(s._optional&&a===void 0)){if(a===void 0&&s.hasDefault){n[o]=s.defaultValue;continue}s.validate(a)||(s.hasFallback?n[o]=s.fallbackValue:i=!1)}}return i}},Mr=class extends ue{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Ei(this.value),actual:r}):!0}},Br=class extends ue{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
2
+ or `);this.errors.push(o)}return n}},Fr=class extends ue{constructor(...t){super(),this._items=t;let r=0,n=t.length-1;for(;n>=0;n--){let i=t[n];if(i._optional||i.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,i)=>{if(n.path=`${this.path}[${i}]`,n.errors=this.errors,t[i]===void 0&&n.hasDefault){t[i]=n.defaultValue;return}n.validate(t[i])||(n.hasFallback?t[i]=n._fallback:r=!1)}),r}},jr=class extends ue{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Hr=class extends ue{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 Si(e,t,r="param"){if(e.errors=[],e.path=r,wi(!0),!e.validate(t)){let n=e.errors.join(`
3
+ `);throw e.errors.length=0,wi(!1),new TypeError(n)}}var F,Ri=Z(()=>{"use strict";Ii();Ii();F={object(e){return new Ur(e)},array(e){return new Nr(e)},tuple(...e){return new Fr(...e)},literal(e){return new Mr(e)},or(...e){return new Br(...e)},symbol(){return new xr},record(e){return new Lr(e)},function(){return new Pr},boolean(){return new Tr},string(){return new kr},number(){return new Rr},undefined(){return new Cr},null(){return new Or},unknown(){return new ht},any(){return new ht},as(){return new ht},arraybuffer(){return new jr},enum(...e){return new Dr(...e)},typedarray(e){return new Hr(e)}}});var Vr,Ga,Ka=Z(()=>{"use strict";V();Qe();Ri();pi();Vr=1,Ga=e=>{function t(n,i){return(...o)=>{var p,v,f,E;let a=Date.now(),s={method:n,trace_id:Vr};Vr+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Si(i.paramsSchema,o,"params")}catch(x){throw hi(`${n}:fail ${x.message}`)}let w=i.implement(...o),S=w,b=`${n}:ok`;if(w&&"code"in w){let{code:x,data:P,message:H}=w;u=x,S=P,b=H}return{code:u,message:b,data:S}}catch(w){let S=w;y=(v=(p=S.code)!=null?p:S.errNo)!=null?v:2e3,u="FAILURE";let b=(E=(f=S.message)!=null?f:S.errMsg)!=null?E:`${w}`;return d=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Oe(new gr(d,y)),{code:u,message:d}}finally{let w=Date.now()-a;e("apiInvoked",me(W({},s),{duration:w,status:u}))}}}function r(n,i){return(...o)=>U(this,null,function*(){var v,f,E,w;let a=ua(o)?o:[o],s=Date.now(),u={method:n,trace_id:Vr};Vr+=1;let d=`${n}:ok`,y="SUCCESS",p={code:y,message:d};try{if(i.paramsSchema)try{Si(i.paramsSchema,a,"params")}catch(x){throw hi(x.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:x,data:P,message:H}=b;y=x,d=H,b=P}return Object.assign(p,{code:y,message:d,data:b}),p}catch(S){let b=S,x=(f=(v=b.code)!=null?v:b.errNo)!=null?f:2e3;y="FAILURE";let P=(w=(E=b.message)!=null?E:b.errMsg)!=null?w:`${S}`,H=`${n}:${y} ${P.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(p,{code:y,message:H}),Oe(new gr(H,x)),p}finally{let S=Date.now()-s;e("apiInvoked",me(W({},u),{duration:S,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Ve,ot,ve,Vt=Z(()=>{"use strict";$a();it();Ka();Ri();({createAPI:Ve,createSyncAPI:ot}=Ga(De)),ve=Ja("h5")});var Ya=qn((Qa,Ci)=>{(function(e){if(typeof Qa=="object"&&typeof Ci!="undefined")Ci.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(i,o,a){function s(y,p){if(!o[y]){if(!i[y]){var v=typeof Lt=="function"&&Lt;if(!p&&v)return v(y,!0);if(u)return u(y,!0);var f=new Error("Cannot find module '"+y+"'");throw f.code="MODULE_NOT_FOUND",f}var E=o[y]={exports:{}};i[y][0].call(E.exports,function(w){var S=i[y][1][w];return s(S||w)},E,E.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Lt=="function"&&Lt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(w),p=a.document.createTextNode("");y.observe(p,{characterData:!0}),u=function(){p.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var v=new a.MessageChannel;v.port1.onmessage=w,u=function(){v.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){w(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:u=function(){setTimeout(w,0)};var f,E=[];function w(){f=!0;for(var b,x,P=E.length;P;){for(x=E,E=[],b=-1;++b<P;)x[b]();P=E.length}f=!1}i.exports=S;function S(b){E.push(b)===1&&!f&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],p=["PENDING"];i.exports=v;function v(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=p,this.queue=[],this.outcome=void 0,R!==s&&S(this,R)}v.prototype.catch=function(R){return this.then(null,R)},v.prototype.then=function(R,D){if(typeof R!="function"&&this.state===y||typeof D!="function"&&this.state===d)return this;var O=new this.constructor(s);if(this.state!==p){var B=this.state===y?R:D;E(O,B,this.outcome)}else this.queue.push(new f(O,R,D));return O};function f(R,D,O){this.promise=R,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(R){u.resolve(this.promise,R)},f.prototype.otherCallFulfilled=function(R){E(this.promise,this.onFulfilled,R)},f.prototype.callRejected=function(R){u.reject(this.promise,R)},f.prototype.otherCallRejected=function(R){E(this.promise,this.onRejected,R)};function E(R,D,O){a(function(){var B;try{B=D(O)}catch(K){return u.reject(R,K)}B===R?u.reject(R,new TypeError("Cannot resolve promise with itself")):u.resolve(R,B)})}u.resolve=function(R,D){var O=b(w,D);if(O.status==="error")return u.reject(R,O.value);var B=O.value;if(B)S(R,B);else{R.state=y,R.outcome=D;for(var K=-1,z=R.queue.length;++K<z;)R.queue[K].callFulfilled(D)}return R},u.reject=function(R,D){R.state=d,R.outcome=D;for(var O=-1,B=R.queue.length;++O<B;)R.queue[O].callRejected(D);return R};function w(R){var D=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof D=="function")return function(){D.apply(R,arguments)}}function S(R,D){var O=!1;function B(ye){O||(O=!0,u.reject(R,ye))}function K(ye){O||(O=!0,u.resolve(R,ye))}function z(){D(K,B)}var ne=b(z);ne.status==="error"&&B(ne.value)}function b(R,D){var O={};try{O.value=R(D),O.status="success"}catch(B){O.status="error",O.value=B}return O}v.resolve=x;function x(R){return R instanceof this?R:u.resolve(new this(s),R)}v.reject=P;function P(R){var D=new this(s);return u.reject(D,R)}v.all=H;function H(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var K=new Array(O),z=0,ne=-1,ye=new this(s);++ne<O;)Me(R[ne],ne);return ye;function Me(Pt,fr){D.resolve(Pt).then(Dn,function(ut){B||(B=!0,u.reject(ye,ut))});function Dn(ut){K[fr]=ut,++z===O&&!B&&(B=!0,u.resolve(ye,K))}}}v.race=X;function X(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var K=-1,z=new this(s);++K<O;)ne(R[K]);return z;function ne(ye){D.resolve(ye).then(function(Me){B||(B=!0,u.resolve(z,Me))},function(Me){B||(B=!0,u.reject(z,Me))})}}},{1:1}],3:[function(n,i,o){(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,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}function u(){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(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),h=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||h)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function p(l,h){l=l||[],h=h||{};try{return new Blob(l,h)}catch(m){if(m.name!=="TypeError")throw m;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new c,g=0;g<l.length;g+=1)_.append(l[g]);return _.getBlob(h.type)}}typeof Promise=="undefined"&&n(3);var v=Promise;function f(l,h){h&&l.then(function(c){h(null,c)},function(c){h(c)})}function E(l,h,c){typeof h=="function"&&l.then(h),typeof c=="function"&&l.catch(c)}function w(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function S(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",x=void 0,P={},H=Object.prototype.toString,X="readonly",R="readwrite";function D(l){for(var h=l.length,c=new ArrayBuffer(h),_=new Uint8Array(c),g=0;g<h;g++)_[g]=l.charCodeAt(g);return c}function O(l){return new v(function(h){var c=l.transaction(b,R),_=p([""]);c.objectStore(b).put(_,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),h(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),m=navigator.userAgent.match(/Edge\//);h(m||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function B(l){return typeof x=="boolean"?v.resolve(x):O(l).then(function(h){return x=h,x})}function K(l){var h=P[l.name],c={};c.promise=new v(function(_,g){c.resolve=_,c.reject=g}),h.deferredOperations.push(c),h.dbReady?h.dbReady=h.dbReady.then(function(){return c.promise}):h.dbReady=c.promise}function z(l){var h=P[l.name],c=h.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ne(l,h){var c=P[l.name],_=c.deferredOperations.pop();if(_)return _.reject(h),_.promise}function ye(l,h){return new v(function(c,_){if(P[l.name]=P[l.name]||Po(),l.db)if(h)K(l),l.db.close();else return c(l.db);var g=[l.name];h&&g.push(l.version);var m=d.open.apply(d,g);h&&(m.onupgradeneeded=function(A){var I=m.result;try{I.createObjectStore(l.storeName),A.oldVersion<=1&&I.createObjectStore(b)}catch(T){if(T.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+A.oldVersion+" to version "+A.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw T}}),m.onerror=function(A){A.preventDefault(),_(m.error)},m.onsuccess=function(){var A=m.result;A.onversionchange=function(I){I.target.close()},c(A),z(l)}})}function Me(l){return ye(l,!1)}function Pt(l){return ye(l,!0)}function fr(l,h){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),_=l.version<l.db.version,g=l.version>l.db.version;if(_&&(l.version!==h&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var m=l.db.version+1;m>l.version&&(l.version=m)}return!0}return!1}function Dn(l){return new v(function(h,c){var _=new FileReader;_.onerror=c,_.onloadend=function(g){var m=btoa(g.target.result||"");h({__local_forage_encoded_blob:!0,data:m,type:l.type})},_.readAsBinaryString(l)})}function ut(l){var h=D(atob(l.data));return p([h],{type:l.type})}function Oo(l){return l&&l.__local_forage_encoded_blob}function vu(l){var h=this,c=h._initReady().then(function(){var _=P[h._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return E(c,l,l),c}function _u(l){K(l);for(var h=P[l.name],c=h.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,Me(l).then(function(m){return l.db=m,fr(l)?Pt(l):m}).then(function(m){l.db=h.db=m;for(var A=0;A<c.length;A++)c[A]._dbInfo.db=m}).catch(function(m){throw ne(l,m),m})}function Be(l,h,c,_){_===void 0&&(_=1);try{var g=l.db.transaction(l.storeName,h);c(null,g)}catch(m){if(_>0&&(!l.db||m.name==="InvalidStateError"||m.name==="NotFoundError"))return v.resolve().then(function(){if(!l.db||m.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Pt(l)}).then(function(){return _u(l).then(function(){Be(l,h,c,_-1)})}).catch(c);c(m)}}function Po(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function gu(l){var h=this,c={db:null};if(l)for(var _ in l)c[_]=l[_];var g=P[c.name];g||(g=Po(),P[c.name]=g),g.forages.push(h),h._initReady||(h._initReady=h.ready,h.ready=vu);var m=[];function A(){return v.resolve()}for(var I=0;I<g.forages.length;I++){var T=g.forages[I];T!==h&&m.push(T._initReady().catch(A))}var k=g.forages.slice(0);return v.all(m).then(function(){return c.db=g.db,Me(c)}).then(function(C){return c.db=C,fr(c,h._defaultConfig.version)?Pt(c):C}).then(function(C){c.db=g.db=C,h._dbInfo=c;for(var L=0;L<k.length;L++){var j=k[L];j!==h&&(j._dbInfo.db=c.db,j._dbInfo.version=c.version)}})}function yu(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){Be(c._dbInfo,X,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=T.get(l);k.onsuccess=function(){var C=k.result;C===void 0&&(C=null),Oo(C)&&(C=ut(C)),g(C)},k.onerror=function(){m(k.error)}}catch(C){m(C)}})}).catch(m)});return f(_,h),_}function bu(l,h){var c=this,_=new v(function(g,m){c.ready().then(function(){Be(c._dbInfo,X,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=T.openCursor(),C=1;k.onsuccess=function(){var L=k.result;if(L){var j=L.value;Oo(j)&&(j=ut(j));var q=l(j,L.key,C++);q!==void 0?g(q):L.continue()}else g()},k.onerror=function(){m(k.error)}}catch(L){m(L)}})}).catch(m)});return f(_,h),_}function wu(l,h,c){var _=this;l=w(l);var g=new v(function(m,A){var I;_.ready().then(function(){return I=_._dbInfo,H.call(h)==="[object Blob]"?B(I.db).then(function(T){return T?h:Dn(h)}):h}).then(function(T){Be(_._dbInfo,R,function(k,C){if(k)return A(k);try{var L=C.objectStore(_._dbInfo.storeName);T===null&&(T=void 0);var j=L.put(T,l);C.oncomplete=function(){T===void 0&&(T=null),m(T)},C.onabort=C.onerror=function(){var q=j.error?j.error:j.transaction.error;A(q)}}catch(q){A(q)}})}).catch(A)});return f(g,c),g}function Eu(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){Be(c._dbInfo,R,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=T.delete(l);I.oncomplete=function(){g()},I.onerror=function(){m(k.error)},I.onabort=function(){var C=k.error?k.error:k.transaction.error;m(C)}}catch(C){m(C)}})}).catch(m)});return f(_,h),_}function Au(l){var h=this,c=new v(function(_,g){h.ready().then(function(){Be(h._dbInfo,R,function(m,A){if(m)return g(m);try{var I=A.objectStore(h._dbInfo.storeName),T=I.clear();A.oncomplete=function(){_()},A.onabort=A.onerror=function(){var k=T.error?T.error:T.transaction.error;g(k)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function Iu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){Be(h._dbInfo,X,function(m,A){if(m)return g(m);try{var I=A.objectStore(h._dbInfo.storeName),T=I.count();T.onsuccess=function(){_(T.result)},T.onerror=function(){g(T.error)}}catch(k){g(k)}})}).catch(g)});return f(c,l),c}function Su(l,h){var c=this,_=new v(function(g,m){if(l<0){g(null);return}c.ready().then(function(){Be(c._dbInfo,X,function(A,I){if(A)return m(A);try{var T=I.objectStore(c._dbInfo.storeName),k=!1,C=T.openKeyCursor();C.onsuccess=function(){var L=C.result;if(!L){g(null);return}l===0||k?g(L.key):(k=!0,L.advance(l))},C.onerror=function(){m(C.error)}}catch(L){m(L)}})}).catch(m)});return f(_,h),_}function Ru(l){var h=this,c=new v(function(_,g){h.ready().then(function(){Be(h._dbInfo,X,function(m,A){if(m)return g(m);try{var I=A.objectStore(h._dbInfo.storeName),T=I.openKeyCursor(),k=[];T.onsuccess=function(){var C=T.result;if(!C){_(k);return}k.push(C.key),C.continue()},T.onerror=function(){g(T.error)}}catch(C){g(C)}})}).catch(g)});return f(c,l),c}function Tu(l,h){h=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;if(!l.name)g=v.reject("Invalid arguments");else{var m=l.name===c.name&&_._dbInfo.db,A=m?v.resolve(_._dbInfo.db):Me(l).then(function(I){var T=P[l.name],k=T.forages;T.db=I;for(var C=0;C<k.length;C++)k[C]._dbInfo.db=I;return I});l.storeName?g=A.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var T=I.version+1;K(l);var k=P[l.name],C=k.forages;I.close();for(var L=0;L<C.length;L++){var j=C[L];j._dbInfo.db=null,j._dbInfo.version=T}var q=new v(function(G,le){var ie=d.open(l.name,T);ie.onerror=function(xe){var Nt=ie.result;Nt.close(),le(xe)},ie.onupgradeneeded=function(){var xe=ie.result;xe.deleteObjectStore(l.storeName)},ie.onsuccess=function(){var xe=ie.result;xe.close(),G(xe)}});return q.then(function(G){k.db=G;for(var le=0;le<C.length;le++){var ie=C[le];ie._dbInfo.db=G,z(ie._dbInfo)}}).catch(function(G){throw(ne(l,G)||v.resolve()).catch(function(){}),G})}}):g=A.then(function(I){K(l);var T=P[l.name],k=T.forages;I.close();for(var C=0;C<k.length;C++){var L=k[C];L._dbInfo.db=null}var j=new v(function(q,G){var le=d.deleteDatabase(l.name);le.onerror=function(){var ie=le.result;ie&&ie.close(),G(le.error)},le.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},le.onsuccess=function(){var ie=le.result;ie&&ie.close(),q(ie)}});return j.then(function(q){T.db=q;for(var G=0;G<k.length;G++){var le=k[G];z(le._dbInfo)}}).catch(function(q){throw(ne(l,q)||v.resolve()).catch(function(){}),q})})}return f(g,h),g}var ku={_driver:"asyncStorage",_initStorage:gu,_support:y(),iterate:bu,getItem:yu,setItem:wu,removeItem:Eu,clear:Au,length:Iu,key:Su,keys:Ru,dropInstance:Tu};function xu(){return typeof openDatabase=="function"}var ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Cu="~~local_forage_type~",Do=/^~~local_forage_type~([^~]+)~/,hr="__lfsc__:",Nn=hr.length,Ln="arbf",Un="blob",No="si08",Lo="ui08",Uo="uic8",Mo="si16",Bo="si32",Fo="ur16",jo="ui32",Ho="fl32",Vo="fl64",Jo=Nn+Ln.length,$o=Object.prototype.toString;function qo(l){var h=l.length*.75,c=l.length,_,g=0,m,A,I,T;l[l.length-1]==="="&&(h--,l[l.length-2]==="="&&h--);var k=new ArrayBuffer(h),C=new Uint8Array(k);for(_=0;_<c;_+=4)m=ze.indexOf(l[_]),A=ze.indexOf(l[_+1]),I=ze.indexOf(l[_+2]),T=ze.indexOf(l[_+3]),C[g++]=m<<2|A>>4,C[g++]=(A&15)<<4|I>>2,C[g++]=(I&3)<<6|T&63;return k}function Mn(l){var h=new Uint8Array(l),c="",_;for(_=0;_<h.length;_+=3)c+=ze[h[_]>>2],c+=ze[(h[_]&3)<<4|h[_+1]>>4],c+=ze[(h[_+1]&15)<<2|h[_+2]>>6],c+=ze[h[_+2]&63];return h.length%3===2?c=c.substring(0,c.length-1)+"=":h.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Ou(l,h){var c="";if(l&&(c=$o.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&$o.call(l.buffer)==="[object ArrayBuffer]")){var _,g=hr;l instanceof ArrayBuffer?(_=l,g+=Ln):(_=l.buffer,c==="[object Int8Array]"?g+=No:c==="[object Uint8Array]"?g+=Lo:c==="[object Uint8ClampedArray]"?g+=Uo:c==="[object Int16Array]"?g+=Mo:c==="[object Uint16Array]"?g+=Fo:c==="[object Int32Array]"?g+=Bo:c==="[object Uint32Array]"?g+=jo:c==="[object Float32Array]"?g+=Ho:c==="[object Float64Array]"?g+=Vo:h(new Error("Failed to get type for BinaryArray"))),h(g+Mn(_))}else if(c==="[object Blob]"){var m=new FileReader;m.onload=function(){var A=Cu+l.type+"~"+Mn(this.result);h(hr+Un+A)},m.readAsArrayBuffer(l)}else try{h(JSON.stringify(l))}catch(A){console.error("Couldn't convert value into a JSON string: ",l),h(null,A)}}function Pu(l){if(l.substring(0,Nn)!==hr)return JSON.parse(l);var h=l.substring(Jo),c=l.substring(Nn,Jo),_;if(c===Un&&Do.test(h)){var g=h.match(Do);_=g[1],h=h.substring(g[0].length)}var m=qo(h);switch(c){case Ln:return m;case Un:return p([m],{type:_});case No:return new Int8Array(m);case Lo:return new Uint8Array(m);case Uo:return new Uint8ClampedArray(m);case Mo:return new Int16Array(m);case Fo:return new Uint16Array(m);case Bo:return new Int32Array(m);case jo:return new Uint32Array(m);case Ho:return new Float32Array(m);case Vo:return new Float64Array(m);default:throw new Error("Unkown type: "+c)}}var Bn={serialize:Ou,deserialize:Pu,stringToBuffer:qo,bufferToString:Mn};function Go(l,h,c,_){l.executeSql("CREATE TABLE IF NOT EXISTS "+h.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function Du(l){var h=this,c={db:null};if(l)for(var _ in l)c[_]=typeof l[_]!="string"?l[_].toString():l[_];var g=new v(function(m,A){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return A(I)}c.db.transaction(function(I){Go(I,c,function(){h._dbInfo=c,m()},function(T,k){A(k)})},A)});return c.serializer=Bn,g}function We(l,h,c,_,g,m){l.executeSql(c,_,g,function(A,I){I.code===I.SYNTAX_ERR?A.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[h.storeName],function(T,k){k.rows.length?m(T,I):Go(T,h,function(){T.executeSql(c,_,g,m)},m)},m):m(A,I)},m)}function Nu(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"SELECT * FROM "+A.storeName+" WHERE key = ? LIMIT 1",[l],function(T,k){var C=k.rows.length?k.rows.item(0).value:null;C&&(C=A.serializer.deserialize(C)),g(C)},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Lu(l,h){var c=this,_=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"SELECT * FROM "+A.storeName,[],function(T,k){for(var C=k.rows,L=C.length,j=0;j<L;j++){var q=C.item(j),G=q.value;if(G&&(G=A.serializer.deserialize(G)),G=l(G,q.key,j+1),G!==void 0){g(G);return}}g()},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Ko(l,h,c,_){var g=this;l=w(l);var m=new v(function(A,I){g.ready().then(function(){h===void 0&&(h=null);var T=h,k=g._dbInfo;k.serializer.serialize(h,function(C,L){L?I(L):k.db.transaction(function(j){We(j,k,"INSERT OR REPLACE INTO "+k.storeName+" (key, value) VALUES (?, ?)",[l,C],function(){A(T)},function(q,G){I(G)})},function(j){if(j.code===j.QUOTA_ERR){if(_>0){A(Ko.apply(g,[l,T,c,_-1]));return}I(j)}})})}).catch(I)});return f(m,c),m}function Uu(l,h,c){return Ko.apply(this,[l,h,c,1])}function Mu(l,h){var c=this;l=w(l);var _=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"DELETE FROM "+A.storeName+" WHERE key = ?",[l],function(){g()},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Bu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var m=h._dbInfo;m.db.transaction(function(A){We(A,m,"DELETE FROM "+m.storeName,[],function(){_()},function(I,T){g(T)})})}).catch(g)});return f(c,l),c}function Fu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var m=h._dbInfo;m.db.transaction(function(A){We(A,m,"SELECT COUNT(key) as c FROM "+m.storeName,[],function(I,T){var k=T.rows.item(0).c;_(k)},function(I,T){g(T)})})}).catch(g)});return f(c,l),c}function ju(l,h){var c=this,_=new v(function(g,m){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){We(I,A,"SELECT key FROM "+A.storeName+" WHERE id = ? LIMIT 1",[l+1],function(T,k){var C=k.rows.length?k.rows.item(0).key:null;g(C)},function(T,k){m(k)})})}).catch(m)});return f(_,h),_}function Hu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var m=h._dbInfo;m.db.transaction(function(A){We(A,m,"SELECT key FROM "+m.storeName,[],function(I,T){for(var k=[],C=0;C<T.rows.length;C++)k.push(T.rows.item(C).key);_(k)},function(I,T){g(T)})})}).catch(g)});return f(c,l),c}function Vu(l){return new v(function(h,c){l.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,m){for(var A=[],I=0;I<m.rows.length;I++)A.push(m.rows.item(I).name);h({db:l,storeNames:A})},function(g,m){c(m)})},function(_){c(_)})})}function Ju(l,h){h=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;return l.name?g=new v(function(m){var A;l.name===c.name?A=_._dbInfo.db:A=openDatabase(l.name,"","",0),l.storeName?m({db:A,storeNames:[l.storeName]}):m(Vu(A))}).then(function(m){return new v(function(A,I){m.db.transaction(function(T){function k(q){return new v(function(G,le){T.executeSql("DROP TABLE IF EXISTS "+q,[],function(){G()},function(ie,xe){le(xe)})})}for(var C=[],L=0,j=m.storeNames.length;L<j;L++)C.push(k(m.storeNames[L]));v.all(C).then(function(){A()}).catch(function(q){I(q)})},function(T){I(T)})})}):g=v.reject("Invalid arguments"),f(g,h),g}var $u={_driver:"webSQLStorage",_initStorage:Du,_support:xu(),iterate:Lu,getItem:Nu,setItem:Uu,removeItem:Mu,clear:Bu,length:Fu,key:ju,keys:Hu,dropInstance:Ju};function qu(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function zo(l,h){var c=l.name+"/";return l.storeName!==h.storeName&&(c+=l.storeName+"/"),c}function Gu(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(h){return!0}}function Ku(){return!Gu()||localStorage.length>0}function zu(l){var h=this,c={};if(l)for(var _ in l)c[_]=l[_];return c.keyPrefix=zo(l,h._defaultConfig),Ku()?(h._dbInfo=c,c.serializer=Bn,v.resolve()):v.reject()}function Wu(l){var h=this,c=h.ready().then(function(){for(var _=h._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var m=localStorage.key(g);m.indexOf(_)===0&&localStorage.removeItem(m)}});return f(c,l),c}function Qu(l,h){var c=this;l=w(l);var _=c.ready().then(function(){var g=c._dbInfo,m=localStorage.getItem(g.keyPrefix+l);return m&&(m=g.serializer.deserialize(m)),m});return f(_,h),_}function Yu(l,h){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,m=g.keyPrefix,A=m.length,I=localStorage.length,T=1,k=0;k<I;k++){var C=localStorage.key(k);if(C.indexOf(m)===0){var L=localStorage.getItem(C);if(L&&(L=g.serializer.deserialize(L)),L=l(L,C.substring(A),T++),L!==void 0)return L}}});return f(_,h),_}function Xu(l,h){var c=this,_=c.ready().then(function(){var g=c._dbInfo,m;try{m=localStorage.key(l)}catch(A){m=null}return m&&(m=m.substring(g.keyPrefix.length)),m});return f(_,h),_}function Zu(l){var h=this,c=h.ready().then(function(){for(var _=h._dbInfo,g=localStorage.length,m=[],A=0;A<g;A++){var I=localStorage.key(A);I.indexOf(_.keyPrefix)===0&&m.push(I.substring(_.keyPrefix.length))}return m});return f(c,l),c}function ec(l){var h=this,c=h.keys().then(function(_){return _.length});return f(c,l),c}function tc(l,h){var c=this;l=w(l);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return f(_,h),_}function rc(l,h,c){var _=this;l=w(l);var g=_.ready().then(function(){h===void 0&&(h=null);var m=h;return new v(function(A,I){var T=_._dbInfo;T.serializer.serialize(h,function(k,C){if(C)I(C);else try{localStorage.setItem(T.keyPrefix+l,k),A(m)}catch(L){(L.name==="QuotaExceededError"||L.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(L),I(L)}})})});return f(g,c),g}function nc(l,h){if(h=S.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var _=this,g;return l.name?g=new v(function(m){l.storeName?m(zo(l,_._defaultConfig)):m(l.name+"/")}).then(function(m){for(var A=localStorage.length-1;A>=0;A--){var I=localStorage.key(A);I.indexOf(m)===0&&localStorage.removeItem(I)}}):g=v.reject("Invalid arguments"),f(g,h),g}var ic={_driver:"localStorageWrapper",_initStorage:zu,_support:qu(),iterate:Yu,getItem:Qu,setItem:rc,removeItem:tc,clear:Wu,length:ec,key:Xu,keys:Zu,dropInstance:nc},oc=function(h,c){return h===c||typeof h=="number"&&typeof c=="number"&&isNaN(h)&&isNaN(c)},ac=function(h,c){for(var _=h.length,g=0;g<_;){if(oc(h[g],c))return!0;g++}return!1},Wo=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Dt={},Qo={},ct={INDEXEDDB:ku,WEBSQL:$u,LOCALSTORAGE:ic},sc=[ct.INDEXEDDB._driver,ct.WEBSQL._driver,ct.LOCALSTORAGE._driver],pr=["dropInstance"],Fn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pr),lc={description:"",driver:sc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function uc(l,h){l[h]=function(){var c=arguments;return l.ready().then(function(){return l[h].apply(l,c)})}}function jn(){for(var l=1;l<arguments.length;l++){var h=arguments[l];if(h)for(var c in h)h.hasOwnProperty(c)&&(Wo(h[c])?arguments[0][c]=h[c].slice():arguments[0][c]=h[c])}return arguments[0]}var cc=function(){function l(h){s(this,l);for(var c in ct)if(ct.hasOwnProperty(c)){var _=ct[c],g=_._driver;this[c]=g,Dt[g]||this.defineDriver(_)}this._defaultConfig=jn({},lc),this._config=jn({},this._defaultConfig,h),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in c){if(_==="storeName"&&(c[_]=c[_].replace(/\W/g,"_")),_==="version"&&typeof c[_]!="number")return new Error("Database version must be a number.");this._config[_]=c[_]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,_,g){var m=new v(function(A,I){try{var T=c._driver,k=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(k);return}for(var C=Fn.concat("_initStorage"),L=0,j=C.length;L<j;L++){var q=C[L],G=!ac(pr,q);if((G||c[q])&&typeof c[q]!="function"){I(k);return}}var le=function(){for(var Nt=function(hc){return function(){var pc=new Error("Method "+hc+" is not implemented by the current driver"),Yo=v.reject(pc);return f(Yo,arguments[arguments.length-1]),Yo}},Hn=0,fc=pr.length;Hn<fc;Hn++){var Vn=pr[Hn];c[Vn]||(c[Vn]=Nt(Vn))}};le();var ie=function(Nt){Dt[T]&&console.info("Redefining LocalForage driver: "+T),Dt[T]=c,Qo[T]=Nt,A()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,I):ie(!!c._support):ie(!0)}catch(xe){I(xe)}});return E(m,_,g),m},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,_,g){var m=Dt[c]?v.resolve(Dt[c]):v.reject(new Error("Driver not found."));return E(m,_,g),m},l.prototype.getSerializer=function(c){var _=v.resolve(Bn);return E(_,c),_},l.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return E(g,c,c),g},l.prototype.setDriver=function(c,_,g){var m=this;Wo(c)||(c=[c]);var A=this._getSupportedDrivers(c);function I(){m._config.driver=m.driver()}function T(L){return m._extend(L),I(),m._ready=m._initStorage(m._config),m._ready}function k(L){return function(){var j=0;function q(){for(;j<L.length;){var G=L[j];return j++,m._dbInfo=null,m._ready=null,m.getDriver(G).then(T).catch(q)}I();var le=new Error("No available storage method found.");return m._driverSet=v.reject(le),m._driverSet}return q()}}var C=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=C.then(function(){var L=A[0];return m._dbInfo=null,m._ready=null,m.getDriver(L).then(function(j){m._driver=j._driver,I(),m._wrapLibraryMethodsWithReady(),m._initDriver=k(A)})}).catch(function(){I();var L=new Error("No available storage method found.");return m._driverSet=v.reject(L),m._driverSet}),E(this._driverSet,_,g),this._driverSet},l.prototype.supports=function(c){return!!Qo[c]},l.prototype._extend=function(c){jn(this,c)},l.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,m=c.length;g<m;g++){var A=c[g];this.supports(A)&&_.push(A)}return _},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=Fn.length;c<_;c++)uc(this,Fn[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),dc=new cc;i.exports=dc},{3:3}]},{},[4])(4)})});var Za=qn(Kr=>{"use strict";V();Vt();it();var Pi=we(),Dd=Ve("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>U(Kr,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;Ce.info("onLevelFinished",r,n,i),yield Promise.all([nt.reporter({event:"COMPLETE_GAME_LEVEL"}),nt.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),Nd=Ve("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>U(Kr,null,function*(){let{duration:t,rating:r,score:n}=e;return Ce.info("onGamePlayEnded",t,r,n),nt.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Ld=Ve("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>U(Kr,[r],function*({levelId:e,name:t}){return nt.tracker("LevelUpgrade",{name:t,levelId:e})})});Pi.registerCommand("TaskTrackerSDK.levelFinished",Dd);Pi.registerCommand("TaskTrackerSDK.gamePlayEnded",Nd);Pi.registerCommand("TaskTrackerSDK.levelUpgrade",Ld);ve("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var mt,pt,es,Di,Ud,Ni,Li=Z(()=>{"use strict";mt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},pt=new Map,es=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=pt.get(t.type);r&&r.forEach(n=>{try{n(t.data)}catch(i){console.warn("Callback execution failed:",i)}})}}catch(t){console.warn("Failed to parse message:",t)}},Di=!1,Ud=()=>{Di||(window.addEventListener("message",es),Di=!0)},Ni=(e,t)=>{Ud(),pt.has(e)||pt.set(e,new Set);let r=pt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&pt.delete(e),pt.size===0&&(window.removeEventListener("message",es),Di=!1)}}});var _t,zr,Wr,Qr,Yr,ts,vt,Md,fe,gt,at=Z(()=>{"use strict";V();_t="UNLOCK_OPTIONS_CHANGED",zr="INVOKE_PAYMENT",Wr="ON_PAYMENT_RESULT",Qr="ON_USE_MODAL_EVENT",Yr="ON_USE_MODAL_RESULT",ts="ON_USE_MODAL_FREQUENCY",vt=new Pe,Md=()=>({on:vt.on.bind(vt),off:vt.off.bind(vt),emit:vt.emit.bind(vt)}),fe=Md(),gt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});var Yl=qn(Ql=>{"use strict";at();Li();V();var Wl={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Ni("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",Wl[e.result],e.result),fe.emit(Yr,{useModalResult:Wl[e.result]})});fe.on(Qr,(e,t)=>{var r;mt("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()})});Ni("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{fe.emit(Wr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});fe.on(zr,(e,t)=>U(Ql,null,function*(){var r;mt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:ft()})}))});it();Ee();Vt();V();var za=we(),_d="env",gd="getSystemInfoSync",yd=()=>{var i,o,a,s;let e={system:N.deviceInfo.system,platform:N.deviceInfo.platform.toLowerCase(),brand:N.deviceInfo.brand,pixelRatio:N.deviceInfo.pixelRatio,language:N.deviceInfo.lang,version:N.sdkInfo.jssdkVersion,appName:(i=N.hostInfo)==null?void 0:i.appName,SDKVersion:N.sdkInfo.nativeSDKVersion},t=(o=N.hostInfo)==null?void 0:o.version;t&&(e=me(W({},e),{version:t}));let r=(a=N.hostInfo)==null?void 0:a.appName;r&&(e=me(W({},e),{appName:r}));let n=(s=N.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=me(W({},e),{SDKVersion:n})),e},bd=ot(gd,{implement:yd}),wd=ot(_d,{implement:()=>me(W({},N.hostInfo),{sdkInfo:N.sdkInfo,platform:N.platform,deviceInfo:N.deviceInfo})});za.registerCommand("API.env",wd);za.registerCommand("API.getSystemInfoSync",bd);ve("env",{version:"1.0.0"});ve("getSystemInfoSync",{version:"1.0.0"});V();Vt();Qe();it();var Ed="onJoliboxShow",Ad="onJoliboxHide",Id="onReady",ki=we(),xi=_a(Oe),Ti=!0,Jt=!0,Jr=0,$r=bi;function Sd(){let e=Date.now();if(e-Jr<100)return;Jr=e;let t=document.visibilityState==="visible";t!==Ti&&(Ti=t,$r.emit("visible",Ti))}function Wa(e){let t=Date.now();t-Jr<100||(Jr=t,e==="focus"&&!Jt?Jt=!0:e==="blur"&&Jt&&(Jt=!1),$r.emit("visible",Jt))}document.addEventListener("visibilitychange",Sd);window.addEventListener("focus",()=>Wa("focus"));window.addEventListener("blur",()=>Wa("blur"));var Rd=ot(Ed,{paramsSchema:F.tuple(F.function()),implement(e){let t=xi(e);$r.on("visible",r=>{r&&t()})}}),Td=ot(Ad,{paramsSchema:F.tuple(F.function()),implement(e){let t=xi(e);$r.on("visible",r=>{!r&&t()})}}),kd=ot(Id,{paramsSchema:F.tuple(F.function()),implement(e){let t=xi(e);jt.on("LifecycleEvent.onReady",r=>{t(r)})}});ki.registerCommand("LifecycleSDK.onReady",kd);ki.registerCommand("LifecycleSDK.onJoliboxShow",Rd);ki.registerCommand("LifecycleSDK.onJoliboxHide",Td);ve("lifeCycle.onReady",{version:"1.0.0"});ve("lifeCycle.onJoliboxShow",{version:"1.0.0"});ve("lifeCycle.onJoliboxHide",{version:"1.0.0"});Vt();V();Ht();Ee();var Xa=Gn(Ya());var qr=we(),Oi=class{constructor(){this.httpClient=je.create({baseUrl:N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>N.mpId;this.getItem=t=>U(this,null,function*(){let{code:r,data:n,message:i}=yield this.httpClient.get(`/api/games/user-storage/${this.gameId}`,{query:{key:t}}),o=n==null?void 0:n.value,a=i;return r!=="SUCCESS"&&(o=yield this.gameStore.getItem(t),console.info("[SDK] cloud storage getItem failed, read from localstorage",o),a+="fallback to localstorage"),{code:r,message:a,data:o&&o!=="undefined"?o:null}});this.setItem=(t,r)=>U(this,null,function*(){let n=typeof r=="string"?r:String(r),{code:i,message:o}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}`,{data:{key:t,value:n}});return yield this.gameStore.setItem(t,n),{code:i,message:o}});this.removeItem=t=>U(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=()=>U(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=Xa.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},Gr=new Oi,xd=Ve("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield Gr.getItem(e)})}});qr.registerCommand("StorageSDK.getItem",xd);ve("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Cd=Ve("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return U(this,null,function*(){return yield Gr.setItem(e,t)})}});qr.registerCommand("StorageSDK.setItem",Cd);ve("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Od=Ve("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return U(this,null,function*(){return yield Gr.removeItem(e)})}});qr.registerCommand("StorageSDK.removeItem",Od);ve("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Pd=Ve("clearStorage",{implement(){return U(this,null,function*(){return yield Gr.clear()})}});qr.registerCommand("StorageSDK.clear",Pd);ve("storage.clear",{version:"1.0.0"});var Wg=Gn(Za());it();V();Ht();Li();Ee();at();var rs=N.testMode;function ns(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return U(this,null,function*(){return yield i.reduce((s,u)=>U(this,null,function*(){let d=yield s;if(d===!0)return!0;rs&&console.log(`handleReward ${u}`);let y=e.get(u),p=y?yield y(...o):d;return rs&&console.log(`handleReward ${u} ${p}`),p}),Promise.resolve(!1))})},registerRewardsFetcher(i){return U(this,null,function*(){t=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return U(this,null,function*(){r=(...o)=>U(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:gt}}})})},getRewardsTypes(...i){return U(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return U(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:gt}})}}}at();var 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"],is=e=>{e.registerRewardsFetcher(t=>U(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;fe.emit(_t,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return Fd(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},os=e=>{e.registerRewardFrequencyConfigFetcher(t=>U(void 0,null,function*(){var n,i;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return fe.emit(ts,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||gt}),{joliCoinUseAndCharge:((i=r.data)==null?void 0:i.joliCoinUseAndCharge)||gt}}))};var as=e=>t=>U(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0});at();function st(e,t){let r=null,n=null,i=null,o=()=>{if(i){r=Promise.resolve(i);return}r=new Promise(a=>{n=a})};return o(),e.on(t,(...a)=>{let s=a[0];i=s,n&&(n(s),n=null)}),{getData:()=>(r||o(),r),getCachedData:()=>i,clearCache:()=>{i=null,r=null},getFreshData:()=>(i=null,r=null,o(),r)}}Ee();V();at();var ss=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}));var Xr=(e,t)=>r=>U(void 0,null,function*(){let n=st(fe,Wr);return fe.emit(zr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),Zr=(e,t)=>r=>U(void 0,null,function*(){let n=st(fe,Yr);return fe.emit(Qr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var en=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:i,showUnlockWithJolicoinModal:o}})=>a=>U(void 0,null,function*(){var s,u,d,y,p,v,f;try{let E=!1,w=yield n.getData(),S=(d=(u=(s=w==null?void 0:w.options)==null?void 0:s.find(P=>P.type==="JOLI_COIN"))==null?void 0:u.joliCoinChoices[0].joliCoinQuantity)!=null?d:0;if(!ss((w==null?void 0:w.options)||[],w==null?void 0:w.userJoliCoin)){if((yield i({userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:S}))!=="SUCCESS")return r==null||r(a),!1;E=!0}let b=!!((y=w==null?void 0:w.userJoliCoin)!=null&&y.enableAutoDeduct);if(!E&&(yield o({enableAutoDeduct:b,userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:S}))!=="CONFIRM")return r==null||r(a),!1;let x=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${ft()}-${N.mpType}-${Date.now()}`,gameInfo:{gameId:N.mpId}}});return x.code=="SUCCESS"?((v=a.adBreakDone)==null||v.call(a,{breakType:a.type,breakName:"name"in a&&(p=a.name)!=null?p:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((f=a.adViewed)==null||f.call(a)),t==null||t({quantity:x.data.quantity,balance:x.data.balance}),!0):(r==null||r(a),!1)}catch(E){if(console.info("JolicoinRewardHandler error:",E),E instanceof Error&&E.message=="CANCEL")throw E;return r==null||r(a),!1}finally{n.clearCache()}});var ls=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=()=>{r==null||r()},o=Zr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=Xr("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"});return en(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})};at();var us=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=st(fe,_t),i=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},o=Zr("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=Xr("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"});return en(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})};var Ye=ns();is(Ye);os(Ye);var on,M,ps,Bi,lt,cs,ms,vs,_s,Fi,Ui,Mi,jd,$t={},gs=[],Hd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,qt=Array.isArray;function Je(e,t){for(var r in t)e[r]=t[r];return e}function ji(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Gt(e,t,r){var n,i,o,a={};for(o in t)o=="key"?n=t[o]:o=="ref"?i=t[o]:a[o]=t[o];if(arguments.length>2&&(a.children=arguments.length>3?on.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(o in e.defaultProps)a[o]===void 0&&(a[o]=e.defaultProps[o]);return rn(e,a,n,i,null)}function rn(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++ps:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function Xe(e){return e.children}function Se(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)&&lt.push(e)&&!nn.__r++||cs!==M.debounceRendering)&&((cs=M.debounceRendering)||ms)(nn)}function nn(){for(var e,t,r,n,i,o,a,s=1;lt.length;)lt.length>s&&lt.sort(vs),e=lt.shift(),s=lt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Je({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),Hi(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?yt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Es(o,r,a),r.__e!=i&&ys(r)));nn.__r=0}function bs(e,t,r,n,i,o,a,s,u,d,y){var p,v,f,E,w,S,b=n&&n.__k||gs,x=t.length;for(u=Vd(r,t,b,u,x),p=0;p<x;p++)(f=r.__k[p])!=null&&(v=f.__i===-1?$t:b[f.__i]||$t,f.__i=p,S=Hi(e,f,v,i,o,a,s,u,d,y),E=f.__e,f.ref&&v.ref!=f.ref&&(v.ref&&Vi(v.ref,null,f),y.push(f.ref,f.__c||E,f)),w==null&&E!=null&&(w=E),4&f.__u||v.__k===f.__k?u=ws(f,u,e):typeof f.type=="function"&&S!==void 0?u=S:E&&(u=E.nextSibling),f.__u&=-7);return r.__e=w,u}function Vd(e,t,r,n,i){var o,a,s,u,d,y=r.length,p=y,v=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+v,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?rn(null,a,null,null,null):qt(a)?rn(Xe,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?rn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(d=a.__i=Jd(a,r,u,p))!==-1&&(p--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?v--:i<y&&v++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?v--:d==u+1?v++:(d>u?v--:v++,a.__u|=4))):e.__k[o]=null;if(p)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=yt(s)),Is(s,s));return n}function ws(e,t,r){var n,i;if(typeof e.type=="function"){for(n=e.__k,i=0;n&&i<n.length;i++)n[i]&&(n[i].__=e,t=ws(n[i],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 Kt(e,t){return t=t||[],e==null||typeof e=="boolean"||(qt(e)?e.some(function(r){Kt(r,t)}):t.push(e)),t}function Jd(e,t,r,n){var i,o,a=e.key,s=e.type,u=t[r];if(u===null&&e.key==null||u&&a==u.key&&s===u.type&&!(2&u.__u))return r;if(n>(u!=null&&!(2&u.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((u=t[i])&&!(2&u.__u)&&a==u.key&&s===u.type)return i;i--}if(o<t.length){if((u=t[o])&&!(2&u.__u)&&a==u.key&&s===u.type)return o;o++}}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 tn(e,t,r,n,i){var o;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")o=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+o]=r,r?n?r.t=n.t:(r.t=Fi,e.addEventListener(t,o?Mi:Ui,o)):e.removeEventListener(t,o?Mi:Ui,o);else{if(i=="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=Fi++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function Hi(e,t,r,n,i,o,a,s,u,d){var y,p,v,f,E,w,S,b,x,P,H,X,R,D,O,B,K,z=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof z=="function")try{if(b=t.props,x="prototype"in z&&z.prototype.render,P=(y=z.contextType)&&n[y.__c],H=y?P?P.props.value:y.__:n,r.__c?S=(p=t.__c=r.__c).__=p.__E:(x?t.__c=p=new z(b,H):(t.__c=p=new Se(b,H),p.constructor=z,p.render=qd),P&&P.sub(p),p.props=b,p.state||(p.state={}),p.context=H,p.__n=n,v=p.__d=!0,p.__h=[],p._sb=[]),x&&p.__s==null&&(p.__s=p.state),x&&z.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=Je({},p.__s)),Je(p.__s,z.getDerivedStateFromProps(b,p.__s))),f=p.props,E=p.state,p.__v=t,v)x&&z.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),x&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(x&&z.getDerivedStateFromProps==null&&b!==f&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(b,H),!p.__e&&(p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(b,p.__s,H)===!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(ne){ne&&(ne.__=t)}),X=0;X<p._sb.length;X++)p.__h.push(p._sb[X]);p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(b,p.__s,H),x&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(f,E,w)})}if(p.context=H,p.props=b,p.__P=e,p.__e=!1,R=M.__r,D=0,x){for(p.state=p.__s,p.__d=!1,R&&R(t),y=p.render(p.props,p.state,p.context),O=0;O<p._sb.length;O++)p.__h.push(p._sb[O]);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&&++D<25);p.state=p.__s,p.getChildContext!=null&&(n=Je(Je({},n),p.getChildContext())),x&&!v&&p.getSnapshotBeforeUpdate!=null&&(w=p.getSnapshotBeforeUpdate(f,E)),B=y,y!=null&&y.type===Xe&&y.key==null&&(B=As(y.props.children)),s=bs(e,qt(B)?B:[B],t,r,n,i,o,a,s,u,d),p.base=t.__e,t.__u&=-161,p.__h.length&&a.push(p),S&&(p.__E=p.__=null)}catch(ne){if(t.__v=null,u||o!=null)if(ne.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(K=o.length;K--;)ji(o[K]);else t.__e=r.__e,t.__k=r.__k;M.__e(ne,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=$d(r.__e,t,r,n,i,o,a,u,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function Es(e,t,r){for(var n=0;n<r.length;n++)Vi(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function As(e){return typeof e!="object"||e==null?e:qt(e)?e.map(As):Je({},e)}function $d(e,t,r,n,i,o,a,s,u){var d,y,p,v,f,E,w,S=r.props,b=t.props,x=t.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(i,x,b.is&&b),s&&(M.__m&&M.__m(t,o),s=!1),o=null}if(x===null)S===b||s&&e.data===b||(e.data=b);else{if(o=o&&on.call(e.childNodes),S=r.props||$t,!s&&o!=null)for(S={},d=0;d<e.attributes.length;d++)S[(f=e.attributes[d]).name]=f.value;for(d in S)if(f=S[d],d!="children"){if(d=="dangerouslySetInnerHTML")p=f;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;tn(e,d,null,f,i)}}for(d in b)f=b[d],d=="children"?v=f:d=="dangerouslySetInnerHTML"?y=f:d=="value"?E=f:d=="checked"?w=f:s&&typeof f!="function"||S[d]===f||tn(e,d,f,S[d],i);if(y)s||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,qt(v)?v:[v],t,r,n,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&yt(r,0),s,u),o!=null)for(d=o.length;d--;)ji(o[d]);s||(d="value",x=="progress"&&E==null?e.removeAttribute("value"):E!==void 0&&(E!==e[d]||x=="progress"&&!E||x=="option"&&E!==S[d])&&tn(e,d,E,S[d],i),d="checked",w!==void 0&&w!==e[d]&&tn(e,d,w,S[d],i))}return e}function Vi(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(i){M.__e(i,r)}}function Is(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Vi(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Is(n[i],t,r||typeof e.type!="function");r||ji(e.__e),e.__c=e.__=e.__e=void 0}function qd(e,t,r){return this.constructor(e,r)}function Ss(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],Hi(t,e=(!n&&r||t).__k=Gt(Xe,null,[e]),i||$t,$t,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?on.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Es(o,e,a)}on=gs.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},ps=0,Bi=function(e){return e!=null&&e.constructor==null},Se.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Je({},this.state),typeof e=="function"&&(e=e(Je({},r),this.props)),e&&Je(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),ds(this))},Se.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ds(this))},Se.prototype.render=Xe,lt=[],ms=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,vs=function(e,t){return e.__v.__b-t.__v.__b},nn.__r=0,_s=/(PointerCapture)$|Capture$/i,Fi=0,Ui=hs(!1),Mi=hs(!0),jd=0;var bt,re,Ji,Rs,zt=0,Ns=[],ae=M,Ts=ae.__b,ks=ae.__r,xs=ae.diffed,Cs=ae.__c,Os=ae.unmount,Ps=ae.__;function sn(e,t){ae.__h&&ae.__h(re,e,zt||t),zt=0;var r=re.__H||(re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ln(e){return zt=1,Ls(Us,e)}function Ls(e,t,r){var n=sn(bt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Us(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=re,!re.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(v){return!!v.__c});if(y.every(function(v){return!v.__N}))return!o||o.call(this,s,u,d);var p=n.__c.props!==s;return y.forEach(function(v){if(v.__N){var f=v.__[0];v.__=v.__N,v.__N=void 0,f!==v.__[0]&&(p=!0)}}),o&&o.call(this,s,u,d)||p};re.__f=!0;var o=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},re.shouldComponentUpdate=i}return n.__N||n.__}function Wt(e,t){var r=sn(bt++,3);!ae.__s&&zi(r.__H,t)&&(r.__=e,r.u=t,re.__H.__h.push(r))}function qi(e,t){var r=sn(bt++,4);!ae.__s&&zi(r.__H,t)&&(r.__=e,r.u=t,re.__h.push(r))}function Gi(e){return zt=5,Qt(function(){return{current:e}},[])}function Qt(e,t){var r=sn(bt++,7);return zi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Ki(e,t){return zt=8,Qt(function(){return e},t)}function Gd(){for(var e;e=Ns.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(an),e.__H.__h.forEach($i),e.__H.__h=[]}catch(t){e.__H.__h=[],ae.__e(t,e.__v)}}ae.__b=function(e){re=null,Ts&&Ts(e)},ae.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ps&&Ps(e,t)},ae.__r=function(e){ks&&ks(e),bt=0;var t=(re=e.__c).__H;t&&(Ji===re?(t.__h=[],re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(an),t.__h.forEach($i),t.__h=[],bt=0)),Ji=re},ae.diffed=function(e){xs&&xs(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ns.push(t)!==1&&Rs===ae.requestAnimationFrame||((Rs=ae.requestAnimationFrame)||Kd)(Gd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Ji=re=null},ae.__c=function(e,t){t.some(function(r){try{r.__h.forEach(an),r.__h=r.__h.filter(function(n){return!n.__||$i(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ae.__e(n,r.__v)}}),Cs&&Cs(e,t)},ae.unmount=function(e){Os&&Os(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{an(n)}catch(i){t=i}}),r.__H=void 0,t&&ae.__e(t,r.__v))};var Ds=typeof requestAnimationFrame=="function";function Kd(e){var t,r=function(){clearTimeout(n),Ds&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ds&&(t=requestAnimationFrame(r))}function an(e){var t=re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),re=t}function $i(e){var t=re;e.__c=e.__(),re=t}function zi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Us(e,t){return typeof t=="function"?t(e):t}function Wd(e,t){for(var r in t)e[r]=t[r];return e}function Ms(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 Bs(e,t){this.props=e,this.context=t}(Bs.prototype=new Se).isPureReactComponent=!0,Bs.prototype.shouldComponentUpdate=function(e,t){return Ms(this.props,e)||Ms(this.state,t)};var Fs=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Fs&&Fs(e)};var og=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Qd=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}Qd(e,t,r,n)};var js=M.unmount;function Ks(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=Wd({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Ks(n,t,r)})),e}function zs(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return zs(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 Wi(){this.__u=0,this.o=null,this.__b=null}function Ws(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function un(){this.i=null,this.l=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),js&&js(e)},(Wi.prototype=new Se).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=Ws(n.__v),o=!1,a=function(){o||(o=!0,r.__R=null,i?i(s):s())};r.__R=a;var s=function(){if(!--n.__u){if(n.state.__a){var u=n.state.__a;n.__v.__k[0]=zs(u,u.__c.__P,u.__c.__O)}var d;for(n.setState({__a:n.__b=null});d=n.o.pop();)d.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},Wi.prototype.componentWillUnmount=function(){this.o=[]},Wi.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]=Ks(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&Gt(Xe,null,e.fallback);return i&&(i.__u&=-33),[Gt(Xe,null,t.__a?null:e.children),i]};var Hs=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]}};(un.prototype=new Se).__a=function(e){var t=this,r=Ws(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Hs(t,e,n)):i()};r?r(o):o()}},un.prototype.render=function(e){this.i=null,this.l=new Map;var t=Kt(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},un.prototype.componentDidUpdate=un.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Hs(e,r,t)})};var Yd=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)};function Qi(e,t,r){return t.__k==null&&(t.textContent=""),Ss(e,t),typeof r=="function"&&r(),e?e.__c:null}Se.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Se.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Vs=M.event;function nf(){}function of(){return this.cancelBubble}function af(){return this.defaultPrevented}M.event=function(e){return Vs&&(e=Vs(e)),e.persist=nf,e.isPropagationStopped=of,e.isDefaultPrevented=af,e.nativeEvent=e};var Qs,sf={enumerable:!1,configurable:!0,get:function(){return this.class}},Js=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||tf&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var u=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":u==="translate"&&s==="no"?s=!1:u[0]==="o"&&u[1]==="n"?u==="ondoubleclick"?a="ondblclick":u!=="onchange"||n!=="input"&&n!=="textarea"||rf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":Zd.test(a)&&(a=u):u=a="oninput":o&&Xd.test(a)?a=a.replace(ef,"-$&").toLowerCase():s===null&&(s=void 0),u==="oninput"&&i[a=u]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Kt(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",sf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Yd,Js&&Js(e)};var $s=M.__r;M.__r=function(e){$s&&$s(e),Qs=e.__c};var qs=M.diffed;M.diffed=function(e){qs&&qs(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),Qs=null};var Ys=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&&Ys)for(var n of Ys(e))t.indexOf(n)<0&&uf.call(e,n)&&(r[n]=e[n]);return r};function Re(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)}var no=class{constructor(t){Re(this,"context",void 0),Re(this,"continueCallback",void 0),Re(this,"adIsShowingCallback",void 0),Re(this,"isBeforeAdCalled",!1),Re(this,"isBeforeRewardCalled",!1),Re(this,"isAdDismissedCalled",!1),Re(this,"isAdViewedCalled",!1),Re(this,"isAfterAdCalled",!1),Re(this,"currentProvider",void 0),Re(this,"currentClientParams",void 0),Re(this,"adsHasResponse",!1),Re(this,"videoChecker",window.document.createElement("video")),Re(this,"wrapShowAdFn",r=>()=>{var n;this.adsHasResponse=!0;let i=!1;this.videoChecker.play().catch(()=>{i=!1}),i=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:i},this.paramsToTrack)),(n=this.adIsShowingCallback)==null||n.call(this,!0),r()}),this.context=t}get paramsToTrack(){var t,r,n,i,o,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:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0)))}}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,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return U(this,null,function*(){return this.currentProvider=t,this.currentClientParams=r,this.adsHasResponse=!1,new Promise(o=>{this.continueCallback=o,this.adIsShowingCallback=i;let a;switch(r.type){case"preroll":{a={type:r.type,adBreakDone:this.wrapAdBreakDone(r.adBreakDone)};break}case"reward":{a={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:{a={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 s,u,d,y,p;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(p=this.adIsShowingCallback)==null||p.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function cn(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)}var io=class{constructor(t){cn(this,"context",void 0),cn(this,"adBreakIsShowing",!1),cn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),cn(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()})}},wl=Object.defineProperty,mf=Object.defineProperties,vf=Object.getOwnPropertyDescriptors,Xs=Object.getOwnPropertySymbols,_f=Object.prototype.hasOwnProperty,gf=Object.prototype.propertyIsEnumerable,Zs=(e,t,r)=>t in e?wl(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)&&Zs(e,r,t[r]);if(Xs)for(var r of Xs(t))gf.call(t,r)&&Zs(e,r,t[r]);return e},bf=(e,t)=>mf(e,vf(t)),wf=(e,t)=>{for(var r in t)wl(e,r,{get:t[r],enumerable:!0})},El=(e,t,r,n)=>{for(var i=t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(i=a(i)||i);return i},Ef=(e,t,r)=>new Promise((n,i)=>{var o=u=>{try{s(r.next(u))}catch(d){i(d)}},a=u=>{try{s(r.throw(u))}catch(d){i(d)}},s=u=>u.done?n(u.value):Promise.resolve(u.value).then(o,a);s((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 i=this._eventListeners[r].indexOf(n);i!==-1&&this._eventListeners[r].splice(i,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}function Af(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function If(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 Al(e){let t=e,r=null,n=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return r||(r=new t(...o)),r};return n.prototype=t.prototype,n}var 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||{});function Yt(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var xf={log:Yt("log"),warn:Yt("warn"),info:Yt("info"),error:Yt("error"),debug:Yt("debug")};Object.assign(globalThis,{logger:xf});var el=Symbol.for("Jolibox.canIUseMap"),Cf={};globalThis[el]||(globalThis[el]=Cf);var tl=Symbol.for("Jolibox.canIUseMap.native"),Of={};globalThis[tl]||(globalThis[tl]=Of);var Il=(e=>(e[e.Other=0]="Other",e[e.Route=1]="Route",e[e.Click=2]="Click",e[e.View=3]="View",e[e.Expose=4]="Expose",e[e.Swipe=5]="Swipe",e[e.Input=6]="Input",e[e.Select=7]="Select",e[e.SwitchOn=8]="SwitchOn",e[e.SwitchOff=9]="SwitchOff",e[e.Submit=10]="Submit",e[e.Scroll=11]="Scroll",e[e.Hide=12]="Hide",e[e.System=1e3]="System",e[e.ErrorTrace=1001]="ErrorTrace",e[e.UserDefined=1002]="UserDefined",e))(Il||{}),Sl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Sl||{}),Rl=(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))(Rl||{}),rl=["name","params"],Pf=["name","type","location","target","extra","timestamp","userId"],Df=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function hn(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Nf(e){let t=e.location?hn(e.location,rl):null,r=e.target?hn(e.target,rl):null;return hn(bf(yf({},e),{location:t,target:r}),Pf)}function Lf(e){let t=e.events.map(n=>Nf(n)),r=hn(e.device,Df);return[e.protocolVersion,t,r,e.project]}function Uf(){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}}Uf();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");var oo=class ao{constructor(t){this.element=t,this.next=ao.Undefined,this.prev=ao.Undefined}};oo.Undefined=new oo(void 0);var te=oo,Mf=class{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let e=this._first;for(;e!==te.Undefined;){let t=e.next;e.prev=te.Undefined,e.next=te.Undefined,e=t}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new te(e);if(this._first===te.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==te.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==te.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==te.Undefined&&e.next!==te.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===te.Undefined&&e.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):e.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):e.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==te.Undefined;)yield e.element,e=e.next}},Bf=0,Xt=class{constructor(e){this.value=e,this.id=Bf++}},rr=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 Xt&&(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,i,o,a,s;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};t&&(e=e.bind(t));let u=new Xt(e);return this._listeners?this._listeners instanceof Xt?this._listeners=[this._listeners,u]:this._listeners.push(u):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=u,(o=(i=this.options)==null?void 0:i.onDidFirstListener)==null||o.call(i,this)),(s=(a=this.options)==null?void 0:a.onDidAddListener)==null||s.call(a,this),this._size++,()=>{var d,y,p,v;if(!this._disposed){if(this._listeners instanceof Xt)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let f=this._listeners.indexOf(u);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((v=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||v.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(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof Xt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ff=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 i=(n=this.listeners.get(e))!=null?n:new rr,o=u=>t(...u.args),a=i.event(o);this.listerHandlerMap.set(t,{handler:o,dispose:a}),this.listeners.set(e,i);let s=this.cachedEventQueue.get(e);if(s&&r)for(let u of s)t(...u.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,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];r||(r=new Mf,this.cachedEventQueue.set(e,r)),r.push({args:i}),t&&t.fire({event:e,args:i})}once(e,t){var r=this;let n=function(){t(...arguments),r.off(e,n)};this.on(e,n,!1)}},so={};wf(so,{None:()=>jf,filter:()=>Vf,once:()=>Tl,toPromise:()=>Hf});var jf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Hf(e){return new Promise(t=>Tl(e)(t))}function Tl(e){return function(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Vf(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new rr(n);return i.event})(function(r){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return e(i=>t(i)&&r.call(n,i),null)})}var Yi=Symbol.for("Jolibox.hostEmitter"),Jf=()=>{let e=new Ff;return globalThis[Yi]||(globalThis[Yi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Yi]};Jf();function $f(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)qf(e[n],t[n])}function qf(e,t){if(If(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")}}var lo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new rr,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 i of e.metadata.args)r.push(i.constraint);let n=e.handler;e.handler=function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return $f(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}};lo=El([Al],lo);var nl=class{constructor(){this._onWillExecuteCommand=new rr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new rr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new lo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Af(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 Ef(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),so.toPromise(so.filter(this.registry.onDidRegisterCommand,i=>i===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),i=1;i<r;i++)n[i-1]=arguments[i];this._onWillExecuteCommand.fire({commandId:e,args:n});let o=this.invokeFunction(t.handler,...n);return this._onDidExecuteCommand.fire({commandId:e,args:n}),o}_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{}}};nl=El([Al],nl);function Xi(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)}var uo=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Xi(this,"context",void 0),Xi(this,"placement","GAME"),Xi(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,i)=>{r[i]=n}),{name:this.placement==="GAME"?"GamePage":"DramaPage",params:r}}getDevice(){var t,r,n,i;return{platform:(t=this.contextInfo.platform)!=null?t:Rl.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:(i=this.contextInfo.deviceBrand)!=null?i:"UnknownBrand",uuid:this.contextInfo.deviceId,jsSdkVersion:"1.0.0",extra:{}}}serialize(t,r){var n;let i={protocolVersion:"1.0.0",events:[{name:t,type:Il.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Sl.WebSDK};return Lf(i)}};function dn(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=Wf(e,"string");return typeof t=="symbol"?t:t+""}function Wf(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 co=class{constructor(t){dn(this,"configs",null),dn(this,"firstRun",!0),dn(this,"context",void 0),dn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return U(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 i=(t=this.contextInfo.channel)!=null?t:"",o=this.configs[i],a=(r=o==null?void 0:o.interstitialRate)!=null?r:1;n=Math.random()<a}return this.firstRun=!1,n}};function $e(e,t,r){return(t=Qf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qf(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)}var fo=class{constructor(t,r){$e(this,"name","ADSENSE"),$e(this,"context",void 0),$e(this,"contextInfo",void 0),$e(this,"configured",!1),$e(this,"initParams",void 0),$e(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),$e(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=cf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),$e(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),$e(this,"adUnit",n=>U(this,null,function*(){var i,o,a,s;if(this.context.track("CallAdUnit",{adFormat:(o=(i=n.adFormat)==null?void 0:i.toString())!=null?o:null,fullWidthResponsive:(a=n.fullWidthResponsive)!=null?a:null}),document.querySelector("#jolibox-ads")){console.warn("Ad unit already set, skipping");return}let{el:u,slot:d,adFormat:y,fullWidthResponsive:p,style:v}=n,f;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?f=document.querySelector(u):f=u,!f)throw new Error("targeting element not found");let E=d;if(E||(E=this.initParams.unitId),!E)throw new Error("slot is required");let w=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,S=document.createElement("ins");if(S.className="adsbygoogle",S.id="jolibox-ads",S.style.display="block",S.setAttribute("data-ad-client",this.initParams.clientId),S.setAttribute("data-ad-slot",E),w&&S.setAttribute("data-ad-format",w),p&&S.setAttribute("data-full-width-responsive",p),v&&S.setAttribute("style",v),(s=this.contextInfo.testAdsMode)!=null?s:!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",S.style.position="relative",f.appendChild(S),S.appendChild(b)}else f.appendChild(S),new MutationObserver(b=>{b.forEach(x=>{if(x.type==="attributes"&&x.attributeName==="data-ad-status"){let P=S.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:P!=null?P:"null"})}})}).observe(S,{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 U(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 i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&this.initParams.admobRewardedSlot&&(i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on")),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};function Xf(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 Zf(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}var eh=function(){function e(r){var n=this;this._insertTag=function(i){var o;n.tags.length===0?n.insertionPoint?o=n.insertionPoint.nextSibling:n.prepend?o=n.container.firstChild:o=n.before:o=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,o),n.tags.push(i)},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(Zf(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Xf(n);try{i.insertRule(r,i.cssRules.length)}catch(o){}}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}(),_e="-ms-",yn="-moz-",J="-webkit-",kl="comm",Eo="rule",Ao="decl",th="@import",xl="@keyframes",rh="@layer",nh=Math.abs,In=String.fromCharCode,ih=Object.assign;function oh(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 Cl(e){return e.trim()}function ah(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function ho(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function nr(e,t,r){return e.slice(t,r)}function Le(e){return e.length}function Io(e){return e.length}function fn(e,t){return t.push(e),e}function sh(e,t){return e.map(t).join("")}var Sn=1,It=1,Ol=0,Ie=0,ce=0,St="";function Rn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Sn,column:It,length:a,return:""}}function Zt(e,t){return ih(Rn("",null,null,"",null,null,0),e,{length:-e.length},t)}function lh(){return ce}function uh(){return ce=Ie>0?he(St,--Ie):0,It--,ce===10&&(It=1,Sn--),ce}function ke(){return ce=Ie<Ol?he(St,Ie++):0,It++,ce===10&&(It=1,Sn++),ce}function Ue(){return he(St,Ie)}function pn(){return Ie}function or(e,t){return nr(St,e,t)}function ir(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 Pl(e){return Sn=It=1,Ol=Le(St=e),Ie=0,[]}function Dl(e){return St="",e}function mn(e){return Cl(or(Ie-1,po(e===91?e+2:e===40?e+1:e)))}function ch(e){for(;(ce=Ue())&&ce<33;)ke();return ir(e)>2||ir(ce)>3?"":" "}function dh(e,t){for(;--t&&ke()&&!(ce<48||ce>102||ce>57&&ce<65||ce>70&&ce<97););return or(e,pn()+(t<6&&Ue()==32&&ke()==32))}function po(e){for(;ke();)switch(ce){case e:return Ie;case 34:case 39:e!==34&&e!==39&&po(ce);break;case 40:e===41&&po(e);break;case 92:ke();break}return Ie}function fh(e,t){for(;ke()&&e+ce!==57&&!(e+ce===84&&Ue()===47););return"/*"+or(t,Ie-1)+"*"+In(e===47?e:ke())}function hh(e){for(;!ir(Ue());)ke();return or(e,Ie)}function ph(e){return Dl(vn("",null,null,null,[""],e=Pl(e),0,[0],e))}function vn(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,p=a,v=0,f=0,E=0,w=1,S=1,b=1,x=0,P="",H=i,X=o,R=n,D=P;S;)switch(E=x,x=ke()){case 40:if(E!=108&&he(D,p-1)==58){ho(D+=$(mn(x),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:D+=mn(x);break;case 9:case 10:case 13:case 32:D+=ch(E);break;case 92:D+=dh(pn()-1,7);continue;case 47:switch(Ue()){case 42:case 47:fn(mh(fh(ke(),pn()),t,r),u);break;default:D+="/"}break;case 123*w:s[d++]=Le(D)*b;case 125*w:case 59:case 0:switch(x){case 0:case 125:S=0;case 59+y:b==-1&&(D=$(D,/\f/g,"")),f>0&&Le(D)-p&&fn(f>32?ol(D+";",n,r,p-1):ol($(D," ","")+";",n,r,p-2),u);break;case 59:D+=";";default:if(fn(R=il(D,t,r,d,y,i,s,P,H=[],X=[],p),o),x===123)if(y===0)vn(D,t,R,R,H,o,p,s,X);else switch(v===99&&he(D,3)===110?100:v){case 100:case 108:case 109:case 115:vn(e,R,R,n&&fn(il(e,R,R,0,0,i,s,P,i,H=[],p),X),i,X,p,s,n?H:X);break;default:vn(D,R,R,R,[""],X,0,s,X)}}d=y=f=0,w=b=1,P=D="",p=a;break;case 58:p=1+Le(D),f=E;default:if(w<1){if(x==123)--w;else if(x==125&&w++==0&&uh()==125)continue}switch(D+=In(x),x*w){case 38:b=y>0?1:(D+="\f",-1);break;case 44:s[d++]=(Le(D)-1)*b,b=1;break;case 64:Ue()===45&&(D+=mn(ke())),v=Ue(),y=p=Le(P=D+=hh(pn())),x++;break;case 45:E===45&&Le(D)==2&&(w=0)}}return o}function il(e,t,r,n,i,o,a,s,u,d,y){for(var p=i-1,v=i===0?o:[""],f=Io(v),E=0,w=0,S=0;E<n;++E)for(var b=0,x=nr(e,p+1,p=nh(w=a[E])),P=e;b<f;++b)(P=Cl(w>0?v[b]+" "+x:$(x,/&\f/g,v[b])))&&(u[S++]=P);return Rn(e,t,r,i===0?Eo:s,u,d,y)}function mh(e,t,r){return Rn(e,t,r,kl,In(lh()),nr(e,2,-2),0)}function ol(e,t,r,n){return Rn(e,t,r,Ao,nr(e,0,n),nr(e,n+1,-1),n)}function At(e,t){for(var r="",n=Io(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function vh(e,t,r,n){switch(e.type){case rh:if(e.children.length)break;case th:case Ao:return e.return=e.return||e.value;case kl:return"";case xl:return e.return=e.value+"{"+At(e.children,n)+"}";case Eo:e.value=e.props.join(",")}return Le(r=At(e.children,n))?e.return=e.value+"{"+r+"}":""}function _h(e){var t=Io(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}function gh(e){return function(t){t.root||(t=t.return)&&e(t)}}function yh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var bh=function(e,t,r){for(var n=0,i=0;n=i,i=Ue(),n===38&&i===12&&(t[r]=1),!ir(i);)ke();return or(e,Ie)},wh=function(e,t){var r=-1,n=44;do switch(ir(n)){case 0:n===38&&Ue()===12&&(t[r]=1),e[r]+=bh(Ie-1,t,r);break;case 2:e[r]+=mn(n);break;case 4:if(n===44){e[++r]=Ue()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=In(n)}while(n=ke());return e},Eh=function(e,t){return Dl(wh(Pl(e),t))},al=new WeakMap,Ah=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&&!al.get(r))&&!n){al.set(e,!0);for(var i=[],o=Eh(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var d=0;d<a.length;d++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Ih=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Nl(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+yn+e+_e+e+e;case 6828:case 4268:return J+e+_e+e+e;case 6165:return J+e+_e+"flex-"+e+e;case 5187:return J+e+$(e,/(\w+).+(:[^]+)/,J+"box-$1$2"+_e+"flex-$1$2")+e;case 5443:return J+e+_e+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return J+e+_e+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return J+e+_e+$(e,"shrink","negative")+e;case 5292:return J+e+_e+$(e,"basis","preferred-size")+e;case 6060:return J+"box-"+$(e,"-grow","")+J+e+_e+$(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"+_e+"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(Le(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+yn+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~ho(e,"stretch")?Nl($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,Le(e)-3-(~ho(e,"!important")&&10))){case 107:return $(e,":",":"+J)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(he(e,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+_e+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return J+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return J+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return J+e+_e+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return J+e+_e+e+e}return e}var Sh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Ao:e.return=Nl(e.value,e.length);break;case xl:return At([Zt(e,{value:$(e.value,"@","@"+J)})],n);case Eo:if(e.length)return sh(e.props,function(i){switch(ah(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return At([Zt(e,{props:[$(i,/:(read-\w+)/,":"+yn+"$1")]})],n);case"::placeholder":return At([Zt(e,{props:[$(i,/:(plac\w+)/,":"+J+"input-$1")]}),Zt(e,{props:[$(i,/:(plac\w+)/,":"+yn+"$1")]}),Zt(e,{props:[$(i,/:(plac\w+)/,_e+"input-$1")]})],n)}return""})}},Rh=[Sh],Th=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(E){var w=E.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(E),E.setAttribute("data-s",""))})}var n=e.stylisPlugins||Rh,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(E){for(var w=E.getAttribute("data-emotion").split(" "),S=1;S<w.length;S++)i[w[S]]=!0;a.push(E)});var s,u=[Ah,Ih];{var d,y=[vh,gh(function(E){d.insert(E)})],p=_h(u.concat(n,y)),v=function(E){return At(ph(E),p)};s=function(E,w,S,b){d=S,v(E?E+"{"+w.styles+"}":w.styles),b&&(f.inserted[w.name]=!0)}}var f={key:t,sheet:new eh({key:t,container:o,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:s};return f.sheet.hydrate(a),f};function kh(e){for(var t=0,r,n=0,i=e.length;i>=4;++n,i-=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(i){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)}var 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,Ll=function(e){return e.charCodeAt(1)===45},sl=function(e){return e!=null&&typeof e!="boolean"},Zi=yh(function(e){return Ll(e)?e:e.replace(Ch,"-$&").toLowerCase()}),ll=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Oh,function(r,n,i){return Ze={name:n,styles:i,next:Ze},n})}return xh[e]!==1&&!Ll(e)&&typeof t=="number"&&t!==0?t+"px":t};function bn(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 i=r;if(i.anim===1)return Ze={name:i.name,styles:i.styles,next:Ze},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)Ze={name:a.name,styles:a.styles,next:Ze},a=a.next;var s=o.styles+";";return s}return Ph(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function Ph(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=bn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":sl(s)&&(n+=Zi(o)+":"+ll(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var u=0;u<a.length;u++)sl(a[u])&&(n+=Zi(o)+":"+ll(o,a[u])+";");else{var d=bn(e,t,a);switch(o){case"animation":case"animationName":{n+=Zi(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var ul=/label:\s*([^\s;{]+)\s*(;|$)/g,Ze;function eo(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,i="";Ze=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=bn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=bn(r,t,e[s]),n){var u=o;i+=u[s]}ul.lastIndex=0;for(var d="",y;(y=ul.exec(i))!==null;)d+="-"+y[1];var p=kh(i)+d;return{name:p,styles:i,next:Ze}}function Ul(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var Dh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Nh=function(e,t,r){Dh(e,t);var n=e.key+"-"+t.name;if(e.inserted[t.name]===void 0){var i=t;do e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next;while(i!==void 0)}};function cl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function dl(e,t,r){var n=[],i=Ul(e,n,r);return n.length<2?r:i+t(n)}var Lh=function(e){var t=Th(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=eo(s,t.registered,void 0);return Nh(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=eo(s,t.registered),y="animation-"+d.name;return cl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];var d=eo(s,t.registered);cl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return dl(t.registered,r,Uh(s))};return{css:r,cx:o,injectGlobal:i,keyframes:n,hydrate:function(a){a.forEach(function(s){t.inserted[s]=!0})},flush:function(){t.registered={},t.inserted={},t.sheet.flush()},sheet:t.sheet,cache:t,getRegisteredStyles:Ul.bind(null,t.registered),merge:dl.bind(null,t.registered,r)}},Uh=function e(t){for(var r="",n=0;n<t.length;n++){var i=t[n];if(i!=null){var o=void 0;switch(typeof i){case"boolean":break;case"object":{if(Array.isArray(i))o=e(i);else{o="";for(var a in i)i[a]&&a&&(o&&(o+=" "),o+=a)}break}default:o=i}o&&(r&&(r+=" "),r+=o)}}return r},Mh=Lh({key:"css"}),Rt=Mh.css,mo,Te,to,fl,hl=0,Ml=[],de=M,pl=de.__b,ml=de.__r,vl=de.diffed,_l=de.__c,gl=de.unmount,yl=de.__;function Bh(e,t){de.__h&&de.__h(Te,e,hl||t),hl=0;var r=Te.__H||(Te.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Bl(e,t){var r=Bh(mo++,7);return Hh(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Fh(){for(var e;e=Ml.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(_n),e.__H.__h.forEach(vo),e.__H.__h=[]}catch(t){e.__H.__h=[],de.__e(t,e.__v)}}de.__b=function(e){Te=null,pl&&pl(e)},de.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),yl&&yl(e,t)},de.__r=function(e){ml&&ml(e),mo=0;var t=(Te=e.__c).__H;t&&(to===Te?(t.__h=[],Te.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(_n),t.__h.forEach(vo),t.__h=[],mo=0)),to=Te},de.diffed=function(e){vl&&vl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Ml.push(t)!==1&&fl===de.requestAnimationFrame||((fl=de.requestAnimationFrame)||jh)(Fh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),to=Te=null},de.__c=function(e,t){t.some(function(r){try{r.__h.forEach(_n),r.__h=r.__h.filter(function(n){return!n.__||vo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],de.__e(n,r.__v)}}),_l&&_l(e,t)},de.unmount=function(e){gl&&gl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{_n(n)}catch(i){t=i}}),r.__H=void 0,t&&de.__e(t,r.__v))};var bl=typeof requestAnimationFrame=="function";function jh(e){var t,r=function(){clearTimeout(n),bl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);bl&&(t=requestAnimationFrame(r))}function _n(e){var t=Te,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Te=t}function vo(e){var t=Te;e.__c=e.__(),Te=t}function Hh(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var Vh=Symbol.for("preact-signals");function Tn(){if(et>1)et--;else{for(var e,t=!1;er!==void 0;){var r=er;for(er=void 0,_o++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&jl(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(_o=0,et--,t)throw e}}function Ae(e){if(et>0)return e();et++;try{return e()}finally{Tn()}}var Q=void 0,er=void 0,et=0,_o=0,wn=0;function Fl(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 pe(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}pe.prototype.brand=Vh;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 sr(function(){var r=t.value,n=Q;Q=void 0;try{e(r)}finally{Q=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=Q;Q=void 0;try{return this.value}finally{Q=e}};Object.defineProperty(pe.prototype,"value",{get:function(){var e=Fl(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(_o>100)throw new Error("Cycle detected");this.v=e,this.i++,wn++,et++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Tn()}}}});function Y(e){return new pe(e)}function jl(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 Hl(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 Vl(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 Tt(e){pe.call(this,void 0),this.x=e,this.s=void 0,this.g=wn-1,this.f=4}(Tt.prototype=new pe).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===wn))return!0;if(this.g=wn,this.f|=1,this.i>0&&!jl(this))return this.f&=-2,!0;var e=Q;try{Hl(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,Vl(this),this.f&=-2,!0};Tt.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)};Tt.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)}};Tt.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(Tt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Fl(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function tr(e){return new Tt(e)}function Jl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){et++;var r=Q;Q=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,So(e),n}finally{Q=r,Tn()}}}function So(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Jl(e)}function Jh(e){if(Q!==this)throw new Error("Out-of-order effect");Vl(this),Q=e,this.f&=-2,8&this.f&&So(this),Tn()}function ar(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ar.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()}};ar.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Jl(this),Hl(this),et++;var e=Q;return Q=this,Jh.bind(this,e)};ar.prototype.N=function(){2&this.f||(this.f|=2,this.o=er,er=this)};ar.prototype.d=function(){this.f|=8,1&this.f||So(this)};function sr(e){var t=new ar(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var $l,ro,ql=[];sr(function(){$l=this.N})();function kt(e,t){M[e]=t.bind(null,M[e]||function(){})}function En(e){ro&&ro(),ro=e&&e.S()}function Gl(e){var t=this,r=e.data,n=Kl(r);n.value=r;var i=Bl(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=tr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=tr(function(){return!Array.isArray(d.value)&&!Bi(d.value)}),p=sr(function(){if(this.N=zl,y.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),v=t.__$u.d;return t.__$u.d=function(){p(),v.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}Gl.displayName="_st";Object.defineProperties(pe.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Gl},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});kt("__b",function(e,t){if(typeof t.type=="string"){var r,n=t.props;for(var i in n)if(i!=="children"){var o=n[i];o instanceof pe&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});kt("__r",function(e,t){En();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return sr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),En(r),e(t)});kt("__e",function(e,t,r,n){En(),e(t,r,n)});kt("diffed",function(e,t){En();var r;if(typeof t.type=="string"&&(r=t.__e)){var n=t.__np,i=t.props;if(n){var o=r.U;if(o)for(var a in o){var s=o[a];s!==void 0&&!(a in n)&&(s.d(),o[a]=void 0)}else o={},r.U=o;for(var u in n){var d=o[u],y=n[u];d===void 0?(d=$h(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});function $h(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=Y(r);return{o:function(a,s){o.value=a,n=s},d:sr(function(){this.N=zl;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}kt("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 i in n){var o=n[i];o&&o.d()}}}}else{var a=t.__c;if(a){var s=a.__$u;s&&(a.__$u=void 0,s.d())}}e(t)});kt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Se.prototype.shouldComponentUpdate=function(e,t){var r=this.__$u,n=r&&r.s!==void 0;for(var i in t)return!0;if(this.__f||typeof this.u=="boolean"&&this.u===!0){var o=2&this.__$f;if(!(n||o||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 s in this.props)if(!(s in e))return!0;return!1};function Kl(e){return Bl(function(){return Y(e)},[])}var qh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Gh(){Ae(function(){for(var e;e=ql.shift();)$l.call(e)})}function zl(){ql.push(this)===1&&(M.requestAnimationFrame||qh)(Gh)}var ge=Rt`
4
4
  inset: 0;
5
5
  clear: none;
6
6
  float: none;
@@ -18,7 +18,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{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
- `;function qh(e,t){let r=qi(e);$i(()=>{r.current=e},[e]),Wt(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}var Gh=0;function se(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Gh,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return M.vnode&&M.vnode(d),d}var Kh=Rt`
21
+ `;function Kh(e,t){let r=Gi(e);qi(()=>{r.current=e},[e]),Wt(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}var zh=0;function se(e,t,r,n,i,o){t||(t={});var a,s,u=t;if("ref"in u)for(s in u={},t)s=="ref"?a=t[s]:u[s]=t[s];var d={type:e,props:u,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--zh,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)u[s]===void 0&&(u[s]=a[s]);return M.vnode&&M.vnode(d),d}var Wh=Rt`
22
22
  ${ge}
23
23
  position: fixed;
24
24
  top: 0;
@@ -93,7 +93,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
93
93
  }
94
94
  }
95
95
  }
96
- `,Ke=Y(null),_o=Y(""),go=Y(""),_n=Y(!1),zh=()=>{var e;(e=Ke.value)==null||e.call(Ke,!1)},Wh=()=>{var e;(e=Ke.value)==null||e.call(Ke,!0)},Qh=e=>U(void 0,null,function*(){let{title:t,content:r}=e;return Ke.value&&(Ke.value(!1),Ee(()=>{Ke.value=null,_n.value=!1})),Ee(()=>{_o.value=t||"",go.value=r||"",_n.value=!0}),new Promise(n=>{Ke.value=i=>{Ee(()=>{Ke.value=null,_n.value=!1,_o.value="",go.value=""}),n(i)}})}),Yh=()=>_n.value?se("div",{className:Kh,children:se("div",{className:"card-wrapper",children:[se("div",{className:"body",children:[se("div",{className:"title",children:_o.value}),se("div",{className:"content",children:go.value})]}),se("div",{className:"footer",children:[se("button",{onClick:zh,className:"cancel-btn",children:"Cancel"}),se("button",{onClick:Wh,className:"confirm-btm",children:"Confirm"})]})]})}):null,Xh=Rt`
96
+ `,Ke=Y(null),go=Y(""),yo=Y(""),gn=Y(!1),Qh=()=>{var e;(e=Ke.value)==null||e.call(Ke,!1)},Yh=()=>{var e;(e=Ke.value)==null||e.call(Ke,!0)},Xh=e=>U(void 0,null,function*(){let{title:t,content:r}=e;return Ke.value&&(Ke.value(!1),Ae(()=>{Ke.value=null,gn.value=!1})),Ae(()=>{go.value=t||"",yo.value=r||"",gn.value=!0}),new Promise(n=>{Ke.value=i=>{Ae(()=>{Ke.value=null,gn.value=!1,go.value="",yo.value=""}),n(i)}})}),Zh=()=>gn.value?se("div",{className:Wh,children:se("div",{className:"card-wrapper",children:[se("div",{className:"body",children:[se("div",{className:"title",children:go.value}),se("div",{className:"content",children:yo.value})]}),se("div",{className:"footer",children:[se("button",{onClick:Qh,className:"cancel-btn",children:"Cancel"}),se("button",{onClick:Yh,className:"confirm-btm",children:"Confirm"})]})]})}):null,ep=Rt`
97
97
  ${ge}
98
98
  position: relative;
99
99
  display: flex;
@@ -126,7 +126,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
126
126
  cursor: not-allowed;
127
127
  }
128
128
  }
129
- `,Zh=()=>{let e=Y(!1),t=Y(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Ee(()=>{t.value=Date.now(),e.value=!1})}}},ep=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=ql(t);qh(()=>{s.value>0?s.value-=1:Ee(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let u=tr(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!o.value)return!1;let f=Date.now()-o.value;return s.value>0&&t-s.value>=5&&f>=5e3}),d=tr(()=>{if(r==="interstitial")return!0;if(!o.value)return!1;let f=Date.now()-o.value;return s.value<=0&&f>=(t-1)*1e3&&t>5}),y=tr(()=>r==="interstitial"?!1:!u.value&&!d.value),p=()=>U(void 0,null,function*(){if(a.value=!0,!(yield Qh({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Ee(()=>{a.value=!0,s.value=0,o.value=null})}),v=()=>{n("viewed"),Ee(()=>{a.value=!0,s.value=0,o.value=null})};return se("div",{className:Xh,children:[s.value>0&&r!=="interstitial"&&se("div",{className:"timer",children:[s.value,"s"]}),se("button",{onClick:u.value?p:d.value?v:void 0,disabled:y.value,children:se("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:se("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"})})})]})},tp=()=>{let e=Y(),t=Y(),r=Y(),n=Y(),i=Y(),o=Y(!1),a=Y(15),s=Y(""),u=Y("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:u}},rp=Rt`
129
+ `,tp=()=>{let e=Y(!1),t=Y(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Ae(()=>{t.value=Date.now(),e.value=!1})}}},rp=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=Kl(t);Kh(()=>{s.value>0?s.value-=1:Ae(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let u=tr(()=>{if(r==="interstitial"||r==="rewarded_insterstitial"||!o.value)return!1;let f=Date.now()-o.value;return s.value>0&&t-s.value>=5&&f>=5e3}),d=tr(()=>{if(r==="interstitial")return!0;if(!o.value)return!1;let f=Date.now()-o.value;return s.value<=0&&f>=(t-1)*1e3&&t>5}),y=tr(()=>r==="interstitial"?!1:!u.value&&!d.value),p=()=>U(void 0,null,function*(){if(a.value=!0,!(yield Xh({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Ae(()=>{a.value=!0,s.value=0,o.value=null})}),v=()=>{n("viewed"),Ae(()=>{a.value=!0,s.value=0,o.value=null})};return se("div",{className:ep,children:[s.value>0&&r!=="interstitial"&&se("div",{className:"timer",children:[s.value,"s"]}),se("button",{onClick:u.value?p:d.value?v:void 0,disabled:y.value,children:se("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:se("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"})})})]})},np=()=>{let e=Y(),t=Y(),r=Y(),n=Y(),i=Y(),o=Y(!1),a=Y(15),s=Y(""),u=Y("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:u}},ip=Rt`
130
130
  ${ge}
131
131
  position: fixed;
132
132
  z-index: 2147483647;
@@ -145,7 +145,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
145
145
  width: 100%;
146
146
  height: 100%;
147
147
  }
148
- `,np=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:u,src:d,mode:y}=t,p=Qt(()=>Zh(),[]),[v,f]=sn(!1),E=S=>{var b,x,P,H;s.value=!1,S==="dismiss"?(b=n.value)==null||b.call(n):S==="viewed"&&((x=i.value)==null||x.call(i)),(P=r.value)==null||P.call(r),(H=o.value)==null||H.call(o),f(!1)},w=Gi(()=>{var S;v||(f(!0),(S=a.value)==null||S.call(a))},[v]);return Wt(()=>{v&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{p.startTimer()},100)},[v,y.value]),s.value?se("div",{className:rp,children:[se(ep,{mode:y.value,onClose:E,countdown:u.value,state:p}),s.value&&se("iframe",{src:d.value,onLoad:w,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"}),se(Yh,{})]}):null};function qe(e,t,r){return(t=ip(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ip(e){var t=op(e,"string");return typeof t=="symbol"?t:t+""}function op(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 yo=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",tp()),this.context=t,this.initParams=r}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Wi(se(np,{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 U(this,null,function*(){var n,i,o,a,s,u,d,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){(i=t.adBreakDone)==null||i.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":{(o=t.adBreakDone)==null||o.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 f;this.adsIsShowing=!1,(f=t.afterAd)==null||f.call(t)},v=()=>{var f;this.adsIsShowing=!1,(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Ee(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=v,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let p=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},v={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},f=()=>{var b;this.adsIsShowing=!1,v.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},E=()=>{var b;this.adsIsShowing=!1,v.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,v)};Ee(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=f,this.state.adViewed.value=E,this.state.adBreakDone.value=w});let S=()=>{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,Ee(()=>{var x;this.state.countdown.value=(x=r.params.countdown)!=null?x: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,S);break}}})}},Et={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Et[e.data.type]&&Et[e.data.type].forEach(t=>{t(e.data.data)})});var wt=(e,t)=>{Wt(()=>(Et[e]||(Et[e]=new Set),Et[e].add(t),()=>{Et[e].delete(t)}),[e,t])},ap=()=>{let e=Y(),t=Y(),r=Y(),n=Y(),i=Y(),o=Y(),a=Y(),s=Y(!1),u=Y("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:u}},sp=Rt`
148
+ `,op=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:u,src:d,mode:y}=t,p=Qt(()=>tp(),[]),[v,f]=ln(!1),E=S=>{var b,x,P,H;s.value=!1,S==="dismiss"?(b=n.value)==null||b.call(n):S==="viewed"&&((x=i.value)==null||x.call(i)),(P=r.value)==null||P.call(r),(H=o.value)==null||H.call(o),f(!1)},w=Ki(()=>{var S;v||(f(!0),(S=a.value)==null||S.call(a))},[v]);return Wt(()=>{v&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{p.startTimer()},100)},[v,y.value]),s.value?se("div",{className:ip,children:[se(rp,{mode:y.value,onClose:E,countdown:u.value,state:p}),s.value&&se("iframe",{src:d.value,onLoad:w,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"}),se(Zh,{})]}):null};function qe(e,t,r){return(t=ap(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ap(e){var t=sp(e,"string");return typeof t=="symbol"?t:t+""}function sp(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 bo=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",np()),this.context=t,this.initParams=r}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Qi(se(op,{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 U(this,null,function*(){var n,i,o,a,s,u,d,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){(i=t.adBreakDone)==null||i.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":{(o=t.adBreakDone)==null||o.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 f;this.adsIsShowing=!1,(f=t.afterAd)==null||f.call(t)},v=()=>{var f;this.adsIsShowing=!1,(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Ae(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=v,this.state.src.value=r.params.url,this.state.mode.value="interstitial",this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let p=()=>{var b;this.adsIsShowing=!1,(b=t.afterAd)==null||b.call(t)},v={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},f=()=>{var b;this.adsIsShowing=!1,v.breakStatus="dismissed",(b=t.adDismissed)==null||b.call(t)},E=()=>{var b;this.adsIsShowing=!1,v.breakStatus="viewed",(b=t.adViewed)==null||b.call(t)},w=()=>{var b;this.adsIsShowing=!1,(b=t.adBreakDone)==null||b.call(t,v)};Ae(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=f,this.state.adViewed.value=E,this.state.adBreakDone.value=w});let S=()=>{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,Ae(()=>{var x;this.state.countdown.value=(x=r.params.countdown)!=null?x: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,S);break}}})}},Et={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Et[e.data.type]&&Et[e.data.type].forEach(t=>{t(e.data.data)})});var wt=(e,t)=>{Wt(()=>(Et[e]||(Et[e]=new Set),Et[e].add(t),()=>{Et[e].delete(t)}),[e,t])},lp=()=>{let e=Y(),t=Y(),r=Y(),n=Y(),i=Y(),o=Y(),a=Y(),s=Y(!1),u=Y("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:u}},up=Rt`
149
149
  ${ge}
150
150
  position: fixed;
151
151
  z-index: 2147483647;
@@ -164,7 +164,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
164
164
  width: 100%;
165
165
  height: 100%;
166
166
  }
167
- `,lp=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,p]=sn(!1),v=E=>{var w,S,b,x;p(!1),u.value=!1,E==="dismiss"?(w=n.value)==null||w.call(n):E==="viewed"&&((S=i.value)==null||S.call(i)),(b=r.value)==null||b.call(r),(x=o.value)==null||x.call(o)},f=()=>{var E;(E=a.value)==null||E.call(a)};return wt("appsrockets_ad_dismissed",()=>v("dismiss")),wt("appsrockets_ad_rewarded",()=>v("viewed")),wt("appsrockets_ad_completed",()=>v("viewed")),wt("appsrockets_ad_skipped",()=>v("viewed")),wt("appsrockets_ad_clicked",E=>{var w;return(w=s.value)==null?void 0:w.call(s,E)}),wt("appsrockets_ad_loaded",()=>p(!0)),u.value?se("div",{className:sp,style:{display:y?"flex":"none"},children:u.value&&se("iframe",{src:d.value,onLoad:f,allowFullScreen:!0,allow:"autoplay",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"})}):null};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)}var bo=class{constructor(t,r){Ge(this,"name","APPSROCKETS"),Ge(this,"initialized",!1),Ge(this,"initCompleter",null),Ge(this,"context",void 0),Ge(this,"adsOverlay",null),Ge(this,"adsIsShowing",!1),Ge(this,"lastUnDisplayedAdBreak",null),Ge(this,"state",ap()),Ge(this,"processUrl",n=>{var i;let o=this.context.getContextInfo(),a=new URL(n),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",o.joliSource),s.get("osType")||s.set("osType",o.osType),s.get("runtimeType")||s.set("runtimeType",o.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",o.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((i=this.context.getWindowInfo().statusBarHeight)!=null?i:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Wi(se(lp,{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){var n,i,o,a,s,u,d,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){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let p=v=>{var f,E;(E=(f=this.context).handleLinkClicked)==null||E.call(f,v)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.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 v=()=>{var w;this.adsIsShowing=!1,(w=t.afterAd)==null||w.call(t)},f=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},E=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Ee(()=>{this.adsIsShowing=!0,this.state.afterAd.value=v,this.state.adBreakDone.value=f,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=p,this.state.adError.value=E,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let v=()=>{var P;this.adsIsShowing=!1,(P=t.afterAd)==null||P.call(t)},f={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},E=()=>{var P;this.adsIsShowing=!1,f.breakStatus="dismissed",(P=t.adDismissed)==null||P.call(t)},w=()=>{var P;this.adsIsShowing=!1,f.breakStatus="viewed",(P=t.adViewed)==null||P.call(t)},S=()=>{var P;this.adsIsShowing=!1,(P=t.adBreakDone)==null||P.call(t,f)},b=()=>{this.adsIsShowing=!1,f.breakStatus="noAdPreloaded"};Ee(()=>{this.state.afterAd.value=v,this.state.adDismissed.value=E,this.state.adViewed.value=w,this.state.adBreakDone.value=S,this.state.adLinkClicked.value=p,this.state.adError.value=b});let x=()=>{var P;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(P=t.adBreakDone)==null||P.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ee(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,x);break}}}};function Ne(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 En=class{constructor(t){if(Ne(this,"context",void 0),Ne(this,"contextInfo",void 0),Ne(this,"providers",{}),Ne(this,"channelPolicy",void 0),Ne(this,"adsActionDetection",void 0),Ne(this,"adsTrackSerializer",void 0),Ne(this,"initialized",!1),Ne(this,"adsIsShowing",!1),Ne(this,"lastAdBreak",void 0),Ne(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new uo(this.context),this.adsActionDetection=new no(this.context),this.adsTrackSerializer=new lo(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;let{width:i,height:o}=this.context.getWindowInfo();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",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return U(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":case"ADSENSE_ADMOB":{let i=new co(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new yo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new bo(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return U(this,null,function*(){var r,n,i,o,a,s,u,d,y,p;let v=Date.now();if(v-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&v-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=v,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:f,code:E}=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(E!=="SUCCESS"){(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let w=f==null?void 0:f.sort((P,H)=>P.seq-H.seq);if(w.length===0){(u=t.adBreakDone)==null||u.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let S=!0,b=null,x=new ro(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;w.length>0;){let P=w.shift(),H=this.providers[P.provider];if(H){let[X,R]=yield x.callAdBreakAndContinue(H,t,P,D=>{var O;this.adsIsShowing=D,(O=this.context.eventEmitter)==null||O.emit("isAdShowing",D)});S=X,b=R}else S=!0,b={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!S)break}S&&b&&((d=t.adBreakDone)==null||d.call(t,b))}}catch(f){(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(p=this.context.eventEmitter)==null||p.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.")}};var ug=Rt`
167
+ `,cp=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,p]=ln(!1),v=E=>{var w,S,b,x;p(!1),u.value=!1,E==="dismiss"?(w=n.value)==null||w.call(n):E==="viewed"&&((S=i.value)==null||S.call(i)),(b=r.value)==null||b.call(r),(x=o.value)==null||x.call(o)},f=()=>{var E;(E=a.value)==null||E.call(a)};return wt("appsrockets_ad_dismissed",()=>v("dismiss")),wt("appsrockets_ad_rewarded",()=>v("viewed")),wt("appsrockets_ad_completed",()=>v("viewed")),wt("appsrockets_ad_skipped",()=>v("viewed")),wt("appsrockets_ad_clicked",E=>{var w;return(w=s.value)==null?void 0:w.call(s,E)}),wt("appsrockets_ad_loaded",()=>p(!0)),u.value?se("div",{className:up,style:{display:y?"flex":"none"},children:u.value&&se("iframe",{src:d.value,onLoad:f,allowFullScreen:!0,allow:"autoplay",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"})}):null};function Ge(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 wo=class{constructor(t,r){Ge(this,"name","APPSROCKETS"),Ge(this,"initialized",!1),Ge(this,"initCompleter",null),Ge(this,"context",void 0),Ge(this,"adsOverlay",null),Ge(this,"adsIsShowing",!1),Ge(this,"lastUnDisplayedAdBreak",null),Ge(this,"state",lp()),Ge(this,"processUrl",n=>{var i;let o=this.context.getContextInfo(),a=new URL(n),s=new URLSearchParams(a.search);return s.has("joliSource")||s.set("joliSource",o.joliSource),s.get("osType")||s.set("osType",o.osType),s.get("runtimeType")||s.set("runtimeType",o.runtimeType),s.get("mode")||s.set("mode","AFG"),s.get("deviceId")||s.set("deviceId",o.deviceId),s.get("statusBarHeight")||s.set("statusBarHeight",((i=this.context.getWindowInfo().statusBarHeight)!=null?i:0).toString()),a.search=s.toString(),a.toString()}),this.context=t}init(){return U(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Qi(se(cp,{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){var n,i,o,a,s,u,d,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){(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?"":t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}let p=v=>{var f,E;(E=(f=this.context).handleLinkClicked)==null||E.call(f,v)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.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 v=()=>{var w;this.adsIsShowing=!1,(w=t.afterAd)==null||w.call(t)},f=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},E=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Ae(()=>{this.adsIsShowing=!0,this.state.afterAd.value=v,this.state.adBreakDone.value=f,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=p,this.state.adError.value=E,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let v=()=>{var P;this.adsIsShowing=!1,(P=t.afterAd)==null||P.call(t)},f={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},E=()=>{var P;this.adsIsShowing=!1,f.breakStatus="dismissed",(P=t.adDismissed)==null||P.call(t)},w=()=>{var P;this.adsIsShowing=!1,f.breakStatus="viewed",(P=t.adViewed)==null||P.call(t)},S=()=>{var P;this.adsIsShowing=!1,(P=t.adBreakDone)==null||P.call(t,f)},b=()=>{this.adsIsShowing=!1,f.breakStatus="noAdPreloaded"};Ae(()=>{this.state.afterAd.value=v,this.state.adDismissed.value=E,this.state.adViewed.value=w,this.state.adBreakDone.value=S,this.state.adLinkClicked.value=p,this.state.adError.value=b});let x=()=>{var P;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(P=t.adBreakDone)==null||P.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ae(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,x);break}}}};function Ne(e,t,r){return(t=hp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function hp(e){var t=pp(e,"string");return typeof t=="symbol"?t:t+""}function pp(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 An=class{constructor(t){if(Ne(this,"context",void 0),Ne(this,"contextInfo",void 0),Ne(this,"providers",{}),Ne(this,"channelPolicy",void 0),Ne(this,"adsActionDetection",void 0),Ne(this,"adsTrackSerializer",void 0),Ne(this,"initialized",!1),Ne(this,"adsIsShowing",!1),Ne(this,"lastAdBreak",void 0),Ne(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new co(this.context),this.adsActionDetection=new io(this.context),this.adsTrackSerializer=new uo(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;let{width:i,height:o}=this.context.getWindowInfo();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",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return U(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":case"ADSENSE_ADMOB":{let i=new fo(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new bo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new wo(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return U(this,null,function*(){var r,n,i,o,a,s,u,d,y,p;let v=Date.now();if(v-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&v-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=v,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:f,code:E}=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(E!=="SUCCESS"){(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let w=f==null?void 0:f.sort((P,H)=>P.seq-H.seq);if(w.length===0){(u=t.adBreakDone)==null||u.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let S=!0,b=null,x=new no(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;w.length>0;){let P=w.shift(),H=this.providers[P.provider];if(H){let[X,R]=yield x.callAdBreakAndContinue(H,t,P,D=>{var O;this.adsIsShowing=D,(O=this.context.eventEmitter)==null||O.emit("isAdShowing",D)});S=X,b=R}else S=!0,b={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!S)break}S&&b&&((d=t.adBreakDone)==null||d.call(t,b))}}catch(f){(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(p=this.context.eventEmitter)==null||p.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.")}};var dg=Rt`
168
168
  ${ge}
169
169
  position: fixed;
170
170
  left: 0;
@@ -213,7 +213,7 @@ or `);this.errors.push(o)}return n}},Br=class extends ue{constructor(...t){super
213
213
  cursor: pointer;
214
214
  }
215
215
  }
216
- `;we();var Mg=qn(Wl());var lr=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){this.ads.adConfig(t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var ur=class e{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initOnMessage(){window.addEventListener("message",t=>{var r,n,i,o,a,s,u,d,y;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&(console.log(`data => ${t.data}`),t.data&&t.data.type==null)){let p=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${p.type}`),p.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",p);break;case"huawei_quick_ads_on_message_ad_config":{let v=p.callbackId;if(v){let f=this.callbackMap.get(v);(r=f==null?void 0:f.onReady)==null||r.call(f)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",p)}break;case"huawei_quick_ads_on_message_ad_break":{let v=p.callbackId;if(v){let f=this.callbackMap.get(v),E="noAdPreloaded",w=!1;switch(p.adsRes){case"viewed":E="viewed",(n=f==null?void 0:f.adViewed)==null||n.call(f),w=!0;break;case"dismissed":E="dismissed",(i=f==null?void 0:f.adDismissed)==null||i.call(f),w=!0;break;case"error":E="error",w=!0;break;case"other":E="other",w=!0;break;case"beforeReward":(o=f==null?void 0:f.beforeReward)==null||o.call(f,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),w=!1;break;case"beforeAd":(a=f==null?void 0:f.beforeAd)==null||a.call(f),w=!1;break;case"afterAd":(s=f==null?void 0:f.afterAd)==null||s.call(f),w=!1;break}w&&((y=f==null?void 0:f.adBreakDone)==null||y.call(f,{breakType:(u=f.breakType)!=null?u:"",breakName:f.breakName,breakFormat:(d=f.breakFormat)!=null?d:"interstitial",breakStatus:E}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",p)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",p);break;default:break}}})}getAdsInstance(){return e.getInstance()}init(t){try{this.sendPostMessage("huawei_quick_ads_init",void 0,t)}catch(r){console.error("init failed",r)}}adConfig(t){try{let r;t.onReady&&(r=++this.callbacksId,this.callbackMap.set(r,{onReady:t.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",r,t)}catch(r){console.error("adConfig failed",r)}}adBreak(t){var r;try{let n=++this.callbacksId,i={};i.breakType=t.type,t.type!=="preroll"&&t.name&&(i.breakName=t.name),i.breakFormat=t.type==="reward"?"reward":"interstitial",t.adBreakDone&&(i.adBreakDone=t.adBreakDone),t.type!=="preroll"&&t.beforeAd&&(i.beforeAd=t.beforeAd),t.type!=="preroll"&&t.afterAd&&(i.afterAd=t.afterAd),t.type==="reward"&&t.beforeReward&&(i.beforeReward=t.beforeReward),t.type==="reward"&&t.adDismissed&&(i.adDismissed=t.adDismissed),t.type==="reward"&&t.adViewed&&(i.adViewed=t.adViewed),this.callbackMap.set(n,i),this.sendPostMessage("huawei_quick_ads_ad_break",n,t)}catch(n){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(t){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,t)}catch(r){console.error("adUnit failed",r)}}sendPostMessage(t,r,n){var i;try{if(!((i=window.system)!=null&&i.postMessage))throw new Error("window.system.postMessage is not available");let o=W(W({type:t},r!==void 0&&{callbackId:r}),n!==void 0&&{data:n});window.system.postMessage(JSON.stringify(o))}catch(o){throw console.error("sendPostMessage failed",o),o}}};var So=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return U(this,null,function*(){var r;if(t.type==="reward")try{let n=yield Ye.getRewardsTypes(kn);yield Ye.handleReward(n,t)}catch(n){console.info("handleReward failed",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}},Ro=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new lr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=ur.getInstance();break}default:{let r=new En(this.context);this.cacheHandler=new So(r);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Tn=Ce(),Ql=new Pe,kn=je.create(),hp={httpClient:kn,checkNetwork:()=>je.getNetworkStatus(),track:De,eventEmitter:Ql,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=N.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=N.deviceInfo.did)!=null?r:"",adId:(n=N.deviceInfo.adId)!=null?n:"",sessionId:(i=N.sessionId)!=null?i:"",userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:N.mpId,testAdsMode:N.testAdsMode,channel:(s=N.joliSource)!=null?s:"",deviceBrand:N.deviceInfo.brand,deviceModel:N.deviceInfo.model,osType:be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=N.joliSource)!=null?u:""}}},Yl=e=>{mt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},pp=new Ro(hp),cr=pp.getAdsHandler(N.sdkEnvironment);Ye.registerRewardHandler("ADS",is(cr.getAdsInstance()));Ye.registerRewardHandler("JOLI_COIN",as(kn,{onUnlockSuccess:Yl.bind(void 0)}));Ye.registerRewardHandler("JOLI_COIN_ONLY",ss(kn,{onUnlockSuccess:Yl.bind(void 0)}));Ql.on("isAdShowing",e=>{mt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Tn.registerCommand("AdsSDK.init",e=>{cr.init(e)});Tn.registerCommand("AdsSDK.adConfig",e=>{cr.adConfig(e)});Tn.registerCommand("AdsSDK.adBreak",e=>{cr.adBreak(e)});Tn.registerCommand("AdsSDK.adUnit",e=>{cr.adUnit(e)});q();it();var nu=-1,Cn=function(e){addEventListener("pageshow",function(t){t.persisted&&(nu=t.timeStamp,e(t))},!0)},ko=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},On=function(){var e=ko();return e&&e.activationStart||0},Ct=function(e,t){var r=ko(),n="navigate";return nu>=0?n="back-forward-cache":r&&(document.prerendering||On()>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}},iu=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Ot=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(s,u){return s>u[1]?"poor":s>u[0]?"needs-improvement":"good"}(t.value,r),e(t))}},ou=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)}},xt=-1,Xl=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},xn=function(e){document.visibilityState==="hidden"&&xt>-1&&(xt=e.type==="visibilitychange"?e.timeStamp:0,mp())},Zl=function(){addEventListener("visibilitychange",xn,!0),addEventListener("prerenderingchange",xn,!0)},mp=function(){removeEventListener("visibilitychange",xn,!0),removeEventListener("prerenderingchange",xn,!0)},lu=function(){return xt<0&&(xt=Xl(),Zl(),Cn(function(){setTimeout(function(){xt=Xl(),Zl()},0)})),{get firstHiddenTime(){return xt}}},xo=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},eu=[1800,3e3],uu=function(e,t){t=t||{},xo(function(){var r,n=lu(),i=Ct("FCP"),o=iu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-On(),0),i.entries.push(s),r(!0)))})});o&&(r=Ot(e,i,eu,t.reportAllChanges),Cn(function(a){i=Ct("FCP"),r=Ot(e,i,eu,t.reportAllChanges),ou(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var vp=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],To={},cu=function(e,t){t=t||{},xo(function(){var r,n=lu(),i=Ct("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-On(),0),i.entries=[d],r())})},a=iu("largest-contentful-paint",o);if(a){r=Ot(e,i,tu,t.reportAllChanges);var s=su(function(){To[i.id]||(o(a.takeRecords()),a.disconnect(),To[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return vp(s)},{once:!0,capture:!0})}),au(s),Cn(function(u){i=Ct("LCP"),r=Ot(e,i,tu,t.reportAllChanges),ou(function(){i.value=performance.now()-u.timeStamp,To[i.id]=!0,r(!0)})})}})},ru=[800,1800],_p=function e(t){document.prerendering?xo(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=Ct("TTFB"),n=Ot(e,r,ru,t.reportAllChanges);_p(function(){var i=ko();i&&(r.value=Math.max(i.responseStart-On(),0),r.entries=[i],n(!0),Cn(function(){r=Ct("TTFB",0),(n=Ot(e,r,ru,t.reportAllChanges))(!0)}))})};we();function gp(){uu(e=>{De("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),cu(e=>{De("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),du(e=>{De("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function yp(){jt.on("onDocumentReady",e=>{jt.emit("LifecycleEvent.onReady",{isLogin:!1}),N.mpType==="game"&&nt.start(Date.now()-e)})}function fu(){yp(),gp()}fu();
216
+ `;Ee();var jg=Gn(Yl());var lr=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){this.ads.adConfig(t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var ur=class e{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initOnMessage(){window.addEventListener("message",t=>{var r,n,i,o,a,s,u,d,y;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&(console.log(`data => ${t.data}`),t.data&&t.data.type==null)){let p=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${p.type}`),p.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",p);break;case"huawei_quick_ads_on_message_ad_config":{let v=p.callbackId;if(v){let f=this.callbackMap.get(v);(r=f==null?void 0:f.onReady)==null||r.call(f)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",p)}break;case"huawei_quick_ads_on_message_ad_break":{let v=p.callbackId;if(v){let f=this.callbackMap.get(v),E="noAdPreloaded",w=!1;switch(p.adsRes){case"viewed":E="viewed",(n=f==null?void 0:f.adViewed)==null||n.call(f),w=!0;break;case"dismissed":E="dismissed",(i=f==null?void 0:f.adDismissed)==null||i.call(f),w=!0;break;case"error":E="error",w=!0;break;case"other":E="other",w=!0;break;case"beforeReward":(o=f==null?void 0:f.beforeReward)==null||o.call(f,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),w=!1;break;case"beforeAd":(a=f==null?void 0:f.beforeAd)==null||a.call(f),w=!1;break;case"afterAd":(s=f==null?void 0:f.afterAd)==null||s.call(f),w=!1;break}w&&((y=f==null?void 0:f.adBreakDone)==null||y.call(f,{breakType:(u=f.breakType)!=null?u:"",breakName:f.breakName,breakFormat:(d=f.breakFormat)!=null?d:"interstitial",breakStatus:E}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",p)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",p);break;default:break}}})}getAdsInstance(){return e.getInstance()}init(t){try{this.sendPostMessage("huawei_quick_ads_init",void 0,t)}catch(r){console.error("init failed",r)}}adConfig(t){try{let r;t.onReady&&(r=++this.callbacksId,this.callbackMap.set(r,{onReady:t.onReady})),this.sendPostMessage("huawei_quick_ads_ad_config",r,t)}catch(r){console.error("adConfig failed",r)}}adBreak(t){var r;try{let n=++this.callbacksId,i={};i.breakType=t.type,t.type!=="preroll"&&t.name&&(i.breakName=t.name),i.breakFormat=t.type==="reward"?"reward":"interstitial",t.adBreakDone&&(i.adBreakDone=t.adBreakDone),t.type!=="preroll"&&t.beforeAd&&(i.beforeAd=t.beforeAd),t.type!=="preroll"&&t.afterAd&&(i.afterAd=t.afterAd),t.type==="reward"&&t.beforeReward&&(i.beforeReward=t.beforeReward),t.type==="reward"&&t.adDismissed&&(i.adDismissed=t.adDismissed),t.type==="reward"&&t.adViewed&&(i.adViewed=t.adViewed),this.callbackMap.set(n,i),this.sendPostMessage("huawei_quick_ads_ad_break",n,t)}catch(n){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}}adUnit(t){try{this.sendPostMessage("huawei_quick_ads_ad_unit",void 0,t)}catch(r){console.error("adUnit failed",r)}}sendPostMessage(t,r,n){var i;try{if(!((i=window.system)!=null&&i.postMessage))throw new Error("window.system.postMessage is not available");let o=W(W({type:t},r!==void 0&&{callbackId:r}),n!==void 0&&{data:n});window.system.postMessage(JSON.stringify(o))}catch(o){throw console.error("sendPostMessage failed",o),o}}};var cr=class e{constructor(){}static getInstance(){return e.instance||(e.instance=new e),e.instance}getAdsInstance(){return e.getInstance()}init(){}adConfig(t){t.onReady&&t.onReady()}adBreak(t){var r;try{t.type==="reward"?window.gdsdk.preloadAd("rewarded").then(()=>{var n;(n=t.beforeReward)==null||n.call(t,()=>{t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("rewarded").then(i=>{var o,a,s,u,d;(o=i==null?void 0:i.args)!=null&&o.success?(a=t.adViewed)==null||a.call(t):(s=t.adDismissed)==null||s.call(t),t.afterAd&&t.afterAd(),(d=t.adBreakDone)==null||d.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:(u=i==null?void 0:i.args)!=null&&u.success?"viewed":"dismissed"})}).catch(i=>{var o;console.log("showReward error => ",i),(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})})})}).catch(n=>{var i;console.log("preloadAd error => ",n),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"noAdPreloaded"})}):(t.type!=="preroll"&&t.beforeAd&&t.beforeAd(),window.gdsdk.showAd("interstitial").then(()=>{var n;t.type!=="preroll"&&t.afterAd&&t.afterAd(),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:"interstitial",breakStatus:"viewed"})}))}catch(n){console.log("adBreak error => ",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"error"})}}adUnit(){}};var Ro=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return U(this,null,function*(){var r;if(t.type==="reward")try{let n=yield Ye.getRewardsTypes(xn);yield Ye.handleReward(n,t)}catch(n){console.info("handleReward failed",n),(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}else this.ads.adBreak(t)})}adUnit(t){this.ads.adUnit(t)}},To=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new lr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=ur.getInstance();break}case"gamedistribution":{this.cacheHandler=cr.getInstance();break}default:{let r=new An(this.context);this.cacheHandler=new Ro(r);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},kn=we(),Xl=new Pe,xn=je.create(),mp={httpClient:xn,checkNetwork:()=>je.getNetworkStatus(),track:De,eventEmitter:Xl,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=N.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=N.deviceInfo.did)!=null?r:"",adId:(n=N.deviceInfo.adId)!=null?n:"",sessionId:(i=N.sessionId)!=null?i:"",userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:N.mpId,testAdsMode:N.testAdsMode,channel:(s=N.joliSource)!=null?s:"",deviceBrand:N.deviceInfo.brand,deviceModel:N.deviceInfo.model,osType:be.isAndroid?"ANDROID":be.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=N.joliSource)!=null?u:""}}},Zl=e=>{mt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},vp=new To(mp),dr=vp.getAdsHandler(N.sdkEnvironment);Ye.registerRewardHandler("ADS",as(dr.getAdsInstance()));Ye.registerRewardHandler("JOLI_COIN",ls(xn,{onUnlockSuccess:Zl.bind(void 0)}));Ye.registerRewardHandler("JOLI_COIN_ONLY",us(xn,{onUnlockSuccess:Zl.bind(void 0)}));Xl.on("isAdShowing",e=>{mt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});kn.registerCommand("AdsSDK.init",e=>{dr.init(e)});kn.registerCommand("AdsSDK.adConfig",e=>{dr.adConfig(e)});kn.registerCommand("AdsSDK.adBreak",e=>{dr.adBreak(e)});kn.registerCommand("AdsSDK.adUnit",e=>{dr.adUnit(e)});V();var eu=we();eu.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{console.log("RuntimeSDK.loadFinishedEvent")});eu.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});V();it();var au=-1,On=function(e){addEventListener("pageshow",function(t){t.persisted&&(au=t.timeStamp,e(t))},!0)},xo=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Pn=function(){var e=xo();return e&&e.activationStart||0},Ct=function(e,t){var r=xo(),n="navigate";return au>=0?n="back-forward-cache":r&&(document.prerendering||Pn()>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(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Ot=function(e,t,r,n){var i,o;return function(a){t.value>=0&&(a||n)&&((o=t.value-(i||0))||i===void 0)&&(i=t.value,t.delta=o,t.rating=function(s,u){return s>u[1]?"poor":s>u[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)}},xt=-1,tu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Cn=function(e){document.visibilityState==="hidden"&&xt>-1&&(xt=e.type==="visibilitychange"?e.timeStamp:0,_p())},ru=function(){addEventListener("visibilitychange",Cn,!0),addEventListener("prerenderingchange",Cn,!0)},_p=function(){removeEventListener("visibilitychange",Cn,!0),removeEventListener("prerenderingchange",Cn,!0)},du=function(){return xt<0&&(xt=tu(),ru(),On(function(){setTimeout(function(){xt=tu(),ru()},0)})),{get firstHiddenTime(){return xt}}},Co=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},nu=[1800,3e3],fu=function(e,t){t=t||{},Co(function(){var r,n=du(),i=Ct("FCP"),o=su("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Pn(),0),i.entries.push(s),r(!0)))})});o&&(r=Ot(e,i,nu,t.reportAllChanges),On(function(a){i=Ct("FCP"),r=Ot(e,i,nu,t.reportAllChanges),lu(function(){i.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 iu=[2500,4e3],ko={},hu=function(e,t){t=t||{},Co(function(){var r,n=du(),i=Ct("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Pn(),0),i.entries=[d],r())})},a=su("largest-contentful-paint",o);if(a){r=Ot(e,i,iu,t.reportAllChanges);var s=cu(function(){ko[i.id]||(o(a.takeRecords()),a.disconnect(),ko[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return gp(s)},{once:!0,capture:!0})}),uu(s),On(function(u){i=Ct("LCP"),r=Ot(e,i,iu,t.reportAllChanges),lu(function(){i.value=performance.now()-u.timeStamp,ko[i.id]=!0,r(!0)})})}})},ou=[800,1800],yp=function e(t){document.prerendering?Co(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=Ct("TTFB"),n=Ot(e,r,ou,t.reportAllChanges);yp(function(){var i=xo();i&&(r.value=Math.max(i.responseStart-Pn(),0),r.entries=[i],n(!0),On(function(){r=Ct("TTFB",0),(n=Ot(e,r,ou,t.reportAllChanges))(!0)}))})};Ee();function bp(){fu(e=>{De("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),hu(e=>{De("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),pu(e=>{De("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function wp(){jt.on("onDocumentReady",e=>U(this,null,function*(){jt.emit("LifecycleEvent.onReady",{isLogin:!1}),N.mpType==="game"&&nt.start(Date.now()-e)}))}function mu(){wp(),bp()}mu();
217
217
  /*! Bundled license information:
218
218
 
219
219
  localforage/dist/localforage.js: