@anpayeras/agnostic-checkout 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -1,157 +1,136 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("react");function oe(e){const t=e.replace("#",""),s=t.length===3?t.split("").map(r=>r+r).join(""):t;return{r:parseInt(s.slice(0,2),16),g:parseInt(s.slice(2,4),16),b:parseInt(s.slice(4,6),16)}}function je({r:e,g:t,b:s}){const r=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(s)}`}function _e(e){const{r:t,g:s,b:r}=oe(e),[n,i,l]=[t/255,s/255,r/255].map(d=>d<=.03928?d/12.92:Math.pow((d+.055)/1.055,2.4));return .2126*n+.7152*i+.0722*l}function Ke(e){return _e(e)>.179?"#000000":"#FFFFFF"}function Tt(e){return _e(e)<.179}function Rt(e,t){const s=oe(e),r=1-t/100;return je({r:s.r*r,g:s.g*r,b:s.b*r})}function _t(e,t){const s=oe(e),r=t/100;return je({r:s.r+(255-s.r)*r,g:s.g+(255-s.g)*r,b:s.b+(255-s.b)*r})}function Pt(e,t,s){const r=oe(e),n=oe(t);return je({r:r.r+(n.r-r.r)*s,g:r.g+(n.g-r.g)*s,b:r.b+(n.b-r.b)*s})}const et={colors:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",text:"#0f172a",border:"#e2e8f0",success:"#22c55e",error:"#ef4444"},radius:"0.75rem",fontFamily:"Inter, system-ui, sans-serif"},At={colors:{primary:"#818cf8",background:"#0f172a",surface:"#1e293b",text:"#f1f5f9",border:"#334155",success:"#34d399",error:"#fb7185"},radius:"0.75rem",fontFamily:"Inter, system-ui, sans-serif"},Mt={colors:{primary:"#0f172a",background:"#ffffff",surface:"#ffffff",text:"#0f172a",border:"#e5e7eb",success:"#059669",error:"#dc2626"},radius:"0.375rem",fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif"},It={colors:{primary:"#1d4ed8",background:"#f0f4f8",surface:"#ffffff",text:"#1e293b",border:"#cbd5e1",success:"#16a34a",error:"#dc2626"},radius:"0.5rem",fontFamily:"'Segoe UI', Roboto, 'Helvetica Neue', sans-serif"},Ot={colors:{primary:"#a855f7",background:"#0a0a0a",surface:"#171717",text:"#fafafa",border:"#2e2e2e",success:"#22d3ee",error:"#f43f5e"},radius:"1rem",fontFamily:"'Space Grotesk', system-ui, sans-serif"},tt={light:et,dark:At,minimal:Mt,corporate:It,neon:Ot},Ee=et;function Se(e,t){return t?{colors:{...e.colors,...t.colors},radius:t.radius??e.radius,fontFamily:t.fontFamily??e.fontFamily}:e}function rt(e){return{"--color-primary":e.colors.primary,"--color-background":e.colors.background,"--color-surface":e.colors.surface,"--color-text":e.colors.text,"--color-border":e.colors.border,"--color-success":e.colors.success,"--color-error":e.colors.error,"--theme-radius":e.radius,"--theme-font":e.fontFamily}}function ot(e){const t="#FFFFFF",s=Ke(t);return{colors:{primary:e,background:t,surface:"#F9FAFB",text:s,border:"#E5E7EB",success:"#16A34A",error:"#DC2626"},radius:"0.75rem",fontFamily:"Inter, system-ui, sans-serif"}}function st(e,t,s){let r;return t?r=ot(t):typeof e=="string"?r=tt[e]??Ee:r=Se(Ee,e),Se(r,s)}var Te={exports:{}},le={};/**
2
- * @license React
3
- * react-jsx-runtime.production.js
4
- *
5
- * Copyright (c) Meta Platforms, Inc. and affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */var Oe;function zt(){if(Oe)return le;Oe=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function s(r,n,i){var l=null;if(i!==void 0&&(l=""+i),n.key!==void 0&&(l=""+n.key),"key"in n){i={};for(var d in n)d!=="key"&&(i[d]=n[d])}else i=n;return n=i.ref,{$$typeof:e,type:r,key:l,ref:n!==void 0?n:null,props:i}}return le.Fragment=t,le.jsx=s,le.jsxs=s,le}var ce={};/**
10
- * @license React
11
- * react-jsx-runtime.development.js
12
- *
13
- * Copyright (c) Meta Platforms, Inc. and affiliates.
14
- *
15
- * This source code is licensed under the MIT license found in the
16
- * LICENSE file in the root directory of this source tree.
17
- */var ze;function Dt(){return ze||(ze=1,process.env.NODE_ENV!=="production"&&function(){function e(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===me?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case k:return"Fragment";case S:return"Profiler";case F:return"StrictMode";case B:return"Suspense";case J:return"SuspenseList";case ue:return"Activity"}if(typeof c=="object")switch(typeof c.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),c.$$typeof){case b:return"Portal";case $:return c.displayName||"Context";case z:return(c._context.displayName||"Context")+".Consumer";case q:var y=c.render;return c=c.displayName,c||(c=y.displayName||y.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case x:return y=c.displayName||null,y!==null?y:e(c.type)||"Memo";case O:y=c._payload,c=c._init;try{return e(c(y))}catch{}}return null}function t(c){return""+c}function s(c){try{t(c);var y=!1}catch{y=!0}if(y){y=console;var E=y.error,R=typeof Symbol=="function"&&Symbol.toStringTag&&c[Symbol.toStringTag]||c.constructor.name||"Object";return E.call(y,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",R),t(c)}}function r(c){if(c===k)return"<>";if(typeof c=="object"&&c!==null&&c.$$typeof===O)return"<...>";try{var y=e(c);return y?"<"+y+">":"<...>"}catch{return"<...>"}}function n(){var c=W.A;return c===null?null:c.getOwner()}function i(){return Error("react-stack-top-frame")}function l(c){if(ae.call(c,"key")){var y=Object.getOwnPropertyDescriptor(c,"key").get;if(y&&y.isReactWarning)return!1}return c.key!==void 0}function d(c,y){function E(){D||(D=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",y))}E.isReactWarning=!0,Object.defineProperty(c,"key",{get:E,configurable:!0})}function a(){var c=e(this.type);return G[c]||(G[c]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),c=this.props.ref,c!==void 0?c:null}function u(c,y,E,R,P,A){var T=E.ref;return c={$$typeof:j,type:c,key:y,props:E,_owner:R},(T!==void 0?T:null)!==null?Object.defineProperty(c,"ref",{enumerable:!1,get:a}):Object.defineProperty(c,"ref",{enumerable:!1,value:null}),c._store={},Object.defineProperty(c._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(c,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(c,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.defineProperty(c,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:A}),Object.freeze&&(Object.freeze(c.props),Object.freeze(c)),c}function f(c,y,E,R,P,A){var T=y.children;if(T!==void 0)if(R)if(ie(T)){for(R=0;R<T.length;R++)C(T[R]);Object.freeze&&Object.freeze(T)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else C(T);if(ae.call(y,"key")){T=e(c);var V=Object.keys(y).filter(function(pe){return pe!=="key"});R=0<V.length?"{key: someKey, "+V.join(": ..., ")+": ...}":"{key: someKey}",h[T+R]||(V=0<V.length?"{"+V.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
- let props = %s;
19
- <%s {...props} />
20
- React keys must be passed directly to JSX without using spread:
21
- let props = %s;
22
- <%s key={someKey} {...props} />`,R,T,V,T),h[T+R]=!0)}if(T=null,E!==void 0&&(s(E),T=""+E),l(y)&&(s(y.key),T=""+y.key),"key"in y){E={};for(var _ in y)_!=="key"&&(E[_]=y[_])}else E=y;return T&&d(E,typeof c=="function"?c.displayName||c.name||"Unknown":c),u(c,T,E,n(),P,A)}function C(c){g(c)?c._store&&(c._store.validated=1):typeof c=="object"&&c!==null&&c.$$typeof===O&&(c._payload.status==="fulfilled"?g(c._payload.value)&&c._payload.value._store&&(c._payload.value._store.validated=1):c._store&&(c._store.validated=1))}function g(c){return typeof c=="object"&&c!==null&&c.$$typeof===j}var w=N,j=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),F=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),$=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),J=Symbol.for("react.suspense_list"),x=Symbol.for("react.memo"),O=Symbol.for("react.lazy"),ue=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),W=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=Object.prototype.hasOwnProperty,ie=Array.isArray,U=console.createTask?console.createTask:function(){return null};w={react_stack_bottom_frame:function(c){return c()}};var D,G={},te=w.react_stack_bottom_frame.bind(w,i)(),re=U(r(i)),h={};ce.Fragment=k,ce.jsx=function(c,y,E){var R=1e4>W.recentlyCreatedOwnerStacks++;return f(c,y,E,!1,R?Error("react-stack-top-frame"):te,R?U(r(c)):re)},ce.jsxs=function(c,y,E){var R=1e4>W.recentlyCreatedOwnerStacks++;return f(c,y,E,!0,R?Error("react-stack-top-frame"):te,R?U(r(c)):re)}}()),ce}process.env.NODE_ENV==="production"?Te.exports=zt():Te.exports=Dt();var o=Te.exports;/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("react/jsx-runtime"),v=require("react");function Y(e){const t=e.replace("#",""),o=t.length===3?t.split("").map(r=>r+r).join(""):t;return{r:parseInt(o.slice(0,2),16),g:parseInt(o.slice(2,4),16),b:parseInt(o.slice(4,6),16)}}function ce({r:e,g:t,b:o}){const r=n=>Math.max(0,Math.min(255,Math.round(n))).toString(16).padStart(2,"0");return`#${r(e)}${r(t)}${r(o)}`}function ye(e){const{r:t,g:o,b:r}=Y(e),[n,l,i]=[t/255,o/255,r/255].map(c=>c<=.03928?c/12.92:Math.pow((c+.055)/1.055,2.4));return .2126*n+.7152*l+.0722*i}function We(e){return ye(e)>.179?"#000000":"#FFFFFF"}function jt(e){return ye(e)<.179}function Nt(e,t){const o=Y(e),r=1-t/100;return ce({r:o.r*r,g:o.g*r,b:o.b*r})}function Ct(e,t){const o=Y(e),r=t/100;return ce({r:o.r+(255-o.r)*r,g:o.g+(255-o.g)*r,b:o.b+(255-o.b)*r})}function St(e,t,o){const r=Y(e),n=Y(t);return ce({r:r.r+(n.r-r.r)*o,g:r.g+(n.g-r.g)*o,b:r.b+(n.b-r.b)*o})}const He={colors:{primary:"#6366f1",background:"#f8fafc",surface:"#ffffff",text:"#0f172a",border:"#e2e8f0",success:"#22c55e",error:"#ef4444"},radius:"0.75rem",fontFamily:"Inter, system-ui, sans-serif"},Et={colors:{primary:"#818cf8",background:"#0f172a",surface:"#1e293b",text:"#f1f5f9",border:"#334155",success:"#34d399",error:"#fb7185"},radius:"0.75rem",fontFamily:"Inter, system-ui, sans-serif"},Pt={colors:{primary:"#0f172a",background:"#ffffff",surface:"#ffffff",text:"#0f172a",border:"#e5e7eb",success:"#059669",error:"#dc2626"},radius:"0.375rem",fontFamily:"'Helvetica Neue', Helvetica, Arial, sans-serif"},Tt={colors:{primary:"#1d4ed8",background:"#f0f4f8",surface:"#ffffff",text:"#1e293b",border:"#cbd5e1",success:"#16a34a",error:"#dc2626"},radius:"0.5rem",fontFamily:"'Segoe UI', Roboto, 'Helvetica Neue', sans-serif"},Rt={colors:{primary:"#a855f7",background:"#0a0a0a",surface:"#171717",text:"#fafafa",border:"#2e2e2e",success:"#22d3ee",error:"#f43f5e"},radius:"1rem",fontFamily:"'Space Grotesk', system-ui, sans-serif"},Xe={light:He,dark:Et,minimal:Pt,corporate:Tt,neon:Rt},fe=He;function be(e,t){return t?{colors:{...e.colors,...t.colors},radius:t.radius??e.radius,fontFamily:t.fontFamily??e.fontFamily}:e}function Je(e){return{"--color-primary":e.colors.primary,"--color-background":e.colors.background,"--color-surface":e.colors.surface,"--color-text":e.colors.text,"--color-border":e.colors.border,"--color-success":e.colors.success,"--color-error":e.colors.error,"--theme-radius":e.radius,"--theme-font":e.fontFamily}}function Ke(e){const t="#FFFFFF",o=We(t);return{colors:{primary:e,background:t,surface:"#F9FAFB",text:o,border:"#E5E7EB",success:"#16A34A",error:"#DC2626"},radius:"0.75rem",fontFamily:"Inter, system-ui, sans-serif"}}function Ze(e,t,o){let r;return t?r=Ke(t):typeof e=="string"?r=Xe[e]??fe:r=be(fe,e),be(r,o)}/**
23
2
  * @license lucide-react v0.575.0 - ISC
24
3
  *
25
4
  * This source code is licensed under the ISC license.
26
5
  * See the LICENSE file in the root directory of this source tree.
27
- */const nt=(...e)=>e.filter((t,s,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===s).join(" ").trim();/**
6
+ */const et=(...e)=>e.filter((t,o,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===o).join(" ").trim();/**
28
7
  * @license lucide-react v0.575.0 - ISC
29
8
  *
30
9
  * This source code is licensed under the ISC license.
31
10
  * See the LICENSE file in the root directory of this source tree.
32
- */const Lt=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
11
+ */const At=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
33
12
  * @license lucide-react v0.575.0 - ISC
34
13
  *
35
14
  * This source code is licensed under the ISC license.
36
15
  * See the LICENSE file in the root directory of this source tree.
37
- */const Ft=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,s,r)=>r?r.toUpperCase():s.toLowerCase());/**
16
+ */const Mt=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,r)=>r?r.toUpperCase():o.toLowerCase());/**
38
17
  * @license lucide-react v0.575.0 - ISC
39
18
  *
40
19
  * This source code is licensed under the ISC license.
41
20
  * See the LICENSE file in the root directory of this source tree.
42
- */const De=e=>{const t=Ft(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
21
+ */const Me=e=>{const t=Mt(e);return t.charAt(0).toUpperCase()+t.slice(1)};/**
43
22
  * @license lucide-react v0.575.0 - ISC
44
23
  *
45
24
  * This source code is licensed under the ISC license.
46
25
  * See the LICENSE file in the root directory of this source tree.
47
- */var $t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
26
+ */var _t={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
48
27
  * @license lucide-react v0.575.0 - ISC
49
28
  *
50
29
  * This source code is licensed under the ISC license.
51
30
  * See the LICENSE file in the root directory of this source tree.
52
- */const Ut=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
31
+ */const It=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0;return!1};/**
53
32
  * @license lucide-react v0.575.0 - ISC
54
33
  *
55
34
  * This source code is licensed under the ISC license.
56
35
  * See the LICENSE file in the root directory of this source tree.
57
- */const Gt=N.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:s=2,absoluteStrokeWidth:r,className:n="",children:i,iconNode:l,...d},a)=>N.createElement("svg",{ref:a,...$t,width:t,height:t,stroke:e,strokeWidth:r?Number(s)*24/Number(t):s,className:nt("lucide",n),...!i&&!Ut(d)&&{"aria-hidden":"true"},...d},[...l.map(([u,f])=>N.createElement(u,f)),...Array.isArray(i)?i:[i]]));/**
36
+ */const zt=v.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:r,className:n="",children:l,iconNode:i,...c},a)=>v.createElement("svg",{ref:a,..._t,width:t,height:t,stroke:e,strokeWidth:r?Number(o)*24/Number(t):o,className:et("lucide",n),...!l&&!It(c)&&{"aria-hidden":"true"},...c},[...i.map(([d,x])=>v.createElement(d,x)),...Array.isArray(l)?l:[l]]));/**
58
37
  * @license lucide-react v0.575.0 - ISC
59
38
  *
60
39
  * This source code is licensed under the ISC license.
61
40
  * See the LICENSE file in the root directory of this source tree.
62
- */const I=(e,t)=>{const s=N.forwardRef(({className:r,...n},i)=>N.createElement(Gt,{ref:i,iconNode:t,className:nt(`lucide-${Lt(De(e))}`,`lucide-${e}`,r),...n}));return s.displayName=De(e),s};/**
41
+ */const S=(e,t)=>{const o=v.forwardRef(({className:r,...n},l)=>v.createElement(zt,{ref:l,iconNode:t,className:et(`lucide-${At(Me(e))}`,`lucide-${e}`,r),...n}));return o.displayName=Me(e),o};/**
63
42
  * @license lucide-react v0.575.0 - ISC
64
43
  *
65
44
  * This source code is licensed under the ISC license.
66
45
  * See the LICENSE file in the root directory of this source tree.
67
- */const Bt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vt=I("chevron-down",Bt);/**
46
+ */const Dt=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Ot=S("chevron-down",Dt);/**
68
47
  * @license lucide-react v0.575.0 - ISC
69
48
  *
70
49
  * This source code is licensed under the ISC license.
71
50
  * See the LICENSE file in the root directory of this source tree.
72
- */const Yt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],qt=I("chevron-left",Yt);/**
51
+ */const Lt=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],Ft=S("chevron-left",Lt);/**
73
52
  * @license lucide-react v0.575.0 - ISC
74
53
  *
75
54
  * This source code is licensed under the ISC license.
76
55
  * See the LICENSE file in the root directory of this source tree.
77
- */const Wt=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Qt=I("chevron-right",Wt);/**
56
+ */const $t=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Bt=S("chevron-right",$t);/**
78
57
  * @license lucide-react v0.575.0 - ISC
79
58
  *
80
59
  * This source code is licensed under the ISC license.
81
60
  * See the LICENSE file in the root directory of this source tree.
82
- */const Ht=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Xt=I("chevron-up",Ht);/**
61
+ */const Gt=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ut=S("chevron-up",Gt);/**
83
62
  * @license lucide-react v0.575.0 - ISC
84
63
  *
85
64
  * This source code is licensed under the ISC license.
86
65
  * See the LICENSE file in the root directory of this source tree.
87
- */const Jt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Zt=I("circle-check",Jt);/**
66
+ */const Vt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],qt=S("circle-check",Vt);/**
88
67
  * @license lucide-react v0.575.0 - ISC
89
68
  *
90
69
  * This source code is licensed under the ISC license.
91
70
  * See the LICENSE file in the root directory of this source tree.
92
- */const Kt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],er=I("circle-x",Kt);/**
71
+ */const Qt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Yt=S("circle-x",Qt);/**
93
72
  * @license lucide-react v0.575.0 - ISC
94
73
  *
95
74
  * This source code is licensed under the ISC license.
96
75
  * See the LICENSE file in the root directory of this source tree.
97
- */const tr=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],rr=I("clock",tr);/**
76
+ */const Wt=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6l4 2",key:"mmk7yg"}]],Ht=S("clock",Wt);/**
98
77
  * @license lucide-react v0.575.0 - ISC
99
78
  *
100
79
  * This source code is licensed under the ISC license.
101
80
  * See the LICENSE file in the root directory of this source tree.
102
- */const or=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],Le=I("code-xml",or);/**
81
+ */const Xt=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],_e=S("code-xml",Xt);/**
103
82
  * @license lucide-react v0.575.0 - ISC
104
83
  *
105
84
  * This source code is licensed under the ISC license.
106
85
  * See the LICENSE file in the root directory of this source tree.
107
- */const sr=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],nr=I("credit-card",sr);/**
86
+ */const Jt=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Kt=S("credit-card",Jt);/**
108
87
  * @license lucide-react v0.575.0 - ISC
109
88
  *
110
89
  * This source code is licensed under the ISC license.
111
90
  * See the LICENSE file in the root directory of this source tree.
112
- */const ar=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],ir=I("external-link",ar);/**
91
+ */const Zt=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],er=S("external-link",Zt);/**
113
92
  * @license lucide-react v0.575.0 - ISC
114
93
  *
115
94
  * This source code is licensed under the ISC license.
116
95
  * See the LICENSE file in the root directory of this source tree.
117
- */const lr=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],cr=I("landmark",lr);/**
96
+ */const tr=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.12 2.198a2 2 0 0 1 1.76.006l7.866 3.847c.476.233.31.949-.22.949H3.474c-.53 0-.695-.716-.22-.949z",key:"1m329m"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],rr=S("landmark",tr);/**
118
97
  * @license lucide-react v0.575.0 - ISC
119
98
  *
120
99
  * This source code is licensed under the ISC license.
121
100
  * See the LICENSE file in the root directory of this source tree.
122
- */const dr=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],K=I("loader-circle",dr);/**
101
+ */const sr=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],U=S("loader-circle",sr);/**
123
102
  * @license lucide-react v0.575.0 - ISC
124
103
  *
125
104
  * This source code is licensed under the ISC license.
126
105
  * See the LICENSE file in the root directory of this source tree.
127
- */const ur=[["path",{d:"M5 12h14",key:"1ays0h"}]],mr=I("minus",ur);/**
106
+ */const or=[["path",{d:"M5 12h14",key:"1ays0h"}]],nr=S("minus",or);/**
128
107
  * @license lucide-react v0.575.0 - ISC
129
108
  *
130
109
  * This source code is licensed under the ISC license.
131
110
  * See the LICENSE file in the root directory of this source tree.
132
- */const pr=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],fr=I("plus",pr);/**
111
+ */const ar=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ir=S("plus",ar);/**
133
112
  * @license lucide-react v0.575.0 - ISC
134
113
  *
135
114
  * This source code is licensed under the ISC license.
136
115
  * See the LICENSE file in the root directory of this source tree.
137
- */const xr=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],hr=I("shield-check",xr);/**
116
+ */const lr=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],cr=S("shield-check",lr);/**
138
117
  * @license lucide-react v0.575.0 - ISC
139
118
  *
140
119
  * This source code is licensed under the ISC license.
141
120
  * See the LICENSE file in the root directory of this source tree.
142
- */const br=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],gr=I("tag",br);/**
121
+ */const dr=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],mr=S("tag",dr);/**
143
122
  * @license lucide-react v0.575.0 - ISC
144
123
  *
145
124
  * This source code is licensed under the ISC license.
146
125
  * See the LICENSE file in the root directory of this source tree.
147
- */const yr=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],at=I("trash-2",yr);/**
126
+ */const ur=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],tt=S("trash-2",ur);/**
148
127
  * @license lucide-react v0.575.0 - ISC
149
128
  *
150
129
  * This source code is licensed under the ISC license.
151
130
  * See the LICENSE file in the root directory of this source tree.
152
- */const vr=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Fe=I("wallet",vr);/**
131
+ */const pr=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],Ie=S("wallet",pr);/**
153
132
  * @license lucide-react v0.575.0 - ISC
154
133
  *
155
134
  * This source code is licensed under the ISC license.
156
135
  * See the LICENSE file in the root directory of this source tree.
157
- */const wr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],kr=I("x",wr),$e=({onApply:e,t,compact:s})=>{const[r,n]=N.useState(""),[i,l]=N.useState("idle"),d=()=>{r.trim()&&(l("loading"),e(r.trim()),n(""),setTimeout(()=>l("idle"),500))},a=i==="loading"||!r.trim();return o.jsxs("div",{className:"flex gap-2",children:[o.jsxs("div",{className:"flex-1 flex items-center gap-2 border border-border/60 focus-within:border-primary/50 focus-within:ring-2 focus-within:ring-primary/5 rounded-xs px-3 py-2 transition-all bg-white",children:[o.jsx(gr,{className:`${s?"w-3 h-3":"w-3.5 h-3.5"} text-text/30 shrink-0`}),o.jsx("input",{type:"text",value:r,onChange:u=>n(u.target.value),onKeyDown:u=>u.key==="Enter"&&d(),placeholder:t.couponPlaceholder,className:`bg-transparent outline-none w-full placeholder:text-text/30 text-text font-semibold ${s?"text-xs":"text-sm"}`})]}),o.jsx("button",{type:"button",onClick:d,disabled:a,className:`font-bold bg-primary text-surface rounded-xs hover:brightness-110 disabled:opacity-40 transition-all ${s?"px-3 py-2 text-xs":"px-4 py-2 text-sm"} ${a?"cursor-not-allowed":"cursor-pointer"}`,children:i==="loading"?o.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):t.couponApply})]})},jr=({onRemove:e,t})=>o.jsx("button",{type:"button",onClick:e,className:"p-0.5 rounded text-error hover:text-error hover:bg-error/10 transition-colors","aria-label":t.couponRemove,children:o.jsx(at,{className:"w-3 h-3"})});function Nr(e){return{id:"discount",slots:{sidebarBeforeTotals:({step:t,t:s})=>t!=="review"?null:o.jsx("div",{className:"mb-6",children:o.jsx($e,{onApply:r=>e({type:"COUPON_APPLY_REQUESTED",code:r}),t:s,compact:!0})}),mobileBarExpanded:({step:t,t:s})=>t!=="review"?null:o.jsx("div",{className:"mb-3 pb-3 border-b border-border/40",children:o.jsx($e,{onApply:r=>e({type:"COUPON_APPLY_REQUESTED",code:r}),t:s})}),totalsDiscountAction:({step:t,t:s})=>t!=="review"?null:o.jsx(jr,{onRemove:()=>e({type:"COUPON_REMOVE_REQUESTED"}),t:s})}}}const Cr=({quantity:e,min:t,max:s,loading:r,onChange:n})=>o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"flex items-center border border-border/60 rounded-xl bg-background/30 p-0.5 overflow-hidden",children:[o.jsx("button",{type:"button",onClick:()=>n(e-1),disabled:r||e<=t,className:"w-8 h-8 flex items-center justify-center text-text/60 hover:bg-border/30 rounded-lg transition-colors disabled:opacity-30",children:o.jsx(mr,{className:"w-3.5 h-3.5"})}),o.jsx("span",{className:"text-sm font-bold w-7 text-center select-none",children:e}),o.jsx("button",{type:"button",onClick:()=>n(e+1),disabled:r||e>=s,className:"w-8 h-8 flex items-center justify-center text-text/60 hover:bg-border/30 rounded-lg transition-colors disabled:opacity-30",children:o.jsx(fr,{className:"w-3.5 h-3.5"})})]}),r&&o.jsx(K,{className:"w-4 h-4 animate-spin text-primary"})]}),Er=({loading:e,onRemove:t,label:s})=>o.jsx("button",{type:"button",onClick:t,disabled:e,className:"p-2 -mr-1 rounded-full text-text/20 hover:text-error hover:bg-error/10 transition-all disabled:opacity-50","aria-label":s,children:e?o.jsx(K,{className:"w-4 h-4 animate-spin"}):o.jsx(at,{className:"w-5 h-5"})}),Sr=({props:e,emit:t,options:s})=>{const[r,n]=N.useState(!1),{item:i,t:l}=e,d=a=>{a<s.minQuantity||a>s.maxQuantity||(n(!0),t({type:"ITEM_QUANTITY_UPDATE_REQUESTED",itemId:i.id,quantity:a}),setTimeout(()=>n(!1),2e3))};return s.allowQuantityEdit?o.jsx("div",{className:"mt-3",children:o.jsx(Cr,{quantity:i.quantity,min:s.minQuantity,max:s.maxQuantity,loading:r,onChange:d})}):o.jsxs("span",{className:"text-sm text-text/40 mt-1 block font-semibold uppercase tracking-wider",children:[l.quantityShort,": ",i.quantity]})},Tr=({props:e,emit:t,options:s})=>{const[r,n]=N.useState(!1),{item:i,t:l}=e;if(!s.allowRemove)return null;const d=()=>{n(!0),t({type:"ITEM_REMOVE_REQUESTED",itemId:i.id}),setTimeout(()=>n(!1),2e3)};return o.jsx(Er,{loading:r,onRemove:d,label:l.removeItem})};function Rr(e,t){const s={allowRemove:!!(t!=null&&t.allowRemove),allowQuantityEdit:!!(t!=null&&t.allowQuantityEdit),minQuantity:(t==null?void 0:t.minQuantity)??1,maxQuantity:(t==null?void 0:t.maxQuantity)??99};return{id:"cart-edit",slots:{orderItemActions:r=>o.jsx(Sr,{props:r,emit:e,options:s}),orderItemEnd:r=>o.jsx(Tr,{props:r,emit:e,options:s})}}}const it=N.createContext(null),_r=(e,t)=>{switch(t.type){case"SET_STEP":return{...e,step:t.step};case"SELECT_METHOD":return{...e,selectedMethodId:t.methodId};case"SET_ERROR":return{...e,error:t.error};case"SET_CART":return{...e,items:t.cartState.items,totals:t.cartState.totals};case"SYNC_PROPS":return{...e,items:t.items,totals:t.totals};case"SET_PAYMENT_RESULT":return{...e,paymentResult:t.result};default:return e}},Pr=({children:e,config:t,initialStatus:s,onEvent:r})=>{const[n,i]=N.useReducer(_r,{...t,step:s?s.status:"review",selectedMethodId:null,error:null,paymentResult:s});N.useEffect(()=>{i({type:"SYNC_PROPS",items:t.items,totals:t.totals})},[t.items,t.totals]);const[l,d]=N.useState([]),a=N.useCallback(u=>{r==null||r(u),d(f=>[`[${new Date().toLocaleTimeString()}] ${u.type}`,...f].slice(0,20))},[r]);return o.jsx(it.Provider,{value:{state:n,dispatch:i,emitEvent:a,eventLog:l},children:e})},Pe=()=>{const e=N.useContext(it);if(!e)throw new Error("useCheckoutContext must be used within a CheckoutProvider");return e},se=()=>{var C;const{state:e,dispatch:t,emitEvent:s}=Pe(),r=g=>{t({type:"SET_STEP",step:g}),s({type:"STEP_CHANGED",step:g})};return{...e,setStep:r,selectMethod:g=>{t({type:"SELECT_METHOD",methodId:g}),s({type:"PAYMENT_METHOD_SELECTED",methodId:g})},submitPayment:async g=>{var w;if(e.selectedMethodId){s({type:"PAYMENT_SUBMITTED"}),r("processing"),t({type:"SET_ERROR",error:null});try{const j=await e.provider.createPayment(g);switch(t({type:"SET_PAYMENT_RESULT",result:j}),console.log(j),j.status){case"success":s({type:"PAYMENT_SUCCESS",transactionId:"unknown"}),r("success");break;case"pending":s({type:"STEP_CHANGED",step:"pending"}),r("pending");break;case"redirect":s({type:"STEP_CHANGED",step:"redirect"}),r("redirect");break;case"error":{const b=((w=j.feedback)==null?void 0:w.description)??"Payment failed";t({type:"SET_ERROR",error:b}),s({type:"PAYMENT_ERROR",error:b}),r("error");break}}}catch(j){const b=j instanceof Error?j.message:"Unknown error";t({type:"SET_ERROR",error:b}),s({type:"PAYMENT_ERROR",error:b}),r("error")}}},setError:g=>{t({type:"SET_ERROR",error:g}),s({type:"PAYMENT_ERROR",error:g})},updateQuantity:async(g,w)=>{if(!e.cartController)return;const j=await e.cartController.updateQuantity(g,w);t({type:"SET_CART",cartState:j})},removeItem:async g=>{if(!e.cartController)return;const w=await e.cartController.removeItem(g);t({type:"SET_CART",cartState:w})},applyCoupon:async g=>{if(!e.cartController)return!1;try{const w=await e.cartController.applyCoupon(g);return t({type:"SET_CART",cartState:w}),!0}catch{return!1}},removeCoupon:async()=>{var g;if(!((g=e.cartController)!=null&&g.removeCoupon))return!1;try{const w=await e.cartController.removeCoupon();return t({type:"SET_CART",cartState:w}),!0}catch{return!1}},hasCartController:!!e.cartController,hasRemoveCoupon:!!((C=e.cartController)!=null&&C.removeCoupon)}};function lt(e){var t,s,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(s=lt(e[t]))&&(r&&(r+=" "),r+=s)}else for(s in e)e[s]&&(r&&(r+=" "),r+=s);return r}function Ar(){for(var e,t,s=0,r="",n=arguments.length;s<n;s++)(e=arguments[s])&&(t=lt(e))&&(r&&(r+=" "),r+=t);return r}const Mr=(e,t)=>{const s=new Array(e.length+t.length);for(let r=0;r<e.length;r++)s[r]=e[r];for(let r=0;r<t.length;r++)s[e.length+r]=t[r];return s},Ir=(e,t)=>({classGroupId:e,validator:t}),ct=(e=new Map,t=null,s)=>({nextPart:e,validators:t,classGroupId:s}),ye="-",Ue=[],Or="arbitrary..",zr=e=>{const t=Lr(e),{conflictingClassGroups:s,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return Dr(l);const d=l.split(ye),a=d[0]===""&&d.length>1?1:0;return dt(d,a,t)},getConflictingClassGroupIds:(l,d)=>{if(d){const a=r[l],u=s[l];return a?u?Mr(u,a):a:u||Ue}return s[l]||Ue}}},dt=(e,t,s)=>{if(e.length-t===0)return s.classGroupId;const n=e[t],i=s.nextPart.get(n);if(i){const u=dt(e,t+1,i);if(u)return u}const l=s.validators;if(l===null)return;const d=t===0?e.join(ye):e.slice(t).join(ye),a=l.length;for(let u=0;u<a;u++){const f=l[u];if(f.validator(d))return f.classGroupId}},Dr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),s=t.indexOf(":"),r=t.slice(0,s);return r?Or+r:void 0})(),Lr=e=>{const{theme:t,classGroups:s}=e;return Fr(s,t)},Fr=(e,t)=>{const s=ct();for(const r in e){const n=e[r];Ae(n,s,r,t)}return s},Ae=(e,t,s,r)=>{const n=e.length;for(let i=0;i<n;i++){const l=e[i];$r(l,t,s,r)}},$r=(e,t,s,r)=>{if(typeof e=="string"){Ur(e,t,s);return}if(typeof e=="function"){Gr(e,t,s,r);return}Br(e,t,s,r)},Ur=(e,t,s)=>{const r=e===""?t:ut(t,e);r.classGroupId=s},Gr=(e,t,s,r)=>{if(Vr(e)){Ae(e(r),t,s,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ir(s,e))},Br=(e,t,s,r)=>{const n=Object.entries(e),i=n.length;for(let l=0;l<i;l++){const[d,a]=n[l];Ae(a,ut(t,d),s,r)}},ut=(e,t)=>{let s=e;const r=t.split(ye),n=r.length;for(let i=0;i<n;i++){const l=r[i];let d=s.nextPart.get(l);d||(d=ct(),s.nextPart.set(l,d)),s=d}return s},Vr=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Yr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,s=Object.create(null),r=Object.create(null);const n=(i,l)=>{s[i]=l,t++,t>e&&(t=0,r=s,s=Object.create(null))};return{get(i){let l=s[i];if(l!==void 0)return l;if((l=r[i])!==void 0)return n(i,l),l},set(i,l){i in s?s[i]=l:n(i,l)}}},Re="!",Ge=":",qr=[],Be=(e,t,s,r,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:s,maybePostfixModifierPosition:r,isExternal:n}),Wr=e=>{const{prefix:t,experimentalParseClassName:s}=e;let r=n=>{const i=[];let l=0,d=0,a=0,u;const f=n.length;for(let b=0;b<f;b++){const k=n[b];if(l===0&&d===0){if(k===Ge){i.push(n.slice(a,b)),a=b+1;continue}if(k==="/"){u=b;continue}}k==="["?l++:k==="]"?l--:k==="("?d++:k===")"&&d--}const C=i.length===0?n:n.slice(a);let g=C,w=!1;C.endsWith(Re)?(g=C.slice(0,-1),w=!0):C.startsWith(Re)&&(g=C.slice(1),w=!0);const j=u&&u>a?u-a:void 0;return Be(i,w,g,j)};if(t){const n=t+Ge,i=r;r=l=>l.startsWith(n)?i(l.slice(n.length)):Be(qr,!1,l,void 0,!0)}if(s){const n=r;r=i=>s({className:i,parseClassName:n})}return r},Qr=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((s,r)=>{t.set(s,1e6+r)}),s=>{const r=[];let n=[];for(let i=0;i<s.length;i++){const l=s[i],d=l[0]==="[",a=t.has(l);d||a?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(l)):n.push(l)}return n.length>0&&(n.sort(),r.push(...n)),r}},Hr=e=>({cache:Yr(e.cacheSize),parseClassName:Wr(e),sortModifiers:Qr(e),...zr(e)}),Xr=/\s+/,Jr=(e,t)=>{const{parseClassName:s,getClassGroupId:r,getConflictingClassGroupIds:n,sortModifiers:i}=t,l=[],d=e.trim().split(Xr);let a="";for(let u=d.length-1;u>=0;u-=1){const f=d[u],{isExternal:C,modifiers:g,hasImportantModifier:w,baseClassName:j,maybePostfixModifierPosition:b}=s(f);if(C){a=f+(a.length>0?" "+a:a);continue}let k=!!b,F=r(k?j.substring(0,b):j);if(!F){if(!k){a=f+(a.length>0?" "+a:a);continue}if(F=r(j),!F){a=f+(a.length>0?" "+a:a);continue}k=!1}const S=g.length===0?"":g.length===1?g[0]:i(g).join(":"),z=w?S+Re:S,$=z+F;if(l.indexOf($)>-1)continue;l.push($);const q=n(F,k);for(let B=0;B<q.length;++B){const J=q[B];l.push(z+J)}a=f+(a.length>0?" "+a:a)}return a},Zr=(...e)=>{let t=0,s,r,n="";for(;t<e.length;)(s=e[t++])&&(r=mt(s))&&(n&&(n+=" "),n+=r);return n},mt=e=>{if(typeof e=="string")return e;let t,s="";for(let r=0;r<e.length;r++)e[r]&&(t=mt(e[r]))&&(s&&(s+=" "),s+=t);return s},Kr=(e,...t)=>{let s,r,n,i;const l=a=>{const u=t.reduce((f,C)=>C(f),e());return s=Hr(u),r=s.cache.get,n=s.cache.set,i=d,d(a)},d=a=>{const u=r(a);if(u)return u;const f=Jr(a,s);return n(a,f),f};return i=l,(...a)=>i(Zr(...a))},eo=[],M=e=>{const t=s=>s[e]||eo;return t.isThemeGetter=!0,t},pt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ft=/^\((?:(\w[\w-]*):)?(.+)\)$/i,to=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,ro=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,oo=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,so=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,no=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ao=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Q=e=>to.test(e),v=e=>!!e&&!Number.isNaN(Number(e)),H=e=>!!e&&Number.isInteger(Number(e)),Ce=e=>e.endsWith("%")&&v(e.slice(0,-1)),Y=e=>ro.test(e),xt=()=>!0,io=e=>oo.test(e)&&!so.test(e),Me=()=>!1,lo=e=>no.test(e),co=e=>ao.test(e),uo=e=>!m(e)&&!p(e),mo=e=>X(e,gt,Me),m=e=>pt.test(e),Z=e=>X(e,yt,io),Ve=e=>X(e,vo,v),po=e=>X(e,wt,xt),fo=e=>X(e,vt,Me),Ye=e=>X(e,ht,Me),xo=e=>X(e,bt,co),be=e=>X(e,kt,lo),p=e=>ft.test(e),de=e=>ee(e,yt),ho=e=>ee(e,vt),qe=e=>ee(e,ht),bo=e=>ee(e,gt),go=e=>ee(e,bt),ge=e=>ee(e,kt,!0),yo=e=>ee(e,wt,!0),X=(e,t,s)=>{const r=pt.exec(e);return r?r[1]?t(r[1]):s(r[2]):!1},ee=(e,t,s=!1)=>{const r=ft.exec(e);return r?r[1]?t(r[1]):s:!1},ht=e=>e==="position"||e==="percentage",bt=e=>e==="image"||e==="url",gt=e=>e==="length"||e==="size"||e==="bg-size",yt=e=>e==="length",vo=e=>e==="number",vt=e=>e==="family-name",wt=e=>e==="number"||e==="weight",kt=e=>e==="shadow",wo=()=>{const e=M("color"),t=M("font"),s=M("text"),r=M("font-weight"),n=M("tracking"),i=M("leading"),l=M("breakpoint"),d=M("container"),a=M("spacing"),u=M("radius"),f=M("shadow"),C=M("inset-shadow"),g=M("text-shadow"),w=M("drop-shadow"),j=M("blur"),b=M("perspective"),k=M("aspect"),F=M("ease"),S=M("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],$=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...$(),p,m],B=()=>["auto","hidden","clip","visible","scroll"],J=()=>["auto","contain","none"],x=()=>[p,m,a],O=()=>[Q,"full","auto",...x()],ue=()=>[H,"none","subgrid",p,m],me=()=>["auto",{span:["full",H,p,m]},H,p,m],W=()=>[H,"auto",p,m],ae=()=>["auto","min","max","fr",p,m],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],U=()=>["start","end","center","stretch","center-safe","end-safe"],D=()=>["auto",...x()],G=()=>[Q,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...x()],te=()=>[Q,"screen","full","dvw","lvw","svw","min","max","fit",...x()],re=()=>[Q,"screen","full","lh","dvh","lvh","svh","min","max","fit",...x()],h=()=>[e,p,m],c=()=>[...$(),qe,Ye,{position:[p,m]}],y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],E=()=>["auto","cover","contain",bo,mo,{size:[p,m]}],R=()=>[Ce,de,Z],P=()=>["","none","full",u,p,m],A=()=>["",v,de,Z],T=()=>["solid","dashed","dotted","double"],V=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_=()=>[v,Ce,qe,Ye],pe=()=>["","none",j,p,m],fe=()=>["none",v,p,m],xe=()=>["none",v,p,m],Ne=()=>[v,p,m],he=()=>[Q,"full",...x()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Y],breakpoint:[Y],color:[xt],container:[Y],"drop-shadow":[Y],ease:["in","out","in-out"],font:[uo],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Y],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Y],shadow:[Y],spacing:["px",v],text:[Y],"text-shadow":[Y],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Q,m,p,k]}],container:["container"],columns:[{columns:[v,m,p,d]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:q()}],overflow:[{overflow:B()}],"overflow-x":[{"overflow-x":B()}],"overflow-y":[{"overflow-y":B()}],overscroll:[{overscroll:J()}],"overscroll-x":[{"overscroll-x":J()}],"overscroll-y":[{"overscroll-y":J()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:O()}],"inset-x":[{"inset-x":O()}],"inset-y":[{"inset-y":O()}],start:[{"inset-s":O(),start:O()}],end:[{"inset-e":O(),end:O()}],"inset-bs":[{"inset-bs":O()}],"inset-be":[{"inset-be":O()}],top:[{top:O()}],right:[{right:O()}],bottom:[{bottom:O()}],left:[{left:O()}],visibility:["visible","invisible","collapse"],z:[{z:[H,"auto",p,m]}],basis:[{basis:[Q,"full","auto",d,...x()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[v,Q,"auto","initial","none",m]}],grow:[{grow:["",v,p,m]}],shrink:[{shrink:["",v,p,m]}],order:[{order:[H,"first","last","none",p,m]}],"grid-cols":[{"grid-cols":ue()}],"col-start-end":[{col:me()}],"col-start":[{"col-start":W()}],"col-end":[{"col-end":W()}],"grid-rows":[{"grid-rows":ue()}],"row-start-end":[{row:me()}],"row-start":[{"row-start":W()}],"row-end":[{"row-end":W()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":ae()}],"auto-rows":[{"auto-rows":ae()}],gap:[{gap:x()}],"gap-x":[{"gap-x":x()}],"gap-y":[{"gap-y":x()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...U(),"normal"]}],"justify-self":[{"justify-self":["auto",...U()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...U(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...U(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...U(),"baseline"]}],"place-self":[{"place-self":["auto",...U()]}],p:[{p:x()}],px:[{px:x()}],py:[{py:x()}],ps:[{ps:x()}],pe:[{pe:x()}],pbs:[{pbs:x()}],pbe:[{pbe:x()}],pt:[{pt:x()}],pr:[{pr:x()}],pb:[{pb:x()}],pl:[{pl:x()}],m:[{m:D()}],mx:[{mx:D()}],my:[{my:D()}],ms:[{ms:D()}],me:[{me:D()}],mbs:[{mbs:D()}],mbe:[{mbe:D()}],mt:[{mt:D()}],mr:[{mr:D()}],mb:[{mb:D()}],ml:[{ml:D()}],"space-x":[{"space-x":x()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":x()}],"space-y-reverse":["space-y-reverse"],size:[{size:G()}],"inline-size":[{inline:["auto",...te()]}],"min-inline-size":[{"min-inline":["auto",...te()]}],"max-inline-size":[{"max-inline":["none",...te()]}],"block-size":[{block:["auto",...re()]}],"min-block-size":[{"min-block":["auto",...re()]}],"max-block-size":[{"max-block":["none",...re()]}],w:[{w:[d,"screen",...G()]}],"min-w":[{"min-w":[d,"screen","none",...G()]}],"max-w":[{"max-w":[d,"screen","none","prose",{screen:[l]},...G()]}],h:[{h:["screen","lh",...G()]}],"min-h":[{"min-h":["screen","lh","none",...G()]}],"max-h":[{"max-h":["screen","lh",...G()]}],"font-size":[{text:["base",s,de,Z]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,yo,po]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Ce,m]}],"font-family":[{font:[ho,fo,t]}],"font-features":[{"font-features":[m]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,p,m]}],"line-clamp":[{"line-clamp":[v,"none",p,Ve]}],leading:[{leading:[i,...x()]}],"list-image":[{"list-image":["none",p,m]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",p,m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:h()}],"text-color":[{text:h()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...T(),"wavy"]}],"text-decoration-thickness":[{decoration:[v,"from-font","auto",p,Z]}],"text-decoration-color":[{decoration:h()}],"underline-offset":[{"underline-offset":[v,"auto",p,m]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:x()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",p,m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",p,m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:c()}],"bg-repeat":[{bg:y()}],"bg-size":[{bg:E()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},H,p,m],radial:["",p,m],conic:[H,p,m]},go,xo]}],"bg-color":[{bg:h()}],"gradient-from-pos":[{from:R()}],"gradient-via-pos":[{via:R()}],"gradient-to-pos":[{to:R()}],"gradient-from":[{from:h()}],"gradient-via":[{via:h()}],"gradient-to":[{to:h()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:A()}],"border-w-x":[{"border-x":A()}],"border-w-y":[{"border-y":A()}],"border-w-s":[{"border-s":A()}],"border-w-e":[{"border-e":A()}],"border-w-bs":[{"border-bs":A()}],"border-w-be":[{"border-be":A()}],"border-w-t":[{"border-t":A()}],"border-w-r":[{"border-r":A()}],"border-w-b":[{"border-b":A()}],"border-w-l":[{"border-l":A()}],"divide-x":[{"divide-x":A()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":A()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...T(),"hidden","none"]}],"divide-style":[{divide:[...T(),"hidden","none"]}],"border-color":[{border:h()}],"border-color-x":[{"border-x":h()}],"border-color-y":[{"border-y":h()}],"border-color-s":[{"border-s":h()}],"border-color-e":[{"border-e":h()}],"border-color-bs":[{"border-bs":h()}],"border-color-be":[{"border-be":h()}],"border-color-t":[{"border-t":h()}],"border-color-r":[{"border-r":h()}],"border-color-b":[{"border-b":h()}],"border-color-l":[{"border-l":h()}],"divide-color":[{divide:h()}],"outline-style":[{outline:[...T(),"none","hidden"]}],"outline-offset":[{"outline-offset":[v,p,m]}],"outline-w":[{outline:["",v,de,Z]}],"outline-color":[{outline:h()}],shadow:[{shadow:["","none",f,ge,be]}],"shadow-color":[{shadow:h()}],"inset-shadow":[{"inset-shadow":["none",C,ge,be]}],"inset-shadow-color":[{"inset-shadow":h()}],"ring-w":[{ring:A()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:h()}],"ring-offset-w":[{"ring-offset":[v,Z]}],"ring-offset-color":[{"ring-offset":h()}],"inset-ring-w":[{"inset-ring":A()}],"inset-ring-color":[{"inset-ring":h()}],"text-shadow":[{"text-shadow":["none",g,ge,be]}],"text-shadow-color":[{"text-shadow":h()}],opacity:[{opacity:[v,p,m]}],"mix-blend":[{"mix-blend":[...V(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":V()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[v]}],"mask-image-linear-from-pos":[{"mask-linear-from":_()}],"mask-image-linear-to-pos":[{"mask-linear-to":_()}],"mask-image-linear-from-color":[{"mask-linear-from":h()}],"mask-image-linear-to-color":[{"mask-linear-to":h()}],"mask-image-t-from-pos":[{"mask-t-from":_()}],"mask-image-t-to-pos":[{"mask-t-to":_()}],"mask-image-t-from-color":[{"mask-t-from":h()}],"mask-image-t-to-color":[{"mask-t-to":h()}],"mask-image-r-from-pos":[{"mask-r-from":_()}],"mask-image-r-to-pos":[{"mask-r-to":_()}],"mask-image-r-from-color":[{"mask-r-from":h()}],"mask-image-r-to-color":[{"mask-r-to":h()}],"mask-image-b-from-pos":[{"mask-b-from":_()}],"mask-image-b-to-pos":[{"mask-b-to":_()}],"mask-image-b-from-color":[{"mask-b-from":h()}],"mask-image-b-to-color":[{"mask-b-to":h()}],"mask-image-l-from-pos":[{"mask-l-from":_()}],"mask-image-l-to-pos":[{"mask-l-to":_()}],"mask-image-l-from-color":[{"mask-l-from":h()}],"mask-image-l-to-color":[{"mask-l-to":h()}],"mask-image-x-from-pos":[{"mask-x-from":_()}],"mask-image-x-to-pos":[{"mask-x-to":_()}],"mask-image-x-from-color":[{"mask-x-from":h()}],"mask-image-x-to-color":[{"mask-x-to":h()}],"mask-image-y-from-pos":[{"mask-y-from":_()}],"mask-image-y-to-pos":[{"mask-y-to":_()}],"mask-image-y-from-color":[{"mask-y-from":h()}],"mask-image-y-to-color":[{"mask-y-to":h()}],"mask-image-radial":[{"mask-radial":[p,m]}],"mask-image-radial-from-pos":[{"mask-radial-from":_()}],"mask-image-radial-to-pos":[{"mask-radial-to":_()}],"mask-image-radial-from-color":[{"mask-radial-from":h()}],"mask-image-radial-to-color":[{"mask-radial-to":h()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":$()}],"mask-image-conic-pos":[{"mask-conic":[v]}],"mask-image-conic-from-pos":[{"mask-conic-from":_()}],"mask-image-conic-to-pos":[{"mask-conic-to":_()}],"mask-image-conic-from-color":[{"mask-conic-from":h()}],"mask-image-conic-to-color":[{"mask-conic-to":h()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:c()}],"mask-repeat":[{mask:y()}],"mask-size":[{mask:E()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",p,m]}],filter:[{filter:["","none",p,m]}],blur:[{blur:pe()}],brightness:[{brightness:[v,p,m]}],contrast:[{contrast:[v,p,m]}],"drop-shadow":[{"drop-shadow":["","none",w,ge,be]}],"drop-shadow-color":[{"drop-shadow":h()}],grayscale:[{grayscale:["",v,p,m]}],"hue-rotate":[{"hue-rotate":[v,p,m]}],invert:[{invert:["",v,p,m]}],saturate:[{saturate:[v,p,m]}],sepia:[{sepia:["",v,p,m]}],"backdrop-filter":[{"backdrop-filter":["","none",p,m]}],"backdrop-blur":[{"backdrop-blur":pe()}],"backdrop-brightness":[{"backdrop-brightness":[v,p,m]}],"backdrop-contrast":[{"backdrop-contrast":[v,p,m]}],"backdrop-grayscale":[{"backdrop-grayscale":["",v,p,m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[v,p,m]}],"backdrop-invert":[{"backdrop-invert":["",v,p,m]}],"backdrop-opacity":[{"backdrop-opacity":[v,p,m]}],"backdrop-saturate":[{"backdrop-saturate":[v,p,m]}],"backdrop-sepia":[{"backdrop-sepia":["",v,p,m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":x()}],"border-spacing-x":[{"border-spacing-x":x()}],"border-spacing-y":[{"border-spacing-y":x()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",p,m]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[v,"initial",p,m]}],ease:[{ease:["linear","initial",F,p,m]}],delay:[{delay:[v,p,m]}],animate:[{animate:["none",S,p,m]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,p,m]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:fe()}],"rotate-x":[{"rotate-x":fe()}],"rotate-y":[{"rotate-y":fe()}],"rotate-z":[{"rotate-z":fe()}],scale:[{scale:xe()}],"scale-x":[{"scale-x":xe()}],"scale-y":[{"scale-y":xe()}],"scale-z":[{"scale-z":xe()}],"scale-3d":["scale-3d"],skew:[{skew:Ne()}],"skew-x":[{"skew-x":Ne()}],"skew-y":[{"skew-y":Ne()}],transform:[{transform:[p,m,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:he()}],"translate-x":[{"translate-x":he()}],"translate-y":[{"translate-y":he()}],"translate-z":[{"translate-z":he()}],"translate-none":["translate-none"],accent:[{accent:h()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:h()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",p,m]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":x()}],"scroll-mx":[{"scroll-mx":x()}],"scroll-my":[{"scroll-my":x()}],"scroll-ms":[{"scroll-ms":x()}],"scroll-me":[{"scroll-me":x()}],"scroll-mbs":[{"scroll-mbs":x()}],"scroll-mbe":[{"scroll-mbe":x()}],"scroll-mt":[{"scroll-mt":x()}],"scroll-mr":[{"scroll-mr":x()}],"scroll-mb":[{"scroll-mb":x()}],"scroll-ml":[{"scroll-ml":x()}],"scroll-p":[{"scroll-p":x()}],"scroll-px":[{"scroll-px":x()}],"scroll-py":[{"scroll-py":x()}],"scroll-ps":[{"scroll-ps":x()}],"scroll-pe":[{"scroll-pe":x()}],"scroll-pbs":[{"scroll-pbs":x()}],"scroll-pbe":[{"scroll-pbe":x()}],"scroll-pt":[{"scroll-pt":x()}],"scroll-pr":[{"scroll-pr":x()}],"scroll-pb":[{"scroll-pb":x()}],"scroll-pl":[{"scroll-pl":x()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",p,m]}],fill:[{fill:["none",...h()]}],"stroke-w":[{stroke:[v,de,Z,Ve]}],stroke:[{stroke:["none",...h()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},ko=Kr(wo);function L(...e){return ko(Ar(e))}const ve=e=>e==="payment_method"||e==="payment_details",we=e=>e==="review",jt=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),jo=({theme:e,brandColor:t,customTheme:s,children:r})=>{const n=st(e,t,s),i=rt(n);return o.jsx("div",{style:i,className:"bg-background text-text font-(--theme-font) h-full w-full",children:r})},Nt={orderSummary:"Order Summary",quantity:"Qty",quantityShort:"Qty",removeItem:"Remove item",subtotal:"Subtotal",discount:"Discount",shipping:"Shipping",shippingFree:"Free",taxes:"Taxes",total:"Total",couponPlaceholder:"Promo code",couponApply:"Apply",couponApplied:"✓ Coupon applied",couponInvalid:"✗ Invalid code",couponRemove:"Remove coupon",orderSummaryTitle:"Order summary",securePayment:"SECURE SSL PAYMENT",continueToPay:"Continue to payment",payNow:"Pay now",pay:"Pay",processing:"Processing…",continueNow:"Continue now",paymentMethod:"Payment method",back:"Back",completeDetails:"Complete details",selectMethod:"Select a method",processingPayment:"Processing payment…",processingDescription:"Don't close or reload this window.",redirecting:"Redirecting…",redirectDescription:"You will be redirected to complete your payment securely.",showOrderDetails:"Show order details",hideOrderDetails:"Hide order details",continue:"Continue"},No={orderSummary:"Resumen del pedido",quantity:"Cant",quantityShort:"Cant",removeItem:"Eliminar item",subtotal:"Subtotal",discount:"Descuento",shipping:"Envío",shippingFree:"Gratis",taxes:"Impuestos",total:"Total",couponPlaceholder:"Código promo",couponApply:"Aplicar",couponApplied:"✓ Cupón aplicado",couponInvalid:"✗ Código inválido",couponRemove:"Eliminar cupón",orderSummaryTitle:"Resumen del pedido",securePayment:"PAGO SEGURO SSL",continueToPay:"Continuar al pago",payNow:"Pagar ahora",pay:"Pagar",processing:"Procesando…",continueNow:"Continuar ahora",paymentMethod:"Método de pago",back:"Volver",completeDetails:"Completa los datos",selectMethod:"Selecciona un método",processingPayment:"Procesando pago…",processingDescription:"No cierres ni recargues esta ventana.",redirecting:"Redirigiendo…",redirectDescription:"Serás redirigido para completar tu pago de forma segura.",showOrderDetails:"Ver detalle del pedido",hideOrderDetails:"Ocultar detalle del pedido",continue:"Continuar"},Co={orderSummary:"Resumo do pedido",quantity:"Qtd",quantityShort:"Qtd",removeItem:"Remover item",subtotal:"Subtotal",discount:"Desconto",shipping:"Frete",shippingFree:"Grátis",taxes:"Impostos",total:"Total",couponPlaceholder:"Código promocional",couponApply:"Aplicar",couponApplied:"✓ Cupom aplicado",couponInvalid:"✗ Código inválido",couponRemove:"Remover cupom",orderSummaryTitle:"Resumo do pedido",securePayment:"PAGAMENTO SEGURO SSL",continueToPay:"Continuar para pagamento",payNow:"Pagar agora",pay:"Pagar",processing:"Processando…",continueNow:"Continuar agora",paymentMethod:"Método de pagamento",back:"Voltar",completeDetails:"Complete os dados",selectMethod:"Selecione um método",processingPayment:"Processando pagamento…",processingDescription:"Não feche nem recarregue esta janela.",redirecting:"Redirecionando…",redirectDescription:"Você será redirecionado para completar seu pagamento com segurança.",showOrderDetails:"Ver detalhes do pedido",hideOrderDetails:"Ocultar detalhes do pedido",continue:"Continuar"},Ct={en:Nt,es:No,"pt-BR":Co},We=Object.keys(Ct);function Eo(){if(typeof navigator>"u")return"en";const e=navigator.languages??[navigator.language];for(const t of e){if(We.includes(t))return t;const s=t.split("-")[0];if(We.includes(s))return s;if(s==="pt")return"pt-BR"}return"en"}function So(e){return e==="auto"?Eo():e}function To(e){const t=So(e);return Ct[t]??Nt}function Ro(e,t){const s=To(e);return t?{...s,...t}:s}const Et=N.createContext(null),_o=({locale:e,currency:t,messages:s,formatters:r,children:n})=>{const i=Ro(e,s),l=r!=null&&r.currency?r.currency:d=>jt(d,t);return o.jsx(Et.Provider,{value:{t:i,fmt:l},children:n})},ne=()=>{const e=N.useContext(Et);if(!e)throw new Error("useI18n must be used within an I18nProvider");return e},St=N.createContext({plugins:[]}),Po=({plugins:e,children:t})=>{const s=N.useMemo(()=>({plugins:e}),[e]);return o.jsx(St.Provider,{value:s,children:t})},Ie=()=>N.useContext(St);function ke(e,t,s){return e.filter(r=>r.slots[t]).map(r=>{const n=r.slots[t];return o.jsx(N.Fragment,{children:n(s)},r.id)})}function Qe(e,t,s){return e.filter(r=>r.slots[t]).map(r=>{const n=r.slots[t];return o.jsx(N.Fragment,{children:n(s)},r.id)})}const He=()=>{const{items:e,step:t}=se(),{t:s,fmt:r}=ne(),{plugins:n}=Ie(),i=n.some(a=>a.slots.orderItemActions),l=n.some(a=>a.slots.orderItemEnd),d={items:e,totals:{subtotal:0,total:0},step:t,t:s,fmt:r};return o.jsxs("div",{className:"flex flex-col h-full animate-in fade-in slide-in-from-bottom-4 duration-500 overflow-hidden",children:[o.jsx("h2",{className:"text-xl font-bold mb-6 shrink-0",children:s.orderSummary}),o.jsx("div",{className:"flex-1 overflow-y-auto pr-3 custom-scrollbar flex flex-col divide-y divide-border/30",children:e.map(a=>{const u=!!a.discount,f={...d,item:a};return o.jsxs("div",{className:"py-5 flex items-start gap-5 transition-opacity",children:[a.image&&o.jsx("img",{src:a.image,alt:a.name,className:"w-20 h-20 rounded-2xl object-cover border border-border/40 shrink-0 shadow-sm transition-transform hover:scale-105 duration-300"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("span",{className:"font-bold text-lg text-text/90 block truncate leading-tight mb-1",children:a.name}),i?Qe(n,"orderItemActions",f):o.jsxs("span",{className:"text-sm text-text/40 mt-1 block font-semibold uppercase tracking-wider",children:[s.quantityShort,": ",a.quantity]}),u&&o.jsxs("div",{className:"flex items-center gap-2 mt-3 flex-wrap",children:[a.discount.label&&o.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest bg-success/10 text-success px-2 py-1 rounded-md border border-success/20",children:a.discount.label}),o.jsx("span",{className:"text-xs text-success font-black",children:a.discount.type==="percentage"?`-${a.discount.value}%`:`-${r(a.discount.value)}`})]})]}),o.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[l&&Qe(n,"orderItemEnd",f),u?o.jsxs("div",{className:L("flex flex-col items-end",l?"":"mt-1"),children:[o.jsx("span",{className:"text-xs line-through text-text/30 font-medium tracking-tight",children:r(a.unitPrice*a.quantity)}),o.jsx("span",{className:"text-lg font-black text-success tracking-tight",children:r(a.total)})]}):o.jsx("span",{className:L("text-lg font-bold text-text/80 tracking-tight",l?"":"mt-1"),children:r(a.total)})]})]},a.id)})})]})},Ao=e=>{switch(e){case"card":return o.jsx(nr,{className:"w-5 h-5"});case"wallet":return o.jsx(Fe,{className:"w-5 h-5"});case"bank":return o.jsx(cr,{className:"w-5 h-5"});default:return o.jsx(Fe,{className:"w-5 h-5"})}},Mo=()=>{const{paymentMethods:e,selectedMethodId:t,selectMethod:s,setStep:r,submitPayment:n,totals:i,error:l}=se(),{t:d,fmt:a}=ne(),[u,f]=N.useState(!1),[C,g]=N.useState({}),w=e.find(S=>S.id===t),j=w?w.renderComponent?!!C[w.id]:!0:!1,b=S=>{s(S)},k=N.useCallback(S=>z=>{g($=>({...$,[S]:z}))},[]),F=async S=>{S.preventDefault(),!(!t||!j)&&(f(!0),await n({methodId:t}),f(!1))};return o.jsxs("form",{id:"checkout-payment-form",onSubmit:F,className:"flex flex-col gap-3 animate-in fade-in slide-in-from-right-4 duration-500",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[o.jsx("button",{type:"button",onClick:()=>r("review"),className:"p-1 hover:bg-border/50 rounded-full transition-colors text-text/80","aria-label":d.back,children:o.jsx(qt,{className:"w-5 h-5"})}),o.jsx("h2",{className:"text-xl font-semibold",children:d.paymentMethod})]}),o.jsx("div",{className:"flex-1 overflow-y-auto pr-1 custom-scrollbar flex flex-col gap-2",children:e.map(S=>{const z=t===S.id;return o.jsxs("div",{className:"flex flex-col",children:[o.jsxs("button",{type:"button",onClick:()=>b(S.id),disabled:u,className:L("flex items-center gap-3 p-3.5 border transition-all duration-200 text-left",z?"border-primary bg-primary/5 ring-1 ring-primary shadow-sm":"border-border/60 hover:border-primary/50 bg-background/50 hover:bg-background",z&&S.renderComponent?"rounded-t-[var(--radius-DEFAULT)]":"rounded-[var(--radius-DEFAULT)]"),children:[o.jsx("div",{className:L("p-1.5 rounded-lg shrink-0",z?"text-primary":"text-text/50"),children:Ao(S.type)}),o.jsx("span",{className:"flex-1 font-bold text-sm tracking-tight",children:S.label}),o.jsx("div",{className:L("w-5 h-5 rounded-full border-2 flex items-center justify-center transition-all shrink-0",z?"border-primary bg-primary/10":"border-text/20"),children:z&&o.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-primary shadow-sm"})})]}),z&&S.renderComponent&&o.jsx("div",{className:"border border-t-0 border-primary/20 bg-background/50 rounded-b-[var(--radius-DEFAULT)] px-5 pt-5 pb-5 animate-in fade-in slide-in-from-top-2 duration-300",children:S.renderComponent({onReadyChange:k(S.id)})})]},S.id)})}),o.jsx("button",{type:"submit",disabled:!j||u,className:L("md:hidden flex w-full py-4 px-4 rounded-[var(--radius-DEFAULT)] mt-2 font-black uppercase tracking-widest justify-center items-center gap-2 transition-all shadow-lg active:scale-[0.98]",!j||u?"bg-primary/40 text-surface cursor-not-allowed":"bg-primary text-surface hover:brightness-110 shadow-primary/20"),children:u?o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"w-5 h-5 animate-spin"}),d.processing]}):j?`${d.pay} ${a(i.total)}`:w?d.completeDetails:d.selectMethod}),l&&!u&&o.jsx("p",{className:"text-sm text-error text-center font-medium animate-in fade-in duration-300 -mt-1",children:l})]})},Io=({label:e,onPress:t,variant:s="solid",icon:r,disabled:n,className:i,type:l="button"})=>o.jsxs("button",{type:l,onClick:t,disabled:n,className:L("flex items-center justify-center gap-2 px-5 py-2.5 rounded-[var(--radius-DEFAULT)] font-medium text-sm transition-all active:scale-[0.98]",s==="solid"&&"bg-primary text-surface hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",s==="outline"&&"border border-primary text-primary hover:bg-primary/5 disabled:opacity-40 disabled:cursor-not-allowed",s==="ghost"&&"text-text/70 hover:bg-border/50 hover:text-text disabled:opacity-40 disabled:cursor-not-allowed",i),children:[r&&o.jsx("span",{className:"shrink-0",children:r}),e]}),Xe=2,Oo={success:{icon:o.jsx(Zt,{className:"w-10 h-10"}),iconBg:"bg-success/10",iconColor:"text-success"},pending:{icon:o.jsx(rr,{className:"w-10 h-10"}),iconBg:"bg-orange-500/10",iconColor:"text-orange-500"},error:{icon:o.jsx(er,{className:"w-10 h-10"}),iconBg:"bg-error/10",iconColor:"text-error"},redirect:{icon:o.jsx(ir,{className:"w-10 h-10"}),iconBg:"bg-primary/10",iconColor:"text-primary"}},Je=({title:e,description:t,actions:s=[],variant:r="success",children:n})=>{const i=Oo[r],[l,d]=N.useState(r==="redirect"?Xe:0);return N.useEffect(()=>{if(r!=="redirect")return;if(l<=0){const u=s.find(f=>!f.variant||f.variant==="solid");u==null||u.onPress();return}const a=setInterval(()=>d(u=>u-1),1e3);return()=>clearInterval(a)},[l,r]),o.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-5 animate-in zoom-in-95 fade-in duration-500",children:[o.jsx("div",{className:L("w-20 h-20 rounded-full flex items-center justify-center",i.iconBg,i.iconColor),children:i.icon}),o.jsxs("div",{className:"text-center",children:[o.jsx("h2",{className:"text-2xl font-bold mb-1",children:e}),t&&o.jsx("p",{className:"text-text/60 text-sm max-w-[280px] mx-auto leading-relaxed",children:t})]}),r==="redirect"&&l>0&&o.jsxs("div",{className:"flex flex-col items-center gap-2",children:[o.jsxs("div",{className:"relative w-14 h-14",children:[o.jsxs("svg",{className:"w-14 h-14 -rotate-90",viewBox:"0 0 56 56",children:[o.jsx("circle",{cx:"28",cy:"28",r:"24",fill:"none",stroke:"currentColor",strokeWidth:"4",className:"text-border"}),o.jsx("circle",{cx:"28",cy:"28",r:"24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*24}`,strokeDashoffset:`${2*Math.PI*24*(1-l/Xe)}`,className:"text-primary transition-all duration-1000"})]}),o.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-xl font-bold text-primary",children:l})]}),o.jsxs("p",{className:"text-xs text-text/50",children:["Redirigiendo en ",l,"s…"]})]}),n&&o.jsx("div",{className:"w-full",children:n}),s.length>0&&o.jsx("div",{className:"flex flex-wrap gap-3 justify-center w-full mt-1",children:s.map((a,u)=>o.jsx(Io,{label:a.label,onPress:a.onPress,variant:a.variant??"solid",icon:a.icon,className:a.variant==="solid"?"flex-1":void 0},u))})]})},zo=({children:e,sidebar:t,className:s,...r})=>{const n=!!t;return o.jsxs("div",{className:L("w-full h-full bg-surface text-text rounded-(--theme-radius) shadow-2xl border border-border","overflow-hidden flex flex-col md:flex-row",s),...r,children:[o.jsx("div",{className:L("flex-1 min-w-0 min-h-0 flex flex-col overflow-hidden p-4"),children:e}),n&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"hidden md:block w-px bg-border/60 shrink-0"}),o.jsx("div",{className:"hidden md:flex w-[320px] shrink-0 flex-col overflow-y-auto p-4 bg-background/60",children:t})]})]})},Do=["success","pending","error","redirect"],Lo={success:"✅ Éxito",pending:"⏳ Pendiente",error:"❌ Error",redirect:"↗️ Redirect"},Fo=()=>{const{state:e,eventLog:t}=Pe(),[s,r]=N.useState(!1),[n,i]=N.useState("success");return o.jsxs(o.Fragment,{children:[o.jsx("button",{onClick:()=>r(!0),className:"fixed top-4 right-4 z-40 bg-surface text-text/50 hover:text-primary p-3 rounded-full shadow-md border border-border transition-all hover:scale-105","aria-label":"Open Dev Tools",children:o.jsx(Le,{className:"w-5 h-5"})}),o.jsxs("div",{className:`fixed top-0 right-0 h-full w-80 bg-surface shadow-2xl z-50 p-6 flex flex-col gap-6 overflow-y-auto transition-transform duration-300 ${s?"translate-x-0":"translate-x-full"}`,style:{colorScheme:"light"},children:[o.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-border",children:[o.jsxs("h2",{className:"text-lg font-bold text-text flex items-center gap-2",children:[o.jsx(Le,{className:"w-5 h-5 text-primary"}),"Dev Tools"]}),o.jsx("button",{onClick:()=>r(!1),className:"text-text/50 hover:text-text p-1 bg-surface hover:bg-border/50 rounded-full transition-colors",children:o.jsx(kr,{className:"w-5 h-5"})})]}),o.jsxs("div",{children:[o.jsx("h2",{className:"text-sm font-bold mb-3 text-slate-500 uppercase tracking-wider",children:"Escenario de pago"}),o.jsx("div",{className:"flex flex-col gap-1",children:Do.map(l=>o.jsxs("label",{className:"flex items-center gap-2 cursor-pointer p-2 hover:bg-slate-50 rounded-lg",children:[o.jsx("input",{type:"radio",name:"scenario",checked:n===l,onChange:()=>i(l),className:"accent-indigo-500 w-4 h-4"}),o.jsx("span",{className:"text-sm",children:Lo[l]})]},l))}),o.jsxs("p",{className:"text-[11px] text-slate-400 mt-2 p-2 bg-slate-50 rounded leading-relaxed",children:["Cupón de prueba: ",o.jsx("code",{className:"font-mono font-bold text-slate-600",children:"SAVE10"})]})]}),o.jsxs("div",{children:[o.jsxs("h2",{className:"text-sm font-bold mb-3 text-slate-500 uppercase tracking-wider flex items-center gap-2",children:["Event Logger ",o.jsx("span",{className:"text-[10px] bg-indigo-100 text-indigo-700 px-2 py-0.5 rounded-full font-semibold",children:"Live"})]}),o.jsx("div",{className:"bg-slate-900 text-emerald-400 font-mono text-[10px] p-3 rounded-xl h-56 overflow-y-auto flex flex-col gap-1",children:t.length===0?o.jsx("span",{className:"text-slate-500 italic",children:"Sin eventos aún…"}):t.map((l,d)=>o.jsx("div",{className:"border-b border-white/10 pb-1",children:l},d))})]}),o.jsxs("div",{className:"flex flex-col gap-2",children:[o.jsx("h2",{className:"text-sm font-bold text-slate-500 uppercase tracking-wider",children:"Estado interno"}),o.jsx("pre",{className:"text-[10px] bg-slate-900 text-emerald-400 p-3 rounded-xl overflow-x-auto",children:JSON.stringify({...e,provider:"PaymentProvider instance"},null,2)})]})]})]})},$o=({showItems:e,isLoading:t})=>{const{items:s,totals:r,step:n,setStep:i,selectedMethodId:l}=se(),{t:d,fmt:a}=ne(),{plugins:u}=Ie(),f=e??n!=="review",C=()=>{if(n==="review")i("payment_method");else{const k=document.getElementById("checkout-payment-form");k==null||k.requestSubmit()}},g=n==="review"?d.continueToPay:d.payNow,w=n==="review"||!!l,j={items:s,totals:r,step:n,t:d,fmt:a},b=u.some(k=>k.slots.totalsDiscountAction);return o.jsxs("div",{className:"flex flex-col h-full animate-in fade-in duration-500",children:[o.jsx("h3",{className:"text-xs font-bold text-text/40 uppercase tracking-widest mb-6",children:d.orderSummaryTitle}),f&&o.jsx("div",{className:"flex flex-col gap-4 overflow-y-auto pr-2 custom-scrollbar",children:s.map(k=>o.jsxs("div",{className:"flex items-start gap-3",children:[k.image&&o.jsx("img",{src:k.image,alt:k.name,className:"w-10 h-10 rounded-lg object-cover border border-border/40 shrink-0 shadow-sm"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-[13px] font-semibold leading-tight truncate text-text/80",children:k.name}),o.jsxs("p",{className:"text-[11px] text-text/40 mt-0.5 font-medium",children:[d.quantityShort,": ",k.quantity]})]}),o.jsx("div",{className:"text-right shrink-0",children:o.jsx("span",{className:"text-[13px] font-bold text-text/80",children:a(k.total)})})]},k.id))}),o.jsxs("div",{className:"flex flex-col gap-2",children:[ke(u,"sidebarBeforeTotals",j),o.jsxs("div",{className:"flex border-t border-border/50 justify-between text-sm text-text/60 font-medium",children:[o.jsx("span",{children:d.subtotal}),o.jsx("span",{children:a(r.subtotal)})]}),r.discount!==void 0&&r.discount>0&&o.jsxs("div",{className:"flex justify-between items-center text-sm font-semibold text-success",children:[o.jsx("span",{children:d.discount}),o.jsxs("span",{className:"flex items-center gap-1.5",children:["-",a(r.discount),b&&ke(u,"totalsDiscountAction",j)]})]}),r.shipping!==void 0&&o.jsxs("div",{className:"flex justify-between text-sm text-text/60 font-medium",children:[o.jsx("span",{children:d.shipping}),o.jsx("span",{children:r.shipping===0?d.shippingFree:a(r.shipping)})]}),r.taxes!==void 0&&o.jsxs("div",{className:"flex justify-between text-sm text-text/60 font-medium",children:[o.jsx("span",{children:d.taxes}),o.jsx("span",{children:a(r.taxes)})]}),o.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-border/50 mt-2",children:[o.jsx("span",{className:"font-bold text-base text-text/90",children:d.total}),o.jsx("span",{className:"text-2xl font-black text-primary tracking-tight",children:a(r.total)})]})]}),o.jsxs("div",{className:"flex flex-col gap-2 mt-auto",children:[o.jsx("button",{onClick:C,disabled:!w||t,className:L("w-full mt-6 py-4 px-6 rounded-xs font-bold flex items-center justify-center gap-2 transition-all duration-300 shadow-lg active:scale-[0.98]",w&&!t?"bg-primary text-surface hover:brightness-110 shadow-primary/20 cursor-pointer":"bg-primary/40 text-surface/60 cursor-not-allowed shadow-none"),children:t?o.jsx(K,{className:"w-5 h-5 animate-spin"}):o.jsxs(o.Fragment,{children:[g,n==="review"&&o.jsx(Qt,{className:"w-5 h-5"})]})}),o.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4 text-[11px] text-text/30 font-semibold tracking-wide",children:[o.jsx(hr,{className:"w-4 h-4 opacity-50"}),o.jsx("span",{children:d.securePayment})]})]})]})},Ze=({onAction:e,actionLabel:t,actionDisabled:s,isSubmitting:r,showItems:n=!1})=>{const{totals:i,items:l,step:d}=se(),{t:a,fmt:u}=ne(),{plugins:f}=Ie(),[C,g]=N.useState(!1),w={items:l,totals:i,step:d,t:a,fmt:u},j=f.some(b=>b.slots.totalsDiscountAction);return o.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-30 md:hidden",children:[o.jsx("div",{className:`bg-surface border-t border-border overflow-hidden transition-all duration-300 ease-in-out ${C?"max-h-[70vh] opacity-100":"max-h-0 opacity-0 pointer-events-none"}`,children:o.jsxs("div",{className:"px-4 pt-4 pb-2 flex flex-col gap-0",children:[n&&o.jsx("div",{className:"overflow-y-auto max-h-52 divide-y divide-border/40 mb-3",children:l.map(b=>o.jsxs("div",{className:"flex items-center gap-3 py-2.5",children:[b.image&&o.jsx("img",{src:b.image,alt:b.name,className:"w-10 h-10 rounded-lg object-cover border border-border/30 shrink-0"}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsx("p",{className:"text-sm font-medium truncate",children:b.name}),o.jsxs("p",{className:"text-xs text-text/50",children:[a.quantityShort,": ",b.quantity]}),b.discount&&o.jsxs("p",{className:"text-[10px] text-success font-medium",children:[b.discount.label&&`${b.discount.label} · `,b.discount.type==="percentage"?`-${b.discount.value}%`:`-${u(b.discount.value)}`]})]}),o.jsx("div",{className:"text-right shrink-0",children:b.discount?o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsx("span",{className:"text-[11px] line-through text-text/40",children:u(b.unitPrice*b.quantity)}),o.jsx("span",{className:"text-sm font-semibold text-success",children:u(b.total)})]}):o.jsx("span",{className:"text-sm font-medium",children:u(b.total)})})]},b.id))}),ke(f,"mobileBarExpanded",w),o.jsxs("div",{className:`flex flex-col gap-1.5 text-sm pb-3 ${n?"border-t border-border/50 pt-3":"pt-1"}`,children:[o.jsxs("div",{className:"flex justify-between text-text/60",children:[o.jsx("span",{children:a.subtotal}),o.jsx("span",{children:u(i.subtotal)})]}),i.discount!==void 0&&i.discount>0&&o.jsxs("div",{className:"flex justify-between items-center text-success font-medium",children:[o.jsx("span",{children:a.discount}),o.jsxs("span",{className:"flex items-center gap-1.5",children:["-",u(i.discount),j&&ke(f,"totalsDiscountAction",w)]})]}),i.shipping!==void 0&&o.jsxs("div",{className:"flex justify-between text-text/60",children:[o.jsx("span",{children:a.shipping}),o.jsx("span",{children:i.shipping===0?a.shippingFree:u(i.shipping)})]}),i.taxes!==void 0&&o.jsxs("div",{className:"flex justify-between text-text/60",children:[o.jsx("span",{children:a.taxes}),o.jsx("span",{children:u(i.taxes)})]})]})]})}),o.jsxs("div",{className:"bg-surface border-t border-border shadow-[0_-4px_20px_rgba(0,0,0,0.1)] px-4 pt-3 pb-4 flex flex-col gap-3",children:[o.jsxs("button",{type:"button",onClick:()=>g(b=>!b),className:"flex items-center justify-between w-full","aria-label":C?a.hideOrderDetails:a.showOrderDetails,children:[o.jsx("span",{className:"text-sm font-medium text-text/60",children:a.total}),o.jsxs("span",{className:"flex items-center gap-1.5",children:[o.jsx("span",{className:"text-lg font-bold text-primary",children:u(i.total)}),C?o.jsx(Vt,{className:"w-4 h-4 text-text/40"}):o.jsx(Xt,{className:"w-4 h-4 text-text/40"})]})]}),e&&o.jsx("button",{type:"button",onClick:e,disabled:s||r,className:`w-full py-3 rounded-[var(--radius-DEFAULT)] font-medium text-sm flex items-center justify-center gap-2 transition-all active:scale-[0.98] ${s||r?"bg-primary/40 text-surface cursor-not-allowed":"bg-primary text-surface hover:opacity-90"}`,children:r?o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"w-4 h-4 animate-spin"}),a.processing]}):t??a.continue})]})]})},Uo=({step:e})=>{const{setStep:t}=se(),{t:s}=ne();return we(e)?o.jsx(Ze,{onAction:()=>t("payment_method"),actionLabel:`${s.continueToPay} →`,showItems:!1}):ve(e)?o.jsx(Ze,{onAction:()=>{const r=document.getElementById("checkout-payment-form");r==null||r.requestSubmit()},actionLabel:s.pay,showItems:!0}):null},Go=({devTools:e})=>{const{state:t}=Pe(),{t:s}=ne(),{step:r,paymentResult:n}=t,i=()=>{var l,d,a;switch(r){case"review":return o.jsx(He,{});case"payment_method":return o.jsx(Mo,{});case"processing":return o.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[o.jsx(K,{className:"w-12 h-12 animate-spin text-primary"}),o.jsx("p",{className:"font-medium text-lg animate-pulse",children:s.processingPayment}),o.jsx("p",{className:"text-sm text-text/50",children:s.processingDescription})]});case"success":case"pending":case"error":return o.jsx(Je,{variant:n==null?void 0:n.status,title:((l=n==null?void 0:n.feedback)==null?void 0:l.title)??"",description:(d=n==null?void 0:n.feedback)==null?void 0:d.title,actions:(a=n==null?void 0:n.feedback)==null?void 0:a.actions});case"redirect":{const u=(n==null?void 0:n.status)==="redirect"?n:void 0,f=u==null?void 0:u.feedback;return o.jsx(Je,{variant:"redirect",title:(f==null?void 0:f.title)??s.redirecting,description:(f==null?void 0:f.description)??s.redirectDescription,actions:(f==null?void 0:f.actions)??[{label:s.continueNow,variant:"solid",onPress:()=>{u!=null&&u.url&&(window.location.href=u.url)}}]})}default:return o.jsx(He,{})}};return o.jsxs("div",{className:"h-[80vh] md:h-full w-full flex flex-col",children:[o.jsx(zo,{sidebar:we(r)||ve(r)?o.jsx($o,{}):void 0,children:i()}),(we(r)||ve(r))&&o.jsx(Uo,{step:r}),e&&o.jsx(Fo,{})]})},Bo=({items:e,totals:t,paymentMethods:s,provider:r,currency:n,locale:i="es",theme:l="light",brandColor:d,customTheme:a,onEvent:u,cartController:f,initialState:C,devTools:g,messages:w,formatters:j,plugins:b=[]})=>o.jsx(jo,{theme:l,brandColor:d,customTheme:a,children:o.jsx(_o,{locale:i,currency:n,messages:w,formatters:j,children:o.jsx(Po,{plugins:b,children:o.jsx(Pr,{config:{items:e,totals:t,paymentMethods:s,provider:r,currency:n,locale:i,cartController:f},initialStatus:C,onEvent:u,children:o.jsx(Go,{devTools:g})})})})});exports.Checkout=Bo;exports.checkoutThemes=tt;exports.cn=L;exports.createCartEditPlugin=Rr;exports.createCssVars=rt;exports.createDiscountPlugin=Nr;exports.darken=Rt;exports.defaultTheme=Ee;exports.formatNumber=jt;exports.generateBrandTheme=ot;exports.getContrastColor=Ke;exports.getLuminance=_e;exports.hexToRgb=oe;exports.isDark=Tt;exports.isPaymentStep=ve;exports.isReviewStep=we;exports.lighten=_t;exports.mergeTheme=Se;exports.mix=Pt;exports.resolveTheme=st;exports.rgbToHex=je;exports.useCheckout=se;
136
+ */const xr=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],hr=S("x",xr),ze=({onApply:e,t,compact:o})=>{const[r,n]=v.useState(""),[l,i]=v.useState("idle"),c=()=>{r.trim()&&(i("loading"),e(r.trim()),n(""),setTimeout(()=>i("idle"),500))},a=l==="loading"||!r.trim();return s.jsxs("div",{className:"flex gap-2",children:[s.jsxs("div",{className:"flex-1 flex items-center gap-2 border border-border/60 focus-within:border-primary/50 focus-within:ring-2 focus-within:ring-primary/5 rounded-xs px-3 py-2 transition-all bg-white",children:[s.jsx(mr,{className:`${o?"w-3 h-3":"w-3.5 h-3.5"} text-text/30 shrink-0`}),s.jsx("input",{type:"text",value:r,onChange:d=>n(d.target.value),onKeyDown:d=>d.key==="Enter"&&c(),placeholder:t.couponPlaceholder,className:`bg-transparent outline-none w-full placeholder:text-text/30 text-text font-semibold ${o?"text-xs":"text-sm"}`})]}),s.jsx("button",{type:"button",onClick:c,disabled:a,className:`font-bold bg-primary text-surface rounded-xs hover:brightness-110 disabled:opacity-40 transition-all ${o?"px-3 py-2 text-xs":"px-4 py-2 text-sm"} ${a?"cursor-not-allowed":"cursor-pointer"}`,children:l==="loading"?s.jsx(U,{className:"w-3.5 h-3.5 animate-spin"}):t.couponApply})]})},fr=({onRemove:e,t})=>s.jsx("button",{type:"button",onClick:e,className:"p-0.5 rounded text-error hover:text-error hover:bg-error/10 transition-colors","aria-label":t.couponRemove,children:s.jsx(tt,{className:"w-3 h-3"})});function br(e){return{id:"discount",slots:{sidebarBeforeTotals:({step:t,t:o})=>t!=="review"?null:s.jsx("div",{className:"mb-6",children:s.jsx(ze,{onApply:r=>e({type:"COUPON_APPLY_REQUESTED",code:r}),t:o,compact:!0})}),mobileBarExpanded:({step:t,t:o})=>t!=="review"?null:s.jsx("div",{className:"mb-3 pb-3 border-b border-border/40",children:s.jsx(ze,{onApply:r=>e({type:"COUPON_APPLY_REQUESTED",code:r}),t:o})}),totalsDiscountAction:({step:t,t:o})=>t!=="review"?null:s.jsx(fr,{onRemove:()=>e({type:"COUPON_REMOVE_REQUESTED"}),t:o})}}}const gr=({quantity:e,min:t,max:o,loading:r,onChange:n})=>s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("div",{className:"flex items-center border border-border/60 rounded-xl bg-background/30 p-0.5 overflow-hidden",children:[s.jsx("button",{type:"button",onClick:()=>n(e-1),disabled:r||e<=t,className:"w-8 h-8 flex items-center justify-center text-text/60 hover:bg-border/30 rounded-lg transition-colors disabled:opacity-30",children:s.jsx(nr,{className:"w-3.5 h-3.5"})}),s.jsx("span",{className:"text-sm font-bold w-7 text-center select-none",children:e}),s.jsx("button",{type:"button",onClick:()=>n(e+1),disabled:r||e>=o,className:"w-8 h-8 flex items-center justify-center text-text/60 hover:bg-border/30 rounded-lg transition-colors disabled:opacity-30",children:s.jsx(ir,{className:"w-3.5 h-3.5"})})]}),r&&s.jsx(U,{className:"w-4 h-4 animate-spin text-primary"})]}),yr=({loading:e,onRemove:t,label:o})=>s.jsx("button",{type:"button",onClick:t,disabled:e,className:"p-2 -mr-1 rounded-full text-text/20 hover:text-error hover:bg-error/10 transition-all disabled:opacity-50","aria-label":o,children:e?s.jsx(U,{className:"w-4 h-4 animate-spin"}):s.jsx(tt,{className:"w-5 h-5"})}),vr=({props:e,emit:t,options:o})=>{const[r,n]=v.useState(!1),{item:l,t:i}=e,c=a=>{a<o.minQuantity||a>o.maxQuantity||(n(!0),t({type:"ITEM_QUANTITY_UPDATE_REQUESTED",itemId:l.id,quantity:a}),setTimeout(()=>n(!1),2e3))};return o.allowQuantityEdit?s.jsx("div",{className:"mt-3",children:s.jsx(gr,{quantity:l.quantity,min:o.minQuantity,max:o.maxQuantity,loading:r,onChange:c})}):s.jsxs("span",{className:"text-sm text-text/40 mt-1 block font-semibold uppercase tracking-wider",children:[i.quantityShort,": ",l.quantity]})},wr=({props:e,emit:t,options:o})=>{const[r,n]=v.useState(!1),{item:l,t:i}=e;if(!o.allowRemove)return null;const c=()=>{n(!0),t({type:"ITEM_REMOVE_REQUESTED",itemId:l.id}),setTimeout(()=>n(!1),2e3)};return s.jsx(yr,{loading:r,onRemove:c,label:i.removeItem})};function kr(e,t){const o={allowRemove:!!(t!=null&&t.allowRemove),allowQuantityEdit:!!(t!=null&&t.allowQuantityEdit),minQuantity:(t==null?void 0:t.minQuantity)??1,maxQuantity:(t==null?void 0:t.maxQuantity)??99};return{id:"cart-edit",slots:{orderItemActions:r=>s.jsx(vr,{props:r,emit:e,options:o}),orderItemEnd:r=>s.jsx(wr,{props:r,emit:e,options:o})}}}const rt=v.createContext(null),jr=(e,t)=>{switch(t.type){case"SET_STEP":return{...e,step:t.step};case"SELECT_METHOD":return{...e,selectedMethodId:t.methodId};case"SET_ERROR":return{...e,error:t.error};case"SET_CART":return{...e,items:t.cartState.items,totals:t.cartState.totals};case"SYNC_PROPS":return{...e,items:t.items,totals:t.totals};case"SET_PAYMENT_RESULT":return{...e,paymentResult:t.result};default:return e}},Nr=({children:e,config:t,initialStatus:o,onEvent:r})=>{const[n,l]=v.useReducer(jr,{...t,step:o?o.status:"review",selectedMethodId:null,error:null,paymentResult:o});v.useEffect(()=>{l({type:"SYNC_PROPS",items:t.items,totals:t.totals})},[t.items,t.totals]);const[i,c]=v.useState([]),a=v.useCallback(d=>{r==null||r(d),c(x=>[`[${new Date().toLocaleTimeString()}] ${d.type}`,...x].slice(0,20))},[r]);return s.jsx(rt.Provider,{value:{state:n,dispatch:l,emitEvent:a,eventLog:i},children:e})},ve=()=>{const e=v.useContext(rt);if(!e)throw new Error("useCheckoutContext must be used within a CheckoutProvider");return e},W=()=>{var j;const{state:e,dispatch:t,emitEvent:o}=ve(),r=g=>{t({type:"SET_STEP",step:g}),o({type:"STEP_CHANGED",step:g})};return{...e,setStep:r,selectMethod:g=>{t({type:"SELECT_METHOD",methodId:g}),o({type:"PAYMENT_METHOD_SELECTED",methodId:g})},submitPayment:async g=>{var y;if(e.selectedMethodId){o({type:"PAYMENT_SUBMITTED"}),r("processing"),t({type:"SET_ERROR",error:null});try{const w=await e.provider.createPayment(g);switch(t({type:"SET_PAYMENT_RESULT",result:w}),console.log(w),w.status){case"success":o({type:"PAYMENT_SUCCESS",transactionId:"unknown"}),r("success");break;case"pending":o({type:"STEP_CHANGED",step:"pending"}),r("pending");break;case"redirect":o({type:"STEP_CHANGED",step:"redirect"}),r("redirect");break;case"error":{const f=((y=w.feedback)==null?void 0:y.description)??"Payment failed";t({type:"SET_ERROR",error:f}),o({type:"PAYMENT_ERROR",error:f}),r("error");break}}}catch(w){const f=w instanceof Error?w.message:"Unknown error";t({type:"SET_ERROR",error:f}),o({type:"PAYMENT_ERROR",error:f}),r("error")}}},setError:g=>{t({type:"SET_ERROR",error:g}),o({type:"PAYMENT_ERROR",error:g})},updateQuantity:async(g,y)=>{if(!e.cartController)return;const w=await e.cartController.updateQuantity(g,y);t({type:"SET_CART",cartState:w})},removeItem:async g=>{if(!e.cartController)return;const y=await e.cartController.removeItem(g);t({type:"SET_CART",cartState:y})},applyCoupon:async g=>{if(!e.cartController)return!1;try{const y=await e.cartController.applyCoupon(g);return t({type:"SET_CART",cartState:y}),!0}catch{return!1}},removeCoupon:async()=>{var g;if(!((g=e.cartController)!=null&&g.removeCoupon))return!1;try{const y=await e.cartController.removeCoupon();return t({type:"SET_CART",cartState:y}),!0}catch{return!1}},hasCartController:!!e.cartController,hasRemoveCoupon:!!((j=e.cartController)!=null&&j.removeCoupon)}};function st(e){var t,o,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var n=e.length;for(t=0;t<n;t++)e[t]&&(o=st(e[t]))&&(r&&(r+=" "),r+=o)}else for(o in e)e[o]&&(r&&(r+=" "),r+=o);return r}function Cr(){for(var e,t,o=0,r="",n=arguments.length;o<n;o++)(e=arguments[o])&&(t=st(e))&&(r&&(r+=" "),r+=t);return r}const Sr=(e,t)=>{const o=new Array(e.length+t.length);for(let r=0;r<e.length;r++)o[r]=e[r];for(let r=0;r<t.length;r++)o[e.length+r]=t[r];return o},Er=(e,t)=>({classGroupId:e,validator:t}),ot=(e=new Map,t=null,o)=>({nextPart:e,validators:t,classGroupId:o}),ne="-",De=[],Pr="arbitrary..",Tr=e=>{const t=Ar(e),{conflictingClassGroups:o,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:i=>{if(i.startsWith("[")&&i.endsWith("]"))return Rr(i);const c=i.split(ne),a=c[0]===""&&c.length>1?1:0;return nt(c,a,t)},getConflictingClassGroupIds:(i,c)=>{if(c){const a=r[i],d=o[i];return a?d?Sr(d,a):a:d||De}return o[i]||De}}},nt=(e,t,o)=>{if(e.length-t===0)return o.classGroupId;const n=e[t],l=o.nextPart.get(n);if(l){const d=nt(e,t+1,l);if(d)return d}const i=o.validators;if(i===null)return;const c=t===0?e.join(ne):e.slice(t).join(ne),a=i.length;for(let d=0;d<a;d++){const x=i[d];if(x.validator(c))return x.classGroupId}},Rr=e=>e.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),o=t.indexOf(":"),r=t.slice(0,o);return r?Pr+r:void 0})(),Ar=e=>{const{theme:t,classGroups:o}=e;return Mr(o,t)},Mr=(e,t)=>{const o=ot();for(const r in e){const n=e[r];we(n,o,r,t)}return o},we=(e,t,o,r)=>{const n=e.length;for(let l=0;l<n;l++){const i=e[l];_r(i,t,o,r)}},_r=(e,t,o,r)=>{if(typeof e=="string"){Ir(e,t,o);return}if(typeof e=="function"){zr(e,t,o,r);return}Dr(e,t,o,r)},Ir=(e,t,o)=>{const r=e===""?t:at(t,e);r.classGroupId=o},zr=(e,t,o,r)=>{if(Or(e)){we(e(r),t,o,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Er(o,e))},Dr=(e,t,o,r)=>{const n=Object.entries(e),l=n.length;for(let i=0;i<l;i++){const[c,a]=n[i];we(a,at(t,c),o,r)}},at=(e,t)=>{let o=e;const r=t.split(ne),n=r.length;for(let l=0;l<n;l++){const i=r[l];let c=o.nextPart.get(i);c||(c=ot(),o.nextPart.set(i,c)),o=c}return o},Or=e=>"isThemeGetter"in e&&e.isThemeGetter===!0,Lr=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,o=Object.create(null),r=Object.create(null);const n=(l,i)=>{o[l]=i,t++,t>e&&(t=0,r=o,o=Object.create(null))};return{get(l){let i=o[l];if(i!==void 0)return i;if((i=r[l])!==void 0)return n(l,i),i},set(l,i){l in o?o[l]=i:n(l,i)}}},ge="!",Oe=":",Fr=[],Le=(e,t,o,r,n)=>({modifiers:e,hasImportantModifier:t,baseClassName:o,maybePostfixModifierPosition:r,isExternal:n}),$r=e=>{const{prefix:t,experimentalParseClassName:o}=e;let r=n=>{const l=[];let i=0,c=0,a=0,d;const x=n.length;for(let f=0;f<x;f++){const k=n[f];if(i===0&&c===0){if(k===Oe){l.push(n.slice(a,f)),a=f+1;continue}if(k==="/"){d=f;continue}}k==="["?i++:k==="]"?i--:k==="("?c++:k===")"&&c--}const j=l.length===0?n:n.slice(a);let g=j,y=!1;j.endsWith(ge)?(g=j.slice(0,-1),y=!0):j.startsWith(ge)&&(g=j.slice(1),y=!0);const w=d&&d>a?d-a:void 0;return Le(l,y,g,w)};if(t){const n=t+Oe,l=r;r=i=>i.startsWith(n)?l(i.slice(n.length)):Le(Fr,!1,i,void 0,!0)}if(o){const n=r;r=l=>o({className:l,parseClassName:n})}return r},Br=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((o,r)=>{t.set(o,1e6+r)}),o=>{const r=[];let n=[];for(let l=0;l<o.length;l++){const i=o[l],c=i[0]==="[",a=t.has(i);c||a?(n.length>0&&(n.sort(),r.push(...n),n=[]),r.push(i)):n.push(i)}return n.length>0&&(n.sort(),r.push(...n)),r}},Gr=e=>({cache:Lr(e.cacheSize),parseClassName:$r(e),sortModifiers:Br(e),...Tr(e)}),Ur=/\s+/,Vr=(e,t)=>{const{parseClassName:o,getClassGroupId:r,getConflictingClassGroupIds:n,sortModifiers:l}=t,i=[],c=e.trim().split(Ur);let a="";for(let d=c.length-1;d>=0;d-=1){const x=c[d],{isExternal:j,modifiers:g,hasImportantModifier:y,baseClassName:w,maybePostfixModifierPosition:f}=o(x);if(j){a=x+(a.length>0?" "+a:a);continue}let k=!!f,I=r(k?w.substring(0,f):w);if(!I){if(!k){a=x+(a.length>0?" "+a:a);continue}if(I=r(w),!I){a=x+(a.length>0?" "+a:a);continue}k=!1}const N=g.length===0?"":g.length===1?g[0]:l(g).join(":"),R=y?N+ge:N,D=R+I;if(i.indexOf(D)>-1)continue;i.push(D);const q=n(I,k);for(let $=0;$<q.length;++$){const X=q[$];i.push(R+X)}a=x+(a.length>0?" "+a:a)}return a},qr=(...e)=>{let t=0,o,r,n="";for(;t<e.length;)(o=e[t++])&&(r=it(o))&&(n&&(n+=" "),n+=r);return n},it=e=>{if(typeof e=="string")return e;let t,o="";for(let r=0;r<e.length;r++)e[r]&&(t=it(e[r]))&&(o&&(o+=" "),o+=t);return o},Qr=(e,...t)=>{let o,r,n,l;const i=a=>{const d=t.reduce((x,j)=>j(x),e());return o=Gr(d),r=o.cache.get,n=o.cache.set,l=c,c(a)},c=a=>{const d=r(a);if(d)return d;const x=Vr(a,o);return n(a,x),x};return l=i,(...a)=>l(qr(...a))},Yr=[],C=e=>{const t=o=>o[e]||Yr;return t.isThemeGetter=!0,t},lt=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ct=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Wr=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Hr=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Xr=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Jr=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Kr=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Zr=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,O=e=>Wr.test(e),b=e=>!!e&&!Number.isNaN(Number(e)),L=e=>!!e&&Number.isInteger(Number(e)),he=e=>e.endsWith("%")&&b(e.slice(0,-1)),z=e=>Hr.test(e),dt=()=>!0,es=e=>Xr.test(e)&&!Jr.test(e),ke=()=>!1,ts=e=>Kr.test(e),rs=e=>Zr.test(e),ss=e=>!m(e)&&!u(e),os=e=>F(e,pt,ke),m=e=>lt.test(e),G=e=>F(e,xt,es),Fe=e=>F(e,us,b),ns=e=>F(e,ft,dt),as=e=>F(e,ht,ke),$e=e=>F(e,mt,ke),is=e=>F(e,ut,rs),se=e=>F(e,bt,ts),u=e=>ct.test(e),J=e=>V(e,xt),ls=e=>V(e,ht),Be=e=>V(e,mt),cs=e=>V(e,pt),ds=e=>V(e,ut),oe=e=>V(e,bt,!0),ms=e=>V(e,ft,!0),F=(e,t,o)=>{const r=lt.exec(e);return r?r[1]?t(r[1]):o(r[2]):!1},V=(e,t,o=!1)=>{const r=ct.exec(e);return r?r[1]?t(r[1]):o:!1},mt=e=>e==="position"||e==="percentage",ut=e=>e==="image"||e==="url",pt=e=>e==="length"||e==="size"||e==="bg-size",xt=e=>e==="length",us=e=>e==="number",ht=e=>e==="family-name",ft=e=>e==="number"||e==="weight",bt=e=>e==="shadow",ps=()=>{const e=C("color"),t=C("font"),o=C("text"),r=C("font-weight"),n=C("tracking"),l=C("leading"),i=C("breakpoint"),c=C("container"),a=C("spacing"),d=C("radius"),x=C("shadow"),j=C("inset-shadow"),g=C("text-shadow"),y=C("drop-shadow"),w=C("blur"),f=C("perspective"),k=C("aspect"),I=C("ease"),N=C("animate"),R=()=>["auto","avoid","all","avoid-page","page","left","right","column"],D=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],q=()=>[...D(),u,m],$=()=>["auto","hidden","clip","visible","scroll"],X=()=>["auto","contain","none"],p=()=>[u,m,a],A=()=>[O,"full","auto",...p()],Ne=()=>[L,"none","subgrid",u,m],Ce=()=>["auto",{span:["full",L,u,m]},L,u,m],K=()=>[L,"auto",u,m],Se=()=>["auto","min","max","fr",u,m],de=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],Q=()=>["start","end","center","stretch","center-safe","end-safe"],_=()=>["auto",...p()],B=()=>[O,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...p()],me=()=>[O,"screen","full","dvw","lvw","svw","min","max","fit",...p()],ue=()=>[O,"screen","full","lh","dvh","lvh","svh","min","max","fit",...p()],h=()=>[e,u,m],Ee=()=>[...D(),Be,$e,{position:[u,m]}],Pe=()=>["no-repeat",{repeat:["","x","y","space","round"]}],Te=()=>["auto","cover","contain",cs,os,{size:[u,m]}],pe=()=>[he,J,G],P=()=>["","none","full",d,u,m],T=()=>["",b,J,G],Z=()=>["solid","dashed","dotted","double"],Re=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],E=()=>[b,he,Be,$e],Ae=()=>["","none",w,u,m],ee=()=>["none",b,u,m],te=()=>["none",b,u,m],xe=()=>[b,u,m],re=()=>[O,"full",...p()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[z],breakpoint:[z],color:[dt],container:[z],"drop-shadow":[z],ease:["in","out","in-out"],font:[ss],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[z],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[z],shadow:[z],spacing:["px",b],text:[z],"text-shadow":[z],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",O,m,u,k]}],container:["container"],columns:[{columns:[b,m,u,c]}],"break-after":[{"break-after":R()}],"break-before":[{"break-before":R()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:q()}],overflow:[{overflow:$()}],"overflow-x":[{"overflow-x":$()}],"overflow-y":[{"overflow-y":$()}],overscroll:[{overscroll:X()}],"overscroll-x":[{"overscroll-x":X()}],"overscroll-y":[{"overscroll-y":X()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:A()}],"inset-x":[{"inset-x":A()}],"inset-y":[{"inset-y":A()}],start:[{"inset-s":A(),start:A()}],end:[{"inset-e":A(),end:A()}],"inset-bs":[{"inset-bs":A()}],"inset-be":[{"inset-be":A()}],top:[{top:A()}],right:[{right:A()}],bottom:[{bottom:A()}],left:[{left:A()}],visibility:["visible","invisible","collapse"],z:[{z:[L,"auto",u,m]}],basis:[{basis:[O,"full","auto",c,...p()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[b,O,"auto","initial","none",m]}],grow:[{grow:["",b,u,m]}],shrink:[{shrink:["",b,u,m]}],order:[{order:[L,"first","last","none",u,m]}],"grid-cols":[{"grid-cols":Ne()}],"col-start-end":[{col:Ce()}],"col-start":[{"col-start":K()}],"col-end":[{"col-end":K()}],"grid-rows":[{"grid-rows":Ne()}],"row-start-end":[{row:Ce()}],"row-start":[{"row-start":K()}],"row-end":[{"row-end":K()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":Se()}],"auto-rows":[{"auto-rows":Se()}],gap:[{gap:p()}],"gap-x":[{"gap-x":p()}],"gap-y":[{"gap-y":p()}],"justify-content":[{justify:[...de(),"normal"]}],"justify-items":[{"justify-items":[...Q(),"normal"]}],"justify-self":[{"justify-self":["auto",...Q()]}],"align-content":[{content:["normal",...de()]}],"align-items":[{items:[...Q(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...Q(),{baseline:["","last"]}]}],"place-content":[{"place-content":de()}],"place-items":[{"place-items":[...Q(),"baseline"]}],"place-self":[{"place-self":["auto",...Q()]}],p:[{p:p()}],px:[{px:p()}],py:[{py:p()}],ps:[{ps:p()}],pe:[{pe:p()}],pbs:[{pbs:p()}],pbe:[{pbe:p()}],pt:[{pt:p()}],pr:[{pr:p()}],pb:[{pb:p()}],pl:[{pl:p()}],m:[{m:_()}],mx:[{mx:_()}],my:[{my:_()}],ms:[{ms:_()}],me:[{me:_()}],mbs:[{mbs:_()}],mbe:[{mbe:_()}],mt:[{mt:_()}],mr:[{mr:_()}],mb:[{mb:_()}],ml:[{ml:_()}],"space-x":[{"space-x":p()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":p()}],"space-y-reverse":["space-y-reverse"],size:[{size:B()}],"inline-size":[{inline:["auto",...me()]}],"min-inline-size":[{"min-inline":["auto",...me()]}],"max-inline-size":[{"max-inline":["none",...me()]}],"block-size":[{block:["auto",...ue()]}],"min-block-size":[{"min-block":["auto",...ue()]}],"max-block-size":[{"max-block":["none",...ue()]}],w:[{w:[c,"screen",...B()]}],"min-w":[{"min-w":[c,"screen","none",...B()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[i]},...B()]}],h:[{h:["screen","lh",...B()]}],"min-h":[{"min-h":["screen","lh","none",...B()]}],"max-h":[{"max-h":["screen","lh",...B()]}],"font-size":[{text:["base",o,J,G]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,ms,ns]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",he,m]}],"font-family":[{font:[ls,as,t]}],"font-features":[{"font-features":[m]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[n,u,m]}],"line-clamp":[{"line-clamp":[b,"none",u,Fe]}],leading:[{leading:[l,...p()]}],"list-image":[{"list-image":["none",u,m]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",u,m]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:h()}],"text-color":[{text:h()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Z(),"wavy"]}],"text-decoration-thickness":[{decoration:[b,"from-font","auto",u,G]}],"text-decoration-color":[{decoration:h()}],"underline-offset":[{"underline-offset":[b,"auto",u,m]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:p()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",u,m]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",u,m]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:Ee()}],"bg-repeat":[{bg:Pe()}],"bg-size":[{bg:Te()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},L,u,m],radial:["",u,m],conic:[L,u,m]},ds,is]}],"bg-color":[{bg:h()}],"gradient-from-pos":[{from:pe()}],"gradient-via-pos":[{via:pe()}],"gradient-to-pos":[{to:pe()}],"gradient-from":[{from:h()}],"gradient-via":[{via:h()}],"gradient-to":[{to:h()}],rounded:[{rounded:P()}],"rounded-s":[{"rounded-s":P()}],"rounded-e":[{"rounded-e":P()}],"rounded-t":[{"rounded-t":P()}],"rounded-r":[{"rounded-r":P()}],"rounded-b":[{"rounded-b":P()}],"rounded-l":[{"rounded-l":P()}],"rounded-ss":[{"rounded-ss":P()}],"rounded-se":[{"rounded-se":P()}],"rounded-ee":[{"rounded-ee":P()}],"rounded-es":[{"rounded-es":P()}],"rounded-tl":[{"rounded-tl":P()}],"rounded-tr":[{"rounded-tr":P()}],"rounded-br":[{"rounded-br":P()}],"rounded-bl":[{"rounded-bl":P()}],"border-w":[{border:T()}],"border-w-x":[{"border-x":T()}],"border-w-y":[{"border-y":T()}],"border-w-s":[{"border-s":T()}],"border-w-e":[{"border-e":T()}],"border-w-bs":[{"border-bs":T()}],"border-w-be":[{"border-be":T()}],"border-w-t":[{"border-t":T()}],"border-w-r":[{"border-r":T()}],"border-w-b":[{"border-b":T()}],"border-w-l":[{"border-l":T()}],"divide-x":[{"divide-x":T()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":T()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Z(),"hidden","none"]}],"divide-style":[{divide:[...Z(),"hidden","none"]}],"border-color":[{border:h()}],"border-color-x":[{"border-x":h()}],"border-color-y":[{"border-y":h()}],"border-color-s":[{"border-s":h()}],"border-color-e":[{"border-e":h()}],"border-color-bs":[{"border-bs":h()}],"border-color-be":[{"border-be":h()}],"border-color-t":[{"border-t":h()}],"border-color-r":[{"border-r":h()}],"border-color-b":[{"border-b":h()}],"border-color-l":[{"border-l":h()}],"divide-color":[{divide:h()}],"outline-style":[{outline:[...Z(),"none","hidden"]}],"outline-offset":[{"outline-offset":[b,u,m]}],"outline-w":[{outline:["",b,J,G]}],"outline-color":[{outline:h()}],shadow:[{shadow:["","none",x,oe,se]}],"shadow-color":[{shadow:h()}],"inset-shadow":[{"inset-shadow":["none",j,oe,se]}],"inset-shadow-color":[{"inset-shadow":h()}],"ring-w":[{ring:T()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:h()}],"ring-offset-w":[{"ring-offset":[b,G]}],"ring-offset-color":[{"ring-offset":h()}],"inset-ring-w":[{"inset-ring":T()}],"inset-ring-color":[{"inset-ring":h()}],"text-shadow":[{"text-shadow":["none",g,oe,se]}],"text-shadow-color":[{"text-shadow":h()}],opacity:[{opacity:[b,u,m]}],"mix-blend":[{"mix-blend":[...Re(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":Re()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[b]}],"mask-image-linear-from-pos":[{"mask-linear-from":E()}],"mask-image-linear-to-pos":[{"mask-linear-to":E()}],"mask-image-linear-from-color":[{"mask-linear-from":h()}],"mask-image-linear-to-color":[{"mask-linear-to":h()}],"mask-image-t-from-pos":[{"mask-t-from":E()}],"mask-image-t-to-pos":[{"mask-t-to":E()}],"mask-image-t-from-color":[{"mask-t-from":h()}],"mask-image-t-to-color":[{"mask-t-to":h()}],"mask-image-r-from-pos":[{"mask-r-from":E()}],"mask-image-r-to-pos":[{"mask-r-to":E()}],"mask-image-r-from-color":[{"mask-r-from":h()}],"mask-image-r-to-color":[{"mask-r-to":h()}],"mask-image-b-from-pos":[{"mask-b-from":E()}],"mask-image-b-to-pos":[{"mask-b-to":E()}],"mask-image-b-from-color":[{"mask-b-from":h()}],"mask-image-b-to-color":[{"mask-b-to":h()}],"mask-image-l-from-pos":[{"mask-l-from":E()}],"mask-image-l-to-pos":[{"mask-l-to":E()}],"mask-image-l-from-color":[{"mask-l-from":h()}],"mask-image-l-to-color":[{"mask-l-to":h()}],"mask-image-x-from-pos":[{"mask-x-from":E()}],"mask-image-x-to-pos":[{"mask-x-to":E()}],"mask-image-x-from-color":[{"mask-x-from":h()}],"mask-image-x-to-color":[{"mask-x-to":h()}],"mask-image-y-from-pos":[{"mask-y-from":E()}],"mask-image-y-to-pos":[{"mask-y-to":E()}],"mask-image-y-from-color":[{"mask-y-from":h()}],"mask-image-y-to-color":[{"mask-y-to":h()}],"mask-image-radial":[{"mask-radial":[u,m]}],"mask-image-radial-from-pos":[{"mask-radial-from":E()}],"mask-image-radial-to-pos":[{"mask-radial-to":E()}],"mask-image-radial-from-color":[{"mask-radial-from":h()}],"mask-image-radial-to-color":[{"mask-radial-to":h()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":D()}],"mask-image-conic-pos":[{"mask-conic":[b]}],"mask-image-conic-from-pos":[{"mask-conic-from":E()}],"mask-image-conic-to-pos":[{"mask-conic-to":E()}],"mask-image-conic-from-color":[{"mask-conic-from":h()}],"mask-image-conic-to-color":[{"mask-conic-to":h()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:Ee()}],"mask-repeat":[{mask:Pe()}],"mask-size":[{mask:Te()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",u,m]}],filter:[{filter:["","none",u,m]}],blur:[{blur:Ae()}],brightness:[{brightness:[b,u,m]}],contrast:[{contrast:[b,u,m]}],"drop-shadow":[{"drop-shadow":["","none",y,oe,se]}],"drop-shadow-color":[{"drop-shadow":h()}],grayscale:[{grayscale:["",b,u,m]}],"hue-rotate":[{"hue-rotate":[b,u,m]}],invert:[{invert:["",b,u,m]}],saturate:[{saturate:[b,u,m]}],sepia:[{sepia:["",b,u,m]}],"backdrop-filter":[{"backdrop-filter":["","none",u,m]}],"backdrop-blur":[{"backdrop-blur":Ae()}],"backdrop-brightness":[{"backdrop-brightness":[b,u,m]}],"backdrop-contrast":[{"backdrop-contrast":[b,u,m]}],"backdrop-grayscale":[{"backdrop-grayscale":["",b,u,m]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[b,u,m]}],"backdrop-invert":[{"backdrop-invert":["",b,u,m]}],"backdrop-opacity":[{"backdrop-opacity":[b,u,m]}],"backdrop-saturate":[{"backdrop-saturate":[b,u,m]}],"backdrop-sepia":[{"backdrop-sepia":["",b,u,m]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":p()}],"border-spacing-x":[{"border-spacing-x":p()}],"border-spacing-y":[{"border-spacing-y":p()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",u,m]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[b,"initial",u,m]}],ease:[{ease:["linear","initial",I,u,m]}],delay:[{delay:[b,u,m]}],animate:[{animate:["none",N,u,m]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[f,u,m]}],"perspective-origin":[{"perspective-origin":q()}],rotate:[{rotate:ee()}],"rotate-x":[{"rotate-x":ee()}],"rotate-y":[{"rotate-y":ee()}],"rotate-z":[{"rotate-z":ee()}],scale:[{scale:te()}],"scale-x":[{"scale-x":te()}],"scale-y":[{"scale-y":te()}],"scale-z":[{"scale-z":te()}],"scale-3d":["scale-3d"],skew:[{skew:xe()}],"skew-x":[{"skew-x":xe()}],"skew-y":[{"skew-y":xe()}],transform:[{transform:[u,m,"","none","gpu","cpu"]}],"transform-origin":[{origin:q()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:re()}],"translate-x":[{"translate-x":re()}],"translate-y":[{"translate-y":re()}],"translate-z":[{"translate-z":re()}],"translate-none":["translate-none"],accent:[{accent:h()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:h()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",u,m]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":p()}],"scroll-mx":[{"scroll-mx":p()}],"scroll-my":[{"scroll-my":p()}],"scroll-ms":[{"scroll-ms":p()}],"scroll-me":[{"scroll-me":p()}],"scroll-mbs":[{"scroll-mbs":p()}],"scroll-mbe":[{"scroll-mbe":p()}],"scroll-mt":[{"scroll-mt":p()}],"scroll-mr":[{"scroll-mr":p()}],"scroll-mb":[{"scroll-mb":p()}],"scroll-ml":[{"scroll-ml":p()}],"scroll-p":[{"scroll-p":p()}],"scroll-px":[{"scroll-px":p()}],"scroll-py":[{"scroll-py":p()}],"scroll-ps":[{"scroll-ps":p()}],"scroll-pe":[{"scroll-pe":p()}],"scroll-pbs":[{"scroll-pbs":p()}],"scroll-pbe":[{"scroll-pbe":p()}],"scroll-pt":[{"scroll-pt":p()}],"scroll-pr":[{"scroll-pr":p()}],"scroll-pb":[{"scroll-pb":p()}],"scroll-pl":[{"scroll-pl":p()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",u,m]}],fill:[{fill:["none",...h()]}],"stroke-w":[{stroke:[b,J,G,Fe]}],stroke:[{stroke:["none",...h()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-bs","border-w-be","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-bs","border-color-be","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mbs","scroll-mbe","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pbs","scroll-pbe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},xs=Qr(ps);function M(...e){return xs(Cr(e))}const ae=e=>e==="payment_method"||e==="payment_details",ie=e=>e==="review",gt=(e,t)=>new Intl.NumberFormat("en-US",{style:"currency",currency:t}).format(e),hs=({theme:e,brandColor:t,customTheme:o,children:r})=>{const n=Ze(e,t,o),l=Je(n);return s.jsx("div",{style:l,className:"bg-background text-text font-(--theme-font) h-full w-full",children:r})},yt={orderSummary:"Order Summary",quantity:"Qty",quantityShort:"Qty",removeItem:"Remove item",subtotal:"Subtotal",discount:"Discount",shipping:"Shipping",shippingFree:"Free",taxes:"Taxes",total:"Total",couponPlaceholder:"Promo code",couponApply:"Apply",couponApplied:"✓ Coupon applied",couponInvalid:"✗ Invalid code",couponRemove:"Remove coupon",orderSummaryTitle:"Order summary",securePayment:"SECURE SSL PAYMENT",continueToPay:"Continue to payment",payNow:"Pay now",pay:"Pay",processing:"Processing…",continueNow:"Continue now",paymentMethod:"Payment method",back:"Back",completeDetails:"Complete details",selectMethod:"Select a method",processingPayment:"Processing payment…",processingDescription:"Don't close or reload this window.",redirecting:"Redirecting…",redirectDescription:"You will be redirected to complete your payment securely.",showOrderDetails:"Show order details",hideOrderDetails:"Hide order details",continue:"Continue"},fs={orderSummary:"Resumen del pedido",quantity:"Cant",quantityShort:"Cant",removeItem:"Eliminar item",subtotal:"Subtotal",discount:"Descuento",shipping:"Envío",shippingFree:"Gratis",taxes:"Impuestos",total:"Total",couponPlaceholder:"Código promo",couponApply:"Aplicar",couponApplied:"✓ Cupón aplicado",couponInvalid:"✗ Código inválido",couponRemove:"Eliminar cupón",orderSummaryTitle:"Resumen del pedido",securePayment:"PAGO SEGURO SSL",continueToPay:"Continuar al pago",payNow:"Pagar ahora",pay:"Pagar",processing:"Procesando…",continueNow:"Continuar ahora",paymentMethod:"Método de pago",back:"Volver",completeDetails:"Completa los datos",selectMethod:"Selecciona un método",processingPayment:"Procesando pago…",processingDescription:"No cierres ni recargues esta ventana.",redirecting:"Redirigiendo…",redirectDescription:"Serás redirigido para completar tu pago de forma segura.",showOrderDetails:"Ver detalle del pedido",hideOrderDetails:"Ocultar detalle del pedido",continue:"Continuar"},bs={orderSummary:"Resumo do pedido",quantity:"Qtd",quantityShort:"Qtd",removeItem:"Remover item",subtotal:"Subtotal",discount:"Desconto",shipping:"Frete",shippingFree:"Grátis",taxes:"Impostos",total:"Total",couponPlaceholder:"Código promocional",couponApply:"Aplicar",couponApplied:"✓ Cupom aplicado",couponInvalid:"✗ Código inválido",couponRemove:"Remover cupom",orderSummaryTitle:"Resumo do pedido",securePayment:"PAGAMENTO SEGURO SSL",continueToPay:"Continuar para pagamento",payNow:"Pagar agora",pay:"Pagar",processing:"Processando…",continueNow:"Continuar agora",paymentMethod:"Método de pagamento",back:"Voltar",completeDetails:"Complete os dados",selectMethod:"Selecione um método",processingPayment:"Processando pagamento…",processingDescription:"Não feche nem recarregue esta janela.",redirecting:"Redirecionando…",redirectDescription:"Você será redirecionado para completar seu pagamento com segurança.",showOrderDetails:"Ver detalhes do pedido",hideOrderDetails:"Ocultar detalhes do pedido",continue:"Continuar"},vt={en:yt,es:fs,"pt-BR":bs},Ge=Object.keys(vt);function gs(){if(typeof navigator>"u")return"en";const e=navigator.languages??[navigator.language];for(const t of e){if(Ge.includes(t))return t;const o=t.split("-")[0];if(Ge.includes(o))return o;if(o==="pt")return"pt-BR"}return"en"}function ys(e){return e==="auto"?gs():e}function vs(e){const t=ys(e);return vt[t]??yt}function ws(e,t){const o=vs(e);return t?{...o,...t}:o}const wt=v.createContext(null),ks=({locale:e,currency:t,messages:o,formatters:r,children:n})=>{const l=ws(e,o),i=r!=null&&r.currency?r.currency:c=>gt(c,t);return s.jsx(wt.Provider,{value:{t:l,fmt:i},children:n})},H=()=>{const e=v.useContext(wt);if(!e)throw new Error("useI18n must be used within an I18nProvider");return e},kt=v.createContext({plugins:[]}),js=({plugins:e,children:t})=>{const o=v.useMemo(()=>({plugins:e}),[e]);return s.jsx(kt.Provider,{value:o,children:t})},je=()=>v.useContext(kt);function le(e,t,o){return e.filter(r=>r.slots[t]).map(r=>{const n=r.slots[t];return s.jsx(v.Fragment,{children:n(o)},r.id)})}function Ue(e,t,o){return e.filter(r=>r.slots[t]).map(r=>{const n=r.slots[t];return s.jsx(v.Fragment,{children:n(o)},r.id)})}const Ve=()=>{const{items:e,step:t}=W(),{t:o,fmt:r}=H(),{plugins:n}=je(),l=n.some(a=>a.slots.orderItemActions),i=n.some(a=>a.slots.orderItemEnd),c={items:e,totals:{subtotal:0,total:0},step:t,t:o,fmt:r};return s.jsxs("div",{className:"flex flex-col h-full animate-in fade-in slide-in-from-bottom-4 duration-500 overflow-hidden",children:[s.jsx("h2",{className:"text-xl font-bold mb-6 shrink-0",children:o.orderSummary}),s.jsx("div",{className:"flex-1 overflow-y-auto pr-3 custom-scrollbar flex flex-col divide-y divide-border/30",children:e.map(a=>{const d=!!a.discount,x={...c,item:a};return s.jsxs("div",{className:"py-5 flex items-start gap-5 transition-opacity",children:[a.image&&s.jsx("img",{src:a.image,alt:a.name,className:"w-20 h-20 rounded-2xl object-cover border border-border/40 shrink-0 shadow-sm transition-transform hover:scale-105 duration-300"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("span",{className:"font-bold text-lg text-text/90 block truncate leading-tight mb-1",children:a.name}),l?Ue(n,"orderItemActions",x):s.jsxs("span",{className:"text-sm text-text/40 mt-1 block font-semibold uppercase tracking-wider",children:[o.quantityShort,": ",a.quantity]}),d&&s.jsxs("div",{className:"flex items-center gap-2 mt-3 flex-wrap",children:[a.discount.label&&s.jsx("span",{className:"text-[10px] font-black uppercase tracking-widest bg-success/10 text-success px-2 py-1 rounded-md border border-success/20",children:a.discount.label}),s.jsx("span",{className:"text-xs text-success font-black",children:a.discount.type==="percentage"?`-${a.discount.value}%`:`-${r(a.discount.value)}`})]})]}),s.jsxs("div",{className:"flex flex-col items-end gap-2 shrink-0",children:[i&&Ue(n,"orderItemEnd",x),d?s.jsxs("div",{className:M("flex flex-col items-end",i?"":"mt-1"),children:[s.jsx("span",{className:"text-xs line-through text-text/30 font-medium tracking-tight",children:r(a.unitPrice*a.quantity)}),s.jsx("span",{className:"text-lg font-black text-success tracking-tight",children:r(a.total)})]}):s.jsx("span",{className:M("text-lg font-bold text-text/80 tracking-tight",i?"":"mt-1"),children:r(a.total)})]})]},a.id)})})]})},Ns=e=>{switch(e){case"card":return s.jsx(Kt,{className:"w-5 h-5"});case"wallet":return s.jsx(Ie,{className:"w-5 h-5"});case"bank":return s.jsx(rr,{className:"w-5 h-5"});default:return s.jsx(Ie,{className:"w-5 h-5"})}},Cs=()=>{const{paymentMethods:e,selectedMethodId:t,selectMethod:o,setStep:r,submitPayment:n,totals:l,error:i}=W(),{t:c,fmt:a}=H(),[d,x]=v.useState(!1),[j,g]=v.useState({}),y=e.find(N=>N.id===t),w=y?y.renderComponent?!!j[y.id]:!0:!1,f=N=>{o(N)},k=v.useCallback(N=>R=>{g(D=>({...D,[N]:R}))},[]),I=async N=>{N.preventDefault(),!(!t||!w)&&(x(!0),await n({methodId:t}),x(!1))};return s.jsxs("form",{id:"checkout-payment-form",onSubmit:I,className:"flex flex-col gap-3 animate-in fade-in slide-in-from-right-4 duration-500",children:[s.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[s.jsx("button",{type:"button",onClick:()=>r("review"),className:"p-1 hover:bg-border/50 rounded-full transition-colors text-text/80","aria-label":c.back,children:s.jsx(Ft,{className:"w-5 h-5"})}),s.jsx("h2",{className:"text-xl font-semibold",children:c.paymentMethod})]}),s.jsx("div",{className:"flex-1 overflow-y-auto pr-1 custom-scrollbar flex flex-col gap-2",children:e.map(N=>{const R=t===N.id;return s.jsxs("div",{className:"flex flex-col",children:[s.jsxs("button",{type:"button",onClick:()=>f(N.id),disabled:d,className:M("flex items-center gap-3 p-3.5 border transition-all duration-200 text-left",R?"border-primary bg-primary/5 ring-1 ring-primary shadow-sm":"border-border/60 hover:border-primary/50 bg-background/50 hover:bg-background",R&&N.renderComponent?"rounded-t-[var(--radius-DEFAULT)]":"rounded-[var(--radius-DEFAULT)]"),children:[s.jsx("div",{className:M("p-1.5 rounded-lg shrink-0",R?"text-primary":"text-text/50"),children:Ns(N.type)}),s.jsx("span",{className:"flex-1 font-bold text-sm tracking-tight",children:N.label}),s.jsx("div",{className:M("w-5 h-5 rounded-full border-2 flex items-center justify-center transition-all shrink-0",R?"border-primary bg-primary/10":"border-text/20"),children:R&&s.jsx("div",{className:"w-2.5 h-2.5 rounded-full bg-primary shadow-sm"})})]}),R&&N.renderComponent&&s.jsx("div",{className:"border border-t-0 border-primary/20 bg-background/50 rounded-b-[var(--radius-DEFAULT)] px-5 pt-5 pb-5 animate-in fade-in slide-in-from-top-2 duration-300",children:N.renderComponent({onReadyChange:k(N.id)})})]},N.id)})}),s.jsx("button",{type:"submit",disabled:!w||d,className:M("md:hidden flex w-full py-4 px-4 rounded-[var(--radius-DEFAULT)] mt-2 font-black uppercase tracking-widest justify-center items-center gap-2 transition-all shadow-lg active:scale-[0.98]",!w||d?"bg-primary/40 text-surface cursor-not-allowed":"bg-primary text-surface hover:brightness-110 shadow-primary/20"),children:d?s.jsxs(s.Fragment,{children:[s.jsx(U,{className:"w-5 h-5 animate-spin"}),c.processing]}):w?`${c.pay} ${a(l.total)}`:y?c.completeDetails:c.selectMethod}),i&&!d&&s.jsx("p",{className:"text-sm text-error text-center font-medium animate-in fade-in duration-300 -mt-1",children:i})]})},Ss=({label:e,onPress:t,variant:o="solid",icon:r,disabled:n,className:l,type:i="button"})=>s.jsxs("button",{type:i,onClick:t,disabled:n,className:M("flex items-center justify-center gap-2 px-5 py-2.5 rounded-[var(--radius-DEFAULT)] font-medium text-sm transition-all active:scale-[0.98]",o==="solid"&&"bg-primary text-surface hover:opacity-90 disabled:opacity-40 disabled:cursor-not-allowed",o==="outline"&&"border border-primary text-primary hover:bg-primary/5 disabled:opacity-40 disabled:cursor-not-allowed",o==="ghost"&&"text-text/70 hover:bg-border/50 hover:text-text disabled:opacity-40 disabled:cursor-not-allowed",l),children:[r&&s.jsx("span",{className:"shrink-0",children:r}),e]}),qe=2,Es={success:{icon:s.jsx(qt,{className:"w-10 h-10"}),iconBg:"bg-success/10",iconColor:"text-success"},pending:{icon:s.jsx(Ht,{className:"w-10 h-10"}),iconBg:"bg-orange-500/10",iconColor:"text-orange-500"},error:{icon:s.jsx(Yt,{className:"w-10 h-10"}),iconBg:"bg-error/10",iconColor:"text-error"},redirect:{icon:s.jsx(er,{className:"w-10 h-10"}),iconBg:"bg-primary/10",iconColor:"text-primary"}},Qe=({title:e,description:t,actions:o=[],variant:r="success",children:n})=>{const l=Es[r],[i,c]=v.useState(r==="redirect"?qe:0);return v.useEffect(()=>{if(r!=="redirect")return;if(i<=0){const d=o.find(x=>!x.variant||x.variant==="solid");d==null||d.onPress();return}const a=setInterval(()=>c(d=>d-1),1e3);return()=>clearInterval(a)},[i,r]),s.jsxs("div",{className:"flex flex-col items-center justify-center py-8 gap-5 animate-in zoom-in-95 fade-in duration-500",children:[s.jsx("div",{className:M("w-20 h-20 rounded-full flex items-center justify-center",l.iconBg,l.iconColor),children:l.icon}),s.jsxs("div",{className:"text-center",children:[s.jsx("h2",{className:"text-2xl font-bold mb-1",children:e}),t&&s.jsx("p",{className:"text-text/60 text-sm max-w-[280px] mx-auto leading-relaxed",children:t})]}),r==="redirect"&&i>0&&s.jsxs("div",{className:"flex flex-col items-center gap-2",children:[s.jsxs("div",{className:"relative w-14 h-14",children:[s.jsxs("svg",{className:"w-14 h-14 -rotate-90",viewBox:"0 0 56 56",children:[s.jsx("circle",{cx:"28",cy:"28",r:"24",fill:"none",stroke:"currentColor",strokeWidth:"4",className:"text-border"}),s.jsx("circle",{cx:"28",cy:"28",r:"24",fill:"none",stroke:"currentColor",strokeWidth:"4",strokeLinecap:"round",strokeDasharray:`${2*Math.PI*24}`,strokeDashoffset:`${2*Math.PI*24*(1-i/qe)}`,className:"text-primary transition-all duration-1000"})]}),s.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-xl font-bold text-primary",children:i})]}),s.jsxs("p",{className:"text-xs text-text/50",children:["Redirigiendo en ",i,"s…"]})]}),n&&s.jsx("div",{className:"w-full",children:n}),o.length>0&&s.jsx("div",{className:"flex flex-wrap gap-3 justify-center w-full mt-1",children:o.map((a,d)=>s.jsx(Ss,{label:a.label,onPress:a.onPress,variant:a.variant??"solid",icon:a.icon,className:a.variant==="solid"?"flex-1":void 0},d))})]})},Ps=({children:e,sidebar:t,className:o,...r})=>{const n=!!t;return s.jsxs("div",{className:M("w-full h-full bg-surface text-text rounded-(--theme-radius) shadow-2xl border border-border","overflow-hidden flex flex-col md:flex-row",o),...r,children:[s.jsx("div",{className:M("flex-1 min-w-0 min-h-0 flex flex-col overflow-hidden p-4"),children:e}),n&&s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"hidden md:block w-px bg-border/60 shrink-0"}),s.jsx("div",{className:"hidden md:flex w-[320px] shrink-0 flex-col overflow-y-auto p-4 bg-background/60",children:t})]})]})},Ts=["success","pending","error","redirect"],Rs={success:"✅ Éxito",pending:"⏳ Pendiente",error:"❌ Error",redirect:"↗️ Redirect"},As=()=>{const{state:e,eventLog:t}=ve(),[o,r]=v.useState(!1),[n,l]=v.useState("success");return s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:()=>r(!0),className:"fixed top-4 right-4 z-40 bg-surface text-text/50 hover:text-primary p-3 rounded-full shadow-md border border-border transition-all hover:scale-105","aria-label":"Open Dev Tools",children:s.jsx(_e,{className:"w-5 h-5"})}),s.jsxs("div",{className:`fixed top-0 right-0 h-full w-80 bg-surface shadow-2xl z-50 p-6 flex flex-col gap-6 overflow-y-auto transition-transform duration-300 ${o?"translate-x-0":"translate-x-full"}`,style:{colorScheme:"light"},children:[s.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-border",children:[s.jsxs("h2",{className:"text-lg font-bold text-text flex items-center gap-2",children:[s.jsx(_e,{className:"w-5 h-5 text-primary"}),"Dev Tools"]}),s.jsx("button",{onClick:()=>r(!1),className:"text-text/50 hover:text-text p-1 bg-surface hover:bg-border/50 rounded-full transition-colors",children:s.jsx(hr,{className:"w-5 h-5"})})]}),s.jsxs("div",{children:[s.jsx("h2",{className:"text-sm font-bold mb-3 text-slate-500 uppercase tracking-wider",children:"Escenario de pago"}),s.jsx("div",{className:"flex flex-col gap-1",children:Ts.map(i=>s.jsxs("label",{className:"flex items-center gap-2 cursor-pointer p-2 hover:bg-slate-50 rounded-lg",children:[s.jsx("input",{type:"radio",name:"scenario",checked:n===i,onChange:()=>l(i),className:"accent-indigo-500 w-4 h-4"}),s.jsx("span",{className:"text-sm",children:Rs[i]})]},i))}),s.jsxs("p",{className:"text-[11px] text-slate-400 mt-2 p-2 bg-slate-50 rounded leading-relaxed",children:["Cupón de prueba: ",s.jsx("code",{className:"font-mono font-bold text-slate-600",children:"SAVE10"})]})]}),s.jsxs("div",{children:[s.jsxs("h2",{className:"text-sm font-bold mb-3 text-slate-500 uppercase tracking-wider flex items-center gap-2",children:["Event Logger ",s.jsx("span",{className:"text-[10px] bg-indigo-100 text-indigo-700 px-2 py-0.5 rounded-full font-semibold",children:"Live"})]}),s.jsx("div",{className:"bg-slate-900 text-emerald-400 font-mono text-[10px] p-3 rounded-xl h-56 overflow-y-auto flex flex-col gap-1",children:t.length===0?s.jsx("span",{className:"text-slate-500 italic",children:"Sin eventos aún…"}):t.map((i,c)=>s.jsx("div",{className:"border-b border-white/10 pb-1",children:i},c))})]}),s.jsxs("div",{className:"flex flex-col gap-2",children:[s.jsx("h2",{className:"text-sm font-bold text-slate-500 uppercase tracking-wider",children:"Estado interno"}),s.jsx("pre",{className:"text-[10px] bg-slate-900 text-emerald-400 p-3 rounded-xl overflow-x-auto",children:JSON.stringify({...e,provider:"PaymentProvider instance"},null,2)})]})]})]})},Ms=({showItems:e,isLoading:t})=>{const{items:o,totals:r,step:n,setStep:l,selectedMethodId:i}=W(),{t:c,fmt:a}=H(),{plugins:d}=je(),x=e??n!=="review",j=()=>{if(n==="review")l("payment_method");else{const k=document.getElementById("checkout-payment-form");k==null||k.requestSubmit()}},g=n==="review"?c.continueToPay:c.payNow,y=n==="review"||!!i,w={items:o,totals:r,step:n,t:c,fmt:a},f=d.some(k=>k.slots.totalsDiscountAction);return s.jsxs("div",{className:"flex flex-col h-full animate-in fade-in duration-500",children:[s.jsx("h3",{className:"text-xs font-bold text-text/40 uppercase tracking-widest mb-6",children:c.orderSummaryTitle}),x&&s.jsx("div",{className:"flex flex-col gap-4 overflow-y-auto pr-2 custom-scrollbar",children:o.map(k=>s.jsxs("div",{className:"flex items-start gap-3",children:[k.image&&s.jsx("img",{src:k.image,alt:k.name,className:"w-10 h-10 rounded-lg object-cover border border-border/40 shrink-0 shadow-sm"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-[13px] font-semibold leading-tight truncate text-text/80",children:k.name}),s.jsxs("p",{className:"text-[11px] text-text/40 mt-0.5 font-medium",children:[c.quantityShort,": ",k.quantity]})]}),s.jsx("div",{className:"text-right shrink-0",children:s.jsx("span",{className:"text-[13px] font-bold text-text/80",children:a(k.total)})})]},k.id))}),s.jsxs("div",{className:"flex flex-col gap-2",children:[le(d,"sidebarBeforeTotals",w),s.jsxs("div",{className:"flex border-t border-border/50 justify-between text-sm text-text/60 font-medium",children:[s.jsx("span",{children:c.subtotal}),s.jsx("span",{children:a(r.subtotal)})]}),r.discount!==void 0&&r.discount>0&&s.jsxs("div",{className:"flex justify-between items-center text-sm font-semibold text-success",children:[s.jsx("span",{children:c.discount}),s.jsxs("span",{className:"flex items-center gap-1.5",children:["-",a(r.discount),f&&le(d,"totalsDiscountAction",w)]})]}),r.shipping!==void 0&&s.jsxs("div",{className:"flex justify-between text-sm text-text/60 font-medium",children:[s.jsx("span",{children:c.shipping}),s.jsx("span",{children:r.shipping===0?c.shippingFree:a(r.shipping)})]}),r.taxes!==void 0&&s.jsxs("div",{className:"flex justify-between text-sm text-text/60 font-medium",children:[s.jsx("span",{children:c.taxes}),s.jsx("span",{children:a(r.taxes)})]}),s.jsxs("div",{className:"flex justify-between items-center pt-4 border-t border-border/50 mt-2",children:[s.jsx("span",{className:"font-bold text-base text-text/90",children:c.total}),s.jsx("span",{className:"text-2xl font-black text-primary tracking-tight",children:a(r.total)})]})]}),s.jsxs("div",{className:"flex flex-col gap-2 mt-auto",children:[s.jsx("button",{onClick:j,disabled:!y||t,className:M("w-full mt-6 py-4 px-6 rounded-xs font-bold flex items-center justify-center gap-2 transition-all duration-300 shadow-lg active:scale-[0.98]",y&&!t?"bg-primary text-surface hover:brightness-110 shadow-primary/20 cursor-pointer":"bg-primary/40 text-surface/60 cursor-not-allowed shadow-none"),children:t?s.jsx(U,{className:"w-5 h-5 animate-spin"}):s.jsxs(s.Fragment,{children:[g,n==="review"&&s.jsx(Bt,{className:"w-5 h-5"})]})}),s.jsxs("div",{className:"flex items-center justify-center gap-2 mt-4 text-[11px] text-text/30 font-semibold tracking-wide",children:[s.jsx(cr,{className:"w-4 h-4 opacity-50"}),s.jsx("span",{children:c.securePayment})]})]})]})},Ye=({onAction:e,actionLabel:t,actionDisabled:o,isSubmitting:r,showItems:n=!1})=>{const{totals:l,items:i,step:c}=W(),{t:a,fmt:d}=H(),{plugins:x}=je(),[j,g]=v.useState(!1),y={items:i,totals:l,step:c,t:a,fmt:d},w=x.some(f=>f.slots.totalsDiscountAction);return s.jsxs("div",{className:"fixed bottom-0 left-0 right-0 z-30 md:hidden",children:[s.jsx("div",{className:`bg-surface border-t border-border overflow-hidden transition-all duration-300 ease-in-out ${j?"max-h-[70vh] opacity-100":"max-h-0 opacity-0 pointer-events-none"}`,children:s.jsxs("div",{className:"px-4 pt-4 pb-2 flex flex-col gap-0",children:[n&&s.jsx("div",{className:"overflow-y-auto max-h-52 divide-y divide-border/40 mb-3",children:i.map(f=>s.jsxs("div",{className:"flex items-center gap-3 py-2.5",children:[f.image&&s.jsx("img",{src:f.image,alt:f.name,className:"w-10 h-10 rounded-lg object-cover border border-border/30 shrink-0"}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("p",{className:"text-sm font-medium truncate",children:f.name}),s.jsxs("p",{className:"text-xs text-text/50",children:[a.quantityShort,": ",f.quantity]}),f.discount&&s.jsxs("p",{className:"text-[10px] text-success font-medium",children:[f.discount.label&&`${f.discount.label} · `,f.discount.type==="percentage"?`-${f.discount.value}%`:`-${d(f.discount.value)}`]})]}),s.jsx("div",{className:"text-right shrink-0",children:f.discount?s.jsxs("div",{className:"flex flex-col items-end",children:[s.jsx("span",{className:"text-[11px] line-through text-text/40",children:d(f.unitPrice*f.quantity)}),s.jsx("span",{className:"text-sm font-semibold text-success",children:d(f.total)})]}):s.jsx("span",{className:"text-sm font-medium",children:d(f.total)})})]},f.id))}),le(x,"mobileBarExpanded",y),s.jsxs("div",{className:`flex flex-col gap-1.5 text-sm pb-3 ${n?"border-t border-border/50 pt-3":"pt-1"}`,children:[s.jsxs("div",{className:"flex justify-between text-text/60",children:[s.jsx("span",{children:a.subtotal}),s.jsx("span",{children:d(l.subtotal)})]}),l.discount!==void 0&&l.discount>0&&s.jsxs("div",{className:"flex justify-between items-center text-success font-medium",children:[s.jsx("span",{children:a.discount}),s.jsxs("span",{className:"flex items-center gap-1.5",children:["-",d(l.discount),w&&le(x,"totalsDiscountAction",y)]})]}),l.shipping!==void 0&&s.jsxs("div",{className:"flex justify-between text-text/60",children:[s.jsx("span",{children:a.shipping}),s.jsx("span",{children:l.shipping===0?a.shippingFree:d(l.shipping)})]}),l.taxes!==void 0&&s.jsxs("div",{className:"flex justify-between text-text/60",children:[s.jsx("span",{children:a.taxes}),s.jsx("span",{children:d(l.taxes)})]})]})]})}),s.jsxs("div",{className:"bg-surface border-t border-border shadow-[0_-4px_20px_rgba(0,0,0,0.1)] px-4 pt-3 pb-4 flex flex-col gap-3",children:[s.jsxs("button",{type:"button",onClick:()=>g(f=>!f),className:"flex items-center justify-between w-full","aria-label":j?a.hideOrderDetails:a.showOrderDetails,children:[s.jsx("span",{className:"text-sm font-medium text-text/60",children:a.total}),s.jsxs("span",{className:"flex items-center gap-1.5",children:[s.jsx("span",{className:"text-lg font-bold text-primary",children:d(l.total)}),j?s.jsx(Ot,{className:"w-4 h-4 text-text/40"}):s.jsx(Ut,{className:"w-4 h-4 text-text/40"})]})]}),e&&s.jsx("button",{type:"button",onClick:e,disabled:o||r,className:`w-full py-3 rounded-[var(--radius-DEFAULT)] font-medium text-sm flex items-center justify-center gap-2 transition-all active:scale-[0.98] ${o||r?"bg-primary/40 text-surface cursor-not-allowed":"bg-primary text-surface hover:opacity-90"}`,children:r?s.jsxs(s.Fragment,{children:[s.jsx(U,{className:"w-4 h-4 animate-spin"}),a.processing]}):t??a.continue})]})]})},_s=({step:e})=>{const{setStep:t}=W(),{t:o}=H();return ie(e)?s.jsx(Ye,{onAction:()=>t("payment_method"),actionLabel:`${o.continueToPay} →`,showItems:!1}):ae(e)?s.jsx(Ye,{onAction:()=>{const r=document.getElementById("checkout-payment-form");r==null||r.requestSubmit()},actionLabel:o.pay,showItems:!0}):null},Is=({devTools:e})=>{const{state:t}=ve(),{t:o}=H(),{step:r,paymentResult:n}=t,l=()=>{var i,c,a;switch(r){case"review":return s.jsx(Ve,{});case"payment_method":return s.jsx(Cs,{});case"processing":return s.jsxs("div",{className:"flex flex-col items-center justify-center py-16 gap-4",children:[s.jsx(U,{className:"w-12 h-12 animate-spin text-primary"}),s.jsx("p",{className:"font-medium text-lg animate-pulse",children:o.processingPayment}),s.jsx("p",{className:"text-sm text-text/50",children:o.processingDescription})]});case"success":case"pending":case"error":return s.jsx(Qe,{variant:n==null?void 0:n.status,title:((i=n==null?void 0:n.feedback)==null?void 0:i.title)??"",description:(c=n==null?void 0:n.feedback)==null?void 0:c.title,actions:(a=n==null?void 0:n.feedback)==null?void 0:a.actions});case"redirect":{const d=(n==null?void 0:n.status)==="redirect"?n:void 0,x=d==null?void 0:d.feedback;return s.jsx(Qe,{variant:"redirect",title:(x==null?void 0:x.title)??o.redirecting,description:(x==null?void 0:x.description)??o.redirectDescription,actions:(x==null?void 0:x.actions)??[{label:o.continueNow,variant:"solid",onPress:()=>{d!=null&&d.url&&(window.location.href=d.url)}}]})}default:return s.jsx(Ve,{})}};return s.jsxs("div",{className:"h-[80vh] md:h-full w-full flex flex-col",children:[s.jsx(Ps,{sidebar:ie(r)||ae(r)?s.jsx(Ms,{}):void 0,children:l()}),(ie(r)||ae(r))&&s.jsx(_s,{step:r}),e&&s.jsx(As,{})]})},zs=({items:e,totals:t,paymentMethods:o,provider:r,currency:n,locale:l="es",theme:i="light",brandColor:c,customTheme:a,onEvent:d,cartController:x,initialState:j,devTools:g,messages:y,formatters:w,plugins:f=[]})=>s.jsx(hs,{theme:i,brandColor:c,customTheme:a,children:s.jsx(ks,{locale:l,currency:n,messages:y,formatters:w,children:s.jsx(js,{plugins:f,children:s.jsx(Nr,{config:{items:e,totals:t,paymentMethods:o,provider:r,currency:n,locale:l,cartController:x},initialStatus:j,onEvent:d,children:s.jsx(Is,{devTools:g})})})})});exports.Checkout=zs;exports.checkoutThemes=Xe;exports.cn=M;exports.createCartEditPlugin=kr;exports.createCssVars=Je;exports.createDiscountPlugin=br;exports.darken=Nt;exports.defaultTheme=fe;exports.formatNumber=gt;exports.generateBrandTheme=Ke;exports.getContrastColor=We;exports.getLuminance=ye;exports.hexToRgb=Y;exports.isDark=jt;exports.isPaymentStep=ae;exports.isReviewStep=ie;exports.lighten=Ct;exports.mergeTheme=be;exports.mix=St;exports.resolveTheme=Ze;exports.rgbToHex=ce;exports.useCheckout=W;