@tagadapay/plugin-sdk 3.1.2 → 3.1.8
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/README.md +1129 -1129
- package/build-cdn.js +113 -113
- package/dist/external-tracker.js +1104 -491
- package/dist/external-tracker.min.js +2 -2
- package/dist/external-tracker.min.js.map +4 -4
- package/dist/react/hooks/useApplePay.js +25 -36
- package/dist/react/hooks/usePaymentPolling.d.ts +9 -3
- package/dist/react/providers/TagadaProvider.js +5 -5
- package/dist/react/utils/money.d.ts +4 -3
- package/dist/react/utils/money.js +39 -6
- package/dist/react/utils/trackingUtils.js +1 -0
- package/dist/v2/core/client.js +34 -2
- package/dist/v2/core/config/environment.js +9 -2
- package/dist/v2/core/funnelClient.d.ts +92 -1
- package/dist/v2/core/funnelClient.js +247 -3
- package/dist/v2/core/resources/apiClient.js +1 -1
- package/dist/v2/core/resources/checkout.d.ts +68 -0
- package/dist/v2/core/resources/funnel.d.ts +15 -0
- package/dist/v2/core/resources/payments.d.ts +50 -3
- package/dist/v2/core/resources/payments.js +38 -7
- package/dist/v2/core/utils/pluginConfig.js +40 -5
- package/dist/v2/core/utils/previewMode.d.ts +3 -0
- package/dist/v2/core/utils/previewMode.js +44 -14
- package/dist/v2/core/utils/previewModeIndicator.d.ts +19 -0
- package/dist/v2/core/utils/previewModeIndicator.js +414 -0
- package/dist/v2/core/utils/tokenStorage.d.ts +4 -0
- package/dist/v2/core/utils/tokenStorage.js +15 -1
- package/dist/v2/index.d.ts +6 -1
- package/dist/v2/index.js +6 -1
- package/dist/v2/react/components/ApplePayButton.d.ts +21 -121
- package/dist/v2/react/components/ApplePayButton.js +221 -290
- package/dist/v2/react/components/FunnelScriptInjector.d.ts +3 -1
- package/dist/v2/react/components/FunnelScriptInjector.js +128 -24
- package/dist/v2/react/components/PreviewModeIndicator.d.ts +46 -0
- package/dist/v2/react/components/PreviewModeIndicator.js +113 -0
- package/dist/v2/react/hooks/useApplePayCheckout.d.ts +16 -0
- package/dist/v2/react/hooks/useApplePayCheckout.js +193 -0
- package/dist/v2/react/hooks/useFunnel.d.ts +42 -6
- package/dist/v2/react/hooks/useFunnel.js +25 -5
- package/dist/v2/react/hooks/usePaymentPolling.d.ts +9 -3
- package/dist/v2/react/hooks/usePaymentPolling.js +31 -9
- package/dist/v2/react/hooks/usePaymentQuery.d.ts +32 -2
- package/dist/v2/react/hooks/usePaymentQuery.js +304 -7
- package/dist/v2/react/hooks/usePaymentRetrieve.d.ts +26 -0
- package/dist/v2/react/hooks/usePaymentRetrieve.js +175 -0
- package/dist/v2/react/hooks/useStepConfig.d.ts +62 -0
- package/dist/v2/react/hooks/useStepConfig.js +52 -0
- package/dist/v2/react/index.d.ts +9 -3
- package/dist/v2/react/index.js +5 -1
- package/dist/v2/react/providers/ExpressPaymentMethodsProvider.js +27 -19
- package/dist/v2/react/providers/TagadaProvider.js +7 -7
- package/dist/v2/standalone/external-tracker.d.ts +2 -0
- package/dist/v2/standalone/external-tracker.js +6 -3
- package/package.json +112 -112
- package/dist/v2/react/hooks/useApplePay.d.ts +0 -16
- package/dist/v2/react/hooks/useApplePay.js +0 -247
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* TagadaPay External Tracker v3.1.
|
|
2
|
+
* TagadaPay External Tracker v3.1.8
|
|
3
3
|
* CDN Bundle - Standalone tracking for external pages
|
|
4
4
|
* @license MIT
|
|
5
5
|
*/
|
|
6
|
-
"use strict";var TagadaTrackerBundle=(()=>{var vt=Object.defineProperty,no=Object.defineProperties,io=Object.getOwnPropertyDescriptor,ro=Object.getOwnPropertyDescriptors,oo=Object.getOwnPropertyNames,Ei=Object.getOwnPropertySymbols;var bi=Object.prototype.hasOwnProperty,so=Object.prototype.propertyIsEnumerable;var _e=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),ao=t=>{throw TypeError(t)};var Ii=(t,e,n)=>e in t?vt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,R=(t,e)=>{for(var n in e||(e={}))bi.call(e,n)&&Ii(t,n,e[n]);if(Ei)for(var n of Ei(e))so.call(e,n)&&Ii(t,n,e[n]);return t},z=(t,e)=>no(t,ro(e));var wi=(t,e)=>{for(var n in e)vt(t,n,{get:e[n],enumerable:!0})},lo=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of oo(e))!bi.call(t,r)&&r!==n&&vt(t,r,{get:()=>e[r],enumerable:!(i=io(e,r))||i.enumerable});return t};var co=t=>lo(vt({},"__esModule",{value:!0}),t);var Re=function(t,e){this[0]=t,this[1]=e},hn=(t,e,n)=>{var i=(o,a,c,u)=>{try{var d=n[o](a),f=(a=d.value)instanceof Re,S=d.done;Promise.resolve(f?a[0]:a).then(I=>f?i(o==="return"?o:"next",a[1]?{done:I.done,value:I.value}:I,c,u):c({value:I,done:S})).catch(I=>i("throw",I,c,u))}catch(I){u(I)}},r=o=>s[o]=a=>new Promise((c,u)=>i(o,a,c,u)),s={};return n=n.apply(t,e),s[_e("asyncIterator")]=()=>s,r("next"),r("throw"),r("return"),s},An=t=>{var e=t[_e("asyncIterator")],n=!1,i,r={};return e==null?(e=t[_e("iterator")](),i=s=>r[s]=o=>e[s](o)):(e=e.call(t),i=s=>r[s]=o=>{if(n){if(n=!1,s==="throw")throw o;return o}return n=!0,{done:!1,value:new Re(new Promise(a=>{var c=e[s](o);c instanceof Object||ao("Object expected"),a(c)}),1)}}),r[_e("iterator")]=()=>r,i("next"),"throw"in e?i("throw"):r.throw=s=>{throw s},"return"in e&&i("return"),r},Si=(t,e,n)=>(e=t[_e("asyncIterator")])?e.call(t):(t=t[_e("iterator")](),e={},n=(i,r)=>(r=t[i])&&(e[i]=s=>new Promise((o,a,c)=>(s=r.call(t,s),c=s.done,Promise.resolve(s.value).then(u=>o({value:u,done:c}),a)))),n("next"),n("return"),e);var sa={};wi(sa,{TagadaExternalTracker:()=>Nt,TagadaTracker:()=>pi});function Ci(t){var i;if(typeof document=="undefined")return null;let n="; ".concat(document.cookie).split("; ".concat(t,"="));return n.length===2&&((i=n.pop())==null?void 0:i.split(";").shift())||null}var Ti={production:{baseUrl:"https://app.tagadapay.com",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},development:{baseUrl:"https://app.tagadapay.dev",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},local:{baseUrl:"http://app.localhost:3000",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}}};function Oi(t="local"){let e=Ti[t];if(!e)return console.warn("Unknown environment: ".concat(t,". Falling back to local.")),{environment:"local",apiConfig:Ti.local};let n=null;if(typeof window!="undefined"&&(n=new URLSearchParams(window.location.search).get("tagadaClientBaseUrl"),!n))try{n=localStorage.getItem("tgd_client_base_url")||Ci("tgd_client_base_url")}catch(r){}return n?(console.log("[SDK] Using custom API base URL override: ".concat(n)),{environment:t,apiConfig:z(R({},e),{baseUrl:n})}):{environment:t,apiConfig:e}}function Ze(){var r;if(typeof window=="undefined")return"local";let e=new URLSearchParams(window.location.search).get("tagadaClientEnv");if(e&&(e==="production"||e==="development"||e==="local"))return console.log("[SDK] Using explicit environment override: ".concat(e)),e;try{let s=localStorage.getItem("tgd_client_env")||Ci("tgd_client_env");if(s&&(s==="production"||s==="development"||s==="local"))return console.log("[SDK] Using persisted environment override: ".concat(s)),s}catch(s){}let n=window.location.hostname,i=window.location.href;if(n==="localhost"||n.startsWith("127.")||n.startsWith("192.168.")||n.startsWith("10.")||n.includes(".local")||n===""||n==="0.0.0.0"){if(typeof window!="undefined"&&((r=window==null?void 0:window.__TAGADA_ENV__)!=null&&r.TAGADA_ENVIRONMENT)){let s=window.__TAGADA_ENV__.TAGADA_ENVIRONMENT.toLowerCase();if(s==="production"||s==="development"||s==="local")return console.log("[SDK] Local override detected: ".concat(s)),s}return"local"}return n==="app.tagadapay.com"||n.includes("tagadapay.com")||n.includes("yourproductiondomain.com")?"production":n==="app.tagadapay.dev"||n.includes("tagadapay.dev")||n.includes("vercel.app")||n.includes("netlify.app")||n.includes("surge.sh")||n.includes("github.io")||n.includes("herokuapp.com")||n.includes("railway.app")||i.includes("?env=dev")||i.includes("?dev=true")||i.includes("#dev")?"development":(console.warn("[SDK] Unknown domain: ".concat(n,", defaulting to production")),"production")}function Qe(t=!1){return Ze()!=="local"?!1:t&&typeof window!="undefined"?!window.location.hostname.includes(".cdn."):!0}var Lt=class{constructor(e){this.apiClient=e}async initialize(e){return this.apiClient.post("/api/v1/funnel/initialize",e)}async navigate(e){return this.apiClient.post("/api/v1/funnel/navigate",e)}async updateContext(e,n){return this.apiClient.patch("/api/v1/funnel/context/".concat(e),n)}async endSession(e){return this.apiClient.delete("/api/v1/funnel/session/".concat(e))}async getSession(e,n,i){let r=new URLSearchParams;n&&r.append("currentUrl",n),i&&r.append("includeDebugData","true");let s="/api/v1/funnel/session/".concat(e).concat(r.toString()?"?".concat(r):"");return this.apiClient.get(s)}};var xe=class{constructor(){this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){this.listeners.forEach(n=>{try{n(e)}catch(i){console.error("Error in event listener:",i)}})}clear(){this.listeners.clear()}};var En="tgd-funnel-session-id";function Ri(t){typeof document!="undefined"&&(document.cookie="".concat(En,"=").concat(t,"; path=/; max-age=2592000; SameSite=Lax"))}function yi(){if(typeof document=="undefined")return;let t=document.cookie.split("; ").find(e=>e.startsWith("".concat(En,"=")));return t?t.split("=")[1]:void 0}function Ni(){typeof document!="undefined"&&(document.cookie="".concat(En,"=; path=/; max-age=0"))}var In="cms_token";function fe(t){if(typeof window!="undefined")try{localStorage.setItem(In,t),window.dispatchEvent(new Event("storage"))}catch(e){console.error("Failed to save token to localStorage:",e)}}function et(){if(typeof window!="undefined")try{return localStorage.getItem(In)}catch(t){return console.error("Failed to get token from localStorage:",t),null}return null}function _t(){if(typeof window!="undefined")try{localStorage.removeItem(In)}catch(t){console.error("Failed to clear token from localStorage:",t)}}var V={DRAFT:"tgd_draft",FUNNEL_TRACKING:"tgd_funnel_tracking",FORCE_RESET:"tgd_force_reset",CLIENT_ENV:"tgd_client_env",CLIENT_BASE_URL:"tgd_client_base_url"};function xt(t){if(typeof window=="undefined")return null;try{return localStorage.getItem(t)}catch(e){return null}}function tt(t,e){if(typeof window!="undefined")try{localStorage.setItem(t,e)}catch(n){}}function Dt(t){var i;if(typeof document=="undefined")return null;let n=document.cookie.split(";").find(r=>r.trim().startsWith("".concat(t,"=")));return n?(i=n.split("=")[1])==null?void 0:i.trim():null}function kt(t,e,n=86400){typeof document!="undefined"&&(document.cookie="".concat(t,"=").concat(e,"; path=/; max-age=").concat(n))}function uo(t){typeof document!="undefined"&&(document.cookie="".concat(t,"=; path=/; max-age=0"))}function Bt(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search),e,n=t.get("draft");if(n!==null)e=n==="true";else{let I=xt(V.DRAFT)||Dt(V.DRAFT);I!==null&&(e=I==="true")}let i,r=t.get("funnelTracking");if(r!==null)i=r!=="false";else{let I=xt(V.FUNNEL_TRACKING)||Dt(V.FUNNEL_TRACKING);I!==null&&(i=I!=="false")}let s=t.get("token")||et()||null,o=t.get("funnelSessionId")||null,a=t.get("funnelId")||null,c=t.get("forceReset")==="true",u,d=t.get("tagadaClientEnv");if(d&&(d==="production"||d==="development"||d==="local"))u=d;else{let I=xt(V.CLIENT_ENV)||Dt(V.CLIENT_ENV);I&&(I==="production"||I==="development"||I==="local")&&(u=I)}let f,S=t.get("tagadaClientBaseUrl");if(S)f=S;else{let I=xt(V.CLIENT_BASE_URL)||Dt(V.CLIENT_BASE_URL);I&&(f=I)}return{forceReset:c,token:s,funnelSessionId:o,funnelId:a,draft:e,funnelTracking:i,tagadaClientEnv:u,tagadaClientBaseUrl:f}}function bn(){var e;return(e=Bt().draft)!=null?e:!1}function wn(t){typeof window!="undefined"&&(t?(tt(V.DRAFT,"true"),kt(V.DRAFT,"true",86400)):(tt(V.DRAFT,"false"),uo(V.DRAFT)))}function vi(t=!1){let e=Bt(),n=e.forceReset||!1;return!n&&!e.token?(Pi(),!1):(t&&console.log("[SDK] Detected params:",e),n&&(t&&console.log("[SDK] Force reset: Clearing all stored state"),_t(),Ni(),typeof window!="undefined"&&window.localStorage&&Object.keys(localStorage).forEach(r=>{(r.startsWith("tagadapay_")||r.startsWith("tgd_"))&&(t&&console.log("[SDK] Clearing localStorage: ".concat(r)),localStorage.removeItem(r))})),e.token!==null&&e.token!==void 0?(t&&console.log("[SDK] Using token from URL:",e.token.substring(0,20)+"..."),e.token===""||e.token==="null"?_t():fe(e.token)):n&&(t&&console.log("[SDK] Force reset mode (no token)"),_t()),Pi(),e.funnelSessionId&&t&&console.log("[SDK] Using funnelSessionId from URL:",e.funnelSessionId),n)}function Pi(){if(typeof window=="undefined")return;let t=new URLSearchParams(window.location.search),e=t.get("draft");e!==null&&wn(e==="true");let n=t.get("funnelTracking");n!==null&&fo(n!=="false");let i=t.get("tagadaClientEnv");i&&(i==="production"||i==="development"||i==="local")&&po(i);let r=t.get("tagadaClientBaseUrl");r&&go(r)}function fo(t){if(typeof window=="undefined")return;let e=t?"true":"false";tt(V.FUNNEL_TRACKING,e),kt(V.FUNNEL_TRACKING,e,86400)}function po(t){typeof window!="undefined"&&(tt(V.CLIENT_ENV,t),kt(V.CLIENT_ENV,t,86400))}function go(t){typeof window!="undefined"&&(tt(V.CLIENT_BASE_URL,t),kt(V.CLIENT_BASE_URL,t,86400))}function ho(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_ID__)return window.__TGD_FUNNEL_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function Mt(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_VARIANT_ID__)return window.__TGD_FUNNEL_VARIANT_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-variant-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function nt(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_STEP_ID__)return window.__TGD_FUNNEL_STEP_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-step-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}var Ut=class{constructor(e){this.eventDispatcher=new xe;this.isInitializing=!1;this.initializationAttempted=!1;this.config=e,this.resource=new Lt(e.apiClient),this.state={context:null,isLoading:!1,isInitialized:!1,isNavigating:!1,error:null,sessionError:null}}setConfig(e){this.config=R(R({},this.config),e)}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}getDetectedSessionId(){var i;if((i=this.state.context)!=null&&i.sessionId)return this.state.context.sessionId;if(typeof window=="undefined")return null;let n=new URLSearchParams(window.location.search).get("funnelSessionId");return n||yi()||null}resetInitialization(){this.initializationAttempted=!1,this.isInitializing=!1,this.updateState({context:null,isInitialized:!1})}async autoInitialize(e,n,i){if(this.state.context)return this.state.context;if(this.isInitializing||this.initializationAttempted)return null;this.initializationAttempted=!0,this.isInitializing=!0,this.updateState({isLoading:!0,error:null});try{let r=this.getDetectedSessionId(),a=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||i,c=ho(),u=Mt(),d=nt(),f=Bt(),S=this.config.funnelId||c||a,I=this.config.stepId||d;this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-initializing...",{existingSessionId:r,effectiveFunnelId:S,funnelVariantId:u,funnelStepId:I,draft:f.draft,funnelTracking:f.funnelTracking,source:{funnelId:this.config.funnelId?"config":c?"injected":a?"url/prop":"none",stepId:this.config.stepId?"config":d?"injected":"none"}});let m=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:S,existingSessionId:r||void 0,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:u,funnelStepId:I,draft:f.draft,funnelTracking:f.funnelTracking});if(m.success&&m.context){let T=this.enrichContext(m.context);return this.handleSessionSuccess(T),T}else throw new Error(m.error||"Failed to initialize funnel session")}catch(r){let s=r instanceof Error?r:new Error(String(r));throw this.updateState({error:s,isLoading:!1}),this.config.debugMode&&console.error("\u274C [FunnelClient] Init failed:",s),s}finally{this.isInitializing=!1}}async initialize(e,n,i,r){this.updateState({isLoading:!0,error:null});try{let s=Mt(),o=nt();this.config.debugMode&&(s&&console.log("\u{1F3AF} [FunnelClient] Detected A/B test variant:",s),o&&console.log("\u{1F3AF} [FunnelClient] Detected step ID:",o));let a=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:i,entryStepId:r,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:s,funnelStepId:o});if(a.success&&a.context){let c=this.enrichContext(a.context);return this.handleSessionSuccess(c),c}else throw new Error(a.error||"Failed to initialize")}catch(s){let o=s instanceof Error?s:new Error(String(s));throw this.updateState({error:o,isLoading:!1}),o}}async navigate(e,n){var i,r,s;if(!((i=this.state.context)!=null&&i.sessionId))throw new Error("No active session");this.updateState({isNavigating:!0,isLoading:!0});try{let o=Mt(),a=nt(),c=typeof window!="undefined"?window.location.href:void 0;!a&&this.config.stepId&&(a=this.config.stepId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using stepId from config (no injection):",a)),!o&&this.config.variantId&&(o=this.config.variantId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using variantId from config (no injection):",o)),this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Sending to backend:",{sessionId:this.state.context.sessionId,currentUrl:c,funnelStepId:a||"(not found)",funnelVariantId:o||"(not found)",hasInjectedStepId:!!nt(),hasInjectedVariantId:!!Mt(),usedConfigFallback:!nt()&&!!this.config.stepId,customerTags:(n==null?void 0:n.customerTags)||"(none)",deviceId:(n==null?void 0:n.deviceId)||"(none)"});let u=(n==null?void 0:n.fireAndForget)||!1,d=await this.resource.navigate({sessionId:this.state.context.sessionId,event:e,currentUrl:c,funnelStepId:a,funnelVariantId:o,fireAndForget:u,customerTags:n==null?void 0:n.customerTags,deviceId:n==null?void 0:n.deviceId});if(!d.success||!d.result)throw new Error(d.error||"Navigation failed");let f=d.result;if(f.queued)return this.updateState({isNavigating:!1,isLoading:!1}),f.sessionId&&f.sessionId!==((r=this.state.context)==null?void 0:r.sessionId)&&(this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Session ID updated: ".concat((s=this.state.context)==null?void 0:s.sessionId," \u2192 ").concat(f.sessionId)),this.state.context&&(this.state.context.sessionId=f.sessionId)),this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Navigation queued (fire-and-forget mode)"),f;let S=this.config.autoRedirect!==!1;return S||(this.config.debugMode&&console.log("\u{1F504} [FunnelClient] Refreshing session (no auto-redirect)"),await this.refreshSession()),this.updateState({isNavigating:!1,isLoading:!1}),S&&(f!=null&&f.url)&&typeof window!="undefined"&&(this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-redirecting to:",f.url,"(skipped session refresh - next page will initialize)"),window.location.href=f.url),f}catch(o){let a=o instanceof Error?o:new Error(String(o));throw this.updateState({error:a,isNavigating:!1,isLoading:!1}),a}}async goToStep(e){return this.navigate({type:"direct_navigation",data:{targetStepId:e}})}async refreshSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{let n=await this.resource.getSession(this.state.context.sessionId);if(n.success&&n.context){let i=this.enrichContext(n.context);return this.updateState({context:i,sessionError:null}),i}}catch(n){this.updateState({sessionError:n instanceof Error?n:new Error(String(n))})}}async updateContext(e){var n;if(!((n=this.state.context)!=null&&n.sessionId))throw new Error("No active session");this.updateState({isLoading:!0});try{let i=await this.resource.updateContext(this.state.context.sessionId,{contextUpdates:e});if(i.success)await this.refreshSession();else throw new Error(i.error||"Failed to update context")}finally{this.updateState({isLoading:!1})}}async endSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{await this.resource.endSession(this.state.context.sessionId)}finally{this.state.context=null,this.updateState({context:null,isInitialized:!1})}}updateState(e){this.state=R(R({},this.state),e),this.eventDispatcher.notify(this.state)}handleSessionSuccess(e){Ri(e.sessionId),this.updateState({context:e,isLoading:!1,isInitialized:!0,error:null,sessionError:null})}enrichContext(e){var o,a;if((((o=this.config.environment)==null?void 0:o.environment)||Ze())!=="local")return e;let i=((a=this.config.pluginConfig)==null?void 0:a.staticResources)||{};if(Object.keys(i).length===0)return e;let r=e.static||{};return Object.keys(i).every(c=>r[c]===i[c])&&Object.keys(r).length===Object.keys(i).length?e:z(R({},e),{static:R(R({},i),r)})}};function it(t,e){return function(){return t.apply(e,arguments)}}var{toString:Ao}=Object.prototype,{getPrototypeOf:Tn}=Object,{iterator:Ht,toStringTag:_i}=Symbol,Gt=(t=>e=>{let n=Ao.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),ne=t=>(t=t.toLowerCase(),e=>Gt(e)===t),Vt=t=>e=>typeof e===t,{isArray:ke}=Array,De=Vt("undefined");function rt(t){return t!==null&&!De(t)&&t.constructor!==null&&!De(t.constructor)&&q(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var xi=ne("ArrayBuffer");function Eo(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&xi(t.buffer),e}var Io=Vt("string"),q=Vt("function"),Di=Vt("number"),ot=t=>t!==null&&typeof t=="object",bo=t=>t===!0||t===!1,Ft=t=>{if(Gt(t)!=="object")return!1;let e=Tn(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(_i in t)&&!(Ht in t)},wo=t=>{if(!ot(t)||rt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch(e){return!1}},So=ne("Date"),To=ne("File"),Co=ne("Blob"),Oo=ne("FileList"),Ro=t=>ot(t)&&q(t.pipe),yo=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||q(t.append)&&((e=Gt(t))==="formdata"||e==="object"&&q(t.toString)&&t.toString()==="[object FormData]"))},No=ne("URLSearchParams"),[Po,vo,Lo,_o]=["ReadableStream","Request","Response","Headers"].map(ne),xo=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function st(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let i,r;if(typeof t!="object"&&(t=[t]),ke(t))for(i=0,r=t.length;i<r;i++)e.call(null,t[i],i,t);else{if(rt(t))return;let s=n?Object.getOwnPropertyNames(t):Object.keys(t),o=s.length,a;for(i=0;i<o;i++)a=s[i],e.call(null,t[a],a,t)}}function ki(t,e){if(rt(t))return null;e=e.toLowerCase();let n=Object.keys(t),i=n.length,r;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}var ye=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,Bi=t=>!De(t)&&t!==ye;function Sn(){let{caseless:t,skipUndefined:e}=Bi(this)&&this||{},n={},i=(r,s)=>{let o=t&&ki(n,s)||s;Ft(n[o])&&Ft(r)?n[o]=Sn(n[o],r):Ft(r)?n[o]=Sn({},r):ke(r)?n[o]=r.slice():(!e||!De(r))&&(n[o]=r)};for(let r=0,s=arguments.length;r<s;r++)arguments[r]&&st(arguments[r],i);return n}var Do=(t,e,n,{allOwnKeys:i}={})=>(st(e,(r,s)=>{n&&q(r)?t[s]=it(r,n):t[s]=r},{allOwnKeys:i}),t),ko=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),Bo=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},Mo=(t,e,n,i)=>{let r,s,o,a={};if(e=e||{},t==null)return e;do{for(r=Object.getOwnPropertyNames(t),s=r.length;s-- >0;)o=r[s],(!i||i(o,t,e))&&!a[o]&&(e[o]=t[o],a[o]=!0);t=n!==!1&&Tn(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},Uo=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;let i=t.indexOf(e,n);return i!==-1&&i===n},Fo=t=>{if(!t)return null;if(ke(t))return t;let e=t.length;if(!Di(e))return null;let n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},Ho=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&Tn(Uint8Array)),Go=(t,e)=>{let i=(t&&t[Ht]).call(t),r;for(;(r=i.next())&&!r.done;){let s=r.value;e.call(t,s[0],s[1])}},Vo=(t,e)=>{let n,i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},Ko=ne("HTMLFormElement"),Wo=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,r){return i.toUpperCase()+r}),Li=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),zo=ne("RegExp"),Mi=(t,e)=>{let n=Object.getOwnPropertyDescriptors(t),i={};st(n,(r,s)=>{let o;(o=e(r,s,t))!==!1&&(i[s]=o||r)}),Object.defineProperties(t,i)},Yo=t=>{Mi(t,(e,n)=>{if(q(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=t[n];if(q(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},jo=(t,e)=>{let n={},i=r=>{r.forEach(s=>{n[s]=!0})};return ke(t)?i(t):i(String(t).split(e)),n},$o=()=>{},Xo=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function qo(t){return!!(t&&q(t.append)&&t[_i]==="FormData"&&t[Ht])}var Jo=t=>{let e=new Array(10),n=(i,r)=>{if(ot(i)){if(e.indexOf(i)>=0)return;if(rt(i))return i;if(!("toJSON"in i)){e[r]=i;let s=ke(i)?[]:{};return st(i,(o,a)=>{let c=n(o,r+1);!De(c)&&(s[a]=c)}),e[r]=void 0,s}}return i};return n(t,0)},Zo=ne("AsyncFunction"),Qo=t=>t&&(ot(t)||q(t))&&q(t.then)&&q(t.catch),Ui=((t,e)=>t?setImmediate:e?((n,i)=>(ye.addEventListener("message",({source:r,data:s})=>{r===ye&&s===n&&i.length&&i.shift()()},!1),r=>{i.push(r),ye.postMessage(n,"*")}))("axios@".concat(Math.random()),[]):n=>setTimeout(n))(typeof setImmediate=="function",q(ye.postMessage)),es=typeof queueMicrotask!="undefined"?queueMicrotask.bind(ye):typeof process!="undefined"&&process.nextTick||Ui,ts=t=>t!=null&&q(t[Ht]),l={isArray:ke,isArrayBuffer:xi,isBuffer:rt,isFormData:yo,isArrayBufferView:Eo,isString:Io,isNumber:Di,isBoolean:bo,isObject:ot,isPlainObject:Ft,isEmptyObject:wo,isReadableStream:Po,isRequest:vo,isResponse:Lo,isHeaders:_o,isUndefined:De,isDate:So,isFile:To,isBlob:Co,isRegExp:zo,isFunction:q,isStream:Ro,isURLSearchParams:No,isTypedArray:Ho,isFileList:Oo,forEach:st,merge:Sn,extend:Do,trim:xo,stripBOM:ko,inherits:Bo,toFlatObject:Mo,kindOf:Gt,kindOfTest:ne,endsWith:Uo,toArray:Fo,forEachEntry:Go,matchAll:Vo,isHTMLForm:Ko,hasOwnProperty:Li,hasOwnProp:Li,reduceDescriptors:Mi,freezeMethods:Yo,toObjectSet:jo,toCamelCase:Wo,noop:$o,toFiniteNumber:Xo,findKey:ki,global:ye,isContextDefined:Bi,isSpecCompliantForm:qo,toJSONObject:Jo,isAsyncFn:Zo,isThenable:Qo,setImmediate:Ui,asap:es,isIterable:ts};function Be(t,e,n,i,r){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),r&&(this.response=r,this.status=r.status?r.status:null)}l.inherits(Be,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:l.toJSONObject(this.config),code:this.code,status:this.status}}});var Fi=Be.prototype,Hi={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Hi[t]={value:t}});Object.defineProperties(Be,Hi);Object.defineProperty(Fi,"isAxiosError",{value:!0});Be.from=(t,e,n,i,r,s)=>{let o=Object.create(Fi);l.toFlatObject(t,o,function(d){return d!==Error.prototype},u=>u!=="isAxiosError");let a=t&&t.message?t.message:"Error",c=e==null&&t?t.code:e;return Be.call(o,a,c,n,i,r),t&&o.cause==null&&Object.defineProperty(o,"cause",{value:t,configurable:!0}),o.name=t&&t.name||"Error",s&&Object.assign(o,s),o};var C=Be;var Kt=null;function Cn(t){return l.isPlainObject(t)||l.isArray(t)}function Vi(t){return l.endsWith(t,"[]")?t.slice(0,-2):t}function Gi(t,e,n){return t?t.concat(e).map(function(r,s){return r=Vi(r),!n&&s?"["+r+"]":r}).join(n?".":""):e}function ns(t){return l.isArray(t)&&!t.some(Cn)}var is=l.toFlatObject(l,{},null,function(e){return/^is[A-Z]/.test(e)});function rs(t,e,n){if(!l.isObject(t))throw new TypeError("target must be an object");e=e||new(Kt||FormData),n=l.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(T,b){return!l.isUndefined(b[T])});let i=n.metaTokens,r=n.visitor||d,s=n.dots,o=n.indexes,c=(n.Blob||typeof Blob!="undefined"&&Blob)&&l.isSpecCompliantForm(e);if(!l.isFunction(r))throw new TypeError("visitor must be a function");function u(m){if(m===null)return"";if(l.isDate(m))return m.toISOString();if(l.isBoolean(m))return m.toString();if(!c&&l.isBlob(m))throw new C("Blob is not supported. Use a Buffer instead.");return l.isArrayBuffer(m)||l.isTypedArray(m)?c&&typeof Blob=="function"?new Blob([m]):Buffer.from(m):m}function d(m,T,b){let v=m;if(m&&!b&&typeof m=="object"){if(l.endsWith(T,"{}"))T=i?T:T.slice(0,-2),m=JSON.stringify(m);else if(l.isArray(m)&&ns(m)||(l.isFileList(m)||l.endsWith(T,"[]"))&&(v=l.toArray(m)))return T=Vi(T),v.forEach(function(_,N){!(l.isUndefined(_)||_===null)&&e.append(o===!0?Gi([T],N,s):o===null?T:T+"[]",u(_))}),!1}return Cn(m)?!0:(e.append(Gi(b,T,s),u(m)),!1)}let f=[],S=Object.assign(is,{defaultVisitor:d,convertValue:u,isVisitable:Cn});function I(m,T){if(!l.isUndefined(m)){if(f.indexOf(m)!==-1)throw Error("Circular reference detected in "+T.join("."));f.push(m),l.forEach(m,function(v,k){(!(l.isUndefined(v)||v===null)&&r.call(e,v,l.isString(k)?k.trim():k,T,S))===!0&&I(v,T?T.concat(k):[k])}),f.pop()}}if(!l.isObject(t))throw new TypeError("data must be an object");return I(t),e}var be=rs;function Ki(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function Wi(t,e){this._pairs=[],t&&be(t,this,e)}var zi=Wi.prototype;zi.append=function(e,n){this._pairs.push([e,n])};zi.toString=function(e){let n=e?function(i){return e.call(this,i,Ki)}:Ki;return this._pairs.map(function(r){return n(r[0])+"="+n(r[1])},"").join("&")};var Wt=Wi;function os(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function at(t,e,n){if(!e)return t;let i=n&&n.encode||os;l.isFunction(n)&&(n={serialize:n});let r=n&&n.serialize,s;if(r?s=r(e,n):s=l.isURLSearchParams(e)?e.toString():new Wt(e,n).toString(i),s){let o=t.indexOf("#");o!==-1&&(t=t.slice(0,o)),t+=(t.indexOf("?")===-1?"?":"&")+s}return t}var On=class{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){l.forEach(this.handlers,function(i){i!==null&&e(i)})}},Rn=On;var zt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Yi=typeof URLSearchParams!="undefined"?URLSearchParams:Wt;var ji=typeof FormData!="undefined"?FormData:null;var $i=typeof Blob!="undefined"?Blob:null;var Xi={isBrowser:!0,classes:{URLSearchParams:Yi,FormData:ji,Blob:$i},protocols:["http","https","file","blob","url","data"]};var Pn={};wi(Pn,{hasBrowserEnv:()=>Nn,hasStandardBrowserEnv:()=>ss,hasStandardBrowserWebWorkerEnv:()=>as,navigator:()=>yn,origin:()=>ls});var Nn=typeof window!="undefined"&&typeof document!="undefined",yn=typeof navigator=="object"&&navigator||void 0,ss=Nn&&(!yn||["ReactNative","NativeScript","NS"].indexOf(yn.product)<0),as=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",ls=Nn&&window.location.href||"http://localhost";var B=R(R({},Pn),Xi);function vn(t,e){return be(t,new B.classes.URLSearchParams,R({visitor:function(n,i,r,s){return B.isNode&&l.isBuffer(n)?(this.append(i,n.toString("base64")),!1):s.defaultVisitor.apply(this,arguments)}},e))}function cs(t){return l.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function us(t){let e={},n=Object.keys(t),i,r=n.length,s;for(i=0;i<r;i++)s=n[i],e[s]=t[s];return e}function ds(t){function e(n,i,r,s){let o=n[s++];if(o==="__proto__")return!0;let a=Number.isFinite(+o),c=s>=n.length;return o=!o&&l.isArray(r)?r.length:o,c?(l.hasOwnProp(r,o)?r[o]=[r[o],i]:r[o]=i,!a):((!r[o]||!l.isObject(r[o]))&&(r[o]=[]),e(n,i,r[o],s)&&l.isArray(r[o])&&(r[o]=us(r[o])),!a)}if(l.isFormData(t)&&l.isFunction(t.entries)){let n={};return l.forEachEntry(t,(i,r)=>{e(cs(i),r,n,0)}),n}return null}var Yt=ds;function fs(t,e,n){if(l.isString(t))try{return(e||JSON.parse)(t),l.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}var Ln={transitional:zt,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){let i=n.getContentType()||"",r=i.indexOf("application/json")>-1,s=l.isObject(e);if(s&&l.isHTMLForm(e)&&(e=new FormData(e)),l.isFormData(e))return r?JSON.stringify(Yt(e)):e;if(l.isArrayBuffer(e)||l.isBuffer(e)||l.isStream(e)||l.isFile(e)||l.isBlob(e)||l.isReadableStream(e))return e;if(l.isArrayBufferView(e))return e.buffer;if(l.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(s){if(i.indexOf("application/x-www-form-urlencoded")>-1)return vn(e,this.formSerializer).toString();if((a=l.isFileList(e))||i.indexOf("multipart/form-data")>-1){let c=this.env&&this.env.FormData;return be(a?{"files[]":e}:e,c&&new c,this.formSerializer)}}return s||r?(n.setContentType("application/json",!1),fs(e)):e}],transformResponse:[function(e){let n=this.transitional||Ln.transitional,i=n&&n.forcedJSONParsing,r=this.responseType==="json";if(l.isResponse(e)||l.isReadableStream(e))return e;if(e&&l.isString(e)&&(i&&!this.responseType||r)){let o=!(n&&n.silentJSONParsing)&&r;try{return JSON.parse(e,this.parseReviver)}catch(a){if(o)throw a.name==="SyntaxError"?C.from(a,C.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};l.forEach(["delete","get","head","post","put","patch"],t=>{Ln.headers[t]={}});var Me=Ln;var ps=l.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),qi=t=>{let e={},n,i,r;return t&&t.split("\n").forEach(function(o){r=o.indexOf(":"),n=o.substring(0,r).trim().toLowerCase(),i=o.substring(r+1).trim(),!(!n||e[n]&&ps[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e};var Ji=Symbol("internals");function lt(t){return t&&String(t).trim().toLowerCase()}function jt(t){return t===!1||t==null?t:l.isArray(t)?t.map(jt):String(t)}function gs(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}var ms=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function _n(t,e,n,i,r){if(l.isFunction(i))return i.call(this,e,n);if(r&&(e=n),!!l.isString(e)){if(l.isString(i))return e.indexOf(i)!==-1;if(l.isRegExp(i))return i.test(e)}}function hs(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function As(t,e){let n=l.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(r,s,o){return this[i].call(this,e,r,s,o)},configurable:!0})})}var Ue=class{constructor(e){e&&this.set(e)}set(e,n,i){let r=this;function s(a,c,u){let d=lt(c);if(!d)throw new Error("header name must be a non-empty string");let f=l.findKey(r,d);(!f||r[f]===void 0||u===!0||u===void 0&&r[f]!==!1)&&(r[f||c]=jt(a))}let o=(a,c)=>l.forEach(a,(u,d)=>s(u,d,c));if(l.isPlainObject(e)||e instanceof this.constructor)o(e,n);else if(l.isString(e)&&(e=e.trim())&&!ms(e))o(qi(e),n);else if(l.isObject(e)&&l.isIterable(e)){let a={},c,u;for(let d of e){if(!l.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[u=d[0]]=(c=a[u])?l.isArray(c)?[...c,d[1]]:[c,d[1]]:d[1]}o(a,n)}else e!=null&&s(n,e,i);return this}get(e,n){if(e=lt(e),e){let i=l.findKey(this,e);if(i){let r=this[i];if(!n)return r;if(n===!0)return gs(r);if(l.isFunction(n))return n.call(this,r,i);if(l.isRegExp(n))return n.exec(r);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=lt(e),e){let i=l.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||_n(this,this[i],i,n)))}return!1}delete(e,n){let i=this,r=!1;function s(o){if(o=lt(o),o){let a=l.findKey(i,o);a&&(!n||_n(i,i[a],a,n))&&(delete i[a],r=!0)}}return l.isArray(e)?e.forEach(s):s(e),r}clear(e){let n=Object.keys(this),i=n.length,r=!1;for(;i--;){let s=n[i];(!e||_n(this,this[s],s,e,!0))&&(delete this[s],r=!0)}return r}normalize(e){let n=this,i={};return l.forEach(this,(r,s)=>{let o=l.findKey(i,s);if(o){n[o]=jt(r),delete n[s];return}let a=e?hs(s):String(s).trim();a!==s&&delete n[s],n[a]=jt(r),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let n=Object.create(null);return l.forEach(this,(i,r)=>{i!=null&&i!==!1&&(n[r]=e&&l.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){let i=new this(e);return n.forEach(r=>i.set(r)),i}static accessor(e){let i=(this[Ji]=this[Ji]={accessors:{}}).accessors,r=this.prototype;function s(o){let a=lt(o);i[a]||(As(r,o),i[a]=!0)}return l.isArray(e)?e.forEach(s):s(e),this}};Ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);l.reduceDescriptors(Ue.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});l.freezeMethods(Ue);var G=Ue;function ct(t,e){let n=this||Me,i=e||n,r=G.from(i.headers),s=i.data;return l.forEach(t,function(a){s=a.call(n,s,r.normalize(),e?e.status:void 0)}),r.normalize(),s}function ut(t){return!!(t&&t.__CANCEL__)}function Zi(t,e,n){C.call(this,t==null?"canceled":t,C.ERR_CANCELED,e,n),this.name="CanceledError"}l.inherits(Zi,C,{__CANCEL__:!0});var ae=Zi;function dt(t,e,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new C("Request failed with status code "+n.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xn(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function Es(t,e){t=t||10;let n=new Array(t),i=new Array(t),r=0,s=0,o;return e=e!==void 0?e:1e3,function(c){let u=Date.now(),d=i[s];o||(o=u),n[r]=c,i[r]=u;let f=s,S=0;for(;f!==r;)S+=n[f++],f=f%t;if(r=(r+1)%t,r===s&&(s=(s+1)%t),u-o<e)return;let I=d&&u-d;return I?Math.round(S*1e3/I):void 0}}var Qi=Es;function Is(t,e){let n=0,i=1e3/e,r,s,o=(u,d=Date.now())=>{n=d,r=null,s&&(clearTimeout(s),s=null),t(...u)};return[(...u)=>{let d=Date.now(),f=d-n;f>=i?o(u,d):(r=u,s||(s=setTimeout(()=>{s=null,o(r)},i-f)))},()=>r&&o(r)]}var er=Is;var Fe=(t,e,n=3)=>{let i=0,r=Qi(50,250);return er(s=>{let o=s.loaded,a=s.lengthComputable?s.total:void 0,c=o-i,u=r(c),d=o<=a;i=o;let f={loaded:o,total:a,progress:a?o/a:void 0,bytes:c,rate:u||void 0,estimated:u&&a&&d?(a-o)/u:void 0,event:s,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(f)},n)},Dn=(t,e)=>{let n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},kn=t=>(...e)=>l.asap(()=>t(...e));var tr=B.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,B.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(B.origin),B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent)):()=>!0;var nr=B.hasStandardBrowserEnv?{write(t,e,n,i,r,s,o){if(typeof document=="undefined")return;let a=["".concat(t,"=").concat(encodeURIComponent(e))];l.isNumber(n)&&a.push("expires=".concat(new Date(n).toUTCString())),l.isString(i)&&a.push("path=".concat(i)),l.isString(r)&&a.push("domain=".concat(r)),s===!0&&a.push("secure"),l.isString(o)&&a.push("SameSite=".concat(o)),document.cookie=a.join("; ")},read(t){if(typeof document=="undefined")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Bn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Mn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function ft(t,e,n){let i=!Bn(e);return t&&(i||n==!1)?Mn(t,e):e}var ir=t=>t instanceof G?R({},t):t;function ie(t,e){e=e||{};let n={};function i(u,d,f,S){return l.isPlainObject(u)&&l.isPlainObject(d)?l.merge.call({caseless:S},u,d):l.isPlainObject(d)?l.merge({},d):l.isArray(d)?d.slice():d}function r(u,d,f,S){if(l.isUndefined(d)){if(!l.isUndefined(u))return i(void 0,u,f,S)}else return i(u,d,f,S)}function s(u,d){if(!l.isUndefined(d))return i(void 0,d)}function o(u,d){if(l.isUndefined(d)){if(!l.isUndefined(u))return i(void 0,u)}else return i(void 0,d)}function a(u,d,f){if(f in e)return i(u,d);if(f in t)return i(void 0,u)}let c={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(u,d,f)=>r(ir(u),ir(d),f,!0)};return l.forEach(Object.keys(R(R({},t),e)),function(d){let f=c[d]||r,S=f(t[d],e[d],d);l.isUndefined(S)&&f!==a||(n[d]=S)}),n}var $t=t=>{let e=ie({},t),{data:n,withXSRFToken:i,xsrfHeaderName:r,xsrfCookieName:s,headers:o,auth:a}=e;if(e.headers=o=G.from(o),e.url=at(ft(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&o.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),l.isFormData(n)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)o.setContentType(void 0);else if(l.isFunction(n.getHeaders)){let c=n.getHeaders(),u=["content-type","content-length"];Object.entries(c).forEach(([d,f])=>{u.includes(d.toLowerCase())&&o.set(d,f)})}}if(B.hasStandardBrowserEnv&&(i&&l.isFunction(i)&&(i=i(e)),i||i!==!1&&tr(e.url))){let c=r&&s&&nr.read(s);c&&o.set(r,c)}return e};var bs=typeof XMLHttpRequest!="undefined",rr=bs&&function(t){return new Promise(function(n,i){let r=$t(t),s=r.data,o=G.from(r.headers).normalize(),{responseType:a,onUploadProgress:c,onDownloadProgress:u}=r,d,f,S,I,m;function T(){I&&I(),m&&m(),r.cancelToken&&r.cancelToken.unsubscribe(d),r.signal&&r.signal.removeEventListener("abort",d)}let b=new XMLHttpRequest;b.open(r.method.toUpperCase(),r.url,!0),b.timeout=r.timeout;function v(){if(!b)return;let _=G.from("getAllResponseHeaders"in b&&b.getAllResponseHeaders()),K={data:!a||a==="text"||a==="json"?b.responseText:b.response,status:b.status,statusText:b.statusText,headers:_,config:t,request:b};dt(function(W){n(W),T()},function(W){i(W),T()},K),b=null}"onloadend"in b?b.onloadend=v:b.onreadystatechange=function(){!b||b.readyState!==4||b.status===0&&!(b.responseURL&&b.responseURL.indexOf("file:")===0)||setTimeout(v)},b.onabort=function(){b&&(i(new C("Request aborted",C.ECONNABORTED,t,b)),b=null)},b.onerror=function(N){let K=N&&N.message?N.message:"Network Error",x=new C(K,C.ERR_NETWORK,t,b);x.event=N||null,i(x),b=null},b.ontimeout=function(){let N=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded",K=r.transitional||zt;r.timeoutErrorMessage&&(N=r.timeoutErrorMessage),i(new C(N,K.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,t,b)),b=null},s===void 0&&o.setContentType(null),"setRequestHeader"in b&&l.forEach(o.toJSON(),function(N,K){b.setRequestHeader(K,N)}),l.isUndefined(r.withCredentials)||(b.withCredentials=!!r.withCredentials),a&&a!=="json"&&(b.responseType=r.responseType),u&&([S,m]=Fe(u,!0),b.addEventListener("progress",S)),c&&b.upload&&([f,I]=Fe(c),b.upload.addEventListener("progress",f),b.upload.addEventListener("loadend",I)),(r.cancelToken||r.signal)&&(d=_=>{b&&(i(!_||_.type?new ae(null,t,b):_),b.abort(),b=null)},r.cancelToken&&r.cancelToken.subscribe(d),r.signal&&(r.signal.aborted?d():r.signal.addEventListener("abort",d)));let k=xn(r.url);if(k&&B.protocols.indexOf(k)===-1){i(new C("Unsupported protocol "+k+":",C.ERR_BAD_REQUEST,t));return}b.send(s||null)})};var ws=(t,e)=>{let{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,r,s=function(u){if(!r){r=!0,a();let d=u instanceof Error?u:this.reason;i.abort(d instanceof C?d:new ae(d instanceof Error?d.message:d))}},o=e&&setTimeout(()=>{o=null,s(new C("timeout ".concat(e," of ms exceeded"),C.ETIMEDOUT))},e),a=()=>{t&&(o&&clearTimeout(o),o=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(s):u.removeEventListener("abort",s)}),t=null)};t.forEach(u=>u.addEventListener("abort",s));let{signal:c}=i;return c.unsubscribe=()=>l.asap(a),c}},or=ws;var Ss=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let i=0,r;for(;i<n;)r=i+e,yield t.slice(i,r),i=r},Ts=function(t,e){return hn(this,null,function*(){try{for(var n=Si(Cs(t)),i,r,s;i=!(r=yield new Re(n.next())).done;i=!1){let o=r.value;yield*An(Ss(o,e))}}catch(r){s=[r]}finally{try{i&&(r=n.return)&&(yield new Re(r.call(n)))}finally{if(s)throw s[0]}}})},Cs=function(t){return hn(this,null,function*(){if(t[Symbol.asyncIterator]){yield*An(t);return}let e=t.getReader();try{for(;;){let{done:n,value:i}=yield new Re(e.read());if(n)break;yield i}}finally{yield new Re(e.cancel())}})},Un=(t,e,n,i)=>{let r=Ts(t,e),s=0,o,a=c=>{o||(o=!0,i&&i(c))};return new ReadableStream({async pull(c){try{let{done:u,value:d}=await r.next();if(u){a(),c.close();return}let f=d.byteLength;if(n){let S=s+=f;n(S)}c.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(c){return a(c),r.return()}},{highWaterMark:2})};var sr=64*1024,{isFunction:Xt}=l,Os=(({Request:t,Response:e})=>({Request:t,Response:e}))(l.global),{ReadableStream:ar,TextEncoder:lr}=l.global,cr=(t,...e)=>{try{return!!t(...e)}catch(n){return!1}},Rs=t=>{t=l.merge.call({skipUndefined:!0},Os,t);let{fetch:e,Request:n,Response:i}=t,r=e?Xt(e):typeof fetch=="function",s=Xt(n),o=Xt(i);if(!r)return!1;let a=r&&Xt(ar),c=r&&(typeof lr=="function"?(m=>T=>m.encode(T))(new lr):async m=>new Uint8Array(await new n(m).arrayBuffer())),u=s&&a&&cr(()=>{let m=!1,T=new n(B.origin,{body:new ar,method:"POST",get duplex(){return m=!0,"half"}}).headers.has("Content-Type");return m&&!T}),d=o&&a&&cr(()=>l.isReadableStream(new i("").body)),f={stream:d&&(m=>m.body)};r&&["text","arrayBuffer","blob","formData","stream"].forEach(m=>{!f[m]&&(f[m]=(T,b)=>{let v=T&&T[m];if(v)return v.call(T);throw new C("Response type '".concat(m,"' is not supported"),C.ERR_NOT_SUPPORT,b)})});let S=async m=>{if(m==null)return 0;if(l.isBlob(m))return m.size;if(l.isSpecCompliantForm(m))return(await new n(B.origin,{method:"POST",body:m}).arrayBuffer()).byteLength;if(l.isArrayBufferView(m)||l.isArrayBuffer(m))return m.byteLength;if(l.isURLSearchParams(m)&&(m=m+""),l.isString(m))return(await c(m)).byteLength},I=async(m,T)=>{let b=l.toFiniteNumber(m.getContentLength());return b==null?S(T):b};return async m=>{let{url:T,method:b,data:v,signal:k,cancelToken:_,timeout:N,onDownloadProgress:K,onUploadProgress:x,responseType:W,headers:oe,withCredentials:qe="same-origin",fetchOptions:te}=$t(m),Ae=e||fetch;W=W?(W+"").toLowerCase():"text";let j=or([k,_&&_.toAbortSignal()],N),Je=null,Oe=j&&j.unsubscribe&&(()=>{j.unsubscribe()}),gi;try{if(x&&u&&b!=="get"&&b!=="head"&&(gi=await I(oe,v))!==0){let Ie=new n(T,{method:"POST",body:v,duplex:"half"}),Le;if(l.isFormData(v)&&(Le=Ie.headers.get("content-type"))&&oe.setContentType(Le),Ie.body){let[mn,Pt]=Dn(gi,Fe(kn(x)));v=Un(Ie.body,sr,mn,Pt)}}l.isString(qe)||(qe=qe?"include":"omit");let se=s&&"credentials"in n.prototype,mi=z(R({},te),{signal:j,method:b.toUpperCase(),headers:oe.normalize().toJSON(),body:v,duplex:"half",credentials:se?qe:void 0});Je=s&&new n(T,mi);let Ee=await(s?Ae(Je,te):Ae(T,mi)),hi=d&&(W==="stream"||W==="response");if(d&&(K||hi&&Oe)){let Ie={};["status","statusText","headers"].forEach(Ai=>{Ie[Ai]=Ee[Ai]});let Le=l.toFiniteNumber(Ee.headers.get("content-length")),[mn,Pt]=K&&Dn(Le,Fe(kn(K),!0))||[];Ee=new i(Un(Ee.body,sr,mn,()=>{Pt&&Pt(),Oe&&Oe()}),Ie)}W=W||"text";let to=await f[l.findKey(f,W)||"text"](Ee,m);return!hi&&Oe&&Oe(),await new Promise((Ie,Le)=>{dt(Ie,Le,{data:to,headers:G.from(Ee.headers),status:Ee.status,statusText:Ee.statusText,config:m,request:Je})})}catch(se){throw Oe&&Oe(),se&&se.name==="TypeError"&&/Load failed|fetch/i.test(se.message)?Object.assign(new C("Network Error",C.ERR_NETWORK,m,Je),{cause:se.cause||se}):C.from(se,se&&se.code,m,Je)}}},ys=new Map,Fn=t=>{let e=t&&t.env||{},{fetch:n,Request:i,Response:r}=e,s=[i,r,n],o=s.length,a=o,c,u,d=ys;for(;a--;)c=s[a],u=d.get(c),u===void 0&&d.set(c,u=a?new Map:Rs(e)),d=u;return u},kc=Fn();var Hn={http:Kt,xhr:rr,fetch:{get:Fn}};l.forEach(Hn,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}});var ur=t=>"- ".concat(t),Ps=t=>l.isFunction(t)||t===null||t===!1;function vs(t,e){t=l.isArray(t)?t:[t];let{length:n}=t,i,r,s={};for(let o=0;o<n;o++){i=t[o];let a;if(r=i,!Ps(i)&&(r=Hn[(a=String(i)).toLowerCase()],r===void 0))throw new C("Unknown adapter '".concat(a,"'"));if(r&&(l.isFunction(r)||(r=r.get(e))))break;s[a||"#"+o]=r}if(!r){let o=Object.entries(s).map(([c,u])=>"adapter ".concat(c," ")+(u===!1?"is not supported by the environment":"is not available in the build")),a=n?o.length>1?"since :\n"+o.map(ur).join("\n"):" "+ur(o[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return r}var qt={getAdapter:vs,adapters:Hn};function Gn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ae(null,t)}function Jt(t){return Gn(t),t.headers=G.from(t.headers),t.data=ct.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),qt.getAdapter(t.adapter||Me.adapter,t)(t).then(function(i){return Gn(t),i.data=ct.call(t,t.transformResponse,i),i.headers=G.from(i.headers),i},function(i){return ut(i)||(Gn(t),i&&i.response&&(i.response.data=ct.call(t,t.transformResponse,i.response),i.response.headers=G.from(i.response.headers))),Promise.reject(i)})}var Zt="1.13.0";var Qt={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Qt[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var dr={};Qt.transitional=function(e,n,i){function r(s,o){return"[Axios v"+Zt+"] Transitional option '"+s+"'"+o+(i?". "+i:"")}return(s,o,a)=>{if(e===!1)throw new C(r(o," has been removed"+(n?" in "+n:"")),C.ERR_DEPRECATED);return n&&!dr[o]&&(dr[o]=!0,console.warn(r(o," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(s,o,a):!0}};Qt.spelling=function(e){return(n,i)=>(console.warn("".concat(i," is likely a misspelling of ").concat(e)),!0)};function Ls(t,e,n){if(typeof t!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);let i=Object.keys(t),r=i.length;for(;r-- >0;){let s=i[r],o=e[s];if(o){let a=t[s],c=a===void 0||o(a,s,t);if(c!==!0)throw new C("option "+s+" must be "+c,C.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new C("Unknown option "+s,C.ERR_BAD_OPTION)}}var pt={assertOptions:Ls,validators:Qt};var le=pt.validators,He=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Rn,response:new Rn}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let r={};Error.captureStackTrace?Error.captureStackTrace(r):r=new Error;let s=r.stack?r.stack.replace(/^.+\n/,""):"";try{i.stack?s&&!String(i.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+s):i.stack=s}catch(o){}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=ie(this.defaults,n);let{transitional:i,paramsSerializer:r,headers:s}=n;i!==void 0&&pt.assertOptions(i,{silentJSONParsing:le.transitional(le.boolean),forcedJSONParsing:le.transitional(le.boolean),clarifyTimeoutError:le.transitional(le.boolean)},!1),r!=null&&(l.isFunction(r)?n.paramsSerializer={serialize:r}:pt.assertOptions(r,{encode:le.function,serialize:le.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),pt.assertOptions(n,{baseUrl:le.spelling("baseURL"),withXsrfToken:le.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let o=s&&l.merge(s.common,s[n.method]);s&&l.forEach(["delete","get","head","post","put","patch","common"],m=>{delete s[m]}),n.headers=G.concat(o,s);let a=[],c=!0;this.interceptors.request.forEach(function(T){typeof T.runWhen=="function"&&T.runWhen(n)===!1||(c=c&&T.synchronous,a.unshift(T.fulfilled,T.rejected))});let u=[];this.interceptors.response.forEach(function(T){u.push(T.fulfilled,T.rejected)});let d,f=0,S;if(!c){let m=[Jt.bind(this),void 0];for(m.unshift(...a),m.push(...u),S=m.length,d=Promise.resolve(n);f<S;)d=d.then(m[f++],m[f++]);return d}S=a.length;let I=n;for(;f<S;){let m=a[f++],T=a[f++];try{I=m(I)}catch(b){T.call(this,b);break}}try{d=Jt.call(this,I)}catch(m){return Promise.reject(m)}for(f=0,S=u.length;f<S;)d=d.then(u[f++],u[f++]);return d}getUri(e){e=ie(this.defaults,e);let n=ft(e.baseURL,e.url,e.allowAbsoluteUrls);return at(n,e.params,e.paramsSerializer)}};l.forEach(["delete","get","head","options"],function(e){He.prototype[e]=function(n,i){return this.request(ie(i||{},{method:e,url:n,data:(i||{}).data}))}});l.forEach(["post","put","patch"],function(e){function n(i){return function(s,o,a){return this.request(ie(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:s,data:o}))}}He.prototype[e]=n(),He.prototype[e+"Form"]=n(!0)});var gt=He;var Vn=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(s){n=s});let i=this;this.promise.then(r=>{if(!i._listeners)return;let s=i._listeners.length;for(;s-- >0;)i._listeners[s](r);i._listeners=null}),this.promise.then=r=>{let s,o=new Promise(a=>{i.subscribe(a),s=a}).then(r);return o.cancel=function(){i.unsubscribe(s)},o},e(function(s,o,a){i.reason||(i.reason=new ae(s,o,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){let e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new t(function(r){e=r}),cancel:e}}},fr=Vn;function Kn(t){return function(n){return t.apply(null,n)}}function Wn(t){return l.isObject(t)&&t.isAxiosError===!0}var zn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(zn).forEach(([t,e])=>{zn[e]=t});var pr=zn;function gr(t){let e=new gt(t),n=it(gt.prototype.request,e);return l.extend(n,gt.prototype,e,{allOwnKeys:!0}),l.extend(n,e,null,{allOwnKeys:!0}),n.create=function(r){return gr(ie(t,r))},n}var F=gr(Me);F.Axios=gt;F.CanceledError=ae;F.CancelToken=fr;F.isCancel=ut;F.VERSION=Zt;F.toFormData=be;F.AxiosError=C;F.Cancel=F.CanceledError;F.all=function(e){return Promise.all(e)};F.spread=Kn;F.isAxiosError=Wn;F.mergeConfig=ie;F.AxiosHeaders=G;F.formToJSON=t=>Yt(l.isHTMLForm(t)?new FormData(t):t);F.getAdapter=qt.getAdapter;F.HttpStatusCode=pr;F.default=F;var en=F;var{Axios:xu,AxiosError:Du,CanceledError:ku,isCancel:Bu,CancelToken:Mu,VERSION:Uu,all:Fu,Cancel:Hu,isAxiosError:Gu,spread:Vu,toFormData:Ku,AxiosHeaders:Wu,HttpStatusCode:zu,formToJSON:Yu,getAdapter:ju,mergeConfig:$u}=en;var mt=class{constructor(e){this.currentToken=null;this.tokenProvider=null;this.requestHistory=new Map;this.WINDOW_MS=5e3;this.MAX_REQUESTS=30;this.axios=en.create({baseURL:e.baseURL,timeout:e.timeout||3e4,headers:R({"Content-Type":"application/json"},e.headers)}),typeof setInterval!="undefined"&&setInterval(()=>this.cleanupHistory(),1e4),this.axios.interceptors.request.use(async n=>{var i,r;if(n.url)try{this.checkRequestLimit("".concat((i=n.method)==null?void 0:i.toUpperCase(),":").concat(n.url))}catch(s){return console.error("[SDK] \u{1F6D1} Request blocked by Circuit Breaker:",s),Promise.reject(s)}if(!n.skipAuth&&!this.currentToken&&this.tokenProvider)try{console.log("[SDK] Waiting for token...");let s=await this.tokenProvider();s&&(this.updateToken(s),n.headers["x-cms-token"]=s)}catch(s){console.error("[SDK] Failed to get token from provider:",s)}return!n.skipAuth&&this.currentToken&&(n.headers["x-cms-token"]=this.currentToken),console.log("[SDK] Making ".concat((r=n.method)==null?void 0:r.toUpperCase()," request to: ").concat(n.baseURL||"").concat(n.url)),n},n=>(console.error("[SDK] Request error:",n),Promise.reject(n instanceof Error?n:new Error(String(n))))),this.axios.interceptors.response.use(n=>n,n=>(console.error("[SDK] Response error:",n.message),Promise.reject(n instanceof Error?n:new Error(String(n)))))}setTokenProvider(e){this.tokenProvider=e}async get(e,n){return(await this.axios.get(e,n)).data}async post(e,n,i){return(await this.axios.post(e,n,i)).data}async put(e,n,i){return(await this.axios.put(e,n,i)).data}async patch(e,n,i){return(await this.axios.patch(e,n,i)).data}async delete(e,n){return(await this.axios.delete(e,n)).data}setHeader(e,n){this.axios.defaults.headers.common[e]=n}removeHeader(e){delete this.axios.defaults.headers.common[e]}updateToken(e){this.currentToken=e,e?this.setHeader("x-cms-token",e):(this.removeHeader("x-cms-token"),console.log("[SDK] Token removed from ApiClient"))}getCurrentToken(){return this.currentToken}updateConfig(e){e.baseURL&&(this.axios.defaults.baseURL=e.baseURL),e.timeout&&(this.axios.defaults.timeout=e.timeout),e.headers&&Object.assign(this.axios.defaults.headers.common,e.headers),console.log("[SDK] ApiClient configuration updated")}checkRequestLimit(e){let n=Date.now(),i=this.requestHistory.get(e);if(!i){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(n-i.firstRequestTime>this.WINDOW_MS){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(i.count++,i.count>this.MAX_REQUESTS){let r=new Error("Circuit Breaker: Too many requests to ".concat(e," (").concat(i.count," in ").concat(this.WINDOW_MS,"ms)"));throw r.isCircuitBreaker=!0,r}}cleanupHistory(){let e=Date.now();for(let[n,i]of this.requestHistory.entries())e-i.firstRequestTime>this.WINDOW_MS&&this.requestHistory.delete(n)}};var _s="2.0.6",xs=500,mr="user-agent",Ye="",hr="?",M={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},J="browser",pe="cpu",de="device",re="engine",Q="os",We="result",h="name",p="type",A="vendor",E="version",$="architecture",Ct="major",g="model",St="console",O="mobile",P="tablet",H="smarttv",ce="wearable",tn="xr",Tt="embedded",Ge="inapp",oi="brands",Pe="formFactors",si="fullVersionList",ze="platform",ai="platformVersion",cn="bitness",Ce="sec-ch-ua",Ds=Ce+"-full-version-list",ks=Ce+"-arch",Bs=Ce+"-"+cn,Ms=Ce+"-form-factors",Us=Ce+"-"+O,Fs=Ce+"-"+g,vr=Ce+"-"+ze,Hs=vr+"-version",Lr=[oi,si,O,g,ze,ai,$,Pe,cn],nn="Amazon",Ve="Apple",Ar="ASUS",Er="BlackBerry",Ne="Google",Ir="Huawei",Yn="Lenovo",br="Honor",rn="LG",jn="Microsoft",$n="Motorola",Xn="Nvidia",wr="OnePlus",qn="OPPO",ht="Samsung",Sr="Sharp",At="Sony",Jn="Xiaomi",Zn="Zebra",Tr="Chrome",Cr="Chromium",we="Chromecast",sn="Edge",Et="Firefox",It="Opera",Qn="Facebook",Or="Sogou",Ke="Mobile ",bt=" Browser",ii="Windows",Gs=typeof window!==M.UNDEFINED,Z=Gs&&window.navigator?window.navigator:void 0,Se=Z&&Z.userAgentData?Z.userAgentData:void 0,Vs=function(t,e){var n={},i=e;if(!an(e)){i={};for(var r in e)for(var s in e[r])i[s]=e[r][s].concat(i[s]?i[s]:[])}for(var o in t)n[o]=i[o]&&i[o].length%2===0?i[o].concat(t[o]):t[o];return n},un=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},ri=function(t,e){if(typeof t===M.OBJECT&&t.length>0){for(var n in t)if(Te(e)==Te(t[n]))return!0;return!1}return Ot(t)?Te(e)==Te(t):!1},an=function(t,e){for(var n in t)return/^(browser|cpu|device|engine|os)$/.test(n)||(e?an(t[n]):!1)},Ot=function(t){return typeof t===M.STRING},ei=function(t){if(t){for(var e=[],n=je(/\\?\"/g,t).split(","),i=0;i<n.length;i++)if(n[i].indexOf(";")>-1){var r=ln(n[i]).split(";v=");e[i]={brand:r[0],version:r[1]}}else e[i]=ln(n[i]);return e}},Te=function(t){return Ot(t)?t.toLowerCase():t},ti=function(t){return Ot(t)?je(/[^\d\.]/g,t).split(".")[0]:void 0},ge=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];typeof n==M.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},je=function(t,e){return Ot(e)?e.replace(t,Ye):e},wt=function(t){return je(/\\?\"/g,t)},ln=function(t,e){return t=je(/^\s\s*/,String(t)),typeof e===M.UNDEFINED?t:t.substring(0,e)},ni=function(t,e){if(!(!t||!e))for(var n=0,i,r,s,o,a,c;n<e.length&&!a;){var u=e[n],d=e[n+1];for(i=r=0;i<u.length&&!a&&u[i];)if(a=u[i++].exec(t),a)for(s=0;s<d.length;s++)c=a[++r],o=d[s],typeof o===M.OBJECT&&o.length>0?o.length===2?typeof o[1]==M.FUNCTION?this[o[0]]=o[1].call(this,c):this[o[0]]=o[1]:o.length>=3&&(typeof o[1]===M.FUNCTION&&!(o[1].exec&&o[1].test)?o.length>3?this[o[0]]=c?o[1].apply(this,o.slice(2)):void 0:this[o[0]]=c?o[1].call(this,c,o[2]):void 0:o.length==3?this[o[0]]=c?c.replace(o[1],o[2]):void 0:o.length==4?this[o[0]]=c?o[3].call(this,c.replace(o[1],o[2])):void 0:o.length>4&&(this[o[0]]=c?o[3].apply(this,[c.replace(o[1],o[2])].concat(o.slice(4))):void 0)):this[o]=c||void 0;n+=2}},ue=function(t,e){for(var n in e)if(typeof e[n]===M.OBJECT&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(ri(e[n][i],t))return n===hr?void 0:n}else if(ri(e[n],t))return n===hr?void 0:n;return e.hasOwnProperty("*")?e["*"]:t},Rr={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},yr={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Ks={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Nr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[E,[h,Ke+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[E,[h,sn+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[E,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,E],[/opios[\/ ]+([\w\.]+)/i],[E,[h,It+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[E,[h,It+" GX"]],[/\bopr\/([\w\.]+)/i],[E,[h,It]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[E,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[E,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[h,E],[/quark(?:pc)?\/([-\w\.]+)/i],[E,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[E,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[E,[h,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[E,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[E,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[E,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[E,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[E,[h,"Smart "+Yn+bt]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure"+bt],E],[/\bfocus\/([\w\.]+)/i],[E,[h,Et+" Focus"]],[/\bopt\/([\w\.]+)/i],[E,[h,It+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[E,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[E,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[E,[h,It+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[E,[h,"MIUI"+bt]],[/fxios\/([\w\.-]+)/i],[E,[h,Ke+Et]],[/\bqihoobrowser\/?([\w\.]*)/i],[E,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],E],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+bt],E],[/samsungbrowser\/([\w\.]+)/i],[E,[h,ht+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[E,[h,Or+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,Or+" Mobile"],E],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,E],[/(lbbrowser|rekonq)/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[E,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,Qn],E,[p,Ge]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[h,E,[p,Ge]],[/\bgsa\/([\w\.]+) .*safari\//i],[E,[h,"GSA"],[p,Ge]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[E,[h,"TikTok"],[p,Ge]],[/\[(linkedin)app\]/i],[h,[p,Ge]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[h,/(.+)/,"Zalo"],E,[p,Ge]],[/(chromium)[\/ ]([-\w\.]+)/i],[h,E],[/headlesschrome(?:\/([\w\.]+)| )/i],[E,[h,Tr+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[E,[h,sn+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,Tr+" WebView"],E],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[E,[h,"Android"+bt]],[/chrome\/([\w\.]+) mobile/i],[E,[h,Ke+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,E],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[E,[h,Ke+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[h,Ke+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[E,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[E,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[h,E],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[h,Ke+Et],E],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],E],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,E],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[E,[h,Et+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[E,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[E,/[^\d\.]+./,Ye]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[$,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[$,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[$,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[$,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[$,"arm"]],[/ sun4\w[;\)]/i],[[$,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[$,/ower/,Ye,Te]],[/mc680.0/i],[[$,"68k"]],[/winnt.+\[axp/i],[[$,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[g,[A,ht],[p,P]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[g,[A,ht],[p,O]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[g,[A,Ve],[p,O]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[g,[A,Ve],[p,P]],[/(macintosh);/i],[g,[A,Ve]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[g,[A,Sr],[p,O]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[g,[A,br],[p,P]],[/honor([-\w ]+)[;\)]/i],[g,[A,br],[p,O]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[g,[A,Ir],[p,P]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[g,[A,Ir],[p,O]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[g,/_/g," "],[A,Jn],[p,P]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[g,/_/g," "],[A,Jn],[p,O]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[g,[A,wr],[p,O]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[g,[A,qn],[p,O]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[g,[A,ue,{OnePlus:["203","304","403","404","413","415"],"*":qn}],[p,P]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[g,[A,"BLU"],[p,O]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[g,[A,"Vivo"],[p,O]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[g,[A,"Realme"],[p,O]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[g,[A,Yn],[p,P]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[g,[A,Yn],[p,O]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[g,[A,$n],[p,O]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[g,[A,$n],[p,P]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[g,[A,rn],[p,P]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[g,[A,rn],[p,O]],[/(nokia) (t[12][01])/i],[A,g,[p,P]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[g,/_/g," "],[p,O],[A,"Nokia"]],[/(pixel (c|tablet))\b/i],[g,[A,Ne],[p,P]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[g,[A,Ne],[p,O]],[/(google) (pixelbook( go)?)/i],[A,g],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[g,[A,At],[p,O]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[g,"Xperia Tablet"],[A,At],[p,P]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[g,[A,nn],[p,P]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[g,/(.+)/g,"Fire Phone $1"],[A,nn],[p,O]],[/(playbook);[-\w\),; ]+(rim)/i],[g,A,[p,P]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[g,[A,Er],[p,O]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[g,[A,Ar],[p,P]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[g,[A,Ar],[p,O]],[/(nexus 9)/i],[g,[A,"HTC"],[p,P]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[A,[g,/_/g," "],[p,O]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[g,[A,"TCL"],[p,P]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[g,[A,"TCL"],[p,O]],[/(itel) ((\w+))/i],[[A,Te],g,[p,ue,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[g,[A,"Acer"],[p,P]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[g,[A,"Meizu"],[p,O]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[g,[A,"Ulefone"],[p,O]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[g,[A,"Energizer"],[p,O]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[g,[A,"Cat"],[p,O]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[g,[A,"Smartfren"],[p,O]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[g,[A,"Nothing"],[p,O]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[g,[A,"Archos"],[p,P]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[g,[A,"Archos"],[p,O]],[/; (n159v)/i],[g,[A,"HMD"],[p,O]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[A,g,[p,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[A,g,[p,O]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[A,g,[p,P]],[/(surface duo)/i],[g,[A,jn],[p,P]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[g,[A,"Fairphone"],[p,O]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[g,[A,Xn],[p,P]],[/(sprint) (\w+)/i],[A,g,[p,O]],[/(kin\.[onetw]{3})/i],[[g,/\./g," "],[A,jn],[p,O]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[g,[A,Zn],[p,P]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[g,[A,Zn],[p,O]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[A,[p,H]],[/hbbtv.+maple;(\d+)/i],[[g,/^/,"SmartTV"],[A,ht],[p,H]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[A,g,[p,H]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[A,rn],[p,H]],[/(apple) ?tv/i],[A,[g,Ve+" TV"],[p,H]],[/crkey.*devicetype\/chromecast/i],[[g,we+" Third Generation"],[A,Ne],[p,H]],[/crkey.*devicetype\/([^/]*)/i],[[g,/^/,"Chromecast "],[A,Ne],[p,H]],[/fuchsia.*crkey/i],[[g,we+" Nest Hub"],[A,Ne],[p,H]],[/crkey/i],[[g,we],[A,Ne],[p,H]],[/(portaltv)/i],[g,[A,Qn],[p,H]],[/droid.+aft(\w+)( bui|\))/i],[g,[A,nn],[p,H]],[/(shield \w+ tv)/i],[g,[A,Xn],[p,H]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[g,[A,Sr],[p,H]],[/(bravia[\w ]+)( bui|\))/i],[g,[A,At],[p,H]],[/(mi(tv|box)-?\w+) bui/i],[g,[A,Jn],[p,H]],[/Hbbtv.*(technisat) (.*);/i],[A,g,[p,H]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[A,/.+\/(\w+)/,"$1",ue,{LG:"lge"}],[g,ln],[p,H]],[/(playstation \w+)/i],[g,[A,At],[p,St]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[g,[A,jn],[p,St]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[A,g,[p,St]],[/droid.+; (shield)( bui|\))/i],[g,[A,Xn],[p,St]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[g,[A,ht],[p,ce]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[A,g,[p,ce]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[g,[A,qn],[p,ce]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[g,[A,Ve],[p,ce]],[/(opwwe\d{3})/i],[g,[A,wr],[p,ce]],[/(moto 360)/i],[g,[A,$n],[p,ce]],[/(smartwatch 3)/i],[g,[A,At],[p,ce]],[/(g watch r)/i],[g,[A,rn],[p,ce]],[/droid.+; (wt63?0{2,3})\)/i],[g,[A,Zn],[p,ce]],[/droid.+; (glass) \d/i],[g,[A,Ne],[p,tn]],[/(pico) ([\w ]+) os\d/i],[A,g,[p,tn]],[/(quest( \d| pro)?s?).+vr/i],[g,[A,Qn],[p,tn]],[/mobile vr; rv.+firefox/i],[[p,tn]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[A,[p,Tt]],[/(aeobc)\b/i],[g,[A,nn],[p,Tt]],[/(homepod).+mac os/i],[g,[A,Ve],[p,Tt]],[/windows iot/i],[[p,Tt]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[g,[p,H]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[p,H]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[g,[p,ue,{mobile:"Mobile",xr:"VR","*":P}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[p,P]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[p,O]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[g,[A,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[E,[h,sn+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,E],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[E,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,E],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[E,h]],os:[[/(windows nt) (6\.[23]); arm/i],[[h,/N/,"R"],[E,ue,Rr]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[h,E],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[E,/(;|\))/g,"",ue,Rr],[h,ii]],[/(windows ce)\/?([\d\.]*)/i],[h,E],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[E,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[h,"macOS"],[E,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[E,[h,we+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[E,[h,we+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[E,[h,we+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[E,[h,we+" Linux"]],[/crkey\/([\d\.]+)/i],[E,[h,we]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[E,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],E],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[h,E],[/\(bb(10);/i],[E,[h,Er]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[E,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[E,[h,Et+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[E,[h,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[E,ue,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[E,[h,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,"Chrome OS"],E],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[h,E],[/(sunos) ?([\d\.]*)/i],[[h,"Solaris"],E],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,E]]},on=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return ge.call(t.init,[[J,[h,E,Ct,p]],[pe,[$]],[de,[p,g,A]],[re,[h,E]],[Q,[h,E]]]),ge.call(t.isIgnore,[[J,[E,Ct]],[re,[E]],[Q,[E]]]),ge.call(t.isIgnoreRgx,[[J,/ ?browser$/i],[Q,/ ?os$/i]]),ge.call(t.toString,[[J,[h,E]],[pe,[$]],[de,[A,g]],[re,[h,E]],[Q,[h,E]]]),t}(),Ws=function(t,e){var n=on.init[e],i=on.isIgnore[e]||0,r=on.isIgnoreRgx[e]||0,s=on.toString[e]||0;function o(){ge.call(this,n)}return o.prototype.getItem=function(){return t},o.prototype.withClientHints=function(){return Se?Se.getHighEntropyValues(Lr).then(function(a){return t.setCH(new _r(a,!1)).parseCH().get()}):t.parseCH().get()},o.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=We&&(o.prototype.is=function(a){var c=!1;for(var u in this)if(this.hasOwnProperty(u)&&!ri(i,u)&&Te(r?je(r,this[u]):this[u])==Te(r?je(r,a):a)){if(c=!0,a!=M.UNDEFINED)break}else if(a==M.UNDEFINED&&c){c=!c;break}return c},o.prototype.toString=function(){var a=Ye;for(var c in s)typeof this[s[c]]!==M.UNDEFINED&&(a+=(a?" ":Ye)+this[s[c]]);return a||M.UNDEFINED}),Se||(o.prototype.then=function(a){var c=this,u=function(){for(var f in c)c.hasOwnProperty(f)&&(this[f]=c[f])};u.prototype={is:o.prototype.is,toString:o.prototype.toString};var d=new u;return a(d),d}),new o};function _r(t,e){if(t=t||{},ge.call(this,Lr),e)ge.call(this,[[oi,ei(t[Ce])],[si,ei(t[Ds])],[O,/\?1/.test(t[Us])],[g,wt(t[Fs])],[ze,wt(t[vr])],[ai,wt(t[Hs])],[$,wt(t[ks])],[Pe,ei(t[Ms])],[cn,wt(t[Bs])]]);else for(var n in t)this.hasOwnProperty(n)&&typeof t[n]!==M.UNDEFINED&&(this[n]=t[n])}function Pr(t,e,n,i){return this.get=function(r){return r?this.data.hasOwnProperty(r)?this.data[r]:void 0:this.data},this.set=function(r,s){return this.data[r]=s,this},this.setCH=function(r){return this.uaCH=r,this},this.detectFeature=function(){if(Z&&Z.userAgent==this.ua)switch(this.itemType){case J:Z.brave&&typeof Z.brave.isBrave==M.FUNCTION&&this.set(h,"Brave");break;case de:!this.get(p)&&Se&&Se[O]&&this.set(p,O),this.get(g)=="Macintosh"&&Z&&typeof Z.standalone!==M.UNDEFINED&&Z.maxTouchPoints&&Z.maxTouchPoints>2&&this.set(g,"iPad").set(p,P);break;case Q:!this.get(h)&&Se&&Se[ze]&&this.set(h,Se[ze]);break;case We:var r=this.data,s=function(o){return r[o].getItem().detectFeature().get()};this.set(J,s(J)).set(pe,s(pe)).set(de,s(de)).set(re,s(re)).set(Q,s(Q))}return this},this.parseUA=function(){switch(this.itemType!=We&&ni.call(this.data,this.ua,this.rgxMap),this.itemType){case J:this.set(Ct,ti(this.get(E)));break;case Q:if(this.get(h)=="iOS"&&this.get(E)=="18.6"){var r=/\) Version\/([\d\.]+)/.exec(this.ua);r&&parseInt(r[1].substring(0,2),10)>=26&&this.set(E,r[1])}break}return this},this.parseCH=function(){var r=this.uaCH,s=this.rgxMap;switch(this.itemType){case J:case re:var o=r[si]||r[oi],a;if(o)for(var c=0;c<o.length;c++){var u=o[c].brand||o[c],d=o[c].version;this.itemType==J&&!/not.a.brand/i.test(u)&&(!a||/Chrom/.test(a)&&u!=Cr||a==sn&&/WebView2/.test(u))&&(u=ue(u,Ks),a=this.get(h),a&&!/Chrom/.test(a)&&/Chrom/.test(u)||this.set(h,u).set(E,d).set(Ct,ti(d)),a=u),this.itemType==re&&u==Cr&&this.set(E,d)}break;case pe:var f=r[$];f&&(f&&r[cn]=="64"&&(f+="64"),ni.call(this.data,f+";",s));break;case de:if(r[O]&&this.set(p,O),r[g]&&(this.set(g,r[g]),!this.get(p)||!this.get(A))){var S={};ni.call(S,"droid 9; "+r[g]+")",s),!this.get(p)&&S.type&&this.set(p,S.type),!this.get(A)&&S.vendor&&this.set(A,S.vendor)}if(r[Pe]){var I;if(typeof r[Pe]!="string")for(var m=0;!I&&m<r[Pe].length;)I=ue(r[Pe][m++],yr);else I=ue(r[Pe],yr);this.set(p,I)}break;case Q:var T=r[ze];if(T){var b=r[ai];T==ii&&(b=parseInt(ti(b),10)>=13?"11":"10"),this.set(h,T).set(E,b)}this.get(h)==ii&&r[g]=="Xbox"&&this.set(h,"Xbox").set(E,void 0);break;case We:var v=this.data,k=function(_){return v[_].getItem().setCH(r).parseCH().get()};this.set(J,k(J)).set(pe,k(pe)).set(de,k(de)).set(re,k(re)).set(Q,k(Q))}return this},ge.call(this,[["itemType",t],["ua",e],["uaCH",i],["rgxMap",n],["data",Ws(this,t)]]),this}function ee(t,e,n){if(typeof t===M.OBJECT?(an(t,!0)?(typeof e===M.OBJECT&&(n=e),e=t):(n=t,e=void 0),t=void 0):typeof t===M.STRING&&!an(e,!0)&&(n=e,e=void 0),n)if(typeof n.append===M.FUNCTION){var i={};n.forEach(function(d,f){i[String(f).toLowerCase()]=d}),n=i}else{var r={};for(var s in n)n.hasOwnProperty(s)&&(r[String(s).toLowerCase()]=n[s]);n=r}if(!(this instanceof ee))return new ee(t,e,n).getResult();var o=typeof t===M.STRING?t:n&&n[mr]?n[mr]:Z&&Z.userAgent?Z.userAgent:Ye,a=new _r(n,!0),c=e?Vs(Nr,e):Nr,u=function(d){return d==We?function(){return new Pr(d,o,c,a).set("ua",o).set(J,this.getBrowser()).set(pe,this.getCPU()).set(de,this.getDevice()).set(re,this.getEngine()).set(Q,this.getOS()).get()}:function(){return new Pr(d,o,c[d],a).parseUA().get()}};return ge.call(this,[["getBrowser",u(J)],["getCPU",u(pe)],["getDevice",u(de)],["getEngine",u(re)],["getOS",u(Q)],["getResult",u(We)],["getUA",function(){return o}],["setUA",function(d){return Ot(d)&&(o=ln(d,xs)),this}]]).setUA(o),this}ee.VERSION=_s;ee.BROWSER=un([h,E,Ct,p]);ee.CPU=un([$]);ee.DEVICE=un([g,A,p,St,O,H,P,ce,Tt]);ee.ENGINE=ee.OS=un([h,E]);var id=Object.freeze({115:"115",2345:"2345",360:"360",ALIPAY:"Alipay",AMAYA:"Amaya",ANDROID:"Android Browser",ARORA:"Arora",AVANT:"Avant",AVAST:"Avast Secure Browser",AVG:"AVG Secure Browser",BAIDU:"Baidu Browser",BASILISK:"Basilisk",BING:"Bing",BLAZER:"Blazer",BOLT:"Bolt",BOWSER:"Bowser",BRAVE:"Brave",CAMINO:"Camino",CHIMERA:"Chimera",CHROME:"Chrome",CHROME_HEADLESS:"Chrome Headless",CHROME_MOBILE:"Mobile Chrome",CHROME_WEBVIEW:"Chrome WebView",CHROMIUM:"Chromium",COBALT:"Cobalt",COC_COC:"Coc Coc",CONKEROR:"Conkeror",DAUM:"Daum",DILLO:"Dillo",DOLPHIN:"Dolphin",DOOBLE:"Dooble",DORIS:"Doris",DRAGON:"Dragon",DUCKDUCKGO:"DuckDuckGo",ECOSIA:"Ecosia",EDGE:"Edge",EDGE_WEBVIEW:"Edge WebView",EDGE_WEBVIEW2:"Edge WebView2",EPIPHANY:"Epiphany",FACEBOOK:"Facebook",FALKON:"Falkon",FIREBIRD:"Firebird",FIREFOX:"Firefox",FIREFOX_FOCUS:"Firefox Focus",FIREFOX_MOBILE:"Mobile Firefox",FIREFOX_REALITY:"Firefox Reality",FENNEC:"Fennec",FLOCK:"Flock",FLOW:"Flow",GO:"GoBrowser",GOOGLE_SEARCH:"GSA",HELIO:"Helio",HEYTAP:"HeyTap",HONOR:"Honor",HUAWEI:"Huawei Browser",ICAB:"iCab",ICE:"ICE Browser",ICEAPE:"IceApe",ICECAT:"IceCat",ICEDRAGON:"IceDragon",ICEWEASEL:"IceWeasel",IE:"IE",INSTAGRAM:"Instagram",IRIDIUM:"Iridium",IRON:"Iron",JASMINE:"Jasmine",KONQUEROR:"Konqueror",KAKAO:"KakaoTalk",KHTML:"KHTML",K_MELEON:"K-Meleon",KLAR:"Klar",KLARNA:"Klarna",KINDLE:"Kindle",LENOVO:"Smart Lenovo Browser",LADYBIRD:"Ladybird",LG:"LG Browser",LIBREWOLF:"LibreWolf",LIEBAO:"LBBROWSER",LINE:"Line",LINKEDIN:"LinkedIn",LINKS:"Links",LUNASCAPE:"Lunascape",LYNX:"Lynx",MAEMO:"Maemo Browser",MAXTHON:"Maxthon",MIDORI:"Midori",MINIMO:"Minimo",MIUI:"MIUI Browser",MOZILLA:"Mozilla",MOSAIC:"Mosaic",NAVER:"Naver",NETFRONT:"NetFront",NETSCAPE:"Netscape",NETSURF:"Netsurf",NOKIA:"Nokia Browser",OBIGO:"Obigo",OCULUS:"Oculus Browser",OMNIWEB:"OmniWeb",OPERA:"Opera",OPERA_COAST:"Opera Coast",OPERA_GX:"Opera GX",OPERA_MINI:"Opera Mini",OPERA_MOBI:"Opera Mobi",OPERA_TABLET:"Opera Tablet",OPERA_TOUCH:"Opera Touch",OTTER:"Otter",OVI:"OviBrowser",PALEMOON:"PaleMoon",PHANTOMJS:"PhantomJS",PHOENIX:"Phoenix",PICOBROWSER:"Pico Browser",POLARIS:"Polaris",PUFFIN:"Puffin",QQ:"QQBrowser",QQ_LITE:"QQBrowserLite",QUARK:"Quark",QUPZILLA:"QupZilla",QUTEBROWSER:"qutebrowser",QWANT:"Qwant",REKONQ:"rekonq",ROCKMELT:"Rockmelt",SAFARI:"Safari",SAFARI_MOBILE:"Mobile Safari",SAILFISH:"Sailfish Browser",SAMSUNG:"Samsung Internet",SEAMONKEY:"SeaMonkey",SILK:"Silk",SKYFIRE:"Skyfire",SLEIPNIR:"Sleipnir",SLIMBOAT:"SlimBoat",SLIMBROWSER:"SlimBrowser",SLIMJET:"Slimjet",SNAPCHAT:"Snapchat",SOGOU_EXPLORER:"Sogou Explorer",SOGOU_MOBILE:"Sogou Mobile",SURF:"Surf",SWIFTFOX:"Swiftfox",TESLA:"Tesla",TIKTOK:"TikTok",TIZEN:"Tizen Browser",TWITTER:"Twitter",UC:"UCBrowser",UP:"UP.Browser",VIVALDI:"Vivaldi",VIVO:"Vivo Browser",W3M:"w3m",WATERFOX:"Waterfox",WEBKIT:"WebKit",WECHAT:"WeChat",WEIBO:"Weibo",WHALE:"Whale",WOLVIC:"Wolvic",YANDEX:"Yandex",ZALO:"Zalo"});var Rt=Object.freeze({CRAWLER:"crawler",CLI:"cli",EMAIL:"email",FETCHER:"fetcher",INAPP:"inapp",MEDIAPLAYER:"mediaplayer",LIBRARY:"library"}),xr=Object.freeze({"68K":"68k",ALPHA:"alpha",ARM:"arm",ARM_64:"arm64",ARM_HF:"armhf",AVR:"avr",AVR_32:"avr32",IA64:"ia64",IRIX:"irix",IRIX_64:"irix64",MIPS:"mips",MIPS_64:"mips64",PA_RISC:"pa-risc",PPC:"ppc",SPARC:"sparc",SPARC_64:"sparc64",X86:"ia32",X86_64:"amd64"});var rd=Object.freeze({CONSOLE:"console",DESKTOP:"desktop",EMBEDDED:"embedded",MOBILE:"mobile",SMARTTV:"smarttv",TABLET:"tablet",WEARABLE:"wearable",XR:"xr"});var od=Object.freeze({ACER:"Acer",ADVAN:"Advan",ALCATEL:"Alcatel",APPLE:"Apple",AMAZON:"Amazon",ARCHOS:"Archos",ASUS:"ASUS",ATT:"AT&T",BENQ:"BenQ",BLACKBERRY:"BlackBerry",BLU:"BLU",CAT:"Cat",DELL:"Dell",ENERGIZER:"Energizer",ESSENTIAL:"Essential",FACEBOOK:"Facebook",FAIRPHONE:"Fairphone",GEEKSPHONE:"GeeksPhone",GENERIC:"Generic",GOOGLE:"Google",HISENSE:"Hisense",HMD:"HMD",HP:"HP",HTC:"HTC",HUAWEI:"Huawei",IMO:"IMO",INFINIX:"Infinix",ITEL:"itel",JOLLA:"Jolla",KOBO:"Kobo",LAVA:"Lava",LENOVO:"Lenovo",LG:"LG",MEIZU:"Meizu",MICROMAX:"Micromax",MICROSOFT:"Microsoft",MOTOROLA:"Motorola",NEXIAN:"Nexian",NINTENDO:"Nintendo",NOKIA:"Nokia",NOTHING:"Nothing",NVIDIA:"Nvidia",ONEPLUS:"OnePlus",OPPO:"OPPO",OUYA:"Ouya",PALM:"Palm",PANASONIC:"Panasonic",PEBBLE:"Pebble",PHILIPS:"Philips",PICO:"Pico",POLYTRON:"Polytron",REALME:"Realme",RETROID:"Retroid",RIM:"RIM",ROKU:"Roku",SAMSUNG:"Samsung",SHARP:"Sharp",SIEMENS:"Siemens",SMARTFREN:"Smartfren",SONY:"Sony",SPRINT:"Sprint",TCL:"TCL",TECHNISAT:"TechniSAT",TECNO:"TECNO",TESLA:"Tesla",ULEFONE:"Ulefone",VIVO:"Vivo",VIZIO:"Vizio",VODAFONE:"Vodafone",WIKO:"Wiko",XBOX:"Xbox",XIAOMI:"Xiaomi",ZEBRA:"Zebra",ZTE:"ZTE"});var Dr=Object.freeze({AMAYA:"Amaya",ARKWEB:"ArkWeb",BLINK:"Blink",EDGEHTML:"EdgeHTML",FLOW:"Flow",GECKO:"Gecko",GOANNA:"Goanna",ICAB:"iCab",KHTML:"KHTML",LIBWEB:"LibWeb",LINKS:"Links",LYNX:"Lynx",NETFRONT:"NetFront",NETSURF:"NetSurf",PRESTO:"Presto",SERVO:"Servo",TASMAN:"Tasman",TRIDENT:"Trident",W3M:"w3m",WEBKIT:"WebKit"});var kr=Object.freeze({AIX:"AIX",AMIGA_OS:"Amiga OS",ANDROID:"Android",ANDROID_X86:"Android-x86",ARCAOS:"ArcaOS",ARCH:"Arch",BADA:"Bada",BEOS:"BeOS",BLACKBERRY:"BlackBerry",CENTOS:"CentOS",CHROME_OS:"Chrome OS",CHROMECAST:"Chromecast",CHROMECAST_ANDROID:"Chromecast Android",CHROMECAST_FUCHSIA:"Chromecast Fuchsia",CHROMECAST_LINUX:"Chromecast Linux",CHROMECAST_SMARTSPEAKER:"Chromecast SmartSpeaker",CONTIKI:"Contiki",DEBIAN:"Debian",DEEPIN:"Deepin",DRAGONFLY:"DragonFly",ELEMENTARY_OS:"elementary OS",FEDORA:"Fedora",FIREFOX_OS:"Firefox OS",FREEBSD:"FreeBSD",FUCHSIA:"Fuchsia",GENTOO:"Gentoo",GHOSTBSD:"GhostBSD",GNU:"GNU",HAIKU:"Haiku",HARMONYOS:"HarmonyOS",HP_UX:"HP-UX",HURD:"Hurd",IOS:"iOS",JOLI:"Joli",KAIOS:"KaiOS",KNOPPIX:"Knoppix",KUBUNTU:"Kubuntu",LINPUS:"Linpus",LINSPIRE:"Linspire",LINUX:"Linux",MACOS:"macOS",MAEMO:"Maemo",MAGEIA:"Mageia",MANDRIVA:"Mandriva",MANJARO:"Manjaro",MEEGO:"MeeGo",MINIX:"Minix",MINT:"Mint",MORPH_OS:"Morph OS",NETBSD:"NetBSD",NETRANGE:"NetRange",NETTV:"NetTV",NINTENDO:"Nintendo",OPENHARMONY:"OpenHarmony",OPENBSD:"OpenBSD",OPENVMS:"OpenVMS",OS2:"OS/2",PALM:"Palm",PC_BSD:"PC-BSD",PCLINUXOS:"PCLinuxOS",PICO:"Pico",PLAN9:"Plan9",PLAYSTATION:"PlayStation",QNX:"QNX",RASPBIAN:"Raspbian",REDHAT:"RedHat",RIM_TABLET_OS:"RIM Tablet OS",RISC_OS:"RISC OS",SABAYON:"Sabayon",SAILFISH:"Sailfish",SERENITYOS:"SerenityOS",SERIES40:"Series40",SLACKWARE:"Slackware",SOLARIS:"Solaris",SUSE:"SUSE",SYMBIAN:"Symbian",TIZEN:"Tizen",UBUNTU:"Ubuntu",UBUNTU_TOUCH:"Ubuntu Touch",UNIX:"Unix",VECTORLINUX:"VectorLinux",WATCHOS:"watchOS",WEBOS:"WebOS",WINDOWS:"Windows",WINDOWS_CE:"Windows CE",WINDOWS_IOT:"Windows IoT",WINDOWS_MOBILE:"Windows Mobile",WINDOWS_PHONE:"Windows Phone",WINDOWS_RT:"Windows RT",XBOX:"Xbox",XUBUNTU:"Xubuntu",ZENWALK:"Zenwalk"});var Br=Object.freeze({BrowserName:{CLI:{CURL:"curl",ELINKS:"ELinks",HTTPIE:"HTTPie",LYNX:"Lynx",WGET:"Wget"},Crawler:{AHREFS_BOT:"AhrefsBot",AI2_BOT:"AI2Bot",AIHIT_BOT:"aiHitBot",ALGOLIA_CRAWLER:"Algolia Crawler",APPLE_BOT:"Applebot",APPLE_BOT_EXTENDED:"Applebot-Extended",ASK_TEOMA:"Teoma",AMAZON_BOT:"Amazonbot",AMAZON_CONTXBOT:"contxbot",ANTHROPIC_AI:"anthropic-ai",ANTHROPIC_CLAUDE_BOT:"ClaudeBot",ANTHROPIC_CLAUDE_SEARCHBOT:"Claude-SearchBot",ANTHROPIC_CLAUDE_WEB:"Claude-Web",ARCHIVEORG_BOT:"archive.org_bot",BAIDU_ADS:"Baidu-ADS",BAIDU_SPIDER:"Baiduspider",BAIDU_SPIDER_ADS:"Baiduspider-ads",BAIDU_SPIDER_CPRO:"Baiduspider-cpro",BAIDU_SPIDER_FAVO:"Baiduspider-favo",BAIDU_SPIDER_IMAGE:"Baiduspider-image",BAIDU_SPIDER_NEWS:"Baiduspider-news",BAIDU_SPIDER_RENDER:"Baiduspider-render",BAIDU_SPIDER_VIDEO:"Baiduspider-video",BLEX_BOT:"BLEXBot",BOTIFY:"botify",BRAVE_BOT:"Bravebot",BYTEDANCE_BYTESPIDER:"Bytespider",BYTEDANCE_TIKTOKSPIDER:"TikTokSpider",COMMON_CRAWL_CCBOT:"CCBot",COCCOC_BOT_WEB:"coccocbot-web",COCCOC_BOT_IMAGE:"coccocbot-image",COHERE_TRAINING_DATA_CRAWLER:"cohere-training-data-crawler",COTOYOGI:"Cotoyogi",COVEO_BOT:"Coveobot",CRITEO_BOT:"CriteoBot",DATAFORSEO_BOT:"DataForSeoBot",DAUM:"Daum",DAUM_DAUMOA:"Daumoa",DAUM_DAUMOA_IMAGE:"Daumoa-image",DEEPSEEK_BOT:"DeepSeekBot",DIFFBOT:"Diffbot",DUCKDUCKGO_BOT:"DuckDuckBot",DUCKDUCKGO_FAVICONS_BOT:"DuckDuckGo-Favicons-Bot",ELASTIC:"Elastic",ELASTIC_SWIFTYPE_BOT:"Swiftbot",EXALEAD_EXABOT:"Exabot",FIRECRAWL_AGENT:"FirecrawlAgent",FREESPOKE:"Freespoke",GOOGLE_ADSBOT:"AdsBot-Google",GOOGLE_ADSBOT_MOBILE:"Adsbot-Google-Mobile",GOOGLE_ADSENSE:"AdSense",GOOGLE_APIS:"APIs-Google",GOOGLE_BOT:"Googlebot",GOOGLE_BOT_IMAGE:"Googlebot-Image",GOOGLE_BOT_NEWS:"Googlebot-News",GOOGLE_BOT_VIDEO:"Googlebot-Video",GOOGLE_CLOUDVERTEXBOT:"Google-CloudVertexBot",GOOGLE_EXTENDED:"Google-Extended",GOOGLE_INSPECTIONTOOL:"Google-InspectionTool",GOOGLE_OTHER:"GoogleOther",GOOGLE_OTHER_IMAGE:"GoogleOther-Image",GOOGLE_OTHER_VIDEO:"GoogleOther-Video",GOOGLE_SAFETY:"Google-Safety",GOOGLE_STOREBOT:"Storebot-Google",HIVE_IMAGESIFTBOT:"ImagesiftBot",HUAWEI_PANGUBOT:"PanguBot",HUAWEI_PETALBOT:"PetalBot",HUGGINGFACE_BOT:"HuggingFace-Bot",HUNTER_VELENPUBLICWEBCRAWLER:"VelenPublicWebCrawler",IA_ARCHIVER:"ia_archiver",IASK_BOT:"iAskBot",KAGI_BOT:"Kagibot",KANGAROO_BOT:"Kangaroo Bot",LINE_SPIDER:"Linespider",LINKEDIN_BOT:"LinkedInBot",MAGPIE_CRAWLER:"magpie-crawler",MARGINALIA:"marginalia",META_EXTERNALAGENT:"meta-externalagent",META_FACEBOOKBOT:"FacebookBot",META_FACEBOOKCATALOG:"facebookcatalog",META_FACEBOOKEXTERNALHIT:"facebookexternalhit",MAJESTIC_MJ12BOT:"MJ12bot",MICROSOFT_BINGBOT:"Bingbot",MICROSOFT_MSNBOT:"msnbot",MICROSOFT_ADIDXBOT:"adidxbot",MOJEEK_BOT:"MojeekBot",MOZ_DOTBOT:"DotBot",ONCRAWL:"OnCrawl",ONESPOT_SCRAPERBOT:"Onespot-ScraperBot",OPENAI_GPTBOT:"GPTBot",OPENAI_SEARCH_BOT:"OAI-SearchBot",PERPLEXITY_BOT:"PerplexityBot",QIHOO_360_SPIDER:"360Spider",QWANT_BOT:"Qwantbot",QWANT_BOT_NEWS:"Qwantbot-news",REPLICATE_BOT:"Replicate-Bot",RUNPOD_BOT:"RunPod-Bot",SB_INTUITIONS_BOT:"SBIntuitionsBot",SEEKPORT_BOT:"SeekportBot",SEMRUSH_BOT:"SemrushBot",SEMRUSH_BOT_BACKLINK:"SemrushBot-BA",SEMRUSH_BOT_CONTENTSHAKE:"SemrushBot-OCOB",SEMRUSH_BOT_SEO_CHECKER:"SemrushBot-SI",SEZNAM_BOT:"SeznamBot",SITEIMPROVE:"Siteimprove",SOGOU_PIC_SPIDER:"Sogou Pic Spider",SOGOU_WEB_SPIDER:"Sogou web spider",STARTPAGE:"Startpage",SURLY_BOT:"SurdotlyBot",TIMPI_BOT:"Timpibot",TOGETHER_BOT:"Together-Bot",TURNITIN_BOT:"TurnitinBot",TWIN_AGENT:"TwinAgent",VERCEL_V0BOT:"v0bot",WEBZIO:"webzio",WEBZIO_EXTENDED:"Webzio-Extended",WEBZIO_OMGILI:"omgili",WEBZIO_OMGILI_BOT:"omgilibot",XAI_BOT:"xAI-Bot",YAHOO_JAPAN:"Y!J-BRW",YAHOO_SLURP:"Yahoo! Slurp",YANDEX_ACCESSIBILITY_BOT:"YandexAccessibilityBot",YANDEX_ADDITIONAL_BOT:"YandexAdditionalBot",YANDEX_ADNET:"YandexAdNet",YANDEX_BLOGS:"YandexBlogs",YANDEX_BOT:"YandexBot",YANDEX_BOT_MIRRORDETECTOR:"YandexBot MirrorDetector",YANDEX_COMBOT:"YandexComBot",YANDEX_FAVICONS:"YandexFavicons",YANDEX_IMAGE_RESIZER:"YandexImageResizer",YANDEX_IMAGES:"YandexImages",YANDEX_MARKET:"YandexMarket",YANDEX_MEDIA:"YandexMedia",YANDEX_METRIKA:"YandexMetrika",YANDEX_MOBILE_BOT:"YandexMobileBot",YANDEX_MOBILE_SCREENSHOT_BOT:"YandexMobileScreenShotBot",YANDEX_NEWS:"YandexNews",YANDEX_ONTODB:"YandexOntoDB",YANDEX_ONTODB_API:"YandexOntoDBAPI",YANDEX_PARTNER:"YandexPartner",YANDEX_RCA:"YandexRCA",YANDEX_RENDERRESOURCES_BOT:"YandexRenderResourcesBot",YANDEX_SCREENSHOT_BOT:"YandexScreenshotBot",YANDEX_SPRAV_BOT:"YandexSpravBot",YANDEX_TRACKER:"YandexTracker",YANDEX_VERTICALS:"YandexVerticals",YANDEX_VERTIS:"YandexVertis",YANDEX_VIDEO:"YandexVideo",YANDEX_VIDEO_PARSER:"YandexVideoParser",YANDEX_WEBMASTER:"YandexWebmaster",YEP_BOT:"YepBot",YETI:"Yeti",YISOU_SPIDER:"YisouSpider",YOU_BOT:"YouBot",ZHIPU_CHATGLM_SPIDER:"ChatGLM-Spider",ZUM_BOT:"ZumBot"},Email:{AIRMAIL:"Airmail",APPLE_MAIL:"Mail",BLUEMAIL:"BlueMail",DAUM_MAIL:"DaumMail",EVOLUTION:"Evolution",EM_CLIENT:"eM Client",FOXMAIL:"Foxmail",KMAIL:"KMail",KMAIL2:"kmail2",KONTACT:"Kontact",MICROSOFT_OUTLOOK:"Microsoft Outlook",MICROSOFT_OUTLOOK_MAC:"MacOutlook",NAVER_MAILAPP:"NaverMailApp",POLYMAIL:"Polymail",PROTON_MAIL:"ProtonMail",SPARK_MAIL:"SparkDesktop",SPARROW:"Sparrow",THUNDERBIRD:"Thunderbird",YAHOO_MAIL:"Yahoo",ZIMBRA:"Zimbra",ZOHO_MAIL:"ZohoMail-Desktop"},Fetcher:{AHREFS_SITEAUDIT:"AhrefsSiteAudit",ANTHROPIC_CLAUDE_USER:"Claude-User",ASANA:"Asana",BETTER_UPTIME_BOT:"Better Uptime Bot",BITLY_BOT:"bitlybot",BLUESKY:"Bluesky",BUFFER_LINKPREVIEWBOT:"BufferLinkPreviewBot",COHERE_AI:"Cohere-AI",DISCORD_BOT:"Discordbot",DUCKDUCKGO_ASSISTBOT:"DuckAssistBot",GOOGLE_CHROME_LIGHTHOUSE:"Chrome-Lighthouse",GOOGLE_FEEDFETCHER:"FeedFetcher-Google",GOOGLE_GEMINI_DEEP_RESEARCH:"Gemini-Deep-Research",GOOGLE_IMAGEPROXY:"GoogleImageProxy",GOOGLE_PAGERENDERER:"Google-PageRenderer",GOOGLE_READ_ALOUD:"Google-Read-Aloud",GOOGLE_PRODUCER:"GoogleProducer",GOOGLE_SITE_VERIFICATION:"Google-Site-Verification",HUBSPOT_PAGE_FETCHER:"HubSpot Page Fetcher",IFRAMELY:"Iframely",KAKAOTALK_SCRAP:"kakaotalk-scrap",KEYBASE_BOT:"KeybaseBot",META_EXTERNALFETCHER:"meta-externalfetcher",META_WHATSAPP:"WhatsApp",MICROSOFT_BINGPREVIEW:"BingPreview",MICROSOFT_PREVIEW:"MicrosoftPreview",MISTRALAI_USER:"MistralAI-User",NAVER_BLUENO:"Blueno",ONCRAWL_ROGERBOT:"rogerbot",OPENAI_CHATGPT_USER:"ChatGPT-User",PERPLEXITY_USER:"Perplexity-User",PINTEREST_BOT:"Pinterestbot",SEMRUSH_SITEAUDITBOT:"SiteAuditBot",SLACK_BOT:"Slackbot",SLACK_BOT_LINKEXPANDING:"Slackbot-LinkExpanding",SLACK_IMGPROXY:"Slack-ImgProxy",SNAP_URL_PREVIEW:"Snap URL Preview",SKYPE_URIPREVIEW:"SkypeUriPreview",TELEGRAM_BOT:"TelegramBot",UPTIMEROBOT:"UptimeRobot",VERCEL_FAVICON_BOT:"vercel-favicon-bot",VERCEL_SCREENSHOT_BOT:"vercel-screenshot-bot",VERCEL_BOT:"Vercelbot",VERCEL_FLAGS:"vercelflags",VERCEL_TRACING:"verceltracing",X_TWITTERBOT:"Twitterbot",YANDEX_CALENDAR:"YandexCalendar",YANDEX_DIRECT:"YandexDirect",YANDEX_DIRECTDYN:"YandexDirectDyn",YANDEX_DIRECTFETCHER:"YaDirectFetcher",YANDEX_FORDOMAIN:"YandexForDomain",YANDEX_PAGECHECKER:"YandexPagechecker",YANDEX_SEARCHSHOP:"YandexSearchShop",YANDEX_SITELINKS:"YandexSitelinks",YANDEX_USERPROXY:"YandexUserproxy",ZOOMINFO_BOT:"Zoombot"},InApp:{DISCORD:"Discord",EVERNOTE:"Evernote",FIGMA:"Figma",FLIPBOARD:"Flipboard",MATTERMOST:"Mattermost",TEAMS:"Teams",NOTION:"Notion",POSTMAN:"Postman",RAMBOX:"Rambox",ROCKETCHAT:"Rocket.Chat",SLACK:"Slack",TIKTOK_LITE:"TikTok Lite",VSCODE:"VS Code",YAHOO_JAPAN:"Yahoo! Japan"},Library:{ADOBE_AIR:"AdobeAIR",AIOHTTP:"aiohttp",APACHE_HTTPCLIENT:"Apache-HttpClient",AXIOS:"axios",GO_HTTP_CLIENT:"go-http-client",GOT:"got",GUZZLEHTTP:"GuzzleHttp",JAVA:"Java",JAVA_HTTPCLIENT:"Java-http-client",JSDOM:"jsdom",LIBWWW_PERL:"libwww-perl",LUA_RESTY_HTTP:"lua-resty-http",NEEDLE:"Needle",NUTCH:"Nutch",OKHTTP:"OkHttp",NODE_FETCH:"node-fetch",NODE_SUPERAGENT:"node-superagent",PHP_SOAP:"PHP-SOAP",POSTMAN_RUNTIME:"PostmanRuntime",PYTHON_HTTPX:"python-httpx",PYTHON_URLLIB:"python-urllib",PYTHON_URLLIB3:"python-urllib3",PYTHON_REQUESTS:"python-requests",SCRAPY:"Scrapy"}},DeviceVendor:{Vehicle:{BMW:"BMW",BYD:"BYD",JEEP:"Jeep",RIVIAN:"Rivian",TESLA:"Tesla",VOLVO:"Volvo"}}});var D="model",U="name",y="type",L="vendor",Y="version",ve="mobile",X="tablet",li="crawler",zs="cli",Mr="email",Ur="fetcher",$e="inapp",yt="mediaplayer",Ys="library",js=Object.freeze({browser:[[/(wget|curl|lynx|elinks|httpie)[\/ ]\(?([\w\.-]+)/i],[U,Y,[y,zs]]]}),Hr=Object.freeze({browser:[[/((?:adidx|ahrefs|amazon|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i,/(algolia crawler(?: renderscript)?)\/?([\w\.]*)/i,/(applebot(?:-extended)?)\/?([\w\.]*)/i,/(baiduspider[-imagevdonwsfcpr]{0,7})\/?([\w\.]*)/i,/(claude(?:bot|-searchbot|-web)|anthropic-ai)\/?([\w\.]*)/i,/(coccocbot-(?:image|web))\/([\w\.]+)/i,/(daum(?:oa)?(?:-image)?)[ \/]([\w\.]+)/i,/(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,/(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i,/(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i,/(oncrawl) mobile\/([\w\.]+)/i,/(qwantbot(?:-news)?)[-\w]*\/?([\w\.]*)/i,/((?:semrush|splitsignal)bot[-abcfimostw]*)\/?([\w\.-]*)/i,/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i,/(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i,/(yandex(?:(?:mobile)?(?:accessibility|additional|com|renderresources|screenshot|sprav)?bot(?!.+mirror)|image(?:s|resizer)|adnet|blogs|favicons|market|media|metrika|news|ontodb(?:api)?|partner|rca|tracker|turbo|verti(?:cal)?s|webmaster|video(?:parser)?))\/([\w\.]+)/i,/(yeti)\/([\w\.]+)/i,/((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cotoyogi|firecrawlagent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|twinagent|webzio-extended)\/?([\w\.]*)/i],[U,Y,[y,li]],[/(yandexbot\/([\w\.]+); mirrordetector)/i],[[U,/\/.+;/ig,""],Y,[y,li]],[/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,/\b((ai2|aspiegel|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i],[U,[y,li]]]}),ad=Object.freeze({device:[[/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[L,D,[y,X]],[/(u304aa)/i],[D,[L,"AT&T"],[y,ve]],[/\bsie-(\w*)/i],[D,[L,"Siemens"],[y,ve]],[/\b(rct\w+) b/i],[D,[L,"RCA"],[y,X]],[/\b(venue[\d ]{2,7}) b/i],[D,[L,"Dell"],[y,X]],[/\b(q(?:mv|ta)\w+) b/i],[D,[L,"Verizon"],[y,X]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[D,[L,"Barnes & Noble"],[y,X]],[/\b(tm\d{3}\w+) b/i],[D,[L,"NuVision"],[y,X]],[/\b(k88) b/i],[D,[L,"ZTE"],[y,X]],[/\b(nx\d{3}j) b/i],[D,[L,"ZTE"],[y,ve]],[/\b(gen\d{3}) b.+49h/i],[D,[L,"Swiss"],[y,ve]],[/\b(zur\d{3}) b/i],[D,[L,"Swiss"],[y,X]],[/^((zeki)?tb.*\b) b/i],[D,[L,"Zeki"],[y,X]],[/\b([yr]\d{2}) b/i,/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i],[D,[L,"Dragon Touch"],[y,X]],[/\b(ns-?\w{0,9}) b/i],[D,[L,"Insignia"],[y,X]],[/\b((nxa|next)-?\w{0,9}) b/i],[D,[L,"NextBook"],[y,X]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[L,"Voice"],D,[y,ve]],[/\b(lvtel\-)?(v1[12]) b/i],[[L,"LvTel"],D,[y,ve]],[/\b(ph-1) /i],[D,[L,"Essential"],[y,ve]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[D,[L,"Envizen"],[y,X]],[/\b(trio[-\w\. ]+) b/i],[D,[L,"MachSpeed"],[y,X]],[/\btu_(1491) b/i],[D,[L,"Rotor"],[y,X]]]}),ld=Object.freeze({browser:[[/((?:air|blue|daum|fox|poly|proton)mail|emclient|evolution|kmail2?|kontact|(?:microsoft |mac)?outlook(?:-express)?|navermailapp|(?!chrom.+)sparrow|sparkdesktop|thunderbird|yahoo|zohomail-desktop)(?:m.+ail; |[\/ ])([\w\.]+)/i,/(mail)\/([\w\.]+) cf/i],[U,Y,[y,Mr]],[/zdesktop\/([\w\.]+)/i],[Y,[U,"Zimbra"],[y,Mr]]]}),Fr=Object.freeze({browser:[[/(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:chatgpt|claude|mistralai|perplexity)-user|cohere-ai|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher)\/([\w\.]+)/i,/(bluesky) cardyb\/([\w\.]+)/i,/(skypeuripreview) preview\/([\w\.]+)/i,/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i,/(whatsapp)\/([\w\.]+)/i],[U,Y,[y,Ur]],[/((?:better uptime |keybase|telegram|vercel)bot|chrome-lighthouse|feedfetcher-google|gemini-deep-research|google(?:imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|yandex(?:sitelinks|userproxy))/i],[U,[y,Ur]]],os:[[/whatsapp\/[\d\.]+ (a|i)/i],[[U,t=>t=="A"?"Android":"iOS"]]]}),cd=Object.freeze({browser:[[/\b(discord|figma|mattermost|notion|postman|rambox|rocket.chat|slack|teams)\/([\w\.]+).+(electron\/|; ios)/i,/(flipboard)\/([\w\.]+)/i],[U,Y,[y,$e]],[/(evernote) win/i,/(teams)mobile-(ios|and)/i],[U,[y,$e]],[/chatlyio\/([\d\.]+)/i],[Y,[U,"Slack"],[y,$e]],[/ultralite app_version\/([\w\.]+)/i],[Y,[U,"TikTok Lite"],[y,$e]],[/\) code\/([\d\.]+).+electron\//i],[Y,[U,"VS Code"],[y,$e]],[/jp\.co\.yahoo\.(?:android\.yjtop|ipn\.appli)\/([\d\.]+)/i],[Y,[U,"Yahoo! Japan"],[y,$e]]]}),ud=Object.freeze({browser:[[/(apple(?:coremedia|tv))\/([\w\._]+)/i,/(coremedia) v([\w\._]+)/i,/(ares|clementine|music player daemon|nexplayer|ossproxy) ([\w\.-]+)/i,/^(aqualung|audacious|audimusicstream|amarok|bass|bsplayer|core|gnomemplayer|gvfs|irapp|lyssna|music on console|nero (?:home|scout)|nokia\d+|nsplayer|psp-internetradioplayer|quicktime|rma|radioapp|radioclientapplication|soundtap|stagefright|streamium|totem|videos|xbmc|xine|xmms)\/([\w\.-]+)/i,/(lg player|nexplayer) ([\d\.]+)/i,/player\/(nexplayer|lg player) ([\w\.-]+)/i,/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i,/(htc streaming player) [\w_]+ \/ ([\d\.]+)/i,/(lavf)([\d\.]+)/i,/(mplayer)(?: |\/)(?:(?:sherpya-){0,1}svn)(?:-| )(r\d+(?:-\d+[\w\.-]+))/i,/ (songbird)\/([\w\.-]+)/i,/(winamp)(?:3 version|mpeg| ) ([\w\.-]+)/i,/(vlc)(?:\/| media player - version )([\w\.-]+)/i,/^(foobar2000|itunes|smp)\/([\d\.]+)/i,/com\.(riseupradioalarm)\/([\d\.]*)/i,/(mplayer)(?:\s|\/| unknown-)([\w\.\-]+)/i,/(windows)\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ home media server/i],[U,Y,[y,yt]],[/(flrp)\/([\w\.-]+)/i],[[U,"Flip Player"],Y,[y,yt]],[/(fstream|media player classic|inlight radio|mplayer|nativehost|nero showtime|ocms-bot|queryseekspider|tapinradio|tunein radio|winamp|yourmuze)/i],[U,[y,yt]],[/(htc_one_s|windows-media-player|wmplayer)\/([\w\.-]+)/i],[[U,/[_-]/g," "],Y,[y,yt]],[/(rad.io|radio.(?:de|at|fr)) ([\d\.]+)/i],[[U,"rad.io"],Y,[y,yt]]]}),$s=Object.freeze({browser:[[/^(apache-httpclient|axios|(?:go|java)-http-client|got|guzzlehttp|java|libwww-perl|lua-resty-http|needle|node-(?:fetch|superagent)|okhttp|php-soap|postmanruntime|python-(?:httpx|urllib[23]?|requests)|scrapy)\/([\w\.]+)/i,/(adobeair|aiohttp|jsdom)\/([\w\.]+)/i,/(nutch)-([\w\.-]+)(\(|$)/i,/\((java)\/([\w\.]+)/i],[U,Y,[y,Ys]]]}),dd=Object.freeze({device:[[/aftlbt962e2/i],[[L,"BMW"]],[/dilink.+(byd) auto/i],[L],[/aftlft962x3/i],[[L,"Jeep"],[D,"Wagooner"]],[/(rivian) (r1t)/i],[L,D],[/vcc.+netfront/i],[[L,"Volvo"]]]}),Gr=Object.freeze({browser:[...js.browser,...Fr.browser,...Hr.browser,...$s.browser],os:[...Fr.os]});var w={ANDORRA:{ANDORRA:"Europe/Andorra"},AUSTRIA:{VIENNA:"Europe/Vienna"},BELGIUM:{BRUSSELS:"Europe/Brussels"},BULGARIA:{SOFIA:"Europe/Sofia"},CROATIA:{ZAGREB:"Europe/Zagreb"},CYPRUS:{NICOSIA_EUROPE:"Europe/Nicosia",NICOSIA_ASIA:"Asia/Nicosia",FAMAGUSTA:"Asia/Famagusta"},CZECHIA:{PRAGUE:"Europe/Prague"},DENMARK:{COPENHAGEN:"Europe/Copenhagen",FAROE:"Atlantic/Faroe"},ESTONIA:{TALLINN:"Europe/Tallinn"},FINLAND:{HELSINKI:"Europe/Helsinki",MARIEHAMN:"Europe/Mariehamn"},FRANCE:{PARIS:"Europe/Paris",CAYENNE:"America/Cayenne",GUADELOUPE:"America/Guadeloupe",MARIGOT:"America/Marigot",MARTINIQUE:"America/Martinique",MAYOTTE:"Indian/Mayotte",REUNION:"Indian/Reunion"},GERMANY:{BERLIN:"Europe/Berlin",BUSINGEN:"Europe/Busingen"},GREECE:{ATHENS:"Europe/Athens"},HUNGARY:{BUDAPEST:"Europe/Budapest"},ICELAND:{REYKJAVIK:"Atlantic/Reykjavik"},IRELAND:{DUBLIN:"Europe/Dublin"},ITALY:{ROME:"Europe/Rome"},LATVIA:{RIGA:"Europe/Riga"},LIECHTENSTEIN:{VADUZ:"Europe/Vaduz"},LITHUANIA:{VILNIUS:"Europe/Vilnius"},LUXEMBOURG:{LUXEMBOURG:"Europe/Luxembourg"},MALTA:{MALTA:"Europe/Malta"},MONACO:{MONACO:"Europe/Monaco"},NETHERLANDS:{AMSTERDAM:"Europe/Amsterdam",ARUBA:"America/Aruba",CURACAO:"America/Curacao",KRALENDIJK:"America/Kralendijk",LOWER_PRINCES:"America/Lower_Princes"},NORWAY:{OSLO:"Europe/Oslo",JAN_MAYEN:"Atlantic/Jan_Mayen",LONGYEARBYEN:"Arctic/Longyearbyen"},POLAND:{WARSAW:"Europe/Warsaw"},PORTUGAL:{LISBON:"Europe/Lisbon",AZORES:"Atlantic/Azores",MADEIRA:"Atlantic/Madeira"},ROMANIA:{BUCHAREST:"Europe/Bucharest"},SAN_MARINO:{SAN_MARINO:"Europe/San_Marino"},SLOVAKIA:{BRATISLAVA:"Europe/Bratislava"},SLOVENIA:{LJUBLJANA:"Europe/Ljubljana"},SPAIN:{MADRID:"Europe/Madrid",CANARY:"Atlantic/Canary",CEUTA:"Africa/Ceuta"},SWEDEN:{STOCKHOLM:"Europe/Stockholm"},SWITZERLAND:{ZURICH:"Europe/Zurich"},VATICAN:{VATICAN:"Europe/Vatican"}},Xs=[w.AUSTRIA.VIENNA,w.BELGIUM.BRUSSELS,w.BULGARIA.SOFIA,w.CROATIA.ZAGREB,w.CYPRUS.NICOSIA_EUROPE,w.CYPRUS.NICOSIA_ASIA,w.CYPRUS.FAMAGUSTA,w.CZECHIA.PRAGUE,w.DENMARK.COPENHAGEN,w.ESTONIA.TALLINN,w.FINLAND.HELSINKI,w.FINLAND.MARIEHAMN,w.FRANCE.PARIS,w.GERMANY.BERLIN,w.GREECE.ATHENS,w.HUNGARY.BUDAPEST,w.IRELAND.DUBLIN,w.ITALY.ROME,w.LATVIA.RIGA,w.LITHUANIA.VILNIUS,w.LUXEMBOURG.LUXEMBOURG,w.MALTA.MALTA,w.NETHERLANDS.AMSTERDAM,w.POLAND.WARSAW,w.PORTUGAL.LISBON,w.ROMANIA.BUCHAREST,w.SLOVAKIA.BRATISLAVA,w.SLOVENIA.LJUBLJANA,w.SPAIN.MADRID,w.SWEDEN.STOCKHOLM,w.FRANCE.CAYENNE,w.FRANCE.GUADELOUPE,w.FRANCE.MARIGOT,w.FRANCE.MARTINIQUE,w.FRANCE.MAYOTTE,w.FRANCE.REUNION,w.PORTUGAL.AZORES,w.PORTUGAL.MADEIRA,w.SPAIN.CANARY],Vr=[w.ICELAND.REYKJAVIK,w.LIECHTENSTEIN.VADUZ,w.NORWAY.OSLO,w.NORWAY.JAN_MAYEN],pd=[...Xs,...Vr],gd=[w.SWITZERLAND.ZURICH,...Vr],md=[w.AUSTRIA.VIENNA,w.BELGIUM.BRUSSELS,w.BULGARIA.SOFIA,w.CROATIA.ZAGREB,w.CZECHIA.PRAGUE,w.DENMARK.COPENHAGEN,w.ESTONIA.TALLINN,w.FINLAND.HELSINKI,w.FINLAND.MARIEHAMN,w.FRANCE.PARIS,w.GERMANY.BERLIN,w.GREECE.ATHENS,w.HUNGARY.BUDAPEST,w.ITALY.ROME,w.LATVIA.RIGA,w.LITHUANIA.VILNIUS,w.LUXEMBOURG.LUXEMBOURG,w.MALTA.MALTA,w.NETHERLANDS.AMSTERDAM,w.POLAND.WARSAW,w.PORTUGAL.LISBON,w.PORTUGAL.AZORES,w.PORTUGAL.MADEIRA,w.ROMANIA.BUCHAREST,w.SLOVAKIA.BRATISLAVA,w.SLOVENIA.LJUBLJANA,w.SPAIN.MADRID,w.SPAIN.CANARY,w.SWEDEN.STOCKHOLM,w.ANDORRA.ANDORRA,w.GERMANY.BUSINGEN,w.ICELAND.REYKJAVIK,w.LIECHTENSTEIN.VADUZ,w.MONACO.MONACO,w.NORWAY.OSLO,w.SAN_MARINO.SAN_MARINO,w.SPAIN.CEUTA,w.SWITZERLAND.ZURICH,w.VATICAN.VATICAN];function ci(){var t;return typeof window!="undefined"&&((window==null?void 0:window.matchMedia("(display-mode: standalone)").matches)||((t=window.navigator)===null||t===void 0?void 0:t.standalone)||document.referrer.startsWith("android-app://")||(window==null?void 0:window.Windows)||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var{Crawler:yd}=Br.BrowserName,ui=(t,e,n)=>typeof t=="string"?ee(t,e,n):t;var Kr=t=>{let e=ui(t);if(e.os.is(kr.MACOS)){if(e.cpu.is(xr.ARM))return!0;if(typeof t!="string"&&typeof window!="undefined")try{let n=document.createElement("canvas"),i=n.getContext("webgl2")||n.getContext("webgl")||n.getContext("experimental-webgl"),r=i.getExtension("WEBGL_debug_renderer_info");if(i.getParameter(r.UNMASKED_RENDERER_WEBGL).match(/apple m\d/i))return!0}catch(n){return!1}}return!1};var Wr=t=>[Rt.CLI,Rt.CRAWLER,Rt.FETCHER,Rt.LIBRARY].includes(ui(t,Gr).browser.type),zr=t=>ui(t).engine.is(Dr.BLINK);function qs(){return{width:window.screen.width,height:window.screen.height}}function Js(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return console.error("Failed to get timezone:",t),"UTC"}}function Yr(){try{return navigator.language||"en-US"}catch(t){return console.error("Failed to get browser locale:",t),"en-US"}}function jr(){if(typeof window=="undefined")return{userAgent:{name:"",browser:{major:"",name:"",version:""},os:{name:"",version:""},device:void 0,engine:{name:"",version:""},cpu:{architecture:""}},screenResolution:{width:0,height:0},timeZone:"UTC",flags:{isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}};let e=new ee().getResult(),n;try{n={isBot:Wr(e),isChromeFamily:zr(e),isStandalonePWA:ci(),isAppleSilicon:Kr(e)}}catch(i){console.error("Failed to compute device flags:",i),n={isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}}return{userAgent:{name:e.ua,browser:{major:e.browser.major||"",name:e.browser.name||"",version:e.browser.version||"",type:e.browser.type},os:{name:e.os.name||"",version:e.os.version||""},device:e.device.model||e.device.type||e.device.vendor?{model:e.device.model,type:e.device.type,vendor:e.device.vendor}:void 0,engine:{name:e.engine.name||"",version:e.engine.version||""},cpu:{architecture:e.cpu.architecture||""}},screenResolution:qs(),timeZone:Js(),flags:n}}function $r(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search);return{locale:t.get("locale")||void 0,currency:t.get("currency")||void 0,utmSource:t.get("utm_source")||void 0,utmMedium:t.get("utm_medium")||void 0,utmCampaign:t.get("utm_campaign")||void 0}}var dn=class{constructor(){this.listeners=new Map}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>this.off(e,n)}off(e,n){this.listeners.has(e)&&this.listeners.get(e).delete(n)}async emit(e,n){if(this.listeners.has(e)){let i=Array.from(this.listeners.get(e));await Promise.all(i.map(r=>{try{return Promise.resolve(r(n))}catch(s){return console.error('[EventBus] Error in listener for event "'.concat(e,'":'),s),Promise.resolve()}}))}}clear(){this.listeners.clear()}};function fn(t){try{let e=t.split(".");if(e.length!==3)return console.error("Invalid JWT token format"),null;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),r=atob(i),s=JSON.parse(r);return s.exp&&Date.now()>=s.exp*1e3?(console.warn("JWT token is expired"),null):{sessionId:s.sessionId,storeId:s.storeId,accountId:s.accountId,customerId:s.customerId,role:s.role,isValid:!0,isLoading:!1}}catch(e){return console.error("Failed to decode JWT token:",e),null}}function Xr(t){try{let e=t.split(".");if(e.length!==3)return!0;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),r=atob(i),s=JSON.parse(r);return s.exp?Date.now()>=s.exp*1e3:!1}catch(e){return console.error("Failed to check token expiration:",e),!0}}var Xe={},Zs=["","VITE_","REACT_APP_","NEXT_PUBLIC_"];function me(t,e=Zs){var n,i,r;for(let s of e){let o=s?"".concat(s).concat(t):t;if(typeof process!="undefined"&&((n=process==null?void 0:process.env)!=null&&n[o]))return console.log("process.env[".concat(o,"]"),process.env[o]),process.env[o];if(typeof Xe!="undefined"&&((i=Xe==null?void 0:Xe.env)!=null&&i[o]))return console.log("import.meta.env[".concat(o,"]"),Xe.env[o]),Xe.env[o];if(typeof window!="undefined"&&((r=window==null?void 0:window.__TAGADA_ENV__)!=null&&r[o]))return console.log("window.__TAGADA_ENV__[".concat(o,"]"),window.__TAGADA_ENV__[o]),window.__TAGADA_ENV__[o]}}var Qs=async(t="default")=>{try{if((me("TAGADA_ENV")||me("TAGADA_ENVIRONMENT"))==="production"||!Qe(!0))return null;let n=await fetch("/.local.json");if(!n.ok)return null;let i=await n.json(),r={},s=!1;try{let a=await fetch("/config/".concat(t,".tgd.json"));a.ok||(a=await fetch("/config/".concat(t,".json"))),a.ok&&(r=await a.json(),s=!0)}catch(a){}if(!s&&t!=="default"){console.warn("\u26A0\uFE0F Config variant '".concat(t,"' not found, falling back to 'default'"));try{let a=await fetch("/config/default.tgd.json");a.ok||(a=await fetch("/config/default.json")),a.ok&&(r=await a.json(),s=!0,console.log("\u2705 Fallback to 'default' config successful"))}catch(a){}}s||console.warn(t==="default"?"\u26A0\uFE0F No 'default' config found. Create /config/default.tgd.json":"\u26A0\uFE0F Neither '".concat(t,"' nor 'default' config found. Create /config/default.tgd.json"));let o={storeId:i.storeId,accountId:i.accountId,basePath:i.basePath,config:r};return console.log("\u{1F6E0}\uFE0F Using local development plugin config:",o),o}catch(e){return null}},ea=async()=>{try{if((me("TAGADA_ENV")||me("TAGADA_ENVIRONMENT"))==="production"||!Qe(!0))return null;console.log("\u{1F6E0}\uFE0F [V2] Attempting to load /config/resources.static.json...");let e=await fetch("/config/resources.static.json");if(!e.ok)return console.log("\u{1F6E0}\uFE0F [V2] resources.static.json not found or failed to load"),null;let n=await e.json();return console.log("\u{1F6E0}\uFE0F [V2] \u2705 Loaded local static resources:",n),n}catch(t){return console.error("\u{1F6E0}\uFE0F [V2] \u274C Error loading static resources:",t),null}},pn=t=>{let e=document.querySelector('meta[name="'.concat(t,'"]'));return(e==null?void 0:e.getAttribute("content"))||void 0},ta=async()=>{try{if(typeof document=="undefined")return null;let t=pn("x-plugin-store-id"),e=pn("x-plugin-account-id");if(!t)return null;let n=pn("x-plugin-base-path")||"/",i={};try{let s=pn("x-plugin-config");if(s){let o=decodeURIComponent(s);i=JSON.parse(o)}}catch(s){console.warn("\u26A0\uFE0F Failed to parse plugin config from meta tag:",s)}e||console.warn("\u26A0\uFE0F Plugin config: Account ID not found in meta tags");let r={storeId:t,accountId:e,basePath:n,config:i};return console.log("\u{1F680} [HIGHEST PRIORITY] Plugin config loaded from meta tags (runtime injected config):",{storeId:t,accountId:e,basePath:n,configKeys:Object.keys(i),configSize:JSON.stringify(i).length}),r}catch(t){return console.warn("\u26A0\uFE0F Error loading production config from meta tags:",t),null}},qr=async(t="default",e)=>{var o,a;console.log("\u{1F527} [V2] loadPluginConfig called with variant:",t);let n=await ea(),i=await ta();if(i){let c=z(R({},i),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using INJECTED config from meta tags (HIGHEST PRIORITY)"),c}if(e){let c={storeId:e.storeId,accountId:e.accountId,basePath:(o=e.basePath)!=null?o:"/",config:(a=e.config)!=null?a:{},staticResources:n!=null?n:void 0};return console.log("\u2705 [V2] Using raw config parameter (PRIORITY 2)"),c}let r=await ia();if(r){let c=z(R({},r),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using environment variables config (PRIORITY 3 - build time)"),c}let s=await Qs(t);if(s){let c=z(R({},s),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using local dev config files (PRIORITY 4)"),c}return console.warn("\u26A0\uFE0F [V2] No plugin config found - using defaults"),{basePath:"/",config:{},staticResources:n!=null?n:void 0}};async function na(t="default",e){try{if(!Qe())return null;if(e)return e;let n=["/config/".concat(t,".config.json"),"/config/".concat(t,".tgd.json"),"/config/".concat(t,".json")];for(let i of n)try{let r=await fetch(i);if(r.ok)return await r.json()}catch(r){continue}return console.warn("\u26A0\uFE0F [loadLocalConfig] No config found for '".concat(t,"'")),null}catch(n){return console.error("[loadLocalConfig] Error loading config:",n),null}}async function ia(){try{if(!Qe())return;let t=me("TAGADA_STORE_ID"),e=me("TAGADA_ACCOUNT_ID"),n=me("TAGADA_BASE_PATH"),i=me("TAGADA_CONFIG_NAME");if(!t||!e)return;let r=await na(i);if(!r)return;let s={storeId:t,accountId:e,basePath:n||"/",config:r};return console.log("\u{1F6E0}\uFE0F [createRawPluginConfig] Using environment variables (build-time config):",{hasStoreId:!!s.storeId,hasAccountId:!!s.accountId,basePath:s.basePath,hasConfig:!!s.config}),s}catch(t){console.error("[createRawPluginConfig] Error creating config:",t);return}}var di=new Map,fi=new Set;function ra(){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get("authCode")}async function Jr(t,e,n,i=!1){if(fi.has(t))throw i&&console.log("[AuthHandoff] Code already resolved, skipping duplicate request"),new Error("Auth code already resolved");let r=di.get(t);if(r)return i&&console.log("[AuthHandoff] Resolution already in progress, waiting for existing request"),r;i&&console.log("[AuthHandoff] Resolving authCode:",t.substring(0,15)+"...");let s=(async()=>{try{let o=await fetch("".concat(n,"/api/v1/cms/auth/resolve-handoff"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,storeId:e})});if(!o.ok){let c=await o.json().catch(()=>({message:"Unknown error"}));throw new Error(c.message||"Failed to resolve auth handoff: ".concat(o.status))}let a=await o.json();return i&&console.log("[AuthHandoff] \u2705 Resolved successfully:",{customerId:a.customer.id,role:a.customer.role,hasContext:Object.keys(a.context).length>0}),i&&console.log("[AuthHandoff] Storing new token (overriding existing)"),fe(a.token),oa(i),fi.add(t),a}catch(o){throw console.error("[AuthHandoff] \u274C Failed to resolve:",o),o}finally{di.delete(t)}})();return di.set(t,s),s}function oa(t=!1){if(typeof window=="undefined")return;let e=new URL(window.location.href);e.searchParams.has("authCode")&&(e.searchParams.delete("authCode"),window.history.replaceState({},"",e.pathname+e.search+e.hash),t&&console.log("[AuthHandoff] Cleaned authCode from URL"))}function Zr(){let t=ra();return!(!t||!t.startsWith("ah_")||fi.has(t))}var gn=class{constructor(e={}){this.bus=new dn;this.eventDispatcher=new xe;this.tokenPromise=null;this.tokenResolver=null;this.isInitializingSession=!1;this.lastSessionInitError=null;this.sessionInitRetryCount=0;this.MAX_SESSION_INIT_RETRIES=3;var a,c,u,d;this.config=e,this.instanceId=Math.random().toString(36).substr(2,9),this.boundHandleStorageChange=this.handleStorageChange.bind(this),this.boundHandlePageshow=f=>{if(f.persisted)if(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Page restored from BFcache (back button), re-initializing funnel...")),this.funnel&&this.state.session&&this.state.store){this.funnel.resetInitialization();let S=this.getAccountId(),m=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.funnel.autoInitialize({customerId:this.state.session.customerId,sessionId:this.state.session.sessionId},{id:this.state.store.id,accountId:S},m).catch(T=>{console.error("[TagadaClient] Funnel re-initialization failed:",T)})}else this.sessionInitRetryCount=0,this.initialize()},console.log("[TagadaClient ".concat(this.instanceId,"] Initializing...")),console.log("[TagadaClient ".concat(this.instanceId,"] Config:"),{debugMode:e.debugMode,hasRawPluginConfig:!!e.rawPluginConfig,rawPluginConfig:e.rawPluginConfig,features:e.features}),vi(this.config.debugMode)&&this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Preview mode active - state cleared"));let i=this.resolveEnvironment(),r=Oi(i);e.customApiConfig&&(r=z(R(R({},r),e.customApiConfig),{apiConfig:R(R({},r.apiConfig),e.customApiConfig.apiConfig)}),this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Applied custom API config:"),r.apiConfig.baseUrl)),this.state={auth:{isAuthenticated:!1,isLoading:!1,customer:null,session:null},session:null,customer:null,locale:{locale:"en-US",language:"en",region:"US",messages:{}},currency:{code:"USD",symbol:"$",name:"US Dollar"},store:null,environment:r,isLoading:!0,isInitialized:!1,isSessionInitialized:!1,pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!0,debugMode:(a=e.debugMode)!=null?a:i!=="production",token:null},console.log("[TagadaClient ".concat(this.instanceId,"] Initial state:"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!e.rawPluginConfig}),this.apiClient=new mt({baseURL:r.apiConfig.baseUrl});let s=(c=e.features)==null?void 0:c.funnel;if(s!==!1){let f=typeof s=="object"?s:{};this.funnel=new Ut({apiClient:this.apiClient,debugMode:this.state.debugMode,pluginConfig:this.state.pluginConfig,environment:this.state.environment,autoRedirect:f.autoRedirect,funnelId:(u=e.rawPluginConfig)==null?void 0:u.funnelId,stepId:(d=e.rawPluginConfig)==null?void 0:d.stepId})}this.apiClient.setTokenProvider(this.waitForToken.bind(this)),typeof window!="undefined"&&(window.addEventListener("storage",this.boundHandleStorageChange),window.addEventListener("pageshow",this.boundHandlePageshow)),this.setupConfigHotReload(),this.initialize()}destroy(){typeof window!="undefined"&&(window.removeEventListener("storage",this.boundHandleStorageChange),window.removeEventListener("pageshow",this.boundHandlePageshow)),this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Destroyed")),this.eventDispatcher.clear(),this.bus.clear()}handleStorageChange(){if(et()===this.state.token){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Token unchanged (ignoring event)"));return}if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping storage change"));return}if(this.sessionInitRetryCount>=this.MAX_SESSION_INIT_RETRIES&&this.lastSessionInitError){this.state.debugMode&&console.error("[TagadaClient ".concat(this.instanceId,"] Max session init retries reached, giving up"),this.lastSessionInitError);return}this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Storage changed, re-initializing token...")),this.initializeToken()}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}updateState(e){this.state=R(R({},this.state),e),this.eventDispatcher.notify(this.state)}resolveEnvironment(){return this.config.environment?this.config.environment:Ze()}async initialize(){try{await this.initializePluginConfig(),this.state.pluginConfig.storeId?await this.initializeToken():(console.warn("[TagadaClient] No store ID found in plugin config. Skipping token initialization."),this.updateState({isLoading:!1,isInitialized:!0}))}catch(e){console.error("[TagadaClient] Initialization failed:",e),this.updateState({isLoading:!1,isInitialized:!0})}}async initializePluginConfig(){if(console.log("[TagadaClient ".concat(this.instanceId,"] initializePluginConfig called"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!this.config.rawPluginConfig}),!this.state.pluginConfigLoading){console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config already loading or loaded, skipping..."));return}try{let e=this.config.localConfig||"default";console.log("[TagadaClient ".concat(this.instanceId,"] Loading plugin config with variant: ").concat(e));let n=await qr(e,this.config.rawPluginConfig);console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config loaded:"),n),this.updateState({pluginConfig:n,pluginConfigLoading:!1}),this.funnel&&this.funnel.setConfig({pluginConfig:n,environment:this.state.environment})}catch(e){console.error("[TagadaClient] Failed to load plugin config:",e),this.updateState({pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!1})}}async initializeToken(){var e;if(Zr()){let n=this.state.pluginConfig.storeId;if(!n)return console.error("[TagadaClient] Cannot resolve authCode: storeId not found in config"),this.fallbackToNormalFlow();console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F510} Cross-domain auth detected, resolving..."));try{let i=new URLSearchParams(window.location.search).get("authCode");if(!i)return this.fallbackToNormalFlow();let r=await Jr(i,n,this.state.environment.apiConfig.baseUrl,this.state.debugMode);console.log("[TagadaClient ".concat(this.instanceId,"] \u2705 Auth handoff resolved:"),{customerId:r.customer.id,role:r.customer.role,hasContext:Object.keys(r.context).length>0}),this.setToken(r.token);let s=fn(r.token);s?(this.updateState({session:s}),await this.initializeSession(s),(e=r.context)!=null&&e.funnelSessionId&&this.funnel&&this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Restoring funnel session from handoff context:"),r.context.funnelSessionId)):(console.error("[TagadaClient] Failed to decode token from handoff"),this.updateState({isInitialized:!0,isLoading:!1}));return}catch(i){console.error("[TagadaClient ".concat(this.instanceId,"] \u274C Auth handoff failed, falling back to normal flow:"),i)}}await this.fallbackToNormalFlow()}async fallbackToNormalFlow(){let e=et(),i=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("token");console.log("[TagadaClient ".concat(this.instanceId,"] Initializing token (normal flow)..."),{hasExistingToken:!!e,hasQueryToken:!!i,storeId:this.state.pluginConfig.storeId});let r=null,s=!1;if(i?(r=i,s=!0):e&&!Xr(e)&&(r=e),r){this.setToken(r),s&&(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Persisting query token to storage...")),fe(r));let o=fn(r);o?(this.updateState({session:o}),await this.initializeSession(o)):(console.error("[TagadaClient] Failed to decode token"),this.updateState({isInitialized:!0,isLoading:!1}))}else{let o=this.state.pluginConfig.storeId;console.log("[TagadaClient ".concat(this.instanceId,"] No existing token, creating anonymous token..."),{hasStoreId:!!o,storeId:o}),o?await this.createAnonymousToken(o):(console.warn("[TagadaClient ".concat(this.instanceId,"] No storeId in plugin config, skipping anonymous token creation")),this.updateState({isInitialized:!0,isLoading:!1}))}}setToken(e){this.apiClient.updateToken(e),this.updateState({token:e}),this.tokenResolver&&(this.tokenResolver(e),this.tokenPromise=null,this.tokenResolver=null)}waitForToken(){return this.apiClient.getCurrentToken()?Promise.resolve(this.apiClient.getCurrentToken()):(this.tokenPromise||(this.tokenPromise=new Promise(e=>{this.tokenResolver=e})),this.tokenPromise)}async createAnonymousToken(e){if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping anonymous token creation"));return}try{let n=bn();this.state.debugMode&&console.log("[TagadaClient] Creating anonymous token for store:",e,{draft:n});let i=await this.apiClient.post("/api/v1/cms/session/anonymous",{storeId:e,role:"anonymous",draft:n},{skipAuth:!0});this.setToken(i.token),fe(i.token);let r=fn(i.token);r&&(this.updateState({session:r}),await this.initializeSession(r)),this.updateState({isSessionInitialized:!0})}catch(n){console.error("[TagadaClient] Failed to create anonymous token:",n),this.updateState({isInitialized:!0,isLoading:!1})}}async initializeSession(e){var n,i,r,s,o,a,c,u,d,f,S;if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization already in progress, skipping"));return}this.isInitializingSession=!0;try{this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Initializing session..."),{sessionId:e.sessionId});let I=jr(),m=$r(),T=Yr(),b=bn(),v=new URLSearchParams(window.location.search).get("draft");v!==null&&wn(v==="true");let k={storeId:e.storeId,accountId:e.accountId,customerId:e.customerId,role:e.role,browserLocale:T,queryLocale:m.locale,queryCurrency:m.currency,utmSource:m.utmSource,utmMedium:m.utmMedium,utmCampaign:m.utmCampaign,browser:I.userAgent.browser.name,browserVersion:I.userAgent.browser.version,os:I.userAgent.os.name,osVersion:I.userAgent.os.version,deviceType:(n=I.userAgent.device)==null?void 0:n.type,deviceModel:(i=I.userAgent.device)==null?void 0:i.model,deviceVendor:(r=I.userAgent.device)==null?void 0:r.vendor,userAgent:I.userAgent.name,engineName:I.userAgent.engine.name,engineVersion:I.userAgent.engine.version,cpuArchitecture:I.userAgent.cpu.architecture,isBot:(o=(s=I.flags)==null?void 0:s.isBot)!=null?o:!1,isChromeFamily:(c=(a=I.flags)==null?void 0:a.isChromeFamily)!=null?c:!1,isStandalonePWA:(d=(u=I.flags)==null?void 0:u.isStandalonePWA)!=null?d:!1,isAppleSilicon:(S=(f=I.flags)==null?void 0:f.isAppleSilicon)!=null?S:!1,screenWidth:I.screenResolution.width,screenHeight:I.screenResolution.height,timeZone:I.timeZone,draft:b,fetchMessages:!1},_=await this.apiClient.post("/api/v1/cms/session/v2/init",k);this.lastSessionInitError=null,this.sessionInitRetryCount=0,this.updateSessionState(_,e),this.updateState({isInitialized:!0,isSessionInitialized:!0,isLoading:!1}),this.state.debugMode&&console.log("[TagadaClient] Session initialized successfully")}catch(I){this.lastSessionInitError=I,this.sessionInitRetryCount++,console.error("[TagadaClient] Error initializing session (attempt ".concat(this.sessionInitRetryCount,"/").concat(this.MAX_SESSION_INIT_RETRIES,"):"),I),this.updateState({isInitialized:!0,isLoading:!1})}finally{this.isInitializingSession=!1}}updateSessionState(e,n){var r,s,o,a,c,u,d,f,S;if(e.store){let I=e.store,m=z(R({},e.store),{accountId:I.accountId||((r=this.state.pluginConfig)==null?void 0:r.accountId)||n.accountId||"",presentmentCurrencies:I.presentmentCurrencies||[e.store.currency||"USD"],chargeCurrencies:I.chargeCurrencies||[e.store.currency||"USD"]});this.updateState({store:m})}if(e.locale){let I={locale:e.locale,language:e.locale.split("-")[0],region:(s=e.locale.split("-")[1])!=null?s:"US",messages:(o=e.messages)!=null?o:{}};this.updateState({locale:I})}if(e.store){let I={code:e.store.currency,symbol:this.getCurrencySymbol(e.store.currency),name:this.getCurrencyName(e.store.currency)};this.updateState({currency:I})}let i={isAuthenticated:(c=(a=e.customer)==null?void 0:a.isAuthenticated)!=null?c:!1,isLoading:!1,customer:(u=e.customer)!=null?u:null,session:n};if(this.updateState({customer:(d=e.customer)!=null?d:null,auth:i}),this.funnel&&n.customerId&&((f=e.store)!=null&&f.id)){let I=e.store.accountId||((S=this.state.pluginConfig)==null?void 0:S.accountId)||n.accountId||"";if(I){let T=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.state.debugMode&&console.log("[TagadaClient] Auto-initializing funnel...",{customerId:n.customerId,storeId:e.store.id,accountId:I,funnelId:T||"auto-detect"}),this.funnel.autoInitialize({customerId:n.customerId,sessionId:n.sessionId},{id:e.store.id,accountId:I},T).catch(b=>{console.error("[TagadaClient] Funnel auto-initialization failed:",b)})}else console.warn("[TagadaClient] Cannot auto-initialize funnel: accountId is missing")}}getCurrencySymbol(e){return{USD:"$",EUR:"\u20AC",GBP:"\xA3",JPY:"\xA5",CAD:"C$",AUD:"A$"}[e]||e}getCurrencyName(e){return{USD:"US Dollar",EUR:"Euro",GBP:"British Pound",JPY:"Japanese Yen",CAD:"Canadian Dollar",AUD:"Australian Dollar"}[e]||e}getAccountId(){var e,n,i;return((e=this.state.store)==null?void 0:e.accountId)||((n=this.state.pluginConfig)==null?void 0:n.accountId)||((i=this.state.session)==null?void 0:i.accountId)||""}updatePluginConfig(e){this.state.debugMode&&console.log("[TagadaClient] Hot-reloading config:",e);let n=R(R({},this.state.pluginConfig.config),e);this.updateState({pluginConfig:z(R({},this.state.pluginConfig),{config:n})}),this.bus.emit("CONFIG_UPDATED",n),this.state.debugMode&&console.log("[TagadaClient] Config updated successfully")}setupConfigHotReload(){if(typeof window=="undefined")return;let e=n=>{var i,r;if(((i=n.data)==null?void 0:i.type)==="TAGADAPAY_CONFIG_UPDATE"){let{config:s}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received config update from parent:",s),this.updatePluginConfig(s)}else if(((r=n.data)==null?void 0:r.type)==="APPLY_STYLES_TO_ELEMENT"){let{elementId:s,styles:o}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received style application request:",{elementId:s,styles:o}),this.applyStylesToElement(s,o)}};window.addEventListener("message",e),this.state.debugMode&&console.log("[TagadaClient] Config hot-reload and style manipulation listeners enabled")}applyStylesToElement(e,n){if(typeof document=="undefined")return;let i="tagada-editor-highlight",r=document.getElementById(i);r&&r.remove();let s=f=>{var _;let I=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(f.tagName.toLowerCase()),m=f;if(I){let N=f.parentElement;if((N==null?void 0:N.getAttribute("data-tagada-highlight-wrapper"))==="true"&&N instanceof HTMLElement)m=N;else{let x=document.createElement("div");x.setAttribute("data-tagada-highlight-wrapper","true");let W=window.getComputedStyle(f),oe=W.display;if(oe==="inline"?x.style.display="inline-block":x.style.display=oe,x.style.position="relative",oe==="inline"||oe.includes("inline")){let te=W.verticalAlign;te&&te!=="baseline"&&(x.style.verticalAlign=te)}["width","height","minWidth","minHeight","maxWidth","maxHeight","flex","flexGrow","flexShrink","flexBasis","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","alignSelf","justifySelf","boxSizing","gap","rowGap","columnGap","order","aspectRatio"].forEach(te=>{let Ae=te.replace(/([A-Z])/g,"-$1").toLowerCase(),j=W.getPropertyValue(Ae);j&&j.trim()!==""&&(te==="flex"&&j!=="none"&&j!=="0 1 auto"?x.style.flex=j:te==="boxSizing"?x.style.boxSizing=j:x.style.setProperty(Ae,j))}),f.style&&["width","height","min-width","min-height","max-width","max-height","flex","flex-grow","flex-shrink","flex-basis","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","grid-area","align-self","justify-self","box-sizing","gap","row-gap","column-gap","order","aspect-ratio"].forEach(Ae=>{let j=f.style.getPropertyValue(Ae);j&&x.style.setProperty(Ae,j)}),(_=f.parentNode)==null||_.insertBefore(x,f),x.appendChild(f),m=x}}let T=getComputedStyle(I?f:m);(m.style.position==="static"||!m.style.position)&&(m.style.position="relative");let b=document.createElement("div");b.id=i,b.style.position="absolute",b.style.inset="0",b.style.pointerEvents="none",b.style.zIndex="9999",b.style.boxSizing="border-box",b.style.background="none",b.style.border="none",b.style.outline="none",b.style.margin="0",b.style.padding="0";let v=T.borderRadius;v&&(b.style.borderRadius=v),m.appendChild(b);let k=n||{boxShadow:"0 0 0 2px rgb(239 68 68)"};if(Object.entries(k).forEach(([N,K])=>{let x=N.includes("-")?N.replace(/-([a-z])/g,(W,oe)=>oe.toUpperCase()):N;N.includes("-")?b.style.setProperty(N,K):b.style[x]=K}),f.scrollIntoView({behavior:"smooth",block:"center"}),this.state.debugMode){let N=Object.entries(k).map(([K,x])=>"".concat(K,": ").concat(x)).join("; ");console.log("[TagadaClient] Applied styles to highlight div of element #".concat(e,":"),N)}},o=5,a=1e3,c=0,u=f=>{let S=window.getComputedStyle(f);return S.display==="none"||S.visibility==="hidden"||S.opacity==="0"||f.hidden||f.offsetWidth===0||f.offsetHeight===0},d=()=>{let f=document.querySelectorAll('[editor-id~="'.concat(e,'"]'));if(f.length===0){if(c+=1,c>=o){this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found after ').concat(o," attempts"));return}this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found (attempt ').concat(c,"/").concat(o,"), retrying in ").concat(a/1e3,"s")),setTimeout(d,a);return}let S=null;if(f.length===1)S=f[0];else{for(let I=0;I<f.length;I++)if(!u(f[I])){S=f[I];break}S||(S=f[0])}S&&s(S)};d()}};function Qr(t={}){return new gn(t)}function eo(t){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get(t)}function he(t,...e){t&&console.log("[TagadaTracker]",...e)}var Nt=class{constructor(){this.config=null;this.client=null;this.initialized=!1;this.initializing=!1}async init(e){var n,i,r,s;if(this.initialized||this.initializing)return he(e.debug||!1,"Already initialized or initializing"),this.getSession();this.initializing=!0,this.config=R({debug:!1},e),he(this.config.debug,"\u{1F680} Initializing external tracker with SDK...",e);try{let o=eo("token");o&&(fe(o),he(this.config.debug,"\u{1F511} Bootstrapped token from URL")),this.client=Qr({debugMode:this.config.debug,features:{funnel:!0}}),await this.waitForClientReady();let a=await this.initializeFunnel();he(this.config.debug,"\u2705 Session initialized (tracking handled by orchestrator):",a),this.initialized=!0;let c=this.getSession();return c&&((i=(n=this.config).onReady)==null||i.call(n,c)),c}catch(o){let a=o instanceof Error?o:new Error(String(o));throw he(this.config.debug,"\u274C Initialization failed:",a),(s=(r=this.config).onError)==null||s.call(r,a),a}finally{this.initializing=!1}}getSession(){var n,i;if(!((i=(n=this.client)==null?void 0:n.funnel)!=null&&i.state.context))return null;let e=this.client.funnel.state.context;return{sessionId:e.sessionId,customerId:e.customerId,storeId:e.storeId,funnelId:e.funnelId,currentStepId:e.currentStepId,cmsToken:this.client.state.token||void 0}}isReady(){var e,n;return this.initialized&&!!((n=(e=this.client)==null?void 0:e.funnel)!=null&&n.state.context)}async navigate(e){if(!this.isReady())throw new Error("Tracker not initialized. Call init() first.");he(this.config.debug,"\u{1F680} Navigating:",e);try{let n=await this.client.funnel.navigate({type:e.eventType,data:e.eventData||{}});return n!=null&&n.url?(he(this.config.debug,"\u2705 Navigation result:",n.url),typeof window!="undefined"&&(window.location.href=e.returnUrl||n.url),{url:n.url}):null}catch(n){throw he(this.config.debug,"\u274C Navigation failed:",n),n}}getCustomerId(){var e,n,i,r,s;return((n=(e=this.client)==null?void 0:e.state.auth.customer)==null?void 0:n.id)||((s=(r=(i=this.client)==null?void 0:i.funnel)==null?void 0:r.state.context)==null?void 0:s.customerId)||null}getFunnelSessionId(){var e,n,i;return((i=(n=(e=this.client)==null?void 0:e.funnel)==null?void 0:n.state.context)==null?void 0:i.sessionId)||null}buildUrl(e,n){let i=this.getSession();if(!i)return e;let r=new URL(e,typeof window!="undefined"?window.location.origin:void 0);return r.searchParams.set("funnelSessionId",i.sessionId),i.cmsToken&&r.searchParams.set("token",i.cmsToken),i.funnelId&&r.searchParams.set("funnelId",i.funnelId),r.searchParams.set("storeId",i.storeId),n&&Object.entries(n).forEach(([s,o])=>{r.searchParams.set(s,o)}),r.toString()}getClient(){return this.client}async waitForClientReady(){if(this.client)return new Promise(e=>{let n=0,i=()=>{var r,s;(r=this.client)!=null&&r.state.isInitialized||(s=this.client)!=null&&s.state.token||n>40?e():(n++,setTimeout(i,50))};i()})}async initializeFunnel(){var r,s,o;if(!((r=this.client)!=null&&r.funnel))return null;let e={customerId:((s=this.client.state.auth.customer)==null?void 0:s.id)||"anon_placeholder",sessionId:((o=this.client.state.auth.session)==null?void 0:o.sessionId)||"sess_placeholder"},n={id:this.config.storeId,accountId:this.config.accountId||""},i=this.config.stepId;if(!i)throw new Error("stepId is required for external page tracking (URL mapping does not work for external pages)");return he(this.config.debug,"\u{1F50D} Initializing external page at step:",i),this.client.funnel.initialize(e,n,this.config.funnelId||eo("funnelId")||void 0,i)}},pi=new Nt;typeof window!="undefined"&&(window.TagadaTracker=pi);return co(sa);})();
|
|
6
|
+
"use strict";var TagadaTrackerBundle=(()=>{var Ut=Object.defineProperty,yr=Object.defineProperties,Or=Object.getOwnPropertyDescriptor,Rr=Object.getOwnPropertyDescriptors,vr=Object.getOwnPropertyNames,_i=Object.getOwnPropertySymbols;var Di=Object.prototype.hasOwnProperty,Nr=Object.prototype.propertyIsEnumerable;var De=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t),Pr=t=>{throw TypeError(t)};var ki=(t,e,n)=>e in t?Ut(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,O=(t,e)=>{for(var n in e||(e={}))Di.call(e,n)&&ki(t,n,e[n]);if(_i)for(var n of _i(e))Nr.call(e,n)&&ki(t,n,e[n]);return t},z=(t,e)=>yr(t,Rr(e));var Ie=(t,e)=>()=>(t&&(e=t(t=0)),e);var Cn=(t,e)=>{for(var n in e)Ut(t,n,{get:e[n],enumerable:!0})},xr=(t,e,n,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of vr(e))!Di.call(t,o)&&o!==n&&Ut(t,o,{get:()=>e[o],enumerable:!(i=Or(e,o))||i.enumerable});return t};var Lr=t=>xr(Ut({},"__esModule",{value:!0}),t);var ve=function(t,e){this[0]=t,this[1]=e},yn=(t,e,n)=>{var i=(s,a,l,u)=>{try{var d=n[s](a),p=(a=d.value)instanceof ve,T=d.done;Promise.resolve(p?a[0]:a).then(b=>p?i(s==="return"?s:"next",a[1]?{done:b.done,value:b.value}:b,l,u):l({value:b,done:T})).catch(b=>i("throw",b,l,u))}catch(b){u(b)}},o=s=>r[s]=a=>new Promise((l,u)=>i(s,a,l,u)),r={};return n=n.apply(t,e),r[De("asyncIterator")]=()=>r,o("next"),o("throw"),o("return"),r},On=t=>{var e=t[De("asyncIterator")],n=!1,i,o={};return e==null?(e=t[De("iterator")](),i=r=>o[r]=s=>e[r](s)):(e=e.call(t),i=r=>o[r]=s=>{if(n){if(n=!1,r==="throw")throw s;return s}return n=!0,{done:!1,value:new ve(new Promise(a=>{var l=e[r](s);l instanceof Object||Pr("Object expected"),a(l)}),1)}}),o[De("iterator")]=()=>o,i("next"),"throw"in e?i("throw"):o.throw=r=>{throw r},"return"in e&&i("return"),o},Bi=(t,e,n)=>(e=t[De("asyncIterator")])?e.call(t):(t=t[De("iterator")](),e={},n=(i,o)=>(o=t[i])&&(e[i]=r=>new Promise((s,a,l)=>(r=o.call(t,r),l=r.done,Promise.resolve(r.value).then(u=>s({value:u,done:l}),a)))),n("next"),n("return"),e);function Ui(t){var i;if(typeof document=="undefined")return null;let n="; ".concat(document.cookie).split("; ".concat(t,"="));return n.length===2&&((i=n.pop())==null?void 0:i.split(";").shift())||null}function Fi(t="local"){let e=Mi[t];if(!e)return console.warn("Unknown environment: ".concat(t,". Falling back to local.")),{environment:"local",apiConfig:Mi.local};let n=null;if(typeof window!="undefined"&&(n=new URLSearchParams(window.location.search).get("tagadaClientBaseUrl"),!n))try{n=localStorage.getItem("tgd_client_base_url")||Ui("tgd_client_base_url")}catch(o){}return n?(console.log("[SDK] Using custom API base URL override: ".concat(n)),{environment:t,apiConfig:z(O({},e),{baseUrl:n})}):{environment:t,apiConfig:e}}function it(){var o;if(console.log("[SDK] detectEnvironment() called"),typeof window=="undefined")return"local";let e=new URLSearchParams(window.location.search).get("tagadaClientEnv");if(e&&(e==="production"||e==="development"||e==="local"))return console.log("[SDK] Using explicit environment override: ".concat(e)),e;try{let r=localStorage.getItem("tgd_client_env")||Ui("tgd_client_env");if(r&&(r==="production"||r==="development"||r==="local"))return console.log("[SDK] Using persisted environment override: ".concat(r)),r}catch(r){}let n=window.location.hostname,i=window.location.href;if(console.log('[SDK] detectEnvironment() - hostname: "'.concat(n,'"')),n==="localhost"||n.startsWith("127.")||n.startsWith("192.168.")||n.startsWith("10.")||n.includes(".local")||n===""||n==="0.0.0.0"||n.includes("ngrok-free.dev")||n.includes("ngrok-free.app")||n.includes("ngrok.io")||n.includes("ngrok.app")){if(console.log("[SDK] detectEnvironment() - returning LOCAL"),typeof window!="undefined"&&((o=window==null?void 0:window.__TAGADA_ENV__)!=null&&o.TAGADA_ENVIRONMENT)){let r=window.__TAGADA_ENV__.TAGADA_ENVIRONMENT.toLowerCase();if(r==="production"||r==="development"||r==="local")return console.log("[SDK] Local override detected: ".concat(r)),r}return"local"}return n==="app.tagadapay.com"||n.includes("tagadapay.com")||n.includes("yourproductiondomain.com")?"production":n==="app.tagadapay.dev"||n.includes("tagadapay.dev")||n.includes("vercel.app")||n.includes("netlify.app")||n.includes("surge.sh")||n.includes("github.io")||n.includes("herokuapp.com")||n.includes("railway.app")||i.includes("?env=dev")||i.includes("?dev=true")||i.includes("#dev")?"development":(console.warn("[SDK] Unknown domain: ".concat(n,", defaulting to production")),"production")}function ot(t=!1){return it()!=="local"?!1:t&&typeof window!="undefined"?!window.location.hostname.includes(".cdn."):!0}var Mi,Ft=Ie(()=>{"use strict";Mi={production:{baseUrl:"https://app.tagadapay.com",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},development:{baseUrl:"https://app.tagadapay.dev",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}},local:{baseUrl:"http://app.localhost:3000",endpoints:{checkout:{sessionInit:"/api/v1/checkout/session/init",sessionInitAsync:"/api/v1/checkout/session/init-async",sessionStatus:"/api/v1/checkout/session/status",asyncStatus:"/api/public/v1/checkout/async-status"},customer:{profile:"/api/v1/customer/profile",session:"/api/v1/customer/session"},store:{config:"/api/v1/store/config"}}}}});var Ht,Rn=Ie(()=>{"use strict";Ht=class{constructor(e){this.apiClient=e}async initialize(e){return this.apiClient.post("/api/v1/funnel/initialize",e)}async navigate(e){return this.apiClient.post("/api/v1/funnel/navigate",e)}async updateContext(e,n){return this.apiClient.patch("/api/v1/funnel/context/".concat(e),n)}async endSession(e){return this.apiClient.delete("/api/v1/funnel/session/".concat(e))}async getSession(e,n,i){let o=new URLSearchParams;n&&o.append("currentUrl",n),i&&o.append("includeDebugData","true");let r="/api/v1/funnel/session/".concat(e).concat(o.toString()?"?".concat(o):"");return this.apiClient.get(r)}}});var Be,vn=Ie(()=>{"use strict";Be=class{constructor(){this.listeners=new Set}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}notify(e){this.listeners.forEach(n=>{try{n(e)}catch(i){console.error("Error in event listener:",i)}})}clear(){this.listeners.clear()}}});function Hi(t){typeof document!="undefined"&&(document.cookie="".concat(Nn,"=").concat(t,"; path=/; max-age=2592000; SameSite=Lax"))}function Gi(){if(typeof document=="undefined")return;let t=document.cookie.split("; ").find(e=>e.startsWith("".concat(Nn,"=")));return t?t.split("=")[1]:void 0}function Gt(){typeof document!="undefined"&&(document.cookie="".concat(Nn,"=; path=/; max-age=0"))}var Nn,rt=Ie(()=>{"use strict";Nn="tgd-funnel-session-id"});function ne(t){if(typeof window!="undefined")try{let n=localStorage.getItem(Vt)!==t;localStorage.setItem(Vt,t),n&&window.dispatchEvent(new Event("storage"))}catch(e){console.error("Failed to save token to localStorage:",e)}}function st(){if(typeof window!="undefined")try{return localStorage.getItem(Vt)}catch(t){return console.error("Failed to get token from localStorage:",t),null}return null}function Me(){if(typeof window!="undefined")try{localStorage.removeItem(Vt)}catch(t){console.error("Failed to clear token from localStorage:",t)}}var Vt,Ue=Ie(()=>{"use strict";Vt="cms_token"});function Kt(t){if(typeof window=="undefined")return null;try{return localStorage.getItem(t)}catch(e){return null}}function Wt(t,e){if(typeof window!="undefined")try{localStorage.setItem(t,e)}catch(n){}}function Pn(t){var i;if(typeof document=="undefined")return null;let n=document.cookie.split(";").find(o=>o.trim().startsWith("".concat(t,"=")));return n?(i=n.split("=")[1])==null?void 0:i.trim():null}function xn(t,e,n=86400){if(typeof document!="undefined"){if(t==="tgd_draft"||t==="tgd-draft"){console.warn("\u{1F6E1}\uFE0F [SDK] Blocked attempt to set ".concat(t," as cookie - this should only be in localStorage"));return}document.cookie="".concat(t,"=").concat(e,"; path=/; max-age=").concat(n)}}function Ki(t){typeof document!="undefined"&&(document.cookie="".concat(t,"=; path=/; max-age=0"))}function Ne(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search),e,n=t.get("draft");if(n!==null)e=n==="true";else{let I=Kt(G.DRAFT);I!==null&&(e=I==="true")}let i,o=t.get("funnelTracking");if(o!==null)i=o!=="false";else{let I=Kt(G.FUNNEL_TRACKING)||Pn(G.FUNNEL_TRACKING);I!==null&&(i=I!=="false")}let r=t.get("token")||st()||null,s=t.get("funnelSessionId")||null,a=t.get("funnelId")||null,l,u=t.get("funnelEnv");u&&(u==="staging"||u==="production")&&(l=u);let d=t.get("forceReset")==="true",p,T=t.get("tagadaClientEnv");if(T&&(T==="production"||T==="development"||T==="local"))p=T;else{let I=Kt(G.CLIENT_ENV)||Pn(G.CLIENT_ENV);I&&(I==="production"||I==="development"||I==="local")&&(p=I)}let b,f=t.get("tagadaClientBaseUrl");if(f)b=f;else{let I=Kt(G.CLIENT_BASE_URL)||Pn(G.CLIENT_BASE_URL);I&&(b=I)}return{forceReset:d,token:r,funnelSessionId:s,funnelId:a,draft:e,funnelTracking:i,funnelEnv:l,tagadaClientEnv:p,tagadaClientBaseUrl:b}}function at(){var e;return(e=Ne().draft)!=null?e:!1}function Ln(t){if(typeof window!="undefined")if(t)Wt(G.DRAFT,"true");else try{localStorage.removeItem(G.DRAFT)}catch(e){}}function Wi(t=!1){let e=null;typeof window!="undefined"&&(e=new URLSearchParams(window.location.search).get("token"));let n=Ne(),i=n.forceReset||!1;if(!i&&!n.token)return Vi(),!1;t&&(console.log("[SDK] Detected params:",n),console.log("[SDK] URL token (direct read):",e?e.substring(0,20)+"...":"none")),i&&(t&&console.log("[SDK] Force reset: Clearing all stored state"),Me(),Gt(),typeof window!="undefined"&&window.localStorage&&Object.keys(localStorage).forEach(s=>{(s.startsWith("tagadapay_")||s.startsWith("tgd_"))&&(t&&console.log("[SDK] Clearing localStorage: ".concat(s)),localStorage.removeItem(s))}));let o=e||n.token;return o!=null?(t&&console.log("[SDK] Setting token from URL:",o.substring(0,20)+"..."),o===""||o==="null"?Me():(ne(o),t&&console.log("[SDK] \u2705 Token set in localStorage immediately after clear"))):i&&(t&&console.log("[SDK] Force reset mode (no token in URL)"),Me()),Vi(),n.funnelSessionId&&t&&console.log("[SDK] Using funnelSessionId from URL:",n.funnelSessionId),i}function Vi(){if(typeof window=="undefined")return;let t=new URLSearchParams(window.location.search),e=t.get("draft");e!==null&&Ln(e==="true");let n=t.get("funnelTracking");n!==null&&_r(n!=="false");let i=t.get("tagadaClientEnv");i&&(i==="production"||i==="development"||i==="local")&&kr(i);let o=t.get("tagadaClientBaseUrl");o&&Dr(o)}function _r(t){if(typeof window=="undefined")return;let e=t?"true":"false";Wt(G.FUNNEL_TRACKING,e),xn(G.FUNNEL_TRACKING,e,86400)}function kr(t){typeof window!="undefined"&&(Wt(G.CLIENT_ENV,t),xn(G.CLIENT_ENV,t,86400))}function zi(){if(typeof window!="undefined")try{localStorage.removeItem(G.CLIENT_ENV),Ki(G.CLIENT_ENV)}catch(t){}}function Dr(t){typeof window!="undefined"&&(Wt(G.CLIENT_BASE_URL,t),xn(G.CLIENT_BASE_URL,t,86400))}function Yi(){if(typeof window!="undefined")try{localStorage.removeItem(G.CLIENT_BASE_URL),Ki(G.CLIENT_BASE_URL)}catch(t){}}function ji(){var e;return(e=Ne().funnelTracking)!=null?e:!0}var G,zt=Ie(()=>{"use strict";Ue();rt();G={DRAFT:"tgd_draft",FUNNEL_TRACKING:"tgd_funnel_tracking",FORCE_RESET:"tgd_force_reset",CLIENT_ENV:"tgd_client_env",CLIENT_BASE_URL:"tgd_client_base_url"}});function _n(t){if(typeof window=="undefined"||typeof document=="undefined")return;let e=window.location.hostname,n=e.split("."),i=["",e,"."+e];for(let a=1;a<n.length;a++){let l=n.slice(a).join(".");i.push(l),i.push("."+l)}let o=window.location.pathname.split("/").filter(a=>a),r=["/"],s="";o.forEach(a=>{s+="/"+a,r.push(s)}),i.forEach(a=>{r.forEach(l=>{let u="".concat(t,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=").concat(l),d=a?"; domain=".concat(a):"";document.cookie=u+d,document.cookie=u+d+"; secure",document.cookie=u+d+"; SameSite=None; secure",document.cookie=u+d+"; SameSite=Lax",document.cookie=u+d+"; SameSite=Strict"})})}function Mr(){if(typeof window=="undefined"||!confirm("\u{1F6AA} Leave Preview Mode?\n\nThis will clear ALL cookies and localStorage (including Shopify session, cart, and preview settings) and reload the page.\n\nAre you sure?"))return;let e=new URL(window.location.href);["draft","funnelEnv","funnelTracking","tagadaClientEnv","tagadaClientBaseUrl","forceReset","funnelId","funnelSessionId","token"].forEach(r=>e.searchParams.delete(r)),window.history.replaceState({},"",e.href);try{let r=Object.getOwnPropertyDescriptor(Document.prototype,"cookie")||Object.getOwnPropertyDescriptor(HTMLDocument.prototype,"cookie");r&&r.set&&Object.defineProperty(document,"cookie",{configurable:!0,enumerable:!0,get:function(){return r.get?r.get.call(this):""},set:function(s){if(typeof s=="string"){let a=s.toLowerCase();if(a.includes("tgd_draft")||a.includes("tgd-draft")||a.includes("tgd.draft")||a.includes("tgddraft")){if(a.includes("max-age=0")||a.includes("expires=thu, 01 jan 1970")){r.set&&r.set.call(this,s);return}console.warn("\u{1F6E1}\uFE0F [TagadaPay] BLOCKED: tgd_draft should never be a cookie");return}}r.set&&r.set.call(this,s)}})}catch(r){console.warn("[TagadaPay] Could not install cookie blocker:",r)}if(window.localStorage)try{localStorage.removeItem("tgd_draft"),localStorage.removeItem("tgd_funnel_tracking"),localStorage.removeItem("tgd_client_env"),localStorage.removeItem("tgd_client_base_url"),localStorage.removeItem("cms_token")}catch(r){console.warn("[TagadaPay] Failed to clear some localStorage keys:",r)}Me(),Gt(),zi(),Yi(),window.localStorage&&localStorage.clear(),window.sessionStorage&&sessionStorage.clear(),["tgd-funnel-session-id","tgd_draft","tgd_funnel_tracking","tgd_client_env","tgd_client_base_url","cms_token","tagadapay_session"].forEach(r=>_n(r)),["tgd-draft","tgd_draft","tgd.draft","tgddraft"].forEach(r=>_n(r)),document.cookie&&document.cookie.split(";").forEach(s=>{let a=s.split("=")[0].trim();if(!a)return;let l=window.location.hostname,u=l.split("."),d=["",l,"."+l];for(let f=1;f<u.length;f++){let I=u.slice(f).join(".");d.push(I),d.push("."+I)}let p=window.location.pathname.split("/").filter(f=>f),T=["/"],b="";p.forEach(f=>{b+="/"+f,T.push(b)}),d.forEach(f=>{T.forEach(I=>{let w="".concat(a,"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path=").concat(I),v=f?"; domain=".concat(f):"";document.cookie=w+v,document.cookie=w+v+"; secure",document.cookie=w+v+"; SameSite=None; secure",document.cookie=w+v+"; SameSite=Lax",document.cookie=w+v+"; SameSite=Strict",document.cookie=w+v+"; secure; SameSite=None",document.cookie=w+v+"; secure; SameSite=Lax",document.cookie=w+v+"; secure; SameSite=Strict"})})}),setTimeout(()=>{window.localStorage&&localStorage.length>0&&localStorage.clear(),_n("tgd_draft"),typeof window.stop=="function"&&window.stop(),window.location.replace(e.href)},10)}function kn(){if($i||typeof window=="undefined"||typeof document=="undefined")return;let t=Ne(),e=at(),n=!ji(),i=!!(t.tagadaClientEnv||t.tagadaClientBaseUrl);if(!e&&!n&&!i)return;let o=document.createElement("div");o.id="tgd-preview-indicator",o.style.cssText='\n position: fixed;\n bottom: 16px;\n right: 16px;\n z-index: 999999;\n font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;\n ';let r=document.createElement("div");r.style.cssText="\n background: ".concat(e?"#ff9500":"#007aff",";\n color: white;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 13px;\n font-weight: 600;\n box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);\n cursor: pointer;\n transition: all 0.2s ease;\n display: flex;\n align-items: center;\n gap: 6px;\n "),r.innerHTML='\n <span style="font-size: 16px;">\u{1F50D}</span>\n <span>'.concat(e?"Preview Mode":"Dev Mode","</span>\n ");let s=document.createElement("div");s.style.cssText="\n position: absolute;\n bottom: calc(100% + 8px);\n right: 0;\n background: white;\n border: 1px solid #e5e5e5;\n border-radius: 8px;\n box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);\n padding: 12px;\n min-width: 250px;\n font-size: 12px;\n line-height: 1.5;\n display: none;\n ",s.style.paddingTop="20px";let a=document.createElement("div");a.style.cssText="\n position: absolute;\n bottom: 100%;\n left: 0;\n right: 0;\n height: 8px;\n display: none;\n ";let l='<div style="margin-bottom: 8px; font-weight: 600; color: #1d1d1f;">Current Environment</div>';l+='<div style="display: flex; flex-direction: column; gap: 6px;">',e&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Draft Mode:</span>\n <span style="color: #ff9500; font-weight: 600;">ON</span>\n </div>\n '),n&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Tracking:</span>\n <span style="color: #ff3b30; font-weight: 600;">DISABLED</span>\n </div>\n '),t.funnelEnv&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>Funnel Env:</span>\n <span style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 11px;">\n '.concat(t.funnelEnv,"\n </span>\n </div>\n ")),t.tagadaClientEnv&&(l+='\n <div style="display: flex; justify-content: space-between; color: #86868b;">\n <span>API Env:</span>\n <span style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 11px;">\n '.concat(t.tagadaClientEnv,"\n </span>\n </div>\n ")),t.tagadaClientBaseUrl&&(l+='\n <div style="color: #86868b;">\n <div style="margin-bottom: 4px;">API URL:</div>\n <div style="color: #1d1d1f; font-weight: 600; font-family: monospace; font-size: 10px; word-break: break-all; background: #f5f5f7; padding: 4px 6px; border-radius: 4px;">\n '.concat(t.tagadaClientBaseUrl,"\n </div>\n </div>\n ")),t.funnelId&&(l+='\n <div style="color: #86868b; margin-top: 4px; padding-top: 8px; border-top: 1px solid #e5e5e5;">\n <div style="margin-bottom: 4px;">Funnel ID:</div>\n <div style="color: #1d1d1f; font-family: monospace; font-size: 10px; word-break: break-all; background: #f5f5f7; padding: 4px 6px; border-radius: 4px;">\n '.concat(t.funnelId,"\n </div>\n </div>\n ")),l+="</div>",l+='\n <div style="margin-top: 12px; padding-top: 8px; border-top: 1px solid #e5e5e5; font-size: 11px; color: #86868b; text-align: center;">\n Add <code style="background: #f5f5f7; padding: 2px 4px; border-radius: 3px;">?forceReset=true</code> to reset\n </div>\n ',l+='\n <div style="margin-top: 12px; padding-top: 8px; border-top: 1px solid #e5e5e5;">\n <button id="tgd-leave-preview" style="\n background: #ff3b30;\n color: white;\n border: none;\n border-radius: 6px;\n padding: 10px 12px;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n transition: opacity 0.2s;\n width: 100%;\n ">\n \u{1F6AA} Leave Preview Mode\n </button>\n </div>\n ',s.innerHTML=l;let u=!1,d=()=>{u=!0,s.style.display="block",a.style.display="block"},p=()=>{u=!1,setTimeout(()=>{u||(s.style.display="none",a.style.display="none")},100)};r.addEventListener("mouseenter",d),r.addEventListener("mouseleave",p),a.addEventListener("mouseenter",d),a.addEventListener("mouseleave",p),s.addEventListener("mouseenter",d),s.addEventListener("mouseleave",p);let T=s.querySelector("#tgd-leave-preview");T&&(T.addEventListener("mouseenter",()=>{T.style.opacity="0.8"}),T.addEventListener("mouseleave",()=>{T.style.opacity="1"}),T.addEventListener("click",b=>{b.stopPropagation(),Mr()})),o.appendChild(r),o.appendChild(a),o.appendChild(s),document.body.appendChild(o),Br=o,$i=!0}var Br,$i,Xi=Ie(()=>{"use strict";zt();Ue();rt();Br=null,$i=!1});var Zi={};Cn(Zi,{FunnelClient:()=>ct,getAssignedPaymentFlowId:()=>Kr,getAssignedScripts:()=>zr,getAssignedStaticResources:()=>Wr,getAssignedStepConfig:()=>jt,getLocalFunnelConfig:()=>Ji,loadLocalFunnelConfig:()=>Gr});function Fr(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_ID__)return window.__TGD_FUNNEL_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function Yt(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_VARIANT_ID__)return window.__TGD_FUNNEL_VARIANT_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-variant-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function lt(){if(typeof window!="undefined"){if(window.__TGD_FUNNEL_STEP_ID__)return window.__TGD_FUNNEL_STEP_ID__;if(typeof document!="undefined"){let t=document.querySelector('meta[name="x-funnel-step-id"]');return(t==null?void 0:t.getAttribute("content"))||void 0}}}function qi(t){if(!t||typeof t!="string")return;let e=t.trim();if(!e)return;let n=[()=>JSON.parse(e),()=>JSON.parse(decodeURIComponent(e)),()=>JSON.parse(decodeURIComponent(decodeURIComponent(e)))];for(let i of n)try{let o=i();if(o&&typeof o=="object")return o}catch(o){}typeof console!="undefined"&&console.warn("[SDK] Failed to parse stepConfig:",e.substring(0,100))}function Hr(){if(typeof window=="undefined")return!1;let t=window.location.hostname;return t==="localhost"||t==="127.0.0.1"||t.endsWith(".localhost")&&!t.includes(".cdn.")}async function Gr(){if(!Hr())return null;if(ie!==void 0)return ie;if(Dn)return await new Promise(t=>setTimeout(t,100)),ie!=null?ie:null;Dn=!0;try{console.log("\u{1F6E0}\uFE0F [SDK] Loading local funnel config from /config/funnel.local.json...");let t=await fetch("/config/funnel.local.json");if(!t.ok)return console.log("\u{1F6E0}\uFE0F [SDK] funnel.local.json not found (this is fine in production)"),ie=null,null;let e=await t.json();return console.log("\u{1F6E0}\uFE0F [SDK] \u2705 Loaded local funnel config:",e),ie=e,e}catch(t){return console.log("\u{1F6E0}\uFE0F [SDK] funnel.local.json not available:",t),ie=null,null}finally{Dn=!1}}function Ji(){return ie!=null?ie:null}function Vr(t){return{payment:t.paymentFlowId?{paymentFlowId:t.paymentFlowId}:void 0,staticResources:t.staticResources,scripts:t.scripts,pixels:t.pixels}}function jt(){if(typeof window=="undefined")return;let t=Ji();if(t)return console.log("\u{1F6E0}\uFE0F [SDK] Using local funnel.local.json (overrides injected)"),Vr(t);let e=window.__TGD_STEP_CONFIG__;if(e){let n=qi(e);if(n)return n}if(typeof document!="undefined"){let n=document.querySelector('meta[name="x-step-config"]'),i=n==null?void 0:n.getAttribute("content");if(i){let o=qi(i);if(o)return o}}}function Kr(){var e;let t=jt();if((e=t==null?void 0:t.payment)!=null&&e.paymentFlowId)return t.payment.paymentFlowId;if(typeof window!="undefined"){if(window.__TGD_PAYMENT_FLOW_ID__)return window.__TGD_PAYMENT_FLOW_ID__;if(typeof document!="undefined"){let n=document.querySelector('meta[name="x-payment-flow-id"]');return(n==null?void 0:n.getAttribute("content"))||void 0}}}function Wr(){let t=jt();return t==null?void 0:t.staticResources}function zr(t){let e=jt();if(!(e!=null&&e.scripts))return;let n=e.scripts.filter(i=>i.enabled);return t&&(n=n.filter(i=>i.position===t||!i.position&&t==="head-end")),n.length>0?n:void 0}var ie,Dn,ct,Bn=Ie(()=>{"use strict";Rn();vn();rt();Ft();zt();Xi();Dn=!1;ct=class{constructor(e){this.eventDispatcher=new Be;this.isInitializing=!1;this.initializationAttempted=!1;this.config=e,this.resource=new Ht(e.apiClient),this.state={context:null,isLoading:!1,isInitialized:!1,isNavigating:!1,error:null,sessionError:null}}setConfig(e){this.config=O(O({},this.config),e)}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}getDetectedSessionId(){var i;if((i=this.state.context)!=null&&i.sessionId)return this.state.context.sessionId;if(typeof window=="undefined")return null;let n=new URLSearchParams(window.location.search).get("funnelSessionId");return n||Gi()||null}resetInitialization(){this.initializationAttempted=!1,this.isInitializing=!1,this.updateState({context:null,isInitialized:!1})}async autoInitialize(e,n,i){if(this.state.context)return this.state.context;if(this.isInitializing||this.initializationAttempted)return null;this.initializationAttempted=!0,this.isInitializing=!0,this.updateState({isLoading:!0,error:null});try{let o=this.getDetectedSessionId(),a=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||i,l=Fr(),u=Yt(),d=lt(),p=Ne(),T=this.config.funnelId||l||a,b=this.config.stepId||d,f=typeof window!="undefined"?new URLSearchParams(window.location.search):null,I=f==null?void 0:f.get("funnelEnv");this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-initializing...",{existingSessionId:o,effectiveFunnelId:T,funnelVariantId:u,funnelStepId:b,draft:p.draft,funnelTracking:p.funnelTracking,funnelEnv:I,tagadaClientEnv:p.tagadaClientEnv,tagadaClientBaseUrl:p.tagadaClientBaseUrl,source:{funnelId:this.config.funnelId?"config":l?"injected":a?"url/prop":"none",stepId:this.config.stepId?"config":d?"injected":"none"}});let w=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:T,existingSessionId:o||void 0,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:u,funnelStepId:b,draft:p.draft,funnelTracking:p.funnelTracking,funnelEnv:I||void 0,tagadaClientEnv:p.tagadaClientEnv,tagadaClientBaseUrl:p.tagadaClientBaseUrl});if(w.success&&w.context){let v=this.enrichContext(w.context);return this.handleSessionSuccess(v),kn(),v}else throw new Error(w.error||"Failed to initialize funnel session")}catch(o){let r=o instanceof Error?o:new Error(String(o));throw this.updateState({error:r,isLoading:!1}),this.config.debugMode&&console.error("\u274C [FunnelClient] Init failed:",r),r}finally{this.isInitializing=!1}}async initialize(e,n,i,o){this.updateState({isLoading:!0,error:null});try{let r=Yt(),s=lt();this.config.debugMode&&(r&&console.log("\u{1F3AF} [FunnelClient] Detected A/B test variant:",r),s&&console.log("\u{1F3AF} [FunnelClient] Detected step ID:",s));let a=await this.resource.initialize({cmsSession:{customerId:e.customerId,sessionId:e.sessionId,storeId:n.id,accountId:n.accountId},funnelId:i,entryStepId:o,currentUrl:typeof window!="undefined"?window.location.href:void 0,funnelVariantId:r,funnelStepId:s});if(a.success&&a.context){let l=this.enrichContext(a.context);return this.handleSessionSuccess(l),kn(),l}else throw new Error(a.error||"Failed to initialize")}catch(r){let s=r instanceof Error?r:new Error(String(r));throw this.updateState({error:s,isLoading:!1}),s}}async navigate(e,n){var i,o,r,s,a,l;if(n!=null&&n.waitForSession&&!((i=this.state.context)!=null&&i.sessionId)){this.config.debugMode&&console.log("\u23F3 [FunnelClient] Waiting for session before navigation...");let u=5e3,d=Date.now();for(;!((o=this.state.context)!=null&&o.sessionId)&&Date.now()-d<u;)await new Promise(p=>setTimeout(p,100));(r=this.state.context)!=null&&r.sessionId&&this.config.debugMode&&console.log("\u2705 [FunnelClient] Session ready, proceeding with navigation")}if(!((s=this.state.context)!=null&&s.sessionId))throw new Error("No active session");this.updateState({isNavigating:!0,isLoading:!0});try{let u=Yt(),d=lt(),p=typeof window!="undefined"?window.location.href:void 0;!d&&this.config.stepId&&(d=this.config.stepId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using stepId from config (no injection):",d)),!u&&this.config.variantId&&(u=this.config.variantId,this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Using variantId from config (no injection):",u)),this.config.debugMode&&console.log("\u{1F50D} [FunnelClient.navigate] Sending to backend:",{sessionId:this.state.context.sessionId,currentUrl:p,funnelStepId:d||"(not found)",funnelVariantId:u||"(not found)",hasInjectedStepId:!!lt(),hasInjectedVariantId:!!Yt(),usedConfigFallback:!lt()&&!!this.config.stepId,customerTags:(n==null?void 0:n.customerTags)||"(none)",deviceId:(n==null?void 0:n.deviceId)||"(none)"});let T=(n==null?void 0:n.fireAndForget)||!1,b=await this.resource.navigate({sessionId:this.state.context.sessionId,event:e,currentUrl:p,funnelStepId:d,funnelVariantId:u,fireAndForget:T,customerTags:n==null?void 0:n.customerTags,deviceId:n==null?void 0:n.deviceId});if(!b.success||!b.result)throw new Error(b.error||"Navigation failed");let f=b.result;if(f.queued)return this.updateState({isNavigating:!1,isLoading:!1}),f.sessionId&&f.sessionId!==((a=this.state.context)==null?void 0:a.sessionId)&&(this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Session ID updated: ".concat((l=this.state.context)==null?void 0:l.sessionId," \u2192 ").concat(f.sessionId)),this.state.context&&(this.state.context.sessionId=f.sessionId)),this.config.debugMode&&console.log("\u{1F525} [FunnelClient] Navigation queued (fire-and-forget mode)"),f;let I=(n==null?void 0:n.autoRedirect)!==void 0?n.autoRedirect:this.config.autoRedirect!==!1;return I||(this.config.debugMode&&console.log("\u{1F504} [FunnelClient] Refreshing session (no auto-redirect)"),await this.refreshSession()),this.updateState({isNavigating:!1,isLoading:!1}),I&&(f!=null&&f.url)&&typeof window!="undefined"&&(this.config.debugMode&&console.log("\u{1F680} [FunnelClient] Auto-redirecting to:",f.url,"(skipped session refresh - next page will initialize)"),window.location.href=f.url),f}catch(u){let d=u instanceof Error?u:new Error(String(u));throw this.updateState({error:d,isNavigating:!1,isLoading:!1}),d}}async goToStep(e,n){return this.navigate({type:"direct_navigation",data:{targetStepId:e}},n)}async refreshSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{let n=await this.resource.getSession(this.state.context.sessionId);if(n.success&&n.context){let i=this.enrichContext(n.context);return this.updateState({context:i,sessionError:null}),i}}catch(n){this.updateState({sessionError:n instanceof Error?n:new Error(String(n))})}}async updateContext(e){var n;if(!((n=this.state.context)!=null&&n.sessionId))throw new Error("No active session");this.updateState({isLoading:!0});try{let i=await this.resource.updateContext(this.state.context.sessionId,{contextUpdates:e});if(i.success)await this.refreshSession();else throw new Error(i.error||"Failed to update context")}finally{this.updateState({isLoading:!1})}}async endSession(){var e;if((e=this.state.context)!=null&&e.sessionId)try{await this.resource.endSession(this.state.context.sessionId)}finally{this.state.context=null,this.updateState({context:null,isInitialized:!1})}}updateState(e){this.state=O(O({},this.state),e),this.eventDispatcher.notify(this.state)}handleSessionSuccess(e){Hi(e.sessionId),this.updateState({context:e,isLoading:!1,isInitialized:!0,error:null,sessionError:null})}enrichContext(e){var s,a;if((((s=this.config.environment)==null?void 0:s.environment)||it())!=="local")return e;let i=((a=this.config.pluginConfig)==null?void 0:a.staticResources)||{};if(Object.keys(i).length===0)return e;let o=e.static||{};return Object.keys(i).every(l=>o[l]===i[l])&&Object.keys(o).length===Object.keys(i).length?e:z(O({},e),{static:O(O({},i),o)})}}});var Da={};Cn(Da,{TagadaExternalTracker:()=>Bt,TagadaTracker:()=>vi});Ft();Bn();function ut(t,e){return function(){return t.apply(e,arguments)}}var{toString:Yr}=Object.prototype,{getPrototypeOf:Un}=Object,{iterator:Xt,toStringTag:eo}=Symbol,qt=(t=>e=>{let n=Yr.call(e);return t[n]||(t[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),oe=t=>(t=t.toLowerCase(),e=>qt(e)===t),Jt=t=>e=>typeof e===t,{isArray:He}=Array,Fe=Jt("undefined");function dt(t){return t!==null&&!Fe(t)&&t.constructor!==null&&!Fe(t.constructor)&&q(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}var to=oe("ArrayBuffer");function jr(t){let e;return typeof ArrayBuffer!="undefined"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&to(t.buffer),e}var $r=Jt("string"),q=Jt("function"),no=Jt("number"),ft=t=>t!==null&&typeof t=="object",Xr=t=>t===!0||t===!1,$t=t=>{if(qt(t)!=="object")return!1;let e=Un(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(eo in t)&&!(Xt in t)},qr=t=>{if(!ft(t)||dt(t))return!1;try{return Object.keys(t).length===0&&Object.getPrototypeOf(t)===Object.prototype}catch(e){return!1}},Jr=oe("Date"),Zr=oe("File"),Qr=oe("Blob"),es=oe("FileList"),ts=t=>ft(t)&&q(t.pipe),ns=t=>{let e;return t&&(typeof FormData=="function"&&t instanceof FormData||q(t.append)&&((e=qt(t))==="formdata"||e==="object"&&q(t.toString)&&t.toString()==="[object FormData]"))},is=oe("URLSearchParams"),[os,rs,ss,as]=["ReadableStream","Request","Response","Headers"].map(oe),ls=t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function pt(t,e,{allOwnKeys:n=!1}={}){if(t===null||typeof t=="undefined")return;let i,o;if(typeof t!="object"&&(t=[t]),He(t))for(i=0,o=t.length;i<o;i++)e.call(null,t[i],i,t);else{if(dt(t))return;let r=n?Object.getOwnPropertyNames(t):Object.keys(t),s=r.length,a;for(i=0;i<s;i++)a=r[i],e.call(null,t[a],a,t)}}function io(t,e){if(dt(t))return null;e=e.toLowerCase();let n=Object.keys(t),i=n.length,o;for(;i-- >0;)if(o=n[i],e===o.toLowerCase())return o;return null}var Pe=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:typeof window!="undefined"?window:global,oo=t=>!Fe(t)&&t!==Pe;function Mn(){let{caseless:t,skipUndefined:e}=oo(this)&&this||{},n={},i=(o,r)=>{let s=t&&io(n,r)||r;$t(n[s])&&$t(o)?n[s]=Mn(n[s],o):$t(o)?n[s]=Mn({},o):He(o)?n[s]=o.slice():(!e||!Fe(o))&&(n[s]=o)};for(let o=0,r=arguments.length;o<r;o++)arguments[o]&&pt(arguments[o],i);return n}var cs=(t,e,n,{allOwnKeys:i}={})=>(pt(e,(o,r)=>{n&&q(o)?t[r]=ut(o,n):t[r]=o},{allOwnKeys:i}),t),us=t=>(t.charCodeAt(0)===65279&&(t=t.slice(1)),t),ds=(t,e,n,i)=>{t.prototype=Object.create(e.prototype,i),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},fs=(t,e,n,i)=>{let o,r,s,a={};if(e=e||{},t==null)return e;do{for(o=Object.getOwnPropertyNames(t),r=o.length;r-- >0;)s=o[r],(!i||i(s,t,e))&&!a[s]&&(e[s]=t[s],a[s]=!0);t=n!==!1&&Un(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},ps=(t,e,n)=>{t=String(t),(n===void 0||n>t.length)&&(n=t.length),n-=e.length;let i=t.indexOf(e,n);return i!==-1&&i===n},gs=t=>{if(!t)return null;if(He(t))return t;let e=t.length;if(!no(e))return null;let n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},ms=(t=>e=>t&&e instanceof t)(typeof Uint8Array!="undefined"&&Un(Uint8Array)),hs=(t,e)=>{let i=(t&&t[Xt]).call(t),o;for(;(o=i.next())&&!o.done;){let r=o.value;e.call(t,r[0],r[1])}},Es=(t,e)=>{let n,i=[];for(;(n=t.exec(e))!==null;)i.push(n);return i},As=oe("HTMLFormElement"),ws=t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,i,o){return i.toUpperCase()+o}),Qi=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),bs=oe("RegExp"),ro=(t,e)=>{let n=Object.getOwnPropertyDescriptors(t),i={};pt(n,(o,r)=>{let s;(s=e(o,r,t))!==!1&&(i[r]=s||o)}),Object.defineProperties(t,i)},Is=t=>{ro(t,(e,n)=>{if(q(t)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;let i=t[n];if(q(i)){if(e.enumerable=!1,"writable"in e){e.writable=!1;return}e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},Ss=(t,e)=>{let n={},i=o=>{o.forEach(r=>{n[r]=!0})};return He(t)?i(t):i(String(t).split(e)),n},Ts=()=>{},Cs=(t,e)=>t!=null&&Number.isFinite(t=+t)?t:e;function ys(t){return!!(t&&q(t.append)&&t[eo]==="FormData"&&t[Xt])}var Os=t=>{let e=new Array(10),n=(i,o)=>{if(ft(i)){if(e.indexOf(i)>=0)return;if(dt(i))return i;if(!("toJSON"in i)){e[o]=i;let r=He(i)?[]:{};return pt(i,(s,a)=>{let l=n(s,o+1);!Fe(l)&&(r[a]=l)}),e[o]=void 0,r}}return i};return n(t,0)},Rs=oe("AsyncFunction"),vs=t=>t&&(ft(t)||q(t))&&q(t.then)&&q(t.catch),so=((t,e)=>t?setImmediate:e?((n,i)=>(Pe.addEventListener("message",({source:o,data:r})=>{o===Pe&&r===n&&i.length&&i.shift()()},!1),o=>{i.push(o),Pe.postMessage(n,"*")}))("axios@".concat(Math.random()),[]):n=>setTimeout(n))(typeof setImmediate=="function",q(Pe.postMessage)),Ns=typeof queueMicrotask!="undefined"?queueMicrotask.bind(Pe):typeof process!="undefined"&&process.nextTick||so,Ps=t=>t!=null&&q(t[Xt]),c={isArray:He,isArrayBuffer:to,isBuffer:dt,isFormData:ns,isArrayBufferView:jr,isString:$r,isNumber:no,isBoolean:Xr,isObject:ft,isPlainObject:$t,isEmptyObject:qr,isReadableStream:os,isRequest:rs,isResponse:ss,isHeaders:as,isUndefined:Fe,isDate:Jr,isFile:Zr,isBlob:Qr,isRegExp:bs,isFunction:q,isStream:ts,isURLSearchParams:is,isTypedArray:ms,isFileList:es,forEach:pt,merge:Mn,extend:cs,trim:ls,stripBOM:us,inherits:ds,toFlatObject:fs,kindOf:qt,kindOfTest:oe,endsWith:ps,toArray:gs,forEachEntry:hs,matchAll:Es,isHTMLForm:As,hasOwnProperty:Qi,hasOwnProp:Qi,reduceDescriptors:ro,freezeMethods:Is,toObjectSet:Ss,toCamelCase:ws,noop:Ts,toFiniteNumber:Cs,findKey:io,global:Pe,isContextDefined:oo,isSpecCompliantForm:ys,toJSONObject:Os,isAsyncFn:Rs,isThenable:vs,setImmediate:so,asap:Ns,isIterable:Ps};function Ge(t,e,n,i,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),i&&(this.request=i),o&&(this.response=o,this.status=o.status?o.status:null)}c.inherits(Ge,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:c.toJSONObject(this.config),code:this.code,status:this.status}}});var ao=Ge.prototype,lo={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{lo[t]={value:t}});Object.defineProperties(Ge,lo);Object.defineProperty(ao,"isAxiosError",{value:!0});Ge.from=(t,e,n,i,o,r)=>{let s=Object.create(ao);c.toFlatObject(t,s,function(d){return d!==Error.prototype},u=>u!=="isAxiosError");let a=t&&t.message?t.message:"Error",l=e==null&&t?t.code:e;return Ge.call(s,a,l,n,i,o),t&&s.cause==null&&Object.defineProperty(s,"cause",{value:t,configurable:!0}),s.name=t&&t.name||"Error",r&&Object.assign(s,r),s};var C=Ge;var Zt=null;function Fn(t){return c.isPlainObject(t)||c.isArray(t)}function uo(t){return c.endsWith(t,"[]")?t.slice(0,-2):t}function co(t,e,n){return t?t.concat(e).map(function(o,r){return o=uo(o),!n&&r?"["+o+"]":o}).join(n?".":""):e}function xs(t){return c.isArray(t)&&!t.some(Fn)}var Ls=c.toFlatObject(c,{},null,function(e){return/^is[A-Z]/.test(e)});function _s(t,e,n){if(!c.isObject(t))throw new TypeError("target must be an object");e=e||new(Zt||FormData),n=c.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(I,w){return!c.isUndefined(w[I])});let i=n.metaTokens,o=n.visitor||d,r=n.dots,s=n.indexes,l=(n.Blob||typeof Blob!="undefined"&&Blob)&&c.isSpecCompliantForm(e);if(!c.isFunction(o))throw new TypeError("visitor must be a function");function u(f){if(f===null)return"";if(c.isDate(f))return f.toISOString();if(c.isBoolean(f))return f.toString();if(!l&&c.isBlob(f))throw new C("Blob is not supported. Use a Buffer instead.");return c.isArrayBuffer(f)||c.isTypedArray(f)?l&&typeof Blob=="function"?new Blob([f]):Buffer.from(f):f}function d(f,I,w){let v=f;if(f&&!w&&typeof f=="object"){if(c.endsWith(I,"{}"))I=i?I:I.slice(0,-2),f=JSON.stringify(f);else if(c.isArray(f)&&xs(f)||(c.isFileList(f)||c.endsWith(I,"[]"))&&(v=c.toArray(f)))return I=uo(I),v.forEach(function(L,N){!(c.isUndefined(L)||L===null)&&e.append(s===!0?co([I],N,r):s===null?I:I+"[]",u(L))}),!1}return Fn(f)?!0:(e.append(co(w,I,r),u(f)),!1)}let p=[],T=Object.assign(Ls,{defaultVisitor:d,convertValue:u,isVisitable:Fn});function b(f,I){if(!c.isUndefined(f)){if(p.indexOf(f)!==-1)throw Error("Circular reference detected in "+I.join("."));p.push(f),c.forEach(f,function(v,D){(!(c.isUndefined(v)||v===null)&&o.call(e,v,c.isString(D)?D.trim():D,I,T))===!0&&b(v,I?I.concat(D):[D])}),p.pop()}}if(!c.isObject(t))throw new TypeError("data must be an object");return b(t),e}var Se=_s;function fo(t){let e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(i){return e[i]})}function po(t,e){this._pairs=[],t&&Se(t,this,e)}var go=po.prototype;go.append=function(e,n){this._pairs.push([e,n])};go.toString=function(e){let n=e?function(i){return e.call(this,i,fo)}:fo;return this._pairs.map(function(o){return n(o[0])+"="+n(o[1])},"").join("&")};var Qt=po;function ks(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function gt(t,e,n){if(!e)return t;let i=n&&n.encode||ks;c.isFunction(n)&&(n={serialize:n});let o=n&&n.serialize,r;if(o?r=o(e,n):r=c.isURLSearchParams(e)?e.toString():new Qt(e,n).toString(i),r){let s=t.indexOf("#");s!==-1&&(t=t.slice(0,s)),t+=(t.indexOf("?")===-1?"?":"&")+r}return t}var Hn=class{constructor(){this.handlers=[]}use(e,n,i){return this.handlers.push({fulfilled:e,rejected:n,synchronous:i?i.synchronous:!1,runWhen:i?i.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){c.forEach(this.handlers,function(i){i!==null&&e(i)})}},Gn=Hn;var en={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var mo=typeof URLSearchParams!="undefined"?URLSearchParams:Qt;var ho=typeof FormData!="undefined"?FormData:null;var Eo=typeof Blob!="undefined"?Blob:null;var Ao={isBrowser:!0,classes:{URLSearchParams:mo,FormData:ho,Blob:Eo},protocols:["http","https","file","blob","url","data"]};var Wn={};Cn(Wn,{hasBrowserEnv:()=>Kn,hasStandardBrowserEnv:()=>Ds,hasStandardBrowserWebWorkerEnv:()=>Bs,navigator:()=>Vn,origin:()=>Ms});var Kn=typeof window!="undefined"&&typeof document!="undefined",Vn=typeof navigator=="object"&&navigator||void 0,Ds=Kn&&(!Vn||["ReactNative","NativeScript","NS"].indexOf(Vn.product)<0),Bs=typeof WorkerGlobalScope!="undefined"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",Ms=Kn&&window.location.href||"http://localhost";var B=O(O({},Wn),Ao);function zn(t,e){return Se(t,new B.classes.URLSearchParams,O({visitor:function(n,i,o,r){return B.isNode&&c.isBuffer(n)?(this.append(i,n.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}function Us(t){return c.matchAll(/\w+|\[(\w*)]/g,t).map(e=>e[0]==="[]"?"":e[1]||e[0])}function Fs(t){let e={},n=Object.keys(t),i,o=n.length,r;for(i=0;i<o;i++)r=n[i],e[r]=t[r];return e}function Hs(t){function e(n,i,o,r){let s=n[r++];if(s==="__proto__")return!0;let a=Number.isFinite(+s),l=r>=n.length;return s=!s&&c.isArray(o)?o.length:s,l?(c.hasOwnProp(o,s)?o[s]=[o[s],i]:o[s]=i,!a):((!o[s]||!c.isObject(o[s]))&&(o[s]=[]),e(n,i,o[s],r)&&c.isArray(o[s])&&(o[s]=Fs(o[s])),!a)}if(c.isFormData(t)&&c.isFunction(t.entries)){let n={};return c.forEachEntry(t,(i,o)=>{e(Us(i),o,n,0)}),n}return null}var tn=Hs;function Gs(t,e,n){if(c.isString(t))try{return(e||JSON.parse)(t),c.trim(t)}catch(i){if(i.name!=="SyntaxError")throw i}return(n||JSON.stringify)(t)}var Yn={transitional:en,adapter:["xhr","http","fetch"],transformRequest:[function(e,n){let i=n.getContentType()||"",o=i.indexOf("application/json")>-1,r=c.isObject(e);if(r&&c.isHTMLForm(e)&&(e=new FormData(e)),c.isFormData(e))return o?JSON.stringify(tn(e)):e;if(c.isArrayBuffer(e)||c.isBuffer(e)||c.isStream(e)||c.isFile(e)||c.isBlob(e)||c.isReadableStream(e))return e;if(c.isArrayBufferView(e))return e.buffer;if(c.isURLSearchParams(e))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(r){if(i.indexOf("application/x-www-form-urlencoded")>-1)return zn(e,this.formSerializer).toString();if((a=c.isFileList(e))||i.indexOf("multipart/form-data")>-1){let l=this.env&&this.env.FormData;return Se(a?{"files[]":e}:e,l&&new l,this.formSerializer)}}return r||o?(n.setContentType("application/json",!1),Gs(e)):e}],transformResponse:[function(e){let n=this.transitional||Yn.transitional,i=n&&n.forcedJSONParsing,o=this.responseType==="json";if(c.isResponse(e)||c.isReadableStream(e))return e;if(e&&c.isString(e)&&(i&&!this.responseType||o)){let s=!(n&&n.silentJSONParsing)&&o;try{return JSON.parse(e,this.parseReviver)}catch(a){if(s)throw a.name==="SyntaxError"?C.from(a,C.ERR_BAD_RESPONSE,this,null,this.response):a}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:B.classes.FormData,Blob:B.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};c.forEach(["delete","get","head","post","put","patch"],t=>{Yn.headers[t]={}});var Ve=Yn;var Vs=c.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),wo=t=>{let e={},n,i,o;return t&&t.split("\n").forEach(function(s){o=s.indexOf(":"),n=s.substring(0,o).trim().toLowerCase(),i=s.substring(o+1).trim(),!(!n||e[n]&&Vs[n])&&(n==="set-cookie"?e[n]?e[n].push(i):e[n]=[i]:e[n]=e[n]?e[n]+", "+i:i)}),e};var bo=Symbol("internals");function mt(t){return t&&String(t).trim().toLowerCase()}function nn(t){return t===!1||t==null?t:c.isArray(t)?t.map(nn):String(t)}function Ks(t){let e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g,i;for(;i=n.exec(t);)e[i[1]]=i[2];return e}var Ws=t=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim());function jn(t,e,n,i,o){if(c.isFunction(i))return i.call(this,e,n);if(o&&(e=n),!!c.isString(e)){if(c.isString(i))return e.indexOf(i)!==-1;if(c.isRegExp(i))return i.test(e)}}function zs(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,n,i)=>n.toUpperCase()+i)}function Ys(t,e){let n=c.toCamelCase(" "+e);["get","set","has"].forEach(i=>{Object.defineProperty(t,i+n,{value:function(o,r,s){return this[i].call(this,e,o,r,s)},configurable:!0})})}var Ke=class{constructor(e){e&&this.set(e)}set(e,n,i){let o=this;function r(a,l,u){let d=mt(l);if(!d)throw new Error("header name must be a non-empty string");let p=c.findKey(o,d);(!p||o[p]===void 0||u===!0||u===void 0&&o[p]!==!1)&&(o[p||l]=nn(a))}let s=(a,l)=>c.forEach(a,(u,d)=>r(u,d,l));if(c.isPlainObject(e)||e instanceof this.constructor)s(e,n);else if(c.isString(e)&&(e=e.trim())&&!Ws(e))s(wo(e),n);else if(c.isObject(e)&&c.isIterable(e)){let a={},l,u;for(let d of e){if(!c.isArray(d))throw TypeError("Object iterator must return a key-value pair");a[u=d[0]]=(l=a[u])?c.isArray(l)?[...l,d[1]]:[l,d[1]]:d[1]}s(a,n)}else e!=null&&r(n,e,i);return this}get(e,n){if(e=mt(e),e){let i=c.findKey(this,e);if(i){let o=this[i];if(!n)return o;if(n===!0)return Ks(o);if(c.isFunction(n))return n.call(this,o,i);if(c.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,n){if(e=mt(e),e){let i=c.findKey(this,e);return!!(i&&this[i]!==void 0&&(!n||jn(this,this[i],i,n)))}return!1}delete(e,n){let i=this,o=!1;function r(s){if(s=mt(s),s){let a=c.findKey(i,s);a&&(!n||jn(i,i[a],a,n))&&(delete i[a],o=!0)}}return c.isArray(e)?e.forEach(r):r(e),o}clear(e){let n=Object.keys(this),i=n.length,o=!1;for(;i--;){let r=n[i];(!e||jn(this,this[r],r,e,!0))&&(delete this[r],o=!0)}return o}normalize(e){let n=this,i={};return c.forEach(this,(o,r)=>{let s=c.findKey(i,r);if(s){n[s]=nn(o),delete n[r];return}let a=e?zs(r):String(r).trim();a!==r&&delete n[r],n[a]=nn(o),i[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let n=Object.create(null);return c.forEach(this,(i,o)=>{i!=null&&i!==!1&&(n[o]=e&&c.isArray(i)?i.join(", "):i)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,n])=>e+": "+n).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...n){let i=new this(e);return n.forEach(o=>i.set(o)),i}static accessor(e){let i=(this[bo]=this[bo]={accessors:{}}).accessors,o=this.prototype;function r(s){let a=mt(s);i[a]||(Ys(o,s),i[a]=!0)}return c.isArray(e)?e.forEach(r):r(e),this}};Ke.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);c.reduceDescriptors(Ke.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(i){this[n]=i}}});c.freezeMethods(Ke);var V=Ke;function ht(t,e){let n=this||Ve,i=e||n,o=V.from(i.headers),r=i.data;return c.forEach(t,function(a){r=a.call(n,r,o.normalize(),e?e.status:void 0)}),o.normalize(),r}function Et(t){return!!(t&&t.__CANCEL__)}function Io(t,e,n){C.call(this,t==null?"canceled":t,C.ERR_CANCELED,e,n),this.name="CanceledError"}c.inherits(Io,C,{__CANCEL__:!0});var ce=Io;function At(t,e,n){let i=n.config.validateStatus;!n.status||!i||i(n.status)?t(n):e(new C("Request failed with status code "+n.status,[C.ERR_BAD_REQUEST,C.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function $n(t){let e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}function js(t,e){t=t||10;let n=new Array(t),i=new Array(t),o=0,r=0,s;return e=e!==void 0?e:1e3,function(l){let u=Date.now(),d=i[r];s||(s=u),n[o]=l,i[o]=u;let p=r,T=0;for(;p!==o;)T+=n[p++],p=p%t;if(o=(o+1)%t,o===r&&(r=(r+1)%t),u-s<e)return;let b=d&&u-d;return b?Math.round(T*1e3/b):void 0}}var So=js;function $s(t,e){let n=0,i=1e3/e,o,r,s=(u,d=Date.now())=>{n=d,o=null,r&&(clearTimeout(r),r=null),t(...u)};return[(...u)=>{let d=Date.now(),p=d-n;p>=i?s(u,d):(o=u,r||(r=setTimeout(()=>{r=null,s(o)},i-p)))},()=>o&&s(o)]}var To=$s;var We=(t,e,n=3)=>{let i=0,o=So(50,250);return To(r=>{let s=r.loaded,a=r.lengthComputable?r.total:void 0,l=s-i,u=o(l),d=s<=a;i=s;let p={loaded:s,total:a,progress:a?s/a:void 0,bytes:l,rate:u||void 0,estimated:u&&a&&d?(a-s)/u:void 0,event:r,lengthComputable:a!=null,[e?"download":"upload"]:!0};t(p)},n)},Xn=(t,e)=>{let n=t!=null;return[i=>e[0]({lengthComputable:n,total:t,loaded:i}),e[1]]},qn=t=>(...e)=>c.asap(()=>t(...e));var Co=B.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,B.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(B.origin),B.navigator&&/(msie|trident)/i.test(B.navigator.userAgent)):()=>!0;var yo=B.hasStandardBrowserEnv?{write(t,e,n,i,o,r,s){if(typeof document=="undefined")return;let a=["".concat(t,"=").concat(encodeURIComponent(e))];c.isNumber(n)&&a.push("expires=".concat(new Date(n).toUTCString())),c.isString(i)&&a.push("path=".concat(i)),c.isString(o)&&a.push("domain=".concat(o)),r===!0&&a.push("secure"),c.isString(s)&&a.push("SameSite=".concat(s)),document.cookie=a.join("; ")},read(t){if(typeof document=="undefined")return null;let e=document.cookie.match(new RegExp("(?:^|; )"+t+"=([^;]*)"));return e?decodeURIComponent(e[1]):null},remove(t){this.write(t,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function Jn(t){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)}function Zn(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}function wt(t,e,n){let i=!Jn(e);return t&&(i||n==!1)?Zn(t,e):e}var Oo=t=>t instanceof V?O({},t):t;function re(t,e){e=e||{};let n={};function i(u,d,p,T){return c.isPlainObject(u)&&c.isPlainObject(d)?c.merge.call({caseless:T},u,d):c.isPlainObject(d)?c.merge({},d):c.isArray(d)?d.slice():d}function o(u,d,p,T){if(c.isUndefined(d)){if(!c.isUndefined(u))return i(void 0,u,p,T)}else return i(u,d,p,T)}function r(u,d){if(!c.isUndefined(d))return i(void 0,d)}function s(u,d){if(c.isUndefined(d)){if(!c.isUndefined(u))return i(void 0,u)}else return i(void 0,d)}function a(u,d,p){if(p in e)return i(u,d);if(p in t)return i(void 0,u)}let l={url:r,method:r,data:r,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:a,headers:(u,d,p)=>o(Oo(u),Oo(d),p,!0)};return c.forEach(Object.keys(O(O({},t),e)),function(d){let p=l[d]||o,T=p(t[d],e[d],d);c.isUndefined(T)&&p!==a||(n[d]=T)}),n}var on=t=>{let e=re({},t),{data:n,withXSRFToken:i,xsrfHeaderName:o,xsrfCookieName:r,headers:s,auth:a}=e;if(e.headers=s=V.from(s),e.url=gt(wt(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),a&&s.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):""))),c.isFormData(n)){if(B.hasStandardBrowserEnv||B.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(c.isFunction(n.getHeaders)){let l=n.getHeaders(),u=["content-type","content-length"];Object.entries(l).forEach(([d,p])=>{u.includes(d.toLowerCase())&&s.set(d,p)})}}if(B.hasStandardBrowserEnv&&(i&&c.isFunction(i)&&(i=i(e)),i||i!==!1&&Co(e.url))){let l=o&&r&&yo.read(r);l&&s.set(o,l)}return e};var Xs=typeof XMLHttpRequest!="undefined",Ro=Xs&&function(t){return new Promise(function(n,i){let o=on(t),r=o.data,s=V.from(o.headers).normalize(),{responseType:a,onUploadProgress:l,onDownloadProgress:u}=o,d,p,T,b,f;function I(){b&&b(),f&&f(),o.cancelToken&&o.cancelToken.unsubscribe(d),o.signal&&o.signal.removeEventListener("abort",d)}let w=new XMLHttpRequest;w.open(o.method.toUpperCase(),o.url,!0),w.timeout=o.timeout;function v(){if(!w)return;let L=V.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),K={data:!a||a==="text"||a==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:L,config:t,request:w};At(function(W){n(W),I()},function(W){i(W),I()},K),w=null}"onloadend"in w?w.onloadend=v:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(v)},w.onabort=function(){w&&(i(new C("Request aborted",C.ECONNABORTED,t,w)),w=null)},w.onerror=function(N){let K=N&&N.message?N.message:"Network Error",_=new C(K,C.ERR_NETWORK,t,w);_.event=N||null,i(_),w=null},w.ontimeout=function(){let N=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded",K=o.transitional||en;o.timeoutErrorMessage&&(N=o.timeoutErrorMessage),i(new C(N,K.clarifyTimeoutError?C.ETIMEDOUT:C.ECONNABORTED,t,w)),w=null},r===void 0&&s.setContentType(null),"setRequestHeader"in w&&c.forEach(s.toJSON(),function(N,K){w.setRequestHeader(K,N)}),c.isUndefined(o.withCredentials)||(w.withCredentials=!!o.withCredentials),a&&a!=="json"&&(w.responseType=o.responseType),u&&([T,f]=We(u,!0),w.addEventListener("progress",T)),l&&w.upload&&([p,b]=We(l),w.upload.addEventListener("progress",p),w.upload.addEventListener("loadend",b)),(o.cancelToken||o.signal)&&(d=L=>{w&&(i(!L||L.type?new ce(null,t,w):L),w.abort(),w=null)},o.cancelToken&&o.cancelToken.subscribe(d),o.signal&&(o.signal.aborted?d():o.signal.addEventListener("abort",d)));let D=$n(o.url);if(D&&B.protocols.indexOf(D)===-1){i(new C("Unsupported protocol "+D+":",C.ERR_BAD_REQUEST,t));return}w.send(r||null)})};var qs=(t,e)=>{let{length:n}=t=t?t.filter(Boolean):[];if(e||n){let i=new AbortController,o,r=function(u){if(!o){o=!0,a();let d=u instanceof Error?u:this.reason;i.abort(d instanceof C?d:new ce(d instanceof Error?d.message:d))}},s=e&&setTimeout(()=>{s=null,r(new C("timeout ".concat(e," of ms exceeded"),C.ETIMEDOUT))},e),a=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(u=>{u.unsubscribe?u.unsubscribe(r):u.removeEventListener("abort",r)}),t=null)};t.forEach(u=>u.addEventListener("abort",r));let{signal:l}=i;return l.unsubscribe=()=>c.asap(a),l}},vo=qs;var Js=function*(t,e){let n=t.byteLength;if(!e||n<e){yield t;return}let i=0,o;for(;i<n;)o=i+e,yield t.slice(i,o),i=o},Zs=function(t,e){return yn(this,null,function*(){try{for(var n=Bi(Qs(t)),i,o,r;i=!(o=yield new ve(n.next())).done;i=!1){let s=o.value;yield*On(Js(s,e))}}catch(o){r=[o]}finally{try{i&&(o=n.return)&&(yield new ve(o.call(n)))}finally{if(r)throw r[0]}}})},Qs=function(t){return yn(this,null,function*(){if(t[Symbol.asyncIterator]){yield*On(t);return}let e=t.getReader();try{for(;;){let{done:n,value:i}=yield new ve(e.read());if(n)break;yield i}}finally{yield new ve(e.cancel())}})},Qn=(t,e,n,i)=>{let o=Zs(t,e),r=0,s,a=l=>{s||(s=!0,i&&i(l))};return new ReadableStream({async pull(l){try{let{done:u,value:d}=await o.next();if(u){a(),l.close();return}let p=d.byteLength;if(n){let T=r+=p;n(T)}l.enqueue(new Uint8Array(d))}catch(u){throw a(u),u}},cancel(l){return a(l),o.return()}},{highWaterMark:2})};var No=64*1024,{isFunction:rn}=c,ea=(({Request:t,Response:e})=>({Request:t,Response:e}))(c.global),{ReadableStream:Po,TextEncoder:xo}=c.global,Lo=(t,...e)=>{try{return!!t(...e)}catch(n){return!1}},ta=t=>{t=c.merge.call({skipUndefined:!0},ea,t);let{fetch:e,Request:n,Response:i}=t,o=e?rn(e):typeof fetch=="function",r=rn(n),s=rn(i);if(!o)return!1;let a=o&&rn(Po),l=o&&(typeof xo=="function"?(f=>I=>f.encode(I))(new xo):async f=>new Uint8Array(await new n(f).arrayBuffer())),u=r&&a&&Lo(()=>{let f=!1,I=new n(B.origin,{body:new Po,method:"POST",get duplex(){return f=!0,"half"}}).headers.has("Content-Type");return f&&!I}),d=s&&a&&Lo(()=>c.isReadableStream(new i("").body)),p={stream:d&&(f=>f.body)};o&&["text","arrayBuffer","blob","formData","stream"].forEach(f=>{!p[f]&&(p[f]=(I,w)=>{let v=I&&I[f];if(v)return v.call(I);throw new C("Response type '".concat(f,"' is not supported"),C.ERR_NOT_SUPPORT,w)})});let T=async f=>{if(f==null)return 0;if(c.isBlob(f))return f.size;if(c.isSpecCompliantForm(f))return(await new n(B.origin,{method:"POST",body:f}).arrayBuffer()).byteLength;if(c.isArrayBufferView(f)||c.isArrayBuffer(f))return f.byteLength;if(c.isURLSearchParams(f)&&(f=f+""),c.isString(f))return(await l(f)).byteLength},b=async(f,I)=>{let w=c.toFiniteNumber(f.getContentLength());return w==null?T(I):w};return async f=>{let{url:I,method:w,data:v,signal:D,cancelToken:L,timeout:N,onDownloadProgress:K,onUploadProgress:_,responseType:W,headers:ae,withCredentials:tt="same-origin",fetchOptions:te}=on(f),Ae=e||fetch;W=W?(W+"").toLowerCase():"text";let j=vo([D,L&&L.toAbortSignal()],N),nt=null,Re=j&&j.unsubscribe&&(()=>{j.unsubscribe()}),Ni;try{if(_&&u&&w!=="get"&&w!=="head"&&(Ni=await b(ae,v))!==0){let be=new n(I,{method:"POST",body:v,duplex:"half"}),ke;if(c.isFormData(v)&&(ke=be.headers.get("content-type"))&&ae.setContentType(ke),be.body){let[Tn,Mt]=Xn(Ni,We(qn(_)));v=Qn(be.body,No,Tn,Mt)}}c.isString(tt)||(tt=tt?"include":"omit");let le=r&&"credentials"in n.prototype,Pi=z(O({},te),{signal:j,method:w.toUpperCase(),headers:ae.normalize().toJSON(),body:v,duplex:"half",credentials:le?tt:void 0});nt=r&&new n(I,Pi);let we=await(r?Ae(nt,te):Ae(I,Pi)),xi=d&&(W==="stream"||W==="response");if(d&&(K||xi&&Re)){let be={};["status","statusText","headers"].forEach(Li=>{be[Li]=we[Li]});let ke=c.toFiniteNumber(we.headers.get("content-length")),[Tn,Mt]=K&&Xn(ke,We(qn(K),!0))||[];we=new i(Qn(we.body,No,Tn,()=>{Mt&&Mt(),Re&&Re()}),be)}W=W||"text";let Cr=await p[c.findKey(p,W)||"text"](we,f);return!xi&&Re&&Re(),await new Promise((be,ke)=>{At(be,ke,{data:Cr,headers:V.from(we.headers),status:we.status,statusText:we.statusText,config:f,request:nt})})}catch(le){throw Re&&Re(),le&&le.name==="TypeError"&&/Load failed|fetch/i.test(le.message)?Object.assign(new C("Network Error",C.ERR_NETWORK,f,nt),{cause:le.cause||le}):C.from(le,le&&le.code,f,nt)}}},na=new Map,ei=t=>{let e=t&&t.env||{},{fetch:n,Request:i,Response:o}=e,r=[i,o,n],s=r.length,a=s,l,u,d=na;for(;a--;)l=r[a],u=d.get(l),u===void 0&&d.set(l,u=a?new Map:ta(e)),d=u;return u},hu=ei();var ti={http:Zt,xhr:Ro,fetch:{get:ei}};c.forEach(ti,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(n){}Object.defineProperty(t,"adapterName",{value:e})}});var _o=t=>"- ".concat(t),oa=t=>c.isFunction(t)||t===null||t===!1;function ra(t,e){t=c.isArray(t)?t:[t];let{length:n}=t,i,o,r={};for(let s=0;s<n;s++){i=t[s];let a;if(o=i,!oa(i)&&(o=ti[(a=String(i)).toLowerCase()],o===void 0))throw new C("Unknown adapter '".concat(a,"'"));if(o&&(c.isFunction(o)||(o=o.get(e))))break;r[a||"#"+s]=o}if(!o){let s=Object.entries(r).map(([l,u])=>"adapter ".concat(l," ")+(u===!1?"is not supported by the environment":"is not available in the build")),a=n?s.length>1?"since :\n"+s.map(_o).join("\n"):" "+_o(s[0]):"as no adapter specified";throw new C("There is no suitable adapter to dispatch the request "+a,"ERR_NOT_SUPPORT")}return o}var sn={getAdapter:ra,adapters:ti};function ni(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new ce(null,t)}function an(t){return ni(t),t.headers=V.from(t.headers),t.data=ht.call(t,t.transformRequest),["post","put","patch"].indexOf(t.method)!==-1&&t.headers.setContentType("application/x-www-form-urlencoded",!1),sn.getAdapter(t.adapter||Ve.adapter,t)(t).then(function(i){return ni(t),i.data=ht.call(t,t.transformResponse,i),i.headers=V.from(i.headers),i},function(i){return Et(i)||(ni(t),i&&i.response&&(i.response.data=ht.call(t,t.transformResponse,i.response),i.response.headers=V.from(i.response.headers))),Promise.reject(i)})}var ln="1.13.0";var cn={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{cn[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}});var ko={};cn.transitional=function(e,n,i){function o(r,s){return"[Axios v"+ln+"] Transitional option '"+r+"'"+s+(i?". "+i:"")}return(r,s,a)=>{if(e===!1)throw new C(o(s," has been removed"+(n?" in "+n:"")),C.ERR_DEPRECATED);return n&&!ko[s]&&(ko[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),e?e(r,s,a):!0}};cn.spelling=function(e){return(n,i)=>(console.warn("".concat(i," is likely a misspelling of ").concat(e)),!0)};function sa(t,e,n){if(typeof t!="object")throw new C("options must be an object",C.ERR_BAD_OPTION_VALUE);let i=Object.keys(t),o=i.length;for(;o-- >0;){let r=i[o],s=e[r];if(s){let a=t[r],l=a===void 0||s(a,r,t);if(l!==!0)throw new C("option "+r+" must be "+l,C.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new C("Unknown option "+r,C.ERR_BAD_OPTION)}}var bt={assertOptions:sa,validators:cn};var ue=bt.validators,ze=class{constructor(e){this.defaults=e||{},this.interceptors={request:new Gn,response:new Gn}}async request(e,n){try{return await this._request(e,n)}catch(i){if(i instanceof Error){let o={};Error.captureStackTrace?Error.captureStackTrace(o):o=new Error;let r=o.stack?o.stack.replace(/^.+\n/,""):"";try{i.stack?r&&!String(i.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(i.stack+="\n"+r):i.stack=r}catch(s){}}throw i}}_request(e,n){typeof e=="string"?(n=n||{},n.url=e):n=e||{},n=re(this.defaults,n);let{transitional:i,paramsSerializer:o,headers:r}=n;i!==void 0&&bt.assertOptions(i,{silentJSONParsing:ue.transitional(ue.boolean),forcedJSONParsing:ue.transitional(ue.boolean),clarifyTimeoutError:ue.transitional(ue.boolean)},!1),o!=null&&(c.isFunction(o)?n.paramsSerializer={serialize:o}:bt.assertOptions(o,{encode:ue.function,serialize:ue.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),bt.assertOptions(n,{baseUrl:ue.spelling("baseURL"),withXsrfToken:ue.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=r&&c.merge(r.common,r[n.method]);r&&c.forEach(["delete","get","head","post","put","patch","common"],f=>{delete r[f]}),n.headers=V.concat(s,r);let a=[],l=!0;this.interceptors.request.forEach(function(I){typeof I.runWhen=="function"&&I.runWhen(n)===!1||(l=l&&I.synchronous,a.unshift(I.fulfilled,I.rejected))});let u=[];this.interceptors.response.forEach(function(I){u.push(I.fulfilled,I.rejected)});let d,p=0,T;if(!l){let f=[an.bind(this),void 0];for(f.unshift(...a),f.push(...u),T=f.length,d=Promise.resolve(n);p<T;)d=d.then(f[p++],f[p++]);return d}T=a.length;let b=n;for(;p<T;){let f=a[p++],I=a[p++];try{b=f(b)}catch(w){I.call(this,w);break}}try{d=an.call(this,b)}catch(f){return Promise.reject(f)}for(p=0,T=u.length;p<T;)d=d.then(u[p++],u[p++]);return d}getUri(e){e=re(this.defaults,e);let n=wt(e.baseURL,e.url,e.allowAbsoluteUrls);return gt(n,e.params,e.paramsSerializer)}};c.forEach(["delete","get","head","options"],function(e){ze.prototype[e]=function(n,i){return this.request(re(i||{},{method:e,url:n,data:(i||{}).data}))}});c.forEach(["post","put","patch"],function(e){function n(i){return function(r,s,a){return this.request(re(a||{},{method:e,headers:i?{"Content-Type":"multipart/form-data"}:{},url:r,data:s}))}}ze.prototype[e]=n(),ze.prototype[e+"Form"]=n(!0)});var It=ze;var ii=class t{constructor(e){if(typeof e!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(r){n=r});let i=this;this.promise.then(o=>{if(!i._listeners)return;let r=i._listeners.length;for(;r-- >0;)i._listeners[r](o);i._listeners=null}),this.promise.then=o=>{let r,s=new Promise(a=>{i.subscribe(a),r=a}).then(o);return s.cancel=function(){i.unsubscribe(r)},s},e(function(r,s,a){i.reason||(i.reason=new ce(r,s,a),n(i.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let n=this._listeners.indexOf(e);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){let e=new AbortController,n=i=>{e.abort(i)};return this.subscribe(n),e.signal.unsubscribe=()=>this.unsubscribe(n),e.signal}static source(){let e;return{token:new t(function(o){e=o}),cancel:e}}},Do=ii;function oi(t){return function(n){return t.apply(null,n)}}function ri(t){return c.isObject(t)&&t.isAxiosError===!0}var si={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(si).forEach(([t,e])=>{si[e]=t});var Bo=si;function Mo(t){let e=new It(t),n=ut(It.prototype.request,e);return c.extend(n,It.prototype,e,{allOwnKeys:!0}),c.extend(n,e,null,{allOwnKeys:!0}),n.create=function(o){return Mo(re(t,o))},n}var F=Mo(Ve);F.Axios=It;F.CanceledError=ce;F.CancelToken=Do;F.isCancel=Et;F.VERSION=ln;F.toFormData=Se;F.AxiosError=C;F.Cancel=F.CanceledError;F.all=function(e){return Promise.all(e)};F.spread=oi;F.isAxiosError=ri;F.mergeConfig=re;F.AxiosHeaders=V;F.formToJSON=t=>tn(c.isHTMLForm(t)?new FormData(t):t);F.getAdapter=sn.getAdapter;F.HttpStatusCode=Bo;F.default=F;var un=F;var{Axios:gd,AxiosError:md,CanceledError:hd,isCancel:Ed,CancelToken:Ad,VERSION:wd,all:bd,Cancel:Id,isAxiosError:Sd,spread:Td,toFormData:Cd,AxiosHeaders:yd,HttpStatusCode:Od,formToJSON:Rd,getAdapter:vd,mergeConfig:Nd}=un;var St=class{constructor(e){this.currentToken=null;this.tokenProvider=null;this.requestHistory=new Map;this.WINDOW_MS=5e3;this.MAX_REQUESTS=30;this.axios=un.create({baseURL:e.baseURL,timeout:e.timeout||6e4,headers:O({"Content-Type":"application/json"},e.headers)}),typeof setInterval!="undefined"&&setInterval(()=>this.cleanupHistory(),1e4),this.axios.interceptors.request.use(async n=>{var i,o;if(n.url)try{this.checkRequestLimit("".concat((i=n.method)==null?void 0:i.toUpperCase(),":").concat(n.url))}catch(r){return console.error("[SDK] \u{1F6D1} Request blocked by Circuit Breaker:",r),Promise.reject(r)}if(!n.skipAuth&&!this.currentToken&&this.tokenProvider)try{console.log("[SDK] Waiting for token...");let r=await this.tokenProvider();r&&(this.updateToken(r),n.headers["x-cms-token"]=r)}catch(r){console.error("[SDK] Failed to get token from provider:",r)}return!n.skipAuth&&this.currentToken&&(n.headers["x-cms-token"]=this.currentToken),console.log("[SDK] Making ".concat((o=n.method)==null?void 0:o.toUpperCase()," request to: ").concat(n.baseURL||"").concat(n.url)),n},n=>(console.error("[SDK] Request error:",n),Promise.reject(n instanceof Error?n:new Error(String(n))))),this.axios.interceptors.response.use(n=>n,n=>(console.error("[SDK] Response error:",n.message),Promise.reject(n instanceof Error?n:new Error(String(n)))))}setTokenProvider(e){this.tokenProvider=e}async get(e,n){return(await this.axios.get(e,n)).data}async post(e,n,i){return(await this.axios.post(e,n,i)).data}async put(e,n,i){return(await this.axios.put(e,n,i)).data}async patch(e,n,i){return(await this.axios.patch(e,n,i)).data}async delete(e,n){return(await this.axios.delete(e,n)).data}setHeader(e,n){this.axios.defaults.headers.common[e]=n}removeHeader(e){delete this.axios.defaults.headers.common[e]}updateToken(e){this.currentToken=e,e?this.setHeader("x-cms-token",e):(this.removeHeader("x-cms-token"),console.log("[SDK] Token removed from ApiClient"))}getCurrentToken(){return this.currentToken}updateConfig(e){e.baseURL&&(this.axios.defaults.baseURL=e.baseURL),e.timeout&&(this.axios.defaults.timeout=e.timeout),e.headers&&Object.assign(this.axios.defaults.headers.common,e.headers),console.log("[SDK] ApiClient configuration updated")}checkRequestLimit(e){let n=Date.now(),i=this.requestHistory.get(e);if(!i){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(n-i.firstRequestTime>this.WINDOW_MS){this.requestHistory.set(e,{count:1,firstRequestTime:n});return}if(i.count++,i.count>this.MAX_REQUESTS){let o=new Error("Circuit Breaker: Too many requests to ".concat(e," (").concat(i.count," in ").concat(this.WINDOW_MS,"ms)"));throw o.isCircuitBreaker=!0,o}}cleanupHistory(){let e=Date.now();for(let[n,i]of this.requestHistory.entries())e-i.firstRequestTime>this.WINDOW_MS&&this.requestHistory.delete(n)}};var aa="2.0.6",la=500,Uo="user-agent",Je="",Fo="?",M={FUNCTION:"function",OBJECT:"object",STRING:"string",UNDEFINED:"undefined"},J="browser",ge="cpu",pe="device",se="engine",Q="os",Xe="result",h="name",g="type",E="vendor",A="version",$="architecture",xt="major",m="model",Nt="console",y="mobile",P="tablet",H="smarttv",de="wearable",dn="xr",Pt="embedded",Ye="inapp",bi="brands",Le="formFactors",Ii="fullVersionList",qe="platform",Si="platformVersion",An="bitness",Oe="sec-ch-ua",ca=Oe+"-full-version-list",ua=Oe+"-arch",da=Oe+"-"+An,fa=Oe+"-form-factors",pa=Oe+"-"+y,ga=Oe+"-"+m,Qo=Oe+"-"+qe,ma=Qo+"-version",er=[bi,Ii,y,m,qe,Si,$,Le,An],fn="Amazon",je="Apple",Ho="ASUS",Go="BlackBerry",xe="Google",Vo="Huawei",ai="Lenovo",Ko="Honor",pn="LG",li="Microsoft",ci="Motorola",ui="Nvidia",Wo="OnePlus",di="OPPO",Tt="Samsung",zo="Sharp",Ct="Sony",fi="Xiaomi",pi="Zebra",Yo="Chrome",jo="Chromium",Te="Chromecast",mn="Edge",yt="Firefox",Ot="Opera",gi="Facebook",$o="Sogou",$e="Mobile ",Rt=" Browser",Ai="Windows",ha=typeof window!==M.UNDEFINED,Z=ha&&window.navigator?window.navigator:void 0,Ce=Z&&Z.userAgentData?Z.userAgentData:void 0,Ea=function(t,e){var n={},i=e;if(!hn(e)){i={};for(var o in e)for(var r in e[o])i[r]=e[o][r].concat(i[r]?i[r]:[])}for(var s in t)n[s]=i[s]&&i[s].length%2===0?i[s].concat(t[s]):t[s];return n},wn=function(t){for(var e={},n=0;n<t.length;n++)e[t[n].toUpperCase()]=t[n];return e},wi=function(t,e){if(typeof t===M.OBJECT&&t.length>0){for(var n in t)if(ye(e)==ye(t[n]))return!0;return!1}return Lt(t)?ye(e)==ye(t):!1},hn=function(t,e){for(var n in t)return/^(browser|cpu|device|engine|os)$/.test(n)||(e?hn(t[n]):!1)},Lt=function(t){return typeof t===M.STRING},mi=function(t){if(t){for(var e=[],n=Ze(/\\?\"/g,t).split(","),i=0;i<n.length;i++)if(n[i].indexOf(";")>-1){var o=En(n[i]).split(";v=");e[i]={brand:o[0],version:o[1]}}else e[i]=En(n[i]);return e}},ye=function(t){return Lt(t)?t.toLowerCase():t},hi=function(t){return Lt(t)?Ze(/[^\d\.]/g,t).split(".")[0]:void 0},me=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];typeof n==M.OBJECT&&n.length==2?this[n[0]]=n[1]:this[n]=void 0}return this},Ze=function(t,e){return Lt(e)?e.replace(t,Je):e},vt=function(t){return Ze(/\\?\"/g,t)},En=function(t,e){return t=Ze(/^\s\s*/,String(t)),typeof e===M.UNDEFINED?t:t.substring(0,e)},Ei=function(t,e){if(!(!t||!e))for(var n=0,i,o,r,s,a,l;n<e.length&&!a;){var u=e[n],d=e[n+1];for(i=o=0;i<u.length&&!a&&u[i];)if(a=u[i++].exec(t),a)for(r=0;r<d.length;r++)l=a[++o],s=d[r],typeof s===M.OBJECT&&s.length>0?s.length===2?typeof s[1]==M.FUNCTION?this[s[0]]=s[1].call(this,l):this[s[0]]=s[1]:s.length>=3&&(typeof s[1]===M.FUNCTION&&!(s[1].exec&&s[1].test)?s.length>3?this[s[0]]=l?s[1].apply(this,s.slice(2)):void 0:this[s[0]]=l?s[1].call(this,l,s[2]):void 0:s.length==3?this[s[0]]=l?l.replace(s[1],s[2]):void 0:s.length==4?this[s[0]]=l?s[3].call(this,l.replace(s[1],s[2])):void 0:s.length>4&&(this[s[0]]=l?s[3].apply(this,[l.replace(s[1],s[2])].concat(s.slice(4))):void 0)):this[s]=l||void 0;n+=2}},fe=function(t,e){for(var n in e)if(typeof e[n]===M.OBJECT&&e[n].length>0){for(var i=0;i<e[n].length;i++)if(wi(e[n][i],t))return n===Fo?void 0:n}else if(wi(e[n],t))return n===Fo?void 0:n;return e.hasOwnProperty("*")?e["*"]:t},Xo={ME:"4.90","NT 3.51":"3.51","NT 4.0":"4.0",2e3:["5.0","5.01"],XP:["5.1","5.2"],Vista:"6.0",7:"6.1",8:"6.2","8.1":"6.3",10:["6.4","10.0"],NT:""},qo={embedded:"Automotive",mobile:"Mobile",tablet:["Tablet","EInk"],smarttv:"TV",wearable:"Watch",xr:["VR","XR"],"?":["Desktop","Unknown"],"*":void 0},Aa={Chrome:"Google Chrome",Edge:"Microsoft Edge","Edge WebView2":"Microsoft Edge WebView2","Chrome WebView":"Android WebView","Chrome Headless":"HeadlessChrome","Huawei Browser":"HuaweiBrowser","MIUI Browser":"Miui Browser","Opera Mobi":"OperaMobile",Yandex:"YaBrowser"},Jo={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[A,[h,$e+"Chrome"]],[/webview.+edge\/([\w\.]+)/i],[A,[h,mn+" WebView"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[A,[h,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[h,A],[/opios[\/ ]+([\w\.]+)/i],[A,[h,Ot+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[A,[h,Ot+" GX"]],[/\bopr\/([\w\.]+)/i],[A,[h,Ot]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[A,[h,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[A,[h,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon|otter|dooble|(?:lg |qute)browser|palemoon)\/([-\w\.]+)/i,/(heytap|ovi|115|surf|qwant)browser\/([\d\.]+)/i,/(qwant)(?:ios|mobile)\/([\d\.]+)/i,/(ecosia|weibo)(?:__| \w+@)([\d\.]+)/i],[h,A],[/quark(?:pc)?\/([-\w\.]+)/i],[A,[h,"Quark"]],[/\bddg\/([\w\.]+)/i],[A,[h,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[A,[h,"UCBrowser"]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[A,[h,"WeChat"]],[/konqueror\/([\w\.]+)/i],[A,[h,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[A,[h,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[A,[h,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[A,[h,"Smart "+ai+Rt]],[/(avast|avg)\/([\w\.]+)/i],[[h,/(.+)/,"$1 Secure"+Rt],A],[/\bfocus\/([\w\.]+)/i],[A,[h,yt+" Focus"]],[/\bopt\/([\w\.]+)/i],[A,[h,Ot+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[A,[h,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[A,[h,"Dolphin"]],[/coast\/([\w\.]+)/i],[A,[h,Ot+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[A,[h,"MIUI"+Rt]],[/fxios\/([\w\.-]+)/i],[A,[h,$e+yt]],[/\bqihoobrowser\/?([\w\.]*)/i],[A,[h,"360"]],[/\b(qq)\/([\w\.]+)/i],[[h,/(.+)/,"$1Browser"],A],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[h,/(.+)/,"$1"+Rt],A],[/samsungbrowser\/([\w\.]+)/i],[A,[h,Tt+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[A,[h,$o+" Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[h,$o+" Mobile"],A],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[h,A],[/(lbbrowser|rekonq)/i],[h],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[A,h],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[h,gi],A,[g,Ye]],[/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\w\.]+)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(bing)(?:web|sapphire)\/([\w\.]+)/i,/(instagram|snapchat|klarna)[\/ ]([-\w\.]+)/i],[h,A,[g,Ye]],[/\bgsa\/([\w\.]+) .*safari\//i],[A,[h,"GSA"],[g,Ye]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[A,[h,"TikTok"],[g,Ye]],[/\[(linkedin)app\]/i],[h,[g,Ye]],[/(zalo(?:app)?)[\/\sa-z]*([\w\.-]+)/i],[[h,/(.+)/,"Zalo"],A,[g,Ye]],[/(chromium)[\/ ]([-\w\.]+)/i],[h,A],[/headlesschrome(?:\/([\w\.]+)| )/i],[A,[h,Yo+" Headless"]],[/wv\).+chrome\/([\w\.]+).+edgw\//i],[A,[h,mn+" WebView2"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[h,Yo+" WebView"],A],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[A,[h,"Android"+Rt]],[/chrome\/([\w\.]+) mobile/i],[A,[h,$e+"Chrome"]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[h,A],[/version\/([\w\.\,]+) .*mobile(?:\/\w+ | ?)safari/i],[A,[h,$e+"Safari"]],[/iphone .*mobile(?:\/\w+ | ?)safari/i],[[h,$e+"Safari"]],[/version\/([\w\.\,]+) .*(safari)/i],[A,h],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[h,[A,"1"]],[/(webkit|khtml)\/([\w\.]+)/i],[h,A],[/(?:mobile|tablet);.*(firefox)\/([\w\.-]+)/i],[[h,$e+yt],A],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[h,"Netscape"],A],[/(wolvic|librewolf)\/([\w\.]+)/i],[h,A],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[A,[h,yt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+(?= .+rv\:.+gecko\/\d+)|[0-4][\w\.]+(?!.+compatible))/i,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[h,[A,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[h,[A,/[^\d\.]+./,Je]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[$,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[$,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[$,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[$,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[$,"arm"]],[/ sun4\w[;\)]/i],[[$,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i,/((ppc|powerpc)(64)?)( mac|;|\))/i,/(?:osf1|[freopnt]{3,4}bsd) (alpha)/i],[[$,/ower/,Je,ye]],[/mc680.0/i],[[$,"68k"]],[/winnt.+\[axp/i],[[$,"alpha"]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[m,[E,Tt],[g,P]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr]|browser)[-\w]+)/i,/sec-(sgh\w+)/i],[m,[E,Tt],[g,y]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)[\/\);]/i],[m,[E,je],[g,y]],[/\b(?:ios|apple\w+)\/.+[\(\/](ipad)/i,/\b(ipad)[\d,]*[;\] ].+(mac |i(pad)?)os/i],[m,[E,je],[g,P]],[/(macintosh);/i],[m,[E,je]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[m,[E,zo],[g,y]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[m,[E,Ko],[g,P]],[/honor([-\w ]+)[;\)]/i],[m,[E,Ko],[g,y]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[m,[E,Vo],[g,P]],[/(?:huawei) ?([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][\dc][adnt]?)\b(?!.+d\/s)/i],[m,[E,Vo],[g,y]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b(?:xiao)?((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[m,/_/g," "],[E,fi],[g,P]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note|max|cc)?[_ ]?(?:\d{0,2}\w?)[_ ]?(?:plus|se|lite|pro)?( 5g|lte)?)(?: bui|\))/i,/ ([\w ]+) miui\/v?\d/i],[[m,/_/g," "],[E,fi],[g,y]],[/droid.+; (cph2[3-6]\d[13579]|((gm|hd)19|(ac|be|in|kb)20|(d[en]|eb|le|mt)21|ne22)[0-2]\d|p[g-k]\w[1m]10)\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[m,[E,Wo],[g,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[m,[E,di],[g,y]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[m,[E,fe,{OnePlus:["203","304","403","404","413","415"],"*":di}],[g,P]],[/(vivo (5r?|6|8l?|go|one|s|x[il]?[2-4]?)[\w\+ ]*)(?: bui|\))/i],[m,[E,"BLU"],[g,y]],[/; vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[m,[E,"Vivo"],[g,y]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[m,[E,"Realme"],[g,y]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[m,[E,ai],[g,P]],[/lenovo[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i],[m,[E,ai],[g,y]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ]([\w\s]+)(\)| bui)/i,/((?:moto(?! 360)[-\w\(\) ]+|xt\d{3,4}[cgkosw\+]?[-\d]*|nexus 6)(?= bui|\)))/i],[m,[E,ci],[g,y]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[m,[E,ci],[g,P]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[m,[E,pn],[g,P]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+(?!.*(?:browser|netcast|android tv|watch|webos))(\w+)/i,/\blg-?([\d\w]+) bui/i],[m,[E,pn],[g,y]],[/(nokia) (t[12][01])/i],[E,m,[g,P]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*?))( bui|\)|;|\/)/i],[[m,/_/g," "],[g,y],[E,"Nokia"]],[/(pixel (c|tablet))\b/i],[m,[E,xe],[g,P]],[/droid.+;(?: google)? (g(01[13]a|020[aem]|025[jn]|1b60|1f8f|2ybb|4s1m|576d|5nz6|8hhn|8vou|a02099|c15s|d1yq|e2ae|ec77|gh2x|kv4x|p4bc|pj41|r83y|tt9q|ur25|wvk6)|pixel[\d ]*a?( pro)?( xl)?( fold)?( \(5g\))?)( bui|\))/i],[m,[E,xe],[g,y]],[/(google) (pixelbook( go)?)/i],[E,m],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-\w\w\d\d)(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[m,[E,Ct],[g,y]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[m,"Xperia Tablet"],[E,Ct],[g,P]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[m,[E,fn],[g,P]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[m,/(.+)/g,"Fire Phone $1"],[E,fn],[g,y]],[/(playbook);[-\w\),; ]+(rim)/i],[m,E,[g,P]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/(?:blackberry|\(bb10;) (\w+)/i],[m,[E,Go],[g,y]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[m,[E,Ho],[g,P]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[m,[E,Ho],[g,y]],[/(nexus 9)/i],[m,[E,"HTC"],[g,P]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[E,[m,/_/g," "],[g,y]],[/tcl (xess p17aa)/i,/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])(_\w(\w|\w\w))?(\)| bui)/i],[m,[E,"TCL"],[g,P]],[/droid [\w\.]+; (418(?:7d|8v)|5087z|5102l|61(?:02[dh]|25[adfh]|27[ai]|56[dh]|59k|65[ah])|a509dl|t(?:43(?:0w|1[adepqu])|50(?:6d|7[adju])|6(?:09dl|10k|12b|71[efho]|76[hjk])|7(?:66[ahju]|67[hw]|7[045][bh]|71[hk]|73o|76[ho]|79w|81[hks]?|82h|90[bhsy]|99b)|810[hs]))(_\w(\w|\w\w))?(\)| bui)/i],[m,[E,"TCL"],[g,y]],[/(itel) ((\w+))/i],[[E,ye],m,[g,fe,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[m,[E,"Acer"],[g,P]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[m,[E,"Meizu"],[g,y]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[m,[E,"Ulefone"],[g,y]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[m,[E,"Energizer"],[g,y]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[m,[E,"Cat"],[g,y]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[m,[E,"Smartfren"],[g,y]],[/droid.+; (a(in)?(0(15|59|6[35])|142)p?)/i],[m,[E,"Nothing"],[g,y]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[m,[E,"Archos"],[g,P]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[m,[E,"Archos"],[g,y]],[/; (n159v)/i],[m,[E,"HMD"],[g,y]],[/(imo) (tab \w+)/i,/(infinix|tecno) (x1101b?|p904|dp(7c|8d|10a)( pro)?|p70[1-3]a?|p904|t1101)/i],[E,m,[g,P]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (blu|hmd|imo|infinix|lava|oneplus|tcl|wiko)[_ ]([\w\+ ]+?)(?: bui|\)|; r)/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(oppo) ?([\w ]+) bui/i,/(hisense) ([ehv][\w ]+)\)/i,/droid[^;]+; (philips)[_ ]([sv-x][\d]{3,4}[xz]?)/i],[E,m,[g,y]],[/(kobo)\s(ereader|touch)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i],[E,m,[g,P]],[/(surface duo)/i],[m,[E,li],[g,P]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[m,[E,"Fairphone"],[g,y]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[m,[E,ui],[g,P]],[/(sprint) (\w+)/i],[E,m,[g,y]],[/(kin\.[onetw]{3})/i],[[m,/\./g," "],[E,li],[g,y]],[/droid.+; ([c6]+|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[m,[E,pi],[g,P]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[m,[E,pi],[g,y]],[/(philips)[\w ]+tv/i,/smart-tv.+(samsung)/i],[E,[g,H]],[/hbbtv.+maple;(\d+)/i],[[m,/^/,"SmartTV"],[E,Tt],[g,H]],[/(vizio)(?: |.+model\/)(\w+-\w+)/i,/tcast.+(lg)e?. ([-\w]+)/i],[E,m,[g,H]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[E,pn],[g,H]],[/(apple) ?tv/i],[E,[m,je+" TV"],[g,H]],[/crkey.*devicetype\/chromecast/i],[[m,Te+" Third Generation"],[E,xe],[g,H]],[/crkey.*devicetype\/([^/]*)/i],[[m,/^/,"Chromecast "],[E,xe],[g,H]],[/fuchsia.*crkey/i],[[m,Te+" Nest Hub"],[E,xe],[g,H]],[/crkey/i],[[m,Te],[E,xe],[g,H]],[/(portaltv)/i],[m,[E,gi],[g,H]],[/droid.+aft(\w+)( bui|\))/i],[m,[E,fn],[g,H]],[/(shield \w+ tv)/i],[m,[E,ui],[g,H]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[m,[E,zo],[g,H]],[/(bravia[\w ]+)( bui|\))/i],[m,[E,Ct],[g,H]],[/(mi(tv|box)-?\w+) bui/i],[m,[E,fi],[g,H]],[/Hbbtv.*(technisat) (.*);/i],[E,m,[g,H]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[E,/.+\/(\w+)/,"$1",fe,{LG:"lge"}],[m,En],[g,H]],[/(playstation \w+)/i],[m,[E,Ct],[g,Nt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[m,[E,li],[g,Nt]],[/(ouya)/i,/(nintendo) (\w+)/i,/(retroid) (pocket ([^\)]+))/i],[E,m,[g,Nt]],[/droid.+; (shield)( bui|\))/i],[m,[E,ui],[g,Nt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[m,[E,Tt],[g,de]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[E,m,[g,de]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[m,[E,di],[g,de]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[m,[E,je],[g,de]],[/(opwwe\d{3})/i],[m,[E,Wo],[g,de]],[/(moto 360)/i],[m,[E,ci],[g,de]],[/(smartwatch 3)/i],[m,[E,Ct],[g,de]],[/(g watch r)/i],[m,[E,pn],[g,de]],[/droid.+; (wt63?0{2,3})\)/i],[m,[E,pi],[g,de]],[/droid.+; (glass) \d/i],[m,[E,xe],[g,dn]],[/(pico) ([\w ]+) os\d/i],[E,m,[g,dn]],[/(quest( \d| pro)?s?).+vr/i],[m,[E,gi],[g,dn]],[/mobile vr; rv.+firefox/i],[[g,dn]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[E,[g,Pt]],[/(aeobc)\b/i],[m,[E,fn],[g,Pt]],[/(homepod).+mac os/i],[m,[E,je],[g,Pt]],[/windows iot/i],[[g,Pt]],[/droid.+; ([\w- ]+) (4k|android|smart|google)[- ]?tv/i],[m,[g,H]],[/\b((4k|android|smart|opera)[- ]?tv|tv; rv:|large screen[\w ]+safari)\b/i],[[g,H]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew|; hmsc).+?(mobile|vr|\d) safari/i],[m,[g,fe,{mobile:"Mobile",xr:"VR","*":P}]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[g,P]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[g,y]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[m,[E,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[A,[h,mn+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[h,A],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[A,[h,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[h,A],[/ladybird\//i],[[h,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[A,h]],os:[[/(windows nt) (6\.[23]); arm/i],[[h,/N/,"R"],[A,fe,Xo]],[/(windows (?:phone|mobile|iot))(?: os)?[\/ ]?([\d\.]*( se)?)/i,/(windows)[\/ ](1[01]|2000|3\.1|7|8(\.1)?|9[58]|me|server 20\d\d( r2)?|vista|xp)/i],[h,A],[/windows nt ?([\d\.\)]*)(?!.+xbox)/i,/\bwin(?=3| ?9|n)(?:nt| 9x )?([\d\.;]*)/i],[[A,/(;|\))/g,"",fe,Xo],[h,Ai]],[/(windows ce)\/?([\d\.]*)/i],[h,A],[/[adehimnop]{4,7}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv|ios(?=.+ip(?:ad|hone))|ip(?:ad|hone)(?: |.+i(?:pad)?)os)[\/ ]([\w\.]+)/i,/cfnetwork\/.+darwin/i],[[A,/_/g,"."],[h,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+(haiku|morphos))/i],[[h,"macOS"],[A,/_/g,"."]],[/android ([\d\.]+).*crkey/i],[A,[h,Te+" Android"]],[/fuchsia.*crkey\/([\d\.]+)/i],[A,[h,Te+" Fuchsia"]],[/crkey\/([\d\.]+).*devicetype\/smartspeaker/i],[A,[h,Te+" SmartSpeaker"]],[/linux.*crkey\/([\d\.]+)/i],[A,[h,Te+" Linux"]],[/crkey\/([\d\.]+)/i],[A,[h,Te]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[A,h],[/(ubuntu) ([\w\.]+) like android/i],[[h,/(.+)/,"$1 Touch"],A],[/(harmonyos)[\/ ]?([\d\.]*)/i,/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen)\w*[-\/\.; ]?([\d\.]*)/i],[h,A],[/\(bb(10);/i],[A,[h,Go]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[A,[h,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[A,[h,yt+" OS"]],[/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i,/webos(?:[ \/]?|\.tv-20(?=2[2-9]))(\d[\d\.]*)/i],[A,[h,"webOS"]],[/web0s;.+?(?:chr[o0]me|safari)\/(\d+)/i],[[A,fe,{25:"120",24:"108",23:"94",22:"87",6:"79",5:"68",4:"53",3:"38",2:"538",1:"537","*":"TV"}],[h,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[A,[h,"watchOS"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[h,"Chrome OS"],A],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) (\w+)/i,/(xbox); +xbox ([^\);]+)/i,/(pico) .+os([\w\.]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/linux.+(mint)[\/\(\) ]?([\w\.]*)/i,/(mageia|vectorlinux|fuchsia|arcaos|arch(?= ?linux))[;l ]([\d\.]*)/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire|knoppix)(?: gnu[\/ ]linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/\b(aix)[; ]([1-9\.]{0,4})/i,/(hurd|linux|morphos)(?: (?:arm|x86|ppc)\w*| ?)([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) ?(r\d)?/i],[h,A],[/(sunos) ?([\d\.]*)/i],[[h,"Solaris"],A],[/\b(beos|os\/2|amigaos|openvms|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[h,A]]},gn=function(){var t={init:{},isIgnore:{},isIgnoreRgx:{},toString:{}};return me.call(t.init,[[J,[h,A,xt,g]],[ge,[$]],[pe,[g,m,E]],[se,[h,A]],[Q,[h,A]]]),me.call(t.isIgnore,[[J,[A,xt]],[se,[A]],[Q,[A]]]),me.call(t.isIgnoreRgx,[[J,/ ?browser$/i],[Q,/ ?os$/i]]),me.call(t.toString,[[J,[h,A]],[ge,[$]],[pe,[E,m]],[se,[h,A]],[Q,[h,A]]]),t}(),wa=function(t,e){var n=gn.init[e],i=gn.isIgnore[e]||0,o=gn.isIgnoreRgx[e]||0,r=gn.toString[e]||0;function s(){me.call(this,n)}return s.prototype.getItem=function(){return t},s.prototype.withClientHints=function(){return Ce?Ce.getHighEntropyValues(er).then(function(a){return t.setCH(new tr(a,!1)).parseCH().get()}):t.parseCH().get()},s.prototype.withFeatureCheck=function(){return t.detectFeature().get()},e!=Xe&&(s.prototype.is=function(a){var l=!1;for(var u in this)if(this.hasOwnProperty(u)&&!wi(i,u)&&ye(o?Ze(o,this[u]):this[u])==ye(o?Ze(o,a):a)){if(l=!0,a!=M.UNDEFINED)break}else if(a==M.UNDEFINED&&l){l=!l;break}return l},s.prototype.toString=function(){var a=Je;for(var l in r)typeof this[r[l]]!==M.UNDEFINED&&(a+=(a?" ":Je)+this[r[l]]);return a||M.UNDEFINED}),Ce||(s.prototype.then=function(a){var l=this,u=function(){for(var p in l)l.hasOwnProperty(p)&&(this[p]=l[p])};u.prototype={is:s.prototype.is,toString:s.prototype.toString};var d=new u;return a(d),d}),new s};function tr(t,e){if(t=t||{},me.call(this,er),e)me.call(this,[[bi,mi(t[Oe])],[Ii,mi(t[ca])],[y,/\?1/.test(t[pa])],[m,vt(t[ga])],[qe,vt(t[Qo])],[Si,vt(t[ma])],[$,vt(t[ua])],[Le,mi(t[fa])],[An,vt(t[da])]]);else for(var n in t)this.hasOwnProperty(n)&&typeof t[n]!==M.UNDEFINED&&(this[n]=t[n])}function Zo(t,e,n,i){return this.get=function(o){return o?this.data.hasOwnProperty(o)?this.data[o]:void 0:this.data},this.set=function(o,r){return this.data[o]=r,this},this.setCH=function(o){return this.uaCH=o,this},this.detectFeature=function(){if(Z&&Z.userAgent==this.ua)switch(this.itemType){case J:Z.brave&&typeof Z.brave.isBrave==M.FUNCTION&&this.set(h,"Brave");break;case pe:!this.get(g)&&Ce&&Ce[y]&&this.set(g,y),this.get(m)=="Macintosh"&&Z&&typeof Z.standalone!==M.UNDEFINED&&Z.maxTouchPoints&&Z.maxTouchPoints>2&&this.set(m,"iPad").set(g,P);break;case Q:!this.get(h)&&Ce&&Ce[qe]&&this.set(h,Ce[qe]);break;case Xe:var o=this.data,r=function(s){return o[s].getItem().detectFeature().get()};this.set(J,r(J)).set(ge,r(ge)).set(pe,r(pe)).set(se,r(se)).set(Q,r(Q))}return this},this.parseUA=function(){switch(this.itemType!=Xe&&Ei.call(this.data,this.ua,this.rgxMap),this.itemType){case J:this.set(xt,hi(this.get(A)));break;case Q:if(this.get(h)=="iOS"&&this.get(A)=="18.6"){var o=/\) Version\/([\d\.]+)/.exec(this.ua);o&&parseInt(o[1].substring(0,2),10)>=26&&this.set(A,o[1])}break}return this},this.parseCH=function(){var o=this.uaCH,r=this.rgxMap;switch(this.itemType){case J:case se:var s=o[Ii]||o[bi],a;if(s)for(var l=0;l<s.length;l++){var u=s[l].brand||s[l],d=s[l].version;this.itemType==J&&!/not.a.brand/i.test(u)&&(!a||/Chrom/.test(a)&&u!=jo||a==mn&&/WebView2/.test(u))&&(u=fe(u,Aa),a=this.get(h),a&&!/Chrom/.test(a)&&/Chrom/.test(u)||this.set(h,u).set(A,d).set(xt,hi(d)),a=u),this.itemType==se&&u==jo&&this.set(A,d)}break;case ge:var p=o[$];p&&(p&&o[An]=="64"&&(p+="64"),Ei.call(this.data,p+";",r));break;case pe:if(o[y]&&this.set(g,y),o[m]&&(this.set(m,o[m]),!this.get(g)||!this.get(E))){var T={};Ei.call(T,"droid 9; "+o[m]+")",r),!this.get(g)&&T.type&&this.set(g,T.type),!this.get(E)&&T.vendor&&this.set(E,T.vendor)}if(o[Le]){var b;if(typeof o[Le]!="string")for(var f=0;!b&&f<o[Le].length;)b=fe(o[Le][f++],qo);else b=fe(o[Le],qo);this.set(g,b)}break;case Q:var I=o[qe];if(I){var w=o[Si];I==Ai&&(w=parseInt(hi(w),10)>=13?"11":"10"),this.set(h,I).set(A,w)}this.get(h)==Ai&&o[m]=="Xbox"&&this.set(h,"Xbox").set(A,void 0);break;case Xe:var v=this.data,D=function(L){return v[L].getItem().setCH(o).parseCH().get()};this.set(J,D(J)).set(ge,D(ge)).set(pe,D(pe)).set(se,D(se)).set(Q,D(Q))}return this},me.call(this,[["itemType",t],["ua",e],["uaCH",i],["rgxMap",n],["data",wa(this,t)]]),this}function ee(t,e,n){if(typeof t===M.OBJECT?(hn(t,!0)?(typeof e===M.OBJECT&&(n=e),e=t):(n=t,e=void 0),t=void 0):typeof t===M.STRING&&!hn(e,!0)&&(n=e,e=void 0),n)if(typeof n.append===M.FUNCTION){var i={};n.forEach(function(d,p){i[String(p).toLowerCase()]=d}),n=i}else{var o={};for(var r in n)n.hasOwnProperty(r)&&(o[String(r).toLowerCase()]=n[r]);n=o}if(!(this instanceof ee))return new ee(t,e,n).getResult();var s=typeof t===M.STRING?t:n&&n[Uo]?n[Uo]:Z&&Z.userAgent?Z.userAgent:Je,a=new tr(n,!0),l=e?Ea(Jo,e):Jo,u=function(d){return d==Xe?function(){return new Zo(d,s,l,a).set("ua",s).set(J,this.getBrowser()).set(ge,this.getCPU()).set(pe,this.getDevice()).set(se,this.getEngine()).set(Q,this.getOS()).get()}:function(){return new Zo(d,s,l[d],a).parseUA().get()}};return me.call(this,[["getBrowser",u(J)],["getCPU",u(ge)],["getDevice",u(pe)],["getEngine",u(se)],["getOS",u(Q)],["getResult",u(Xe)],["getUA",function(){return s}],["setUA",function(d){return Lt(d)&&(s=En(d,la)),this}]]).setUA(s),this}ee.VERSION=aa;ee.BROWSER=wn([h,A,xt,g]);ee.CPU=wn([$]);ee.DEVICE=wn([m,E,g,Nt,y,H,P,de,Pt]);ee.ENGINE=ee.OS=wn([h,A]);var Ud=Object.freeze({115:"115",2345:"2345",360:"360",ALIPAY:"Alipay",AMAYA:"Amaya",ANDROID:"Android Browser",ARORA:"Arora",AVANT:"Avant",AVAST:"Avast Secure Browser",AVG:"AVG Secure Browser",BAIDU:"Baidu Browser",BASILISK:"Basilisk",BING:"Bing",BLAZER:"Blazer",BOLT:"Bolt",BOWSER:"Bowser",BRAVE:"Brave",CAMINO:"Camino",CHIMERA:"Chimera",CHROME:"Chrome",CHROME_HEADLESS:"Chrome Headless",CHROME_MOBILE:"Mobile Chrome",CHROME_WEBVIEW:"Chrome WebView",CHROMIUM:"Chromium",COBALT:"Cobalt",COC_COC:"Coc Coc",CONKEROR:"Conkeror",DAUM:"Daum",DILLO:"Dillo",DOLPHIN:"Dolphin",DOOBLE:"Dooble",DORIS:"Doris",DRAGON:"Dragon",DUCKDUCKGO:"DuckDuckGo",ECOSIA:"Ecosia",EDGE:"Edge",EDGE_WEBVIEW:"Edge WebView",EDGE_WEBVIEW2:"Edge WebView2",EPIPHANY:"Epiphany",FACEBOOK:"Facebook",FALKON:"Falkon",FIREBIRD:"Firebird",FIREFOX:"Firefox",FIREFOX_FOCUS:"Firefox Focus",FIREFOX_MOBILE:"Mobile Firefox",FIREFOX_REALITY:"Firefox Reality",FENNEC:"Fennec",FLOCK:"Flock",FLOW:"Flow",GO:"GoBrowser",GOOGLE_SEARCH:"GSA",HELIO:"Helio",HEYTAP:"HeyTap",HONOR:"Honor",HUAWEI:"Huawei Browser",ICAB:"iCab",ICE:"ICE Browser",ICEAPE:"IceApe",ICECAT:"IceCat",ICEDRAGON:"IceDragon",ICEWEASEL:"IceWeasel",IE:"IE",INSTAGRAM:"Instagram",IRIDIUM:"Iridium",IRON:"Iron",JASMINE:"Jasmine",KONQUEROR:"Konqueror",KAKAO:"KakaoTalk",KHTML:"KHTML",K_MELEON:"K-Meleon",KLAR:"Klar",KLARNA:"Klarna",KINDLE:"Kindle",LENOVO:"Smart Lenovo Browser",LADYBIRD:"Ladybird",LG:"LG Browser",LIBREWOLF:"LibreWolf",LIEBAO:"LBBROWSER",LINE:"Line",LINKEDIN:"LinkedIn",LINKS:"Links",LUNASCAPE:"Lunascape",LYNX:"Lynx",MAEMO:"Maemo Browser",MAXTHON:"Maxthon",MIDORI:"Midori",MINIMO:"Minimo",MIUI:"MIUI Browser",MOZILLA:"Mozilla",MOSAIC:"Mosaic",NAVER:"Naver",NETFRONT:"NetFront",NETSCAPE:"Netscape",NETSURF:"Netsurf",NOKIA:"Nokia Browser",OBIGO:"Obigo",OCULUS:"Oculus Browser",OMNIWEB:"OmniWeb",OPERA:"Opera",OPERA_COAST:"Opera Coast",OPERA_GX:"Opera GX",OPERA_MINI:"Opera Mini",OPERA_MOBI:"Opera Mobi",OPERA_TABLET:"Opera Tablet",OPERA_TOUCH:"Opera Touch",OTTER:"Otter",OVI:"OviBrowser",PALEMOON:"PaleMoon",PHANTOMJS:"PhantomJS",PHOENIX:"Phoenix",PICOBROWSER:"Pico Browser",POLARIS:"Polaris",PUFFIN:"Puffin",QQ:"QQBrowser",QQ_LITE:"QQBrowserLite",QUARK:"Quark",QUPZILLA:"QupZilla",QUTEBROWSER:"qutebrowser",QWANT:"Qwant",REKONQ:"rekonq",ROCKMELT:"Rockmelt",SAFARI:"Safari",SAFARI_MOBILE:"Mobile Safari",SAILFISH:"Sailfish Browser",SAMSUNG:"Samsung Internet",SEAMONKEY:"SeaMonkey",SILK:"Silk",SKYFIRE:"Skyfire",SLEIPNIR:"Sleipnir",SLIMBOAT:"SlimBoat",SLIMBROWSER:"SlimBrowser",SLIMJET:"Slimjet",SNAPCHAT:"Snapchat",SOGOU_EXPLORER:"Sogou Explorer",SOGOU_MOBILE:"Sogou Mobile",SURF:"Surf",SWIFTFOX:"Swiftfox",TESLA:"Tesla",TIKTOK:"TikTok",TIZEN:"Tizen Browser",TWITTER:"Twitter",UC:"UCBrowser",UP:"UP.Browser",VIVALDI:"Vivaldi",VIVO:"Vivo Browser",W3M:"w3m",WATERFOX:"Waterfox",WEBKIT:"WebKit",WECHAT:"WeChat",WEIBO:"Weibo",WHALE:"Whale",WOLVIC:"Wolvic",YANDEX:"Yandex",ZALO:"Zalo"});var _t=Object.freeze({CRAWLER:"crawler",CLI:"cli",EMAIL:"email",FETCHER:"fetcher",INAPP:"inapp",MEDIAPLAYER:"mediaplayer",LIBRARY:"library"}),nr=Object.freeze({"68K":"68k",ALPHA:"alpha",ARM:"arm",ARM_64:"arm64",ARM_HF:"armhf",AVR:"avr",AVR_32:"avr32",IA64:"ia64",IRIX:"irix",IRIX_64:"irix64",MIPS:"mips",MIPS_64:"mips64",PA_RISC:"pa-risc",PPC:"ppc",SPARC:"sparc",SPARC_64:"sparc64",X86:"ia32",X86_64:"amd64"});var Fd=Object.freeze({CONSOLE:"console",DESKTOP:"desktop",EMBEDDED:"embedded",MOBILE:"mobile",SMARTTV:"smarttv",TABLET:"tablet",WEARABLE:"wearable",XR:"xr"});var Hd=Object.freeze({ACER:"Acer",ADVAN:"Advan",ALCATEL:"Alcatel",APPLE:"Apple",AMAZON:"Amazon",ARCHOS:"Archos",ASUS:"ASUS",ATT:"AT&T",BENQ:"BenQ",BLACKBERRY:"BlackBerry",BLU:"BLU",CAT:"Cat",DELL:"Dell",ENERGIZER:"Energizer",ESSENTIAL:"Essential",FACEBOOK:"Facebook",FAIRPHONE:"Fairphone",GEEKSPHONE:"GeeksPhone",GENERIC:"Generic",GOOGLE:"Google",HISENSE:"Hisense",HMD:"HMD",HP:"HP",HTC:"HTC",HUAWEI:"Huawei",IMO:"IMO",INFINIX:"Infinix",ITEL:"itel",JOLLA:"Jolla",KOBO:"Kobo",LAVA:"Lava",LENOVO:"Lenovo",LG:"LG",MEIZU:"Meizu",MICROMAX:"Micromax",MICROSOFT:"Microsoft",MOTOROLA:"Motorola",NEXIAN:"Nexian",NINTENDO:"Nintendo",NOKIA:"Nokia",NOTHING:"Nothing",NVIDIA:"Nvidia",ONEPLUS:"OnePlus",OPPO:"OPPO",OUYA:"Ouya",PALM:"Palm",PANASONIC:"Panasonic",PEBBLE:"Pebble",PHILIPS:"Philips",PICO:"Pico",POLYTRON:"Polytron",REALME:"Realme",RETROID:"Retroid",RIM:"RIM",ROKU:"Roku",SAMSUNG:"Samsung",SHARP:"Sharp",SIEMENS:"Siemens",SMARTFREN:"Smartfren",SONY:"Sony",SPRINT:"Sprint",TCL:"TCL",TECHNISAT:"TechniSAT",TECNO:"TECNO",TESLA:"Tesla",ULEFONE:"Ulefone",VIVO:"Vivo",VIZIO:"Vizio",VODAFONE:"Vodafone",WIKO:"Wiko",XBOX:"Xbox",XIAOMI:"Xiaomi",ZEBRA:"Zebra",ZTE:"ZTE"});var ir=Object.freeze({AMAYA:"Amaya",ARKWEB:"ArkWeb",BLINK:"Blink",EDGEHTML:"EdgeHTML",FLOW:"Flow",GECKO:"Gecko",GOANNA:"Goanna",ICAB:"iCab",KHTML:"KHTML",LIBWEB:"LibWeb",LINKS:"Links",LYNX:"Lynx",NETFRONT:"NetFront",NETSURF:"NetSurf",PRESTO:"Presto",SERVO:"Servo",TASMAN:"Tasman",TRIDENT:"Trident",W3M:"w3m",WEBKIT:"WebKit"});var or=Object.freeze({AIX:"AIX",AMIGA_OS:"Amiga OS",ANDROID:"Android",ANDROID_X86:"Android-x86",ARCAOS:"ArcaOS",ARCH:"Arch",BADA:"Bada",BEOS:"BeOS",BLACKBERRY:"BlackBerry",CENTOS:"CentOS",CHROME_OS:"Chrome OS",CHROMECAST:"Chromecast",CHROMECAST_ANDROID:"Chromecast Android",CHROMECAST_FUCHSIA:"Chromecast Fuchsia",CHROMECAST_LINUX:"Chromecast Linux",CHROMECAST_SMARTSPEAKER:"Chromecast SmartSpeaker",CONTIKI:"Contiki",DEBIAN:"Debian",DEEPIN:"Deepin",DRAGONFLY:"DragonFly",ELEMENTARY_OS:"elementary OS",FEDORA:"Fedora",FIREFOX_OS:"Firefox OS",FREEBSD:"FreeBSD",FUCHSIA:"Fuchsia",GENTOO:"Gentoo",GHOSTBSD:"GhostBSD",GNU:"GNU",HAIKU:"Haiku",HARMONYOS:"HarmonyOS",HP_UX:"HP-UX",HURD:"Hurd",IOS:"iOS",JOLI:"Joli",KAIOS:"KaiOS",KNOPPIX:"Knoppix",KUBUNTU:"Kubuntu",LINPUS:"Linpus",LINSPIRE:"Linspire",LINUX:"Linux",MACOS:"macOS",MAEMO:"Maemo",MAGEIA:"Mageia",MANDRIVA:"Mandriva",MANJARO:"Manjaro",MEEGO:"MeeGo",MINIX:"Minix",MINT:"Mint",MORPH_OS:"Morph OS",NETBSD:"NetBSD",NETRANGE:"NetRange",NETTV:"NetTV",NINTENDO:"Nintendo",OPENHARMONY:"OpenHarmony",OPENBSD:"OpenBSD",OPENVMS:"OpenVMS",OS2:"OS/2",PALM:"Palm",PC_BSD:"PC-BSD",PCLINUXOS:"PCLinuxOS",PICO:"Pico",PLAN9:"Plan9",PLAYSTATION:"PlayStation",QNX:"QNX",RASPBIAN:"Raspbian",REDHAT:"RedHat",RIM_TABLET_OS:"RIM Tablet OS",RISC_OS:"RISC OS",SABAYON:"Sabayon",SAILFISH:"Sailfish",SERENITYOS:"SerenityOS",SERIES40:"Series40",SLACKWARE:"Slackware",SOLARIS:"Solaris",SUSE:"SUSE",SYMBIAN:"Symbian",TIZEN:"Tizen",UBUNTU:"Ubuntu",UBUNTU_TOUCH:"Ubuntu Touch",UNIX:"Unix",VECTORLINUX:"VectorLinux",WATCHOS:"watchOS",WEBOS:"WebOS",WINDOWS:"Windows",WINDOWS_CE:"Windows CE",WINDOWS_IOT:"Windows IoT",WINDOWS_MOBILE:"Windows Mobile",WINDOWS_PHONE:"Windows Phone",WINDOWS_RT:"Windows RT",XBOX:"Xbox",XUBUNTU:"Xubuntu",ZENWALK:"Zenwalk"});var rr=Object.freeze({BrowserName:{CLI:{CURL:"curl",ELINKS:"ELinks",HTTPIE:"HTTPie",LYNX:"Lynx",WGET:"Wget"},Crawler:{AHREFS_BOT:"AhrefsBot",AI2_BOT:"AI2Bot",AIHIT_BOT:"aiHitBot",ALGOLIA_CRAWLER:"Algolia Crawler",APPLE_BOT:"Applebot",APPLE_BOT_EXTENDED:"Applebot-Extended",ASK_TEOMA:"Teoma",AMAZON_BOT:"Amazonbot",AMAZON_CONTXBOT:"contxbot",ANTHROPIC_AI:"anthropic-ai",ANTHROPIC_CLAUDE_BOT:"ClaudeBot",ANTHROPIC_CLAUDE_SEARCHBOT:"Claude-SearchBot",ANTHROPIC_CLAUDE_WEB:"Claude-Web",ARCHIVEORG_BOT:"archive.org_bot",BAIDU_ADS:"Baidu-ADS",BAIDU_SPIDER:"Baiduspider",BAIDU_SPIDER_ADS:"Baiduspider-ads",BAIDU_SPIDER_CPRO:"Baiduspider-cpro",BAIDU_SPIDER_FAVO:"Baiduspider-favo",BAIDU_SPIDER_IMAGE:"Baiduspider-image",BAIDU_SPIDER_NEWS:"Baiduspider-news",BAIDU_SPIDER_RENDER:"Baiduspider-render",BAIDU_SPIDER_VIDEO:"Baiduspider-video",BLEX_BOT:"BLEXBot",BOTIFY:"botify",BRAVE_BOT:"Bravebot",BYTEDANCE_BYTESPIDER:"Bytespider",BYTEDANCE_TIKTOKSPIDER:"TikTokSpider",COMMON_CRAWL_CCBOT:"CCBot",COCCOC_BOT_WEB:"coccocbot-web",COCCOC_BOT_IMAGE:"coccocbot-image",COHERE_TRAINING_DATA_CRAWLER:"cohere-training-data-crawler",COTOYOGI:"Cotoyogi",COVEO_BOT:"Coveobot",CRITEO_BOT:"CriteoBot",DATAFORSEO_BOT:"DataForSeoBot",DAUM:"Daum",DAUM_DAUMOA:"Daumoa",DAUM_DAUMOA_IMAGE:"Daumoa-image",DEEPSEEK_BOT:"DeepSeekBot",DIFFBOT:"Diffbot",DUCKDUCKGO_BOT:"DuckDuckBot",DUCKDUCKGO_FAVICONS_BOT:"DuckDuckGo-Favicons-Bot",ELASTIC:"Elastic",ELASTIC_SWIFTYPE_BOT:"Swiftbot",EXALEAD_EXABOT:"Exabot",FIRECRAWL_AGENT:"FirecrawlAgent",FREESPOKE:"Freespoke",GOOGLE_ADSBOT:"AdsBot-Google",GOOGLE_ADSBOT_MOBILE:"Adsbot-Google-Mobile",GOOGLE_ADSENSE:"AdSense",GOOGLE_APIS:"APIs-Google",GOOGLE_BOT:"Googlebot",GOOGLE_BOT_IMAGE:"Googlebot-Image",GOOGLE_BOT_NEWS:"Googlebot-News",GOOGLE_BOT_VIDEO:"Googlebot-Video",GOOGLE_CLOUDVERTEXBOT:"Google-CloudVertexBot",GOOGLE_EXTENDED:"Google-Extended",GOOGLE_INSPECTIONTOOL:"Google-InspectionTool",GOOGLE_OTHER:"GoogleOther",GOOGLE_OTHER_IMAGE:"GoogleOther-Image",GOOGLE_OTHER_VIDEO:"GoogleOther-Video",GOOGLE_SAFETY:"Google-Safety",GOOGLE_STOREBOT:"Storebot-Google",HIVE_IMAGESIFTBOT:"ImagesiftBot",HUAWEI_PANGUBOT:"PanguBot",HUAWEI_PETALBOT:"PetalBot",HUGGINGFACE_BOT:"HuggingFace-Bot",HUNTER_VELENPUBLICWEBCRAWLER:"VelenPublicWebCrawler",IA_ARCHIVER:"ia_archiver",IASK_BOT:"iAskBot",KAGI_BOT:"Kagibot",KANGAROO_BOT:"Kangaroo Bot",LINE_SPIDER:"Linespider",LINKEDIN_BOT:"LinkedInBot",MAGPIE_CRAWLER:"magpie-crawler",MARGINALIA:"marginalia",META_EXTERNALAGENT:"meta-externalagent",META_FACEBOOKBOT:"FacebookBot",META_FACEBOOKCATALOG:"facebookcatalog",META_FACEBOOKEXTERNALHIT:"facebookexternalhit",MAJESTIC_MJ12BOT:"MJ12bot",MICROSOFT_BINGBOT:"Bingbot",MICROSOFT_MSNBOT:"msnbot",MICROSOFT_ADIDXBOT:"adidxbot",MOJEEK_BOT:"MojeekBot",MOZ_DOTBOT:"DotBot",ONCRAWL:"OnCrawl",ONESPOT_SCRAPERBOT:"Onespot-ScraperBot",OPENAI_GPTBOT:"GPTBot",OPENAI_SEARCH_BOT:"OAI-SearchBot",PERPLEXITY_BOT:"PerplexityBot",QIHOO_360_SPIDER:"360Spider",QWANT_BOT:"Qwantbot",QWANT_BOT_NEWS:"Qwantbot-news",REPLICATE_BOT:"Replicate-Bot",RUNPOD_BOT:"RunPod-Bot",SB_INTUITIONS_BOT:"SBIntuitionsBot",SEEKPORT_BOT:"SeekportBot",SEMRUSH_BOT:"SemrushBot",SEMRUSH_BOT_BACKLINK:"SemrushBot-BA",SEMRUSH_BOT_CONTENTSHAKE:"SemrushBot-OCOB",SEMRUSH_BOT_SEO_CHECKER:"SemrushBot-SI",SEZNAM_BOT:"SeznamBot",SITEIMPROVE:"Siteimprove",SOGOU_PIC_SPIDER:"Sogou Pic Spider",SOGOU_WEB_SPIDER:"Sogou web spider",STARTPAGE:"Startpage",SURLY_BOT:"SurdotlyBot",TIMPI_BOT:"Timpibot",TOGETHER_BOT:"Together-Bot",TURNITIN_BOT:"TurnitinBot",TWIN_AGENT:"TwinAgent",VERCEL_V0BOT:"v0bot",WEBZIO:"webzio",WEBZIO_EXTENDED:"Webzio-Extended",WEBZIO_OMGILI:"omgili",WEBZIO_OMGILI_BOT:"omgilibot",XAI_BOT:"xAI-Bot",YAHOO_JAPAN:"Y!J-BRW",YAHOO_SLURP:"Yahoo! Slurp",YANDEX_ACCESSIBILITY_BOT:"YandexAccessibilityBot",YANDEX_ADDITIONAL_BOT:"YandexAdditionalBot",YANDEX_ADNET:"YandexAdNet",YANDEX_BLOGS:"YandexBlogs",YANDEX_BOT:"YandexBot",YANDEX_BOT_MIRRORDETECTOR:"YandexBot MirrorDetector",YANDEX_COMBOT:"YandexComBot",YANDEX_FAVICONS:"YandexFavicons",YANDEX_IMAGE_RESIZER:"YandexImageResizer",YANDEX_IMAGES:"YandexImages",YANDEX_MARKET:"YandexMarket",YANDEX_MEDIA:"YandexMedia",YANDEX_METRIKA:"YandexMetrika",YANDEX_MOBILE_BOT:"YandexMobileBot",YANDEX_MOBILE_SCREENSHOT_BOT:"YandexMobileScreenShotBot",YANDEX_NEWS:"YandexNews",YANDEX_ONTODB:"YandexOntoDB",YANDEX_ONTODB_API:"YandexOntoDBAPI",YANDEX_PARTNER:"YandexPartner",YANDEX_RCA:"YandexRCA",YANDEX_RENDERRESOURCES_BOT:"YandexRenderResourcesBot",YANDEX_SCREENSHOT_BOT:"YandexScreenshotBot",YANDEX_SPRAV_BOT:"YandexSpravBot",YANDEX_TRACKER:"YandexTracker",YANDEX_VERTICALS:"YandexVerticals",YANDEX_VERTIS:"YandexVertis",YANDEX_VIDEO:"YandexVideo",YANDEX_VIDEO_PARSER:"YandexVideoParser",YANDEX_WEBMASTER:"YandexWebmaster",YEP_BOT:"YepBot",YETI:"Yeti",YISOU_SPIDER:"YisouSpider",YOU_BOT:"YouBot",ZHIPU_CHATGLM_SPIDER:"ChatGLM-Spider",ZUM_BOT:"ZumBot"},Email:{AIRMAIL:"Airmail",APPLE_MAIL:"Mail",BLUEMAIL:"BlueMail",DAUM_MAIL:"DaumMail",EVOLUTION:"Evolution",EM_CLIENT:"eM Client",FOXMAIL:"Foxmail",KMAIL:"KMail",KMAIL2:"kmail2",KONTACT:"Kontact",MICROSOFT_OUTLOOK:"Microsoft Outlook",MICROSOFT_OUTLOOK_MAC:"MacOutlook",NAVER_MAILAPP:"NaverMailApp",POLYMAIL:"Polymail",PROTON_MAIL:"ProtonMail",SPARK_MAIL:"SparkDesktop",SPARROW:"Sparrow",THUNDERBIRD:"Thunderbird",YAHOO_MAIL:"Yahoo",ZIMBRA:"Zimbra",ZOHO_MAIL:"ZohoMail-Desktop"},Fetcher:{AHREFS_SITEAUDIT:"AhrefsSiteAudit",ANTHROPIC_CLAUDE_USER:"Claude-User",ASANA:"Asana",BETTER_UPTIME_BOT:"Better Uptime Bot",BITLY_BOT:"bitlybot",BLUESKY:"Bluesky",BUFFER_LINKPREVIEWBOT:"BufferLinkPreviewBot",COHERE_AI:"Cohere-AI",DISCORD_BOT:"Discordbot",DUCKDUCKGO_ASSISTBOT:"DuckAssistBot",GOOGLE_CHROME_LIGHTHOUSE:"Chrome-Lighthouse",GOOGLE_FEEDFETCHER:"FeedFetcher-Google",GOOGLE_GEMINI_DEEP_RESEARCH:"Gemini-Deep-Research",GOOGLE_IMAGEPROXY:"GoogleImageProxy",GOOGLE_PAGERENDERER:"Google-PageRenderer",GOOGLE_READ_ALOUD:"Google-Read-Aloud",GOOGLE_PRODUCER:"GoogleProducer",GOOGLE_SITE_VERIFICATION:"Google-Site-Verification",HUBSPOT_PAGE_FETCHER:"HubSpot Page Fetcher",IFRAMELY:"Iframely",KAKAOTALK_SCRAP:"kakaotalk-scrap",KEYBASE_BOT:"KeybaseBot",META_EXTERNALFETCHER:"meta-externalfetcher",META_WHATSAPP:"WhatsApp",MICROSOFT_BINGPREVIEW:"BingPreview",MICROSOFT_PREVIEW:"MicrosoftPreview",MISTRALAI_USER:"MistralAI-User",NAVER_BLUENO:"Blueno",ONCRAWL_ROGERBOT:"rogerbot",OPENAI_CHATGPT_USER:"ChatGPT-User",PERPLEXITY_USER:"Perplexity-User",PINTEREST_BOT:"Pinterestbot",SEMRUSH_SITEAUDITBOT:"SiteAuditBot",SLACK_BOT:"Slackbot",SLACK_BOT_LINKEXPANDING:"Slackbot-LinkExpanding",SLACK_IMGPROXY:"Slack-ImgProxy",SNAP_URL_PREVIEW:"Snap URL Preview",SKYPE_URIPREVIEW:"SkypeUriPreview",TELEGRAM_BOT:"TelegramBot",UPTIMEROBOT:"UptimeRobot",VERCEL_FAVICON_BOT:"vercel-favicon-bot",VERCEL_SCREENSHOT_BOT:"vercel-screenshot-bot",VERCEL_BOT:"Vercelbot",VERCEL_FLAGS:"vercelflags",VERCEL_TRACING:"verceltracing",X_TWITTERBOT:"Twitterbot",YANDEX_CALENDAR:"YandexCalendar",YANDEX_DIRECT:"YandexDirect",YANDEX_DIRECTDYN:"YandexDirectDyn",YANDEX_DIRECTFETCHER:"YaDirectFetcher",YANDEX_FORDOMAIN:"YandexForDomain",YANDEX_PAGECHECKER:"YandexPagechecker",YANDEX_SEARCHSHOP:"YandexSearchShop",YANDEX_SITELINKS:"YandexSitelinks",YANDEX_USERPROXY:"YandexUserproxy",ZOOMINFO_BOT:"Zoombot"},InApp:{DISCORD:"Discord",EVERNOTE:"Evernote",FIGMA:"Figma",FLIPBOARD:"Flipboard",MATTERMOST:"Mattermost",TEAMS:"Teams",NOTION:"Notion",POSTMAN:"Postman",RAMBOX:"Rambox",ROCKETCHAT:"Rocket.Chat",SLACK:"Slack",TIKTOK_LITE:"TikTok Lite",VSCODE:"VS Code",YAHOO_JAPAN:"Yahoo! Japan"},Library:{ADOBE_AIR:"AdobeAIR",AIOHTTP:"aiohttp",APACHE_HTTPCLIENT:"Apache-HttpClient",AXIOS:"axios",GO_HTTP_CLIENT:"go-http-client",GOT:"got",GUZZLEHTTP:"GuzzleHttp",JAVA:"Java",JAVA_HTTPCLIENT:"Java-http-client",JSDOM:"jsdom",LIBWWW_PERL:"libwww-perl",LUA_RESTY_HTTP:"lua-resty-http",NEEDLE:"Needle",NUTCH:"Nutch",OKHTTP:"OkHttp",NODE_FETCH:"node-fetch",NODE_SUPERAGENT:"node-superagent",PHP_SOAP:"PHP-SOAP",POSTMAN_RUNTIME:"PostmanRuntime",PYTHON_HTTPX:"python-httpx",PYTHON_URLLIB:"python-urllib",PYTHON_URLLIB3:"python-urllib3",PYTHON_REQUESTS:"python-requests",SCRAPY:"Scrapy"}},DeviceVendor:{Vehicle:{BMW:"BMW",BYD:"BYD",JEEP:"Jeep",RIVIAN:"Rivian",TESLA:"Tesla",VOLVO:"Volvo"}}});var k="model",U="name",R="type",x="vendor",Y="version",_e="mobile",X="tablet",Ti="crawler",ba="cli",sr="email",ar="fetcher",Qe="inapp",kt="mediaplayer",Ia="library",Sa=Object.freeze({browser:[[/(wget|curl|lynx|elinks|httpie)[\/ ]\(?([\w\.-]+)/i],[U,Y,[R,ba]]]}),cr=Object.freeze({browser:[[/((?:adidx|ahrefs|amazon|bing|brave|cc|contx|coveo|criteo|dot|duckduck(?:go-favicons-)?|exa|facebook|gpt|iask|kagi|kangaroo |linkedin|mj12|mojeek|oai-search|onespot-scraper|perplexity|sbintuitions|semrush|seznam|surdotly|swift|yep)bot)\/([\w\.-]+)/i,/(algolia crawler(?: renderscript)?)\/?([\w\.]*)/i,/(applebot(?:-extended)?)\/?([\w\.]*)/i,/(baiduspider[-imagevdonwsfcpr]{0,7})\/?([\w\.]*)/i,/(claude(?:bot|-searchbot|-web)|anthropic-ai)\/?([\w\.]*)/i,/(coccocbot-(?:image|web))\/([\w\.]+)/i,/(daum(?:oa)?(?:-image)?)[ \/]([\w\.]+)/i,/(facebook(?:externalhit|catalog)|meta-externalagent)\/([\w\.]+)/i,/(google(?:bot|other|-inspectiontool)(?:-image|-video|-news)?|storebot-google)\/?([\w\.]*)/i,/(ia_archiver|archive\.org_bot)\/?([\w\.]*)/i,/(oncrawl) mobile\/([\w\.]+)/i,/(qwantbot(?:-news)?)[-\w]*\/?([\w\.]*)/i,/((?:semrush|splitsignal)bot[-abcfimostw]*)\/?([\w\.-]*)/i,/(sogou (?:pic|head|web|orion|news) spider)\/([\w\.]+)/i,/(y!?j-(?:asr|br[uw]|dscv|mmp|vsidx|wsc))\/([\w\.]+)/i,/(yandex(?:(?:mobile)?(?:accessibility|additional|com|renderresources|screenshot|sprav)?bot(?!.+mirror)|image(?:s|resizer)|adnet|blogs|favicons|market|media|metrika|news|ontodb(?:api)?|partner|rca|tracker|turbo|verti(?:cal)?s|webmaster|video(?:parser)?))\/([\w\.]+)/i,/(yeti)\/([\w\.]+)/i,/((?:aihit|blex|diff|huggingface-|msn|pangu|replicate-|runpod-|timpi|together-|xai-|you|zum)bot|(?:magpie-|velenpublicweb)crawler|(?:chatglm-|line|screaming frog seo |yisou)spider|cotoyogi|firecrawlagent|freespoke|omgili(?:bot)?|openai image downloader|startpageprivateimageproxy|twinagent|webzio-extended)\/?([\w\.]*)/i],[U,Y,[R,Ti]],[/(yandexbot\/([\w\.]+); mirrordetector)/i],[[U,/\/.+;/ig,""],Y,[R,Ti]],[/((?:adsbot|apis|mediapartners)-google(?:-mobile)?|google-?(?:other|cloudvertexbot|extended|safety))/i,/\b((ai2|aspiegel|dataforseo|deepseek|imagesift|petal|seekport|turnitin|v0)bot|360spider-?(image|video)?|baidu-ads|botify|(byte|tiktok)spider|cohere-training-data-crawler|elastic(?=\/s)|marginalia|siteimprove(?=bot|\.com)|teoma|webzio|yahoo! slurp)/i],[U,[R,Ti]]]}),Vd=Object.freeze({device:[[/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[x,k,[R,X]],[/(u304aa)/i],[k,[x,"AT&T"],[R,_e]],[/\bsie-(\w*)/i],[k,[x,"Siemens"],[R,_e]],[/\b(rct\w+) b/i],[k,[x,"RCA"],[R,X]],[/\b(venue[\d ]{2,7}) b/i],[k,[x,"Dell"],[R,X]],[/\b(q(?:mv|ta)\w+) b/i],[k,[x,"Verizon"],[R,X]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[k,[x,"Barnes & Noble"],[R,X]],[/\b(tm\d{3}\w+) b/i],[k,[x,"NuVision"],[R,X]],[/\b(k88) b/i],[k,[x,"ZTE"],[R,X]],[/\b(nx\d{3}j) b/i],[k,[x,"ZTE"],[R,_e]],[/\b(gen\d{3}) b.+49h/i],[k,[x,"Swiss"],[R,_e]],[/\b(zur\d{3}) b/i],[k,[x,"Swiss"],[R,X]],[/^((zeki)?tb.*\b) b/i],[k,[x,"Zeki"],[R,X]],[/\b([yr]\d{2}) b/i,/\b(?:dragon[- ]+touch |dt)(\w{5}) b/i],[k,[x,"Dragon Touch"],[R,X]],[/\b(ns-?\w{0,9}) b/i],[k,[x,"Insignia"],[R,X]],[/\b((nxa|next)-?\w{0,9}) b/i],[k,[x,"NextBook"],[R,X]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[x,"Voice"],k,[R,_e]],[/\b(lvtel\-)?(v1[12]) b/i],[[x,"LvTel"],k,[R,_e]],[/\b(ph-1) /i],[k,[x,"Essential"],[R,_e]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[k,[x,"Envizen"],[R,X]],[/\b(trio[-\w\. ]+) b/i],[k,[x,"MachSpeed"],[R,X]],[/\btu_(1491) b/i],[k,[x,"Rotor"],[R,X]]]}),Kd=Object.freeze({browser:[[/((?:air|blue|daum|fox|poly|proton)mail|emclient|evolution|kmail2?|kontact|(?:microsoft |mac)?outlook(?:-express)?|navermailapp|(?!chrom.+)sparrow|sparkdesktop|thunderbird|yahoo|zohomail-desktop)(?:m.+ail; |[\/ ])([\w\.]+)/i,/(mail)\/([\w\.]+) cf/i],[U,Y,[R,sr]],[/zdesktop\/([\w\.]+)/i],[Y,[U,"Zimbra"],[R,sr]]]}),lr=Object.freeze({browser:[[/(asana|ahrefssiteaudit|(?:bing|microsoft)preview|blueno|(?:chatgpt|claude|mistralai|perplexity)-user|cohere-ai|hubspot page fetcher|mastodon|(?:bitly|bufferlinkpreview|discord|duckassist|linkedin|pinterest|reddit|roger|siteaudit|twitter|uptimero|zoom)bot|google-site-verification|iframely|kakaotalk-scrap|meta-externalfetcher|y!?j-dlc|yandex(?:calendar|direct(?:dyn)?|fordomain|pagechecker|searchshop)|yadirectfetcher)\/([\w\.]+)/i,/(bluesky) cardyb\/([\w\.]+)/i,/(skypeuripreview) preview\/([\w\.]+)/i,/(slack(?:bot)?(?:-imgproxy|-linkexpanding)?) ([\w\.]+)/i,/(whatsapp)\/([\w\.]+)/i],[U,Y,[R,ar]],[/((?:better uptime |keybase|telegram|vercel)bot|chrome-lighthouse|feedfetcher-google|gemini-deep-research|google(?:imageproxy|-read-aloud|-pagerenderer|producer)|snap url preview|vercel(flags|tracing|-(favicon|screenshot)-bot)|yandex(?:sitelinks|userproxy))/i],[U,[R,ar]]],os:[[/whatsapp\/[\d\.]+ (a|i)/i],[[U,t=>t=="A"?"Android":"iOS"]]]}),Wd=Object.freeze({browser:[[/\b(discord|figma|mattermost|notion|postman|rambox|rocket.chat|slack|teams)\/([\w\.]+).+(electron\/|; ios)/i,/(flipboard)\/([\w\.]+)/i],[U,Y,[R,Qe]],[/(evernote) win/i,/(teams)mobile-(ios|and)/i],[U,[R,Qe]],[/chatlyio\/([\d\.]+)/i],[Y,[U,"Slack"],[R,Qe]],[/ultralite app_version\/([\w\.]+)/i],[Y,[U,"TikTok Lite"],[R,Qe]],[/\) code\/([\d\.]+).+electron\//i],[Y,[U,"VS Code"],[R,Qe]],[/jp\.co\.yahoo\.(?:android\.yjtop|ipn\.appli)\/([\d\.]+)/i],[Y,[U,"Yahoo! Japan"],[R,Qe]]]}),zd=Object.freeze({browser:[[/(apple(?:coremedia|tv))\/([\w\._]+)/i,/(coremedia) v([\w\._]+)/i,/(ares|clementine|music player daemon|nexplayer|ossproxy) ([\w\.-]+)/i,/^(aqualung|audacious|audimusicstream|amarok|bass|bsplayer|core|gnomemplayer|gvfs|irapp|lyssna|music on console|nero (?:home|scout)|nokia\d+|nsplayer|psp-internetradioplayer|quicktime|rma|radioapp|radioclientapplication|soundtap|stagefright|streamium|totem|videos|xbmc|xine|xmms)\/([\w\.-]+)/i,/(lg player|nexplayer) ([\d\.]+)/i,/player\/(nexplayer|lg player) ([\w\.-]+)/i,/(gstreamer) souphttpsrc.+libsoup\/([\w\.-]+)/i,/(htc streaming player) [\w_]+ \/ ([\d\.]+)/i,/(lavf)([\d\.]+)/i,/(mplayer)(?: |\/)(?:(?:sherpya-){0,1}svn)(?:-| )(r\d+(?:-\d+[\w\.-]+))/i,/ (songbird)\/([\w\.-]+)/i,/(winamp)(?:3 version|mpeg| ) ([\w\.-]+)/i,/(vlc)(?:\/| media player - version )([\w\.-]+)/i,/^(foobar2000|itunes|smp)\/([\d\.]+)/i,/com\.(riseupradioalarm)\/([\d\.]*)/i,/(mplayer)(?:\s|\/| unknown-)([\w\.\-]+)/i,/(windows)\/([\w\.-]+) upnp\/[\d\.]+ dlnadoc\/[\d\.]+ home media server/i],[U,Y,[R,kt]],[/(flrp)\/([\w\.-]+)/i],[[U,"Flip Player"],Y,[R,kt]],[/(fstream|media player classic|inlight radio|mplayer|nativehost|nero showtime|ocms-bot|queryseekspider|tapinradio|tunein radio|winamp|yourmuze)/i],[U,[R,kt]],[/(htc_one_s|windows-media-player|wmplayer)\/([\w\.-]+)/i],[[U,/[_-]/g," "],Y,[R,kt]],[/(rad.io|radio.(?:de|at|fr)) ([\d\.]+)/i],[[U,"rad.io"],Y,[R,kt]]]}),Ta=Object.freeze({browser:[[/^(apache-httpclient|axios|(?:go|java)-http-client|got|guzzlehttp|java|libwww-perl|lua-resty-http|needle|node-(?:fetch|superagent)|okhttp|php-soap|postmanruntime|python-(?:httpx|urllib[23]?|requests)|scrapy)\/([\w\.]+)/i,/(adobeair|aiohttp|jsdom)\/([\w\.]+)/i,/(nutch)-([\w\.-]+)(\(|$)/i,/\((java)\/([\w\.]+)/i],[U,Y,[R,Ia]]]}),Yd=Object.freeze({device:[[/aftlbt962e2/i],[[x,"BMW"]],[/dilink.+(byd) auto/i],[x],[/aftlft962x3/i],[[x,"Jeep"],[k,"Wagooner"]],[/(rivian) (r1t)/i],[x,k],[/vcc.+netfront/i],[[x,"Volvo"]]]}),ur=Object.freeze({browser:[...Sa.browser,...lr.browser,...cr.browser,...Ta.browser],os:[...lr.os]});var S={ANDORRA:{ANDORRA:"Europe/Andorra"},AUSTRIA:{VIENNA:"Europe/Vienna"},BELGIUM:{BRUSSELS:"Europe/Brussels"},BULGARIA:{SOFIA:"Europe/Sofia"},CROATIA:{ZAGREB:"Europe/Zagreb"},CYPRUS:{NICOSIA_EUROPE:"Europe/Nicosia",NICOSIA_ASIA:"Asia/Nicosia",FAMAGUSTA:"Asia/Famagusta"},CZECHIA:{PRAGUE:"Europe/Prague"},DENMARK:{COPENHAGEN:"Europe/Copenhagen",FAROE:"Atlantic/Faroe"},ESTONIA:{TALLINN:"Europe/Tallinn"},FINLAND:{HELSINKI:"Europe/Helsinki",MARIEHAMN:"Europe/Mariehamn"},FRANCE:{PARIS:"Europe/Paris",CAYENNE:"America/Cayenne",GUADELOUPE:"America/Guadeloupe",MARIGOT:"America/Marigot",MARTINIQUE:"America/Martinique",MAYOTTE:"Indian/Mayotte",REUNION:"Indian/Reunion"},GERMANY:{BERLIN:"Europe/Berlin",BUSINGEN:"Europe/Busingen"},GREECE:{ATHENS:"Europe/Athens"},HUNGARY:{BUDAPEST:"Europe/Budapest"},ICELAND:{REYKJAVIK:"Atlantic/Reykjavik"},IRELAND:{DUBLIN:"Europe/Dublin"},ITALY:{ROME:"Europe/Rome"},LATVIA:{RIGA:"Europe/Riga"},LIECHTENSTEIN:{VADUZ:"Europe/Vaduz"},LITHUANIA:{VILNIUS:"Europe/Vilnius"},LUXEMBOURG:{LUXEMBOURG:"Europe/Luxembourg"},MALTA:{MALTA:"Europe/Malta"},MONACO:{MONACO:"Europe/Monaco"},NETHERLANDS:{AMSTERDAM:"Europe/Amsterdam",ARUBA:"America/Aruba",CURACAO:"America/Curacao",KRALENDIJK:"America/Kralendijk",LOWER_PRINCES:"America/Lower_Princes"},NORWAY:{OSLO:"Europe/Oslo",JAN_MAYEN:"Atlantic/Jan_Mayen",LONGYEARBYEN:"Arctic/Longyearbyen"},POLAND:{WARSAW:"Europe/Warsaw"},PORTUGAL:{LISBON:"Europe/Lisbon",AZORES:"Atlantic/Azores",MADEIRA:"Atlantic/Madeira"},ROMANIA:{BUCHAREST:"Europe/Bucharest"},SAN_MARINO:{SAN_MARINO:"Europe/San_Marino"},SLOVAKIA:{BRATISLAVA:"Europe/Bratislava"},SLOVENIA:{LJUBLJANA:"Europe/Ljubljana"},SPAIN:{MADRID:"Europe/Madrid",CANARY:"Atlantic/Canary",CEUTA:"Africa/Ceuta"},SWEDEN:{STOCKHOLM:"Europe/Stockholm"},SWITZERLAND:{ZURICH:"Europe/Zurich"},VATICAN:{VATICAN:"Europe/Vatican"}},Ca=[S.AUSTRIA.VIENNA,S.BELGIUM.BRUSSELS,S.BULGARIA.SOFIA,S.CROATIA.ZAGREB,S.CYPRUS.NICOSIA_EUROPE,S.CYPRUS.NICOSIA_ASIA,S.CYPRUS.FAMAGUSTA,S.CZECHIA.PRAGUE,S.DENMARK.COPENHAGEN,S.ESTONIA.TALLINN,S.FINLAND.HELSINKI,S.FINLAND.MARIEHAMN,S.FRANCE.PARIS,S.GERMANY.BERLIN,S.GREECE.ATHENS,S.HUNGARY.BUDAPEST,S.IRELAND.DUBLIN,S.ITALY.ROME,S.LATVIA.RIGA,S.LITHUANIA.VILNIUS,S.LUXEMBOURG.LUXEMBOURG,S.MALTA.MALTA,S.NETHERLANDS.AMSTERDAM,S.POLAND.WARSAW,S.PORTUGAL.LISBON,S.ROMANIA.BUCHAREST,S.SLOVAKIA.BRATISLAVA,S.SLOVENIA.LJUBLJANA,S.SPAIN.MADRID,S.SWEDEN.STOCKHOLM,S.FRANCE.CAYENNE,S.FRANCE.GUADELOUPE,S.FRANCE.MARIGOT,S.FRANCE.MARTINIQUE,S.FRANCE.MAYOTTE,S.FRANCE.REUNION,S.PORTUGAL.AZORES,S.PORTUGAL.MADEIRA,S.SPAIN.CANARY],dr=[S.ICELAND.REYKJAVIK,S.LIECHTENSTEIN.VADUZ,S.NORWAY.OSLO,S.NORWAY.JAN_MAYEN],$d=[...Ca,...dr],Xd=[S.SWITZERLAND.ZURICH,...dr],qd=[S.AUSTRIA.VIENNA,S.BELGIUM.BRUSSELS,S.BULGARIA.SOFIA,S.CROATIA.ZAGREB,S.CZECHIA.PRAGUE,S.DENMARK.COPENHAGEN,S.ESTONIA.TALLINN,S.FINLAND.HELSINKI,S.FINLAND.MARIEHAMN,S.FRANCE.PARIS,S.GERMANY.BERLIN,S.GREECE.ATHENS,S.HUNGARY.BUDAPEST,S.ITALY.ROME,S.LATVIA.RIGA,S.LITHUANIA.VILNIUS,S.LUXEMBOURG.LUXEMBOURG,S.MALTA.MALTA,S.NETHERLANDS.AMSTERDAM,S.POLAND.WARSAW,S.PORTUGAL.LISBON,S.PORTUGAL.AZORES,S.PORTUGAL.MADEIRA,S.ROMANIA.BUCHAREST,S.SLOVAKIA.BRATISLAVA,S.SLOVENIA.LJUBLJANA,S.SPAIN.MADRID,S.SPAIN.CANARY,S.SWEDEN.STOCKHOLM,S.ANDORRA.ANDORRA,S.GERMANY.BUSINGEN,S.ICELAND.REYKJAVIK,S.LIECHTENSTEIN.VADUZ,S.MONACO.MONACO,S.NORWAY.OSLO,S.SAN_MARINO.SAN_MARINO,S.SPAIN.CEUTA,S.SWITZERLAND.ZURICH,S.VATICAN.VATICAN];function Ci(){var t;return typeof window!="undefined"&&((window==null?void 0:window.matchMedia("(display-mode: standalone)").matches)||((t=window.navigator)===null||t===void 0?void 0:t.standalone)||document.referrer.startsWith("android-app://")||(window==null?void 0:window.Windows)||/trident.+(msapphost|webview)\//i.test(navigator.userAgent)||document.referrer.startsWith("app-info://platform/microsoft-store"))}var{Crawler:cf}=rr.BrowserName,yi=(t,e,n)=>typeof t=="string"?ee(t,e,n):t;var fr=t=>{let e=yi(t);if(e.os.is(or.MACOS)){if(e.cpu.is(nr.ARM))return!0;if(typeof t!="string"&&typeof window!="undefined")try{let n=document.createElement("canvas"),i=n.getContext("webgl2")||n.getContext("webgl")||n.getContext("experimental-webgl"),o=i.getExtension("WEBGL_debug_renderer_info");if(i.getParameter(o.UNMASKED_RENDERER_WEBGL).match(/apple m\d/i))return!0}catch(n){return!1}}return!1};var pr=t=>[_t.CLI,_t.CRAWLER,_t.FETCHER,_t.LIBRARY].includes(yi(t,ur).browser.type),gr=t=>yi(t).engine.is(ir.BLINK);function ya(){return{width:window.screen.width,height:window.screen.height}}function Oa(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch(t){return console.error("Failed to get timezone:",t),"UTC"}}function mr(){try{return navigator.language||"en-US"}catch(t){return console.error("Failed to get browser locale:",t),"en-US"}}function hr(){if(typeof window=="undefined")return{userAgent:{name:"",browser:{major:"",name:"",version:""},os:{name:"",version:""},device:void 0,engine:{name:"",version:""},cpu:{architecture:""}},screenResolution:{width:0,height:0},timeZone:"UTC",flags:{isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}};let e=new ee().getResult(),n;try{n={isBot:pr(e),isChromeFamily:gr(e),isStandalonePWA:Ci(),isAppleSilicon:fr(e)}}catch(i){console.error("Failed to compute device flags:",i),n={isBot:!1,isChromeFamily:!1,isStandalonePWA:!1,isAppleSilicon:!1}}return{userAgent:{name:e.ua,browser:{major:e.browser.major||"",name:e.browser.name||"",version:e.browser.version||"",type:e.browser.type},os:{name:e.os.name||"",version:e.os.version||""},device:e.device.model||e.device.type||e.device.vendor?{model:e.device.model,type:e.device.type,vendor:e.device.vendor}:void 0,engine:{name:e.engine.name||"",version:e.engine.version||""},cpu:{architecture:e.cpu.architecture||""}},screenResolution:ya(),timeZone:Oa(),flags:n}}function Er(){if(typeof window=="undefined")return{};let t=new URLSearchParams(window.location.search);return{locale:t.get("locale")||void 0,currency:t.get("currency")||void 0,utmSource:t.get("utm_source")||void 0,utmMedium:t.get("utm_medium")||void 0,utmCampaign:t.get("utm_campaign")||void 0}}var bn=class{constructor(){this.listeners=new Map}on(e,n){return this.listeners.has(e)||this.listeners.set(e,new Set),this.listeners.get(e).add(n),()=>this.off(e,n)}off(e,n){this.listeners.has(e)&&this.listeners.get(e).delete(n)}async emit(e,n){if(this.listeners.has(e)){let i=Array.from(this.listeners.get(e));await Promise.all(i.map(o=>{try{return Promise.resolve(o(n))}catch(r){return console.error('[EventBus] Error in listener for event "'.concat(e,'":'),r),Promise.resolve()}}))}}clear(){this.listeners.clear()}};vn();function Dt(t){try{let e=t.split(".");if(e.length!==3)return console.error("Invalid JWT token format"),null;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),o=atob(i),r=JSON.parse(o);return r.exp&&Date.now()>=r.exp*1e3?(console.warn("JWT token is expired"),null):{sessionId:r.sessionId,storeId:r.storeId,accountId:r.accountId,customerId:r.customerId,role:r.role,isValid:!0,isLoading:!1}}catch(e){return console.error("Failed to decode JWT token:",e),null}}function Ar(t){try{let e=t.split(".");if(e.length!==3)return!0;let n=e[1],i=n+"=".repeat((4-n.length%4)%4),o=atob(i),r=JSON.parse(o);return r.exp?Date.now()>=r.exp*1e3:!1}catch(e){return console.error("Failed to check token expiration:",e),!0}}Ft();var et={},Ra=["","VITE_","REACT_APP_","NEXT_PUBLIC_"];function he(t,e=Ra){var n,i,o;for(let r of e){let s=r?"".concat(r).concat(t):t;if(typeof process!="undefined"&&((n=process==null?void 0:process.env)!=null&&n[s]))return console.log("process.env[".concat(s,"]"),process.env[s]),process.env[s];if(typeof et!="undefined"&&((i=et==null?void 0:et.env)!=null&&i[s]))return console.log("import.meta.env[".concat(s,"]"),et.env[s]),et.env[s];if(typeof window!="undefined"&&((o=window==null?void 0:window.__TAGADA_ENV__)!=null&&o[s]))return console.log("window.__TAGADA_ENV__[".concat(s,"]"),window.__TAGADA_ENV__[s]),window.__TAGADA_ENV__[s]}}var va=async(t="default")=>{try{if((he("TAGADA_ENV")||he("TAGADA_ENVIRONMENT"))==="production"||!ot(!0))return null;let n=await fetch("/.local.json");if(!n.ok)return null;let i=await n.json(),o={},r=!1;try{let a=await fetch("/config/".concat(t,".tgd.json"));a.ok||(a=await fetch("/config/".concat(t,".json"))),a.ok&&(o=await a.json(),r=!0)}catch(a){}if(!r&&t!=="default"){console.warn("\u26A0\uFE0F Config variant '".concat(t,"' not found, falling back to 'default'"));try{let a=await fetch("/config/default.tgd.json");a.ok||(a=await fetch("/config/default.json")),a.ok&&(o=await a.json(),r=!0,console.log("\u2705 Fallback to 'default' config successful"))}catch(a){}}r||console.warn(t==="default"?"\u26A0\uFE0F No 'default' config found. Create /config/default.tgd.json":"\u26A0\uFE0F Neither '".concat(t,"' nor 'default' config found. Create /config/default.tgd.json"));let s={storeId:i.storeId,accountId:i.accountId,basePath:i.basePath,config:o};return console.log("\u{1F6E0}\uFE0F Using local development plugin config:",s),s}catch(e){return null}},Na=async()=>{try{if((he("TAGADA_ENV")||he("TAGADA_ENVIRONMENT"))==="production"||!ot(!0))return null;try{console.log("\u{1F6E0}\uFE0F [V2] Attempting to load /config/funnel.local.json...");let i=await fetch("/config/funnel.local.json");if(i.ok){let o=await i.json();console.log("\u{1F6E0}\uFE0F [V2] \u2705 Loaded local funnel config (NEW format):",o);let{loadLocalFunnelConfig:r}=await Promise.resolve().then(()=>(Bn(),Zi));if(await r(),o.staticResources){let s={};for(let[a,l]of Object.entries(o.staticResources))s[a]={id:l};return s}return null}}catch(i){console.log("\u{1F6E0}\uFE0F [V2] funnel.local.json not found, trying legacy format...")}console.log("\u{1F6E0}\uFE0F [V2] Attempting to load /config/resources.static.json (legacy)...");let e=await fetch("/config/resources.static.json");if(!e.ok)return console.log("\u{1F6E0}\uFE0F [V2] No local static resources found"),null;let n=await e.json();return console.log("\u{1F6E0}\uFE0F [V2] \u2705 Loaded legacy static resources:",n),n}catch(t){return console.error("\u{1F6E0}\uFE0F [V2] \u274C Error loading static resources:",t),null}},In=t=>{let e=document.querySelector('meta[name="'.concat(t,'"]'));return(e==null?void 0:e.getAttribute("content"))||void 0},Pa=async()=>{try{if(typeof document=="undefined")return null;let t=In("x-plugin-store-id"),e=In("x-plugin-account-id");if(!t)return null;let n=In("x-plugin-base-path")||"/",i={};try{let r=In("x-plugin-config");if(r){let s=decodeURIComponent(r);i=JSON.parse(s)}}catch(r){console.warn("\u26A0\uFE0F Failed to parse plugin config from meta tag:",r)}e||console.warn("\u26A0\uFE0F Plugin config: Account ID not found in meta tags");let o={storeId:t,accountId:e,basePath:n,config:i};return console.log("\u{1F680} [HIGHEST PRIORITY] Plugin config loaded from meta tags (runtime injected config):",{storeId:t,accountId:e,basePath:n,configKeys:Object.keys(i),configSize:JSON.stringify(i).length}),o}catch(t){return console.warn("\u26A0\uFE0F Error loading production config from meta tags:",t),null}},wr=async(t="default",e)=>{var s,a;console.log("\u{1F527} [V2] loadPluginConfig called with variant:",t);let n=await Na(),i=await Pa();if(i){let l=z(O({},i),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using INJECTED config from meta tags (HIGHEST PRIORITY)"),l}if(e){let l={storeId:e.storeId,accountId:e.accountId,basePath:(s=e.basePath)!=null?s:"/",config:(a=e.config)!=null?a:{},staticResources:n!=null?n:void 0};return console.log("\u2705 [V2] Using raw config parameter (PRIORITY 2)"),l}let o=await La();if(o){let l=z(O({},o),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using environment variables config (PRIORITY 3 - build time)"),l}let r=await va(t);if(r){let l=z(O({},r),{staticResources:n!=null?n:void 0});return console.log("\u2705 [V2] Using local dev config files (PRIORITY 4)"),l}return console.warn("\u26A0\uFE0F [V2] No plugin config found - using defaults"),{basePath:"/",config:{},staticResources:n!=null?n:void 0}};async function xa(t="default",e){try{if(!ot())return null;if(e)return e;let n=["/config/".concat(t,".config.json"),"/config/".concat(t,".tgd.json"),"/config/".concat(t,".json")];for(let i of n)try{let o=await fetch(i);if(o.ok)return await o.json()}catch(o){continue}return console.warn("\u26A0\uFE0F [loadLocalConfig] No config found for '".concat(t,"'")),null}catch(n){return console.error("[loadLocalConfig] Error loading config:",n),null}}async function La(){try{if(!ot())return;let t=he("TAGADA_STORE_ID"),e=he("TAGADA_ACCOUNT_ID"),n=he("TAGADA_BASE_PATH"),i=he("TAGADA_CONFIG_NAME");if(!t||!e)return;let o=await xa(i);if(!o)return;let r={storeId:t,accountId:e,basePath:n||"/",config:o};return console.log("\u{1F6E0}\uFE0F [createRawPluginConfig] Using environment variables (build-time config):",{hasStoreId:!!r.storeId,hasAccountId:!!r.accountId,basePath:r.basePath,hasConfig:!!r.config}),r}catch(t){console.error("[createRawPluginConfig] Error creating config:",t);return}}zt();Ue();Ue();var Oi=new Map,Ri=new Set;function _a(){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get("authCode")}async function br(t,e,n,i=!1){if(Ri.has(t))throw i&&console.log("[AuthHandoff] Code already resolved, skipping duplicate request"),new Error("Auth code already resolved");let o=Oi.get(t);if(o)return i&&console.log("[AuthHandoff] Resolution already in progress, waiting for existing request"),o;i&&console.log("[AuthHandoff] Resolving authCode:",t.substring(0,15)+"...");let r=(async()=>{try{let s=await fetch("".concat(n,"/api/v1/cms/auth/resolve-handoff"),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:t,storeId:e})});if(!s.ok){let l=await s.json().catch(()=>({message:"Unknown error"}));throw new Error(l.message||"Failed to resolve auth handoff: ".concat(s.status))}let a=await s.json();return i&&console.log("[AuthHandoff] \u2705 Resolved successfully:",{customerId:a.customer.id,role:a.customer.role,hasContext:Object.keys(a.context).length>0}),i&&console.log("[AuthHandoff] Storing new token (overriding existing)"),ne(a.token),ka(i),Ri.add(t),a}catch(s){throw console.error("[AuthHandoff] \u274C Failed to resolve:",s),s}finally{Oi.delete(t)}})();return Oi.set(t,r),r}function ka(t=!1){if(typeof window=="undefined")return;let e=new URL(window.location.href);e.searchParams.has("authCode")&&(e.searchParams.delete("authCode"),window.history.replaceState({},"",e.pathname+e.search+e.hash),t&&console.log("[AuthHandoff] Cleaned authCode from URL"))}function Ir(){let t=_a();return!(!t||!t.startsWith("ah_")||Ri.has(t))}var Sn=class{constructor(e={}){this.bus=new bn;this.eventDispatcher=new Be;this.tokenPromise=null;this.tokenResolver=null;this.isInitializingSession=!1;this.lastSessionInitError=null;this.sessionInitRetryCount=0;this.MAX_SESSION_INIT_RETRIES=3;var a,l,u,d;this.config=e,this.instanceId=Math.random().toString(36).substr(2,9),this.boundHandleStorageChange=this.handleStorageChange.bind(this),this.boundHandlePageshow=p=>{if(p.persisted)if(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Page restored from BFcache (back button), re-initializing funnel...")),this.funnel&&this.state.session&&this.state.store){this.funnel.resetInitialization();let T=this.getAccountId(),f=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.funnel.autoInitialize({customerId:this.state.session.customerId,sessionId:this.state.session.sessionId},{id:this.state.store.id,accountId:T},f).catch(I=>{console.error("[TagadaClient] Funnel re-initialization failed:",I)})}else this.sessionInitRetryCount=0,this.initialize()},console.log("[TagadaClient ".concat(this.instanceId,"] Initializing...")),console.log("[TagadaClient ".concat(this.instanceId,"] Config:"),{debugMode:e.debugMode,hasRawPluginConfig:!!e.rawPluginConfig,rawPluginConfig:e.rawPluginConfig,features:e.features}),Wi(this.config.debugMode)&&this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Preview mode active - state cleared"));let i=this.resolveEnvironment(),o=Fi(i);e.customApiConfig&&(o=z(O(O({},o),e.customApiConfig),{apiConfig:O(O({},o.apiConfig),e.customApiConfig.apiConfig)}),this.config.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Applied custom API config:"),o.apiConfig.baseUrl)),this.state={auth:{isAuthenticated:!1,isLoading:!1,customer:null,session:null},session:null,customer:null,locale:{locale:"en-US",language:"en",region:"US",messages:{}},currency:{code:"USD",symbol:"$",name:"US Dollar"},store:null,environment:o,isLoading:!0,isInitialized:!1,isSessionInitialized:!1,pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!0,debugMode:(a=e.debugMode)!=null?a:i!=="production",token:null},console.log("[TagadaClient ".concat(this.instanceId,"] Initial state:"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!e.rawPluginConfig}),this.apiClient=new St({baseURL:o.apiConfig.baseUrl});let r=(l=e.features)==null?void 0:l.funnel;if(r!==!1){let p=typeof r=="object"?r:{};this.funnel=new ct({apiClient:this.apiClient,debugMode:this.state.debugMode,pluginConfig:this.state.pluginConfig,environment:this.state.environment,autoRedirect:p.autoRedirect,funnelId:(u=e.rawPluginConfig)==null?void 0:u.funnelId,stepId:(d=e.rawPluginConfig)==null?void 0:d.stepId})}this.apiClient.setTokenProvider(this.waitForToken.bind(this)),typeof window!="undefined"&&(window.addEventListener("storage",this.boundHandleStorageChange),window.addEventListener("pageshow",this.boundHandlePageshow)),this.setupConfigHotReload(),this.initialize()}destroy(){typeof window!="undefined"&&(window.removeEventListener("storage",this.boundHandleStorageChange),window.removeEventListener("pageshow",this.boundHandlePageshow)),this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Destroyed")),this.eventDispatcher.clear(),this.bus.clear()}handleStorageChange(){if(st()===this.state.token){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Token unchanged (ignoring event)"));return}if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping storage change"));return}if(this.sessionInitRetryCount>=this.MAX_SESSION_INIT_RETRIES&&this.lastSessionInitError){this.state.debugMode&&console.error("[TagadaClient ".concat(this.instanceId,"] Max session init retries reached, giving up"),this.lastSessionInitError);return}this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Storage changed, re-initializing token...")),this.initializeToken()}subscribe(e){return this.eventDispatcher.subscribe(e)}getState(){return this.state}updateState(e){this.state=O(O({},this.state),e),this.eventDispatcher.notify(this.state)}resolveEnvironment(){return this.config.environment?this.config.environment:it()}async initialize(){try{await this.initializePluginConfig(),this.state.pluginConfig.storeId?await this.initializeToken():(console.warn("[TagadaClient] No store ID found in plugin config. Skipping token initialization."),this.updateState({isLoading:!1,isInitialized:!0}))}catch(e){console.error("[TagadaClient] Initialization failed:",e),this.updateState({isLoading:!1,isInitialized:!0})}}async initializePluginConfig(){if(console.log("[TagadaClient ".concat(this.instanceId,"] initializePluginConfig called"),{pluginConfigLoading:this.state.pluginConfigLoading,hasRawPluginConfig:!!this.config.rawPluginConfig}),!this.state.pluginConfigLoading){console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config already loading or loaded, skipping..."));return}try{let e=this.config.localConfig||"default";console.log("[TagadaClient ".concat(this.instanceId,"] Loading plugin config with variant: ").concat(e));let n=await wr(e,this.config.rawPluginConfig);console.log("[TagadaClient ".concat(this.instanceId,"] Plugin config loaded:"),n),this.updateState({pluginConfig:n,pluginConfigLoading:!1}),this.funnel&&this.funnel.setConfig({pluginConfig:n,environment:this.state.environment})}catch(e){console.error("[TagadaClient] Failed to load plugin config:",e),this.updateState({pluginConfig:{basePath:"/",config:{}},pluginConfigLoading:!1})}}async initializeToken(){var e;if(Ir()){let n=this.state.pluginConfig.storeId;if(!n)return console.error("[TagadaClient] Cannot resolve authCode: storeId not found in config"),this.fallbackToNormalFlow();console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F510} Cross-domain auth detected, resolving..."));try{let i=new URLSearchParams(window.location.search).get("authCode");if(!i)return this.fallbackToNormalFlow();let o=await br(i,n,this.state.environment.apiConfig.baseUrl,this.state.debugMode);console.log("[TagadaClient ".concat(this.instanceId,"] \u2705 Auth handoff resolved:"),{customerId:o.customer.id,role:o.customer.role,hasContext:Object.keys(o.context).length>0}),this.setToken(o.token);let r=Dt(o.token);r?(this.updateState({session:r}),await this.initializeSession(r),(e=o.context)!=null&&e.funnelSessionId&&this.funnel&&this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Restoring funnel session from handoff context:"),o.context.funnelSessionId)):(console.error("[TagadaClient] Failed to decode token from handoff"),this.updateState({isInitialized:!0,isLoading:!1}));return}catch(i){console.error("[TagadaClient ".concat(this.instanceId,"] \u274C Auth handoff failed, falling back to normal flow:"),i)}}await this.fallbackToNormalFlow()}async fallbackToNormalFlow(){let n=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("token");n&&(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F512} URL token detected, setting immediately to prevent race condition")),this.apiClient.updateToken(n),ne(n));let i=st();console.log("[TagadaClient ".concat(this.instanceId,"] Initializing token (normal flow)..."),{hasExistingToken:!!i,hasQueryToken:!!n,storeId:this.state.pluginConfig.storeId});let o=null,r=!1;if(n?(o=n,r=!0):i&&!Ar(i)&&(o=i),o){this.setToken(o),r&&(this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Persisting query token to storage...")),ne(o));let s=Dt(o);s?(this.updateState({session:s}),await this.initializeSession(s)):(console.error("[TagadaClient] Failed to decode token"),this.updateState({isInitialized:!0,isLoading:!1}))}else{let s=this.state.pluginConfig.storeId;console.log("[TagadaClient ".concat(this.instanceId,"] No existing token, creating anonymous token..."),{hasStoreId:!!s,storeId:s}),s?await this.createAnonymousToken(s):(console.warn("[TagadaClient ".concat(this.instanceId,"] No storeId in plugin config, skipping anonymous token creation")),this.updateState({isInitialized:!0,isLoading:!1}))}}setToken(e){this.apiClient.updateToken(e),this.updateState({token:e}),this.tokenResolver&&(this.tokenResolver(e),this.tokenPromise=null,this.tokenResolver=null)}waitForToken(){return this.apiClient.getCurrentToken()?Promise.resolve(this.apiClient.getCurrentToken()):(this.tokenPromise||(this.tokenPromise=new Promise(e=>{this.tokenResolver=e})),this.tokenPromise)}async createAnonymousToken(e){if(typeof window!="undefined"){let i=new URLSearchParams(window.location.search).get("token");if(i){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] \u{1F512} URL has token, skipping anonymous token creation")),this.setToken(i),ne(i);let o=Dt(i);o&&(this.updateState({session:o}),await this.initializeSession(o));return}}if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization in progress, skipping anonymous token creation"));return}try{let n=at();this.state.debugMode&&console.log("[TagadaClient] Creating anonymous token for store:",e,{draft:n});let i=await this.apiClient.post("/api/v1/cms/session/anonymous",{storeId:e,role:"anonymous",draft:n},{skipAuth:!0});this.setToken(i.token),ne(i.token);let o=Dt(i.token);o&&(this.updateState({session:o}),await this.initializeSession(o)),this.updateState({isSessionInitialized:!0})}catch(n){console.error("[TagadaClient] Failed to create anonymous token:",n),this.updateState({isInitialized:!0,isLoading:!1})}}async initializeSession(e){var n,i,o,r,s,a,l,u,d,p,T;if(this.isInitializingSession){this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Session initialization already in progress, skipping"));return}this.isInitializingSession=!0;try{this.state.debugMode&&console.log("[TagadaClient ".concat(this.instanceId,"] Initializing session..."),{sessionId:e.sessionId});let b=hr(),f=Er(),I=mr(),w=at(),v=new URLSearchParams(window.location.search).get("draft");v!==null&&Ln(v==="true");let D={storeId:e.storeId,accountId:e.accountId,customerId:e.customerId,role:e.role,browserLocale:I,queryLocale:f.locale,queryCurrency:f.currency,utmSource:f.utmSource,utmMedium:f.utmMedium,utmCampaign:f.utmCampaign,browser:b.userAgent.browser.name,browserVersion:b.userAgent.browser.version,os:b.userAgent.os.name,osVersion:b.userAgent.os.version,deviceType:(n=b.userAgent.device)==null?void 0:n.type,deviceModel:(i=b.userAgent.device)==null?void 0:i.model,deviceVendor:(o=b.userAgent.device)==null?void 0:o.vendor,userAgent:b.userAgent.name,engineName:b.userAgent.engine.name,engineVersion:b.userAgent.engine.version,cpuArchitecture:b.userAgent.cpu.architecture,isBot:(s=(r=b.flags)==null?void 0:r.isBot)!=null?s:!1,isChromeFamily:(l=(a=b.flags)==null?void 0:a.isChromeFamily)!=null?l:!1,isStandalonePWA:(d=(u=b.flags)==null?void 0:u.isStandalonePWA)!=null?d:!1,isAppleSilicon:(T=(p=b.flags)==null?void 0:p.isAppleSilicon)!=null?T:!1,screenWidth:b.screenResolution.width,screenHeight:b.screenResolution.height,timeZone:b.timeZone,draft:w,fetchMessages:!1},L=await this.apiClient.post("/api/v1/cms/session/v2/init",D);this.lastSessionInitError=null,this.sessionInitRetryCount=0,this.updateSessionState(L,e),this.updateState({isInitialized:!0,isSessionInitialized:!0,isLoading:!1}),this.state.debugMode&&console.log("[TagadaClient] Session initialized successfully")}catch(b){this.lastSessionInitError=b,this.sessionInitRetryCount++,console.error("[TagadaClient] Error initializing session (attempt ".concat(this.sessionInitRetryCount,"/").concat(this.MAX_SESSION_INIT_RETRIES,"):"),b),this.updateState({isInitialized:!0,isLoading:!1})}finally{this.isInitializingSession=!1}}updateSessionState(e,n){var o,r,s,a,l,u,d,p,T;if(e.store){let b=e.store,f=z(O({},e.store),{accountId:b.accountId||((o=this.state.pluginConfig)==null?void 0:o.accountId)||n.accountId||"",presentmentCurrencies:b.presentmentCurrencies||[e.store.currency||"USD"],chargeCurrencies:b.chargeCurrencies||[e.store.currency||"USD"]});this.updateState({store:f})}if(e.locale){let b={locale:e.locale,language:e.locale.split("-")[0],region:(r=e.locale.split("-")[1])!=null?r:"US",messages:(s=e.messages)!=null?s:{}};this.updateState({locale:b})}if(e.store){let b={code:e.store.currency,symbol:this.getCurrencySymbol(e.store.currency),name:this.getCurrencyName(e.store.currency)};this.updateState({currency:b})}let i={isAuthenticated:(l=(a=e.customer)==null?void 0:a.isAuthenticated)!=null?l:!1,isLoading:!1,customer:(u=e.customer)!=null?u:null,session:n};if(this.updateState({customer:(d=e.customer)!=null?d:null,auth:i}),this.funnel&&n.customerId&&((p=e.store)!=null&&p.id)){let b=e.store.accountId||((T=this.state.pluginConfig)==null?void 0:T.accountId)||n.accountId||"";if(b){let I=new URLSearchParams(typeof window!="undefined"?window.location.search:"").get("funnelId")||void 0;this.state.debugMode&&console.log("[TagadaClient] Auto-initializing funnel...",{customerId:n.customerId,storeId:e.store.id,accountId:b,funnelId:I||"auto-detect"}),this.funnel.autoInitialize({customerId:n.customerId,sessionId:n.sessionId},{id:e.store.id,accountId:b},I).catch(w=>{console.error("[TagadaClient] Funnel auto-initialization failed:",w)})}else console.warn("[TagadaClient] Cannot auto-initialize funnel: accountId is missing")}}getCurrencySymbol(e){return{USD:"$",EUR:"\u20AC",GBP:"\xA3",JPY:"\xA5",CAD:"C$",AUD:"A$"}[e]||e}getCurrencyName(e){return{USD:"US Dollar",EUR:"Euro",GBP:"British Pound",JPY:"Japanese Yen",CAD:"Canadian Dollar",AUD:"Australian Dollar"}[e]||e}getAccountId(){var e,n,i;return((e=this.state.store)==null?void 0:e.accountId)||((n=this.state.pluginConfig)==null?void 0:n.accountId)||((i=this.state.session)==null?void 0:i.accountId)||""}updatePluginConfig(e){this.state.debugMode&&console.log("[TagadaClient] Hot-reloading config:",e);let n=O(O({},this.state.pluginConfig.config),e);this.updateState({pluginConfig:z(O({},this.state.pluginConfig),{config:n})}),this.bus.emit("CONFIG_UPDATED",n),this.state.debugMode&&console.log("[TagadaClient] Config updated successfully")}setupConfigHotReload(){if(typeof window=="undefined")return;let e=n=>{var i,o;if(((i=n.data)==null?void 0:i.type)==="TAGADAPAY_CONFIG_UPDATE"){let{config:r}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received config update from parent:",r),this.updatePluginConfig(r)}else if(((o=n.data)==null?void 0:o.type)==="APPLY_STYLES_TO_ELEMENT"){let{elementId:r,styles:s}=n.data;this.state.debugMode&&console.log("[TagadaClient] Received style application request:",{elementId:r,styles:s}),this.applyStylesToElement(r,s)}};window.addEventListener("message",e),this.state.debugMode&&console.log("[TagadaClient] Config hot-reload and style manipulation listeners enabled")}applyStylesToElement(e,n){if(typeof document=="undefined")return;let i="tagada-editor-highlight",o=document.getElementById(i);o&&o.remove();let r=p=>{var L;let b=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]).has(p.tagName.toLowerCase()),f=p;if(b){let N=p.parentElement;if((N==null?void 0:N.getAttribute("data-tagada-highlight-wrapper"))==="true"&&N instanceof HTMLElement)f=N;else{let _=document.createElement("div");_.setAttribute("data-tagada-highlight-wrapper","true");let W=window.getComputedStyle(p),ae=W.display;if(ae==="inline"?_.style.display="inline-block":_.style.display=ae,_.style.position="relative",ae==="inline"||ae.includes("inline")){let te=W.verticalAlign;te&&te!=="baseline"&&(_.style.verticalAlign=te)}["width","height","minWidth","minHeight","maxWidth","maxHeight","flex","flexGrow","flexShrink","flexBasis","gridColumn","gridRow","gridColumnStart","gridColumnEnd","gridRowStart","gridRowEnd","gridArea","alignSelf","justifySelf","boxSizing","gap","rowGap","columnGap","order","aspectRatio"].forEach(te=>{let Ae=te.replace(/([A-Z])/g,"-$1").toLowerCase(),j=W.getPropertyValue(Ae);j&&j.trim()!==""&&(te==="flex"&&j!=="none"&&j!=="0 1 auto"?_.style.flex=j:te==="boxSizing"?_.style.boxSizing=j:_.style.setProperty(Ae,j))}),p.style&&["width","height","min-width","min-height","max-width","max-height","flex","flex-grow","flex-shrink","flex-basis","grid-column","grid-row","grid-column-start","grid-column-end","grid-row-start","grid-row-end","grid-area","align-self","justify-self","box-sizing","gap","row-gap","column-gap","order","aspect-ratio"].forEach(Ae=>{let j=p.style.getPropertyValue(Ae);j&&_.style.setProperty(Ae,j)}),(L=p.parentNode)==null||L.insertBefore(_,p),_.appendChild(p),f=_}}let I=getComputedStyle(b?p:f);(f.style.position==="static"||!f.style.position)&&(f.style.position="relative");let w=document.createElement("div");w.id=i,w.style.position="absolute",w.style.inset="0",w.style.pointerEvents="none",w.style.zIndex="9999",w.style.boxSizing="border-box",w.style.background="none",w.style.border="none",w.style.outline="none",w.style.margin="0",w.style.padding="0";let v=I.borderRadius;v&&(w.style.borderRadius=v),f.appendChild(w);let D=n||{boxShadow:"0 0 0 2px rgb(239 68 68)"};if(Object.entries(D).forEach(([N,K])=>{let _=N.includes("-")?N.replace(/-([a-z])/g,(W,ae)=>ae.toUpperCase()):N;N.includes("-")?w.style.setProperty(N,K):w.style[_]=K}),p.scrollIntoView({behavior:"smooth",block:"center"}),this.state.debugMode){let N=Object.entries(D).map(([K,_])=>"".concat(K,": ").concat(_)).join("; ");console.log("[TagadaClient] Applied styles to highlight div of element #".concat(e,":"),N)}},s=5,a=1e3,l=0,u=p=>{let T=window.getComputedStyle(p);return T.display==="none"||T.visibility==="hidden"||T.opacity==="0"||p.hidden||p.offsetWidth===0||p.offsetHeight===0},d=()=>{let p=document.querySelectorAll('[editor-id~="'.concat(e,'"]'));if(p.length===0){if(l+=1,l>=s){this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found after ').concat(s," attempts"));return}this.state.debugMode&&console.warn('[TagadaClient] Element with editor-id containing "'.concat(e,'" not found (attempt ').concat(l,"/").concat(s,"), retrying in ").concat(a/1e3,"s")),setTimeout(d,a);return}let T=null;if(p.length===1)T=p[0];else{for(let b=0;b<p.length;b++)if(!u(p[b])){T=p[b];break}T||(T=p[0])}T&&r(T)};d()}};Rn();rt();function Sr(t={}){return new Sn(t)}Ue();function Tr(t){return typeof window=="undefined"?null:new URLSearchParams(window.location.search).get(t)}function Ee(t,...e){t&&console.log("[TagadaTracker]",...e)}var Bt=class{constructor(){this.config=null;this.client=null;this.initialized=!1;this.initializing=!1}async init(e){var n,i,o,r;if(this.initialized||this.initializing)return Ee(e.debug||!1,"Already initialized or initializing"),this.getSession();this.initializing=!0,this.config=O({debug:!1},e),Ee(this.config.debug,"\u{1F680} Initializing external tracker with SDK...",e);try{let s=Tr("token");s&&(ne(s),Ee(this.config.debug,"\u{1F511} Bootstrapped token from URL")),this.client=Sr({debugMode:this.config.debug,features:{funnel:!0}}),await this.waitForClientReady();let a=await this.initializeFunnel();Ee(this.config.debug,"\u2705 Session initialized (tracking handled by orchestrator):",a),this.initialized=!0;let l=this.getSession();return l&&((i=(n=this.config).onReady)==null||i.call(n,l)),l}catch(s){let a=s instanceof Error?s:new Error(String(s));throw Ee(this.config.debug,"\u274C Initialization failed:",a),(r=(o=this.config).onError)==null||r.call(o,a),a}finally{this.initializing=!1}}getSession(){var n,i;if(!((i=(n=this.client)==null?void 0:n.funnel)!=null&&i.state.context))return null;let e=this.client.funnel.state.context;return{sessionId:e.sessionId,customerId:e.customerId,storeId:e.storeId,funnelId:e.funnelId,currentStepId:e.currentStepId,cmsToken:this.client.state.token||void 0}}isReady(){var e,n;return this.initialized&&!!((n=(e=this.client)==null?void 0:e.funnel)!=null&&n.state.context)}async navigate(e){if(!this.isReady())throw new Error("Tracker not initialized. Call init() first.");Ee(this.config.debug,"\u{1F680} Navigating:",e);let n=e.autoRedirect!==!1;try{let i=await this.client.funnel.navigate({type:e.eventType,data:e.eventData||{}},{autoRedirect:!1});return i!=null&&i.url?(Ee(this.config.debug,"\u2705 Navigation result:",i.url),n&&typeof window!="undefined"&&(window.location.href=e.returnUrl||i.url),{url:i.url}):null}catch(i){throw Ee(this.config.debug,"\u274C Navigation failed:",i),i}}getCustomerId(){var e,n,i,o,r;return((n=(e=this.client)==null?void 0:e.state.auth.customer)==null?void 0:n.id)||((r=(o=(i=this.client)==null?void 0:i.funnel)==null?void 0:o.state.context)==null?void 0:r.customerId)||null}getFunnelSessionId(){var e,n,i;return((i=(n=(e=this.client)==null?void 0:e.funnel)==null?void 0:n.state.context)==null?void 0:i.sessionId)||null}buildUrl(e,n){let i=this.getSession();if(!i)return e;let o=new URL(e,typeof window!="undefined"?window.location.origin:void 0);return o.searchParams.set("funnelSessionId",i.sessionId),i.cmsToken&&o.searchParams.set("token",i.cmsToken),i.funnelId&&o.searchParams.set("funnelId",i.funnelId),o.searchParams.set("storeId",i.storeId),n&&Object.entries(n).forEach(([r,s])=>{o.searchParams.set(r,s)}),o.toString()}getClient(){return this.client}async waitForClientReady(){if(this.client)return new Promise(e=>{let n=0,i=()=>{var o,r;(o=this.client)!=null&&o.state.isInitialized||(r=this.client)!=null&&r.state.token||n>40?e():(n++,setTimeout(i,50))};i()})}async initializeFunnel(){var o,r,s;if(!((o=this.client)!=null&&o.funnel))return null;let e={customerId:((r=this.client.state.auth.customer)==null?void 0:r.id)||"anon_placeholder",sessionId:((s=this.client.state.auth.session)==null?void 0:s.sessionId)||"sess_placeholder"},n={id:this.config.storeId,accountId:this.config.accountId||""},i=this.config.stepId;if(!i)throw new Error("stepId is required for external page tracking (URL mapping does not work for external pages)");return Ee(this.config.debug,"\u{1F50D} Initializing external page at step:",i),this.client.funnel.initialize(e,n,this.config.funnelId||Tr("funnelId")||void 0,i)}},vi=new Bt;typeof window!="undefined"&&(window.TagadaTracker=vi);return Lr(Da);})();
|
|
7
7
|
/*! Bundled license information:
|
|
8
8
|
|
|
9
9
|
detect-europe-js/dist/esm/index.js:
|