@jolibox/implement 1.1.38 → 1.1.39
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 +26 -15
- package/dist/common/rewards/registers/utils/coins/commands/index.d.ts +3 -0
- package/dist/common/rewards/registers/utils/coins/commands/use-jolicoin.d.ts +16 -0
- package/dist/common/rewards/registers/utils/coins/commands/use-payment.d.ts +16 -0
- package/dist/common/rewards/registers/utils/coins/commands/use-unlogin.d.ts +18 -0
- package/dist/common/rewards/registers/utils/coins/fetch-balance.d.ts +4 -0
- package/dist/common/rewards/registers/utils/coins/index.d.ts +3 -17
- package/dist/common/rewards/registers/utils/coins/rewards-command.d.ts +1 -0
- package/dist/common/rewards/registers/utils/common.d.ts +8 -0
- package/dist/common/rewards/registers/utils/event-listener.d.ts +1 -0
- package/dist/common/rewards/reward-emitter.d.ts +30 -4
- package/dist/common/utils/index.d.ts +19 -0
- package/dist/index.js +25 -25
- package/dist/index.native.js +132 -46
- package/dist/native/api/login.d.ts +20 -0
- package/dist/native/rewards/check-frequency.d.ts +13 -16
- package/dist/native/rewards/index.d.ts +3 -1
- package/dist/native/rewards/ui/payment-modal.d.ts +1 -0
- package/dist/native/rewards/ui/unlogin-modal.d.ts +1 -0
- package/dist/native/rewards/ui/use-modal.d.ts +1 -0
- package/dist/native/rewards/ui/utils.d.ts +6 -0
- package/implement.build.log +2 -2
- package/package.json +5 -5
- package/src/common/rewards/fetch-reward.ts +6 -3
- package/src/common/rewards/registers/use-jolicoin-only.ts +13 -13
- package/src/common/rewards/registers/use-jolicoin.ts +15 -11
- package/src/common/rewards/registers/utils/coins/commands/index.ts +3 -0
- package/src/common/rewards/registers/utils/coins/commands/use-jolicoin.ts +67 -0
- package/src/common/rewards/registers/utils/coins/commands/use-payment.ts +85 -0
- package/src/common/rewards/registers/utils/coins/commands/use-unlogin.ts +96 -0
- package/src/common/rewards/registers/utils/coins/fetch-balance.ts +15 -0
- package/src/common/rewards/registers/utils/coins/index.ts +45 -99
- package/src/common/rewards/registers/utils/coins/rewards-command.ts +3 -0
- package/src/common/rewards/registers/utils/common.ts +8 -0
- package/src/common/rewards/registers/utils/event-listener.ts +13 -0
- package/src/common/rewards/reward-emitter.ts +33 -4
- package/src/common/rewards/reward-helper.ts +3 -3
- package/src/common/utils/index.ts +20 -0
- package/src/h5/bootstrap/index.ts +20 -2
- package/src/h5/rewards/index.ts +29 -1
- package/src/native/api/ads.ts +17 -7
- package/src/native/api/login.ts +62 -32
- package/src/native/rewards/check-frequency.ts +46 -84
- package/src/native/rewards/index.ts +3 -370
- package/src/native/rewards/ui/payment-modal.ts +254 -0
- package/src/native/rewards/ui/unlogin-modal.ts +121 -0
- package/src/native/rewards/ui/use-modal.ts +104 -0
- package/src/native/rewards/ui/utils.ts +25 -0
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
var Ec=Object.create;var qn=Object.defineProperty,Ac=Object.defineProperties,Ic=Object.getOwnPropertyDescriptor,Sc=Object.getOwnPropertyDescriptors,Rc=Object.getOwnPropertyNames,gr=Object.getOwnPropertySymbols,kc=Object.getPrototypeOf,Kn=Object.prototype.hasOwnProperty,oa=Object.prototype.propertyIsEnumerable;var ia=(e,t,r)=>t in e?qn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,z=(e,t)=>{for(var r in t||(t={}))Kn.call(t,r)&&ia(e,r,t[r]);if(gr)for(var r of gr(t))oa.call(t,r)&&ia(e,r,t[r]);return e},pe=(e,t)=>Ac(e,Sc(t));var Bt=(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 aa=(e,t)=>{var r={};for(var n in e)Kn.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&gr)for(var n of gr(e))t.indexOf(n)<0&&oa.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var Wn=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Tc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Rc(t))!Kn.call(e,i)&&i!==r&&qn(e,i,{get:()=>t[i],enumerable:!(n=Ic(t,i))||n.enumerable});return e};var zn=(e,t,r)=>(r=e!=null?Ec(kc(e)):{},Tc(t||!e||!e.__esModule?qn(r,"default",{value:e,enumerable:!0}):r,e));var L=(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 Mc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function ni(e){return typeof e=="string"}function ma(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function pa(e){return typeof e=="object"&&Array.isArray(e)}function Bc(e){return typeof e=="undefined"}function Fc(e){return Bc(e)||e===null}function jc(e){return typeof e=="function"}function va(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function _a(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:ua(u)&&ua(s)?i[a]=n(fa({},s),u):Array.isArray(u)&&Array.isArray(s)?i[a]=[...s,...u]:i[a]=u}return i}return n(e,t)}function ua(e){return e&&typeof e=="object"&&e.constructor===Object}function ga(e,t){if(Array.isArray(e))return e.concat(t)}function Ht(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(...m){i=m,o=this;let v=s&&!n;if(n&&clearTimeout(n),n=setTimeout(()=>{n=null,u&&!v&&d()},t),v)return d()};return y.cancel=()=>{n&&clearTimeout(n),n=null,i=o=void 0},y.flush=()=>{if(n)return clearTimeout(n),n=null,d()},y}function Jc(e,t){return(...r)=>t(e,...r)}function Aa(e){return t=>Jc(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new Hc(`${i}`))}})}function Ft(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function yr(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 zc(e){let t=e.location?yr(e.location,da):null,r=e.target?yr(e.target,da):null;return yr(Nc(fa({},e),{location:t,target:r}),Kc)}function li(e){let t=e.events.map(n=>zc(n)),r=yr(e.device,Wc);return[e.protocolVersion,t,r,e.project]}function Qc(){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 ad(e){return new Promise(t=>Ra(e)(t))}function Ra(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function sd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new Vt(i);return o.event})((r,n=null)=>e(i=>t(i)&&r.call(n,i),null))}function ud(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)cd(e[n],t[n])}function cd(e,t){if(ni(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(jc(t)){try{if(e instanceof t)return}catch(r){}if(!Fc(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 dd(){return typeof globalThis!="undefined"?globalThis[ka]:void 0}function fd(e){typeof globalThis!="undefined"&&(globalThis[ka]=e)}function Ee(){let e=dd();if(e)return e;let t=new br,r=new ti,n={registerCommand(i,o,a){t.registerCommand({id:i,handler:o,metadata:a})},executeCommand(i,...o){return r.executeCommand(i,...o)},excuteCommandSync(i,...o){return r.executeCommandThowErr(i,...o)}};return fd(n),n}var ri,xc,Cc,Oc,sa,Pc,Dc,la,fa,Nc,Lc,ha,Uc,Vc,ii,oi,ya,ba,Hc,wa,Ea,wr,ai,Pe,Yn,$c,si,ca,Gc,nt,mt,qc,da,Kc,Wc,pt,Yc,we,Xc,Zc,ed,Ia,ui,ci,td,rd,Sa,Xn,ee,nd,id,jt,Vt,Ne,ei,od,Qn,ld,Jt,br,ti,ka,H=Z(()=>{"use strict";ri=Object.defineProperty,xc=Object.defineProperties,Cc=Object.getOwnPropertyDescriptor,Oc=Object.getOwnPropertyDescriptors,sa=Object.getOwnPropertySymbols,Pc=Object.prototype.hasOwnProperty,Dc=Object.prototype.propertyIsEnumerable,la=(e,t,r)=>t in e?ri(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,fa=(e,t)=>{for(var r in t||(t={}))Pc.call(t,r)&&la(e,r,t[r]);if(sa)for(var r of sa(t))Dc.call(t,r)&&la(e,r,t[r]);return e},Nc=(e,t)=>xc(e,Oc(t)),Lc=(e,t)=>{for(var r in t)ri(e,r,{get:t[r],enumerable:!0})},ha=(e,t,r,n)=>{for(var i=n>1?void 0:n?Cc(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&&ri(t,r,i),i},Uc=(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}Vc=(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))(Vc||{}),ii=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}},oi=class extends ii{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},ya=class extends ii{constructor(){super(...arguments),this.kind="USER_ERROR"}},ba=class extends ya{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Hc=class extends ya{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))}},wa=class extends oi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Ea=class extends oi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},wr=class extends ii{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}}},ai=class extends oi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};Pe={log:Ft("log"),warn:Ft("warn"),info:Ft("info"),error:Ft("error"),debug:Ft("debug")};Object.assign(globalThis,{logger:Pe});Yn=Symbol.for("Jolibox.canIUseMap"),$c={};globalThis[Yn]||(globalThis[Yn]=$c);si={get config(){return globalThis[Yn]}},ca=Symbol.for("Jolibox.canIUseMap.native"),Gc={};globalThis[ca]||(globalThis[ca]=Gc);nt=(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))(nt||{}),mt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(mt||{}),qc=(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))(qc||{}),da=["name","params"],Kc=["name","type","location","target","extra","timestamp","userId"],Wc=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];pt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});Qc();Yc=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),we={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},Xc=()=>we.isiOS?"iOS":we.isAndroid?"Android":we.isMac?"Mac":we.isFacebook?"Facebook":"PC",Zc="device_id",ed="advertising_id",Ia=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,pt()),window.__joliboxLocalStorage__.getItem(e)),ui=()=>new URLSearchParams(window.location.search).get("deviceId")||Ia(Zc),ci=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ia(ed),td=e=>e.charAt(0).toUpperCase()+e.slice(1),rd=()=>{var e;let t=new URLSearchParams(window.location.search);return td((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Sa=e=>{if(Yc())return window.navigator.userAgent;let t="JoliboxWebSDK",r=Xc(),n=navigator.language,i=ui(),o=ci();return`${t} (${rd()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},Xn=class Zn{constructor(t){this.element=t,this.next=Zn.Undefined,this.prev=Zn.Undefined}};Xn.Undefined=new Xn(void 0);ee=Xn,nd=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},id=0,jt=class{constructor(e){this.value=e,this.id=id++}},Vt=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 jt&&(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 jt(t);return this._listeners?this._listeners instanceof jt?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,m,v,f;if(!this._disposed){if(this._listeners instanceof jt)this._listeners.id===d.id&&(this._listeners=void 0,this._size=0,(m=(y=this.options)==null?void 0:y.onDidRemoveLastListener)==null||m.call(y));else if(this._listeners){let E=this._listeners.indexOf(d);E>=0&&(this._listeners.splice(E,1),this._size--,this._size===0&&((f=(v=this.options)==null?void 0:v.onDidRemoveLastListener)==null||f.call(v)))}}}}),this._event}_deliver(e,t){var r;if(!e)return;let n=((r=this.options)==null?void 0:r.onListenerError)||Error.constructor;if(!n){e.value(t);return}try{e.value(t)}catch(i){n(i)}}fire(e){this._listeners&&(this._listeners instanceof jt?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Ne=class{constructor(){this.listeners=new Map,this.listerHandlerMap=new WeakMap,this.cachedEventQueue=new Map}on(e,t,r=!0){var n;let i=(n=this.listeners.get(e))!=null?n:new Vt,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 nd,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)}},ei={};Lc(ei,{None:()=>od,filter:()=>sd,once:()=>Ra,toPromise:()=>ad});od=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});Qn=Symbol.for("Jolibox.hostEmitter"),ld=()=>{let e=new Ne;return globalThis[Qn]||(globalThis[Qn]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[Qn]},Jt=ld();br=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new Vt,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 ud(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}};br=ha([va],br);ti=class{constructor(){this._onWillExecuteCommand=new Vt,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new Vt,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new br,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Mc(3e4)),this._starActivation}executeCommand(e,...t){return Uc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),ei.toPromise(ei.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}}};ti=ha([va],ti);ka=Symbol.for("Jolibox.commands")});function De(e,t={}){di.emit("ERROR_REPORT",{error:e,options:t})}var di,it,Xe=Z(()=>{"use strict";H();H();di=new Ne,it=new Ne;De.debounce=Ht(De,50,{leading:!0})});var fi,hd,Ta,xa,Ca=Z(()=>{"use strict";H();Xe();fi=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{}}},hd=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},Ta=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:fi(o),payloadJson:fi(a),signature:fi(s)}}else throw"joli_source is missing"}catch(r){return De(new wa(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},xa=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=hd(e),o=r[2];return`${n}.${i}.${o}`}return t}});var md,Er,Oa,hi=Z(()=>{"use strict";H();md="1.1.38",Er=()=>md,Oa=()=>{let e=Er();return`${Sa(e)}`}});function Pa(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var pd,Da,mi,Na,oe,vd,N,Ae=Z(()=>{"use strict";H();Ca();hi();H();pd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:ui(),adId:ci(),pixelRatio:window.devicePixelRatio||1,platform:we.isAndroid?"android":we.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Er()},schema:window.location.href,platform:we.isAndroid?"android":we.isiOS?"ios":"h5"},mi=(Da=globalThis.joliboxJSCore)==null?void 0:Da.env,oe=Object.assign({},(Na=mi==null?void 0:mi())!=null?Na:pd);vd=()=>{var f,E,w,S,b,x,P,V,X,R,D;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?Ta(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.schema:window.location.href).searchParams,a=(w=(E=(f=o.get("mpId"))!=null?f:o.get("appId"))!=null?E:o.get("gameId"))!=null?w:"",s=(x=(b=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?b:o.get("sessionId"))!=null?x:n,u=!!((V=(P=e==null?void 0:e.testAdsMode)!=null?P:e==null?void 0:e.__testAdsMode)!=null?V:o.get("testAdsMode")==="true"),d=(D=(R=(X=e==null?void 0:e.joliboxEnv)!=null?X:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?D:"production",y=d==="staging",m=t==null?void 0:t.channel,v=e==null?void 0:e.__shouldInterupt;return{get testMode(){return y},get testAdsMode(){return u},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:Er()},get mpType(){var O,B;return(B=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,B;return(B=(O=oe.clientSessionId)!=null?O:s)!=null?B:n},get channel(){return m},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-1},get shouldInterupt(){return v},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return Pa("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":Pa("gamedistribution","jolibox")?"gamedistribution":"jolibox"},get viewport(){var W,ne,be;let O=(W=oe.deviceInfo.pixelRatio)!=null?W:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,K=(be=oe.deviceInfo.navigationBarHeight)!=null?be:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/O:20,navigationBarHeight:K!==void 0?K/O:10}},onEnvConfigChanged:O=>{_a(oe,O,ga)},encodeJoliSourceQuery:O=>{var B,K;return t&&r?xa(z(z({},e),O),(B=o.get("joliSource"))!=null?B:""):(K=o.get("joliSource"))!=null?K:""},setDoExitDirectly:()=>{v=!1}}},N=vd()});var pi,Ua,_d,gd,La,yd,Ma=Z(()=>{"use strict";H();Xe();Ae();H();pi=!1,Ua=(e,t)=>e==null?!1:t in e,_d=e=>Ua(e,"kind"),gd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},La=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=N.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:gd(e.name)},i=pe(z({},n),{env:t.environment,isFromUser:r});r?it.emit("GLOBAL_USER_ERROR",e,i):it.emit("GLOBAL_ERROR",e,i)},yd=e=>Ua(e,"kind")&&e.kind==="USER_ERROR";di.on("ERROR_REPORT",({error:e,options:t})=>{if(pi)return;pi=!0;let r=_d(e)&&e.raw?e.raw:e;try{let n=yd(e);La(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new ai(`${i}, origin error: ${r.message}`);Pe.error(o),La(new ai(o.message),{environment:t.environment},!1)}finally{pi=!1}})});var vi,_i=Z(()=>{"use strict";Xe();H();Xe();vi=e=>new ba(e)});function Ba(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=aa(d,["eventType"]),u=pe(z({tag:n,eventType:a!=null?a:nt.Other},t),{extra:z({},s)});n=="globalJsError"?De(new Ea(JSON.stringify(u))):e("systemLog",u,o)};return r.debounce=Ht(r,500,{leading:!0}),r}function Fa(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=Ht(t,500,{leading:!0}),t}var ja=Z(()=>{"use strict";H();H();Xe()});function Va(e,t){let r=Ba(e,t),n=Fa(r);return{track:r,trackPerformance:n}}var Ha=Z(()=>{"use strict";ja()});var gi=Z(()=>{"use strict"});var Ar,Ja=Z(()=>{"use strict";Ae();H();H();Ar=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return L(this,null,function*(){let r=`${N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=N.sdkInfo;return{platform:1e3,os:N.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=N.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=N.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=N.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:N.deviceInfo.did,jsSdkVersion:r,extra:{}}}getLocation(){let t=new URLSearchParams(window.location.search),r={};return t.forEach((n,i)=>{r[i]=n}),{name:"GamePage",params:r}}trackEvent(t,r,n){return L(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:[pe(z({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(li(d),n):yield this.doReport(li(d))}catch(y){Pe.log("[Jolibox SDK] report API error",y)}})}}});var yi=Z(()=>{"use strict";Ha();gi();Ja()});var bi,$a,Ve,Ir,He,$t=Z(()=>{"use strict";hi();Ae();H();bi=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};($a=AbortSignal.timeout)!=null||(AbortSignal.timeout=bi);Ve=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 Ir(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},Ir=class{constructor(t){this.xua=Oa();this.getJoliSource=()=>N.joliSource;var n;let r=N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return L(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 m=yield fetch(u,{method:"GET",headers:o,credentials:"include",signal:bi(i!=null?i:3e4)});return Ve.getInstance().recordNetworkRequest(!0),yield m.json()}catch(n){throw Ve.getInstance().recordNetworkRequest(!1),n}})}post(t,r){return L(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,m=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},m?{"x-joli-source":m}:{},{"x-os-type":we.isAndroid?"ANDROID":we.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let v=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:bi(o!=null?o:3e4),credentials:"include"});Ve.getInstance().recordNetworkRequest(!0);let f=v.headers.get("content-type");if(f!=null&&f.includes("application/octet-stream"))try{return v.blob()}catch(E){return yield v.arrayBuffer()}if(f!=null&&f.includes("multipart/form-data")||f!=null&&f.includes("application/x-www-form-urlencoded"))try{return v.formData()}catch(E){return yield v.text()}if(f!=null&&f.includes("application/json"))try{return yield v.json()}catch(E){return yield v.text()}return v}catch(n){throw Ve.getInstance().recordNetworkRequest(!1),n}})}put(t,r){return L(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,m=this.getJoliSource();a=Object.assign({},a!=null?a:{},{"Content-Type":"application/json"},y?{"x-user-agent":y}:{},m?{"x-joli-source":m}:{});let v=yield fetch(d,{method:"PUT",headers:a,credentials:"include",body:JSON.stringify(n!=null?n:{})});if(!v.ok)throw Ve.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${v.status}`);return Ve.getInstance().recordNetworkRequest(!0),yield v.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=Ir;He=Ve.getInstance()});var wi,Sr,Ei=Z(()=>{"use strict";Ae();yi();$t();wi=class extends Ar{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=He.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=N.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Sr=new wi});var bd,Ga=Z(()=>{"use strict";Ma();H();_i();H();Ei();Ae();bd=(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:nt.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Sr.trackEvent(n,mt.WebSDK)};it.on("GLOBAL_ERROR",(e,t)=>{bd(t.tag,e)});it.on("GLOBAL_USER_ERROR",(e,t)=>{Pe.log("UserError",e,t)})});var Rr,qa=Z(()=>{"use strict";Rr=class{constructor(t,r){this.eventEmitter=t;this.lastReportTime=0;this.visible=!0;this.timer=this.createRAFTimer(t=>{this.reporter({event:"PLAY_GAME",params:{duration:t}}),this.tracker("PlayGame",{duration:t})});this.interval=r!=null?r:5*1e3,t.on("visible",n=>{this.visible=n})}start(t){this.reporter({event:"OPEN_GAME",params:{timestamp:Date.now(),duration:t!=null?t:0}}),this.tracker("OpenGame",{duration:t!=null?t:0}),this.timer.start()}close(t){this.reporter({event:"CLOSE_GAME",params:{timestamp:Date.now(),duration:t}}),this.tracker("CloseGame",{duration:t}),this.timer.stop()}createRAFTimer(t){let r=Date.now(),n,i,o=!1,a=0,s=()=>{if(!o)return;let f=Date.now(),E=f-r;E>=this.interval&&(this.visible&&(a+=Math.min(E,this.interval+1e3),t(a)),r=f),n=requestAnimationFrame(s)},u=()=>{y(),r=Date.now(),i=window.setInterval(()=>{if(!o)return;let f=Date.now();f-r>=this.interval&&(r=f)},this.interval)},d=()=>{m(),r=Date.now(),n=requestAnimationFrame(s)},y=()=>{n&&(cancelAnimationFrame(n),n=0)},m=()=>{i&&(clearInterval(i),i=0)};this.eventEmitter.on("visible",f=>{o&&(console.log("visible",f),f?d():u())});let v=this.visible;return{start(){o||(o=!0,v?d():u())},stop(){o=!1,y(),m()}}}}});var kr,Ka=Z(()=>{"use strict";Ae();qa();$t();kr=class extends Rr{constructor(r,n,i){super(n,i);this.httpClient=He.create();this.gameId=N.mpId,this.sessionId=N.sessionId,this.track=r}reporter(r){return L(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:z({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var Wa,wd,Le,Ed,Ai,ot,at=Z(()=>{"use strict";Ga();H();H();yi();Ei();Ka();Ae();gi();Wa=Ee(),wd={type:mt.WebSDK,platform:"h5",jssdk_version:N.sdkInfo.jssdkVersion,mp_id:N.mpId,mp_version:N.mpVersion},{track:Le,trackPerformance:Ed}=Va((...e)=>{var a,s,u,d;let[,t]=e,r=t,n=ma(r.extra)?r.extra:ni(r.extra)?JSON.parse(r.extra):{},i=pe(z({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:nt.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(u=N.hostUserInfo)==null?void 0:u.uid)!=null?d:null};Sr.trackEvent(o,mt.WebSDK)},wd);Wa.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Ed(e,t,r)});Wa.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Le(e,t)});Ai=new Ne,ot=new kr(Le,Ai)});function za(e){let t=si.config[e];return t||(t={},si.config[e]=t),(r,n)=>{if(t[r]){Pe.warn(`[can i use] ${r} already registered`);return}t[r]=z({},n)}}var Qa=Z(()=>{"use strict";H()});function Ii(e){Ya=e}function Tr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Tr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Tr(e[r]),t),{})}function Je(e){return typeof e=="number"}function Si(e){let t=Ri(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Ri(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var Ya,ue,xr,Cr,Or,Pr,vt,Dr,Nr,Lr,Ur,Mr,Br,Fr,jr,Vr,Hr,Jr,$r,ki=Z(()=>{"use strict";Ya=!1;ue=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(Ya)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 ${Si(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Tr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Tr(this._default)}optional(){return this._optional=!0,this}};xr=class extends ue{validate(t){return this._optional&&t===void 0?!0:Je(t)?Je(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):Je(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):Je(this._greater)&&t<=this._greater?this.fail(`the value of ${this.path} should be greater than ${this._greater}`):this._isInt&&t!==Math.floor(t)?this.fail(`the value of ${this.path} should be integer but got ${t}`):!0:this.fail({expect:"number",actual:t})}min(t){return this._min=t,this}max(t){return this._max=t,this}isInt(t){return this._isInt=t,this}greater(t){return this._greater=t,this}},Cr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Or=class extends ue{validate(t){if(this._optional&&t===void 0)return!0;if(typeof t!="string")return this.fail({expect:"string",actual:t});if(Je(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(Je(this._minLength)&&t.length<this._minLength)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minLength}`);if(typeof this._pattern=="string"){if(!new RegExp(this._pattern).test(t))return this.fail(`${this.path} should match pattern "${this._pattern}"`)}else if(this._pattern&&!this._pattern.test(t))return this.fail(`${this.path} should match pattern "${this._pattern.toString()}"`);return!0}minLength(t){return this._minLength=t,this}maxLength(t){return this._maxLength=t,this}pattern(t){return this._pattern=t,this}},Pr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},vt=class extends ue{validate(t){return!0}},Dr=class extends ue{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},Nr=class extends ue{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Lr=class extends ue{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Ur=class extends ue{constructor(...t){super(),this._items=t}validate(t){if(this._optional&&t===void 0)return!0;if(!this._items.includes(t)){let r=this._items.map(n=>JSON.stringify(n)).join(", ");return this.fail(`expect ${this.path} to be one of ${r}, but got ${Si(t)}`)}return!0}},Mr=class extends ue{constructor(r){super();this._item=r}validate(r){if(this._optional&&r===void 0)return!0;if(!Array.isArray(r))return this.fail({expect:"array",actual:r});if(Je(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(Je(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(Je(this._length)&&r.length!==this._length)return this.fail(`the length of ${this.path} should be equal to ${this._length}`);let n=this._item;if(!n)return!0;let 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}},Br=class extends ue{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ri(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}},Fr=class extends ue{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Ri(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}},jr=class extends ue{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Si(this.value),actual:r}):!0}},Vr=class extends ue{constructor(...t){super(),this._items=t}validate(t){if(t===void 0&&this._optional)return!0;let r=[],n=!1,i=this._items.length;for(let o=0;o<i;o++){let a=this._items[o];if(a.errors=[],a.path=this.path,!a.validate(t))r.push(a.errors.join("; "));else if(!n){n=!0;break}}if(!n){let o=r.join(`
|
|
2
|
-
or `);this.errors.push(o)}return n}},
|
|
3
|
-
`);throw e.errors.length=0,Ii(!1),new TypeError(n)}}var F,xi=Z(()=>{"use strict";ki();ki();F={object(e){return new Fr(e)},array(e){return new Mr(e)},tuple(...e){return new Hr(...e)},literal(e){return new jr(e)},or(...e){return new Vr(...e)},symbol(){return new Pr},record(e){return new Br(e)},function(){return new Lr},boolean(){return new Cr},string(){return new Or},number(){return new xr},undefined(){return new Dr},null(){return new Nr},unknown(){return new vt},any(){return new vt},as(){return new vt},arraybuffer(){return new Jr},enum(...e){return new Ur(...e)},typedarray(e){return new $r(e)}}});var Gr,Xa,Za=Z(()=>{"use strict";H();Xe();xi();_i();Gr=1,Xa=e=>{function t(n,i){return(...o)=>{var m,v,f,E;let a=Date.now(),s={method:n,trace_id:Gr};Gr+=1;let u="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Ti(i.paramsSchema,o,"params")}catch(x){throw vi(`${n}:fail ${x.message}`)}let w=i.implement(...o),S=w,b=`${n}:ok`;if(w&&"code"in w){let{code:x,data:P,message:V}=w;u=x,S=P,b=V}return{code:u,message:b,data:S}}catch(w){let S=w;y=(v=(m=S.code)!=null?m:S.errNo)!=null?v:2e3,u="FAILURE";let b=(E=(f=S.message)!=null?f:S.errMsg)!=null?E:`${w}`;return d=`${n}:${u} ${b.replace(/^\S+:(fail|cancel)\s?/,"")}`,De(new wr(d,y)),{code:u,message:d}}finally{let w=Date.now()-a;e("apiInvoked",pe(z({},s),{duration:w,status:u}))}}}function r(n,i){return(...o)=>L(this,null,function*(){var v,f,E,w;let a=pa(o)?o:[o],s=Date.now(),u={method:n,trace_id:Gr};Gr+=1;let d=`${n}:ok`,y="SUCCESS",m={code:y,message:d};try{if(i.paramsSchema)try{Ti(i.paramsSchema,a,"params")}catch(x){throw vi(x.message)}let b=yield i.implement(...a);if(b&&"code"in b){let{code:x,data:P,message:V}=b;y=x,d=V,b=P}return Object.assign(m,{code:y,message:d,data:b}),m}catch(S){let b=S,x=(f=(v=b.code)!=null?v:b.errNo)!=null?f:2e3;y="FAILURE";let P=(w=(E=b.message)!=null?E:b.errMsg)!=null?w:`${S}`,V=`${n}:${y} ${P.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(m,{code:y,message:V}),De(new wr(V,x)),m}finally{let S=Date.now()-s;e("apiInvoked",pe(z({},u),{duration:S,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var $e,st,ve,Gt=Z(()=>{"use strict";Qa();at();Za();xi();({createAPI:$e,createSyncAPI:st}=Xa(Le)),ve=za("h5")});var ns=Wn((rs,Di)=>{(function(e){if(typeof rs=="object"&&typeof Di!="undefined")Di.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,m){if(!o[y]){if(!i[y]){var v=typeof Bt=="function"&&Bt;if(!m&&v)return v(y,!0);if(u)return u(y,!0);var f=new Error("Cannot find module '"+y+"'");throw f.code="MODULE_NOT_FOUND",f}var E=o[y]={exports:{}};i[y][0].call(E.exports,function(w){var S=i[y][1][w];return s(S||w)},E,E.exports,n,i,o,a)}return o[y].exports}for(var u=typeof Bt=="function"&&Bt,d=0;d<a.length;d++)s(a[d]);return s}({1:[function(n,i,o){(function(a){"use strict";var s=a.MutationObserver||a.WebKitMutationObserver,u;if(s){var d=0,y=new s(w),m=a.document.createTextNode("");y.observe(m,{characterData:!0}),u=function(){m.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var v=new a.MessageChannel;v.port1.onmessage=w,u=function(){v.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?u=function(){var b=a.document.createElement("script");b.onreadystatechange=function(){w(),b.onreadystatechange=null,b.parentNode.removeChild(b),b=null},a.document.documentElement.appendChild(b)}:u=function(){setTimeout(w,0)};var f,E=[];function w(){f=!0;for(var b,x,P=E.length;P;){for(x=E,E=[],b=-1;++b<P;)x[b]();P=E.length}f=!1}i.exports=S;function S(b){E.push(b)===1&&!f&&u()}}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{}],2:[function(n,i,o){"use strict";var a=n(1);function s(){}var u={},d=["REJECTED"],y=["FULFILLED"],m=["PENDING"];i.exports=v;function v(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=m,this.queue=[],this.outcome=void 0,R!==s&&S(this,R)}v.prototype.catch=function(R){return this.then(null,R)},v.prototype.then=function(R,D){if(typeof R!="function"&&this.state===y||typeof D!="function"&&this.state===d)return this;var O=new this.constructor(s);if(this.state!==m){var B=this.state===y?R:D;E(O,B,this.outcome)}else this.queue.push(new f(O,R,D));return O};function f(R,D,O){this.promise=R,typeof D=="function"&&(this.onFulfilled=D,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(R){u.resolve(this.promise,R)},f.prototype.otherCallFulfilled=function(R){E(this.promise,this.onFulfilled,R)},f.prototype.callRejected=function(R){u.reject(this.promise,R)},f.prototype.otherCallRejected=function(R){E(this.promise,this.onRejected,R)};function E(R,D,O){a(function(){var B;try{B=D(O)}catch(K){return u.reject(R,K)}B===R?u.reject(R,new TypeError("Cannot resolve promise with itself")):u.resolve(R,B)})}u.resolve=function(R,D){var O=b(w,D);if(O.status==="error")return u.reject(R,O.value);var B=O.value;if(B)S(R,B);else{R.state=y,R.outcome=D;for(var K=-1,W=R.queue.length;++K<W;)R.queue[K].callFulfilled(D)}return R},u.reject=function(R,D){R.state=d,R.outcome=D;for(var O=-1,B=R.queue.length;++O<B;)R.queue[O].callRejected(D);return R};function w(R){var D=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof D=="function")return function(){D.apply(R,arguments)}}function S(R,D){var O=!1;function B(be){O||(O=!0,u.reject(R,be))}function K(be){O||(O=!0,u.resolve(R,be))}function W(){D(K,B)}var ne=b(W);ne.status==="error"&&B(ne.value)}function b(R,D){var O={};try{O.value=R(D),O.status="success"}catch(B){O.status="error",O.value=B}return O}v.resolve=x;function x(R){return R instanceof this?R:u.resolve(new this(s),R)}v.reject=P;function P(R){var D=new this(s);return u.reject(D,R)}v.all=V;function V(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var K=new Array(O),W=0,ne=-1,be=new this(s);++ne<O;)Fe(R[ne],ne);return be;function Fe(Lt,pr){D.resolve(Lt).then(Un,function(ft){B||(B=!0,u.reject(be,ft))});function Un(ft){K[pr]=ft,++W===O&&!B&&(B=!0,u.resolve(be,K))}}}v.race=X;function X(R){var D=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var K=-1,W=new this(s);++K<O;)ne(R[K]);return W;function ne(be){D.resolve(be).then(function(Fe){B||(B=!0,u.resolve(W,Fe))},function(Fe){B||(B=!0,u.reject(W,Fe))})}}},{1:1}],3:[function(n,i,o){(function(a){"use strict";typeof a.Promise!="function"&&(a.Promise=n(2))}).call(this,typeof global!="undefined"?global:typeof self!="undefined"?self:typeof window!="undefined"?window:{})},{2:2}],4:[function(n,i,o){"use strict";var a=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(l){return typeof l}:function(l){return l&&typeof Symbol=="function"&&l.constructor===Symbol&&l!==Symbol.prototype?"symbol":typeof l};function s(l,h){if(!(l instanceof h))throw new TypeError("Cannot call a class as a function")}function u(){try{if(typeof indexedDB!="undefined")return indexedDB;if(typeof webkitIndexedDB!="undefined")return webkitIndexedDB;if(typeof mozIndexedDB!="undefined")return mozIndexedDB;if(typeof OIndexedDB!="undefined")return OIndexedDB;if(typeof msIndexedDB!="undefined")return msIndexedDB}catch(l){return}}var d=u();function y(){try{if(!d||!d.open)return!1;var l=typeof openDatabase!="undefined"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),h=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!l||h)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function m(l,h){l=l||[],h=h||{};try{return new Blob(l,h)}catch(p){if(p.name!=="TypeError")throw p;for(var c=typeof BlobBuilder!="undefined"?BlobBuilder:typeof MSBlobBuilder!="undefined"?MSBlobBuilder:typeof MozBlobBuilder!="undefined"?MozBlobBuilder:WebKitBlobBuilder,_=new c,g=0;g<l.length;g+=1)_.append(l[g]);return _.getBlob(h.type)}}typeof Promise=="undefined"&&n(3);var v=Promise;function f(l,h){h&&l.then(function(c){h(null,c)},function(c){h(c)})}function E(l,h,c){typeof h=="function"&&l.then(h),typeof c=="function"&&l.catch(c)}function w(l){return typeof l!="string"&&(console.warn(l+" used as a key, but it is not a string."),l=String(l)),l}function S(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var b="local-forage-detect-blob-support",x=void 0,P={},V=Object.prototype.toString,X="readonly",R="readwrite";function D(l){for(var h=l.length,c=new ArrayBuffer(h),_=new Uint8Array(c),g=0;g<h;g++)_[g]=l.charCodeAt(g);return c}function O(l){return new v(function(h){var c=l.transaction(b,R),_=m([""]);c.objectStore(b).put(_,"key"),c.onabort=function(g){g.preventDefault(),g.stopPropagation(),h(!1)},c.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);h(p||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function B(l){return typeof x=="boolean"?v.resolve(x):O(l).then(function(h){return x=h,x})}function K(l){var h=P[l.name],c={};c.promise=new v(function(_,g){c.resolve=_,c.reject=g}),h.deferredOperations.push(c),h.dbReady?h.dbReady=h.dbReady.then(function(){return c.promise}):h.dbReady=c.promise}function W(l){var h=P[l.name],c=h.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ne(l,h){var c=P[l.name],_=c.deferredOperations.pop();if(_)return _.reject(h),_.promise}function be(l,h){return new v(function(c,_){if(P[l.name]=P[l.name]||Bo(),l.db)if(h)K(l),l.db.close();else return c(l.db);var g=[l.name];h&&g.push(l.version);var p=d.open.apply(d,g);h&&(p.onupgradeneeded=function(A){var I=p.result;try{I.createObjectStore(l.storeName),A.oldVersion<=1&&I.createObjectStore(b)}catch(k){if(k.name==="ConstraintError")console.warn('The database "'+l.name+'" has been upgraded from version '+A.oldVersion+" to version "+A.newVersion+', but the storage "'+l.storeName+'" already exists.');else throw k}}),p.onerror=function(A){A.preventDefault(),_(p.error)},p.onsuccess=function(){var A=p.result;A.onversionchange=function(I){I.target.close()},c(A),W(l)}})}function Fe(l){return be(l,!1)}function Lt(l){return be(l,!0)}function pr(l,h){if(!l.db)return!0;var c=!l.db.objectStoreNames.contains(l.storeName),_=l.version<l.db.version,g=l.version>l.db.version;if(_&&(l.version!==h&&console.warn('The database "'+l.name+`" can't be downgraded from version `+l.db.version+" to version "+l.version+"."),l.version=l.db.version),g||c){if(c){var p=l.db.version+1;p>l.version&&(l.version=p)}return!0}return!1}function Un(l){return new v(function(h,c){var _=new FileReader;_.onerror=c,_.onloadend=function(g){var p=btoa(g.target.result||"");h({__local_forage_encoded_blob:!0,data:p,type:l.type})},_.readAsBinaryString(l)})}function ft(l){var h=D(atob(l.data));return m([h],{type:l.type})}function Mo(l){return l&&l.__local_forage_encoded_blob}function Au(l){var h=this,c=h._initReady().then(function(){var _=P[h._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return E(c,l,l),c}function Iu(l){K(l);for(var h=P[l.name],c=h.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return l.db=null,Fe(l).then(function(p){return l.db=p,pr(l)?Lt(l):p}).then(function(p){l.db=h.db=p;for(var A=0;A<c.length;A++)c[A]._dbInfo.db=p}).catch(function(p){throw ne(l,p),p})}function je(l,h,c,_){_===void 0&&(_=1);try{var g=l.db.transaction(l.storeName,h);c(null,g)}catch(p){if(_>0&&(!l.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return v.resolve().then(function(){if(!l.db||p.name==="NotFoundError"&&!l.db.objectStoreNames.contains(l.storeName)&&l.version<=l.db.version)return l.db&&(l.version=l.db.version+1),Lt(l)}).then(function(){return Iu(l).then(function(){je(l,h,c,_-1)})}).catch(c);c(p)}}function Bo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Su(l){var h=this,c={db:null};if(l)for(var _ in l)c[_]=l[_];var g=P[c.name];g||(g=Bo(),P[c.name]=g),g.forages.push(h),h._initReady||(h._initReady=h.ready,h.ready=Au);var p=[];function A(){return v.resolve()}for(var I=0;I<g.forages.length;I++){var k=g.forages[I];k!==h&&p.push(k._initReady().catch(A))}var T=g.forages.slice(0);return v.all(p).then(function(){return c.db=g.db,Fe(c)}).then(function(C){return c.db=C,pr(c,h._defaultConfig.version)?Lt(c):C}).then(function(C){c.db=g.db=C,h._dbInfo=c;for(var U=0;U<T.length;U++){var j=T[U];j!==h&&(j._dbInfo.db=c.db,j._dbInfo.version=c.version)}})}function Ru(l,h){var c=this;l=w(l);var _=new v(function(g,p){c.ready().then(function(){je(c._dbInfo,X,function(A,I){if(A)return p(A);try{var k=I.objectStore(c._dbInfo.storeName),T=k.get(l);T.onsuccess=function(){var C=T.result;C===void 0&&(C=null),Mo(C)&&(C=ft(C)),g(C)},T.onerror=function(){p(T.error)}}catch(C){p(C)}})}).catch(p)});return f(_,h),_}function ku(l,h){var c=this,_=new v(function(g,p){c.ready().then(function(){je(c._dbInfo,X,function(A,I){if(A)return p(A);try{var k=I.objectStore(c._dbInfo.storeName),T=k.openCursor(),C=1;T.onsuccess=function(){var U=T.result;if(U){var j=U.value;Mo(j)&&(j=ft(j));var G=l(j,U.key,C++);G!==void 0?g(G):U.continue()}else g()},T.onerror=function(){p(T.error)}}catch(U){p(U)}})}).catch(p)});return f(_,h),_}function Tu(l,h,c){var _=this;l=w(l);var g=new v(function(p,A){var I;_.ready().then(function(){return I=_._dbInfo,V.call(h)==="[object Blob]"?B(I.db).then(function(k){return k?h:Un(h)}):h}).then(function(k){je(_._dbInfo,R,function(T,C){if(T)return A(T);try{var U=C.objectStore(_._dbInfo.storeName);k===null&&(k=void 0);var j=U.put(k,l);C.oncomplete=function(){k===void 0&&(k=null),p(k)},C.onabort=C.onerror=function(){var G=j.error?j.error:j.transaction.error;A(G)}}catch(G){A(G)}})}).catch(A)});return f(g,c),g}function xu(l,h){var c=this;l=w(l);var _=new v(function(g,p){c.ready().then(function(){je(c._dbInfo,R,function(A,I){if(A)return p(A);try{var k=I.objectStore(c._dbInfo.storeName),T=k.delete(l);I.oncomplete=function(){g()},I.onerror=function(){p(T.error)},I.onabort=function(){var C=T.error?T.error:T.transaction.error;p(C)}}catch(C){p(C)}})}).catch(p)});return f(_,h),_}function Cu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){je(h._dbInfo,R,function(p,A){if(p)return g(p);try{var I=A.objectStore(h._dbInfo.storeName),k=I.clear();A.oncomplete=function(){_()},A.onabort=A.onerror=function(){var T=k.error?k.error:k.transaction.error;g(T)}}catch(T){g(T)}})}).catch(g)});return f(c,l),c}function Ou(l){var h=this,c=new v(function(_,g){h.ready().then(function(){je(h._dbInfo,X,function(p,A){if(p)return g(p);try{var I=A.objectStore(h._dbInfo.storeName),k=I.count();k.onsuccess=function(){_(k.result)},k.onerror=function(){g(k.error)}}catch(T){g(T)}})}).catch(g)});return f(c,l),c}function Pu(l,h){var c=this,_=new v(function(g,p){if(l<0){g(null);return}c.ready().then(function(){je(c._dbInfo,X,function(A,I){if(A)return p(A);try{var k=I.objectStore(c._dbInfo.storeName),T=!1,C=k.openKeyCursor();C.onsuccess=function(){var U=C.result;if(!U){g(null);return}l===0||T?g(U.key):(T=!0,U.advance(l))},C.onerror=function(){p(C.error)}}catch(U){p(U)}})}).catch(p)});return f(_,h),_}function Du(l){var h=this,c=new v(function(_,g){h.ready().then(function(){je(h._dbInfo,X,function(p,A){if(p)return g(p);try{var I=A.objectStore(h._dbInfo.storeName),k=I.openKeyCursor(),T=[];k.onsuccess=function(){var C=k.result;if(!C){_(T);return}T.push(C.key),C.continue()},k.onerror=function(){g(k.error)}}catch(C){g(C)}})}).catch(g)});return f(c,l),c}function Nu(l,h){h=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;if(!l.name)g=v.reject("Invalid arguments");else{var p=l.name===c.name&&_._dbInfo.db,A=p?v.resolve(_._dbInfo.db):Fe(l).then(function(I){var k=P[l.name],T=k.forages;k.db=I;for(var C=0;C<T.length;C++)T[C]._dbInfo.db=I;return I});l.storeName?g=A.then(function(I){if(I.objectStoreNames.contains(l.storeName)){var k=I.version+1;K(l);var T=P[l.name],C=T.forages;I.close();for(var U=0;U<C.length;U++){var j=C[U];j._dbInfo.db=null,j._dbInfo.version=k}var G=new v(function(q,le){var ie=d.open(l.name,k);ie.onerror=function(Oe){var Mt=ie.result;Mt.close(),le(Oe)},ie.onupgradeneeded=function(){var Oe=ie.result;Oe.deleteObjectStore(l.storeName)},ie.onsuccess=function(){var Oe=ie.result;Oe.close(),q(Oe)}});return G.then(function(q){T.db=q;for(var le=0;le<C.length;le++){var ie=C[le];ie._dbInfo.db=q,W(ie._dbInfo)}}).catch(function(q){throw(ne(l,q)||v.resolve()).catch(function(){}),q})}}):g=A.then(function(I){K(l);var k=P[l.name],T=k.forages;I.close();for(var C=0;C<T.length;C++){var U=T[C];U._dbInfo.db=null}var j=new v(function(G,q){var le=d.deleteDatabase(l.name);le.onerror=function(){var ie=le.result;ie&&ie.close(),q(le.error)},le.onblocked=function(){console.warn('dropInstance blocked for database "'+l.name+'" until all open connections are closed')},le.onsuccess=function(){var ie=le.result;ie&&ie.close(),G(ie)}});return j.then(function(G){k.db=G;for(var q=0;q<T.length;q++){var le=T[q];W(le._dbInfo)}}).catch(function(G){throw(ne(l,G)||v.resolve()).catch(function(){}),G})})}return f(g,h),g}var Lu={_driver:"asyncStorage",_initStorage:Su,_support:y(),iterate:ku,getItem:Ru,setItem:Tu,removeItem:xu,clear:Cu,length:Ou,key:Pu,keys:Du,dropInstance:Nu};function Uu(){return typeof openDatabase=="function"}var Qe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Mu="~~local_forage_type~",Fo=/^~~local_forage_type~([^~]+)~/,vr="__lfsc__:",Mn=vr.length,Bn="arbf",Fn="blob",jo="si08",Vo="ui08",Ho="uic8",Jo="si16",$o="si32",Go="ur16",qo="ui32",Ko="fl32",Wo="fl64",zo=Mn+Bn.length,Qo=Object.prototype.toString;function Yo(l){var h=l.length*.75,c=l.length,_,g=0,p,A,I,k;l[l.length-1]==="="&&(h--,l[l.length-2]==="="&&h--);var T=new ArrayBuffer(h),C=new Uint8Array(T);for(_=0;_<c;_+=4)p=Qe.indexOf(l[_]),A=Qe.indexOf(l[_+1]),I=Qe.indexOf(l[_+2]),k=Qe.indexOf(l[_+3]),C[g++]=p<<2|A>>4,C[g++]=(A&15)<<4|I>>2,C[g++]=(I&3)<<6|k&63;return T}function jn(l){var h=new Uint8Array(l),c="",_;for(_=0;_<h.length;_+=3)c+=Qe[h[_]>>2],c+=Qe[(h[_]&3)<<4|h[_+1]>>4],c+=Qe[(h[_+1]&15)<<2|h[_+2]>>6],c+=Qe[h[_+2]&63];return h.length%3===2?c=c.substring(0,c.length-1)+"=":h.length%3===1&&(c=c.substring(0,c.length-2)+"=="),c}function Bu(l,h){var c="";if(l&&(c=Qo.call(l)),l&&(c==="[object ArrayBuffer]"||l.buffer&&Qo.call(l.buffer)==="[object ArrayBuffer]")){var _,g=vr;l instanceof ArrayBuffer?(_=l,g+=Bn):(_=l.buffer,c==="[object Int8Array]"?g+=jo:c==="[object Uint8Array]"?g+=Vo:c==="[object Uint8ClampedArray]"?g+=Ho:c==="[object Int16Array]"?g+=Jo:c==="[object Uint16Array]"?g+=Go:c==="[object Int32Array]"?g+=$o:c==="[object Uint32Array]"?g+=qo:c==="[object Float32Array]"?g+=Ko:c==="[object Float64Array]"?g+=Wo:h(new Error("Failed to get type for BinaryArray"))),h(g+jn(_))}else if(c==="[object Blob]"){var p=new FileReader;p.onload=function(){var A=Mu+l.type+"~"+jn(this.result);h(vr+Fn+A)},p.readAsArrayBuffer(l)}else try{h(JSON.stringify(l))}catch(A){console.error("Couldn't convert value into a JSON string: ",l),h(null,A)}}function Fu(l){if(l.substring(0,Mn)!==vr)return JSON.parse(l);var h=l.substring(zo),c=l.substring(Mn,zo),_;if(c===Fn&&Fo.test(h)){var g=h.match(Fo);_=g[1],h=h.substring(g[0].length)}var p=Yo(h);switch(c){case Bn:return p;case Fn:return m([p],{type:_});case jo:return new Int8Array(p);case Vo:return new Uint8Array(p);case Ho:return new Uint8ClampedArray(p);case Jo:return new Int16Array(p);case Go:return new Uint16Array(p);case $o:return new Int32Array(p);case qo:return new Uint32Array(p);case Ko:return new Float32Array(p);case Wo:return new Float64Array(p);default:throw new Error("Unkown type: "+c)}}var Vn={serialize:Bu,deserialize:Fu,stringToBuffer:Yo,bufferToString:jn};function Xo(l,h,c,_){l.executeSql("CREATE TABLE IF NOT EXISTS "+h.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function ju(l){var h=this,c={db:null};if(l)for(var _ in l)c[_]=typeof l[_]!="string"?l[_].toString():l[_];var g=new v(function(p,A){try{c.db=openDatabase(c.name,String(c.version),c.description,c.size)}catch(I){return A(I)}c.db.transaction(function(I){Xo(I,c,function(){h._dbInfo=c,p()},function(k,T){A(T)})},A)});return c.serializer=Vn,g}function Ye(l,h,c,_,g,p){l.executeSql(c,_,g,function(A,I){I.code===I.SYNTAX_ERR?A.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[h.storeName],function(k,T){T.rows.length?p(k,I):Xo(k,h,function(){k.executeSql(c,_,g,p)},p)},p):p(A,I)},p)}function Vu(l,h){var c=this;l=w(l);var _=new v(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){Ye(I,A,"SELECT * FROM "+A.storeName+" WHERE key = ? LIMIT 1",[l],function(k,T){var C=T.rows.length?T.rows.item(0).value:null;C&&(C=A.serializer.deserialize(C)),g(C)},function(k,T){p(T)})})}).catch(p)});return f(_,h),_}function Hu(l,h){var c=this,_=new v(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){Ye(I,A,"SELECT * FROM "+A.storeName,[],function(k,T){for(var C=T.rows,U=C.length,j=0;j<U;j++){var G=C.item(j),q=G.value;if(q&&(q=A.serializer.deserialize(q)),q=l(q,G.key,j+1),q!==void 0){g(q);return}}g()},function(k,T){p(T)})})}).catch(p)});return f(_,h),_}function Zo(l,h,c,_){var g=this;l=w(l);var p=new v(function(A,I){g.ready().then(function(){h===void 0&&(h=null);var k=h,T=g._dbInfo;T.serializer.serialize(h,function(C,U){U?I(U):T.db.transaction(function(j){Ye(j,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[l,C],function(){A(k)},function(G,q){I(q)})},function(j){if(j.code===j.QUOTA_ERR){if(_>0){A(Zo.apply(g,[l,k,c,_-1]));return}I(j)}})})}).catch(I)});return f(p,c),p}function Ju(l,h,c){return Zo.apply(this,[l,h,c,1])}function $u(l,h){var c=this;l=w(l);var _=new v(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){Ye(I,A,"DELETE FROM "+A.storeName+" WHERE key = ?",[l],function(){g()},function(k,T){p(T)})})}).catch(p)});return f(_,h),_}function Gu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(A){Ye(A,p,"DELETE FROM "+p.storeName,[],function(){_()},function(I,k){g(k)})})}).catch(g)});return f(c,l),c}function qu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(A){Ye(A,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(I,k){var T=k.rows.item(0).c;_(T)},function(I,k){g(k)})})}).catch(g)});return f(c,l),c}function Ku(l,h){var c=this,_=new v(function(g,p){c.ready().then(function(){var A=c._dbInfo;A.db.transaction(function(I){Ye(I,A,"SELECT key FROM "+A.storeName+" WHERE id = ? LIMIT 1",[l+1],function(k,T){var C=T.rows.length?T.rows.item(0).key:null;g(C)},function(k,T){p(T)})})}).catch(p)});return f(_,h),_}function Wu(l){var h=this,c=new v(function(_,g){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(A){Ye(A,p,"SELECT key FROM "+p.storeName,[],function(I,k){for(var T=[],C=0;C<k.rows.length;C++)T.push(k.rows.item(C).key);_(T)},function(I,k){g(k)})})}).catch(g)});return f(c,l),c}function zu(l){return new v(function(h,c){l.transaction(function(_){_.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,p){for(var A=[],I=0;I<p.rows.length;I++)A.push(p.rows.item(I).name);h({db:l,storeNames:A})},function(g,p){c(p)})},function(_){c(_)})})}function Qu(l,h){h=S.apply(this,arguments);var c=this.config();l=typeof l!="function"&&l||{},l.name||(l.name=l.name||c.name,l.storeName=l.storeName||c.storeName);var _=this,g;return l.name?g=new v(function(p){var A;l.name===c.name?A=_._dbInfo.db:A=openDatabase(l.name,"","",0),l.storeName?p({db:A,storeNames:[l.storeName]}):p(zu(A))}).then(function(p){return new v(function(A,I){p.db.transaction(function(k){function T(G){return new v(function(q,le){k.executeSql("DROP TABLE IF EXISTS "+G,[],function(){q()},function(ie,Oe){le(Oe)})})}for(var C=[],U=0,j=p.storeNames.length;U<j;U++)C.push(T(p.storeNames[U]));v.all(C).then(function(){A()}).catch(function(G){I(G)})},function(k){I(k)})})}):g=v.reject("Invalid arguments"),f(g,h),g}var Yu={_driver:"webSQLStorage",_initStorage:ju,_support:Uu(),iterate:Hu,getItem:Vu,setItem:Ju,removeItem:$u,clear:Gu,length:qu,key:Ku,keys:Wu,dropInstance:Qu};function Xu(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(l){return!1}}function ea(l,h){var c=l.name+"/";return l.storeName!==h.storeName&&(c+=l.storeName+"/"),c}function Zu(){var l="_localforage_support_test";try{return localStorage.setItem(l,!0),localStorage.removeItem(l),!1}catch(h){return!0}}function ec(){return!Zu()||localStorage.length>0}function tc(l){var h=this,c={};if(l)for(var _ in l)c[_]=l[_];return c.keyPrefix=ea(l,h._defaultConfig),ec()?(h._dbInfo=c,c.serializer=Vn,v.resolve()):v.reject()}function rc(l){var h=this,c=h.ready().then(function(){for(var _=h._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var p=localStorage.key(g);p.indexOf(_)===0&&localStorage.removeItem(p)}});return f(c,l),c}function nc(l,h){var c=this;l=w(l);var _=c.ready().then(function(){var g=c._dbInfo,p=localStorage.getItem(g.keyPrefix+l);return p&&(p=g.serializer.deserialize(p)),p});return f(_,h),_}function ic(l,h){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,p=g.keyPrefix,A=p.length,I=localStorage.length,k=1,T=0;T<I;T++){var C=localStorage.key(T);if(C.indexOf(p)===0){var U=localStorage.getItem(C);if(U&&(U=g.serializer.deserialize(U)),U=l(U,C.substring(A),k++),U!==void 0)return U}}});return f(_,h),_}function oc(l,h){var c=this,_=c.ready().then(function(){var g=c._dbInfo,p;try{p=localStorage.key(l)}catch(A){p=null}return p&&(p=p.substring(g.keyPrefix.length)),p});return f(_,h),_}function ac(l){var h=this,c=h.ready().then(function(){for(var _=h._dbInfo,g=localStorage.length,p=[],A=0;A<g;A++){var I=localStorage.key(A);I.indexOf(_.keyPrefix)===0&&p.push(I.substring(_.keyPrefix.length))}return p});return f(c,l),c}function sc(l){var h=this,c=h.keys().then(function(_){return _.length});return f(c,l),c}function lc(l,h){var c=this;l=w(l);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+l)});return f(_,h),_}function uc(l,h,c){var _=this;l=w(l);var g=_.ready().then(function(){h===void 0&&(h=null);var p=h;return new v(function(A,I){var k=_._dbInfo;k.serializer.serialize(h,function(T,C){if(C)I(C);else try{localStorage.setItem(k.keyPrefix+l,T),A(p)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&I(U),I(U)}})})});return f(g,c),g}function cc(l,h){if(h=S.apply(this,arguments),l=typeof l!="function"&&l||{},!l.name){var c=this.config();l.name=l.name||c.name,l.storeName=l.storeName||c.storeName}var _=this,g;return l.name?g=new v(function(p){l.storeName?p(ea(l,_._defaultConfig)):p(l.name+"/")}).then(function(p){for(var A=localStorage.length-1;A>=0;A--){var I=localStorage.key(A);I.indexOf(p)===0&&localStorage.removeItem(I)}}):g=v.reject("Invalid arguments"),f(g,h),g}var dc={_driver:"localStorageWrapper",_initStorage:tc,_support:Xu(),iterate:ic,getItem:nc,setItem:uc,removeItem:lc,clear:rc,length:sc,key:oc,keys:ac,dropInstance:cc},fc=function(h,c){return h===c||typeof h=="number"&&typeof c=="number"&&isNaN(h)&&isNaN(c)},hc=function(h,c){for(var _=h.length,g=0;g<_;){if(fc(h[g],c))return!0;g++}return!1},ta=Array.isArray||function(l){return Object.prototype.toString.call(l)==="[object Array]"},Ut={},ra={},ht={INDEXEDDB:Lu,WEBSQL:Yu,LOCALSTORAGE:dc},mc=[ht.INDEXEDDB._driver,ht.WEBSQL._driver,ht.LOCALSTORAGE._driver],_r=["dropInstance"],Hn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(_r),pc={description:"",driver:mc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function vc(l,h){l[h]=function(){var c=arguments;return l.ready().then(function(){return l[h].apply(l,c)})}}function Jn(){for(var l=1;l<arguments.length;l++){var h=arguments[l];if(h)for(var c in h)h.hasOwnProperty(c)&&(ta(h[c])?arguments[0][c]=h[c].slice():arguments[0][c]=h[c])}return arguments[0]}var _c=function(){function l(h){s(this,l);for(var c in ht)if(ht.hasOwnProperty(c)){var _=ht[c],g=_._driver;this[c]=g,Ut[g]||this.defineDriver(_)}this._defaultConfig=Jn({},pc),this._config=Jn({},this._defaultConfig,h),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return l.prototype.config=function(c){if((typeof c=="undefined"?"undefined":a(c))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var _ in c){if(_==="storeName"&&(c[_]=c[_].replace(/\W/g,"_")),_==="version"&&typeof c[_]!="number")return new Error("Database version must be a number.");this._config[_]=c[_]}return"driver"in c&&c.driver?this.setDriver(this._config.driver):!0}else return typeof c=="string"?this._config[c]:this._config},l.prototype.defineDriver=function(c,_,g){var p=new v(function(A,I){try{var k=c._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){I(T);return}for(var C=Hn.concat("_initStorage"),U=0,j=C.length;U<j;U++){var G=C[U],q=!hc(_r,G);if((q||c[G])&&typeof c[G]!="function"){I(T);return}}var le=function(){for(var Mt=function(bc){return function(){var wc=new Error("Method "+bc+" is not implemented by the current driver"),na=v.reject(wc);return f(na,arguments[arguments.length-1]),na}},$n=0,yc=_r.length;$n<yc;$n++){var Gn=_r[$n];c[Gn]||(c[Gn]=Mt(Gn))}};le();var ie=function(Mt){Ut[k]&&console.info("Redefining LocalForage driver: "+k),Ut[k]=c,ra[k]=Mt,A()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,I):ie(!!c._support):ie(!0)}catch(Oe){I(Oe)}});return E(p,_,g),p},l.prototype.driver=function(){return this._driver||null},l.prototype.getDriver=function(c,_,g){var p=Ut[c]?v.resolve(Ut[c]):v.reject(new Error("Driver not found."));return E(p,_,g),p},l.prototype.getSerializer=function(c){var _=v.resolve(Vn);return E(_,c),_},l.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return E(g,c,c),g},l.prototype.setDriver=function(c,_,g){var p=this;ta(c)||(c=[c]);var A=this._getSupportedDrivers(c);function I(){p._config.driver=p.driver()}function k(U){return p._extend(U),I(),p._ready=p._initStorage(p._config),p._ready}function T(U){return function(){var j=0;function G(){for(;j<U.length;){var q=U[j];return j++,p._dbInfo=null,p._ready=null,p.getDriver(q).then(k).catch(G)}I();var le=new Error("No available storage method found.");return p._driverSet=v.reject(le),p._driverSet}return G()}}var C=this._driverSet!==null?this._driverSet.catch(function(){return v.resolve()}):v.resolve();return this._driverSet=C.then(function(){var U=A[0];return p._dbInfo=null,p._ready=null,p.getDriver(U).then(function(j){p._driver=j._driver,I(),p._wrapLibraryMethodsWithReady(),p._initDriver=T(A)})}).catch(function(){I();var U=new Error("No available storage method found.");return p._driverSet=v.reject(U),p._driverSet}),E(this._driverSet,_,g),this._driverSet},l.prototype.supports=function(c){return!!ra[c]},l.prototype._extend=function(c){Jn(this,c)},l.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,p=c.length;g<p;g++){var A=c[g];this.supports(A)&&_.push(A)}return _},l.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=Hn.length;c<_;c++)vc(this,Hn[c])},l.prototype.createInstance=function(c){return new l(c)},l}(),gc=new _c;i.exports=gc},{3:3}]},{},[4])(4)})});var os=Wn(Qr=>{"use strict";H();Gt();at();var Li=Ee(),jd=$e("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>L(Qr,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;Pe.info("onLevelFinished",r,n,i),yield Promise.all([ot.reporter({event:"COMPLETE_GAME_LEVEL"}),ot.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),Vd=$e("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>L(Qr,null,function*(){let{duration:t,rating:r,score:n}=e;return Pe.info("onGamePlayEnded",t,r,n),ot.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Hd=$e("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>L(Qr,[r],function*({levelId:e,name:t}){return ot.tracker("LevelUpgrade",{name:t,levelId:e})})});Li.registerCommand("TaskTrackerSDK.levelFinished",jd);Li.registerCommand("TaskTrackerSDK.gamePlayEnded",Vd);Li.registerCommand("TaskTrackerSDK.levelUpgrade",Hd);ve("TaskTrackerSDK.onLevelFinished",{version:"1.1.25",properties:{params:{levelId:"1.1.25",duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ve("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var gt,_t,as,Ui,Jd,Mi,Bi=Z(()=>{"use strict";gt=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},_t=new Map,as=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=_t.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)}},Ui=!1,Jd=()=>{Ui||(window.addEventListener("message",as),Ui=!0)},Mi=(e,t)=>{Jd(),_t.has(e)||_t.set(e,new Set);let r=_t.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&_t.delete(e),_t.size===0&&(window.removeEventListener("message",as),Ui=!1)}}});var bt,Yr,Xr,Zr,en,ss,yt,$d,fe,wt,lt=Z(()=>{"use strict";H();bt="UNLOCK_OPTIONS_CHANGED",Yr="INVOKE_PAYMENT",Xr="ON_PAYMENT_RESULT",Zr="ON_USE_MODAL_EVENT",en="ON_USE_MODAL_RESULT",ss="ON_USE_MODAL_FREQUENCY",yt=new Ne,$d=()=>({on:yt.on.bind(yt),off:yt.off.bind(yt),emit:yt.emit.bind(yt)}),fe=$d(),wt={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}}});var iu=Wn(nu=>{"use strict";lt();Bi();H();var ru={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};Mi("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",ru[e.result],e.result),fe.emit(en,{useModalResult:ru[e.result]})});fe.on(Zr,(e,t)=>{var r;gt("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:pt()})});Mi("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{fe.emit(Xr,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});fe.on(Yr,(e,t)=>L(nu,null,function*(){var r;gt("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:pt()})}))});at();Ae();Gt();H();var es=Ee(),Id="env",Sd="getSystemInfoSync",Rd=()=>{var i,o,a,s;let e={system:N.deviceInfo.system,platform:N.deviceInfo.platform.toLowerCase(),brand:N.deviceInfo.brand,pixelRatio:N.deviceInfo.pixelRatio,language:N.deviceInfo.lang,version:N.sdkInfo.jssdkVersion,appName:(i=N.hostInfo)==null?void 0:i.appName,SDKVersion:N.sdkInfo.nativeSDKVersion},t=(o=N.hostInfo)==null?void 0:o.version;t&&(e=pe(z({},e),{version:t}));let r=(a=N.hostInfo)==null?void 0:a.appName;r&&(e=pe(z({},e),{appName:r}));let n=(s=N.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=pe(z({},e),{SDKVersion:n})),e},kd=st(Sd,{implement:Rd}),Td=st(Id,{implement:()=>pe(z({},N.hostInfo),{sdkInfo:N.sdkInfo,platform:N.platform,deviceInfo:N.deviceInfo})});es.registerCommand("API.env",Td);es.registerCommand("API.getSystemInfoSync",kd);ve("env",{version:"1.0.0"});ve("getSystemInfoSync",{version:"1.0.0"});H();Gt();Xe();at();var xd="onJoliboxShow",Cd="onJoliboxHide",Od="onReady",Oi=Ee(),Pi=Aa(De),Ci=!0,qt=!0,qr=0,Kr=Ai;function Pd(){let e=Date.now();if(e-qr<100)return;qr=e;let t=document.visibilityState==="visible";t!==Ci&&(Ci=t,Kr.emit("visible",Ci))}function ts(e){let t=Date.now();t-qr<100||(qr=t,e==="focus"&&!qt?qt=!0:e==="blur"&&qt&&(qt=!1),Kr.emit("visible",qt))}document.addEventListener("visibilitychange",Pd);window.addEventListener("focus",()=>ts("focus"));window.addEventListener("blur",()=>ts("blur"));var Dd=st(xd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Pi(e);Kr.on("visible",r=>{r&&t()})}}),Nd=st(Cd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Pi(e);Kr.on("visible",r=>{!r&&t()})}}),Ld=st(Od,{paramsSchema:F.tuple(F.function()),implement(e){let t=Pi(e);Jt.on("LifecycleEvent.onReady",r=>{t(r)})}});Oi.registerCommand("LifecycleSDK.onReady",Ld);Oi.registerCommand("LifecycleSDK.onJoliboxShow",Dd);Oi.registerCommand("LifecycleSDK.onJoliboxHide",Nd);ve("lifeCycle.onReady",{version:"1.0.0"});ve("lifeCycle.onJoliboxShow",{version:"1.0.0"});ve("lifeCycle.onJoliboxHide",{version:"1.0.0"});Gt();H();$t();Ae();var is=zn(ns());var Wr=Ee(),Ni=class{constructor(){this.httpClient=He.create({baseUrl:N.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>N.mpId;this.getItem=t=>L(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)=>L(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=>L(this,null,function*(){yield this.gameStore.removeItem(t);let{code:r,message:n}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/remove`,{data:{key:t}});return{code:r,message:n}});this.clear=()=>L(this,null,function*(){yield this.gameStore.clear();let{code:t,message:r}=yield this.httpClient.post(`/api/games/user-storage/${this.gameId}/clear`,{});return{code:t,message:r}});this.gameId=this.getGameId(),this.gameStore=is.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},zr=new Ni,Ud=$e("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return L(this,null,function*(){return yield zr.getItem(e)})}});Wr.registerCommand("StorageSDK.getItem",Ud);ve("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Md=$e("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return L(this,null,function*(){return yield zr.setItem(e,t)})}});Wr.registerCommand("StorageSDK.setItem",Md);ve("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Bd=$e("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return L(this,null,function*(){return yield zr.removeItem(e)})}});Wr.registerCommand("StorageSDK.removeItem",Bd);ve("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Fd=$e("clearStorage",{implement(){return L(this,null,function*(){return yield zr.clear()})}});Wr.registerCommand("StorageSDK.clear",Fd);ve("storage.clear",{version:"1.0.0"});var ly=zn(os());at();H();$t();Bi();Ae();lt();var ls=N.testMode;function us(){let e=new Map,t,r;return{registerRewardHandler(i,o){e.set(i,o)},handleReward(i,...o){return L(this,null,function*(){return yield i.reduce((s,u)=>L(this,null,function*(){let d=yield s;if(d===!0)return!0;ls&&console.log(`handleReward ${u}`);let y=e.get(u),m=y?yield y(...o):d;return ls&&console.log(`handleReward ${u} ${m}`),m}),Promise.resolve(!1))})},registerRewardsFetcher(i){return L(this,null,function*(){t=(...o)=>L(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),["ADS"]}})})},registerRewardFrequencyConfigFetcher(i){return L(this,null,function*(){r=(...o)=>L(this,null,function*(){try{return yield i(...o)}catch(a){return console.error("getRewardOptions error:",a),{joliCoinUseAndCharge:wt}}})})},getRewardsTypes(...i){return L(this,null,function*(){return t?yield t(...i):["ADS"]})},getRewardFrequencyConfig(...i){return L(this,null,function*(){return r?yield r(...i):{joliCoinUseAndCharge:wt}})}}}lt();var Gd=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,qd=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(Gd()):["ADS"],cs=e=>{e.registerRewardsFetcher(t=>L(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;fe.emit(bt,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let u=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return qd(u)}catch(s){return console.error("getRewardOptions error:",s),r}}))},ds=e=>{e.registerRewardFrequencyConfigFetcher(t=>L(void 0,null,function*(){var n,i;let r=yield t.get("/api/fe-configs/web-common/global-config",{});return fe.emit(ss,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||wt}),{joliCoinUseAndCharge:((i=r.data)==null?void 0:i.joliCoinUseAndCharge)||wt}}))};var fs=e=>t=>L(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0});lt();function ut(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)}}Ae();H();lt();var hs=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}));var tn=(e,t)=>r=>L(void 0,null,function*(){let n=ut(fe,Xr);return fe.emit(Yr,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult}),rn=(e,t)=>r=>L(void 0,null,function*(){let n=ut(fe,en);return fe.emit(Zr,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var nn=(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:r,unlockOptionsHandler:n,initiateAndAwaitPayment:i,showUnlockWithJolicoinModal:o}})=>a=>L(void 0,null,function*(){var s,u,d,y,m,v,f;try{let E=!1,w=yield n.getData(),S=(d=(u=(s=w==null?void 0:w.options)==null?void 0:s.find(P=>P.type==="JOLI_COIN"))==null?void 0:u.joliCoinChoices[0].joliCoinQuantity)!=null?d:0;if(!hs((w==null?void 0:w.options)||[],w==null?void 0:w.userJoliCoin)){if((yield i({userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:S}))!=="SUCCESS")return r==null||r(a),!1;E=!0}let b=!!((y=w==null?void 0:w.userJoliCoin)!=null&&y.enableAutoDeduct);if(!E&&(yield o({enableAutoDeduct:b,userJoliCoin:w==null?void 0:w.userJoliCoin,joliCoinQuantity:S}))!=="CONFIRM")return r==null||r(a),!1;let x=yield e.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${pt()}-${N.mpType}-${Date.now()}`,gameInfo:{gameId:N.mpId}}});return x.code=="SUCCESS"?((v=a.adBreakDone)==null||v.call(a,{breakType:a.type,breakName:"name"in a&&(m=a.name)!=null?m:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in a&&((f=a.adViewed)==null||f.call(a)),t==null||t({quantity:x.data.quantity,balance:x.data.balance}),!0):(r==null||r(a),!1)}catch(E){if(console.info("JolicoinRewardHandler error:",E),E instanceof Error&&E.message=="CANCEL")throw E;return r==null||r(a),!1}finally{n.clearCache()}});var ms=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=ut(fe,bt),i=()=>{r==null||r()},o=rn("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),a=tn("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"});return nn(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})};lt();var ps=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=ut(fe,bt),i=u=>{var d;r==null||r(),(d=u.adBreakDone)==null||d.call(u,{breakType:u.type,breakFormat:u.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},o=rn("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),a=tn("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"});return nn(e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:i,unlockOptionsHandler:n,initiateAndAwaitPayment:a,showUnlockWithJolicoinModal:o}})};var Ze=us();cs(Ze);ds(Ze);var ln,M,bs,Vi,ct,vs,ws,Es,As,Hi,Fi,ji,Kd,Kt={},Is=[],Wd=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Wt=Array.isArray;function Ge(e,t){for(var r in t)e[r]=t[r];return e}function Ji(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function zt(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?ln.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 an(e,a,n,i,null)}function an(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?++bs:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function et(e){return e.children}function Re(e,t){this.props=e,this.context=t}function Et(e,t){if(t==null)return e.__?Et(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"?Et(e):null}function Ss(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 Ss(e)}}function _s(e){(!e.__d&&(e.__d=!0)&&ct.push(e)&&!sn.__r++||vs!==M.debounceRendering)&&((vs=M.debounceRendering)||ws)(sn)}function sn(){for(var e,t,r,n,i,o,a,s=1;ct.length;)ct.length>s&&ct.sort(Es),e=ct.shift(),s=ct.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=Ge({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),$i(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?Et(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,Ts(o,r,a),r.__e!=i&&Ss(r)));sn.__r=0}function Rs(e,t,r,n,i,o,a,s,u,d,y){var m,v,f,E,w,S,b=n&&n.__k||Is,x=t.length;for(u=zd(r,t,b,u,x),m=0;m<x;m++)(f=r.__k[m])!=null&&(v=f.__i===-1?Kt:b[f.__i]||Kt,f.__i=m,S=$i(e,f,v,i,o,a,s,u,d,y),E=f.__e,f.ref&&v.ref!=f.ref&&(v.ref&&Gi(v.ref,null,f),y.push(f.ref,f.__c||E,f)),w==null&&E!=null&&(w=E),4&f.__u||v.__k===f.__k?u=ks(f,u,e):typeof f.type=="function"&&S!==void 0?u=S:E&&(u=E.nextSibling),f.__u&=-7);return r.__e=w,u}function zd(e,t,r,n,i){var o,a,s,u,d,y=r.length,m=y,v=0;for(e.__k=new Array(i),o=0;o<i;o++)(a=t[o])!=null&&typeof a!="boolean"&&typeof a!="function"?(u=o+v,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?an(null,a,null,null,null):Wt(a)?an(et,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?an(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=Qd(a,r,u,m))!==-1&&(m--,(s=r[d])&&(s.__u|=2)),s==null||s.__v===null?(d==-1&&(i>y?v--:i<y&&v++),typeof a.type!="function"&&(a.__u|=4)):d!=u&&(d==u-1?v--:d==u+1?v++:(d>u?v--:v++,a.__u|=4))):e.__k[o]=null;if(m)for(o=0;o<y;o++)(s=r[o])!=null&&!(2&s.__u)&&(s.__e==n&&(n=Et(s)),Cs(s,s));return n}function ks(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=ks(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=Et(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function Qt(e,t){return t=t||[],e==null||typeof e=="boolean"||(Wt(e)?e.some(function(r){Qt(r,t)}):t.push(e)),t}function Qd(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 gs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||Wd.test(t)?r:r+"px"}function on(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||gs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||gs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(As,"$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=Hi,e.addEventListener(t,o?ji:Fi,o)):e.removeEventListener(t,o?ji:Fi,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 ys(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Hi++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function $i(e,t,r,n,i,o,a,s,u,d){var y,m,v,f,E,w,S,b,x,P,V,X,R,D,O,B,K,W=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(u=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof W=="function")try{if(b=t.props,x="prototype"in W&&W.prototype.render,P=(y=W.contextType)&&n[y.__c],V=y?P?P.props.value:y.__:n,r.__c?S=(m=t.__c=r.__c).__=m.__E:(x?t.__c=m=new W(b,V):(t.__c=m=new Re(b,V),m.constructor=W,m.render=Xd),P&&P.sub(m),m.props=b,m.state||(m.state={}),m.context=V,m.__n=n,v=m.__d=!0,m.__h=[],m._sb=[]),x&&m.__s==null&&(m.__s=m.state),x&&W.getDerivedStateFromProps!=null&&(m.__s==m.state&&(m.__s=Ge({},m.__s)),Ge(m.__s,W.getDerivedStateFromProps(b,m.__s))),f=m.props,E=m.state,m.__v=t,v)x&&W.getDerivedStateFromProps==null&&m.componentWillMount!=null&&m.componentWillMount(),x&&m.componentDidMount!=null&&m.__h.push(m.componentDidMount);else{if(x&&W.getDerivedStateFromProps==null&&b!==f&&m.componentWillReceiveProps!=null&&m.componentWillReceiveProps(b,V),!m.__e&&(m.shouldComponentUpdate!=null&&m.shouldComponentUpdate(b,m.__s,V)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(m.props=b,m.state=m.__s,m.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ne){ne&&(ne.__=t)}),X=0;X<m._sb.length;X++)m.__h.push(m._sb[X]);m._sb=[],m.__h.length&&a.push(m);break e}m.componentWillUpdate!=null&&m.componentWillUpdate(b,m.__s,V),x&&m.componentDidUpdate!=null&&m.__h.push(function(){m.componentDidUpdate(f,E,w)})}if(m.context=V,m.props=b,m.__P=e,m.__e=!1,R=M.__r,D=0,x){for(m.state=m.__s,m.__d=!1,R&&R(t),y=m.render(m.props,m.state,m.context),O=0;O<m._sb.length;O++)m.__h.push(m._sb[O]);m._sb=[]}else do m.__d=!1,R&&R(t),y=m.render(m.props,m.state,m.context),m.state=m.__s;while(m.__d&&++D<25);m.state=m.__s,m.getChildContext!=null&&(n=Ge(Ge({},n),m.getChildContext())),x&&!v&&m.getSnapshotBeforeUpdate!=null&&(w=m.getSnapshotBeforeUpdate(f,E)),B=y,y!=null&&y.type===et&&y.key==null&&(B=xs(y.props.children)),s=Rs(e,Wt(B)?B:[B],t,r,n,i,o,a,s,u,d),m.base=t.__e,t.__u&=-161,m.__h.length&&a.push(m),S&&(m.__E=m.__=null)}catch(ne){if(t.__v=null,u||o!=null)if(ne.then){for(t.__u|=u?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;o[o.indexOf(s)]=null,t.__e=s}else for(K=o.length;K--;)Ji(o[K]);else t.__e=r.__e,t.__k=r.__k;M.__e(ne,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=Yd(r.__e,t,r,n,i,o,a,u,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function Ts(e,t,r){for(var n=0;n<r.length;n++)Gi(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function xs(e){return typeof e!="object"||e==null?e:Wt(e)?e.map(xs):Ge({},e)}function Yd(e,t,r,n,i,o,a,s,u){var d,y,m,v,f,E,w,S=r.props,b=t.props,x=t.type;if(x=="svg"?i="http://www.w3.org/2000/svg":x=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),o!=null){for(d=0;d<o.length;d++)if((f=o[d])&&"setAttribute"in f==!!x&&(x?f.localName==x:f.nodeType==3)){e=f,o[d]=null;break}}if(e==null){if(x==null)return document.createTextNode(b);e=document.createElementNS(i,x,b.is&&b),s&&(M.__m&&M.__m(t,o),s=!1),o=null}if(x===null)S===b||s&&e.data===b||(e.data=b);else{if(o=o&&ln.call(e.childNodes),S=r.props||Kt,!s&&o!=null)for(S={},d=0;d<e.attributes.length;d++)S[(f=e.attributes[d]).name]=f.value;for(d in S)if(f=S[d],d!="children"){if(d=="dangerouslySetInnerHTML")m=f;else if(!(d in b)){if(d=="value"&&"defaultValue"in b||d=="checked"&&"defaultChecked"in b)continue;on(e,d,null,f,i)}}for(d in b)f=b[d],d=="children"?v=f:d=="dangerouslySetInnerHTML"?y=f:d=="value"?E=f:d=="checked"?w=f:s&&typeof f!="function"||S[d]===f||on(e,d,f,S[d],i);if(y)s||m&&(y.__html===m.__html||y.__html===e.innerHTML)||(e.innerHTML=y.__html),t.__k=[];else if(m&&(e.innerHTML=""),Rs(t.type==="template"?e.content:e,Wt(v)?v:[v],t,r,n,x=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&Et(r,0),s,u),o!=null)for(d=o.length;d--;)Ji(o[d]);s||(d="value",x=="progress"&&E==null?e.removeAttribute("value"):E!==void 0&&(E!==e[d]||x=="progress"&&!E||x=="option"&&E!==S[d])&&on(e,d,E,S[d],i),d="checked",w!==void 0&&w!==e[d]&&on(e,d,w,S[d],i))}return e}function Gi(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){M.__e(i,r)}}function Cs(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||Gi(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Cs(n[i],t,r||typeof e.type!="function");r||Ji(e.__e),e.__c=e.__=e.__e=void 0}function Xd(e,t,r){return this.constructor(e,r)}function Os(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],$i(t,e=(!n&&r||t).__k=zt(et,null,[e]),i||Kt,Kt,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?ln.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),Ts(o,e,a)}ln=Is.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},bs=0,Vi=function(e){return e!=null&&e.constructor==null},Re.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ge({},this.state),typeof e=="function"&&(e=e(Ge({},r),this.props)),e&&Ge(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),_s(this))},Re.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),_s(this))},Re.prototype.render=et,ct=[],ws=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Es=function(e,t){return e.__v.__b-t.__v.__b},sn.__r=0,As=/(PointerCapture)$|Capture$/i,Hi=0,Fi=ys(!1),ji=ys(!0),Kd=0;var At,re,qi,Ps,Yt=0,js=[],ae=M,Ds=ae.__b,Ns=ae.__r,Ls=ae.diffed,Us=ae.__c,Ms=ae.unmount,Bs=ae.__;function cn(e,t){ae.__h&&ae.__h(re,e,Yt||t),Yt=0;var r=re.__H||(re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function dn(e){return Yt=1,Vs(Hs,e)}function Vs(e,t,r){var n=cn(At++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Hs(void 0,t),function(s){var u=n.__N?n.__N[0]:n.__[0],d=n.t(u,s);u!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=re,!re.__f)){var i=function(s,u,d){if(!n.__c.__H)return!0;var y=n.__c.__H.__.filter(function(v){return!!v.__c});if(y.every(function(v){return!v.__N}))return!o||o.call(this,s,u,d);var m=n.__c.props!==s;return y.forEach(function(v){if(v.__N){var f=v.__[0];v.__=v.__N,v.__N=void 0,f!==v.__[0]&&(m=!0)}}),o&&o.call(this,s,u,d)||m};re.__f=!0;var o=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,u,d){if(this.__e){var y=o;o=void 0,i(s,u,d),o=y}a&&a.call(this,s,u,d)},re.shouldComponentUpdate=i}return n.__N||n.__}function Xt(e,t){var r=cn(At++,3);!ae.__s&&Yi(r.__H,t)&&(r.__=e,r.u=t,re.__H.__h.push(r))}function Wi(e,t){var r=cn(At++,4);!ae.__s&&Yi(r.__H,t)&&(r.__=e,r.u=t,re.__h.push(r))}function zi(e){return Yt=5,Zt(function(){return{current:e}},[])}function Zt(e,t){var r=cn(At++,7);return Yi(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Qi(e,t){return Yt=8,Zt(function(){return e},t)}function Zd(){for(var e;e=js.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(un),e.__H.__h.forEach(Ki),e.__H.__h=[]}catch(t){e.__H.__h=[],ae.__e(t,e.__v)}}ae.__b=function(e){re=null,Ds&&Ds(e)},ae.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Bs&&Bs(e,t)},ae.__r=function(e){Ns&&Ns(e),At=0;var t=(re=e.__c).__H;t&&(qi===re?(t.__h=[],re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(un),t.__h.forEach(Ki),t.__h=[],At=0)),qi=re},ae.diffed=function(e){Ls&&Ls(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(js.push(t)!==1&&Ps===ae.requestAnimationFrame||((Ps=ae.requestAnimationFrame)||ef)(Zd)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),qi=re=null},ae.__c=function(e,t){t.some(function(r){try{r.__h.forEach(un),r.__h=r.__h.filter(function(n){return!n.__||Ki(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],ae.__e(n,r.__v)}}),Us&&Us(e,t)},ae.unmount=function(e){Ms&&Ms(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{un(n)}catch(i){t=i}}),r.__H=void 0,t&&ae.__e(t,r.__v))};var Fs=typeof requestAnimationFrame=="function";function ef(e){var t,r=function(){clearTimeout(n),Fs&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Fs&&(t=requestAnimationFrame(r))}function un(e){var t=re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),re=t}function Ki(e){var t=re;e.__c=e.__(),re=t}function Yi(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Hs(e,t){return typeof t=="function"?t(e):t}function rf(e,t){for(var r in t)e[r]=t[r];return e}function Js(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 $s(e,t){this.props=e,this.context=t}($s.prototype=new Re).isPureReactComponent=!0,$s.prototype.shouldComponentUpdate=function(e,t){return Js(this.props,e)||Js(this.state,t)};var Gs=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),Gs&&Gs(e)};var gg=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var nf=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}nf(e,t,r,n)};var qs=M.unmount;function Zs(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=rf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return Zs(n,t,r)})),e}function el(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return el(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 Xi(){this.__u=0,this.o=null,this.__b=null}function tl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function fn(){this.i=null,this.l=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),qs&&qs(e)},(Xi.prototype=new Re).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=tl(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]=el(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)},Xi.prototype.componentWillUnmount=function(){this.o=[]},Xi.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]=Zs(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&zt(et,null,e.fallback);return i&&(i.__u&=-33),[zt(et,null,t.__a?null:e.children),i]};var Ks=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]}};(fn.prototype=new Re).__a=function(e){var t=this,r=tl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),Ks(t,e,n)):i()};r?r(o):o()}},fn.prototype.render=function(e){this.i=null,this.l=new Map;var t=Qt(e.children);e.revealOrder&&e.revealOrder[0]==="b"&&t.reverse();for(var r=t.length;r--;)this.l.set(t[r],this.i=[1,0,this.i]);return e.children},fn.prototype.componentDidUpdate=fn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){Ks(e,r,t)})};var of=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,af=/^(?: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]/,sf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,lf=/[A-Z0-9]/g,uf=typeof document!="undefined",cf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function Zi(e,t,r){return t.__k==null&&(t.textContent=""),Os(e,t),typeof r=="function"&&r(),e?e.__c:null}Re.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Re.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var Ws=M.event;function df(){}function ff(){return this.cancelBubble}function hf(){return this.defaultPrevented}M.event=function(e){return Ws&&(e=Ws(e)),e.persist=df,e.isPropagationStopped=ff,e.isDefaultPrevented=hf,e.nativeEvent=e};var rl,mf={enumerable:!1,configurable:!0,get:function(){return this.class}},zs=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||uf&&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"||cf(r.type)?u==="onfocus"?a="onfocusin":u==="onblur"?a="onfocusout":sf.test(a)&&(a=u):u=a="oninput":o&&af.test(a)?a=a.replace(lf,"-$&").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=Qt(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=Qt(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",mf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=of,zs&&zs(e)};var Qs=M.__r;M.__r=function(e){Qs&&Qs(e),rl=e.__c};var Ys=M.diffed;M.diffed=function(e){Ys&&Ys(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),rl=null};var nl=Object.getOwnPropertySymbols,pf=Object.prototype.hasOwnProperty,vf=Object.prototype.propertyIsEnumerable,_f=(e,t)=>{var r={};for(var n in e)pf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&nl)for(var n of nl(e))t.indexOf(n)<0&&vf.call(e,n)&&(r[n]=e[n]);return r};function ke(e,t,r){return(t=gf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gf(e){var t=yf(e,"string");return typeof t=="symbol"?t:t+""}function yf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var ao=class{constructor(t){ke(this,"context",void 0),ke(this,"continueCallback",void 0),ke(this,"adIsShowingCallback",void 0),ke(this,"isBeforeAdCalled",!1),ke(this,"isBeforeRewardCalled",!1),ke(this,"isAdDismissedCalled",!1),ke(this,"isAdViewedCalled",!1),ke(this,"isAfterAdCalled",!1),ke(this,"currentProvider",void 0),ke(this,"currentClientParams",void 0),ke(this,"adsHasResponse",!1),ke(this,"videoChecker",window.document.createElement("video")),ke(this,"wrapShowAdFn",r=>()=>{var n;this.adsHasResponse=!0;let i=!1;this.videoChecker.play().catch(()=>{i=!1}),i=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:i},this.paramsToTrack)),(n=this.adIsShowingCallback)==null||n.call(this,!0),r()}),this.context=t}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0)))}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,u;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(u=this.continueCallback)==null||u.call(this,[!0,r]);break}}}}callAdBreakAndContinue(t,r,n,i){return L(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,m;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(u=(s=this.currentProvider)==null?void 0:s.name)!=null?u:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(m=this.adIsShowingCallback)==null||m.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function hn(e,t,r){return(t=bf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bf(e){var t=wf(e,"string");return typeof t=="symbol"?t:t+""}function wf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var so=class{constructor(t){hn(this,"context",void 0),hn(this,"adBreakIsShowing",!1),hn(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),hn(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()})}},kl=Object.defineProperty,Ef=Object.defineProperties,Af=Object.getOwnPropertyDescriptors,il=Object.getOwnPropertySymbols,If=Object.prototype.hasOwnProperty,Sf=Object.prototype.propertyIsEnumerable,ol=(e,t,r)=>t in e?kl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Rf=(e,t)=>{for(var r in t||(t={}))If.call(t,r)&&ol(e,r,t[r]);if(il)for(var r of il(t))Sf.call(t,r)&&ol(e,r,t[r]);return e},kf=(e,t)=>Ef(e,Af(t)),Tf=(e,t)=>{for(var r in t)kl(e,r,{get:t[r],enumerable:!0})},Tl=(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},xf=(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 Cf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Of(e){return typeof e=="string"}function Pf(e){return typeof e=="undefined"}function Df(e){return Pf(e)||e===null}function Nf(e){return typeof e=="function"}function xl(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 Lf=(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))(Lf||{});function er(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Uf={log:er("log"),warn:er("warn"),info:er("info"),error:er("error"),debug:er("debug")};Object.assign(globalThis,{logger:Uf});var al=Symbol.for("Jolibox.canIUseMap"),Mf={};globalThis[al]||(globalThis[al]=Mf);var sl=Symbol.for("Jolibox.canIUseMap.native"),Bf={};globalThis[sl]||(globalThis[sl]=Bf);var Cl=(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))(Cl||{}),Ol=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Ol||{}),Pl=(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))(Pl||{}),ll=["name","params"],Ff=["name","type","location","target","extra","timestamp","userId"],jf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function vn(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 Vf(e){let t=e.location?vn(e.location,ll):null,r=e.target?vn(e.target,ll):null;return vn(kf(Rf({},e),{location:t,target:r}),Ff)}function Hf(e){let t=e.events.map(n=>Vf(n)),r=vn(e.device,jf);return[e.protocolVersion,t,r,e.project]}function Jf(){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}}Jf();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var lo=class uo{constructor(t){this.element=t,this.next=uo.Undefined,this.prev=uo.Undefined}};lo.Undefined=new lo(void 0);var te=lo,$f=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}},Gf=0,tr=class{constructor(e){this.value=e,this.id=Gf++}},or=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 tr&&(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 tr(e);return this._listeners?this._listeners instanceof tr?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,m,v;if(!this._disposed){if(this._listeners instanceof tr)this._listeners.id===u.id&&(this._listeners=void 0,this._size=0,(y=(d=this.options)==null?void 0:d.onDidRemoveLastListener)==null||y.call(d));else if(this._listeners){let f=this._listeners.indexOf(u);f>=0&&(this._listeners.splice(f,1),this._size--,this._size===0&&((v=(m=this.options)==null?void 0:m.onDidRemoveLastListener)==null||v.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 tr?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},qf=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 or,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 $f,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)}},co={};Tf(co,{None:()=>Kf,filter:()=>zf,once:()=>Dl,toPromise:()=>Wf});var Kf=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function Wf(e){return new Promise(t=>Dl(e)(t))}function Dl(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 zf(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new or(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 eo=Symbol.for("Jolibox.hostEmitter"),Qf=()=>{let e=new qf;return globalThis[eo]||(globalThis[eo]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[eo]};Qf();function Yf(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)Xf(e[n],t[n])}function Xf(e,t){if(Of(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Nf(t)){try{if(e instanceof t)return}catch(r){}if(!Df(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 fo=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new or,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 Yf(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}};fo=Tl([xl],fo);var ul=class{constructor(){this._onWillExecuteCommand=new or,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new or,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new fo,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Cf(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 xf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),co.toPromise(co.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=Tl([xl],ul);function to(e,t,r){return(t=Zf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Zf(e){var t=eh(e,"string");return typeof t=="symbol"?t:t+""}function eh(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 ho=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";to(this,"context",void 0),to(this,"placement","GAME"),to(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:Pl.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:Cl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Ol.WebSDK};return Hf(i)}};function mn(e,t,r){return(t=th(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function th(e){var t=rh(e,"string");return typeof t=="symbol"?t:t+""}function rh(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 mo=class{constructor(t){mn(this,"configs",null),mn(this,"firstRun",!0),mn(this,"context",void 0),mn(this,"contextInfo",void 0),this.context=t,this.contextInfo=this.context.getContextInfo(),this.init()}init(){return L(this,null,function*(){try{this.configs=yield this.context.httpClient.get("/api/fe-configs/js-sdk/ads-channel-config",{})}catch(t){}})}shouldBypassCallingInterstitial(){var t,r;let n;if(!this.configs)this.init(),n=!this.firstRun;else{let 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 qe(e,t,r){return(t=nh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nh(e){var t=ih(e,"string");return typeof t=="symbol"?t:t+""}function ih(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 po=class{constructor(t,r){qe(this,"name","ADSENSE"),qe(this,"context",void 0),qe(this,"contextInfo",void 0),qe(this,"configured",!1),qe(this,"initParams",void 0),qe(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),qe(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=_f(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),qe(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),qe(this,"adUnit",n=>L(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:m,style:v}=n,f;if(!u)throw new Error("targeting element is required");if(typeof u=="string"?f=document.querySelector(u):f=u,!f)throw new Error("targeting element not found");let E=d;if(E||(E=this.initParams.unitId),!E)throw new Error("slot is required");let w=typeof y=="object"&&Array.isArray(y)?y.join(", "):y,S=document.createElement("ins");if(S.className="adsbygoogle",S.id="jolibox-ads",S.style.display="block",S.setAttribute("data-ad-client",this.initParams.clientId),S.setAttribute("data-ad-slot",E),w&&S.setAttribute("data-ad-format",w),m&&S.setAttribute("data-full-width-responsive",m),v&&S.setAttribute("style",v),(s=this.contextInfo.testAdsMode)!=null?s:!1){let b=document.createElement("div");b.style.position="absolute",b.style.top="0",b.style.left="0",b.style.width="100%",b.style.height="100%",b.style.display="flex",b.style.justifyContent="center",b.style.alignItems="center",b.style.backgroundColor="rgba(0, 0, 0, 0.5)",b.style.color="white",b.innerHTML="Test Ad",S.style.position="relative",f.appendChild(S),S.appendChild(b)}else f.appendChild(S),new MutationObserver(b=>{b.forEach(x=>{if(x.type==="attributes"&&x.attributeName==="data-ad-status"){let P=S.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:P!=null?P:"null"})}})}).observe(S,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return L(this,null,function*(){var t;if(this.context.track("CallAdsInit",{provider:this.name}),typeof window=="undefined")return;let r="google-adsense",n=(t=this.contextInfo.testAdsMode)!=null?t:!1;if(!document.getElementById(r)&&this.initParams.clientId){let i=document.createElement("script");i.id=r,i.async=!0,i.crossOrigin="anonymous",i.src=`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${this.initParams.clientId}`,n&&i.setAttribute("data-adbreak-test","on"),this.initParams.channelId&&i.setAttribute("data-ad-channel",this.initParams.channelId),this.initParams.admobInterstitialSlot&&this.initParams.admobRewardedSlot&&(i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on")),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};function oh(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 ah(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 sh=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(ah(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=oh(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}(),ge="-ms-",En="-moz-",J="-webkit-",Nl="comm",To="rule",xo="decl",lh="@import",Ll="@keyframes",uh="@layer",ch=Math.abs,kn=String.fromCharCode,dh=Object.assign;function fh(e,t){return he(e,0)^45?(((t<<2^he(e,0))<<2^he(e,1))<<2^he(e,2))<<2^he(e,3):0}function Ul(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 vo(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function ar(e,t,r){return e.slice(t,r)}function Me(e){return e.length}function Co(e){return e.length}function pn(e,t){return t.push(e),e}function mh(e,t){return e.map(t).join("")}var Tn=1,kt=1,Ml=0,Se=0,ce=0,Tt="";function xn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Tn,column:kt,length:a,return:""}}function rr(e,t){return dh(xn("",null,null,"",null,null,0),e,{length:-e.length},t)}function ph(){return ce}function vh(){return ce=Se>0?he(Tt,--Se):0,kt--,ce===10&&(kt=1,Tn--),ce}function Ce(){return ce=Se<Ml?he(Tt,Se++):0,kt++,ce===10&&(kt=1,Tn++),ce}function Be(){return he(Tt,Se)}function _n(){return Se}function lr(e,t){return ar(Tt,e,t)}function sr(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 Bl(e){return Tn=kt=1,Ml=Me(Tt=e),Se=0,[]}function Fl(e){return Tt="",e}function gn(e){return Ul(lr(Se-1,_o(e===91?e+2:e===40?e+1:e)))}function _h(e){for(;(ce=Be())&&ce<33;)Ce();return sr(e)>2||sr(ce)>3?"":" "}function gh(e,t){for(;--t&&Ce()&&!(ce<48||ce>102||ce>57&&ce<65||ce>70&&ce<97););return lr(e,_n()+(t<6&&Be()==32&&Ce()==32))}function _o(e){for(;Ce();)switch(ce){case e:return Se;case 34:case 39:e!==34&&e!==39&&_o(ce);break;case 40:e===41&&_o(e);break;case 92:Ce();break}return Se}function yh(e,t){for(;Ce()&&e+ce!==57&&!(e+ce===84&&Be()===47););return"/*"+lr(t,Se-1)+"*"+kn(e===47?e:Ce())}function bh(e){for(;!sr(Be());)Ce();return lr(e,Se)}function wh(e){return Fl(yn("",null,null,null,[""],e=Bl(e),0,[0],e))}function yn(e,t,r,n,i,o,a,s,u){for(var d=0,y=0,m=a,v=0,f=0,E=0,w=1,S=1,b=1,x=0,P="",V=i,X=o,R=n,D=P;S;)switch(E=x,x=Ce()){case 40:if(E!=108&&he(D,m-1)==58){vo(D+=$(gn(x),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:D+=gn(x);break;case 9:case 10:case 13:case 32:D+=_h(E);break;case 92:D+=gh(_n()-1,7);continue;case 47:switch(Be()){case 42:case 47:pn(Eh(yh(Ce(),_n()),t,r),u);break;default:D+="/"}break;case 123*w:s[d++]=Me(D)*b;case 125*w:case 59:case 0:switch(x){case 0:case 125:S=0;case 59+y:b==-1&&(D=$(D,/\f/g,"")),f>0&&Me(D)-m&&pn(f>32?dl(D+";",n,r,m-1):dl($(D," ","")+";",n,r,m-2),u);break;case 59:D+=";";default:if(pn(R=cl(D,t,r,d,y,i,s,P,V=[],X=[],m),o),x===123)if(y===0)yn(D,t,R,R,V,o,m,s,X);else switch(v===99&&he(D,3)===110?100:v){case 100:case 108:case 109:case 115:yn(e,R,R,n&&pn(cl(e,R,R,0,0,i,s,P,i,V=[],m),X),i,X,m,s,n?V:X);break;default:yn(D,R,R,R,[""],X,0,s,X)}}d=y=f=0,w=b=1,P=D="",m=a;break;case 58:m=1+Me(D),f=E;default:if(w<1){if(x==123)--w;else if(x==125&&w++==0&&vh()==125)continue}switch(D+=kn(x),x*w){case 38:b=y>0?1:(D+="\f",-1);break;case 44:s[d++]=(Me(D)-1)*b,b=1;break;case 64:Be()===45&&(D+=gn(Ce())),v=Be(),y=m=Me(P=D+=bh(_n())),x++;break;case 45:E===45&&Me(D)==2&&(w=0)}}return o}function cl(e,t,r,n,i,o,a,s,u,d,y){for(var m=i-1,v=i===0?o:[""],f=Co(v),E=0,w=0,S=0;E<n;++E)for(var b=0,x=ar(e,m+1,m=ch(w=a[E])),P=e;b<f;++b)(P=Ul(w>0?v[b]+" "+x:$(x,/&\f/g,v[b])))&&(u[S++]=P);return xn(e,t,r,i===0?To:s,u,d,y)}function Eh(e,t,r){return xn(e,t,r,Nl,kn(ph()),ar(e,2,-2),0)}function dl(e,t,r,n){return xn(e,t,r,xo,ar(e,0,n),ar(e,n+1,-1),n)}function Rt(e,t){for(var r="",n=Co(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Ah(e,t,r,n){switch(e.type){case uh:if(e.children.length)break;case lh:case xo:return e.return=e.return||e.value;case Nl:return"";case Ll:return e.return=e.value+"{"+Rt(e.children,n)+"}";case To:e.value=e.props.join(",")}return Me(r=Rt(e.children,n))?e.return=e.value+"{"+r+"}":""}function Ih(e){var t=Co(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 Sh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Rh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var kh=function(e,t,r){for(var n=0,i=0;n=i,i=Be(),n===38&&i===12&&(t[r]=1),!sr(i);)Ce();return lr(e,Se)},Th=function(e,t){var r=-1,n=44;do switch(sr(n)){case 0:n===38&&Be()===12&&(t[r]=1),e[r]+=kh(Se-1,t,r);break;case 2:e[r]+=gn(n);break;case 4:if(n===44){e[++r]=Be()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=kn(n)}while(n=Ce());return e},xh=function(e,t){return Fl(Th(Bl(e),t))},fl=new WeakMap,Ch=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&&!fl.get(r))&&!n){fl.set(e,!0);for(var i=[],o=xh(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]}}},Oh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function jl(e,t){switch(fh(e,t)){case 5103:return J+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return J+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return J+e+En+e+ge+e+e;case 6828:case 4268:return J+e+ge+e+e;case 6165:return J+e+ge+"flex-"+e+e;case 5187:return J+e+$(e,/(\w+).+(:[^]+)/,J+"box-$1$2"+ge+"flex-$1$2")+e;case 5443:return J+e+ge+"flex-item-"+$(e,/flex-|-self/,"")+e;case 4675:return J+e+ge+"flex-line-pack"+$(e,/align-content|flex-|-self/,"")+e;case 5548:return J+e+ge+$(e,"shrink","negative")+e;case 5292:return J+e+ge+$(e,"basis","preferred-size")+e;case 6060:return J+"box-"+$(e,"-grow","")+J+e+ge+$(e,"grow","positive")+e;case 4554:return J+$(e,/([^-])(transform)/g,"$1"+J+"$2")+e;case 6187:return $($($(e,/(zoom-|grab)/,J+"$1"),/(image-set)/,J+"$1"),e,"")+e;case 5495:case 3959:return $(e,/(image-set\([^]*)/,J+"$1$`$1");case 4968:return $($(e,/(.+:)(flex-)?(.*)/,J+"box-pack:$3"+ge+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+J+e+e;case 4095:case 3583:case 4068:case 2532:return $(e,/(.+)-inline(.+)/,J+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Me(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return $(e,/(.+:)(.+)-([^]+)/,"$1"+J+"$2-$3$1"+En+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~vo(e,"stretch")?jl($(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,Me(e)-3-(~vo(e,"!important")&&10))){case 107:return $(e,":",":"+J)+e;case 101:return $(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+J+(he(e,14)===45?"inline-":"")+"box$3$1"+J+"$2$3$1"+ge+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return J+e+ge+$(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return J+e+ge+$(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return J+e+ge+$(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return J+e+ge+e+e}return e}var Ph=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case xo:e.return=jl(e.value,e.length);break;case Ll:return Rt([rr(e,{value:$(e.value,"@","@"+J)})],n);case To:if(e.length)return mh(e.props,function(i){switch(hh(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Rt([rr(e,{props:[$(i,/:(read-\w+)/,":"+En+"$1")]})],n);case"::placeholder":return Rt([rr(e,{props:[$(i,/:(plac\w+)/,":"+J+"input-$1")]}),rr(e,{props:[$(i,/:(plac\w+)/,":"+En+"$1")]}),rr(e,{props:[$(i,/:(plac\w+)/,ge+"input-$1")]})],n)}return""})}},Dh=[Ph],Nh=function(e){var t=e.key;if(t==="css"){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(E){var w=E.getAttribute("data-emotion");w.indexOf(" ")!==-1&&(document.head.appendChild(E),E.setAttribute("data-s",""))})}var n=e.stylisPlugins||Dh,i={},o,a=[];o=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(E){for(var w=E.getAttribute("data-emotion").split(" "),S=1;S<w.length;S++)i[w[S]]=!0;a.push(E)});var s,u=[Ch,Oh];{var d,y=[Ah,Sh(function(E){d.insert(E)})],m=Ih(u.concat(n,y)),v=function(E){return Rt(wh(E),m)};s=function(E,w,S,b){d=S,v(E?E+"{"+w.styles+"}":w.styles),b&&(f.inserted[w.name]=!0)}}var f={key:t,sheet:new sh({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 Lh(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 Uh={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},Mh=/[A-Z]|^ms/g,Bh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Vl=function(e){return e.charCodeAt(1)===45},hl=function(e){return e!=null&&typeof e!="boolean"},ro=Rh(function(e){return Vl(e)?e:e.replace(Mh,"-$&").toLowerCase()}),ml=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(Bh,function(r,n,i){return tt={name:n,styles:i,next:tt},n})}return Uh[e]!==1&&!Vl(e)&&typeof t=="number"&&t!==0?t+"px":t};function An(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 tt={name:i.name,styles:i.styles,next:tt},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)tt={name:a.name,styles:a.styles,next:tt},a=a.next;var s=o.styles+";";return s}return Fh(e,t,r)}}var u=r;if(t==null)return u;var d=t[u];return d!==void 0?d:u}function Fh(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=An(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]+"}":hl(s)&&(n+=ro(o)+":"+ml(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++)hl(a[u])&&(n+=ro(o)+":"+ml(o,a[u])+";");else{var d=An(e,t,a);switch(o){case"animation":case"animationName":{n+=ro(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var pl=/label:\s*([^\s;{]+)\s*(;|$)/g,tt;function no(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="";tt=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=An(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=An(r,t,e[s]),n){var u=o;i+=u[s]}pl.lastIndex=0;for(var d="",y;(y=pl.exec(i))!==null;)d+="-"+y[1];var m=Lh(i)+d;return{name:m,styles:i,next:tt}}function Hl(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var jh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Vh=function(e,t,r){jh(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 vl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function _l(e,t,r){var n=[],i=Hl(e,n,r);return n.length<2?r:i+t(n)}var Hh=function(e){var t=Nh(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=no(s,t.registered,void 0);return Vh(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=no(s,t.registered),y="animation-"+d.name;return vl(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=no(s,t.registered);vl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),u=0;u<a;u++)s[u]=arguments[u];return _l(t.registered,r,Jh(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:Hl.bind(null,t.registered),merge:_l.bind(null,t.registered,r)}},Jh=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},$h=Hh({key:"css"}),xt=$h.css,go,xe,io,gl,yl=0,Jl=[],de=M,bl=de.__b,wl=de.__r,El=de.diffed,Al=de.__c,Il=de.unmount,Sl=de.__;function Gh(e,t){de.__h&&de.__h(xe,e,yl||t),yl=0;var r=xe.__H||(xe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function $l(e,t){var r=Gh(go++,7);return Wh(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function qh(){for(var e;e=Jl.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(bn),e.__H.__h.forEach(yo),e.__H.__h=[]}catch(t){e.__H.__h=[],de.__e(t,e.__v)}}de.__b=function(e){xe=null,bl&&bl(e)},de.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Sl&&Sl(e,t)},de.__r=function(e){wl&&wl(e),go=0;var t=(xe=e.__c).__H;t&&(io===xe?(t.__h=[],xe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(bn),t.__h.forEach(yo),t.__h=[],go=0)),io=xe},de.diffed=function(e){El&&El(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Jl.push(t)!==1&&gl===de.requestAnimationFrame||((gl=de.requestAnimationFrame)||Kh)(qh)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),io=xe=null},de.__c=function(e,t){t.some(function(r){try{r.__h.forEach(bn),r.__h=r.__h.filter(function(n){return!n.__||yo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],de.__e(n,r.__v)}}),Al&&Al(e,t)},de.unmount=function(e){Il&&Il(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{bn(n)}catch(i){t=i}}),r.__H=void 0,t&&de.__e(t,r.__v))};var Rl=typeof requestAnimationFrame=="function";function Kh(e){var t,r=function(){clearTimeout(n),Rl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Rl&&(t=requestAnimationFrame(r))}function bn(e){var t=xe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),xe=t}function yo(e){var t=xe;e.__c=e.__(),xe=t}function Wh(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var zh=Symbol.for("preact-signals");function Cn(){if(rt>1)rt--;else{for(var e,t=!1;nr!==void 0;){var r=nr;for(nr=void 0,bo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&ql(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(bo=0,rt--,t)throw e}}function Ie(e){if(rt>0)return e();rt++;try{return e()}finally{Cn()}}var Q=void 0,nr=void 0,rt=0,bo=0,In=0;function Gl(e){if(Q!==void 0){var t=e.n;if(t===void 0||t.t!==Q)return t={i:0,S:e,p:Q.s,n:void 0,t:Q,e:void 0,x:void 0,r:t},Q.s!==void 0&&(Q.s.n=t),Q.s=t,e.n=t,32&Q.f&&e.S(t),t;if(t.i===-1)return t.i=0,t.n!==void 0&&(t.n.p=t.p,t.p!==void 0&&(t.p.n=t.n),t.p=Q.s,t.n=void 0,Q.s.n=t,Q.s=t),t}}function me(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}me.prototype.brand=zh;me.prototype.h=function(){return!0};me.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)};me.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)}};me.prototype.subscribe=function(e){var t=this;return cr(function(){var r=t.value,n=Q;Q=void 0;try{e(r)}finally{Q=n}})};me.prototype.valueOf=function(){return this.value};me.prototype.toString=function(){return this.value+""};me.prototype.toJSON=function(){return this.value};me.prototype.peek=function(){var e=Q;Q=void 0;try{return this.value}finally{Q=e}};Object.defineProperty(me.prototype,"value",{get:function(){var e=Gl(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(bo>100)throw new Error("Cycle detected");this.v=e,this.i++,In++,rt++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Cn()}}}});function Y(e){return new me(e)}function ql(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 Kl(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 Wl(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 Ct(e){me.call(this,void 0),this.x=e,this.s=void 0,this.g=In-1,this.f=4}(Ct.prototype=new me).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===In))return!0;if(this.g=In,this.f|=1,this.i>0&&!ql(this))return this.f&=-2,!0;var e=Q;try{Kl(this),Q=this;var t=this.x();(16&this.f||this.v!==t||this.i===0)&&(this.v=t,this.f&=-17,this.i++)}catch(r){this.v=r,this.f|=16,this.i++}return Q=e,Wl(this),this.f&=-2,!0};Ct.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)}me.prototype.S.call(this,e)};Ct.prototype.U=function(e){if(this.t!==void 0&&(me.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)}};Ct.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(Ct.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=Gl(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ir(e){return new Ct(e)}function zl(e){var t=e.u;if(e.u=void 0,typeof t=="function"){rt++;var r=Q;Q=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Oo(e),n}finally{Q=r,Cn()}}}function Oo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,zl(e)}function Qh(e){if(Q!==this)throw new Error("Out-of-order effect");Wl(this),Q=e,this.f&=-2,8&this.f&&Oo(this),Cn()}function ur(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}ur.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()}};ur.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,zl(this),Kl(this),rt++;var e=Q;return Q=this,Qh.bind(this,e)};ur.prototype.N=function(){2&this.f||(this.f|=2,this.o=nr,nr=this)};ur.prototype.d=function(){this.f|=8,1&this.f||Oo(this)};function cr(e){var t=new ur(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var Ql,oo,Yl=[];cr(function(){Ql=this.N})();function Ot(e,t){M[e]=t.bind(null,M[e]||function(){})}function Sn(e){oo&&oo(),oo=e&&e.S()}function Xl(e){var t=this,r=e.data,n=Zl(r);n.value=r;var i=$l(function(){for(var s=t,u=t.__v;u=u.__;)if(u.__c){u.__c.__$f|=4;break}var d=ir(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=ir(function(){return!Array.isArray(d.value)&&!Vi(d.value)}),m=cr(function(){if(this.N=eu,y.value){var f=d.value;s.__v&&s.__v.__e&&s.__v.__e.nodeType===3&&(s.__v.__e.data=f)}}),v=t.__$u.d;return t.__$u.d=function(){m(),v.call(this)},[y,d]},[]),o=i[0],a=i[1];return o.value?a.peek():a.value}Xl.displayName="_st";Object.defineProperties(me.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:Xl},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Ot("__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 me&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Ot("__r",function(e,t){Sn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return cr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Sn(r),e(t)});Ot("__e",function(e,t,r,n){Sn(),e(t,r,n)});Ot("diffed",function(e,t){Sn();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=Yh(r,u,y,i),o[u]=d):d.o(y,i)}}}e(t)});function Yh(e,t,r,n){var i=t in e&&e.ownerSVGElement===void 0,o=Y(r);return{o:function(a,s){o.value=a,n=s},d:cr(function(){this.N=eu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Ot("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)});Ot("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Re.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 Zl(e){return $l(function(){return Y(e)},[])}var Xh=function(e){queueMicrotask(function(){queueMicrotask(e)})};function Zh(){Ie(function(){for(var e;e=Yl.shift();)Ql.call(e)})}function eu(){Yl.push(this)===1&&(M.requestAnimationFrame||Xh)(Zh)}var ye=xt`
|
|
1
|
+
var Dc=Object.create;var ti=Object.defineProperty,Nc=Object.defineProperties,Lc=Object.getOwnPropertyDescriptor,Uc=Object.getOwnPropertyDescriptors,Mc=Object.getOwnPropertyNames,Ir=Object.getOwnPropertySymbols,Bc=Object.getPrototypeOf,ri=Object.prototype.hasOwnProperty,_a=Object.prototype.propertyIsEnumerable;var va=(e,t,r)=>t in e?ti(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,H=(e,t)=>{for(var r in t||(t={}))ri.call(t,r)&&va(e,r,t[r]);if(Ir)for(var r of Ir(t))_a.call(t,r)&&va(e,r,t[r]);return e},pe=(e,t)=>Nc(e,Uc(t));var Jt=(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 ga=(e,t)=>{var r={};for(var n in e)ri.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&Ir)for(var n of Ir(e))t.indexOf(n)<0&&_a.call(e,n)&&(r[n]=e[n]);return r};var Z=(e,t)=>()=>(e&&(t=e(e=0)),t);var ni=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Fc=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Mc(t))!ri.call(e,i)&&i!==r&&ti(e,i,{get:()=>t[i],enumerable:!(n=Lc(t,i))||n.enumerable});return e};var ii=(e,t,r)=>(r=e!=null?Dc(Bc(e)):{},Fc(t||!e||!e.__esModule?ti(r,"default",{value:e,enumerable:!0}):r,e));var P=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},s=l=>l.done?n(l.value):Promise.resolve(l.value).then(o,a);s((r=r.apply(e,t)).next())});function Wc(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Ra(e){return new Promise(t=>setTimeout(t,e))}function fi(e){return typeof e=="string"}function Ca(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)&&!(e instanceof RegExp)&&!(e instanceof Date)}function Ta(e){return typeof e=="object"&&Array.isArray(e)}function zc(e){return typeof e=="undefined"}function Qc(e){return zc(e)||e===null}function Yc(e){return typeof e=="function"}function ka(e){let t=e,r=null,n=function(...i){return r||(r=new t(...i)),r};return n.prototype=t.prototype,n}function xa(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],d=r(s,l,a,i,o);d!==void 0?i[a]=d:wa(l)&&wa(s)?i[a]=n(Aa({},s),l):Array.isArray(l)&&Array.isArray(s)?i[a]=[...s,...l]:i[a]=l}return i}return n(e,t)}function wa(e){return e&&typeof e=="object"&&e.constructor===Object}function Oa(e,t){if(Array.isArray(e))return e.concat(t)}function Gt(e,t,r={}){let n=null,i,o,a,{leading:s=!1,trailing:l=!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,l&&!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 ed(e,t){return(...r)=>t(e,...r)}function La(e){return t=>ed(t,function(r,...n){if(typeof r=="function")try{return r.apply(this,n)}catch(i){e(new Zc(`${i}`))}})}function Vt(e){return(...t)=>{var r,n;((n=(r=globalThis.VConsole)==null?void 0:r[e])!=null?n:globalThis.console[e])(...t)}}function Ar(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 ad(e){let t=e.location?Ar(e.location,Ia):null,r=e.target?Ar(e.target,Ia):null;return Ar(Gc(Aa({},e),{location:t,target:r}),id)}function _i(e){let t=e.events.map(n=>ad(n)),r=Ar(e.device,od);return[e.protocolVersion,t,r,e.project]}function sd(){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 _d(e){return new Promise(t=>Ba(e)(t))}function Ba(e){return(t,r=null)=>{let n=!1;return e(i=>{if(!n)return n=!0,t.call(r,i)},null)}}function gd(e,t){return(r=>{let n,i={onWillAddFirstListener(){n=r(o.fire,o)}},o=new $t(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++)wd(e[n],t[n])}function wd(e,t){if(fi(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Yc(t)){try{if(e instanceof t)return}catch(r){}if(!Qc(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 Ed(){return typeof globalThis!="undefined"?globalThis[Fa]:void 0}function Id(e){typeof globalThis!="undefined"&&(globalThis[Fa]=e)}function ve(e=!1){let t=Ed();if(!e&&t)return t;let r=new Sr,n=new ci,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 Id(i),i}var di,jc,Jc,Vc,ya,Hc,$c,ba,Aa,Gc,qc,Sa,Kc,Xc,hi,mi,Pa,Da,Zc,Na,Rr,Cr,pi,De,ai,td,vi,Ea,rd,st,gt,nd,Ia,id,od,lt,ld,Ie,ud,cd,dd,Ua,gi,yi,fd,hd,Ma,si,ee,md,pd,Ht,$t,Me,ui,vd,oi,yd,qt,Sr,ci,Fa,V=Z(()=>{"use strict";di=Object.defineProperty,jc=Object.defineProperties,Jc=Object.getOwnPropertyDescriptor,Vc=Object.getOwnPropertyDescriptors,ya=Object.getOwnPropertySymbols,Hc=Object.prototype.hasOwnProperty,$c=Object.prototype.propertyIsEnumerable,ba=(e,t,r)=>t in e?di(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Aa=(e,t)=>{for(var r in t||(t={}))Hc.call(t,r)&&ba(e,r,t[r]);if(ya)for(var r of ya(t))$c.call(t,r)&&ba(e,r,t[r]);return e},Gc=(e,t)=>jc(e,Vc(t)),qc=(e,t)=>{for(var r in t)di(e,r,{get:t[r],enumerable:!0})},Sa=(e,t,r,n)=>{for(var i=n>1?void 0:n?Jc(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&&di(t,r,i),i},Kc=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},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}Xc=(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))(Xc||{}),hi=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}},mi=class extends hi{constructor(){super(...arguments),this.kind="INTERNAL_ERROR"}},Pa=class extends hi{constructor(){super(...arguments),this.kind="USER_ERROR"}},Da=class extends Pa{constructor(){super(...arguments),this.name="USER_VALIDATE_ERROR"}},Zc=class extends Pa{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))}},Na=class extends mi{constructor(){super(...arguments),this.name="INTERNAL_SCHEMA_PARSE_ERROR",this.priority="P0"}},Rr=class extends mi{constructor(){super(...arguments),this.name="INTERNAL_GLOBAL_JS_ERROR",this.priority="P1"}},Cr=class extends hi{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}}},pi=class extends mi{constructor(){super(...arguments),this.name="INTERNAL_REPORTER_ERROR"}};De={log:Vt("log"),warn:Vt("warn"),info:Vt("info"),error:Vt("error"),debug:Vt("debug")};Object.assign(globalThis,{logger:De});ai=Symbol.for("Jolibox.canIUseMap"),td={};globalThis[ai]||(globalThis[ai]=td);vi={get config(){return globalThis[ai]}},Ea=Symbol.for("Jolibox.canIUseMap.native"),rd={};globalThis[Ea]||(globalThis[Ea]=rd);st=(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))(st||{}),gt=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(gt||{}),nd=(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))(nd||{}),Ia=["name","params"],id=["name","type","location","target","extra","timestamp","userId"],od=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];lt=()=>"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)});sd();ld=()=>!!(navigator.userAgent||"").includes("JoliboxPlatformSDK"),Ie={isiOS:navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),iosVersion:()=>{let e=navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/);return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3]||"0",10)]},isAndroid:navigator.userAgent.includes("Android"),isMac:navigator.userAgent.includes("Mac"),isFacebook:navigator.userAgent.includes("FB_IAB"),isPC:!navigator.userAgent.includes("iPhone")&&!navigator.userAgent.includes("Android")},ud=()=>Ie.isiOS?"iOS":Ie.isAndroid?"Android":Ie.isMac?"Mac":Ie.isFacebook?"Facebook":"PC",cd="device_id",dd="advertising_id",Ua=e=>(window.__joliboxLocalStorage__.getItem(e)||window.__joliboxLocalStorage__.setItem(e,lt()),window.__joliboxLocalStorage__.getItem(e)),gi=()=>new URLSearchParams(window.location.search).get("deviceId")||Ua(cd),yi=()=>new URLSearchParams(window.location.search).get("advertisingId")||Ua(dd),fd=e=>e.charAt(0).toUpperCase()+e.slice(1),hd=()=>{var e;let t=new URLSearchParams(window.location.search);return fd((e=t.get("utm_source"))!=null?e:"")||"JoliboxSDK"},Ma=e=>{if(ld())return window.navigator.userAgent;let t="JoliboxWebSDK",r=ud(),n=navigator.language,i=gi(),o=yi();return`${t} (${hd()}${r}; UnknownModel; UnknownSystemVersion; ${n}) uuid/${i} adid/${o} version/${e||""}`},si=class li{constructor(t){this.element=t,this.next=li.Undefined,this.prev=li.Undefined}};si.Undefined=new si(void 0);ee=si,md=class{constructor(){this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===ee.Undefined}clear(){let e=this._first;for(;e!==ee.Undefined;){let t=e.next;e.prev=ee.Undefined,e.next=ee.Undefined,e=t}this._first=ee.Undefined,this._last=ee.Undefined,this._size=0}unshift(e){return this._insert(e,!1)}push(e){return this._insert(e,!0)}_insert(e,t){let r=new ee(e);if(this._first===ee.Undefined)this._first=r,this._last=r;else if(t){let i=this._last;this._last=r,r.prev=i,i.next=r}else{let i=this._first;this._first=r,r.next=i,i.prev=r}this._size+=1;let n=!1;return()=>{n||(n=!0,this._remove(r))}}shift(){if(this._first!==ee.Undefined){let e=this._first.element;return this._remove(this._first),e}}pop(){if(this._last!==ee.Undefined){let e=this._last.element;return this._remove(this._last),e}}_remove(e){if(e.prev!==ee.Undefined&&e.next!==ee.Undefined){let t=e.prev;t.next=e.next,e.next.prev=t}else e.prev===ee.Undefined&&e.next===ee.Undefined?(this._first=ee.Undefined,this._last=ee.Undefined):e.next===ee.Undefined?(this._last=this._last.prev,this._last.next=ee.Undefined):e.prev===ee.Undefined&&(this._first=this._first.next,this._first.prev=ee.Undefined);this._size-=1}*[Symbol.iterator](){let e=this._first;for(;e!==ee.Undefined;)yield e.element,e=e.next}},pd=0,Ht=class{constructor(e){this.value=e,this.id=pd++}},$t=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 Ht&&(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 d=new Ht(t);return this._listeners?this._listeners instanceof Ht?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)),(l=(s=this.options)==null?void 0:s.onDidAddListener)==null||l.call(s,this),this._size++,()=>{var y,h,p,f;if(!this._disposed){if(this._listeners instanceof Ht)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 Ht?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},Me=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 $t,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 md,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)}},ui={};qc(ui,{None:()=>vd,filter:()=>gd,once:()=>Ba,toPromise:()=>_d});vd=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});oi=Symbol.for("Jolibox.hostEmitter"),yd=()=>{let e=new Me;return globalThis[oi]||(globalThis[oi]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[oi]},qt=yd();Sr=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new $t,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}};Sr=Sa([ka],Sr);ci=class{constructor(){this._onWillExecuteCommand=new $t,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new $t,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Sr,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Wc(3e4)),this._starActivation}executeCommand(e,...t){return Kc(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,t):(yield Promise.all([Promise.race([this._activateStar(),ui.toPromise(ui.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}}};ci=Sa([ka],ci);Fa=Symbol.for("Jolibox.commands")});function Re(e,t={}){bi.emit("ERROR_REPORT",{error:e,options:t})}var bi,ut,$e=Z(()=>{"use strict";V();V();bi=new Me,ut=new Me;Re.debounce=Gt(Re,50,{leading:!0})});var wi,Ad,ja,Ja,Va=Z(()=>{"use strict";V();$e();wi=e=>{let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=t.length%4===0?"":"=".repeat(4-t.length%4),n=atob(t+r);try{return JSON.parse(n)}catch(i){return{}}},Ad=e=>{let t=JSON.stringify(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")},ja=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:wi(o),payloadJson:wi(a),signature:wi(s)}}else throw"joli_source is missing"}catch(r){return Re(new Na(`${e} not a valid schema: ${r}`)),{headerJson:{},payloadJson:{},signature:{}}}},Ja=(e,t)=>{let r=t.split(".");if(r&&r.length===3){let n=r[0],i=Ad(e),o=r[2];return`${n}.${i}.${o}`}return t}});var Sd,Tr,Ha,Ei=Z(()=>{"use strict";V();Sd="1.1.39",Tr=()=>Sd,Ha=()=>{let e=Tr();return`${Ma(e)}`}});function $a(e,t){return(document==null?void 0:document.head.querySelector(`meta[name="${e}"][content="${t}"]`))!==null}var Rd,Ga,Ii,qa,oe,Cd,D,_e=Z(()=>{"use strict";V();Va();Ei();V();Rd={deviceInfo:{brand:"UnknownBrand",model:"UnknownModel",did:gi(),adId:yi(),pixelRatio:window.devicePixelRatio||1,platform:Ie.isAndroid?"android":Ie.isiOS?"ios":"h5",system:"UnknownSystemVersion",lang:"zh"},sdkInfo:{nativeSDKVersion:"",jssdkVersion:Tr()},schema:window.location.href,platform:Ie.isAndroid?"android":Ie.isiOS?"ios":"h5"},Ii=(Ga=globalThis.joliboxJSCore)==null?void 0:Ga.env,oe=Object.assign({},(qa=Ii==null?void 0:Ii())!=null?qa:Rd);Cd=()=>{var f,b,I,S,w,k,N,j,W,R,L;let{payloadJson:e,headerJson:t,signature:r}=oe.schema.length?ja(oe.schema):{},n=`${oe.deviceInfo.did}-${new Date().getTime()}`,o=new URL(oe.schema.length?oe.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=(S=oe.clientSessionId)!=null?S:e==null?void 0:e.sessionId)!=null?w:o.get("sessionId"))!=null?k:n,l=!!((j=(N=e==null?void 0:e.testAdsMode)!=null?N:e==null?void 0:e.__testAdsMode)!=null?j:o.get("testAdsMode")==="true"),d=(L=(R=(W=e==null?void 0:e.joliboxEnv)!=null?W:e==null?void 0:e.__joliboxEnv)!=null?R:o.get("joliboxEnv"))!=null?L:"production",y=d==="staging",h=t==null?void 0:t.channel,p=e==null?void 0:e.__shouldInterupt;return{get testMode(){return y},get testAdsMode(){return l},get joliboxEnv(){return d},get joliSource(){var O;return(O=o.get("joliSource"))!=null?O:null},get mpId(){var O;return(O=a!=null?a:e==null?void 0:e.id)!=null?O:""},get mpVersion(){var O;return(O=t==null?void 0:t.ver)!=null?O:Tr()},get mpType(){var O,B;return(B=(O=t==null?void 0:t.__mpType)!=null?O:e==null?void 0:e.__mpType)!=null?B:"game"},get platform(){var O;return((O=oe.platform)!=null?O:oe.deviceInfo.platform).toLowerCase()},get deviceInfo(){return oe.deviceInfo},get sdkInfo(){return oe.sdkInfo},get hostInfo(){return oe.hostInfo},get hostUserInfo(){return oe.hostUserInfo},get sessionId(){var O,B;return(B=(O=oe.clientSessionId)!=null?O:s)!=null?B:n},get channel(){return h},get webviewId(){var O;return(O=oe.webviewId)!=null?O:-1},get shouldInterupt(){return p},get from(){return e==null?void 0:e.__from},get baseApiHost(){return y?"https://stg-api.jolibox.com":"https://api.jolibox.com"},get adId(){var O;return(O=oe.deviceInfo.adId)!=null?O:oe.deviceInfo.did},get language(){return oe.deviceInfo.lang},get sdkEnvironment(){return $a("dlightek","jolibox")?"dlightek":o.get("huaweiQuick")==="true"?"huaweiQuick":$a("gamedistribution","jolibox")?"gamedistribution":"jolibox"},get viewport(){var Q,ne,Ee;let O=(Q=oe.deviceInfo.pixelRatio)!=null?Q:1,B=(ne=oe.deviceInfo.statusBarHeight)!=null?ne:e==null?void 0:e.__androidStatusBarHeight,z=(Ee=oe.deviceInfo.navigationBarHeight)!=null?Ee:e==null?void 0:e.__androidNavigationBarHeight;return{statusBarHeight:B!==void 0?B/O:20,navigationBarHeight:z!==void 0?z/O:10}},onEnvConfigChanged:O=>{xa(oe,O,Oa)},encodeJoliSourceQuery:O=>{var B,z;return t&&r?Ja(H(H({},e),O),(B=o.get("joliSource"))!=null?B:""):(z=o.get("joliSource"))!=null?z:""},setDoExitDirectly:()=>{p=!1}}},D=Cd()});var Ai,Wa,Td,kd,Ka,xd,za=Z(()=>{"use strict";V();$e();_e();V();Ai=!1,Wa=(e,t)=>e==null?!1:t in e,Td=e=>Wa(e,"kind"),kd=e=>{let t=e.toLowerCase().split("_");return t[0]+t.slice(1).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join("")},Ka=(e,t={},r)=>{var o,a,s;let n={user_id:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",device_id:(s=D.deviceInfo.did)!=null?s:"",timestamp:Date.now(),tag:kd(e.name)},i=pe(H({},n),{env:t.environment,isFromUser:r});r?ut.emit("GLOBAL_USER_ERROR",e,i):ut.emit("GLOBAL_ERROR",e,i)},xd=e=>Wa(e,"kind")&&e.kind==="USER_ERROR";bi.on("ERROR_REPORT",({error:e,options:t})=>{if(Ai)return;Ai=!0;let r=Td(e)&&e.raw?e.raw:e;try{let n=xd(e);Ka(e,t,n)}catch(n){let i=n instanceof Error?n.message:String(n),o=new pi(`${i}, origin error: ${r.message}`);De.error(o),Ka(new pi(o.message),{environment:t.environment},!1)}finally{Ai=!1}})});var Si,Ri=Z(()=>{"use strict";$e();V();$e();Si=e=>new Da(e)});function Qa(e,t){let r=(n,i,o)=>{let d=i!=null?i:{},{eventType:a}=d,s=ga(d,["eventType"]),l=pe(H({tag:n,eventType:a!=null?a:st.Other},t),{extra:H({},s)});n=="globalJsError"?Re(new Rr(JSON.stringify(l))):e("systemLog",l,o)};return r.debounce=Gt(r,500,{leading:!0}),r}function Ya(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=Gt(t,500,{leading:!0}),t}var Xa=Z(()=>{"use strict";V();V();$e()});function Za(e,t){let r=Qa(e,t),n=Ya(r);return{track:r,trackPerformance:n}}var es=Z(()=>{"use strict";Xa()});var Ci=Z(()=>{"use strict"});var kr,ts=Z(()=>{"use strict";_e();V();V();kr=class{constructor(){this.deviceInfo=null;this.samplesConfig=null;this.fetchSamplesConfig()}fetchSamplesConfig(){return P(this,null,function*(){let r=`${D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"}/api/fe-configs/js-sdk/samples-config`,n=yield(yield fetch(r)).json();this.samplesConfig=n})}checkIsSampled(t){if(!this.samplesConfig)return!1;let{samples:r}=this.samplesConfig;for(let[n,i]of Object.entries(r))if(i.includes(t.name))return Math.floor(Math.random()*101)<parseFloat(n);return!1}getDevice(){var n,i,o,a,s;let{nativeSDKVersion:t,jssdkVersion:r}=D.sdkInfo;return{platform:1e3,os:D.deviceInfo.platform,appVersion:(n=t!=null?t:r)!=null?n:"1.0.0",appId:(o=(i=D.hostInfo)==null?void 0:i.aid)!=null?o:"1",model:(a=D.deviceInfo.model)!=null?a:"UnknownModel",brand:(s=D.deviceInfo.brand)!=null?s:"UnknownBrand",uuid:D.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:[pe(H({},t),{location:i,target:o,extra:a,timestamp:Date.now(),userId:null})],device:s,project:r};try{n?yield this.doReport(_i(d),n):yield this.doReport(_i(d))}catch(y){De.log("[Jolibox SDK] report API error",y)}})}}});var Ti=Z(()=>{"use strict";es();Ci();ts()});var ki,rs,Ge,xr,Ue,yt=Z(()=>{"use strict";Ei();_e();V();ki=e=>{let t=new AbortController;return setTimeout(()=>t.abort(),e),t.signal};(rs=AbortSignal.timeout)!=null||(AbortSignal.timeout=ki);Ge=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 xr(t);return e.getInstance().httpClients.add(r),r}recordNetworkRequest(t){this.networkRequests.push(t),this.networkRequests.length>this.maxRequestsToTrack&&this.networkRequests.shift()}},xr=class{constructor(t){this.xua=Ha();this.getJoliSource=()=>D.joliSource;var n;let r=D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com";this.baseUrl=(n=t==null?void 0:t.baseUrl)!=null?n:r}get(t,r){return 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}`:""}`,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(l,{method:"GET",headers:o,credentials:"include",signal:ki(i!=null?i:3e4)});return Ge.getInstance().recordNetworkRequest(!0),yield h.json()}catch(n){throw Ge.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(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,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":Ie.isAndroid?"ANDROID":Ie.isiOS?"IOS":"PC"},{"x-runtime-type":"WEB"});let p=yield fetch(d,{method:"POST",headers:a,body:JSON.stringify(n),signal:ki(o!=null?o:3e4),credentials:"include"});Ge.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 Ge.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(),d=`${this.baseUrl}${t}${l?`?${l}`:""}`,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 Ge.getInstance().recordNetworkRequest(!1),new Error(`HTTP error! status: ${p.status}`);return Ge.getInstance().recordNetworkRequest(!0),yield p.json()}catch(n){throw console.error("Error:",n),n}})}};window.JoliboxHttpClient=xr;Ue=Ge.getInstance()});var xi,Or,Oi=Z(()=>{"use strict";_e();Ti();yt();xi=class extends kr{constructor(){super(...arguments);this.hostToApiMap={default:{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.jolibox.com":{test:"https://stg-collect.jolibox.com",prod:"https://collect.jolibox.com"},"oss.pico-game.com":{test:"https://stg-collect.pico-game.com",prod:"https://collect.pico-game.com"}};this.httpClient=Ue.create({baseUrl:this.apiBaseURL})}get apiBaseURL(){var n,i;let r=(n=this.hostToApiMap[window.location.host])!=null?n:this.hostToApiMap.default;return(i=D.testMode)!=null&&i?r.test:r.prod}doReport(r){this.httpClient.post("/report",{data:r,timeout:5e3}).catch(n=>{console.info("report error",n)})}},Or=new xi});var Od,ns=Z(()=>{"use strict";za();V();Ri();V();Oi();_e();Od=(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:st.ErrorTrace,location:null,target:null,extra:r,timestamp:Date.now(),userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:null};Or.trackEvent(n,gt.WebSDK)};ut.on("GLOBAL_ERROR",(e,t)=>{Od(t.tag,e)});ut.on("GLOBAL_USER_ERROR",(e,t)=>{De.log("UserError",e,t)})});var Pr,is=Z(()=>{"use strict";Pr=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)},l=()=>{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():l())});let p=this.visible;return{start(){o||(o=!0,p?d():l())},stop(){o=!1,y(),h()}}}}});var Dr,os=Z(()=>{"use strict";_e();is();yt();Dr=class extends Pr{constructor(r,n,i){super(n,i);this.httpClient=Ue.create();this.gameId=D.mpId,this.sessionId=D.sessionId,this.track=r}reporter(r){return P(this,null,function*(){let{event:n,params:i}=r;yield this.httpClient.post("/api/base/app-event",{data:{eventType:n,gameInfo:H({gameId:this.gameId,sessionId:this.sessionId},i)}})})}tracker(r,n=null){this.track(r,n)}}});var as,Pd,Be,Dd,Pi,ct,dt=Z(()=>{"use strict";ns();V();V();Ti();Oi();os();_e();Ci();as=ve(),Pd={type:gt.WebSDK,platform:"h5",jssdk_version:D.sdkInfo.jssdkVersion,mp_id:D.mpId,mp_version:D.mpVersion},{track:Be,trackPerformance:Dd}=Za((...e)=>{var a,s,l,d;let[,t]=e,r=t,n=Ca(r.extra)?r.extra:fi(r.extra)?JSON.parse(r.extra):{},i=pe(H({},n),{mp_id:(a=r.mp_id)!=null?a:"",mp_version:(s=r.mp_version)!=null?s:""}),o={name:t.tag,type:st.System,location:null,target:null,extra:i,timestamp:Date.now(),userId:(d=(l=D.hostUserInfo)==null?void 0:l.uid)!=null?d:null};Or.trackEvent(o,gt.WebSDK)},Pd);as.registerCommand("ReportSDK.traceSystemTimeline",({event:e,duration:t,extra:r})=>{Dd(e,t,r)});as.registerCommand("ReportSDK.traceSystem",({event:e,info:t})=>{Be(e,t)});Pi=new Me,ct=new Dr(Be,Pi)});function ss(e){let t=vi.config[e];return t||(t={},vi.config[e]=t),(r,n)=>{if(t[r]){De.warn(`[can i use] ${r} already registered`);return}t[r]=H({},n)}}var ls=Z(()=>{"use strict";V()});function Di(e){us=e}function Nr(e){return e===null||typeof e!="object"?e:Array.isArray(e)?e.map(t=>Nr(t)):Object.keys(e).reduce((t,r)=>(t[r]=Nr(e[r]),t),{})}function qe(e){return typeof e=="number"}function Ni(e){let t=Li(e);switch(t){case"string":return`"${e}"`;case"number":case"boolean":case"null":case"undefined":return String(e);default:return`a(n) ${t}`}}function Li(e){return typeof e=="function"?"function":Object.prototype.toString.call(e).slice(8).slice(0,-1).toLowerCase()}var us,ce,Lr,Ur,Mr,Br,bt,Fr,jr,Jr,Vr,Hr,$r,Gr,qr,Kr,Wr,zr,Qr,Ui=Z(()=>{"use strict";us=!1;ce=class{constructor(){this.errors=[];this.hasFallback=!1;this.hasDefault=!1;this._optional=!1}fail(t){if(us)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 ${Ni(t.actual)}`,this.errors.push(r)}return!1}fallback(t){return this.hasFallback=!0,this._fallback=t,this}get fallbackValue(){return Nr(this._fallback)}default(t){return this.hasDefault=!0,this._default=t,this}get defaultValue(){return typeof this._default=="function"?this._default:Nr(this._default)}optional(){return this._optional=!0,this}};Lr=class extends ce{validate(t){return this._optional&&t===void 0?!0:qe(t)?qe(this._min)&&t<this._min?this.fail(`the value of ${this.path} should be greater than or equal to ${this._min}`):qe(this._max)&&t>this._max?this.fail(`the value of ${this.path} should be less than or equal to ${this._max}`):qe(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}},Ur=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="boolean"?this.fail({expect:"boolean",actual:t}):!0}},Mr=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(qe(this._maxLength)&&t.length>this._maxLength)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxLength}`);if(qe(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}},Br=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="symbol"?this.fail({expect:"symbol",actual:t}):!0}},bt=class extends ce{validate(t){return!0}},Fr=class extends ce{validate(t){return t!==void 0?this.fail({expect:"undefined",actual:t}):!0}},jr=class extends ce{validate(t){return this._optional&&t===void 0?!0:t!==null?this.fail({expect:"null",actual:t}):!0}},Jr=class extends ce{validate(t){return this._optional&&t===void 0?!0:typeof t!="function"?this.fail({expect:"function",actual:t}):!0}},Vr=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 ${Ni(t)}`)}return!0}},Hr=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(qe(this._minItems)&&r.length<this._minItems)return this.fail(`the length of ${this.path} should be greater than or equal to ${this._minItems}`);if(qe(this._maxItems)&&r.length>this._maxItems)return this.fail(`the length of ${this.path} should be less than or equal to ${this._maxItems}`);if(qe(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}},$r=class extends ce{constructor(r){super();this._value=r}validate(r){if(this._optional&&r===void 0)return!0;if(Li(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}},Gr=class extends ce{constructor(r={}){super();this._object=r}validate(r){if(this._optional&&r===void 0)return!0;if(Li(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}},qr=class extends ce{constructor(r){super();this.value=r}validate(r){return r===void 0&&this._optional?!0:r!==this.value?this.fail({expect:Ni(this.value),actual:r}):!0}},Kr=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}},Wr=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}},zr=class extends ce{validate(t){return t===void 0&&this._optional||t instanceof ArrayBuffer?!0:this.fail({expect:"arraybuffer",actual:t})}},Qr=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 Mi(e,t,r="param"){if(e.errors=[],e.path=r,Di(!0),!e.validate(t)){let n=e.errors.join(`
|
|
3
|
+
`);throw e.errors.length=0,Di(!1),new TypeError(n)}}var F,Bi=Z(()=>{"use strict";Ui();Ui();F={object(e){return new Gr(e)},array(e){return new Hr(e)},tuple(...e){return new Wr(...e)},literal(e){return new qr(e)},or(...e){return new Kr(...e)},symbol(){return new Br},record(e){return new $r(e)},function(){return new Jr},boolean(){return new Ur},string(){return new Mr},number(){return new Lr},undefined(){return new Fr},null(){return new jr},unknown(){return new bt},any(){return new bt},as(){return new bt},arraybuffer(){return new zr},enum(...e){return new Vr(...e)},typedarray(e){return new Qr(e)}}});var Yr,cs,ds=Z(()=>{"use strict";V();$e();Bi();Ri();Yr=1,cs=e=>{function t(n,i){return(...o)=>{var h,p,f,b;let a=Date.now(),s={method:n,trace_id:Yr};Yr+=1;let l="SUCCESS",d=`${n}:ok`,y=0;try{if(i.paramsSchema)try{Mi(i.paramsSchema,o,"params")}catch(k){throw Si(`${n}:fail ${k.message}`)}let I=i.implement(...o),S=I,w=`${n}:ok`;if(I&&"code"in I){let{code:k,data:N,message:j}=I;l=k,S=N,w=j}return{code:l,message:w,data:S}}catch(I){let S=I;y=(p=(h=S.code)!=null?h:S.errNo)!=null?p:2e3,l="FAILURE";let w=(b=(f=S.message)!=null?f:S.errMsg)!=null?b:`${I}`;return d=`${n}:${l} ${w.replace(/^\S+:(fail|cancel)\s?/,"")}`,Re(new Cr(d,y)),{code:l,message:d}}finally{let I=Date.now()-a;e("apiInvoked",pe(H({},s),{duration:I,status:l}))}}}function r(n,i){return(...o)=>P(this,null,function*(){var p,f,b,I;let a=Ta(o)?o:[o],s=Date.now(),l={method:n,trace_id:Yr};Yr+=1;let d=`${n}:ok`,y="SUCCESS",h={code:y,message:d};try{if(i.paramsSchema)try{Mi(i.paramsSchema,a,"params")}catch(k){throw Si(k.message)}let w=yield i.implement(...a);if(w&&"code"in w){let{code:k,data:N,message:j}=w;y=k,d=j,w=N}return Object.assign(h,{code:y,message:d,data:w}),h}catch(S){let w=S,k=(f=(p=w.code)!=null?p:w.errNo)!=null?f:2e3;y="FAILURE";let N=(I=(b=w.message)!=null?b:w.errMsg)!=null?I:`${S}`,j=`${n}:${y} ${N.replace(/^\S+:(fail|cancel)\s?/,"")}`;return Object.assign(h,{code:y,message:j}),Re(new Cr(j,k)),h}finally{let S=Date.now()-s;e("apiInvoked",pe(H({},l),{duration:S,status:y}))}})}return{createAPI:r,createSyncAPI:t}}});var Ke,ft,ge,Kt=Z(()=>{"use strict";ls();dt();ds();Bi();({createAPI:Ke,createSyncAPI:ft}=cs(Be)),ge=ss("h5")});var ps=ni((ms,Vi)=>{(function(e){if(typeof ms=="object"&&typeof Vi!="undefined")Vi.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 Jt=="function"&&Jt;if(!h&&p)return p(y,!0);if(l)return l(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 S=i[y][1][I];return s(S||I)},b,b.exports,n,i,o,a)}return o[y].exports}for(var l=typeof Jt=="function"&&Jt,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,l;if(s){var d=0,y=new s(I),h=a.document.createTextNode("");y.observe(h,{characterData:!0}),l=function(){h.data=d=++d%2}}else if(!a.setImmediate&&typeof a.MessageChannel!="undefined"){var p=new a.MessageChannel;p.port1.onmessage=I,l=function(){p.port2.postMessage(0)}}else"document"in a&&"onreadystatechange"in a.document.createElement("script")?l=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)}:l=function(){setTimeout(I,0)};var f,b=[];function I(){f=!0;for(var w,k,N=b.length;N;){for(k=b,b=[],w=-1;++w<N;)k[w]();N=b.length}f=!1}i.exports=S;function S(w){b.push(w)===1&&!f&&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={},d=["REJECTED"],y=["FULFILLED"],h=["PENDING"];i.exports=p;function p(R){if(typeof R!="function")throw new TypeError("resolver must be a function");this.state=h,this.queue=[],this.outcome=void 0,R!==s&&S(this,R)}p.prototype.catch=function(R){return this.then(null,R)},p.prototype.then=function(R,L){if(typeof R!="function"&&this.state===y||typeof L!="function"&&this.state===d)return this;var O=new this.constructor(s);if(this.state!==h){var B=this.state===y?R:L;b(O,B,this.outcome)}else this.queue.push(new f(O,R,L));return O};function f(R,L,O){this.promise=R,typeof L=="function"&&(this.onFulfilled=L,this.callFulfilled=this.otherCallFulfilled),typeof O=="function"&&(this.onRejected=O,this.callRejected=this.otherCallRejected)}f.prototype.callFulfilled=function(R){l.resolve(this.promise,R)},f.prototype.otherCallFulfilled=function(R){b(this.promise,this.onFulfilled,R)},f.prototype.callRejected=function(R){l.reject(this.promise,R)},f.prototype.otherCallRejected=function(R){b(this.promise,this.onRejected,R)};function b(R,L,O){a(function(){var B;try{B=L(O)}catch(z){return l.reject(R,z)}B===R?l.reject(R,new TypeError("Cannot resolve promise with itself")):l.resolve(R,B)})}l.resolve=function(R,L){var O=w(I,L);if(O.status==="error")return l.reject(R,O.value);var B=O.value;if(B)S(R,B);else{R.state=y,R.outcome=L;for(var z=-1,Q=R.queue.length;++z<Q;)R.queue[z].callFulfilled(L)}return R},l.reject=function(R,L){R.state=d,R.outcome=L;for(var O=-1,B=R.queue.length;++O<B;)R.queue[O].callRejected(L);return R};function I(R){var L=R&&R.then;if(R&&(typeof R=="object"||typeof R=="function")&&typeof L=="function")return function(){L.apply(R,arguments)}}function S(R,L){var O=!1;function B(Ee){O||(O=!0,l.reject(R,Ee))}function z(Ee){O||(O=!0,l.resolve(R,Ee))}function Q(){L(z,B)}var ne=w(Q);ne.status==="error"&&B(ne.value)}function w(R,L){var O={};try{O.value=R(L),O.status="success"}catch(B){O.status="error",O.value=B}return O}p.resolve=k;function k(R){return R instanceof this?R:l.resolve(new this(s),R)}p.reject=N;function N(R){var L=new this(s);return l.reject(L,R)}p.all=j;function j(R){var L=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var z=new Array(O),Q=0,ne=-1,Ee=new this(s);++ne<O;)Ve(R[ne],ne);return Ee;function Ve(Bt,br){L.resolve(Bt).then(Gn,function(vt){B||(B=!0,l.reject(Ee,vt))});function Gn(vt){z[br]=vt,++Q===O&&!B&&(B=!0,l.resolve(Ee,z))}}}p.race=W;function W(R){var L=this;if(Object.prototype.toString.call(R)!=="[object Array]")return this.reject(new TypeError("must be an array"));var O=R.length,B=!1;if(!O)return this.resolve([]);for(var z=-1,Q=new this(s);++z<O;)ne(R[z]);return Q;function ne(Ee){L.resolve(Ee).then(function(Ve){B||(B=!0,l.resolve(Q,Ve))},function(Ve){B||(B=!0,l.reject(Q,Ve))})}}},{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(u){return typeof u}:function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u};function s(u,m){if(!(u instanceof m))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(u){return}}var d=l();function y(){try{if(!d||!d.open)return!1;var u=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(!u||m)&&typeof indexedDB!="undefined"&&typeof IDBKeyRange!="undefined"}catch(c){return!1}}function h(u,m){u=u||[],m=m||{};try{return new Blob(u,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<u.length;g+=1)_.append(u[g]);return _.getBlob(m.type)}}typeof Promise=="undefined"&&n(3);var p=Promise;function f(u,m){m&&u.then(function(c){m(null,c)},function(c){m(c)})}function b(u,m,c){typeof m=="function"&&u.then(m),typeof c=="function"&&u.catch(c)}function I(u){return typeof u!="string"&&(console.warn(u+" used as a key, but it is not a string."),u=String(u)),u}function S(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var w="local-forage-detect-blob-support",k=void 0,N={},j=Object.prototype.toString,W="readonly",R="readwrite";function L(u){for(var m=u.length,c=new ArrayBuffer(m),_=new Uint8Array(c),g=0;g<m;g++)_[g]=u.charCodeAt(g);return c}function O(u){return new p(function(m){var c=u.transaction(w,R),_=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 B(u){return typeof k=="boolean"?p.resolve(k):O(u).then(function(m){return k=m,k})}function z(u){var m=N[u.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 Q(u){var m=N[u.name],c=m.deferredOperations.pop();if(c)return c.resolve(),c.promise}function ne(u,m){var c=N[u.name],_=c.deferredOperations.pop();if(_)return _.reject(m),_.promise}function Ee(u,m){return new p(function(c,_){if(N[u.name]=N[u.name]||Qo(),u.db)if(m)z(u),u.db.close();else return c(u.db);var g=[u.name];m&&g.push(u.version);var v=d.open.apply(d,g);m&&(v.onupgradeneeded=function(E){var A=v.result;try{A.createObjectStore(u.storeName),E.oldVersion<=1&&A.createObjectStore(w)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+u.name+'" has been upgraded from version '+E.oldVersion+" to version "+E.newVersion+', but the storage "'+u.storeName+'" already exists.');else throw C}}),v.onerror=function(E){E.preventDefault(),_(v.error)},v.onsuccess=function(){var E=v.result;E.onversionchange=function(A){A.target.close()},c(E),Q(u)}})}function Ve(u){return Ee(u,!1)}function Bt(u){return Ee(u,!0)}function br(u,m){if(!u.db)return!0;var c=!u.db.objectStoreNames.contains(u.storeName),_=u.version<u.db.version,g=u.version>u.db.version;if(_&&(u.version!==m&&console.warn('The database "'+u.name+`" can't be downgraded from version `+u.db.version+" to version "+u.version+"."),u.version=u.db.version),g||c){if(c){var v=u.db.version+1;v>u.version&&(u.version=v)}return!0}return!1}function Gn(u){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:u.type})},_.readAsBinaryString(u)})}function vt(u){var m=L(atob(u.data));return h([m],{type:u.type})}function zo(u){return u&&u.__local_forage_encoded_blob}function Nu(u){var m=this,c=m._initReady().then(function(){var _=N[m._dbInfo.name];if(_&&_.dbReady)return _.dbReady});return b(c,u,u),c}function Lu(u){z(u);for(var m=N[u.name],c=m.forages,_=0;_<c.length;_++){var g=c[_];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return u.db=null,Ve(u).then(function(v){return u.db=v,br(u)?Bt(u):v}).then(function(v){u.db=m.db=v;for(var E=0;E<c.length;E++)c[E]._dbInfo.db=v}).catch(function(v){throw ne(u,v),v})}function He(u,m,c,_){_===void 0&&(_=1);try{var g=u.db.transaction(u.storeName,m);c(null,g)}catch(v){if(_>0&&(!u.db||v.name==="InvalidStateError"||v.name==="NotFoundError"))return p.resolve().then(function(){if(!u.db||v.name==="NotFoundError"&&!u.db.objectStoreNames.contains(u.storeName)&&u.version<=u.db.version)return u.db&&(u.version=u.db.version+1),Bt(u)}).then(function(){return Lu(u).then(function(){He(u,m,c,_-1)})}).catch(c);c(v)}}function Qo(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Uu(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=u[_];var g=N[c.name];g||(g=Qo(),N[c.name]=g),g.forages.push(m),m._initReady||(m._initReady=m.ready,m.ready=Nu);var v=[];function E(){return p.resolve()}for(var A=0;A<g.forages.length;A++){var C=g.forages[A];C!==m&&v.push(C._initReady().catch(E))}var T=g.forages.slice(0);return p.all(v).then(function(){return c.db=g.db,Ve(c)}).then(function(x){return c.db=x,br(c,m._defaultConfig.version)?Bt(c):x}).then(function(x){c.db=g.db=x,m._dbInfo=c;for(var U=0;U<T.length;U++){var J=T[U];J!==m&&(J._dbInfo.db=c.db,J._dbInfo.version=c.version)}})}function Mu(u,m){var c=this;u=I(u);var _=new p(function(g,v){c.ready().then(function(){He(c._dbInfo,W,function(E,A){if(E)return v(E);try{var C=A.objectStore(c._dbInfo.storeName),T=C.get(u);T.onsuccess=function(){var x=T.result;x===void 0&&(x=null),zo(x)&&(x=vt(x)),g(x)},T.onerror=function(){v(T.error)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Bu(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){He(c._dbInfo,W,function(E,A){if(E)return v(E);try{var C=A.objectStore(c._dbInfo.storeName),T=C.openCursor(),x=1;T.onsuccess=function(){var U=T.result;if(U){var J=U.value;zo(J)&&(J=vt(J));var q=u(J,U.key,x++);q!==void 0?g(q):U.continue()}else g()},T.onerror=function(){v(T.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function Fu(u,m,c){var _=this;u=I(u);var g=new p(function(v,E){var A;_.ready().then(function(){return A=_._dbInfo,j.call(m)==="[object Blob]"?B(A.db).then(function(C){return C?m:Gn(m)}):m}).then(function(C){He(_._dbInfo,R,function(T,x){if(T)return E(T);try{var U=x.objectStore(_._dbInfo.storeName);C===null&&(C=void 0);var J=U.put(C,u);x.oncomplete=function(){C===void 0&&(C=null),v(C)},x.onabort=x.onerror=function(){var q=J.error?J.error:J.transaction.error;E(q)}}catch(q){E(q)}})}).catch(E)});return f(g,c),g}function ju(u,m){var c=this;u=I(u);var _=new p(function(g,v){c.ready().then(function(){He(c._dbInfo,R,function(E,A){if(E)return v(E);try{var C=A.objectStore(c._dbInfo.storeName),T=C.delete(u);A.oncomplete=function(){g()},A.onerror=function(){v(T.error)},A.onabort=function(){var x=T.error?T.error:T.transaction.error;v(x)}}catch(x){v(x)}})}).catch(v)});return f(_,m),_}function Ju(u){var m=this,c=new p(function(_,g){m.ready().then(function(){He(m._dbInfo,R,function(v,E){if(v)return g(v);try{var A=E.objectStore(m._dbInfo.storeName),C=A.clear();E.oncomplete=function(){_()},E.onabort=E.onerror=function(){var T=C.error?C.error:C.transaction.error;g(T)}}catch(T){g(T)}})}).catch(g)});return f(c,u),c}function Vu(u){var m=this,c=new p(function(_,g){m.ready().then(function(){He(m._dbInfo,W,function(v,E){if(v)return g(v);try{var A=E.objectStore(m._dbInfo.storeName),C=A.count();C.onsuccess=function(){_(C.result)},C.onerror=function(){g(C.error)}}catch(T){g(T)}})}).catch(g)});return f(c,u),c}function Hu(u,m){var c=this,_=new p(function(g,v){if(u<0){g(null);return}c.ready().then(function(){He(c._dbInfo,W,function(E,A){if(E)return v(E);try{var C=A.objectStore(c._dbInfo.storeName),T=!1,x=C.openKeyCursor();x.onsuccess=function(){var U=x.result;if(!U){g(null);return}u===0||T?g(U.key):(T=!0,U.advance(u))},x.onerror=function(){v(x.error)}}catch(U){v(U)}})}).catch(v)});return f(_,m),_}function $u(u){var m=this,c=new p(function(_,g){m.ready().then(function(){He(m._dbInfo,W,function(v,E){if(v)return g(v);try{var A=E.objectStore(m._dbInfo.storeName),C=A.openKeyCursor(),T=[];C.onsuccess=function(){var x=C.result;if(!x){_(T);return}T.push(x.key),x.continue()},C.onerror=function(){g(C.error)}}catch(x){g(x)}})}).catch(g)});return f(c,u),c}function Gu(u,m){m=S.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;if(!u.name)g=p.reject("Invalid arguments");else{var v=u.name===c.name&&_._dbInfo.db,E=v?p.resolve(_._dbInfo.db):Ve(u).then(function(A){var C=N[u.name],T=C.forages;C.db=A;for(var x=0;x<T.length;x++)T[x]._dbInfo.db=A;return A});u.storeName?g=E.then(function(A){if(A.objectStoreNames.contains(u.storeName)){var C=A.version+1;z(u);var T=N[u.name],x=T.forages;A.close();for(var U=0;U<x.length;U++){var J=x[U];J._dbInfo.db=null,J._dbInfo.version=C}var q=new p(function(K,ue){var ie=d.open(u.name,C);ie.onerror=function(Pe){var jt=ie.result;jt.close(),ue(Pe)},ie.onupgradeneeded=function(){var Pe=ie.result;Pe.deleteObjectStore(u.storeName)},ie.onsuccess=function(){var Pe=ie.result;Pe.close(),K(Pe)}});return q.then(function(K){T.db=K;for(var ue=0;ue<x.length;ue++){var ie=x[ue];ie._dbInfo.db=K,Q(ie._dbInfo)}}).catch(function(K){throw(ne(u,K)||p.resolve()).catch(function(){}),K})}}):g=E.then(function(A){z(u);var C=N[u.name],T=C.forages;A.close();for(var x=0;x<T.length;x++){var U=T[x];U._dbInfo.db=null}var J=new p(function(q,K){var ue=d.deleteDatabase(u.name);ue.onerror=function(){var ie=ue.result;ie&&ie.close(),K(ue.error)},ue.onblocked=function(){console.warn('dropInstance blocked for database "'+u.name+'" until all open connections are closed')},ue.onsuccess=function(){var ie=ue.result;ie&&ie.close(),q(ie)}});return J.then(function(q){C.db=q;for(var K=0;K<T.length;K++){var ue=T[K];Q(ue._dbInfo)}}).catch(function(q){throw(ne(u,q)||p.resolve()).catch(function(){}),q})})}return f(g,m),g}var qu={_driver:"asyncStorage",_initStorage:Uu,_support:y(),iterate:Bu,getItem:Mu,setItem:Fu,removeItem:ju,clear:Ju,length:Vu,key:Hu,keys:$u,dropInstance:Gu};function Ku(){return typeof openDatabase=="function"}var Ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Wu="~~local_forage_type~",Yo=/^~~local_forage_type~([^~]+)~/,wr="__lfsc__:",qn=wr.length,Kn="arbf",Wn="blob",Xo="si08",Zo="ui08",ea="uic8",ta="si16",ra="si32",na="ur16",ia="ui32",oa="fl32",aa="fl64",sa=qn+Kn.length,la=Object.prototype.toString;function ua(u){var m=u.length*.75,c=u.length,_,g=0,v,E,A,C;u[u.length-1]==="="&&(m--,u[u.length-2]==="="&&m--);var T=new ArrayBuffer(m),x=new Uint8Array(T);for(_=0;_<c;_+=4)v=Ze.indexOf(u[_]),E=Ze.indexOf(u[_+1]),A=Ze.indexOf(u[_+2]),C=Ze.indexOf(u[_+3]),x[g++]=v<<2|E>>4,x[g++]=(E&15)<<4|A>>2,x[g++]=(A&3)<<6|C&63;return T}function zn(u){var m=new Uint8Array(u),c="",_;for(_=0;_<m.length;_+=3)c+=Ze[m[_]>>2],c+=Ze[(m[_]&3)<<4|m[_+1]>>4],c+=Ze[(m[_+1]&15)<<2|m[_+2]>>6],c+=Ze[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 zu(u,m){var c="";if(u&&(c=la.call(u)),u&&(c==="[object ArrayBuffer]"||u.buffer&&la.call(u.buffer)==="[object ArrayBuffer]")){var _,g=wr;u instanceof ArrayBuffer?(_=u,g+=Kn):(_=u.buffer,c==="[object Int8Array]"?g+=Xo:c==="[object Uint8Array]"?g+=Zo:c==="[object Uint8ClampedArray]"?g+=ea:c==="[object Int16Array]"?g+=ta:c==="[object Uint16Array]"?g+=na:c==="[object Int32Array]"?g+=ra:c==="[object Uint32Array]"?g+=ia:c==="[object Float32Array]"?g+=oa:c==="[object Float64Array]"?g+=aa:m(new Error("Failed to get type for BinaryArray"))),m(g+zn(_))}else if(c==="[object Blob]"){var v=new FileReader;v.onload=function(){var E=Wu+u.type+"~"+zn(this.result);m(wr+Wn+E)},v.readAsArrayBuffer(u)}else try{m(JSON.stringify(u))}catch(E){console.error("Couldn't convert value into a JSON string: ",u),m(null,E)}}function Qu(u){if(u.substring(0,qn)!==wr)return JSON.parse(u);var m=u.substring(sa),c=u.substring(qn,sa),_;if(c===Wn&&Yo.test(m)){var g=m.match(Yo);_=g[1],m=m.substring(g[0].length)}var v=ua(m);switch(c){case Kn:return v;case Wn:return h([v],{type:_});case Xo:return new Int8Array(v);case Zo:return new Uint8Array(v);case ea:return new Uint8ClampedArray(v);case ta:return new Int16Array(v);case na:return new Uint16Array(v);case ra:return new Int32Array(v);case ia:return new Uint32Array(v);case oa:return new Float32Array(v);case aa:return new Float64Array(v);default:throw new Error("Unkown type: "+c)}}var Qn={serialize:zu,deserialize:Qu,stringToBuffer:ua,bufferToString:zn};function ca(u,m,c,_){u.executeSql("CREATE TABLE IF NOT EXISTS "+m.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],c,_)}function Yu(u){var m=this,c={db:null};if(u)for(var _ in u)c[_]=typeof u[_]!="string"?u[_].toString():u[_];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){ca(A,c,function(){m._dbInfo=c,v()},function(C,T){E(T)})},E)});return c.serializer=Qn,g}function et(u,m,c,_,g,v){u.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(C,T){T.rows.length?v(C,A):ca(C,m,function(){C.executeSql(c,_,g,v)},v)},v):v(E,A)},v)}function Xu(u,m){var c=this;u=I(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){et(A,E,"SELECT * FROM "+E.storeName+" WHERE key = ? LIMIT 1",[u],function(C,T){var x=T.rows.length?T.rows.item(0).value:null;x&&(x=E.serializer.deserialize(x)),g(x)},function(C,T){v(T)})})}).catch(v)});return f(_,m),_}function Zu(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){et(A,E,"SELECT * FROM "+E.storeName,[],function(C,T){for(var x=T.rows,U=x.length,J=0;J<U;J++){var q=x.item(J),K=q.value;if(K&&(K=E.serializer.deserialize(K)),K=u(K,q.key,J+1),K!==void 0){g(K);return}}g()},function(C,T){v(T)})})}).catch(v)});return f(_,m),_}function da(u,m,c,_){var g=this;u=I(u);var v=new p(function(E,A){g.ready().then(function(){m===void 0&&(m=null);var C=m,T=g._dbInfo;T.serializer.serialize(m,function(x,U){U?A(U):T.db.transaction(function(J){et(J,T,"INSERT OR REPLACE INTO "+T.storeName+" (key, value) VALUES (?, ?)",[u,x],function(){E(C)},function(q,K){A(K)})},function(J){if(J.code===J.QUOTA_ERR){if(_>0){E(da.apply(g,[u,C,c,_-1]));return}A(J)}})})}).catch(A)});return f(v,c),v}function ec(u,m,c){return da.apply(this,[u,m,c,1])}function tc(u,m){var c=this;u=I(u);var _=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){et(A,E,"DELETE FROM "+E.storeName+" WHERE key = ?",[u],function(){g()},function(C,T){v(T)})})}).catch(v)});return f(_,m),_}function rc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){et(E,v,"DELETE FROM "+v.storeName,[],function(){_()},function(A,C){g(C)})})}).catch(g)});return f(c,u),c}function nc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){et(E,v,"SELECT COUNT(key) as c FROM "+v.storeName,[],function(A,C){var T=C.rows.item(0).c;_(T)},function(A,C){g(C)})})}).catch(g)});return f(c,u),c}function ic(u,m){var c=this,_=new p(function(g,v){c.ready().then(function(){var E=c._dbInfo;E.db.transaction(function(A){et(A,E,"SELECT key FROM "+E.storeName+" WHERE id = ? LIMIT 1",[u+1],function(C,T){var x=T.rows.length?T.rows.item(0).key:null;g(x)},function(C,T){v(T)})})}).catch(v)});return f(_,m),_}function oc(u){var m=this,c=new p(function(_,g){m.ready().then(function(){var v=m._dbInfo;v.db.transaction(function(E){et(E,v,"SELECT key FROM "+v.storeName,[],function(A,C){for(var T=[],x=0;x<C.rows.length;x++)T.push(C.rows.item(x).key);_(T)},function(A,C){g(C)})})}).catch(g)});return f(c,u),c}function ac(u){return new p(function(m,c){u.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:u,storeNames:E})},function(g,v){c(v)})},function(_){c(_)})})}function sc(u,m){m=S.apply(this,arguments);var c=this.config();u=typeof u!="function"&&u||{},u.name||(u.name=u.name||c.name,u.storeName=u.storeName||c.storeName);var _=this,g;return u.name?g=new p(function(v){var E;u.name===c.name?E=_._dbInfo.db:E=openDatabase(u.name,"","",0),u.storeName?v({db:E,storeNames:[u.storeName]}):v(ac(E))}).then(function(v){return new p(function(E,A){v.db.transaction(function(C){function T(q){return new p(function(K,ue){C.executeSql("DROP TABLE IF EXISTS "+q,[],function(){K()},function(ie,Pe){ue(Pe)})})}for(var x=[],U=0,J=v.storeNames.length;U<J;U++)x.push(T(v.storeNames[U]));p.all(x).then(function(){E()}).catch(function(q){A(q)})},function(C){A(C)})})}):g=p.reject("Invalid arguments"),f(g,m),g}var lc={_driver:"webSQLStorage",_initStorage:Yu,_support:Ku(),iterate:Zu,getItem:Xu,setItem:ec,removeItem:tc,clear:rc,length:nc,key:ic,keys:oc,dropInstance:sc};function uc(){try{return typeof localStorage!="undefined"&&"setItem"in localStorage&&!!localStorage.setItem}catch(u){return!1}}function fa(u,m){var c=u.name+"/";return u.storeName!==m.storeName&&(c+=u.storeName+"/"),c}function cc(){var u="_localforage_support_test";try{return localStorage.setItem(u,!0),localStorage.removeItem(u),!1}catch(m){return!0}}function dc(){return!cc()||localStorage.length>0}function fc(u){var m=this,c={};if(u)for(var _ in u)c[_]=u[_];return c.keyPrefix=fa(u,m._defaultConfig),dc()?(m._dbInfo=c,c.serializer=Qn,p.resolve()):p.reject()}function hc(u){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,u),c}function mc(u,m){var c=this;u=I(u);var _=c.ready().then(function(){var g=c._dbInfo,v=localStorage.getItem(g.keyPrefix+u);return v&&(v=g.serializer.deserialize(v)),v});return f(_,m),_}function pc(u,m){var c=this,_=c.ready().then(function(){for(var g=c._dbInfo,v=g.keyPrefix,E=v.length,A=localStorage.length,C=1,T=0;T<A;T++){var x=localStorage.key(T);if(x.indexOf(v)===0){var U=localStorage.getItem(x);if(U&&(U=g.serializer.deserialize(U)),U=u(U,x.substring(E),C++),U!==void 0)return U}}});return f(_,m),_}function vc(u,m){var c=this,_=c.ready().then(function(){var g=c._dbInfo,v;try{v=localStorage.key(u)}catch(E){v=null}return v&&(v=v.substring(g.keyPrefix.length)),v});return f(_,m),_}function _c(u){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,u),c}function gc(u){var m=this,c=m.keys().then(function(_){return _.length});return f(c,u),c}function yc(u,m){var c=this;u=I(u);var _=c.ready().then(function(){var g=c._dbInfo;localStorage.removeItem(g.keyPrefix+u)});return f(_,m),_}function bc(u,m,c){var _=this;u=I(u);var g=_.ready().then(function(){m===void 0&&(m=null);var v=m;return new p(function(E,A){var C=_._dbInfo;C.serializer.serialize(m,function(T,x){if(x)A(x);else try{localStorage.setItem(C.keyPrefix+u,T),E(v)}catch(U){(U.name==="QuotaExceededError"||U.name==="NS_ERROR_DOM_QUOTA_REACHED")&&A(U),A(U)}})})});return f(g,c),g}function wc(u,m){if(m=S.apply(this,arguments),u=typeof u!="function"&&u||{},!u.name){var c=this.config();u.name=u.name||c.name,u.storeName=u.storeName||c.storeName}var _=this,g;return u.name?g=new p(function(v){u.storeName?v(fa(u,_._defaultConfig)):v(u.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 Ec={_driver:"localStorageWrapper",_initStorage:fc,_support:uc(),iterate:pc,getItem:mc,setItem:bc,removeItem:yc,clear:hc,length:gc,key:vc,keys:_c,dropInstance:wc},Ic=function(m,c){return m===c||typeof m=="number"&&typeof c=="number"&&isNaN(m)&&isNaN(c)},Ac=function(m,c){for(var _=m.length,g=0;g<_;){if(Ic(m[g],c))return!0;g++}return!1},ha=Array.isArray||function(u){return Object.prototype.toString.call(u)==="[object Array]"},Ft={},ma={},_t={INDEXEDDB:qu,WEBSQL:lc,LOCALSTORAGE:Ec},Sc=[_t.INDEXEDDB._driver,_t.WEBSQL._driver,_t.LOCALSTORAGE._driver],Er=["dropInstance"],Yn=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Er),Rc={description:"",driver:Sc.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Cc(u,m){u[m]=function(){var c=arguments;return u.ready().then(function(){return u[m].apply(u,c)})}}function Xn(){for(var u=1;u<arguments.length;u++){var m=arguments[u];if(m)for(var c in m)m.hasOwnProperty(c)&&(ha(m[c])?arguments[0][c]=m[c].slice():arguments[0][c]=m[c])}return arguments[0]}var Tc=function(){function u(m){s(this,u);for(var c in _t)if(_t.hasOwnProperty(c)){var _=_t[c],g=_._driver;this[c]=g,Ft[g]||this.defineDriver(_)}this._defaultConfig=Xn({},Rc),this._config=Xn({},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 u.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},u.prototype.defineDriver=function(c,_,g){var v=new p(function(E,A){try{var C=c._driver,T=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!c._driver){A(T);return}for(var x=Yn.concat("_initStorage"),U=0,J=x.length;U<J;U++){var q=x[U],K=!Ac(Er,q);if((K||c[q])&&typeof c[q]!="function"){A(T);return}}var ue=function(){for(var jt=function(Oc){return function(){var Pc=new Error("Method "+Oc+" is not implemented by the current driver"),pa=p.reject(Pc);return f(pa,arguments[arguments.length-1]),pa}},Zn=0,xc=Er.length;Zn<xc;Zn++){var ei=Er[Zn];c[ei]||(c[ei]=jt(ei))}};ue();var ie=function(jt){Ft[C]&&console.info("Redefining LocalForage driver: "+C),Ft[C]=c,ma[C]=jt,E()};"_support"in c?c._support&&typeof c._support=="function"?c._support().then(ie,A):ie(!!c._support):ie(!0)}catch(Pe){A(Pe)}});return b(v,_,g),v},u.prototype.driver=function(){return this._driver||null},u.prototype.getDriver=function(c,_,g){var v=Ft[c]?p.resolve(Ft[c]):p.reject(new Error("Driver not found."));return b(v,_,g),v},u.prototype.getSerializer=function(c){var _=p.resolve(Qn);return b(_,c),_},u.prototype.ready=function(c){var _=this,g=_._driverSet.then(function(){return _._ready===null&&(_._ready=_._initDriver()),_._ready});return b(g,c,c),g},u.prototype.setDriver=function(c,_,g){var v=this;ha(c)||(c=[c]);var E=this._getSupportedDrivers(c);function A(){v._config.driver=v.driver()}function C(U){return v._extend(U),A(),v._ready=v._initStorage(v._config),v._ready}function T(U){return function(){var J=0;function q(){for(;J<U.length;){var K=U[J];return J++,v._dbInfo=null,v._ready=null,v.getDriver(K).then(C).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(J){v._driver=J._driver,A(),v._wrapLibraryMethodsWithReady(),v._initDriver=T(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},u.prototype.supports=function(c){return!!ma[c]},u.prototype._extend=function(c){Xn(this,c)},u.prototype._getSupportedDrivers=function(c){for(var _=[],g=0,v=c.length;g<v;g++){var E=c[g];this.supports(E)&&_.push(E)}return _},u.prototype._wrapLibraryMethodsWithReady=function(){for(var c=0,_=Yn.length;c<_;c++)Cc(this,Yn[c])},u.prototype.createInstance=function(c){return new u(c)},u}(),kc=new Tc;i.exports=kc},{3:3}]},{},[4])(4)})});var _s=ni(rn=>{"use strict";V();Kt();dt();var $i=ve(),Yd=Ke("levelFinished",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),duration:F.number().optional(),rating:F.number().optional(),score:F.number().optional()})),implement:e=>P(rn,null,function*(){let{levelId:t,duration:r,rating:n,score:i}=e;De.info("onLevelFinished",r,n,i),yield Promise.all([ct.reporter({event:"COMPLETE_GAME_LEVEL"}),ct.tracker("LevelFinished",{levelId:t,duration:r,rating:n,score:i})])})}),Xd=Ke("gamePlayEnded",{paramsSchema:F.tuple(F.object({duration:F.number().optional(),rating:F.number().optional(),score:F.number()})),implement:e=>P(rn,null,function*(){let{duration:t,rating:r,score:n}=e;return De.info("onGamePlayEnded",t,r,n),ct.tracker("GamePlayEnded",{duration:t,rating:r,score:n})})}),Zd=Ke("levelUpgrade",{paramsSchema:F.tuple(F.object({levelId:F.or(F.string(),F.number()),name:F.string().optional()})),implement:r=>P(rn,[r],function*({levelId:e,name:t}){return ct.tracker("LevelUpgrade",{name:t,levelId:e})})});$i.registerCommand("TaskTrackerSDK.levelFinished",Yd);$i.registerCommand("TaskTrackerSDK.gamePlayEnded",Xd);$i.registerCommand("TaskTrackerSDK.levelUpgrade",Zd);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"}}});ge("TaskTrackerSDK.onGamePlayEnded",{version:"1.1.25",properties:{params:{duration:"1.1.25",rating:"1.1.25",score:"1.1.25"}}});ge("TaskTrackerSDK.onLevelUpgrade",{version:"1.1.25",properties:{params:{levelId:"1.1.25",name:"1.1.25"}}})});var ht,wt,gs,Gi,ef,nn,qi=Z(()=>{"use strict";ht=(e,t)=>{var r;window.dispatchEvent(new CustomEvent(e,{detail:t})),(r=window.parent)==null||r.postMessage({type:e,data:{detail:t}},"*")},wt=new Map,gs=e=>{if(e.source===window.parent)try{let t=e.data;if(t&&t.type){let r=wt.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)}},Gi=!1,ef=()=>{Gi||(window.addEventListener("message",gs),Gi=!0)},nn=(e,t)=>{ef(),wt.has(e)||wt.set(e,new Set);let r=wt.get(e);return r.add(t),()=>{r.delete(t),r.size===0&&wt.delete(e),wt.size===0&&(window.removeEventListener("message",gs),Gi=!1)}}});var on,an,sn,ln,un,ys,cn,dn,Et,tf,ae,It,At,Ne=Z(()=>{"use strict";V();on="UNLOCK_OPTIONS_CHANGED",an="INVOKE_PAYMENT",sn="ON_PAYMENT_RESULT",ln="ON_USE_MODAL_EVENT",un="ON_USE_MODAL_RESULT",ys="ON_USE_MODAL_FREQUENCY",cn="ON_USE_UNLOGIN_MODAL_EVENT",dn="INVOKE_UNLOGIN_MODAL_EVENT",Et=new Me,tf=()=>({on:Et.on.bind(Et),off:Et.off.bind(Et),emit:Et.emit.bind(Et)}),ae=tf(),It={charge:{dailyMaxPopUps:2,minInterval:8*60*60*1e3},useJolicoin:{dailyMaxPopUps:2,minInterval:8*60*60*1e3}},At={show:!0,minInterval:8*60*60*1e3}});var pu=ni(Ho=>{"use strict";_e();Ne();qi();V();var mu={USE_COIN:"CONFIRM",ADS:"FAILED",CANCEL:"CANCEL"};nn("ON_JOLIBOX_JOLI_COIN_USE_RESULT",e=>{console.log("onCustomEvent ON_JOLIBOX_JOLI_COIN_USE_RESULT",mu[e.result],e.result),ae.emit(un,{useModalResult:mu[e.result]})});ae.on(ln,(e,t)=>{var r;ht("JOLIBOX_JOLI_COIN_USE_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:lt()})});nn("ON_JOLIBOX_TOPUP_JOLI_COIN_RESULT",e=>{ae.emit(sn,{paymentResult:e.result=="ADS"?"FAILED":e.result,userJoliCoin:e.joliCoin})});ae.on(an,(e,t)=>P(Ho,null,function*(){var r;ht("JOLIBOX_TOPUP_EVENT",{JOLI_COIN:{quantity:t.joliCoinQuantity,balance:t.userJoliCoin.balance,enableAutoDeduct:t.enableAutoDeduct},type:e,sequenceId:(r=t.sequenceId)!=null?r:lt()})}));nn("ON_JOLIBOX_JOLI_UNLOGIN_MODAL_RESULT_EVENT",e=>{var t,r,n,i,o;ae.emit(cn,{result:e.result=="ADS"?"FAILED":e.result,rewards:{jolicoin:{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"&&D.onEnvConfigChanged({hostUserInfo:{isLogin:!0}})});ae.on(dn,e=>P(Ho,null,function*(){ht("JOLIBOX_JOLI_UNLOGIN_MODAL_EVENT",{sequenceId:lt(),type:e})}))});dt();_e();Kt();V();var fs=ve(),Ld="env",Ud="getSystemInfoSync",Md=()=>{var i,o,a,s;let e={system:D.deviceInfo.system,platform:D.deviceInfo.platform.toLowerCase(),brand:D.deviceInfo.brand,pixelRatio:D.deviceInfo.pixelRatio,language:D.deviceInfo.lang,version:D.sdkInfo.jssdkVersion,appName:(i=D.hostInfo)==null?void 0:i.appName,SDKVersion:D.sdkInfo.nativeSDKVersion},t=(o=D.hostInfo)==null?void 0:o.version;t&&(e=pe(H({},e),{version:t}));let r=(a=D.hostInfo)==null?void 0:a.appName;r&&(e=pe(H({},e),{appName:r}));let n=(s=D.sdkInfo)==null?void 0:s.jssdkVersion;return n&&(e=pe(H({},e),{SDKVersion:n})),e},Bd=ft(Ud,{implement:Md}),Fd=ft(Ld,{implement:()=>pe(H({},D.hostInfo),{sdkInfo:D.sdkInfo,platform:D.platform,deviceInfo:D.deviceInfo})});fs.registerCommand("API.env",Fd);fs.registerCommand("API.getSystemInfoSync",Bd);ge("env",{version:"1.0.0"});ge("getSystemInfoSync",{version:"1.0.0"});V();Kt();$e();dt();var jd="onJoliboxShow",Jd="onJoliboxHide",Vd="onReady",ji=ve(),Ji=La(Re),Fi=!0,Wt=!0,Xr=0,Zr=Pi;function Hd(){let e=Date.now();if(e-Xr<100)return;Xr=e;let t=document.visibilityState==="visible";t!==Fi&&(Fi=t,Zr.emit("visible",Fi))}function hs(e){let t=Date.now();t-Xr<100||(Xr=t,e==="focus"&&!Wt?Wt=!0:e==="blur"&&Wt&&(Wt=!1),Zr.emit("visible",Wt))}document.addEventListener("visibilitychange",Hd);window.addEventListener("focus",()=>hs("focus"));window.addEventListener("blur",()=>hs("blur"));var $d=ft(jd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ji(e);Zr.on("visible",r=>{r&&t()})}}),Gd=ft(Jd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ji(e);Zr.on("visible",r=>{!r&&t()})}}),qd=ft(Vd,{paramsSchema:F.tuple(F.function()),implement(e){let t=Ji(e);qt.on("LifecycleEvent.onReady",r=>{t(r)})}});ji.registerCommand("LifecycleSDK.onReady",qd);ji.registerCommand("LifecycleSDK.onJoliboxShow",$d);ji.registerCommand("LifecycleSDK.onJoliboxHide",Gd);ge("lifeCycle.onReady",{version:"1.0.0"});ge("lifeCycle.onJoliboxShow",{version:"1.0.0"});ge("lifeCycle.onJoliboxHide",{version:"1.0.0"});Kt();V();yt();_e();var vs=ii(ps());var en=ve(),Hi=class{constructor(){this.httpClient=Ue.create({baseUrl:D.testMode?"https://stg-api.jolibox.com":"https://api.jolibox.com"});this.getGameId=()=>D.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=vs.default.createInstance({name:this.gameId.length?this.gameId:"default"})}},tn=new Hi,Kd=Ke("getLocalStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield tn.getItem(e)})}});en.registerCommand("StorageSDK.getItem",Kd);ge("storage.getItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var Wd=Ke("setStorage",{paramsSchema:F.tuple(F.string(),F.or(F.string(),F.boolean(),F.number())),implement(e,t){return P(this,null,function*(){return yield tn.setItem(e,t)})}});en.registerCommand("StorageSDK.setItem",Wd);ge("storage.setItem",{version:"1.0.0",properties:{key:"1.0.0",value:"1.0.0"}});var zd=Ke("removeStorage",{paramsSchema:F.tuple(F.string()),implement(e){return P(this,null,function*(){return yield tn.removeItem(e)})}});en.registerCommand("StorageSDK.removeItem",zd);ge("storage.removeItem",{version:"1.0.0",properties:{key:"1.0.0"}});var Qd=Ke("clearStorage",{implement(){return P(this,null,function*(){return yield tn.clear()})}});en.registerCommand("StorageSDK.clear",Qd);ge("storage.clear",{version:"1.0.0"});var ib=ii(_s());dt();V();yt();qi();_e();Ne();var bs=D.testMode;function ws(){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 d=yield s;if(d===!0)return!0;bs&&console.log(`handleReward ${l}`);let y=e.get(l),h=y?yield y(...o):d;return bs&&console.log(`handleReward ${l} ${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:It,loginGuide:At}}})})},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:It,loginGuide:At}})}}}Ne();var rf=()=>(e,t)=>e==="JOLI_COIN"&&t==="ADS"?-1:e==="ADS"&&t==="JOLI_COIN"?1:0,nf=e=>e.length?e.includes("JOLI_COIN")&&e.length<=1?["JOLI_COIN_ONLY"]:e.sort(rf()):["ADS"],Es=e=>{e.registerRewardsFetcher(t=>P(void 0,null,function*(){var n,i,o,a;let r=["ADS"];try{let s=yield t.post("/api/games/unlock-options",{});if(s.code!=="SUCCESS")return r;ae.emit(on,{options:((n=s.data)==null?void 0:n.unlockOptions)||[],userJoliCoin:((i=s.extra)==null?void 0:i.joliCoin)||{balance:0,enableAutoDeduct:!1}});let l=((a=(o=s.data)==null?void 0:o.unlockOptions)==null?void 0:a.map(d=>d.type))||Array.from(r);return nf(l)}catch(s){return console.error("getRewardOptions error:",s),r}}))},Is=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(ys,{joliCoinUseAndCharge:((n=r.data)==null?void 0:n.joliCoinUseAndCharge)||It,loginGuide:((i=r.data)==null?void 0:i.loginGuide)||At}),{joliCoinUseAndCharge:((o=r.data)==null?void 0:o.joliCoinUseAndCharge)||It,loginGuide:((a=r.data)==null?void 0:a.loginGuide)||At}}))};var As=e=>t=>P(void 0,null,function*(){return console.log("trigger @jolibox/ads reward",t),e.adBreak(t),!0});Ne();function tt(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=H(H({},i),a),r=Promise.resolve(i),n&&(n(i),n=null),i}}}Ne();var Le=tt(ae,on);_e();V();V();var rt=ve();Ne();Ne();var Ki=(e,t)=>{let{showUnlockWithJolicoinModal:r}=t;rt.registerCommand(`Rewards.${e}.useJolicoin`,()=>P(void 0,null,function*(){var s,l,d,y;let n=yield Le.getData(),i=!!((s=n==null?void 0:n.userJoliCoin)!=null&&s.enableAutoDeduct),o=(y=(d=(l=n==null?void 0:n.options)==null?void 0:l.find(h=>h.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0;return console.log("-----unlockOptions usemodal-----",n,i,o),(yield r({enableAutoDeduct:i,userJoliCoin:n==null?void 0:n.userJoliCoin,joliCoinQuantity:o}))!=="CONFIRM"?{result:"FAILED"}:{result:"SUCCESS"}}))},zt=(e,t)=>r=>P(void 0,null,function*(){let n=tt(ae,un);return ae.emit(ln,e,{enableAutoDeduct:r.enableAutoDeduct,userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).useModalResult});var fn=e=>P(void 0,null,function*(){return(yield e.get("/api/joli-coin/balance",{query:{type:"JOLI_COIN"}})).data});var Ss=(e,t)=>e.some(r=>r.type==="JOLI_COIN"&&r.joliCoinChoices.some(n=>{var i;return n.joliCoinQuantity<=((i=t==null?void 0:t.balance)!=null?i:0)}));Ne();Ne();var Wi=(e,t)=>{let{httpClient:r,initiateAndAwaitPayment:n}=t;rt.registerCommand(`Rewards.${e}.usePayment`,()=>P(void 0,null,function*(){var l,d,y,h,p,f;let i=yield Le.getData(),o=yield fn(r),a=(y=(d=(l=i==null?void 0:i.options)==null?void 0:l.find(b=>b.type==="JOLI_COIN"))==null?void 0:d.joliCoinChoices[0].joliCoinQuantity)!=null?y:0,s={balance:(h=o==null?void 0:o.balance)!=null?h:0,enableAutoDeduct:(f=(p=i==null?void 0:i.userJoliCoin)==null?void 0:p.enableAutoDeduct)!=null?f:!1};return Le.updateData({userJoliCoin:s}),console.log("-----unlockOptions payment-----",i,s,a),Ss((i==null?void 0:i.options)||[],s)?{result:"CONTINUE"}:{result:(yield n({userJoliCoin:s,joliCoinQuantity:a}))==="SUCCESS"?"SUCCESS":"FAILED"}}))},Qt=(e,t)=>r=>P(void 0,null,function*(){let n=tt(ae,sn);return ae.emit(an,e,{userJoliCoin:r.userJoliCoin,joliCoinQuantity:r.joliCoinQuantity,enableAutoDeduct:r.userJoliCoin.enableAutoDeduct,confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),(yield n.getFreshData()).paymentResult});_e();Ne();Ne();V();var zi=(e,t)=>{let{showUnloginModal:r,httpClient:n}=t;rt.registerCommand(`Rewards.${e}.useUnloginModal`,()=>P(void 0,null,function*(){var a,s,l,d,y,h,p,f,b;let i=(a=D.hostUserInfo)==null?void 0:a.isLogin,o=yield Le.getData();if(console.log("-----isLogin-----",!!i),!i){let I=yield r();if(console.log("-----unloginModalResult-----",I),I.result=="FAILED"||I.result=="CANCEL")return{result:"FAILED"};let{isFirstLogin:S,claimedRewardValue:w}=(l=(s=I.rewards)==null?void 0:s.jolicoin)!=null?l:{};if(I.result=="SUCCESS"){S&&w&&(yield Ra(3e3));let k=yield fn(n),N=(h=(y=(d=o==null?void 0:o.options)==null?void 0:d.find(W=>W.type==="JOLI_COIN"))==null?void 0:y.joliCoinChoices[0].joliCoinQuantity)!=null?h:0,j={balance:(p=k==null?void 0:k.balance)!=null?p:0,enableAutoDeduct:(b=(f=o==null?void 0:o.userJoliCoin)==null?void 0:f.enableAutoDeduct)!=null?b:!1};if(Le.updateData({userJoliCoin:j}),j.balance>=N)return{result:"SUCCESS"}}}return{result:"CONTINUE"}}))},Yt=(e,t)=>()=>P(void 0,null,function*(){let r=tt(ae,cn);return ae.emit(dn,e,{confirmButtonText:t.confirmButtonText,cancelButtonText:t.cancelButtonText}),yield r.getFreshData()});var hn=(e,t,{handlers:{handleUnlockSuccess:r,handleUnlockFailed:n,unlockOptionsHandler:i,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:a,showUnloginModal:s}})=>(zi(e,{httpClient:t,showUnloginModal:s}),Wi(e,{httpClient:t,initiateAndAwaitPayment:o}),Ki(e,{showUnlockWithJolicoinModal:a}),l=>P(void 0,null,function*(){var d,y,h;try{let p=!0,f=[`Rewards.${e}.useUnloginModal`,`Rewards.${e}.usePayment`,`Rewards.${e}.useJolicoin`];for(let I of f){let S=yield rt.executeCommand(I);if(p=p&&S.result!=="FAILED",S.result!=="CONTINUE")break}if(!p)return n==null||n(l),!1;let b=yield t.post("/api/joli-coin/unlock",{data:{type:"GAME_REWARD",reqId:`${lt()}-${D.mpType}-${Date.now()}`,gameInfo:{gameId:D.mpId}}});return console.log("-----unlockWithJolicoin request result-----",b),b.code=="SUCCESS"?((y=l.adBreakDone)==null||y.call(l,{breakType:l.type,breakName:"name"in l&&(d=l.name)!=null?d:"",breakFormat:"reward",breakStatus:"viewed"}),"adViewed"in l&&((h=l.adViewed)==null||h.call(l)),r==null||r({quantity:b.data.quantity,balance:b.data.balance}),!0):(n==null||n(l),!1)}catch(p){if(console.info("JolicoinRewardHandler error:",p),p instanceof Error&&p.message=="CANCEL")throw p;return n==null||n(l),!1}finally{i.clearCache()}}));var Rs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=()=>{r==null||r()},i=zt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noWatchAds"}),o=Qt("ADS-JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noWatchAds"}),a=Yt("ADS-JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noWatchAds"});return hn("ADS-JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Le,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var Cs=(e,{onUnlockSuccess:t,onUnlockFailed:r})=>{let n=l=>{var d;r==null||r(),(d=l.adBreakDone)==null||d.call(l,{breakType:l.type,breakFormat:l.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})},i=zt("JOLI_COIN",{confirmButtonText:"jolicoin.useJolicoin",cancelButtonText:"jolicoin.noThanks"}),o=Qt("JOLI_COIN",{confirmButtonText:"jolicoin.payAndUnlock",cancelButtonText:"jolicoin.noThanks"}),a=Yt("JOLI_COIN",{confirmButtonText:"loginGuide.login",cancelButtonText:"loginGuide.noThanks"});return hn("JOLI_COIN",e,{handlers:{handleUnlockSuccess:t,handleUnlockFailed:n,unlockOptionsHandler:Le,initiateAndAwaitPayment:o,showUnlockWithJolicoinModal:i,showUnloginModal:a}})};var nt=ws();Es(nt);Is(nt);var _n,M,Ps,Xi,mt,Ts,Ds,Ns,Ls,Zi,Qi,Yi,of,Xt={},Us=[],af=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Zt=Array.isArray;function We(e,t){for(var r in t)e[r]=t[r];return e}function eo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function er(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?_n.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 pn(e,a,n,i,null)}function pn(e,t,r,n,i){var o={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i==null?++Ps:i,__i:-1,__u:0};return i==null&&M.vnode!=null&&M.vnode(o),o}function it(e){return e.children}function Ce(e,t){this.props=e,this.context=t}function St(e,t){if(t==null)return e.__?St(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"?St(e):null}function Ms(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 Ms(e)}}function ks(e){(!e.__d&&(e.__d=!0)&&mt.push(e)&&!vn.__r++||Ts!==M.debounceRendering)&&((Ts=M.debounceRendering)||Ds)(vn)}function vn(){for(var e,t,r,n,i,o,a,s=1;mt.length;)mt.length>s&&mt.sort(Ns),e=mt.shift(),s=mt.length,e.__d&&(r=void 0,i=(n=(t=e).__v).__e,o=[],a=[],t.__P&&((r=We({},n)).__v=n.__v+1,M.vnode&&M.vnode(r),to(t.__P,r,n,t.__n,t.__P.namespaceURI,32&n.__u?[i]:null,o,i==null?St(n):i,!!(32&n.__u),a),r.__v=n.__v,r.__.__k[r.__i]=r,js(o,r,a),r.__e!=i&&Ms(r)));vn.__r=0}function Bs(e,t,r,n,i,o,a,s,l,d,y){var h,p,f,b,I,S,w=n&&n.__k||Us,k=t.length;for(l=sf(r,t,w,l,k),h=0;h<k;h++)(f=r.__k[h])!=null&&(p=f.__i===-1?Xt:w[f.__i]||Xt,f.__i=h,S=to(e,f,p,i,o,a,s,l,d,y),b=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&ro(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?l=Fs(f,l,e):typeof f.type=="function"&&S!==void 0?l=S:b&&(l=b.nextSibling),f.__u&=-7);return r.__e=I,l}function sf(e,t,r,n,i){var o,a,s,l,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"?(l=o+p,(a=e.__k[o]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?pn(null,a,null,null,null):Zt(a)?pn(it,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?pn(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=lf(a,r,l,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!=l&&(d==l-1?p--:d==l+1?p++:(d>l?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=St(s)),Vs(s,s));return n}function Fs(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=Fs(n[i],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=St(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function tr(e,t){return t=t||[],e==null||typeof e=="boolean"||(Zt(e)?e.some(function(r){tr(r,t)}):t.push(e)),t}function lf(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 xs(e,t,r){t[0]=="-"?e.setProperty(t,r==null?"":r):e[t]=r==null?"":typeof r!="number"||af.test(t)?r:r+"px"}function mn(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||xs(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||xs(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")o=t!=(t=t.replace(Ls,"$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=Zi,e.addEventListener(t,o?Yi:Qi,o)):e.removeEventListener(t,o?Yi:Qi,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 Os(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.u==null)t.u=Zi++;else if(t.u<r.t)return;return r(M.event?M.event(t):t)}}}function to(e,t,r,n,i,o,a,s,l,d){var y,h,p,f,b,I,S,w,k,N,j,W,R,L,O,B,z,Q=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),o=[s=t.__e=r.__e]),(y=M.__b)&&y(t);e:if(typeof Q=="function")try{if(w=t.props,k="prototype"in Q&&Q.prototype.render,N=(y=Q.contextType)&&n[y.__c],j=y?N?N.props.value:y.__:n,r.__c?S=(h=t.__c=r.__c).__=h.__E:(k?t.__c=h=new Q(w,j):(t.__c=h=new Ce(w,j),h.constructor=Q,h.render=cf),N&&N.sub(h),h.props=w,h.state||(h.state={}),h.context=j,h.__n=n,p=h.__d=!0,h.__h=[],h._sb=[]),k&&h.__s==null&&(h.__s=h.state),k&&Q.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=We({},h.__s)),We(h.__s,Q.getDerivedStateFromProps(w,h.__s))),f=h.props,b=h.state,h.__v=t,p)k&&Q.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),k&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(k&&Q.getDerivedStateFromProps==null&&w!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(w,j),!h.__e&&(h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(w,h.__s,j)===!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(ne){ne&&(ne.__=t)}),W=0;W<h._sb.length;W++)h.__h.push(h._sb[W]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(w,h.__s,j),k&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,b,I)})}if(h.context=j,h.props=w,h.__P=e,h.__e=!1,R=M.__r,L=0,k){for(h.state=h.__s,h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),O=0;O<h._sb.length;O++)h.__h.push(h._sb[O]);h._sb=[]}else do h.__d=!1,R&&R(t),y=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++L<25);h.state=h.__s,h.getChildContext!=null&&(n=We(We({},n),h.getChildContext())),k&&!p&&h.getSnapshotBeforeUpdate!=null&&(I=h.getSnapshotBeforeUpdate(f,b)),B=y,y!=null&&y.type===it&&y.key==null&&(B=Js(y.props.children)),s=Bs(e,Zt(B)?B:[B],t,r,n,i,o,a,s,l,d),h.base=t.__e,t.__u&=-161,h.__h.length&&a.push(h),S&&(h.__E=h.__=null)}catch(ne){if(t.__v=null,l||o!=null)if(ne.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(z=o.length;z--;)eo(o[z]);else t.__e=r.__e,t.__k=r.__k;M.__e(ne,t,r)}else o==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):s=t.__e=uf(r.__e,t,r,n,i,o,a,l,d);return(y=M.diffed)&&y(t),128&t.__u?void 0:s}function js(e,t,r){for(var n=0;n<r.length;n++)ro(r[n],r[++n],r[++n]);M.__c&&M.__c(t,e),e.some(function(i){try{e=i.__h,i.__h=[],e.some(function(o){o.call(i)})}catch(o){M.__e(o,i.__v)}})}function Js(e){return typeof e!="object"||e==null?e:Zt(e)?e.map(Js):We({},e)}function uf(e,t,r,n,i,o,a,s,l){var d,y,h,p,f,b,I,S=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&&(M.__m&&M.__m(t,o),s=!1),o=null}if(k===null)S===w||s&&e.data===w||(e.data=w);else{if(o=o&&_n.call(e.childNodes),S=r.props||Xt,!s&&o!=null)for(S={},d=0;d<e.attributes.length;d++)S[(f=e.attributes[d]).name]=f.value;for(d in S)if(f=S[d],d!="children"){if(d=="dangerouslySetInnerHTML")h=f;else if(!(d in w)){if(d=="value"&&"defaultValue"in w||d=="checked"&&"defaultChecked"in w)continue;mn(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"||S[d]===f||mn(e,d,f,S[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=""),Bs(t.type==="template"?e.content:e,Zt(p)?p:[p],t,r,n,k=="foreignObject"?"http://www.w3.org/1999/xhtml":i,o,a,o?o[0]:r.__k&&St(r,0),s,l),o!=null)for(d=o.length;d--;)eo(o[d]);s||(d="value",k=="progress"&&b==null?e.removeAttribute("value"):b!==void 0&&(b!==e[d]||k=="progress"&&!b||k=="option"&&b!==S[d])&&mn(e,d,b,S[d],i),d="checked",I!==void 0&&I!==e[d]&&mn(e,d,I,S[d],i))}return e}function ro(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(i){M.__e(i,r)}}function Vs(e,t,r){var n,i;if(M.unmount&&M.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||ro(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(o){M.__e(o,t)}n.base=n.__P=null}if(n=e.__k)for(i=0;i<n.length;i++)n[i]&&Vs(n[i],t,r||typeof e.type!="function");r||eo(e.__e),e.__c=e.__=e.__e=void 0}function cf(e,t,r){return this.constructor(e,r)}function Hs(e,t,r){var n,i,o,a;t==document&&(t=document.documentElement),M.__&&M.__(e,t),i=(n=typeof r=="function")?null:r&&r.__k||t.__k,o=[],a=[],to(t,e=(!n&&r||t).__k=er(it,null,[e]),i||Xt,Xt,t.namespaceURI,!n&&r?[r]:i?null:t.firstChild?_n.call(t.childNodes):null,o,!n&&r?r:i?i.__e:t.firstChild,n,a),js(o,e,a)}_n=Us.slice,M={__e:function(e,t,r,n){for(var i,o,a;t=t.__;)if((i=t.__c)&&!i.__)try{if((o=i.constructor)&&o.getDerivedStateFromError!=null&&(i.setState(o.getDerivedStateFromError(e)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(e,n||{}),a=i.__d),a)return i.__E=i}catch(s){e=s}throw e}},Ps=0,Xi=function(e){return e!=null&&e.constructor==null},Ce.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=We({},this.state),typeof e=="function"&&(e=e(We({},r),this.props)),e&&We(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),ks(this))},Ce.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),ks(this))},Ce.prototype.render=it,mt=[],Ds=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ns=function(e,t){return e.__v.__b-t.__v.__b},vn.__r=0,Ls=/(PointerCapture)$|Capture$/i,Zi=0,Qi=Os(!1),Yi=Os(!0),of=0;var Rt,re,no,$s,rr=0,Xs=[],se=M,Gs=se.__b,qs=se.__r,Ks=se.diffed,Ws=se.__c,zs=se.unmount,Qs=se.__;function yn(e,t){se.__h&&se.__h(re,e,rr||t),rr=0;var r=re.__H||(re.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function bn(e){return rr=1,Zs(el,e)}function Zs(e,t,r){var n=yn(Rt++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):el(void 0,t),function(s){var l=n.__N?n.__N[0]:n.__[0],d=n.t(l,s);l!==d&&(n.__N=[d,n.__[1]],n.__c.setState({}))}],n.__c=re,!re.__f)){var i=function(s,l,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,l,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,l,d)||h};re.__f=!0;var o=re.shouldComponentUpdate,a=re.componentWillUpdate;re.componentWillUpdate=function(s,l,d){if(this.__e){var y=o;o=void 0,i(s,l,d),o=y}a&&a.call(this,s,l,d)},re.shouldComponentUpdate=i}return n.__N||n.__}function nr(e,t){var r=yn(Rt++,3);!se.__s&&lo(r.__H,t)&&(r.__=e,r.u=t,re.__H.__h.push(r))}function oo(e,t){var r=yn(Rt++,4);!se.__s&&lo(r.__H,t)&&(r.__=e,r.u=t,re.__h.push(r))}function ao(e){return rr=5,ir(function(){return{current:e}},[])}function ir(e,t){var r=yn(Rt++,7);return lo(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function so(e,t){return rr=8,ir(function(){return e},t)}function df(){for(var e;e=Xs.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(gn),e.__H.__h.forEach(io),e.__H.__h=[]}catch(t){e.__H.__h=[],se.__e(t,e.__v)}}se.__b=function(e){re=null,Gs&&Gs(e)},se.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Qs&&Qs(e,t)},se.__r=function(e){qs&&qs(e),Rt=0;var t=(re=e.__c).__H;t&&(no===re?(t.__h=[],re.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(gn),t.__h.forEach(io),t.__h=[],Rt=0)),no=re},se.diffed=function(e){Ks&&Ks(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Xs.push(t)!==1&&$s===se.requestAnimationFrame||(($s=se.requestAnimationFrame)||ff)(df)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),no=re=null},se.__c=function(e,t){t.some(function(r){try{r.__h.forEach(gn),r.__h=r.__h.filter(function(n){return!n.__||io(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],se.__e(n,r.__v)}}),Ws&&Ws(e,t)},se.unmount=function(e){zs&&zs(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{gn(n)}catch(i){t=i}}),r.__H=void 0,t&&se.__e(t,r.__v))};var Ys=typeof requestAnimationFrame=="function";function ff(e){var t,r=function(){clearTimeout(n),Ys&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Ys&&(t=requestAnimationFrame(r))}function gn(e){var t=re,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),re=t}function io(e){var t=re;e.__c=e.__(),re=t}function lo(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function el(e,t){return typeof t=="function"?t(e):t}function mf(e,t){for(var r in t)e[r]=t[r];return e}function tl(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 rl(e,t){this.props=e,this.context=t}(rl.prototype=new Ce).isPureReactComponent=!0,rl.prototype.shouldComponentUpdate=function(e,t){return tl(this.props,e)||tl(this.state,t)};var nl=M.__b;M.__b=function(e){e.type&&e.type.__f&&e.ref&&(e.props.ref=e.ref,e.ref=null),nl&&nl(e)};var hy=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.forward_ref")||3911;var pf=M.__e;M.__e=function(e,t,r,n){if(e.then){for(var i,o=t;o=o.__;)if((i=o.__c)&&i.__c)return t.__e==null&&(t.__e=r.__e,t.__k=r.__k),i.__c(e,t)}pf(e,t,r,n)};var il=M.unmount;function dl(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=mf({},e)).__c!=null&&(e.__c.__P===r&&(e.__c.__P=t),e.__c=null),e.__k=e.__k&&e.__k.map(function(n){return dl(n,t,r)})),e}function fl(e,t,r){return e&&r&&(e.__v=null,e.__k=e.__k&&e.__k.map(function(n){return fl(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 uo(){this.__u=0,this.o=null,this.__b=null}function hl(e){var t=e.__.__c;return t&&t.__a&&t.__a(e)}function wn(){this.i=null,this.l=null}M.unmount=function(e){var t=e.__c;t&&t.__R&&t.__R(),t&&32&e.__u&&(e.type=null),il&&il(e)},(uo.prototype=new Ce).__c=function(e,t){var r=t.__c,n=this;n.o==null&&(n.o=[]),n.o.push(r);var i=hl(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]=fl(l,l.__c.__P,l.__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)},uo.prototype.componentWillUnmount=function(){this.o=[]},uo.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]=dl(this.__b,r,n.__O=n.__P)}this.__b=null}var i=t.__a&&er(it,null,e.fallback);return i&&(i.__u&=-33),[er(it,null,t.__a?null:e.children),i]};var ol=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]}};(wn.prototype=new Ce).__a=function(e){var t=this,r=hl(t.__v),n=t.l.get(e);return n[0]++,function(i){var o=function(){t.props.revealOrder?(n.push(i),ol(t,e,n)):i()};r?r(o):o()}},wn.prototype.render=function(e){this.i=null,this.l=new Map;var t=tr(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},wn.prototype.componentDidUpdate=wn.prototype.componentDidMount=function(){var e=this;this.l.forEach(function(t,r){ol(e,r,t)})};var vf=typeof Symbol!="undefined"&&Symbol.for&&Symbol.for("react.element")||60103,_f=/^(?: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]/,gf=/^on(Ani|Tra|Tou|BeforeInp|Compo)/,yf=/[A-Z0-9]/g,bf=typeof document!="undefined",wf=function(e){return(typeof Symbol!="undefined"&&typeof Symbol()=="symbol"?/fil|che|rad/:/fil|che|ra/).test(e)};function co(e,t,r){return t.__k==null&&(t.textContent=""),Hs(e,t),typeof r=="function"&&r(),e?e.__c:null}Ce.prototype.isReactComponent={},["componentWillMount","componentWillReceiveProps","componentWillUpdate"].forEach(function(e){Object.defineProperty(Ce.prototype,e,{configurable:!0,get:function(){return this["UNSAFE_"+e]},set:function(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,value:t})}})});var al=M.event;function Ef(){}function If(){return this.cancelBubble}function Af(){return this.defaultPrevented}M.event=function(e){return al&&(e=al(e)),e.persist=Ef,e.isPropagationStopped=If,e.isDefaultPrevented=Af,e.nativeEvent=e};var ml,Sf={enumerable:!1,configurable:!0,get:function(){return this.class}},sl=M.vnode;M.vnode=function(e){typeof e.type=="string"&&function(t){var r=t.props,n=t.type,i={},o=n.indexOf("-")===-1;for(var a in r){var s=r[a];if(!(a==="value"&&"defaultValue"in r&&s==null||bf&&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"||wf(r.type)?l==="onfocus"?a="onfocusin":l==="onblur"?a="onfocusout":gf.test(a)&&(a=l):l=a="oninput":o&&_f.test(a)?a=a.replace(yf,"-$&").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=tr(r.children).forEach(function(d){d.props.selected=i.value.indexOf(d.props.value)!=-1})),n=="select"&&i.defaultValue!=null&&(i.value=tr(r.children).forEach(function(d){d.props.selected=i.multiple?i.defaultValue.indexOf(d.props.value)!=-1:i.defaultValue==d.props.value})),r.class&&!r.className?(i.class=r.class,Object.defineProperty(i,"className",Sf)):(r.className&&!r.class||r.class&&r.className)&&(i.class=i.className=r.className),t.props=i}(e),e.$$typeof=vf,sl&&sl(e)};var ll=M.__r;M.__r=function(e){ll&&ll(e),ml=e.__c};var ul=M.diffed;M.diffed=function(e){ul&&ul(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),ml=null};var pl=Object.getOwnPropertySymbols,Rf=Object.prototype.hasOwnProperty,Cf=Object.prototype.propertyIsEnumerable,Tf=(e,t)=>{var r={};for(var n in e)Rf.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&pl)for(var n of pl(e))t.indexOf(n)<0&&Cf.call(e,n)&&(r[n]=e[n]);return r};function Te(e,t,r){return(t=kf(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function kf(e){var t=xf(e,"string");return typeof t=="symbol"?t:t+""}function xf(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 go=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,"wrapShowAdFn",r=>()=>{var n;this.adsHasResponse=!0;let i=!1;this.videoChecker.play().catch(()=>{i=!1}),i=!this.videoChecker.paused,this.videoChecker.pause(),this.context.track("CallShowAdFn",Object.assign({},{userEvent:i},this.paramsToTrack)),(n=this.adIsShowingCallback)==null||n.call(this,!0),r()}),this.context=t}get paramsToTrack(){var t,r,n,i,o,a;return{provider:(r=(t=this.currentProvider)==null?void 0:t.name)!=null?r:null,type:(n=this.currentClientParams)==null?void 0:n.type,name:((i=this.currentClientParams)==null?void 0:i.type)==="preroll"?null:(a=(o=this.currentClientParams)==null?void 0:o.name)!=null?a:""}}wrapBeforeAd(t){return()=>{var r,n;this.adsHasResponse=!0,this.context.track("CallBeforeAd",this.paramsToTrack),this.isBeforeAdCalled||(this.isBeforeAdCalled=!0,t==null||t(),((r=this.currentClientParams)==null?void 0:r.type)!=="reward"&&((n=this.adIsShowingCallback)==null||n.call(this,!0)))}}wrapBeforeReward(t){return r=>{this.adsHasResponse=!0,this.isBeforeRewardCalled?this.wrapShowAdFn(r)():(this.isBeforeRewardCalled=!0,t==null||t(this.wrapShowAdFn(r)))}}wrapAdDismissed(t){return()=>{this.adsHasResponse=!0,this.isAdDismissedCalled||(this.isAdDismissedCalled=!0,t==null||t())}}wrapAdViewed(t){return()=>{this.adsHasResponse=!0,this.isAdViewedCalled||(this.isAdViewedCalled=!0,t==null||t())}}wrapAfterAd(t){return()=>{this.adsHasResponse=!0,this.context.track("CallAfterAd",this.paramsToTrack),this.isAfterAdCalled||(this.isAfterAdCalled=!0,t==null||t())}}wrapAdBreakDone(t){return r=>{var n,i,o,a,s,l;switch(this.adsHasResponse=!0,this.context.track("CallAdBreakDone",{provider:(i=(n=this.currentProvider)==null?void 0:n.name)!=null?i:null,breakType:r.breakType,breakName:(o=r.breakName)!=null?o:"",breakFormat:r.breakFormat,breakStatus:r.breakStatus}),r.breakStatus){case"viewed":case"ignored":case"dismissed":case"error":{t==null||t(r),(a=this.adIsShowingCallback)==null||a.call(this,!1),(s=this.continueCallback)==null||s.call(this,[!1,r]);break}default:{(l=this.continueCallback)==null||l.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,d,y,h;this.adsHasResponse||(this.context.track("CallAdBreakTimeout",{type:r.type,provider:(l=(s=this.currentProvider)==null?void 0:s.name)!=null?l:null}),(y=this.continueCallback)==null||y.call(this,[!0,{breakType:r.type,breakName:r.type==="preroll"?"":(d=r.name)!=null?d:"",breakFormat:r.type==="reward"?"reward":"interstitial",breakStatus:"timeout"}]),(h=this.adIsShowingCallback)==null||h.call(this,!1))},5e3),this.context.track("CallAdBreak",this.paramsToTrack),t.adBreak(a,n),window.JoliTesterBridge&&console.log("joli-fullscreen-ad-show")})})}};function En(e,t,r){return(t=Of(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Of(e){var t=Pf(e,"string");return typeof t=="symbol"?t:t+""}function Pf(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var yo=class{constructor(t){En(this,"context",void 0),En(this,"adBreakIsShowing",!1),En(this,"reportPageJumpOut",()=>{this.context.track("AdBreakJumpOut",{context:"AdsActionDetection"})}),En(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()})}},Fl=Object.defineProperty,Df=Object.defineProperties,Nf=Object.getOwnPropertyDescriptors,vl=Object.getOwnPropertySymbols,Lf=Object.prototype.hasOwnProperty,Uf=Object.prototype.propertyIsEnumerable,_l=(e,t,r)=>t in e?Fl(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,Mf=(e,t)=>{for(var r in t||(t={}))Lf.call(t,r)&&_l(e,r,t[r]);if(vl)for(var r of vl(t))Uf.call(t,r)&&_l(e,r,t[r]);return e},Bf=(e,t)=>Df(e,Nf(t)),Ff=(e,t)=>{for(var r in t)Fl(e,r,{get:t[r],enumerable:!0})},jl=(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},jf=(e,t,r)=>new Promise((n,i)=>{var o=l=>{try{s(r.next(l))}catch(d){i(d)}},a=l=>{try{s(r.throw(l))}catch(d){i(d)}},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 Jf(e){return new Promise(t=>{setTimeout(()=>{t()},e)})}function Vf(e){return typeof e=="string"}function Hf(e){return typeof e=="undefined"}function $f(e){return Hf(e)||e===null}function Gf(e){return typeof e=="function"}function Jl(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 qf=(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))(qf||{});function or(e){return function(){var t,r;((r=(t=globalThis.VConsole)==null?void 0:t[e])!=null?r:globalThis.console[e])(...arguments)}}var Kf={log:or("log"),warn:or("warn"),info:or("info"),error:or("error"),debug:or("debug")};Object.assign(globalThis,{logger:Kf});var gl=Symbol.for("Jolibox.canIUseMap"),Wf={};globalThis[gl]||(globalThis[gl]=Wf);var yl=Symbol.for("Jolibox.canIUseMap.native"),zf={};globalThis[yl]||(globalThis[yl]=zf);var Vl=(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))(Vl||{}),Hl=(e=>(e.MiniGame="mini-game",e.MiniDrama="mini-drama",e.App="app",e.WebSDK="web-sdk",e.AppSDK="app-sdk",e))(Hl||{}),$l=(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))($l||{}),bl=["name","params"],Qf=["name","type","location","target","extra","timestamp","userId"],Yf=["platform","os","appVersion","appId","model","brand","uuid","jsSdkVersion","extra"];function Sn(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 Xf(e){let t=e.location?Sn(e.location,bl):null,r=e.target?Sn(e.target,bl):null;return Sn(Bf(Mf({},e),{location:t,target:r}),Qf)}function Zf(e){let t=e.events.map(n=>Xf(n)),r=Sn(e.device,Yf);return[e.protocolVersion,t,r,e.project]}function eh(){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}}eh();navigator.userAgent.includes("iPhone")||navigator.userAgent.includes("iPod")||navigator.userAgent.includes("iPad")||navigator.userAgent.includes("iPhone OS"),navigator.userAgent.includes("Android"),navigator.userAgent.includes("Mac"),navigator.userAgent.includes("FB_IAB"),!navigator.userAgent.includes("iPhone")&&navigator.userAgent.includes("Android");var bo=class wo{constructor(t){this.element=t,this.next=wo.Undefined,this.prev=wo.Undefined}};bo.Undefined=new bo(void 0);var te=bo,th=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}},rh=0,ar=class{constructor(e){this.value=e,this.id=rh++}},cr=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 ar&&(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 ar(e);return this._listeners?this._listeners instanceof ar?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 d,y,h,p;if(!this._disposed){if(this._listeners instanceof ar)this._listeners.id===l.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(l);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 ar?this._deliver(this._listeners,e):this._listeners.forEach(t=>this._deliver(t,e)))}hasListeners(){return this._size>0}},nh=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 cr,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 th,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)}},Eo={};Ff(Eo,{None:()=>ih,filter:()=>ah,once:()=>Gl,toPromise:()=>oh});var ih=()=>(console.log("[Jolibox SDK] None Event"),()=>{console.log("[Jolibox SDK] None Event dispose")});function oh(e){return new Promise(t=>Gl(e)(t))}function Gl(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 ah(e,t){return(r=>{let n={onWillAddFirstListener(){r(i.fire,i)}},i=new cr(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 fo=Symbol.for("Jolibox.hostEmitter"),sh=()=>{let e=new nh;return globalThis[fo]||(globalThis[fo]={on:e.on.bind(e),off:e.off.bind(e),emit:e.emit.bind(e),once:e.once.bind(e)}),globalThis[fo]};sh();function lh(e,t){let r=Math.min(e.length,t.length);for(let n=0;n<r;n++)uh(e[n],t[n])}function uh(e,t){if(Vf(t)){if(typeof e!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(Gf(t)){try{if(e instanceof t)return}catch(r){}if(!$f(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 Io=class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new cr,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 lh(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}};Io=jl([Jl],Io);var wl=class{constructor(){this._onWillExecuteCommand=new cr,this.onWillExecuteCommand=this._onWillExecuteCommand.event,this._onDidExecuteCommand=new cr,this.onDidExecuteCommand=this._onDidExecuteCommand.event,this.registry=new Io,this._starActivation=null}_activateStar(){return this._starActivation||(this._starActivation=Jf(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 jf(this,null,function*(){return this.registry.getCommand(e)?this._tryExecuteCommand(e,r):(yield Promise.all([Promise.race([this._activateStar(),Eo.toPromise(Eo.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{}}};wl=jl([Jl],wl);function ho(e,t,r){return(t=ch(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function ch(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 Ao=class{constructor(t){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"GAME";ho(this,"context",void 0),ho(this,"placement","GAME"),ho(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:$l.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:Vl.System,location:this.getLocation(),target:null,extra:r,timestamp:Date.now(),userId:(n=this.contextInfo.userId)!=null?n:null}],device:this.getDevice(),project:Hl.WebSDK};return Zf(i)}};function In(e,t,r){return(t=fh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function fh(e){var t=hh(e,"string");return typeof t=="symbol"?t:t+""}function hh(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 So=class{constructor(t){In(this,"configs",null),In(this,"firstRun",!0),In(this,"context",void 0),In(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 ze(e,t,r){return(t=mh(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function mh(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 Ro=class{constructor(t,r){ze(this,"name","ADSENSE"),ze(this,"context",void 0),ze(this,"contextInfo",void 0),ze(this,"configured",!1),ze(this,"initParams",void 0),ze(this,"push",function(){let n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};window.adsbygoogle.push(n)}),ze(this,"adConfig",n=>{let i=n,{onReady:o}=i,a=Tf(i,["onReady"]);this.context.track("CallAdConfig",a),this.configured?console.warn("Ad config already set, skipping"):(this.configured=!0,this.push(n))}),ze(this,"adBreak",n=>{if(!this.contextInfo.objectId){console.warn("Game ID is not set, skip calling adBreak");return}this.push(n)}),ze(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:d,adFormat:y,fullWidthResponsive:h,style:p}=n,f;if(!l)throw new Error("targeting element is required");if(typeof l=="string"?f=document.querySelector(l):f=l,!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,S=document.createElement("ins");if(S.className="adsbygoogle",S.id="jolibox-ads",S.style.display="block",S.setAttribute("data-ad-client",this.initParams.clientId),S.setAttribute("data-ad-slot",b),I&&S.setAttribute("data-ad-format",I),h&&S.setAttribute("data-full-width-responsive",h),p&&S.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",S.style.position="relative",f.appendChild(S),S.appendChild(w)}else f.appendChild(S),new MutationObserver(w=>{w.forEach(k=>{if(k.type==="attributes"&&k.attributeName==="data-ad-status"){let N=S.getAttribute("data-ad-status");this.context.track("AdSenseUnitStatusChanged",{status:N!=null?N:"null"})}})}).observe(S,{attributes:!0,attributeFilter:["data-ad-status"]}),this.push({})})),this.context=t,this.contextInfo=this.context.getContextInfo(),this.initParams=r,window.adsbygoogle=window.adsbygoogle||[]}init(){return 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&&this.initParams.admobRewardedSlot&&(i.setAttribute("data-admob-interstitial-slot",this.initParams.admobInterstitialSlot),i.setAttribute("data-admob-rewarded-slot",this.initParams.admobRewardedSlot),this.initParams.admobOnly&&i.setAttribute("data-admob-ads-only","on")),document.head.appendChild(i),this.context.track("LoadAdsenseCompleted",null)}})}};function vh(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 _h(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 gh=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(_h(this));var n=this.tags[this.tags.length-1];if(this.isSpeedy){var i=vh(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}(),be="-ms-",On="-moz-",$="-webkit-",ql="comm",Fo="rule",jo="decl",yh="@import",Kl="@keyframes",bh="@layer",wh=Math.abs,Un=String.fromCharCode,Eh=Object.assign;function Ih(e,t){return he(e,0)^45?(((t<<2^he(e,0))<<2^he(e,1))<<2^he(e,2))<<2^he(e,3):0}function Wl(e){return e.trim()}function Ah(e,t){return(e=t.exec(e))?e[0]:e}function G(e,t,r){return e.replace(t,r)}function Co(e,t){return e.indexOf(t)}function he(e,t){return e.charCodeAt(t)|0}function dr(e,t,r){return e.slice(t,r)}function je(e){return e.length}function Jo(e){return e.length}function An(e,t){return t.push(e),e}function Sh(e,t){return e.map(t).join("")}var Mn=1,xt=1,zl=0,Se=0,de=0,Ot="";function Bn(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Mn,column:xt,length:a,return:""}}function sr(e,t){return Eh(Bn("",null,null,"",null,null,0),e,{length:-e.length},t)}function Rh(){return de}function Ch(){return de=Se>0?he(Ot,--Se):0,xt--,de===10&&(xt=1,Mn--),de}function Oe(){return de=Se<zl?he(Ot,Se++):0,xt++,de===10&&(xt=1,Mn++),de}function Je(){return he(Ot,Se)}function Rn(){return Se}function hr(e,t){return dr(Ot,e,t)}function fr(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 Ql(e){return Mn=xt=1,zl=je(Ot=e),Se=0,[]}function Yl(e){return Ot="",e}function Cn(e){return Wl(hr(Se-1,To(e===91?e+2:e===40?e+1:e)))}function Th(e){for(;(de=Je())&&de<33;)Oe();return fr(e)>2||fr(de)>3?"":" "}function kh(e,t){for(;--t&&Oe()&&!(de<48||de>102||de>57&&de<65||de>70&&de<97););return hr(e,Rn()+(t<6&&Je()==32&&Oe()==32))}function To(e){for(;Oe();)switch(de){case e:return Se;case 34:case 39:e!==34&&e!==39&&To(de);break;case 40:e===41&&To(e);break;case 92:Oe();break}return Se}function xh(e,t){for(;Oe()&&e+de!==57&&!(e+de===84&&Je()===47););return"/*"+hr(t,Se-1)+"*"+Un(e===47?e:Oe())}function Oh(e){for(;!fr(Je());)Oe();return hr(e,Se)}function Ph(e){return Yl(Tn("",null,null,null,[""],e=Ql(e),0,[0],e))}function Tn(e,t,r,n,i,o,a,s,l){for(var d=0,y=0,h=a,p=0,f=0,b=0,I=1,S=1,w=1,k=0,N="",j=i,W=o,R=n,L=N;S;)switch(b=k,k=Oe()){case 40:if(b!=108&&he(L,h-1)==58){Co(L+=G(Cn(k),"&","&\f"),"&\f")!=-1&&(w=-1);break}case 34:case 39:case 91:L+=Cn(k);break;case 9:case 10:case 13:case 32:L+=Th(b);break;case 92:L+=kh(Rn()-1,7);continue;case 47:switch(Je()){case 42:case 47:An(Dh(xh(Oe(),Rn()),t,r),l);break;default:L+="/"}break;case 123*I:s[d++]=je(L)*w;case 125*I:case 59:case 0:switch(k){case 0:case 125:S=0;case 59+y:w==-1&&(L=G(L,/\f/g,"")),f>0&&je(L)-h&&An(f>32?Il(L+";",n,r,h-1):Il(G(L," ","")+";",n,r,h-2),l);break;case 59:L+=";";default:if(An(R=El(L,t,r,d,y,i,s,N,j=[],W=[],h),o),k===123)if(y===0)Tn(L,t,R,R,j,o,h,s,W);else switch(p===99&&he(L,3)===110?100:p){case 100:case 108:case 109:case 115:Tn(e,R,R,n&&An(El(e,R,R,0,0,i,s,N,i,j=[],h),W),i,W,h,s,n?j:W);break;default:Tn(L,R,R,R,[""],W,0,s,W)}}d=y=f=0,I=w=1,N=L="",h=a;break;case 58:h=1+je(L),f=b;default:if(I<1){if(k==123)--I;else if(k==125&&I++==0&&Ch()==125)continue}switch(L+=Un(k),k*I){case 38:w=y>0?1:(L+="\f",-1);break;case 44:s[d++]=(je(L)-1)*w,w=1;break;case 64:Je()===45&&(L+=Cn(Oe())),p=Je(),y=h=je(N=L+=Oh(Rn())),k++;break;case 45:b===45&&je(L)==2&&(I=0)}}return o}function El(e,t,r,n,i,o,a,s,l,d,y){for(var h=i-1,p=i===0?o:[""],f=Jo(p),b=0,I=0,S=0;b<n;++b)for(var w=0,k=dr(e,h+1,h=wh(I=a[b])),N=e;w<f;++w)(N=Wl(I>0?p[w]+" "+k:G(k,/&\f/g,p[w])))&&(l[S++]=N);return Bn(e,t,r,i===0?Fo:s,l,d,y)}function Dh(e,t,r){return Bn(e,t,r,ql,Un(Rh()),dr(e,2,-2),0)}function Il(e,t,r,n){return Bn(e,t,r,jo,dr(e,0,n),dr(e,n+1,-1),n)}function kt(e,t){for(var r="",n=Jo(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Nh(e,t,r,n){switch(e.type){case bh:if(e.children.length)break;case yh:case jo:return e.return=e.return||e.value;case ql:return"";case Kl:return e.return=e.value+"{"+kt(e.children,n)+"}";case Fo:e.value=e.props.join(",")}return je(r=kt(e.children,n))?e.return=e.value+"{"+r+"}":""}function Lh(e){var t=Jo(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 Uh(e){return function(t){t.root||(t=t.return)&&e(t)}}function Mh(e){var t=Object.create(null);return function(r){return t[r]===void 0&&(t[r]=e(r)),t[r]}}var Bh=function(e,t,r){for(var n=0,i=0;n=i,i=Je(),n===38&&i===12&&(t[r]=1),!fr(i);)Oe();return hr(e,Se)},Fh=function(e,t){var r=-1,n=44;do switch(fr(n)){case 0:n===38&&Je()===12&&(t[r]=1),e[r]+=Bh(Se-1,t,r);break;case 2:e[r]+=Cn(n);break;case 4:if(n===44){e[++r]=Je()===58?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Un(n)}while(n=Oe());return e},jh=function(e,t){return Yl(Fh(Ql(e),t))},Al=new WeakMap,Jh=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;r.type!=="rule";)if(r=r.parent,!r)return;if(!(e.props.length===1&&t.charCodeAt(0)!==58&&!Al.get(r))&&!n){Al.set(e,!0);for(var i=[],o=jh(t,i),a=r.props,s=0,l=0;s<o.length;s++)for(var d=0;d<a.length;d++,l++)e.props[l]=i[s]?o[s].replace(/&\f/g,a[d]):a[d]+" "+o[s]}}},Vh=function(e){if(e.type==="decl"){var t=e.value;t.charCodeAt(0)===108&&t.charCodeAt(2)===98&&(e.return="",e.value="")}};function Xl(e,t){switch(Ih(e,t)){case 5103:return $+"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 $+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return $+e+On+e+be+e+e;case 6828:case 4268:return $+e+be+e+e;case 6165:return $+e+be+"flex-"+e+e;case 5187:return $+e+G(e,/(\w+).+(:[^]+)/,$+"box-$1$2"+be+"flex-$1$2")+e;case 5443:return $+e+be+"flex-item-"+G(e,/flex-|-self/,"")+e;case 4675:return $+e+be+"flex-line-pack"+G(e,/align-content|flex-|-self/,"")+e;case 5548:return $+e+be+G(e,"shrink","negative")+e;case 5292:return $+e+be+G(e,"basis","preferred-size")+e;case 6060:return $+"box-"+G(e,"-grow","")+$+e+be+G(e,"grow","positive")+e;case 4554:return $+G(e,/([^-])(transform)/g,"$1"+$+"$2")+e;case 6187:return G(G(G(e,/(zoom-|grab)/,$+"$1"),/(image-set)/,$+"$1"),e,"")+e;case 5495:case 3959:return G(e,/(image-set\([^]*)/,$+"$1$`$1");case 4968:return G(G(e,/(.+:)(flex-)?(.*)/,$+"box-pack:$3"+be+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+$+e+e;case 4095:case 3583:case 4068:case 2532:return G(e,/(.+)-inline(.+)/,$+"$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(je(e)-1-t>6)switch(he(e,t+1)){case 109:if(he(e,t+4)!==45)break;case 102:return G(e,/(.+:)(.+)-([^]+)/,"$1"+$+"$2-$3$1"+On+(he(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Co(e,"stretch")?Xl(G(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(he(e,t+1)!==115)break;case 6444:switch(he(e,je(e)-3-(~Co(e,"!important")&&10))){case 107:return G(e,":",":"+$)+e;case 101:return G(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+$+(he(e,14)===45?"inline-":"")+"box$3$1"+$+"$2$3$1"+be+"$2box$3")+e}break;case 5936:switch(he(e,t+11)){case 114:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return $+e+be+G(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return $+e+be+e+e}return e}var Hh=function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case jo:e.return=Xl(e.value,e.length);break;case Kl:return kt([sr(e,{value:G(e.value,"@","@"+$)})],n);case Fo:if(e.length)return Sh(e.props,function(i){switch(Ah(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return kt([sr(e,{props:[G(i,/:(read-\w+)/,":"+On+"$1")]})],n);case"::placeholder":return kt([sr(e,{props:[G(i,/:(plac\w+)/,":"+$+"input-$1")]}),sr(e,{props:[G(i,/:(plac\w+)/,":"+On+"$1")]}),sr(e,{props:[G(i,/:(plac\w+)/,be+"input-$1")]})],n)}return""})}},$h=[Hh],Gh=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||$h,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(" "),S=1;S<I.length;S++)i[I[S]]=!0;a.push(b)});var s,l=[Jh,Vh];{var d,y=[Nh,Uh(function(b){d.insert(b)})],h=Lh(l.concat(n,y)),p=function(b){return kt(Ph(b),h)};s=function(b,I,S,w){d=S,p(b?b+"{"+I.styles+"}":I.styles),w&&(f.inserted[I.name]=!0)}}var f={key:t,sheet:new gh({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 qh(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 Kh={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Wh=/[A-Z]|^ms/g,zh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Zl=function(e){return e.charCodeAt(1)===45},Sl=function(e){return e!=null&&typeof e!="boolean"},mo=Mh(function(e){return Zl(e)?e:e.replace(Wh,"-$&").toLowerCase()}),Rl=function(e,t){switch(e){case"animation":case"animationName":if(typeof t=="string")return t.replace(zh,function(r,n,i){return ot={name:n,styles:i,next:ot},n})}return Kh[e]!==1&&!Zl(e)&&typeof t=="number"&&t!==0?t+"px":t};function Pn(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var i=r;if(i.anim===1)return ot={name:i.name,styles:i.styles,next:ot},i.name;var o=r;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)ot={name:a.name,styles:a.styles,next:ot},a=a.next;var s=o.styles+";";return s}return Qh(e,t,r)}}var l=r;if(t==null)return l;var d=t[l];return d!==void 0?d:l}function Qh(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Pn(e,t,r[i])+";";else for(var o in r){var a=r[o];if(typeof a!="object"){var s=a;t!=null&&t[s]!==void 0?n+=o+"{"+t[s]+"}":Sl(s)&&(n+=mo(o)+":"+Rl(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++)Sl(a[l])&&(n+=mo(o)+":"+Rl(o,a[l])+";");else{var d=Pn(e,t,a);switch(o){case"animation":case"animationName":{n+=mo(o)+":"+d+";";break}default:n+=o+"{"+d+"}"}}}return n}var Cl=/label:\s*([^\s;{]+)\s*(;|$)/g,ot;function po(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="";ot=void 0;var o=e[0];if(o==null||o.raw===void 0)n=!1,i+=Pn(r,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=Pn(r,t,e[s]),n){var l=o;i+=l[s]}Cl.lastIndex=0;for(var d="",y;(y=Cl.exec(i))!==null;)d+="-"+y[1];var h=qh(i)+d;return{name:h,styles:i,next:ot}}function eu(e,t,r){var n="";return r.split(" ").forEach(function(i){e[i]!==void 0?t.push(e[i]+";"):i&&(n+=i+" ")}),n}var Yh=function(e,t,r){var n=e.key+"-"+t.name;e.registered[n]===void 0&&(e.registered[n]=t.styles)},Xh=function(e,t,r){Yh(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 Tl(e,t){if(e.inserted[t.name]===void 0)return e.insert("",t,e.sheet,!0)}function kl(e,t,r){var n=[],i=eu(e,n,r);return n.length<2?r:i+t(n)}var Zh=function(e){var t=Gh(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 d=po(s,t.registered,void 0);return Xh(t,d),t.key+"-"+d.name},n=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=po(s,t.registered),y="animation-"+d.name;return Tl(t,{name:d.name,styles:"@keyframes "+y+"{"+d.styles+"}"}),y},i=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];var d=po(s,t.registered);Tl(t,d)},o=function(){for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return kl(t.registered,r,em(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:eu.bind(null,t.registered),merge:kl.bind(null,t.registered,r)}},em=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},tm=Zh({key:"css"}),Pt=tm.css,ko,xe,vo,xl,Ol=0,tu=[],fe=M,Pl=fe.__b,Dl=fe.__r,Nl=fe.diffed,Ll=fe.__c,Ul=fe.unmount,Ml=fe.__;function rm(e,t){fe.__h&&fe.__h(xe,e,Ol||t),Ol=0;var r=xe.__H||(xe.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function ru(e,t){var r=rm(ko++,7);return om(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function nm(){for(var e;e=tu.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(kn),e.__H.__h.forEach(xo),e.__H.__h=[]}catch(t){e.__H.__h=[],fe.__e(t,e.__v)}}fe.__b=function(e){xe=null,Pl&&Pl(e)},fe.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Ml&&Ml(e,t)},fe.__r=function(e){Dl&&Dl(e),ko=0;var t=(xe=e.__c).__H;t&&(vo===xe?(t.__h=[],xe.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(t.__h.forEach(kn),t.__h.forEach(xo),t.__h=[],ko=0)),vo=xe},fe.diffed=function(e){Nl&&Nl(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(tu.push(t)!==1&&xl===fe.requestAnimationFrame||((xl=fe.requestAnimationFrame)||im)(nm)),t.__H.__.forEach(function(r){r.u&&(r.__H=r.u),r.u=void 0})),vo=xe=null},fe.__c=function(e,t){t.some(function(r){try{r.__h.forEach(kn),r.__h=r.__h.filter(function(n){return!n.__||xo(n)})}catch(n){t.some(function(i){i.__h&&(i.__h=[])}),t=[],fe.__e(n,r.__v)}}),Ll&&Ll(e,t)},fe.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&&fe.__e(t,r.__v))};var Bl=typeof requestAnimationFrame=="function";function im(e){var t,r=function(){clearTimeout(n),Bl&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Bl&&(t=requestAnimationFrame(r))}function kn(e){var t=xe,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),xe=t}function xo(e){var t=xe;e.__c=e.__(),xe=t}function om(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}var am=Symbol.for("preact-signals");function Fn(){if(at>1)at--;else{for(var e,t=!1;lr!==void 0;){var r=lr;for(lr=void 0,Oo++;r!==void 0;){var n=r.o;if(r.o=void 0,r.f&=-3,!(8&r.f)&&iu(r))try{r.c()}catch(i){t||(e=i,t=!0)}r=n}}if(Oo=0,at--,t)throw e}}function Ae(e){if(at>0)return e();at++;try{return e()}finally{Fn()}}var Y=void 0,lr=void 0,at=0,Oo=0,Dn=0;function nu(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 me(e){this.v=e,this.i=0,this.n=void 0,this.t=void 0}me.prototype.brand=am;me.prototype.h=function(){return!0};me.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)};me.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)}};me.prototype.subscribe=function(e){var t=this;return pr(function(){var r=t.value,n=Y;Y=void 0;try{e(r)}finally{Y=n}})};me.prototype.valueOf=function(){return this.value};me.prototype.toString=function(){return this.value+""};me.prototype.toJSON=function(){return this.value};me.prototype.peek=function(){var e=Y;Y=void 0;try{return this.value}finally{Y=e}};Object.defineProperty(me.prototype,"value",{get:function(){var e=nu(this);return e!==void 0&&(e.i=this.i),this.v},set:function(e){if(e!==this.v){if(Oo>100)throw new Error("Cycle detected");this.v=e,this.i++,Dn++,at++;try{for(var t=this.t;t!==void 0;t=t.x)t.t.N()}finally{Fn()}}}});function X(e){return new me(e)}function iu(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 ou(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 au(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 Dt(e){me.call(this,void 0),this.x=e,this.s=void 0,this.g=Dn-1,this.f=4}(Dt.prototype=new me).h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===Dn))return!0;if(this.g=Dn,this.f|=1,this.i>0&&!iu(this))return this.f&=-2,!0;var e=Y;try{ou(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,au(this),this.f&=-2,!0};Dt.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)}me.prototype.S.call(this,e)};Dt.prototype.U=function(e){if(this.t!==void 0&&(me.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)}};Dt.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(Dt.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var e=nu(this);if(this.h(),e!==void 0&&(e.i=this.i),16&this.f)throw this.v;return this.v}});function ur(e){return new Dt(e)}function su(e){var t=e.u;if(e.u=void 0,typeof t=="function"){at++;var r=Y;Y=void 0;try{t()}catch(n){throw e.f&=-2,e.f|=8,Vo(e),n}finally{Y=r,Fn()}}}function Vo(e){for(var t=e.s;t!==void 0;t=t.n)t.S.U(t);e.x=void 0,e.s=void 0,su(e)}function sm(e){if(Y!==this)throw new Error("Out-of-order effect");au(this),Y=e,this.f&=-2,8&this.f&&Vo(this),Fn()}function mr(e){this.x=e,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}mr.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()}};mr.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,su(this),ou(this),at++;var e=Y;return Y=this,sm.bind(this,e)};mr.prototype.N=function(){2&this.f||(this.f|=2,this.o=lr,lr=this)};mr.prototype.d=function(){this.f|=8,1&this.f||Vo(this)};function pr(e){var t=new mr(e);try{t.c()}catch(r){throw t.d(),r}return t.d.bind(t)}var lu,_o,uu=[];pr(function(){lu=this.N})();function Nt(e,t){M[e]=t.bind(null,M[e]||function(){})}function Nn(e){_o&&_o(),_o=e&&e.S()}function cu(e){var t=this,r=e.data,n=du(r);n.value=r;var i=ru(function(){for(var s=t,l=t.__v;l=l.__;)if(l.__c){l.__c.__$f|=4;break}var d=ur(function(){var f=n.value.value;return f===0?0:f===!0?"":f||""}),y=ur(function(){return!Array.isArray(d.value)&&!Xi(d.value)}),h=pr(function(){if(this.N=fu,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}cu.displayName="_st";Object.defineProperties(me.prototype,{constructor:{configurable:!0,value:void 0},type:{configurable:!0,value:cu},props:{configurable:!0,get:function(){return{data:this}}},__b:{configurable:!0,value:1}});Nt("__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 me&&(r||(t.__np=r={}),r[i]=o,n[i]=o.peek())}}e(t)});Nt("__r",function(e,t){Nn();var r,n=t.__c;n&&(n.__$f&=-2,(r=n.__$u)===void 0&&(n.__$u=r=function(i){var o;return pr(function(){o=this}),o.c=function(){n.__$f|=1,n.setState({})},o}())),Nn(r),e(t)});Nt("__e",function(e,t,r,n){Nn(),e(t,r,n)});Nt("diffed",function(e,t){Nn();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 d=o[l],y=n[l];d===void 0?(d=lm(r,l,y,i),o[l]=d):d.o(y,i)}}}e(t)});function lm(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:pr(function(){this.N=fu;var a=o.value.value;n[t]!==a&&(n[t]=a,i?e[t]=a:a?e.setAttribute(t,a):e.removeAttribute(t))})}}Nt("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)});Nt("__h",function(e,t,r,n){(n<3||n===9)&&(t.__$f|=2),e(t,r,n)});Ce.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 du(e){return ru(function(){return X(e)},[])}var um=function(e){queueMicrotask(function(){queueMicrotask(e)})};function cm(){Ae(function(){for(var e;e=uu.shift();)lu.call(e)})}function fu(){uu.push(this)===1&&(M.requestAnimationFrame||um)(cm)}var we=Pt`
|
|
4
4
|
inset: 0;
|
|
5
5
|
clear: none;
|
|
6
6
|
float: none;
|
|
@@ -18,8 +18,8 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
18
18
|
text-decoration: none;
|
|
19
19
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans',
|
|
20
20
|
'Helvetica Neue', sans-serif;
|
|
21
|
-
`;function
|
|
22
|
-
${
|
|
21
|
+
`;function dm(e,t){let r=ao(e);oo(()=>{r.current=e},[e]),nr(()=>{if(t===null)return;let n=setInterval(()=>{r.current()},t);return()=>{clearInterval(n)}},[t])}var fm=0;function le(e,t,r,n,i,o){t||(t={});var a,s,l=t;if("ref"in l)for(s in l={},t)s=="ref"?a=t[s]:l[s]=t[s];var d={type:e,props:l,key:r,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--fm,__i:-1,__u:0,__source:i,__self:o};if(typeof e=="function"&&(a=e.defaultProps))for(s in a)l[s]===void 0&&(l[s]=a[s]);return M.vnode&&M.vnode(d),d}var hm=Pt`
|
|
22
|
+
${we}
|
|
23
23
|
position: fixed;
|
|
24
24
|
top: 0;
|
|
25
25
|
left: 0;
|
|
@@ -32,7 +32,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
32
32
|
height: 100vh;
|
|
33
33
|
|
|
34
34
|
.card-wrapper {
|
|
35
|
-
${
|
|
35
|
+
${we}
|
|
36
36
|
position: relative;
|
|
37
37
|
display: flex;
|
|
38
38
|
flex-direction: column;
|
|
@@ -46,7 +46,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
46
46
|
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
|
|
47
47
|
|
|
48
48
|
.body {
|
|
49
|
-
${
|
|
49
|
+
${we}
|
|
50
50
|
display: flex;
|
|
51
51
|
flex-direction: column;
|
|
52
52
|
width: 100%;
|
|
@@ -55,7 +55,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
55
55
|
box-sizing: border-box;
|
|
56
56
|
justify-content: center;
|
|
57
57
|
.title {
|
|
58
|
-
${
|
|
58
|
+
${we}
|
|
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}},Hr=class extends ue{constructor(...t){super
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.content {
|
|
66
|
-
${
|
|
66
|
+
${we}
|
|
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}},Hr=class extends ue{constructor(...t){super
|
|
|
71
71
|
}
|
|
72
72
|
|
|
73
73
|
.footer {
|
|
74
|
-
${
|
|
74
|
+
${we}
|
|
75
75
|
display: flex;
|
|
76
76
|
align-items: center;
|
|
77
77
|
width: 100%;
|
|
78
78
|
height: 40px;
|
|
79
79
|
button {
|
|
80
|
-
${
|
|
80
|
+
${we}
|
|
81
81
|
border: none;
|
|
82
82
|
outline: none;
|
|
83
83
|
height: 100%;
|
|
@@ -93,8 +93,8 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
`,
|
|
97
|
-
${
|
|
96
|
+
`,Xe=X(null),Po=X(""),Do=X(""),xn=X(!1),mm=()=>{var e;(e=Xe.value)==null||e.call(Xe,!1)},pm=()=>{var e;(e=Xe.value)==null||e.call(Xe,!0)},vm=e=>P(void 0,null,function*(){let{title:t,content:r}=e;return Xe.value&&(Xe.value(!1),Ae(()=>{Xe.value=null,xn.value=!1})),Ae(()=>{Po.value=t||"",Do.value=r||"",xn.value=!0}),new Promise(n=>{Xe.value=i=>{Ae(()=>{Xe.value=null,xn.value=!1,Po.value="",Do.value=""}),n(i)}})}),_m=()=>xn.value?le("div",{className:hm,children:le("div",{className:"card-wrapper",children:[le("div",{className:"body",children:[le("div",{className:"title",children:Po.value}),le("div",{className:"content",children:Do.value})]}),le("div",{className:"footer",children:[le("button",{onClick:mm,className:"cancel-btn",children:"Cancel"}),le("button",{onClick:pm,className:"confirm-btm",children:"Confirm"})]})]})}):null,gm=Pt`
|
|
97
|
+
${we}
|
|
98
98
|
position: relative;
|
|
99
99
|
display: flex;
|
|
100
100
|
align-items: center;
|
|
@@ -112,7 +112,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
112
112
|
}
|
|
113
113
|
|
|
114
114
|
button {
|
|
115
|
-
${
|
|
115
|
+
${we}
|
|
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}},Hr=class extends ue{constructor(...t){super
|
|
|
126
126
|
cursor: not-allowed;
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
|
-
`,
|
|
130
|
-
${
|
|
129
|
+
`,ym=()=>{let e=X(!1),t=X(null);return{timerPaused:e,startTimestamp:t,startTimer:()=>{Ae(()=>{t.value=Date.now(),e.value=!1})}}},bm=e=>{let{countdown:t=0,mode:r,onClose:n,state:i}=e,{startTimestamp:o,timerPaused:a}=i,s=du(t);dm(()=>{s.value>0?s.value-=1:Ae(()=>{a.value=!0,s.value=0})},a.value?null:1e3);let l=ur(()=>{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=ur(()=>{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=ur(()=>r==="interstitial"?!1:!l.value&&!d.value),h=()=>P(void 0,null,function*(){if(a.value=!0,!(yield vm({title:"Are you sure?",content:"You will lose your reward if you dismiss this Ad."}))){a.value=!1;return}n("dismiss"),Ae(()=>{a.value=!0,s.value=0,o.value=null})}),p=()=>{n("viewed"),Ae(()=>{a.value=!0,s.value=0,o.value=null})};return le("div",{className:gm,children:[s.value>0&&r!=="interstitial"&&le("div",{className:"timer",children:[s.value,"s"]}),le("button",{onClick:l.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"})})})]})},wm=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(!1),a=X(15),s=X(""),l=X("reward");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,visible:o,countdown:a,src:s,mode:l}},Em=Pt`
|
|
130
|
+
${we}
|
|
131
131
|
position: fixed;
|
|
132
132
|
z-index: 2147483647;
|
|
133
133
|
background: white;
|
|
@@ -137,7 +137,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
137
137
|
flex-direction: column;
|
|
138
138
|
|
|
139
139
|
iframe {
|
|
140
|
-
${
|
|
140
|
+
${we}
|
|
141
141
|
flex: 1;
|
|
142
142
|
position: relative;
|
|
143
143
|
display: block;
|
|
@@ -145,8 +145,8 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
145
145
|
width: 100%;
|
|
146
146
|
height: 100%;
|
|
147
147
|
}
|
|
148
|
-
`,
|
|
149
|
-
${
|
|
148
|
+
`,Im=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,visible:s,countdown:l,src:d,mode:y}=t,h=ir(()=>ym(),[]),[p,f]=bn(!1),b=S=>{var w,k,N,j;s.value=!1,S==="dismiss"?(w=n.value)==null||w.call(n):S==="viewed"&&((k=i.value)==null||k.call(i)),(N=r.value)==null||N.call(r),(j=o.value)==null||j.call(o),f(!1)},I=so(()=>{var S;p||(f(!0),(S=a.value)==null||S.call(a))},[p]);return nr(()=>{p&&(y.value==="reward"||y.value==="rewarded_insterstitial")&&setTimeout(()=>{h.startTimer()},100)},[p,y.value]),s.value?le("div",{className:Em,children:[le(bm,{mode:y.value,onClose:b,countdown:l.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(_m,{})]}):null};function Qe(e,t,r){return(t=Am(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Am(e){var t=Sm(e,"string");return typeof t=="symbol"?t:t+""}function Sm(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,r){Qe(this,"name","OKSPIN"),Qe(this,"initialized",!1),Qe(this,"initCompleter",null),Qe(this,"context",void 0),Qe(this,"initParams",void 0),Qe(this,"adsOverlay",null),Qe(this,"adsIsShowing",!1),Qe(this,"lastUnDisplayedAdBreak",null),Qe(this,"state",wm()),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"),co(le(Im,{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,l,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"})};Ae(()=>{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&&((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),(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)};Ae(()=>{this.state.afterAd.value=h,this.state.adDismissed.value=f,this.state.adViewed.value=b,this.state.adBreakDone.value=I});let S=()=>{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,Ae(()=>{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,S);break}}})}},Tt={};window.addEventListener("message",e=>{e.origin!=="https://ads.appsrockets.com"&&e.origin!=="https://stg-ads.appsrockets.com"||Tt[e.data.type]&&Tt[e.data.type].forEach(t=>{t(e.data.data)})});var Ct=(e,t)=>{nr(()=>(Tt[e]||(Tt[e]=new Set),Tt[e].add(t),()=>{Tt[e].delete(t)}),[e,t])},Rm=()=>{let e=X(),t=X(),r=X(),n=X(),i=X(),o=X(),a=X(),s=X(!1),l=X("");return{afterAd:e,adDismissed:t,adViewed:r,adBreakDone:n,adLoaded:i,adLinkClicked:o,adError:a,visible:s,src:l}},Cm=Pt`
|
|
149
|
+
${we}
|
|
150
150
|
position: fixed;
|
|
151
151
|
z-index: 2147483647;
|
|
152
152
|
background: white;
|
|
@@ -156,7 +156,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
156
156
|
flex-direction: column;
|
|
157
157
|
|
|
158
158
|
iframe {
|
|
159
|
-
${
|
|
159
|
+
${we}
|
|
160
160
|
flex: 1;
|
|
161
161
|
position: relative;
|
|
162
162
|
display: block;
|
|
@@ -164,8 +164,8 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
164
164
|
width: 100%;
|
|
165
165
|
height: 100%;
|
|
166
166
|
}
|
|
167
|
-
`,_m=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:u,src:d}=t,[y,m]=dn(!1),v=E=>{var w,S,b,x;m(!1),u.value=!1,E==="dismiss"?(w=n.value)==null||w.call(n):E==="viewed"&&((S=i.value)==null||S.call(i)),(b=r.value)==null||b.call(r),(x=o.value)==null||x.call(o)},f=()=>{var E;(E=a.value)==null||E.call(a)};return It("appsrockets_ad_dismissed",()=>v("dismiss")),It("appsrockets_ad_rewarded",()=>v("viewed")),It("appsrockets_ad_completed",()=>v("viewed")),It("appsrockets_ad_skipped",()=>v("viewed")),It("appsrockets_ad_clicked",E=>{var w;return(w=s.value)==null?void 0:w.call(s,E)}),It("appsrockets_ad_loaded",()=>m(!0)),u.value?se("div",{className:vm,style:{display:y?"flex":"none"},children:u.value&&se("iframe",{src:d.value,onLoad:f,allowFullScreen:!0,allow:"autoplay",sandbox:"allow-scripts allow-same-origin allow-forms allow-modals allow-downloads allow-popups allow-popups-to-escape-sandbox allow-top-navigation-by-user-activation allow-top-navigation allow-top-navigation-by-user-activation allow-top-navigation-to-custom-protocols"})}):null};function We(e,t,r){return(t=gm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function gm(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 Io=class{constructor(t,r){We(this,"name","APPSROCKETS"),We(this,"initialized",!1),We(this,"initCompleter",null),We(this,"context",void 0),We(this,"adsOverlay",null),We(this,"adsIsShowing",!1),We(this,"lastUnDisplayedAdBreak",null),We(this,"state",pm()),We(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 L(this,null,function*(){var t;this.adsOverlay=document.createElement("div"),this.adsOverlay.setAttribute("data-placement-info","afg-appsrockets"),Zi(se(_m,{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 m=v=>{var f,E;(E=(f=this.context).handleLinkClicked)==null||E.call(f,v)};switch(t.type){case"preroll":{(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"start":case"browse":case"next":case"pause":{(a=t.beforeAd)==null||a.call(t);let v=()=>{var w;this.adsIsShowing=!1,(w=t.afterAd)==null||w.call(t)},f=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"viewed"})},E=()=>{var w;this.adsIsShowing=!1,(w=t.adBreakDone)==null||w.call(t,{breakType:t.type,breakName:t.name,breakFormat:"interstitial",breakStatus:"noAdPreloaded"})};Ie(()=>{this.adsIsShowing=!0,this.state.afterAd.value=v,this.state.adBreakDone.value=f,this.state.src.value=this.processUrl(r.params.url),this.state.adLinkClicked.value=m,this.state.adError.value=E,this.state.visible.value=!0});break}case"reward":{this.lastUnDisplayedAdBreak&&((u=(s=this.lastUnDisplayedAdBreak).adBreakDone)==null||u.call(s,{breakType:this.lastUnDisplayedAdBreak.type,breakName:this.lastUnDisplayedAdBreak.type==="preroll"?"":this.lastUnDisplayedAdBreak.name,breakFormat:this.lastUnDisplayedAdBreak.type==="reward"?"reward":"interstitial",breakStatus:"ignored"}),this.lastUnDisplayedAdBreak=null),(d=t.beforeAd)==null||d.call(t);let v=()=>{var P;this.adsIsShowing=!1,(P=t.afterAd)==null||P.call(t)},f={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},E=()=>{var P;this.adsIsShowing=!1,f.breakStatus="dismissed",(P=t.adDismissed)==null||P.call(t)},w=()=>{var P;this.adsIsShowing=!1,f.breakStatus="viewed",(P=t.adViewed)==null||P.call(t)},S=()=>{var P;this.adsIsShowing=!1,(P=t.adBreakDone)==null||P.call(t,f)},b=()=>{this.adsIsShowing=!1,f.breakStatus="noAdPreloaded"};Ie(()=>{this.state.afterAd.value=v,this.state.adDismissed.value=E,this.state.adViewed.value=w,this.state.adBreakDone.value=S,this.state.adLinkClicked.value=m,this.state.adError.value=b});let x=()=>{var P;if(this.lastUnDisplayedAdBreak=null,!this.adsOverlay){(P=t.adBreakDone)==null||P.call(t,{breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"notReady"});return}this.adsIsShowing=!0,Ie(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,x);break}}}},tu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function _e(e,t,r){return(t=bm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function bm(e){var t=wm(e,"string");return typeof t=="symbol"?t:t+""}function wm(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 So=class{constructor(t,r,n){_e(this,"adUnit",void 0),_e(this,"project",void 0),_e(this,"keyValue",void 0),_e(this,"adsContext",null),_e(this,"rewardedSlot",null),_e(this,"rewardedPayload",null),_e(this,"readyEvent",null),_e(this,"withCommand",function(){googletag.cmd.push(...arguments)}),_e(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))}),_e(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}),_e(this,"reinit",i=>{this.destroy(i),this.init()}),_e(this,"handleSlotReady",i=>{i.slot===this.rewardedSlot&&(this.readyEvent=i)}),_e(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)})}}),_e(this,"handleSlotGranted",i=>{this.adsContext&&i.slot===this.rewardedSlot&&(this.rewardedPayload=i.payload)}),_e(this,"handleSlotRenderEnded",i=>{i.slot===this.rewardedSlot&&i.isEmpty&&this.adsContext&&this.withCommand(()=>{this.reinit("frequencyCapped")})}),_e(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=>{var s,u;a.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",o),this.readyEvent=a,(u=(s=this.adsContext).beforeAd)==null||u.call(s),this.adsContext.beforeReward(()=>{var d;(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 Te(e,t,r){return(t=Em(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Em(e){var t=Am(e,"string");return typeof t=="symbol"?t:t+""}function Am(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Ro=class{constructor(t,r,n){Te(this,"adUnit",void 0),Te(this,"project",void 0),Te(this,"keyValue",void 0),Te(this,"adsContext",null),Te(this,"gamingInterstitialSlot",null),Te(this,"readyEvent",null),Te(this,"withCommand",function(){googletag.cmd.push(...arguments)}),Te(this,"init",()=>{var i;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(o=>{var a;(a=this.gamingInterstitialSlot)==null||a.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.gamingInterstitialSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),Te(this,"destroy",i=>{var o,a;(a=(o=this.adsContext)==null?void 0:o.onEnd)==null||a.call(o,i),this.adsContext=null,googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.gamingInterstitialSlot&&(googletag.destroySlots([this.gamingInterstitialSlot]),this.gamingInterstitialSlot=null,this.readyEvent=null)}),Te(this,"reinit",i=>{this.destroy(i),this.init()}),Te(this,"handleSlotReady",i=>{this.gamingInterstitialSlot===i.slot&&(this.readyEvent=i)}),Te(this,"handleSlotClosed",i=>{var o,a;this.adsContext&&this.gamingInterstitialSlot===i.slot&&((a=(o=this.adsContext).afterAd)==null||a.call(o),this.withCommand(()=>{this.reinit("viewed")}))}),Te(this,"requestAds",i=>{this.withCommand(()=>{var o;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=i,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((o=i.beforeAd)==null||o.call(i),this.readyEvent.makeGameManualInterstitialVisible()):this.reinit("frequencyCapped")})}),tu(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function dt(e,t,r){return(t=Im(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Im(e){var t=Sm(e,"string");return typeof t=="symbol"?t:t+""}function Sm(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){dt(this,"name","GOOGLE_GPT"),dt(this,"context",void 0),dt(this,"contextInfo",void 0),dt(this,"initParams",void 0),dt(this,"rewardAdManager",void 0),dt(this,"interstitialManager",void 0),dt(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 L(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"}`;this.rewardAdManager=new So(t,n,this.initParams.keyValue),this.interstitialManager=new Ro(r,n,this.initParams.keyValue)})}adConfig(t,r){}adBreak(t,r){var n,i;if(!this.rewardAdManager||!this.interstitialManager){(n=t.adBreakDone)==null||n.call(t,{breakName:t.type==="preroll"?"":t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"error"});return}switch(t.type){case"preroll":{(i=t.adBreakDone)==null||i.call(t,{breakType:"preroll",breakFormat:"reward",breakStatus:"noAdPreloaded"});break}case"reward":{this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:o=>{var a;(a=t.adBreakDone)==null||a.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:o})}});break}default:{this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:o=>{var a;(a=t.adBreakDone)==null||a.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:o})}});break}}}};function Ue(e,t,r){return(t=Rm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rm(e){var t=km(e,"string");return typeof t=="symbol"?t:t+""}function km(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 Rn=class{constructor(t){if(Ue(this,"context",void 0),Ue(this,"contextInfo",void 0),Ue(this,"providers",{}),Ue(this,"channelPolicy",void 0),Ue(this,"adsActionDetection",void 0),Ue(this,"adsTrackSerializer",void 0),Ue(this,"initialized",!1),Ue(this,"adsIsShowing",!1),Ue(this,"lastAdBreak",void 0),Ue(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new mo(this.context),this.adsActionDetection=new so(this.context),this.adsTrackSerializer=new ho(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;let{width:i,height:o}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return L(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"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 po(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new Ao(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new Io(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return L(this,null,function*(){var r,n,i,o,a,s,u,d,y,m;let v=Date.now();if(v-this.initializedTimeStamp<3e3){(r=t.adBreakDone)==null||r.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}if(this.lastAdBreak&&v-this.lastAdBreak<500){console.warn("[Jolibox SDK Ads] You can't call adBreak too frequently"),(n=t.adBreakDone)==null||n.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.lastAdBreak=v,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:f,code:E}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(E!=="SUCCESS"){(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let w=f==null?void 0:f.sort((P,V)=>P.seq-V.seq);if(w.length===0){(u=t.adBreakDone)==null||u.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let S=!0,b=null,x=new ao(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;w.length>0;){let P=w.shift(),V=this.providers[P.provider];if(V){let[X,R]=yield x.callAdBreakAndContinue(V,t,P,D=>{var O;this.adsIsShowing=D,(O=this.context.eventEmitter)==null||O.emit("isAdShowing",D)});S=X,b=R}else S=!0,b={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!S)break}S&&b&&((d=t.adBreakDone)==null||d.call(t,b))}}catch(f){(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(m=this.context.eventEmitter)==null||m.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 Ig=xt`
|
|
168
|
-
${
|
|
167
|
+
`,Tm=e=>{let{state:t}=e,{afterAd:r,adDismissed:n,adViewed:i,adBreakDone:o,adLoaded:a,adLinkClicked:s,visible:l,src:d}=t,[y,h]=bn(!1),p=b=>{var I,S,w,k;h(!1),l.value=!1,b==="dismiss"?(I=n.value)==null||I.call(n):b==="viewed"&&((S=i.value)==null||S.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 Ct("appsrockets_ad_dismissed",()=>p("dismiss")),Ct("appsrockets_ad_rewarded",()=>p("viewed")),Ct("appsrockets_ad_completed",()=>p("viewed")),Ct("appsrockets_ad_skipped",()=>p("viewed")),Ct("appsrockets_ad_clicked",b=>{var I;return(I=s.value)==null?void 0:I.call(s,b)}),Ct("appsrockets_ad_loaded",()=>h(!0)),l.value?le("div",{className:Cm,style:{display:y?"flex":"none"},children:l.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 Ye(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=xm(e,"string");return typeof t=="symbol"?t:t+""}function xm(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Lo=class{constructor(t,r){Ye(this,"name","APPSROCKETS"),Ye(this,"initialized",!1),Ye(this,"initCompleter",null),Ye(this,"context",void 0),Ye(this,"adsOverlay",null),Ye(this,"adsIsShowing",!1),Ye(this,"lastUnDisplayedAdBreak",null),Ye(this,"state",Rm()),Ye(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"),co(le(Tm,{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,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"})};Ae(()=>{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&&((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),(d=t.beforeAd)==null||d.call(t);let p=()=>{var N;this.adsIsShowing=!1,(N=t.afterAd)==null||N.call(t)},f={breakType:t.type,breakName:t.name,breakFormat:"reward",breakStatus:"ignored"},b=()=>{var N;this.adsIsShowing=!1,f.breakStatus="dismissed",(N=t.adDismissed)==null||N.call(t)},I=()=>{var N;this.adsIsShowing=!1,f.breakStatus="viewed",(N=t.adViewed)==null||N.call(t)},S=()=>{var N;this.adsIsShowing=!1,(N=t.adBreakDone)==null||N.call(t,f)},w=()=>{this.adsIsShowing=!1,f.breakStatus="noAdPreloaded"};Ae(()=>{this.state.afterAd.value=p,this.state.adDismissed.value=b,this.state.adViewed.value=I,this.state.adBreakDone.value=S,this.state.adLinkClicked.value=h,this.state.adError.value=w});let k=()=>{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,Ae(()=>{this.state.src.value=this.processUrl(r.params.url),this.state.visible.value=!0})};this.lastUnDisplayedAdBreak=t,(y=t.beforeReward)==null||y.call(t,k);break}}}},hu=()=>{window.googletag=window.googletag||{cmd:[]},window.googletag.pubadsReady||window.googletag.cmd.push(()=>{window.googletag.enableServices()})};function ye(e,t,r){return(t=Om(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Om(e){var t=Pm(e,"string");return typeof t=="symbol"?t:t+""}function Pm(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,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=>{var s,l;a.slot===this.rewardedSlot&&this.adsContext&&(googletag.pubads().removeEventListener("rewardedSlotReady",o),this.readyEvent=a,(l=(s=this.adsContext).beforeAd)==null||l.call(s),this.adsContext.beforeReward(()=>{var d;(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,hu(),this.withCommand(()=>{this.init()})}};function ke(e,t,r){return(t=Dm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Dm(e){var t=Nm(e,"string");return typeof t=="symbol"?t:t+""}function Nm(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 Mo=class{constructor(t,r,n){ke(this,"adUnit",void 0),ke(this,"project",void 0),ke(this,"keyValue",void 0),ke(this,"adsContext",null),ke(this,"gamingInterstitialSlot",null),ke(this,"readyEvent",null),ke(this,"withCommand",function(){googletag.cmd.push(...arguments)}),ke(this,"init",()=>{var i;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(o=>{var a;(a=this.gamingInterstitialSlot)==null||a.setTargeting(o,this.keyValue[o])}),Object.keys(this.keyValue).includes("project")||(i=this.gamingInterstitialSlot)==null||i.setTargeting("project",this.project)),googletag.display(this.gamingInterstitialSlot))}),ke(this,"destroy",i=>{var o,a;(a=(o=this.adsContext)==null?void 0:o.onEnd)==null||a.call(o,i),this.adsContext=null,googletag.pubads().removeEventListener("gameManualInterstitialSlotReady",this.handleSlotReady),googletag.pubads().removeEventListener("gameManualInterstitialSlotClosed",this.handleSlotClosed),this.gamingInterstitialSlot&&(googletag.destroySlots([this.gamingInterstitialSlot]),this.gamingInterstitialSlot=null,this.readyEvent=null)}),ke(this,"reinit",i=>{this.destroy(i),this.init()}),ke(this,"handleSlotReady",i=>{this.gamingInterstitialSlot===i.slot&&(this.readyEvent=i)}),ke(this,"handleSlotClosed",i=>{var o,a;this.adsContext&&this.gamingInterstitialSlot===i.slot&&((a=(o=this.adsContext).afterAd)==null||a.call(o),this.withCommand(()=>{this.reinit("viewed")}))}),ke(this,"requestAds",i=>{this.withCommand(()=>{var o,a,s;if(this.adsContext&&this.reinit("ignored"),this.gamingInterstitialSlot||this.init(),this.adsContext=i,!this.gamingInterstitialSlot){this.reinit("notReady");return}this.readyEvent?((o=i.beforeAd)==null||o.call(i),this.readyEvent.makeGameManualInterstitialVisible()):((s=(a=this.adsContext).onEnd)==null||s.call(a,"frequencyCapped"),this.adsContext=null,googletag.pubads().refresh([this.gamingInterstitialSlot]))})}),hu(),this.adUnit=t,this.project=r,this.keyValue=n,this.withCommand(()=>{this.init()})}};function pt(e,t,r){return(t=Lm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Lm(e){var t=Um(e,"string");return typeof t=="symbol"?t:t+""}function Um(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var Bo=class{constructor(t,r){pt(this,"name","GOOGLE_GPT"),pt(this,"context",void 0),pt(this,"contextInfo",void 0),pt(this,"initParams",void 0),pt(this,"rewardAdManager",void 0),pt(this,"interstitialManager",void 0),pt(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"}`;this.rewardAdManager=new Uo(t,n,this.initParams.keyValue),this.interstitialManager=new Mo(r,n,this.initParams.keyValue)})}adConfig(t,r){}adBreak(t,r){var n,i;if(!this.rewardAdManager||!this.interstitialManager){(n=t.adBreakDone)==null||n.call(t,{breakName:t.type==="preroll"?"":t.name,breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"error"});return}switch(t.type){case"preroll":{(i=t.adBreakDone)==null||i.call(t,{breakType:"preroll",breakFormat:"interstitial",breakStatus:"noAdPreloaded"});break}case"reward":{this.rewardAdManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,adDismissed:t.adDismissed,adViewed:t.adViewed,beforeReward:t.beforeReward,adBreakDone:o=>{var a;(a=t.adBreakDone)==null||a.call(t,{breakName:t.name,breakType:t.type,breakFormat:"reward",breakStatus:o})}});break}default:{this.interstitialManager.requestAds({beforeAd:t.beforeAd,afterAd:t.afterAd,onEnd:o=>{var a;(a=t.adBreakDone)==null||a.call(t,{breakName:t.name,breakType:t.type,breakFormat:"interstitial",breakStatus:o})}});break}}}};function Fe(e,t,r){return(t=Mm(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Mm(e){var t=Bm(e,"string");return typeof t=="symbol"?t:t+""}function Bm(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 Ln=class{constructor(t){if(Fe(this,"context",void 0),Fe(this,"contextInfo",void 0),Fe(this,"providers",{}),Fe(this,"channelPolicy",void 0),Fe(this,"adsActionDetection",void 0),Fe(this,"adsTrackSerializer",void 0),Fe(this,"initialized",!1),Fe(this,"adsIsShowing",!1),Fe(this,"lastAdBreak",void 0),Fe(this,"initializedTimeStamp",Date.now()),t)this.context=t,this.channelPolicy=new So(this.context),this.adsActionDetection=new yo(this.context),this.adsTrackSerializer=new Ao(this.context),this.contextInfo=this.context.getContextInfo();else throw new Error("JoliboxAdsForGame requires a configuration object")}getRequestContextData(t){var r,n;let{width:i,height:o}=this.context.getWindowInfo();return{report:JSON.stringify(this.adsTrackSerializer.serialize(t,{sessionId:this.contextInfo.sessionId,objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId,testAdsMode:this.contextInfo.testAdsMode})),osType:this.contextInfo.osType,runtimeType:this.contextInfo.runtimeType,sessionId:this.contextInfo.sessionId,deviceId:this.contextInfo.deviceId,adId:this.contextInfo.adId,deviceModel:(r=this.contextInfo.deviceModel)!=null?r:"UnknownModel",deviceBrand:(n=this.contextInfo.deviceBrand)!=null?n:"UnknownBrand",dimension:{width:i,height:o}}}getRequestBizParams(){return{objectType:this.contextInfo.objectType,objectId:this.contextInfo.objectId}}init(t){return P(this,null,function*(){window.adsbygoogle=window.adsbygoogle||[];let{data:r}=yield this.context.httpClient.post("/api/ads/init",{data:{contextData:this.getRequestContextData("AdsAFGSDKInit"),bizParams:this.getRequestBizParams(),testAdsMode:this.contextInfo.testAdsMode}});if((r==null?void 0:r.length)>0)for(let n of r)switch(n.provider){case"GOOGLE_GPT":{let i=new Bo(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"ADSENSE":case"ADSENSE_ADMOB":{let i=new Ro(this.context,n.params);yield i.init(),this.providers[n.provider]=i;break}case"OKSPIN":{let i=new No(this.context,n.params);yield i.init(),this.providers.OKSPIN=i;break}case"APPSROCKETS":{let i=new Lo(this.context,n.params);yield i.init(),this.providers.APPSROCKETS=i;break}}this.initialized=!0})}adConfig(t){this.providers.ADSENSE?this.providers.ADSENSE.adConfig(t):window.adsbygoogle.push(t)}adBreak(t){return P(this,null,function*(){var r,n,i,o,a,s,l,d,y,h;let p=Date.now();if(p-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&&p-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=p,this.adsIsShowing){console.warn("[Jolibox SDK Ads] You can't call adBreak while ad is showing"),(i=t.adBreakDone)==null||i.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"frequencyCapped"});return}if(this.initialized||(yield this.init()),t.type!=="reward"&&!this.channelPolicy.shouldBypassCallingInterstitial()){(o=t.adBreakDone)==null||o.call(t,{breakType:t.type,breakName:"skipInterstitials",breakFormat:"interstitial",breakStatus:"viewed"});return}if(!this.context.checkNetwork()){(a=t.adBreakDone)==null||a.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}try{let{data:f,code:b}=yield this.context.httpClient.post("/api/ads/info",{data:{contextData:this.getRequestContextData("AdsAFGSDKAdBreak"),bizParams:this.getRequestBizParams(),adsType:t.type==="reward"?"REWARD":"INTERSTITIAL",testAdsMode:this.contextInfo.testAdsMode,name:t.type==="preroll"?"":t.name}});if(b!=="SUCCESS"){(s=t.adBreakDone)==null||s.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}else{let I=f==null?void 0:f.sort((N,j)=>N.seq-j.seq);if(I.length===0){(l=t.adBreakDone)==null||l.call(t,{breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"});return}let S=!0,w=null,k=new go(this.context);for(this.adsActionDetection.adBreakIsShowing=!0;I.length>0;){let N=I.shift(),j=this.providers[N.provider];if(j){let[W,R]=yield k.callAdBreakAndContinue(j,t,N,L=>{var O;this.adsIsShowing=L,(O=this.context.eventEmitter)==null||O.emit("isAdShowing",L)});S=W,w=R}else S=!0,w={breakType:t.type,breakName:t.type==="preroll"?void 0:t.name,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"notReady"};if(!S)break}S&&w&&((d=t.adBreakDone)==null||d.call(t,w))}}catch(f){(y=t.adBreakDone)==null||y.call(t,{breakType:t.type,breakFormat:t.type==="reward"?"reward":"interstitial",breakStatus:"noAdPreloaded"})}finally{this.adsIsShowing=!1,(h=this.context.eventEmitter)==null||h.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 yy=Pt`
|
|
168
|
+
${we}
|
|
169
169
|
position: fixed;
|
|
170
170
|
left: 0;
|
|
171
171
|
top: 0;
|
|
@@ -180,7 +180,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
180
180
|
}
|
|
181
181
|
|
|
182
182
|
.ads-wrapper {
|
|
183
|
-
${
|
|
183
|
+
${we}
|
|
184
184
|
position: relative;
|
|
185
185
|
width: 100%;
|
|
186
186
|
height: 100%;
|
|
@@ -203,7 +203,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
.retry-button {
|
|
206
|
-
${
|
|
206
|
+
${we}
|
|
207
207
|
position: absolute;
|
|
208
208
|
width: 100%;
|
|
209
209
|
height: 100%;
|
|
@@ -213,7 +213,7 @@ or `);this.errors.push(o)}return n}},Hr=class extends ue{constructor(...t){super
|
|
|
213
213
|
cursor: pointer;
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
|
-
`;Ae();var Zg=zn(iu());var dr=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){this.ads.adConfig(t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var fr=class e{constructor(){this.callbacksId=0,this.callbackMap=new Map,this.initOnMessage()}static getInstance(){return e.instance||(e.instance=new e),e.instance}initOnMessage(){window.addEventListener("message",t=>{var r,n,i,o,a,s,u,d,y;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&(console.log(`data => ${t.data}`),t.data&&t.data.type==null)){let m=JSON.parse(t.data);switch(console.log(`HuaweiQuickAdsHandler type => ${m.type}`),m.type){case"huawei_quick_ads_on_message_init":console.log("HuaweiQuickAdsHandler window.addEventListener init",m);break;case"huawei_quick_ads_on_message_ad_config":{let v=m.callbackId;if(v){let f=this.callbackMap.get(v);(r=f==null?void 0:f.onReady)==null||r.call(f)}console.log("HuaweiQuickAdsHandler window.addEventListener adConfig",m)}break;case"huawei_quick_ads_on_message_ad_break":{let v=m.callbackId;if(v){let f=this.callbackMap.get(v),E="noAdPreloaded",w=!1;switch(m.adsRes){case"viewed":E="viewed",(n=f==null?void 0:f.adViewed)==null||n.call(f),w=!0;break;case"dismissed":E="dismissed",(i=f==null?void 0:f.adDismissed)==null||i.call(f),w=!0;break;case"error":E="error",w=!0;break;case"other":E="other",w=!0;break;case"beforeReward":(o=f==null?void 0:f.beforeReward)==null||o.call(f,()=>{window.system.postMessage(JSON.stringify({type:"huawei_quick_ads_ad_operation"})),console.log("HuaweiQuickAdsHandler beforeReward postMessage AD_OPERATION")}),w=!1;break;case"beforeAd":(a=f==null?void 0:f.beforeAd)==null||a.call(f),w=!1;break;case"afterAd":(s=f==null?void 0:f.afterAd)==null||s.call(f),w=!1;break}w&&((y=f==null?void 0:f.adBreakDone)==null||y.call(f,{breakType:(u=f.breakType)!=null?u:"",breakName:f.breakName,breakFormat:(d=f.breakFormat)!=null?d:"interstitial",breakStatus:E}))}console.log("HuaweiQuickAdsHandler window.addEventListener adBreak",m)}break;case"huawei_quick_ads_on_message_ad_unit":console.log("HuaweiQuickAdsHandler window.addEventListener adUnit",m);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=z(z({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 hr=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 Po=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return L(this,null,function*(){var r;if(t.type==="reward")try{let n=yield Ze.getRewardsTypes(Pn);yield Ze.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)}},Do=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new dr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=fr.getInstance();break}case"gamedistribution":{this.cacheHandler=hr.getInstance();break}default:{let r=new Rn(this.context);this.cacheHandler=new Po(r);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},On=Ee(),ou=new Ne,Pn=He.create(),Tm={httpClient:Pn,checkNetwork:()=>He.getNetworkStatus(),track:Le,eventEmitter:ou,getWindowInfo:()=>({width:window.innerWidth*window.devicePixelRatio,height:window.innerHeight*window.devicePixelRatio,statusBarHeight:0}),handleLinkClicked:e=>{window.open(e,"_blank")},getContextInfo:()=>{var e,t,r,n,i,o,a,s,u;return{hostAppId:(t=(e=N.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=N.deviceInfo.did)!=null?r:"",adId:(n=N.deviceInfo.adId)!=null?n:"",sessionId:(i=N.sessionId)!=null?i:"",userId:(a=(o=N.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:N.mpId,testAdsMode:N.testAdsMode,channel:(s=N.joliSource)!=null?s:"",deviceBrand:N.deviceInfo.brand,deviceModel:N.deviceInfo.model,osType:we.isAndroid?"ANDROID":we.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(u=N.joliSource)!=null?u:""}}},au=e=>{gt("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},xm=new Do(Tm),mr=xm.getAdsHandler(N.sdkEnvironment);Ze.registerRewardHandler("ADS",fs(mr.getAdsInstance()));Ze.registerRewardHandler("JOLI_COIN",ms(Pn,{onUnlockSuccess:au.bind(void 0)}));Ze.registerRewardHandler("JOLI_COIN_ONLY",ps(Pn,{onUnlockSuccess:au.bind(void 0)}));ou.on("isAdShowing",e=>{gt("JOLIBOX_ADS_EVENT",{isAdShowing:e})});On.registerCommand("AdsSDK.init",e=>{mr.init(e)});On.registerCommand("AdsSDK.adConfig",e=>{mr.adConfig(e)});On.registerCommand("AdsSDK.adBreak",e=>{mr.adBreak(e)});On.registerCommand("AdsSDK.adUnit",e=>{mr.adUnit(e)});H();var su=Ee();su.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{console.log("RuntimeSDK.loadFinishedEvent")});su.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});H();at();var hu=-1,Nn=function(e){addEventListener("pageshow",function(t){t.persisted&&(hu=t.timeStamp,e(t))},!0)},Lo=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Ln=function(){var e=Lo();return e&&e.activationStart||0},Dt=function(e,t){var r=Lo(),n="navigate";return hu>=0?n="back-forward-cache":r&&(document.prerendering||Ln()>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}},mu=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){}},Nt=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))}},pu=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)}},Pt=-1,lu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Dn=function(e){document.visibilityState==="hidden"&&Pt>-1&&(Pt=e.type==="visibilitychange"?e.timeStamp:0,Cm())},uu=function(){addEventListener("visibilitychange",Dn,!0),addEventListener("prerenderingchange",Dn,!0)},Cm=function(){removeEventListener("visibilitychange",Dn,!0),removeEventListener("prerenderingchange",Dn,!0)},gu=function(){return Pt<0&&(Pt=lu(),uu(),Nn(function(){setTimeout(function(){Pt=lu(),uu()},0)})),{get firstHiddenTime(){return Pt}}},Uo=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},cu=[1800,3e3],yu=function(e,t){t=t||{},Uo(function(){var r,n=gu(),i=Dt("FCP"),o=mu("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-Ln(),0),i.entries.push(s),r(!0)))})});o&&(r=Nt(e,i,cu,t.reportAllChanges),Nn(function(a){i=Dt("FCP"),r=Nt(e,i,cu,t.reportAllChanges),pu(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var Om=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 du=[2500,4e3],No={},bu=function(e,t){t=t||{},Uo(function(){var r,n=gu(),i=Dt("LCP"),o=function(u){t.reportAllChanges||(u=u.slice(-1)),u.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-Ln(),0),i.entries=[d],r())})},a=mu("largest-contentful-paint",o);if(a){r=Nt(e,i,du,t.reportAllChanges);var s=_u(function(){No[i.id]||(o(a.takeRecords()),a.disconnect(),No[i.id]=!0,r(!0))});["keydown","click"].forEach(function(u){addEventListener(u,function(){return Om(s)},{once:!0,capture:!0})}),vu(s),Nn(function(u){i=Dt("LCP"),r=Nt(e,i,du,t.reportAllChanges),pu(function(){i.value=performance.now()-u.timeStamp,No[i.id]=!0,r(!0)})})}})},fu=[800,1800],Pm=function e(t){document.prerendering?Uo(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},wu=function(e,t){t=t||{};var r=Dt("TTFB"),n=Nt(e,r,fu,t.reportAllChanges);Pm(function(){var i=Lo();i&&(r.value=Math.max(i.responseStart-Ln(),0),r.entries=[i],n(!0),Nn(function(){r=Dt("TTFB",0),(n=Nt(e,r,fu,t.reportAllChanges))(!0)}))})};Ae();function Dm(){yu(e=>{Le("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),bu(e=>{Le("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),wu(e=>{Le("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Nm(){Jt.on("onDocumentReady",e=>L(this,null,function*(){Jt.emit("LifecycleEvent.onReady",{isLogin:!1}),N.mpType==="game"&&ot.start(Date.now()-e)}))}function Eu(){Nm(),Dm()}Eu();
|
|
216
|
+
`;_e();var zy=ii(pu());var vr=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(){}adConfig(t){this.ads.adConfig(t)}adBreak(t){this.ads.adBreak(t)}adUnit(){}};var _r=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,d,y;if(console.log(`HuaweiQuickAdsHandler,event => ${t}`),t.origin==window.location.origin&&(console.log(`data => ${t.data}`),t.data&&t.data.type==null)){let 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=!0;break;case"dismissed":b="dismissed",(i=f==null?void 0:f.adDismissed)==null||i.call(f),I=!0;break;case"error":b="error",I=!0;break;case"other":b="other",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:(l=f.breakType)!=null?l:"",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=H(H({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 gr=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,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:(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 $o=class{constructor(t){this.ads=t}getAdsInstance(){return this.ads}init(t){this.ads.init(t)}adConfig(t){this.ads.adConfig(t)}adBreak(t){return P(this,null,function*(){var r;if(t.type==="reward")try{let n=yield nt.getRewardsTypes(Jn);yield nt.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)}},Go=class{constructor(t){this.cacheHandler=null;this.context=t}createAdsHandler(t){if(this.cacheHandler)return this.cacheHandler;switch(t){case"dlightek":{this.cacheHandler=new vr(window.h5sdk);break}case"huaweiQuick":{this.cacheHandler=_r.getInstance();break}case"gamedistribution":{this.cacheHandler=gr.getInstance();break}default:{let r=new Ln(this.context);this.cacheHandler=new $o(r);break}}return this.cacheHandler}getAdsHandler(t){return this.createAdsHandler(t)}},jn=ve(),vu=new Me,Jn=Ue.create(),Fm={httpClient:Jn,checkNetwork:()=>Ue.getNetworkStatus(),track:Be,eventEmitter:vu,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=D.hostInfo)==null?void 0:e.aid)!=null?t:"1",deviceId:(r=D.deviceInfo.did)!=null?r:"",adId:(n=D.deviceInfo.adId)!=null?n:"",sessionId:(i=D.sessionId)!=null?i:"",userId:(a=(o=D.hostUserInfo)==null?void 0:o.uid)!=null?a:"",objectType:"GAME",objectId:D.mpId,testAdsMode:D.testAdsMode,channel:(s=D.joliSource)!=null?s:"",deviceBrand:D.deviceInfo.brand,deviceModel:D.deviceInfo.model,osType:Ie.isAndroid?"ANDROID":Ie.isiOS?"IOS":"PC",runtimeType:"WEB",platform:1e3,joliSource:(l=D.joliSource)!=null?l:""}}},_u=e=>{ht("JOLIBOX_CUSTOM_REWARDS_EVENT",{JOLI_COIN:e})},jm=new Go(Fm),yr=jm.getAdsHandler(D.sdkEnvironment);nt.registerRewardHandler("ADS",As(yr.getAdsInstance()));nt.registerRewardHandler("JOLI_COIN",Rs(Jn,{onUnlockSuccess:_u.bind(void 0)}));nt.registerRewardHandler("JOLI_COIN_ONLY",Cs(Jn,{onUnlockSuccess:_u.bind(void 0)}));vu.on("isAdShowing",e=>{ht("JOLIBOX_ADS_EVENT",{isAdShowing:e})});jn.registerCommand("AdsSDK.init",e=>{yr.init(e)});jn.registerCommand("AdsSDK.adConfig",e=>{yr.adConfig(e)});jn.registerCommand("AdsSDK.adBreak",e=>{yr.adBreak(e)});jn.registerCommand("AdsSDK.adUnit",e=>{yr.adUnit(e)});V();var gu=ve();gu.registerCommand("RuntimeSDK.loadFinishedEvent",()=>{console.log("RuntimeSDK.loadFinishedEvent")});gu.registerCommand("RuntimeSDK.loadProgressEvent",e=>{console.log("RuntimeSDK.loadProgressEvent",e)});V();dt();var Au=-1,Hn=function(e){addEventListener("pageshow",function(t){t.persisted&&(Au=t.timeStamp,e(t))},!0)},Ko=function(){var e=self.performance&&performance.getEntriesByType&&performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},$n=function(){var e=Ko();return e&&e.activationStart||0},Ut=function(e,t){var r=Ko(),n="navigate";return Au>=0?n="back-forward-cache":r&&(document.prerendering||$n()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t===void 0?-1:t,rating:"good",delta:0,entries:[],id:"v4-".concat(Date.now(),"-").concat(Math.floor(8999999999999*Math.random())+1e12),navigationType:n}},Su=function(e,t,r){try{if(PerformanceObserver.supportedEntryTypes.includes(e)){var n=new PerformanceObserver(function(i){Promise.resolve().then(function(){t(i.getEntries())})});return n.observe(Object.assign({type:e,buffered:!0},r||{})),n}}catch(i){}},Mt=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))}},Ru=function(e){requestAnimationFrame(function(){return requestAnimationFrame(function(){return e()})})},Cu=function(e){document.addEventListener("visibilitychange",function(){document.visibilityState==="hidden"&&e()})},Tu=function(e){var t=!1;return function(){t||(e(),t=!0)}},Lt=-1,yu=function(){return document.visibilityState!=="hidden"||document.prerendering?1/0:0},Vn=function(e){document.visibilityState==="hidden"&&Lt>-1&&(Lt=e.type==="visibilitychange"?e.timeStamp:0,Jm())},bu=function(){addEventListener("visibilitychange",Vn,!0),addEventListener("prerenderingchange",Vn,!0)},Jm=function(){removeEventListener("visibilitychange",Vn,!0),removeEventListener("prerenderingchange",Vn,!0)},ku=function(){return Lt<0&&(Lt=yu(),bu(),Hn(function(){setTimeout(function(){Lt=yu(),bu()},0)})),{get firstHiddenTime(){return Lt}}},Wo=function(e){document.prerendering?addEventListener("prerenderingchange",function(){return e()},!0):e()},wu=[1800,3e3],xu=function(e,t){t=t||{},Wo(function(){var r,n=ku(),i=Ut("FCP"),o=Su("paint",function(a){a.forEach(function(s){s.name==="first-contentful-paint"&&(o.disconnect(),s.startTime<n.firstHiddenTime&&(i.value=Math.max(s.startTime-$n(),0),i.entries.push(s),r(!0)))})});o&&(r=Mt(e,i,wu,t.reportAllChanges),Hn(function(a){i=Ut("FCP"),r=Mt(e,i,wu,t.reportAllChanges),Ru(function(){i.value=performance.now()-a.timeStamp,r(!0)})}))})};var Vm=function(e){var t=self.requestIdleCallback||self.setTimeout,r=-1;return e=Tu(e),document.visibilityState==="hidden"?e():(r=t(e),Cu(e)),r};var Eu=[2500,4e3],qo={},Ou=function(e,t){t=t||{},Wo(function(){var r,n=ku(),i=Ut("LCP"),o=function(l){t.reportAllChanges||(l=l.slice(-1)),l.forEach(function(d){d.startTime<n.firstHiddenTime&&(i.value=Math.max(d.startTime-$n(),0),i.entries=[d],r())})},a=Su("largest-contentful-paint",o);if(a){r=Mt(e,i,Eu,t.reportAllChanges);var s=Tu(function(){qo[i.id]||(o(a.takeRecords()),a.disconnect(),qo[i.id]=!0,r(!0))});["keydown","click"].forEach(function(l){addEventListener(l,function(){return Vm(s)},{once:!0,capture:!0})}),Cu(s),Hn(function(l){i=Ut("LCP"),r=Mt(e,i,Eu,t.reportAllChanges),Ru(function(){i.value=performance.now()-l.timeStamp,qo[i.id]=!0,r(!0)})})}})},Iu=[800,1800],Hm=function e(t){document.prerendering?Wo(function(){return e(t)}):document.readyState!=="complete"?addEventListener("load",function(){return e(t)},!0):setTimeout(t,0)},Pu=function(e,t){t=t||{};var r=Ut("TTFB"),n=Mt(e,r,Iu,t.reportAllChanges);Hm(function(){var i=Ko();i&&(r.value=Math.max(i.responseStart-$n(),0),r.entries=[i],n(!0),Hn(function(){r=Ut("TTFB",0),(n=Mt(e,r,Iu,t.reportAllChanges))(!0)}))})};_e();yt();$e();function $m(){xu(e=>{Be("GameFCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Ou(e=>{Be("GameLCP",{value:e.value,rating:e.rating,navigationType:e.navigationType})}),Pu(e=>{Be("GameTTFB",{value:e.value,rating:e.rating,navigationType:e.navigationType})})}function Gm(){return P(this,null,function*(){let e=Ue.create();try{let t=yield e.get("/api/users/info");return!(t.code!=="SUCCESS"||!t.data)}catch(t){return Re(new Rr(t)),!1}})}function qm(){qt.on("onDocumentReady",e=>P(this,null,function*(){let t=yield Gm();D.onEnvConfigChanged({hostUserInfo:{isLogin:t}}),qt.emit("LifecycleEvent.onReady",H({},D.hostUserInfo?D.hostUserInfo:{isLogin:!1})),D.mpType==="game"&&ct.start(Date.now()-e)}))}function Du(){qm(),$m()}Du();
|
|
217
217
|
/*! Bundled license information:
|
|
218
218
|
|
|
219
219
|
localforage/dist/localforage.js:
|