1import{R as w}from"./index-CaKTCWaW.js";import{g}from"./ssrViewport-dnvABO0C.js";import{F as i,L as c,D as m,as as S}from"./api-qiY2smlF.js";import{m as v}from"./materialDefaults-D1b-FGD2.js";import{w as I,a as k}from"./hydrationSignal-CBciSBd6.js";import"./chunk-KS7C4IRE-D5dXzlLW.js";import"./squareappApi-BSlCWhS7.js";import"./emotion-element-f0de968e.browser.esm-CkAcib9J.js";function d(t){this.message=t}d.prototype=new Error,d.prototype.name="InvalidCharacterError";var u=typeof window<"u"&&window.atob&&window.atob.bind(window)||function(t){var r=String(t).replace(/=+$/,"");if(r.length%4==1)throw new d("'atob' failed: The string to be decoded is not correctly encoded.");for(var e,n,o=0,a=0,h="";n=r.charAt(a++);~n&&(e=o%4?64*e+n:n,o++%4)?h+=String.fromCharCode(255&e>>(-2*o&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return h};function b(t){var r=t.replace(/-/g,"+").replace(/_/g,"/");switch(r.length%4){case 0:break;case 2:r+="==";break;case 3:r+="=";break;default:throw"Illegal base64url string!"}try{return(function(e){return decodeURIComponent(u(e).replace(/(.)/g,(function(n,o){var a=o.charCodeAt(0).toString(16).toUpperCase();return a.length<2&&(a="0"+a),"%"+a})))})(r)}catch{return u(r)}}function l(t){this.message=t}function y(t,r){if(typeof t!="string")throw new l("Invalid token specified");var e=(r=r||{}).header===!0?0:1;try{return JSON.parse(b(t.split(".")[e]))}catch(n){throw new l("Invalid token specified: "+n.message)}}l.prototype=new Error,l.prototype.name="InvalidTokenError";const p=t=>{try{return localStorage.getItem(t)}catch{return null}};let s="not-started";function D(){return s}const C=6e4;let f=!1;function E(){const t=p("jwtToken");if(!t)return null;try{const r=y(t);return typeof(r==null?void 0:r.exp)!="number"?null:r.exp<Date.now()/1e3}catch{return null}}function x(){if(f||typeof window>"u")return;f=!0;const t=g();let r=!1;const e=()=>{if(!r)try{if(E()!==!0)return;r=!0,clearInterval(n),t.dispatch(i({}));try{c("")}catch{}window.location.pathname!=="/signin"&&window.location.replace("/signin")}catch{}},n=setInterval(e,C);try{document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"&&e()})}catch{}}function L(){f=!1}async function N(){const t=g();try{window.__rsdStore=t}catch{}s="awaiting-hydration";try{await I(),await k(),s="applying";const r=p("jwtToken");if(r)try{const e=y(r),n=Date.now()/1e3;if(e.exp<n){t.dispatch(i({})),window.location.replace("/signin");try{c("")}catch{}}else{t.dispatch(i({token:r,user:e}));try{const o=(e==null?void 0:e.id)??(e==null?void 0:e._id)??(e==null?void 0:e.sub)??"";o&&c(o)}catch{}}}catch{t.dispatch(i({}));try{c("")}catch{}}else if(t.getState().auth.signedIn){t.dispatch(i({}));try{c("")}catch{}}try{const e=p("cart");e&&t.dispatch(m({order:JSON.parse(e)}))}catch{}}finally{t.dispatch(S()),s="done",x()}}function U(){var t;try{if(!localStorage.lat||!localStorage.lon){const r=navigator.geolocation;r&&((t=navigator.permissions)!=null&&t.query)&&navigator.permissions.query({name:"geolocation"}).then(e=>{e.state==="granted"&&r.getCurrentPosition(n=>{let o=n.coords.latitude,a=n.coords.longitude;try{localStorage.setItem("lat",o),localStorage.setItem("lon",a)}catch{}})}).catch(()=>{})}}catch{}try{["demo","prod"].includes("prod")&&localStorage.getItem("acceptedCookies")&&w.initialize("G-QK00MW1WF4")}catch{}try{localStorage.setItem("prefersPalette",JSON.stringify(v))}catch{}}export{L as __resetSessionExpiryWatchForTest,D as getRestorePhase,U as initClientBootstrap,N as restorePersistedState,x as startSessionExpiryWatch};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.