@jolibox/implement 1.2.0-beta.9 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/package-deps_build.json +5 -5
- package/dist/index.js +25 -25
- package/dist/index.native.js +32 -32
- package/implement.build.log +2 -2
- package/package.json +5 -5
- package/src/common/rewards/registers/utils/coins/jolicoin/jolicoin-handler.ts +4 -8
- package/src/common/rewards/registers/utils/coins/joligem/gem-handler.ts +0 -4
- package/src/h5/api/ads.ts +3 -0
- package/src/native/api/ads.ts +14 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var cf=Object.create;var Mi=Object.defineProperty,uf=Object.defineProperties,df=Object.getOwnPropertyDescriptor,ff=Object.getOwnPropertyDescriptors,hf=Object.getOwnPropertyNames,Yr=Object.getOwnPropertySymbols,vs=Object.getPrototypeOf,Bi=Object.prototype.hasOwnProperty,_s=Object.prototype.propertyIsEnumerable,mf=Reflect.get;var ps=(e,t,r)=>t in e?Mi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,G=(e,t)=>{for(var r in t||(t={}))Bi.call(t,r)&&ps(e,r,t[r]);if(Yr)for(var r of Yr(t))_s.call(t,r)&&ps(e,r,t[r]);return e},ve=(e,t)=>uf(e,ff(t));var sr=(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 lr=(e,t)=>{var r={};for(var n in e)Bi.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Yr)for(var n of Yr(e))t.indexOf(n)<0&&_s.call(e,n)&&(r[n]=e[n]);return r};var te=(e,t)=>()=>(e&&(t=e(e=0)),t);var Ji=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var pf=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of hf(t))!Bi.call(e,i)&&i!==r&&Mi(e,i,{get:()=>t[i],enumerable:!(n=df(t,i))||n.enumerable});return e};var Fi=(e,t,r)=>(r=e!=null?cf(vs(e)):{},pf(t||!e||!e.__esModule?Mi(r,"default",{value:e,enumerable:!0}):r,e));var gs=(e,t,r)=>mf(vs(e),r,t);var P=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(u){i(u)}},a=l=>{try{s(r.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function Af(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Rs(e){return new Promise(t=>setTimeout(t,e))}function wt(e){return typeof e=="string"}function Pt(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Cs(e){return typeof e=="object"&&Array.isArray(e)}function ks(e){return typeof e=="undefined"}function Sf(e){return ks(e)||e===null}function Rf(e){return typeof e=="function"}function Ts(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function xs(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],l=o[a],u=r(s,l,a,i,o);u!==void 0?i[a]=u:ws(l)&&ws(s)?i[a]=n(As({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function ws(e){return e&&typeof e=="object"&&e.constructor===Object}function Ps(e,t){if(Array.isArray(e))return e.concat(t)}function fr(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!0}=r,u=()=>(a=e.apply(o,i),i=void 0,o=void 0,a),p=function(...f){i=f,o=this;let m=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,l&&!m&&u()},t),m)return u()};return p.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},p.flush=()=>{if(n)return clearTimeout(n),n=null,u()},p}function kf(e,t){return(...r)=>t(e,...r)}function Us(e){return t=>kf(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new Cf(`${i}`))}})}function cr(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Xr(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 Df(e){let t=e.location?Xr(e.location,Is):null,r=e.target?Xr(e.target,Is):null;return Xr(wf(As({},e),{location:t,target:r}),Nf)}function Xi(e){let t=e.events.map(n=>Df(n)),r=Xr(e.device,Lf);return[e.protocolVersion,t,r,e.project]}function Uf(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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 Js(e,t,r){let n=window.location.hostname,i=n.split("."),o=r?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))return`${o}.jolibox.com`;if(i.length>=2){let a=i.slice(-2).join(".");if(a==="jolibox.com"||a==="pico-game.com"||a==="joyslite.com")return`${o}.${a}`}return`${o}.jolibox.com`}function to(e){return Js("api","stg-api",e)}function Be(e){return`https://${to(e)}`}function Gf(e){return Js("collect","stg-collect",e)}function Fs(e){return`https://${Gf(e)}`}function Kf(e){return new Promise(t=>js(e)(t))}function js(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Wf(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new dr(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Qf(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Yf(e[n],t[n])}function Yf(e,t){if(wt(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Rf(t)){try{if(e instanceof t)return}catch(r){}if(!Sf(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 Xf(){return typeof globalThis!="undefined"?globalThis[Hs]:void 0}function Zf(e){typeof globalThis!="undefined"&&(globalThis[Hs]=e)}function _e(e=!1){let t=Xf();if(!e&&t)return t;let r=new Zr,n=new qi,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Zf(i),i}var Ki,vf,_f,gf,ys,yf,bf,bs,As,wf,Ef,Ss,If,Os,Of,Wi,zi,Ns,Ls,Cf,Ds,en,hr,Qi,we,Hi,Tf,Yi,Es,xf,Qe,mt,Pf,Is,Nf,Lf,Ye,xt,Mf,Re,Bf,Jf,Ff,Ms,Zi,eo,jf,Hf,Bs,Gi,re,Vf,$f,ur,dr,Je,$i,qf,ji,zf,Xe,Zr,qi,Hs,F=te(()=>{"use strict";Ki=Object.defineProperty,vf=Object.defineProperties,_f=Object.getOwnPropertyDescriptor,gf=Object.getOwnPropertyDescriptors,ys=Object.getOwnPropertySymbols,yf=Object.prototype.hasOwnProperty,bf=Object.prototype.propertyIsEnumerable,bs=(e,t,r)=>t in e?Ki(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,As=(e,t)=>{for(var r in t||(t={}))yf.call(t,r)&&bs(e,r,t[r]);if(ys)for(var r of ys(t))bf.call(t,r)&&bs(e,r,t[r]);return e},wf=(e,t)=>vf(e,gf(t)),Ef=(e,t)=>{for(var r in t)Ki(e,r,{get:t[r],enumerable:!0})},Ss=(e,t,r,n)=>{for(var i=n>1?void 0:n?_f(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&&Ki(t,r,i),i},If=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(u){i(u)}},a=l=>{try{s(r.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.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}Os=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};Of=(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))(Of||{}),Wi=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}},zi=class extends Wi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Ns=class extends Wi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Ls=class extends Ns{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Cf=class extends Ns{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))}},Ds=class extends zi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},en=class extends zi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},hr=class extends Wi{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}}},Qi=class extends zi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};we={log:cr("log"),warn:cr("warn"),info:cr("info"),error:cr("error"),debug:cr("debug")};Object.assign(globalThis,{logger:we});Hi=Symbol.for("Jolibox.canIUseMap"),Tf={};globalThis[Hi]||(globalThis[Hi]=Tf);Yi={get config(){return globalThis[Hi]}},Es=Symbol.for("Jolibox.canIUseMap.native"),xf={};globalThis[Es]||(globalThis[Es]=xf);Qe=(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))(Qe||{}),mt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(mt||{}),Pf=(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))(Pf||{}),Is=["name","params"],Nf=["name","type","location","target","extra","timestamp","userId"],Lf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];Ye=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Uf();xt=typeof window=="undefined",Mf=()=>!xt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Re={isiOS:!xt&&(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:!xt&&navigator.userAgent.includes("Android"),isMac:!xt&&navigator.userAgent.includes("Mac"),isFacebook:!xt&&navigator.userAgent.includes("FB_IAB"),isPC:!xt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Bf=()=>Re.isiOS?"iOS":Re.isAndroid?"Android":Re.isMac?"Mac":Re.isFacebook?"Facebook":"PC",Jf="device_id",Ff="advertising_id",Ms=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,Ye()),window.__joliboxLocalStorage__.getItem(e)),Zi=()=>new URLSearchParams(window.location.search).get("deviceId")||Ms(Jf),eo=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ms(Ff),jf=e=>e.charAt(0).toUpperCase()+e.slice(1),Hf=()=>{var e;let t=new URLSearchParams(window.location.search);return jf((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Bs=e=>{if(Mf())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Bf(),n=navigator.language,i=Zi(),o=eo();return`${t} (${Hf()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`};Gi=class Vi{constructor(t){this.element=t,this.next=Vi.Undefined,this.prev=Vi.Undefined}};Gi.Undefined=new Gi(void 0);re=Gi,Vf=class{constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let e=this._first;for(;e!==re.Undefined;){let t=e.next;e.prev=re.Undefined,e.next=re.Undefined,e=t}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new re(e);if(this._first===re.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!==re.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==re.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==re.Undefined&&e.next!==re.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===re.Undefined&&e.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):e.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):e.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==re.Undefined;)yield e.element,e=e.next}},$f=0,ur=class{constructor(e){this.value=e,this.id=$f++}},dr=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 ur&&(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,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let u=new ur(t);return this._listeners?this._listeners instanceof ur?this._listeners=[this._listeners,u]:this._listeners.push(u):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=u,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var p,f,m,h;if(!this._disposed){if(this._listeners instanceof ur)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p));else if(this._listeners){let w=this._listeners.indexOf(u);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((h=(m=this.options)==null?void 0:m.onDidRemoveLastListener)==null||h.call(m)))}}}}),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 ur?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Je=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 dr,o=l=>t(...l.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 l of s)t(...l.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 Vf,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)}},$i={};Ef($i,{None:()=>qf,filter:()=>Wf,once:()=>js,toPromise:()=>Kf});qf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});ji=Symbol.for("Jolibox.hostEmitter"),zf=()=>{let e=new Je;return globalThis[ji]||(globalThis[ji]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[ji]},Xe=zf();Zr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new dr,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 Qf(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}};Zr=Ss([Ts],Zr);qi=class{constructor(){this._onWillExecuteCommand=new dr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new dr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Zr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Af(3e4)),this._starActivation}executeCommand(e,...t){return If(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),$i.toPromise($i.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}}};qi=Ss([Ts],qi);Hs=Symbol.for("Jolibox.commands")});function Oe(e,t={}){ro.emit("ERROR_REPORT",{error:e,options:t})}var ro,Ve,$e=te(()=>{"use strict";F();F();ro=new Je,Ve=new Je;Oe.debounce=fr(Oe,50,{leading:!0})});var no,eh,Gs,Vs,$s=te(()=>{"use strict";F();$e();no=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{}}},eh=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Gs=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:no(o),payloadJson:no(a),signature:no(s)}}else throw"joli_source is missing"}catch(r){return Oe(new Ds(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Vs=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=eh(e),o=r[2];return`${n}.${i}.${o}`}return t}});var th,tn,qs,io=te(()=>{"use strict";F();th="1.2.0-beta.9",tn=()=>th,qs=()=>{let e=tn();return`${Bs(e)}`}});function ao(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var rh,Ks,oo,Ws,oe,nh,O,ae=te(()=>{"use strict";F();$s();io();F();rh={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:Zi(),adId:eo(),pixelRatio:window.devicePixelRatio||1,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:tn()},schema:window.location.href,platform:Re.isAndroid?"android":Re.isiOS?"ios":"h5"},oo=(Ks=globalThis.joliboxJSCore)==null?void 0:Ks.env,oe=Object.assign({},(Ws=oo==null?void 0:oo())!=null?Ws:rh);nh=()=>{var h,w,E,A,b,C,N,B,V,S,D;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?Gs(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(E=(w=(h=o.get("mpId"))!=null?h:o.get("appId"))!=null?w:o.get("gameId"))!=null?E:"",s=(C=(b=(A=oe.clientSessionId)!=null?A:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?C:n,l=!!((B=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?B:o.get("testAdsMode")==="true"),u=(D=(S=(V=e==null?void 0:e.joliboxEnv)!=null?V:e==null?void 0:e.__joliboxEnv)!=null?S:o.get("joliboxEnv"))!=null?D:"production",p=u==="staging",f=t==null?void 0:t.channel,m=e==null?void 0:e.__shouldInterupt;return{get startTime(){var x;return(x=performance.timeOrigin)!=null?x:performance.timing.navigationStart},get testMode(){return p},get testAdsMode(){return l},get joliboxEnv(){return u},get joliSource(){var x;return(x=o.get("joliSource"))!=null?x:null},get mpId(){var x;return(x=a!=null?a:e==null?void 0:e.id)!=null?x:""},get mpVersion(){var x;return(x=t==null?void 0:t.ver)!=null?x:tn()},get mpType(){var x,M;return(M=(x=t==null?void 0:t.__mpType)!=null?x:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var x;return((x=oe.platform)!=null?x: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 x,M;return(M=(x=oe.clientSessionId)!=null?x:s)!=null?M:n},get channel(){return f},get webviewId(){var x;return(x=oe.webviewId)!=null?x:-1},get shouldInterupt(){return m},get from(){return e==null?void 0:e.__from},get baseApiHost(){return to(p)},get adId(){var x;return(x=oe.deviceInfo.adId)!=null?x:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return ao("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":ao("gamedistribution","jolibox")?"gamedistribution":ao("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var q,X,Z;let x=(q=oe.deviceInfo.pixelRatio)!=null?q:1,M=(X=oe.deviceInfo.statusBarHeight)!=null?X:e==null?void 0:e.__androidStatusBarHeight,$=(Z=oe.deviceInfo.navigationBarHeight)!=null?Z:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/x:20,navigationBarHeight:$!==void 0?$/x:10}},get abTests(){var x,M;return(M=(x=oe.abValues)==null?void 0:x.split(","))!=null?M:[]},onEnvConfigChanged:x=>{xs(oe,x,Ps)},encodeJoliSourceQuery:x=>{var M,$;return t&&r?Vs(G(G({},e),x),(M=o.get("joliSource"))!=null?M:""):($=o.get("joliSource"))!=null?$:""},setDoExitDirectly:()=>{m=!1}}},O=nh()});var so,Qs,ih,oh,zs,ah,lo=te(()=>{"use strict";F();$e();ae();F();so=!1,Qs=(e,t)=>e==null?!1:t in e,ih=e=>Qs(e,"kind"),oh=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},zs=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=O.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=O.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:oh(e.name)},i=ve(G({},n),{env:t.environment,isFromUser:r});r?Ve.emit("GLOBAL_USER_ERROR",e,i):Ve.emit("GLOBAL_ERROR",e,i)},ah=e=>Qs(e,"kind")&&e.kind==="USER_ERROR";ro.on("ERROR_REPORT",({error:e,options:t})=>{if(so)return;so=!0;let r=ih(e)&&e.raw?e.raw:e;try{let n=ah(e);zs(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Qi(`${i}, origin error: ${r.message}`);we.error(o),zs(new Qi(o.message),{environment:t.environment},!1)}finally{so=!1}})});var co,uo,mr=te(()=>{"use strict";$e();F();$e();co=(e,t)=>{var r,n;return new hr((n=(r=t==null?void 0:t.errMsg)!=null?r:e.msg)!=null?n:"",e.code,e.type)},uo=e=>new Ls(e)});function Ys(e,t){let r=(n,i,o)=>{let u=i!=null?i:{},{eventType:a}=u,s=lr(u,["eventType"]),l=ve(G({tag:n,eventType:o!=null?o:a!=null?a:Qe.Other},t),{extra:G({},s)});n=="globalJsError"?Oe(new en(JSON.stringify(l))):e("systemLog",l,O.webviewId)};return r.debounce=fr(r,500,{leading:!0}),r}function Xs(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=fr(t,500,{leading:!0}),t}var Zs=te(()=>{"use strict";F();F();$e();ae()});function rn(e,t){let r=Ys(e,t),n=Xs(r);return{track:r,trackPerformance:n}}var el=te(()=>{"use strict";Zs()});var nn=te(()=>{"use strict"});var on,tl=te(()=>{"use strict";ae();F();F();on=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${Be(O.testMode)}/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}=O.sdkInfo;return{platform:1e3,os:O.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=O.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=O.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=O.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:O.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 P(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,u={protocolVersion:"1.0.0",events:[ve(G({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(Xi(u),n):yield this.doReport(Xi(u))}catch(p){we.log("[Jolibox SDK] report API error",p)}})}}});var an=te(()=>{"use strict";el();nn();tl()});var fo,rl,Ze,sn,He,Nt=te(()=>{"use strict";io();ae();F();fo=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(rl=AbortSignal.timeout)!=null||(AbortSignal.timeout=fo);Ze=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 sn(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},sn=class{constructor(t){this.xua=qs();this.getJoliSource=()=>O.joliSource;var n;let r=Be(O.testMode);this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(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(),l=`${this.baseUrl}${t}${s?`?${s}`:""}`,u=this.xua,p=this.getJoliSource();o=Object.assign({},o!=null?o:{},u?{"x-user-agent":u}:{},p?{"x-joli-source":p}:{});let f=yield fetch(l,{method:"GET",headers:o,credentials:"include",signal:fo(i!=null?i:3e4)});return Ze.getInstance().recordNetworkRequest(!0),yield f.json()}catch(n){throw Ze.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(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,l=s==null?void 0:s.toString(),u=`${this.baseUrl}${t}${l?`?${l}`:""}`,p=this.xua,f=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},p?{"x-user-agent":p}:{},f?{"x-joli-source":f}:{},{"x-os-type":Re.isAndroid?"ANDROID":Re.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let m=yield fetch(u,{method:"POST",headers:a,body:JSON.stringify(n),signal:fo(o!=null?o:3e4),credentials:"include"});Ze.getInstance().recordNetworkRequest(!0);let h=m.headers.get("content-type");if(h!=null&&h.includes("application/octet-stream"))try{return m.blob()}catch(w){return yield m.arrayBuffer()}if(h!=null&&h.includes("multipart/form-data")||h!=null&&h.includes("application/x-www-form-urlencoded"))try{return m.formData()}catch(w){return yield m.text()}if(h!=null&&h.includes("application/json"))try{return yield m.json()}catch(w){return yield m.text()}return m}catch(n){throw Ze.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(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,l=s==null?void 0:s.toString(),u=`${this.baseUrl}${t}${l?`?${l}`:""}`,p=this.xua,f=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},p?{"x-user-agent":p}:{},f?{"x-joli-source":f}:{});let m=yield fetch(u,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!m.ok)throw Ze.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${m.status}`);return Ze.getInstance().recordNetworkRequest(!0),yield m.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=sn;He=Ze.getInstance()});var ho,ln,mo=te(()=>{"use strict";ae();an();Nt();F();ho=class extends on{constructor(){super(...arguments);this.httpClient=He.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var r;return Fs((r=O.testMode)!=null?r:!1)}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},ln=new ho});var sh,nl=te(()=>{"use strict";lo();F();mr();F();mo();ae();sh=(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:Qe.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=O.hostUserInfo)==null?void 0:o.uid)!=null?a:null};ln.trackEvent(n,mt.WebSDK)};Ve.on("GLOBAL_ERROR",(e,t)=>{sh(t.tag,e)});Ve.on("GLOBAL_USER_ERROR",(e,t)=>{we.log("UserError",e,t)})});var Lt,po=te(()=>{"use strict";Lt=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 h=Date.now(),w=h-r;w>=this.interval&&(this.visible&&(a+=Math.min(w,this.interval+1e3),t(a)),r=h),n=requestAnimationFrame(s)},l=()=>{p(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let h=Date.now();h-r>=this.interval&&(r=h)},this.interval)},u=()=>{f(),r=Date.now(),n=requestAnimationFrame(s)},p=()=>{n&&(cancelAnimationFrame(n),n=0)},f=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",h=>{o&&(console.log("visible",h),h?u():l())});let m=this.visible;return{start(){o||(o=!0,m?u():l())},stop(){o=!1,p(),f()}}}}});var cn,il=te(()=>{"use strict";ae();po();Nt();cn=class extends Lt{constructor(r,n,i){super(n,i);this.httpClient=He.create();this.gameId=O.mpId,this.sessionId=O.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i,extraParams:o}=r,a={eventType:n,gameInfo:G({gameId:this.gameId,sessionId:this.sessionId},i)};o&&Object.assign(a,o),yield this.httpClient.post("/api/base/app-event",{data:a})})}tracker(r,n=null){this.track(r,n)}}});var ol,lh,Fe,ch,vo,et,pt=te(()=>{"use strict";nl();F();F();an();mo();il();ae();nn();ol=_e(),lh={type:mt.WebSDK,platform:"h5",jssdk_version:O.sdkInfo.jssdkVersion,mp_id:O.mpId,mp_version:O.mpVersion},{track:Fe,trackPerformance:ch}=rn((...e)=>{var a,s,l,u;let[,t]=e,r=t,n=Pt(r.extra)?r.extra:wt(r.extra)?JSON.parse(r.extra):{},i=ve(G({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:Qe.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(u=(l=O.hostUserInfo)==null?void 0:l.uid)!=null?u:null};ln.trackEvent(o,mt.WebSDK)},lh);ol.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{ch(e,t,r)});ol.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Fe(e,t)});vo=new Je,et=new cn(Fe,vo)});function al(e){let t=Yi.config[e];return t||(t={},Yi.config[e]=t),(r,n)=>{if(t[r]){we.warn(`[can i use] ${r} already registered`);return}t[r]=G({},n)}}var sl=te(()=>{"use strict";F()});function _o(e){ll=e}function un(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>un(t)):Object.keys(e).reduce((t,r)=>(t[r]=un(e[r]),t),{})}function tt(e){return typeof e=="number"}function go(e){let t=yo(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function yo(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var ll,he,dn,fn,hn,mn,Dt,pn,vn,_n,gn,yn,bn,wn,En,In,An,Sn,Rn,bo=te(()=>{"use strict";ll=!1;he=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(ll)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 ${go(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return un(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:un(this._default)}optional(){return this._optional=!0,this}};dn=class extends he{validate(t){return this._optional&&t===void 0?!0:tt(t)?tt(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):tt(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):tt(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}},fn=class extends he{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},hn=class extends he{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(tt(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(tt(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}},mn=class extends he{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Dt=class extends he{validate(t){return!0}},pn=class extends he{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},vn=class extends he{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},_n=class extends he{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},gn=class extends he{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 ${go(t)}`)}return!0}},yn=class extends he{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(tt(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(tt(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(tt(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}},bn=class extends he{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(yo(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 l=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}"]`,!(l===void 0&&o._optional)){if(l===void 0&&o.hasDefault){i[s]=o.defaultValue;continue}o.validate(l)||(o.hasFallback?i[s]=o.fallbackValue:a=!1)}}return a}},wn=class extends he{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(yo(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}},En=class extends he{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:go(this.value),actual:r}):!0}},In=class extends he{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}},
|
|
3
|
-
`);throw e.errors.length=0,_o(!1),new TypeError(n)}}var j,Eo=te(()=>{"use strict";bo();bo();j={object(e){return new wn(e)},array(e){return new yn(e)},tuple(...e){return new An(...e)},literal(e){return new En(e)},or(...e){return new In(...e)},symbol(){return new mn},record(e){return new bn(e)},function(){return new _n},boolean(){return new fn},string(){return new hn},number(){return new dn},undefined(){return new pn},null(){return new vn},unknown(){return new Dt},any(){return new Dt},as(){return new Dt},arraybuffer(){return new Sn},enum(...e){return new gn(...e)},typedarray(e){return new Rn(e)}}});var On,cl,ul=te(()=>{"use strict";F();$e();Eo();mr();On=1,cl=e=>{function t(n,i){return(...o)=>{var f,m,h,w;let a=Date.now(),s={method:n,trace_id:On};On+=1;let l="SUCCESS",u=`${n}:ok`,p=0;try{if(i.paramsSchema)try{wo(i.paramsSchema,o,"params")}catch(C){throw uo(`${n}:fail ${C.message}`)}let E=i.implement(...o),A=E,b=`${n}:ok`;if(E&&"code"in E){let{code:C,data:N,message:B}=E;l=C,A=N,b=B}return{code:l,message:b,data:A}}catch(E){let A=E;p=(m=(f=A.code)!=null?f:A.errNo)!=null?m:2e3,l="FAILURE";let b=(w=(h=A.message)!=null?h:A.errMsg)!=null?w:`${E}`;return u=`${n}:${l} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,Oe(new hr(u,p)),{code:l,message:u}}finally{let E=Date.now()-a}}}function r(n,i){return(...o)=>P(this,null,function*(){var m,h,w,E;let a=Cs(o)?o:[o],s=Date.now(),l={method:n,trace_id:On};On+=1;let u=`${n}:ok`,p="SUCCESS",f={code:p,message:u};try{if(i.paramsSchema)try{wo(i.paramsSchema,a,"params")}catch(C){throw uo(C.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:C,data:N,message:B}=b;p=C,u=B,b=N}return Object.assign(f,{code:p,message:u,data:b}),f}catch(A){let b=A,C=(h=(m=b.code)!=null?m:b.errNo)!=null?h:2e3;p="FAILURE";let N=(E=(w=b.message)!=null?w:b.errMsg)!=null?E:`${A}`,B=`${n}:${p} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(f,{code:p,message:B}),Oe(new hr(B,C)),f}finally{let A=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});var rt,Et,Ee,pr=te(()=>{"use strict";sl();pt();ul();Eo();({createAPI:rt,createSyncAPI:Et}=cl(Fe)),Ee=al("h5")});var ml=Ji((hl,Ro)=>{(function(e){if(typeof hl=="object"&&typeof Ro!="undefined")Ro.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(p,f){if(!o[p]){if(!i[p]){var m=typeof sr=="function"&&sr;if(!f&&m)return m(p,!0);if(l)return l(p,!0);var h=new Error("Cannot find module '"+p+"'");throw h.code="MODULE_NOT_FOUND",h}var w=o[p]={exports:{}};i[p][0].call(w.exports,function(E){var A=i[p][1][E];return s(A||E)},w,w.exports,n,i,o,a)}return o[p].exports}for(var l=typeof sr=="function"&&sr,u=0;u<a.length;u++)s(a[u]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,l;if(s){var u=0,p=new s(E),f=a.document.createTextNode("");p.observe(f,{characterData:!0}),l=function(){f.data=u=++u%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var m=new a.MessageChannel;m.port1.onmessage=E,l=function(){m.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){E(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:l=function(){setTimeout(E,0)};var h,w=[];function E(){h=!0;for(var b,C,N=w.length;N;){for(C=w,w=[],b=-1;++b<N;)C[b]();N=w.length}h=!1}i.exports=A;function A(b){w.push(b)===1&&!h&&l()}}).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 l={},u=["REJECTED"],p=["FULFILLED"],f=["PENDING"];i.exports=m;function m(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,S!==s&&A(this,S)}m.prototype.catch=function(S){return this.then(null,S)},m.prototype.then=function(S,D){if(typeof S!="function"&&this.state===p||typeof D!="function"&&this.state===u)return this;var x=new this.constructor(s);if(this.state!==f){var M=this.state===p?S:D;w(x,M,this.outcome)}else this.queue.push(new h(x,S,D));return x};function h(S,D,x){this.promise=S,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof x=="function"&&(this.onRejected=x,this.callRejected=this.otherCallRejected)}h.prototype.callFulfilled=function(S){l.resolve(this.promise,S)},h.prototype.otherCallFulfilled=function(S){w(this.promise,this.onFulfilled,S)},h.prototype.callRejected=function(S){l.reject(this.promise,S)},h.prototype.otherCallRejected=function(S){w(this.promise,this.onRejected,S)};function w(S,D,x){a(function(){var M;try{M=D(x)}catch($){return l.reject(S,$)}M===S?l.reject(S,new TypeError("Cannot resolve promise with itself")):l.resolve(S,M)})}l.resolve=function(S,D){var x=b(E,D);if(x.status==="error")return l.reject(S,x.value);var M=x.value;if(M)A(S,M);else{S.state=p,S.outcome=D;for(var $=-1,q=S.queue.length;++$<q;)S.queue[$].callFulfilled(D)}return S},l.reject=function(S,D){S.state=u,S.outcome=D;for(var x=-1,M=S.queue.length;++x<M;)S.queue[x].callRejected(D);return S};function E(S){var D=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof D=="function")return function(){D.apply(S,arguments)}}function A(S,D){var x=!1;function M(Z){x||(x=!0,l.reject(S,Z))}function $(Z){x||(x=!0,l.resolve(S,Z))}function q(){D($,M)}var X=b(q);X.status==="error"&&M(X.value)}function b(S,D){var x={};try{x.value=S(D),x.status="success"}catch(M){x.status="error",x.value=M}return x}m.resolve=C;function C(S){return S instanceof this?S:l.resolve(new this(s),S)}m.reject=N;function N(S){var D=new this(s);return l.reject(D,S)}m.all=B;function B(S){var D=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,M=!1;if(!x)return this.resolve([]);for(var $=new Array(x),q=0,X=-1,Z=new this(s);++X<x;)ge(S[X],X);return Z;function ge(We,ir){D.resolve(We).then(Wr,function(dt){M||(M=!0,l.reject(Z,dt))});function Wr(dt){$[ir]=dt,++q===x&&!M&&(M=!0,l.resolve(Z,$))}}}m.race=V;function V(S){var D=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var x=S.length,M=!1;if(!x)return this.resolve([]);for(var $=-1,q=new this(s);++$<x;)X(S[$]);return q;function X(Z){D.resolve(Z).then(function(ge){M||(M=!0,l.resolve(q,ge))},function(ge){M||(M=!0,l.reject(q,ge))})}}},{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(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function s(c,v){if(!(c instanceof v))throw new TypeError("Cannot call a class as a function")}function l(){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(c){return}}var u=l();function p(){try{if(!u||!u.open)return!1;var c=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),v=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||v)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(d){return!1}}function f(c,v){c=c||[],v=v||{};try{return new Blob(c,v)}catch(_){if(_.name!=="TypeError")throw _;for(var d=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,g=new d,y=0;y<c.length;y+=1)g.append(c[y]);return g.getBlob(v.type)}}typeof Promise=="undefined"&&n(3);var m=Promise;function h(c,v){v&&c.then(function(d){v(null,d)},function(d){v(d)})}function w(c,v,d){typeof v=="function"&&c.then(v),typeof d=="function"&&c.catch(d)}function E(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function A(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",C=void 0,N={},B=Object.prototype.toString,V="readonly",S="readwrite";function D(c){for(var v=c.length,d=new ArrayBuffer(v),g=new Uint8Array(d),y=0;y<v;y++)g[y]=c.charCodeAt(y);return d}function x(c){return new m(function(v){var d=c.transaction(b,S),g=f([""]);d.objectStore(b).put(g,"key"),d.onabort=function(y){y.preventDefault(),y.stopPropagation(),v(!1)},d.oncomplete=function(){var y=navigator.userAgent.match(/Chrome\/(\d+)/),_=navigator.userAgent.match(/Edge\//);v(_||!y||parseInt(y[1],10)>=43)}}).catch(function(){return!1})}function M(c){return typeof C=="boolean"?m.resolve(C):x(c).then(function(v){return C=v,C})}function $(c){var v=N[c.name],d={};d.promise=new m(function(g,y){d.resolve=g,d.reject=y}),v.deferredOperations.push(d),v.dbReady?v.dbReady=v.dbReady.then(function(){return d.promise}):v.dbReady=d.promise}function q(c){var v=N[c.name],d=v.deferredOperations.pop();if(d)return d.resolve(),d.promise}function X(c,v){var d=N[c.name],g=d.deferredOperations.pop();if(g)return g.reject(v),g.promise}function Z(c,v){return new m(function(d,g){if(N[c.name]=N[c.name]||za(),c.db)if(v)$(c),c.db.close();else return d(c.db);var y=[c.name];v&&y.push(c.version);var _=u.open.apply(u,y);v&&(_.onupgradeneeded=function(I){var R=_.result;try{R.createObjectStore(c.storeName),I.oldVersion<=1&&R.createObjectStore(b)}catch(k){if(k.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+I.oldVersion+" to version "+I.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw k}}),_.onerror=function(I){I.preventDefault(),g(_.error)},_.onsuccess=function(){var I=_.result;I.onversionchange=function(R){R.target.close()},d(I),q(c)}})}function ge(c){return Z(c,!1)}function We(c){return Z(c,!0)}function ir(c,v){if(!c.db)return!0;var d=!c.db.objectStoreNames.contains(c.storeName),g=c.version<c.db.version,y=c.version>c.db.version;if(g&&(c.version!==v&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),y||d){if(d){var _=c.db.version+1;_>c.version&&(c.version=_)}return!0}return!1}function Wr(c){return new m(function(v,d){var g=new FileReader;g.onerror=d,g.onloadend=function(y){var _=btoa(y.target.result||"");v({__local_forage_encoded_blob:!0,data:_,type:c.type})},g.readAsBinaryString(c)})}function dt(c){var v=D(atob(c.data));return f([v],{type:c.type})}function Wa(c){return c&&c.__local_forage_encoded_blob}function cd(c){var v=this,d=v._initReady().then(function(){var g=N[v._dbInfo.name];if(g&&g.dbReady)return g.dbReady});return w(d,c,c),d}function ud(c){$(c);for(var v=N[c.name],d=v.forages,g=0;g<d.length;g++){var y=d[g];y._dbInfo.db&&(y._dbInfo.db.close(),y._dbInfo.db=null)}return c.db=null,ge(c).then(function(_){return c.db=_,ir(c)?We(c):_}).then(function(_){c.db=v.db=_;for(var I=0;I<d.length;I++)d[I]._dbInfo.db=_}).catch(function(_){throw X(c,_),_})}function ze(c,v,d,g){g===void 0&&(g=1);try{var y=c.db.transaction(c.storeName,v);d(null,y)}catch(_){if(g>0&&(!c.db||_.name==="InvalidStateError"||_.name==="NotFoundError"))return m.resolve().then(function(){if(!c.db||_.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),We(c)}).then(function(){return ud(c).then(function(){ze(c,v,d,g-1)})}).catch(d);d(_)}}function za(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function dd(c){var v=this,d={db:null};if(c)for(var g in c)d[g]=c[g];var y=N[d.name];y||(y=za(),N[d.name]=y),y.forages.push(v),v._initReady||(v._initReady=v.ready,v.ready=cd);var _=[];function I(){return m.resolve()}for(var R=0;R<y.forages.length;R++){var k=y.forages[R];k!==v&&_.push(k._initReady().catch(I))}var T=y.forages.slice(0);return m.all(_).then(function(){return d.db=y.db,ge(d)}).then(function(L){return d.db=L,ir(d,v._defaultConfig.version)?We(d):L}).then(function(L){d.db=y.db=L,v._dbInfo=d;for(var U=0;U<T.length;U++){var H=T[U];H!==v&&(H._dbInfo.db=d.db,H._dbInfo.version=d.version)}})}function fd(c,v){var d=this;c=E(c);var g=new m(function(y,_){d.ready().then(function(){ze(d._dbInfo,V,function(I,R){if(I)return _(I);try{var k=R.objectStore(d._dbInfo.storeName),T=k.get(c);T.onsuccess=function(){var L=T.result;L===void 0&&(L=null),Wa(L)&&(L=dt(L)),y(L)},T.onerror=function(){_(T.error)}}catch(L){_(L)}})}).catch(_)});return h(g,v),g}function hd(c,v){var d=this,g=new m(function(y,_){d.ready().then(function(){ze(d._dbInfo,V,function(I,R){if(I)return _(I);try{var k=R.objectStore(d._dbInfo.storeName),T=k.openCursor(),L=1;T.onsuccess=function(){var U=T.result;if(U){var H=U.value;Wa(H)&&(H=dt(H));var z=c(H,U.key,L++);z!==void 0?y(z):U.continue()}else y()},T.onerror=function(){_(T.error)}}catch(U){_(U)}})}).catch(_)});return h(g,v),g}function md(c,v,d){var g=this;c=E(c);var y=new m(function(_,I){var R;g.ready().then(function(){return R=g._dbInfo,B.call(v)==="[object Blob]"?M(R.db).then(function(k){return k?v:Wr(v)}):v}).then(function(k){ze(g._dbInfo,S,function(T,L){if(T)return I(T);try{var U=L.objectStore(g._dbInfo.storeName);k===null&&(k=void 0);var H=U.put(k,c);L.oncomplete=function(){k===void 0&&(k=null),_(k)},L.onabort=L.onerror=function(){var z=H.error?H.error:H.transaction.error;I(z)}}catch(z){I(z)}})}).catch(I)});return h(y,d),y}function pd(c,v){var d=this;c=E(c);var g=new m(function(y,_){d.ready().then(function(){ze(d._dbInfo,S,function(I,R){if(I)return _(I);try{var k=R.objectStore(d._dbInfo.storeName),T=k.delete(c);R.oncomplete=function(){y()},R.onerror=function(){_(T.error)},R.onabort=function(){var L=T.error?T.error:T.transaction.error;_(L)}}catch(L){_(L)}})}).catch(_)});return h(g,v),g}function vd(c){var v=this,d=new m(function(g,y){v.ready().then(function(){ze(v._dbInfo,S,function(_,I){if(_)return y(_);try{var R=I.objectStore(v._dbInfo.storeName),k=R.clear();I.oncomplete=function(){g()},I.onabort=I.onerror=function(){var T=k.error?k.error:k.transaction.error;y(T)}}catch(T){y(T)}})}).catch(y)});return h(d,c),d}function _d(c){var v=this,d=new m(function(g,y){v.ready().then(function(){ze(v._dbInfo,V,function(_,I){if(_)return y(_);try{var R=I.objectStore(v._dbInfo.storeName),k=R.count();k.onsuccess=function(){g(k.result)},k.onerror=function(){y(k.error)}}catch(T){y(T)}})}).catch(y)});return h(d,c),d}function gd(c,v){var d=this,g=new m(function(y,_){if(c<0){y(null);return}d.ready().then(function(){ze(d._dbInfo,V,function(I,R){if(I)return _(I);try{var k=R.objectStore(d._dbInfo.storeName),T=!1,L=k.openKeyCursor();L.onsuccess=function(){var U=L.result;if(!U){y(null);return}c===0||T?y(U.key):(T=!0,U.advance(c))},L.onerror=function(){_(L.error)}}catch(U){_(U)}})}).catch(_)});return h(g,v),g}function yd(c){var v=this,d=new m(function(g,y){v.ready().then(function(){ze(v._dbInfo,V,function(_,I){if(_)return y(_);try{var R=I.objectStore(v._dbInfo.storeName),k=R.openKeyCursor(),T=[];k.onsuccess=function(){var L=k.result;if(!L){g(T);return}T.push(L.key),L.continue()},k.onerror=function(){y(k.error)}}catch(L){y(L)}})}).catch(y)});return h(d,c),d}function bd(c,v){v=A.apply(this,arguments);var d=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||d.name,c.storeName=c.storeName||d.storeName);var g=this,y;if(!c.name)y=m.reject("Invalid arguments");else{var _=c.name===d.name&&g._dbInfo.db,I=_?m.resolve(g._dbInfo.db):ge(c).then(function(R){var k=N[c.name],T=k.forages;k.db=R;for(var L=0;L<T.length;L++)T[L]._dbInfo.db=R;return R});c.storeName?y=I.then(function(R){if(R.objectStoreNames.contains(c.storeName)){var k=R.version+1;$(c);var T=N[c.name],L=T.forages;R.close();for(var U=0;U<L.length;U++){var H=L[U];H._dbInfo.db=null,H._dbInfo.version=k}var z=new m(function(Q,fe){var le=u.open(c.name,k);le.onerror=function(Me){var ar=le.result;ar.close(),fe(Me)},le.onupgradeneeded=function(){var Me=le.result;Me.deleteObjectStore(c.storeName)},le.onsuccess=function(){var Me=le.result;Me.close(),Q(Me)}});return z.then(function(Q){T.db=Q;for(var fe=0;fe<L.length;fe++){var le=L[fe];le._dbInfo.db=Q,q(le._dbInfo)}}).catch(function(Q){throw(X(c,Q)||m.resolve()).catch(function(){}),Q})}}):y=I.then(function(R){$(c);var k=N[c.name],T=k.forages;R.close();for(var L=0;L<T.length;L++){var U=T[L];U._dbInfo.db=null}var H=new m(function(z,Q){var fe=u.deleteDatabase(c.name);fe.onerror=function(){var le=fe.result;le&&le.close(),Q(fe.error)},fe.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},fe.onsuccess=function(){var le=fe.result;le&&le.close(),z(le)}});return H.then(function(z){k.db=z;for(var Q=0;Q<T.length;Q++){var fe=T[Q];q(fe._dbInfo)}}).catch(function(z){throw(X(c,z)||m.resolve()).catch(function(){}),z})})}return h(y,v),y}var wd={_driver:"asyncStorage",_initStorage:dd,_support:p(),iterate:hd,getItem:fd,setItem:md,removeItem:pd,clear:vd,length:_d,key:gd,keys:yd,dropInstance:bd};function Ed(){return typeof openDatabase=="function"}var ft="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Id="~~local_forage_type~",Qa=/^~~local_forage_type~([^~]+)~/,zr="__lfsc__:",Ci=zr.length,ki="arbf",Ti="blob",Ya="si08",Xa="ui08",Za="uic8",es="si16",ts="si32",rs="ur16",ns="ui32",is="fl32",os="fl64",as=Ci+ki.length,ss=Object.prototype.toString;function ls(c){var v=c.length*.75,d=c.length,g,y=0,_,I,R,k;c[c.length-1]==="="&&(v--,c[c.length-2]==="="&&v--);var T=new ArrayBuffer(v),L=new Uint8Array(T);for(g=0;g<d;g+=4)_=ft.indexOf(c[g]),I=ft.indexOf(c[g+1]),R=ft.indexOf(c[g+2]),k=ft.indexOf(c[g+3]),L[y++]=_<<2|I>>4,L[y++]=(I&15)<<4|R>>2,L[y++]=(R&3)<<6|k&63;return T}function xi(c){var v=new Uint8Array(c),d="",g;for(g=0;g<v.length;g+=3)d+=ft[v[g]>>2],d+=ft[(v[g]&3)<<4|v[g+1]>>4],d+=ft[(v[g+1]&15)<<2|v[g+2]>>6],d+=ft[v[g+2]&63];return v.length%3===2?d=d.substring(0,d.length-1)+"=":v.length%3===1&&(d=d.substring(0,d.length-2)+"=="),d}function Ad(c,v){var d="";if(c&&(d=ss.call(c)),c&&(d==="[object ArrayBuffer]"||c.buffer&&ss.call(c.buffer)==="[object ArrayBuffer]")){var g,y=zr;c instanceof ArrayBuffer?(g=c,y+=ki):(g=c.buffer,d==="[object Int8Array]"?y+=Ya:d==="[object Uint8Array]"?y+=Xa:d==="[object Uint8ClampedArray]"?y+=Za:d==="[object Int16Array]"?y+=es:d==="[object Uint16Array]"?y+=rs:d==="[object Int32Array]"?y+=ts:d==="[object Uint32Array]"?y+=ns:d==="[object Float32Array]"?y+=is:d==="[object Float64Array]"?y+=os:v(new Error("Failed to get type for BinaryArray"))),v(y+xi(g))}else if(d==="[object Blob]"){var _=new FileReader;_.onload=function(){var I=Id+c.type+"~"+xi(this.result);v(zr+Ti+I)},_.readAsArrayBuffer(c)}else try{v(JSON.stringify(c))}catch(I){console.error("Couldn't convert value into a JSON string: ",c),v(null,I)}}function Sd(c){if(c.substring(0,Ci)!==zr)return JSON.parse(c);var v=c.substring(as),d=c.substring(Ci,as),g;if(d===Ti&&Qa.test(v)){var y=v.match(Qa);g=y[1],v=v.substring(y[0].length)}var _=ls(v);switch(d){case ki:return _;case Ti:return f([_],{type:g});case Ya:return new Int8Array(_);case Xa:return new Uint8Array(_);case Za:return new Uint8ClampedArray(_);case es:return new Int16Array(_);case rs:return new Uint16Array(_);case ts:return new Int32Array(_);case ns:return new Uint32Array(_);case is:return new Float32Array(_);case os:return new Float64Array(_);default:throw new Error("Unkown type: "+d)}}var Pi={serialize:Ad,deserialize:Sd,stringToBuffer:ls,bufferToString:xi};function cs(c,v,d,g){c.executeSql("CREATE TABLE IF NOT EXISTS "+v.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],d,g)}function Rd(c){var v=this,d={db:null};if(c)for(var g in c)d[g]=typeof c[g]!="string"?c[g].toString():c[g];var y=new m(function(_,I){try{d.db=openDatabase(d.name,String(d.version),d.description,d.size)}catch(R){return I(R)}d.db.transaction(function(R){cs(R,d,function(){v._dbInfo=d,_()},function(k,T){I(T)})},I)});return d.serializer=Pi,y}function ht(c,v,d,g,y,_){c.executeSql(d,g,y,function(I,R){R.code===R.SYNTAX_ERR?I.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[v.storeName],function(k,T){T.rows.length?_(k,R):cs(k,v,function(){k.executeSql(d,g,y,_)},_)},_):_(I,R)},_)}function Od(c,v){var d=this;c=E(c);var g=new m(function(y,_){d.ready().then(function(){var I=d._dbInfo;I.db.transaction(function(R){ht(R,I,"SELECT * FROM "+I.storeName+" WHERE key = ? LIMIT 1",[c],function(k,T){var L=T.rows.length?T.rows.item(0).value:null;L&&(L=I.serializer.deserialize(L)),y(L)},function(k,T){_(T)})})}).catch(_)});return h(g,v),g}function Cd(c,v){var d=this,g=new m(function(y,_){d.ready().then(function(){var I=d._dbInfo;I.db.transaction(function(R){ht(R,I,"SELECT * FROM "+I.storeName,[],function(k,T){for(var L=T.rows,U=L.length,H=0;H<U;H++){var z=L.item(H),Q=z.value;if(Q&&(Q=I.serializer.deserialize(Q)),Q=c(Q,z.key,H+1),Q!==void 0){y(Q);return}}y()},function(k,T){_(T)})})}).catch(_)});return h(g,v),g}function us(c,v,d,g){var y=this;c=E(c);var _=new m(function(I,R){y.ready().then(function(){v===void 0&&(v=null);var k=v,T=y._dbInfo;T.serializer.serialize(v,function(L,U){U?R(U):T.db.transaction(function(H){ht(H,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[c,L],function(){I(k)},function(z,Q){R(Q)})},function(H){if(H.code===H.QUOTA_ERR){if(g>0){I(us.apply(y,[c,k,d,g-1]));return}R(H)}})})}).catch(R)});return h(_,d),_}function kd(c,v,d){return us.apply(this,[c,v,d,1])}function Td(c,v){var d=this;c=E(c);var g=new m(function(y,_){d.ready().then(function(){var I=d._dbInfo;I.db.transaction(function(R){ht(R,I,"DELETE FROM "+I.storeName+" WHERE key = ?",[c],function(){y()},function(k,T){_(T)})})}).catch(_)});return h(g,v),g}function xd(c){var v=this,d=new m(function(g,y){v.ready().then(function(){var _=v._dbInfo;_.db.transaction(function(I){ht(I,_,"DELETE FROM "+_.storeName,[],function(){g()},function(R,k){y(k)})})}).catch(y)});return h(d,c),d}function Pd(c){var v=this,d=new m(function(g,y){v.ready().then(function(){var _=v._dbInfo;_.db.transaction(function(I){ht(I,_,"SELECT COUNT(key) as c FROM "+_.storeName,[],function(R,k){var T=k.rows.item(0).c;g(T)},function(R,k){y(k)})})}).catch(y)});return h(d,c),d}function Nd(c,v){var d=this,g=new m(function(y,_){d.ready().then(function(){var I=d._dbInfo;I.db.transaction(function(R){ht(R,I,"SELECT key FROM "+I.storeName+" WHERE id = ? LIMIT 1",[c+1],function(k,T){var L=T.rows.length?T.rows.item(0).key:null;y(L)},function(k,T){_(T)})})}).catch(_)});return h(g,v),g}function Ld(c){var v=this,d=new m(function(g,y){v.ready().then(function(){var _=v._dbInfo;_.db.transaction(function(I){ht(I,_,"SELECT key FROM "+_.storeName,[],function(R,k){for(var T=[],L=0;L<k.rows.length;L++)T.push(k.rows.item(L).key);g(T)},function(R,k){y(k)})})}).catch(y)});return h(d,c),d}function Dd(c){return new m(function(v,d){c.transaction(function(g){g.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(y,_){for(var I=[],R=0;R<_.rows.length;R++)I.push(_.rows.item(R).name);v({db:c,storeNames:I})},function(y,_){d(_)})},function(g){d(g)})})}function Ud(c,v){v=A.apply(this,arguments);var d=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||d.name,c.storeName=c.storeName||d.storeName);var g=this,y;return c.name?y=new m(function(_){var I;c.name===d.name?I=g._dbInfo.db:I=openDatabase(c.name,"","",0),c.storeName?_({db:I,storeNames:[c.storeName]}):_(Dd(I))}).then(function(_){return new m(function(I,R){_.db.transaction(function(k){function T(z){return new m(function(Q,fe){k.executeSql("DROP TABLE IF EXISTS "+z,[],function(){Q()},function(le,Me){fe(Me)})})}for(var L=[],U=0,H=_.storeNames.length;U<H;U++)L.push(T(_.storeNames[U]));m.all(L).then(function(){I()}).catch(function(z){R(z)})},function(k){R(k)})})}):y=m.reject("Invalid arguments"),h(y,v),y}var Md={_driver:"webSQLStorage",_initStorage:Rd,_support:Ed(),iterate:Cd,getItem:Od,setItem:kd,removeItem:Td,clear:xd,length:Pd,key:Nd,keys:Ld,dropInstance:Ud};function Bd(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(c){return!1}}function ds(c,v){var d=c.name+"/";return c.storeName!==v.storeName&&(d+=c.storeName+"/"),d}function Jd(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch(v){return!0}}function Fd(){return!Jd()||localStorage.length>0}function jd(c){var v=this,d={};if(c)for(var g in c)d[g]=c[g];return d.keyPrefix=ds(c,v._defaultConfig),Fd()?(v._dbInfo=d,d.serializer=Pi,m.resolve()):m.reject()}function Hd(c){var v=this,d=v.ready().then(function(){for(var g=v._dbInfo.keyPrefix,y=localStorage.length-1;y>=0;y--){var _=localStorage.key(y);_.indexOf(g)===0&&localStorage.removeItem(_)}});return h(d,c),d}function Gd(c,v){var d=this;c=E(c);var g=d.ready().then(function(){var y=d._dbInfo,_=localStorage.getItem(y.keyPrefix+c);return _&&(_=y.serializer.deserialize(_)),_});return h(g,v),g}function Vd(c,v){var d=this,g=d.ready().then(function(){for(var y=d._dbInfo,_=y.keyPrefix,I=_.length,R=localStorage.length,k=1,T=0;T<R;T++){var L=localStorage.key(T);if(L.indexOf(_)===0){var U=localStorage.getItem(L);if(U&&(U=y.serializer.deserialize(U)),U=c(U,L.substring(I),k++),U!==void 0)return U}}});return h(g,v),g}function $d(c,v){var d=this,g=d.ready().then(function(){var y=d._dbInfo,_;try{_=localStorage.key(c)}catch(I){_=null}return _&&(_=_.substring(y.keyPrefix.length)),_});return h(g,v),g}function qd(c){var v=this,d=v.ready().then(function(){for(var g=v._dbInfo,y=localStorage.length,_=[],I=0;I<y;I++){var R=localStorage.key(I);R.indexOf(g.keyPrefix)===0&&_.push(R.substring(g.keyPrefix.length))}return _});return h(d,c),d}function Kd(c){var v=this,d=v.keys().then(function(g){return g.length});return h(d,c),d}function Wd(c,v){var d=this;c=E(c);var g=d.ready().then(function(){var y=d._dbInfo;localStorage.removeItem(y.keyPrefix+c)});return h(g,v),g}function zd(c,v,d){var g=this;c=E(c);var y=g.ready().then(function(){v===void 0&&(v=null);var _=v;return new m(function(I,R){var k=g._dbInfo;k.serializer.serialize(v,function(T,L){if(L)R(L);else try{localStorage.setItem(k.keyPrefix+c,T),I(_)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&R(U),R(U)}})})});return h(y,d),y}function Qd(c,v){if(v=A.apply(this,arguments),c=typeof c!="function"&&c||{},!c.name){var d=this.config();c.name=c.name||d.name,c.storeName=c.storeName||d.storeName}var g=this,y;return c.name?y=new m(function(_){c.storeName?_(ds(c,g._defaultConfig)):_(c.name+"/")}).then(function(_){for(var I=localStorage.length-1;I>=0;I--){var R=localStorage.key(I);R.indexOf(_)===0&&localStorage.removeItem(R)}}):y=m.reject("Invalid arguments"),h(y,v),y}var Yd={_driver:"localStorageWrapper",_initStorage:jd,_support:Bd(),iterate:Vd,getItem:Gd,setItem:zd,removeItem:Wd,clear:Hd,length:Kd,key:$d,keys:qd,dropInstance:Qd},Xd=function(v,d){return v===d||typeof v=="number"&&typeof d=="number"&&isNaN(v)&&isNaN(d)},Zd=function(v,d){for(var g=v.length,y=0;y<g;){if(Xd(v[y],d))return!0;y++}return!1},fs=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},or={},hs={},Tt={INDEXEDDB:wd,WEBSQL:Md,LOCALSTORAGE:Yd},ef=[Tt.INDEXEDDB._driver,Tt.WEBSQL._driver,Tt.LOCALSTORAGE._driver],Qr=["dropInstance"],Ni=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Qr),tf={description:"",driver:ef.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function rf(c,v){c[v]=function(){var d=arguments;return c.ready().then(function(){return c[v].apply(c,d)})}}function Li(){for(var c=1;c<arguments.length;c++){var v=arguments[c];if(v)for(var d in v)v.hasOwnProperty(d)&&(fs(v[d])?arguments[0][d]=v[d].slice():arguments[0][d]=v[d])}return arguments[0]}var nf=function(){function c(v){s(this,c);for(var d in Tt)if(Tt.hasOwnProperty(d)){var g=Tt[d],y=g._driver;this[d]=y,or[y]||this.defineDriver(g)}this._defaultConfig=Li({},tf),this._config=Li({},this._defaultConfig,v),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.prototype.config=function(d){if((typeof d=="undefined"?"undefined":a(d))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var g in d){if(g==="storeName"&&(d[g]=d[g].replace(/\W/g,"_")),g==="version"&&typeof d[g]!="number")return new Error("Database version must be a number.");this._config[g]=d[g]}return"driver"in d&&d.driver?this.setDriver(this._config.driver):!0}else return typeof d=="string"?this._config[d]:this._config},c.prototype.defineDriver=function(d,g,y){var _=new m(function(I,R){try{var k=d._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!d._driver){R(T);return}for(var L=Ni.concat("_initStorage"),U=0,H=L.length;U<H;U++){var z=L[U],Q=!Zd(Qr,z);if((Q||d[z])&&typeof d[z]!="function"){R(T);return}}var fe=function(){for(var ar=function(sf){return function(){var lf=new Error("Method "+sf+" is not implemented by the current driver"),ms=m.reject(lf);return h(ms,arguments[arguments.length-1]),ms}},Di=0,af=Qr.length;Di<af;Di++){var Ui=Qr[Di];d[Ui]||(d[Ui]=ar(Ui))}};fe();var le=function(ar){or[k]&&console.info("Redefining LocalForage driver: "+k),or[k]=d,hs[k]=ar,I()};"_support"in d?d._support&&typeof d._support=="function"?d._support().then(le,R):le(!!d._support):le(!0)}catch(Me){R(Me)}});return w(_,g,y),_},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(d,g,y){var _=or[d]?m.resolve(or[d]):m.reject(new Error("Driver not found."));return w(_,g,y),_},c.prototype.getSerializer=function(d){var g=m.resolve(Pi);return w(g,d),g},c.prototype.ready=function(d){var g=this,y=g._driverSet.then(function(){return g._ready===null&&(g._ready=g._initDriver()),g._ready});return w(y,d,d),y},c.prototype.setDriver=function(d,g,y){var _=this;fs(d)||(d=[d]);var I=this._getSupportedDrivers(d);function R(){_._config.driver=_.driver()}function k(U){return _._extend(U),R(),_._ready=_._initStorage(_._config),_._ready}function T(U){return function(){var H=0;function z(){for(;H<U.length;){var Q=U[H];return H++,_._dbInfo=null,_._ready=null,_.getDriver(Q).then(k).catch(z)}R();var fe=new Error("No available storage method found.");return _._driverSet=m.reject(fe),_._driverSet}return z()}}var L=this._driverSet!==null?this._driverSet.catch(function(){return m.resolve()}):m.resolve();return this._driverSet=L.then(function(){var U=I[0];return _._dbInfo=null,_._ready=null,_.getDriver(U).then(function(H){_._driver=H._driver,R(),_._wrapLibraryMethodsWithReady(),_._initDriver=T(I)})}).catch(function(){R();var U=new Error("No available storage method found.");return _._driverSet=m.reject(U),_._driverSet}),w(this._driverSet,g,y),this._driverSet},c.prototype.supports=function(d){return!!hs[d]},c.prototype._extend=function(d){Li(this,d)},c.prototype._getSupportedDrivers=function(d){for(var g=[],y=0,_=d.length;y<_;y++){var I=d[y];this.supports(I)&&g.push(I)}return g},c.prototype._wrapLibraryMethodsWithReady=function(){for(var d=0,g=Ni.length;d<g;d++)rf(this,Ni[d])},c.prototype.createInstance=function(d){return new c(d)},c}(),of=new nf;i.exports=of},{3:3}]},{},[4])(4)})});var vl=Ji(Pn=>{"use strict";F();pr();pt();var Co=_e(),Oh=rt("levelFinished",{paramsSchema:j.tuple(j.object({levelId:j.or(j.string(),j.number()),duration:j.number().optional(),rating:j.number().optional(),score:j.number().optional(),variation:j.string().optional()})),implement:e=>P(Pn,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e;we.info("onLevelFinished",r,n,i,o),yield Promise.all([et.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}}),et.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})])})}),Ch=rt("gamePlayEnded",{paramsSchema:j.tuple(j.object({duration:j.number().optional(),rating:j.number().optional(),score:j.number(),variation:j.string().optional()})),implement:e=>P(Pn,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e;we.info("onGamePlayEnded",t,r,n,i),yield Promise.all([et.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i}),et.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})])})}),kh=rt("levelUpgrade",{paramsSchema:j.tuple(j.object({levelId:j.or(j.string(),j.number()),name:j.string().optional()})),implement:r=>P(Pn,[r],function*({levelId:e,name:t}){yield Promise.all([et.tracker("LevelUpgrade",{name:t,levelId:e}),et.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});Co.registerCommand("TaskTrackerSDK.levelFinished",Oh);Co.registerCommand("TaskTrackerSDK.gamePlayEnded",Ch);Co.registerCommand("TaskTrackerSDK.levelUpgrade",kh);Ee("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});Ee("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});Ee("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var It,Ut,_l,ko,Th,Nn,To=te(()=>{"use strict";It=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},Ut=new Map,_l=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=Ut.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)}},ko=!1,Th=()=>{ko||(window.addEventListener("message",_l),ko=!0)},Nn=(e,t)=>{Th(),Ut.has(e)||Ut.set(e,new Set);let r=Ut.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&Ut.delete(e),Ut.size===0&&(window.removeEventListener("message",_l),ko=!1)}}});var Ln,Dn,Un,Mn,Bn,gl,Jn,Fn,Mt,xh,ce,Bt,Jt,je=te(()=>{"use strict";F();Ln="UNLOCK_OPTIONS_CHANGED",Dn="INVOKE_PAYMENT",Un="ON_PAYMENT_RESULT",Mn="ON_USE_MODAL_EVENT",Bn="ON_USE_MODAL_RESULT",gl="ON_USE_MODAL_FREQUENCY",Jn="ON_USE_UNLOGIN_MODAL_EVENT",Fn="INVOKE_UNLOGIN_MODAL_EVENT",Mt=new Je,xh=()=>({on:Mt.on.bind(Mt),off:Mt.off.bind(Mt),emit:Mt.emit.bind(Mt)}),ce=xh(),Bt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},Jt={show:!0,minInterval:8*60*60*1e3}});var Vu=Ji(Ga=>{"use strict";ae();je();To();F();var Gu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Nn("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",Gu[e.result],e.result),ce.emit(Bn,{useModalResult:Gu[e.result]})});ce.on(Mn,(e,t)=>{var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||It("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:Ye()})});Nn("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ce.emit(Un,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin,currency:"JOLI_COIN"})});ce.on(Dn,(e,t)=>P(Ga,null,function*(){var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||It("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:Ye()})}));Nn("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ce.emit(Jn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{claimedRewardValue:(i=(n=(r=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:r.reward)==null?void 0:n.rewardValue)!=null?i:0,isFirstLogin:(o=e.isFirstLogin)!=null?o:!1}}),e.result==="SUCCESS"&&O.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ce.on(Fn,e=>P(Ga,null,function*(){e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||It("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:Ye(),type:e})}))});pt();ae();pr();F();var dl=_e(),dh="env",fh="getSystemInfoSync",hh=()=>{var i,o,a,s;let e={system:O.deviceInfo.system,platform:O.deviceInfo.platform.toLowerCase(),brand:O.deviceInfo.brand,pixelRatio:O.deviceInfo.pixelRatio,language:O.deviceInfo.lang,version:O.sdkInfo.jssdkVersion,appName:(i=O.hostInfo)==null?void 0:i.appName,SDKVersion:O.sdkInfo.nativeSDKVersion},t=(o=O.hostInfo)==null?void 0:o.version;t&&(e=ve(G({},e),{version:t}));let r=(a=O.hostInfo)==null?void 0:a.appName;r&&(e=ve(G({},e),{appName:r}));let n=(s=O.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=ve(G({},e),{SDKVersion:n})),e},mh=Et(fh,{implement:hh}),ph=Et(dh,{implement:()=>ve(G({},O.hostInfo),{sdkInfo:O.sdkInfo,platform:O.platform,deviceInfo:O.deviceInfo})});dl.registerCommand("API.env",ph);dl.registerCommand("API.getSystemInfoSync",mh);Ee("env",{version:"1.0.0"});Ee("getSystemInfoSync",{version:"1.0.0"});F();pr();$e();pt();var vh="onJoliboxShow",_h="onJoliboxHide",gh="onReady",Ao=_e(),So=Us(Oe),Io=!0,vr=!0,Cn=0,kn=vo;function yh(){let e=Date.now();if(e-Cn<100)return;Cn=e;let t=document.visibilityState==="visible";t!==Io&&(Io=t,kn.emit("visible",Io))}function fl(e){let t=Date.now();t-Cn<100||(Cn=t,e==="focus"&&!vr?vr=!0:e==="blur"&&vr&&(vr=!1),kn.emit("visible",vr))}document.addEventListener("visibilitychange",yh);window.addEventListener("focus",()=>fl("focus"));window.addEventListener("blur",()=>fl("blur"));var bh=Et(vh,{paramsSchema:j.tuple(j.function()),implement(e){let t=So(e);kn.on("visible",r=>{r&&t()})}}),wh=Et(_h,{paramsSchema:j.tuple(j.function()),implement(e){let t=So(e);kn.on("visible",r=>{!r&&t()})}}),Eh=Et(gh,{paramsSchema:j.tuple(j.function()),implement(e){let t=So(e);Xe.on("LifecycleEvent.onReady",r=>{t(r)})}});Ao.registerCommand("LifecycleSDK.onReady",Eh);Ao.registerCommand("LifecycleSDK.onJoliboxShow",bh);Ao.registerCommand("LifecycleSDK.onJoliboxHide",wh);Ee("lifeCycle.onReady",{version:"1.0.0"});Ee("lifeCycle.onJoliboxShow",{version:"1.0.0"});Ee("lifeCycle.onJoliboxHide",{version:"1.0.0"});pr();F();Nt();ae();var pl=Fi(ml());var Tn=_e(),Oo=class{constructor(){this.httpClient=He.create({baseUrl:Be(O.testMode)});this.getGameId=()=>O.mpId;this.getItem=t=>P(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)=>P(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=>P(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=()=>P(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=pl.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},xn=new Oo,Ih=rt("getLocalStorage",{paramsSchema:j.tuple(j.string()),implement(e){return P(this,null,function*(){return yield xn.getItem(e)})}});Tn.registerCommand("StorageSDK.getItem",Ih);Ee("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Ah=rt("setStorage",{paramsSchema:j.tuple(j.string(),j.or(j.string(),j.boolean(),j.number())),implement(e,t){return P(this,null,function*(){return yield xn.setItem(e,t)})}});Tn.registerCommand("StorageSDK.setItem",Ah);Ee("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Sh=rt("removeStorage",{paramsSchema:j.tuple(j.string()),implement(e){return P(this,null,function*(){return yield xn.removeItem(e)})}});Tn.registerCommand("StorageSDK.removeItem",Sh);Ee("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Rh=rt("clearStorage",{implement(){return P(this,null,function*(){return yield xn.clear()})}});Tn.registerCommand("StorageSDK.clear",Rh);Ee("storage.clear",{version:"1.0.0"});var UA=Fi(vl());pt();F();Nt();To();ae();je();var yl=O.testMode;function bl(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return P(this,null,function*(){return yield i.reduce((s,l)=>P(this,null,function*(){let u=yield s;if(u===!0)return!0;yl&&console.log(`handleReward ${l}`);let p=e.get(l),f=p?yield p(...o):u;return yl&&console.log(`handleReward ${l} ${f}`),f}),Promise.resolve(!1))})},registerRewardsFetcher(i){return P(this,null,function*(){t=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return P(this,null,function*(){r=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:Bt,loginGuide:Jt}}})})},getRewardsTypes(...i){return P(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return P(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:Bt,loginGuide:Jt}})}}}je();F();var Ph=()=>(e,t)=>{let r={JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return r[t]-r[e]},Nh=e=>e.length?e.includes("JOLI_GEM")&&e.length<=1?["JOLI_GEM_ONLY"]:e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Ph()):["ADS"],wl=e=>{e.registerRewardsFetcher(t=>P(void 0,null,function*(){var n,i,o,a,s;let r=["ADS"];try{let l=yield t.post("/api/games/unlock-options",{});if(l.code!=="SUCCESS")return r;console.log("-----res fetch reward-----",l),ce.emit(Ln,{options:((n=l.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=l.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1},userGem:((o=l.extra)==null?void 0:o.joliGem)||{balance:0,enableAutoDeduct:!1}});let u=((s=(a=l.data)==null?void 0:a.unlockOptions)==null?void 0:s.map(p=>p.type))||Array.from(r);return Nh(u)}catch(l){return console.error("getRewardOptions error:",l),r}}))},El=e=>{e.registerRewardFrequencyConfigFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return ce.emit(gl,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||Bt,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||Jt}),r.data&&Xe.emit("onGlobalConfigChanged",{globalConfig:r.data}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||Bt,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||Jt}}))};var Il=e=>t=>P(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(r){console.error("-----createAdsRewardHandler error-----",r)}return!0});je();function vt(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),updateData:a=>{if(i)return i=G(G({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}je();var ke=vt(ce,Ln);ae();F();var xo={JOLI_COIN:{balanceEndpoint:"/api/joli-coin/balance",balanceDetailEndpoint:"/api/joli-coin/balance-detail",unlockEndpoint:"/api/joli-coin/unlock",unlockType:"JOLI_COIN"},GEM:{balanceEndpoint:"/api/joli-gem/balance",balanceDetailEndpoint:"/api/joli-gem/balance-detail",unlockEndpoint:"/api/joli-gem/unlock",unlockType:"GEM"}};F();var nt=_e();je();je();var Al=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Sl=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-gem/balance",{query:{type:"GEM"}})).data});var Ft={JOLI_COIN:{fetchBalance:Al,getQuantity:e=>{var t,r,n;return(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(i=>i.type==="JOLI_COIN"))==null?void 0:r.joliCoinChoices[0].joliCoinQuantity)!=null?n:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userJoliCoin)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userJoliCoin",isEnough:(e,t)=>{var r,n;return(n=(r=e==null?void 0:e.options)==null?void 0:r.some(i=>i.type==="JOLI_COIN"&&i.joliCoinChoices.some(o=>{var a;return o.joliCoinQuantity<=((a=t==null?void 0:t.balance)!=null?a:0)})))!=null?n:!1}},JOLI_GEM:{fetchBalance:Sl,getQuantity:e=>{var t,r,n,i;return(i=(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(o=>o.type==="JOLI_GEM"))==null?void 0:r.joliGemChoice)==null?void 0:n.joliGemQuantity)!=null?i:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userGem)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userGem",isEnough:(e,t)=>{var n,i,o;let r=e==null?void 0:e.options.find(a=>a.type==="JOLI_GEM");return r?((i=(n=r.joliGemChoice)==null?void 0:n.joliGemQuantity)!=null?i:0)<=((o=t==null?void 0:t.balance)!=null?o:0):!1}}};var jn=(e,t,r)=>{let{showUnlockWithCurrencyModal:n}=r;nt.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){let i=yield ke.getData(),o=Ft[t],a=o.getCurrentUser(i),s=o.getQuantity(i),l=!!(a!=null&&a.enableAutoDeduct);return console.log("-----unlockOptions usemodal-----",i,l,s),(yield n({enableAutoDeduct:l,userCurrency:a,quantity:s,currency:t}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},At=(e,t)=>r=>P(void 0,null,function*(){let n=vt(ce,Bn);return ce.emit(Mn,e,{enableAutoDeduct:r.enableAutoDeduct,userCurrency:r.userCurrency,quantity:r.quantity,currency:r.currency,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});je();je();var Hn=(e,t,r)=>{let{httpClient:n,initiateAndAwaitPayment:i}=r;nt.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var m;let o=yield ke.getData(),a=Ft[t],s=yield a.fetchBalance(n),l=a.getQuantity(o),u=a.getCurrentUser(o),p=a.createUpdatedUser((m=s==null?void 0:s.balance)!=null?m:0,u.enableAutoDeduct),f=a.getUpdateKey();return ke.updateData({[f]:p}),console.log("-----unlockOptions payment-----",o,p,l,t),a.isEnough(o,p)?{result:"CONTINUE"}:{result:(yield i({userCurrency:p,currencyQuantity:l,currency:t}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},St=(e,t)=>r=>P(void 0,null,function*(){let n=vt(ce,Un);return ce.emit(Dn,e,{userCurrency:r.userCurrency,quantity:r.currencyQuantity,currency:r.currency,enableAutoDeduct:r.userCurrency.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});ae();je();je();F();var Gn=(e,t,r)=>{let{showUnloginModal:n,httpClient:i}=r;nt.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var s,l,u;let o=(s=O.hostUserInfo)==null?void 0:s.isLogin,a=yield ke.getData();if(console.log("-----isLogin-----",!!o),!o){let p=yield n(t);if(console.log("-----unloginModalResult-----",p),p.result=="FAILED"||p.result=="CANCEL")return{result:"FAILED"};let{isFirstLogin:f,claimedRewardValue:m}=(l=p.rewards)!=null?l:{};if(p.result=="SUCCESS"){f&&m&&(yield Rs(3e3));let h=Ft[t],w=yield h.fetchBalance(i),E=h.getQuantity(a),A=h.getCurrentUser(a),b=h.createUpdatedUser((u=w==null?void 0:w.balance)!=null?u:0,A.enableAutoDeduct),C=h.getUpdateKey();if(ke.updateData({[C]:b}),b.balance>=E)return{result:"SUCCESS"}}}return{result:"CONTINUE"}}))},Rt=(e,t)=>r=>P(void 0,null,function*(){let n=vt(ce,Jn);return ce.emit(Fn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,currency:r}),yield n.getFreshData()});lo();mr();F();var Lh=Object.defineProperty,Dh=Object.defineProperties,Uh=Object.getOwnPropertyDescriptors,qn=Object.getOwnPropertySymbols,Ll=Object.prototype.hasOwnProperty,Dl=Object.prototype.propertyIsEnumerable,Rl=(e,t,r)=>t in e?Lh(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,it=(e,t)=>{for(var r in t||(t={}))Ll.call(t,r)&&Rl(e,r,t[r]);if(qn)for(var r of qn(t))Dl.call(t,r)&&Rl(e,r,t[r]);return e},Mh=(e,t)=>Dh(e,Uh(t)),Bh=(e,t)=>{var r={};for(var n in e)Ll.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&qn)for(var n of qn(e))t.indexOf(n)<0&&Dl.call(e,n)&&(r[n]=e[n]);return r},Kn=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(u){i(u)}},a=l=>{try{s(r.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function Jh(e){return!!(e!=null&&e.__nativeBuffers__)}var Fh=e=>{let t=atob(e),r=t.length,n=new Uint8Array(r);for(let i=0;i<r;i++)n[i]=t.charCodeAt(i);return n.buffer};function Bo(e){if(typeof e=="string")try{e=JSON.parse(e)}catch(r){return{}}if(typeof e!="object"||e===null)return{};if(!Jh(e))return e;let t=e.__nativeBuffers__;if(delete e.__nativeBuffers__,t)for(let r=0;r<t.length;r++){let n=t[r];if(n){let i;n.value?i=n.value:n.base64&&(i=Fh(n.base64)),typeof i!="undefined"&&i instanceof ArrayBuffer&&(e[n.key]=i)}}return e}var jh=e=>{let t="",r=new Uint8Array(e),n=r.byteLength;for(let i=0;i<n;i++)t+=String.fromCharCode(r[i]);return btoa(t)};function Hh(e={},t=!1){let r=e,n=[];for(let[i,o]of Object.entries(r))if(o!==void 0&&o instanceof ArrayBuffer&&o.byteLength!==void 0){let a=t?{value:o,key:i}:{base64:jh(o),key:i};n.push(a),delete r[i]}return n.length>0&&(r.__nativeBuffers__=n),r}var Ul=Object.defineProperty,Gh=Object.getOwnPropertyDescriptor,Vh=(e,t)=>{for(var r in t)Ul(e,r,{get:t[r],enumerable:!0})},Ml=(e,t,r,n)=>{for(var i=n>1?void 0:n?Gh(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&&Ul(t,r,i),i},$h=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(u){i(u)}},a=l=>{try{s(r.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.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 qh(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}var Kh=class{constructor(){this.state="pending",this.promise=new Promise((e,t)=>{this.resolve=r=>{this.state==="pending"&&(this.state="fulfilled",e(r))},this.reject=r=>{this.state==="pending"&&(this.state="rejected",t(r))}})}};function Bl(e){return typeof e=="string"}function yr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Wh(e){return typeof e=="undefined"}function zh(e){return Wh(e)||e===null}function Jl(e){return typeof e=="function"}function Qh(e){return yr(e)&&Jl(e.then)}function Fl(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}var Yh=(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))(Yh||{}),Xh=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}},Wn=class extends Xh{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Zh=class extends Wn{constructor(){super(...arguments),this.name="INTERNAL_INVOKE_NATIVE_ERROR"}},em=class extends Wn{constructor(e,t,r,n){super(e),this.errNo=t,this.name="INTERNAL_APPLY_NATIVE_ERROR",this.errorType=r,this.errorCode=n}},tm=class extends Wn{constructor(){super(...arguments),this.name="INTERNAL_JSCORE_ERROR",this.priority="P0"}},Po=class extends Wn{constructor(){super(...arguments),this.name="INTERNAL_METRIC_REPORT_ERROR"}};function _r(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}var zn={log:_r("log"),warn:_r("warn"),info:_r("info"),error:_r("error"),debug:_r("debug")};Object.assign(globalThis,{logger:zn});var Ol=Symbol.for("Jolibox.canIUseMap"),rm={};globalThis[Ol]||(globalThis[Ol]=rm);var Jo=Symbol.for("Jolibox.canIUseMap.native"),nm={};globalThis[Jo]||(globalThis[Jo]=nm);var Cl={get config(){return globalThis[Jo]}},im=(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))(im||{}),om=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(om||{}),am=(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))(am||{});function sm(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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}}sm();var jt=typeof window=="undefined",lm=()=>!jt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Cw={isiOS:!jt&&(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:!jt&&navigator.userAgent.includes("Android"),isMac:!jt&&navigator.userAgent.includes("Mac"),isFacebook:!jt&&navigator.userAgent.includes("FB_IAB"),isPC:!jt&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Fo=class jo{constructor(t){this.element=t,this.next=jo.Undefined,this.prev=jo.Undefined}};Fo.Undefined=new Fo(void 0);var ne=Fo,cm=class{constructor(){this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ne.Undefined}clear(){let e=this._first;for(;e!==ne.Undefined;){let t=e.next;e.prev=ne.Undefined,e.next=ne.Undefined,e=t}this._first=ne.Undefined,this._last=ne.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ne(e);if(this._first===ne.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!==ne.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ne.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ne.Undefined&&e.next!==ne.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ne.Undefined&&e.next===ne.Undefined?(this._first=ne.Undefined,this._last=ne.Undefined):e.next===ne.Undefined?(this._last=this._last.prev,this._last.next=ne.Undefined):e.prev===ne.Undefined&&(this._first=this._first.next,this._first.prev=ne.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ne.Undefined;)yield e.element,e=e.next}},um=0,gr=class{constructor(e){this.value=e,this.id=um++}},wr=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 gr&&(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,l;if(this._disposed)return()=>{console.info("[Jolibox SDK] Emitter is _disposed")};r&&(t=t.bind(r));let u=new gr(t);return this._listeners?this._listeners instanceof gr?this._listeners=[this._listeners,u]:this._listeners.push(u):((i=(n=this.options)==null?void 0:n.onWillAddFirstListener)==null||i.call(n,this),this._listeners=u,(a=(o=this.options)==null?void 0:o.onDidFirstListener)==null||a.call(o,this)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var p,f,m,h;if(!this._disposed){if(this._listeners instanceof gr)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.call(p));else if(this._listeners){let w=this._listeners.indexOf(u);w>=0&&(this._listeners.splice(w,1),this._size--,this._size===0&&((h=(m=this.options)==null?void 0:m.onDidRemoveLastListener)==null||h.call(m)))}}}}),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 gr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ho=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 wr,o=l=>t(...l.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 l of s)t(...l.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 cm,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)}},Go={};Vh(Go,{None:()=>dm,filter:()=>hm,once:()=>jl,toPromise:()=>fm});var dm=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function fm(e){return new Promise(t=>jl(e)(t))}function jl(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function hm(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new wr(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}var No=Symbol.for("Jolibox.hostEmitter"),mm=()=>{let e=new Ho;return globalThis[No]||(globalThis[No]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[No]},kw=mm();function pm(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)vm(e[n],t[n])}function vm(e,t){if(Bl(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Jl(t)){try{if(e instanceof t)return}catch(r){}if(!zh(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 Vo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new wr,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 pm(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}};Vo=Ml([Fl],Vo);var kl=class{constructor(){this._onWillExecuteCommand=new wr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new wr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Vo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=qh(3e4)),this._starActivation}executeCommand(e,...t){return $h(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),Go.toPromise(Go.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}}};kl=Ml([Fl],kl);var Tw=Symbol.for("Jolibox.commands");qo("requestPaymentSync",{version:1e6,properties:{paymentBody:{appStoreProductId:102e4}}});qo("requestProductDetailsAsync",{version:102e4});qo("loginSync",{version:1e6,properties:{skipLogin:102e4,triggerFrom:102e4}});function qo(e,t){if(Cl.config[e]){zn.warn(`[can i use] ${e} already registered`);return}Cl.config[e]=it({},t)}function Tl(e,t){return`[${e}]:${t}`}var _m=()=>lm(),br="custom_event_",gm=[],ym=[],bm=["env","createRequestTask","login"],Hl="__batch_event__",wm="__native_batch_event__",Em=e=>e==="pv"?e:"default",$n=class{constructor(e){this.interval=30,this.lastReportTime=0,this.cache={};let{reporter:t,interval:r=30,eventName:n,tagNameOrder:i,metricName:o,type:a}=e;this.reporter=t,this.interval=r,this.eventName=n,this.tagNameOrder=i,this.metricName=o,this.type=Em(a)}report(e){this.type==="pv"?this.addPVPoint(e):this.addPoint(e),this.tryReport(!1)}flush(){this.tryReport(!0)}tryReport(e){if(Object.keys(this.cache).length){if(e){this.reporter(this.processPoints(this.cache)),this.clearPoints();return}this.lastReportTime=this.lastReportTime||Date.now(),Date.now()-this.lastReportTime>=this.interval*1e3&&(this.reporter(this.processPoints(this.cache)),this.clearPoints(),this.lastReportTime=Date.now())}}addPoint(e){let t=(r,n,i,o)=>{let a=n.shift();if(a){let s=o[a];r[s]||(r[s]={}),t(r[s],n,i,o)}else r[i]||(r[i]=[]),r[i].push(o[i])};t(this.cache,[...this.tagNameOrder],this.metricName,e)}addPVPoint(e){let t=(n,i,o,a)=>{let s=i.shift();if(!s&&yr(a))throw new Po(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);if(s){let l=[];if(yr(a))l.push(...Object.keys(a));else if(Bl(a)){if(i.length>0)throw new Po(`report value failed to match tagNameOrder, ${JSON.stringify(r)}`);l.push(a)}else throw new Po(`expected metric value to be a string, but got a(n) ${typeof a}, ${JSON.stringify(r)}`);l.forEach(u=>{n[u]||(n[u]={});let p=yr(a)?a[u]:a;t(n[u],[...i],o,p)})}else n[o]?n[o]++:n[o]=1},r={point:e,metricName:this.metricName,tagNameOrder:this.tagNameOrder};t(this.cache,[...this.tagNameOrder],this.metricName,e)}processPoints(e){return{eventName:this.eventName,tagNameOrder:this.tagNameOrder,metricName:this.metricName,metricAggregateType:this.type==="pv"?"itoa":"arr",data:e}}clearPoints(){this.cache={}}},xl=!1,Lo,Do,Uo;function Im(e,t){xl||(Lo=new $n({eventName:"jolibox_invoke",tagNameOrder:["status","method","errNo","errMsg","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Do=new $n({eventName:"jolibox_invoke_js2native",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),Uo=new $n({eventName:"jolibox_invoke_native2js",tagNameOrder:["status","method","isForeground"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}}),t("onJoliboxEnterBackground",()=>{Lo.flush(),Do.flush(),Uo.flush()}),xl=!0);function r(i){var o,a;let{method:s,args:l,startTime:u,isForeground:p,errMsg:f=`${s}:fail no errMsg`,errNo:m=0,__timing:h={receiveJSInvoke:0,invokeCallback:0}}=i,{receiveJSInvoke:w,invokeCallback:E}=h,A=(a=(o=f.match(/\S:(\S+)\s?/))==null?void 0:o[1])!=null?a:"fail";Lo.report({status:A,method:n(s,l),errNo:`${m}`,errMsg:f,isForeground:p,duration:Date.now()-u}),u&&w&&E&&(Do.report({status:A,method:s,isForeground:p,duration:Number((w-u).toFixed(3))}),Uo.report({status:A,method:s,isForeground:p,duration:Number((Date.now()-E).toFixed(3))}))}function n(i,o){return(i==="callHostMethod"||i==="callHostMethodSync")&&o!=null&&o.method?`${i}-${o.method}`:i}return r}var Mo=[],Am=!1,$o=Symbol.for("Jolibox.invokeResolverInstance"),Sm=new Map;globalThis[$o]||(globalThis[$o]=Sm);var Rm={get resolveMap(){return globalThis[$o]}};function Om(e,t){let r=0,n=!0,i=Rm.resolveMap,o=Im(e,t);t("onJoliboxEnterBackground",()=>{n=!1}),t("onJoliboxEnterForeground",()=>{n=!0,Mo.forEach(l=>Kn(this,[l],function*({method:u,args:p,resolve:f}){let m=yield s(u,p);f(m)})),Mo.length=0});let a=(l,u)=>{let p=i.get(Number(l));if(!p)return;let f=Bo(u);p(f),i.delete(Number(l))},s=(l,u)=>{var p,f;let m=Date.now(),h=`${n}`;r+=1;let w=new Kh;if(i.set(r,w.resolve),!n&&ym.includes(l))return new Promise(B=>{Mo.push({method:l,args:u,resolve:B})});let E=Mh(it({},{method:l,startTime:m,args:u,isForeground:h}),{invokeType:"js-bridge"}),A=!Am&&gm.includes(l),b=Hh(u,A),C=A?b:JSON.stringify(b),N;if(l.endsWith("Sync")||bm.includes(l)?N=(p=e.call)==null?void 0:p.call(e,l,b,r):typeof C=="string"?N=e.invoke(l,C,r):N=(f=e.call)==null?void 0:f.call(e,l,C,r),N){try{typeof N=="string"&&(N=JSON.parse(N)),N=Bo(N)}catch(B){zn.error(B)}return i.delete(r),N.errorCode&&(N.errorCode=Tl(l,N.errorCode)),o(it(it({},E),N)),N}return l.endsWith("Sync")&&i.delete(r),w.promise.then(B=>(B.errorCode&&(B.errorCode=Tl(l,B.errorCode)),o(it(it({},E),B)),B))};return{invokeNative:s,applyNative:(l,u)=>{let p=s(l,u);return Qh(p)?p.then(f=>Pl(l,f)):Pl(l,p)},invokeHandler:a}}function Pl(e,t){if(!yr(t)){zn.warn(`[Jolibox SDK]${e} no response value`);return}let r=t,{errMsg:n,errNo:i,errorType:o,errorCode:a}=r,s=Bh(r,["errMsg","errNo","errorType","errorCode"]);if(n&&n!==`${e}:ok`)throw new em(n,i,o,a);return s}var Vn=Symbol.for("Jolibox.subscribeInstance");function Cm(e){if(globalThis[Vn])return globalThis[Vn];let t=new Ho,r=new Ho,n=new $n({eventName:"jolibox_publish",tagNameOrder:["type","event"],metricName:"duration",reporter(i){e.invoke("trackAsync",JSON.stringify({event:"reportMetrics",data:i}),-1)}});return t.on("onJoliboxEnterBackground",()=>{n.flush()}),globalThis[Vn]={onNative:t.on.bind(t),offNative:t.off.bind(t),subscribe:r.on.bind(r),unsubscribe:r.off.bind(r),subscribeHandler(i,o,a){let s=Bo(o),l;if(s.__extra){l=s.params;let{type:u,startTime:p}=s.__extra;n.report({type:u,event:i,duration:Date.now()-p})}else l=s;if(i===Hl){l.forEach(u=>{let[p,f]=u;try{r.emit(p.slice(br.length),f,a)}catch(m){}});return}if(i.startsWith(br)){r.emit(i.slice(br.length),l,a);return}t.emit(i,l,a)}},globalThis[Vn]}function km(e){let t=new Map,r=new Map,n,i;return{publish:(o,a,s,l)=>{if(l){let p=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(`${br}${o}`,a,p);return}n||(n=Promise.resolve().then(()=>{t.forEach((p,f)=>{try{let m=f!==void 0?f==="*"?"*":[f]:void 0;e.publish(Hl,p,m)}catch(m){}}),n=void 0,t.clear()}));let u=t.get(s);u||(u=[],t.set(s,u)),u.push([`${br}${o}`,a])},emitNative:(o,a,s,l)=>{if(l){let p=s!==void 0?s==="*"?"*":[s]:void 0;e.publish(o,a,p),console.log("emitNative",o,a,p);return}i||(i=Promise.resolve().then(()=>{r.forEach((p,f)=>{try{let m=f!==void 0?f==="*"?"*":[f]:void 0;e.publish(wm,p,m)}catch(m){}}),i=void 0,r.clear()}));let u=r.get(s);u||(u=[],r.set(s,u)),u.push([o,a])}}}function Tm(e){let{subscribeHandler:t,onNative:r,offNative:n,subscribe:i,unsubscribe:o}=Cm(e),{invokeNative:a,invokeHandler:s,applyNative:l}=Om(e,r),{publish:u,emitNative:p}=km(e);return{invokeHandler:s,subscribeHandler:t,applyNative:l,invokeNative:a,onNative:r,offNative:n,emitNative:p,publish:u,subscribe:i,unsubscribe:o}}function Gl(e,t){return{params:e,__extra:{startTime:Date.now(),type:t}}}var Ko,_t={trigger(){},exit(){return Promise.resolve(!1)},backPress(){return Promise.resolve(!1)},onReady(e){_t.trigger=e},onDoExit(e){_t.exit=e},onDoBackPress(e){_t.backPress=e}},Vl=e=>{let t=window.prompt("invoke",JSON.stringify({event:"envSync",paramsString:JSON.stringify({})}));if(!t)e.onError(new Zh("native env failed"));else{let{data:r}=JSON.parse(t);return r!=null?r:void 0}};if(typeof window!="undefined"&&window.webkit){let e=window.webkit.messageHandlers,t=(i="")=>{_t.trigger(),e.onDocumentReady.postMessage({path:i})},r=i=>Kn(void 0,null,function*(){let o=yield _t.exit();e.doExit.postMessage({uuid:i,shouldInterrupt:o})});Ko={onDocumentReady:t,doExit:r,invoke(i,o,a){e.invoke.postMessage({event:i,paramsString:o,callbackId:a})},publish(i,o,a){let s=Gl(o,"joliboxJSCore");window.prompt("publish",JSON.stringify({event:i,paramsString:JSON.stringify(s),webviewIds:a}))},call(i,o,a){let s=window.prompt("invoke",JSON.stringify({event:i,paramsString:JSON.stringify(o),callbackId:a}));if(s)return JSON.parse(s)}};let n={onDocumentReady:t,env:Vl,doExit:r};globalThis.joliboxJSCore=it({},n)}if(typeof window!="undefined"&&window.JoliAndroidSDKBridge){let e,t=window.JoliAndroidSDKBridge,r=(o="")=>{_t.trigger(),t.onDocumentReady(JSON.stringify({path:o}))},n=o=>Kn(void 0,null,function*(){let a=yield _t.exit();t.doExit(JSON.stringify({uuid:o,shouldInterrupt:a}))});Ko={onDocumentReady:r,invoke(o,a,s){t.invoke(JSON.stringify({event:o,paramsString:a,callbackId:s}))},doExit:n,publish(o,a,s){let l=Gl(a,"joliboxJSCore");t.publish(JSON.stringify({event:o,paramsString:JSON.stringify(l),webviewIds:s}))},call(o,a,s){let l=window.prompt("invoke",JSON.stringify({event:o,paramsString:JSON.stringify(a),callbackId:s}));if(l)return JSON.parse(l)},doBackPress(o){return Kn(this,null,function*(){let a=yield _t.backPress();t.doBackPress(JSON.stringify({uuid:o,shouldInterrupt:a}))})}};let i={onDocumentReady:r,env:Vl,doExit:n};globalThis.joliboxJSCore=it({},i)}var $l=Ko;if(!$l&&_m())throw new tm("No joliboxJScore is found, native bridge not found.");var xm=it({},$l),ql=Tm(xm),{invokeHandler:Nl}=ql,{applyNative:Wo,invokeNative:Ht,onNative:Kl,offNative:xw,subscribeHandler:Pm,publish:Pw,emitNative:Nw,subscribe:Lw,unsubscribe:Dw}=ql;globalThis.joliboxJSBridge={callHandler:Nl,invokeHandler:Nl,subscribeHandler:Pm};Ve.on("GLOBAL_ERROR",(e,t)=>{var n;let r={message:e.message,stack:(n=e.stack)!=null?n:"",errorType:e.name,source:0};Ht("trackAsync",{event:"reportJsError",data:r})});Ve.on("GLOBAL_USER_ERROR",(e,t)=>{we.log("UserError",e,t)});F();nn();an();ae();ae();po();F();F();$e();mr();ae();var Nm=(e,t)=>{if(/^https?:\/\//.test(e))return e;let r=t==null?void 0:t.query,i=new URLSearchParams(r).toString();return t!=null&&t.baseUrl?`${t.baseUrl}${e}${i?`?${i}`:""}`:`${e}${i?`?${i}`:""}`};function Wl(e,t,r){var l,u,p;let n=new Map,i=(l=r==null?void 0:r.baseUrl)!=null?l:Be(O.testMode),o=(u=r==null?void 0:r.type)!=null?u:"public",a=(p=r==null?void 0:r.defaultHeaders)!=null?p:{};return Kl("onRequestTaskStateChange",f=>{if(typeof f.requestTaskId!="string")return;let m=n.get(f.requestTaskId);if(m)if(f.state==="success"){let h=f,{requestTaskId:E,state:A}=h,b=lr(h,["requestTaskId","state"]);f.statusCode===200?m.resolve(b):m.reject(b),n.delete(E)}else if(f.state==="fail"){let w=f,{requestTaskId:E,state:A}=w,b=lr(w,["requestTaskId","state"]);m.reject(b),n.delete(E)}else we.warn("onRequestTaskStateChange unknown event",f)}),Xe.on("onLoginComplete",({isLogin:f,token:m})=>{o!=="public"&&f&&m&&(a["X-JOLI-TOKEN"]=m)}),(h,...w)=>P(this,[h,...w],function*(f,m={}){let E=Date.now(),A=Nm(f,ve(G({},m),{baseUrl:i})),{method:b="GET",responseType:C="text",dataType:N="json",timeout:B,enableCache:V=!1,appendHostCookie:S=!0}=m,D=Object.assign({"content-type":"application/json"},a,m.header),x={url:A,method:b,header:D,enableCache:V,responseType:C,appendHostCookie:S};if(b=="POST"||b=="PUT"){let Z=Dm(m.data,D["content-type"]);x.data=Z}B&&Object.assign(x,{timeout:B});let{data:{requestTaskId:M}}=Ht(e,x);if(typeof M!="string")throw co({code:-1,msg:"requestTaskId is not a string"});let{resolve:$,reject:q,promise:X}=new Os;n.set(M,{resolve:$,reject:q});try{let Z=yield X,{data:ge}=Z;return N==="json"&&typeof ge=="string"&&(ge=Lm(ge)),{url:A,timeout:B,method:b,response:ve(G({},Z),{data:ge})}}catch(Z){let ge=Z;if(Pt(ge)){let{errMsg:We,prefetchDetail:ir,isPrefetch:Wr,errNo:dt}=ge;wt(We)&&Oe(co({code:-1,msg:We},{errNo:dt,errMsg:We}))}throw Z}})}function Lm(e){try{return JSON.parse(e.trim())}catch(t){return e}}function Dm(e,t="application/json"){let r=t.toLowerCase();return e===void 0?"":typeof e=="string"||e instanceof ArrayBuffer?e:r.includes("application/x-www-form-urlencoded")||r.includes("application/json")||typeof e=="object"?JSON.stringify(e):String(e)}ae();F();var zo={},zl;(zl=O.hostUserInfo)!=null&&zl.token&&(zo["x-joli-token"]=O.hostUserInfo.token);O.joliSource&&(zo["x-joli-source"]=O.joliSource);var Ql=Wl("createRequestTaskSync","operateRequestTaskSync",{type:"inner",baseUrl:Be(O.testMode),defaultHeaders:zo});var Qn=class extends Lt{constructor(t,r,n){super(r,n),this.gameId=O.mpId,this.sessionId=O.sessionId,this.track=t,this.taskUrl=Be(O.testMode)+"/api/base/app-event"}reporter(t){return P(this,null,function*(){let{event:r,params:n,extraParams:i}=t,o={eventType:r,gameInfo:G({gameId:this.gameId,sessionId:this.sessionId},n)};i&&Object.assign(o,i),yield O.platform==="android"?Ql("/api/base/app-event",{method:"POST",data:o}):Wo("trackAppEventAsync",{url:this.taskUrl,body:JSON.stringify(o)})})}reportToNative(t){return P(this,null,function*(){let{event:r,params:n}=t;yield Wo("userTrackAsync",{event:r,params:G({},n),gameId:this.gameId})})}tracker(t,r=null){this.track(t,r)}};var Um=(e,t,r)=>{var s,l,u,p,f,m;let n=t,i=Pt(n.extra)?n.extra:wt(n.extra)?JSON.parse(n.extra):{},o=ve(G({},i),{mp_id:(s=n.mp_id)!=null?s:"",mp_version:(l=n.mp_version)!=null?l:"",session_id:O.sessionId,user_id:(p=(u=O.hostUserInfo)==null?void 0:u.uid)!=null?p:""}),a=(f=n.eventType)!=null?f:Qe.Other;Ht("trackAsync",{event:(m=t.tag)!=null?m:e,data:o,webviewId:r,eventType:a})},Yl,Xl,{track:Er,trackPerformance:Mm}=rn(Um,{type:mt.AppSDK,platform:"native",jssdk_version:(Xl=(Yl=O.sdkInfo)==null?void 0:Yl.jssdkVersion)!=null?Xl:"1.0.0",mp_id:O.mpId,mp_version:O.mpVersion});var Zl=_e();Zl.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Mm(e,t,r)});Zl.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Er(e,t)});var Bm=new Je,CE=new Qn(Er,Bm);var Jm=(e,t,r,{handlers:{handleUnlockSuccess:n,handleUnlockFailed:i,unlockOptionsHandler:o,initiateAndAwaitPayment:a,showUnlockWithCurrencyModal:s,showUnloginModal:l}})=>{Gn(e,"JOLI_COIN",{httpClient:t,showUnloginModal:l}),Hn(e,"JOLI_COIN",{httpClient:t,initiateAndAwaitPayment:a}),jn(e,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let u=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];return p=>P(void 0,null,function*(){var f,m,h;try{let w=!0;for(let b of u){let C=yield nt.executeCommand(b);if(w=w&&C.result!=="FAILED",C.result!=="CONTINUE")break}if(!w)return i==null||i(p),!1;let E=xo[r],A=yield t.post(E.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${Ye()}-${O.mpType}-${Date.now()}`,gameInfo:{gameId:O.mpId}}});if(console.log("-----unlockWithCurrency request result-----",A),A.code=="SUCCESS"){try{(m=p.adBreakDone)==null||m.call(p,{breakType:p.type,breakName:"name"in p&&(f=p.name)!=null?f:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in p&&((h=p.adViewed)==null||h.call(p)),Er("jolicoin_unlock_success",{quantity:A.data.quantity})}catch(b){console.error("-----unlockWithJolicoin adBreakDone error-----",b)}return n==null||n({quantity:A.data.quantity,balance:A.data.balance}),!0}return i==null||i(p),!1}catch(w){if(console.info("JolicoinRewardHandler error:",w),w instanceof Error&&w.message=="CANCEL")throw w;return i==null||i(p),!1}finally{o.clearCache()}})},Yn=(e,t,r)=>Jm(e,t,"JOLI_COIN",r);var ec=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=At("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=St("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=Rt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return Yn("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:ke,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:a}})};var tc=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=l=>{var u;r==null||r(),(u=l.adBreakDone)==null||u.call(l,{breakType:l.type,breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=At("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=St("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=Rt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return Yn("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:ke,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:a}})};ae();F();var ot=bl();wl(ot);El(ot);var ti,J,ac,Xo,Ot,rc,sc,lc,cc,Zo,Qo,Yo,jm,Ir={},uc=[],Hm=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ar=Array.isArray;function at(e,t){for(var r in t)e[r]=t[r];return e}function ea(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Sr(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?ti.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 Zn(e,a,n,i,null)}function Zn(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?++ac:i,__i:-1,__u:0};return i==null&&J.vnode!=null&&J.vnode(o),o}function gt(e){return e.children}function Le(e,t){this.props=e,this.context=t}function Gt(e,t){if(t==null)return e.__?Gt(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?Gt(e):null}function dc(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 dc(e)}}function nc(e){(!e.__d&&(e.__d=!0)&&Ot.push(e)&&!ei.__r++||rc!==J.debounceRendering)&&((rc=J.debounceRendering)||sc)(ei)}function ei(){for(var e,t,r,n,i,o,a,s=1;Ot.length;)Ot.length>s&&Ot.sort(lc),e=Ot.shift(),s=Ot.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=at({},n)).__v=n.__v+1,J.vnode&&J.vnode(r),ta(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?Gt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,mc(o,r,a),r.__e!=i&&dc(r)));ei.__r=0}function fc(e,t,r,n,i,o,a,s,l,u,p){var f,m,h,w,E,A,b=n&&n.__k||uc,C=t.length;for(l=Gm(r,t,b,l,C),f=0;f<C;f++)(h=r.__k[f])!=null&&(m=h.__i===-1?Ir:b[h.__i]||Ir,h.__i=f,A=ta(e,h,m,i,o,a,s,l,u,p),w=h.__e,h.ref&&m.ref!=h.ref&&(m.ref&&ra(m.ref,null,h),p.push(h.ref,h.__c||w,h)),E==null&&w!=null&&(E=w),4&h.__u||m.__k===h.__k?l=hc(h,l,e):typeof h.type=="function"&&A!==void 0?l=A:w&&(l=w.nextSibling),h.__u&=-7);return r.__e=E,l}function Gm(e,t,r,n,i){var o,a,s,l,u,p=r.length,f=p,m=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(l=o+m,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Zn(null,a,null,null,null):Ar(a)?Zn(gt,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Zn(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,s=null,(u=a.__i=Vm(a,r,l,f))!==-1&&(f--,(s=r[u])&&(s.__u|=2)),s==null||s.__v===null?(u==-1&&(i>p?m--:i<p&&m++),typeof a.type!="function"&&(a.__u|=4)):u!=l&&(u==l-1?m--:u==l+1?m++:(u>l?m--:m++,a.__u|=4))):e.__k[o]=null;if(f)for(o=0;o<p;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=Gt(s)),vc(s,s));return n}function hc(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=hc(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Gt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Rr(e,t){return t=t||[],e==null||typeof e=="boolean"||(Ar(e)?e.some(function(r){Rr(r,t)}):t.push(e)),t}function Vm(e,t,r,n){var i,o,a=e.key,s=e.type,l=t[r];if(l===null&&e.key==null||l&&a==l.key&&s===l.type&&!(2&l.__u))return r;if(n>(l!=null&&!(2&l.__u)?1:0))for(i=r-1,o=r+1;i>=0||o<t.length;){if(i>=0){if((l=t[i])&&!(2&l.__u)&&a==l.key&&s===l.type)return i;i--}if(o<t.length){if((l=t[o])&&!(2&l.__u)&&a==l.key&&s===l.type)return o;o++}}return-1}function ic(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Hm.test(t)?r:r+"px"}function Xn(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||ic(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||ic(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(cc,"$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=Zo,e.addEventListener(t,o?Yo:Qo,o)):e.removeEventListener(t,o?Yo:Qo,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 oc(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Zo++;else if(t.u<r.t)return;return r(J.event?J.event(t):t)}}}function ta(e,t,r,n,i,o,a,s,l,u){var p,f,m,h,w,E,A,b,C,N,B,V,S,D,x,M,$,q=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[s=t.__e=r.__e]),(p=J.__b)&&p(t);e:if(typeof q=="function")try{if(b=t.props,C="prototype"in q&&q.prototype.render,N=(p=q.contextType)&&n[p.__c],B=p?N?N.props.value:p.__:n,r.__c?A=(f=t.__c=r.__c).__=f.__E:(C?t.__c=f=new q(b,B):(t.__c=f=new Le(b,B),f.constructor=q,f.render=qm),N&&N.sub(f),f.props=b,f.state||(f.state={}),f.context=B,f.__n=n,m=f.__d=!0,f.__h=[],f._sb=[]),C&&f.__s==null&&(f.__s=f.state),C&&q.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=at({},f.__s)),at(f.__s,q.getDerivedStateFromProps(b,f.__s))),h=f.props,w=f.state,f.__v=t,m)C&&q.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),C&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(C&&q.getDerivedStateFromProps==null&&b!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(b,B),!f.__e&&(f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(b,f.__s,B)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(f.props=b,f.state=f.__s,f.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(X){X&&(X.__=t)}),V=0;V<f._sb.length;V++)f.__h.push(f._sb[V]);f._sb=[],f.__h.length&&a.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(b,f.__s,B),C&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(h,w,E)})}if(f.context=B,f.props=b,f.__P=e,f.__e=!1,S=J.__r,D=0,C){for(f.state=f.__s,f.__d=!1,S&&S(t),p=f.render(f.props,f.state,f.context),x=0;x<f._sb.length;x++)f.__h.push(f._sb[x]);f._sb=[]}else do f.__d=!1,S&&S(t),p=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++D<25);f.state=f.__s,f.getChildContext!=null&&(n=at(at({},n),f.getChildContext())),C&&!m&&f.getSnapshotBeforeUpdate!=null&&(E=f.getSnapshotBeforeUpdate(h,w)),M=p,p!=null&&p.type===gt&&p.key==null&&(M=pc(p.props.children)),s=fc(e,Ar(M)?M:[M],t,r,n,i,o,a,s,l,u),f.base=t.__e,t.__u&=-161,f.__h.length&&a.push(f),A&&(f.__E=f.__=null)}catch(X){if(t.__v=null,l||o!=null)if(X.then){for(t.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for($=o.length;$--;)ea(o[$]);else t.__e=r.__e,t.__k=r.__k;J.__e(X,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=$m(r.__e,t,r,n,i,o,a,l,u);return(p=J.diffed)&&p(t),128&t.__u?void 0:s}function mc(e,t,r){for(var n=0;n<r.length;n++)ra(r[n],r[++n],r[++n]);J.__c&&J.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){J.__e(o,i.__v)}})}function pc(e){return typeof e!="object"||e==null?e:Ar(e)?e.map(pc):at({},e)}function $m(e,t,r,n,i,o,a,s,l){var u,p,f,m,h,w,E,A=r.props,b=t.props,C=t.type;if(C=="svg"?i="http://www.w3.org/2000/svg":C=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(u=0;u<o.length;u++)if((h=o[u])&&"setAttribute"in h==!!C&&(C?h.localName==C:h.nodeType==3)){e=h,o[u]=null;break}}if(e==null){if(C==null)return document.createTextNode(b);e=document.createElementNS(i,C,b.is&&b),s&&(J.__m&&J.__m(t,o),s=!1),o=null}if(C===null)A===b||s&&e.data===b||(e.data=b);else{if(o=o&&ti.call(e.childNodes),A=r.props||Ir,!s&&o!=null)for(A={},u=0;u<e.attributes.length;u++)A[(h=e.attributes[u]).name]=h.value;for(u in A)if(h=A[u],u!="children"){if(u=="dangerouslySetInnerHTML")f=h;else if(!(u in b)){if(u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b)continue;Xn(e,u,null,h,i)}}for(u in b)h=b[u],u=="children"?m=h:u=="dangerouslySetInnerHTML"?p=h:u=="value"?w=h:u=="checked"?E=h:s&&typeof h!="function"||A[u]===h||Xn(e,u,h,A[u],i);if(p)s||f&&(p.__html===f.__html||p.__html===e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(f&&(e.innerHTML=""),fc(t.type==="template"?e.content:e,Ar(m)?m:[m],t,r,n,C=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Gt(r,0),s,l),o!=null)for(u=o.length;u--;)ea(o[u]);s||(u="value",C=="progress"&&w==null?e.removeAttribute("value"):w!==void 0&&(w!==e[u]||C=="progress"&&!w||C=="option"&&w!==A[u])&&Xn(e,u,w,A[u],i),u="checked",E!==void 0&&E!==e[u]&&Xn(e,u,E,A[u],i))}return e}function ra(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){J.__e(i,r)}}function vc(e,t,r){var n,i;if(J.unmount&&J.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||ra(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){J.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&vc(n[i],t,r||typeof e.type!="function");r||ea(e.__e),e.__c=e.__=e.__e=void 0}function qm(e,t,r){return this.constructor(e,r)}function _c(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),J.__&&J.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],ta(t,e=(!n&&r||t).__k=Sr(gt,null,[e]),i||Ir,Ir,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?ti.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),mc(o,e,a)}ti=uc.slice,J={__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}},ac=0,Xo=function(e){return e!=null&&e.constructor==null},Le.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=at({},this.state),typeof e=="function"&&(e=e(at({},r),this.props)),e&&at(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),nc(this))},Le.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),nc(this))},Le.prototype.render=gt,Ot=[],sc=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,lc=function(e,t){return e.__v.__b-t.__v.__b},ei.__r=0,cc=/(PointerCapture)$|Capture$/i,Zo=0,Qo=oc(!1),Yo=oc(!0),jm=0;var Vt,se,na,gc,Or=0,Rc=[],ue=J,yc=ue.__b,bc=ue.__r,wc=ue.diffed,Ec=ue.__c,Ic=ue.unmount,Ac=ue.__;function ni(e,t){ue.__h&&ue.__h(se,e,Or||t),Or=0;var r=se.__H||(se.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ii(e){return Or=1,Oc(Cc,e)}function Oc(e,t,r){var n=ni(Vt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Cc(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],u=n.t(l,s);l!==u&&(n.__N=[u,n.__[1]],n.__c.setState({}))}],n.__c=se,!se.__f)){var i=function(s,l,u){if(!n.__c.__H)return!0;var p=n.__c.__H.__.filter(function(m){return!!m.__c});if(p.every(function(m){return!m.__N}))return!o||o.call(this,s,l,u);var f=n.__c.props!==s;return p.forEach(function(m){if(m.__N){var h=m.__[0];m.__=m.__N,m.__N=void 0,h!==m.__[0]&&(f=!0)}}),o&&o.call(this,s,l,u)||f};se.__f=!0;var o=se.shouldComponentUpdate,a=se.componentWillUpdate;se.componentWillUpdate=function(s,l,u){if(this.__e){var p=o;o=void 0,i(s,l,u),o=p}a&&a.call(this,s,l,u)},se.shouldComponentUpdate=i}return n.__N||n.__}function Cr(e,t){var r=ni(Vt++,3);!ue.__s&&la(r.__H,t)&&(r.__=e,r.u=t,se.__H.__h.push(r))}function oa(e,t){var r=ni(Vt++,4);!ue.__s&&la(r.__H,t)&&(r.__=e,r.u=t,se.__h.push(r))}function aa(e){return Or=5,kr(function(){return{current:e}},[])}function kr(e,t){var r=ni(Vt++,7);return la(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function sa(e,t){return Or=8,kr(function(){return e},t)}function Km(){for(var e;e=Rc.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(ri),e.__H.__h.forEach(ia),e.__H.__h=[]}catch(t){e.__H.__h=[],ue.__e(t,e.__v)}}ue.__b=function(e){se=null,yc&&yc(e)},ue.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ac&&Ac(e,t)},ue.__r=function(e){bc&&bc(e),Vt=0;var t=(se=e.__c).__H;t&&(na===se?(t.__h=[],se.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(ri),t.__h.forEach(ia),t.__h=[],Vt=0)),na=se},ue.diffed=function(e){wc&&wc(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Rc.push(t)!==1&&gc===ue.requestAnimationFrame||((gc=ue.requestAnimationFrame)||Wm)(Km)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),na=se=null},ue.__c=function(e,t){t.some(function(r){try{r.__h.forEach(ri),r.__h=r.__h.filter(function(n){return!n.__||ia(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ue.__e(n,r.__v)}}),Ec&&Ec(e,t)},ue.unmount=function(e){Ic&&Ic(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{ri(n)}catch(i){t=i}}),r.__H=void 0,t&&ue.__e(t,r.__v))};var Sc=typeof requestAnimationFrame=="function";function Wm(e){var t,r=function(){clearTimeout(n),Sc&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Sc&&(t=requestAnimationFrame(r))}function ri(e){var t=se,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),se=t}function ia(e){var t=se;e.__c=e.__(),se=t}function la(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Cc(e,t){return typeof t=="function"?t(e):t}function Qm(e,t){for(var r in t)e[r]=t[r];return e}function kc(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 Tc(e,t){this.props=e,this.context=t}(Tc.prototype=new Le).isPureReactComponent=!0,Tc.prototype.shouldComponentUpdate=function(e,t){return kc(this.props,e)||kc(this.state,t)};var xc=J.__b;J.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),xc&&xc(e)};var MI=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Ym=J.__e;J.__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)}Ym(e,t,r,n)};var Pc=J.unmount;function Jc(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=Qm({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Jc(n,t,r)})),e}function Fc(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Fc(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 ca(){this.__u=0,this.o=null,this.__b=null}function jc(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function oi(){this.i=null,this.l=null}J.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),Pc&&Pc(e)},(ca.prototype=new Le).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=jc(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 l=n.state.__a;n.__v.__k[0]=Fc(l,l.__c.__P,l.__c.__O)}var u;for(n.setState({__a:n.__b=null});u=n.o.pop();)u.forceUpdate()}};n.__u++||32&t.__u||n.setState({__a:n.__b=n.__v.__k[0]}),e.then(a,a)},ca.prototype.componentWillUnmount=function(){this.o=[]},ca.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]=Jc(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&Sr(gt,null,e.fallback);return i&&(i.__u&=-33),[Sr(gt,null,t.__a?null:e.children),i]};var Nc=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]}};(oi.prototype=new Le).__a=function(e){var t=this,r=jc(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Nc(t,e,n)):i()};r?r(o):o()}},oi.prototype.render=function(e){this.i=null,this.l=new Map;var t=Rr(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},oi.prototype.componentDidUpdate=oi.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Nc(e,r,t)})};var Xm=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Zm=/^(?: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]/,ep=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,tp=/[A-Z0-9]/g,rp=typeof document!="undefined",np=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function ua(e,t,r){return t.__k==null&&(t.textContent=""),_c(e,t),typeof r=="function"&&r(),e?e.__c:null}Le.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Le.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Lc=J.event;function ip(){}function op(){return this.cancelBubble}function ap(){return this.defaultPrevented}J.event=function(e){return Lc&&(e=Lc(e)),e.persist=ip,e.isPropagationStopped=op,e.isDefaultPrevented=ap,e.nativeEvent=e};var Hc,sp={enumerable:!1,configurable:!0,get:function(){return this.class}},Dc=J.vnode;J.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||rp&&a==="children"&&n==="noscript"||a==="class"||a==="className")){var l=a.toLowerCase();a==="defaultValue"&&"value"in r&&r.value==null?a="value":a==="download"&&s===!0?s="":l==="translate"&&s==="no"?s=!1:l[0]==="o"&&l[1]==="n"?l==="ondoubleclick"?a="ondblclick":l!=="onchange"||n!=="input"&&n!=="textarea"||np(r.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":ep.test(a)&&(a=l):l=a="oninput":o&&Zm.test(a)?a=a.replace(tp,"-$&").toLowerCase():s===null&&(s=void 0),l==="oninput"&&i[a=l]&&(a="oninputCapture"),i[a]=s}}n=="select"&&i.multiple&&Array.isArray(i.value)&&(i.value=Rr(r.children).forEach(function(u){u.props.selected=i.value.indexOf(u.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Rr(r.children).forEach(function(u){u.props.selected=i.multiple?i.defaultValue.indexOf(u.props.value)!=-1:i.defaultValue==u.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",sp)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Xm,Dc&&Dc(e)};var Uc=J.__r;J.__r=function(e){Uc&&Uc(e),Hc=e.__c};var Mc=J.diffed;J.diffed=function(e){Mc&&Mc(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),Hc=null};var Gc=Object.getOwnPropertySymbols,lp=Object.prototype.hasOwnProperty,cp=Object.prototype.propertyIsEnumerable,up=(e,t)=>{var r={};for(var n in e)lp.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Gc)for(var n of Gc(e))t.indexOf(n)<0&&cp.call(e,n)&&(r[n]=e[n]);return r},mu=Object.defineProperty,dp=Object.defineProperties,fp=Object.getOwnPropertyDescriptors,Vc=Object.getOwnPropertySymbols,hp=Object.prototype.hasOwnProperty,mp=Object.prototype.propertyIsEnumerable,$c=(e,t,r)=>t in e?mu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,pp=(e,t)=>{for(var r in t||(t={}))hp.call(t,r)&&$c(e,r,t[r]);if(Vc)for(var r of Vc(t))mp.call(t,r)&&$c(e,r,t[r]);return e},vp=(e,t)=>dp(e,fp(t)),_p=(e,t)=>{for(var r in t)mu(e,r,{get:t[r],enumerable:!0})},pu=(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},gp=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(u){i(u)}},a=l=>{try{s(r.throw(l))}catch(u){i(u)}},s=l=>l.done?n(l.value):Promise.resolve(l.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 yp(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function bp(e){return typeof e=="string"}function wp(e){return typeof e=="undefined"}function Ep(e){return wp(e)||e===null}function Ip(e){return typeof e=="function"}function vu(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 Ap=(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))(Ap||{});function Tr(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Sp={log:Tr("log"),warn:Tr("warn"),info:Tr("info"),error:Tr("error"),debug:Tr("debug")};Object.assign(globalThis,{logger:Sp});var qc=Symbol.for("Jolibox.canIUseMap"),Rp={};globalThis[qc]||(globalThis[qc]=Rp);var Kc=Symbol.for("Jolibox.canIUseMap.native"),Op={};globalThis[Kc]||(globalThis[Kc]=Op);var _u=(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))(_u||{}),gu=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(gu||{}),yu=(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))(yu||{}),Wc=["name","params"],Cp=["name","type","location","target","extra","timestamp","userId"],kp=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function ci(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 Tp(e){let t=e.location?ci(e.location,Wc):null,r=e.target?ci(e.target,Wc):null;return ci(vp(pp({},e),{location:t,target:r}),Cp)}function xp(e){let t=e.events.map(n=>Tp(n)),r=ci(e.device,kp);return[e.protocolVersion,t,r,e.project]}function Pp(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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}}Pp();var Kt=typeof window=="undefined",zc=()=>!Kt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Kt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Kt&&navigator.userAgent.includes("Android"),!Kt&&navigator.userAgent.includes("Mac"),!Kt&&navigator.userAgent.includes("FB_IAB"),!Kt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var _a=class ga{constructor(t){this.element=t,this.next=ga.Undefined,this.prev=ga.Undefined}};_a.Undefined=new _a(void 0);var ie=_a,Np=class{constructor(){this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ie.Undefined}clear(){let e=this._first;for(;e!==ie.Undefined;){let t=e.next;e.prev=ie.Undefined,e.next=ie.Undefined,e=t}this._first=ie.Undefined,this._last=ie.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ie(e);if(this._first===ie.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!==ie.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ie.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ie.Undefined&&e.next!==ie.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ie.Undefined&&e.next===ie.Undefined?(this._first=ie.Undefined,this._last=ie.Undefined):e.next===ie.Undefined?(this._last=this._last.prev,this._last.next=ie.Undefined):e.prev===ie.Undefined&&(this._first=this._first.next,this._first.prev=ie.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ie.Undefined;)yield e.element,e=e.next}},Lp=0,xr=class{constructor(e){this.value=e,this.id=Lp++}},Dr=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 xr&&(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 l=new xr(e);return this._listeners?this._listeners instanceof xr?this._listeners=[this._listeners,l]:this._listeners.push(l):((n=(r=this.options)==null?void 0:r.onWillAddFirstListener)==null||n.call(r,this),this._listeners=l,(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 u,p,f,m;if(!this._disposed){if(this._listeners instanceof xr)this._listeners.id===l.id&&(this._listeners=void 0,this._size=0,(p=(u=this.options)==null?void 0:u.onDidRemoveLastListener)==null||p.call(u));else if(this._listeners){let h=this._listeners.indexOf(l);h>=0&&(this._listeners.splice(h,1),this._size--,this._size===0&&((m=(f=this.options)==null?void 0:f.onDidRemoveLastListener)==null||m.call(f)))}}}}),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 xr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Dp=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 Dr,o=l=>t(...l.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 l of s)t(...l.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 Np,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)}},ya={};_p(ya,{None:()=>Up,filter:()=>Bp,once:()=>bu,toPromise:()=>Mp});var Up=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Mp(e){return new Promise(t=>bu(e)(t))}function bu(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 Bp(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new Dr(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 da=Symbol.for("Jolibox.hostEmitter"),Jp=()=>{let e=new Dp;return globalThis[da]||(globalThis[da]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[da]};Jp();function Fp(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)jp(e[n],t[n])}function jp(e,t){if(bp(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Ip(t)){try{if(e instanceof t)return}catch(r){}if(!Ep(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 ba=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Dr,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 Fp(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}};ba=pu([vu],ba);var Qc=class{constructor(){this._onWillExecuteCommand=new Dr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Dr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new ba,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=yp(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 gp(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),ya.toPromise(ya.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{}}};Qc=pu([vu],Qc);function Te(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=Gp(e,"string");return typeof t=="symbol"?t:t+""}function Gp(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 $t=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(...r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},wa=class{constructor(t){Te(this,"context",void 0),Te(this,"continueCallback",void 0),Te(this,"adIsShowingCallback",void 0),Te(this,"isBeforeAdCalled",!1),Te(this,"isBeforeRewardCalled",!1),Te(this,"isAdDismissedCalled",!1),Te(this,"isAdViewedCalled",!1),Te(this,"isAfterAdCalled",!1),Te(this,"currentProvider",void 0),Te(this,"currentClientParams",void 0),Te(this,"adsHasResponse",!1),Te(this,"videoChecker",window.document.createElement("video")),Te(this,"contextInfo",void 0),Te(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),window.postMessage({type:"JOLIBOX_AD_CALL_BEFORE_REWARD",data:Object.assign({},{userEvent:a},this.paramsToTrack)},"*"),zc()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0);let s=$t(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}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,i,o;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),window.postMessage({type:"JOLIBOX_AD_CALL_BEFORE_AD",data:this.paramsToTrack},"*"),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=$t(t);a==null||a(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),zc()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=$t(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=$t(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),window.postMessage({type:"JOLIBOX_AD_CALL_AFTER_AD",data:this.paramsToTrack},"*"),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=$t(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,l,u,p,f;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}),window.postMessage({type:"JOLIBOX_AD_CALL_AD_BREAK_DONE",data:{provider:(s=(a=this.currentProvider)==null?void 0:a.name)!=null?s:null,breakType:r.breakType,breakName:(l=r.breakName)!=null?l:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}},"*"),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let m=$t(t);m==null||m(r),(u=this.adIsShowingCallback)==null||u.call(this,!1),(p=this.continueCallback)==null||p.call(this,[!1,r]);break}default:{(f=this.continueCallback)==null||f.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return P(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,l,u,p,f;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),(p=this.continueCallback)==null||p.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(u=r.name)!=null?u:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(f=this.adIsShowingCallback)==null||f.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),window.postMessage({type:"JOLIBOX_AD_CALL_AD_BREAK",data:this.paramsToTrack},"*"),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function ai(e,t,r){return(t=Vp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Vp(e){var t=$p(e,"string");return typeof t=="symbol"?t:t+""}function $p(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 Ea=class{constructor(t){ai(this,"context",void 0),ai(this,"adBreakIsShowing",!1),ai(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),ai(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()})}};function si(e,t,r){return(t=qp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function qp(e){var t=Kp(e,"string");return typeof t=="symbol"?t:t+""}function Kp(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 Ia=class{constructor(t){si(this,"configs",null),si(this,"firstRun",!0),si(this,"context",void 0),si(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return P(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 st(e,t,r){return(t=Wp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Wp(e){var t=zp(e,"string");return typeof t=="symbol"?t:t+""}function zp(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 Aa=class{constructor(t,r){st(this,"name","ADSENSE"),st(this,"context",void 0),st(this,"contextInfo",void 0),st(this,"configured",!1),st(this,"initParams",void 0),st(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),st(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=up(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),st(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),st(this,"adUnit",n=>P(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:l,slot:u,adFormat:p,fullWidthResponsive:f,style:m}=n,h;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?h=document.querySelector(l):h=l,!h)throw new Error("targeting element not found");let w=u;if(w||(w=this.initParams.unitId),!w)throw new Error("slot is required");let E=typeof p=="object"&&Array.isArray(p)?p.join(", "):p,A=document.createElement("ins");if(A.className="adsbygoogle",A.id="jolibox-ads",A.style.display="block",A.setAttribute("data-ad-client",this.initParams.clientId),A.setAttribute("data-ad-slot",w),E&&A.setAttribute("data-ad-format",E),f&&A.setAttribute("data-full-width-responsive",f),m&&A.setAttribute("style",m),(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",A.style.position="relative",h.appendChild(A),A.appendChild(b)}else h.appendChild(A),new MutationObserver(b=>{b.forEach(C=>{if(C.type==="attributes"&&C.attributeName==="data-ad-status"){let N=A.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(A,{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 P(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&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&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 Qp(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 Yp(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 Xp=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(Yp(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Qp(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}(),Ae="-ms-",pi="-moz-",K="-webkit-",wu="comm",Ja="rule",Fa="decl",Zp="@import",Eu="@keyframes",ev="@layer",tv=Math.abs,bi=String.fromCharCode,rv=Object.assign;function nv(e,t){return ye(e,0)^45?(((t<<2^ye(e,0))<<2^ye(e,1))<<2^ye(e,2))<<2^ye(e,3):0}function Iu(e){return e.trim()}function iv(e,t){return(e=t.exec(e))?e[0]:e}function W(e,t,r){return e.replace(t,r)}function Sa(e,t){return e.indexOf(t)}function ye(e,t){return e.charCodeAt(t)|0}function Ur(e,t,r){return e.slice(t,r)}function qe(e){return e.length}function ja(e){return e.length}function li(e,t){return t.push(e),e}function ov(e,t){return e.map(t).join("")}var wi=1,Qt=1,Au=0,Ne=0,me=0,Yt="";function Ei(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:wi,column:Qt,length:a,return:""}}function Pr(e,t){return rv(Ei("",null,null,"",null,null,0),e,{length:-e.length},t)}function av(){return me}function sv(){return me=Ne>0?ye(Yt,--Ne):0,Qt--,me===10&&(Qt=1,wi--),me}function Ue(){return me=Ne<Au?ye(Yt,Ne++):0,Qt++,me===10&&(Qt=1,wi++),me}function Ke(){return ye(Yt,Ne)}function ui(){return Ne}function Jr(e,t){return Ur(Yt,e,t)}function Mr(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 Su(e){return wi=Qt=1,Au=qe(Yt=e),Ne=0,[]}function Ru(e){return Yt="",e}function di(e){return Iu(Jr(Ne-1,Ra(e===91?e+2:e===40?e+1:e)))}function lv(e){for(;(me=Ke())&&me<33;)Ue();return Mr(e)>2||Mr(me)>3?"":" "}function cv(e,t){for(;--t&&Ue()&&!(me<48||me>102||me>57&&me<65||me>70&&me<97););return Jr(e,ui()+(t<6&&Ke()==32&&Ue()==32))}function Ra(e){for(;Ue();)switch(me){case e:return Ne;case 34:case 39:e!==34&&e!==39&&Ra(me);break;case 40:e===41&&Ra(e);break;case 92:Ue();break}return Ne}function uv(e,t){for(;Ue()&&e+me!==57&&!(e+me===84&&Ke()===47););return"/*"+Jr(t,Ne-1)+"*"+bi(e===47?e:Ue())}function dv(e){for(;!Mr(Ke());)Ue();return Jr(e,Ne)}function fv(e){return Ru(fi("",null,null,null,[""],e=Su(e),0,[0],e))}function fi(e,t,r,n,i,o,a,s,l){for(var u=0,p=0,f=a,m=0,h=0,w=0,E=1,A=1,b=1,C=0,N="",B=i,V=o,S=n,D=N;A;)switch(w=C,C=Ue()){case 40:if(w!=108&&ye(D,f-1)==58){Sa(D+=W(di(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:D+=di(C);break;case 9:case 10:case 13:case 32:D+=lv(w);break;case 92:D+=cv(ui()-1,7);continue;case 47:switch(Ke()){case 42:case 47:li(hv(uv(Ue(),ui()),t,r),l);break;default:D+="/"}break;case 123*E:s[u++]=qe(D)*b;case 125*E:case 59:case 0:switch(C){case 0:case 125:A=0;case 59+p:b==-1&&(D=W(D,/\f/g,"")),h>0&&qe(D)-f&&li(h>32?Xc(D+";",n,r,f-1):Xc(W(D," ","")+";",n,r,f-2),l);break;case 59:D+=";";default:if(li(S=Yc(D,t,r,u,p,i,s,N,B=[],V=[],f),o),C===123)if(p===0)fi(D,t,S,S,B,o,f,s,V);else switch(m===99&&ye(D,3)===110?100:m){case 100:case 108:case 109:case 115:fi(e,S,S,n&&li(Yc(e,S,S,0,0,i,s,N,i,B=[],f),V),i,V,f,s,n?B:V);break;default:fi(D,S,S,S,[""],V,0,s,V)}}u=p=h=0,E=b=1,N=D="",f=a;break;case 58:f=1+qe(D),h=w;default:if(E<1){if(C==123)--E;else if(C==125&&E++==0&&sv()==125)continue}switch(D+=bi(C),C*E){case 38:b=p>0?1:(D+="\f",-1);break;case 44:s[u++]=(qe(D)-1)*b,b=1;break;case 64:Ke()===45&&(D+=di(Ue())),m=Ke(),p=f=qe(N=D+=dv(ui())),C++;break;case 45:w===45&&qe(D)==2&&(E=0)}}return o}function Yc(e,t,r,n,i,o,a,s,l,u,p){for(var f=i-1,m=i===0?o:[""],h=ja(m),w=0,E=0,A=0;w<n;++w)for(var b=0,C=Ur(e,f+1,f=tv(E=a[w])),N=e;b<h;++b)(N=Iu(E>0?m[b]+" "+C:W(C,/&\f/g,m[b])))&&(l[A++]=N);return Ei(e,t,r,i===0?Ja:s,l,u,p)}function hv(e,t,r){return Ei(e,t,r,wu,bi(av()),Ur(e,2,-2),0)}function Xc(e,t,r,n){return Ei(e,t,r,Fa,Ur(e,0,n),Ur(e,n+1,-1),n)}function zt(e,t){for(var r="",n=ja(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function mv(e,t,r,n){switch(e.type){case ev:if(e.children.length)break;case Zp:case Fa:return e.return=e.return||e.value;case wu:return"";case Eu:return e.return=e.value+"{"+zt(e.children,n)+"}";case Ja:e.value=e.props.join(",")}return qe(r=zt(e.children,n))?e.return=e.value+"{"+r+"}":""}function pv(e){var t=ja(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 vv(e){return function(t){t.root||(t=t.return)&&e(t)}}function _v(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var gv=function(e,t,r){for(var n=0,i=0;n=i,i=Ke(),n===38&&i===12&&(t[r]=1),!Mr(i);)Ue();return Jr(e,Ne)},yv=function(e,t){var r=-1,n=44;do switch(Mr(n)){case 0:n===38&&Ke()===12&&(t[r]=1),e[r]+=gv(Ne-1,t,r);break;case 2:e[r]+=di(n);break;case 4:if(n===44){e[++r]=Ke()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=bi(n)}while(n=Ue());return e},bv=function(e,t){return Ru(yv(Su(e),t))},Zc=new WeakMap,wv=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&&!Zc.get(r))&&!n){Zc.set(e,!0);for(var i=[],o=bv(t,i),a=r.props,s=0,l=0;s<o.length;s++)for(var u=0;u<a.length;u++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[u]):a[u]+" "+o[s]}}},Ev=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Ou(e,t){switch(nv(e,t)){case 5103:return K+"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 K+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return K+e+pi+e+Ae+e+e;case 6828:case 4268:return K+e+Ae+e+e;case 6165:return K+e+Ae+"flex-"+e+e;case 5187:return K+e+W(e,/(\w+).+(:[^]+)/,K+"box-$1$2"+Ae+"flex-$1$2")+e;case 5443:return K+e+Ae+"flex-item-"+W(e,/flex-|-self/,"")+e;case 4675:return K+e+Ae+"flex-line-pack"+W(e,/align-content|flex-|-self/,"")+e;case 5548:return K+e+Ae+W(e,"shrink","negative")+e;case 5292:return K+e+Ae+W(e,"basis","preferred-size")+e;case 6060:return K+"box-"+W(e,"-grow","")+K+e+Ae+W(e,"grow","positive")+e;case 4554:return K+W(e,/([^-])(transform)/g,"$1"+K+"$2")+e;case 6187:return W(W(W(e,/(zoom-|grab)/,K+"$1"),/(image-set)/,K+"$1"),e,"")+e;case 5495:case 3959:return W(e,/(image-set\([^]*)/,K+"$1$`$1");case 4968:return W(W(e,/(.+:)(flex-)?(.*)/,K+"box-pack:$3"+Ae+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+K+e+e;case 4095:case 3583:case 4068:case 2532:return W(e,/(.+)-inline(.+)/,K+"$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(qe(e)-1-t>6)switch(ye(e,t+1)){case 109:if(ye(e,t+4)!==45)break;case 102:return W(e,/(.+:)(.+)-([^]+)/,"$1"+K+"$2-$3$1"+pi+(ye(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Sa(e,"stretch")?Ou(W(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(ye(e,t+1)!==115)break;case 6444:switch(ye(e,qe(e)-3-(~Sa(e,"!important")&&10))){case 107:return W(e,":",":"+K)+e;case 101:return W(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+K+(ye(e,14)===45?"inline-":"")+"box$3$1"+K+"$2$3$1"+Ae+"$2box$3")+e}break;case 5936:switch(ye(e,t+11)){case 114:return K+e+Ae+W(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return K+e+Ae+W(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return K+e+Ae+W(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return K+e+Ae+e+e}return e}var Iv=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Fa:e.return=Ou(e.value,e.length);break;case Eu:return zt([Pr(e,{value:W(e.value,"@","@"+K)})],n);case Ja:if(e.length)return ov(e.props,function(i){switch(iv(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return zt([Pr(e,{props:[W(i,/:(read-\w+)/,":"+pi+"$1")]})],n);case"::placeholder":return zt([Pr(e,{props:[W(i,/:(plac\w+)/,":"+K+"input-$1")]}),Pr(e,{props:[W(i,/:(plac\w+)/,":"+pi+"$1")]}),Pr(e,{props:[W(i,/:(plac\w+)/,Ae+"input-$1")]})],n)}return""})}},Av=[Iv],Sv=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(w){var E=w.getAttribute("data-emotion");E.indexOf(" ")!==-1&&(document.head.appendChild(w),w.setAttribute("data-s",""))})}var n=e.stylisPlugins||Av,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(w){for(var E=w.getAttribute("data-emotion").split(" "),A=1;A<E.length;A++)i[E[A]]=!0;a.push(w)});var s,l=[wv,Ev];{var u,p=[mv,vv(function(w){u.insert(w)})],f=pv(l.concat(n,p)),m=function(w){return zt(fv(w),f)};s=function(w,E,A,b){u=A,m(w?w+"{"+E.styles+"}":E.styles),b&&(h.inserted[E.name]=!0)}}var h={key:t,sheet:new Xp({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 h.sheet.hydrate(a),h};function Rv(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 Ov={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},Cv=/[A-Z]|^ms/g,kv=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Cu=function(e){return e.charCodeAt(1)===45},eu=function(e){return e!=null&&typeof e!="boolean"},fa=_v(function(e){return Cu(e)?e:e.replace(Cv,"-$&").toLowerCase()}),tu=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(kv,function(r,n,i){return yt={name:n,styles:i,next:yt},n})}return Ov[e]!==1&&!Cu(e)&&typeof t=="number"&&t!==0?t+"px":t};function vi(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 yt={name:i.name,styles:i.styles,next:yt},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)yt={name:a.name,styles:a.styles,next:yt},a=a.next;var s=o.styles+";";return s}return Tv(e,t,r)}}var l=r;if(t==null)return l;var u=t[l];return u!==void 0?u:l}function Tv(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=vi(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]+"}":eu(s)&&(n+=fa(o)+":"+tu(o,s)+";")}else if(Array.isArray(a)&&typeof a[0]=="string"&&(t==null||t[a[0]]===void 0))for(var l=0;l<a.length;l++)eu(a[l])&&(n+=fa(o)+":"+tu(o,a[l])+";");else{var u=vi(e,t,a);switch(o){case"animation":case"animationName":{n+=fa(o)+":"+u+";";break}default:n+=o+"{"+u+"}"}}}return n}var ru=/label:\s*([^\s;{]+)\s*(;|$)/g,yt;function ha(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="";yt=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=vi(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=vi(r,t,e[s]),n){var l=o;i+=l[s]}ru.lastIndex=0;for(var u="",p;(p=ru.exec(i))!==null;)u+="-"+p[1];var f=Rv(i)+u;return{name:f,styles:i,next:yt}}function ku(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var xv=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Pv=function(e,t,r){xv(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 nu(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function iu(e,t,r){var n=[],i=ku(e,n,r);return n.length<2?r:i+t(n)}var Nv=function(e){var t=Sv(e);t.sheet.speedy=function(a){this.isSpeedy=a},t.compat=!0;var r=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u=ha(s,t.registered,void 0);return Pv(t,u),t.key+"-"+u.name},n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u=ha(s,t.registered),p="animation-"+u.name;return nu(t,{name:u.name,styles:"@keyframes "+p+"{"+u.styles+"}"}),p},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var u=ha(s,t.registered);nu(t,u)},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return iu(t.registered,r,Lv(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:ku.bind(null,t.registered),merge:iu.bind(null,t.registered,r)}},Lv=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},Dv=Nv({key:"css"}),Xt=Dv.css,Oa,De,ma,ou,au=0,Tu=[],pe=J,su=pe.__b,lu=pe.__r,cu=pe.diffed,uu=pe.__c,du=pe.unmount,fu=pe.__;function Uv(e,t){pe.__h&&pe.__h(De,e,au||t),au=0;var r=De.__H||(De.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function xu(e,t){var r=Uv(Oa++,7);return Jv(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Mv(){for(var e;e=Tu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(hi),e.__H.__h.forEach(Ca),e.__H.__h=[]}catch(t){e.__H.__h=[],pe.__e(t,e.__v)}}pe.__b=function(e){De=null,su&&su(e)},pe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),fu&&fu(e,t)},pe.__r=function(e){lu&&lu(e),Oa=0;var t=(De=e.__c).__H;t&&(ma===De?(t.__h=[],De.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(hi),t.__h.forEach(Ca),t.__h=[],Oa=0)),ma=De},pe.diffed=function(e){cu&&cu(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Tu.push(t)!==1&&ou===pe.requestAnimationFrame||((ou=pe.requestAnimationFrame)||Bv)(Mv)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),ma=De=null},pe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(hi),r.__h=r.__h.filter(function(n){return!n.__||Ca(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],pe.__e(n,r.__v)}}),uu&&uu(e,t)},pe.unmount=function(e){du&&du(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{hi(n)}catch(i){t=i}}),r.__H=void 0,t&&pe.__e(t,r.__v))};var hu=typeof requestAnimationFrame=="function";function Bv(e){var t,r=function(){clearTimeout(n),hu&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);hu&&(t=requestAnimationFrame(r))}function hi(e){var t=De,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),De=t}function Ca(e){var t=De;e.__c=e.__(),De=t}function Jv(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var Fv=Symbol.for("preact-signals");function Ii(){if(bt>1)bt--;else{for(var e,t=!1;Nr!==void 0;){var r=Nr;for(Nr=void 0,ka++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&Nu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(ka=0,bt--,t)throw e}}function Pe(e){if(bt>0)return e();bt++;try{return e()}finally{Ii()}}var Y=void 0,Nr=void 0,bt=0,ka=0,_i=0;function Pu(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.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=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function be(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}be.prototype.brand=Fv;be.prototype.h=function(){return!0};be.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)};be.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)}};be.prototype.subscribe=function(e){var t=this;return jr(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};be.prototype.valueOf=function(){return this.value};be.prototype.toString=function(){return this.value+""};be.prototype.toJSON=function(){return this.value};be.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(be.prototype,"value",{get:function(){var e=Pu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(ka>100)throw new Error("Cycle detected");this.v=e,this.i++,_i++,bt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Ii()}}}});function ee(e){return new be(e)}function Nu(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 Lu(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 Du(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 Zt(e){be.call(this,void 0),this.x=e,this.s=void 0,this.g=_i-1,this.f=4}(Zt.prototype=new be).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===_i))return!0;if(this.g=_i,this.f|=1,this.i>0&&!Nu(this))return this.f&=-2,!0;var e=Y;try{Lu(this),Y=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 Y=e,Du(this),this.f&=-2,!0};Zt.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)}be.prototype.S.call(this,e)};Zt.prototype.U=function(e){if(this.t!==void 0&&(be.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)}};Zt.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(Zt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Pu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function Lr(e){return new Zt(e)}function Uu(e){var t=e.u;if(e.u=void 0,typeof t=="function"){bt++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Ha(e),n}finally{Y=r,Ii()}}}function Ha(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Uu(e)}function jv(e){if(Y!==this)throw new Error("Out-of-order effect");Du(this),Y=e,this.f&=-2,8&this.f&&Ha(this),Ii()}function Fr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Fr.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()}};Fr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Uu(this),Lu(this),bt++;var e=Y;return Y=this,jv.bind(this,e)};Fr.prototype.N=function(){2&this.f||(this.f|=2,this.o=Nr,Nr=this)};Fr.prototype.d=function(){this.f|=8,1&this.f||Ha(this)};function jr(e){var t=new Fr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Mu,pa,Bu=[];jr(function(){Mu=this.N})();function er(e,t){J[e]=t.bind(null,J[e]||function(){})}function gi(e){pa&&pa(),pa=e&&e.S()}function Ju(e){var t=this,r=e.data,n=Fu(r);n.value=r;var i=xu(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var u=Lr(function(){var h=n.value.value;return h===0?0:h===!0?"":h||""}),p=Lr(function(){return!Array.isArray(u.value)&&!Xo(u.value)}),f=jr(function(){if(this.N=ju,p.value){var h=u.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=h)}}),m=t.__$u.d;return t.__$u.d=function(){f(),m.call(this)},[p,u]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}Ju.displayName="_st";Object.defineProperties(be.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ju},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});er("__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 be&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});er("__r",function(e,t){gi();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return jr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),gi(r),e(t)});er("__e",function(e,t,r,n){gi(),e(t,r,n)});er("diffed",function(e,t){gi();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 l in n){var u=o[l],p=n[l];u===void 0?(u=Hv(r,l,p,i),o[l]=u):u.o(p,i)}}}e(t)});function Hv(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=ee(r);return{o:function(a,s){o.value=a,n=s},d:jr(function(){this.N=ju;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}er("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)});er("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Le.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 Fu(e){return xu(function(){return ee(e)},[])}var Gv=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Vv(){Pe(function(){for(var e;e=Bu.shift();)Mu.call(e)})}function ju(){Bu.push(this)===1&&(J.requestAnimationFrame||Gv)(Vv)}var Se=Xt`
|
|
1
|
+
var Qc=Object.create;var fi=Object.defineProperty,Yc=Object.defineProperties,Xc=Object.getOwnPropertyDescriptor,Zc=Object.getOwnPropertyDescriptors,ed=Object.getOwnPropertyNames,Lr=Object.getOwnPropertySymbols,Oa=Object.getPrototypeOf,hi=Object.prototype.hasOwnProperty,ka=Object.prototype.propertyIsEnumerable,td=Reflect.get;var Ra=(e,t,r)=>t in e?fi(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Q=(e,t)=>{for(var r in t||(t={}))hi.call(t,r)&&Ra(e,r,t[r]);if(Lr)for(var r of Lr(t))ka.call(t,r)&&Ra(e,r,t[r]);return e},Oe=(e,t)=>Yc(e,Zc(t));var Yt=(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 Ta=(e,t)=>{var r={};for(var n in e)hi.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Lr)for(var n of Lr(e))t.indexOf(n)<0&&ka.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var mi=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var rd=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of ed(t))!hi.call(e,i)&&i!==r&&fi(e,i,{get:()=>t[i],enumerable:!(n=Xc(t,i))||n.enumerable});return e};var pi=(e,t,r)=>(r=e!=null?Qc(Oa(e)):{},rd(t||!e||!e.__esModule?fi(r,"default",{value:e,enumerable:!0}):r,e));var xa=(e,t,r)=>td(Oa(e),r,t);var P=(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 dd(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Ii(e){return typeof e=="string"}function Ja(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Fa(e){return typeof e=="object"&&Array.isArray(e)}function fd(e){return typeof e=="undefined"}function hd(e){return fd(e)||e===null}function md(e){return typeof e=="function"}function Ga(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function ja(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:Da(u)&&Da(s)?i[a]=n(Ma({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function Da(e){return e&&typeof e=="object"&&e.constructor===Object}function Ha(e,t){if(Array.isArray(e))return e.concat(t)}function tr(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(...h){i=h,o=this;let p=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!p&&d()},t),p)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 _d(e,t){return(...r)=>t(e,...r)}function Wa(e){return t=>_d(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new vd(`${i}`))}})}function Xt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Dr(e,t){return t.map(r=>{if(r==="params"&&e[r]){let n=e[r];return Object.keys(n).reduce((i,o)=>(i[o]=String(n[o]),i),{})}return e[r]})}function Id(e){let t=e.location?Dr(e.location,Ua):null,r=e.target?Dr(e.target,Ua):null;return Dr(ld(Ma({},e),{location:t,target:r}),bd)}function Oi(e){let t=e.events.map(n=>Id(n)),r=Dr(e.device,Ed);return[e.protocolVersion,t,r,e.project]}function Ad(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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 Qa(e,t,r){let n=window.location.hostname,i=n.split("."),o=r?t:e;if(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(n))return`${o}.jolibox.com`;if(i.length>=2){let a=i.slice(-2).join(".");if(a==="jolibox.com"||a==="pico-game.com"||a==="joyslite.com")return`${o}.${a}`}return`${o}.jolibox.com`}function xi(e){return Qa("api","stg-api",e)}function Ct(e){return`https://${xi(e)}`}function xd(e){return Qa("collect","stg-collect",e)}function Ya(e){return`https://${xd(e)}`}function Nd(e){return new Promise(t=>Xa(e)(t))}function Xa(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function Ud(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new er(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function Bd(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Jd(e[n],t[n])}function Jd(e,t){if(Ii(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(md(t)){try{if(e instanceof t)return}catch(r){}if(!hd(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 Fd(){return typeof globalThis!="undefined"?globalThis[Za]:void 0}function Gd(e){typeof globalThis!="undefined"&&(globalThis[Za]=e)}function _e(e=!1){let t=Fd();if(!e&&t)return t;let r=new Nr,n=new bi,i={registerCommand(o,a,s){r.registerCommand({id:o,handler:a,metadata:s})},executeCommand(o,...a){return n.executeCommand(o,...a)},excuteCommandSync(o,...a){return n.executeCommandThowErr(o,...a)}};return Gd(i),i}var Ei,nd,id,od,Pa,ad,sd,La,Ma,ld,ud,Ba,cd,pd,Ai,Si,Va,$a,vd,qa,Ur,Mr,Ci,Ne,_i,gd,Ri,Na,yd,dt,St,wd,Ua,bd,Ed,it,At,Sd,Ee,Cd,Rd,Od,Ka,ki,Ti,kd,Td,za,gi,te,Pd,Ld,Zt,er,Fe,wi,Dd,vi,Md,ft,Nr,bi,Za,j=Z(()=>{"use strict";Ei=Object.defineProperty,nd=Object.defineProperties,id=Object.getOwnPropertyDescriptor,od=Object.getOwnPropertyDescriptors,Pa=Object.getOwnPropertySymbols,ad=Object.prototype.hasOwnProperty,sd=Object.prototype.propertyIsEnumerable,La=(e,t,r)=>t in e?Ei(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Ma=(e,t)=>{for(var r in t||(t={}))ad.call(t,r)&&La(e,r,t[r]);if(Pa)for(var r of Pa(t))sd.call(t,r)&&La(e,r,t[r]);return e},ld=(e,t)=>nd(e,od(t)),ud=(e,t)=>{for(var r in t)Ei(e,r,{get:t[r],enumerable:!0})},Ba=(e,t,r,n)=>{for(var i=n>1?void 0:n?id(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&&Ei(t,r,i),i},cd=(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}pd=(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))(pd||{}),Ai=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}},Si=class extends Ai{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Va=class extends Ai{constructor(){super(...arguments),this.kind="USER_ERROR"}},$a=class extends Va{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},vd=class extends Va{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))}},qa=class extends Si{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Ur=class extends Si{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Mr=class extends Ai{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}}},Ci=class extends Si{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Ne={log:Xt("log"),warn:Xt("warn"),info:Xt("info"),error:Xt("error"),debug:Xt("debug")};Object.assign(globalThis,{logger:Ne});_i=Symbol.for("Jolibox.canIUseMap"),gd={};globalThis[_i]||(globalThis[_i]=gd);Ri={get config(){return globalThis[_i]}},Na=Symbol.for("Jolibox.canIUseMap.native"),yd={};globalThis[Na]||(globalThis[Na]=yd);dt=(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))(dt||{}),St=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(St||{}),wd=(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))(wd||{}),Ua=["name","params"],bd=["name","type","location","target","extra","timestamp","userId"],Ed=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];it=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Ad();At=typeof window=="undefined",Sd=()=>!At&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ee={isiOS:!At&&(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:!At&&navigator.userAgent.includes("Android"),isMac:!At&&navigator.userAgent.includes("Mac"),isFacebook:!At&&navigator.userAgent.includes("FB_IAB"),isPC:!At&&!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Cd=()=>Ee.isiOS?"iOS":Ee.isAndroid?"Android":Ee.isMac?"Mac":Ee.isFacebook?"Facebook":"PC",Rd="device_id",Od="advertising_id",Ka=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,it()),window.__joliboxLocalStorage__.getItem(e)),ki=()=>new URLSearchParams(window.location.search).get("deviceId")||Ka(Rd),Ti=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ka(Od),kd=e=>e.charAt(0).toUpperCase()+e.slice(1),Td=()=>{var e;let t=new URLSearchParams(window.location.search);return kd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},za=e=>{if(Sd())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Cd(),n=navigator.language,i=ki(),o=Ti();return`${t} (${Td()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`};gi=class yi{constructor(t){this.element=t,this.next=yi.Undefined,this.prev=yi.Undefined}};gi.Undefined=new gi(void 0);te=gi,Pd=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}},Ld=0,Zt=class{constructor(e){this.value=e,this.id=Ld++}},er=class{constructor(e){this.options=e,this._size=0}dispose(e){var t,r;this._disposed||(this._disposed=!0,this._listeners&&(e?(this._listeners instanceof Zt&&(this._listeners=[this._listeners]),this._listeners=this._listeners.filter(n=>(n==null?void 0:n.value)===e)):(this._listeners=void 0,this._size=0)),(r=(t=this.options)==null?void 0:t.onDidRemoveLastListener)==null||r.call(t))}get event(){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 Zt(t);return this._listeners?this._listeners instanceof Zt?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,h,p,f;if(!this._disposed){if(this._listeners instanceof Zt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(h=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||h.call(y));else if(this._listeners){let b=this._listeners.indexOf(d);b>=0&&(this._listeners.splice(b,1),this._size--,this._size===0&&((f=(p=this.options)==null?void 0:p.onDidRemoveLastListener)==null||f.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 Zt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Fe=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 er,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 Pd,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)}},wi={};ud(wi,{None:()=>Dd,filter:()=>Ud,once:()=>Xa,toPromise:()=>Nd});Dd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});vi=Symbol.for("Jolibox.hostEmitter"),Md=()=>{let e=new Fe;return globalThis[vi]||(globalThis[vi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[vi]},ft=Md();Nr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new er,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 Bd(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}};Nr=Ba([Ga],Nr);bi=class{constructor(){this._onWillExecuteCommand=new er,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new er,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Nr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=dd(3e4)),this._starActivation}executeCommand(e,...t){return cd(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),wi.toPromise(wi.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}}};bi=Ba([Ga],bi);Za=Symbol.for("Jolibox.commands")});function ke(e,t={}){Pi.emit("ERROR_REPORT",{error:e,options:t})}var Pi,ht,$e=Z(()=>{"use strict";j();j();Pi=new Fe,ht=new Fe;ke.debounce=tr(ke,50,{leading:!0})});var Li,jd,es,ts,rs=Z(()=>{"use strict";j();$e();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{}}},jd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},es=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 ke(new qa(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},ts=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=jd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Hd,Br,ns,Di=Z(()=>{"use strict";j();Hd="1.2.2",Br=()=>Hd,ns=()=>{let e=Br();return`${za(e)}`}});function Ui(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Vd,is,Ni,os,ne,$d,L,me=Z(()=>{"use strict";j();rs();Di();j();Vd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ki(),adId:Ti(),pixelRatio:window.devicePixelRatio||1,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Br()},schema:window.location.href,platform:Ee.isAndroid?"android":Ee.isiOS?"ios":"h5"},Ni=(is=globalThis.joliboxJSCore)==null?void 0:is.env,ne=Object.assign({},(os=Ni==null?void 0:Ni())!=null?os:Vd);$d=()=>{var f,b,I,C,w,k,D,G,H,S,N;let{payloadJson:e,headerJson:t,signature:r}=ne.schema.length?es(ne.schema):{},n=`${ne.deviceInfo.did}-${new Date().getTime()}`,o=new URL(ne.schema.length?ne.schema:window.location.href).searchParams,a=(I=(b=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?b:o.get("gameId"))!=null?I:"",s=(k=(w=(C=ne.clientSessionId)!=null?C:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?k:n,u=!!((G=(D=e==null?void 0:e.testAdsMode)!=null?D:e==null?void 0:e.__testAdsMode)!=null?G:o.get("testAdsMode")==="true"),d=(N=(S=(H=e==null?void 0:e.joliboxEnv)!=null?H:e==null?void 0:e.__joliboxEnv)!=null?S:o.get("joliboxEnv"))!=null?N:"production",y=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get startTime(){var T;return(T=performance.timeOrigin)!=null?T:performance.timing.navigationStart},get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var T;return(T=o.get("joliSource"))!=null?T:null},get mpId(){var T;return(T=a!=null?a:e==null?void 0:e.id)!=null?T:""},get mpVersion(){var T;return(T=t==null?void 0:t.ver)!=null?T:Br()},get mpType(){var T,M;return(M=(T=t==null?void 0:t.__mpType)!=null?T:e==null?void 0:e.__mpType)!=null?M:"game"},get platform(){var T;return((T=ne.platform)!=null?T:ne.deviceInfo.platform).toLowerCase()},get deviceInfo(){return ne.deviceInfo},get sdkInfo(){return ne.sdkInfo},get hostInfo(){return ne.hostInfo},get hostUserInfo(){return ne.hostUserInfo},get sessionId(){var T,M;return(M=(T=ne.clientSessionId)!=null?T:s)!=null?M:n},get channel(){return h},get webviewId(){var T;return(T=ne.webviewId)!=null?T:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return xi(y)},get adId(){var T;return(T=ne.deviceInfo.adId)!=null?T:ne.deviceInfo.did},get language(){return ne.deviceInfo.lang},get sdkEnvironment(){return Ui("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Ui("gamedistribution","jolibox")?"gamedistribution":Ui("funmax","jolibox")?"funmax":"jolibox"},get viewport(){var K,ee,he;let T=(K=ne.deviceInfo.pixelRatio)!=null?K:1,M=(ee=ne.deviceInfo.statusBarHeight)!=null?ee:e==null?void 0:e.__androidStatusBarHeight,W=(he=ne.deviceInfo.navigationBarHeight)!=null?he:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:M!==void 0?M/T:20,navigationBarHeight:W!==void 0?W/T:10}},get abTests(){var T,M;return(M=(T=ne.abValues)==null?void 0:T.split(","))!=null?M:[]},onEnvConfigChanged:T=>{ja(ne,T,Ha)},encodeJoliSourceQuery:T=>{var M,W;return t&&r?ts(Q(Q({},e),T),(M=o.get("joliSource"))!=null?M:""):(W=o.get("joliSource"))!=null?W:""},setDoExitDirectly:()=>{p=!1}}},L=$d()});var Mi,ss,qd,Wd,as,Kd,ls=Z(()=>{"use strict";j();$e();me();j();Mi=!1,ss=(e,t)=>e==null?!1:t in e,qd=e=>ss(e,"kind"),Wd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},as=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=L.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=L.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:Wd(e.name)},i=Oe(Q({},n),{env:t.environment,isFromUser:r});r?ht.emit("GLOBAL_USER_ERROR",e,i):ht.emit("GLOBAL_ERROR",e,i)},Kd=e=>ss(e,"kind")&&e.kind==="USER_ERROR";Pi.on("ERROR_REPORT",({error:e,options:t})=>{if(Mi)return;Mi=!0;let r=qd(e)&&e.raw?e.raw:e;try{let n=Kd(e);as(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new Ci(`${i}, origin error: ${r.message}`);Ne.error(o),as(new Ci(o.message),{environment:t.environment},!1)}finally{Mi=!1}})});var Bi,Ji=Z(()=>{"use strict";$e();j();$e();Bi=e=>new $a(e)});function us(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=Ta(d,["eventType"]),u=Oe(Q({tag:n,eventType:o!=null?o:a!=null?a:dt.Other},t),{extra:Q({},s)});n=="globalJsError"?ke(new Ur(JSON.stringify(u))):e("systemLog",u,L.webviewId)};return r.debounce=tr(r,500,{leading:!0}),r}function cs(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=tr(t,500,{leading:!0}),t}var ds=Z(()=>{"use strict";j();j();$e();me()});function fs(e,t){let r=us(e,t),n=cs(r);return{track:r,trackPerformance:n}}var hs=Z(()=>{"use strict";ds()});var Fi=Z(()=>{"use strict"});var Jr,ms=Z(()=>{"use strict";me();j();j();Jr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${Ct(L.testMode)}/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}=L.sdkInfo;return{platform:1e3,os:L.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=L.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=L.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=L.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:L.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 P(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:[Oe(Q({},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){Ne.log("[Jolibox SDK] report API error",y)}})}}});var Gi=Z(()=>{"use strict";hs();Fi();ms()});var ji,ps,qe,Fr,Be,Rt=Z(()=>{"use strict";Di();me();j();ji=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(ps=AbortSignal.timeout)!=null||(AbortSignal.timeout=ji);qe=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 Fr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Fr=class{constructor(t){this.xua=ns();this.getJoliSource=()=>L.joliSource;var n;let r=Ct(L.testMode);this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return P(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 h=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:ji(i!=null?i:3e4)});return qe.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return P(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,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{},{"x-os-type":Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:ji(o!=null?o:3e4),credentials:"include"});qe.getInstance().recordNetworkRequest(!0);let f=p.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return p.blob()}catch(b){return yield p.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return p.formData()}catch(b){return yield p.text()}if(f!=null&&f.includes("application/json"))try{return yield p.json()}catch(b){return yield p.text()}return p}catch(n){throw qe.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return P(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,h=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},h?{"x-joli-source":h}:{});let p=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!p.ok)throw qe.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return qe.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Fr;Be=qe.getInstance()});var Hi,Gr,Vi=Z(()=>{"use strict";me();Gi();Rt();j();Hi=class extends Jr{constructor(){super(...arguments);this.httpClient=Be.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var r;return Ya((r=L.testMode)!=null?r:!1)}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Gr=new Hi});var zd,vs=Z(()=>{"use strict";ls();j();Ji();j();Vi();me();zd=(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:dt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=L.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Gr.trackEvent(n,St.WebSDK)};ht.on("GLOBAL_ERROR",(e,t)=>{zd(t.tag,e)});ht.on("GLOBAL_USER_ERROR",(e,t)=>{Ne.log("UserError",e,t)})});var jr,_s=Z(()=>{"use strict";jr=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(),b=f-r;b>=this.interval&&(this.visible&&(a+=Math.min(b,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=()=>{h(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},h=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let p=this.visible;return{start(){o||(o=!0,p?d():u())},stop(){o=!1,y(),h()}}}}});var Hr,gs=Z(()=>{"use strict";me();_s();Rt();Hr=class extends jr{constructor(r,n,i){super(n,i);this.httpClient=Be.create();this.gameId=L.mpId,this.sessionId=L.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i,extraParams:o}=r,a={eventType:n,gameInfo:Q({gameId:this.gameId,sessionId:this.sessionId},i)};o&&Object.assign(a,o),yield this.httpClient.post("/api/base/app-event",{data:a})})}tracker(r,n=null){this.track(r,n)}}});var ys,Qd,Te,Yd,$i,We,ot=Z(()=>{"use strict";vs();j();j();Gi();Vi();gs();me();Fi();ys=_e(),Qd={type:St.WebSDK,platform:"h5",jssdk_version:L.sdkInfo.jssdkVersion,mp_id:L.mpId,mp_version:L.mpVersion},{track:Te,trackPerformance:Yd}=fs((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=Ja(r.extra)?r.extra:Ii(r.extra)?JSON.parse(r.extra):{},i=Oe(Q({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:dt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=L.hostUserInfo)==null?void 0:u.uid)!=null?d:null};Gr.trackEvent(o,St.WebSDK)},Qd);ys.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Yd(e,t,r)});ys.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Te(e,t)});$i=new Fe,We=new Hr(Te,$i)});function ws(e){let t=Ri.config[e];return t||(t={},Ri.config[e]=t),(r,n)=>{if(t[r]){Ne.warn(`[can i use] ${r} already registered`);return}t[r]=Q({},n)}}var bs=Z(()=>{"use strict";j()});function qi(e){Es=e}function Vr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Vr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Vr(e[r]),t),{})}function Ke(e){return typeof e=="number"}function Wi(e){let t=Ki(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Ki(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Es,ce,$r,qr,Wr,Kr,Ot,zr,Qr,Yr,Xr,Zr,en,tn,rn,nn,on,an,sn,zi=Z(()=>{"use strict";Es=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Es)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 Vr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Vr(this._default)}optional(){return this._optional=!0,this}};$r=class extends ce{validate(t){return this._optional&&t===void 0?!0:Ke(t)?Ke(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Ke(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Ke(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}},qr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Wr=class extends ce{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Ke(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Ke(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 ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},Ot=class extends ce{validate(t){return!0}},zr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Qr=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Yr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Xr=class extends ce{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}},Zr=class extends ce{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(Ke(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Ke(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Ke(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}},en=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ki(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}},tn=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ki(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}},rn=class extends ce{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}},nn=class extends ce{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}},on=class extends ce{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}},an=class extends ce{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},sn=class extends ce{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 Qi(e,t,r="param"){if(e.errors=[],e.path=r,qi(!0),!e.validate(t)){let n=e.errors.join(`
|
|
3
|
+
`);throw e.errors.length=0,qi(!1),new TypeError(n)}}var J,Yi=Z(()=>{"use strict";zi();zi();J={object(e){return new tn(e)},array(e){return new Zr(e)},tuple(...e){return new on(...e)},literal(e){return new rn(e)},or(...e){return new nn(...e)},symbol(){return new Kr},record(e){return new en(e)},function(){return new Yr},boolean(){return new qr},string(){return new Wr},number(){return new $r},undefined(){return new zr},null(){return new Qr},unknown(){return new Ot},any(){return new Ot},as(){return new Ot},arraybuffer(){return new an},enum(...e){return new Xr(...e)},typedarray(e){return new sn(e)}}});var ln,Is,As=Z(()=>{"use strict";j();$e();Yi();Ji();ln=1,Is=e=>{function t(n,i){return(...o)=>{var h,p,f,b;let a=Date.now(),s={method:n,trace_id:ln};ln+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Qi(i.paramsSchema,o,"params")}catch(k){throw Bi(`${n}:fail ${k.message}`)}let I=i.implement(...o),C=I,w=`${n}:ok`;if(I&&"code"in I){let{code:k,data:D,message:G}=I;u=k,C=D,w=G}return{code:u,message:w,data:C}}catch(I){let C=I;y=(p=(h=C.code)!=null?h:C.errNo)!=null?p:2e3,u="FAILURE";let w=(b=(f=C.message)!=null?f:C.errMsg)!=null?b:`${I}`;return d=`${n}:${u} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,ke(new Mr(d,y)),{code:u,message:d}}finally{let I=Date.now()-a}}}function r(n,i){return(...o)=>P(this,null,function*(){var p,f,b,I;let a=Fa(o)?o:[o],s=Date.now(),u={method:n,trace_id:ln};ln+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Qi(i.paramsSchema,a,"params")}catch(k){throw Bi(k.message)}let w=yield i.implement(...a);if(w&&"code"in w){let{code:k,data:D,message:G}=w;y=k,d=G,w=D}return Object.assign(h,{code:y,message:d,data:w}),h}catch(C){let w=C,k=(f=(p=w.code)!=null?p:w.errNo)!=null?f:2e3;y="FAILURE";let D=(I=(b=w.message)!=null?b:w.errMsg)!=null?I:`${C}`,G=`${n}:${y} ${D.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:G}),ke(new Mr(G,k)),h}finally{let C=Date.now()-s}})}return{createAPI:r,createSyncAPI:t}}});var ze,mt,ge,rr=Z(()=>{"use strict";bs();ot();As();Yi();({createAPI:ze,createSyncAPI:mt}=Is(Te)),ge=ws("h5")});var Os=mi((Rs,to)=>{(function(e){if(typeof Rs=="object"&&typeof to!="undefined")to.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,h){if(!o[y]){if(!i[y]){var p=typeof Yt=="function"&&Yt;if(!h&&p)return p(y,!0);if(u)return u(y,!0);var f=new Error("Cannot find module '"+y+"'");throw f.code="MODULE_NOT_FOUND",f}var b=o[y]={exports:{}};i[y][0].call(b.exports,function(I){var C=i[y][1][I];return s(C||I)},b,b.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Yt=="function"&&Yt,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(I),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),u=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=I,u=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var w=a.document.createElement("script");w.onreadystatechange=function(){I(),w.onreadystatechange=null,w.parentNode.removeChild(w),w=null},a.document.documentElement.appendChild(w)}:u=function(){setTimeout(I,0)};var f,b=[];function I(){f=!0;for(var w,k,D=b.length;D;){for(k=b,b=[],w=-1;++w<D;)k[w]();D=b.length}f=!1}i.exports=C;function C(w){b.push(w)===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"],h=["PENDING"];i.exports=p;function p(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,S!==s&&C(this,S)}p.prototype.catch=function(S){return this.then(null,S)},p.prototype.then=function(S,N){if(typeof S!="function"&&this.state===y||typeof N!="function"&&this.state===d)return this;var T=new this.constructor(s);if(this.state!==h){var M=this.state===y?S:N;b(T,M,this.outcome)}else this.queue.push(new f(T,S,N));return T};function f(S,N,T){this.promise=S,typeof N=="function"&&(this.onFulfilled=N,this.callFulfilled=this.otherCallFulfilled),typeof T=="function"&&(this.onRejected=T,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(S){u.resolve(this.promise,S)},f.prototype.otherCallFulfilled=function(S){b(this.promise,this.onFulfilled,S)},f.prototype.callRejected=function(S){u.reject(this.promise,S)},f.prototype.otherCallRejected=function(S){b(this.promise,this.onRejected,S)};function b(S,N,T){a(function(){var M;try{M=N(T)}catch(W){return u.reject(S,W)}M===S?u.reject(S,new TypeError("Cannot resolve promise with itself")):u.resolve(S,M)})}u.resolve=function(S,N){var T=w(I,N);if(T.status==="error")return u.reject(S,T.value);var M=T.value;if(M)C(S,M);else{S.state=y,S.outcome=N;for(var W=-1,K=S.queue.length;++W<K;)S.queue[W].callFulfilled(N)}return S},u.reject=function(S,N){S.state=d,S.outcome=N;for(var T=-1,M=S.queue.length;++T<M;)S.queue[T].callRejected(N);return S};function I(S){var N=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof N=="function")return function(){N.apply(S,arguments)}}function C(S,N){var T=!1;function M(he){T||(T=!0,u.reject(S,he))}function W(he){T||(T=!0,u.resolve(S,he))}function K(){N(W,M)}var ee=w(K);ee.status==="error"&&M(ee.value)}function w(S,N){var T={};try{T.value=S(N),T.status="success"}catch(M){T.status="error",T.value=M}return T}p.resolve=k;function k(S){return S instanceof this?S:u.resolve(new this(s),S)}p.reject=D;function D(S){var N=new this(s);return u.reject(N,S)}p.all=G;function G(S){var N=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=S.length,M=!1;if(!T)return this.resolve([]);for(var W=new Array(T),K=0,ee=-1,he=new this(s);++ee<T;)He(S[ee],ee);return he;function He(Kt,Tr){N.resolve(Kt).then(ri,function(Et){M||(M=!0,u.reject(he,Et))});function ri(Et){W[Tr]=Et,++K===T&&!M&&(M=!0,u.resolve(he,W))}}}p.race=H;function H(S){var N=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var T=S.length,M=!1;if(!T)return this.resolve([]);for(var W=-1,K=new this(s);++W<T;)ee(S[W]);return K;function ee(he){N.resolve(he).then(function(He){M||(M=!0,u.resolve(K,He))},function(He){M||(M=!0,u.reject(K,He))})}}},{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,m){if(!(l instanceof m))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),m=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(l,m){l=l||[],m=m||{};try{return new Blob(l,m)}catch(v){if(v.name!=="TypeError")throw v;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(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(l,m){m&&l.then(function(c){m(null,c)},function(c){m(c)})}function b(l,m,c){typeof m=="function"&&l.then(m),typeof c=="function"&&l.catch(c)}function I(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function C(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",k=void 0,D={},G=Object.prototype.toString,H="readonly",S="readwrite";function N(l){for(var m=l.length,c=new ArrayBuffer(m),_=new Uint8Array(c),g=0;g<m;g++)_[g]=l.charCodeAt(g);return c}function T(l){return new p(function(m){var c=l.transaction(w,S),_=h([""]);c.objectStore(w).put(_,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),m(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),v=navigator.userAgent.match(/Edge\//);m(v||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function M(l){return typeof k=="boolean"?p.resolve(k):T(l).then(function(m){return k=m,k})}function W(l){var m=D[l.name],c={};c.promise=new p(function(_,g){c.resolve=_,c.reject=g}),m.deferredOperations.push(c),m.dbReady?m.dbReady=m.dbReady.then(function(){return c.promise}):m.dbReady=c.promise}function K(l){var m=D[l.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ee(l,m){var c=D[l.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function he(l,m){return new p(function(c,_){if(D[l.name]=D[l.name]||sa(),l.db)if(m)W(l),l.db.close();else return c(l.db);var g=[l.name];m&&g.push(l.version);var v=d.open.apply(d,g);m&&(v.onupgradeneeded=function(E){var A=v.result;try{A.createObjectStore(l.storeName),E.oldVersion<=1&&A.createObjectStore(w)}catch(R){if(R.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw R}}),v.onerror=function(E){E.preventDefault(),_(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(A){A.target.close()},c(E),K(l)}})}function He(l){return he(l,!1)}function Kt(l){return he(l,!0)}function Tr(l,m){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!==m&&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 v=l.db.version+1;v>l.version&&(l.version=v)}return!0}return!1}function ri(l){return new p(function(m,c){var _=new FileReader;_.onerror=c,_.onloadend=function(g){var v=btoa(g.target.result||"");m({__local_forage_encoded_blob:!0,data:v,type:l.type})},_.readAsBinaryString(l)})}function Et(l){var m=N(atob(l.data));return h([m],{type:l.type})}function aa(l){return l&&l.__local_forage_encoded_blob}function Yu(l){var m=this,c=m._initReady().then(function(){var _=D[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return b(c,l,l),c}function Xu(l){W(l);for(var m=D[l.name],c=m.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,He(l).then(function(v){return l.db=v,Tr(l)?Kt(l):v}).then(function(v){l.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ee(l,v),v})}function Ve(l,m,c,_){_===void 0&&(_=1);try{var g=l.db.transaction(l.storeName,m);c(null,g)}catch(v){if(_>0&&(!l.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!l.db||v.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Kt(l)}).then(function(){return Xu(l).then(function(){Ve(l,m,c,_-1)})}).catch(c);c(v)}}function sa(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Zu(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=l[_];var g=D[c.name];g||(g=sa(),D[c.name]=g),g.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Yu);var v=[];function E(){return p.resolve()}for(var A=0;A<g.forages.length;A++){var R=g.forages[A];R!==m&&v.push(R._initReady().catch(E))}var O=g.forages.slice(0);return p.all(v).then(function(){return c.db=g.db,He(c)}).then(function(x){return c.db=x,Tr(c,m._defaultConfig.version)?Kt(c):x}).then(function(x){c.db=g.db=x,m._dbInfo=c;for(var U=0;U<O.length;U++){var F=O[U];F!==m&&(F._dbInfo.db=c.db,F._dbInfo.version=c.version)}})}function ec(l,m){var c=this;l=I(l);var _=new p(function(g,v){c.ready().then(function(){Ve(c._dbInfo,H,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=R.get(l);O.onsuccess=function(){var x=O.result;x===void 0&&(x=null),aa(x)&&(x=Et(x)),g(x)},O.onerror=function(){v(O.error)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function tc(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){Ve(c._dbInfo,H,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=R.openCursor(),x=1;O.onsuccess=function(){var U=O.result;if(U){var F=U.value;aa(F)&&(F=Et(F));var q=l(F,U.key,x++);q!==void 0?g(q):U.continue()}else g()},O.onerror=function(){v(O.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function rc(l,m,c){var _=this;l=I(l);var g=new p(function(v,E){var A;_.ready().then(function(){return A=_._dbInfo,G.call(m)==="[object Blob]"?M(A.db).then(function(R){return R?m:ri(m)}):m}).then(function(R){Ve(_._dbInfo,S,function(O,x){if(O)return E(O);try{var U=x.objectStore(_._dbInfo.storeName);R===null&&(R=void 0);var F=U.put(R,l);x.oncomplete=function(){R===void 0&&(R=null),v(R)},x.onabort=x.onerror=function(){var q=F.error?F.error:F.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return f(g,c),g}function nc(l,m){var c=this;l=I(l);var _=new p(function(g,v){c.ready().then(function(){Ve(c._dbInfo,S,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=R.delete(l);A.oncomplete=function(){g()},A.onerror=function(){v(O.error)},A.onabort=function(){var x=O.error?O.error:O.transaction.error;v(x)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function ic(l){var m=this,c=new p(function(_,g){m.ready().then(function(){Ve(m._dbInfo,S,function(v,E){if(v)return g(v);try{var A=E.objectStore(m._dbInfo.storeName),R=A.clear();E.oncomplete=function(){_()},E.onabort=E.onerror=function(){var O=R.error?R.error:R.transaction.error;g(O)}}catch(O){g(O)}})}).catch(g)});return f(c,l),c}function oc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){Ve(m._dbInfo,H,function(v,E){if(v)return g(v);try{var A=E.objectStore(m._dbInfo.storeName),R=A.count();R.onsuccess=function(){_(R.result)},R.onerror=function(){g(R.error)}}catch(O){g(O)}})}).catch(g)});return f(c,l),c}function ac(l,m){var c=this,_=new p(function(g,v){if(l<0){g(null);return}c.ready().then(function(){Ve(c._dbInfo,H,function(E,A){if(E)return v(E);try{var R=A.objectStore(c._dbInfo.storeName),O=!1,x=R.openKeyCursor();x.onsuccess=function(){var U=x.result;if(!U){g(null);return}l===0||O?g(U.key):(O=!0,U.advance(l))},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function sc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){Ve(m._dbInfo,H,function(v,E){if(v)return g(v);try{var A=E.objectStore(m._dbInfo.storeName),R=A.openKeyCursor(),O=[];R.onsuccess=function(){var x=R.result;if(!x){_(O);return}O.push(x.key),x.continue()},R.onerror=function(){g(R.error)}}catch(x){g(x)}})}).catch(g)});return f(c,l),c}function lc(l,m){m=C.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=p.reject("Invalid arguments");else{var v=l.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):He(l).then(function(A){var R=D[l.name],O=R.forages;R.db=A;for(var x=0;x<O.length;x++)O[x]._dbInfo.db=A;return A});l.storeName?g=E.then(function(A){if(A.objectStoreNames.contains(l.storeName)){var R=A.version+1;W(l);var O=D[l.name],x=O.forages;A.close();for(var U=0;U<x.length;U++){var F=x[U];F._dbInfo.db=null,F._dbInfo.version=R}var q=new p(function(z,ue){var oe=d.open(l.name,R);oe.onerror=function(De){var Qt=oe.result;Qt.close(),ue(De)},oe.onupgradeneeded=function(){var De=oe.result;De.deleteObjectStore(l.storeName)},oe.onsuccess=function(){var De=oe.result;De.close(),z(De)}});return q.then(function(z){O.db=z;for(var ue=0;ue<x.length;ue++){var oe=x[ue];oe._dbInfo.db=z,K(oe._dbInfo)}}).catch(function(z){throw(ee(l,z)||p.resolve()).catch(function(){}),z})}}):g=E.then(function(A){W(l);var R=D[l.name],O=R.forages;A.close();for(var x=0;x<O.length;x++){var U=O[x];U._dbInfo.db=null}var F=new p(function(q,z){var ue=d.deleteDatabase(l.name);ue.onerror=function(){var oe=ue.result;oe&&oe.close(),z(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},ue.onsuccess=function(){var oe=ue.result;oe&&oe.close(),q(oe)}});return F.then(function(q){R.db=q;for(var z=0;z<O.length;z++){var ue=O[z];K(ue._dbInfo)}}).catch(function(q){throw(ee(l,q)||p.resolve()).catch(function(){}),q})})}return f(g,m),g}var uc={_driver:"asyncStorage",_initStorage:Zu,_support:y(),iterate:tc,getItem:ec,setItem:rc,removeItem:nc,clear:ic,length:oc,key:ac,keys:sc,dropInstance:lc};function cc(){return typeof openDatabase=="function"}var rt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",dc="~~local_forage_type~",la=/^~~local_forage_type~([^~]+)~/,xr="__lfsc__:",ni=xr.length,ii="arbf",oi="blob",ua="si08",ca="ui08",da="uic8",fa="si16",ha="si32",ma="ur16",pa="ui32",va="fl32",_a="fl64",ga=ni+ii.length,ya=Object.prototype.toString;function wa(l){var m=l.length*.75,c=l.length,_,g=0,v,E,A,R;l[l.length-1]==="="&&(m--,l[l.length-2]==="="&&m--);var O=new ArrayBuffer(m),x=new Uint8Array(O);for(_=0;_<c;_+=4)v=rt.indexOf(l[_]),E=rt.indexOf(l[_+1]),A=rt.indexOf(l[_+2]),R=rt.indexOf(l[_+3]),x[g++]=v<<2|E>>4,x[g++]=(E&15)<<4|A>>2,x[g++]=(A&3)<<6|R&63;return O}function ai(l){var m=new Uint8Array(l),c="",_;for(_=0;_<m.length;_+=3)c+=rt[m[_]>>2],c+=rt[(m[_]&3)<<4|m[_+1]>>4],c+=rt[(m[_+1]&15)<<2|m[_+2]>>6],c+=rt[m[_+2]&63];return m.length%3===2?c=c.substring(0,c.length-1)+"=":m.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function fc(l,m){var c="";if(l&&(c=ya.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&ya.call(l.buffer)==="[object ArrayBuffer]")){var _,g=xr;l instanceof ArrayBuffer?(_=l,g+=ii):(_=l.buffer,c==="[object Int8Array]"?g+=ua:c==="[object Uint8Array]"?g+=ca:c==="[object Uint8ClampedArray]"?g+=da:c==="[object Int16Array]"?g+=fa:c==="[object Uint16Array]"?g+=ma:c==="[object Int32Array]"?g+=ha:c==="[object Uint32Array]"?g+=pa:c==="[object Float32Array]"?g+=va:c==="[object Float64Array]"?g+=_a:m(new Error("Failed to get type for BinaryArray"))),m(g+ai(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=dc+l.type+"~"+ai(this.result);m(xr+oi+E)},v.readAsArrayBuffer(l)}else try{m(JSON.stringify(l))}catch(E){console.error("Couldn't convert value into a JSON string: ",l),m(null,E)}}function hc(l){if(l.substring(0,ni)!==xr)return JSON.parse(l);var m=l.substring(ga),c=l.substring(ni,ga),_;if(c===oi&&la.test(m)){var g=m.match(la);_=g[1],m=m.substring(g[0].length)}var v=wa(m);switch(c){case ii:return v;case oi:return h([v],{type:_});case ua:return new Int8Array(v);case ca:return new Uint8Array(v);case da:return new Uint8ClampedArray(v);case fa:return new Int16Array(v);case ma:return new Uint16Array(v);case ha:return new Int32Array(v);case pa:return new Uint32Array(v);case va:return new Float32Array(v);case _a:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var si={serialize:fc,deserialize:hc,stringToBuffer:wa,bufferToString:ai};function ba(l,m,c,_){l.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function mc(l){var m=this,c={db:null};if(l)for(var _ in l)c[_]=typeof l[_]!="string"?l[_].toString():l[_];var g=new p(function(v,E){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(A){return E(A)}c.db.transaction(function(A){ba(A,c,function(){m._dbInfo=c,v()},function(R,O){E(O)})},E)});return c.serializer=si,g}function nt(l,m,c,_,g,v){l.executeSql(c,_,g,function(E,A){A.code===A.SYNTAX_ERR?E.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[m.storeName],function(R,O){O.rows.length?v(R,A):ba(R,m,function(){R.executeSql(c,_,g,v)},v)},v):v(E,A)},v)}function pc(l,m){var c=this;l=I(l);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[l],function(R,O){var x=O.rows.length?O.rows.item(0).value:null;x&&(x=E.serializer.deserialize(x)),g(x)},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function vc(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"SELECT * FROM "+E.storeName,[],function(R,O){for(var x=O.rows,U=x.length,F=0;F<U;F++){var q=x.item(F),z=q.value;if(z&&(z=E.serializer.deserialize(z)),z=l(z,q.key,F+1),z!==void 0){g(z);return}}g()},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function Ea(l,m,c,_){var g=this;l=I(l);var v=new p(function(E,A){g.ready().then(function(){m===void 0&&(m=null);var R=m,O=g._dbInfo;O.serializer.serialize(m,function(x,U){U?A(U):O.db.transaction(function(F){nt(F,O,"INSERT OR REPLACE INTO "+O.storeName+" (key, value) VALUES (?, ?)",[l,x],function(){E(R)},function(q,z){A(z)})},function(F){if(F.code===F.QUOTA_ERR){if(_>0){E(Ea.apply(g,[l,R,c,_-1]));return}A(F)}})})}).catch(A)});return f(v,c),v}function _c(l,m,c){return Ea.apply(this,[l,m,c,1])}function gc(l,m){var c=this;l=I(l);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[l],function(){g()},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function yc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(A,R){g(R)})})}).catch(g)});return f(c,l),c}function wc(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(A,R){var O=R.rows.item(0).c;_(O)},function(A,R){g(R)})})}).catch(g)});return f(c,l),c}function bc(l,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){nt(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[l+1],function(R,O){var x=O.rows.length?O.rows.item(0).key:null;g(x)},function(R,O){v(O)})})}).catch(v)});return f(_,m),_}function Ec(l){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){nt(E,v,"SELECT key FROM "+v.storeName,[],function(A,R){for(var O=[],x=0;x<R.rows.length;x++)O.push(R.rows.item(x).key);_(O)},function(A,R){g(R)})})}).catch(g)});return f(c,l),c}function Ic(l){return new p(function(m,c){l.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,v){for(var E=[],A=0;A<v.rows.length;A++)E.push(v.rows.item(A).name);m({db:l,storeNames:E})},function(g,v){c(v)})},function(_){c(_)})})}function Ac(l,m){m=C.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 p(function(v){var E;l.name===c.name?E=_._dbInfo.db:E=openDatabase(l.name,"","",0),l.storeName?v({db:E,storeNames:[l.storeName]}):v(Ic(E))}).then(function(v){return new p(function(E,A){v.db.transaction(function(R){function O(q){return new p(function(z,ue){R.executeSql("DROP TABLE IF EXISTS "+q,[],function(){z()},function(oe,De){ue(De)})})}for(var x=[],U=0,F=v.storeNames.length;U<F;U++)x.push(O(v.storeNames[U]));p.all(x).then(function(){E()}).catch(function(q){A(q)})},function(R){A(R)})})}):g=p.reject("Invalid arguments"),f(g,m),g}var Sc={_driver:"webSQLStorage",_initStorage:mc,_support:cc(),iterate:vc,getItem:pc,setItem:_c,removeItem:gc,clear:yc,length:wc,key:bc,keys:Ec,dropInstance:Ac};function Cc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function Ia(l,m){var c=l.name+"/";return l.storeName!==m.storeName&&(c+=l.storeName+"/"),c}function Rc(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(m){return!0}}function Oc(){return!Rc()||localStorage.length>0}function kc(l){var m=this,c={};if(l)for(var _ in l)c[_]=l[_];return c.keyPrefix=Ia(l,m._defaultConfig),Oc()?(m._dbInfo=c,c.serializer=si,p.resolve()):p.reject()}function Tc(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var v=localStorage.key(g);v.indexOf(_)===0&&localStorage.removeItem(v)}});return f(c,l),c}function xc(l,m){var c=this;l=I(l);var _=c.ready().then(function(){var g=c._dbInfo,v=localStorage.getItem(g.keyPrefix+l);return v&&(v=g.serializer.deserialize(v)),v});return f(_,m),_}function Pc(l,m){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,v=g.keyPrefix,E=v.length,A=localStorage.length,R=1,O=0;O<A;O++){var x=localStorage.key(O);if(x.indexOf(v)===0){var U=localStorage.getItem(x);if(U&&(U=g.serializer.deserialize(U)),U=l(U,x.substring(E),R++),U!==void 0)return U}}});return f(_,m),_}function Lc(l,m){var c=this,_=c.ready().then(function(){var g=c._dbInfo,v;try{v=localStorage.key(l)}catch(E){v=null}return v&&(v=v.substring(g.keyPrefix.length)),v});return f(_,m),_}function Dc(l){var m=this,c=m.ready().then(function(){for(var _=m._dbInfo,g=localStorage.length,v=[],E=0;E<g;E++){var A=localStorage.key(E);A.indexOf(_.keyPrefix)===0&&v.push(A.substring(_.keyPrefix.length))}return v});return f(c,l),c}function Nc(l){var m=this,c=m.keys().then(function(_){return _.length});return f(c,l),c}function Uc(l,m){var c=this;l=I(l);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return f(_,m),_}function Mc(l,m,c){var _=this;l=I(l);var g=_.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,A){var R=_._dbInfo;R.serializer.serialize(m,function(O,x){if(x)A(x);else try{localStorage.setItem(R.keyPrefix+l,O),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(U),A(U)}})})});return f(g,c),g}function Bc(l,m){if(m=C.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 p(function(v){l.storeName?v(Ia(l,_._defaultConfig)):v(l.name+"/")}).then(function(v){for(var E=localStorage.length-1;E>=0;E--){var A=localStorage.key(E);A.indexOf(v)===0&&localStorage.removeItem(A)}}):g=p.reject("Invalid arguments"),f(g,m),g}var Jc={_driver:"localStorageWrapper",_initStorage:kc,_support:Cc(),iterate:Pc,getItem:xc,setItem:Mc,removeItem:Uc,clear:Tc,length:Nc,key:Lc,keys:Dc,dropInstance:Bc},Fc=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},Gc=function(m,c){for(var _=m.length,g=0;g<_;){if(Fc(m[g],c))return!0;g++}return!1},Aa=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},zt={},Sa={},It={INDEXEDDB:uc,WEBSQL:Sc,LOCALSTORAGE:Jc},jc=[It.INDEXEDDB._driver,It.WEBSQL._driver,It.LOCALSTORAGE._driver],Pr=["dropInstance"],li=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Pr),Hc={description:"",driver:jc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Vc(l,m){l[m]=function(){var c=arguments;return l.ready().then(function(){return l[m].apply(l,c)})}}function ui(){for(var l=1;l<arguments.length;l++){var m=arguments[l];if(m)for(var c in m)m.hasOwnProperty(c)&&(Aa(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var $c=function(){function l(m){s(this,l);for(var c in It)if(It.hasOwnProperty(c)){var _=It[c],g=_._driver;this[c]=g,zt[g]||this.defineDriver(_)}this._defaultConfig=ui({},Hc),this._config=ui({},this._defaultConfig,m),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 v=new p(function(E,A){try{var R=c._driver,O=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){A(O);return}for(var x=li.concat("_initStorage"),U=0,F=x.length;U<F;U++){var q=x[U],z=!Gc(Pr,q);if((z||c[q])&&typeof c[q]!="function"){A(O);return}}var ue=function(){for(var Qt=function(Kc){return function(){var zc=new Error("Method "+Kc+" is not implemented by the current driver"),Ca=p.reject(zc);return f(Ca,arguments[arguments.length-1]),Ca}},ci=0,Wc=Pr.length;ci<Wc;ci++){var di=Pr[ci];c[di]||(c[di]=Qt(di))}};ue();var oe=function(Qt){zt[R]&&console.info("Redefining LocalForage driver: "+R),zt[R]=c,Sa[R]=Qt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(oe,A):oe(!!c._support):oe(!0)}catch(De){A(De)}});return b(v,_,g),v},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,_,g){var v=zt[c]?p.resolve(zt[c]):p.reject(new Error("Driver not found."));return b(v,_,g),v},l.prototype.getSerializer=function(c){var _=p.resolve(si);return b(_,c),_},l.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return b(g,c,c),g},l.prototype.setDriver=function(c,_,g){var v=this;Aa(c)||(c=[c]);var E=this._getSupportedDrivers(c);function A(){v._config.driver=v.driver()}function R(U){return v._extend(U),A(),v._ready=v._initStorage(v._config),v._ready}function O(U){return function(){var F=0;function q(){for(;F<U.length;){var z=U[F];return F++,v._dbInfo=null,v._ready=null,v.getDriver(z).then(R).catch(q)}A();var ue=new Error("No available storage method found.");return v._driverSet=p.reject(ue),v._driverSet}return q()}}var x=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=x.then(function(){var U=E[0];return v._dbInfo=null,v._ready=null,v.getDriver(U).then(function(F){v._driver=F._driver,A(),v._wrapLibraryMethodsWithReady(),v._initDriver=O(E)})}).catch(function(){A();var U=new Error("No available storage method found.");return v._driverSet=p.reject(U),v._driverSet}),b(this._driverSet,_,g),this._driverSet},l.prototype.supports=function(c){return!!Sa[c]},l.prototype._extend=function(c){ui(this,c)},l.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,v=c.length;g<v;g++){var E=c[g];this.supports(E)&&_.push(E)}return _},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=li.length;c<_;c++)Vc(this,li[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),qc=new $c;i.exports=qc},{3:3}]},{},[4])(4)})});var Ts=mi(hn=>{"use strict";j();rr();ot();var no=_e(),vf=ze("levelFinished",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),duration:J.number().optional(),rating:J.number().optional(),score:J.number().optional(),variation:J.string().optional()})),implement:e=>P(hn,null,function*(){let{levelId:t,duration:r,rating:n,score:i,variation:o}=e;Ne.info("onLevelFinished",r,n,i,o),yield Promise.all([We.reporter({event:"COMPLETE_GAME_LEVEL",extraParams:{inGameInfo:{levelId:t,duration:r,rating:n,score:i}}}),We.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i,variation:o})])})}),_f=ze("gamePlayEnded",{paramsSchema:J.tuple(J.object({duration:J.number().optional(),rating:J.number().optional(),score:J.number(),variation:J.string().optional()})),implement:e=>P(hn,null,function*(){let{duration:t,rating:r,score:n,variation:i}=e;Ne.info("onGamePlayEnded",t,r,n,i),yield Promise.all([We.tracker("GamePlayEnded",{duration:t,rating:r,score:n,variation:i}),We.reporter({event:"GAME_ENDED",extraParams:{inGameInfo:{duration:t,rating:r,score:n}}})])})}),gf=ze("levelUpgrade",{paramsSchema:J.tuple(J.object({levelId:J.or(J.string(),J.number()),name:J.string().optional()})),implement:r=>P(hn,[r],function*({levelId:e,name:t}){yield Promise.all([We.tracker("LevelUpgrade",{name:t,levelId:e}),We.reporter({event:"GAME_LEVEL_UP",extraParams:{inGameInfo:{levelId:e,levelName:t}}})])})});no.registerCommand("TaskTrackerSDK.levelFinished",vf);no.registerCommand("TaskTrackerSDK.gamePlayEnded",_f);no.registerCommand("TaskTrackerSDK.levelUpgrade",gf);ge("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25",variation:"1.1.50"}}});ge("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var pt,kt,xs,io,yf,mn,oo=Z(()=>{"use strict";pt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},kt=new Map,xs=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=kt.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)}},io=!1,yf=()=>{io||(window.addEventListener("message",xs),io=!0)},mn=(e,t)=>{yf(),kt.has(e)||kt.set(e,new Set);let r=kt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&kt.delete(e),kt.size===0&&(window.removeEventListener("message",xs),io=!1)}}});var pn,vn,_n,gn,yn,Ps,wn,bn,Tt,wf,ae,xt,Pt,Ue=Z(()=>{"use strict";j();pn="UNLOCK_OPTIONS_CHANGED",vn="INVOKE_PAYMENT",_n="ON_PAYMENT_RESULT",gn="ON_USE_MODAL_EVENT",yn="ON_USE_MODAL_RESULT",Ps="ON_USE_MODAL_FREQUENCY",wn="ON_USE_UNLOGIN_MODAL_EVENT",bn="INVOKE_UNLOGIN_MODAL_EVENT",Tt=new Fe,wf=()=>({on:Tt.on.bind(Tt),off:Tt.off.bind(Tt),emit:Tt.emit.bind(Tt)}),ae=wf(),xt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},Pt={show:!0,minInterval:8*60*60*1e3}});var Pu=mi(ta=>{"use strict";me();Ue();oo();j();var xu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};mn("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",xu[e.result],e.result),ae.emit(yn,{useModalResult:xu[e.result]})});ae.on(gn,(e,t)=>{var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||pt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:it()})});mn("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(_n,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin,currency:"JOLI_COIN"})});ae.on(vn,(e,t)=>P(ta,null,function*(){var r;e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||pt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.quantity,balance:t.userCurrency.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:it()})}));mn("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(wn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{claimedRewardValue:(i=(n=(r=(t=e.extra)==null?void 0:t.firstLogin)==null?void 0:r.reward)==null?void 0:n.rewardValue)!=null?i:0,isFirstLogin:(o=e.isFirstLogin)!=null?o:!1}}),e.result==="SUCCESS"&&L.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ae.on(bn,e=>P(ta,null,function*(){e=="ADS-JOLI_GEM"||e=="JOLI_GEM"||pt("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:it(),type:e})}))});ot();me();rr();j();var Ss=_e(),Zd="env",ef="getSystemInfoSync",tf=()=>{var i,o,a,s;let e={system:L.deviceInfo.system,platform:L.deviceInfo.platform.toLowerCase(),brand:L.deviceInfo.brand,pixelRatio:L.deviceInfo.pixelRatio,language:L.deviceInfo.lang,version:L.sdkInfo.jssdkVersion,appName:(i=L.hostInfo)==null?void 0:i.appName,SDKVersion:L.sdkInfo.nativeSDKVersion},t=(o=L.hostInfo)==null?void 0:o.version;t&&(e=Oe(Q({},e),{version:t}));let r=(a=L.hostInfo)==null?void 0:a.appName;r&&(e=Oe(Q({},e),{appName:r}));let n=(s=L.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=Oe(Q({},e),{SDKVersion:n})),e},rf=mt(ef,{implement:tf}),nf=mt(Zd,{implement:()=>Oe(Q({},L.hostInfo),{sdkInfo:L.sdkInfo,platform:L.platform,deviceInfo:L.deviceInfo})});Ss.registerCommand("API.env",nf);Ss.registerCommand("API.getSystemInfoSync",rf);ge("env",{version:"1.0.0"});ge("getSystemInfoSync",{version:"1.0.0"});j();rr();$e();ot();var of="onJoliboxShow",af="onJoliboxHide",sf="onReady",Zi=_e(),eo=Wa(ke),Xi=!0,nr=!0,un=0,cn=$i;function lf(){let e=Date.now();if(e-un<100)return;un=e;let t=document.visibilityState==="visible";t!==Xi&&(Xi=t,cn.emit("visible",Xi))}function Cs(e){let t=Date.now();t-un<100||(un=t,e==="focus"&&!nr?nr=!0:e==="blur"&&nr&&(nr=!1),cn.emit("visible",nr))}document.addEventListener("visibilitychange",lf);window.addEventListener("focus",()=>Cs("focus"));window.addEventListener("blur",()=>Cs("blur"));var uf=mt(of,{paramsSchema:J.tuple(J.function()),implement(e){let t=eo(e);cn.on("visible",r=>{r&&t()})}}),cf=mt(af,{paramsSchema:J.tuple(J.function()),implement(e){let t=eo(e);cn.on("visible",r=>{!r&&t()})}}),df=mt(sf,{paramsSchema:J.tuple(J.function()),implement(e){let t=eo(e);ft.on("LifecycleEvent.onReady",r=>{t(r)})}});Zi.registerCommand("LifecycleSDK.onReady",df);Zi.registerCommand("LifecycleSDK.onJoliboxShow",uf);Zi.registerCommand("LifecycleSDK.onJoliboxHide",cf);ge("lifeCycle.onReady",{version:"1.0.0"});ge("lifeCycle.onJoliboxShow",{version:"1.0.0"});ge("lifeCycle.onJoliboxHide",{version:"1.0.0"});rr();j();Rt();me();var ks=pi(Os());var dn=_e(),ro=class{constructor(){this.httpClient=Be.create({baseUrl:Ct(L.testMode)});this.getGameId=()=>L.mpId;this.getItem=t=>P(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)=>P(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=>P(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=()=>P(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=ks.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},fn=new ro,ff=ze("getLocalStorage",{paramsSchema:J.tuple(J.string()),implement(e){return P(this,null,function*(){return yield fn.getItem(e)})}});dn.registerCommand("StorageSDK.getItem",ff);ge("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var hf=ze("setStorage",{paramsSchema:J.tuple(J.string(),J.or(J.string(),J.boolean(),J.number())),implement(e,t){return P(this,null,function*(){return yield fn.setItem(e,t)})}});dn.registerCommand("StorageSDK.setItem",hf);ge("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var mf=ze("removeStorage",{paramsSchema:J.tuple(J.string()),implement(e){return P(this,null,function*(){return yield fn.removeItem(e)})}});dn.registerCommand("StorageSDK.removeItem",mf);ge("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var pf=ze("clearStorage",{implement(){return P(this,null,function*(){return yield fn.clear()})}});dn.registerCommand("StorageSDK.clear",pf);ge("storage.clear",{version:"1.0.0"});var vb=pi(Ts());ot();j();Rt();oo();me();Ue();var Ls=L.testMode;function Ds(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return P(this,null,function*(){return yield i.reduce((s,u)=>P(this,null,function*(){let d=yield s;if(d===!0)return!0;Ls&&console.log(`handleReward ${u}`);let y=e.get(u),h=y?yield y(...o):d;return Ls&&console.log(`handleReward ${u} ${h}`),h}),Promise.resolve(!1))})},registerRewardsFetcher(i){return P(this,null,function*(){t=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return P(this,null,function*(){r=(...o)=>P(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:xt,loginGuide:Pt}}})})},getRewardsTypes(...i){return P(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return P(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:xt,loginGuide:Pt}})}}}Ue();j();var bf=()=>(e,t)=>{let r={JOLI_GEM:3,JOLI_GEM_ONLY:3,JOLI_COIN:2,JOLI_COIN_ONLY:2,ADS:1};return r[t]-r[e]},Ef=e=>e.length?e.includes("JOLI_GEM")&&e.length<=1?["JOLI_GEM_ONLY"]:e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(bf()):["ADS"],Ns=e=>{e.registerRewardsFetcher(t=>P(void 0,null,function*(){var n,i,o,a,s;let r=["ADS"];try{let u=yield t.post("/api/games/unlock-options",{});if(u.code!=="SUCCESS")return r;console.log("-----res fetch reward-----",u),ae.emit(pn,{options:((n=u.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=u.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1},userGem:((o=u.extra)==null?void 0:o.joliGem)||{balance:0,enableAutoDeduct:!1}});let d=((s=(a=u.data)==null?void 0:a.unlockOptions)==null?void 0:s.map(y=>y.type))||Array.from(r);return Ef(d)}catch(u){return console.error("getRewardOptions error:",u),r}}))},Us=e=>{e.registerRewardFrequencyConfigFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return ae.emit(Ps,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||xt,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||Pt}),r.data&&ft.emit("onGlobalConfigChanged",{globalConfig:r.data}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||xt,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||Pt}}))};var Ms=e=>t=>P(void 0,null,function*(){try{console.log("trigger @jolibox/ads reward",t),yield e.adBreak(t)}catch(r){console.error("-----createAdsRewardHandler error-----",r)}return!0});Ue();function at(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),updateData:a=>{if(i)return i=Q(Q({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Ue();var Me=at(ae,pn);me();j();var ao={JOLI_COIN:{balanceEndpoint:"/api/joli-coin/balance",balanceDetailEndpoint:"/api/joli-coin/balance-detail",unlockEndpoint:"/api/joli-coin/unlock",unlockType:"JOLI_COIN"},GEM:{balanceEndpoint:"/api/joli-gem/balance",balanceDetailEndpoint:"/api/joli-gem/balance-detail",unlockEndpoint:"/api/joli-gem/unlock",unlockType:"GEM"}};j();var st=_e();Ue();Ue();var Bs=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Js=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-gem/balance",{query:{type:"GEM"}})).data});var ir={JOLI_COIN:{fetchBalance:Bs,getQuantity:e=>{var t,r,n;return(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(i=>i.type==="JOLI_COIN"))==null?void 0:r.joliCoinChoices[0].joliCoinQuantity)!=null?n:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userJoliCoin)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userJoliCoin",isEnough:(e,t)=>{var r,n;return(n=(r=e==null?void 0:e.options)==null?void 0:r.some(i=>i.type==="JOLI_COIN"&&i.joliCoinChoices.some(o=>{var a;return o.joliCoinQuantity<=((a=t==null?void 0:t.balance)!=null?a:0)})))!=null?n:!1}},JOLI_GEM:{fetchBalance:Js,getQuantity:e=>{var t,r,n,i;return(i=(n=(r=(t=e==null?void 0:e.options)==null?void 0:t.find(o=>o.type==="JOLI_GEM"))==null?void 0:r.joliGemChoice)==null?void 0:n.joliGemQuantity)!=null?i:0},getCurrentUser:e=>{var t;return(t=e==null?void 0:e.userGem)!=null?t:{balance:0,enableAutoDeduct:!1}},createUpdatedUser:(e,t)=>({balance:e,enableAutoDeduct:t}),getUpdateKey:()=>"userGem",isEnough:(e,t)=>{var n,i,o;let r=e==null?void 0:e.options.find(a=>a.type==="JOLI_GEM");return r?((i=(n=r.joliGemChoice)==null?void 0:n.joliGemQuantity)!=null?i:0)<=((o=t==null?void 0:t.balance)!=null?o:0):!1}}};var En=(e,t,r)=>{let{showUnlockWithCurrencyModal:n}=r;st.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){let i=yield Me.getData(),o=ir[t],a=o.getCurrentUser(i),s=o.getQuantity(i),u=!!(a!=null&&a.enableAutoDeduct);return console.log("-----unlockOptions usemodal-----",i,u,s),(yield n({enableAutoDeduct:u,userCurrency:a,quantity:s,currency:t}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},vt=(e,t)=>r=>P(void 0,null,function*(){let n=at(ae,yn);return ae.emit(gn,e,{enableAutoDeduct:r.enableAutoDeduct,userCurrency:r.userCurrency,quantity:r.quantity,currency:r.currency,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});Ue();Ue();var In=(e,t,r)=>{let{httpClient:n,initiateAndAwaitPayment:i}=r;st.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var p;let o=yield Me.getData(),a=ir[t],s=yield a.fetchBalance(n),u=a.getQuantity(o),d=a.getCurrentUser(o),y=a.createUpdatedUser((p=s==null?void 0:s.balance)!=null?p:0,d.enableAutoDeduct),h=a.getUpdateKey();return Me.updateData({[h]:y}),console.log("-----unlockOptions payment-----",o,y,u,t),a.isEnough(o,y)?{result:"CONTINUE"}:{result:(yield i({userCurrency:y,currencyQuantity:u,currency:t}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},_t=(e,t)=>r=>P(void 0,null,function*(){let n=at(ae,_n);return ae.emit(vn,e,{userCurrency:r.userCurrency,quantity:r.currencyQuantity,currency:r.currency,enableAutoDeduct:r.userCurrency.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});me();Ue();Ue();j();var gt=(e,t)=>r=>P(void 0,null,function*(){let n=at(ae,wn);return ae.emit(bn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText,currency:r}),yield n.getFreshData()});var Af=(e,t,r,{handlers:{handleUnlockSuccess:n,handleUnlockFailed:i,unlockOptionsHandler:o,initiateAndAwaitPayment:a,showUnlockWithCurrencyModal:s,showUnloginModal:u}})=>{In(e,"JOLI_COIN",{httpClient:t,initiateAndAwaitPayment:a}),En(e,"JOLI_COIN",{showUnlockWithCurrencyModal:s});let d=[`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];return y=>P(void 0,null,function*(){var h,p,f;try{let b=!0;for(let w of d){let k=yield st.executeCommand(w);if(b=b&&k.result!=="FAILED",k.result!=="CONTINUE")break}if(!b)return i==null||i(y),!1;let I=ao[r],C=yield t.post(I.unlockEndpoint,{data:{type:"GAME_REWARD",reqId:`${it()}-${L.mpType}-${Date.now()}`,gameInfo:{gameId:L.mpId}}});if(console.log("-----unlockWithCurrency request result-----",C),C.code=="SUCCESS"){try{(p=y.adBreakDone)==null||p.call(y,{breakType:y.type,breakName:"name"in y&&(h=y.name)!=null?h:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in y&&((f=y.adViewed)==null||f.call(y))}catch(w){console.error("-----unlockWithJolicoin adBreakDone error-----",w)}return n==null||n({quantity:C.data.quantity,balance:C.data.balance}),!0}return i==null||i(y),!1}catch(b){if(console.info("JolicoinRewardHandler error:",b),b instanceof Error&&b.message=="CANCEL")throw b;return i==null||i(y),!1}finally{o.clearCache()}})},An=(e,t,r)=>Af(e,t,"JOLI_COIN",r);var Fs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=vt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=_t("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=gt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return An("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:a}})};var Gs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=vt("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=_t("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=gt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return An("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Me,initiateAndAwaitPayment:o,showUnlockWithCurrencyModal:i,showUnloginModal:a}})};me();j();var Qe=Ds();Ns(Qe);Us(Qe);var On,B,qs,uo,yt,js,Ws,Ks,zs,co,so,lo,Cf,or={},Qs=[],Rf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ar=Array.isArray;function Ye(e,t){for(var r in t)e[r]=t[r];return e}function fo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function sr(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 Cn(e,a,n,i,null)}function Cn(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?++qs:i,__i:-1,__u:0};return i==null&&B.vnode!=null&&B.vnode(o),o}function lt(e){return e.children}function xe(e,t){this.props=e,this.context=t}function Lt(e,t){if(t==null)return e.__?Lt(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"?Lt(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 Hs(e){(!e.__d&&(e.__d=!0)&&yt.push(e)&&!Rn.__r++||js!==B.debounceRendering)&&((js=B.debounceRendering)||Ws)(Rn)}function Rn(){for(var e,t,r,n,i,o,a,s=1;yt.length;)yt.length>s&&yt.sort(Ks),e=yt.shift(),s=yt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ye({},n)).__v=n.__v+1,B.vnode&&B.vnode(r),ho(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?Lt(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,el(o,r,a),r.__e!=i&&Ys(r)));Rn.__r=0}function Xs(e,t,r,n,i,o,a,s,u,d,y){var h,p,f,b,I,C,w=n&&n.__k||Qs,k=t.length;for(u=Of(r,t,w,u,k),h=0;h<k;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?or:w[f.__i]||or,f.__i=h,C=ho(e,f,p,i,o,a,s,u,d,y),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&mo(p.ref,null,f),y.push(f.ref,f.__c||b,f)),I==null&&b!=null&&(I=b),4&f.__u||p.__k===f.__k?u=Zs(f,u,e):typeof f.type=="function"&&C!==void 0?u=C:b&&(u=b.nextSibling),f.__u&=-7);return r.__e=I,u}function Of(e,t,r,n,i){var o,a,s,u,d,y=r.length,h=y,p=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?Cn(null,a,null,null,null):ar(a)?Cn(lt,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?Cn(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=kf(a,r,u,h))!==-1&&(h--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?p--:i<y&&p++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?p--:d==u+1?p++:(d>u?p--:p++,a.__u|=4))):e.__k[o]=null;if(h)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=Lt(s)),rl(s,s));return n}function Zs(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=Zs(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Lt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function lr(e,t){return t=t||[],e==null||typeof e=="boolean"||(ar(e)?e.some(function(r){lr(r,t)}):t.push(e)),t}function kf(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 Vs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Rf.test(t)?r:r+"px"}function Sn(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||Vs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||Vs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(zs,"$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=co,e.addEventListener(t,o?lo:so,o)):e.removeEventListener(t,o?lo:so,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 $s(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=co++;else if(t.u<r.t)return;return r(B.event?B.event(t):t)}}}function ho(e,t,r,n,i,o,a,s,u,d){var y,h,p,f,b,I,C,w,k,D,G,H,S,N,T,M,W,K=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=B.__b)&&y(t);e:if(typeof K=="function")try{if(w=t.props,k="prototype"in K&&K.prototype.render,D=(y=K.contextType)&&n[y.__c],G=y?D?D.props.value:y.__:n,r.__c?C=(h=t.__c=r.__c).__=h.__E:(k?t.__c=h=new K(w,G):(t.__c=h=new xe(w,G),h.constructor=K,h.render=xf),D&&D.sub(h),h.props=w,h.state||(h.state={}),h.context=G,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),k&&h.__s==null&&(h.__s=h.state),k&&K.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=Ye({},h.__s)),Ye(h.__s,K.getDerivedStateFromProps(w,h.__s))),f=h.props,b=h.state,h.__v=t,p)k&&K.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),k&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(k&&K.getDerivedStateFromProps==null&&w!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,G),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,G)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(h.props=w,h.state=h.__s,h.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ee){ee&&(ee.__=t)}),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,G),k&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,b,I)})}if(h.context=G,h.props=w,h.__P=e,h.__e=!1,S=B.__r,N=0,k){for(h.state=h.__s,h.__d=!1,S&&S(t),y=h.render(h.props,h.state,h.context),T=0;T<h._sb.length;T++)h.__h.push(h._sb[T]);h._sb=[]}else do h.__d=!1,S&&S(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++N<25);h.state=h.__s,h.getChildContext!=null&&(n=Ye(Ye({},n),h.getChildContext())),k&&!p&&h.getSnapshotBeforeUpdate!=null&&(I=h.getSnapshotBeforeUpdate(f,b)),M=y,y!=null&&y.type===lt&&y.key==null&&(M=tl(y.props.children)),s=Xs(e,ar(M)?M:[M],t,r,n,i,o,a,s,u,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),C&&(h.__E=h.__=null)}catch(ee){if(t.__v=null,u||o!=null)if(ee.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(W=o.length;W--;)fo(o[W]);else t.__e=r.__e,t.__k=r.__k;B.__e(ee,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=Tf(r.__e,t,r,n,i,o,a,u,d);return(y=B.diffed)&&y(t),128&t.__u?void 0:s}function el(e,t,r){for(var n=0;n<r.length;n++)mo(r[n],r[++n],r[++n]);B.__c&&B.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){B.__e(o,i.__v)}})}function tl(e){return typeof e!="object"||e==null?e:ar(e)?e.map(tl):Ye({},e)}function Tf(e,t,r,n,i,o,a,s,u){var d,y,h,p,f,b,I,C=r.props,w=t.props,k=t.type;if(k=="svg"?i="http://www.w3.org/2000/svg":k=="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==!!k&&(k?f.localName==k:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(k==null)return document.createTextNode(w);e=document.createElementNS(i,k,w.is&&w),s&&(B.__m&&B.__m(t,o),s=!1),o=null}if(k===null)C===w||s&&e.data===w||(e.data=w);else{if(o=o&&On.call(e.childNodes),C=r.props||or,!s&&o!=null)for(C={},d=0;d<e.attributes.length;d++)C[(f=e.attributes[d]).name]=f.value;for(d in C)if(f=C[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=f;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;Sn(e,d,null,f,i)}}for(d in w)f=w[d],d=="children"?p=f:d=="dangerouslySetInnerHTML"?y=f:d=="value"?b=f:d=="checked"?I=f:s&&typeof f!="function"||C[d]===f||Sn(e,d,f,C[d],i);if(y)s||h&&(y.__html===h.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(h&&(e.innerHTML=""),Xs(t.type==="template"?e.content:e,ar(p)?p:[p],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Lt(r,0),s,u),o!=null)for(d=o.length;d--;)fo(o[d]);s||(d="value",k=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[d]||k=="progress"&&!b||k=="option"&&b!==C[d])&&Sn(e,d,b,C[d],i),d="checked",I!==void 0&&I!==e[d]&&Sn(e,d,I,C[d],i))}return e}function mo(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){B.__e(i,r)}}function rl(e,t,r){var n,i;if(B.unmount&&B.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||mo(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){B.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&rl(n[i],t,r||typeof e.type!="function");r||fo(e.__e),e.__c=e.__=e.__e=void 0}function xf(e,t,r){return this.constructor(e,r)}function nl(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),B.__&&B.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],ho(t,e=(!n&&r||t).__k=sr(lt,null,[e]),i||or,or,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),el(o,e,a)}On=Qs.slice,B={__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}},qs=0,uo=function(e){return e!=null&&e.constructor==null},xe.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},r),this.props)),e&&Ye(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),Hs(this))},xe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Hs(this))},xe.prototype.render=lt,yt=[],Ws=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ks=function(e,t){return e.__v.__b-t.__v.__b},Rn.__r=0,zs=/(PointerCapture)$|Capture$/i,co=0,so=$s(!1),lo=$s(!0),Cf=0;var Dt,ie,po,il,ur=0,fl=[],se=B,ol=se.__b,al=se.__r,sl=se.diffed,ll=se.__c,ul=se.unmount,cl=se.__;function Tn(e,t){se.__h&&se.__h(ie,e,ur||t),ur=0;var r=ie.__H||(ie.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function xn(e){return ur=1,hl(ml,e)}function hl(e,t,r){var n=Tn(Dt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):ml(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=ie,!ie.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(p){return!!p.__c});if(y.every(function(p){return!p.__N}))return!o||o.call(this,s,u,d);var h=n.__c.props!==s;return y.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),o&&o.call(this,s,u,d)||h};ie.__f=!0;var o=ie.shouldComponentUpdate,a=ie.componentWillUpdate;ie.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)},ie.shouldComponentUpdate=i}return n.__N||n.__}function cr(e,t){var r=Tn(Dt++,3);!se.__s&&wo(r.__H,t)&&(r.__=e,r.u=t,ie.__H.__h.push(r))}function _o(e,t){var r=Tn(Dt++,4);!se.__s&&wo(r.__H,t)&&(r.__=e,r.u=t,ie.__h.push(r))}function go(e){return ur=5,dr(function(){return{current:e}},[])}function dr(e,t){var r=Tn(Dt++,7);return wo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function yo(e,t){return ur=8,dr(function(){return e},t)}function Pf(){for(var e;e=fl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(kn),e.__H.__h.forEach(vo),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){ie=null,ol&&ol(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),cl&&cl(e,t)},se.__r=function(e){al&&al(e),Dt=0;var t=(ie=e.__c).__H;t&&(po===ie?(t.__h=[],ie.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(kn),t.__h.forEach(vo),t.__h=[],Dt=0)),po=ie},se.diffed=function(e){sl&&sl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(fl.push(t)!==1&&il===se.requestAnimationFrame||((il=se.requestAnimationFrame)||Lf)(Pf)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),po=ie=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(kn),r.__h=r.__h.filter(function(n){return!n.__||vo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),ll&&ll(e,t)},se.unmount=function(e){ul&&ul(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{kn(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var dl=typeof requestAnimationFrame=="function";function Lf(e){var t,r=function(){clearTimeout(n),dl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);dl&&(t=requestAnimationFrame(r))}function kn(e){var t=ie,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),ie=t}function vo(e){var t=ie;e.__c=e.__(),ie=t}function wo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function ml(e,t){return typeof t=="function"?t(e):t}function Nf(e,t){for(var r in t)e[r]=t[r];return e}function pl(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 vl(e,t){this.props=e,this.context=t}(vl.prototype=new xe).isPureReactComponent=!0,vl.prototype.shouldComponentUpdate=function(e,t){return pl(this.props,e)||pl(this.state,t)};var _l=B.__b;B.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),_l&&_l(e)};var _w=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var Uf=B.__e;B.__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)}Uf(e,t,r,n)};var gl=B.unmount;function Sl(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=Nf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Sl(n,t,r)})),e}function Cl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return Cl(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 bo(){this.__u=0,this.o=null,this.__b=null}function Rl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function Pn(){this.i=null,this.l=null}B.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),gl&&gl(e)},(bo.prototype=new xe).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=Rl(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]=Cl(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)},bo.prototype.componentWillUnmount=function(){this.o=[]},bo.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]=Sl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&sr(lt,null,e.fallback);return i&&(i.__u&=-33),[sr(lt,null,t.__a?null:e.children),i]};var yl=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]}};(Pn.prototype=new xe).__a=function(e){var t=this,r=Rl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),yl(t,e,n)):i()};r?r(o):o()}},Pn.prototype.render=function(e){this.i=null,this.l=new Map;var t=lr(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},Pn.prototype.componentDidUpdate=Pn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){yl(e,r,t)})};var Mf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,Bf=/^(?: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]/,Jf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,Ff=/[A-Z0-9]/g,Gf=typeof document!="undefined",jf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Eo(e,t,r){return t.__k==null&&(t.textContent=""),nl(e,t),typeof r=="function"&&r(),e?e.__c:null}xe.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(xe.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var wl=B.event;function Hf(){}function Vf(){return this.cancelBubble}function $f(){return this.defaultPrevented}B.event=function(e){return wl&&(e=wl(e)),e.persist=Hf,e.isPropagationStopped=Vf,e.isDefaultPrevented=$f,e.nativeEvent=e};var Ol,qf={enumerable:!1,configurable:!0,get:function(){return this.class}},bl=B.vnode;B.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||Gf&&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"||jf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":Jf.test(a)&&(a=u):u=a="oninput":o&&Bf.test(a)?a=a.replace(Ff,"-$&").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=lr(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=lr(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",qf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=Mf,bl&&bl(e)};var El=B.__r;B.__r=function(e){El&&El(e),Ol=e.__c};var Il=B.diffed;B.diffed=function(e){Il&&Il(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),Ol=null};var Wf=Object.defineProperty,jn=Object.getOwnPropertySymbols,eu=Object.prototype.hasOwnProperty,tu=Object.prototype.propertyIsEnumerable,kl=(e,t,r)=>t in e?Wf(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Kf=(e,t)=>{for(var r in t||(t={}))eu.call(t,r)&&kl(e,r,t[r]);if(jn)for(var r of jn(t))tu.call(t,r)&&kl(e,r,t[r]);return e},zf=(e,t)=>{var r={};for(var n in e)eu.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&jn)for(var n of jn(e))t.indexOf(n)<0&&tu.call(e,n)&&(r[n]=e[n]);return r},ru=Object.defineProperty,Qf=Object.defineProperties,Yf=Object.getOwnPropertyDescriptors,Tl=Object.getOwnPropertySymbols,Xf=Object.prototype.hasOwnProperty,Zf=Object.prototype.propertyIsEnumerable,xl=(e,t,r)=>t in e?ru(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eh=(e,t)=>{for(var r in t||(t={}))Xf.call(t,r)&&xl(e,r,t[r]);if(Tl)for(var r of Tl(t))Zf.call(t,r)&&xl(e,r,t[r]);return e},th=(e,t)=>Qf(e,Yf(t)),rh=(e,t)=>{for(var r in t)ru(e,r,{get:t[r],enumerable:!0})},nu=(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},nh=(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 ih(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function oh(e){return typeof e=="string"}function ah(e){return typeof e=="undefined"}function sh(e){return ah(e)||e===null}function lh(e){return typeof e=="function"}function iu(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 uh=(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))(uh||{});function fr(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var ch={log:fr("log"),warn:fr("warn"),info:fr("info"),error:fr("error"),debug:fr("debug")};Object.assign(globalThis,{logger:ch});var Pl=Symbol.for("Jolibox.canIUseMap"),dh={};globalThis[Pl]||(globalThis[Pl]=dh);var Ll=Symbol.for("Jolibox.canIUseMap.native"),fh={};globalThis[Ll]||(globalThis[Ll]=fh);var ou=(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))(ou||{}),au=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(au||{}),su=(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))(su||{}),Dl=["name","params"],hh=["name","type","location","target","extra","timestamp","userId"],mh=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Un(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 ph(e){let t=e.location?Un(e.location,Dl):null,r=e.target?Un(e.target,Dl):null;return Un(th(eh({},e),{location:t,target:r}),hh)}function vh(e){let t=e.events.map(n=>ph(n)),r=Un(e.device,mh);return[e.protocolVersion,t,r,e.project]}function _h(){if(typeof window=="undefined")return{getItem:()=>null,setItem:()=>{},removeItem:()=>{},clear:()=>{},length:0,key:()=>null};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}}_h();var Mt=typeof window=="undefined",Nl=()=>!Mt&&!!(navigator.userAgent||"").includes("JoliboxPlatformSDK");!Mt&&(navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS")),!Mt&&navigator.userAgent.includes("Android"),!Mt&&navigator.userAgent.includes("Mac"),!Mt&&navigator.userAgent.includes("FB_IAB"),!Mt&&!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var ko=class To{constructor(t){this.element=t,this.next=To.Undefined,this.prev=To.Undefined}};ko.Undefined=new ko(void 0);var re=ko,gh=class{constructor(){this._first=re.Undefined,this._last=re.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===re.Undefined}clear(){let e=this._first;for(;e!==re.Undefined;){let t=e.next;e.prev=re.Undefined,e.next=re.Undefined,e=t}this._first=re.Undefined,this._last=re.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new re(e);if(this._first===re.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!==re.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==re.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==re.Undefined&&e.next!==re.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===re.Undefined&&e.next===re.Undefined?(this._first=re.Undefined,this._last=re.Undefined):e.next===re.Undefined?(this._last=this._last.prev,this._last.next=re.Undefined):e.prev===re.Undefined&&(this._first=this._first.next,this._first.prev=re.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==re.Undefined;)yield e.element,e=e.next}},yh=0,hr=class{constructor(e){this.value=e,this.id=yh++}},_r=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 hr&&(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 hr(e);return this._listeners?this._listeners instanceof hr?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,h,p;if(!this._disposed){if(this._listeners instanceof hr)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&&((p=(h=this.options)==null?void 0:h.onDidRemoveLastListener)==null||p.call(h)))}}}}),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 hr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},wh=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 _r,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 gh,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)}},xo={};rh(xo,{None:()=>bh,filter:()=>Ih,once:()=>lu,toPromise:()=>Eh});var bh=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Eh(e){return new Promise(t=>lu(e)(t))}function lu(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 Ih(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new _r(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 Io=Symbol.for("Jolibox.hostEmitter"),Ah=()=>{let e=new wh;return globalThis[Io]||(globalThis[Io]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Io]};Ah();function Sh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Ch(e[n],t[n])}function Ch(e,t){if(oh(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(lh(t)){try{if(e instanceof t)return}catch(r){}if(!sh(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 Po=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new _r,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 Sh(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}};Po=nu([iu],Po);var Ul=class{constructor(){this._onWillExecuteCommand=new _r,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new _r,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Po,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=ih(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 nh(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),xo.toPromise(xo.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{}}};Ul=nu([iu],Ul);function Ae(e,t,r){return(t=Rh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rh(e){var t=Oh(e,"string");return typeof t=="symbol"?t:t+""}function Oh(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 Nt=e=>e?function(){try{for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];e==null||e(...r)}catch(i){console.error("Error calling function",i)}}:()=>{console.log("wrapUserFunction: fn is undefined")},Lo=class{constructor(t){Ae(this,"context",void 0),Ae(this,"continueCallback",void 0),Ae(this,"adIsShowingCallback",void 0),Ae(this,"isBeforeAdCalled",!1),Ae(this,"isBeforeRewardCalled",!1),Ae(this,"isAdDismissedCalled",!1),Ae(this,"isAdViewedCalled",!1),Ae(this,"isAfterAdCalled",!1),Ae(this,"currentProvider",void 0),Ae(this,"currentClientParams",void 0),Ae(this,"adsHasResponse",!1),Ae(this,"videoChecker",window.document.createElement("video")),Ae(this,"contextInfo",void 0),Ae(this,"wrapShowAdFn",r=>()=>{var n,i,o;this.adsHasResponse=!0;let a=!1;this.videoChecker.play().catch(()=>{a=!1}),a=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:a},this.paramsToTrack)),this.notifyAdsEvent("JOLIBOX_AD_CALL_BEFORE_REWARD",Kf({userEvent:a},this.paramsToTrack)),Nl()&&this.context.track("mmp_ad_impression",{ad_network:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:"",ad_format:"rewarded",module:"game",game_id:this.contextInfo.objectId}),(o=this.adIsShowingCallback)==null||o.call(this,!0);let s=Nt(r);s==null||s()}),this.context=t,this.contextInfo=t.getContextInfo()}notifyAdsEvent(t,r){window.parent&&window.parent.postMessage({type:t,data:r},"*"),window.dispatchEvent(new CustomEvent(t,{detail:r}))}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,i,o;if(this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.notifyAdsEvent("JOLIBOX_AD_CALL_BEFORE_AD",this.paramsToTrack),!this.isBeforeAdCalled){this.isBeforeAdCalled=!0;let a=Nt(t);a==null||a(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0),Nl()&&this.context.track("mmp_ad_impression",{ad_network:(o=(i=this.currentProvider)==null?void 0:i.name)!=null?o:"",ad_format:"interstitial",module:"game",game_id:this.contextInfo.objectId}))}}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdDismissedCalled){this.isAdDismissedCalled=!0;let r=Nt(t);r==null||r()}}}wrapAdViewed(t){return()=>{if(this.adsHasResponse=!0,!this.isAdViewedCalled){this.isAdViewedCalled=!0;let r=Nt(t);r==null||r()}}}wrapAfterAd(t){return()=>{if(this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.notifyAdsEvent("JOLIBOX_AD_CALL_AFTER_AD",this.paramsToTrack),!this.isAfterAdCalled){this.isAfterAdCalled=!0;let r=Nt(t);r==null||r()}}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,u,d,y,h;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}),this.notifyAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_DONE",{provider:(s=(a=this.currentProvider)==null?void 0:a.name)!=null?s:null,breakType:r.breakType,breakName:(u=r.breakName)!=null?u:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{let p=Nt(t);p==null||p(r),(d=this.adIsShowingCallback)==null||d.call(this,!1),(y=this.continueCallback)==null||y.call(this,[!1,r]);break}default:{(h=this.continueCallback)==null||h.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return P(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,h,p,f;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),this.notifyAdsEvent("JOLIBOX_AD_CALL_AD_BREAK_TIMEOUT",{type:r.type,provider:(y=(d=this.currentProvider)==null?void 0:d.name)!=null?y:null}),(p=this.continueCallback)==null||p.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(h=r.name)!=null?h:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(f=this.adIsShowingCallback)==null||f.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),this.notifyAdsEvent("JOLIBOX_AD_CALL_AD_BREAK",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function Ln(e,t,r){return(t=kh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kh(e){var t=Th(e,"string");return typeof t=="symbol"?t:t+""}function Th(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 Do=class{constructor(t){Ln(this,"context",void 0),Ln(this,"adBreakIsShowing",!1),Ln(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),Ln(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()})}};function Dn(e,t,r){return(t=xh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function xh(e){var t=Ph(e,"string");return typeof t=="symbol"?t:t+""}function Ph(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){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 P(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 Xe(e,t,r){return(t=Lh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lh(e){var t=Dh(e,"string");return typeof t=="symbol"?t:t+""}function Dh(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,r){Xe(this,"name","ADSENSE"),Xe(this,"context",void 0),Xe(this,"contextInfo",void 0),Xe(this,"configured",!1),Xe(this,"initParams",void 0),Xe(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),Xe(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=zf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),Xe(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),Xe(this,"adUnit",n=>P(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:h,style:p}=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 b=d;if(b||(b=this.initParams.unitId),!b)throw new Error("slot is required");let I=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,C=document.createElement("ins");if(C.className="adsbygoogle",C.id="jolibox-ads",C.style.display="block",C.setAttribute("data-ad-client",this.initParams.clientId),C.setAttribute("data-ad-slot",b),I&&C.setAttribute("data-ad-format",I),h&&C.setAttribute("data-full-width-responsive",h),p&&C.setAttribute("style",p),(s=this.contextInfo.testAdsMode)!=null?s:!1){let w=document.createElement("div");w.style.position="absolute",w.style.top="0",w.style.left="0",w.style.width="100%",w.style.height="100%",w.style.display="flex",w.style.justifyContent="center",w.style.alignItems="center",w.style.backgroundColor="rgba(0, 0, 0, 0.5)",w.style.color="white",w.innerHTML="Test Ad",C.style.position="relative",f.appendChild(C),C.appendChild(w)}else f.appendChild(C),new MutationObserver(w=>{w.forEach(k=>{if(k.type==="attributes"&&k.attributeName==="data-ad-status"){let D=C.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:D!=null?D:"null"})}})}).observe(C,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return P(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&&i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),this.initParams.admobRewardedSlot&&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 Nh(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 Uh(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 Mh=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(Uh(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=Nh(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}(),we="-ms-",Hn="-moz-",V="-webkit-",uu="comm",Yo="rule",Xo="decl",Bh="@import",cu="@keyframes",Jh="@layer",Fh=Math.abs,Kn=String.fromCharCode,Gh=Object.assign;function jh(e,t){return pe(e,0)^45?(((t<<2^pe(e,0))<<2^pe(e,1))<<2^pe(e,2))<<2^pe(e,3):0}function du(e){return e.trim()}function Hh(e,t){return(e=t.exec(e))?e[0]:e}function $(e,t,r){return e.replace(t,r)}function Mo(e,t){return e.indexOf(t)}function pe(e,t){return e.charCodeAt(t)|0}function gr(e,t,r){return e.slice(t,r)}function Ge(e){return e.length}function Zo(e){return e.length}function Nn(e,t){return t.push(e),e}function Vh(e,t){return e.map(t).join("")}var zn=1,Ft=1,fu=0,Re=0,de=0,Gt="";function Qn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:zn,column:Ft,length:a,return:""}}function mr(e,t){return Gh(Qn("",null,null,"",null,null,0),e,{length:-e.length},t)}function $h(){return de}function qh(){return de=Re>0?pe(Gt,--Re):0,Ft--,de===10&&(Ft=1,zn--),de}function Le(){return de=Re<fu?pe(Gt,Re++):0,Ft++,de===10&&(Ft=1,zn++),de}function je(){return pe(Gt,Re)}function Mn(){return Re}function br(e,t){return gr(Gt,e,t)}function yr(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 hu(e){return zn=Ft=1,fu=Ge(Gt=e),Re=0,[]}function mu(e){return Gt="",e}function Bn(e){return du(br(Re-1,Bo(e===91?e+2:e===40?e+1:e)))}function Wh(e){for(;(de=je())&&de<33;)Le();return yr(e)>2||yr(de)>3?"":" "}function Kh(e,t){for(;--t&&Le()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return br(e,Mn()+(t<6&&je()==32&&Le()==32))}function Bo(e){for(;Le();)switch(de){case e:return Re;case 34:case 39:e!==34&&e!==39&&Bo(de);break;case 40:e===41&&Bo(e);break;case 92:Le();break}return Re}function zh(e,t){for(;Le()&&e+de!==57&&!(e+de===84&&je()===47););return"/*"+br(t,Re-1)+"*"+Kn(e===47?e:Le())}function Qh(e){for(;!yr(je());)Le();return br(e,Re)}function Yh(e){return mu(Jn("",null,null,null,[""],e=hu(e),0,[0],e))}function Jn(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,h=a,p=0,f=0,b=0,I=1,C=1,w=1,k=0,D="",G=i,H=o,S=n,N=D;C;)switch(b=k,k=Le()){case 40:if(b!=108&&pe(N,h-1)==58){Mo(N+=$(Bn(k),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:N+=Bn(k);break;case 9:case 10:case 13:case 32:N+=Wh(b);break;case 92:N+=Kh(Mn()-1,7);continue;case 47:switch(je()){case 42:case 47:Nn(Xh(zh(Le(),Mn()),t,r),u);break;default:N+="/"}break;case 123*I:s[d++]=Ge(N)*w;case 125*I:case 59:case 0:switch(k){case 0:case 125:C=0;case 59+y:w==-1&&(N=$(N,/\f/g,"")),f>0&&Ge(N)-h&&Nn(f>32?Bl(N+";",n,r,h-1):Bl($(N," ","")+";",n,r,h-2),u);break;case 59:N+=";";default:if(Nn(S=Ml(N,t,r,d,y,i,s,D,G=[],H=[],h),o),k===123)if(y===0)Jn(N,t,S,S,G,o,h,s,H);else switch(p===99&&pe(N,3)===110?100:p){case 100:case 108:case 109:case 115:Jn(e,S,S,n&&Nn(Ml(e,S,S,0,0,i,s,D,i,G=[],h),H),i,H,h,s,n?G:H);break;default:Jn(N,S,S,S,[""],H,0,s,H)}}d=y=f=0,I=w=1,D=N="",h=a;break;case 58:h=1+Ge(N),f=b;default:if(I<1){if(k==123)--I;else if(k==125&&I++==0&&qh()==125)continue}switch(N+=Kn(k),k*I){case 38:w=y>0?1:(N+="\f",-1);break;case 44:s[d++]=(Ge(N)-1)*w,w=1;break;case 64:je()===45&&(N+=Bn(Le())),p=je(),y=h=Ge(D=N+=Qh(Mn())),k++;break;case 45:b===45&&Ge(N)==2&&(I=0)}}return o}function Ml(e,t,r,n,i,o,a,s,u,d,y){for(var h=i-1,p=i===0?o:[""],f=Zo(p),b=0,I=0,C=0;b<n;++b)for(var w=0,k=gr(e,h+1,h=Fh(I=a[b])),D=e;w<f;++w)(D=du(I>0?p[w]+" "+k:$(k,/&\f/g,p[w])))&&(u[C++]=D);return Qn(e,t,r,i===0?Yo:s,u,d,y)}function Xh(e,t,r){return Qn(e,t,r,uu,Kn($h()),gr(e,2,-2),0)}function Bl(e,t,r,n){return Qn(e,t,r,Xo,gr(e,0,n),gr(e,n+1,-1),n)}function Jt(e,t){for(var r="",n=Zo(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Zh(e,t,r,n){switch(e.type){case Jh:if(e.children.length)break;case Bh:case Xo:return e.return=e.return||e.value;case uu:return"";case cu:return e.return=e.value+"{"+Jt(e.children,n)+"}";case Yo:e.value=e.props.join(",")}return Ge(r=Jt(e.children,n))?e.return=e.value+"{"+r+"}":""}function em(e){var t=Zo(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 tm(e){return function(t){t.root||(t=t.return)&&e(t)}}function rm(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var nm=function(e,t,r){for(var n=0,i=0;n=i,i=je(),n===38&&i===12&&(t[r]=1),!yr(i);)Le();return br(e,Re)},im=function(e,t){var r=-1,n=44;do switch(yr(n)){case 0:n===38&&je()===12&&(t[r]=1),e[r]+=nm(Re-1,t,r);break;case 2:e[r]+=Bn(n);break;case 4:if(n===44){e[++r]=je()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Kn(n)}while(n=Le());return e},om=function(e,t){return mu(im(hu(e),t))},Jl=new WeakMap,am=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&&!Jl.get(r))&&!n){Jl.set(e,!0);for(var i=[],o=om(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]}}},sm=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function pu(e,t){switch(jh(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+Hn+e+we+e+e;case 6828:case 4268:return V+e+we+e+e;case 6165:return V+e+we+"flex-"+e+e;case 5187:return V+e+$(e,/(\w+).+(:[^]+)/,V+"box-$1$2"+we+"flex-$1$2")+e;case 5443:return V+e+we+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return V+e+we+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return V+e+we+$(e,"shrink","negative")+e;case 5292:return V+e+we+$(e,"basis","preferred-size")+e;case 6060:return V+"box-"+$(e,"-grow","")+V+e+we+$(e,"grow","positive")+e;case 4554:return V+$(e,/([^-])(transform)/g,"$1"+V+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,V+"$1"),/(image-set)/,V+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,V+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,V+"box-pack:$3"+we+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+V+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,V+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Ge(e)-1-t>6)switch(pe(e,t+1)){case 109:if(pe(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+V+"$2-$3$1"+Hn+(pe(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Mo(e,"stretch")?pu($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(pe(e,t+1)!==115)break;case 6444:switch(pe(e,Ge(e)-3-(~Mo(e,"!important")&&10))){case 107:return $(e,":",":"+V)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+V+(pe(e,14)===45?"inline-":"")+"box$3$1"+V+"$2$3$1"+we+"$2box$3")+e}break;case 5936:switch(pe(e,t+11)){case 114:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return V+e+we+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return V+e+we+e+e}return e}var lm=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case Xo:e.return=pu(e.value,e.length);break;case cu:return Jt([mr(e,{value:$(e.value,"@","@"+V)})],n);case Yo:if(e.length)return Vh(e.props,function(i){switch(Hh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Jt([mr(e,{props:[$(i,/:(read-\w+)/,":"+Hn+"$1")]})],n);case"::placeholder":return Jt([mr(e,{props:[$(i,/:(plac\w+)/,":"+V+"input-$1")]}),mr(e,{props:[$(i,/:(plac\w+)/,":"+Hn+"$1")]}),mr(e,{props:[$(i,/:(plac\w+)/,we+"input-$1")]})],n)}return""})}},um=[lm],cm=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(b){var I=b.getAttribute("data-emotion");I.indexOf(" ")!==-1&&(document.head.appendChild(b),b.setAttribute("data-s",""))})}var n=e.stylisPlugins||um,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(b){for(var I=b.getAttribute("data-emotion").split(" "),C=1;C<I.length;C++)i[I[C]]=!0;a.push(b)});var s,u=[am,sm];{var d,y=[Zh,tm(function(b){d.insert(b)})],h=em(u.concat(n,y)),p=function(b){return Jt(Yh(b),h)};s=function(b,I,C,w){d=C,p(b?b+"{"+I.styles+"}":I.styles),w&&(f.inserted[I.name]=!0)}}var f={key:t,sheet:new Mh({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 dm(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 fm={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},hm=/[A-Z]|^ms/g,mm=/_EMO_([^_]+?)_([^]*?)_EMO_/g,vu=function(e){return e.charCodeAt(1)===45},Fl=function(e){return e!=null&&typeof e!="boolean"},Ao=rm(function(e){return vu(e)?e:e.replace(hm,"-$&").toLowerCase()}),Gl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(mm,function(r,n,i){return ut={name:n,styles:i,next:ut},n})}return fm[e]!==1&&!vu(e)&&typeof t=="number"&&t!==0?t+"px":t};function Vn(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 ut={name:i.name,styles:i.styles,next:ut},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)ut={name:a.name,styles:a.styles,next:ut},a=a.next;var s=o.styles+";";return s}return pm(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function pm(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Vn(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]+"}":Fl(s)&&(n+=Ao(o)+":"+Gl(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++)Fl(a[u])&&(n+=Ao(o)+":"+Gl(o,a[u])+";");else{var d=Vn(e,t,a);switch(o){case"animation":case"animationName":{n+=Ao(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var jl=/label:\s*([^\s;{]+)\s*(;|$)/g,ut;function So(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="";ut=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=Vn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Vn(r,t,e[s]),n){var u=o;i+=u[s]}jl.lastIndex=0;for(var d="",y;(y=jl.exec(i))!==null;)d+="-"+y[1];var h=dm(i)+d;return{name:h,styles:i,next:ut}}function _u(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var vm=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},_m=function(e,t,r){vm(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 Hl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function Vl(e,t,r){var n=[],i=_u(e,n,r);return n.length<2?r:i+t(n)}var gm=function(e){var t=cm(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=So(s,t.registered,void 0);return _m(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=So(s,t.registered),y="animation-"+d.name;return Hl(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=So(s,t.registered);Hl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return Vl(t.registered,r,ym(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:_u.bind(null,t.registered),merge:Vl.bind(null,t.registered,r)}},ym=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},wm=gm({key:"css"}),jt=wm.css,Jo,Pe,Co,$l,ql=0,gu=[],fe=B,Wl=fe.__b,Kl=fe.__r,zl=fe.diffed,Ql=fe.__c,Yl=fe.unmount,Xl=fe.__;function bm(e,t){fe.__h&&fe.__h(Pe,e,ql||t),ql=0;var r=Pe.__H||(Pe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function yu(e,t){var r=bm(Jo++,7);return Am(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Em(){for(var e;e=gu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Fn),e.__H.__h.forEach(Fo),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){Pe=null,Wl&&Wl(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Xl&&Xl(e,t)},fe.__r=function(e){Kl&&Kl(e),Jo=0;var t=(Pe=e.__c).__H;t&&(Co===Pe?(t.__h=[],Pe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(Fn),t.__h.forEach(Fo),t.__h=[],Jo=0)),Co=Pe},fe.diffed=function(e){zl&&zl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(gu.push(t)!==1&&$l===fe.requestAnimationFrame||(($l=fe.requestAnimationFrame)||Im)(Em)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Co=Pe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Fn),r.__h=r.__h.filter(function(n){return!n.__||Fo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),Ql&&Ql(e,t)},fe.unmount=function(e){Yl&&Yl(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Fn(n)}catch(i){t=i}}),r.__H=void 0,t&&fe.__e(t,r.__v))};var Zl=typeof requestAnimationFrame=="function";function Im(e){var t,r=function(){clearTimeout(n),Zl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Zl&&(t=requestAnimationFrame(r))}function Fn(e){var t=Pe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Pe=t}function Fo(e){var t=Pe;e.__c=e.__(),Pe=t}function Am(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var Sm=Symbol.for("preact-signals");function Yn(){if(ct>1)ct--;else{for(var e,t=!1;pr!==void 0;){var r=pr;for(pr=void 0,Go++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&bu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Go=0,ct--,t)throw e}}function Ce(e){if(ct>0)return e();ct++;try{return e()}finally{Yn()}}var Y=void 0,pr=void 0,ct=0,Go=0,$n=0;function wu(e){if(Y!==void 0){var t=e.n;if(t===void 0||t.t!==Y)return t={i:0,S:e,p:Y.s,n:void 0,t:Y,e:void 0,x:void 0,r:t},Y.s!==void 0&&(Y.s.n=t),Y.s=t,e.n=t,32&Y.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=Y.s,t.n=void 0,Y.s.n=t,Y.s=t),t}}function ve(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}ve.prototype.brand=Sm;ve.prototype.h=function(){return!0};ve.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)};ve.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)}};ve.prototype.subscribe=function(e){var t=this;return Ir(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};ve.prototype.valueOf=function(){return this.value};ve.prototype.toString=function(){return this.value+""};ve.prototype.toJSON=function(){return this.value};ve.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(ve.prototype,"value",{get:function(){var e=wu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Go>100)throw new Error("Cycle detected");this.v=e,this.i++,$n++,ct++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Yn()}}}});function X(e){return new ve(e)}function bu(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 Eu(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 Iu(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 Ht(e){ve.call(this,void 0),this.x=e,this.s=void 0,this.g=$n-1,this.f=4}(Ht.prototype=new ve).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===$n))return!0;if(this.g=$n,this.f|=1,this.i>0&&!bu(this))return this.f&=-2,!0;var e=Y;try{Eu(this),Y=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 Y=e,Iu(this),this.f&=-2,!0};Ht.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)}ve.prototype.S.call(this,e)};Ht.prototype.U=function(e){if(this.t!==void 0&&(ve.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)}};Ht.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(Ht.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=wu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function vr(e){return new Ht(e)}function Au(e){var t=e.u;if(e.u=void 0,typeof t=="function"){ct++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,ea(e),n}finally{Y=r,Yn()}}}function ea(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,Au(e)}function Cm(e){if(Y!==this)throw new Error("Out-of-order effect");Iu(this),Y=e,this.f&=-2,8&this.f&&ea(this),Yn()}function Er(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}Er.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()}};Er.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,Au(this),Eu(this),ct++;var e=Y;return Y=this,Cm.bind(this,e)};Er.prototype.N=function(){2&this.f||(this.f|=2,this.o=pr,pr=this)};Er.prototype.d=function(){this.f|=8,1&this.f||ea(this)};function Ir(e){var t=new Er(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Su,Ro,Cu=[];Ir(function(){Su=this.N})();function Vt(e,t){B[e]=t.bind(null,B[e]||function(){})}function qn(e){Ro&&Ro(),Ro=e&&e.S()}function Ru(e){var t=this,r=e.data,n=Ou(r);n.value=r;var i=yu(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=vr(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=vr(function(){return!Array.isArray(d.value)&&!uo(d.value)}),h=Ir(function(){if(this.N=ku,y.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),p=t.__$u.d;return t.__$u.d=function(){h(),p.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}Ru.displayName="_st";Object.defineProperties(ve.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Ru},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Vt("__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 ve&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Vt("__r",function(e,t){qn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return Ir(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),qn(r),e(t)});Vt("__e",function(e,t,r,n){qn(),e(t,r,n)});Vt("diffed",function(e,t){qn();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=Rm(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});function Rm(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=X(r);return{o:function(a,s){o.value=a,n=s},d:Ir(function(){this.N=ku;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Vt("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)});Vt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});xe.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 Ou(e){return yu(function(){return X(e)},[])}var Om=function(e){queueMicrotask(function(){queueMicrotask(e)})};function km(){Ce(function(){for(var e;e=Cu.shift();)Su.call(e)})}function ku(){Cu.push(this)===1&&(B.requestAnimationFrame||Om)(km)}var be=jt`
|
|
4
4
|
inset: 0;
|
|
5
5
|
clear: none;
|
|
6
6
|
float: none;
|
|
@@ -18,8 +18,8 @@ or `);this.errors.push(o)}return n}},An=class extends he{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
|
|
22
|
-
${
|
|
21
|
+
`;function Tm(e,t){let r=go(e);_o(()=>{r.current=e},[e]),cr(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}var xm=0;function le(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:--xm,__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 B.vnode&&B.vnode(d),d}var Pm=jt`
|
|
22
|
+
${be}
|
|
23
23
|
position: fixed;
|
|
24
24
|
top: 0;
|
|
25
25
|
left: 0;
|
|
@@ -32,7 +32,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
32
32
|
height: 100vh;
|
|
33
33
|
|
|
34
34
|
.card-wrapper {
|
|
35
|
-
${
|
|
35
|
+
${be}
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
38
38
|
flex-direction: column;
|
|
@@ -46,7 +46,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
46
46
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
47
47
|
|
|
48
48
|
.body {
|
|
49
|
-
${
|
|
49
|
+
${be}
|
|
50
50
|
display: flex;
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
width: 100%;
|
|
@@ -55,7 +55,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
.title {
|
|
58
|
-
${
|
|
58
|
+
${be}
|
|
59
59
|
text-align: center;
|
|
60
60
|
font-size: 16px;
|
|
61
61
|
font-weight: bold;
|
|
@@ -63,7 +63,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.content {
|
|
66
|
-
${
|
|
66
|
+
${be}
|
|
67
67
|
font-size: 14px;
|
|
68
68
|
color: #888;
|
|
69
69
|
margin-bottom: 16px;
|
|
@@ -71,13 +71,13 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.footer {
|
|
74
|
-
${
|
|
74
|
+
${be}
|
|
75
75
|
display: flex;
|
|
76
76
|
align-items: center;
|
|
77
77
|
width: 100%;
|
|
78
78
|
height: 40px;
|
|
79
79
|
button {
|
|
80
|
-
${
|
|
80
|
+
${be}
|
|
81
81
|
border: none;
|
|
82
82
|
outline: none;
|
|
83
83
|
height: 100%;
|
|
@@ -93,8 +93,8 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
97
|
-
${
|
|
96
|
+
`,tt=X(null),jo=X(""),Ho=X(""),Gn=X(!1),Lm=()=>{var e;(e=tt.value)==null||e.call(tt,!1)},Dm=()=>{var e;(e=tt.value)==null||e.call(tt,!0)},Nm=e=>P(void 0,null,function*(){let{title:t,content:r}=e;return tt.value&&(tt.value(!1),Ce(()=>{tt.value=null,Gn.value=!1})),Ce(()=>{jo.value=t||"",Ho.value=r||"",Gn.value=!0}),new Promise(n=>{tt.value=i=>{Ce(()=>{tt.value=null,Gn.value=!1,jo.value="",Ho.value=""}),n(i)}})}),Um=()=>Gn.value?le("div",{className:Pm,children:le("div",{className:"card-wrapper",children:[le("div",{className:"body",children:[le("div",{className:"title",children:jo.value}),le("div",{className:"content",children:Ho.value})]}),le("div",{className:"footer",children:[le("button",{onClick:Lm,className:"cancel-btn",children:"Cancel"}),le("button",{onClick:Dm,className:"confirm-btm",children:"Confirm"})]})]})}):null,Mm=jt`
|
|
97
|
+
${be}
|
|
98
98
|
position: relative;
|
|
99
99
|
display: flex;
|
|
100
100
|
align-items: center;
|
|
@@ -112,7 +112,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
button {
|
|
115
|
-
${
|
|
115
|
+
${be}
|
|
116
116
|
padding: 0 20px;
|
|
117
117
|
height: 30px;
|
|
118
118
|
line-height: 30px;
|
|
@@ -126,8 +126,8 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
126
126
|
cursor: not-allowed;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
`,
|
|
130
|
-
${
|
|
129
|
+
`,Bm=()=>{let e=X(!1),t=X(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Ce(()=>{t.value=Date.now(),e.value=!1})}}},Jm=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=Ou(t);Tm(()=>{s.value>0?s.value-=1:Ce(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let u=vr(()=>{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=vr(()=>{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=vr(()=>r==="interstitial"?!1:!u.value&&!d.value),h=()=>P(void 0,null,function*(){if(a.value=!0,!(yield Nm({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Ce(()=>{a.value=!0,s.value=0,o.value=null})}),p=()=>{n("viewed"),Ce(()=>{a.value=!0,s.value=0,o.value=null})};return le("div",{className:Mm,children:[s.value>0&&r!=="interstitial"&&le("div",{className:"timer",children:[s.value,"s"]}),le("button",{onClick:u.value?h:d.value?p:void 0,disabled:y.value,children:le("svg",{width:"12",height:"12",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:le("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"})})})]})},Fm=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(!1),a=X(15),s=X(""),u=X("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:u}},Gm=jt`
|
|
130
|
+
${be}
|
|
131
131
|
position: fixed;
|
|
132
132
|
z-index: 2147483647;
|
|
133
133
|
background: white;
|
|
@@ -137,7 +137,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
137
137
|
flex-direction: column;
|
|
138
138
|
|
|
139
139
|
iframe {
|
|
140
|
-
${
|
|
140
|
+
${be}
|
|
141
141
|
flex: 1;
|
|
142
142
|
position: relative;
|
|
143
143
|
display: block;
|
|
@@ -145,8 +145,8 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
145
145
|
width: 100%;
|
|
146
146
|
height: 100%;
|
|
147
147
|
}
|
|
148
|
-
`,
|
|
149
|
-
${
|
|
148
|
+
`,jm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:u,src:d,mode:y}=t,h=dr(()=>Bm(),[]),[p,f]=xn(!1),b=C=>{var w,k,D,G;s.value=!1,C==="dismiss"?(w=n.value)==null||w.call(n):C==="viewed"&&((k=i.value)==null||k.call(i)),(D=r.value)==null||D.call(r),(G=o.value)==null||G.call(o),f(!1)},I=yo(()=>{var C;p||(f(!0),(C=a.value)==null||C.call(a))},[p]);return cr(()=>{p&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{h.startTimer()},100)},[p,y.value]),s.value?le("div",{className:Gm,children:[le(Jm,{mode:y.value,onClose:b,countdown:u.value,state:h}),s.value&&le("iframe",{src:d.value,onLoad:I,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"}),le(Um,{})]}):null};function Ze(e,t,r){return(t=Hm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Hm(e){var t=Vm(e,"string");return typeof t=="symbol"?t:t+""}function Vm(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 Vo=class{constructor(t,r){Ze(this,"name","OKSPIN"),Ze(this,"initialized",!1),Ze(this,"initCompleter",null),Ze(this,"context",void 0),Ze(this,"initParams",void 0),Ze(this,"adsOverlay",null),Ze(this,"adsIsShowing",!1),Ze(this,"lastUnDisplayedAdBreak",null),Ze(this,"state",Fm()),this.context=t,this.initParams=r}init(){return P(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg"),Eo(le(jm,{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 P(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 h=()=>{var f;this.adsIsShowing=!1,(f=t.afterAd)==null||f.call(t)},p=()=>{var f;this.adsIsShowing=!1,(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})};Ce(()=>{this.adsIsShowing=!0,this.state.afterAd.value=h,this.state.adBreakDone.value=p,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 h=()=>{var w;this.adsIsShowing=!1,(w=t.afterAd)==null||w.call(t)},p={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},f=()=>{var w;this.adsIsShowing=!1,p.breakStatus="dismissed",(w=t.adDismissed)==null||w.call(t)},b=()=>{var w;this.adsIsShowing=!1,p.breakStatus="viewed",(w=t.adViewed)==null||w.call(t)},I=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,p)};Ce(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=f,this.state.adViewed.value=b,this.state.adBreakDone.value=I});let C=()=>{var w;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ce(()=>{var k;this.state.countdown.value=(k=r.params.countdown)!=null?k:15,this.state.src.value=r.params.url,this.state.mode.value="reward",this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,C);break}}})}},Bt={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Bt[e.data.type]&&Bt[e.data.type].forEach(t=>{t(e.data.data)})});var Ut=(e,t)=>{cr(()=>(Bt[e]||(Bt[e]=new Set),Bt[e].add(t),()=>{Bt[e].delete(t)}),[e,t])},$m=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(),a=X(),s=X(!1),u=X("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:u}},qm=jt`
|
|
149
|
+
${be}
|
|
150
150
|
position: fixed;
|
|
151
151
|
z-index: 2147483647;
|
|
152
152
|
background: white;
|
|
@@ -156,7 +156,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
156
156
|
flex-direction: column;
|
|
157
157
|
|
|
158
158
|
iframe {
|
|
159
|
-
${
|
|
159
|
+
${be}
|
|
160
160
|
flex: 1;
|
|
161
161
|
position: relative;
|
|
162
162
|
display: block;
|
|
@@ -164,8 +164,8 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
164
164
|
width: 100%;
|
|
165
165
|
height: 100%;
|
|
166
166
|
}
|
|
167
|
-
`,l_=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:l,src:u}=t,[p,f]=ii(!1),m=w=>{var E,A,b,C;f(!1),l.value=!1,w==="dismiss"?(E=n.value)==null||E.call(n):w==="viewed"&&((A=i.value)==null||A.call(i)),(b=r.value)==null||b.call(r),(C=o.value)==null||C.call(o)},h=()=>{var w;(w=a.value)==null||w.call(a)};return qt("appsrockets_ad_dismissed",()=>m("dismiss")),qt("appsrockets_ad_rewarded",()=>m("viewed")),qt("appsrockets_ad_completed",()=>m("viewed")),qt("appsrockets_ad_skipped",()=>m("viewed")),qt("appsrockets_ad_clicked",w=>{var E;return(E=s.value)==null?void 0:E.call(s,w)}),qt("appsrockets_ad_loaded",()=>f(!0)),l.value?de("div",{className:s_,style:{display:p?"flex":"none"},children:l.value&&de("iframe",{src:u.value,onLoad:h,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 ct(e,t,r){return(t=c_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function c_(e){var t=u_(e,"string");return typeof t=="symbol"?t:t+""}function u_(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 Na=class{constructor(t,r){ct(this,"name","APPSROCKETS"),ct(this,"initialized",!1),ct(this,"initCompleter",null),ct(this,"context",void 0),ct(this,"adsOverlay",null),ct(this,"adsIsShowing",!1),ct(this,"lastUnDisplayedAdBreak",null),ct(this,"state",a_()),ct(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 P(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),ua(de(l_,{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,l,u,p;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 f=m=>{var h,w;(w=(h=this.context).handleLinkClicked)==null||w.call(h,m)};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 m=()=>{var E;this.adsIsShowing=!1,(E=t.afterAd)==null||E.call(t)},h=()=>{var E;this.adsIsShowing=!1,(E=t.adBreakDone)==null||E.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},w=()=>{var E;this.adsIsShowing=!1,(E=t.adBreakDone)==null||E.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Pe(()=>{this.adsIsShowing=!0,this.state.afterAd.value=m,this.state.adBreakDone.value=h,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=f,this.state.adError.value=w,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((l=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||l.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),(u=t.beforeAd)==null||u.call(t);let m=()=>{var N;this.adsIsShowing=!1,(N=t.afterAd)==null||N.call(t)},h={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},w=()=>{var N;this.adsIsShowing=!1,h.breakStatus="dismissed",(N=t.adDismissed)==null||N.call(t)},E=()=>{var N;this.adsIsShowing=!1,h.breakStatus="viewed",(N=t.adViewed)==null||N.call(t)},A=()=>{var N;this.adsIsShowing=!1,(N=t.adBreakDone)==null||N.call(t,h)},b=()=>{this.adsIsShowing=!1,h.breakStatus="noAdPreloaded"};Pe(()=>{this.state.afterAd.value=m,this.state.adDismissed.value=w,this.state.adViewed.value=E,this.state.adBreakDone.value=A,this.state.adLinkClicked.value=f,this.state.adError.value=b});let C=()=>{var N;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(N=t.adBreakDone)==null||N.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Pe(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(p=t.beforeReward)==null||p.call(t,C);break}}}},Hu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function Ie(e,t,r){return(t=d_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d_(e){var t=f_(e,"string");return typeof t=="symbol"?t:t+""}function f_(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var La=class{constructor(t,r,n){Ie(this,"adUnit",void 0),Ie(this,"project",void 0),Ie(this,"keyValue",void 0),Ie(this,"adsContext",null),Ie(this,"rewardedSlot",null),Ie(this,"rewardedPayload",null),Ie(this,"readyEvent",null),Ie(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Ie(this,"init",()=>{var i;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(o=>{var a;(a=this.rewardedSlot)==null||a.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.rewardedSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),Ie(this,"destroy",i=>{var o,a;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(a=(o=this.adsContext)==null?void 0:o.adBreakDone)==null||a.call(o,i),this.adsContext=null}),Ie(this,"reinit",i=>{this.destroy(i),this.init()}),Ie(this,"handleSlotReady",i=>{i.slot===this.rewardedSlot&&(this.readyEvent=i)}),Ie(this,"handleSlotClosed",i=>{var o,a;if(this.adsContext&&i.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(a=(o=this.adsContext).afterAd)==null||a.call(o),this.withCommand(()=>{this.reinit(s)})}}),Ie(this,"handleSlotGranted",i=>{this.adsContext&&i.slot===this.rewardedSlot&&(this.rewardedPayload=i.payload)}),Ie(this,"handleSlotRenderEnded",i=>{i.slot===this.rewardedSlot&&i.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),Ie(this,"requestAds",i=>{this.withCommand(()=>{if(this.adsContext&&this.reinit("ignored"),this.rewardedSlot||this.init(),this.adsContext=i,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var o,a,s;(a=(o=this.adsContext)==null?void 0:o.beforeAd)==null||a.call(o),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let o=a=>{a.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",o),this.readyEvent=a,this.adsContext.beforeReward(()=>{var s,l,u;(l=(s=this.adsContext)==null?void 0:s.beforeAd)==null||l.call(s),(u=this.readyEvent)==null||u.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",o),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",o))},500)}})}),this.adUnit=t,this.project=r,this.keyValue=n,Hu(),this.withCommand(()=>{this.init()})}};function xe(e,t,r){return(t=h_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function h_(e){var t=m_(e,"string");return typeof t=="symbol"?t:t+""}function m_(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 Da=class{constructor(t,r,n){var i=this;xe(this,"adUnit",void 0),xe(this,"project",void 0),xe(this,"keyValue",void 0),xe(this,"adsContext",null),xe(this,"gamingInterstitialSlot",null),xe(this,"readyEvent",null),xe(this,"isRetrying",!1),xe(this,"withCommand",function(){googletag.cmd.push(...arguments)}),xe(this,"init",()=>{var o;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(a=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(a,this.keyValue[a])}),Object.keys(this.keyValue).includes("project")||(o=this.gamingInterstitialSlot)==null||o.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),xe(this,"destroy",function(o){var a,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(a=i.adsContext)==null?void 0:a.onEnd)==null||s.call(a,o),i.adsContext=null),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",i.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",i.handleSlotClosed),i.gamingInterstitialSlot&&(googletag.destroySlots([i.gamingInterstitialSlot]),i.gamingInterstitialSlot=null,i.readyEvent=null)}),xe(this,"reinit",function(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i.destroy(o,a),i.init()}),xe(this,"handleSlotReady",o=>{this.gamingInterstitialSlot===o.slot&&(this.readyEvent=o)}),xe(this,"handleSlotClosed",o=>{var a,s;this.adsContext&&this.gamingInterstitialSlot===o.slot&&((s=(a=this.adsContext).afterAd)==null||s.call(a),this.withCommand(()=>{this.reinit("viewed")}))}),xe(this,"requestAds",o=>{this.withCommand(()=>{var a,s,l;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=o,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((a=o.beforeAd)==null||a.call(o),this.readyEvent.makeGameManualInterstitialVisible()):((l=(s=this.adsContext).onEnd)==null||l.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),Hu(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function Ct(e,t,r){return(t=p_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function p_(e){var t=v_(e,"string");return typeof t=="symbol"?t:t+""}function v_(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 Ua=class{constructor(t,r){Ct(this,"name","GOOGLE_GPT"),Ct(this,"context",void 0),Ct(this,"contextInfo",void 0),Ct(this,"initParams",void 0),Ct(this,"rewardAdManager",void 0),Ct(this,"interstitialManager",void 0),Ct(this,"insertScript",()=>{let n="jolibox-google-gpt",i=document.getElementById(n);i||(i=window.document.createElement("script"),i.id=n,i.async=!0,i.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",i.crossOrigin="anonymous",document.head.appendChild(i))}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,this.insertScript()}init(){return P(this,null,function*(){let t=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,r=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,n=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;t&&(this.rewardAdManager=new La(t,n,this.initParams.keyValue)),r&&(this.interstitialManager=new Da(r,n,this.initParams.keyValue))})}adConfig(t,r){}adBreak(t,r){var n,i,o;switch(t.type){case"preroll":{(n=t.adBreakDone)==null||n.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(i=t.adBreakDone)==null||i.call(t,{breakName:t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:a})}});break}default:{if(!this.interstitialManager){(o=t.adBreakDone)==null||o.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:a})}});break}}}};function va(e,t,r){return(t=__(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function __(e){var t=g_(e,"string");return typeof t=="symbol"?t:t+""}function g_(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 Ma=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";va(this,"context",void 0),va(this,"placement","GAME"),va(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:yu.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:_u.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:gu.WebSDK};return xp(i)}};function Ce(e,t,r){return(t=y_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function y_(e){var t=b_(e,"string");return typeof t=="symbol"?t:t+""}function b_(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 yi=class{constructor(t){Ce(this,"context",void 0),Ce(this,"adsTrackSerializer",void 0),Ce(this,"contextInfo",void 0),this.context=t,this.contextInfo=t.getContextInfo(),this.adsTrackSerializer=new Ma(this.context)}getRequestContextData(t){var r,n;this.contextInfo=this.context.getContextInfo();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}}},Ba=class{constructor(t,r){var n=this;Ce(this,"context",void 0),Ce(this,"contextInfo",void 0),Ce(this,"requestContext",void 0),Ce(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),Ce(this,"pendingAFVAdsInfo",Promise.resolve(null)),Ce(this,"doFetchAdsInfo",i=>P(this,null,function*(){let o=i==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",a=i==="afv"?"REWARD_INTERSTITIAL":i==="reward"?"REWARD":"INTERSTITIAL",s=i==="afv"?void 0:"cached",{data:l,code:u}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(o),bizParams:this.requestContext.getRequestBizParams(),adsType:a,testAdsMode:this.contextInfo.testAdsMode,name:s}});return u==="SUCCESS"||u==="BYPASS_ADS"?{code:u,data:l}:null})),Ce(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),Ce(this,"cacheInterstitialInfo",i=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(i).catch(()=>null)}),Ce(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),Ce(this,"cacheNextAFGAdsInfo",i=>P(this,null,function*(){i==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(i)})),Ce(this,"getAFGAdsInfo",i=>P(this,null,function*(){let o=yield i==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(i),o})),Ce(this,"getAFVAdsInfo",function(){return P(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let i=yield n.pendingAFVAdsInfo;return n.cacheAFVInfo(),i}else return n.cacheAFVInfo(),yield n.pendingAFVAdsInfo})}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.requestContext=new yi(t),r!=null&&r.reward&&this.cacheRewardInfo(),r!=null&&r.interstitial&&this.cacheInterstitialInfo("start"),r!=null&&r.afv&&this.cacheAFVInfo()}};function Ge(e,t,r){return(t=w_(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function w_(e){var t=E_(e,"string");return typeof t=="symbol"?t:t+""}function E_(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 Br=class{constructor(t){if(Ge(this,"context",void 0),Ge(this,"contextInfo",void 0),Ge(this,"providers",{}),Ge(this,"channelPolicy",void 0),Ge(this,"adsActionDetection",void 0),Ge(this,"requestContext",void 0),Ge(this,"adsRequest",void 0),Ge(this,"initialized",!1),Ge(this,"adsIsShowing",!1),Ge(this,"lastAdBreak",void 0),Ge(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new Ia(this.context),this.adsActionDetection=new Ea(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new Ba(t),this.requestContext=new yi(t);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(t){return P(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"GOOGLE_GPT":{let i=new Ua(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"ADSENSE":case"ADSENSE_ADMOB":{let i=new Aa(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new Pa(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new Na(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return P(this,null,function*(){var r,n,i,o,a,s,l,u,p,f,m,h,w,E;let A=Date.now();if(A-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&&A-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=A,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 b=yield this.adsRequest.getAFGAdsInfo(t.type),C=b==null?void 0:b.data,N=b==null?void 0:b.code;if(N==="BYPASS_ADS"){switch(t.type){case"preroll":{(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{t.beforeReward(()=>{var B,V,S,D;(B=t.beforeAd)==null||B.call(t),(V=t.adViewed)==null||V.call(t),(S=t.afterAd)==null||S.call(t),(D=t.adBreakDone)==null||D.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(l=t.beforeAd)==null||l.call(t),(u=t.afterAd)==null||u.call(t),(p=t.adBreakDone)==null||p.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!C||N!=="SUCCESS"){(f=t.adBreakDone)==null||f.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let B=C.sort((x,M)=>x.seq-M.seq);if(B.length===0){(m=t.adBreakDone)==null||m.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let V=!0,S=null,D=new wa(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;B.length>0;){let x=B.shift(),M=this.providers[x.provider];if(M){let[$,q]=yield D.callAdBreakAndContinue(M,t,x,X=>{var Z;this.adsIsShowing=X,(Z=this.context.eventEmitter)==null||Z.emit("isAdShowing",X)});V=$,S=q}else V=!0,S={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!V)break}V&&S&&((h=t.adBreakDone)==null||h.call(t,S))}}catch(b){(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(E=this.context.eventEmitter)==null||E.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 GI=Xt`
|
|
168
|
-
${
|
|
167
|
+
`,Wm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,h]=xn(!1),p=b=>{var I,C,w,k;h(!1),u.value=!1,b==="dismiss"?(I=n.value)==null||I.call(n):b==="viewed"&&((C=i.value)==null||C.call(i)),(w=r.value)==null||w.call(r),(k=o.value)==null||k.call(o)},f=()=>{var b;(b=a.value)==null||b.call(a)};return Ut("appsrockets_ad_dismissed",()=>p("dismiss")),Ut("appsrockets_ad_rewarded",()=>p("viewed")),Ut("appsrockets_ad_completed",()=>p("viewed")),Ut("appsrockets_ad_skipped",()=>p("viewed")),Ut("appsrockets_ad_clicked",b=>{var I;return(I=s.value)==null?void 0:I.call(s,b)}),Ut("appsrockets_ad_loaded",()=>h(!0)),u.value?le("div",{className:qm,style:{display:y?"flex":"none"},children:u.value&&le("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 et(e,t,r){return(t=Km(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Km(e){var t=zm(e,"string");return typeof t=="symbol"?t:t+""}function zm(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 $o=class{constructor(t,r){et(this,"name","APPSROCKETS"),et(this,"initialized",!1),et(this,"initCompleter",null),et(this,"context",void 0),et(this,"adsOverlay",null),et(this,"adsIsShowing",!1),et(this,"lastUnDisplayedAdBreak",null),et(this,"state",$m()),et(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 P(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Eo(le(Wm,{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 h=p=>{var f,b;(b=(f=this.context).handleLinkClicked)==null||b.call(f,p)};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 I;this.adsIsShowing=!1,(I=t.afterAd)==null||I.call(t)},f=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},b=()=>{var I;this.adsIsShowing=!1,(I=t.adBreakDone)==null||I.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Ce(()=>{this.adsIsShowing=!0,this.state.afterAd.value=p,this.state.adBreakDone.value=f,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=h,this.state.adError.value=b,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 D;this.adsIsShowing=!1,(D=t.afterAd)==null||D.call(t)},f={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},b=()=>{var D;this.adsIsShowing=!1,f.breakStatus="dismissed",(D=t.adDismissed)==null||D.call(t)},I=()=>{var D;this.adsIsShowing=!1,f.breakStatus="viewed",(D=t.adViewed)==null||D.call(t)},C=()=>{var D;this.adsIsShowing=!1,(D=t.adBreakDone)==null||D.call(t,f)},w=()=>{this.adsIsShowing=!1,f.breakStatus="noAdPreloaded"};Ce(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=b,this.state.adViewed.value=I,this.state.adBreakDone.value=C,this.state.adLinkClicked.value=h,this.state.adError.value=w});let k=()=>{var D;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(D=t.adBreakDone)==null||D.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ce(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,k);break}}}},Tu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function ye(e,t,r){return(t=Qm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Qm(e){var t=Ym(e,"string");return typeof t=="symbol"?t:t+""}function Ym(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 qo=class{constructor(t,r,n){ye(this,"adUnit",void 0),ye(this,"project",void 0),ye(this,"keyValue",void 0),ye(this,"adsContext",null),ye(this,"rewardedSlot",null),ye(this,"rewardedPayload",null),ye(this,"readyEvent",null),ye(this,"withCommand",function(){googletag.cmd.push(...arguments)}),ye(this,"init",()=>{var i;this.rewardedSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.REWARDED),this.rewardedSlot&&(this.rewardedSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().addEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().addEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.keyValue&&(Object.keys(this.keyValue).forEach(o=>{var a;(a=this.rewardedSlot)==null||a.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.rewardedSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.rewardedSlot))}),ye(this,"destroy",i=>{var o,a;this.rewardedPayload=null,this.readyEvent=null,googletag.pubads().removeEventListener("rewardedSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("rewardedSlotClosed",this.handleSlotClosed),googletag.pubads().removeEventListener("rewardedSlotGranted",this.handleSlotGranted),googletag.pubads().removeEventListener("slotRenderEnded",this.handleSlotRenderEnded),this.rewardedSlot&&(googletag.destroySlots([this.rewardedSlot]),this.rewardedSlot=null),(a=(o=this.adsContext)==null?void 0:o.adBreakDone)==null||a.call(o,i),this.adsContext=null}),ye(this,"reinit",i=>{this.destroy(i),this.init()}),ye(this,"handleSlotReady",i=>{i.slot===this.rewardedSlot&&(this.readyEvent=i)}),ye(this,"handleSlotClosed",i=>{var o,a;if(this.adsContext&&i.slot===this.rewardedSlot){let s=this.rewardedPayload?"viewed":"dismissed";s==="viewed"?this.adsContext.adViewed():this.adsContext.adDismissed(),(a=(o=this.adsContext).afterAd)==null||a.call(o),this.withCommand(()=>{this.reinit(s)})}}),ye(this,"handleSlotGranted",i=>{this.adsContext&&i.slot===this.rewardedSlot&&(this.rewardedPayload=i.payload)}),ye(this,"handleSlotRenderEnded",i=>{i.slot===this.rewardedSlot&&i.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),ye(this,"requestAds",i=>{this.withCommand(()=>{if(this.adsContext&&this.reinit("ignored"),this.rewardedSlot||this.init(),this.adsContext=i,!this.rewardedSlot){this.reinit("notReady");return}if(this.readyEvent)this.adsContext.beforeReward(()=>{var o,a,s;(a=(o=this.adsContext)==null?void 0:o.beforeAd)==null||a.call(o),(s=this.readyEvent)==null||s.makeRewardedVisible()});else{let o=a=>{a.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",o),this.readyEvent=a,this.adsContext.beforeReward(()=>{var s,u,d;(u=(s=this.adsContext)==null?void 0:s.beforeAd)==null||u.call(s),(d=this.readyEvent)==null||d.makeRewardedVisible()}))};googletag.pubads().addEventListener("rewardedSlotReady",o),window.setTimeout(()=>{this.readyEvent||(this.reinit("timeout"),googletag.pubads().removeEventListener("rewardedSlotReady",o))},500)}})}),this.adUnit=t,this.project=r,this.keyValue=n,Tu(),this.withCommand(()=>{this.init()})}};function Se(e,t,r){return(t=Xm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Xm(e){var t=Zm(e,"string");return typeof t=="symbol"?t:t+""}function Zm(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,n){var i=this;Se(this,"adUnit",void 0),Se(this,"project",void 0),Se(this,"keyValue",void 0),Se(this,"adsContext",null),Se(this,"gamingInterstitialSlot",null),Se(this,"readyEvent",null),Se(this,"isRetrying",!1),Se(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Se(this,"init",()=>{var o;this.gamingInterstitialSlot=googletag.defineOutOfPageSlot(this.adUnit,googletag.enums.OutOfPageFormat.GAME_MANUAL_INTERSTITIAL),this.gamingInterstitialSlot&&(this.gamingInterstitialSlot.addService(googletag.pubads()),googletag.pubads().addEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().addEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.keyValue&&(Object.keys(this.keyValue).forEach(a=>{var s;(s=this.gamingInterstitialSlot)==null||s.setTargeting(a,this.keyValue[a])}),Object.keys(this.keyValue).includes("project")||(o=this.gamingInterstitialSlot)==null||o.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),Se(this,"destroy",function(o){var a,s;(!(arguments.length>1&&arguments[1]!==void 0)||arguments[1])&&((s=(a=i.adsContext)==null?void 0:a.onEnd)==null||s.call(a,o),i.adsContext=null),googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",i.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",i.handleSlotClosed),i.gamingInterstitialSlot&&(googletag.destroySlots([i.gamingInterstitialSlot]),i.gamingInterstitialSlot=null,i.readyEvent=null)}),Se(this,"reinit",function(o){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;i.destroy(o,a),i.init()}),Se(this,"handleSlotReady",o=>{this.gamingInterstitialSlot===o.slot&&(this.readyEvent=o)}),Se(this,"handleSlotClosed",o=>{var a,s;this.adsContext&&this.gamingInterstitialSlot===o.slot&&((s=(a=this.adsContext).afterAd)==null||s.call(a),this.withCommand(()=>{this.reinit("viewed")}))}),Se(this,"requestAds",o=>{this.withCommand(()=>{var a,s,u;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=o,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((a=o.beforeAd)==null||a.call(o),this.readyEvent.makeGameManualInterstitialVisible()):((u=(s=this.adsContext).onEnd)==null||u.call(s,"frequencyCapped"),this.adsContext=null,this.isRetrying||(this.isRetrying=!0,window.setTimeout(()=>{this.readyEvent||this.withCommand(()=>{this.reinit("frequencyCapped",!1)}),this.isRetrying=!1},31e3)))})}),Tu(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function wt(e,t,r){return(t=ep(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ep(e){var t=tp(e,"string");return typeof t=="symbol"?t:t+""}function tp(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 Ko=class{constructor(t,r){wt(this,"name","GOOGLE_GPT"),wt(this,"context",void 0),wt(this,"contextInfo",void 0),wt(this,"initParams",void 0),wt(this,"rewardAdManager",void 0),wt(this,"interstitialManager",void 0),wt(this,"insertScript",()=>{let n="jolibox-google-gpt",i=document.getElementById(n);i||(i=window.document.createElement("script"),i.id=n,i.async=!0,i.src="https://securepubads.g.doubleclick.net/tag/js/gpt.js",i.crossOrigin="anonymous",document.head.appendChild(i))}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,this.insertScript()}init(){return P(this,null,function*(){let t=this.contextInfo.testAdsMode?"/22639388115/rewarded_web_example":this.initParams.rewardedSlot,r=this.contextInfo.testAdsMode?"/6355419/Travel/Europe/France/Paris":this.initParams.interstitialSlot,n=`minigame-${this.contextInfo.runtimeType==="APP"?"app":"h5"}`;t&&(this.rewardAdManager=new qo(t,n,this.initParams.keyValue)),r&&(this.interstitialManager=new Wo(r,n,this.initParams.keyValue))})}adConfig(t,r){}adBreak(t,r){var n,i,o;switch(t.type){case"preroll":{(n=t.adBreakDone)==null||n.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{if(!this.rewardAdManager){(i=t.adBreakDone)==null||i.call(t,{breakName:t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:a})}});break}default:{if(!this.interstitialManager){(o=t.adBreakDone)==null||o.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:a=>{var s;(s=t.adBreakDone)==null||s.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:a})}});break}}}};function Oo(e,t,r){return(t=rp(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rp(e){var t=np(e,"string");return typeof t=="symbol"?t:t+""}function np(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 zo=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";Oo(this,"context",void 0),Oo(this,"placement","GAME"),Oo(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:su.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:ou.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:au.WebSDK};return vh(i)}};function Ie(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 Wn=class{constructor(t){Ie(this,"context",void 0),Ie(this,"adsTrackSerializer",void 0),Ie(this,"contextInfo",void 0),this.context=t,this.contextInfo=t.getContextInfo(),this.adsTrackSerializer=new zo(this.context)}getRequestContextData(t){var r,n;this.contextInfo=this.context.getContextInfo();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}}},Qo=class{constructor(t,r){var n=this;Ie(this,"context",void 0),Ie(this,"contextInfo",void 0),Ie(this,"requestContext",void 0),Ie(this,"pendingAFGAdsInfo",{REWARD:Promise.resolve(null),INTERSTITIAL:Promise.resolve(null)}),Ie(this,"pendingAFVAdsInfo",Promise.resolve(null)),Ie(this,"doFetchAdsInfo",i=>P(this,null,function*(){let o=i==="afv"?"AdsAFVSDKRequest":"AdsAFGSDKAdBreak",a=i==="afv"?"REWARD_INTERSTITIAL":i==="reward"?"REWARD":"INTERSTITIAL",s=i==="afv"?void 0:"cached",{data:u,code:d}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.requestContext.getRequestContextData(o),bizParams:this.requestContext.getRequestBizParams(),adsType:a,testAdsMode:this.contextInfo.testAdsMode,name:s}});return d==="SUCCESS"||d==="BYPASS_ADS"?{code:d,data:u}:null})),Ie(this,"cacheRewardInfo",()=>{this.pendingAFGAdsInfo.REWARD=this.doFetchAdsInfo("reward").catch(()=>null)}),Ie(this,"cacheInterstitialInfo",i=>{this.pendingAFGAdsInfo.INTERSTITIAL=this.doFetchAdsInfo(i).catch(()=>null)}),Ie(this,"cacheAFVInfo",()=>{this.pendingAFVAdsInfo=this.doFetchAdsInfo("afv").catch(()=>null)}),Ie(this,"cacheNextAFGAdsInfo",i=>P(this,null,function*(){i==="reward"?this.cacheRewardInfo():this.cacheInterstitialInfo(i)})),Ie(this,"getAFGAdsInfo",i=>P(this,null,function*(){let o=yield i==="reward"?this.pendingAFGAdsInfo.REWARD:this.pendingAFGAdsInfo.INTERSTITIAL;return this.cacheNextAFGAdsInfo(i),o})),Ie(this,"getAFVAdsInfo",function(){return P(this,arguments,function*(){if(!(arguments.length>0&&arguments[0]!==void 0)||arguments[0]){let i=yield n.pendingAFVAdsInfo;return n.cacheAFVInfo(),i}else return n.cacheAFVInfo(),yield n.pendingAFVAdsInfo})}),this.context=t,this.contextInfo=this.context.getContextInfo(),this.requestContext=new Wn(t),r!=null&&r.reward&&this.cacheRewardInfo(),r!=null&&r.interstitial&&this.cacheInterstitialInfo("start"),r!=null&&r.afv&&this.cacheAFVInfo()}};function Je(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 wr=class{constructor(t){if(Je(this,"context",void 0),Je(this,"contextInfo",void 0),Je(this,"providers",{}),Je(this,"channelPolicy",void 0),Je(this,"adsActionDetection",void 0),Je(this,"requestContext",void 0),Je(this,"adsRequest",void 0),Je(this,"initialized",!1),Je(this,"adsIsShowing",!1),Je(this,"lastAdBreak",void 0),Je(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new No(this.context),this.adsActionDetection=new Do(this.context),this.contextInfo=this.context.getContextInfo(),this.adsRequest=new Qo(t),this.requestContext=new Wn(t);else throw new Error("JoliboxAdsForGame requires a configuration object")}init(t){return P(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.requestContext.getRequestContextData("AdsAFGSDKInit"),bizParams:this.requestContext.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"GOOGLE_GPT":{let i=new Ko(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"ADSENSE":case"ADSENSE_ADMOB":{let i=new Uo(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new Vo(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new $o(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.adsRequest.cacheInterstitialInfo("start"),this.adsRequest.cacheRewardInfo(),this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return P(this,null,function*(){var r,n,i,o,a,s,u,d,y,h,p,f,b,I;let C=Date.now();if(C-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&&C-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=C,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 w=yield this.adsRequest.getAFGAdsInfo(t.type),k=w==null?void 0:w.data,D=w==null?void 0:w.code;if(D==="BYPASS_ADS"){switch(t.type){case"preroll":{(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"viewed"});break}case"reward":{t.beforeReward(()=>{var G,H,S,N;(G=t.beforeAd)==null||G.call(t),(H=t.adViewed)==null||H.call(t),(S=t.afterAd)==null||S.call(t),(N=t.adBreakDone)==null||N.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"viewed"})});break}default:{(u=t.beforeAd)==null||u.call(t),(d=t.afterAd)==null||d.call(t),(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"});break}}return}if(!k||D!=="SUCCESS"){(h=t.adBreakDone)==null||h.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let G=k.sort((T,M)=>T.seq-M.seq);if(G.length===0){(p=t.adBreakDone)==null||p.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let H=!0,S=null,N=new Lo(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;G.length>0;){let T=G.shift(),M=this.providers[T.provider];if(M){let[W,K]=yield N.callAdBreakAndContinue(M,t,T,ee=>{var he;this.adsIsShowing=ee,(he=this.context.eventEmitter)==null||he.emit("isAdShowing",ee)});H=W,S=K}else H=!0,S={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!H)break}H&&S&&((f=t.adBreakDone)==null||f.call(t,S))}}catch(w){(b=t.adBreakDone)==null||b.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(I=this.context.eventEmitter)==null||I.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 Iw=jt`
|
|
168
|
+
${be}
|
|
169
169
|
position: fixed;
|
|
170
170
|
left: 0;
|
|
171
171
|
top: 0;
|
|
@@ -180,7 +180,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.ads-wrapper {
|
|
183
|
-
${
|
|
183
|
+
${be}
|
|
184
184
|
position: relative;
|
|
185
185
|
width: 100%;
|
|
186
186
|
height: 100%;
|
|
@@ -203,7 +203,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
.retry-button {
|
|
206
|
-
${
|
|
206
|
+
${be}
|
|
207
207
|
position: absolute;
|
|
208
208
|
width: 100%;
|
|
209
209
|
height: 100%;
|
|
@@ -213,7 +213,7 @@ or `);this.errors.push(o)}return n}},An=class extends he{constructor(...t){super
|
|
|
213
213
|
cursor: pointer;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
`;ae();var SA=Fi(Vu());var Hr=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){var r,n;(n=(r=this.ads)==null?void 0:r.adConfig)==null||n.call(r,t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var Gr=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,l,u,p;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&t.data&&t.data.type==null){let f=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${f.type}`),f.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",f);break;case"huawei_quick_ads_on_message_ad_config":{let m=f.callbackId;if(m){let h=this.callbackMap.get(m);(r=h==null?void 0:h.onReady)==null||r.call(h)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",f)}break;case"huawei_quick_ads_on_message_ad_break":{let m=f.callbackId;if(m){let h=this.callbackMap.get(m),w="noAdPreloaded",E=!1;switch(f.adsRes){case"viewed":w="viewed",(n=h==null?void 0:h.adViewed)==null||n.call(h),E=!1;break;case"dismissed":w="dismissed",(i=h==null?void 0:h.adDismissed)==null||i.call(h),E=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":w=f.adsRes,E=!0;break;case"breakDone":w=f.params,E=!0;break;case"beforeReward":(o=h==null?void 0:h.beforeReward)==null||o.call(h,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),E=!1;break;case"beforeAd":(a=h==null?void 0:h.beforeAd)==null||a.call(h),E=!1;break;case"afterAd":(s=h==null?void 0:h.afterAd)==null||s.call(h),E=!1;break}E&&((p=h==null?void 0:h.adBreakDone)==null||p.call(h,{breakType:(l=h.breakType)!=null?l:"",breakName:h.breakName,breakFormat:(u=h.breakFormat)!=null?u:"interstitial",breakStatus:w}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",f)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",f);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=G(G({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 Vr=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,l,u;(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(),(u=t.adBreakDone)==null||u.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:(l=i==null?void 0:i.args)!=null&&l.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 kt=class{constructor(t,r){this.ads=t;this.httpClient=r}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return P(this,null,function*(){var r;if(t.type==="reward")try{let n=yield ot.getRewardsTypes(this.httpClient);yield ot.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)}};var $r=class e extends kt{constructor(t,r){super(t,r),this.startTimes=Date.now()}adBreak(t){return P(this,null,function*(){var r,n;if(t.type!=="reward"){if(t.type==="preroll"){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let i=Date.now();if(console.log("FunmaxAdsHandler time => ",i-this.startTimes),i-this.startTimes<4e4){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}gs(e.prototype,this,"adBreak").call(this,t)})}};var Va=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new Hr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Gr.getInstance();break}case"gamedistribution":{this.cacheHandler=Vr.getInstance();break}case"funmax":{let r=new Br(this.context);this.cacheHandler=new $r(r,qr);break}default:{let r=new Br(this.context);this.cacheHandler=new kt(r,qr);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Ai=_e(),$u=new Je,qr=He.create(),I_={httpClient:qr,checkNetwork:()=>He.getNetworkStatus(),track:Fe,eventEmitter:$u,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,l;return{hostAppId:(t=(e=O.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=O.deviceInfo.did)!=null?r:"",adId:(n=O.deviceInfo.adId)!=null?n:"",sessionId:(i=O.sessionId)!=null?i:"",userId:(a=(o=O.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:O.mpId,testAdsMode:O.testAdsMode,channel:(s=O.joliSource)!=null?s:"",deviceBrand:O.deviceInfo.brand,deviceModel:O.deviceInfo.model,osType:Re.isAndroid?"ANDROID":Re.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(l=O.joliSource)!=null?l:""}}},qu=e=>{It("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},A_=new Va(I_),Kr=A_.getAdsHandler(O.sdkEnvironment);ot.registerRewardHandler("ADS",Il(Kr.getAdsInstance()));ot.registerRewardHandler("JOLI_COIN",ec(qr,{onUnlockSuccess:qu.bind(void 0)}));ot.registerRewardHandler("JOLI_COIN_ONLY",tc(qr,{onUnlockSuccess:qu.bind(void 0)}));$u.on("isAdShowing",e=>{It("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Ai.registerCommand("AdsSDK.init",e=>{Kr.init(e)});Ai.registerCommand("AdsSDK.adConfig",e=>{Kr.adConfig(e)});Ai.registerCommand("AdsSDK.adBreak",e=>{Kr.adBreak(e)});Ai.registerCommand("AdsSDK.adUnit",e=>{Kr.adUnit(e)});F();pt();var Ku=_e();Ku.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Fe("loadFinished",{duration:e})});Ku.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});F();pt();var Zu=-1,Ri=function(e){addEventListener("pageshow",function(t){t.persisted&&(Zu=t.timeStamp,e(t))},!0)},qa=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Oi=function(){var e=qa();return e&&e.activationStart||0},rr=function(e,t){var r=qa(),n="navigate";return Zu>=0?n="back-forward-cache":r&&(document.prerendering||Oi()>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}},ed=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){}},nr=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,l){return s>l[1]?"poor":s>l[0]?"needs-improvement":"good"}(t.value,r),e(t))}},td=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},rd=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},nd=function(e){var t=!1;return function(){t||(e(),t=!0)}},tr=-1,Wu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Si=function(e){document.visibilityState==="hidden"&&tr>-1&&(tr=e.type==="visibilitychange"?e.timeStamp:0,S_())},zu=function(){addEventListener("visibilitychange",Si,!0),addEventListener("prerenderingchange",Si,!0)},S_=function(){removeEventListener("visibilitychange",Si,!0),removeEventListener("prerenderingchange",Si,!0)},id=function(){return tr<0&&(tr=Wu(),zu(),Ri(function(){setTimeout(function(){tr=Wu(),zu()},0)})),{get firstHiddenTime(){return tr}}},Ka=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Qu=[1800,3e3],od=function(e,t){t=t||{},Ka(function(){var r,n=id(),i=rr("FCP"),o=ed("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Oi(),0),i.entries.push(s),r(!0)))})});o&&(r=nr(e,i,Qu,t.reportAllChanges),Ri(function(a){i=rr("FCP"),r=nr(e,i,Qu,t.reportAllChanges),td(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var R_=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=nd(e),document.visibilityState==="hidden"?e():(r=t(e),rd(e)),r};var Yu=[2500,4e3],$a={},ad=function(e,t){t=t||{},Ka(function(){var r,n=id(),i=rr("LCP"),o=function(l){t.reportAllChanges||(l=l.slice(-1)),l.forEach(function(u){u.startTime<n.firstHiddenTime&&(i.value=Math.max(u.startTime-Oi(),0),i.entries=[u],r())})},a=ed("largest-contentful-paint",o);if(a){r=nr(e,i,Yu,t.reportAllChanges);var s=nd(function(){$a[i.id]||(o(a.takeRecords()),a.disconnect(),$a[i.id]=!0,r(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return R_(s)},{once:!0,capture:!0})}),rd(s),Ri(function(l){i=rr("LCP"),r=nr(e,i,Yu,t.reportAllChanges),td(function(){i.value=performance.now()-l.timeStamp,$a[i.id]=!0,r(!0)})})}})},Xu=[800,1800],O_=function e(t){document.prerendering?Ka(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},sd=function(e,t){t=t||{};var r=rr("TTFB"),n=nr(e,r,Xu,t.reportAllChanges);O_(function(){var i=qa();i&&(r.value=Math.max(i.responseStart-Oi(),0),r.entries=[i],n(!0),Ri(function(){r=rr("TTFB",0),(n=nr(e,r,Xu,t.reportAllChanges))(!0)}))})};ae();Nt();$e();function C_(){od(e=>{Fe("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),ad(e=>{Fe("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),sd(e=>{Fe("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function k_(){return P(this,null,function*(){let e=He.create();try{let t=yield e.get("/api/users/info");return!(t.code!=="SUCCESS"||!t.data)}catch(t){return Oe(new en(t)),!1}})}function T_(){Xe.on("onDocumentReady",e=>P(this,null,function*(){let t=yield k_();O.onEnvConfigChanged({hostUserInfo:{isLogin:t}}),Xe.emit("LifecycleEvent.onReady",G({},O.hostUserInfo?O.hostUserInfo:{isLogin:!1})),O.mpType==="game"&&et.start(Date.now()-e)}))}function ld(){T_(),C_()}ld();
|
|
216
|
+
`;me();var ob=pi(Pu());var Ar=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){var r,n;(n=(r=this.ads)==null?void 0:r.adConfig)==null||n.call(r,t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var Sr=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&&t.data&&t.data.type==null){let h=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${h.type}`),h.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",h);break;case"huawei_quick_ads_on_message_ad_config":{let p=h.callbackId;if(p){let f=this.callbackMap.get(p);(r=f==null?void 0:f.onReady)==null||r.call(f)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",h)}break;case"huawei_quick_ads_on_message_ad_break":{let p=h.callbackId;if(p){let f=this.callbackMap.get(p),b="noAdPreloaded",I=!1;switch(h.adsRes){case"viewed":b="viewed",(n=f==null?void 0:f.adViewed)==null||n.call(f),I=!1;break;case"dismissed":b="dismissed",(i=f==null?void 0:f.adDismissed)==null||i.call(f),I=!1;break;case"notReady":case"timeout":case"error":case"noAdPreloaded":case"frequencyCapped":case"ignored":case"other":b=h.adsRes,I=!0;break;case"breakDone":b=h.params,I=!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")}),I=!1;break;case"beforeAd":(a=f==null?void 0:f.beforeAd)==null||a.call(f),I=!1;break;case"afterAd":(s=f==null?void 0:f.afterAd)==null||s.call(f),I=!1;break}I&&((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:b}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",h)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",h);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=Q(Q({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 bt=class{constructor(t,r){this.ads=t;this.httpClient=r}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return P(this,null,function*(){var r;if(t.type==="reward")try{let n=yield Qe.getRewardsTypes(this.httpClient);yield Qe.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)}};var Rr=class e extends bt{constructor(t,r){super(t,r),this.startTimes=Date.now()}adBreak(t){return P(this,null,function*(){var r,n;if(t.type!=="reward"){if(t.type==="preroll"){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}let i=Date.now();if(console.log("FunmaxAdsHandler time => ",i-this.startTimes),i-this.startTimes<4e4){(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakFormat:"interstitial",breakStatus:"noAdPreloaded"});return}}xa(e.prototype,this,"adBreak").call(this,t)})}};var ra=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new Ar(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=Sr.getInstance();break}case"gamedistribution":{this.cacheHandler=Cr.getInstance();break}case"funmax":{let r=new wr(this.context);this.cacheHandler=new Rr(r,Or);break}default:{let r=new wr(this.context);this.cacheHandler=new bt(r,Or);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},Xn=_e(),Lu=new Fe,Or=Be.create(),lp={httpClient:Or,checkNetwork:()=>Be.getNetworkStatus(),track:Te,eventEmitter:Lu,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=L.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=L.deviceInfo.did)!=null?r:"",adId:(n=L.deviceInfo.adId)!=null?n:"",sessionId:(i=L.sessionId)!=null?i:"",userId:(a=(o=L.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:L.mpId,testAdsMode:L.testAdsMode,channel:(s=L.joliSource)!=null?s:"",deviceBrand:L.deviceInfo.brand,deviceModel:L.deviceInfo.model,osType:Ee.isAndroid?"ANDROID":Ee.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=L.joliSource)!=null?u:""}}},Du=e=>{pt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e}),Te("jolicoin_unlock_success",{quantity:e.quantity})},up=new ra(lp),kr=up.getAdsHandler(L.sdkEnvironment);Qe.registerRewardHandler("ADS",Ms(kr.getAdsInstance()));Qe.registerRewardHandler("JOLI_COIN",Fs(Or,{onUnlockSuccess:Du.bind(void 0)}));Qe.registerRewardHandler("JOLI_COIN_ONLY",Gs(Or,{onUnlockSuccess:Du.bind(void 0)}));Lu.on("isAdShowing",e=>{pt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});Xn.registerCommand("AdsSDK.init",e=>{kr.init(e)});Xn.registerCommand("AdsSDK.adConfig",e=>{kr.adConfig(e)});Xn.registerCommand("AdsSDK.adBreak",e=>{kr.adBreak(e)});Xn.registerCommand("AdsSDK.adUnit",e=>{kr.adUnit(e)});j();ot();var Nu=_e();Nu.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{let e=performance.now();Te("loadFinished",{duration:e})});Nu.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});j();ot();var Gu=-1,ei=function(e){addEventListener("pageshow",function(t){t.persisted&&(Gu=t.timeStamp,e(t))},!0)},ia=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},ti=function(){var e=ia();return e&&e.activationStart||0},qt=function(e,t){var r=ia(),n="navigate";return Gu>=0?n="back-forward-cache":r&&(document.prerendering||ti()>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}},ju=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){}},Wt=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))}},Hu=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Vu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},$u=function(e){var t=!1;return function(){t||(e(),t=!0)}},$t=-1,Uu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Zn=function(e){document.visibilityState==="hidden"&&$t>-1&&($t=e.type==="visibilitychange"?e.timeStamp:0,cp())},Mu=function(){addEventListener("visibilitychange",Zn,!0),addEventListener("prerenderingchange",Zn,!0)},cp=function(){removeEventListener("visibilitychange",Zn,!0),removeEventListener("prerenderingchange",Zn,!0)},qu=function(){return $t<0&&($t=Uu(),Mu(),ei(function(){setTimeout(function(){$t=Uu(),Mu()},0)})),{get firstHiddenTime(){return $t}}},oa=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},Bu=[1800,3e3],Wu=function(e,t){t=t||{},oa(function(){var r,n=qu(),i=qt("FCP"),o=ju("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-ti(),0),i.entries.push(s),r(!0)))})});o&&(r=Wt(e,i,Bu,t.reportAllChanges),ei(function(a){i=qt("FCP"),r=Wt(e,i,Bu,t.reportAllChanges),Hu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var dp=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=$u(e),document.visibilityState==="hidden"?e():(r=t(e),Vu(e)),r};var Ju=[2500,4e3],na={},Ku=function(e,t){t=t||{},oa(function(){var r,n=qu(),i=qt("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-ti(),0),i.entries=[d],r())})},a=ju("largest-contentful-paint",o);if(a){r=Wt(e,i,Ju,t.reportAllChanges);var s=$u(function(){na[i.id]||(o(a.takeRecords()),a.disconnect(),na[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return dp(s)},{once:!0,capture:!0})}),Vu(s),ei(function(u){i=qt("LCP"),r=Wt(e,i,Ju,t.reportAllChanges),Hu(function(){i.value=performance.now()-u.timeStamp,na[i.id]=!0,r(!0)})})}})},Fu=[800,1800],fp=function e(t){document.prerendering?oa(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},zu=function(e,t){t=t||{};var r=qt("TTFB"),n=Wt(e,r,Fu,t.reportAllChanges);fp(function(){var i=ia();i&&(r.value=Math.max(i.responseStart-ti(),0),r.entries=[i],n(!0),ei(function(){r=qt("TTFB",0),(n=Wt(e,r,Fu,t.reportAllChanges))(!0)}))})};me();Rt();$e();function hp(){Wu(e=>{Te("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Ku(e=>{Te("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),zu(e=>{Te("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function mp(){return P(this,null,function*(){let e=Be.create();try{let t=yield e.get("/api/users/info");return!(t.code!=="SUCCESS"||!t.data)}catch(t){return ke(new Ur(t)),!1}})}function pp(){ft.on("onDocumentReady",e=>P(this,null,function*(){let t=yield mp();L.onEnvConfigChanged({hostUserInfo:{isLogin:t}}),ft.emit("LifecycleEvent.onReady",Q({},L.hostUserInfo?L.hostUserInfo:{isLogin:!1})),L.mpType==="game"&&We.start(Date.now()-e)}))}function Qu(){pp(),hp()}Qu();
|
|
217
217
|
/*! Bundled license information:
|
|
218
218
|
|
|
219
219
|
localforage/dist/localforage.js:
|