@billgangcom/theme-lib 1.120.0 → 1.120.1

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.
Files changed (39) hide show
  1. package/dist/{builder-COOwVmYf.js → builder-CE6yg5oK.js} +5 -5
  2. package/dist/{builder-D2Z888EH.cjs → builder-CWaG42kw.cjs} +2 -2
  3. package/dist/{builder-components-DIW3F4oN.js → builder-components-5Z24DJJP.js} +4 -4
  4. package/dist/{builder-components-CeV8vAD9.cjs → builder-components-Dyplqbia.cjs} +1 -1
  5. package/dist/builder.cjs.js +1 -1
  6. package/dist/builder.es.js +200 -200
  7. package/dist/{charge-GM7BICIx.js → charge-B1GrtVWc.js} +7 -7
  8. package/dist/{charge-D3lrI4Ud.cjs → charge-BEnNfxFr.cjs} +2 -2
  9. package/dist/{checkout-7Tq3dWUe.js → checkout-B21z1TGE.js} +5 -5
  10. package/dist/{checkout-CjlGQSvn.cjs → checkout-CF05O03i.cjs} +1 -1
  11. package/dist/exports.cjs.js +1 -1
  12. package/dist/exports.es.js +6 -6
  13. package/dist/{index-BDiRhZO4.cjs → index-1x0-wbdS.cjs} +1 -1
  14. package/dist/{index-BNbbZxAR.cjs → index-BZ7C0iBt.cjs} +1 -1
  15. package/dist/{index-Cnz2WUHM.js → index-Be2NRkjG.js} +5 -5
  16. package/dist/{index-CjkknAhD.cjs → index-Bl91R63p.cjs} +1 -1
  17. package/dist/{index-9pUVSOhu.cjs → index-BpWh-qOk.cjs} +1 -1
  18. package/dist/{index-DqP6nS6V.js → index-C9ZIjLVQ.js} +5 -5
  19. package/dist/{index-BSEVf9MF.js → index-Cs9xerh4.js} +5 -5
  20. package/dist/{index-Cr_7GBLp.js → index-DTAlnIyB.js} +1 -1
  21. package/dist/{index-C6t0KlJ9.cjs → index-DT_aTpZf.cjs} +1 -1
  22. package/dist/{index-CCCarAz0.js → index-Dez8BiQX.js} +5 -5
  23. package/dist/index.cjs.js +1 -1
  24. package/dist/index.es.js +6 -6
  25. package/dist/{order-Bww_-NyP.cjs → order-BEBOxyTb.cjs} +1 -1
  26. package/dist/{order-D6A71mPV.js → order-dg2Oyqn4.js} +5 -5
  27. package/dist/{subscription-B2CA6LXD.cjs → subscription-Cd-C2FDT.cjs} +1 -1
  28. package/dist/{subscription-D4heazS1.js → subscription-ts1zCYfh.js} +5 -5
  29. package/dist/{ticket-FbE64Ih2.js → ticket-KYg6_LAo.js} +5 -5
  30. package/dist/{ticket-9tbnrHX0.cjs → ticket-STaDp20p.cjs} +1 -1
  31. package/dist/{top-up-D45914YA.cjs → top-up-ZgLo1nZF.cjs} +1 -1
  32. package/dist/{top-up-BDG04hQY.js → top-up-dXcEKblL.js} +5 -5
  33. package/dist/{ui-components-B6WYf8_6.js → ui-components-CpDQ53a4.js} +4 -4
  34. package/dist/{ui-components-CUItRi8R.cjs → ui-components-s9Q6Wg3R.cjs} +1 -1
  35. package/dist/ui.cjs.js +1 -1
  36. package/dist/ui.es.js +1 -1
  37. package/dist/{validation-C4E-87ir.js → validation-DC8gCoJH.js} +5 -5
  38. package/dist/{validation-BAXOBuUN.cjs → validation-DLYUReRT.cjs} +1 -1
  39. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- "use strict";const b=require("./builder-D2Z888EH.cjs"),i=require("react/jsx-runtime"),P=require("react"),v=require("./ui-components-CUItRi8R.cjs"),Xc=require("./builder-components-CeV8vAD9.cjs");require("react-dom");const Kc=require("./ticket-9tbnrHX0.cjs"),Qc=require("./order-Bww_-NyP.cjs"),Gd=require("./subscription-B2CA6LXD.cjs");function Xd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const de=Xd(P),Kd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Jc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=P.useState(!1);return P.useEffect(()=>{typeof window<"u"&&a(Kd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function Qd(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const Jd=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},e2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},t2=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Sr=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},n2=()=>Sr("dash/info"),r2=()=>Sr("dash/dashboard/home"),u2=()=>Sr("rewards"),a2=()=>Sr("balance"),s2=()=>Sr("balance/top-up/settings"),i2=()=>Sr("referral-system"),Ys=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},o2=()=>Ys("terms"),c2=()=>Ys("refund-policy"),l2=()=>Ys("privacy-policy"),xs=10,ua=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${xs}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},aa=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},d2=e=>aa("","post",e),f2=({PageNumber:e})=>ua({url:"customers/orders",PageNumber:e}),h2=e=>aa(e),p2=e=>aa(e),m2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},g2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},b2=(e,t,n)=>aa(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),_2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},x2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},E2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},y2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},T2=({PageNumber:e})=>ua({url:"customers/subscriptions",PageNumber:e}),k2=async({id:e,accessToken:t})=>await C2(e,t),A2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},S2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},I2=async(e,t,n,r,u,a)=>{const s=b.useApiStore.getState().apiUrls,o=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,c=`${s.slApi}/v1/public/${o}/tickets/${e}/${t}/answer`;return(await b.request({url:c,method:"post",body:{message:n,recaptcha:r,tsId:u,...a&&a.length>0&&{imageIds:a.map(h=>h.imageId)}},withToken:!1})).data},N2=({PageNumber:e})=>ua({url:"customers/tickets",PageNumber:e}),v2=({PageNumber:e})=>ua({url:"customers/balance/transactions",PageNumber:e}),w2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},D2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},Tu=new Map,el=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(Tu.has(o))return Tu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw Tu.delete(o),l});return Tu.set(o,c),c},tl=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},nl=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},Cs=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},P2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:nl,logoutCustomer:Cs,requestOtp:tl},Symbol.toStringTag,{value:"Module"})),R2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},O2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},M2=async()=>{const{data:e}=await i2();return e},F2=async e=>{const{data:t}=await O2(e);return t},B2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},j2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function H2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const U2=async(e,t,n,r)=>{const a=`${b.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},Ra="Balance",Mn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},V2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Ui=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},$2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},z2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=$2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},q2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Vi=e=>new Set(e.gateways.map(t=>t.name)),Oa={availableGateways:[],requiresSignInGateways:[]},$i=(e,t)=>{if(t.length===0)return Oa;const n=e[0];if(!n)return Oa;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Oa;const a=Vi(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Vi(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(Ra)?(a.delete(Ra),{availableGateways:[...a],requiresSignInGateways:[Ra]}):{availableGateways:[...a],requiresSignInGateways:[]}},zi=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},Z2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},lu=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var O;h(!0);const{cart:E}=b.useCartStore.getState(),{gateway:_,parts:k}=E,{notifications:y,setNotifications:D}=b.useNotificationStore.getState();_||(h(!1),D([...y,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const I=k.map(Z=>Z.productId);let S=null;try{const{data:Z}=await R2({gateway:_,couponName:x,productIds:I});S=Z.data,D([...y,{message:"Coupon is applied",status:"success",id:b.v4()}]),s(H=>({...H,coupon:x}))}catch(Z){const H=Z;D([...y,{message:`Coupon is not applied: ${H.message}`,status:"error",id:b.v4()}]),s(L=>({...L,coupon:null})),c(null),h(!1)}if(h(!1),(O=S==null?void 0:S.restrictToProductIds)!=null&&O.length&&!I.every(Z=>{var H;return(H=S==null?void 0:S.restrictToProductIds)==null?void 0:H.includes(Z)}))throw new Error("Coupon can't be applied to such products");return c(S),S},g={reset(){s({...V2})},addProducts:x=>{const E=b.useCartStore.getState().products,_=x.filter(k=>!E.some(y=>y.id===k.id));o([...E,..._])},addProductToCart:x=>{const E=b.useCartStore.getState().cart;try{Ui(t,x)}catch(k){throw new Error(k)}const _=E.parts.find(k=>k.productId===x.productId&&k.productVariantId===x.productVariantId&&k.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(E.parts.length&&$i([...E.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...E,parts:[...E.parts,x]}),E.coupon&&f(E.coupon)},removeProduct({productId:x,productVariantId:E}){s(_=>({..._,parts:_.parts.filter(k=>k.productId!==x||k.productVariantId!==E)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return $i(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return q2(t,e.parts)},updateQuantityOfProduct(x){Ui(t,x),s(E=>({...E,parts:E.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:E,totalWithVolumeDiscounts:_}=z2(e.parts,t);let k;const y=_;return x&&x.discount?!x.isFixed&&x.discount===100?k=0:k=x.isFixed?Math.max(0,y-x.discount):y*(1-x.discount/100):_!==E&&(k=_),{total:E,totalWithVolumeDiscounts:_!==E?_:void 0,totalWithDiscount:k}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:E}=b.useGeneralStore.getState();e.coupon&&!E&&f(e.coupon)},setPaymentMethod(x){s(E=>({...E,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:E}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let k;if(E.parts&&a&&Z2(E.parts[0],t))try{const{data:y}=await _2({gateway:E.gateway,coupon:E.coupon,partOrder:E.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...E.customFields},tsId:b.useGetTsId()});k=y.data}catch(y){console.error(y)}else try{const{data:y}=await d2({gateway:E.gateway,parts:[...E.parts],coupon:E.coupon,customerEmail:E.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...E.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:E.usePriorityReplacement===!0});k=y.data}catch(y){const D=y,{notifications:I,setNotifications:S}=b.useNotificationStore.getState();S([...I,{message:`Failed to create order: ${D.message}`,status:"error",id:b.v4()}])}if(l(!1),k)return k;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(E=>({...E,discordSocialConnectId:x}))},setCustomFields(x){s(E=>({...E,customFields:{...x}}))}};return P.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},ur=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var Es={exports:{}},ku={exports:{}},Pe={};/** @license React v16.13.1
1
+ "use strict";const b=require("./builder-CWaG42kw.cjs"),i=require("react/jsx-runtime"),P=require("react"),v=require("./ui-components-s9Q6Wg3R.cjs"),Xc=require("./builder-components-Dyplqbia.cjs");require("react-dom");const Kc=require("./ticket-STaDp20p.cjs"),Qc=require("./order-BEBOxyTb.cjs"),Gd=require("./subscription-Cd-C2FDT.cjs");function Xd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const de=Xd(P),Kd=()=>typeof document<"u"?document.documentElement.hasAttribute("translated")||document.documentElement.querySelector(".translated-ltr, .translated-rtl")!==null||document.head.querySelector('meta[name="_translator"]')!==null:!1,Jc=({children:e,className:t,as:n="span",...r})=>{const[u,a]=P.useState(!1);return P.useEffect(()=>{typeof window<"u"&&a(Kd())},[]),u?i.jsx(n,{className:t,...r,"data-stable-text":e,dangerouslySetInnerHTML:{__html:""}}):i.jsx(n,{className:t,...r,children:e})};async function Qd(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/general`+(e?`?password=${e}`:"");return(await b.request({method:"get",url:r,withToken:!1})).data}const Jd=async()=>{const e=b.useApiStore.getState().apiUrls,t=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain")||"flagship-theme.pages.dev":window.location.hostname,n=`${e.storeApi}/v2/shops/${t}/settings-theme`;return await b.request({url:n,withToken:!0,method:"get"})},e2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/balance/top-up/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},t2=async(e,t)=>{const r=`${b.useApiStore.getState().apiUrls.cashappApi}/v1/${t}/cashapp/link`;return await b.request({url:r,method:"post",body:e,withToken:!1})},Sr=async e=>{const t=b.useApiStore.getState().apiUrls;if(!localStorage.getItem("token"))throw new Error("No access token");const r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${t.customersApi}/v2/${r}/customers/${e}`;return await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"})},n2=()=>Sr("dash/info"),r2=()=>Sr("dash/dashboard/home"),u2=()=>Sr("rewards"),a2=()=>Sr("balance"),s2=()=>Sr("balance/top-up/settings"),i2=()=>Sr("referral-system"),Ys=e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.storeApi}/shops/${n}/${e}`;return b.request({url:r,withToken:!1,method:"get"})},o2=()=>Ys("terms"),c2=()=>Ys("refund-policy"),l2=()=>Ys("privacy-policy"),xs=10,ua=async({url:e,PageNumber:t})=>{var o;const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.customersApi}/v2/${r}/${e}?PageNumber=${t}&PageSize=${xs}`,a=await b.request({url:u,withToken:!0,method:"get",typeToken:"customer"}),s=Number((o=a.headers)==null?void 0:o["x-pagination-total"]);return{list:a.data,totalCount:s}},aa=async(e,t="get",n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/orders/${u}/${e}`;return await b.request({url:a,method:t,withToken:!0,body:n,typeToken:"customer"})},d2=e=>aa("","post",e),f2=({PageNumber:e})=>ua({url:"customers/orders",PageNumber:e}),h2=e=>aa(e),p2=e=>aa(e),m2=(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v2/orders/${u}/${e}/${t}/replacement-requests`;return b.request({url:a,method:"post",withToken:!0,body:n,typeToken:"customer"})},g2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/public/${n}/images`,u=new FormData;return u.append("file",e),b.request({url:r,method:"post",withToken:!1,body:u})},b2=(e,t,n)=>aa(`${e}/${t}/replacement-requests/${n}/cancel`,"post"),_2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/${n}/subscriptions`;return await b.request({url:r,method:"post",withToken:!1,body:e})},x2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},C2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/${r}/subscriptions/${e}/${t}/upgrades`;return await b.request({url:u,method:"get",withToken:!1})},E2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/${u}/subscriptions/${e}/${t}/cancel`;return await b.request({url:a,method:"post",withToken:!1,body:n})},y2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/change-gateway`;return await b.request({url:u,method:"post",withToken:!1,body:{gateway:t}})},T2=({PageNumber:e})=>ua({url:"customers/subscriptions",PageNumber:e}),k2=async({id:e,accessToken:t})=>await C2(e,t),A2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v2/${r}/subscriptions/${e}/order`;return await b.request({url:u,method:"post",withToken:!1,body:t})},S2=async(e,t)=>{const n=b.useApiStore.getState().apiUrls,r=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,u=`${n.slApi}/v1/public/${r}/tickets/${e}/${t}`;return await b.request({url:u,method:"get",withToken:!1})},I2=async(e,t,n,r,u,a)=>{const s=b.useApiStore.getState().apiUrls,o=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,c=`${s.slApi}/v1/public/${o}/tickets/${e}/${t}/answer`;return(await b.request({url:c,method:"post",body:{message:n,recaptcha:r,tsId:u,...a&&a.length>0&&{imageIds:a.map(h=>h.imageId)}},withToken:!1})).data},N2=({PageNumber:e})=>ua({url:"customers/tickets",PageNumber:e}),v2=({PageNumber:e})=>ua({url:"customers/balance/transactions",PageNumber:e}),w2=async(e,t,n)=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.slApi}/v1/reviews/${u}/${t}/${n}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},D2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/charges/${n}/${e}`;return await b.request({url:r,method:"get",withToken:!1})},L2=async e=>{const t=b.useApiStore.getState().apiUrls,n=e.map(s=>["names",s]),r=new URLSearchParams(n),u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${t.slApi}/v2/gateways?shopDomain=${u}&${r.toString()}`;return await b.request({url:a,method:"get",withToken:!1})},Tu=new Map,el=async e=>{const t=b.useApiStore.getState().apiUrls,r=Array.from(new Set(e)).sort().map(l=>["names",l]),u=new URLSearchParams(r),a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${t.slApi}/v2/checkout?shopDomain=${a}&${u.toString()}`,o=`${s}`;if(Tu.has(o))return Tu.get(o);const c=b.request({url:s,method:"get",withToken:!1}).catch(l=>{throw Tu.delete(o),l});return Tu.set(o,c),c},tl=async({email:e,recaptcha:t,tsId:n})=>{const r=b.useApiStore.getState().apiUrls,u=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,a=`${r.customersApi}/v2/${u}/auth/otp/request`;return(await b.request({url:a,body:{email:e,recaptcha:t,tsId:n},method:"post",withToken:!1})).data?{requested:!0,email:e}:{requested:!1,email:void 0}},nl=async({email:e,otp:t,recaptcha:n,tsId:r})=>{const u=b.useApiStore.getState().apiUrls,a=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,s=`${u.customersApi}/v2/${a}/auth/otp/login`,{data:o}=await b.request({url:s,method:"post",body:{email:e,otp:t,recaptcha:n,tsId:r},withToken:!1});return b.useStorefrontStore.getState().setToken(o.data),localStorage.setItem("token",o.data),{token:o.data,requested:!1}},Cs=async()=>{b.useStorefrontStore.getState().setToken(""),b.useCustomerDashboardStore.getState().setDashInfo(null),localStorage.removeItem("token")},P2=Object.freeze(Object.defineProperty({__proto__:null,loginCustomer:nl,logoutCustomer:Cs,requestOtp:tl},Symbol.toStringTag,{value:"Module"})),R2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v2/coupons/${n}/validate`;return await b.request({url:r,method:"post",body:e,withToken:!1})},O2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/referral-system/signup`;return(await b.request({url:r,withToken:!0,method:"post",body:e,typeToken:"customer"})).data},M2=async()=>{const{data:e}=await i2();return e},F2=async e=>{const{data:t}=await O2(e);return t},B2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}`;return await b.request({url:r,method:"post",body:e,withToken:!1})},j2=async e=>{const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.slApi}/v1/discord/${n}/${e.id}?customerEmail=${e.customerEmail}`;return await b.request({url:r,method:"get",withToken:!1})};async function H2(e){const t=b.useApiStore.getState().apiUrls,n=b.IS_LOCAL_HOST?localStorage.getItem("fakeDomain"):window.location.hostname,r=`${t.customersApi}/v2/${n}/customers/rewards/${e.id}/claim`;return b.request({url:r,method:"post",withToken:!0,typeToken:"customer"})}const U2=async(e,t,n,r)=>{const a=`${b.useApiStore.getState().apiUrls.slApi}/v1/vouches/${t}/${n}/${r}`;return await b.request({url:a,method:"post",withToken:!1,body:e})},Ra="Balance",Mn={Number:"NUMBER",Textarea:"LARGE_TEXT",Checkbox:"CHECK_BOX",Hidden:"HIDDEN"},V2={customerEmail:"",recaptcha:"",gateway:"",paymentMethod:"",parts:[],customFields:{},discordSocialConnectId:null,coupon:null,tsId:""},Ui=(e,t)=>{var l;const{productId:n,productVariantId:r,quantity:u,chargeType:a}=t,s=e.find(h=>h.id===n);if(!s)throw new Error("Product does not exist");const o=s.variants.find(h=>h.id===r);if(!o)throw new Error("Variant does not exist");if(a==="RECURRING"&&!o.subscriptionSettings)throw new Error("Variant does not have subscription settings");if(u!==void 0&&((l=o.quantity)!=null&&l.available)&&o.quantity.available<u)throw new Error("Not enough quantity available");const c=b.useCartStore.getState().cart;if(c.parts.length>0){const h=e.find(m=>m.id===c.parts[0].productId),f=h==null?void 0:h.variants.find(m=>m.id===c.parts[0].productVariantId);if(f&&o.price.currency!==f.price.currency)throw new Error("Product have different currency")}return o},$2=(e,t)=>{if(!e.volumeDiscounts||e.volumeDiscounts.length===0)return 0;const n=e.volumeDiscounts.filter(u=>t>=u.amount);return n.length===0?0:n.reduce((u,a)=>a.amount>u.amount?a:u).percentage},z2=(e,t)=>{let n=0,r=0;return e.forEach(u=>{var m,p;const a=t.find(g=>(g==null?void 0:g.id)===u.productId),s=a==null?void 0:a.variants.find(g=>g.id===u.productVariantId);if(!s)return;const{gateway:o}=b.useCartStore.getState().cart,c=(s==null?void 0:s.gateways)||[],l=c.some(g=>g.name===o&&g.overrodePrice)?(m=c.find(g=>g.name===o))==null?void 0:m.overrodePrice:null;let h=0,f=0;if(u.chargeType==="ONE_TIME"?(h=(l==null?void 0:l.amount)||(s==null?void 0:s.price.amount)||0,f=h*u.quantity):f=s!=null&&s.subscriptionSettings?s.subscriptionSettings.price.amount+(((p=s.subscriptionSettings.entryFee)==null?void 0:p.amount)||0):0,n+=f,u.chargeType==="ONE_TIME"){const g=$2(s,u.quantity),x=f*(1-g/100);r+=x}else r+=f}),{total:n,totalWithVolumeDiscounts:r}},q2=(e,t)=>({isRequired:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isRequired}),isEnabled:t.some(r=>{var a;const u=e.find(s=>(s==null?void 0:s.id)===r.productId);return(a=u==null?void 0:u.variants.find(s=>s.id===r.productVariantId))==null?void 0:a.discordSettings.isEnabled})}),Vi=e=>new Set(e.gateways.map(t=>t.name)),Oa={availableGateways:[],requiresSignInGateways:[]},$i=(e,t)=>{if(t.length===0)return Oa;const n=e[0];if(!n)return Oa;const r=t.find(o=>o.id===n.productId),u=r==null?void 0:r.variants.find(o=>o.id===n.productVariantId);if(!u)return Oa;const a=Vi(u);for(const o of e){const c=t.find(f=>f.id===o.productId);if(!c)continue;const l=c.variants.find(f=>f.id===o.productVariantId);if(!l)continue;const h=Vi(l);for(const f of a)h.has(f)||a.delete(f)}return!localStorage.getItem("token")&&a.has(Ra)?(a.delete(Ra),{availableGateways:[...a],requiresSignInGateways:[Ra]}):{availableGateways:[...a],requiresSignInGateways:[]}},zi=(e,t)=>{if(e.length===0)return[];const r=e.map(a=>{const s=t.find(c=>c.id===a.productId),o=s==null?void 0:s.variants.find(c=>c.id===a.productVariantId);return(o==null?void 0:o.customFields)??[]}).flat().reduce((a,s)=>{const o=a[s.name];return o?(s.required&&!o.required&&(a[s.name]={...s,value:s.defaultValue}),a):(a[s.name]={...s,value:s.defaultValue},a)},{});return Object.values(r).map(a=>({...a,value:""}))},Z2=(e,t)=>{const n=t.find(u=>u.id===e.productId),r=n==null?void 0:n.variants.find(u=>u.id===e.productVariantId);return e.chargeType==="RECURRING"?!!(r!=null&&r.subscriptionSettings):!1},lu=()=>{const{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,customerEmail:a,setCart:s,setProducts:o,setCoupon:c,setPending:l,setApplyCouponPending:h}=b.useCartStore(),f=async x=>{var O;h(!0);const{cart:E}=b.useCartStore.getState(),{gateway:_,parts:k}=E,{notifications:y,setNotifications:D}=b.useNotificationStore.getState();_||(h(!1),D([...y,{message:"There should be a gateway for the coupon",status:"error",id:b.v4()}]));const I=k.map(Z=>Z.productId);let S=null;try{const{data:Z}=await R2({gateway:_,couponName:x,productIds:I});S=Z.data,D([...y,{message:"Coupon is applied",status:"success",id:b.v4()}]),s(H=>({...H,coupon:x}))}catch(Z){const H=Z;D([...y,{message:`Coupon is not applied: ${H.message}`,status:"error",id:b.v4()}]),s(L=>({...L,coupon:null})),c(null),h(!1)}if(h(!1),(O=S==null?void 0:S.restrictToProductIds)!=null&&O.length&&!I.every(Z=>{var H;return(H=S==null?void 0:S.restrictToProductIds)==null?void 0:H.includes(Z)}))throw new Error("Coupon can't be applied to such products");return c(S),S},g={reset(){s({...V2})},addProducts:x=>{const E=b.useCartStore.getState().products,_=x.filter(k=>!E.some(y=>y.id===k.id));o([...E,..._])},addProductToCart:x=>{const E=b.useCartStore.getState().cart;try{Ui(t,x)}catch(k){throw new Error(k)}const _=E.parts.find(k=>k.productId===x.productId&&k.productVariantId===x.productVariantId&&k.chargeType===x.chargeType);if(_)return g.updateQuantityOfProduct({..._,quantity:(_.quantity||1)+(x.quantity||1),chargeType:x.chargeType});if(E.parts.length&&$i([...E.parts,x],t).availableGateways.length===0)throw new Error("No common payment gateways available");s({...E,parts:[...E.parts,x]}),E.coupon&&f(E.coupon)},removeProduct({productId:x,productVariantId:E}){s(_=>({..._,parts:_.parts.filter(k=>k.productId!==x||k.productVariantId!==E)})),e.coupon&&f(e.coupon)},getPossibleGateways(){return $i(e.parts,t)},removeCoupon(){c(null)},getDiscordSettings(){return q2(t,e.parts)},updateQuantityOfProduct(x){Ui(t,x),s(E=>({...E,parts:E.parts.map(_=>_.productId===x.productId&&_.productVariantId===x.productVariantId?{..._,quantity:x.quantity,chargeType:x.chargeType}:_)})),e.coupon&&f(e.coupon)},getTotalAndDiscount(){const{coupon:x}=b.useCartStore.getState(),{total:E,totalWithVolumeDiscounts:_}=z2(e.parts,t);let k;const y=_;return x&&x.discount?!x.isFixed&&x.discount===100?k=0:k=x.isFixed?Math.max(0,y-x.discount):y*(1-x.discount/100):_!==E&&(k=_),{total:E,totalWithVolumeDiscounts:_!==E?_:void 0,totalWithDiscount:k}},setGateway(x){s(_=>({..._,gateway:x}));const{isAntistock:E}=b.useGeneralStore.getState();e.coupon&&!E&&f(e.coupon)},setPaymentMethod(x){s(E=>({...E,paymentMethod:x}))},async submitCart(x){l(!0);const{cart:E}=b.useCartStore.getState(),{discordInfo:_}=b.useDiscordStore.getState();let k;if(E.parts&&a&&Z2(E.parts[0],t))try{const{data:y}=await _2({gateway:E.gateway,coupon:E.coupon,partOrder:E.parts[0],referralCode:localStorage.getItem("referralCode"),discordSocialConnectId:_!=null&&_.authorized?_.id:null,customerEmail:a,recaptcha:x,customFields:{...E.customFields},tsId:b.useGetTsId()});k=y.data}catch(y){console.error(y)}else try{const{data:y}=await d2({gateway:E.gateway,parts:[...E.parts],coupon:E.coupon,customerEmail:E.customerEmail,referralCode:localStorage.getItem("referralCode"),recaptcha:x,customFields:{...E.customFields},tsId:b.useGetTsId(),discordSocialConnectId:_!=null&&_.authorized?_.id:null,usePriorityReplacement:E.usePriorityReplacement===!0});k=y.data}catch(y){const D=y,{notifications:I,setNotifications:S}=b.useNotificationStore.getState();S([...I,{message:`Failed to create order: ${D.message}`,status:"error",id:b.v4()}])}if(l(!1),k)return k;throw new Error("Failed to create order")},setDiscordSocialConnectId(x){s(E=>({...E,discordSocialConnectId:x}))},setCustomFields(x){s(E=>({...E,customFields:{...x}}))}};return P.useEffect(()=>{s(x=>({...x,customerEmail:a??""}))},[a,s]),{cart:e,products:t,coupon:n,pending:r,applyCouponPending:u,applyCoupon:f,...g}},ur=()=>{const{notifications:e,setNotifications:t}=b.useNotificationStore();return n=>{navigator.clipboard.writeText(n),t([...e,{status:"success",message:"Successfully copied",id:b.v4()}])}};var Es={exports:{}},ku={exports:{}},Pe={};/** @license React v16.13.1
2
2
  * react-is.production.min.js
3
3
  *
4
4
  * Copyright (c) Facebook, Inc. and its affiliates.
@@ -76,7 +76,7 @@ and limitations under the License.
76
76
  }
77
77
  }`;const s4="_authContainer_1uyf7_2",i4="_authWrapper_1uyf7_12",o4="_inModal_1uyf7_19",c4="_formHeaderTitle_1uyf7_26",l4="_formHeaderSubtitle_1uyf7_33",d4="_formLabel_1uyf7_39",f4="_formError_1uyf7_51",h4="_submitButton_1uyf7_57",p4="_submitButtonAntistock_1uyf7_57",m4="_backButton_1uyf7_67",g4="_otpContainer_1uyf7_78",b4="_otpSlots_1uyf7_85",_4="_otpSlot_1uyf7_85",x4="_active_1uyf7_108",C4="_otpSlotEmpty_1uyf7_113",E4="_actionRow_1uyf7_117",y4="_authForm_1uyf7_124",T4="_formHeader_1uyf7_26",k4="_input_1uyf7_135",Xe={authContainer:s4,authWrapper:i4,inModal:o4,formHeaderTitle:c4,formHeaderSubtitle:l4,formLabel:d4,formError:f4,submitButton:h4,submitButtonAntistock:p4,backButton:m4,otpContainer:g4,otpSlots:b4,otpSlot:_4,active:x4,otpSlotEmpty:C4,actionRow:E4,authForm:y4,formHeader:T4,input:k4},A4=P.forwardRef(({value:e,onChange:t,onComplete:n},r)=>i.jsx(t0,{ref:r,value:e,onChange:t,onComplete:n,maxLength:6,containerClassName:Xe.otpContainer,render:({slots:u})=>i.jsx("div",{className:Xe.otpSlots,children:u.map(a=>i.jsx(S4,{...a},crypto.randomUUID()))})}));function S4({char:e,isActive:t}){return i.jsx("div",{className:b.clx(Xe.otpSlot,{[Xe.active]:t}),children:e?i.jsx("div",{children:e}):i.jsx("div",{className:Xe.otpSlotEmpty,children:"0"})})}const I4=e=>{const t=/^[^\s@]+@[^\s@]+\.[^\s@]+$/;return e.trim()?t.test(e)?null:"Please enter a valid email.":"The email field cannot be empty."},N4=e=>/^[0-9]{6}$/.test(e)?null:"Invalid verification code. The code should be a six-digit number. Please try again",n0=({title:e,subtitle:t,isAntistock:n})=>i.jsxs("div",{className:Xe.formHeader,style:{textAlign:n?"center":void 0},children:[i.jsx("h3",{id:"h3",className:Xe.formHeaderTitle,children:e}),t?i.jsx("div",{className:Xe.formHeaderSubtitle,children:t}):null]}),r0=({error:e})=>e?i.jsx("div",{className:Xe.formError,children:e}):null,u0=()=>{const[e,t]=P.useState(""),[n,r]=P.useState(null),[u,a]=P.useState(!1),{executeRecaptcha:s}=du(),{setOtpRequest:o}=b.useCustomerDashboardStore(),{isAntistock:c}=b.useGeneralStore(),l=async h=>{h.preventDefault(),r(null);const f=I4(e);if(f){r(f);return}a(!0);try{const m=await s();if(!m)throw new Error("ReCaptcha verification failed");await tl({email:e,recaptcha:m,tsId:b.useGetTsId()}),o({requested:!0,email:e})}catch{r("Failed to request OTP. Please try again.")}finally{a(!1)}};return i.jsxs("form",{onSubmit:l,className:Xe.authForm,children:[i.jsx(n0,{title:c?"My Account":"Sign In",subtitle:c?"":"To continue, enter your email address below.",isAntistock:c}),i.jsxs("div",{className:Xe.input,children:[i.jsx(v.Input,{label:c?"Email":"Email Address",placeholder:"your@email.com",value:e,onChange:h=>{t(h),r(null)}}),i.jsx(r0,{error:n})]}),i.jsx(v.Button,{type:"Primary",className:c?Xe.submitButtonAntistock:Xe.submitButton,disabled:u,children:u?c?i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[i.jsx(v.Loader,{}),i.jsx("span",{children:"Continue"})]}):i.jsx(v.Loader,{}):c?"Continue":"Sign In"}),i.jsx("span",{style:{color:"var(--text-secondary)",paddingTop:"8px",fontSize:"var(--font-body-md-size)",textAlign:"center"},children:"You will receive a 6-digit account code via email."})]})},a0=({onSignIn:e})=>{const{otpRequest:t,setOtpRequest:n}=b.useCustomerDashboardStore(),{isAntistock:r}=b.useGeneralStore(),[u,a]=P.useState(""),[s,o]=P.useState(null),[c,l]=P.useState(!1),{executeRecaptcha:h}=du(),f=async()=>{o(null);const p=N4(u);if(p){o(p);return}l(!0);try{const g=await h();if(!g)throw new Error("ReCaptcha verification failed");await nl({email:t.email,otp:u,recaptcha:g||"",tsId:b.useGetTsId()}),e&&e()}catch{o("Invalid OTP. Please try again.")}finally{l(!1)}},m=()=>n({requested:!1,email:""});return i.jsxs("form",{onSubmit:f,className:Xe.authForm,children:[i.jsx(n0,{title:"Check Your Email",subtitle:`Enter the 6-digit code we sent to ${t.email}`,isAntistock:r}),i.jsxs("label",{className:Xe.formLabel,children:["Code",i.jsx(A4,{onChange:p=>{a(p),o(null)},value:u,onComplete:f})]}),i.jsx(r0,{error:s}),i.jsxs("div",{className:Xe.actionRow,children:[i.jsx(v.Button,{onClick:m,type:"Secondary",className:Xe.backButton,children:"Back"}),i.jsx(v.Button,{type:"Primary",className:r?Xe.submitButtonAntistock:Xe.submitButton,disabled:c,children:c?i.jsx(v.Loader,{}):r?"Continue":"Sign In"})]})]})},ma=({inModal:e,onSignIn:t})=>{const{otpRequest:n,setOtpRequest:r}=b.useCustomerDashboardStore();return P.useEffect(()=>{n.requested&&r({requested:!1,email:""})},[]),i.jsx("div",{className:Xe.authContainer,children:n?i.jsx("div",{className:b.clx(Xe.authWrapper,e&&Xe.inModal),children:n.requested?i.jsx(a0,{onSignIn:t}):i.jsx(u0,{})}):i.jsx(v.Loader,{})})};function v4(){const e=new URL(window.location.href);window.history.replaceState(null,"",e.pathname+e.hash)}var oi=(e=>(e.ADD_BALANCE="AddBalance",e))(oi||{});function w4(){const e=new URLSearchParams(document.location.search),t=e.get("page"),n=e.get("action");return{page:t,action:n}}function D4(){const{page:e,action:t}=w4(),{setRoute:n,setAction:r}=b.useCustomerDashboardStore.getState();e&&Object.values(b.Routes).includes(e)&&n(e),t&&Object.values(oi).includes(t)&&r(t),v4()}const L4=()=>typeof b.Routes>"u"?(console.warn("Routes not available for RouteToRouteComponent"),{}):{[b.Routes.Home]:Xl,[b.Routes.Orders]:Qc.Orders,[b.Routes.Rewards]:Kl,[b.Routes.Balance]:Yl,[b.Routes.Subscriptions]:Gd.Subscriptions,[b.Routes.Tickets]:Kc.Tickets},P4=()=>typeof b.Routes>"u"?(console.warn("Routes not available for RouteToAntistockRouteComponent"),{}):{[b.Routes.Home]:Xl,[b.Routes.Orders]:Qc.Orders,[b.Routes.Rewards]:Kl,[b.Routes.Balance]:Yl,[b.Routes.Tickets]:Kc.Tickets},R4=()=>{const{route:e,action:t,setRoute:n,setIsBalanceModalOpen:r}=b.useCustomerDashboardStore(),{resetPage:u}=b.usePaginationPagesStore(),{token:a}=b.useStorefrontStore(),{isAntistock:s}=b.useGeneralStore(),o=s?P4()[e]:L4()[e];return P.useEffect(()=>{u(),D4()},[a,e,u]),P.useEffect(()=>{t===oi.ADD_BALANCE&&e===b.Routes.Balance&&r(!0)},[e,t]),P.useEffect(()=>{window.location.pathname.includes("/ticket")&&n(b.Routes.Tickets)},[window.location.pathname]),a?i.jsx("div",{style:{maxWidth:"var(--max-width-store)",margin:"0 auto",height:"100%"},children:i.jsx(v.Wrapper,{notPadding:!0,style:{height:"100%"},maxWidth:"var(--max-width-store)",children:c=>i.jsxs("main",{className:b.clx(Wn.appContainer,{[Wn.mobile]:c!=="desktop",[Wn.noAnimation]:s,[Wn.appContainerAntistock]:s}),children:[i.jsx(jl,{adaptiveStyles:c}),i.jsx("div",{className:b.clx(Wn.contentContainer,{[Wn.mobile]:c!=="desktop",[Wn.contentContainerAntistock]:s}),children:i.jsx(o,{adaptiveStyles:c})})]})})}):i.jsx(ma,{})},O4=()=>i.jsx(Js,{children:i.jsx(R4,{})}),M4="_referralBlock_kla2r_2",F4="_skeleton_kla2r_3",B4="_mobile_kla2r_13",j4="_referralContainer_kla2r_18",H4="_title_kla2r_30",U4="_description_kla2r_36",V4="_linkContainer_kla2r_56",$4="_modalContainer_kla2r_77",z4="_steps_kla2r_86",q4="_joinButton_kla2r_92",Z4="_stepItem_kla2r_97",W4="_iconContainer_kla2r_103",Y4="_index_kla2r_111",G4="_bar_kla2r_123",X4="_content_kla2r_130",K4="_caption_kla2r_135",Q4="_descriptionStep_kla2r_141",J4="_error_kla2r_151",e5="_infoBlock_kla2r_155",t5="_infoIcon_kla2r_164",n5="_infoText_kla2r_173",r5="_actions_kla2r_178",u5="_cancelButton_kla2r_183",a5="_referralStats_kla2r_187",s5="_referralInfo_kla2r_204",i5="_referralStatsItem_kla2r_210",o5="_referralStatsItemValue_kla2r_220",c5="_referralStatsItemLabel_kla2r_225",l5="_referral_kla2r_2",d5="_header_kla2r_244",f5="_contentModal_kla2r_254",ge={referralBlock:M4,skeleton:F4,mobile:B4,referralContainer:j4,title:H4,description:U4,linkContainer:V4,modalContainer:$4,steps:z4,joinButton:q4,stepItem:Z4,iconContainer:W4,index:Y4,bar:G4,content:X4,caption:K4,descriptionStep:Q4,error:J4,infoBlock:e5,infoIcon:t5,infoText:n5,actions:r5,cancelButton:u5,referralStats:a5,referralInfo:s5,referralStatsItem:i5,referralStatsItemValue:o5,referralStatsItemLabel:c5,referral:l5,header:d5,contentModal:f5},h5=({caption:e,description:t,index:n,bar:r=!0})=>i.jsxs("div",{className:ge.stepItem,children:[i.jsxs("div",{className:ge.iconContainer,children:[i.jsx("div",{className:ge.index,children:n}),r&&i.jsx("div",{className:ge.bar})]}),i.jsxs("div",{className:ge.content,children:[i.jsx("div",{className:ge.caption,children:e}),i.jsx("div",{className:ge.descriptionStep,children:t})]})]}),p5=({setIsOpen:e,setIsLoading:t})=>{const[n,r]=P.useState(""),[u,a]=P.useState(""),{notifications:s,setNotifications:o}=b.useNotificationStore(),{setIsOpen:c}=b.useModalStore(),l=async f=>{if(f.preventDefault(),n.length<3){a("Referral Code should have minimum length of 3");return}t(!0),h();try{await F2({referralCode:n}),o([...s,{message:"Referral Code has been applied",status:"success",id:b.v4()}])}catch(m){const p=m;o([...s,{message:p.message,status:"error",id:b.v4()}])}t(!1),e(!1),r(""),a("")},h=()=>{c(!1),setTimeout(()=>{e(!1)},300)};return i.jsxs("div",{onClick:f=>f.stopPropagation(),className:ge.modalContainer,children:[i.jsxs("div",{className:ge.header,children:[i.jsx("div",{id:"h3",children:"Create an affiliate code"}),i.jsx(v.Icon,{name:"X",onClick:h,hoverable:!0,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:ge.contentModal,children:[i.jsx(v.Input,{value:n,onChange:f=>r(f),placeholder:"Enter code here (e.g., Join)",label:"Affiliate Code"}),u&&i.jsx("div",{className:ge.error,children:u}),i.jsxs("div",{className:ge.infoBlock,children:[i.jsx("div",{className:ge.infoIcon,children:i.jsx(v.Icon,{name:"Info"})}),i.jsx("div",{className:ge.infoText,children:"Once you join our referral program, you'll gain access to special deals, rewards, and potentially earn a percentage (%) of revenue."})]}),i.jsxs("div",{className:ge.actions,children:[i.jsx(v.Button,{type:"Secondary",className:ge.cancelButton,onClick:h,children:"Cancel"}),i.jsx(v.Button,{type:"Primary",onClick:l,children:"Create"})]})]})]})},wu=()=>i.jsx("div",{style:{display:"flex",alignItems:"center",width:"100%"},children:i.jsxs("svg",{width:"100%",height:"64",viewBox:"0 0 208 64",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[i.jsxs("g",{clipPath:"url(#clip0_2098_5511)",children:[i.jsx("mask",{id:"path-1-inside-1_2098_5511",fill:"white",children:i.jsx("path",{d:"M0 0H208V16H0V0Z"})}),i.jsx("path",{d:"M208 16.5C208.276 16.5 208.5 16.2761 208.5 16C208.5 15.7239 208.276 15.5 208 15.5V16.5ZM0 15.5C-0.276142 15.5 -0.5 15.7239 -0.5 16C-0.5 16.2761 -0.276142 16.5 0 16.5V15.5ZM4 16.5C4.27614 16.5 4.5 16.2761 4.5 16C4.5 15.7239 4.27614 15.5 4 15.5V16.5ZM12 15.5C11.7239 15.5 11.5 15.7239 11.5 16C11.5 16.2761 11.7239 16.5 12 16.5V15.5ZM20 16.5C20.2761 16.5 20.5 16.2761 20.5 16C20.5 15.7239 20.2761 15.5 20 15.5V16.5ZM28 15.5C27.7239 15.5 27.5 15.7239 27.5 16C27.5 16.2761 27.7239 16.5 28 16.5V15.5ZM36 16.5C36.2761 16.5 36.5 16.2761 36.5 16C36.5 15.7239 36.2761 15.5 36 15.5V16.5ZM44 15.5C43.7239 15.5 43.5 15.7239 43.5 16C43.5 16.2761 43.7239 16.5 44 16.5V15.5ZM52 16.5C52.2761 16.5 52.5 16.2761 52.5 16C52.5 15.7239 52.2761 15.5 52 15.5V16.5ZM60 15.5C59.7239 15.5 59.5 15.7239 59.5 16C59.5 16.2761 59.7239 16.5 60 16.5V15.5ZM68 16.5C68.2761 16.5 68.5 16.2761 68.5 16C68.5 15.7239 68.2761 15.5 68 15.5V16.5ZM76 15.5C75.7239 15.5 75.5 15.7239 75.5 16C75.5 16.2761 75.7239 16.5 76 16.5V15.5ZM84 16.5C84.2761 16.5 84.5 16.2761 84.5 16C84.5 15.7239 84.2761 15.5 84 15.5V16.5ZM92 15.5C91.7239 15.5 91.5 15.7239 91.5 16C91.5 16.2761 91.7239 16.5 92 16.5V15.5ZM100 16.5C100.276 16.5 100.5 16.2761 100.5 16C100.5 15.7239 100.276 15.5 100 15.5V16.5ZM108 15.5C107.724 15.5 107.5 15.7239 107.5 16C107.5 16.2761 107.724 16.5 108 16.5V15.5ZM116 16.5C116.276 16.5 116.5 16.2761 116.5 16C116.5 15.7239 116.276 15.5 116 15.5V16.5ZM124 15.5C123.724 15.5 123.5 15.7239 123.5 16C123.5 16.2761 123.724 16.5 124 16.5V15.5ZM132 16.5C132.276 16.5 132.5 16.2761 132.5 16C132.5 15.7239 132.276 15.5 132 15.5V16.5ZM140 15.5C139.724 15.5 139.5 15.7239 139.5 16C139.5 16.2761 139.724 16.5 140 16.5V15.5ZM148 16.5C148.276 16.5 148.5 16.2761 148.5 16C148.5 15.7239 148.276 15.5 148 15.5V16.5ZM156 15.5C155.724 15.5 155.5 15.7239 155.5 16C155.5 16.2761 155.724 16.5 156 16.5V15.5ZM164 16.5C164.276 16.5 164.5 16.2761 164.5 16C164.5 15.7239 164.276 15.5 164 15.5V16.5ZM172 15.5C171.724 15.5 171.5 15.7239 171.5 16C171.5 16.2761 171.724 16.5 172 16.5V15.5ZM180 16.5C180.276 16.5 180.5 16.2761 180.5 16C180.5 15.7239 180.276 15.5 180 15.5V16.5ZM188 15.5C187.724 15.5 187.5 15.7239 187.5 16C187.5 16.2761 187.724 16.5 188 16.5V15.5ZM196 16.5C196.276 16.5 196.5 16.2761 196.5 16C196.5 15.7239 196.276 15.5 196 15.5V16.5ZM204 15.5C203.724 15.5 203.5 15.7239 203.5 16C203.5 16.2761 203.724 16.5 204 16.5V15.5ZM0 16.5H4V15.5H0V16.5ZM12 16.5H20V15.5H12V16.5ZM28 16.5H36V15.5H28V16.5ZM44 16.5H52V15.5H44V16.5ZM60 16.5H68V15.5H60V16.5ZM76 16.5H84V15.5H76V16.5ZM92 16.5H100V15.5H92V16.5ZM108 16.5H116V15.5H108V16.5ZM124 16.5H132V15.5H124V16.5ZM140 16.5H148V15.5H140V16.5ZM156 16.5H164V15.5H156V16.5ZM172 16.5H180V15.5H172V16.5ZM188 16.5H196V15.5H188V16.5ZM204 16.5H208V15.5H204V16.5ZM208 17C208.552 17 209 16.5523 209 16C209 15.4477 208.552 15 208 15V17ZM0 15C-0.552285 15 -1 15.4477 -1 16C-1 16.5523 -0.552285 17 0 17V15ZM4 17C4.55228 17 5 16.5523 5 16C5 15.4477 4.55228 15 4 15V17ZM12 15C11.4477 15 11 15.4477 11 16C11 16.5523 11.4477 17 12 17V15ZM20 17C20.5523 17 21 16.5523 21 16C21 15.4477 20.5523 15 20 15V17ZM28 15C27.4477 15 27 15.4477 27 16C27 16.5523 27.4477 17 28 17V15ZM36 17C36.5523 17 37 16.5523 37 16C37 15.4477 36.5523 15 36 15V17ZM44 15C43.4477 15 43 15.4477 43 16C43 16.5523 43.4477 17 44 17V15ZM52 17C52.5523 17 53 16.5523 53 16C53 15.4477 52.5523 15 52 15V17ZM60 15C59.4477 15 59 15.4477 59 16C59 16.5523 59.4477 17 60 17V15ZM68 17C68.5523 17 69 16.5523 69 16C69 15.4477 68.5523 15 68 15V17ZM76 15C75.4477 15 75 15.4477 75 16C75 16.5523 75.4477 17 76 17V15ZM84 17C84.5523 17 85 16.5523 85 16C85 15.4477 84.5523 15 84 15V17ZM92 15C91.4477 15 91 15.4477 91 16C91 16.5523 91.4477 17 92 17V15ZM100 17C100.552 17 101 16.5523 101 16C101 15.4477 100.552 15 100 15V17ZM108 15C107.448 15 107 15.4477 107 16C107 16.5523 107.448 17 108 17V15ZM116 17C116.552 17 117 16.5523 117 16C117 15.4477 116.552 15 116 15V17ZM124 15C123.448 15 123 15.4477 123 16C123 16.5523 123.448 17 124 17V15ZM132 17C132.552 17 133 16.5523 133 16C133 15.4477 132.552 15 132 15V17ZM140 15C139.448 15 139 15.4477 139 16C139 16.5523 139.448 17 140 17V15ZM148 17C148.552 17 149 16.5523 149 16C149 15.4477 148.552 15 148 15V17ZM156 15C155.448 15 155 15.4477 155 16C155 16.5523 155.448 17 156 17V15ZM164 17C164.552 17 165 16.5523 165 16C165 15.4477 164.552 15 164 15V17ZM172 15C171.448 15 171 15.4477 171 16C171 16.5523 171.448 17 172 17V15ZM180 17C180.552 17 181 16.5523 181 16C181 15.4477 180.552 15 180 15V17ZM188 15C187.448 15 187 15.4477 187 16C187 16.5523 187.448 17 188 17V15ZM196 17C196.552 17 197 16.5523 197 16C197 15.4477 196.552 15 196 15V17ZM204 15C203.448 15 203 15.4477 203 16C203 16.5523 203.448 17 204 17V15ZM0 17H4V15H0V17ZM12 17H20V15H12V17ZM28 17H36V15H28V17ZM44 17H52V15H44V17ZM60 17H68V15H60V17ZM76 17H84V15H76V17ZM92 17H100V15H92V17ZM108 17H116V15H108V17ZM124 17H132V15H124V17ZM140 17H148V15H140V17ZM156 17H164V15H156V17ZM172 17H180V15H172V17ZM188 17H196V15H188V17ZM204 17H208V15H204V17Z",fill:"#F8F8F8",mask:"url(#path-1-inside-1_2098_5511)"}),i.jsx("mask",{id:"path-3-inside-2_2098_5511",fill:"white",children:i.jsx("path",{d:"M0 16H208V32H0V16Z"})}),i.jsx("path",{d:"M208 32.5C208.276 32.5 208.5 32.2761 208.5 32C208.5 31.7239 208.276 31.5 208 31.5V32.5ZM0 31.5C-0.276142 31.5 -0.5 31.7239 -0.5 32C-0.5 32.2761 -0.276142 32.5 0 32.5V31.5ZM4 32.5C4.27614 32.5 4.5 32.2761 4.5 32C4.5 31.7239 4.27614 31.5 4 31.5V32.5ZM12 31.5C11.7239 31.5 11.5 31.7239 11.5 32C11.5 32.2761 11.7239 32.5 12 32.5V31.5ZM20 32.5C20.2761 32.5 20.5 32.2761 20.5 32C20.5 31.7239 20.2761 31.5 20 31.5V32.5ZM28 31.5C27.7239 31.5 27.5 31.7239 27.5 32C27.5 32.2761 27.7239 32.5 28 32.5V31.5ZM36 32.5C36.2761 32.5 36.5 32.2761 36.5 32C36.5 31.7239 36.2761 31.5 36 31.5V32.5ZM44 31.5C43.7239 31.5 43.5 31.7239 43.5 32C43.5 32.2761 43.7239 32.5 44 32.5V31.5ZM52 32.5C52.2761 32.5 52.5 32.2761 52.5 32C52.5 31.7239 52.2761 31.5 52 31.5V32.5ZM60 31.5C59.7239 31.5 59.5 31.7239 59.5 32C59.5 32.2761 59.7239 32.5 60 32.5V31.5ZM68 32.5C68.2761 32.5 68.5 32.2761 68.5 32C68.5 31.7239 68.2761 31.5 68 31.5V32.5ZM76 31.5C75.7239 31.5 75.5 31.7239 75.5 32C75.5 32.2761 75.7239 32.5 76 32.5V31.5ZM84 32.5C84.2761 32.5 84.5 32.2761 84.5 32C84.5 31.7239 84.2761 31.5 84 31.5V32.5ZM92 31.5C91.7239 31.5 91.5 31.7239 91.5 32C91.5 32.2761 91.7239 32.5 92 32.5V31.5ZM100 32.5C100.276 32.5 100.5 32.2761 100.5 32C100.5 31.7239 100.276 31.5 100 31.5V32.5ZM108 31.5C107.724 31.5 107.5 31.7239 107.5 32C107.5 32.2761 107.724 32.5 108 32.5V31.5ZM116 32.5C116.276 32.5 116.5 32.2761 116.5 32C116.5 31.7239 116.276 31.5 116 31.5V32.5ZM124 31.5C123.724 31.5 123.5 31.7239 123.5 32C123.5 32.2761 123.724 32.5 124 32.5V31.5ZM132 32.5C132.276 32.5 132.5 32.2761 132.5 32C132.5 31.7239 132.276 31.5 132 31.5V32.5ZM140 31.5C139.724 31.5 139.5 31.7239 139.5 32C139.5 32.2761 139.724 32.5 140 32.5V31.5ZM148 32.5C148.276 32.5 148.5 32.2761 148.5 32C148.5 31.7239 148.276 31.5 148 31.5V32.5ZM156 31.5C155.724 31.5 155.5 31.7239 155.5 32C155.5 32.2761 155.724 32.5 156 32.5V31.5ZM164 32.5C164.276 32.5 164.5 32.2761 164.5 32C164.5 31.7239 164.276 31.5 164 31.5V32.5ZM172 31.5C171.724 31.5 171.5 31.7239 171.5 32C171.5 32.2761 171.724 32.5 172 32.5V31.5ZM180 32.5C180.276 32.5 180.5 32.2761 180.5 32C180.5 31.7239 180.276 31.5 180 31.5V32.5ZM188 31.5C187.724 31.5 187.5 31.7239 187.5 32C187.5 32.2761 187.724 32.5 188 32.5V31.5ZM196 32.5C196.276 32.5 196.5 32.2761 196.5 32C196.5 31.7239 196.276 31.5 196 31.5V32.5ZM204 31.5C203.724 31.5 203.5 31.7239 203.5 32C203.5 32.2761 203.724 32.5 204 32.5V31.5ZM0 32.5H4V31.5H0V32.5ZM12 32.5H20V31.5H12V32.5ZM28 32.5H36V31.5H28V32.5ZM44 32.5H52V31.5H44V32.5ZM60 32.5H68V31.5H60V32.5ZM76 32.5H84V31.5H76V32.5ZM92 32.5H100V31.5H92V32.5ZM108 32.5H116V31.5H108V32.5ZM124 32.5H132V31.5H124V32.5ZM140 32.5H148V31.5H140V32.5ZM156 32.5H164V31.5H156V32.5ZM172 32.5H180V31.5H172V32.5ZM188 32.5H196V31.5H188V32.5ZM204 32.5H208V31.5H204V32.5ZM208 33C208.552 33 209 32.5523 209 32C209 31.4477 208.552 31 208 31V33ZM0 31C-0.552285 31 -1 31.4477 -1 32C-1 32.5523 -0.552285 33 0 33V31ZM4 33C4.55228 33 5 32.5523 5 32C5 31.4477 4.55228 31 4 31V33ZM12 31C11.4477 31 11 31.4477 11 32C11 32.5523 11.4477 33 12 33V31ZM20 33C20.5523 33 21 32.5523 21 32C21 31.4477 20.5523 31 20 31V33ZM28 31C27.4477 31 27 31.4477 27 32C27 32.5523 27.4477 33 28 33V31ZM36 33C36.5523 33 37 32.5523 37 32C37 31.4477 36.5523 31 36 31V33ZM44 31C43.4477 31 43 31.4477 43 32C43 32.5523 43.4477 33 44 33V31ZM52 33C52.5523 33 53 32.5523 53 32C53 31.4477 52.5523 31 52 31V33ZM60 31C59.4477 31 59 31.4477 59 32C59 32.5523 59.4477 33 60 33V31ZM68 33C68.5523 33 69 32.5523 69 32C69 31.4477 68.5523 31 68 31V33ZM76 31C75.4477 31 75 31.4477 75 32C75 32.5523 75.4477 33 76 33V31ZM84 33C84.5523 33 85 32.5523 85 32C85 31.4477 84.5523 31 84 31V33ZM92 31C91.4477 31 91 31.4477 91 32C91 32.5523 91.4477 33 92 33V31ZM100 33C100.552 33 101 32.5523 101 32C101 31.4477 100.552 31 100 31V33ZM108 31C107.448 31 107 31.4477 107 32C107 32.5523 107.448 33 108 33V31ZM116 33C116.552 33 117 32.5523 117 32C117 31.4477 116.552 31 116 31V33ZM124 31C123.448 31 123 31.4477 123 32C123 32.5523 123.448 33 124 33V31ZM132 33C132.552 33 133 32.5523 133 32C133 31.4477 132.552 31 132 31V33ZM140 31C139.448 31 139 31.4477 139 32C139 32.5523 139.448 33 140 33V31ZM148 33C148.552 33 149 32.5523 149 32C149 31.4477 148.552 31 148 31V33ZM156 31C155.448 31 155 31.4477 155 32C155 32.5523 155.448 33 156 33V31ZM164 33C164.552 33 165 32.5523 165 32C165 31.4477 164.552 31 164 31V33ZM172 31C171.448 31 171 31.4477 171 32C171 32.5523 171.448 33 172 33V31ZM180 33C180.552 33 181 32.5523 181 32C181 31.4477 180.552 31 180 31V33ZM188 31C187.448 31 187 31.4477 187 32C187 32.5523 187.448 33 188 33V31ZM196 33C196.552 33 197 32.5523 197 32C197 31.4477 196.552 31 196 31V33ZM204 31C203.448 31 203 31.4477 203 32C203 32.5523 203.448 33 204 33V31ZM0 33H4V31H0V33ZM12 33H20V31H12V33ZM28 33H36V31H28V33ZM44 33H52V31H44V33ZM60 33H68V31H60V33ZM76 33H84V31H76V33ZM92 33H100V31H92V33ZM108 33H116V31H108V33ZM124 33H132V31H124V33ZM140 33H148V31H140V33ZM156 33H164V31H156V33ZM172 33H180V31H172V33ZM188 33H196V31H188V33ZM204 33H208V31H204V33Z",fill:"#F8F8F8",mask:"url(#path-3-inside-2_2098_5511)"}),i.jsx("mask",{id:"path-5-inside-3_2098_5511",fill:"white",children:i.jsx("path",{d:"M0 32H208V48H0V32Z"})}),i.jsx("path",{d:"M208 48.5C208.276 48.5 208.5 48.2761 208.5 48C208.5 47.7239 208.276 47.5 208 47.5V48.5ZM0 47.5C-0.276142 47.5 -0.5 47.7239 -0.5 48C-0.5 48.2761 -0.276142 48.5 0 48.5V47.5ZM4 48.5C4.27614 48.5 4.5 48.2761 4.5 48C4.5 47.7239 4.27614 47.5 4 47.5V48.5ZM12 47.5C11.7239 47.5 11.5 47.7239 11.5 48C11.5 48.2761 11.7239 48.5 12 48.5V47.5ZM20 48.5C20.2761 48.5 20.5 48.2761 20.5 48C20.5 47.7239 20.2761 47.5 20 47.5V48.5ZM28 47.5C27.7239 47.5 27.5 47.7239 27.5 48C27.5 48.2761 27.7239 48.5 28 48.5V47.5ZM36 48.5C36.2761 48.5 36.5 48.2761 36.5 48C36.5 47.7239 36.2761 47.5 36 47.5V48.5ZM44 47.5C43.7239 47.5 43.5 47.7239 43.5 48C43.5 48.2761 43.7239 48.5 44 48.5V47.5ZM52 48.5C52.2761 48.5 52.5 48.2761 52.5 48C52.5 47.7239 52.2761 47.5 52 47.5V48.5ZM60 47.5C59.7239 47.5 59.5 47.7239 59.5 48C59.5 48.2761 59.7239 48.5 60 48.5V47.5ZM68 48.5C68.2761 48.5 68.5 48.2761 68.5 48C68.5 47.7239 68.2761 47.5 68 47.5V48.5ZM76 47.5C75.7239 47.5 75.5 47.7239 75.5 48C75.5 48.2761 75.7239 48.5 76 48.5V47.5ZM84 48.5C84.2761 48.5 84.5 48.2761 84.5 48C84.5 47.7239 84.2761 47.5 84 47.5V48.5ZM92 47.5C91.7239 47.5 91.5 47.7239 91.5 48C91.5 48.2761 91.7239 48.5 92 48.5V47.5ZM100 48.5C100.276 48.5 100.5 48.2761 100.5 48C100.5 47.7239 100.276 47.5 100 47.5V48.5ZM108 47.5C107.724 47.5 107.5 47.7239 107.5 48C107.5 48.2761 107.724 48.5 108 48.5V47.5ZM116 48.5C116.276 48.5 116.5 48.2761 116.5 48C116.5 47.7239 116.276 47.5 116 47.5V48.5ZM124 47.5C123.724 47.5 123.5 47.7239 123.5 48C123.5 48.2761 123.724 48.5 124 48.5V47.5ZM132 48.5C132.276 48.5 132.5 48.2761 132.5 48C132.5 47.7239 132.276 47.5 132 47.5V48.5ZM140 47.5C139.724 47.5 139.5 47.7239 139.5 48C139.5 48.2761 139.724 48.5 140 48.5V47.5ZM148 48.5C148.276 48.5 148.5 48.2761 148.5 48C148.5 47.7239 148.276 47.5 148 47.5V48.5ZM156 47.5C155.724 47.5 155.5 47.7239 155.5 48C155.5 48.2761 155.724 48.5 156 48.5V47.5ZM164 48.5C164.276 48.5 164.5 48.2761 164.5 48C164.5 47.7239 164.276 47.5 164 47.5V48.5ZM172 47.5C171.724 47.5 171.5 47.7239 171.5 48C171.5 48.2761 171.724 48.5 172 48.5V47.5ZM180 48.5C180.276 48.5 180.5 48.2761 180.5 48C180.5 47.7239 180.276 47.5 180 47.5V48.5ZM188 47.5C187.724 47.5 187.5 47.7239 187.5 48C187.5 48.2761 187.724 48.5 188 48.5V47.5ZM196 48.5C196.276 48.5 196.5 48.2761 196.5 48C196.5 47.7239 196.276 47.5 196 47.5V48.5ZM204 47.5C203.724 47.5 203.5 47.7239 203.5 48C203.5 48.2761 203.724 48.5 204 48.5V47.5ZM0 48.5H4V47.5H0V48.5ZM12 48.5H20V47.5H12V48.5ZM28 48.5H36V47.5H28V48.5ZM44 48.5H52V47.5H44V48.5ZM60 48.5H68V47.5H60V48.5ZM76 48.5H84V47.5H76V48.5ZM92 48.5H100V47.5H92V48.5ZM108 48.5H116V47.5H108V48.5ZM124 48.5H132V47.5H124V48.5ZM140 48.5H148V47.5H140V48.5ZM156 48.5H164V47.5H156V48.5ZM172 48.5H180V47.5H172V48.5ZM188 48.5H196V47.5H188V48.5ZM204 48.5H208V47.5H204V48.5ZM208 49C208.552 49 209 48.5523 209 48C209 47.4477 208.552 47 208 47V49ZM0 47C-0.552285 47 -1 47.4477 -1 48C-1 48.5523 -0.552285 49 0 49V47ZM4 49C4.55228 49 5 48.5523 5 48C5 47.4477 4.55228 47 4 47V49ZM12 47C11.4477 47 11 47.4477 11 48C11 48.5523 11.4477 49 12 49V47ZM20 49C20.5523 49 21 48.5523 21 48C21 47.4477 20.5523 47 20 47V49ZM28 47C27.4477 47 27 47.4477 27 48C27 48.5523 27.4477 49 28 49V47ZM36 49C36.5523 49 37 48.5523 37 48C37 47.4477 36.5523 47 36 47V49ZM44 47C43.4477 47 43 47.4477 43 48C43 48.5523 43.4477 49 44 49V47ZM52 49C52.5523 49 53 48.5523 53 48C53 47.4477 52.5523 47 52 47V49ZM60 47C59.4477 47 59 47.4477 59 48C59 48.5523 59.4477 49 60 49V47ZM68 49C68.5523 49 69 48.5523 69 48C69 47.4477 68.5523 47 68 47V49ZM76 47C75.4477 47 75 47.4477 75 48C75 48.5523 75.4477 49 76 49V47ZM84 49C84.5523 49 85 48.5523 85 48C85 47.4477 84.5523 47 84 47V49ZM92 47C91.4477 47 91 47.4477 91 48C91 48.5523 91.4477 49 92 49V47ZM100 49C100.552 49 101 48.5523 101 48C101 47.4477 100.552 47 100 47V49ZM108 47C107.448 47 107 47.4477 107 48C107 48.5523 107.448 49 108 49V47ZM116 49C116.552 49 117 48.5523 117 48C117 47.4477 116.552 47 116 47V49ZM124 47C123.448 47 123 47.4477 123 48C123 48.5523 123.448 49 124 49V47ZM132 49C132.552 49 133 48.5523 133 48C133 47.4477 132.552 47 132 47V49ZM140 47C139.448 47 139 47.4477 139 48C139 48.5523 139.448 49 140 49V47ZM148 49C148.552 49 149 48.5523 149 48C149 47.4477 148.552 47 148 47V49ZM156 47C155.448 47 155 47.4477 155 48C155 48.5523 155.448 49 156 49V47ZM164 49C164.552 49 165 48.5523 165 48C165 47.4477 164.552 47 164 47V49ZM172 47C171.448 47 171 47.4477 171 48C171 48.5523 171.448 49 172 49V47ZM180 49C180.552 49 181 48.5523 181 48C181 47.4477 180.552 47 180 47V49ZM188 47C187.448 47 187 47.4477 187 48C187 48.5523 187.448 49 188 49V47ZM196 49C196.552 49 197 48.5523 197 48C197 47.4477 196.552 47 196 47V49ZM204 47C203.448 47 203 47.4477 203 48C203 48.5523 203.448 49 204 49V47ZM0 49H4V47H0V49ZM12 49H20V47H12V49ZM28 49H36V47H28V49ZM44 49H52V47H44V49ZM60 49H68V47H60V49ZM76 49H84V47H76V49ZM92 49H100V47H92V49ZM108 49H116V47H108V49ZM124 49H132V47H124V49ZM140 49H148V47H140V49ZM156 49H164V47H156V49ZM172 49H180V47H172V49ZM188 49H196V47H188V49ZM204 49H208V47H204V49Z",fill:"#F8F8F8",mask:"url(#path-5-inside-3_2098_5511)"}),i.jsx("mask",{id:"path-7-inside-4_2098_5511",fill:"white",children:i.jsx("path",{d:"M0 48H208V64H0V48Z"})}),i.jsx("path",{d:"M208 64.5C208.276 64.5 208.5 64.2761 208.5 64C208.5 63.7239 208.276 63.5 208 63.5V64.5ZM0 63.5C-0.276142 63.5 -0.5 63.7239 -0.5 64C-0.5 64.2761 -0.276142 64.5 0 64.5V63.5ZM4 64.5C4.27614 64.5 4.5 64.2761 4.5 64C4.5 63.7239 4.27614 63.5 4 63.5V64.5ZM12 63.5C11.7239 63.5 11.5 63.7239 11.5 64C11.5 64.2761 11.7239 64.5 12 64.5V63.5ZM20 64.5C20.2761 64.5 20.5 64.2761 20.5 64C20.5 63.7239 20.2761 63.5 20 63.5V64.5ZM28 63.5C27.7239 63.5 27.5 63.7239 27.5 64C27.5 64.2761 27.7239 64.5 28 64.5V63.5ZM36 64.5C36.2761 64.5 36.5 64.2761 36.5 64C36.5 63.7239 36.2761 63.5 36 63.5V64.5ZM44 63.5C43.7239 63.5 43.5 63.7239 43.5 64C43.5 64.2761 43.7239 64.5 44 64.5V63.5ZM52 64.5C52.2761 64.5 52.5 64.2761 52.5 64C52.5 63.7239 52.2761 63.5 52 63.5V64.5ZM60 63.5C59.7239 63.5 59.5 63.7239 59.5 64C59.5 64.2761 59.7239 64.5 60 64.5V63.5ZM68 64.5C68.2761 64.5 68.5 64.2761 68.5 64C68.5 63.7239 68.2761 63.5 68 63.5V64.5ZM76 63.5C75.7239 63.5 75.5 63.7239 75.5 64C75.5 64.2761 75.7239 64.5 76 64.5V63.5ZM84 64.5C84.2761 64.5 84.5 64.2761 84.5 64C84.5 63.7239 84.2761 63.5 84 63.5V64.5ZM92 63.5C91.7239 63.5 91.5 63.7239 91.5 64C91.5 64.2761 91.7239 64.5 92 64.5V63.5ZM100 64.5C100.276 64.5 100.5 64.2761 100.5 64C100.5 63.7239 100.276 63.5 100 63.5V64.5ZM108 63.5C107.724 63.5 107.5 63.7239 107.5 64C107.5 64.2761 107.724 64.5 108 64.5V63.5ZM116 64.5C116.276 64.5 116.5 64.2761 116.5 64C116.5 63.7239 116.276 63.5 116 63.5V64.5ZM124 63.5C123.724 63.5 123.5 63.7239 123.5 64C123.5 64.2761 123.724 64.5 124 64.5V63.5ZM132 64.5C132.276 64.5 132.5 64.2761 132.5 64C132.5 63.7239 132.276 63.5 132 63.5V64.5ZM140 63.5C139.724 63.5 139.5 63.7239 139.5 64C139.5 64.2761 139.724 64.5 140 64.5V63.5ZM148 64.5C148.276 64.5 148.5 64.2761 148.5 64C148.5 63.7239 148.276 63.5 148 63.5V64.5ZM156 63.5C155.724 63.5 155.5 63.7239 155.5 64C155.5 64.2761 155.724 64.5 156 64.5V63.5ZM164 64.5C164.276 64.5 164.5 64.2761 164.5 64C164.5 63.7239 164.276 63.5 164 63.5V64.5ZM172 63.5C171.724 63.5 171.5 63.7239 171.5 64C171.5 64.2761 171.724 64.5 172 64.5V63.5ZM180 64.5C180.276 64.5 180.5 64.2761 180.5 64C180.5 63.7239 180.276 63.5 180 63.5V64.5ZM188 63.5C187.724 63.5 187.5 63.7239 187.5 64C187.5 64.2761 187.724 64.5 188 64.5V63.5ZM196 64.5C196.276 64.5 196.5 64.2761 196.5 64C196.5 63.7239 196.276 63.5 196 63.5V64.5ZM204 63.5C203.724 63.5 203.5 63.7239 203.5 64C203.5 64.2761 203.724 64.5 204 64.5V63.5ZM0 64.5H4V63.5H0V64.5ZM12 64.5H20V63.5H12V64.5ZM28 64.5H36V63.5H28V64.5ZM44 64.5H52V63.5H44V64.5ZM60 64.5H68V63.5H60V64.5ZM76 64.5H84V63.5H76V64.5ZM92 64.5H100V63.5H92V64.5ZM108 64.5H116V63.5H108V64.5ZM124 64.5H132V63.5H124V64.5ZM140 64.5H148V63.5H140V64.5ZM156 64.5H164V63.5H156V64.5ZM172 64.5H180V63.5H172V64.5ZM188 64.5H196V63.5H188V64.5ZM204 64.5H208V63.5H204V64.5ZM208 65C208.552 65 209 64.5523 209 64C209 63.4477 208.552 63 208 63V65ZM0 63C-0.552285 63 -1 63.4477 -1 64C-1 64.5523 -0.552285 65 0 65V63ZM4 65C4.55228 65 5 64.5523 5 64C5 63.4477 4.55228 63 4 63V65ZM12 63C11.4477 63 11 63.4477 11 64C11 64.5523 11.4477 65 12 65V63ZM20 65C20.5523 65 21 64.5523 21 64C21 63.4477 20.5523 63 20 63V65ZM28 63C27.4477 63 27 63.4477 27 64C27 64.5523 27.4477 65 28 65V63ZM36 65C36.5523 65 37 64.5523 37 64C37 63.4477 36.5523 63 36 63V65ZM44 63C43.4477 63 43 63.4477 43 64C43 64.5523 43.4477 65 44 65V63ZM52 65C52.5523 65 53 64.5523 53 64C53 63.4477 52.5523 63 52 63V65ZM60 63C59.4477 63 59 63.4477 59 64C59 64.5523 59.4477 65 60 65V63ZM68 65C68.5523 65 69 64.5523 69 64C69 63.4477 68.5523 63 68 63V65ZM76 63C75.4477 63 75 63.4477 75 64C75 64.5523 75.4477 65 76 65V63ZM84 65C84.5523 65 85 64.5523 85 64C85 63.4477 84.5523 63 84 63V65ZM92 63C91.4477 63 91 63.4477 91 64C91 64.5523 91.4477 65 92 65V63ZM100 65C100.552 65 101 64.5523 101 64C101 63.4477 100.552 63 100 63V65ZM108 63C107.448 63 107 63.4477 107 64C107 64.5523 107.448 65 108 65V63ZM116 65C116.552 65 117 64.5523 117 64C117 63.4477 116.552 63 116 63V65ZM124 63C123.448 63 123 63.4477 123 64C123 64.5523 123.448 65 124 65V63ZM132 65C132.552 65 133 64.5523 133 64C133 63.4477 132.552 63 132 63V65ZM140 63C139.448 63 139 63.4477 139 64C139 64.5523 139.448 65 140 65V63ZM148 65C148.552 65 149 64.5523 149 64C149 63.4477 148.552 63 148 63V65ZM156 63C155.448 63 155 63.4477 155 64C155 64.5523 155.448 65 156 65V63ZM164 65C164.552 65 165 64.5523 165 64C165 63.4477 164.552 63 164 63V65ZM172 63C171.448 63 171 63.4477 171 64C171 64.5523 171.448 65 172 65V63ZM180 65C180.552 65 181 64.5523 181 64C181 63.4477 180.552 63 180 63V65ZM188 63C187.448 63 187 63.4477 187 64C187 64.5523 187.448 65 188 65V63ZM196 65C196.552 65 197 64.5523 197 64C197 63.4477 196.552 63 196 63V65ZM204 63C203.448 63 203 63.4477 203 64C203 64.5523 203.448 65 204 65V63ZM0 65H4V63H0V65ZM12 65H20V63H12V65ZM28 65H36V63H28V65ZM44 65H52V63H44V65ZM60 65H68V63H60V65ZM76 65H84V63H76V65ZM92 65H100V63H92V65ZM108 65H116V63H108V65ZM124 65H132V63H124V65ZM140 65H148V63H140V65ZM156 65H164V63H156V65ZM172 65H180V63H172V65ZM188 65H196V63H188V65ZM204 65H208V63H204V65Z",fill:"#F8F8F8",mask:"url(#path-7-inside-4_2098_5511)"}),i.jsx("path",{opacity:"0.25",d:"M188.216 21.8308L192.267 33.3363C192.984 35.3729 195.553 36.0079 197.136 34.5401L200.346 31.5644C200.704 31.2324 200.976 30.8179 201.137 30.357L202.893 25.3492L207.891 8.63898C207.962 8.40249 207.998 8.15696 207.998 7.91011V61C207.998 62.6569 206.655 64 204.998 64H2.99805C1.34119 64 -0.00195312 62.6569 -0.00195312 61V38.199C-0.00195312 37.5477 0.209976 36.9142 0.601822 36.394L4.07924 31.7775C5.46086 29.9434 8.30679 30.2781 9.22513 32.3828L13.7407 42.7321C14.1196 43.6005 14.8865 44.2389 15.8092 44.454L20.4905 45.5454C21.1539 45.7 21.8501 45.6244 22.4647 45.3308L27.6593 42.8495C28.3218 42.533 28.8452 41.9846 29.1305 41.3081L33.0958 31.9045C34.1272 29.4587 37.593 29.4587 38.6244 31.9045L39.704 34.4648C40.8065 37.0793 44.5863 36.8438 45.3559 34.1128L49.5889 19.0897C49.9533 17.7966 51.133 16.9033 52.4765 16.9033H56.4941C57.0707 16.9033 57.6351 16.7372 58.1197 16.4247L61.1576 14.466C62.8476 13.3764 65.11 14.2251 65.6662 16.1575L70.599 33.2936C71.1572 35.2328 73.4323 36.079 75.122 34.9758L75.9273 34.45C77.4802 33.4361 79.5719 34.0601 80.3156 35.7591L84.8676 46.1586C85.5306 47.6733 87.2942 48.366 88.8108 47.7074L91.9453 46.3462C92.765 45.9903 93.3833 45.2875 93.632 44.4292L99.0729 25.6458C99.6874 23.5244 102.321 22.7938 103.941 24.2955C105.587 25.8222 108.267 25.0377 108.831 22.864L112.541 8.54954C113.26 5.77543 117.087 5.49227 118.207 8.13037L120.305 13.0767C121.105 14.9603 123.513 15.5086 125.049 14.1567L125.58 13.6896C127.224 12.2425 129.814 12.9875 130.438 15.0869L134.329 28.1818C135.073 30.6853 138.439 31.1086 139.779 28.8673L142.671 24.0333C143.159 23.2175 144.004 22.6813 144.95 22.5878L149.822 22.1065C150.344 22.0549 150.843 21.8672 151.271 21.5621L154.984 18.9089C156.467 17.8494 158.544 18.346 159.388 19.9617L161.285 23.5972C162.565 26.0491 166.199 25.6102 166.858 22.9241L169.511 12.1165C170.239 9.14844 174.421 9.04274 175.298 11.9702L177.723 20.0592C178.406 22.3382 181.343 22.9532 182.883 21.1398L183.099 20.8852C184.598 19.1202 187.447 19.6467 188.216 21.8308Z",fill:"url(#paint0_linear_2098_5511)"}),i.jsx("path",{d:"M207.998 8.42336L201.106 31.2146C200.924 31.8169 200.557 32.3467 200.057 32.729L196.94 35.1136C195.319 36.3534 192.96 35.6482 192.286 33.7223L188.181 22.0024C187.422 19.8338 184.606 19.289 183.092 21.0179L182.846 21.2991C181.3 23.0654 178.416 22.4516 177.723 20.2087L175.29 12.336C174.395 9.4396 170.259 9.54691 169.515 12.4858L166.857 22.9946C166.185 25.6477 162.603 26.0903 161.306 23.6803L159.382 20.1042C158.534 18.5278 156.503 18.0404 155.031 19.0601L151.262 21.6725C150.84 21.9649 150.35 22.1442 149.839 22.1931L144.931 22.6636C143.996 22.7532 143.157 23.2757 142.664 24.0754L139.754 28.7942C138.4 30.9907 135.088 30.5657 134.332 28.0982L130.441 15.3948C129.808 13.3298 127.267 12.5895 125.624 13.9921L125.005 14.5209C123.474 15.8283 121.115 15.2863 120.308 13.4417L118.191 8.60225C117.054 6.00226 113.277 6.28847 112.544 9.03014L108.848 22.8647C108.27 25.0292 105.606 25.8158 103.94 24.3175V24.3175C102.303 22.8447 99.6856 23.5762 99.0555 25.6864L93.6445 43.8072C93.388 44.6663 92.7608 45.3656 91.9346 45.7136L88.763 47.0496C87.2632 47.6814 85.5332 47.0022 84.8638 45.5188L80.3156 35.4387C79.5653 33.7759 77.517 33.1621 75.9758 34.1381L75.0745 34.709C73.393 35.774 71.1595 34.9362 70.5933 33.028L65.672 16.4433C65.1078 14.5419 62.8867 13.7015 61.2051 14.7533L58.1073 16.6909C57.6303 16.9892 57.079 17.1474 56.5164 17.1474H52.4575C51.123 17.1474 49.9489 18.029 49.5766 19.3106L45.3511 33.8582C44.5676 36.5556 40.8386 36.7934 39.7188 34.2174L38.6114 31.6698C37.5658 29.2644 34.1544 29.2644 33.1088 31.6698L29.1425 40.7941C28.8495 41.4681 28.3193 42.0111 27.6525 42.3201L22.4421 44.7345C21.8411 45.0129 21.165 45.0847 20.519 44.9386L15.803 43.872C14.8836 43.6641 14.1154 43.0362 13.7288 42.1765L9.21662 32.1447C8.28874 30.0817 5.49845 29.7487 4.11113 31.5353L-0.00196201 36.8322",stroke:"#FF3F19"})]}),i.jsxs("defs",{children:[i.jsxs("linearGradient",{id:"paint0_linear_2098_5511",x1:"103.998",y1:"0",x2:"103.998",y2:"64",gradientUnits:"userSpaceOnUse",children:[i.jsx("stop",{stopColor:"#FF3F19"}),i.jsx("stop",{offset:"1",stopColor:"white",stopOpacity:"0"})]}),i.jsx("clipPath",{id:"clip0_2098_5511",children:i.jsx("rect",{width:"208",height:"64",fill:"white"})})]})]})}),s0=({adaptiveStyles:e})=>{const[t,n]=P.useState(null),[r,u]=P.useState(!1),[a,s]=P.useState(!1),[o,c]=P.useState(!1);if(P.useEffect(()=>{u(!0),s(!0),(async()=>{const p=await M2();n(p)})(),u(!1),s(!1)},[]),!t)return i.jsx(v.Loader,{});const{isAvailable:l,isActivated:h,info:f}=t.data;return l?i.jsxs("div",{children:[i.jsxs("div",{className:b.clx(ge.referral,{[ge.mobile]:e!=="desktop"}),children:[i.jsx("div",{className:b.clx(ge.referralBlock,{[ge.mobile]:e!=="desktop"}),children:r?i.jsx(c0,{adaptiveStyles:e}):i.jsxs("div",{className:ge.referralContainer,children:[i.jsx("div",{id:"h2",className:ge.title,children:"Refer friends"}),i.jsx("div",{className:ge.description,id:"lg",children:"Refer friends. Earn rewards. Make bank."}),h?i.jsx(i.Fragment,{children:i.jsx(o0,{referral:t})}):i.jsx(i.Fragment,{children:i.jsx(i0,{setIsOpen:c})})]})}),a?i.jsx("div",{className:ge.referralStats}):i.jsxs("div",{className:b.clx(ge.referralStats,{[ge.mobile]:e!=="desktop"}),children:[i.jsxs("div",{className:ge.referralStatsItem,children:[i.jsx("div",{id:"lg",className:ge.referralStatsItemLabel,children:"Referrals"}),i.jsx("div",{id:"h2",className:ge.referralStatsItemValue,children:f!=null&&f.totalReferrals?`${f.totalReferrals} person`:"-"}),i.jsx(wu,{})]}),i.jsxs("div",{className:ge.referralStatsItem,children:[i.jsx("div",{id:"lg",className:ge.referralStatsItemLabel,children:"Earned"}),i.jsx("div",{id:"h2",className:ge.referralStatsItemValue,children:"-"}),i.jsx(wu,{})]}),i.jsxs("div",{className:ge.referralStatsItem,children:[i.jsx("div",{id:"lg",className:ge.referralStatsItemLabel,children:"Total Revenue"}),i.jsx("div",{id:"h2",className:ge.referralStatsItemValue,children:b.formatPrice({amount:(f==null?void 0:f.totalRevenueUsd)||0})}),i.jsx(wu,{})]}),i.jsxs("div",{className:ge.referralStatsItem,children:[i.jsx("div",{id:"lg",className:ge.referralStatsItemLabel,children:"Earn Procent"}),i.jsx("div",{id:"h2",className:ge.referralStatsItemValue,children:`${t.data.earnPercent}%`||"-"}),i.jsx(wu,{})]})]})]}),o&&i.jsx(v.Modal,{close:()=>c(!1),children:i.jsx(p5,{setIsOpen:c,setIsLoading:u})})]}):null},i0=({setIsOpen:e})=>{const{setIsOpen:t}=b.useModalStore();return i.jsxs("div",{className:ge.steps,onClick:n=>n.stopPropagation(),children:[i.jsx(v.Button,{type:"Primary",className:ge.joinButton,onClick:()=>{e(!0),t(!0)},children:"Join the referral Program"}),i.jsx("div",{children:b.referralSteps.map(({caption:n,description:r},u,a)=>i.jsx(h5,{caption:n,description:r,index:u+1,bar:u+1!==a.length},n))})]})},o0=({referral:e})=>{var a,s;const{shopDomain:t}=b.useStorefrontStore(),n=`https://${t}/?r=${(a=e.data.info)==null?void 0:a.referralCode}`,{notifications:r,setNotifications:u}=b.useNotificationStore();return i.jsxs("div",{className:ge.referralInfo,children:[i.jsx(v.Input,{onChange:()=>{},label:"Affiliate Code",value:((s=e.data.info)==null?void 0:s.referralCode)||"",disabled:!0}),i.jsx("div",{className:ge.linkContainer,children:i.jsx(v.Input,{onChange:()=>{},label:"Affiliate Link",value:n,disabled:!0,rightIcon:i.jsx(v.Icon,{name:"Copy",fill:"var(--text-action)",onClick:()=>{navigator.clipboard.writeText(n),u([...r,{message:"Link copied to clipboard",status:"success",id:b.v4()}])},hoverable:!0})})})]})},c0=({adaptiveStyles:e})=>i.jsxs(ar,{speed:2,width:500,height:"100%",viewBox:"0 0 500 305",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",className:b.clx(ge.skeleton,{[ge.mobile]:e!=="desktop"}),style:{borderRadius:"var(--border-radius)"},children:[i.jsx("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"264",height:"40"}),i.jsx("rect",{x:"0",y:"45",rx:"10",ry:"10",width:"160",height:"24"}),i.jsx("rect",{x:"0",y:"100",rx:"10",ry:"10",width:"100",height:"40"}),i.jsx("rect",{x:"0",y:"150",rx:"10",ry:"10",width:"476",height:"40"}),i.jsx("rect",{x:"0",y:"220",rx:"10",ry:"10",width:"428",height:"50"})]}),m5="_title_u8oqs_1",g5="_heading_u8oqs_10",b5="_description_u8oqs_15",Xa={title:m5,heading:g5,description:b5},ga=({title:e,description:t})=>i.jsxs("div",{className:Xa.title,children:[i.jsx("div",{id:"h3",className:Xa.heading,children:e}),t&&i.jsx("div",{className:Xa.description,id:"lg",children:t})]}),_5="_noItemsBlock_yefnm_4",x5="_noItemsBlockIcon_yefnm_13",C5="_noItemsBlockTitle_yefnm_21",E5="_noItemsBlockDescription_yefnm_31",y5="_centered_yefnm_37",Fr={noItemsBlock:_5,noItemsBlockIcon:x5,noItemsBlockTitle:C5,noItemsBlockDescription:E5,centered:y5},ba=({title:e,description:t,className:n,centered:r=!1})=>i.jsxs("div",{className:b.clx(Fr.noItemsBlock,n,{[Fr.centered]:r}),children:[i.jsx("div",{className:Fr.noItemsBlockIcon,children:i.jsx(v.Icon,{name:"Info",fill:"var(--text-secondary)"})}),i.jsx("div",{className:Fr.noItemsBlockTitle,id:"h4",children:e}),i.jsx("div",{className:Fr.noItemsBlockDescription,id:"md",children:t})]}),T5="_ordersTable_1btyq_2",k5="_gatewayItem_1btyq_10",A5="_gatewayIcon_1btyq_15",S5="_orderTime_1btyq_20",I5="_reviewContainer_1btyq_25",N5="_reviewRating_1btyq_35",v5="_tableLoader_1btyq_39",w5="_tableItem_1btyq_48",Ht={ordersTable:T5,gatewayItem:k5,gatewayIcon:A5,orderTime:S5,reviewContainer:I5,reviewRating:N5,tableLoader:v5,tableItem:w5};var Sn=(e=>(e[e.SUCCESS=1]="SUCCESS",e[e.WARNING=2]="WARNING",e[e.ERROR=3]="ERROR",e))(Sn||{});const D5={[xe.New]:2,[xe.Pending]:2,[xe.Completed]:1,[xe.Cancelled]:3,[xe.Expired]:3,[xe.FullDeliveryFailure]:3,[xe.PartiallyDelivered]:2,[xe.Refunded]:2,[xe.Failed]:3,[xe.PartiallyRefunded]:2},L5=(e,t)=>{const n=t.find(r=>r.name===e);return n?i.jsxs("div",{className:Ht.gatewayItem,children:[(n==null?void 0:n.name)==="ForebitPayments"?i.jsx(Ul,{}):n.name==="Balance"?i.jsx(v.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20,style:{marginRight:"0.25rem"}}):i.jsx("img",{alt:n.displayName,src:b.convertCfImageIdToUrl(n.logoCfImageId,"100"),className:Ht.gatewayIcon}),i.jsx("div",{id:"md",children:n.displayName})]}):null},P5=({item:e,gatewaysDetail:t})=>{const[n,r]=b.extractDateAndTime(e.time),{isAntistock:u}=b.useGeneralStore();return i.jsxs(P.Fragment,{children:[i.jsx(ot,{copyText:e.id,children:i.jsx(b.NavLink,{to:`/orders/${e.id}/${e.accessToken}`,id:"md",children:e.id})}),i.jsx(ot,{children:i.jsx(b.NavLink,{to:`/orders/${e.id}/${e.accessToken}`,children:i.jsx(h0,{status:e.status,variant:D5[e.status]})})}),i.jsx(ot,{children:b.formatPrice(e.price)}),i.jsx(ot,{children:L5(e.gatewayName,t)}),i.jsx(ot,{children:i.jsxs("div",{children:[i.jsx("div",{id:"md",children:n}),i.jsx("div",{className:Ht.orderTime,id:"md",children:r})]})}),!u&&i.jsx(ot,{children:e.review?i.jsxs("div",{className:Ht.reviewContainer,children:[i.jsx(v.Icon,{name:"Star",fill:"var(--text-secondary)"}),i.jsx("div",{className:Ht.reviewRating,id:"md",children:e.review.rating})]}):i.jsx("span",{id:"md",children:"None"})})]},e.id)},l0=({orders:e,gatewaysDetail:t,totalCount:n,isLoading:r})=>{const{page:u,setPage:a}=b.usePaginationPagesStore(),{isAntistock:s}=b.useGeneralStore(),c=!(!(e!=null&&e.length)||!t)&&e.length>0;return i.jsxs("div",{className:Ht.ordersTable,children:[i.jsxs(_a,{children:[i.jsx(Dt,{className:Ht.tableItem,children:"Invoice ID"}),i.jsx(Dt,{className:Ht.tableItem,children:"Status"}),i.jsx(Dt,{className:Ht.tableItem,children:"Value"}),i.jsx(Dt,{className:Ht.tableItem,children:"Payment"}),i.jsx(Dt,{className:Ht.tableItem,children:"Date"}),!s&&i.jsx(Dt,{className:Ht.tableItem,children:"Review"}),c&&!r&&e.map(l=>i.jsx(P5,{item:l,gatewaysDetail:t},l.id))]}),(!c||r)&&i.jsx("div",{className:Ht.tableLoader,children:i.jsx(v.Loader,{})}),c&&!r&&i.jsx(gu,{currentPage:u,totalCount:n,onPageChange:a})]})},R5="_ticketsTable_1m2oy_4",O5="_antistockTable_1m2oy_4",M5="_table_1m2oy_4",F5="_tableItem_1m2oy_22",B5="_text_1m2oy_47",j5="_tableItemTitle_1m2oy_54",H5="_copyIcon_1m2oy_85",tr={ticketsTable:R5,antistockTable:O5,table:M5,tableItem:F5,text:B5,tableItemTitle:j5,copyIcon:H5},ot=({children:e,className:t,onClick:n,copyText:r,id:u})=>{const a=ur();return i.jsxs("div",{className:b.clx(tr.tableItem,t),onClick:n,style:{cursor:n?"pointer":"default"},children:[i.jsx("span",{className:tr.text,id:u||"md",children:e})," ",r&&i.jsx("div",{className:tr.copyIcon,children:i.jsx(v.Icon,{name:"Copy",onClick:()=>a(r),width:20,height:20})})]})},Dt=({children:e,className:t})=>i.jsx(ot,{className:b.clx(tr.tableItemTitle,t),id:"lg",children:e}),_a=({children:e,className:t})=>{const{isAntistock:n}=b.useGeneralStore(),r=t==null?void 0:t.includes("ticketsTable");return i.jsx("div",{className:b.clx(t,r?tr.ticketsTable:n?tr.antistockTable:tr.table),children:e})},U5="_paginationContainer_pt4l5_4",V5="_paginationWithRange_pt4l5_16",$5="_paginationWithRangeText_pt4l5_33",z5="_paginationWithRangePagination_pt4l5_45",Vu={paginationContainer:U5,paginationWithRange:V5,paginationWithRangeText:$5,paginationWithRangePagination:z5},Du=(e,t)=>Array.from({length:t-e+1},(n,r)=>e+r),q5=(e,t,n)=>{const r=n*2+3+2;if(t<=r)return Du(1,t);const u=Math.max(e-n,1),a=Math.min(e+n,t),s=u>2,o=a<t-2;return!s&&o?[...Du(1,3+2*n),"right-ellipsis",t]:s&&!o?[1,"left-ellipsis",...Du(t-(3+2*n)+1,t)]:[1,"left-ellipsis",...Du(u,a),"right-ellipsis",t]},d0=({currentPage:e,totalPages:t,onPageChange:n,siblingCount:r=1})=>{const u=c=>{const l=r*2+1;n(c?Math.max(e-l,1):Math.min(e+l,t))},a=e===1,s=e===t,o=c=>i.jsx(v.Button,{type:typeof c=="number"&&c===e?"Primary":"Secondary",onClick:()=>typeof c=="string"?u(c==="left-ellipsis"):n(c),"aria-current":typeof c=="number"&&c===e?"page":void 0,children:typeof c=="string"?"…":c},c);return i.jsxs("div",{className:Vu.paginationContainer,children:[i.jsx(v.Button,{type:"Secondary",onClick:()=>!a&&n(e-1),disabled:a,children:i.jsx(v.Icon,{name:"ArrowLeft"})}),q5(e,t,r).map(o),i.jsx(v.Button,{type:"Secondary",onClick:()=>!s&&n(e+1),disabled:s,children:i.jsx(v.Icon,{name:"ArrowRight"})})]})},f0=(e,t,n)=>{const r=(e-1)*n+1,u=Math.min(e*n,t);return`Showing ${r}-${u} entries of ${t}`},gu=({className:e,totalCount:t,...n})=>{const r=Math.ceil(t/xs);return r<2?null:i.jsxs("div",{className:`${Vu.paginationWithRange} ${e}`,children:[i.jsx("div",{className:Vu.paginationWithRangeText,id:"md",children:f0(n.currentPage,t,xs)}),i.jsx("div",{className:Vu.paginationWithRangePagination,children:i.jsx(d0,{...n,totalPages:r})})]})},Z5="_statusIndicator_1gt2z_4",W5="_antistockStatus_1gt2z_11",Y5="_statusIndicatorSuccess_1gt2z_16",G5="_statusIndicatorWarning_1gt2z_20",X5="_statusIndicatorError_1gt2z_24",K5="_statusIndicatorText_1gt2z_28",_r={statusIndicator:Z5,antistockStatus:W5,statusIndicatorSuccess:Y5,statusIndicatorWarning:G5,statusIndicatorError:X5,statusIndicatorText:K5},Q5=()=>i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:i.jsx("path",{d:"M11.2105 5.91453C11.2628 5.96677 11.3043 6.02881 11.3326 6.0971C11.3609 6.16538 11.3754 6.23858 11.3754 6.3125C11.3754 6.38642 11.3609 6.45962 11.3326 6.5279C11.3043 6.59619 11.2628 6.65823 11.2105 6.71047L7.27297 10.648C7.22073 10.7003 7.15869 10.7418 7.09041 10.7701C7.02212 10.7984 6.94892 10.8129 6.875 10.8129C6.80108 10.8129 6.72789 10.7984 6.6596 10.7701C6.59131 10.7418 6.52928 10.7003 6.47703 10.648L4.78953 8.96047C4.68399 8.85492 4.62469 8.71177 4.62469 8.5625C4.62469 8.41323 4.68399 8.27008 4.78953 8.16453C4.89508 8.05898 5.03824 7.99969 5.1875 7.99969C5.33677 7.99969 5.47992 8.05898 5.58547 8.16453L6.875 9.45477L10.4145 5.91453C10.4668 5.86223 10.5288 5.82074 10.5971 5.79244C10.6654 5.76413 10.7386 5.74956 10.8125 5.74956C10.8864 5.74956 10.9596 5.76413 11.0279 5.79244C11.0962 5.82074 11.1582 5.86223 11.2105 5.91453ZM15.3125 8C15.3125 9.44628 14.8836 10.8601 14.0801 12.0626C13.2766 13.2651 12.1346 14.2024 10.7984 14.7559C9.46219 15.3093 7.99189 15.4541 6.57341 15.172C5.15492 14.8898 3.85196 14.1934 2.82928 13.1707C1.80661 12.148 1.11017 10.8451 0.828011 9.4266C0.545857 8.00811 0.690668 6.53781 1.24413 5.20163C1.7976 3.86544 2.73486 2.72339 3.9374 1.91988C5.13993 1.11637 6.55373 0.6875 8 0.6875C9.93877 0.689547 11.7975 1.46063 13.1685 2.83154C14.5394 4.20246 15.3105 6.06123 15.3125 8ZM14.1875 8C14.1875 6.77623 13.8246 5.57994 13.1447 4.56241C12.4648 3.54488 11.4985 2.75181 10.3679 2.2835C9.23724 1.81518 7.99314 1.69264 6.79288 1.93139C5.59262 2.17014 4.49012 2.75944 3.62478 3.62478C2.75944 4.49011 2.17014 5.59262 1.93139 6.79288C1.69265 7.99314 1.81518 9.23724 2.2835 10.3679C2.75182 11.4985 3.54488 12.4648 4.56241 13.1447C5.57994 13.8246 6.77623 14.1875 8 14.1875C9.64046 14.1856 11.2132 13.5331 12.3732 12.3732C13.5331 11.2132 14.1856 9.64046 14.1875 8Z",fill:"#338B13"})}),J5=()=>i.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:i.jsx("path",{d:"M8 0.6875C6.55373 0.6875 5.13993 1.11637 3.9374 1.91988C2.73486 2.72339 1.7976 3.86544 1.24413 5.20163C0.690668 6.53781 0.545857 8.00811 0.828011 9.4266C1.11017 10.8451 1.80661 12.148 2.82928 13.1707C3.85196 14.1934 5.15492 14.8898 6.57341 15.172C7.99189 15.4541 9.46219 15.3093 10.7984 14.7559C12.1346 14.2024 13.2766 13.2651 14.0801 12.0626C14.8836 10.8601 15.3125 9.44628 15.3125 8C15.3105 6.06123 14.5394 4.20246 13.1685 2.83154C11.7975 1.46063 9.93877 0.689547 8 0.6875ZM8 14.1875C6.77623 14.1875 5.57994 13.8246 4.56241 13.1447C3.54488 12.4648 2.75182 11.4985 2.2835 10.3679C1.81518 9.23724 1.69265 7.99314 1.93139 6.79288C2.17014 5.59262 2.75944 4.49011 3.62478 3.62478C4.49012 2.75944 5.59262 2.17014 6.79288 1.93139C7.99314 1.69264 9.23724 1.81518 10.3679 2.2835C11.4985 2.75181 12.4648 3.54488 13.1447 4.56241C13.8246 5.57994 14.1875 6.77623 14.1875 8C14.1856 9.64046 13.5331 11.2132 12.3732 12.3732C11.2132 13.5331 9.64046 14.1856 8 14.1875ZM12.5 8C12.5 8.14918 12.4407 8.29226 12.3353 8.39775C12.2298 8.50324 12.0867 8.5625 11.9375 8.5625H8C7.85082 8.5625 7.70775 8.50324 7.60226 8.39775C7.49677 8.29226 7.4375 8.14918 7.4375 8V4.0625C7.4375 3.91332 7.49677 3.77024 7.60226 3.66475C7.70775 3.55926 7.85082 3.5 8 3.5C8.14919 3.5 8.29226 3.55926 8.39775 3.66475C8.50324 3.77024 8.5625 3.91332 8.5625 4.0625V7.4375H11.9375C12.0867 7.4375 12.2298 7.49676 12.3353 7.60225C12.4407 7.70774 12.5 7.85082 12.5 8Z",fill:"#C1972A"})}),e8=()=>i.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[i.jsx("path",{d:"M9 17.0625C4.5525 17.0625 0.9375 13.4475 0.9375 9C0.9375 4.5525 4.5525 0.9375 9 0.9375C13.4475 0.9375 17.0625 4.5525 17.0625 9C17.0625 13.4475 13.4475 17.0625 9 17.0625ZM9 2.0625C5.175 2.0625 2.0625 5.175 2.0625 9C2.0625 12.825 5.175 15.9375 9 15.9375C12.825 15.9375 15.9375 12.825 15.9375 9C15.9375 5.175 12.825 2.0625 9 2.0625Z",fill:"#C12A2A"}),i.jsx("path",{d:"M6.87752 11.685C6.73502 11.685 6.59252 11.6325 6.48002 11.52C6.26252 11.3025 6.26252 10.9425 6.48002 10.725L10.725 6.48C10.9425 6.2625 11.3025 6.2625 11.52 6.48C11.7375 6.6975 11.7375 7.0575 11.52 7.275L7.27502 11.52C7.17002 11.6325 7.02002 11.685 6.87752 11.685Z",fill:"#C12A2A"}),i.jsx("path",{d:"M11.1225 11.685C10.98 11.685 10.8375 11.6325 10.725 11.52L6.48002 7.275C6.26252 7.0575 6.26252 6.6975 6.48002 6.48C6.69752 6.2625 7.05752 6.2625 7.27502 6.48L11.52 10.725C11.7375 10.9425 11.7375 11.3025 11.52 11.52C11.4075 11.6325 11.265 11.685 11.1225 11.685Z",fill:"#C12A2A"})]}),t8={[Sn.SUCCESS]:Q5,[Sn.WARNING]:J5,[Sn.ERROR]:e8},n8={[Sn.SUCCESS]:_r.statusIndicatorSuccess,[Sn.WARNING]:_r.statusIndicatorWarning,[Sn.ERROR]:_r.statusIndicatorError},r8=e=>{switch(e){case"NEW":return"New";case"COMPLETED":return"Completed";case"CANCELLED":return"Cancelled";case"EXPIRED":return"Expired";case"FAILED":return"Failed";case"FULL_DELIVERY_FAILURE":return"Delivery Failed";case"PARTIALLY_DELIVERED":return"Partial Delivery Failed";case"REFUNDED":return"Refunded";case"PENDING":return"Pending";case"PROCESSING":return"Processing";case"APPROVED":return"Approved";case"DECLINED":return"Declined";case"AUTO_APPROVED":return"Auto Approved";case"PARTIALLY_REFUNDED":return"Partial Refunded"}return e},h0=({status:e,variant:t=Sn.WARNING})=>{const{isAntistock:n}=b.useGeneralStore(),r=t8[t];return i.jsxs("div",{className:b.clx(_r.statusIndicator,n8[t],{[_r.antistockStatus]:n}),children:[i.jsx(r,{}),i.jsx("span",{className:_r.statusIndicatorText,id:"md",children:r8(e)})]})},u8="_checkoutItemsContainer_1kn61_2",a8="_innerContainer_1kn61_16",s8="_headerSection_1kn61_22",i8="_header_1kn61_22",o8="_productsContainer_1kn61_47",c8="_couponContainer_1kn61_54",l8="_checkoutFooter_1kn61_58",Yn={checkoutItemsContainer:u8,innerContainer:a8,headerSection:s8,header:i8,productsContainer:o8,couponContainer:c8,checkoutFooter:l8},d8="_checkoutFooter_sum4s_1",f8="_antistock_sum4s_12",h8="_footerBranding_sum4s_22",p8="_poweredText_sum4s_27",m8="_antistockLink_sum4s_31",g8="_footerNav_sum4s_39",Nn={checkoutFooter:d8,antistock:f8,footerBranding:h8,poweredText:p8,antistockLink:m8,footerNav:g8},b8="data:image/svg+xml,%3csvg%20width='100'%20height='26'%20viewBox='0%200%20100%2026'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M20.3996%203.39999V12.8228L16.2964%2014.1313V8.89738L7.69363%2011.587V6.87107L20.3996%203.39999Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M16.2964%2014.1313L16.2962%2018.6292L3.59961%2022.6V12.7592L7.69363%2011.587L7.69344%2016.9118L16.2964%2014.1313Z'%20fill='%23FF3F19'/%3e%3cpath%20d='M95.6308%2022C93.4931%2022%2091.8804%2020.882%2091.4678%2019.1776L93.118%2019.0676C93.4181%2019.984%2094.0931%2020.5338%2095.6308%2020.5338C97.4311%2020.5338%2098.4249%2019.8373%2098.4249%2018.4078V16.8316C97.9374%2017.858%2096.8122%2018.5178%2095.5183%2018.5178C92.9868%2018.5178%2091.1865%2016.575%2091.1865%2013.8076C91.1865%2011.0401%2092.9492%209.09737%2095.4433%209.09737C96.831%209.09737%2098.0499%209.77549%2098.5%2010.8568V9.3173H100V18.3711C100%2020.6438%2098.3687%2022%2095.6308%2022ZM95.5933%2017.0515C97.2998%2017.0515%2098.4062%2015.8053%2098.4249%2013.8076C98.4624%2011.8099%2097.3186%2010.5636%2095.5933%2010.5636C93.8494%2010.5636%2092.8367%2011.8099%2092.8367%2013.8076C92.8367%2015.8053%2093.8869%2017.0515%2095.5933%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M81.1836%2019.0309V9.3173H82.6275L82.665%2011.0584C83.1901%209.72051%2084.3527%209.09737%2085.7217%209.09737C87.9907%209.09737%2089.0783%2010.7285%2089.0783%2012.7812V19.0309H87.5031V13.2211C87.5031%2011.425%2086.8843%2010.4536%2085.3841%2010.4536C83.8464%2010.4536%2082.7588%2011.425%2082.7588%2013.2211V19.0309H81.1836Z'%20fill='%23252525'/%3e%3cpath%20d='M73.3176%2019.2509C71.2549%2019.2509%2069.9609%2018.2795%2069.9609%2016.6117C69.9609%2014.9622%2070.9173%2014.0458%2073.0926%2013.6426L76.618%2013.0011C76.618%2011.37%2075.8304%2010.5636%2074.2552%2010.5636C72.8676%2010.5636%2072.0987%2011.1867%2071.7987%2012.3047L70.1297%2012.1764C70.5048%2010.3436%2072.0049%209.09737%2074.2552%209.09737C76.8056%209.09737%2078.1932%2010.6002%2078.1932%2013.0561V17.0699C78.1932%2017.5097%2078.3433%2017.6747%2078.7183%2017.6747H79.1121V19.0309C78.9996%2019.0493%2078.7558%2019.0676%2078.512%2019.0676C77.3119%2019.0676%2076.7681%2018.6094%2076.6368%2017.5281C76.1492%2018.5361%2074.7803%2019.2509%2073.3176%2019.2509ZM73.4676%2017.8946C75.4554%2017.8946%2076.618%2016.6483%2076.618%2015.0355V14.3391L73.3926%2014.9255C72.0425%2015.1638%2071.6111%2015.6586%2071.6111%2016.4651C71.6111%2017.3814%2072.305%2017.8946%2073.4676%2017.8946Z'%20fill='%23252525'/%3e%3cpath%20d='M63.2168%2022C61.079%2022%2059.4663%2020.882%2059.0537%2019.1776L60.704%2019.0676C61.004%2019.984%2061.6791%2020.5338%2063.2168%2020.5338C65.017%2020.5338%2066.0109%2019.8373%2066.0109%2018.4078V16.8316C65.5233%2017.858%2064.3982%2018.5178%2063.1043%2018.5178C60.5727%2018.5178%2058.7725%2016.575%2058.7725%2013.8076C58.7725%2011.0401%2060.5352%209.09737%2063.0293%209.09737C64.4169%209.09737%2065.6358%209.77549%2066.0859%2010.8568V9.3173H67.5861V18.3711C67.5861%2020.6438%2065.9546%2022%2063.2168%2022ZM63.1793%2017.0515C64.8857%2017.0515%2065.9921%2015.8053%2066.0109%2013.8076C66.0484%2011.8099%2064.9045%2010.5636%2063.1793%2010.5636C61.4353%2010.5636%2060.4227%2011.8099%2060.4227%2013.8076C60.4227%2015.8053%2061.4728%2017.0515%2063.1793%2017.0515Z'%20fill='%23252525'/%3e%3cpath%20d='M56.2141%2019.0309C55.0515%2019.0309%2054.2451%2018.4811%2054.2451%2017.1982L54.2639%206.01834H55.8391V17.0699C55.8391%2017.4731%2056.0453%2017.6747%2056.4579%2017.6747H57.3205V19.0309H56.2141Z'%20fill='%23252525'/%3e%3cpath%20d='M51.0686%2019.0309C49.906%2019.0309%2049.0996%2018.4811%2049.0996%2017.1982L49.1184%206.01834H50.6936V17.0699C50.6936%2017.4731%2050.8998%2017.6747%2051.3124%2017.6747H52.175V19.0309H51.0686Z'%20fill='%23252525'/%3e%3cpath%20d='M44.5209%2019.0309V9.3173H46.0961V19.0309H44.5209ZM44.4834%207.79611V6H46.1336V7.79611H44.4834Z'%20fill='%23252525'/%3e%3cpath%20d='M32%2019.0309V6.01834H36.5756C39.726%206.01834%2041.3012%207.09967%2041.3012%209.51891C41.3012%2010.9851%2040.4198%2012.0481%2038.9384%2012.3047C40.7574%2012.5613%2041.8638%2013.7709%2041.8638%2015.4571C41.8638%2017.8213%2040.2323%2019.0309%2037.3257%2019.0309H32ZM37.3257%2017.4914C39.1447%2017.4914%2040.176%2016.74%2040.176%2015.3654C40.176%2013.9908%2039.1447%2013.1844%2037.3257%2013.1844H33.6127V17.4914H37.3257ZM36.5756%2011.6449C38.5258%2011.6449%2039.6135%2010.8935%2039.6135%209.59222C39.6135%208.21765%2038.6008%207.55786%2036.5756%207.55786H33.6127V11.6449H36.5756Z'%20fill='%23252525'/%3e%3c/svg%3e",zn=({className:e})=>{const{shopTerms:t,shopPrivacyPolicy:n,shopRefundPolicy:r,shopLogo:u}=b.useStorefrontStore(),{isAntistock:a}=b.useGeneralStore(),{settings:s}=b.useSettingsStore();return i.jsxs("footer",{className:`${Nn.checkoutFooter} ${e} ${a?Nn.antistock:""}`,children:[a&&(s==null?void 0:s.showPoweredBy)&&i.jsxs("div",{className:Nn.footerBranding,children:[i.jsx("p",{className:Nn.poweredText,id:"md",style:{color:"var(--text-action)"},children:"Powered by"}),i.jsxs("a",{className:Nn.antistockLink,href:"https://antistock.io",target:"_blank",rel:"noopener noreferrer",children:[i.jsx(Gl,{width:14,height:18}),"Antistock"]})]}),!a&&i.jsxs("div",{className:Nn.footerBranding,children:[i.jsx("p",{className:Nn.poweredText,id:"md",children:"Powered by"}),u||i.jsx("img",{src:b8,alt:"Billgang"})]}),i.jsx("nav",{children:i.jsxs("ul",{className:Nn.footerNav,children:[(t==null?void 0:t.showTermsOfServiceOnProduct)&&!a&&i.jsx("li",{children:i.jsx("a",{href:t.termsOfService,target:"_blank",rel:"noopener noreferrer",children:"Terms"})}),(n==null?void 0:n.showPrivacyPolicyOnProduct)&&i.jsx("li",{children:i.jsx("a",{href:n.privacyPolicy,target:"_blank",rel:"noopener noreferrer",children:"Privacy"})}),(r==null?void 0:r.showRefundPolicyOnProduct)&&i.jsx("li",{children:i.jsx("a",{href:r.refundPolicy,target:"_blank",rel:"noopener noreferrer",children:"Refund"})})]})})]})},_8="_checkoutHeader_1stm3_1",x8="_leftContainer_1stm3_20",C8="_backArrow_1stm3_26",E8="_logoContainer_1stm3_38",y8="_logo_1stm3_38",T8="_antistockLink_1stm3_48",dr={checkoutHeader:_8,leftContainer:x8,backArrow:C8,logoContainer:E8,logo:y8,antistockLink:T8},k8="_activeBadge_1yb5i_1",A8="_activeBadgeText_1yb5i_12",No={activeBadge:k8,activeBadgeText:A8},S8=({className:e})=>i.jsxs("div",{className:b.clx(No.activeBadge,e),children:[i.jsx(v.Icon,{name:"Check",width:20,height:20}),i.jsx("p",{className:No.activeBadgeText,children:"Active"})]}),I8="_timerContainer_rh66p_2",N8="_timerText_rh66p_12",v8="_timerContainerAntistock_rh66p_16",Ka={timerContainer:I8,timerText:N8,timerContainerAntistock:v8},w8=({expiresAt:e})=>{const[t,n]=P.useState(u()),{isAntistock:r}=b.useGeneralStore();function u(){const a=new Date,s=new Date(e).getTime()-a.getTime();if(s<=0)return{hours:"00",minutes:"00",seconds:"00"};const o=Math.floor(s/(1e3*60*60)),c=Math.floor(s%(1e3*60*60)/(1e3*60)),l=Math.floor(s%(1e3*60)/1e3);return{hours:String(o).padStart(2,"0"),minutes:String(c).padStart(2,"0"),seconds:String(l).padStart(2,"0")}}return P.useEffect(()=>{const a=setInterval(()=>{n(u())},1e3);return()=>clearInterval(a)},[e]),t.hours==="00"&&t.minutes==="00"&&t.seconds==="00"?null:r?i.jsxs("div",{className:Ka.timerContainerAntistock,children:[i.jsxs("span",{children:[t.hours,":",t.minutes,":",t.seconds]}),i.jsx("span",{children:"remaining"})]}):i.jsxs("div",{className:Ka.timerContainer,children:[i.jsx(v.Icon,{name:"Clock"}),i.jsxs("p",{className:Ka.timerText,id:"md",children:[t.hours,":",t.minutes,":",t.seconds]})]})},D8="_progressBar_mcabf_4",L8="_progressBarLabel_mcabf_12",P8="_progressBarTrack_mcabf_17",R8="_progressBarFill_mcabf_28",Lu={progressBar:D8,progressBarLabel:L8,progressBarTrack:P8,progressBarFill:R8},p0=({color:e,percent:t,disablePercentLabel:n})=>i.jsxs("div",{className:Lu.progressBar,children:[!n&&i.jsxs("p",{className:Lu.progressBarLabel,children:[t,"%"]}),i.jsx("div",{className:Lu.progressBarTrack,children:i.jsx("div",{style:{width:`${t}%`,background:e||void 0},className:Lu.progressBarFill})})]}),O8="_rating_1bpps_4",M8="_disabled_1bpps_9",F8="_ratingStar_1bpps_14",B8="_inactive_1bpps_22",Pu={rating:O8,disabled:M8,ratingStar:F8,inactive:B8},j8=({setRating:e,rating:t,disabled:n})=>{const[r,u]=P.useState(0),a=o=>{n||u(+o.currentTarget.id)},s=o=>{n||e(o)};return i.jsx("div",{className:b.clx(Pu.rating,{[Pu.disabled]:n}),onMouseLeave:()=>u(0),children:[1,2,3,4,5].map(o=>i.jsx("div",{id:o.toString(),className:b.clx(Pu.ratingStar,{[Pu.inactive]:!(t>=o||r>=o)}),onMouseEnter:a,onClick:()=>s(o),children:t>=o||r>=o?i.jsx(um,{}):i.jsx(v.Icon,{name:"Star",fill:"var(--text-secondary)",width:22,height:21})},o))})},H8="_inputRange_iv6ow_4",U8="_inputRangeLabel_iv6ow_14",V8="_progressBar_iv6ow_22",$8="_progressBarFill_iv6ow_29",z8="_stepsContainer_iv6ow_40",q8="_step_iv6ow_40",Z8="_stepDot_iv6ow_57",W8="_current_iv6ow_61",Y8="_active_iv6ow_69",G8="_inactive_iv6ow_72",X8="_tooltip_iv6ow_77",zt={inputRange:H8,inputRangeLabel:U8,progressBar:V8,progressBarFill:$8,stepsContainer:z8,step:q8,stepDot:Z8,current:W8,default:"_default_iv6ow_65",active:Y8,inactive:G8,tooltip:X8},K8=({totalSteps:e,step:t,onStepChange:n,label:r})=>{const[u,a]=P.useState(t),s=u===1?0:(u-1)/(e-1)*100,o=c=>{a(c),n(c)};return i.jsxs("div",{className:zt.inputRange,children:[r&&i.jsx("div",{className:zt.inputRangeLabel,children:r}),i.jsxs("div",{className:zt.progressBar,children:[i.jsx("div",{className:zt.progressBarFill,style:{width:`${Math.ceil(s)}%`}}),i.jsx("div",{className:zt.stepsContainer,children:[...Array(e)].map((c,l)=>{const h=l+1,f=h<=u,m=h===u;return i.jsxs("div",{className:zt.step,onClick:()=>o(h),children:[i.jsx("div",{className:b.clx(zt.stepDot,m?zt.current:zt.default,f?zt.active:zt.inactive)}),m&&i.jsxs("div",{className:zt.tooltip,style:{transform:`translateX(calc(50% - ${s<99?"40px":"70px"}))`},children:[i.jsx("span",{children:u}),i.jsx("span",{children:u===1?"month":"months"})]})]},h)})})]})]})},xa=({className:e,expiresAt:t})=>{const{shopGeneral:n}=b.useStorefrontStore(),r=b.useNavigate(),{isAntistock:u}=b.useGeneralStore();return i.jsxs("header",{className:`${dr.checkoutHeader} ${e}`,children:[i.jsxs("div",{className:dr.leftContainer,children:[i.jsx("div",{className:dr.backArrow,onClick:()=>{window.history.length>2?r(-1):r("/")},children:i.jsx(v.Icon,{name:"ArrowUp"})}),(n==null?void 0:n.info.logo)&&i.jsx("div",{className:dr.logoContainer,children:u?i.jsx("a",{className:dr.antistockLink,href:"https://antistock.io",target:"_blank",rel:"noopener noreferrer",children:"Antistock"}):i.jsx("img",{className:dr.logo,src:b.convertCfImageIdToUrl(n.info.logo.cfId,"200")})})]}),t&&i.jsx(w8,{expiresAt:t})]})},Q8="_checkoutPrices_7fn88_1",J8="_priceRow_7fn88_12",e7="_label_7fn88_22",t7="_labelContainer_7fn88_26",n7="_tooltipContainer_7fn88_34",r7="_infoIcon_7fn88_40",u7="_tooltip_7fn88_34",a7="_totalRow_7fn88_94",s7="_totalLabel_7fn88_105",i7="_totalValue_7fn88_110",Ye={checkoutPrices:Q8,priceRow:J8,label:e7,labelContainer:t7,tooltipContainer:n7,infoIcon:r7,tooltip:u7,totalRow:a7,totalLabel:s7,totalValue:i7},Nr=({formatter:e,coupon:t,discount:n,totalWithDiscount:r,total:u,className:a,isShowSubtotal:s=!0,feeOrDiscount:o,serviceFeeAmount:c,replacementLabel:l,replacementAmount:h})=>{const f=Math.max(0,n),[m,p]=P.useState(!1),[g,x]=P.useState(!1),{priceAdjustment:E}=b.useCartStore(),{isAntistock:_}=b.useGeneralStore(),{settings:k}=b.useSettingsStore(),y={isDiscount:!1,fixedAmount:10,percentage:10},I=(()=>{const S=r!==void 0?r:u-f;if((!E||o===null||o===void 0)&&h==null&&(!y||c===null||c===void 0))return Math.max(S,0);let O=S;return E&&o!==null&&o!==void 0&&(E.isDiscount?O=Math.max(O-o,0):O=Math.max(O+o,0)),h!=null&&(O=Math.max(O+h,0)),y&&c!==null&&c!==void 0&&(y.isDiscount?O=Math.max(O-c,0):O=Math.max(O+c,0)),O})();return i.jsxs("div",{className:`${Ye.checkoutPrices} ${a||""}`,style:{border:_?"1px solid var(--border-secondary)":void 0},children:[s&&i.jsxs("div",{className:Ye.priceRow,children:[i.jsx("p",{className:Ye.label,id:"md",children:"Subtotal"}),i.jsx("p",{id:"md",children:e.format(u)})]}),(t||f>0)&&i.jsxs("div",{className:Ye.priceRow,children:[i.jsxs("p",{className:Ye.label,id:"md",children:["Discount ",t&&!(t!=null&&t.isFixed)&&`(${t==null?void 0:t.discount}%)`]}),i.jsx("p",{id:"md",children:t&&!(t!=null&&t.isFixed)&&(t==null?void 0:t.discount)===100?`-${e.format(u)}`:`-${e.format(f)}`})]}),o!=null&&o!==0&&E&&(E.fixedAmount!==0||E.percentage!==0)&&i.jsxs("div",{className:Ye.priceRow,children:[i.jsx("p",{className:Ye.label,id:"md",children:E.isDiscount?"Gateway Discount":"Gateway Fee"}),i.jsx("p",{id:"md",children:e.format(o)})]}),h!=null&&h!==0&&i.jsxs("div",{className:Ye.priceRow,children:[i.jsxs("div",{className:Ye.labelContainer,children:[i.jsx("p",{className:Ye.label,id:"md",children:l||"Priority Replacement"}),_&&i.jsxs("div",{className:Ye.tooltipContainer,children:[i.jsx("div",{className:Ye.infoIcon,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),children:i.jsx(v.Icon,{name:"Info",fill:"var(--text-secondary)"})}),m&&i.jsx("div",{className:Ye.tooltip,children:"This is an optional add-on you enabled to protect your checkout."})]})]}),i.jsx("p",{id:"md",children:e.format(h)})]}),c!=null&&c!==0&&y&&(y.fixedAmount!==0||y.percentage!==0)&&i.jsxs("div",{className:Ye.priceRow,children:[i.jsxs("div",{className:Ye.labelContainer,children:[i.jsx("p",{className:Ye.label,id:"md",children:y.isDiscount?"Platform Discount":"Platform Fee"}),_&&i.jsxs("div",{className:Ye.tooltipContainer,children:[i.jsx("div",{className:Ye.infoIcon,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),children:i.jsx(v.Icon,{name:"Info",fill:"var(--text-secondary)"})}),g&&i.jsxs("div",{className:Ye.tooltip,children:["Platform ",y.isDiscount?"discount":"fee",(k==null?void 0:k.showPoweredBy)&&" charged by Antistock"," for processing your payment."]})]})]}),i.jsx("p",{id:"md",children:e.format(c)})]}),i.jsxs("div",{className:Ye.totalRow,children:[i.jsx("p",{className:Ye.totalLabel,id:"md-bold",children:"Total Due"}),i.jsx("p",{className:Ye.totalValue,id:"md-bold",children:e.format(I)})]})]})},o7="_checkoutProduct_8yrle_1",c7="_isOrder_8yrle_1",l7="_productDetails_8yrle_14",d7="_productImage_8yrle_20",f7="_isOrderImage_8yrle_30",h7="_productImageAntistock_8yrle_34",p7="_image_8yrle_39",m7="_productInfo_8yrle_44",g7="_productInfoOverrodePrice_8yrle_51",b7="_productHeader_8yrle_55",_7="_quantityBadge_8yrle_61",x7="_productPrice_8yrle_79",C7="_priceContainer_8yrle_88",E7="_originalPrice_8yrle_97",y7="_overridePrice_8yrle_103",T7="_deliveryCategories_8yrle_107",k7="_customerNote_8yrle_115",A7="_noteHeader_8yrle_122",S7="_logoContainer_8yrle_128",I7="_shopName_8yrle_140",N7="_noteContent_8yrle_144",v7="_productName_8yrle_150",w7="_replacementRequests_8yrle_165",D7="_replacementRequestsTitle_8yrle_175",L7="_replacementButton_8yrle_182",P7="_replacementButtonText_8yrle_186",R7="_replacementRequestsList_8yrle_190",Me={checkoutProduct:o7,isOrder:c7,productDetails:l7,productImage:d7,isOrderImage:f7,productImageAntistock:h7,image:p7,productInfo:m7,productInfoOverrodePrice:g7,productHeader:b7,quantityBadge:_7,productPrice:x7,priceContainer:C7,originalPrice:E7,overridePrice:y7,deliveryCategories:T7,customerNote:k7,noteHeader:A7,logoContainer:S7,shopName:I7,noteContent:N7,productName:v7,replacementRequests:w7,replacementRequestsTitle:D7,replacementButton:L7,replacementButtonText:P7,replacementRequestsList:R7},O7="_deliveryItem_1x3fg_1",M7="_deliveryItemText_1x3fg_10",Zr={deliveryItem:O7,deliveryItemText:M7},ws={[Le.Text]:"View",[Le.Serial]:"View",[Le.Ebook]:"View",[Le.Link]:"Visit",[Le.Download]:"",[Le.Custom]:"View",[Le.Discord]:"Access",[Le.Telegram]:"Telegram"},Ds={[Le.Text]:"Content",[Le.Serial]:"Content",[Le.Ebook]:"Ebook",[Le.Link]:"Link",[Le.Download]:"Download",[Le.Custom]:"Content",[Le.Discord]:"Discord",[Le.Telegram]:"Telegram"},m0=()=>({[Le.Text]:i.jsx(v.Icon,{name:"FileText",fill:"var(--text-secondary)"}),[Le.Serial]:i.jsx(v.Icon,{name:"FileText",fill:"var(--text-secondary)"}),[Le.Ebook]:i.jsx(v.Icon,{name:"BookOpen",fill:"var(--text-secondary)"}),[Le.Link]:i.jsx(v.Icon,{name:"ArrowLineUpRight",fill:"var(--text-secondary)"}),[Le.Download]:i.jsx(v.Icon,{name:"DownloadSimple",fill:"var(--text-secondary)"}),[Le.Custom]:i.jsx(v.Icon,{name:"FileText",fill:"var(--text-secondary)"}),[Le.Discord]:i.jsx(v.Icon,{name:"DiscordLogo",fill:"var(--text-secondary)"}),[Le.Telegram]:i.jsx(v.Icon,{name:"TelegramLogo",fill:"var(--text-secondary)"})}),F7=({deliveryConfiguration:e})=>{const t=e.type;return t===Le.Text||t===Le.Custom||t===Le.Serial||t===Le.Discord?i.jsx(B7,{deliveryConfiguration:e}):i.jsx(j7,{deliveryConfiguration:e})},B7=({deliveryConfiguration:e})=>{const t=e.type,[n,r]=P.useState(!1),{setIsOpen:u}=b.useModalStore(),{isAntistock:a}=b.useGeneralStore(),s=()=>{u(!0),r(!0)};return i.jsxs(i.Fragment,{children:[a?i.jsx(v.Button,{type:"Secondary",onClick:o=>{o.stopPropagation(),s()},children:i.jsx("p",{className:Zr.deliveryItemText,children:e.customName??`${ws[t]} ${Ds[t]}`})}):i.jsxs(v.Button,{type:"Secondary",className:Zr.deliveryItem,onClick:o=>{o.stopPropagation(),s()},children:[m0()[t],i.jsx("p",{className:Zr.deliveryItemText,children:e.customName??`${ws[t]} ${Ds[t]}`})]}),n&&i.jsx(v.Modal,{close:()=>r(!1),withAnimation:!a,children:i.jsx(kd,{deliveryConfiguration:e,setIsOpen:r})})]})},j7=({deliveryConfiguration:e})=>{const t=e.type;return i.jsxs(v.Button,{type:"Secondary",className:Zr.deliveryItem,style:{display:"flex",alignItems:"center",gap:"0.5rem"},onClick:()=>window.open(e.deliveryItems[0].textData,"_blank"),children:[m0()[t],i.jsx("p",{className:Zr.deliveryItemText,children:e.customName??`${ws[t]} ${Ds[t]}`})]})},H7="_replacementRequestItem_1sd2r_1",U7="_replacementRequestHeader_1sd2r_11",V7="_replacementRequestId_1sd2r_18",$7="_replacementRequestDescription_1sd2r_24",z7="_statusBadge_1sd2r_30",q7="_statusPending_1sd2r_38",Z7="_statusApproved_1sd2r_43",W7="_statusDeclined_1sd2r_48",Y7="_statusCancelled_1sd2r_53",G7="_replacementModal_1sd2r_58",X7="_replacementModalAntistock_1sd2r_68",K7="_replacementModalHeader_1sd2r_73",Q7="_closeButton_1sd2r_87",J7="_replacementModalContent_1sd2r_101",e9="_statusSection_1sd2r_110",t9="_statusTitle_1sd2r_116",n9="_statusDescription_1sd2r_123",r9="_actionButtons_1sd2r_130",u9="_productsSection_1sd2r_137",a9="_productsList_1sd2r_151",s9="_productItem_1sd2r_157",i9="_noProducts_1sd2r_164",o9="_previouslyDeliveredSection_1sd2r_171",c9="_previouslyDeliveredHeader_1sd2r_179",l9="_previouslyDeliveredTitle_1sd2r_186",d9="_caretIcon_1sd2r_192",f9="_caretIconRotated_1sd2r_196",h9="_previouslyDeliveredContent_1sd2r_200",p9="_previouslyDeliveredProductItem_1sd2r_209",we={replacementRequestItem:H7,replacementRequestHeader:U7,replacementRequestId:V7,replacementRequestDescription:$7,statusBadge:z7,statusPending:q7,statusApproved:Z7,statusDeclined:W7,statusCancelled:Y7,replacementModal:G7,replacementModalAntistock:X7,replacementModalHeader:K7,closeButton:Q7,replacementModalContent:J7,statusSection:e9,statusTitle:t9,statusDescription:n9,actionButtons:r9,productsSection:u9,productsList:a9,productItem:s9,noProducts:i9,previouslyDeliveredSection:o9,previouslyDeliveredHeader:c9,previouslyDeliveredTitle:l9,caretIcon:d9,caretIconRotated:f9,previouslyDeliveredContent:h9,previouslyDeliveredProductItem:p9},m9=({item:e,orderId:t,accessToken:n,onCancel:r})=>{var D,I;const[u,a]=P.useState(!1),[s,o]=P.useState(!1),[c,l]=P.useState(!1),{setIsOpen:h}=b.useModalStore(),{isAntistock:f}=b.useGeneralStore(),{setNotifications:m,notifications:p}=b.useNotificationStore(),g=()=>{h(!0),a(!0)},x=async()=>{var S,O;if(!t||!n){m([...p,{id:b.v4(),message:"Missing order information",status:"error"}]);return}o(!0);try{const Z=await b2(t,n,e.id);m([...p,{id:b.v4(),message:((S=Z.data)==null?void 0:S.message)||"Replacement request cancelled successfully",status:"success"}]),r==null||r(),a(!1)}catch(Z){let H="Failed to cancel replacement request",L="";const j=Z;if((O=j==null?void 0:j.response)!=null&&O.data){const B=j.response.data;B.message&&B.errors&&Array.isArray(B.errors)?(L=B.message,H=B.errors.join(", ")):B.errors&&Array.isArray(B.errors)?H=B.errors.join(", "):B.message&&(H=B.message)}else Z instanceof Error&&(H=Z.message);m([...p,{id:b.v4(),message:H,status:"error",label:L}])}finally{o(!1)}},E=()=>{if(!e.replacementItems||e.replacementItems.length===0){m([...p,{id:b.v4(),message:"No products to copy",status:"error"}]);return}const S=e.replacementItems.map(O=>`${O.originalSerialKey} -> ${O.replacementSerialKey}`).join(`
78
78
  `);navigator.clipboard.writeText(S).then(()=>{m([...p,{id:b.v4(),message:"Copied to clipboard",status:"success"}])})},_=()=>{if(!e.replacementItems||e.replacementItems.length===0){m([...p,{id:b.v4(),message:"No products to download",status:"error"}]);return}const S=e.replacementItems.map(L=>`${L.originalSerialKey} -> ${L.replacementSerialKey}`).join(`
79
- `),O=new Blob([S],{type:"text/plain"}),Z=URL.createObjectURL(O),H=document.createElement("a");H.href=Z,H.download=`replacement-request-${e.id}.txt`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(Z)},k=S=>{switch(S){case le.PENDING:case le.PROCESSING:return we.statusPending;case le.APPROVED:case le.AUTO_APPROVED:case le.COMPLETED:return we.statusApproved;case le.DECLINED:case le.FAILED:return we.statusDeclined;case le.CANCELLED:case le.EXPIRED:return we.statusCancelled;default:return we.statusPending}},y=S=>{switch(S){case le.PENDING:case le.PROCESSING:return"In Progress";case le.APPROVED:case le.AUTO_APPROVED:case le.COMPLETED:return"Approved";case le.DECLINED:return"Denied";case le.FAILED:return"Failed";case le.CANCELLED:case le.EXPIRED:return"Cancelled";default:return"In Progress"}};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:we.replacementRequestItem,onClick:S=>{S.stopPropagation(),g()},children:[i.jsxs("div",{className:we.replacementRequestHeader,children:[i.jsxs("span",{className:we.replacementRequestId,children:["ID: ",e.id]}),i.jsx("span",{className:b.clx(we.statusBadge,k(e.status)),children:y(e.status)})]}),i.jsxs("div",{className:we.replacementRequestDescription,children:[(e.status===le.PENDING||e.status===le.PROCESSING)&&"We're currently investigating your replacement. It may take a minimum of 24-48 hours for our team to get back to you.",(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&"We've approved your replacement request. Your replaced products are attached to this section.",e.status===le.DECLINED&&"We've denied your replacement request. You will not be able to request a replacement for these products in the future.",(e.status===le.CANCELLED||e.status===le.EXPIRED)&&"Your replacement request has been cancelled."]})]}),u&&i.jsx(v.Modal,{close:()=>a(!1),withAnimation:!f,children:i.jsxs("div",{className:b.clx(we.replacementModal,{[we.replacementModalAntistock]:f}),onClick:S=>S.stopPropagation(),children:[i.jsxs("div",{className:we.replacementModalHeader,children:[i.jsx("h3",{id:"h3",children:"Replacement Request"}),i.jsx("button",{className:we.closeButton,onClick:()=>a(!1),children:i.jsx(v.Icon,{name:"X"})})]}),i.jsxs("div",{className:we.replacementModalContent,children:[i.jsxs("div",{className:we.statusSection,children:[i.jsx("span",{className:b.clx(we.statusBadge,k(e.status)),children:y(e.status)}),i.jsxs("h4",{className:we.statusTitle,children:[(e.status===le.PENDING||e.status===le.PROCESSING)&&"Your Replacement Is In Progress",(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&"Your Replacement Was Approved",e.status===le.DECLINED&&"Your Replacement Was Denied",e.status===le.FAILED&&"Your Replacement Was Failed",(e.status===le.CANCELLED||e.status===le.EXPIRED)&&"Your Replacement Was Cancelled"]}),i.jsxs("p",{className:we.statusDescription,children:[(e.status===le.PENDING||e.status===le.PROCESSING)&&"We're currently investigating your request. It may take a minimum of 24-48 hours for our team to get back to you.",(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&"We've approved your replacement request. Your replaced products are attached below.",e.status===le.DECLINED&&"We've denied your replacement request. You will not be able to request a replacement for these products in the future.",e.status===le.FAILED&&"We've failed your replacement request. You will not be able to request a replacement for these products in the future.",(e.status===le.CANCELLED||e.status===le.EXPIRED)&&"Your replacement request has been cancelled."]})]}),(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:we.productsSection,children:[i.jsxs("div",{className:we.actionButtons,children:[i.jsxs(v.Button,{type:"Secondary",onClick:E,style:{display:"flex",alignItems:"center",gap:"5px",height:"32px"},children:[i.jsx(v.Icon,{name:"Copy"}),"Copy"]}),i.jsxs(v.Button,{type:"Secondary",onClick:_,style:{display:"flex",alignItems:"center",gap:"5px",height:"32px"},children:[i.jsx(v.Icon,{name:"ArrowLineDown"}),"Download"]})]}),i.jsx("div",{className:we.productsList,children:(D=e.replacementItems)==null?void 0:D.map((S,O)=>i.jsx("div",{className:we.productItem,children:i.jsx("span",{children:S.replacementSerialKey})},O))})]}),i.jsxs("div",{className:we.previouslyDeliveredSection,children:[i.jsxs("div",{className:we.previouslyDeliveredHeader,onClick:()=>l(!c),children:[i.jsx("span",{className:we.previouslyDeliveredTitle,children:"Previously Delivered Products"}),i.jsx(v.Icon,{name:"CaretDown",width:16,height:16,fill:"var(--text-secondary)",className:b.clx(we.caretIcon,{[we.caretIconRotated]:c})})]}),c&&i.jsx("div",{className:we.previouslyDeliveredContent,children:((I=e.replacementItems)==null?void 0:I.map((S,O)=>i.jsx("div",{className:we.previouslyDeliveredProductItem,children:i.jsx("span",{children:S.originalSerialKey})},O)))||i.jsx("div",{className:we.noProducts,children:"No products found"})})]})]})]}),i.jsx("div",{className:we.replacementModalFooter,children:e.status===le.PENDING&&i.jsx(v.Button,{type:"Secondary",onClick:x,disabled:s,style:{width:"fit-content",margin:"0 auto 8px"},children:s?"CANCELLING...":"CANCEL REPLACEMENT REQUEST"})})]})})]})},g9="_replacementModal_1f8b8_1",b9="_replacementModalAntistock_1f8b8_12",_9="_replacementModalHeader_1f8b8_17",x9="_title_1f8b8_25",C9="_closeButton_1f8b8_32",E9="_replacementModalContent_1f8b8_46",y9="_bottomSheet_1f8b8_53",T9="_content_1f8b8_61",k9="_productReplaceContainer_1f8b8_65",A9="_scrollableBox_1f8b8_76",S9="_searchContainer_1f8b8_90",I9="_productItem_1f8b8_94",N9="_productItemError_1f8b8_125",v9="_scrollIndicator_1f8b8_129",w9="_noResults_1f8b8_138",D9="_replacementForm_1f8b8_148",L9="_formField_1f8b8_155",P9="_replacementModalFooter_1f8b8_355",R9="_fieldError_1f8b8_361",O9="_requestButton_1f8b8_367",qe={replacementModal:g9,replacementModalAntistock:b9,replacementModalHeader:_9,title:x9,closeButton:C9,replacementModalContent:E9,bottomSheet:y9,content:T9,productReplaceContainer:k9,scrollableBox:A9,searchContainer:S9,productItem:I9,productItemError:N9,scrollIndicator:v9,noResults:w9,replacementForm:D9,formField:L9,replacementModalFooter:P9,fieldError:R9,requestButton:O9},M9=({isOpen:e,onClose:t,product:n,orderId:r,accessToken:u,onSuccess:a,allowedReplacementReasons:s})=>{const{isAntistock:o}=b.useGeneralStore(),{setNotifications:c,notifications:l}=b.useNotificationStore(),[h,f]=P.useState(null),[m,p]=P.useState((s==null?void 0:s[0])||""),[g,x]=P.useState(""),[E,_]=P.useState(""),[k,y]=P.useState([]),[D,I]=P.useState(!1),[S,O]=P.useState({}),Z=P.useRef(null),H=P.useRef(null),L=P.useRef(null),j=P.useMemo(()=>{var C;return((C=n.deliveryCategories)==null?void 0:C.filter(U=>U.type==="SERIALS").flatMap(U=>U.deliveryItems))||[]},[n.deliveryCategories]),B=P.useMemo(()=>n.replacementRequests?new Set(n.replacementRequests.flatMap(C=>C.replacementItems||[]).map(C=>C.originalSerialKey)):new Set,[n.replacementRequests]),K=P.useMemo(()=>j.filter(C=>!B.has(C.serialKey)),[j,B]),Y=P.useMemo(()=>new Xc.Fuse(K,{keys:["serialKey"],threshold:.4}),[K]),X=P.useMemo(()=>E.trim()?Y.search(E).map(C=>C.item):K,[E,Y,K]),ue=C=>{y(U=>U.includes(C)?U.filter(ne=>ne!==C):[...U,C]),S.selectedItems&&O(U=>({...U,selectedItems:void 0}))},he=()=>{y([]),f(null),p((s==null?void 0:s[0])||""),x(""),_(""),O({})},De=()=>{he(),t()},Te=async()=>{var U,ne,N,ee;O({});const C={};if(k.length===0&&(C.selectedItems="Please select at least one item to replace"),(!h||h.length===0)&&(C.images="Please add at least one image"),m.trim()||(C.reason="Please select a reason for replacement"),Object.keys(C).length>0){O(C),setTimeout(()=>{C.selectedItems&&Z.current?Z.current.scrollIntoView({behavior:"smooth",block:"center"}):C.images&&H.current?H.current.scrollIntoView({behavior:"smooth",block:"center"}):C.reason&&L.current&&L.current.scrollIntoView({behavior:"smooth",block:"center"})},100);return}if(!r||!u){c([...l,{id:b.v4(),message:"Missing order information",status:"error"}]);return}I(!0);try{if(!n.partOrderId){c([...l,{id:b.v4(),message:"Part order ID is required",status:"error"}]);return}const te=await m2(r,u,{partOrderId:n.partOrderId,deliveryItemIds:k,imageIds:(h==null?void 0:h.map(J=>J.id))||[],reason:m,message:g});c([...l,{id:b.v4(),message:((U=te.data)==null?void 0:U.message)||"Replacement request submitted successfully",status:"success"}]),(ne=te.data)!=null&&ne.id&&((N=te.data)!=null&&N.status)&&(a==null||a({id:te.data.id,status:te.data.status})),De()}catch(te){console.log({error:te});let J="Failed to submit replacement request",ce="";const oe=te;if((ee=oe==null?void 0:oe.response)!=null&&ee.data){const ae=oe.response.data;ae.message&&ae.errors&&Array.isArray(ae.errors)?(ce=ae.message,J=ae.errors.join(", ")):ae.errors&&Array.isArray(ae.errors)?J=ae.errors.join(", "):ae.message&&(J=ae.message)}else te instanceof Error&&(J=te.message);c([...l,{id:b.v4(),message:J,status:"error",label:ce}])}finally{I(!1)}};return!e||K.length===0?null:i.jsx(v.Modal,{close:De,withAnimation:!o,children:i.jsxs("div",{className:b.clx(qe.replacementModal,{[qe.replacementModalAntistock]:o}),onClick:C=>C.stopPropagation(),children:[i.jsxs("div",{className:qe.replacementModalHeader,children:[i.jsx("h3",{id:"h3 ",className:qe.title,children:"Request Replacement"}),i.jsx("button",{className:qe.closeButton,onClick:De,children:i.jsx(v.Icon,{name:"X"})})]}),i.jsx("div",{className:qe.replacementModalContent,children:i.jsx("div",{className:qe.bottomSheet,children:i.jsxs("div",{className:qe.content,children:[i.jsx(v.Tip,{type:"info",message:"Info: Based on your replacement policy, it may take up to 24-48 hours for our team to review your request.",showCloseButton:!1,style:{marginBottom:"16px"}}),i.jsxs("div",{className:qe.productReplaceContainer,children:[i.jsx("div",{className:qe.searchContainer,children:i.jsx(v.Input,{onChange:C=>{_(C)},isSearch:!0,value:E,placeholder:"Search for delivered stock",label:"Product Replace List *"})}),i.jsx("div",{ref:Z,className:b.clx(qe.scrollableBox,{[qe.scrollableBoxAntistock]:o}),children:X.length>0?X.map(C=>i.jsxs("div",{className:b.clx(qe.productItem,{[qe.productItemError]:S.selectedItems&&!k.includes(C.id)}),onClick:()=>ue(C.id),children:[i.jsx(v.Checkbox,{value:k.includes(C.id),onChange:()=>ue(C.id)}),i.jsx("span",{children:C.serialKey})]},C.id)):i.jsx("div",{className:qe.noResults,children:i.jsxs("p",{children:['No items found matching "',E,'"']})})}),S.selectedItems&&i.jsx("div",{className:qe.fieldError,children:S.selectedItems}),i.jsx("div",{className:qe.scrollIndicator,children:i.jsx("p",{children:"To continue with your replacement request, scroll down."})})]}),i.jsxs("div",{className:qe.replacementForm,children:[i.jsx("div",{className:qe.formField,ref:H,children:i.jsx(v.ImagesLoader,{images:h,onChange:C=>{f(C),S.images&&O(U=>({...U,images:void 0}))},multiple:!0,label:"Images",required:!0,enablePaste:e})}),i.jsx("div",{className:qe.formField,ref:L,children:i.jsx(v.Select,{options:(s==null?void 0:s.filter(C=>C!==m))||[],onChange:C=>{p(C),S.reason&&O(U=>({...U,reason:void 0}))},value:m,isSearch:!1,label:"Reason *",isMaxLength:!1,error:S.reason})}),i.jsx("div",{className:qe.formField,children:i.jsx(v.Textarea,{placeholder:"Use this space to provide our team with additional details regarding your replacement request.",onChange:x,label:"Your Message (Optional)",value:g})})]})]})})}),i.jsx("div",{className:qe.replacementModalFooter,children:i.jsx(v.Button,{type:"Primary",className:qe.requestButton,onClick:Te,disabled:D,children:D?"SUBMITTING...":"REQUEST REPLACEMENT"})})]})})},Ca=({isOrder:e,product:t,isApplicableForReplacement:n,orderId:r,accessToken:u,allowedReplacementReasons:a})=>{var E;const{shopGeneral:s}=b.useStorefrontStore(),o=t.subscriptionSettings,{cart:c}=lu(),{isAntistock:l}=b.useGeneralStore(),[h,f]=P.useState(!1),{setIsOpen:m}=b.useModalStore(),p=P.useMemo(()=>t.replacementRequests?new Set(t.replacementRequests.flatMap(_=>_.replacementItems||[]).map(_=>_.originalSerialKey)):new Set,[t.replacementRequests]),g=P.useMemo(()=>{var k;return(((k=t.deliveryCategories)==null?void 0:k.filter(y=>y.type==="SERIALS").flatMap(y=>y.deliveryItems))||[]).filter(y=>!p.has(y.serialKey)).length},[t.deliveryCategories,p]),x=()=>{m(!0),f(!0)};return i.jsxs("div",{className:`${Me.checkoutProduct} ${e?Me.isOrder:""}`,children:[i.jsxs("div",{className:Me.productDetails,children:[i.jsx("div",{className:`${Me.productImage} ${e?Me.isOrderImage:""} ${l?Me.productImageAntistock:""}`,children:t!=null&&t.image?i.jsx("img",{className:Me.image,src:b.convertCfImageIdToUrl(t.image.cfId,"100")}):i.jsx(v.Icon,{name:"Image",fill:"var(--text-secondary)"})}),i.jsx("div",{className:b.clx(Me.productInfo,{[Me.productInfoOverrodePrice]:t.variantsGateways&&c.gateway&&t.variantsGateways.some(_=>_.name===c.gateway&&_.overrodePrice)}),children:i.jsxs("div",{className:Me.productHeader,children:[i.jsx("h2",{className:Me.productName,id:"h5",children:t.name}),i.jsxs("span",{className:Me.quantityBadge,id:"md",children:[t.price.quantity,"x"]})]})}),t.chargeType==="RECURRING"&&i.jsx("p",{className:Me.productPrice,id:"md",children:o&&`${b.formatPrice(o.price)} / ${b.normalizeInterval(o.recurringIntervalDays||0)}${o.entryFee?" + "+b.formatPrice(o.entryFee):""}`}),t.chargeType==="ONE_TIME"&&i.jsx(i.Fragment,{children:t.variantsGateways&&c.gateway&&t.variantsGateways.some(_=>_.name===c.gateway&&_.overrodePrice)?i.jsxs("div",{className:Me.priceContainer,children:[i.jsx("span",{className:Me.originalPrice,id:"md",children:b.formatPrice(t.price)}),i.jsx("span",{className:Me.overridePrice,id:"md",children:b.formatPrice(((E=t.variantsGateways.find(_=>_.name===c.gateway))==null?void 0:E.overrodePrice)||t.price)})]}):i.jsx("p",{className:Me.productPrice,id:"md",children:b.formatPrice(t.price)})})]}),t.deliveryCategories&&i.jsx("div",{className:Me.deliveryCategories,children:t.deliveryCategories.map(_=>i.jsx(F7,{deliveryConfiguration:_},_.id))}),t.customerNote&&i.jsxs("div",{className:Me.customerNote,style:l?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsxs("div",{className:Me.noteHeader,children:[(s==null?void 0:s.info.logo)&&i.jsx("div",{className:Me.logoContainer,children:i.jsx("img",{src:b.convertCfImageIdToUrl(s==null?void 0:s.info.logo.cfId,"200")})}),i.jsx("p",{className:Me.shopName,id:"md",children:s==null?void 0:s.info.name})]}),i.jsx("p",{className:Me.noteContent,id:"md",children:t.customerNote})]}),t.replacementRequests&&t.replacementRequests.length===0&&n&&g>0&&i.jsx(v.Button,{type:"Secondary",className:Me.replacementButton,onClick:_=>{_.stopPropagation(),x()},children:i.jsx("p",{className:Me.replacementButtonText,children:"Request Replacement"})}),t.replacementRequests&&t.replacementRequests.length>0&&n&&i.jsxs("div",{className:Me.replacementRequests,children:[i.jsx("h4",{className:Me.replacementRequestsTitle,children:"Replacements"}),i.jsx("div",{className:Me.replacementRequestsList,children:t.replacementRequests.map(_=>i.jsx(m9,{item:_,orderId:r,accessToken:u,onCancel:()=>{}},_.id))}),g>0&&i.jsx(v.Button,{type:"Secondary",onClick:_=>{_.stopPropagation(),x()},children:i.jsx("p",{className:Me.replacementButtonText,children:"Request New Replacement"})})]}),i.jsx(M9,{isOpen:h,onClose:()=>f(!1),product:t,orderId:r,accessToken:u,allowedReplacementReasons:a})]})},F9="_coupon_dkjzv_1",B9="_couponApplied_dkjzv_7",j9="_discount_dkjzv_17",H9="_removeButton_dkjzv_23",U9="_removeButtonText_dkjzv_27",V9="_couponInput_dkjzv_31",$9="_couponInputContainer_dkjzv_37",vn={coupon:F9,couponApplied:B9,discount:j9,removeButton:H9,removeButtonText:U9,couponInput:V9,couponInputContainer:$9},z9=({applyCoupon:e,couponData:t,discount:n,removeCoupon:r,gateway:u})=>{const[a,s]=P.useState(null),[o,c]=P.useState(!1),{isAntistock:l}=b.useGeneralStore();return i.jsxs("div",{className:vn.coupon,children:[o&&i.jsx(ar,{speed:2,width:500,height:48,viewBox:"0 0 500 48",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",className:vn.skeleton,style:{borderRadius:"var(--border-radius)"},children:i.jsx("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"100%",height:"48"})}),!o&&(t?i.jsxs("div",{className:vn.couponApplied,style:l?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"}),i.jsxs("p",{id:"md",style:{color:l?"var(--text-primary)":void 0},children:[a," is applied"," ",i.jsxs("span",{className:vn.discount,children:["-",n," ",!t.isFixed&&`(${t.discount}%)`]})]}),i.jsx("button",{className:vn.removeButton,onClick:r,children:i.jsx("span",{className:vn.removeButtonText,children:"Remove"})})]}):i.jsxs("div",{className:vn.couponInput,children:[i.jsxs("div",{className:vn.couponInputContainer,children:[i.jsx(v.Input,{placeholder:"Enter a discount code",value:a||"",onChange:h=>{s(h===""?null:h)}}),i.jsx(v.Button,{onClick:async()=>{c(!0),a&&await e(a),c(!1)},disabled:!u||!a,type:"Primary",children:"Apply"})]}),!l&&!u&&i.jsx(v.Tip,{type:"warning",message:"The discount is related to the method of payment. Select to enter.",id:"md"})]}))]})},g0=({cart:e,products:t,applyCoupon:n,applyCouponPending:r,coupon:u,totalAndDiscount:a,removeCoupon:s})=>{const{priceAdjustment:o,serviceFee:c,replacementConfig:l}=b.useCartStore(),[h,f]=P.useState(!1),m=P.useMemo(()=>e.parts.map(y=>{const D=t.find(S=>S.id===y.productId),I=D==null?void 0:D.variants.find(S=>S.id===y.productVariantId);return y.chargeType==="RECURRING"&&f(!0),{id:(D==null?void 0:D.id)||0,image:D==null?void 0:D.images[0],name:(()=>{const S=(D==null?void 0:D.name)||"",O=(I==null?void 0:I.name)||"";return!S&&!O?"":!O||S===O?S:S?`${S} (${O})`:O})(),description:"",price:{quantity:y.quantity,amount:(I==null?void 0:I.price.amount)||0,currency:I==null?void 0:I.price.currency},subscriptionSettings:I==null?void 0:I.subscriptionSettings,chargeType:y.chargeType,variantsGateways:I==null?void 0:I.gateways}}),[e,t]),p=P.useMemo(()=>{const y=m[0];if(y!=null&&y.variantsGateways&&e.gateway){const D=y.variantsGateways.find(I=>I.name===e.gateway&&I.overrodePrice);if(D!=null&&D.overrodePrice)return D.overrodePrice.currency}return(y==null?void 0:y.price.currency)||"USD"},[m,e.gateway]),g=new Intl.NumberFormat("en-US",{style:"currency",currency:p}),x=P.useMemo(()=>u&&!u.isFixed&&u.discount===100||u&&u.isFixed&&u.discount&&u.discount>=a.total?a.total:a.totalWithDiscount?a.total-a.totalWithDiscount:0,[a,u]),E=o?(o==null?void 0:o.fixedAmount)+Math.round((a.totalWithDiscount!==void 0?a.totalWithDiscount:a.total-x)*((o==null?void 0:o.percentage)/100)):null,_=P.useMemo(()=>{const y=e.usePriorityReplacement===!0,D=y?l==null?void 0:l.priorityReplacement:null;if(!y||!(D!=null&&D.enabled))return{label:"",amount:null};const I=a.totalWithDiscount!==void 0?a.totalWithDiscount:a.total-x,S=(D.fixedFee||0)+I*(D.feePercentage||0)/100;return{label:D.name||"Priority Replacement",amount:S}},[e.usePriorityReplacement,l,a,x]),k=P.useMemo(()=>{if(!c)return null;const y=a.totalWithDiscount!==void 0?a.totalWithDiscount:a.total-x,S=((o&&E!==null&&E!==void 0?o.isDiscount?y-E:y+E:y)+(_.amount||0))*(c.percentage/100);return c.fixedAmount+S},[c,a,x,o,E,_]);return i.jsx("div",{className:Yn.checkoutItemsContainer,children:i.jsxs("div",{className:Yn.innerContainer,children:[i.jsx(xa,{}),i.jsxs("div",{className:Yn.headerSection,children:[i.jsx("header",{className:Yn.header,children:i.jsx("h1",{id:"h3",children:"Checkout"})}),i.jsx("div",{className:Yn.productsContainer,children:m.map(y=>i.jsx(Ca,{product:y},y.id))}),i.jsx("div",{className:Yn.couponContainer,children:i.jsx(z9,{applyCoupon:n,applyCouponPending:r,couponData:u,discount:g.format(x),removeCoupon:s,gateway:e.gateway})}),i.jsx(Nr,{formatter:g,coupon:u,total:a.total,discount:x,totalWithDiscount:a.totalWithDiscount,feeOrDiscount:h?null:E,serviceFeeAmount:h?null:k,replacementLabel:_.amount?_.label:"",replacementAmount:h?null:_.amount})]}),i.jsx("div",{className:Yn.checkoutFooter,children:i.jsx(zn,{})})]})})},q9="_checkoutOperational_6gta6_1",Z9="_innerContainer_6gta6_16",W9="_innerContainerAntistock_6gta6_26",Y9="_paymentMethodsSectionAntistock_6gta6_38",G9="_continueButtonAntistock_6gta6_48",X9="_checkoutFooterAntistock_6gta6_58",K9="_antistock_6gta6_69",Q9="_checkoutOperationalAntistock_6gta6_74",J9="_loginSection_6gta6_85",eg="_paymentMethodsSection_6gta6_38",tg="_socialConnectSection_6gta6_96",ng="_socialConnectLabel_6gta6_99",rg="_socialConnectContent_6gta6_103",ug="_continueButton_6gta6_48",ag="_button_6gta6_111",sg="_checkoutFooter_6gta6_58",ht={checkoutOperational:q9,innerContainer:Z9,innerContainerAntistock:W9,paymentMethodsSectionAntistock:Y9,continueButtonAntistock:G9,checkoutFooterAntistock:X9,antistock:K9,checkoutOperationalAntistock:Q9,loginSection:J9,paymentMethodsSection:eg,socialConnectSection:tg,socialConnectLabel:ng,socialConnectContent:rg,continueButton:ug,button:ag,checkoutFooter:sg},ig="_customFields_uhcib_2",og="_checkboxWrapper_uhcib_9",cg="_textareaWrapper_uhcib_16",lg="_inputWrapper_uhcib_17",dg="_requiredStar_uhcib_27",pr={customFields:ig,checkboxWrapper:og,textareaWrapper:cg,inputWrapper:lg,requiredStar:dg},b0=({customFields:e,setCustomFields:t})=>{if(e.length===0)return null;const n=e.map(r=>i.jsx(_0,{customField:r,setCustomFields:t},r.name));return i.jsx("div",{className:pr.customFields,children:n})},_0=({customField:e,setCustomFields:t})=>{const n=r=>{t(u=>u.map(a=>a.name===e.name?{...a,value:r}:a))};return i.jsx(fg,{value:e.value??"",placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:n,label:e.name,regex:e.regex})},fg=({label:e,type:t,defaultValue:n,value:r,placeholder:u,regex:a,required:s,onValueChange:o})=>{if(P.useEffect(()=>{r===""&&n!==void 0&&o(String(n))},[]),t===Mn.Checkbox)return i.jsxs("label",{className:pr.checkboxWrapper,children:[i.jsx(v.CheckboxSettings,{value:r==="true",onChange:l=>o(l?"true":"false")}),i.jsxs("p",{className:pr.checkboxLabel,children:[e,s&&i.jsx("span",{className:pr.requiredStar,children:"*"})]})]});if(t===Mn.Hidden)return i.jsx("input",{type:"hidden",value:String(n??""),required:s});const c=l=>{let h;if(t===Mn.Number)h=/^\d*$/;else if(a)try{h=new RegExp(a)}catch(f){console.error("Invalid regex pattern:",a,f),h=/.*/}else h=/.*/;h.test(l)&&o(l)};return t===Mn.Textarea?i.jsx("div",{className:pr.textareaWrapper,children:i.jsx(v.Textarea,{label:e,value:r,placeholder:u,onChange:c,required:s})}):i.jsx("div",{className:pr.inputWrapper,children:i.jsx(v.Input,{type:t===Mn.Number?"number":"text",placeholder:t===Mn.Number?"Type something number...":u,label:e,value:r,required:s,onChange:c})})},hg="_connectedContainer_1rxr8_1",pg="_userInfo_1rxr8_10",mg="_avatar_1rxr8_16",gg="_avatarImage_1rxr8_26",Ru={connectedContainer:hg,userInfo:pg,avatar:mg,avatarImage:gg},x0=({customerEmail:e})=>{const{discordInfo:t,setDiscordInfo:n}=b.useDiscordStore(),{notifications:r,setNotifications:u}=b.useNotificationStore(),[a,s]=P.useState(!1),[o,c]=P.useState(0),[l,h]=P.useState(null),f=20,m=x=>{var E,_,k,y;return(_=(E=x==null?void 0:x.response)==null?void 0:E.data)!=null&&_.error?x.response.data.error:(y=(k=x==null?void 0:x.response)==null?void 0:k.data)!=null&&y.message?x.response.data.message:x!=null&&x.message?x.message:"Failed to connect to Discord. Please try again later."},p=(x,E)=>{u([...r,{id:b.v4(),message:x,status:E}])};P.useEffect(()=>{if(l&&a){const x=setInterval(()=>{l.closed&&(clearInterval(x),s(!1),h(null))},1e3);return()=>clearInterval(x)}},[l,a]);const g=()=>{e.trim()!==""&&(s(!0),c(0),B2({customerEmail:e,tsId:b.useGetTsId()}).then(({data:x})=>{const E=window.open(x.redirectUrl);h(E),(!E||E.closed||typeof E.closed>"u")&&setTimeout(()=>{const y=document.createElement("a");y.href=x.redirectUrl,y.target="_blank",y.click()});let _;const k=()=>{if(c(y=>y+1),o>=f||E&&E.closed){o>=f&&p("Authorization timeout. Please try again.","error"),s(!1),clearTimeout(_);return}j2({id:x.id,customerEmail:e}).then(({data:y})=>{n({authorized:!0,id:x.id,avatar:y.avatar,username:y.username}),E&&E.close(),s(!1),h(null),p("Discord successfully connected!","success"),clearTimeout(_)}).catch(y=>{var D;if(console.log("Waiting for authorization...",y,{newWindow:E}),E&&E.closed){s(!1),clearTimeout(_);return}if((D=y==null?void 0:y.response)!=null&&D.status&&y.response.status!==404&&y.response.status>=400){p(m(y),"error"),s(!1),clearTimeout(_);return}clearTimeout(_),_=setTimeout(k,1500)})};k()}).catch(x=>{console.log("Could not initiate Discord authorization",x),p(m(x),"error"),s(!1)}))};return t!=null&&t.authorized?i.jsxs("div",{className:Ru.connectedContainer,children:[i.jsxs("div",{className:Ru.userInfo,children:[i.jsx("div",{className:Ru.avatar,children:t.avatar?i.jsx("img",{className:Ru.avatarImage,src:`https://cdn.discordapp.com/avatars/${t.id}/${t.avatar}.png?size=256`}):i.jsx(v.Icon,{name:"UserCircle"})}),i.jsx("p",{children:t.username}),i.jsx(S8,{})]}),i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Reconnect"})]}):i.jsx(v.Button,{type:"Secondary",onClick:g,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},disabled:a,children:a?i.jsx(v.Loader,{}):i.jsxs(i.Fragment,{children:[i.jsx(v.Icon,{name:"DiscordLogo"}),i.jsx(Jc,{children:"Connect Your Discord"})]})})},bg="_paymentMethodsContainer_1pfqr_2",_g="_antistock_1pfqr_15",vo={paymentMethodsContainer:bg,antistock:_g},xg="_paymentMethod_1it0n_3",Cg="_selected_1it0n_16",Eg="_alignColumn_1it0n_19",yg="_reversed_1it0n_25",Tg="_antistock_1it0n_29",kg="_paymentText_1it0n_36",Ag="_balanceText_1it0n_50",Sg="_signInLink_1it0n_54",Ig="_iconContainer_1it0n_63",Ng="_gatewayLogo_1it0n_76",vg="_poweredByLogo_1it0n_77",wg="_logo_1it0n_82",ve={paymentMethod:xg,selected:Cg,alignColumn:Eg,reversed:yg,antistock:Tg,paymentText:kg,balanceText:Ag,signInLink:Sg,iconContainer:Ig,gatewayLogo:Ng,poweredByLogo:vg,logo:wg},Dg="_bottomSheet_1x8kc_1",Lg="_content_1x8kc_8",Pg="_description_1x8kc_11",Rg="_title_1x8kc_15",Og="_buttonGroup_1x8kc_19",Mg="_buttonWrapper_1x8kc_29",Fg="_fullWidthButton_1x8kc_32",Bg="_modal_1x8kc_36",jg="_header_1x8kc_43",En={bottomSheet:Dg,content:Lg,description:Pg,title:Rg,buttonGroup:Og,buttonWrapper:Mg,fullWidthButton:Fg,modal:Bg,header:jg},Hg=({setIsOpen:e,balance:t})=>{const n=b.useNavigate(),{setIsOpen:r}=b.useModalStore(),u=()=>{n("/top-up?redirectRoute=checkout")};function a(){r(!1),setTimeout(()=>{e(!1)},300)}return i.jsxs("div",{className:En.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:En.header,children:[i.jsx("h3",{id:"h3",className:En.title,children:"Insufficient Customer Balance"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:En.bottomSheet,children:[i.jsx("div",{className:En.content,children:i.jsxs("p",{className:En.description,children:["You currently have ",t&&b.formatPrice(t)," in your balance. After topping up the required amount, you can continue to checkout."]})}),i.jsxs("div",{className:En.buttonGroup,children:[i.jsx("div",{className:En.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),i.jsx("div",{className:En.fullWidthButton,children:i.jsx(v.Button,{type:"Primary",onClick:u,children:"Add Balance"})})]})]})]})},ci=({align:e,gateway:t,gatewayDisplayName:n,selected:r,onSelect:u,total:a,onSignInClick:s,reversed:o,isAntistock:c=!1})=>{const{token:l}=b.useStorefrontStore(),{balance:h}=b.useCustomerDashboardStore(),[f,m]=P.useState(!1),{setIsOpen:p}=b.useModalStore(),g=x=>{x.stopPropagation(),u==null||u(t),h&&h.amount<a&&(m(!0),p(!0))};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:b.clx(ve.paymentMethod,{[ve.selected]:r,[ve.alignColumn]:e==="column",[ve.reversed]:o&&!c,[ve.antistock]:c}),onClick:g,children:c?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:ve.paymentText,id:"md",children:[n," ",i.jsxs("span",{className:ve.balanceText,id:"md",children:["(",l?h&&b.formatPrice(h):i.jsx("a",{className:ve.signInLink,onClick:s,id:"md",children:"Sign in"}),")"]})]}),i.jsx("div",{className:ve.iconContainer,children:i.jsx(v.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:ve.paymentText,id:"md",children:[n," ",i.jsxs("span",{className:ve.balanceText,id:"md",children:["(",l?h&&b.formatPrice(h):i.jsx("a",{className:ve.signInLink,onClick:s,id:"md",children:"Sign in"}),")"]})]}),i.jsx("div",{className:ve.iconContainer,children:i.jsx(v.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]})}),f&&i.jsx(v.Modal,{close:()=>m(!1),children:i.jsx(Hg,{setIsOpen:m,balance:h})})]})};var We=(e=>(e.BankCard="BANK_CARD",e.BankTransfer="BANK_TRANSFER",e.PayPal="PAYPAL",e.CashApp="CASHAPP",e.Crypto="CRYPTO",e.AppleGooglePay="APPLE_AND_GOOGLE_PAY",e.Custom="CUSTOM",e))(We||{});const Ug={[We.CashApp]:i.jsx($l,{}),[We.AppleGooglePay]:i.jsx(ql,{}),[We.BankCard]:i.jsx(Vl,{}),[We.Crypto]:i.jsx(Hl,{}),[We.PayPal]:i.jsx(zl,{}),[We.Custom]:i.jsx("div",{}),[We.BankTransfer]:i.jsx(Zl,{})},Vg={[We.CashApp]:i.jsx($l,{isAntistock:!0}),[We.AppleGooglePay]:i.jsx(ql,{isAntistock:!0}),[We.BankCard]:i.jsx(Vl,{isAntistock:!0}),[We.Crypto]:i.jsx(Hl,{isAntistock:!0}),[We.PayPal]:i.jsx(zl,{isAntistock:!0}),[We.Custom]:i.jsx("div",{}),[We.BankTransfer]:i.jsx(Zl,{isAntistock:!0})},wo={[We.CashApp]:"Cash App",[We.AppleGooglePay]:"Apple Pay / Google Pay",[We.BankCard]:"Debit / Credit Card",[We.Crypto]:"Cryptocurrency",[We.PayPal]:"PayPal",[We.Custom]:"",[We.BankTransfer]:"Bank Transfer"},li=({align:e,paymentMethod:t,gatewayDisplayName:n,gatewayLogoCfId:r,poweredByLogoCfId:u,selected:a,onSelect:s,className:o,isAntistock:c=!1})=>{const l=t===We.Custom;return t?i.jsx("div",{className:b.clx(ve.paymentMethod,{[ve.selected]:a,[ve.alignColumn]:e==="column",[ve.antistock]:c},o),onClick:()=>s&&s(t),children:c?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:ve.paymentText,id:"md",children:l?n:wo[t]}),i.jsxs("div",{className:ve.iconContainer,children:[l?i.jsx("div",{className:ve.gatewayLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(r,"100"),alt:n})}):Vg[t],u&&i.jsx("div",{className:ve.poweredByLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(u,"100"),alt:n})})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:ve.paymentText,id:"md",children:l?n:wo[t]}),i.jsxs("div",{className:ve.iconContainer,children:[l?i.jsx("div",{className:ve.gatewayLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(r,"100"),alt:n})}):Ug[t],u&&i.jsx("div",{className:ve.poweredByLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(u,"100"),alt:n})})]})]})}):i.jsxs("div",{className:b.clx(ve.paymentMethod,o),children:[i.jsx("div",{className:ve.gatewayLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(r,"100"),alt:n})}),i.jsx("p",{className:ve.paymentText,children:n})]})},di=({possibleGateways:e,setGateway:t,totalAndDiscount:n,onSignInClick:r,setPaymentMethod:u,isAntistock:a=!1,hideBalance:s=!1})=>{const[o,c]=P.useState(),[l,h]=P.useState(),{setPriceAdjustment:f,setServiceFee:m}=b.useCartStore(),[p,g]=P.useState(null),x=P.useMemo(()=>p?s?p.filter(k=>k.name!=="Balance"):p:null,[p,s]),E=k=>{t(k);const y=p==null?void 0:p.find(D=>D.name===k);f((y==null?void 0:y.priceAdjustment)||null),m((y==null?void 0:y.serviceFee)||null)},_=(k,y)=>{l!==y&&E(y),u(k),c(k),h(y)};return P.useEffect(()=>{if(x&&x.length>0){const k=x[0];if(k.name==="Balance")h(k.name),t(k.name),f(k.priceAdjustment||null),m(k.serviceFee||null);else if(k.paymentMethods&&k.paymentMethods.length>0){const y=k.paymentMethods[0];c(y),h(k.name),t(k.name),u(y),f(k.priceAdjustment||null),m(k.serviceFee||null)}}},[x]),P.useEffect(()=>{const k=async()=>{const{data:y}=await el([...e.availableGateways,...e.requiresSignInGateways]),D=Array.isArray(y)?y:y.gateways;g(D)};(e.availableGateways.length||e.requiresSignInGateways.length)&&k()},[]),P.useLayoutEffect(()=>{f(null),m(null)},[]),i.jsxs(i.Fragment,{children:[x&&i.jsx("div",{className:b.clx(vo.paymentMethodsContainer,{[vo.antistock]:a}),children:x==null?void 0:x.map(k=>k.name==="Balance"?i.jsx(ci,{gateway:k.name,gatewayDisplayName:k.displayName,onSelect:y=>{h(y),l!==y&&E(y)},selected:k.name===l,total:n.totalWithDiscount??0,onSignInClick:r,reversed:!0,isAntistock:a},k.name):k.paymentMethods.map(y=>i.jsx(li,{paymentMethod:y,gateway:k.name,gatewayDisplayName:k.displayName,gatewayLogoCfId:k.logoCfImageId,poweredByLogoCfId:k.poweredByImageCfImageId,onSelect:D=>_(D,k.name),selected:o===y&&l===k.name,isAntistock:a},`${k.name}-${y}`)))}),!p&&(a?i.jsx(v.Loader,{}):i.jsx(ar,{speed:2,width:"100%",height:"220px",viewBox:"0 0 600 220",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",style:{borderRadius:"var(--border-radius)"},children:i.jsx("rect",{x:"0",y:"0",rx:"5",ry:"5",width:"100%",height:"100%"})}))]})},$g="_modal_1htd8_1",zg={modal:$g},C0=({setIsOpen:e})=>{const{token:t}=b.useStorefrontStore(),{setIsOpen:n}=b.useModalStore();P.useEffect(()=>{t&&r()},[t]);const r=()=>{n(!1),setTimeout(()=>{e(!1)},300)};return i.jsx("div",{className:zg.modal,onClick:u=>u.stopPropagation(),children:i.jsx(ma,{inModal:!0})})},qg="_container_r8mpd_1",Zg="_text_r8mpd_9",Wg="_link_r8mpd_14",Br={container:qg,text:Zg,link:Wg};function Do(e){const t=[],n=String(e||"");let r=n.indexOf(","),u=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(u,r).trim();(s||!a)&&t.push(s),u=r+1,r=n.indexOf(",",u)}return t}function E0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yg=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gg=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xg={};function Lo(e,t){return(Xg.jsx?Gg:Yg).test(e)}const Kg=/[ \t\n\f\r]/g;function Qg(e){return typeof e=="object"?e.type==="text"?Po(e.value):!1:Po(e)}function Po(e){return e.replace(Kg,"")===""}let bu=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};bu.prototype.normal={};bu.prototype.property={};bu.prototype.space=void 0;function y0(e,t){const n={},r={};for(const u of e)Object.assign(n,u.property),Object.assign(r,u.normal);return new bu(n,r,t)}function su(e){return e.toLowerCase()}let Pt=class{constructor(t,n){this.attribute=n,this.property=t}};Pt.prototype.attribute="";Pt.prototype.booleanish=!1;Pt.prototype.boolean=!1;Pt.prototype.commaOrSpaceSeparated=!1;Pt.prototype.commaSeparated=!1;Pt.prototype.defined=!1;Pt.prototype.mustUseProperty=!1;Pt.prototype.number=!1;Pt.prototype.overloadedBoolean=!1;Pt.prototype.property="";Pt.prototype.spaceSeparated=!1;Pt.prototype.space=void 0;let Jg=0;const be=sr(),Je=sr(),T0=sr(),z=sr(),Be=sr(),xr=sr(),Ft=sr();function sr(){return 2**++Jg}const Ls=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:Je,commaOrSpaceSeparated:Ft,commaSeparated:xr,number:z,overloadedBoolean:T0,spaceSeparated:Be},Symbol.toStringTag,{value:"Module"})),Qa=Object.keys(Ls);let fi=class extends Pt{constructor(t,n,r,u){let a=-1;if(super(t,n),Ro(this,"space",u),typeof r=="number")for(;++a<Qa.length;){const s=Qa[a];Ro(this,Qa[a],(r&Ls[s])===Ls[s])}}};fi.prototype.defined=!0;function Ro(e,t,n){n&&(e[t]=n)}function vr(e){const t={},n={};for(const[r,u]of Object.entries(e.properties)){const a=new fi(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[su(r)]=r,n[su(a.attribute)]=r}return new bu(t,n,e.space)}const k0=vr({properties:{ariaActiveDescendant:null,ariaAtomic:Je,ariaAutoComplete:null,ariaBusy:Je,ariaChecked:Je,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:Be,ariaCurrent:null,ariaDescribedBy:Be,ariaDetails:null,ariaDisabled:Je,ariaDropEffect:Be,ariaErrorMessage:null,ariaExpanded:Je,ariaFlowTo:Be,ariaGrabbed:Je,ariaHasPopup:null,ariaHidden:Je,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Be,ariaLevel:z,ariaLive:null,ariaModal:Je,ariaMultiLine:Je,ariaMultiSelectable:Je,ariaOrientation:null,ariaOwns:Be,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Je,ariaReadOnly:Je,ariaRelevant:null,ariaRequired:Je,ariaRoleDescription:Be,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Je,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function A0(e,t){return t in e?e[t]:t}function S0(e,t){return A0(e,t.toLowerCase())}const eb=vr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xr,acceptCharset:Be,accessKey:Be,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Be,autoFocus:be,autoPlay:be,blocking:Be,capture:null,charSet:null,checked:be,cite:null,className:Be,cols:z,colSpan:null,content:null,contentEditable:Je,controls:be,controlsList:Be,coords:z|xr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:T0,draggable:Je,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Be,height:z,hidden:be,high:z,href:null,hrefLang:null,htmlFor:Be,httpEquiv:Be,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Be,itemRef:Be,itemScope:be,itemType:Be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:be,optimum:z,pattern:null,ping:Be,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Be,required:be,reversed:be,rows:z,rowSpan:z,sandbox:Be,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Je,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:Je,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Be,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Je,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:S0}),tb=vr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ft,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:Be,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xr,g2:xr,glyphName:xr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:Ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ft,rev:Ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ft,requiredFeatures:Ft,requiredFonts:Ft,requiredFormats:Ft,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:Ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ft,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A0}),I0=vr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),N0=vr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:S0}),v0=vr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),nb={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},rb=/[A-Z]/g,Oo=/-[a-z]/g,ub=/^data[-\w.:]+$/i;function hi(e,t){const n=su(t);let r=t,u=Pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ub.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Oo,sb);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Oo.test(a)){let s=a.replace(rb,ab);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}u=fi}return new u(r,t)}function ab(e){return"-"+e.toLowerCase()}function sb(e){return e.charAt(1).toUpperCase()}const Ea=y0([k0,eb,I0,N0,v0],"html"),wr=y0([k0,tb,I0,N0,v0],"svg");function Mo(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function w0(e){return e.join(" ").trim()}var D0={},Fo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ib=/\n/g,ob=/^\s*/,cb=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,lb=/^:\s*/,db=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,fb=/^[;\s]*/,hb=/^\s+|\s+$/g,pb=`
79
+ `),O=new Blob([S],{type:"text/plain"}),Z=URL.createObjectURL(O),H=document.createElement("a");H.href=Z,H.download=`replacement-request-${e.id}.txt`,document.body.appendChild(H),H.click(),document.body.removeChild(H),URL.revokeObjectURL(Z)},k=S=>{switch(S){case le.PENDING:case le.PROCESSING:return we.statusPending;case le.APPROVED:case le.AUTO_APPROVED:case le.COMPLETED:return we.statusApproved;case le.DECLINED:case le.FAILED:return we.statusDeclined;case le.CANCELLED:case le.EXPIRED:return we.statusCancelled;default:return we.statusPending}},y=S=>{switch(S){case le.PENDING:case le.PROCESSING:return"In Progress";case le.APPROVED:case le.AUTO_APPROVED:case le.COMPLETED:return"Approved";case le.DECLINED:return"Denied";case le.FAILED:return"Failed";case le.CANCELLED:case le.EXPIRED:return"Cancelled";default:return"In Progress"}};return i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:we.replacementRequestItem,onClick:S=>{S.stopPropagation(),g()},children:[i.jsxs("div",{className:we.replacementRequestHeader,children:[i.jsxs("span",{className:we.replacementRequestId,children:["ID: ",e.id]}),i.jsx("span",{className:b.clx(we.statusBadge,k(e.status)),children:y(e.status)})]}),i.jsxs("div",{className:we.replacementRequestDescription,children:[(e.status===le.PENDING||e.status===le.PROCESSING)&&"We're currently investigating your replacement. It may take a minimum of 24-48 hours for our team to get back to you.",(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&"We've approved your replacement request. Your replaced products are attached to this section.",e.status===le.DECLINED&&"We've denied your replacement request. You will not be able to request a replacement for these products in the future.",(e.status===le.CANCELLED||e.status===le.EXPIRED)&&"Your replacement request has been cancelled."]})]}),u&&i.jsx(v.Modal,{close:()=>a(!1),withAnimation:!f,children:i.jsxs("div",{className:b.clx(we.replacementModal,{[we.replacementModalAntistock]:f}),onClick:S=>S.stopPropagation(),children:[i.jsxs("div",{className:we.replacementModalHeader,children:[i.jsx("h3",{id:"h3",children:"Replacement Request"}),i.jsx("button",{className:we.closeButton,onClick:()=>a(!1),children:i.jsx(v.Icon,{name:"X"})})]}),i.jsxs("div",{className:we.replacementModalContent,children:[i.jsxs("div",{className:we.statusSection,children:[i.jsx("span",{className:b.clx(we.statusBadge,k(e.status)),children:y(e.status)}),i.jsxs("h4",{className:we.statusTitle,children:[(e.status===le.PENDING||e.status===le.PROCESSING)&&"Your Replacement Is In Progress",(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&"Your Replacement Was Approved",e.status===le.DECLINED&&"Your Replacement Was Denied",e.status===le.FAILED&&"Your Replacement Was Failed",(e.status===le.CANCELLED||e.status===le.EXPIRED)&&"Your Replacement Was Cancelled"]}),i.jsxs("p",{className:we.statusDescription,children:[(e.status===le.PENDING||e.status===le.PROCESSING)&&"We're currently investigating your request. It may take a minimum of 24-48 hours for our team to get back to you.",(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&"We've approved your replacement request. Your replaced products are attached below.",e.status===le.DECLINED&&"We've denied your replacement request. You will not be able to request a replacement for these products in the future.",e.status===le.FAILED&&"We've failed your replacement request. You will not be able to request a replacement for these products in the future.",(e.status===le.CANCELLED||e.status===le.EXPIRED)&&"Your replacement request has been cancelled."]})]}),(e.status===le.APPROVED||e.status===le.AUTO_APPROVED||e.status===le.COMPLETED)&&i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:we.productsSection,children:[i.jsxs("div",{className:we.actionButtons,children:[i.jsxs(v.Button,{type:"Secondary",onClick:E,style:{display:"flex",alignItems:"center",gap:"5px",height:"32px"},children:[i.jsx(v.Icon,{name:"Copy"}),"Copy"]}),i.jsxs(v.Button,{type:"Secondary",onClick:_,style:{display:"flex",alignItems:"center",gap:"5px",height:"32px"},children:[i.jsx(v.Icon,{name:"ArrowLineDown"}),"Download"]})]}),i.jsx("div",{className:we.productsList,children:(D=e.replacementItems)==null?void 0:D.map((S,O)=>i.jsx("div",{className:we.productItem,children:i.jsx("span",{children:S.replacementSerialKey})},O))})]}),i.jsxs("div",{className:we.previouslyDeliveredSection,children:[i.jsxs("div",{className:we.previouslyDeliveredHeader,onClick:()=>l(!c),children:[i.jsx("span",{className:we.previouslyDeliveredTitle,children:"Previously Delivered Products"}),i.jsx(v.Icon,{name:"CaretDown",width:16,height:16,fill:"var(--text-secondary)",className:b.clx(we.caretIcon,{[we.caretIconRotated]:c})})]}),c&&i.jsx("div",{className:we.previouslyDeliveredContent,children:((I=e.replacementItems)==null?void 0:I.map((S,O)=>i.jsx("div",{className:we.previouslyDeliveredProductItem,children:i.jsx("span",{children:S.originalSerialKey})},O)))||i.jsx("div",{className:we.noProducts,children:"No products found"})})]})]})]}),i.jsx("div",{className:we.replacementModalFooter,children:e.status===le.PENDING&&i.jsx(v.Button,{type:"Secondary",onClick:x,disabled:s,style:{width:"fit-content",margin:"0 auto 8px"},children:s?"CANCELLING...":"CANCEL REPLACEMENT REQUEST"})})]})})]})},g9="_replacementModal_1f8b8_1",b9="_replacementModalAntistock_1f8b8_12",_9="_replacementModalHeader_1f8b8_17",x9="_title_1f8b8_25",C9="_closeButton_1f8b8_32",E9="_replacementModalContent_1f8b8_46",y9="_bottomSheet_1f8b8_53",T9="_content_1f8b8_61",k9="_productReplaceContainer_1f8b8_65",A9="_scrollableBox_1f8b8_76",S9="_searchContainer_1f8b8_90",I9="_productItem_1f8b8_94",N9="_productItemError_1f8b8_125",v9="_scrollIndicator_1f8b8_129",w9="_noResults_1f8b8_138",D9="_replacementForm_1f8b8_148",L9="_formField_1f8b8_155",P9="_replacementModalFooter_1f8b8_355",R9="_fieldError_1f8b8_361",O9="_requestButton_1f8b8_367",qe={replacementModal:g9,replacementModalAntistock:b9,replacementModalHeader:_9,title:x9,closeButton:C9,replacementModalContent:E9,bottomSheet:y9,content:T9,productReplaceContainer:k9,scrollableBox:A9,searchContainer:S9,productItem:I9,productItemError:N9,scrollIndicator:v9,noResults:w9,replacementForm:D9,formField:L9,replacementModalFooter:P9,fieldError:R9,requestButton:O9},M9=({isOpen:e,onClose:t,product:n,orderId:r,accessToken:u,onSuccess:a,allowedReplacementReasons:s})=>{const{isAntistock:o}=b.useGeneralStore(),{setNotifications:c,notifications:l}=b.useNotificationStore(),[h,f]=P.useState(null),[m,p]=P.useState((s==null?void 0:s[0])||""),[g,x]=P.useState(""),[E,_]=P.useState(""),[k,y]=P.useState([]),[D,I]=P.useState(!1),[S,O]=P.useState({}),Z=P.useRef(null),H=P.useRef(null),L=P.useRef(null),j=P.useMemo(()=>{var C;return((C=n.deliveryCategories)==null?void 0:C.filter(U=>U.type==="SERIALS").flatMap(U=>U.deliveryItems))||[]},[n.deliveryCategories]),B=P.useMemo(()=>n.replacementRequests?new Set(n.replacementRequests.flatMap(C=>C.replacementItems||[]).map(C=>C.originalSerialKey)):new Set,[n.replacementRequests]),K=P.useMemo(()=>j.filter(C=>!B.has(C.serialKey)),[j,B]),Y=P.useMemo(()=>new Xc.Fuse(K,{keys:["serialKey"],threshold:.4}),[K]),X=P.useMemo(()=>E.trim()?Y.search(E).map(C=>C.item):K,[E,Y,K]),ue=C=>{y(U=>U.includes(C)?U.filter(ne=>ne!==C):[...U,C]),S.selectedItems&&O(U=>({...U,selectedItems:void 0}))},he=()=>{y([]),f(null),p((s==null?void 0:s[0])||""),x(""),_(""),O({})},De=()=>{he(),t()},Te=async()=>{var U,ne,N,ee;O({});const C={};if(k.length===0&&(C.selectedItems="Please select at least one item to replace"),(!h||h.length===0)&&(C.images="Please add at least one image"),m.trim()||(C.reason="Please select a reason for replacement"),Object.keys(C).length>0){O(C),setTimeout(()=>{C.selectedItems&&Z.current?Z.current.scrollIntoView({behavior:"smooth",block:"center"}):C.images&&H.current?H.current.scrollIntoView({behavior:"smooth",block:"center"}):C.reason&&L.current&&L.current.scrollIntoView({behavior:"smooth",block:"center"})},100);return}if(!r||!u){c([...l,{id:b.v4(),message:"Missing order information",status:"error"}]);return}I(!0);try{if(!n.partOrderId){c([...l,{id:b.v4(),message:"Part order ID is required",status:"error"}]);return}const te=await m2(r,u,{partOrderId:n.partOrderId,deliveryItemIds:k,imageIds:(h==null?void 0:h.map(J=>J.id))||[],reason:m,message:g});c([...l,{id:b.v4(),message:((U=te.data)==null?void 0:U.message)||"Replacement request submitted successfully",status:"success"}]),(ne=te.data)!=null&&ne.id&&((N=te.data)!=null&&N.status)&&(a==null||a({id:te.data.id,status:te.data.status})),De()}catch(te){console.log({error:te});let J="Failed to submit replacement request",ce="";const oe=te;if((ee=oe==null?void 0:oe.response)!=null&&ee.data){const ae=oe.response.data;ae.message&&ae.errors&&Array.isArray(ae.errors)?(ce=ae.message,J=ae.errors.join(", ")):ae.errors&&Array.isArray(ae.errors)?J=ae.errors.join(", "):ae.message&&(J=ae.message)}else te instanceof Error&&(J=te.message);c([...l,{id:b.v4(),message:J,status:"error",label:ce}])}finally{I(!1)}};return!e||K.length===0?null:i.jsx(v.Modal,{close:De,withAnimation:!o,children:i.jsxs("div",{className:b.clx(qe.replacementModal,{[qe.replacementModalAntistock]:o}),onClick:C=>C.stopPropagation(),children:[i.jsxs("div",{className:qe.replacementModalHeader,children:[i.jsx("h3",{id:"h3 ",className:qe.title,children:"Request Replacement"}),i.jsx("button",{className:qe.closeButton,onClick:De,children:i.jsx(v.Icon,{name:"X"})})]}),i.jsx("div",{className:qe.replacementModalContent,children:i.jsx("div",{className:qe.bottomSheet,children:i.jsxs("div",{className:qe.content,children:[i.jsx(v.Tip,{type:"info",message:"Info: Based on your replacement policy, it may take up to 24-48 hours for our team to review your request.",showCloseButton:!1,style:{marginBottom:"16px"}}),i.jsxs("div",{className:qe.productReplaceContainer,children:[i.jsx("div",{className:qe.searchContainer,children:i.jsx(v.Input,{onChange:C=>{_(C)},isSearch:!0,value:E,placeholder:"Search for delivered stock",label:"Product Replace List *"})}),i.jsx("div",{ref:Z,className:b.clx(qe.scrollableBox,{[qe.scrollableBoxAntistock]:o}),children:X.length>0?X.map(C=>i.jsxs("div",{className:b.clx(qe.productItem,{[qe.productItemError]:S.selectedItems&&!k.includes(C.id)}),onClick:()=>ue(C.id),children:[i.jsx(v.Checkbox,{value:k.includes(C.id),onChange:()=>ue(C.id)}),i.jsx("span",{children:C.serialKey})]},C.id)):i.jsx("div",{className:qe.noResults,children:i.jsxs("p",{children:['No items found matching "',E,'"']})})}),S.selectedItems&&i.jsx("div",{className:qe.fieldError,children:S.selectedItems}),i.jsx("div",{className:qe.scrollIndicator,children:i.jsx("p",{children:"To continue with your replacement request, scroll down."})})]}),i.jsxs("div",{className:qe.replacementForm,children:[i.jsx("div",{className:qe.formField,ref:H,children:i.jsx(v.ImagesLoader,{images:h,onChange:C=>{f(C),S.images&&O(U=>({...U,images:void 0}))},multiple:!0,label:"Images",required:!0,enablePaste:e})}),i.jsx("div",{className:qe.formField,ref:L,children:i.jsx(v.Select,{options:(s==null?void 0:s.filter(C=>C!==m))||[],onChange:C=>{p(C),S.reason&&O(U=>({...U,reason:void 0}))},value:m,isSearch:!1,label:"Reason *",isMaxLength:!1,error:S.reason})}),i.jsx("div",{className:qe.formField,children:i.jsx(v.Textarea,{placeholder:"Use this space to provide our team with additional details regarding your replacement request.",onChange:x,label:"Your Message (Optional)",value:g})})]})]})})}),i.jsx("div",{className:qe.replacementModalFooter,children:i.jsx(v.Button,{type:"Primary",className:qe.requestButton,onClick:Te,disabled:D,children:D?"SUBMITTING...":"REQUEST REPLACEMENT"})})]})})},Ca=({isOrder:e,product:t,isApplicableForReplacement:n,orderId:r,accessToken:u,allowedReplacementReasons:a})=>{var E;const{shopGeneral:s}=b.useStorefrontStore(),o=t.subscriptionSettings,{cart:c}=lu(),{isAntistock:l}=b.useGeneralStore(),[h,f]=P.useState(!1),{setIsOpen:m}=b.useModalStore(),p=P.useMemo(()=>t.replacementRequests?new Set(t.replacementRequests.flatMap(_=>_.replacementItems||[]).map(_=>_.originalSerialKey)):new Set,[t.replacementRequests]),g=P.useMemo(()=>{var k;return(((k=t.deliveryCategories)==null?void 0:k.filter(y=>y.type==="SERIALS").flatMap(y=>y.deliveryItems))||[]).filter(y=>!p.has(y.serialKey)).length},[t.deliveryCategories,p]),x=()=>{m(!0),f(!0)};return i.jsxs("div",{className:`${Me.checkoutProduct} ${e?Me.isOrder:""}`,children:[i.jsxs("div",{className:Me.productDetails,children:[i.jsx("div",{className:`${Me.productImage} ${e?Me.isOrderImage:""} ${l?Me.productImageAntistock:""}`,children:t!=null&&t.image?i.jsx("img",{className:Me.image,src:b.convertCfImageIdToUrl(t.image.cfId,"100")}):i.jsx(v.Icon,{name:"Image",fill:"var(--text-secondary)"})}),i.jsx("div",{className:b.clx(Me.productInfo,{[Me.productInfoOverrodePrice]:t.variantsGateways&&c.gateway&&t.variantsGateways.some(_=>_.name===c.gateway&&_.overrodePrice)}),children:i.jsxs("div",{className:Me.productHeader,children:[i.jsx("h2",{className:Me.productName,id:"h5",children:t.name}),i.jsxs("span",{className:Me.quantityBadge,id:"md",children:[t.price.quantity,"x"]})]})}),t.chargeType==="RECURRING"&&i.jsx("p",{className:Me.productPrice,id:"md",children:o&&`${b.formatPrice(o.price)} / ${b.normalizeInterval(o.recurringIntervalDays||0)}${o.entryFee?" + "+b.formatPrice(o.entryFee):""}`}),t.chargeType==="ONE_TIME"&&i.jsx(i.Fragment,{children:t.variantsGateways&&c.gateway&&t.variantsGateways.some(_=>_.name===c.gateway&&_.overrodePrice)?i.jsxs("div",{className:Me.priceContainer,children:[i.jsx("span",{className:Me.originalPrice,id:"md",children:b.formatPrice(t.price)}),i.jsx("span",{className:Me.overridePrice,id:"md",children:b.formatPrice(((E=t.variantsGateways.find(_=>_.name===c.gateway))==null?void 0:E.overrodePrice)||t.price)})]}):i.jsx("p",{className:Me.productPrice,id:"md",children:b.formatPrice(t.price)})})]}),t.deliveryCategories&&i.jsx("div",{className:Me.deliveryCategories,children:t.deliveryCategories.map(_=>i.jsx(F7,{deliveryConfiguration:_},_.id))}),t.customerNote&&i.jsxs("div",{className:Me.customerNote,style:l?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsxs("div",{className:Me.noteHeader,children:[(s==null?void 0:s.info.logo)&&i.jsx("div",{className:Me.logoContainer,children:i.jsx("img",{src:b.convertCfImageIdToUrl(s==null?void 0:s.info.logo.cfId,"200")})}),i.jsx("p",{className:Me.shopName,id:"md",children:s==null?void 0:s.info.name})]}),i.jsx("p",{className:Me.noteContent,id:"md",children:t.customerNote})]}),t.replacementRequests&&t.replacementRequests.length===0&&n&&g>0&&i.jsx(v.Button,{type:"Secondary",className:Me.replacementButton,onClick:_=>{_.stopPropagation(),x()},children:i.jsx("p",{className:Me.replacementButtonText,children:"Request Replacement"})}),t.replacementRequests&&t.replacementRequests.length>0&&n&&i.jsxs("div",{className:Me.replacementRequests,children:[i.jsx("h4",{className:Me.replacementRequestsTitle,children:"Replacements"}),i.jsx("div",{className:Me.replacementRequestsList,children:t.replacementRequests.map(_=>i.jsx(m9,{item:_,orderId:r,accessToken:u,onCancel:()=>{}},_.id))}),g>0&&i.jsx(v.Button,{type:"Secondary",onClick:_=>{_.stopPropagation(),x()},children:i.jsx("p",{className:Me.replacementButtonText,children:"Request New Replacement"})})]}),i.jsx(M9,{isOpen:h,onClose:()=>f(!1),product:t,orderId:r,accessToken:u,allowedReplacementReasons:a})]})},F9="_coupon_dkjzv_1",B9="_couponApplied_dkjzv_7",j9="_discount_dkjzv_17",H9="_removeButton_dkjzv_23",U9="_removeButtonText_dkjzv_27",V9="_couponInput_dkjzv_31",$9="_couponInputContainer_dkjzv_37",vn={coupon:F9,couponApplied:B9,discount:j9,removeButton:H9,removeButtonText:U9,couponInput:V9,couponInputContainer:$9},z9=({applyCoupon:e,couponData:t,discount:n,removeCoupon:r,gateway:u})=>{const[a,s]=P.useState(null),[o,c]=P.useState(!1),{isAntistock:l}=b.useGeneralStore();return i.jsxs("div",{className:vn.coupon,children:[o&&i.jsx(ar,{speed:2,width:500,height:48,viewBox:"0 0 500 48",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",className:vn.skeleton,style:{borderRadius:"var(--border-radius)"},children:i.jsx("rect",{x:"0",y:"0",rx:"10",ry:"10",width:"100%",height:"48"})}),!o&&(t?i.jsxs("div",{className:vn.couponApplied,style:l?{border:"1px solid var(--border-secondary)"}:void 0,children:[i.jsx(v.Icon,{name:"Check",fill:"var(--text-success)"}),i.jsxs("p",{id:"md",style:{color:l?"var(--text-primary)":void 0},children:[a," is applied"," ",i.jsxs("span",{className:vn.discount,children:["-",n," ",!t.isFixed&&`(${t.discount}%)`]})]}),i.jsx("button",{className:vn.removeButton,onClick:r,children:i.jsx("span",{className:vn.removeButtonText,children:"Remove"})})]}):i.jsxs("div",{className:vn.couponInput,children:[i.jsxs("div",{className:vn.couponInputContainer,children:[i.jsx(v.Input,{placeholder:"Enter a discount code",value:a||"",onChange:h=>{s(h===""?null:h)}}),i.jsx(v.Button,{onClick:async()=>{c(!0),a&&await e(a),c(!1)},disabled:!u||!a,type:"Primary",children:"Apply"})]}),!l&&!u&&i.jsx(v.Tip,{type:"warning",message:"The discount is related to the method of payment. Select to enter.",id:"md"})]}))]})},g0=({cart:e,products:t,applyCoupon:n,applyCouponPending:r,coupon:u,totalAndDiscount:a,removeCoupon:s})=>{const{priceAdjustment:o,serviceFee:c,replacementConfig:l}=b.useCartStore(),[h,f]=P.useState(!1),m=P.useMemo(()=>e.parts.map(y=>{const D=t.find(S=>S.id===y.productId),I=D==null?void 0:D.variants.find(S=>S.id===y.productVariantId);return y.chargeType==="RECURRING"&&f(!0),{id:(D==null?void 0:D.id)||0,image:D==null?void 0:D.images[0],name:(()=>{const S=(D==null?void 0:D.name)||"",O=(I==null?void 0:I.name)||"";return!S&&!O?"":!O||S===O?S:S?`${S} (${O})`:O})(),description:"",price:{quantity:y.quantity,amount:(I==null?void 0:I.price.amount)||0,currency:I==null?void 0:I.price.currency},subscriptionSettings:I==null?void 0:I.subscriptionSettings,chargeType:y.chargeType,variantsGateways:I==null?void 0:I.gateways}}),[e,t]),p=P.useMemo(()=>{const y=m[0];if(y!=null&&y.variantsGateways&&e.gateway){const D=y.variantsGateways.find(I=>I.name===e.gateway&&I.overrodePrice);if(D!=null&&D.overrodePrice)return D.overrodePrice.currency}return(y==null?void 0:y.price.currency)||"USD"},[m,e.gateway]),g=new Intl.NumberFormat("en-US",{style:"currency",currency:p}),x=P.useMemo(()=>u&&!u.isFixed&&u.discount===100||u&&u.isFixed&&u.discount&&u.discount>=a.total?a.total:a.totalWithDiscount?a.total-a.totalWithDiscount:0,[a,u]),E=o?(o==null?void 0:o.fixedAmount)+Math.round((a.totalWithDiscount!==void 0?a.totalWithDiscount:a.total-x)*((o==null?void 0:o.percentage)/100)):null,_=P.useMemo(()=>{const y=e.usePriorityReplacement===!0,D=y?l==null?void 0:l.priorityReplacement:null;if(!y||!(D!=null&&D.enabled))return{label:"",amount:null};const I=a.totalWithDiscount!==void 0?a.totalWithDiscount:a.total-x,S=(D.fixedFee||0)+I*(D.feePercentage||0)/100;return{label:D.name||"Priority Replacement",amount:S}},[e.usePriorityReplacement,l,a,x]),k=P.useMemo(()=>{if(!c)return null;const y=a.totalWithDiscount!==void 0?a.totalWithDiscount:a.total-x,S=((o&&E!==null&&E!==void 0?o.isDiscount?y-E:y+E:y)+(_.amount||0))*(c.percentage/100);return c.fixedAmount+S},[c,a,x,o,E,_]);return i.jsx("div",{className:Yn.checkoutItemsContainer,children:i.jsxs("div",{className:Yn.innerContainer,children:[i.jsx(xa,{}),i.jsxs("div",{className:Yn.headerSection,children:[i.jsx("header",{className:Yn.header,children:i.jsx("h1",{id:"h3",children:"Checkout"})}),i.jsx("div",{className:Yn.productsContainer,children:m.map(y=>i.jsx(Ca,{product:y},y.id))}),i.jsx("div",{className:Yn.couponContainer,children:i.jsx(z9,{applyCoupon:n,applyCouponPending:r,couponData:u,discount:g.format(x),removeCoupon:s,gateway:e.gateway})}),i.jsx(Nr,{formatter:g,coupon:u,total:a.total,discount:x,totalWithDiscount:a.totalWithDiscount,feeOrDiscount:h?null:E,serviceFeeAmount:h?null:k,replacementLabel:_.amount?_.label:"",replacementAmount:h?null:_.amount})]}),i.jsx("div",{className:Yn.checkoutFooter,children:i.jsx(zn,{})})]})})},q9="_checkoutOperational_6gta6_1",Z9="_innerContainer_6gta6_16",W9="_innerContainerAntistock_6gta6_26",Y9="_paymentMethodsSectionAntistock_6gta6_38",G9="_continueButtonAntistock_6gta6_48",X9="_checkoutFooterAntistock_6gta6_58",K9="_antistock_6gta6_69",Q9="_checkoutOperationalAntistock_6gta6_74",J9="_loginSection_6gta6_85",eg="_paymentMethodsSection_6gta6_38",tg="_socialConnectSection_6gta6_96",ng="_socialConnectLabel_6gta6_99",rg="_socialConnectContent_6gta6_103",ug="_continueButton_6gta6_48",ag="_button_6gta6_111",sg="_checkoutFooter_6gta6_58",ht={checkoutOperational:q9,innerContainer:Z9,innerContainerAntistock:W9,paymentMethodsSectionAntistock:Y9,continueButtonAntistock:G9,checkoutFooterAntistock:X9,antistock:K9,checkoutOperationalAntistock:Q9,loginSection:J9,paymentMethodsSection:eg,socialConnectSection:tg,socialConnectLabel:ng,socialConnectContent:rg,continueButton:ug,button:ag,checkoutFooter:sg},ig="_customFields_uhcib_2",og="_checkboxWrapper_uhcib_9",cg="_textareaWrapper_uhcib_16",lg="_inputWrapper_uhcib_17",dg="_requiredStar_uhcib_27",pr={customFields:ig,checkboxWrapper:og,textareaWrapper:cg,inputWrapper:lg,requiredStar:dg},b0=({customFields:e,setCustomFields:t})=>{if(e.length===0)return null;const n=e.map(r=>i.jsx(_0,{customField:r,setCustomFields:t},r.name));return i.jsx("div",{className:pr.customFields,children:n})},_0=({customField:e,setCustomFields:t})=>{const n=r=>{t(u=>u.map(a=>a.name===e.name?{...a,value:r}:a))};return i.jsx(fg,{value:e.value??"",placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:n,label:e.name,regex:e.regex})},fg=({label:e,type:t,defaultValue:n,value:r,placeholder:u,regex:a,required:s,onValueChange:o})=>{if(P.useEffect(()=>{r===""&&n!==void 0&&o(String(n))},[]),t===Mn.Checkbox)return i.jsxs("label",{className:pr.checkboxWrapper,children:[i.jsx(v.CheckboxSettings,{value:r==="true",onChange:l=>o(l?"true":"false")}),i.jsxs("p",{className:pr.checkboxLabel,children:[e,s&&i.jsx("span",{className:pr.requiredStar,children:"*"})]})]});if(t===Mn.Hidden)return i.jsx("input",{type:"hidden",value:String(n??""),required:s});const c=l=>{let h;if(t===Mn.Number)h=/^\d*$/;else if(a)try{h=new RegExp(a)}catch(f){console.error("Invalid regex pattern:",a,f),h=/.*/}else h=/.*/;h.test(l)&&o(l)};return t===Mn.Textarea?i.jsx("div",{className:pr.textareaWrapper,children:i.jsx(v.Textarea,{label:e,value:r,placeholder:u,onChange:c,required:s})}):i.jsx("div",{className:pr.inputWrapper,children:i.jsx(v.Input,{type:t===Mn.Number?"number":"text",placeholder:t===Mn.Number?"Type something number...":u,label:e,value:r,required:s,onChange:c})})},hg="_connectedContainer_1rxr8_1",pg="_userInfo_1rxr8_10",mg="_avatar_1rxr8_16",gg="_avatarImage_1rxr8_26",Ru={connectedContainer:hg,userInfo:pg,avatar:mg,avatarImage:gg},x0=({customerEmail:e})=>{const{discordInfo:t,setDiscordInfo:n}=b.useDiscordStore(),{notifications:r,setNotifications:u}=b.useNotificationStore(),[a,s]=P.useState(!1),[o,c]=P.useState(0),[l,h]=P.useState(null),f=20,m=x=>{var E,_,k,y;return(_=(E=x==null?void 0:x.response)==null?void 0:E.data)!=null&&_.error?x.response.data.error:(y=(k=x==null?void 0:x.response)==null?void 0:k.data)!=null&&y.message?x.response.data.message:x!=null&&x.message?x.message:"Failed to connect to Discord. Please try again later."},p=(x,E)=>{u([...r,{id:b.v4(),message:x,status:E}])};P.useEffect(()=>{if(l&&a){const x=setInterval(()=>{l.closed&&(clearInterval(x),s(!1),h(null))},1e3);return()=>clearInterval(x)}},[l,a]);const g=()=>{e.trim()!==""&&(s(!0),c(0),B2({customerEmail:e,tsId:b.useGetTsId()}).then(({data:x})=>{const E=window.open(x.redirectUrl);h(E),(!E||E.closed||typeof E.closed>"u")&&setTimeout(()=>{const y=document.createElement("a");y.href=x.redirectUrl,y.target="_blank",y.click()});let _;const k=()=>{if(c(y=>y+1),o>=f||E&&E.closed){o>=f&&p("Authorization timeout. Please try again.","error"),s(!1),clearTimeout(_);return}j2({id:x.id,customerEmail:e}).then(({data:y})=>{n({authorized:!0,id:x.id,avatar:y.avatar,username:y.username}),E&&E.close(),s(!1),h(null),p("Discord successfully connected!","success"),clearTimeout(_)}).catch(y=>{var D;if(console.log("Waiting for authorization...",y,{newWindow:E}),E&&E.closed){s(!1),clearTimeout(_);return}if((D=y==null?void 0:y.response)!=null&&D.status&&y.response.status!==404&&y.response.status>=400){p(m(y),"error"),s(!1),clearTimeout(_);return}clearTimeout(_),_=setTimeout(k,1500)})};k()}).catch(x=>{console.log("Could not initiate Discord authorization",x),p(m(x),"error"),s(!1)}))};return t!=null&&t.authorized?i.jsxs("div",{className:Ru.connectedContainer,children:[i.jsxs("div",{className:Ru.userInfo,children:[i.jsx("div",{className:Ru.avatar,children:t.avatar?i.jsx("img",{className:Ru.avatarImage,src:`https://cdn.discordapp.com/avatars/${t.id}/${t.avatar}.png?size=256`}):i.jsx(v.Icon,{name:"UserCircle"})}),i.jsx("p",{children:t.username}),i.jsx(S8,{})]}),i.jsx(v.Button,{type:"Secondary",onClick:g,children:"Reconnect"})]}):i.jsx(v.Button,{type:"Secondary",onClick:g,style:{width:"100%",display:"flex",alignItems:"center",justifyContent:"center",gap:"10px"},disabled:a,children:a?i.jsx(v.Loader,{}):i.jsxs(i.Fragment,{children:[i.jsx(v.Icon,{name:"DiscordLogo"}),i.jsx(Jc,{children:"Connect Your Discord"})]})})},bg="_paymentMethodsContainer_1pfqr_2",_g="_antistock_1pfqr_15",vo={paymentMethodsContainer:bg,antistock:_g},xg="_paymentMethod_1it0n_3",Cg="_selected_1it0n_16",Eg="_alignColumn_1it0n_19",yg="_reversed_1it0n_25",Tg="_antistock_1it0n_29",kg="_paymentText_1it0n_36",Ag="_balanceText_1it0n_50",Sg="_signInLink_1it0n_54",Ig="_iconContainer_1it0n_63",Ng="_gatewayLogo_1it0n_76",vg="_poweredByLogo_1it0n_77",wg="_logo_1it0n_82",ve={paymentMethod:xg,selected:Cg,alignColumn:Eg,reversed:yg,antistock:Tg,paymentText:kg,balanceText:Ag,signInLink:Sg,iconContainer:Ig,gatewayLogo:Ng,poweredByLogo:vg,logo:wg},Dg="_bottomSheet_1x8kc_1",Lg="_content_1x8kc_8",Pg="_description_1x8kc_11",Rg="_title_1x8kc_15",Og="_buttonGroup_1x8kc_19",Mg="_buttonWrapper_1x8kc_29",Fg="_fullWidthButton_1x8kc_32",Bg="_modal_1x8kc_36",jg="_header_1x8kc_43",En={bottomSheet:Dg,content:Lg,description:Pg,title:Rg,buttonGroup:Og,buttonWrapper:Mg,fullWidthButton:Fg,modal:Bg,header:jg},Hg=({setIsOpen:e,balance:t})=>{const n=b.useNavigate(),{setIsOpen:r}=b.useModalStore(),u=()=>{n("/top-up?redirectRoute=checkout")};function a(){r(!1),setTimeout(()=>{e(!1)},300)}return i.jsxs("div",{className:En.modal,onClick:s=>s.stopPropagation(),children:[i.jsxs("div",{className:En.header,children:[i.jsx("h3",{id:"h3",className:En.title,children:"Insufficient Customer Balance"}),i.jsx(v.Icon,{name:"X",hoverable:!0,onClick:a,fill:"var(--text-primary)"})]}),i.jsxs("div",{className:En.bottomSheet,children:[i.jsx("div",{className:En.content,children:i.jsxs("p",{className:En.description,children:["You currently have ",t&&b.formatPrice(t)," in your balance. After topping up the required amount, you can continue to checkout."]})}),i.jsxs("div",{className:En.buttonGroup,children:[i.jsx("div",{className:En.buttonWrapper,children:i.jsx(v.Button,{type:"Secondary",onClick:a,children:"Cancel"})}),i.jsx("div",{className:En.fullWidthButton,children:i.jsx(v.Button,{type:"Primary",onClick:u,children:"Add Balance"})})]})]})]})},ci=({align:e,gateway:t,gatewayDisplayName:n,selected:r,onSelect:u,total:a,onSignInClick:s,reversed:o,isAntistock:c=!1})=>{const{token:l}=b.useStorefrontStore(),{balance:h}=b.useCustomerDashboardStore(),[f,m]=P.useState(!1),{setIsOpen:p}=b.useModalStore(),g=x=>{x.stopPropagation(),u==null||u(t),h&&h.amount<a&&(m(!0),p(!0))};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:b.clx(ve.paymentMethod,{[ve.selected]:r,[ve.alignColumn]:e==="column",[ve.reversed]:o&&!c,[ve.antistock]:c}),onClick:g,children:c?i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:ve.paymentText,id:"md",children:[n," ",i.jsxs("span",{className:ve.balanceText,id:"md",children:["(",l?h&&b.formatPrice(h):i.jsx("a",{className:ve.signInLink,onClick:s,id:"md",children:"Sign in"}),")"]})]}),i.jsx("div",{className:ve.iconContainer,children:i.jsx(v.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:ve.paymentText,id:"md",children:[n," ",i.jsxs("span",{className:ve.balanceText,id:"md",children:["(",l?h&&b.formatPrice(h):i.jsx("a",{className:ve.signInLink,onClick:s,id:"md",children:"Sign in"}),")"]})]}),i.jsx("div",{className:ve.iconContainer,children:i.jsx(v.Icon,{name:"Wallet",fill:"var(--text-primary)",width:20,height:20})})]})}),f&&i.jsx(v.Modal,{close:()=>m(!1),children:i.jsx(Hg,{setIsOpen:m,balance:h})})]})};var We=(e=>(e.BankCard="BANK_CARD",e.BankTransfer="BANK_TRANSFER",e.PayPal="PAYPAL",e.CashApp="CASHAPP",e.Crypto="CRYPTO",e.AppleGooglePay="APPLE_AND_GOOGLE_PAY",e.Custom="CUSTOM",e))(We||{});const Ug={[We.CashApp]:i.jsx($l,{}),[We.AppleGooglePay]:i.jsx(ql,{}),[We.BankCard]:i.jsx(Vl,{}),[We.Crypto]:i.jsx(Hl,{}),[We.PayPal]:i.jsx(zl,{}),[We.Custom]:i.jsx("div",{}),[We.BankTransfer]:i.jsx(Zl,{})},Vg={[We.CashApp]:i.jsx($l,{isAntistock:!0}),[We.AppleGooglePay]:i.jsx(ql,{isAntistock:!0}),[We.BankCard]:i.jsx(Vl,{isAntistock:!0}),[We.Crypto]:i.jsx(Hl,{isAntistock:!0}),[We.PayPal]:i.jsx(zl,{isAntistock:!0}),[We.Custom]:i.jsx("div",{}),[We.BankTransfer]:i.jsx(Zl,{isAntistock:!0})},wo={[We.CashApp]:"Cash App",[We.AppleGooglePay]:"Apple Pay / Google Pay",[We.BankCard]:"Debit / Credit Card",[We.Crypto]:"Cryptocurrency",[We.PayPal]:"PayPal",[We.Custom]:"",[We.BankTransfer]:"Bank Transfer"},li=({align:e,paymentMethod:t,gatewayDisplayName:n,gatewayLogoCfId:r,poweredByLogoCfId:u,selected:a,onSelect:s,className:o,isAntistock:c=!1})=>{const l=t===We.Custom;return t?i.jsx("div",{className:b.clx(ve.paymentMethod,{[ve.selected]:a,[ve.alignColumn]:e==="column",[ve.antistock]:c},o),onClick:()=>s&&s(t),children:c?i.jsxs(i.Fragment,{children:[i.jsx("p",{className:ve.paymentText,id:"md",children:l?n:wo[t]}),i.jsxs("div",{className:ve.iconContainer,children:[l?i.jsx("div",{className:ve.gatewayLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(r,"100"),alt:n})}):Vg[t],u&&i.jsx("div",{className:ve.poweredByLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(u,"100"),alt:n})})]})]}):i.jsxs(i.Fragment,{children:[i.jsx("p",{className:ve.paymentText,id:"md",children:l?n:wo[t]}),i.jsxs("div",{className:ve.iconContainer,children:[l?i.jsx("div",{className:ve.gatewayLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(r,"100"),alt:n})}):Ug[t],u&&i.jsx("div",{className:ve.poweredByLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(u,"100"),alt:n})})]})]})}):i.jsxs("div",{className:b.clx(ve.paymentMethod,o),children:[i.jsx("div",{className:ve.gatewayLogo,children:i.jsx("img",{className:ve.logo,src:b.convertCfImageIdToUrl(r,"100"),alt:n})}),i.jsx("p",{className:ve.paymentText,children:n})]})},di=({possibleGateways:e,setGateway:t,totalAndDiscount:n,onSignInClick:r,setPaymentMethod:u,isAntistock:a=!1,hideBalance:s=!1})=>{const[o,c]=P.useState(),[l,h]=P.useState(),{setPriceAdjustment:f,setServiceFee:m}=b.useCartStore(),[p,g]=P.useState(null),x=P.useMemo(()=>p?s?p.filter(k=>k.name!=="Balance"):p:null,[p,s]),E=k=>{t(k);const y=p==null?void 0:p.find(D=>D.name===k);f((y==null?void 0:y.priceAdjustment)||null),m((y==null?void 0:y.serviceFee)||null)},_=(k,y)=>{l!==y&&E(y),u(k),c(k),h(y)};return P.useEffect(()=>{if(x&&x.length>0){const k=x[0];if(k.name==="Balance")h(k.name),t(k.name),f(k.priceAdjustment||null),m(k.serviceFee||null);else if(k.paymentMethods&&k.paymentMethods.length>0){const y=k.paymentMethods[0];c(y),h(k.name),t(k.name),u(y),f(k.priceAdjustment||null),m(k.serviceFee||null)}}},[x]),P.useEffect(()=>{const k=async()=>{const{data:y}=await el([...e.availableGateways,...e.requiresSignInGateways]),D=Array.isArray(y)?y:y.gateways;g(D)};(e.availableGateways.length||e.requiresSignInGateways.length)&&k()},[]),P.useLayoutEffect(()=>{f(null),m(null)},[]),i.jsxs(i.Fragment,{children:[x&&i.jsx("div",{className:b.clx(vo.paymentMethodsContainer,{[vo.antistock]:a}),children:x==null?void 0:x.map(k=>k.name==="Balance"?i.jsx(ci,{gateway:k.name,gatewayDisplayName:k.displayName,onSelect:y=>{h(y),l!==y&&E(y)},selected:k.name===l,total:n.totalWithDiscount??n.total,onSignInClick:r,reversed:!0,isAntistock:a},k.name):k.paymentMethods.map(y=>i.jsx(li,{paymentMethod:y,gateway:k.name,gatewayDisplayName:k.displayName,gatewayLogoCfId:k.logoCfImageId,poweredByLogoCfId:k.poweredByImageCfImageId,onSelect:D=>_(D,k.name),selected:o===y&&l===k.name,isAntistock:a},`${k.name}-${y}`)))}),!p&&(a?i.jsx(v.Loader,{}):i.jsx(ar,{speed:2,width:"100%",height:"220px",viewBox:"0 0 600 220",backgroundColor:"var(--surface-secondary)",foregroundColor:"var(--surface-disabled)",style:{borderRadius:"var(--border-radius)"},children:i.jsx("rect",{x:"0",y:"0",rx:"5",ry:"5",width:"100%",height:"100%"})}))]})},$g="_modal_1htd8_1",zg={modal:$g},C0=({setIsOpen:e})=>{const{token:t}=b.useStorefrontStore(),{setIsOpen:n}=b.useModalStore();P.useEffect(()=>{t&&r()},[t]);const r=()=>{n(!1),setTimeout(()=>{e(!1)},300)};return i.jsx("div",{className:zg.modal,onClick:u=>u.stopPropagation(),children:i.jsx(ma,{inModal:!0})})},qg="_container_r8mpd_1",Zg="_text_r8mpd_9",Wg="_link_r8mpd_14",Br={container:qg,text:Zg,link:Wg};function Do(e){const t=[],n=String(e||"");let r=n.indexOf(","),u=0,a=!1;for(;!a;){r===-1&&(r=n.length,a=!0);const s=n.slice(u,r).trim();(s||!a)&&t.push(s),u=r+1,r=n.indexOf(",",u)}return t}function E0(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const Yg=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Gg=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,Xg={};function Lo(e,t){return(Xg.jsx?Gg:Yg).test(e)}const Kg=/[ \t\n\f\r]/g;function Qg(e){return typeof e=="object"?e.type==="text"?Po(e.value):!1:Po(e)}function Po(e){return e.replace(Kg,"")===""}let bu=class{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}};bu.prototype.normal={};bu.prototype.property={};bu.prototype.space=void 0;function y0(e,t){const n={},r={};for(const u of e)Object.assign(n,u.property),Object.assign(r,u.normal);return new bu(n,r,t)}function su(e){return e.toLowerCase()}let Pt=class{constructor(t,n){this.attribute=n,this.property=t}};Pt.prototype.attribute="";Pt.prototype.booleanish=!1;Pt.prototype.boolean=!1;Pt.prototype.commaOrSpaceSeparated=!1;Pt.prototype.commaSeparated=!1;Pt.prototype.defined=!1;Pt.prototype.mustUseProperty=!1;Pt.prototype.number=!1;Pt.prototype.overloadedBoolean=!1;Pt.prototype.property="";Pt.prototype.spaceSeparated=!1;Pt.prototype.space=void 0;let Jg=0;const be=sr(),Je=sr(),T0=sr(),z=sr(),Be=sr(),xr=sr(),Ft=sr();function sr(){return 2**++Jg}const Ls=Object.freeze(Object.defineProperty({__proto__:null,boolean:be,booleanish:Je,commaOrSpaceSeparated:Ft,commaSeparated:xr,number:z,overloadedBoolean:T0,spaceSeparated:Be},Symbol.toStringTag,{value:"Module"})),Qa=Object.keys(Ls);let fi=class extends Pt{constructor(t,n,r,u){let a=-1;if(super(t,n),Ro(this,"space",u),typeof r=="number")for(;++a<Qa.length;){const s=Qa[a];Ro(this,Qa[a],(r&Ls[s])===Ls[s])}}};fi.prototype.defined=!0;function Ro(e,t,n){n&&(e[t]=n)}function vr(e){const t={},n={};for(const[r,u]of Object.entries(e.properties)){const a=new fi(r,e.transform(e.attributes||{},r),u,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(a.mustUseProperty=!0),t[r]=a,n[su(r)]=r,n[su(a.attribute)]=r}return new bu(t,n,e.space)}const k0=vr({properties:{ariaActiveDescendant:null,ariaAtomic:Je,ariaAutoComplete:null,ariaBusy:Je,ariaChecked:Je,ariaColCount:z,ariaColIndex:z,ariaColSpan:z,ariaControls:Be,ariaCurrent:null,ariaDescribedBy:Be,ariaDetails:null,ariaDisabled:Je,ariaDropEffect:Be,ariaErrorMessage:null,ariaExpanded:Je,ariaFlowTo:Be,ariaGrabbed:Je,ariaHasPopup:null,ariaHidden:Je,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Be,ariaLevel:z,ariaLive:null,ariaModal:Je,ariaMultiLine:Je,ariaMultiSelectable:Je,ariaOrientation:null,ariaOwns:Be,ariaPlaceholder:null,ariaPosInSet:z,ariaPressed:Je,ariaReadOnly:Je,ariaRelevant:null,ariaRequired:Je,ariaRoleDescription:Be,ariaRowCount:z,ariaRowIndex:z,ariaRowSpan:z,ariaSelected:Je,ariaSetSize:z,ariaSort:null,ariaValueMax:z,ariaValueMin:z,ariaValueNow:z,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function A0(e,t){return t in e?e[t]:t}function S0(e,t){return A0(e,t.toLowerCase())}const eb=vr({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:xr,acceptCharset:Be,accessKey:Be,action:null,allow:null,allowFullScreen:be,allowPaymentRequest:be,allowUserMedia:be,alt:null,as:null,async:be,autoCapitalize:null,autoComplete:Be,autoFocus:be,autoPlay:be,blocking:Be,capture:null,charSet:null,checked:be,cite:null,className:Be,cols:z,colSpan:null,content:null,contentEditable:Je,controls:be,controlsList:Be,coords:z|xr,crossOrigin:null,data:null,dateTime:null,decoding:null,default:be,defer:be,dir:null,dirName:null,disabled:be,download:T0,draggable:Je,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:be,formTarget:null,headers:Be,height:z,hidden:be,high:z,href:null,hrefLang:null,htmlFor:Be,httpEquiv:Be,id:null,imageSizes:null,imageSrcSet:null,inert:be,inputMode:null,integrity:null,is:null,isMap:be,itemId:null,itemProp:Be,itemRef:Be,itemScope:be,itemType:Be,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:be,low:z,manifest:null,max:null,maxLength:z,media:null,method:null,min:null,minLength:z,multiple:be,muted:be,name:null,nonce:null,noModule:be,noValidate:be,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:be,optimum:z,pattern:null,ping:Be,placeholder:null,playsInline:be,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:be,referrerPolicy:null,rel:Be,required:be,reversed:be,rows:z,rowSpan:z,sandbox:Be,scope:null,scoped:be,seamless:be,selected:be,shadowRootClonable:be,shadowRootDelegatesFocus:be,shadowRootMode:null,shape:null,size:z,sizes:null,slot:null,span:z,spellCheck:Je,src:null,srcDoc:null,srcLang:null,srcSet:null,start:z,step:null,style:null,tabIndex:z,target:null,title:null,translate:null,type:null,typeMustMatch:be,useMap:null,value:Je,width:z,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Be,axis:null,background:null,bgColor:null,border:z,borderColor:null,bottomMargin:z,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:be,declare:be,event:null,face:null,frame:null,frameBorder:null,hSpace:z,leftMargin:z,link:null,longDesc:null,lowSrc:null,marginHeight:z,marginWidth:z,noResize:be,noHref:be,noShade:be,noWrap:be,object:null,profile:null,prompt:null,rev:null,rightMargin:z,rules:null,scheme:null,scrolling:Je,standby:null,summary:null,text:null,topMargin:z,valueType:null,version:null,vAlign:null,vLink:null,vSpace:z,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:be,disableRemotePlayback:be,prefix:null,property:null,results:z,security:null,unselectable:null},space:"html",transform:S0}),tb=vr({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Ft,accentHeight:z,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:z,amplitude:z,arabicForm:null,ascent:z,attributeName:null,attributeType:null,azimuth:z,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:z,by:null,calcMode:null,capHeight:z,className:Be,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:z,diffuseConstant:z,direction:null,display:null,dur:null,divisor:z,dominantBaseline:null,download:be,dx:null,dy:null,edgeMode:null,editable:null,elevation:z,enableBackground:null,end:null,event:null,exponent:z,externalResourcesRequired:null,fill:null,fillOpacity:z,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:xr,g2:xr,glyphName:xr,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:z,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:z,horizOriginX:z,horizOriginY:z,id:null,ideographic:z,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:z,k:z,k1:z,k2:z,k3:z,k4:z,kernelMatrix:Ft,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:z,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:z,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:z,overlineThickness:z,paintOrder:null,panose1:null,path:null,pathLength:z,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Be,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:z,pointsAtY:z,pointsAtZ:z,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ft,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ft,rev:Ft,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ft,requiredFeatures:Ft,requiredFonts:Ft,requiredFormats:Ft,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:z,specularExponent:z,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:z,strikethroughThickness:z,string:null,stroke:null,strokeDashArray:Ft,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:z,strokeOpacity:z,strokeWidth:null,style:null,surfaceScale:z,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ft,tabIndex:z,tableValues:null,target:null,targetX:z,targetY:z,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ft,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:z,underlineThickness:z,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:z,values:null,vAlphabetic:z,vMathematical:z,vectorEffect:null,vHanging:z,vIdeographic:z,version:null,vertAdvY:z,vertOriginX:z,vertOriginY:z,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:z,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:A0}),I0=vr({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),N0=vr({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:S0}),v0=vr({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),nb={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},rb=/[A-Z]/g,Oo=/-[a-z]/g,ub=/^data[-\w.:]+$/i;function hi(e,t){const n=su(t);let r=t,u=Pt;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&ub.test(t)){if(t.charAt(4)==="-"){const a=t.slice(5).replace(Oo,sb);r="data"+a.charAt(0).toUpperCase()+a.slice(1)}else{const a=t.slice(4);if(!Oo.test(a)){let s=a.replace(rb,ab);s.charAt(0)!=="-"&&(s="-"+s),t="data"+s}}u=fi}return new u(r,t)}function ab(e){return"-"+e.toLowerCase()}function sb(e){return e.charAt(1).toUpperCase()}const Ea=y0([k0,eb,I0,N0,v0],"html"),wr=y0([k0,tb,I0,N0,v0],"svg");function Mo(e){const t=String(e||"").trim();return t?t.split(/[ \t\n\r\f]+/g):[]}function w0(e){return e.join(" ").trim()}var D0={},Fo=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,ib=/\n/g,ob=/^\s*/,cb=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,lb=/^:\s*/,db=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,fb=/^[;\s]*/,hb=/^\s+|\s+$/g,pb=`
80
80
  `,Bo="/",jo="*",Qn="",mb="comment",gb="declaration",bb=function(e,t){if(typeof e!="string")throw new TypeError("First argument must be a string");if(!e)return[];t=t||{};var n=1,r=1;function u(g){var x=g.match(ib);x&&(n+=x.length);var E=g.lastIndexOf(pb);r=~E?g.length-E:r+g.length}function a(){var g={line:n,column:r};return function(x){return x.position=new s(g),l(),x}}function s(g){this.start=g,this.end={line:n,column:r},this.source=t.source}s.prototype.content=e;function o(g){var x=new Error(t.source+":"+n+":"+r+": "+g);if(x.reason=g,x.filename=t.source,x.line=n,x.column=r,x.source=e,!t.silent)throw x}function c(g){var x=g.exec(e);if(x){var E=x[0];return u(E),e=e.slice(E.length),x}}function l(){c(ob)}function h(g){var x;for(g=g||[];x=f();)x!==!1&&g.push(x);return g}function f(){var g=a();if(!(Bo!=e.charAt(0)||jo!=e.charAt(1))){for(var x=2;Qn!=e.charAt(x)&&(jo!=e.charAt(x)||Bo!=e.charAt(x+1));)++x;if(x+=2,Qn===e.charAt(x-1))return o("End of comment missing");var E=e.slice(2,x-2);return r+=2,u(E),e=e.slice(x),r+=2,g({type:mb,comment:E})}}function m(){var g=a(),x=c(cb);if(x){if(f(),!c(lb))return o("property missing ':'");var E=c(db),_=g({type:gb,property:Ho(x[0].replace(Fo,Qn)),value:E?Ho(E[0].replace(Fo,Qn)):Qn});return c(fb),_}}function p(){var g=[];h(g);for(var x;x=m();)x!==!1&&(g.push(x),h(g));return g}return l(),p()};function Ho(e){return e?e.replace(hb,Qn):Qn}var _b=b.commonjsGlobal&&b.commonjsGlobal.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(D0,"__esModule",{value:!0});var Uo=D0.default=Cb,xb=_b(bb);function Cb(e,t){var n=null;if(!e||typeof e!="string")return n;var r=(0,xb.default)(e),u=typeof t=="function";return r.forEach(function(a){if(a.type==="declaration"){var s=a.property,o=a.value;u?t(s,o,a):o&&(n=n||{},n[s]=o)}}),n}const Eb=Uo.default||Uo,ya=L0("end"),pn=L0("start");function L0(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function yb(e){const t=pn(e),n=ya(e);if(t&&n)return{start:t,end:n}}function Wr(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Vo(e.position):"start"in e||"end"in e?Vo(e):"line"in e||"column"in e?Ps(e):""}function Ps(e){return $o(e&&e.line)+":"+$o(e&&e.column)}function Vo(e){return Ps(e&&e.start)+"-"+Ps(e&&e.end)}function $o(e){return e&&typeof e=="number"?e:1}class xt extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let u="",a={},s=!1;if(n&&("line"in n&&"column"in n?a={place:n}:"start"in n&&"end"in n?a={place:n}:"type"in n?a={ancestors:[n],place:n.position}:a={...n}),typeof t=="string"?u=t:!a.cause&&t&&(s=!0,u=t.message,a.cause=t),!a.ruleId&&!a.source&&typeof r=="string"){const c=r.indexOf(":");c===-1?a.ruleId=r:(a.source=r.slice(0,c),a.ruleId=r.slice(c+1))}if(!a.place&&a.ancestors&&a.ancestors){const c=a.ancestors[a.ancestors.length-1];c&&(a.place=c.position)}const o=a.place&&"start"in a.place?a.place.start:a.place;this.ancestors=a.ancestors||void 0,this.cause=a.cause||void 0,this.column=o?o.column:void 0,this.fatal=void 0,this.file,this.message=u,this.line=o?o.line:void 0,this.name=Wr(a.place)||"1:1",this.place=a.place||void 0,this.reason=this.message,this.ruleId=a.ruleId||void 0,this.source=a.source||void 0,this.stack=s&&a.cause&&typeof a.cause.stack=="string"?a.cause.stack:"",this.actual,this.expected,this.note,this.url}}xt.prototype.file="";xt.prototype.name="";xt.prototype.reason="";xt.prototype.message="";xt.prototype.stack="";xt.prototype.column=void 0;xt.prototype.line=void 0;xt.prototype.ancestors=void 0;xt.prototype.cause=void 0;xt.prototype.fatal=void 0;xt.prototype.place=void 0;xt.prototype.ruleId=void 0;xt.prototype.source=void 0;const pi={}.hasOwnProperty,Tb=new Map,kb=/[A-Z]/g,Ab=/-([a-z])/g,Sb=new Set(["table","tbody","thead","tfoot","tr"]),Ib=new Set(["td","th"]),P0="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function Nb(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Mb(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=Ob(n,t.jsx,t.jsxs)}const u={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?wr:Ea,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},a=R0(u,e,void 0);return a&&typeof a!="string"?a:u.create(e,u.Fragment,{children:a||void 0},void 0)}function R0(e,t,n){if(t.type==="element")return vb(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return wb(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return Lb(e,t,n);if(t.type==="mdxjsEsm")return Db(e,t);if(t.type==="root")return Pb(e,t,n);if(t.type==="text")return Rb(e,t)}function vb(e,t,n){const r=e.schema;let u=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(u=wr,e.schema=u),e.ancestors.push(t);const a=M0(e,t.tagName,!1),s=Fb(e,t);let o=gi(e,t);return Sb.has(t.tagName)&&(o=o.filter(function(c){return typeof c=="string"?!Qg(c):!0})),O0(e,s,a,t),mi(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function wb(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}iu(e,t.position)}function Db(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);iu(e,t.position)}function Lb(e,t,n){const r=e.schema;let u=r;t.name==="svg"&&r.space==="html"&&(u=wr,e.schema=u),e.ancestors.push(t);const a=t.name===null?e.Fragment:M0(e,t.name,!0),s=Bb(e,t),o=gi(e,t);return O0(e,s,a,t),mi(s,o),e.ancestors.pop(),e.schema=r,e.create(t,a,s,n)}function Pb(e,t,n){const r={};return mi(r,gi(e,t)),e.create(t,e.Fragment,r,n)}function Rb(e,t){return t.value}function O0(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function mi(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function Ob(e,t,n){return r;function r(u,a,s,o){const l=Array.isArray(s.children)?n:t;return o?l(a,s,o):l(a,s)}}function Mb(e,t){return n;function n(r,u,a,s){const o=Array.isArray(a.children),c=pn(r);return t(u,a,s,o,{columnNumber:c?c.column-1:void 0,fileName:e,lineNumber:c?c.line:void 0},void 0)}}function Fb(e,t){const n={};let r,u;for(u in t.properties)if(u!=="children"&&pi.call(t.properties,u)){const a=jb(e,u,t.properties[u]);if(a){const[s,o]=a;e.tableCellAlignToStyle&&s==="align"&&typeof o=="string"&&Ib.has(t.tagName)?r=o:n[s]=o}}if(r){const a=n.style||(n.style={});a[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function Bb(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const a=r.data.estree.body[0];a.type;const s=a.expression;s.type;const o=s.properties[0];o.type,Object.assign(n,e.evaluater.evaluateExpression(o.argument))}else iu(e,t.position);else{const u=r.name;let a;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const o=r.value.data.estree.body[0];o.type,a=e.evaluater.evaluateExpression(o.expression)}else iu(e,t.position);else a=r.value===null?!0:r.value;n[u]=a}return n}function gi(e,t){const n=[];let r=-1;const u=e.passKeys?new Map:Tb;for(;++r<t.children.length;){const a=t.children[r];let s;if(e.passKeys){const c=a.type==="element"?a.tagName:a.type==="mdxJsxFlowElement"||a.type==="mdxJsxTextElement"?a.name:void 0;if(c){const l=u.get(c)||0;s=c+"-"+l,u.set(c,l+1)}}const o=R0(e,a,s);o!==void 0&&n.push(o)}return n}function jb(e,t,n){const r=hi(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?E0(n):w0(n)),r.property==="style"){let u=typeof n=="object"?n:Hb(e,String(n));return e.stylePropertyNameCase==="css"&&(u=Ub(u)),["style",u]}return[e.elementAttributeNameCase==="react"&&r.space?nb[r.property]||r.property:r.attribute,n]}}function Hb(e,t){const n={};try{Eb(t,r)}catch(u){if(!e.ignoreInvalidStyle){const a=u,s=new xt("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:a,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=P0+"#cannot-parse-style-attribute",s}}return n;function r(u,a){let s=u;s.slice(0,2)!=="--"&&(s.slice(0,4)==="-ms-"&&(s="ms-"+s.slice(4)),s=s.replace(Ab,$b)),n[s]=a}}function M0(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const u=t.split(".");let a=-1,s;for(;++a<u.length;){const o=Lo(u[a])?{type:"Identifier",name:u[a]}:{type:"Literal",value:u[a]};s=s?{type:"MemberExpression",object:s,property:o,computed:!!(a&&o.type==="Literal"),optional:!1}:o}r=s}else r=Lo(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const u=r.value;return pi.call(e.components,u)?e.components[u]:u}if(e.evaluater)return e.evaluater.evaluateExpression(r);iu(e)}function iu(e,t){const n=new xt("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=P0+"#cannot-handle-mdx-estrees-without-createevaluater",n}function Ub(e){const t={};let n;for(n in e)pi.call(e,n)&&(t[Vb(n)]=e[n]);return t}function Vb(e){let t=e.replace(kb,zb);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function $b(e,t){return t.toUpperCase()}function zb(e){return"-"+e.toLowerCase()}const Ja={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},qb={};function bi(e,t){const n=qb,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,u=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return F0(e,r,u)}function F0(e,t,n){if(Zb(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return zo(e.children,t,n)}return Array.isArray(e)?zo(e,t,n):""}function zo(e,t,n){const r=[];let u=-1;for(;++u<e.length;)r[u]=F0(e[u],t,n);return r.join("")}function Zb(e){return!!(e&&typeof e=="object")}const qo=document.createElement("i");function _i(e){const t="&"+e+";";qo.innerHTML=t;const n=qo.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function Ut(e,t,n,r){const u=e.length;let a=0,s;if(t<0?t=-t>u?0:u+t:t=t>u?u:t,n=n>0?n:0,r.length<1e4)s=Array.from(r),s.unshift(t,n),e.splice(...s);else for(n&&e.splice(t,n);a<r.length;)s=r.slice(a,a+1e4),s.unshift(t,0),e.splice(...s),a+=1e4,t+=1e4}function Wt(e,t){return e.length>0?(Ut(e,e.length,0,t),e):t}const Zo={}.hasOwnProperty;function B0(e){const t={};let n=-1;for(;++n<e.length;)Wb(t,e[n]);return t}function Wb(e,t){let n;for(n in t){const u=(Zo.call(e,n)?e[n]:void 0)||(e[n]={}),a=t[n];let s;if(a)for(s in a){Zo.call(u,s)||(u[s]=[]);const o=a[s];Yb(u[s],Array.isArray(o)?o:o?[o]:[])}}}function Yb(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);Ut(e,0,0,r)}function j0(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function en(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const Tt=qn(/[A-Za-z]/),_t=qn(/[\dA-Za-z]/),Gb=qn(/[#-'*+\--9=?A-Z^-~]/);function Ku(e){return e!==null&&(e<32||e===127)}const Rs=qn(/\d/),Xb=qn(/[\dA-Fa-f]/),Kb=qn(/[!-/:-@[-`{-~]/);function ie(e){return e!==null&&e<-2}function Fe(e){return e!==null&&(e<0||e===32)}function Se(e){return e===-2||e===-1||e===32}const Ta=qn(new RegExp("\\p{P}|\\p{S}","u")),rr=qn(/\s/);function qn(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Dr(e){const t=[];let n=-1,r=0,u=0;for(;++n<e.length;){const a=e.charCodeAt(n);let s="";if(a===37&&_t(e.charCodeAt(n+1))&&_t(e.charCodeAt(n+2)))u=2;else if(a<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(a))||(s=String.fromCharCode(a));else if(a>55295&&a<57344){const o=e.charCodeAt(n+1);a<56320&&o>56319&&o<57344?(s=String.fromCharCode(a,o),u=1):s="�"}else s=String.fromCharCode(a);s&&(t.push(e.slice(r,n),encodeURIComponent(s)),r=n+u+1,s=""),u&&(n+=u,u=0)}return t.join("")+e.slice(r)}function Ne(e,t,n,r){const u=r?r-1:Number.POSITIVE_INFINITY;let a=0;return s;function s(c){return Se(c)?(e.enter(n),o(c)):t(c)}function o(c){return Se(c)&&a++<u?(e.consume(c),o):(e.exit(n),t(c))}}const Qb={tokenize:Jb};function Jb(e){const t=e.attempt(this.parser.constructs.contentInitial,r,u);let n;return t;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),Ne(e,t,"linePrefix")}function u(o){return e.enter("paragraph"),a(o)}function a(o){const c=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=c),n=c,s(o)}function s(o){if(o===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(o);return}return ie(o)?(e.consume(o),e.exit("chunkText"),a):(e.consume(o),s)}}const e_={tokenize:t_},Wo={tokenize:n_};function t_(e){const t=this,n=[];let r=0,u,a,s;return o;function o(y){if(r<n.length){const D=n[r];return t.containerState=D[1],e.attempt(D[0].continuation,c,l)(y)}return l(y)}function c(y){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,u&&k();const D=t.events.length;let I=D,S;for(;I--;)if(t.events[I][0]==="exit"&&t.events[I][1].type==="chunkFlow"){S=t.events[I][1].end;break}_(r);let O=D;for(;O<t.events.length;)t.events[O][1].end={...S},O++;return Ut(t.events,I+1,0,t.events.slice(D)),t.events.length=O,l(y)}return o(y)}function l(y){if(r===n.length){if(!u)return m(y);if(u.currentConstruct&&u.currentConstruct.concrete)return g(y);t.interrupt=!!(u.currentConstruct&&!u._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(Wo,h,f)(y)}function h(y){return u&&k(),_(r),m(y)}function f(y){return t.parser.lazy[t.now().line]=r!==n.length,s=t.now().offset,g(y)}function m(y){return t.containerState={},e.attempt(Wo,p,g)(y)}function p(y){return r++,n.push([t.currentConstruct,t.containerState]),m(y)}function g(y){if(y===null){u&&k(),_(0),e.consume(y);return}return u=u||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:u,contentType:"flow",previous:a}),x(y)}function x(y){if(y===null){E(e.exit("chunkFlow"),!0),_(0),e.consume(y);return}return ie(y)?(e.consume(y),E(e.exit("chunkFlow")),r=0,t.interrupt=void 0,o):(e.consume(y),x)}function E(y,D){const I=t.sliceStream(y);if(D&&I.push(null),y.previous=a,a&&(a.next=y),a=y,u.defineSkip(y.start),u.write(I),t.parser.lazy[y.start.line]){let S=u.events.length;for(;S--;)if(u.events[S][1].start.offset<s&&(!u.events[S][1].end||u.events[S][1].end.offset>s))return;const O=t.events.length;let Z=O,H,L;for(;Z--;)if(t.events[Z][0]==="exit"&&t.events[Z][1].type==="chunkFlow"){if(H){L=t.events[Z][1].end;break}H=!0}for(_(r),S=O;S<t.events.length;)t.events[S][1].end={...L},S++;Ut(t.events,Z+1,0,t.events.slice(O)),t.events.length=S}}function _(y){let D=n.length;for(;D-- >y;){const I=n[D];t.containerState=I[1],I[0].exit.call(t,e)}n.length=y}function k(){u.write([null]),a=void 0,u=void 0,t.containerState._closeFlow=void 0}}function n_(e,t,n){return Ne(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Tr(e){if(e===null||Fe(e)||rr(e))return 1;if(Ta(e))return 2}function ka(e,t,n){const r=[];let u=-1;for(;++u<e.length;){const a=e[u].resolveAll;a&&!r.includes(a)&&(t=a(t,n),r.push(a))}return t}const Os={name:"attention",resolveAll:r_,tokenize:u_};function r_(e,t){let n=-1,r,u,a,s,o,c,l,h;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;c=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const f={...e[r][1].end},m={...e[n][1].start};Yo(f,-c),Yo(m,c),s={type:c>1?"strongSequence":"emphasisSequence",start:f,end:{...e[r][1].end}},o={type:c>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:m},a={type:c>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},u={type:c>1?"strong":"emphasis",start:{...s.start},end:{...o.end}},e[r][1].end={...s.start},e[n][1].start={...o.end},l=[],e[r][1].end.offset-e[r][1].start.offset&&(l=Wt(l,[["enter",e[r][1],t],["exit",e[r][1],t]])),l=Wt(l,[["enter",u,t],["enter",s,t],["exit",s,t],["enter",a,t]]),l=Wt(l,ka(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),l=Wt(l,[["exit",a,t],["enter",o,t],["exit",o,t],["exit",u,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,l=Wt(l,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Ut(e,r-1,n-r+3,l),n=r+l.length-h-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function u_(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,u=Tr(r);let a;return s;function s(c){return a=c,e.enter("attentionSequence"),o(c)}function o(c){if(c===a)return e.consume(c),o;const l=e.exit("attentionSequence"),h=Tr(c),f=!h||h===2&&u||n.includes(c),m=!u||u===2&&h||n.includes(r);return l._open=!!(a===42?f:f&&(u||!m)),l._close=!!(a===42?m:m&&(h||!f)),t(c)}}function Yo(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const a_={name:"autolink",tokenize:s_};function s_(e,t,n){let r=0;return u;function u(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return Tt(p)?(e.consume(p),s):p===64?n(p):l(p)}function s(p){return p===43||p===45||p===46||_t(p)?(r=1,o(p)):l(p)}function o(p){return p===58?(e.consume(p),r=0,c):(p===43||p===45||p===46||_t(p))&&r++<32?(e.consume(p),o):(r=0,l(p))}function c(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):p===null||p===32||p===60||Ku(p)?n(p):(e.consume(p),c)}function l(p){return p===64?(e.consume(p),h):Gb(p)?(e.consume(p),l):n(p)}function h(p){return _t(p)?f(p):n(p)}function f(p){return p===46?(e.consume(p),r=0,h):p===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),t):m(p)}function m(p){if((p===45||_t(p))&&r++<63){const g=p===45?m:f;return e.consume(p),g}return n(p)}}const _u={partial:!0,tokenize:i_};function i_(e,t,n){return r;function r(a){return Se(a)?Ne(e,u,"linePrefix")(a):u(a)}function u(a){return a===null||ie(a)?t(a):n(a)}}const H0={continuation:{tokenize:c_},exit:l_,name:"blockQuote",tokenize:o_};function o_(e,t,n){const r=this;return u;function u(s){if(s===62){const o=r.containerState;return o.open||(e.enter("blockQuote",{_container:!0}),o.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(s),e.exit("blockQuoteMarker"),a}return n(s)}function a(s){return Se(s)?(e.enter("blockQuotePrefixWhitespace"),e.consume(s),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(s))}}function c_(e,t,n){const r=this;return u;function u(s){return Se(s)?Ne(e,a,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(s):a(s)}function a(s){return e.attempt(H0,t,n)(s)}}function l_(e){e.exit("blockQuote")}const U0={name:"characterEscape",tokenize:d_};function d_(e,t,n){return r;function r(a){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(a),e.exit("escapeMarker"),u}function u(a){return Kb(a)?(e.enter("characterEscapeValue"),e.consume(a),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(a)}}const V0={name:"characterReference",tokenize:f_};function f_(e,t,n){const r=this;let u=0,a,s;return o;function o(f){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),c}function c(f){return f===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(f),e.exit("characterReferenceMarkerNumeric"),l):(e.enter("characterReferenceValue"),a=31,s=_t,h(f))}function l(f){return f===88||f===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(f),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),a=6,s=Xb,h):(e.enter("characterReferenceValue"),a=7,s=Rs,h(f))}function h(f){if(f===59&&u){const m=e.exit("characterReferenceValue");return s===_t&&!_i(r.sliceSerialize(m))?n(f):(e.enter("characterReferenceMarker"),e.consume(f),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return s(f)&&u++<a?(e.consume(f),h):n(f)}}const Go={partial:!0,tokenize:p_},Xo={concrete:!0,name:"codeFenced",tokenize:h_};function h_(e,t,n){const r=this,u={partial:!0,tokenize:I};let a=0,s=0,o;return c;function c(S){return l(S)}function l(S){const O=r.events[r.events.length-1];return a=O&&O[1].type==="linePrefix"?O[2].sliceSerialize(O[1],!0).length:0,o=S,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),h(S)}function h(S){return S===o?(s++,e.consume(S),h):s<3?n(S):(e.exit("codeFencedFenceSequence"),Se(S)?Ne(e,f,"whitespace")(S):f(S))}function f(S){return S===null||ie(S)?(e.exit("codeFencedFence"),r.interrupt?t(S):e.check(Go,x,D)(S)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),m(S))}function m(S){return S===null||ie(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),f(S)):Se(S)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ne(e,p,"whitespace")(S)):S===96&&S===o?n(S):(e.consume(S),m)}function p(S){return S===null||ie(S)?f(S):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),g(S))}function g(S){return S===null||ie(S)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),f(S)):S===96&&S===o?n(S):(e.consume(S),g)}function x(S){return e.attempt(u,D,E)(S)}function E(S){return e.enter("lineEnding"),e.consume(S),e.exit("lineEnding"),_}function _(S){return a>0&&Se(S)?Ne(e,k,"linePrefix",a+1)(S):k(S)}function k(S){return S===null||ie(S)?e.check(Go,x,D)(S):(e.enter("codeFlowValue"),y(S))}function y(S){return S===null||ie(S)?(e.exit("codeFlowValue"),k(S)):(e.consume(S),y)}function D(S){return e.exit("codeFenced"),t(S)}function I(S,O,Z){let H=0;return L;function L(X){return S.enter("lineEnding"),S.consume(X),S.exit("lineEnding"),j}function j(X){return S.enter("codeFencedFence"),Se(X)?Ne(S,B,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(X):B(X)}function B(X){return X===o?(S.enter("codeFencedFenceSequence"),K(X)):Z(X)}function K(X){return X===o?(H++,S.consume(X),K):H>=s?(S.exit("codeFencedFenceSequence"),Se(X)?Ne(S,Y,"whitespace")(X):Y(X)):Z(X)}function Y(X){return X===null||ie(X)?(S.exit("codeFencedFence"),O(X)):Z(X)}}}function p_(e,t,n){const r=this;return u;function u(s){return s===null?n(s):(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}const es={name:"codeIndented",tokenize:g_},m_={partial:!0,tokenize:b_};function g_(e,t,n){const r=this;return u;function u(l){return e.enter("codeIndented"),Ne(e,a,"linePrefix",5)(l)}function a(l){const h=r.events[r.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?s(l):n(l)}function s(l){return l===null?c(l):ie(l)?e.attempt(m_,s,c)(l):(e.enter("codeFlowValue"),o(l))}function o(l){return l===null||ie(l)?(e.exit("codeFlowValue"),s(l)):(e.consume(l),o)}function c(l){return e.exit("codeIndented"),t(l)}}function b_(e,t,n){const r=this;return u;function u(s){return r.parser.lazy[r.now().line]?n(s):ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),u):Ne(e,a,"linePrefix",5)(s)}function a(s){const o=r.events[r.events.length-1];return o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):ie(s)?u(s):n(s)}}const __={name:"codeText",previous:C_,resolve:x_,tokenize:E_};function x_(e){let t=e.length-4,n=3,r,u;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)u===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(u=r):(r===t||e[r][1].type==="lineEnding")&&(e[u][1].type="codeTextData",r!==u+2&&(e[u][1].end=e[r-1][1].end,e.splice(u+2,r-u-2),t-=r-u-2,r=u+2),u=void 0);return e}function C_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function E_(e,t,n){let r=0,u,a;return s;function s(f){return e.enter("codeText"),e.enter("codeTextSequence"),o(f)}function o(f){return f===96?(e.consume(f),r++,o):(e.exit("codeTextSequence"),c(f))}function c(f){return f===null?n(f):f===32?(e.enter("space"),e.consume(f),e.exit("space"),c):f===96?(a=e.enter("codeTextSequence"),u=0,h(f)):ie(f)?(e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),c):(e.enter("codeTextData"),l(f))}function l(f){return f===null||f===32||f===96||ie(f)?(e.exit("codeTextData"),c(f)):(e.consume(f),l)}function h(f){return f===96?(e.consume(f),u++,h):u===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(f)):(a.type="codeTextData",l(f))}}class y_{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const u=n||0;this.setCursor(Math.trunc(t));const a=this.right.splice(this.right.length-u,Number.POSITIVE_INFINITY);return r&&jr(this.left,r),a.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),jr(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),jr(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);jr(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);jr(this.left,n.reverse())}}}function jr(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function $0(e){const t={};let n=-1,r,u,a,s,o,c,l;const h=new y_(e);for(;++n<h.length;){for(;n in t;)n=t[n];if(r=h.get(n),n&&r[1].type==="chunkFlow"&&h.get(n-1)[1].type==="listItemPrefix"&&(c=r[1]._tokenizer.events,a=0,a<c.length&&c[a][1].type==="lineEndingBlank"&&(a+=2),a<c.length&&c[a][1].type==="content"))for(;++a<c.length&&c[a][1].type!=="content";)c[a][1].type==="chunkText"&&(c[a][1]._isInFirstContentOfListItem=!0,a++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,T_(h,n)),n=t[n],l=!0);else if(r[1]._container){for(a=n,u=void 0;a--;)if(s=h.get(a),s[1].type==="lineEnding"||s[1].type==="lineEndingBlank")s[0]==="enter"&&(u&&(h.get(u)[1].type="lineEndingBlank"),s[1].type="lineEnding",u=a);else if(!(s[1].type==="linePrefix"||s[1].type==="listItemIndent"))break;u&&(r[1].end={...h.get(u)[1].start},o=h.slice(u,n),o.unshift(r),h.splice(u,n-u+1,o))}}return Ut(e,0,Number.POSITIVE_INFINITY,h.slice(0)),!l}function T_(e,t){const n=e.get(t)[1],r=e.get(t)[2];let u=t-1;const a=[];let s=n._tokenizer;s||(s=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(s._contentTypeTextTrailing=!0));const o=s.events,c=[],l={};let h,f,m=-1,p=n,g=0,x=0;const E=[x];for(;p;){for(;e.get(++u)[1]!==p;);a.push(u),p._tokenizer||(h=r.sliceStream(p),p.next||h.push(null),f&&s.defineSkip(p.start),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=!0),s.write(h),p._isInFirstContentOfListItem&&(s._gfmTasklistFirstContentOfListItem=void 0)),f=p,p=p.next}for(p=n;++m<o.length;)o[m][0]==="exit"&&o[m-1][0]==="enter"&&o[m][1].type===o[m-1][1].type&&o[m][1].start.line!==o[m][1].end.line&&(x=m+1,E.push(x),p._tokenizer=void 0,p.previous=void 0,p=p.next);for(s.events=[],p?(p._tokenizer=void 0,p.previous=void 0):E.pop(),m=E.length;m--;){const _=o.slice(E[m],E[m+1]),k=a.pop();c.push([k,k+_.length-1]),e.splice(k,2,_)}for(c.reverse(),m=-1;++m<c.length;)l[g+c[m][0]]=g+c[m][1],g+=c[m][1]-c[m][0]-1;return l}const k_={resolve:S_,tokenize:I_},A_={partial:!0,tokenize:N_};function S_(e){return $0(e),e}function I_(e,t){let n;return r;function r(o){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),u(o)}function u(o){return o===null?a(o):ie(o)?e.check(A_,s,a)(o):(e.consume(o),u)}function a(o){return e.exit("chunkContent"),e.exit("content"),t(o)}function s(o){return e.consume(o),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,u}}function N_(e,t,n){const r=this;return u;function u(s){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),Ne(e,a,"linePrefix")}function a(s){if(s===null||ie(s))return n(s);const o=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&o&&o[1].type==="linePrefix"&&o[2].sliceSerialize(o[1],!0).length>=4?t(s):e.interrupt(r.parser.constructs.flow,n,t)(s)}}function z0(e,t,n,r,u,a,s,o,c){const l=c||Number.POSITIVE_INFINITY;let h=0;return f;function f(_){return _===60?(e.enter(r),e.enter(u),e.enter(a),e.consume(_),e.exit(a),m):_===null||_===32||_===41||Ku(_)?n(_):(e.enter(r),e.enter(s),e.enter(o),e.enter("chunkString",{contentType:"string"}),x(_))}function m(_){return _===62?(e.enter(a),e.consume(_),e.exit(a),e.exit(u),e.exit(r),t):(e.enter(o),e.enter("chunkString",{contentType:"string"}),p(_))}function p(_){return _===62?(e.exit("chunkString"),e.exit(o),m(_)):_===null||_===60||ie(_)?n(_):(e.consume(_),_===92?g:p)}function g(_){return _===60||_===62||_===92?(e.consume(_),p):p(_)}function x(_){return!h&&(_===null||_===41||Fe(_))?(e.exit("chunkString"),e.exit(o),e.exit(s),e.exit(r),t(_)):h<l&&_===40?(e.consume(_),h++,x):_===41?(e.consume(_),h--,x):_===null||_===32||_===40||Ku(_)?n(_):(e.consume(_),_===92?E:x)}function E(_){return _===40||_===41||_===92?(e.consume(_),x):x(_)}}function q0(e,t,n,r,u,a){const s=this;let o=0,c;return l;function l(p){return e.enter(r),e.enter(u),e.consume(p),e.exit(u),e.enter(a),h}function h(p){return o>999||p===null||p===91||p===93&&!c||p===94&&!o&&"_hiddenFootnoteSupport"in s.parser.constructs?n(p):p===93?(e.exit(a),e.enter(u),e.consume(p),e.exit(u),e.exit(r),t):ie(p)?(e.enter("lineEnding"),e.consume(p),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),f(p))}function f(p){return p===null||p===91||p===93||ie(p)||o++>999?(e.exit("chunkString"),h(p)):(e.consume(p),c||(c=!Se(p)),p===92?m:f)}function m(p){return p===91||p===92||p===93?(e.consume(p),o++,f):f(p)}}function Z0(e,t,n,r,u,a){let s;return o;function o(m){return m===34||m===39||m===40?(e.enter(r),e.enter(u),e.consume(m),e.exit(u),s=m===40?41:m,c):n(m)}function c(m){return m===s?(e.enter(u),e.consume(m),e.exit(u),e.exit(r),t):(e.enter(a),l(m))}function l(m){return m===s?(e.exit(a),c(s)):m===null?n(m):ie(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),Ne(e,l,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(m))}function h(m){return m===s||m===null||ie(m)?(e.exit("chunkString"),l(m)):(e.consume(m),m===92?f:h)}function f(m){return m===s||m===92?(e.consume(m),h):h(m)}}function Yr(e,t){let n;return r;function r(u){return ie(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),n=!0,r):Se(u)?Ne(e,r,n?"linePrefix":"lineSuffix")(u):t(u)}}const v_={name:"definition",tokenize:D_},w_={partial:!0,tokenize:L_};function D_(e,t,n){const r=this;let u;return a;function a(p){return e.enter("definition"),s(p)}function s(p){return q0.call(r,e,o,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(p)}function o(p){return u=en(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),p===58?(e.enter("definitionMarker"),e.consume(p),e.exit("definitionMarker"),c):n(p)}function c(p){return Fe(p)?Yr(e,l)(p):l(p)}function l(p){return z0(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(p)}function h(p){return e.attempt(w_,f,f)(p)}function f(p){return Se(p)?Ne(e,m,"whitespace")(p):m(p)}function m(p){return p===null||ie(p)?(e.exit("definition"),r.parser.defined.push(u),t(p)):n(p)}}function L_(e,t,n){return r;function r(o){return Fe(o)?Yr(e,u)(o):n(o)}function u(o){return Z0(e,a,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(o)}function a(o){return Se(o)?Ne(e,s,"whitespace")(o):s(o)}function s(o){return o===null||ie(o)?t(o):n(o)}}const P_={name:"hardBreakEscape",tokenize:R_};function R_(e,t,n){return r;function r(a){return e.enter("hardBreakEscape"),e.consume(a),u}function u(a){return ie(a)?(e.exit("hardBreakEscape"),t(a)):n(a)}}const O_={name:"headingAtx",resolve:M_,tokenize:F_};function M_(e,t){let n=e.length-2,r=3,u,a;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(u={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},a={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},Ut(e,r,n-r+1,[["enter",u,t],["enter",a,t],["exit",a,t],["exit",u,t]])),e}function F_(e,t,n){let r=0;return u;function u(h){return e.enter("atxHeading"),a(h)}function a(h){return e.enter("atxHeadingSequence"),s(h)}function s(h){return h===35&&r++<6?(e.consume(h),s):h===null||Fe(h)?(e.exit("atxHeadingSequence"),o(h)):n(h)}function o(h){return h===35?(e.enter("atxHeadingSequence"),c(h)):h===null||ie(h)?(e.exit("atxHeading"),t(h)):Se(h)?Ne(e,o,"whitespace")(h):(e.enter("atxHeadingText"),l(h))}function c(h){return h===35?(e.consume(h),c):(e.exit("atxHeadingSequence"),o(h))}function l(h){return h===null||h===35||Fe(h)?(e.exit("atxHeadingText"),o(h)):(e.consume(h),l)}}const B_=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Ko=["pre","script","style","textarea"],j_={concrete:!0,name:"htmlFlow",resolveTo:V_,tokenize:$_},H_={partial:!0,tokenize:q_},U_={partial:!0,tokenize:z_};function V_(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function $_(e,t,n){const r=this;let u,a,s,o,c;return l;function l(N){return h(N)}function h(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),f}function f(N){return N===33?(e.consume(N),m):N===47?(e.consume(N),a=!0,x):N===63?(e.consume(N),u=3,r.interrupt?t:C):Tt(N)?(e.consume(N),s=String.fromCharCode(N),E):n(N)}function m(N){return N===45?(e.consume(N),u=2,p):N===91?(e.consume(N),u=5,o=0,g):Tt(N)?(e.consume(N),u=4,r.interrupt?t:C):n(N)}function p(N){return N===45?(e.consume(N),r.interrupt?t:C):n(N)}function g(N){const ee="CDATA[";return N===ee.charCodeAt(o++)?(e.consume(N),o===ee.length?r.interrupt?t:B:g):n(N)}function x(N){return Tt(N)?(e.consume(N),s=String.fromCharCode(N),E):n(N)}function E(N){if(N===null||N===47||N===62||Fe(N)){const ee=N===47,te=s.toLowerCase();return!ee&&!a&&Ko.includes(te)?(u=1,r.interrupt?t(N):B(N)):B_.includes(s.toLowerCase())?(u=6,ee?(e.consume(N),_):r.interrupt?t(N):B(N)):(u=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(N):a?k(N):y(N))}return N===45||_t(N)?(e.consume(N),s+=String.fromCharCode(N),E):n(N)}function _(N){return N===62?(e.consume(N),r.interrupt?t:B):n(N)}function k(N){return Se(N)?(e.consume(N),k):L(N)}function y(N){return N===47?(e.consume(N),L):N===58||N===95||Tt(N)?(e.consume(N),D):Se(N)?(e.consume(N),y):L(N)}function D(N){return N===45||N===46||N===58||N===95||_t(N)?(e.consume(N),D):I(N)}function I(N){return N===61?(e.consume(N),S):Se(N)?(e.consume(N),I):y(N)}function S(N){return N===null||N===60||N===61||N===62||N===96?n(N):N===34||N===39?(e.consume(N),c=N,O):Se(N)?(e.consume(N),S):Z(N)}function O(N){return N===c?(e.consume(N),c=null,H):N===null||ie(N)?n(N):(e.consume(N),O)}function Z(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||Fe(N)?I(N):(e.consume(N),Z)}function H(N){return N===47||N===62||Se(N)?y(N):n(N)}function L(N){return N===62?(e.consume(N),j):n(N)}function j(N){return N===null||ie(N)?B(N):Se(N)?(e.consume(N),j):n(N)}function B(N){return N===45&&u===2?(e.consume(N),ue):N===60&&u===1?(e.consume(N),he):N===62&&u===4?(e.consume(N),U):N===63&&u===3?(e.consume(N),C):N===93&&u===5?(e.consume(N),Te):ie(N)&&(u===6||u===7)?(e.exit("htmlFlowData"),e.check(H_,ne,K)(N)):N===null||ie(N)?(e.exit("htmlFlowData"),K(N)):(e.consume(N),B)}function K(N){return e.check(U_,Y,ne)(N)}function Y(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),X}function X(N){return N===null||ie(N)?K(N):(e.enter("htmlFlowData"),B(N))}function ue(N){return N===45?(e.consume(N),C):B(N)}function he(N){return N===47?(e.consume(N),s="",De):B(N)}function De(N){if(N===62){const ee=s.toLowerCase();return Ko.includes(ee)?(e.consume(N),U):B(N)}return Tt(N)&&s.length<8?(e.consume(N),s+=String.fromCharCode(N),De):B(N)}function Te(N){return N===93?(e.consume(N),C):B(N)}function C(N){return N===62?(e.consume(N),U):N===45&&u===2?(e.consume(N),C):B(N)}function U(N){return N===null||ie(N)?(e.exit("htmlFlowData"),ne(N)):(e.consume(N),U)}function ne(N){return e.exit("htmlFlow"),t(N)}}function z_(e,t,n){const r=this;return u;function u(s){return ie(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),a):n(s)}function a(s){return r.parser.lazy[r.now().line]?n(s):t(s)}}function q_(e,t,n){return r;function r(u){return e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),e.attempt(_u,t,n)}}const Z_={name:"htmlText",tokenize:W_};function W_(e,t,n){const r=this;let u,a,s;return o;function o(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),c}function c(C){return C===33?(e.consume(C),l):C===47?(e.consume(C),I):C===63?(e.consume(C),y):Tt(C)?(e.consume(C),Z):n(C)}function l(C){return C===45?(e.consume(C),h):C===91?(e.consume(C),a=0,g):Tt(C)?(e.consume(C),k):n(C)}function h(C){return C===45?(e.consume(C),p):n(C)}function f(C){return C===null?n(C):C===45?(e.consume(C),m):ie(C)?(s=f,he(C)):(e.consume(C),f)}function m(C){return C===45?(e.consume(C),p):f(C)}function p(C){return C===62?ue(C):C===45?m(C):f(C)}function g(C){const U="CDATA[";return C===U.charCodeAt(a++)?(e.consume(C),a===U.length?x:g):n(C)}function x(C){return C===null?n(C):C===93?(e.consume(C),E):ie(C)?(s=x,he(C)):(e.consume(C),x)}function E(C){return C===93?(e.consume(C),_):x(C)}function _(C){return C===62?ue(C):C===93?(e.consume(C),_):x(C)}function k(C){return C===null||C===62?ue(C):ie(C)?(s=k,he(C)):(e.consume(C),k)}function y(C){return C===null?n(C):C===63?(e.consume(C),D):ie(C)?(s=y,he(C)):(e.consume(C),y)}function D(C){return C===62?ue(C):y(C)}function I(C){return Tt(C)?(e.consume(C),S):n(C)}function S(C){return C===45||_t(C)?(e.consume(C),S):O(C)}function O(C){return ie(C)?(s=O,he(C)):Se(C)?(e.consume(C),O):ue(C)}function Z(C){return C===45||_t(C)?(e.consume(C),Z):C===47||C===62||Fe(C)?H(C):n(C)}function H(C){return C===47?(e.consume(C),ue):C===58||C===95||Tt(C)?(e.consume(C),L):ie(C)?(s=H,he(C)):Se(C)?(e.consume(C),H):ue(C)}function L(C){return C===45||C===46||C===58||C===95||_t(C)?(e.consume(C),L):j(C)}function j(C){return C===61?(e.consume(C),B):ie(C)?(s=j,he(C)):Se(C)?(e.consume(C),j):H(C)}function B(C){return C===null||C===60||C===61||C===62||C===96?n(C):C===34||C===39?(e.consume(C),u=C,K):ie(C)?(s=B,he(C)):Se(C)?(e.consume(C),B):(e.consume(C),Y)}function K(C){return C===u?(e.consume(C),u=void 0,X):C===null?n(C):ie(C)?(s=K,he(C)):(e.consume(C),K)}function Y(C){return C===null||C===34||C===39||C===60||C===61||C===96?n(C):C===47||C===62||Fe(C)?H(C):(e.consume(C),Y)}function X(C){return C===47||C===62||Fe(C)?H(C):n(C)}function ue(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),t):n(C)}function he(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),De}function De(C){return Se(C)?Ne(e,Te,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):Te(C)}function Te(C){return e.enter("htmlTextData"),s(C)}}const xi={name:"labelEnd",resolveAll:K_,resolveTo:Q_,tokenize:J_},Y_={tokenize:ex},G_={tokenize:tx},X_={tokenize:nx};function K_(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const u=r.type==="labelImage"?4:2;r.type="data",t+=u}}return e.length!==n.length&&Ut(e,0,e.length,n),e}function Q_(e,t){let n=e.length,r=0,u,a,s,o;for(;n--;)if(u=e[n][1],a){if(u.type==="link"||u.type==="labelLink"&&u._inactive)break;e[n][0]==="enter"&&u.type==="labelLink"&&(u._inactive=!0)}else if(s){if(e[n][0]==="enter"&&(u.type==="labelImage"||u.type==="labelLink")&&!u._balanced&&(a=n,u.type!=="labelLink")){r=2;break}}else u.type==="labelEnd"&&(s=n);const c={type:e[a][1].type==="labelLink"?"link":"image",start:{...e[a][1].start},end:{...e[e.length-1][1].end}},l={type:"label",start:{...e[a][1].start},end:{...e[s][1].end}},h={type:"labelText",start:{...e[a+r+2][1].end},end:{...e[s-2][1].start}};return o=[["enter",c,t],["enter",l,t]],o=Wt(o,e.slice(a+1,a+r+3)),o=Wt(o,[["enter",h,t]]),o=Wt(o,ka(t.parser.constructs.insideSpan.null,e.slice(a+r+4,s-3),t)),o=Wt(o,[["exit",h,t],e[s-2],e[s-1],["exit",l,t]]),o=Wt(o,e.slice(s+1)),o=Wt(o,[["exit",c,t]]),Ut(e,a,e.length,o),e}function J_(e,t,n){const r=this;let u=r.events.length,a,s;for(;u--;)if((r.events[u][1].type==="labelImage"||r.events[u][1].type==="labelLink")&&!r.events[u][1]._balanced){a=r.events[u][1];break}return o;function o(m){return a?a._inactive?f(m):(s=r.parser.defined.includes(en(r.sliceSerialize({start:a.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(m),e.exit("labelMarker"),e.exit("labelEnd"),c):n(m)}function c(m){return m===40?e.attempt(Y_,h,s?h:f)(m):m===91?e.attempt(G_,h,s?l:f)(m):s?h(m):f(m)}function l(m){return e.attempt(X_,h,f)(m)}function h(m){return t(m)}function f(m){return a._balanced=!0,n(m)}}function ex(e,t,n){return r;function r(f){return e.enter("resource"),e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),u}function u(f){return Fe(f)?Yr(e,a)(f):a(f)}function a(f){return f===41?h(f):z0(e,s,o,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(f)}function s(f){return Fe(f)?Yr(e,c)(f):h(f)}function o(f){return n(f)}function c(f){return f===34||f===39||f===40?Z0(e,l,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(f):h(f)}function l(f){return Fe(f)?Yr(e,h)(f):h(f)}function h(f){return f===41?(e.enter("resourceMarker"),e.consume(f),e.exit("resourceMarker"),e.exit("resource"),t):n(f)}}function tx(e,t,n){const r=this;return u;function u(o){return q0.call(r,e,a,s,"reference","referenceMarker","referenceString")(o)}function a(o){return r.parser.defined.includes(en(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(o):n(o)}function s(o){return n(o)}}function nx(e,t,n){return r;function r(a){return e.enter("reference"),e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),u}function u(a){return a===93?(e.enter("referenceMarker"),e.consume(a),e.exit("referenceMarker"),e.exit("reference"),t):n(a)}}const rx={name:"labelStartImage",resolveAll:xi.resolveAll,tokenize:ux};function ux(e,t,n){const r=this;return u;function u(o){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(o),e.exit("labelImageMarker"),a}function a(o){return o===91?(e.enter("labelMarker"),e.consume(o),e.exit("labelMarker"),e.exit("labelImage"),s):n(o)}function s(o){return o===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(o):t(o)}}const ax={name:"labelStartLink",resolveAll:xi.resolveAll,tokenize:sx};function sx(e,t,n){const r=this;return u;function u(s){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(s),e.exit("labelMarker"),e.exit("labelLink"),a}function a(s){return s===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(s):t(s)}}const ts={name:"lineEnding",tokenize:ix};function ix(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ne(e,t,"linePrefix")}}const $u={name:"thematicBreak",tokenize:ox};function ox(e,t,n){let r=0,u;return a;function a(l){return e.enter("thematicBreak"),s(l)}function s(l){return u=l,o(l)}function o(l){return l===u?(e.enter("thematicBreakSequence"),c(l)):r>=3&&(l===null||ie(l))?(e.exit("thematicBreak"),t(l)):n(l)}function c(l){return l===u?(e.consume(l),r++,c):(e.exit("thematicBreakSequence"),Se(l)?Ne(e,o,"whitespace")(l):o(l))}}const vt={continuation:{tokenize:fx},exit:px,name:"list",tokenize:dx},cx={partial:!0,tokenize:mx},lx={partial:!0,tokenize:hx};function dx(e,t,n){const r=this,u=r.events[r.events.length-1];let a=u&&u[1].type==="linePrefix"?u[2].sliceSerialize(u[1],!0).length:0,s=0;return o;function o(p){const g=r.containerState.type||(p===42||p===43||p===45?"listUnordered":"listOrdered");if(g==="listUnordered"?!r.containerState.marker||p===r.containerState.marker:Rs(p)){if(r.containerState.type||(r.containerState.type=g,e.enter(g,{_container:!0})),g==="listUnordered")return e.enter("listItemPrefix"),p===42||p===45?e.check($u,n,l)(p):l(p);if(!r.interrupt||p===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),c(p)}return n(p)}function c(p){return Rs(p)&&++s<10?(e.consume(p),c):(!r.interrupt||s<2)&&(r.containerState.marker?p===r.containerState.marker:p===41||p===46)?(e.exit("listItemValue"),l(p)):n(p)}function l(p){return e.enter("listItemMarker"),e.consume(p),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||p,e.check(_u,r.interrupt?n:h,e.attempt(cx,m,f))}function h(p){return r.containerState.initialBlankLine=!0,a++,m(p)}function f(p){return Se(p)?(e.enter("listItemPrefixWhitespace"),e.consume(p),e.exit("listItemPrefixWhitespace"),m):n(p)}function m(p){return r.containerState.size=a+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(p)}}function fx(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(_u,u,a);function u(o){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ne(e,t,"listItemIndent",r.containerState.size+1)(o)}function a(o){return r.containerState.furtherBlankLines||!Se(o)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,s(o)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(lx,t,s)(o))}function s(o){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ne(e,e.attempt(vt,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(o)}}function hx(e,t,n){const r=this;return Ne(e,u,"listItemIndent",r.containerState.size+1);function u(a){const s=r.events[r.events.length-1];return s&&s[1].type==="listItemIndent"&&s[2].sliceSerialize(s[1],!0).length===r.containerState.size?t(a):n(a)}}function px(e){e.exit(this.containerState.type)}function mx(e,t,n){const r=this;return Ne(e,u,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function u(a){const s=r.events[r.events.length-1];return!Se(a)&&s&&s[1].type==="listItemPrefixWhitespace"?t(a):n(a)}}const Qo={name:"setextUnderline",resolveTo:gx,tokenize:bx};function gx(e,t){let n=e.length,r,u,a;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(u=n)}else e[n][1].type==="content"&&e.splice(n,1),!a&&e[n][1].type==="definition"&&(a=n);const s={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[u][1].type="setextHeadingText",a?(e.splice(u,0,["enter",s,t]),e.splice(a+1,0,["exit",e[r][1],t]),e[r][1].end={...e[a][1].end}):e[r][1]=s,e.push(["exit",s,t]),e}function bx(e,t,n){const r=this;let u;return a;function a(l){let h=r.events.length,f;for(;h--;)if(r.events[h][1].type!=="lineEnding"&&r.events[h][1].type!=="linePrefix"&&r.events[h][1].type!=="content"){f=r.events[h][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||f)?(e.enter("setextHeadingLine"),u=l,s(l)):n(l)}function s(l){return e.enter("setextHeadingLineSequence"),o(l)}function o(l){return l===u?(e.consume(l),o):(e.exit("setextHeadingLineSequence"),Se(l)?Ne(e,c,"lineSuffix")(l):c(l))}function c(l){return l===null||ie(l)?(e.exit("setextHeadingLine"),t(l)):n(l)}}const _x={tokenize:xx};function xx(e){const t=this,n=e.attempt(_u,r,e.attempt(this.parser.constructs.flowInitial,u,Ne(e,e.attempt(this.parser.constructs.flow,u,e.attempt(k_,u)),"linePrefix")));return n;function r(a){if(a===null){e.consume(a);return}return e.enter("lineEndingBlank"),e.consume(a),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function u(a){if(a===null){e.consume(a);return}return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const Cx={resolveAll:Y0()},Ex=W0("string"),yx=W0("text");function W0(e){return{resolveAll:Y0(e==="text"?Tx:void 0),tokenize:t};function t(n){const r=this,u=this.parser.constructs[e],a=n.attempt(u,s,o);return s;function s(h){return l(h)?a(h):o(h)}function o(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),c}function c(h){return l(h)?(n.exit("data"),a(h)):(n.consume(h),c)}function l(h){if(h===null)return!0;const f=u[h];let m=-1;if(f)for(;++m<f.length;){const p=f[m];if(!p.previous||p.previous.call(r,r.previous))return!0}return!1}}}function Y0(e){return t;function t(n,r){let u=-1,a;for(;++u<=n.length;)a===void 0?n[u]&&n[u][1].type==="data"&&(a=u,u++):(!n[u]||n[u][1].type!=="data")&&(u!==a+2&&(n[a][1].end=n[u-1][1].end,n.splice(a+2,u-a-2),u=a+2),a=void 0);return e?e(n,r):n}}function Tx(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],u=t.sliceStream(r);let a=u.length,s=-1,o=0,c;for(;a--;){const l=u[a];if(typeof l=="string"){for(s=l.length;l.charCodeAt(s-1)===32;)o++,s--;if(s)break;s=-1}else if(l===-2)c=!0,o++;else if(l!==-1){a++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(o=0),o){const l={type:n===e.length||c||o<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:a?s:r.start._bufferIndex+s,_index:r.start._index+a,line:r.end.line,column:r.end.column-o,offset:r.end.offset-o},end:{...r.end}};r.end={...l.start},r.start.offset===r.end.offset?Object.assign(r,l):(e.splice(n,0,["enter",l,t],["exit",l,t]),n+=2)}n++}return e}const kx={42:vt,43:vt,45:vt,48:vt,49:vt,50:vt,51:vt,52:vt,53:vt,54:vt,55:vt,56:vt,57:vt,62:H0},Ax={91:v_},Sx={[-2]:es,[-1]:es,32:es},Ix={35:O_,42:$u,45:[Qo,$u],60:j_,61:Qo,95:$u,96:Xo,126:Xo},Nx={38:V0,92:U0},vx={[-5]:ts,[-4]:ts,[-3]:ts,33:rx,38:V0,42:Os,60:[a_,Z_],91:ax,92:[P_,U0],93:xi,95:Os,96:__},wx={null:[Os,Cx]},Dx={null:[42,95]},Lx={null:[]},Px=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:Dx,contentInitial:Ax,disable:Lx,document:kx,flow:Ix,flowInitial:Sx,insideSpan:wx,string:Nx,text:vx},Symbol.toStringTag,{value:"Module"}));function Rx(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const u={},a=[];let s=[],o=[];const c={attempt:O(I),check:O(S),consume:k,enter:y,exit:D,interrupt:O(S,{interrupt:!0})},l={code:null,containerState:{},defineSkip:x,events:[],now:g,parser:e,previous:null,sliceSerialize:m,sliceStream:p,write:f};let h=t.tokenize.call(l,c);return t.resolveAll&&a.push(t),l;function f(j){return s=Wt(s,j),E(),s[s.length-1]!==null?[]:(Z(t,0),l.events=ka(a,l.events,l),l.events)}function m(j,B){return Mx(p(j),B)}function p(j){return Ox(s,j)}function g(){const{_bufferIndex:j,_index:B,line:K,column:Y,offset:X}=r;return{_bufferIndex:j,_index:B,line:K,column:Y,offset:X}}function x(j){u[j.line]=j.column,L()}function E(){let j;for(;r._index<s.length;){const B=s[r._index];if(typeof B=="string")for(j=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===j&&r._bufferIndex<B.length;)_(B.charCodeAt(r._bufferIndex));else _(B)}}function _(j){h=h(j)}function k(j){ie(j)?(r.line++,r.column=1,r.offset+=j===-3?2:1,L()):j!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===s[r._index].length&&(r._bufferIndex=-1,r._index++)),l.previous=j}function y(j,B){const K=B||{};return K.type=j,K.start=g(),l.events.push(["enter",K,l]),o.push(K),K}function D(j){const B=o.pop();return B.end=g(),l.events.push(["exit",B,l]),B}function I(j,B){Z(j,B.from)}function S(j,B){B.restore()}function O(j,B){return K;function K(Y,X,ue){let he,De,Te,C;return Array.isArray(Y)?ne(Y):"tokenize"in Y?ne([Y]):U(Y);function U(J){return ce;function ce(oe){const ae=oe!==null&&J[oe],pe=oe!==null&&J.null,Ue=[...Array.isArray(ae)?ae:ae?[ae]:[],...Array.isArray(pe)?pe:pe?[pe]:[]];return ne(Ue)(oe)}}function ne(J){return he=J,De=0,J.length===0?ue:N(J[De])}function N(J){return ce;function ce(oe){return C=H(),Te=J,J.partial||(l.currentConstruct=J),J.name&&l.parser.constructs.disable.null.includes(J.name)?te():J.tokenize.call(B?Object.assign(Object.create(l),B):l,c,ee,te)(oe)}}function ee(J){return j(Te,C),X}function te(J){return C.restore(),++De<he.length?N(he[De]):ue}}}function Z(j,B){j.resolveAll&&!a.includes(j)&&a.push(j),j.resolve&&Ut(l.events,B,l.events.length-B,j.resolve(l.events.slice(B),l)),j.resolveTo&&(l.events=j.resolveTo(l.events,l))}function H(){const j=g(),B=l.previous,K=l.currentConstruct,Y=l.events.length,X=Array.from(o);return{from:Y,restore:ue};function ue(){r=j,l.previous=B,l.currentConstruct=K,l.events.length=Y,o=X,L()}}function L(){r.line in u&&r.column<2&&(r.column=u[r.line],r.offset+=u[r.line]-1)}}function Ox(e,t){const n=t.start._index,r=t.start._bufferIndex,u=t.end._index,a=t.end._bufferIndex;let s;if(n===u)s=[e[n].slice(r,a)];else{if(s=e.slice(n,u),r>-1){const o=s[0];typeof o=="string"?s[0]=o.slice(r):s.shift()}a>0&&s.push(e[u].slice(0,a))}return s}function Mx(e,t){let n=-1;const r=[];let u;for(;++n<e.length;){const a=e[n];let s;if(typeof a=="string")s=a;else switch(a){case-5:{s="\r";break}case-4:{s=`
81
81
  `;break}case-3:{s=`\r
82
82
  `;break}case-2:{s=t?" ":" ";break}case-1:{if(!t&&u)continue;s=" ";break}default:s=String.fromCharCode(a)}u=a===-2,r.push(s)}return r.join("")}function Fx(e){const r={constructs:B0([Px,...(e||{}).extensions||[]]),content:u(Qb),defined:[],document:u(e_),flow:u(_x),lazy:{},string:u(Ex),text:u(yx)};return r;function u(a){return s;function s(o){return Rx(r,a,o)}}}function Bx(e){for(;!$0(e););return e}const Jo=/[\0\t\n\r]/g;function jx(){let e=1,t="",n=!0,r;return u;function u(a,s,o){const c=[];let l,h,f,m,p;for(a=t+(typeof a=="string"?a.toString():new TextDecoder(s||void 0).decode(a)),f=0,t="",n&&(a.charCodeAt(0)===65279&&f++,n=void 0);f<a.length;){if(Jo.lastIndex=f,l=Jo.exec(a),m=l&&l.index!==void 0?l.index:a.length,p=a.charCodeAt(m),!l){t=a.slice(f);break}if(p===10&&f===m&&r)c.push(-3),r=void 0;else switch(r&&(c.push(-5),r=void 0),f<m&&(c.push(a.slice(f,m)),e+=m-f),p){case 0:{c.push(65533),e++;break}case 9:{for(h=Math.ceil(e/4)*4,c.push(-2);e++<h;)c.push(-1);break}case 10:{c.push(-4),e=1;break}default:r=!0,e=1}f=m+1}return o&&(r&&c.push(-5),t&&c.push(t),c.push(null)),c}}const Hx=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function Ux(e){return e.replace(Hx,Vx)}function Vx(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const u=n.charCodeAt(1),a=u===120||u===88;return j0(n.slice(a?2:1),a?16:10)}return _i(n)||e}const G0={}.hasOwnProperty;function $x(e,t,n){return typeof t!="string"&&(n=t,t=void 0),zx(n)(Bx(Fx(n).document().write(jx()(e,t,!0))))}function zx(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a(Ie),autolinkProtocol:H,autolinkEmail:H,atxHeading:a(Q),blockQuote:a(pe),characterEscape:H,characterReference:H,codeFenced:a(Ue),codeFencedFenceInfo:s,codeFencedFenceMeta:s,codeIndented:a(Ue,s),codeText:a(G,s),codeTextData:H,data:H,codeFlowValue:H,definition:a(dt),definitionDestinationString:s,definitionLabelString:s,definitionTitleString:s,emphasis:a(re),hardBreakEscape:a(Ce),hardBreakTrailing:a(Ce),htmlFlow:a(se,s),htmlFlowData:H,htmlText:a(se,s),htmlTextData:H,image:a(me),label:s,link:a(Ie),listItem:a(gn),listItemValue:m,listOrdered:a(tt,f),listUnordered:a(tt),paragraph:a(mt),reference:N,referenceString:s,resourceDestinationString:s,resourceTitleString:s,setextHeading:a(Q),strong:a(Ve),thematicBreak:a($t)},exit:{atxHeading:c(),atxHeadingSequence:I,autolink:c(),autolinkEmail:ae,autolinkProtocol:oe,blockQuote:c(),characterEscapeValue:L,characterReferenceMarkerHexadecimal:te,characterReferenceMarkerNumeric:te,characterReferenceValue:J,characterReference:ce,codeFenced:c(E),codeFencedFence:x,codeFencedFenceInfo:p,codeFencedFenceMeta:g,codeFlowValue:L,codeIndented:c(_),codeText:c(X),codeTextData:L,data:L,definition:c(),definitionDestinationString:D,definitionLabelString:k,definitionTitleString:y,emphasis:c(),hardBreakEscape:c(B),hardBreakTrailing:c(B),htmlFlow:c(K),htmlFlowData:L,htmlText:c(Y),htmlTextData:L,image:c(he),label:Te,labelText:De,lineEnding:j,link:c(ue),listItem:c(),listOrdered:c(),listUnordered:c(),paragraph:c(),referenceString:ee,resourceDestinationString:C,resourceTitleString:U,resource:ne,setextHeading:c(Z),setextHeadingLineSequence:O,setextHeadingText:S,strong:c(),thematicBreak:c()}};X0(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(F){let W={type:"root",children:[]};const fe={stack:[W],tokenStack:[],config:t,enter:o,exit:l,buffer:s,resume:h,data:n},ke=[];let Oe=-1;for(;++Oe<F.length;)if(F[Oe][1].type==="listOrdered"||F[Oe][1].type==="listUnordered")if(F[Oe][0]==="enter")ke.push(Oe);else{const Rt=ke.pop();Oe=u(F,Rt,Oe)}for(Oe=-1;++Oe<F.length;){const Rt=t[F[Oe][0]];G0.call(Rt,F[Oe][1].type)&&Rt[F[Oe][1].type].call(Object.assign({sliceSerialize:F[Oe][2].sliceSerialize},fe),F[Oe][1])}if(fe.tokenStack.length>0){const Rt=fe.tokenStack[fe.tokenStack.length-1];(Rt[1]||ec).call(fe,void 0,Rt[0])}for(W.position={start:wn(F.length>0?F[0][1].start:{line:1,column:1,offset:0}),end:wn(F.length>0?F[F.length-2][1].end:{line:1,column:1,offset:0})},Oe=-1;++Oe<t.transforms.length;)W=t.transforms[Oe](W)||W;return W}function u(F,W,fe){let ke=W-1,Oe=-1,Rt=!1,bn,ft,_n,Zn;for(;++ke<=fe;){const Ot=F[ke];switch(Ot[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Ot[0]==="enter"?Oe++:Oe--,Zn=void 0;break}case"lineEndingBlank":{Ot[0]==="enter"&&(bn&&!Zn&&!Oe&&!_n&&(_n=ke),Zn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Zn=void 0}if(!Oe&&Ot[0]==="enter"&&Ot[1].type==="listItemPrefix"||Oe===-1&&Ot[0]==="exit"&&(Ot[1].type==="listUnordered"||Ot[1].type==="listOrdered")){if(bn){let cr=ke;for(ft=void 0;cr--;){const xn=F[cr];if(xn[1].type==="lineEnding"||xn[1].type==="lineEndingBlank"){if(xn[0]==="exit")continue;ft&&(F[ft][1].type="lineEndingBlank",Rt=!0),xn[1].type="lineEnding",ft=cr}else if(!(xn[1].type==="linePrefix"||xn[1].type==="blockQuotePrefix"||xn[1].type==="blockQuotePrefixWhitespace"||xn[1].type==="blockQuoteMarker"||xn[1].type==="listItemIndent"))break}_n&&(!ft||_n<ft)&&(bn._spread=!0),bn.end=Object.assign({},ft?F[ft][1].start:Ot[1].end),F.splice(ft||ke,0,["exit",bn,Ot[2]]),ke++,fe++}if(Ot[1].type==="listItemPrefix"){const cr={type:"listItem",_spread:!1,start:Object.assign({},Ot[1].start),end:void 0};bn=cr,F.splice(ke,0,["enter",cr,Ot[2]]),ke++,fe++,_n=void 0,Zn=!0}}}return F[W][1]._spread=Rt,fe}function a(F,W){return fe;function fe(ke){o.call(this,F(ke),ke),W&&W.call(this,ke)}}function s(){this.stack.push({type:"fragment",children:[]})}function o(F,W,fe){this.stack[this.stack.length-1].children.push(F),this.stack.push(F),this.tokenStack.push([W,fe||void 0]),F.position={start:wn(W.start),end:void 0}}function c(F){return W;function W(fe){F&&F.call(this,fe),l.call(this,fe)}}function l(F,W){const fe=this.stack.pop(),ke=this.tokenStack.pop();if(ke)ke[0].type!==F.type&&(W?W.call(this,F,ke[0]):(ke[1]||ec).call(this,F,ke[0]));else throw new Error("Cannot close `"+F.type+"` ("+Wr({start:F.start,end:F.end})+"): it’s not open");fe.position.end=wn(F.end)}function h(){return bi(this.stack.pop())}function f(){this.data.expectingFirstListItemValue=!0}function m(F){if(this.data.expectingFirstListItemValue){const W=this.stack[this.stack.length-2];W.start=Number.parseInt(this.sliceSerialize(F),10),this.data.expectingFirstListItemValue=void 0}}function p(){const F=this.resume(),W=this.stack[this.stack.length-1];W.lang=F}function g(){const F=this.resume(),W=this.stack[this.stack.length-1];W.meta=F}function x(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const F=this.resume(),W=this.stack[this.stack.length-1];W.value=F.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function _(){const F=this.resume(),W=this.stack[this.stack.length-1];W.value=F.replace(/(\r?\n|\r)$/g,"")}function k(F){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.label=W,fe.identifier=en(this.sliceSerialize(F)).toLowerCase()}function y(){const F=this.resume(),W=this.stack[this.stack.length-1];W.title=F}function D(){const F=this.resume(),W=this.stack[this.stack.length-1];W.url=F}function I(F){const W=this.stack[this.stack.length-1];if(!W.depth){const fe=this.sliceSerialize(F).length;W.depth=fe}}function S(){this.data.setextHeadingSlurpLineEnding=!0}function O(F){const W=this.stack[this.stack.length-1];W.depth=this.sliceSerialize(F).codePointAt(0)===61?1:2}function Z(){this.data.setextHeadingSlurpLineEnding=void 0}function H(F){const fe=this.stack[this.stack.length-1].children;let ke=fe[fe.length-1];(!ke||ke.type!=="text")&&(ke=nt(),ke.position={start:wn(F.start),end:void 0},fe.push(ke)),this.stack.push(ke)}function L(F){const W=this.stack.pop();W.value+=this.sliceSerialize(F),W.position.end=wn(F.end)}function j(F){const W=this.stack[this.stack.length-1];if(this.data.atHardBreak){const fe=W.children[W.children.length-1];fe.position.end=wn(F.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(W.type)&&(H.call(this,F),L.call(this,F))}function B(){this.data.atHardBreak=!0}function K(){const F=this.resume(),W=this.stack[this.stack.length-1];W.value=F}function Y(){const F=this.resume(),W=this.stack[this.stack.length-1];W.value=F}function X(){const F=this.resume(),W=this.stack[this.stack.length-1];W.value=F}function ue(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=W,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function he(){const F=this.stack[this.stack.length-1];if(this.data.inReference){const W=this.data.referenceType||"shortcut";F.type+="Reference",F.referenceType=W,delete F.url,delete F.title}else delete F.identifier,delete F.label;this.data.referenceType=void 0}function De(F){const W=this.sliceSerialize(F),fe=this.stack[this.stack.length-2];fe.label=Ux(W),fe.identifier=en(W).toLowerCase()}function Te(){const F=this.stack[this.stack.length-1],W=this.resume(),fe=this.stack[this.stack.length-1];if(this.data.inReference=!0,fe.type==="link"){const ke=F.children;fe.children=ke}else fe.alt=W}function C(){const F=this.resume(),W=this.stack[this.stack.length-1];W.url=F}function U(){const F=this.resume(),W=this.stack[this.stack.length-1];W.title=F}function ne(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ee(F){const W=this.resume(),fe=this.stack[this.stack.length-1];fe.label=W,fe.identifier=en(this.sliceSerialize(F)).toLowerCase(),this.data.referenceType="full"}function te(F){this.data.characterReferenceType=F.type}function J(F){const W=this.sliceSerialize(F),fe=this.data.characterReferenceType;let ke;fe?(ke=j0(W,fe==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ke=_i(W);const Oe=this.stack[this.stack.length-1];Oe.value+=ke}function ce(F){const W=this.stack.pop();W.position.end=wn(F.end)}function oe(F){L.call(this,F);const W=this.stack[this.stack.length-1];W.url=this.sliceSerialize(F)}function ae(F){L.call(this,F);const W=this.stack[this.stack.length-1];W.url="mailto:"+this.sliceSerialize(F)}function pe(){return{type:"blockquote",children:[]}}function Ue(){return{type:"code",lang:null,meta:null,value:""}}function G(){return{type:"inlineCode",value:""}}function dt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function re(){return{type:"emphasis",children:[]}}function Q(){return{type:"heading",depth:0,children:[]}}function Ce(){return{type:"break"}}function se(){return{type:"html",value:""}}function me(){return{type:"image",title:null,url:"",alt:null}}function Ie(){return{type:"link",title:null,url:"",children:[]}}function tt(F){return{type:"list",ordered:F.type==="listOrdered",start:null,spread:F._spread,children:[]}}function gn(F){return{type:"listItem",spread:F._spread,checked:null,children:[]}}function mt(){return{type:"paragraph",children:[]}}function Ve(){return{type:"strong",children:[]}}function nt(){return{type:"text",value:""}}function $t(){return{type:"thematicBreak"}}}function wn(e){return{line:e.line,column:e.column,offset:e.offset}}function X0(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?X0(e,r):qx(e,r)}}function qx(e,t){let n;for(n in t)if(G0.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function ec(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+Wr({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+Wr({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+Wr({start:t.start,end:t.end})+") is still open")}function Zx(e){const t=this;t.parser=n;function n(r){return $x(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function Wx(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function Yx(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`