(function(){"use strict";function g(t,e){for(var r=0;rs[n]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}function wt(t){return localStorage===void 0?"":localStorage.getItem(t)||""}function de(t){try{return wt(t)}catch{return""}}function v(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function y(t){if(t.__esModule)return t;var e=t.default;if(typeof e=="function"){var r=function s(){return this instanceof s?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(s){var n=Object.getOwnPropertyDescriptor(t,s);Object.defineProperty(r,s,n.get?n:{enumerable:!0,get:function(){return t[s]}})}),r}var H={exports:{}},pe=function(e,r){return function(){for(var n=new Array(arguments.length),a=0;a"u"}function Et(t){return t!==null&&!J(t)&&t.constructor!==null&&!J(t.constructor)&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function $t(t){return S.call(t)==="[object ArrayBuffer]"}function St(t){return typeof FormData<"u"&&t instanceof FormData}function Rt(t){var e;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?e=ArrayBuffer.isView(t):e=t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function _t(t){return typeof t=="string"}function Ct(t){return typeof t=="number"}function me(t){return t!==null&&typeof t=="object"}function N(t){if(S.call(t)!=="[object Object]")return!1;var e=Object.getPrototypeOf(t);return e===null||e===Object.prototype}function xt(t){return S.call(t)==="[object Date]"}function qt(t){return S.call(t)==="[object File]"}function It(t){return S.call(t)==="[object Blob]"}function ve(t){return S.call(t)==="[object Function]"}function Ot(t){return me(t)&&ve(t.pipe)}function At(t){return typeof URLSearchParams<"u"&&t instanceof URLSearchParams}function Tt(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function Ut(){return typeof navigator<"u"&&(navigator.product==="ReactNative"||navigator.product==="NativeScript"||navigator.product==="NS")?!1:typeof window<"u"&&typeof document<"u"}function V(t,e){if(!(t===null||typeof t>"u"))if(typeof t!="object"&&(t=[t]),z(t))for(var r=0,s=t.length;r"u"||(C.isArray(f)?o=o+"[]":f=[f],C.forEach(f,function(h){C.isDate(h)?h=h.toISOString():C.isObject(h)&&(h=JSON.stringify(h)),a.push(ye(o)+"="+ye(h))}))}),n=a.join("&")}if(n){var i=e.indexOf("#");i!==-1&&(e=e.slice(0,i)),e+=(e.indexOf("?")===-1?"?":"&")+n}return e};const be=y(g({__proto__:null,default:v(we)},[we]));var jt=w;function P(){this.handlers=[]}P.prototype.use=function(e,r,s){return this.handlers.push({fulfilled:e,rejected:r,synchronous:s?s.synchronous:!1,runWhen:s?s.runWhen:null}),this.handlers.length-1},P.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},P.prototype.forEach=function(e){jt.forEach(this.handlers,function(s){s!==null&&e(s)})};var Ee=P;const Lt=y(g({__proto__:null,default:v(Ee)},[Ee])),$e={};var kt=w,Se=function(e,r){kt.forEach(e,function(n,a){a!==r&&a.toUpperCase()===r.toUpperCase()&&(e[r]=n,delete e[a])})};const Dt=y(g({__proto__:null,default:v(Se)},[Se]));var Re=function(e,r,s,n,a){return e.config=r,s&&(e.code=s),e.request=n,e.response=a,e.isAxiosError=!0,e.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:this.config,code:this.code}},e};const _e=y(g({__proto__:null,default:v(Re)},[Re]));var K,Ce;function xe(){if(Ce)return K;Ce=1;var t=_e;return K=function(r,s,n,a,i){var u=new Error(r);return t(u,s,n,a,i)},K}var W,qe;function Bt(){if(qe)return W;qe=1;var t=xe();return W=function(r,s,n){var a=n.config.validateStatus;!n.status||!a||a(n.status)?r(n):s(t("Request failed with status code "+n.status,n.config,null,n.request,n))},W}var X,Ie;function Ft(){if(Ie)return X;Ie=1;var t=w;return X=t.isStandardBrowserEnv()?function(){return{write:function(s,n,a,i,u,f){var o=[];o.push(s+"="+encodeURIComponent(n)),t.isNumber(a)&&o.push("expires="+new Date(a).toGMTString()),t.isString(i)&&o.push("path="+i),t.isString(u)&&o.push("domain="+u),f===!0&&o.push("secure"),document.cookie=o.join("; ")},read:function(s){var n=document.cookie.match(new RegExp("(^|;\\s*)("+s+")=([^;]*)"));return n?decodeURIComponent(n[3]):null},remove:function(s){this.write(s,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}(),X}var Y,Oe;function Mt(){return Oe||(Oe=1,Y=function(e){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(e)}),Y}var Z,Ae;function Ht(){return Ae||(Ae=1,Z=function(e,r){return r?e.replace(/\/+$/,"")+"/"+r.replace(/^\/+/,""):e}),Z}var Q,Te;function zt(){if(Te)return Q;Te=1;var t=Mt(),e=Ht();return Q=function(s,n){return s&&!t(n)?e(s,n):n},Q}var ee,Ue;function Jt(){if(Ue)return ee;Ue=1;var t=w,e=["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"];return ee=function(s){var n={},a,i,u;return s&&t.forEach(s.split(` `),function(o){if(u=o.indexOf(":"),a=t.trim(o.substr(0,u)).toLowerCase(),i=t.trim(o.substr(u+1)),a){if(n[a]&&e.indexOf(a)>=0)return;a==="set-cookie"?n[a]=(n[a]?n[a]:[]).concat([i]):n[a]=n[a]?n[a]+", "+i:i}}),n},ee}var te,Ne;function Vt(){if(Ne)return te;Ne=1;var t=w;return te=t.isStandardBrowserEnv()?function(){var r=/(msie|trident)/i.test(navigator.userAgent),s=document.createElement("a"),n;function a(i){var u=i;return r&&(s.setAttribute("href",u),u=s.href),s.setAttribute("href",u),{href:s.href,protocol:s.protocol?s.protocol.replace(/:$/,""):"",host:s.host,search:s.search?s.search.replace(/^\?/,""):"",hash:s.hash?s.hash.replace(/^#/,""):"",hostname:s.hostname,port:s.port,pathname:s.pathname.charAt(0)==="/"?s.pathname:"/"+s.pathname}}return n=a(window.location.href),function(u){var f=t.isString(u)?a(u):u;return f.protocol===n.protocol&&f.host===n.host}}():function(){return function(){return!0}}(),te}var re,Pe;function je(){if(Pe)return re;Pe=1;var t=w,e=Bt(),r=Ft(),s=be,n=zt(),a=Jt(),i=Vt(),u=xe();return re=function(o){return new Promise(function(h,d){var l=o.data,A=o.headers,T=o.responseType;t.isFormData(l)&&delete A["Content-Type"];var c=new XMLHttpRequest;if(o.auth){var _r=o.auth.username||"",Cr=o.auth.password?unescape(encodeURIComponent(o.auth.password)):"";A.Authorization="Basic "+btoa(_r+":"+Cr)}var vt=n(o.baseURL,o.url);c.open(o.method.toUpperCase(),s(vt,o.params,o.paramsSerializer),!0),c.timeout=o.timeout;function gt(){if(c){var _="getAllResponseHeaders"in c?a(c.getAllResponseHeaders()):null,$=!T||T==="text"||T==="json"?c.responseText:c.response,U={data:$,status:c.status,statusText:c.statusText,headers:_,config:o,request:c};e(h,d,U),c=null}}if("onloadend"in c?c.onloadend=gt:c.onreadystatechange=function(){!c||c.readyState!==4||c.status===0&&!(c.responseURL&&c.responseURL.indexOf("file:")===0)||setTimeout(gt)},c.onabort=function(){c&&(d(u("Request aborted",o,"ECONNABORTED",c)),c=null)},c.onerror=function(){d(u("Network Error",o,null,c)),c=null},c.ontimeout=function(){var $="timeout of "+o.timeout+"ms exceeded";o.timeoutErrorMessage&&($=o.timeoutErrorMessage),d(u($,o,o.transitional&&o.transitional.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",c)),c=null},t.isStandardBrowserEnv()){var yt=(o.withCredentials||i(vt))&&o.xsrfCookieName?r.read(o.xsrfCookieName):void 0;yt&&(A[o.xsrfHeaderName]=yt)}"setRequestHeader"in c&&t.forEach(A,function($,U){typeof l>"u"&&U.toLowerCase()==="content-type"?delete A[U]:c.setRequestHeader(U,$)}),t.isUndefined(o.withCredentials)||(c.withCredentials=!!o.withCredentials),T&&T!=="json"&&(c.responseType=o.responseType),typeof o.onDownloadProgress=="function"&&c.addEventListener("progress",o.onDownloadProgress),typeof o.onUploadProgress=="function"&&c.upload&&c.upload.addEventListener("progress",o.onUploadProgress),o.cancelToken&&o.cancelToken.promise.then(function($){c&&(c.abort(),d($),c=null)}),l||(l=null),c.send(l)})},re}var p=w,Le=Dt,Gt=_e,Kt={"Content-Type":"application/x-www-form-urlencoded"};function ke(t,e){!p.isUndefined(t)&&p.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function Wt(){var t;return(typeof XMLHttpRequest<"u"||typeof $e<"u"&&Object.prototype.toString.call($e)==="[object process]")&&(t=je()),t}function Xt(t,e,r){if(p.isString(t))try{return(e||JSON.parse)(t),p.trim(t)}catch(s){if(s.name!=="SyntaxError")throw s}return(r||JSON.stringify)(t)}var j={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:Wt(),transformRequest:[function(e,r){return Le(r,"Accept"),Le(r,"Content-Type"),p.isFormData(e)||p.isArrayBuffer(e)||p.isBuffer(e)||p.isStream(e)||p.isFile(e)||p.isBlob(e)?e:p.isArrayBufferView(e)?e.buffer:p.isURLSearchParams(e)?(ke(r,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):p.isObject(e)||r&&r["Content-Type"]==="application/json"?(ke(r,"application/json"),Xt(e)):e}],transformResponse:[function(e){var r=this.transitional,s=r&&r.silentJSONParsing,n=r&&r.forcedJSONParsing,a=!s&&this.responseType==="json";if(a||n&&p.isString(e)&&e.length)try{return JSON.parse(e)}catch(i){if(a)throw i.name==="SyntaxError"?Gt(i,this,"E_JSON_PARSE"):i}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(e){return e>=200&&e<300}};j.headers={common:{Accept:"application/json, text/plain, */*"}},p.forEach(["delete","get","head"],function(e){j.headers[e]={}}),p.forEach(["post","put","patch"],function(e){j.headers[e]=p.merge(Kt)});var De=j;const ne=y(g({__proto__:null,default:v(De)},[De]));var Yt=w,Zt=ne,Be=function(e,r,s){var n=this||Zt;return Yt.forEach(s,function(i){e=i.call(n,e,r)}),e};const Qt=y(g({__proto__:null,default:v(Be)},[Be]));var se,Fe;function Me(){return Fe||(Fe=1,se=function(e){return!!(e&&e.__CANCEL__)}),se}var He=w,ae=Qt,er=Me(),tr=ne;function ie(t){t.cancelToken&&t.cancelToken.throwIfRequested()}var ze=function(e){ie(e),e.headers=e.headers||{},e.data=ae.call(e,e.data,e.headers,e.transformRequest),e.headers=He.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),He.forEach(["delete","get","head","post","put","patch","common"],function(n){delete e.headers[n]});var r=e.adapter||tr.adapter;return r(e).then(function(n){return ie(e),n.data=ae.call(e,n.data,n.headers,e.transformResponse),n},function(n){return er(n)||(ie(e),n&&n.response&&(n.response.data=ae.call(e,n.response.data,n.response.headers,e.transformResponse))),Promise.reject(n)})};const rr=y(g({__proto__:null,default:v(ze)},[ze]));var m=w,Je=function(e,r){r=r||{};var s={},n=["url","method","data"],a=["headers","auth","proxy","params"],i=["baseURL","transformRequest","transformResponse","paramsSerializer","timeout","timeoutMessage","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","decompress","maxContentLength","maxBodyLength","maxRedirects","transport","httpAgent","httpsAgent","cancelToken","socketPath","responseEncoding"],u=["validateStatus"];function f(d,l){return m.isPlainObject(d)&&m.isPlainObject(l)?m.merge(d,l):m.isPlainObject(l)?m.merge({},l):m.isArray(l)?l.slice():l}function o(d){m.isUndefined(r[d])?m.isUndefined(e[d])||(s[d]=f(void 0,e[d])):s[d]=f(e[d],r[d])}m.forEach(n,function(l){m.isUndefined(r[l])||(s[l]=f(void 0,r[l]))}),m.forEach(a,o),m.forEach(i,function(l){m.isUndefined(r[l])?m.isUndefined(e[l])||(s[l]=f(void 0,e[l])):s[l]=f(void 0,r[l])}),m.forEach(u,function(l){l in r?s[l]=f(e[l],r[l]):l in e&&(s[l]=f(void 0,e[l]))});var O=n.concat(a).concat(i).concat(u),h=Object.keys(e).concat(Object.keys(r)).filter(function(l){return O.indexOf(l)===-1});return m.forEach(h,o),s};const Ve=y(g({__proto__:null,default:v(Je)},[Je]));var Ge={name:"axios",version:"0.21.4",description:"Promise based HTTP client for the browser and node.js",main:"index.js",scripts:{test:"grunt test",start:"node ./sandbox/server.js",build:"NODE_ENV=production grunt build",preversion:"npm test",version:"npm run build && grunt version && git add -A dist && git add CHANGELOG.md bower.json package.json",postversion:"git push && git push --tags",examples:"node ./examples/server.js",coveralls:"cat coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js",fix:"eslint --fix lib/**/*.js"},repository:{type:"git",url:"https://github.com/axios/axios.git"},keywords:["xhr","http","ajax","promise","node"],author:"Matt Zabriskie",license:"MIT",bugs:{url:"https://github.com/axios/axios/issues"},homepage:"https://axios-http.com",devDependencies:{coveralls:"^3.0.0","es6-promise":"^4.2.4",grunt:"^1.3.0","grunt-banner":"^0.6.0","grunt-cli":"^1.2.0","grunt-contrib-clean":"^1.1.0","grunt-contrib-watch":"^1.0.0","grunt-eslint":"^23.0.0","grunt-karma":"^4.0.0","grunt-mocha-test":"^0.13.3","grunt-ts":"^6.0.0-beta.19","grunt-webpack":"^4.0.2","istanbul-instrumenter-loader":"^1.0.0","jasmine-core":"^2.4.1",karma:"^6.3.2","karma-chrome-launcher":"^3.1.0","karma-firefox-launcher":"^2.1.0","karma-jasmine":"^1.1.1","karma-jasmine-ajax":"^0.1.13","karma-safari-launcher":"^1.0.0","karma-sauce-launcher":"^4.3.6","karma-sinon":"^1.0.5","karma-sourcemap-loader":"^0.3.8","karma-webpack":"^4.0.2","load-grunt-tasks":"^3.5.2",minimist:"^1.2.0",mocha:"^8.2.1",sinon:"^4.5.0","terser-webpack-plugin":"^4.2.3",typescript:"^4.0.5","url-search-params":"^0.10.0",webpack:"^4.44.2","webpack-dev-server":"^3.11.0"},browser:{"./lib/adapters/http.js":"./lib/adapters/xhr.js"},jsdelivr:"dist/axios.min.js",unpkg:"dist/axios.min.js",typings:"./index.d.ts",dependencies:{"follow-redirects":"^1.14.0"},bundlesize:[{path:"./dist/axios.min.js",threshold:"5kB"}]},oe={};["object","boolean","number","function","string","symbol"].forEach(function(t,e){oe[t]=function(s){return typeof s===t||"a"+(e<1?"n ":" ")+t}});var Ke={},nr=Ge.version.split(".");function We(t,e){for(var r=e?e.split("."):nr,s=t.split("."),n=0;n<3;n++){if(r[n]>s[n])return!0;if(r[n]0;){var a=s[n],i=e[a];if(i){var u=t[a],f=u===void 0||i(u,a,t);if(f!==!0)throw new TypeError("option "+a+" must be "+f);continue}if(r!==!0)throw Error("Unknown option "+a)}}var Xe={isOlderVersion:We,assertOptions:sr,validators:oe};const ar=y(g({__proto__:null,default:v(Xe)},[Xe]));var Ye=w,ir=be,Ze=Lt,Qe=rr,L=Ve,et=ar,x=et.validators;function q(t){this.defaults=t,this.interceptors={request:new Ze,response:new Ze}}q.prototype.request=function(e){typeof e=="string"?(e=arguments[1]||{},e.url=arguments[0]):e=e||{},e=L(this.defaults,e),e.method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var r=e.transitional;r!==void 0&&et.assertOptions(r,{silentJSONParsing:x.transitional(x.boolean,"1.0.0"),forcedJSONParsing:x.transitional(x.boolean,"1.0.0"),clarifyTimeoutError:x.transitional(x.boolean,"1.0.0")},!1);var s=[],n=!0;this.interceptors.request.forEach(function(d){typeof d.runWhen=="function"&&d.runWhen(e)===!1||(n=n&&d.synchronous,s.unshift(d.fulfilled,d.rejected))});var a=[];this.interceptors.response.forEach(function(d){a.push(d.fulfilled,d.rejected)});var i;if(!n){var u=[Qe,void 0];for(Array.prototype.unshift.apply(u,s),u=u.concat(a),i=Promise.resolve(e);u.length;)i=i.then(u.shift(),u.shift());return i}for(var f=e;s.length;){var o=s.shift(),O=s.shift();try{f=o(f)}catch(h){O(h);break}}try{i=Qe(f)}catch(h){return Promise.reject(h)}for(;a.length;)i=i.then(a.shift(),a.shift());return i},q.prototype.getUri=function(e){return e=L(this.defaults,e),ir(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Ye.forEach(["delete","get","head","options"],function(e){q.prototype[e]=function(r,s){return this.request(L(s||{},{method:e,url:r,data:(s||{}).data}))}}),Ye.forEach(["post","put","patch"],function(e){q.prototype[e]=function(r,s,n){return this.request(L(n||{},{method:e,url:r,data:s}))}});var tt=q;const or=y(g({__proto__:null,default:v(tt)},[tt]));var ue,rt;function nt(){if(rt)return ue;rt=1;function t(e){this.message=e}return t.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},t.prototype.__CANCEL__=!0,ue=t,ue}var ce,st;function ur(){if(st)return ce;st=1;var t=nt();function e(r){if(typeof r!="function")throw new TypeError("executor must be a function.");var s;this.promise=new Promise(function(i){s=i});var n=this;r(function(i){n.reason||(n.reason=new t(i),s(n.reason))})}return e.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},e.source=function(){var s,n=new e(function(i){s=i});return{token:n,cancel:s}},ce=e,ce}var le,at;function cr(){return at||(at=1,le=function(e){return function(s){return e.apply(null,s)}}),le}var fe,it;function lr(){return it||(it=1,fe=function(e){return typeof e=="object"&&e.isAxiosError===!0}),fe}var ot=w,fr=he,k=or,dr=Ve,pr=ne;function ut(t){var e=new k(t),r=fr(k.prototype.request,e);return ot.extend(r,k.prototype,e),ot.extend(r,e),r}var b=ut(pr);b.Axios=k,b.create=function(e){return ut(dr(b.defaults,e))},b.Cancel=nt(),b.CancelToken=ur(),b.isCancel=Me(),b.all=function(e){return Promise.all(e)},b.spread=cr(),b.isAxiosError=lr(),H.exports=b,H.exports.default=b;var ct=H.exports,hr=y(g({__proto__:null,default:v(ct)},[ct]));const D=v(hr);async function mr(t){return new Promise(e=>setTimeout(e,t))}async function vr(t,e=3,r=1e3){for(let s=0;s(+e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>+e/4).toString(16))}}function F(){return{headers:{Accept:"application/json","Content-Type":"application/json"}}}class lt{static async get(e,r,s){const n=B();E("Sending GET request",{requestId:n,url:e,config:r,params:s});try{const a=await D.get(e,{...F(),...r,withCredentials:!0,params:s});return E("GET response successfully received.",{requestId:n,status:a.status,response:a.data,headers:a.headers}),a}catch(a){throw R("GET request error",{requestId:n,err:a}),a}}static async post(e,r,s,n){const a=B();E("Sending POST request",{requestId:a,url:e,data:r,config:s});const i=async()=>{const u=await D.post(e,r,{...F(),...s,withCredentials:!0});return E("POST response successfully received.",{requestId:a,status:u.status,response:u.data,headers:u.headers}),u};if(n){const{retries:u,backoffFactor:f}=n;return vr(i,u,f)}return i()}static async put(e,r,s){const n=B();E("Sending PUT request",{requestId:n,url:e,data:r,config:s});try{const a=await D.put(e,r,{...F(),...s,withCredentials:!0});return E("PUT response successfully received.",{requestId:n,status:a.status,response:a.data,headers:a.headers}),a}catch(a){throw R("PUT request error",{requestId:n,err:a}),a}}static async delete(e,r){const s=B();E("Sending DELETE request",{requestId:s,url:e,config:r});try{const n=await D.delete(e,{...F(),...r,withCredentials:!0});return E("DELETE response successfully received.",{requestId:s,status:n.status,response:n.data,headers:n.headers}),n}catch(n){throw R("DELETE request error",{requestId:s,err:n}),n}}}async function gr(t){try{const e=`${dt()}/a/log`;await lt.post(e,{log:t},void 0)}catch{}}function R(t,e={}){try{console.error(`[INSTANT] - Error: ${t}`,e),gr({logType:"ERROR",message:t,params:e})}catch{}}function E(t,e={},r=!1){try{(wr||r)&&(Object.keys(e).length>0?console.log(`[INSTANT] - Info: ${t}`,e):console.log(`[INSTANT] - Info: ${t}`))}catch{}}const I="true";window.location.href.includes("instant_use_localhost=true");const yr=window.location.href.includes("instant_use_staging=true")||{}.VITE_USE_STAGING===I||de("_instant_use_staging")===I,wr=window.location.href.includes("instant_use_debug=true")||{}.VITE_USE_DEBUG===I||de("_instant_use_debug")===I,M=(()=>{try{const t=n=>{try{let i=new URL(n).toString();return i.endsWith("/")&&(i=i.slice(0,-1)),i}catch{return null}},r=new URLSearchParams(window.location.search).get("instant_backend_url");if(r)return t(r);const s={}.VITE_BACKEND_URL_OVERRIDE;return s?t(s):""}catch(t){return R("Error getting BACKEND_URL_OVERRIDE",{err:t}),""}})();function br(){const e=new URL(window.location.href).hostname.split(".");return e.length>=2&&e[0]==="mcstaging"}function Er(t){try{!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`http://${t}`);const e=new URL(t).hostname.split(".");return e.length===1?!1:!!(["mcstaging","staging"].includes(e[0])&&e.length>1)}catch(e){return R("An error occurred while parsing the URL",{error:e}),!1}}function ft(){var r,s;const t=(r=window.Instant)==null?void 0:r.appId;return t==="amaroso"?!1:!!((s=window.Instant)!=null&&s.enableSandbox)||(t==null?void 0:t.includes("staging"))||br()||Er(window.location.href)||yr}function dt(){return M||(ft()?"https://cf.staging.api.instant.one":"https://cf.api.instant.one")}function $r(){return M||(ft()?"https://staging.cdn.instant.one":"https://cdn.instant.one")}async function Sr(t,e){return(await lt.get(`${dt()}/merchant/${t}/store?storeCode=${e}&origin=${window.location.origin}`)).data}function pt(t){const e=document.createElement("script");e.src=`${$r()}/instant.js?siteId=${t}`,e.async=!0,document.getElementsByTagName("head")[0].appendChild(e)}function Rr(){function t(){var r;return(r=window.InstantConfig)!=null&&r.siteId?(pt(window.InstantConfig.siteId),!0):!1}let e=t();if(!e){const r=setInterval(()=>{e=t(),e&&clearInterval(r)},200);return r}return null}async function ht(){try{const t=Rr(),e=setInterval(()=>{var r;try{if(!window.Instant||!window.Instant.appId||!window.Instant.storeCode||((r=window==null?void 0:window.InstantJSLoader)==null?void 0:r.initialized))return;clearInterval(e),t&&clearInterval(t),window.InstantJSLoader={initialized:!0},Sr(window.Instant.appId,window.Instant.storeCode).then(({store:n})=>{pt(n.siteId)})}catch(s){R("Error initialising Instant",{err:s})}},200)}catch(t){R("Error initialising Instant",{err:t})}}const mt=()=>{Promise.resolve().then(()=>setTimeout(ht,0)).catch(()=>setTimeout(ht,0))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",mt):mt()})();