import{o as k,s as H}from"https://cdn.shopify.com/oxygen-v2/26324/10616/21935/1653405/build/_shared/chunk-WG6M4KMI.js";import{b as U,d as z}from"https://cdn.shopify.com/oxygen-v2/26324/10616/21935/1653405/build/_shared/chunk-SFLZO754.js";var _=U(g=>{"use strict";g.parse=I;g.serialize=q;var A=decodeURIComponent,$=encodeURIComponent,p=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/;function I(r,n){if(typeof r!="string")throw new TypeError("argument str must be a string");for(var t={},e=n||{},o=r.split(";"),i=e.decode||A,a=0;ak(r,n);var m=z(_());var R={};function y(r,n){!r&&!R[n]&&(R[n]=!0,console.warn(n))}var h=({sign:r,unsign:n})=>(t,e={})=>{let{secrets:o=[],...i}={path:"/",sameSite:"lax",...e};return B(t,i.expires),{get name(){return t},get isSigned(){return o.length>0},get expires(){return typeof i.maxAge<"u"?new Date(Date.now()+i.maxAge*1e3):i.expires},async parse(a,c){if(!a)return null;let s=(0,m.parse)(a,{...i,...c});return t in s?s[t]===""?"":await P(n,s[t],o):null},async serialize(a,c){return(0,m.serialize)(t,a===""?"":await L(r,a,o),{...i,...c})}}},d=r=>r!=null&&typeof r.name=="string"&&typeof r.isSigned=="boolean"&&typeof r.parse=="function"&&typeof r.serialize=="function";async function L(r,n,t){let e=J(n);return t.length>0&&(e=await r(e,t[0])),e}async function P(r,n,t){if(t.length>0){for(let e of t){let o=await r(n,e);if(o!==!1)return F(o)}return null}return F(n)}function J(r){return btoa(j(encodeURIComponent(JSON.stringify(r))))}function F(r){try{return JSON.parse(decodeURIComponent(V(atob(r))))}catch{return{}}}function V(r){let n=r.toString(),t="",e=0,o,i;for(;e{let t=new Map(Object.entries(r));return{get id(){return n},get data(){return Object.fromEntries(t)},has(e){return t.has(e)||t.has(S(e))},get(e){if(t.has(e))return t.get(e);let o=S(e);if(t.has(o)){let i=t.get(o);return t.delete(o),i}},set(e,o){t.set(e,o)},flash(e,o){t.set(S(e),o)},unset(e){t.delete(e)}}};var w=r=>({cookie:n,createData:t,readData:e,updateData:o,deleteData:i})=>{let a=d(n)?n:r(n?.name||"__session",n);return x(a),{async getSession(c,s){let u=c&&await a.parse(c,s),l=u&&await e(u);return f(l||{},u||"")},async commitSession(c,s){let{id:u,data:l}=c,E=s?.maxAge!=null?new Date(Date.now()+s.maxAge*1e3):s?.expires!=null?s.expires:a.expires;return u?await o(u,l,E):u=await t(l,E),a.serialize(u,s)},async destroySession(c,s){return await i(c.id),a.serialize("",{...s,maxAge:void 0,expires:new Date(0)})}}};function x(r){y(r.isSigned,`The "${r.name}" cookie is not signed, but session cookies should be signed to prevent tampering on the client before they are sent back to the server. See https://remix.run/utils/cookies#signing-cookies for more information.`)}var C=r=>({cookie:n}={})=>{let t=d(n)?n:r(n?.name||"__session",n);return x(t),{async getSession(e,o){return f(e&&await t.parse(e,o)||{})},async commitSession(e,o){let i=await t.serialize(e.data,o);if(i.length>4096)throw new Error("Cookie length will exceed browser maximum. Length: "+i.length);return i},async destroySession(e,o){return t.serialize("",{...o,maxAge:void 0,expires:new Date(0)})}}};var b=r=>({cookie:n}={})=>{let t=new Map;return r({cookie:n,async createData(e,o){let i=Math.random().toString(36).substring(2,10);return t.set(i,{data:e,expires:o}),i},async readData(e){if(t.has(e)){let{data:o,expires:i}=t.get(e);if(!i||i>new Date)return o;i&&t.delete(e)}return null},async updateData(e,o,i){t.set(e,{data:o,expires:i})},async deleteData(e){t.delete(e)}})};var v=new TextEncoder,K=async(r,n)=>{let t=await O(n,["sign"]),e=v.encode(r),o=await crypto.subtle.sign("HMAC",t,e),i=btoa(String.fromCharCode(...new Uint8Array(o))).replace(/=+$/,"");return r+"."+i},Q=async(r,n)=>{let t=r.lastIndexOf("."),e=r.slice(0,t),o=r.slice(t+1),i=await O(n,["verify"]),a=v.encode(e),c=Z(atob(o));return await crypto.subtle.verify("HMAC",i,c,a)?e:!1};async function O(r,n){return await crypto.subtle.importKey("raw",v.encode(r),{name:"HMAC",hash:"SHA-256"},!1,n)}function Z(r){let n=new Uint8Array(r.length);for(let t=0;t