@billgangcom/theme-lib 1.60.0 → 1.62.0

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.
@@ -58,7 +58,7 @@ React keys must be passed directly to JSX without using spread:
58
58
  * LICENSE.md file in the root directory of this source tree.
59
59
  *
60
60
  * @license MIT
61
- */function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ua.apply(this,arguments)}function Dd(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}const ac="get",oc="application/x-www-form-urlencoded";function tu(e){return e!=null&&typeof e.tagName=="string"}function D7(e){return tu(e)&&e.tagName.toLowerCase()==="button"}function O7(e){return tu(e)&&e.tagName.toLowerCase()==="form"}function I7(e){return tu(e)&&e.tagName.toLowerCase()==="input"}function M7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B7(e,t){return e.button===0&&(!t||t==="_self")&&!M7(e)}function T1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function F7(e,t){let n=T1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}let Tl=null;function H7(){if(Tl===null)try{new FormData(document.createElement("form"),0),Tl=!1}catch{Tl=!0}return Tl}const $7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mu(e){return e!=null&&!$7.has(e)?(process.env.NODE_ENV!=="production"&&en(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):e}function V7(e,t){let n,r,a,o,i;if(O7(e)){let c=e.getAttribute("action");r=c?Tr(c,t):null,n=e.getAttribute("method")||ac,a=Mu(e.getAttribute("enctype"))||oc,o=new FormData(e)}else if(D7(e)||I7(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(r=u?Tr(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||ac,a=Mu(e.getAttribute("formenctype"))||Mu(c.getAttribute("enctype"))||oc,o=new FormData(c,e),!H7()){let{name:d,type:h,value:p}=e;if(h==="image"){let f=d?d+".":"";o.append(f+"x","0"),o.append(f+"y","0")}else d&&o.append(d,p)}}else{if(tu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ac,r=null,a=oc,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:i}}const U7=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],W7=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],q7=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],z7="6";try{window.__reactRouterVersion=z7}catch{}function Z7(e,t){return G6({basename:void 0,future:Ua({},void 0,{v7_prependBasename:!0}),history:y6({window:void 0}),hydrationData:G7(),routes:e,mapRouteProperties:R7,unstable_dataStrategy:void 0,unstable_patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function G7(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ua({},t,{errors:Y7(t.errors)})),t}function Y7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new gc(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}const Od=H.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Od.displayName="ViewTransition");const d2=H.createContext(new Map);process.env.NODE_ENV!=="production"&&(d2.displayName="Fetchers");const K7="startTransition",Of=H[K7],X7="flushSync",If=p6[X7];function J7(e){Of?Of(e):e()}function Xi(e){If?If(e):e()}class Q7{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function eg(e){let{fallbackElement:t,router:n,future:r}=e,[a,o]=H.useState(n.state),[i,c]=H.useState(),[u,d]=H.useState({isTransitioning:!1}),[h,p]=H.useState(),[f,y]=H.useState(),[g,m]=H.useState(),b=H.useRef(new Map),{v7_startTransition:w}=r||{},_=H.useCallback(S=>{w?J7(S):S()},[w]),x=H.useCallback((S,T)=>{let{deletedFetchers:I,unstable_flushSync:A,unstable_viewTransitionOpts:U}=T;I.forEach(X=>b.current.delete(X)),S.fetchers.forEach((X,G)=>{X.data!==void 0&&b.current.set(G,X.data)});let K=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!U||K){A?Xi(()=>o(S)):_(()=>o(S));return}if(A){Xi(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Xi(()=>o(S))});X.finished.finally(()=>{Xi(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})})}),Xi(()=>y(X));return}f?(h&&h.resolve(),f.skipTransition(),m({state:S,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(c(S),d({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,f,h,b,_]);H.useLayoutEffect(()=>n.subscribe(x),[n,x]),H.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Q7)},[u]),H.useEffect(()=>{if(h&&i&&n.window){let S=i,T=h.promise,I=n.window.document.startViewTransition(async()=>{_(()=>o(S)),await T});I.finished.finally(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})}),y(I)}},[_,i,h,n.window]),H.useEffect(()=>{h&&i&&a.location.key===i.location.key&&h.resolve()},[h,f,a.location,i]),H.useEffect(()=>{!u.isTransitioning&&g&&(c(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),m(void 0))},[u.isTransitioning,g]),H.useEffect(()=>{process.env.NODE_ENV!=="production"&&en(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let j=H.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:S=>n.navigate(S),push:(S,T,I)=>n.navigate(S,{state:T,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(S,T,I)=>n.navigate(S,{replace:!0,state:T,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),k=n.basename||"/",L=H.useMemo(()=>({router:n,navigator:j,static:!1,basename:k}),[n,j,k]),D=H.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return H.createElement(H.Fragment,null,H.createElement(Ni.Provider,{value:L},H.createElement(Qc.Provider,{value:a},H.createElement(d2.Provider,{value:b.current},H.createElement(Od.Provider,{value:u},H.createElement(A7,{basename:k,location:a.location,navigationType:a.historyAction,navigator:j,future:D},a.initialized||n.future.v7_partialHydration?H.createElement(tg,{routes:n.routes,future:n.future,state:a}):t))))),null)}const tg=H.memo(ng);function ng(e){let{routes:t,future:n,state:r}=e;return C7(t,void 0,r,n)}process.env.NODE_ENV;const rg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h2=H.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:i,state:c,target:u,to:d,preventScrollReset:h,unstable_viewTransition:p}=t,f=Dd(t,U7),{basename:y}=H.useContext(Dr),g,m=!1;if(typeof d=="string"&&ag.test(d)&&(g=d,rg))try{let x=new URL(window.location.href),j=d.startsWith("//")?new URL(x.protocol+d):new URL(d),k=Tr(j.pathname,y);j.origin===x.origin&&k!=null?d=k+j.search+j.hash:m=!0}catch{process.env.NODE_ENV!=="production"&&en(!1,'<Link to="'+d+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let b=m7(d,{relative:a}),w=sg(d,{replace:i,state:c,target:u,preventScrollReset:h,relative:a,unstable_viewTransition:p});function _(x){r&&r(x),x.defaultPrevented||w(x)}return H.createElement("a",Ua({},f,{href:g||b,onClick:m||o?r:_,ref:n,target:u}))});process.env.NODE_ENV!=="production"&&(h2.displayName="Link");const f2=H.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:i=!1,style:c,to:u,unstable_viewTransition:d,children:h}=t,p=Dd(t,W7),f=rl(u,{relative:p.relative}),y=no(),g=H.useContext(Qc),{navigator:m,basename:b}=H.useContext(Dr),w=g!=null&&fg(f)&&d===!0,_=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,x=y.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(x=x.toLowerCase(),j=j?j.toLowerCase():null,_=_.toLowerCase()),j&&b&&(j=Tr(j,b)||j);const k=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let L=x===_||!i&&x.startsWith(_)&&x.charAt(k)==="/",D=j!=null&&(j===_||!i&&j.startsWith(_)&&j.charAt(_.length)==="/"),S={isActive:L,isPending:D,isTransitioning:w},T=L?r:void 0,I;typeof o=="function"?I=o(S):I=[o,L?"active":null,D?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A=typeof c=="function"?c(S):c;return H.createElement(h2,Ua({},p,{"aria-current":T,className:I,ref:n,style:A,to:u,unstable_viewTransition:d}),typeof h=="function"?h(S):h)});process.env.NODE_ENV!=="production"&&(f2.displayName="NavLink");const og=H.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:i,method:c=ac,action:u,onSubmit:d,relative:h,preventScrollReset:p,unstable_viewTransition:f}=e,y=Dd(e,q7),g=dg(),m=hg(u,{relative:h}),b=c.toLowerCase()==="get"?"get":"post",w=_=>{if(d&&d(_),_.defaultPrevented)return;_.preventDefault();let x=_.nativeEvent.submitter,j=(x==null?void 0:x.getAttribute("formmethod"))||c;g(x||_.currentTarget,{fetcherKey:n,method:j,navigate:r,replace:o,state:i,relative:h,preventScrollReset:p,unstable_viewTransition:f})};return H.createElement("form",Ua({ref:t,method:b,action:m,onSubmit:a?d:w},y))});process.env.NODE_ENV!=="production"&&(og.displayName="Form");process.env.NODE_ENV;var yc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(yc||(yc={}));var Mf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mf||(Mf={}));function ig(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function p2(e){let t=H.useContext(Ni);return t||(process.env.NODE_ENV!=="production"?Te(!1,ig(e)):Te(!1)),t}function sg(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c}=t===void 0?{}:t,u=ur(),d=no(),h=rl(e,{relative:i});return H.useCallback(p=>{if(B7(p,n)){p.preventDefault();let f=r!==void 0?r:Va(d)===Va(h);u(e,{replace:f,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c})}},[d,u,h,r,a,n,e,o,i,c])}function m2(e){process.env.NODE_ENV!=="production"&&en(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=H.useRef(T1(e)),n=H.useRef(!1),r=no(),a=H.useMemo(()=>F7(r.search,n.current?null:t.current),[r.search]),o=ur(),i=H.useCallback((c,u)=>{const d=T1(typeof c=="function"?c(a):c);n.current=!0,o("?"+d,u)},[o,a]);return[a,i]}function lg(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let cg=0,ug=()=>"__"+String(++cg)+"__";function dg(){let{router:e}=p2(yc.UseSubmit),{basename:t}=H.useContext(Dr),n=N7();return H.useCallback(function(r,a){a===void 0&&(a={}),lg();let{action:o,method:i,encType:c,formData:u,body:d}=V7(r,t);if(a.navigate===!1){let h=a.fetcherKey||ug();e.fetch(h,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,n])}function hg(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=H.useContext(Dr),a=H.useContext(Or);a||(process.env.NODE_ENV!=="production"?Te(!1,"useFormAction must be used inside a RouteContext"):Te(!1));let[o]=a.matches.slice(-1),i=Ua({},rl(e||".",{relative:n})),c=no();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search);u.has("index")&&u.get("index")===""&&(u.delete("index"),i.search=u.toString()?"?"+u.toString():"")}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:Xr([r,i.pathname])),Va(i)}function fg(e,t){t===void 0&&(t={});let n=H.useContext(Od);n==null&&(process.env.NODE_ENV!=="production"?Te(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Te(!1));let{basename:r}=p2(yc.useViewTransitionState),a=rl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Tr(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Tr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return mc(a.pathname,i)!=null||mc(a.pathname,o)!=null}const Bf=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const f=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,f))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,a,c);return c},pg=e=>e?Bf(e):Bf,mg=e=>e;function gg(e,t=mg){const n=C.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return C.useDebugValue(n),n}const Ff=e=>{const t=pg(e),n=r=>gg(t,r);return Object.assign(n,t),n},Ut=e=>e?Ff(e):Ff,vg=Ut(e=>({blocks:null,setBlocks:t=>e(()=>({blocks:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),sourceBlocks:{},setSourceBlocks:t=>e(()=>({sourceBlocks:t})),currentInstance:null,setCurrentInstance:t=>e(()=>({currentInstance:t}))})),yg=Ut(e=>({currentDevice:{icon:"Desktop",value:"desktop"},setCurrentDevice:t=>e(()=>({currentDevice:t}))}));Ut(e=>({pageData:null,setPageData:t=>e(()=>({pageData:t}))}));const g2=[{icon:"TreeStructure",name:"Layers"},{icon:"Plus",name:"Add"},{icon:"Palette",name:"Theme"},{icon:"Gear",name:"Settings"}],Id="https://g-api.billgang.com",Cg="https://www.googleapis.com/webfonts/v1/webfonts",bg="https://stores-api.billgang.com",_g="https://sl-api.billgang.com",xg=window.location.hostname.includes("localhost"),wg=Ut(e=>({activeBlock:g2[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function Sg(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const i=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(a))!=null?o:null;return c instanceof Promise?c.then(i):i(c)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const P1=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return P1(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return P1(r)(n)}}}},jg=(e,t)=>(n,r,a)=>{let o={storage:Sg(()=>localStorage),partialize:m=>m,version:0,merge:(m,b)=>({...b,...m}),...t},i=!1;const c=new Set,u=new Set;let d=o.storage;if(!d)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,a);const h=()=>{const m=o.partialize({...r()});return d.setItem(o.name,{state:m,version:o.version})},p=a.setState;a.setState=(m,b)=>{p(m,b),h()};const f=e((...m)=>{n(...m),h()},r,a);a.getInitialState=()=>f;let y;const g=()=>{var m,b;if(!d)return;i=!1,c.forEach(_=>{var x;return _((x=r())!=null?x:f)});const w=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(m=r())!=null?m:f))||void 0;return P1(d.getItem.bind(d))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return[!0,o.migrate(_.state,_.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var x;const[j,k]=_;if(y=o.merge(k,(x=r())!=null?x:f),n(y,!0),j)return h()}).then(()=>{w==null||w(y,void 0),y=r(),i=!0,u.forEach(_=>_(y))}).catch(_=>{w==null||w(void 0,_)})};return a.persist={setOptions:m=>{o={...o,...m},m.storage&&(d=m.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(u.add(m),()=>{u.delete(m)})},o.skipHydration||g(),y||f},nu=jg,v2=Ut(nu(e=>({onPreview:!0,setOnPreview:t=>e(()=>({onPreview:t})),activeBlock:{id:null,neededScroll:!1},setActiveBlock:t=>e(()=>({activeBlock:t})),zoomLevel:1,setZoomLevel:t=>e(()=>({zoomLevel:t}))}),{name:"preview-storage",partialize:e=>{const{onPreview:t}=e;return{onPreview:t}}}));var dn=[];for(var Bu=0;Bu<256;++Bu)dn.push((Bu+256).toString(16).slice(1));function kg(e,t=0){return(dn[e[t+0]]+dn[e[t+1]]+dn[e[t+2]]+dn[e[t+3]]+"-"+dn[e[t+4]]+dn[e[t+5]]+"-"+dn[e[t+6]]+dn[e[t+7]]+"-"+dn[e[t+8]]+dn[e[t+9]]+"-"+dn[e[t+10]]+dn[e[t+11]]+dn[e[t+12]]+dn[e[t+13]]+dn[e[t+14]]+dn[e[t+15]]).toLowerCase()}var Pl,Eg=new Uint8Array(16);function Ng(){if(!Pl&&(Pl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pl(Eg)}var Tg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:Tg};function yi(e,t,n){if(Hf.randomUUID&&!t&&!e)return Hf.randomUUID();e=e||{};var r=e.random||(e.rng||Ng)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,kg(r)}const hs=Ut(nu((e,t)=>({header:null,blocks:{},announcement:null,footer:null,currentBlock:null,positionBlock:null,setBlocks:n=>{e({blocks:n})},setHeader:n=>{e({header:n})},setFooter:n=>{e({footer:n})},setAnnouncement:n=>{e({announcement:n})},createPage:n=>{const r=t().blocks;r[n]={data:{},order:[]},e({blocks:r})},deletePage:n=>{const r=t().blocks;delete r[n],e({blocks:r})},updatePage:(n,r)=>{const a=t().blocks;if(a[r])return;const o=a[n];delete a[n],a[r]=o,e({blocks:a})},setCurrentBlock:n=>{e({currentBlock:n})},setPositionBlock:(n,r=!1)=>{const{blocks:a}=t(),{currentPage:o,pages:i}=Md.getState();if(!o||!i||!i[o]||!a[i[o].path]){console.error("Cannot set position: invalid page or block data");return}const c=i[o].path,u=a[c],d=n?u.order.indexOf(n):-1;if(d===-1&&n){console.error(`Block with ID "${n}" not found in page "${c}"`);return}const h=d!==-1?d+(r?1:0):u.order.length;e({positionBlock:h})},addBlock:(n,r)=>{const a=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:a});const o={...t().blocks},i=o[n]||{data:{},order:[]},c=t().positionBlock,u=yi(),d={name:r.name,value:r.value};return i.data[u]=d,c===null||c>=i.order.length?i.order.push(u):i.order.splice(c,0,u),e({blocks:{...o,[n]:{data:i.data,order:i.order}},currentBlock:u,positionBlock:null}),fs.getState().setNotification({message:"Block successfully added",status:"success"}),u},editBlock:(n,r,a)=>{const o=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:o});const i=t().blocks,c=i[n]||{};c.data[r]={name:a.name,value:{...a.value}},e({blocks:{...i,[n]:c}})},removeBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i){console.error(`Page at path "${n}" does not exist.`);return}delete i.data[r],i.order=i.order.filter(c=>c!==r),e({blocks:{...o,[n]:i}}),fs.getState().setNotification({message:"Block successfully deleted",status:"success"})},moveBlock:(n,r,a)=>e(o=>{const i=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));if(mr.getState().addHistory({layers:i}),!o.blocks[n])return console.error(`Path ${n} does not exist in blocks`),o;const c={...o.blocks[n]},u=[...c.order];if(r<0||a<0||r>=u.length||a>=u.length)return console.error(`Invalid indices: fromIndex=${r}, toIndex=${a}`),o;const[d]=u.splice(r,1);return u.splice(a,0,d),fs.getState().setNotification({message:"Block successfully moved",status:"success"}),{blocks:{...o.blocks,[n]:{...c,order:u}}}}),duplicateBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i||!i.data[r]){console.error(`Block with ID "${r}" not found in page "${n}"`);return}const c=yi(),u=i.data[r],d={name:u.name,value:structuredClone({...u.value})};i.data[c]={...d};const h=i.order.indexOf(r);if(h===-1){console.error(`Block ID "${r}" not found in order array`);return}i.order.splice(h+1,0,c),e({blocks:{...o,[n]:i},currentBlock:c}),v2.getState().setActiveBlock({id:c,neededScroll:!0}),fs.getState().setNotification({message:"Block successfully duplicated",status:"success"})},isLoadingLayers:!1,setIsLoadingLayers:n=>e(()=>({isLoadingLayers:n}))}),{name:"layers-storage",partialize:e=>{const{blocks:t,header:n,footer:r}=e;return{blocks:t,header:n,footer:r}}})),Pg=Ut((e,t)=>({isModalVisible:!1,hoverBlockId:null,isMouseOverModal:!1,hideTimeout:null,setHoverBlockId:n=>{e({hoverBlockId:n})},showModal:(n,r="hoverBlockId")=>{t().hideTimeout&&clearTimeout(t().hideTimeout),e({isModalVisible:!0,[r]:n})},hideModal:(n="hoverBlockId")=>{e({isModalVisible:!1,[n]:null})},startHideTimeout:()=>{if(!t().isMouseOverModal){const n=setTimeout(()=>{e({isModalVisible:!1,hoverBlockId:null,keyBlock:null})},500);e({hideTimeout:n})}},clearHideTimeout:()=>{t().hideTimeout&&(clearTimeout(t().hideTimeout),e({hideTimeout:null}))},setMouseOverModal:n=>{e({isMouseOverModal:n})},isPreviewVisible:!1,showPreview:(n,r="hoverBlockId")=>{e({isPreviewVisible:!0,[r]:n})},hidePreview:(n="hoverBlockId")=>{e({isPreviewVisible:!1,[n]:null})},keyBlock:null,setKeyBlock:n=>{e({keyBlock:n})},hoverBlockTopPosition:null,setHoverBlockTopPosition:n=>{e({hoverBlockTopPosition:n})}})),xo=Ut((e,t)=>({activeBlock:null,setActiveBlock:n=>e(()=>({activeBlock:n})),activeFont:null,setActiveFont:n=>e(()=>({activeFont:n})),setThemeSettings:n=>e(()=>({themeSettings:n})),themeSettings:{colors:{text:{primary:"#252525",secondary:"#757575",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},icon:{primary:"#252525",secondary:"#555555",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},border:{primary:"#C2C2C2",secondary:"#E6E6E6",action:"#FF3F19",actionHover:"#DA2400",disabled:"#E6E6E6",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",focus:"#FF3F19"},surface:{primary:"#FFFFFF",secondary:"#F8F8F8",action1:"#FF3F19",action1Hover:"#DA2400",action2:"#FFFFFF",action2Hover:"#F8F8F8",disabled:"#C2C2C2",warning:"#FAF4E6",error:"#FAE6E6",success:"#E5FADD",information:"#E9F1FE",modal:"rgba(1, 1, 4, 0.4)"}},fonts:{mobile:{fontSizePercentage:30},tablet:{fontSizePercentage:50},desktop:{heading:{h1:{font:"Archivo",weight:"900",size:48},h2:{font:"Archivo",weight:"700",size:32},h3:{font:"Archivo",weight:"600",size:24},h4:{font:"Archivo",weight:"500",size:16},h5:{font:"Archivo",weight:"400",size:16},h6:{font:"Archivo",weight:"400",size:16}},paragraph:{text:{font:"Archivo",size:14,weight:"400"}}}},borders:{radius:10,thickness:1},buttons:{primary:{size:26,alignment:"left",radius:32,height:40,background:"#ff3f19",hover:!0,font:"Archivo",boxShadow:{left:0,top:0,blur:0,spread:0,color:"#000000"}},secondary:{size:26,alignment:"left",radius:10,height:20,background:"#c2c2c2",hover:!1,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}},tertiary:{size:12,alignment:"left",radius:30,height:30,background:"#c2c2c2",hover:!0,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}}},inputs:{general:{height:48,size:48,color:"#000000"},field:{active:!0,color:"#000000",opacity:40},border:{active:!0,style:"solid",radius:0,thickness:0,color:"#000000"},label:{height:48,size:48,color:"#000000",alignment:"left"}}},updateColor:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.colors,[n]:{...o.themeSettings.colors[n],[r]:a}};return{themeSettings:{...o.themeSettings,colors:c}}}),updateFont:(n,r,a,o,i)=>e(c=>{const u=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:u});const d={...c.themeSettings.fonts,[n]:{...c.themeSettings.fonts[n],[r]:{...c.themeSettings.fonts[n][r],[a]:{...c.themeSettings.fonts[n][r][a],[o]:i}}}};return{themeSettings:{...c.themeSettings,fonts:d}}}),updateFontSizePercentage:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.fonts,[n]:{...a.themeSettings.fonts[n],fontSizePercentage:r}};return{themeSettings:{...a.themeSettings,fonts:i}}}),updateBorder:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.borders,[n]:r};return{themeSettings:{...a.themeSettings,borders:i}}}),updateButton:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.buttons[n],[r]:a},u={...o.themeSettings.buttons,[n]:c};return{themeSettings:{...o.themeSettings,buttons:u}}}),updateInput:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);return mr.getState().addHistory({themeSettings:i}),{themeSettings:{...o.themeSettings,inputs:{...o.themeSettings.inputs,[n]:{...o.themeSettings.inputs[n],[a]:r}}}}}),isLoadingThemeSettings:!1,setIsLoadingThemeSettings:n=>e(()=>({isLoadingThemeSettings:n}))})),Lg=Ut(nu(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),Ag=Ut(e=>({settings:null,setSettings:t=>e(()=>({settings:t})),isLoadingSettings:!0,setIsLoadingSettings:t=>e(()=>({isLoadingSettings:t}))})),Rg=Ut()(e=>({color:"default",initialColor:"",setInitialColor:t=>e(()=>({initialColor:t})),colorChange:()=>{},update:()=>{},activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradientActive:!0,isGradient:!1,setIsGradient:t=>e(()=>({isGradient:t})),gradientDirection:"vertical",setGradientDirection:t=>e(()=>({gradientDirection:t})),hue2:0,saturation2:100,brightness2:100,alpha2:100,setHue2:t=>e(()=>({hue2:t})),setSaturation2:t=>e(()=>({saturation2:t})),setBrightness2:t=>e(()=>({brightness2:t})),setAlpha2:t=>e(()=>({alpha2:t})),activeColorIndex:1,setActiveColorIndex:t=>e(()=>({activeColorIndex:t})),setModalPosition:t=>e(()=>({modalPosition:t})),setHue:t=>e(()=>({hue:t})),setSaturation:t=>e(()=>({saturation:t})),setBrightness:t=>e(()=>({brightness:t})),setShowModal:t=>e(()=>({showModal:t})),setDragging:t=>e(()=>({dragging:t})),setActiveLabel:t=>e(()=>({activeLabel:t})),setColor:t=>e(()=>({color:t})),setUpdate:t=>e(()=>({update:t})),setColorChange:t=>e(()=>({colorChange:t})),setAlpha:t=>e(()=>({alpha:t})),setIsGradientActive:t=>e(()=>({isGradientActive:t})),resetColors:()=>e(()=>({color:"default",initialColor:"",activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradient:!1,gradientDirection:"vertical",hue2:0,saturation2:100,brightness2:100,alpha2:100,activeColorIndex:1,isGradientActive:!0}))})),Md=Ut(nu((e,t)=>({pages:null,currentPage:"",setPages:n=>e(()=>({pages:n})),pageContext:{listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},isOpenModal:!1,isOpenSelectModal:!1,isEdit:!1,editedPage:null,setEditedPage:n=>e(()=>({editedPage:n})),setCurrentPage:n=>e(()=>({currentPage:n})),setPageContext:n=>e(()=>({pageContext:n})),setIsOpenModal:n=>e(()=>({isOpenModal:n})),setIsOpenSelectModal:n=>e(()=>({isOpenSelectModal:n})),setIsEdit:n=>e(()=>({isEdit:n})),createPage:n=>{const r=t().pages,a=yi();if(r)r[a]=n,e({pages:r});else{const o=t().setPages;o({});const i=t().pages;i[a]=n,e({pages:i})}},updatePage:(n,r)=>{const a=t().pages;a&&(a[n]={...r},e({pages:a}))},deletePage:n=>{const r=t().pages;r&&(delete r[n],e({pages:r}))}}),{name:"pages-storage",partialize:e=>{const{pages:t,pageContext:n}=e;return{pages:t,pageContext:n}}})),Bd=Ut(e=>({openModal:!1,setOpenModal:t=>e(()=>({openModal:t})),onChange:null,setOnChange:t=>e(()=>({onChange:t})),tip:"",setTip:t=>e(()=>({tip:t}))})),mr=Ut((e,t)=>({past:[],future:[],addHistory:n=>{e(r=>({past:[...r.past,n],future:[]}))},undo:()=>{const{past:n,future:r}=t();if(n.length===0)return;const a=n[n.length-1],o=n.slice(0,-1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:o,future:[i,...r]}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})},redo:()=>{const{past:n,future:r}=t();if(r.length===0)return;const a=r[0],o=r.slice(1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:[...n,i],future:o}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})}})),Dg=Ut(e=>({isOpenModal:!1,setIsOpenModal:t=>e(()=>({isOpenModal:t}))})),fs=Ut(e=>({notification:null,setNotification:t=>e(()=>({notification:t}))})),Og=Ut(e=>({error:null,setError:t=>e(()=>({error:t}))})),Ig=Ut(e=>({title:null,description:null,onConfirm:null,setTitle:t=>e(()=>({title:t})),setDescription:t=>e(()=>({description:t})),setOnConfirm:t=>e(()=>({onConfirm:t}))})),Mg=Ut(e=>({showTooltip:!1,setShowTooltip:t=>e({showTooltip:t})})),Fd=Ut(e=>({isOpen:!0,setIsOpen:t=>e(()=>({isOpen:t}))})),Bg=Ut(e=>({general:null,setGeneral:t=>e(()=>({general:t}))})),Fg="_icon_bsuj2_1",Hg="_hoverable_bsuj2_5",$g="_rotated_bsuj2_9",$f={icon:Fg,hoverable:Hg,rotated:$g};var y2={exports:{}};/*!
61
+ */function Ua(){return Ua=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ua.apply(this,arguments)}function Dd(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o<r.length;o++)a=r[o],!(t.indexOf(a)>=0)&&(n[a]=e[a]);return n}const ac="get",oc="application/x-www-form-urlencoded";function tu(e){return e!=null&&typeof e.tagName=="string"}function D7(e){return tu(e)&&e.tagName.toLowerCase()==="button"}function O7(e){return tu(e)&&e.tagName.toLowerCase()==="form"}function I7(e){return tu(e)&&e.tagName.toLowerCase()==="input"}function M7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function B7(e,t){return e.button===0&&(!t||t==="_self")&&!M7(e)}function T1(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function F7(e,t){let n=T1(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}let Tl=null;function H7(){if(Tl===null)try{new FormData(document.createElement("form"),0),Tl=!1}catch{Tl=!0}return Tl}const $7=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mu(e){return e!=null&&!$7.has(e)?(process.env.NODE_ENV!=="production"&&en(!1,'"'+e+'" is not a valid `encType` for `<Form>`/`<fetcher.Form>` '+('and will default to "'+oc+'"')),null):e}function V7(e,t){let n,r,a,o,i;if(O7(e)){let c=e.getAttribute("action");r=c?Tr(c,t):null,n=e.getAttribute("method")||ac,a=Mu(e.getAttribute("enctype"))||oc,o=new FormData(e)}else if(D7(e)||I7(e)&&(e.type==="submit"||e.type==="image")){let c=e.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let u=e.getAttribute("formaction")||c.getAttribute("action");if(r=u?Tr(u,t):null,n=e.getAttribute("formmethod")||c.getAttribute("method")||ac,a=Mu(e.getAttribute("formenctype"))||Mu(c.getAttribute("enctype"))||oc,o=new FormData(c,e),!H7()){let{name:d,type:h,value:p}=e;if(h==="image"){let f=d?d+".":"";o.append(f+"x","0"),o.append(f+"y","0")}else d&&o.append(d,p)}}else{if(tu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=ac,r=null,a=oc,i=e}return o&&a==="text/plain"&&(i=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:i}}const U7=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","unstable_viewTransition"],W7=["aria-current","caseSensitive","className","end","style","to","unstable_viewTransition","children"],q7=["fetcherKey","navigate","reloadDocument","replace","state","method","action","onSubmit","relative","preventScrollReset","unstable_viewTransition"],z7="6";try{window.__reactRouterVersion=z7}catch{}function Z7(e,t){return G6({basename:void 0,future:Ua({},void 0,{v7_prependBasename:!0}),history:y6({window:void 0}),hydrationData:G7(),routes:e,mapRouteProperties:R7,unstable_dataStrategy:void 0,unstable_patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function G7(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=Ua({},t,{errors:Y7(t.errors)})),t}function Y7(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,a]of t)if(a&&a.__type==="RouteErrorResponse")n[r]=new gc(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let o=window[a.__subType];if(typeof o=="function")try{let i=new o(a.message);i.stack="",n[r]=i}catch{}}if(n[r]==null){let o=new Error(a.message);o.stack="",n[r]=o}}else n[r]=a;return n}const Od=H.createContext({isTransitioning:!1});process.env.NODE_ENV!=="production"&&(Od.displayName="ViewTransition");const d2=H.createContext(new Map);process.env.NODE_ENV!=="production"&&(d2.displayName="Fetchers");const K7="startTransition",Of=H[K7],X7="flushSync",If=p6[X7];function J7(e){Of?Of(e):e()}function Xi(e){If?If(e):e()}class Q7{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function eg(e){let{fallbackElement:t,router:n,future:r}=e,[a,o]=H.useState(n.state),[i,c]=H.useState(),[u,d]=H.useState({isTransitioning:!1}),[h,p]=H.useState(),[f,y]=H.useState(),[g,m]=H.useState(),b=H.useRef(new Map),{v7_startTransition:w}=r||{},_=H.useCallback(S=>{w?J7(S):S()},[w]),x=H.useCallback((S,T)=>{let{deletedFetchers:I,unstable_flushSync:A,unstable_viewTransitionOpts:U}=T;I.forEach(X=>b.current.delete(X)),S.fetchers.forEach((X,G)=>{X.data!==void 0&&b.current.set(G,X.data)});let K=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!U||K){A?Xi(()=>o(S)):_(()=>o(S));return}if(A){Xi(()=>{f&&(h&&h.resolve(),f.skipTransition()),d({isTransitioning:!0,flushSync:!0,currentLocation:U.currentLocation,nextLocation:U.nextLocation})});let X=n.window.document.startViewTransition(()=>{Xi(()=>o(S))});X.finished.finally(()=>{Xi(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})})}),Xi(()=>y(X));return}f?(h&&h.resolve(),f.skipTransition(),m({state:S,currentLocation:U.currentLocation,nextLocation:U.nextLocation})):(c(S),d({isTransitioning:!0,flushSync:!1,currentLocation:U.currentLocation,nextLocation:U.nextLocation}))},[n.window,f,h,b,_]);H.useLayoutEffect(()=>n.subscribe(x),[n,x]),H.useEffect(()=>{u.isTransitioning&&!u.flushSync&&p(new Q7)},[u]),H.useEffect(()=>{if(h&&i&&n.window){let S=i,T=h.promise,I=n.window.document.startViewTransition(async()=>{_(()=>o(S)),await T});I.finished.finally(()=>{p(void 0),y(void 0),c(void 0),d({isTransitioning:!1})}),y(I)}},[_,i,h,n.window]),H.useEffect(()=>{h&&i&&a.location.key===i.location.key&&h.resolve()},[h,f,a.location,i]),H.useEffect(()=>{!u.isTransitioning&&g&&(c(g.state),d({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),m(void 0))},[u.isTransitioning,g]),H.useEffect(()=>{process.env.NODE_ENV!=="production"&&en(t==null||!n.future.v7_partialHydration,"`<RouterProvider fallbackElement>` is deprecated when using `v7_partialHydration`, use a `HydrateFallback` component instead")},[]);let j=H.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:S=>n.navigate(S),push:(S,T,I)=>n.navigate(S,{state:T,preventScrollReset:I==null?void 0:I.preventScrollReset}),replace:(S,T,I)=>n.navigate(S,{replace:!0,state:T,preventScrollReset:I==null?void 0:I.preventScrollReset})}),[n]),k=n.basename||"/",L=H.useMemo(()=>({router:n,navigator:j,static:!1,basename:k}),[n,j,k]),D=H.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return H.createElement(H.Fragment,null,H.createElement(Ni.Provider,{value:L},H.createElement(Qc.Provider,{value:a},H.createElement(d2.Provider,{value:b.current},H.createElement(Od.Provider,{value:u},H.createElement(A7,{basename:k,location:a.location,navigationType:a.historyAction,navigator:j,future:D},a.initialized||n.future.v7_partialHydration?H.createElement(tg,{routes:n.routes,future:n.future,state:a}):t))))),null)}const tg=H.memo(ng);function ng(e){let{routes:t,future:n,state:r}=e;return C7(t,void 0,r,n)}process.env.NODE_ENV;const rg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",ag=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,h2=H.forwardRef(function(t,n){let{onClick:r,relative:a,reloadDocument:o,replace:i,state:c,target:u,to:d,preventScrollReset:h,unstable_viewTransition:p}=t,f=Dd(t,U7),{basename:y}=H.useContext(Dr),g,m=!1;if(typeof d=="string"&&ag.test(d)&&(g=d,rg))try{let x=new URL(window.location.href),j=d.startsWith("//")?new URL(x.protocol+d):new URL(d),k=Tr(j.pathname,y);j.origin===x.origin&&k!=null?d=k+j.search+j.hash:m=!0}catch{process.env.NODE_ENV!=="production"&&en(!1,'<Link to="'+d+'"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.')}let b=m7(d,{relative:a}),w=sg(d,{replace:i,state:c,target:u,preventScrollReset:h,relative:a,unstable_viewTransition:p});function _(x){r&&r(x),x.defaultPrevented||w(x)}return H.createElement("a",Ua({},f,{href:g||b,onClick:m||o?r:_,ref:n,target:u}))});process.env.NODE_ENV!=="production"&&(h2.displayName="Link");const f2=H.forwardRef(function(t,n){let{"aria-current":r="page",caseSensitive:a=!1,className:o="",end:i=!1,style:c,to:u,unstable_viewTransition:d,children:h}=t,p=Dd(t,W7),f=rl(u,{relative:p.relative}),y=no(),g=H.useContext(Qc),{navigator:m,basename:b}=H.useContext(Dr),w=g!=null&&fg(f)&&d===!0,_=m.encodeLocation?m.encodeLocation(f).pathname:f.pathname,x=y.pathname,j=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;a||(x=x.toLowerCase(),j=j?j.toLowerCase():null,_=_.toLowerCase()),j&&b&&(j=Tr(j,b)||j);const k=_!=="/"&&_.endsWith("/")?_.length-1:_.length;let L=x===_||!i&&x.startsWith(_)&&x.charAt(k)==="/",D=j!=null&&(j===_||!i&&j.startsWith(_)&&j.charAt(_.length)==="/"),S={isActive:L,isPending:D,isTransitioning:w},T=L?r:void 0,I;typeof o=="function"?I=o(S):I=[o,L?"active":null,D?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let A=typeof c=="function"?c(S):c;return H.createElement(h2,Ua({},p,{"aria-current":T,className:I,ref:n,style:A,to:u,unstable_viewTransition:d}),typeof h=="function"?h(S):h)});process.env.NODE_ENV!=="production"&&(f2.displayName="NavLink");const og=H.forwardRef((e,t)=>{let{fetcherKey:n,navigate:r,reloadDocument:a,replace:o,state:i,method:c=ac,action:u,onSubmit:d,relative:h,preventScrollReset:p,unstable_viewTransition:f}=e,y=Dd(e,q7),g=dg(),m=hg(u,{relative:h}),b=c.toLowerCase()==="get"?"get":"post",w=_=>{if(d&&d(_),_.defaultPrevented)return;_.preventDefault();let x=_.nativeEvent.submitter,j=(x==null?void 0:x.getAttribute("formmethod"))||c;g(x||_.currentTarget,{fetcherKey:n,method:j,navigate:r,replace:o,state:i,relative:h,preventScrollReset:p,unstable_viewTransition:f})};return H.createElement("form",Ua({ref:t,method:b,action:m,onSubmit:a?d:w},y))});process.env.NODE_ENV!=="production"&&(og.displayName="Form");process.env.NODE_ENV;var yc;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(yc||(yc={}));var Mf;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Mf||(Mf={}));function ig(e){return e+" must be used within a data router. See https://reactrouter.com/routers/picking-a-router."}function p2(e){let t=H.useContext(Ni);return t||(process.env.NODE_ENV!=="production"?Te(!1,ig(e)):Te(!1)),t}function sg(e,t){let{target:n,replace:r,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c}=t===void 0?{}:t,u=ur(),d=no(),h=rl(e,{relative:i});return H.useCallback(p=>{if(B7(p,n)){p.preventDefault();let f=r!==void 0?r:Va(d)===Va(h);u(e,{replace:f,state:a,preventScrollReset:o,relative:i,unstable_viewTransition:c})}},[d,u,h,r,a,n,e,o,i,c])}function m2(e){process.env.NODE_ENV!=="production"&&en(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=H.useRef(T1(e)),n=H.useRef(!1),r=no(),a=H.useMemo(()=>F7(r.search,n.current?null:t.current),[r.search]),o=ur(),i=H.useCallback((c,u)=>{const d=T1(typeof c=="function"?c(a):c);n.current=!0,o("?"+d,u)},[o,a]);return[a,i]}function lg(){if(typeof document>"u")throw new Error("You are calling submit during the server render. Try calling submit within a `useEffect` or callback instead.")}let cg=0,ug=()=>"__"+String(++cg)+"__";function dg(){let{router:e}=p2(yc.UseSubmit),{basename:t}=H.useContext(Dr),n=N7();return H.useCallback(function(r,a){a===void 0&&(a={}),lg();let{action:o,method:i,encType:c,formData:u,body:d}=V7(r,t);if(a.navigate===!1){let h=a.fetcherKey||ug();e.fetch(h,n,a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,unstable_flushSync:a.unstable_flushSync})}else e.navigate(a.action||o,{preventScrollReset:a.preventScrollReset,formData:u,body:d,formMethod:a.method||i,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,unstable_flushSync:a.unstable_flushSync,unstable_viewTransition:a.unstable_viewTransition})},[e,t,n])}function hg(e,t){let{relative:n}=t===void 0?{}:t,{basename:r}=H.useContext(Dr),a=H.useContext(Or);a||(process.env.NODE_ENV!=="production"?Te(!1,"useFormAction must be used inside a RouteContext"):Te(!1));let[o]=a.matches.slice(-1),i=Ua({},rl(e||".",{relative:n})),c=no();if(e==null){i.search=c.search;let u=new URLSearchParams(i.search);u.has("index")&&u.get("index")===""&&(u.delete("index"),i.search=u.toString()?"?"+u.toString():"")}return(!e||e===".")&&o.route.index&&(i.search=i.search?i.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(i.pathname=i.pathname==="/"?r:Xr([r,i.pathname])),Va(i)}function fg(e,t){t===void 0&&(t={});let n=H.useContext(Od);n==null&&(process.env.NODE_ENV!=="production"?Te(!1,"`unstable_useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?"):Te(!1));let{basename:r}=p2(yc.useViewTransitionState),a=rl(e,{relative:t.relative});if(!n.isTransitioning)return!1;let o=Tr(n.currentLocation.pathname,r)||n.currentLocation.pathname,i=Tr(n.nextLocation.pathname,r)||n.nextLocation.pathname;return mc(a.pathname,i)!=null||mc(a.pathname,o)!=null}const Bf=e=>{let t;const n=new Set,r=(d,h)=>{const p=typeof d=="function"?d(t):d;if(!Object.is(p,t)){const f=t;t=h??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(y=>y(t,f))}},a=()=>t,c={setState:r,getState:a,getInitialState:()=>u,subscribe:d=>(n.add(d),()=>n.delete(d))},u=t=e(r,a,c);return c},pg=e=>e?Bf(e):Bf,mg=e=>e;function gg(e,t=mg){const n=C.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return C.useDebugValue(n),n}const Ff=e=>{const t=pg(e),n=r=>gg(t,r);return Object.assign(n,t),n},Ut=e=>e?Ff(e):Ff,vg=Ut(e=>({blocks:null,setBlocks:t=>e(()=>({blocks:t})),activeBlock:null,setActiveBlock:t=>e(()=>({activeBlock:t})),sourceBlocks:{},setSourceBlocks:t=>e(()=>({sourceBlocks:t})),currentInstance:null,setCurrentInstance:t=>e(()=>({currentInstance:t}))})),yg=Ut(e=>({currentDevice:{icon:"Desktop",value:"desktop"},setCurrentDevice:t=>e(()=>({currentDevice:t}))}));Ut(e=>({pageData:null,setPageData:t=>e(()=>({pageData:t}))}));const g2=[{icon:"TreeStructure",name:"Layers"},{icon:"Plus",name:"Add"},{icon:"Palette",name:"Theme"},{icon:"Gear",name:"Settings"}],Id="https://g-api.billgang.com",Cg="https://www.googleapis.com/webfonts/v1/webfonts",bg="https://stores-api.billgang.com",_g="https://sl-api.billgang.com",xg=window.location.hostname.includes("localhost"),wg=Ut(e=>({activeBlock:g2[0],setActiveBlock:t=>e(()=>({activeBlock:t}))}));function Sg(e,t){let n;try{n=e()}catch{return}return{getItem:a=>{var o;const i=u=>u===null?null:JSON.parse(u,void 0),c=(o=n.getItem(a))!=null?o:null;return c instanceof Promise?c.then(i):i(c)},setItem:(a,o)=>n.setItem(a,JSON.stringify(o,void 0)),removeItem:a=>n.removeItem(a)}}const P1=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return P1(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return P1(r)(n)}}}},jg=(e,t)=>(n,r,a)=>{let o={storage:Sg(()=>localStorage),partialize:m=>m,version:0,merge:(m,b)=>({...b,...m}),...t},i=!1;const c=new Set,u=new Set;let d=o.storage;if(!d)return e((...m)=>{console.warn(`[zustand persist middleware] Unable to update item '${o.name}', the given storage is currently unavailable.`),n(...m)},r,a);const h=()=>{const m=o.partialize({...r()});return d.setItem(o.name,{state:m,version:o.version})},p=a.setState;a.setState=(m,b)=>{p(m,b),h()};const f=e((...m)=>{n(...m),h()},r,a);a.getInitialState=()=>f;let y;const g=()=>{var m,b;if(!d)return;i=!1,c.forEach(_=>{var x;return _((x=r())!=null?x:f)});const w=((b=o.onRehydrateStorage)==null?void 0:b.call(o,(m=r())!=null?m:f))||void 0;return P1(d.getItem.bind(d))(o.name).then(_=>{if(_)if(typeof _.version=="number"&&_.version!==o.version){if(o.migrate)return[!0,o.migrate(_.state,_.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,_.state];return[!1,void 0]}).then(_=>{var x;const[j,k]=_;if(y=o.merge(k,(x=r())!=null?x:f),n(y,!0),j)return h()}).then(()=>{w==null||w(y,void 0),y=r(),i=!0,u.forEach(_=>_(y))}).catch(_=>{w==null||w(void 0,_)})};return a.persist={setOptions:m=>{o={...o,...m},m.storage&&(d=m.storage)},clearStorage:()=>{d==null||d.removeItem(o.name)},getOptions:()=>o,rehydrate:()=>g(),hasHydrated:()=>i,onHydrate:m=>(c.add(m),()=>{c.delete(m)}),onFinishHydration:m=>(u.add(m),()=>{u.delete(m)})},o.skipHydration||g(),y||f},nu=jg,v2=Ut(nu(e=>({onPreview:!0,setOnPreview:t=>e(()=>({onPreview:t})),activeBlock:{id:null,neededScroll:!1},setActiveBlock:t=>e(()=>({activeBlock:t})),zoomLevel:1,setZoomLevel:t=>e(()=>({zoomLevel:t}))}),{name:"preview-storage",partialize:e=>{const{onPreview:t}=e;return{onPreview:t}}}));var dn=[];for(var Bu=0;Bu<256;++Bu)dn.push((Bu+256).toString(16).slice(1));function kg(e,t=0){return(dn[e[t+0]]+dn[e[t+1]]+dn[e[t+2]]+dn[e[t+3]]+"-"+dn[e[t+4]]+dn[e[t+5]]+"-"+dn[e[t+6]]+dn[e[t+7]]+"-"+dn[e[t+8]]+dn[e[t+9]]+"-"+dn[e[t+10]]+dn[e[t+11]]+dn[e[t+12]]+dn[e[t+13]]+dn[e[t+14]]+dn[e[t+15]]).toLowerCase()}var Pl,Eg=new Uint8Array(16);function Ng(){if(!Pl&&(Pl=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Pl))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Pl(Eg)}var Tg=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);const Hf={randomUUID:Tg};function yi(e,t,n){if(Hf.randomUUID&&!t&&!e)return Hf.randomUUID();e=e||{};var r=e.random||(e.rng||Ng)();return r[6]=r[6]&15|64,r[8]=r[8]&63|128,kg(r)}const hs=Ut(nu((e,t)=>({header:null,blocks:{},announcement:null,footer:null,currentBlock:null,positionBlock:null,setBlocks:n=>{e({blocks:n})},setHeader:n=>{e({header:n})},setFooter:n=>{e({footer:n})},setAnnouncement:n=>{e({announcement:n})},createPage:n=>{const r=t().blocks;r[n]={data:{},order:[]},e({blocks:r})},deletePage:n=>{const r=t().blocks;delete r[n],e({blocks:r})},updatePage:(n,r)=>{const a=t().blocks;if(a[r])return;const o=a[n];delete a[n],a[r]=o,e({blocks:a})},setCurrentBlock:n=>{e({currentBlock:n})},setPositionBlock:(n,r=!1)=>{const{blocks:a}=t(),{currentPage:o,pages:i}=Md.getState();if(!o||!i||!i[o]||!a[i[o].path]){console.error("Cannot set position: invalid page or block data");return}const c=i[o].path,u=a[c],d=n?u.order.indexOf(n):-1;if(d===-1&&n){console.error(`Block with ID "${n}" not found in page "${c}"`);return}const h=d!==-1?d+(r?1:0):u.order.length;e({positionBlock:h})},addBlock:(n,r)=>{const a=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:a});const o={...t().blocks},i=o[n]||{data:{},order:[]},c=t().positionBlock,u=yi(),d={name:r.name,value:r.value};return i.data[u]=d,c===null||c>=i.order.length?i.order.push(u):i.order.splice(c,0,u),e({blocks:{...o,[n]:{data:i.data,order:i.order}},currentBlock:u,positionBlock:null}),fs.getState().setNotification({message:"Block successfully added",status:"success"}),u},editBlock:(n,r,a)=>{const o=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));mr.getState().addHistory({layers:o});const i=t().blocks,c=i[n]||{};c.data[r]={name:a.name,value:{...a.value}},e({blocks:{...i,[n]:c}})},removeBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i){console.error(`Page at path "${n}" does not exist.`);return}delete i.data[r],i.order=i.order.filter(c=>c!==r),e({blocks:{...o,[n]:i}}),fs.getState().setNotification({message:"Block successfully deleted",status:"success"})},moveBlock:(n,r,a)=>e(o=>{const i=structuredClone(t().blocks)||JSON.parse(JSON.stringify(t().blocks));if(mr.getState().addHistory({layers:i}),!o.blocks[n])return console.error(`Path ${n} does not exist in blocks`),o;const c={...o.blocks[n]},u=[...c.order];if(r<0||a<0||r>=u.length||a>=u.length)return console.error(`Invalid indices: fromIndex=${r}, toIndex=${a}`),o;const[d]=u.splice(r,1);return u.splice(a,0,d),fs.getState().setNotification({message:"Block successfully moved",status:"success"}),{blocks:{...o.blocks,[n]:{...c,order:u}}}}),duplicateBlock:(n,r)=>{const a=structuredClone(t().blocks);mr.getState().addHistory({layers:a});const o=structuredClone(t().blocks),i=o[n];if(!i||!i.data[r]){console.error(`Block with ID "${r}" not found in page "${n}"`);return}const c=yi(),u=i.data[r],d={name:u.name,value:structuredClone({...u.value})};i.data[c]={...d};const h=i.order.indexOf(r);if(h===-1){console.error(`Block ID "${r}" not found in order array`);return}i.order.splice(h+1,0,c),e({blocks:{...o,[n]:i},currentBlock:c}),v2.getState().setActiveBlock({id:c,neededScroll:!0}),fs.getState().setNotification({message:"Block successfully duplicated",status:"success"})},isLoadingLayers:!1,setIsLoadingLayers:n=>e(()=>({isLoadingLayers:n}))}),{name:"layers-storage",partialize:e=>{const{blocks:t,header:n,footer:r}=e;return{blocks:t,header:n,footer:r}}})),Pg=Ut((e,t)=>({isModalVisible:!1,hoverBlockId:null,isMouseOverModal:!1,hideTimeout:null,setHoverBlockId:n=>{e({hoverBlockId:n})},showModal:(n,r="hoverBlockId")=>{t().hideTimeout&&clearTimeout(t().hideTimeout),e({isModalVisible:!0,[r]:n})},hideModal:(n="hoverBlockId")=>{e({isModalVisible:!1,[n]:null})},startHideTimeout:()=>{if(!t().isMouseOverModal){const n=setTimeout(()=>{e({isModalVisible:!1,hoverBlockId:null,keyBlock:null})},500);e({hideTimeout:n})}},clearHideTimeout:()=>{t().hideTimeout&&(clearTimeout(t().hideTimeout),e({hideTimeout:null}))},setMouseOverModal:n=>{e({isMouseOverModal:n})},isPreviewVisible:!1,showPreview:(n,r="hoverBlockId")=>{e({isPreviewVisible:!0,[r]:n})},hidePreview:(n="hoverBlockId")=>{e({isPreviewVisible:!1,[n]:null})},keyBlock:null,setKeyBlock:n=>{e({keyBlock:n})},hoverBlockTopPosition:null,setHoverBlockTopPosition:n=>{e({hoverBlockTopPosition:n})}})),xo=Ut((e,t)=>({activeBlock:null,setActiveBlock:n=>e(()=>({activeBlock:n})),activeFont:null,setActiveFont:n=>e(()=>({activeFont:n})),setThemeSettings:n=>e(()=>({themeSettings:n})),activeColorCategory:null,setActiveColorCategory:n=>e(()=>({activeColorCategory:n})),themeSettings:{colors:{text:{primary:"#252525",secondary:"#757575",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},icon:{primary:"#252525",secondary:"#555555",tertiary:"#C2C2C2",inverted:"#FFFFFF",action:"#FF3F19",actionHover:"#DA2400",disabled:"#C2C2C2",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",link:"#3683F7"},border:{primary:"#C2C2C2",secondary:"#E6E6E6",action:"#FF3F19",actionHover:"#DA2400",disabled:"#E6E6E6",warning:"#FF3F19",error:"#C12A2A",success:"#338B13",information:"#3683F7",focus:"#FF3F19"},surface:{primary:"#FFFFFF",secondary:"#F8F8F8",action1:"#FF3F19",action1Hover:"#DA2400",action2:"#FFFFFF",action2Hover:"#F8F8F8",disabled:"#C2C2C2",warning:"#FAF4E6",error:"#FAE6E6",success:"#E5FADD",information:"#E9F1FE",modal:"rgba(1, 1, 4, 0.4)"}},fonts:{mobile:{fontSizePercentage:30},tablet:{fontSizePercentage:50},desktop:{heading:{h1:{font:"Archivo",weight:"900",size:48},h2:{font:"Archivo",weight:"700",size:32},h3:{font:"Archivo",weight:"600",size:24},h4:{font:"Archivo",weight:"500",size:16},h5:{font:"Archivo",weight:"400",size:16},h6:{font:"Archivo",weight:"400",size:16}},paragraph:{text:{font:"Archivo",size:14,weight:"400"}}}},borders:{radius:"var(--radius-lg)",thickness:"var(--border-none)"},buttons:{primary:{size:26,alignment:"left",radius:32,height:40,background:"#ff3f19",hover:!0,font:"Archivo",boxShadow:{left:0,top:0,blur:0,spread:0,color:"#000000"}},secondary:{size:26,alignment:"left",radius:10,height:20,background:"#c2c2c2",hover:!1,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}},tertiary:{size:12,alignment:"left",radius:30,height:30,background:"#c2c2c2",hover:!0,font:"Archivo",boxShadow:{left:0,top:4,blur:10,spread:0,color:"#000000"}}},inputs:{general:{height:48,size:48,color:"#000000"},field:{active:!0,color:"#000000",opacity:40},border:{active:!0,style:"solid",radius:0,thickness:0,color:"#000000"},label:{height:48,size:48,color:"#000000",alignment:"left"}}},updateColor:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.colors,[n]:{...o.themeSettings.colors[n],[r]:a}};return{themeSettings:{...o.themeSettings,colors:c}}}),updateFont:(n,r,a,o,i)=>e(c=>{const u=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:u});const d={...c.themeSettings.fonts,[n]:{...c.themeSettings.fonts[n],[r]:{...c.themeSettings.fonts[n][r],[a]:{...c.themeSettings.fonts[n][r][a],[o]:i}}}};return{themeSettings:{...c.themeSettings,fonts:d}}}),updateFontSizePercentage:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.fonts,[n]:{...a.themeSettings.fonts[n],fontSizePercentage:r}};return{themeSettings:{...a.themeSettings,fonts:i}}}),updateBorder:(n,r)=>e(a=>{const o=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:o});const i={...a.themeSettings.borders,[n]:r};return{themeSettings:{...a.themeSettings,borders:i}}}),updateButton:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);mr.getState().addHistory({themeSettings:i});const c={...o.themeSettings.buttons[n],[r]:a},u={...o.themeSettings.buttons,[n]:c};return{themeSettings:{...o.themeSettings,buttons:u}}}),updateInput:(n,r,a)=>e(o=>{const i=structuredClone(t().themeSettings);return mr.getState().addHistory({themeSettings:i}),{themeSettings:{...o.themeSettings,inputs:{...o.themeSettings.inputs,[n]:{...o.themeSettings.inputs[n],[a]:r}}}}}),isLoadingThemeSettings:!1,setIsLoadingThemeSettings:n=>e(()=>({isLoadingThemeSettings:n}))})),Lg=Ut(nu(e=>({fonts:[],setFonts:t=>e(()=>({fonts:t}))}),{name:"fonts-storage"})),Ag=Ut(e=>({settings:null,setSettings:t=>e(()=>({settings:t})),isLoadingSettings:!0,setIsLoadingSettings:t=>e(()=>({isLoadingSettings:t}))})),Rg=Ut()(e=>({color:"default",initialColor:"",setInitialColor:t=>e(()=>({initialColor:t})),colorChange:()=>{},update:()=>{},activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradientActive:!0,isGradient:!1,setIsGradient:t=>e(()=>({isGradient:t})),gradientDirection:"vertical",setGradientDirection:t=>e(()=>({gradientDirection:t})),hue2:0,saturation2:100,brightness2:100,alpha2:100,setHue2:t=>e(()=>({hue2:t})),setSaturation2:t=>e(()=>({saturation2:t})),setBrightness2:t=>e(()=>({brightness2:t})),setAlpha2:t=>e(()=>({alpha2:t})),activeColorIndex:1,setActiveColorIndex:t=>e(()=>({activeColorIndex:t})),setModalPosition:t=>e(()=>({modalPosition:t})),setHue:t=>e(()=>({hue:t})),setSaturation:t=>e(()=>({saturation:t})),setBrightness:t=>e(()=>({brightness:t})),setShowModal:t=>e(()=>({showModal:t})),setDragging:t=>e(()=>({dragging:t})),setActiveLabel:t=>e(()=>({activeLabel:t})),setColor:t=>e(()=>({color:t})),setUpdate:t=>e(()=>({update:t})),setColorChange:t=>e(()=>({colorChange:t})),setAlpha:t=>e(()=>({alpha:t})),setIsGradientActive:t=>e(()=>({isGradientActive:t})),resetColors:()=>e(()=>({color:"default",initialColor:"",activeLabel:null,modalPosition:{left:0,top:0},showModal:!1,dragging:!1,hue:0,saturation:100,brightness:100,alpha:100,isGradient:!1,gradientDirection:"vertical",hue2:0,saturation2:100,brightness2:100,alpha2:100,activeColorIndex:1,isGradientActive:!0}))})),Md=Ut(nu((e,t)=>({pages:null,currentPage:"",setPages:n=>e(()=>({pages:n})),pageContext:{listings:null,products:null,reviews:null,categories:null,faqs:null,general:null,fullPosts:null,posts:null},isOpenModal:!1,isOpenSelectModal:!1,isEdit:!1,editedPage:null,setEditedPage:n=>e(()=>({editedPage:n})),setCurrentPage:n=>e(()=>({currentPage:n})),setPageContext:n=>e(()=>({pageContext:n})),setIsOpenModal:n=>e(()=>({isOpenModal:n})),setIsOpenSelectModal:n=>e(()=>({isOpenSelectModal:n})),setIsEdit:n=>e(()=>({isEdit:n})),createPage:n=>{const r=t().pages,a=yi();if(r)r[a]=n,e({pages:r});else{const o=t().setPages;o({});const i=t().pages;i[a]=n,e({pages:i})}},updatePage:(n,r)=>{const a=t().pages;a&&(a[n]={...r},e({pages:a}))},deletePage:n=>{const r=t().pages;r&&(delete r[n],e({pages:r}))}}),{name:"pages-storage",partialize:e=>{const{pages:t,pageContext:n}=e;return{pages:t,pageContext:n}}})),Bd=Ut(e=>({openModal:!1,setOpenModal:t=>e(()=>({openModal:t})),onChange:null,setOnChange:t=>e(()=>({onChange:t})),tip:"",setTip:t=>e(()=>({tip:t}))})),mr=Ut((e,t)=>({past:[],future:[],addHistory:n=>{e(r=>({past:[...r.past,n],future:[]}))},undo:()=>{const{past:n,future:r}=t();if(n.length===0)return;const a=n[n.length-1],o=n.slice(0,-1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:o,future:[i,...r]}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})},redo:()=>{const{past:n,future:r}=t();if(r.length===0)return;const a=r[0],o=r.slice(1),i={themeSettings:xo.getState().themeSettings,layers:hs.getState().blocks};e({past:[...n,i],future:o}),a.themeSettings&&xo.setState({themeSettings:a.themeSettings}),a.layers&&hs.setState({blocks:a.layers})}})),Dg=Ut(e=>({isOpenModal:!1,setIsOpenModal:t=>e(()=>({isOpenModal:t}))})),fs=Ut(e=>({notification:null,setNotification:t=>e(()=>({notification:t}))})),Og=Ut(e=>({error:null,setError:t=>e(()=>({error:t}))})),Ig=Ut(e=>({title:null,description:null,onConfirm:null,setTitle:t=>e(()=>({title:t})),setDescription:t=>e(()=>({description:t})),setOnConfirm:t=>e(()=>({onConfirm:t}))})),Mg=Ut(e=>({showTooltip:!1,setShowTooltip:t=>e({showTooltip:t})})),Fd=Ut(e=>({isOpen:!0,setIsOpen:t=>e(()=>({isOpen:t}))})),Bg=Ut(e=>({general:null,setGeneral:t=>e(()=>({general:t}))})),Fg="_icon_bsuj2_1",Hg="_hoverable_bsuj2_5",$g="_rotated_bsuj2_9",$f={icon:Fg,hoverable:Hg,rotated:$g};var y2={exports:{}};/*!
62
62
  Copyright (c) 2018 Jed Watson.
63
63
  Licensed under the MIT License (MIT), see
64
64
  http://jedwatson.github.io/classnames
@@ -136,7 +136,7 @@ If there's a particular need for this, please submit a feature request at https:
136
136
  *
137
137
  * This source code is licensed under the MIT license found in the
138
138
  * LICENSE file in the root directory of this source tree.
139
- */var qp;function $k(){return qp||(qp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=C,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var j=arguments.length,k=new Array(j>1?j-1:0),L=1;L<j;L++)k[L-1]=arguments[L];r("error",x,k)}}function r(x,j,k){{var L=t.ReactDebugCurrentFrame,D=L.getStackAddendum();D!==""&&(j+="%s",k=k.concat([D]));var S=k.map(function(T){return String(T)});S.unshift("Warning: "+j),Function.prototype.apply.call(console[x],console,S)}}function a(x,j){return x===j&&(x!==0||1/x===1/j)||x!==x&&j!==j}var o=typeof Object.is=="function"?Object.is:a,i=e.useState,c=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue,h=!1,p=!1;function f(x,j,k){h||e.startTransition!==void 0&&(h=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var L=j();if(!p){var D=j();o(L,D)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}var S=i({inst:{value:L,getSnapshot:j}}),T=S[0].inst,I=S[1];return u(function(){T.value=L,T.getSnapshot=j,y(T)&&I({inst:T})},[x,L,j]),c(function(){y(T)&&I({inst:T});var A=function(){y(T)&&I({inst:T})};return x(A)},[x]),d(L),L}function y(x){var j=x.getSnapshot,k=x.value;try{var L=j();return!o(k,L)}catch{return!0}}function g(x,j,k){return j()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",b=!m,w=b?g:f,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;Wp.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Wp}process.env.NODE_ENV==="production"?dd.exports=Hk():dd.exports=$k();var Vk=dd.exports;const Uk=ul(Vk);var{useSyncExternalStore:Wk}=Uk,qk=()=>()=>{};function pr(e,t=k5){const n=H.useCallback(a=>e?R5(e,null,a):qk(),[e]),r=()=>{const a=typeof t=="string"?t:null,o=typeof t=="function"?t:null,i=e==null?void 0:e.getState();if(o)return o(i);if(i&&a&&Ya(i,a))return i[a]};return Wk(n,r,r)}function lr(e,t,n,r){const a=Ya(t,n)?t[n]:void 0,o=r?t[r]:void 0,i=L5({value:a,setValue:o});Et(()=>Ka(e,[n],(c,u)=>{const{value:d,setValue:h}=i.current;h&&c[n]!==u[n]&&c[n]!==d&&h(c[n])}),[e,n]),Et(()=>{if(a!==void 0)return e.setState(n,a),ud(e,[n],()=>{a!==void 0&&e.setState(n,a)})})}function _u(e,t){const[n,r]=H.useState(()=>e(t));Et(()=>Cu(n),[n]);const a=H.useCallback(c=>pr(n,c),[n]),o=H.useMemo(()=>je(he({},n),{useState:a}),[n,a]),i=Ye(()=>{r(c=>e(he(he({},t),c.getState())))});return[o,i]}function zk(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Zk(e){const t=e.map((r,a)=>[a,r]);let n=!1;return t.sort(([r,a],[o,i])=>{const c=a.element,u=i.element;return c===u||!c||!u?0:zk(c,u)?(r>o&&(n=!0),-1):(r<o&&(n=!0),1)}),n?t.map(([r,a])=>a):e}function Gk(e){var t;const n=e.find(o=>!!o.element),r=[...e].reverse().find(o=>!!o.element);let a=(t=n==null?void 0:n.element)==null?void 0:t.parentElement;for(;a&&r!=null&&r.element;){if(r&&a.contains(r.element))return a;a=a.parentElement}return It(a).body}function Yk(e){return e==null?void 0:e.__unstablePrivateStore}function Kk(e={}){var t;bu(e,e.store);const n=(t=e.store)==null?void 0:t.getState(),r=St(e.items,n==null?void 0:n.items,e.defaultItems,[]),a=new Map(r.map(f=>[f.id,f])),o={items:r,renderedItems:St(n==null?void 0:n.renderedItems,[])},i=Yk(e.store),c=vr({items:r,renderedItems:o.renderedItems},i),u=vr(o,e.store),d=f=>{const y=Zk(f);c.setState("renderedItems",y),u.setState("renderedItems",y)};To(u,()=>Cu(c)),To(c,()=>ud(c,["items"],f=>{u.setState("items",f.items)})),To(c,()=>ud(c,["renderedItems"],f=>{let y=!0,g=requestAnimationFrame(()=>{const{renderedItems:_}=u.getState();f.renderedItems!==_&&d(f.renderedItems)});if(typeof IntersectionObserver!="function")return()=>cancelAnimationFrame(g);const m=()=>{if(y){y=!1;return}cancelAnimationFrame(g),g=requestAnimationFrame(()=>d(f.renderedItems))},b=Gk(f.renderedItems),w=new IntersectionObserver(m,{root:b});for(const _ of f.renderedItems)_.element&&w.observe(_.element);return()=>{cancelAnimationFrame(g),w.disconnect()}}));const h=(f,y,g=!1)=>{let m;return y(b=>{const w=b.findIndex(({id:x})=>x===f.id),_=b.slice();if(w!==-1){m=b[w];const x=Ht(Ht({},m),f);_[w]=x,a.set(f.id,x)}else _.push(f),a.set(f.id,f);return _}),()=>{y(b=>{if(!m)return g&&a.delete(f.id),b.filter(({id:x})=>x!==f.id);const w=b.findIndex(({id:x})=>x===f.id);if(w===-1)return b;const _=b.slice();return _[w]=m,a.set(f.id,m),_})}},p=f=>h(f,y=>c.setState("items",y),!0);return Gn(Ht({},u),{registerItem:p,renderItem:f=>Yn(p(f),h(f,y=>c.setState("renderedItems",y))),item:f=>{if(!f)return null;let y=a.get(f);if(!y){const{items:g}=u.getState();y=g.find(m=>m.id===f),y&&a.set(f,y)}return y||null},__unstablePrivateStore:c})}function Xk(e,t,n){return yu(t,[n.store]),lr(e,n,"items","setItems"),e}function rt(e){const t=H.forwardRef((n,r)=>e(je(he({},n),{ref:r})));return t.displayName=e.displayName||e.name,t}function Wo(e,t){return H.memo(e,t)}function ut(e,t){const n=t,{wrapElement:r,render:a}=n,o=mt(n,["wrapElement","render"]),i=Cn(t.ref,jk(a));let c;if(H.isValidElement(a)){const u=je(he({},a.props),{ref:i});c=H.cloneElement(a,kk(o,u))}else a?c=a(o):c=l.jsx(e,he({},o));return r?r(c):c}function gt(e){const t=(n={})=>e(n);return t.displayName=e.name,t}function Sa(e=[],t=[]){const n=H.createContext(void 0),r=H.createContext(void 0),a=()=>H.useContext(n),o=(u=!1)=>{const d=H.useContext(r),h=a();return u?d:d||h},i=()=>{const u=H.useContext(r),d=a();if(!(u&&u===d))return d},c=u=>e.reduceRight((d,h)=>l.jsx(h,je(he({},u),{children:d})),l.jsx(n.Provider,he({},u)));return{context:n,scopedContext:r,useContext:a,useScopedContext:o,useProviderContext:i,ContextProvider:c,ScopedContextProvider:u=>l.jsx(c,je(he({},u),{children:t.reduceRight((d,h)=>l.jsx(h,je(he({},u),{children:d})),l.jsx(r.Provider,he({},u)))}))}}var _h=Sa(),Jk=_h.useContext,I5=_h.ContextProvider,M5=_h.ScopedContextProvider,Qk="div",yl=gt(function(e){var t=e,{store:n,shouldRegisterItem:r=!0,getItem:a=k5,element:o}=t,i=mt(t,["store","shouldRegisterItem","getItem","element"]);const c=Jk();n=n||c;const u=lo(i.id),d=C.useRef(o);return C.useEffect(()=>{const h=d.current;if(!u||!h||!r)return;const p=a({id:u,element:h});return n==null?void 0:n.renderItem(p)},[u,r,a,n]),i=je(he({},i),{ref:Cn(d,i.ref)}),Ii(i)});rt(function(e){const t=yl(e);return ut(Qk,t)});var B5=C.createContext(!0),xh="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function eE(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Qr(e){return!(!e.matches(xh)||!E5(e)||e.closest("[inert]"))}function Vc(e){if(!Qr(e)||eE(e))return!1;if(!("form"in e)||!e.form||e.checked||e.type!=="radio")return!0;const t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;const n=so(e);return!n||n===e||!("form"in n)||n.form!==e.form||n.name!==e.name}function wh(e,t){const n=Array.from(e.querySelectorAll(xh));t&&n.unshift(e);const r=n.filter(Qr);return r.forEach((a,o)=>{if(gh(a)&&a.contentDocument){const i=a.contentDocument.body;r.splice(o,1,...wh(i))}}),r}function xu(e,t,n){const r=Array.from(e.querySelectorAll(xh)),a=r.filter(Vc);return t&&Vc(e)&&a.unshift(e),a.forEach((o,i)=>{if(gh(o)&&o.contentDocument){const c=o.contentDocument.body,u=xu(c,!1,n);a.splice(i,1,...u)}}),!a.length&&n?r:a}function F5(e,t,n){const[r]=xu(e,t,n);return r||null}function tE(e,t,n,r){const a=so(e),o=wh(e,t),i=o.indexOf(a);return o.slice(i+1).find(Vc)||null||null||null}function r1(e,t){return tE(document.body,!1)}function nE(e,t,n,r){const a=so(e),o=wh(e,t).reverse(),i=o.indexOf(a);return o.slice(i+1).find(Vc)||null||null||null}function zp(e,t){return nE(document.body,!1)}function Zp(e){const t=so(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return n?n===e.id:!1}function H5(e){const t=so(e);if(!t)return!1;if(Xt(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!n||!("id"in e)?!1:n===e.id?!0:!!e.querySelector(`#${CSS.escape(n)}`)}function $5(e){!H5(e)&&Qr(e)&&e.focus()}function rE(e){var t;const n=(t=e.getAttribute("tabindex"))!=null?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}function aE(e,t){const n=xu(e,t);for(const r of n)rE(r)}function oE(e){const t=e.querySelectorAll("[data-tabindex]"),n=r=>{const a=r.getAttribute("data-tabindex");r.removeAttribute("data-tabindex"),a?r.setAttribute("tabindex",a):r.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e);for(const r of t)n(r)}var iE="div",Gp=vh(),sE=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"];function lE(e){const{tagName:t,readOnly:n,type:r}=e;return t==="TEXTAREA"&&!n||t==="SELECT"&&!n?!0:t==="INPUT"&&!n?sE.includes(r):!!(e.isContentEditable||e.getAttribute("role")==="combobox"&&e.dataset.name)}function cE(e){return"labels"in e?e.labels:null}function Yp(e){return e.tagName.toLowerCase()==="input"&&e.type?e.type==="radio"||e.type==="checkbox":!1}function uE(e){return e?e==="button"||e==="summary"||e==="input"||e==="select"||e==="textarea"||e==="a":!0}function dE(e){return e?e==="button"||e==="input"||e==="select"||e==="textarea":!0}function hE(e,t,n,r,a){return e?t?n&&!r?-1:void 0:n?a:a||0:a}function a1(e,t){return Ye(n=>{e==null||e(n),!n.defaultPrevented&&t&&(n.stopPropagation(),n.preventDefault())})}var Sh=!0;function fE(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(Sh=!1))}function pE(e){e.metaKey||e.ctrlKey||e.altKey||(Sh=!0)}var Cl=gt(function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:r,autoFocus:a,onFocusVisible:o}=t,i=mt(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const c=C.useRef(null);C.useEffect(()=>{n&&(gn("mousedown",fE,!0),gn("keydown",pE,!0))},[n]),Gp&&C.useEffect(()=>{if(!n)return;const G=c.current;if(!G||!Yp(G))return;const Q=cE(G);if(!Q)return;const oe=()=>queueMicrotask(()=>G.focus());for(const le of Q)le.addEventListener("mouseup",oe);return()=>{for(const le of Q)le.removeEventListener("mouseup",oe)}},[n]);const u=n&&vl(i),d=!!u&&!r,[h,p]=C.useState(!1);C.useEffect(()=>{n&&d&&h&&p(!1)},[n,d,h]),C.useEffect(()=>{if(!n||!h)return;const G=c.current;if(!G||typeof IntersectionObserver>"u")return;const Q=new IntersectionObserver(()=>{Qr(G)||p(!1)});return Q.observe(G),()=>Q.disconnect()},[n,h]);const f=a1(i.onKeyPressCapture,u),y=a1(i.onMouseDownCapture,u),g=a1(i.onClickCapture,u),m=i.onMouseDown,b=Ye(G=>{if(m==null||m(G),G.defaultPrevented||!n)return;const Q=G.currentTarget;if(!Gp||P5(G)||!Ca(Q)&&!Yp(Q))return;let oe=!1;const le=()=>{oe=!0},de={capture:!0,once:!0};Q.addEventListener("focusin",le,de),ws(Q,"mouseup",()=>{Q.removeEventListener("focusin",le,!0),!oe&&$5(Q)})}),w=(G,Q)=>{if(Q&&(G.currentTarget=Q),!n)return;const oe=G.currentTarget;oe&&Zp(oe)&&(o==null||o(G),!G.defaultPrevented&&p(!0))},_=i.onKeyDownCapture,x=Ye(G=>{if(_==null||_(G),G.defaultPrevented||!n||h||G.metaKey||G.altKey||G.ctrlKey||!Si(G))return;const Q=G.currentTarget;ws(Q,"focusout",()=>w(G,Q))}),j=i.onFocusCapture,k=Ye(G=>{if(j==null||j(G),G.defaultPrevented||!n)return;if(!Si(G)){p(!1);return}const Q=G.currentTarget,oe=()=>w(G,Q);Sh||lE(G.target)?ws(G.target,"focusout",oe):p(!1)}),L=i.onBlur,D=Ye(G=>{L==null||L(G),n&&ui(G)&&p(!1)}),S=C.useContext(B5),T=Ye(G=>{n&&a&&G&&S&&queueMicrotask(()=>{Zp(G)||Qr(G)&&G.focus()})}),I=Bi(c),A=n&&uE(I),U=n&&dE(I),K=i.style,X=C.useMemo(()=>d?he({pointerEvents:"none"},K):K,[d,K]);return i=je(he({"data-focus-visible":n&&h||void 0,"data-autofocus":a||void 0,"aria-disabled":u||void 0},i),{ref:Cn(c,T,i.ref),style:X,tabIndex:hE(n,d,A,U,i.tabIndex),disabled:U&&d?!0:void 0,contentEditable:u?void 0:i.contentEditable,onKeyPressCapture:f,onClickCapture:g,onMouseDownCapture:y,onMouseDown:b,onKeyDownCapture:x,onFocusCapture:k,onBlur:D}),Ii(i)});rt(function(e){const t=Cl(e);return ut(iE,t)});var mE="button";function Kp(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return e.key==="Enter"?Ca(t)||t.tagName==="SUMMARY"||t.tagName==="A":e.key===" "?Ca(t)||t.tagName==="SUMMARY"||t.tagName==="INPUT"||t.tagName==="SELECT":!1}var gE=Symbol("command"),jh=gt(function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:r=!0}=t,a=mt(t,["clickOnEnter","clickOnSpace"]);const o=C.useRef(null),i=Bi(o),c=a.type,[u,d]=C.useState(()=>!!i&&Ca({tagName:i,type:c}));C.useEffect(()=>{o.current&&d(Ca(o.current))},[]);const[h,p]=C.useState(!1),f=C.useRef(!1),y=vl(a),[g,m]=Ik(a,gE,!0),b=a.onKeyDown,w=Ye(j=>{b==null||b(j);const k=j.currentTarget;if(j.defaultPrevented||g||y||!Si(j)||Uo(k)||k.isContentEditable)return;const L=n&&j.key==="Enter",D=r&&j.key===" ",S=j.key==="Enter"&&!n,T=j.key===" "&&!r;if(S||T){j.preventDefault();return}if(L||D){const I=Kp(j);if(L){if(!I){j.preventDefault();const A=j,U=mt(A,["view"]),K=()=>Bp(k,U);Rk()?ws(k,"keyup",K):queueMicrotask(K)}}else D&&(f.current=!0,I||(j.preventDefault(),p(!0)))}}),_=a.onKeyUp,x=Ye(j=>{if(_==null||_(j),j.defaultPrevented||g||y||j.metaKey)return;const k=r&&j.key===" ";if(f.current&&k&&(f.current=!1,!Kp(j))){j.preventDefault(),p(!1);const L=j.currentTarget,D=j,S=mt(D,["view"]);queueMicrotask(()=>Bp(L,S))}});return a=je(he(he({"data-active":h||void 0,type:u?"button":void 0},m),a),{ref:Cn(o,a.ref),onKeyDown:w,onKeyUp:x}),a=Cl(a),a});rt(function(e){const t=jh(e);return ut(mE,t)});var V5="button",kh=gt(function(e){const t=C.useRef(null),n=Bi(t,V5),[r,a]=C.useState(()=>!!n&&Ca({tagName:n,type:e.type}));return C.useEffect(()=>{t.current&&a(Ca(t.current))},[]),e=je(he({role:!r&&n!=="a"?"button":void 0},e),{ref:Cn(t,e.ref)}),e=jh(e),e});rt(function(e){const t=kh(e);return ut(V5,t)});function Xp(){return new Promise(e=>requestAnimationFrame(()=>e()))}function fc(e){return Object.keys(e).some(t=>Hc(e[t])?fc(e[t]):!!e[t])}function ha(e,t,n){var r;const[a,...o]=Array.isArray(t)?t:`${t}`.split(".");return a==null||!e?n:o.length?ha(e[a],o,n):(r=e[a])!=null?r:n}function di(e,t,n){const[r,...a]=Array.isArray(t)?t:`${t}`.split(".");if(r==null)return e;const o=r,i=Ck(o),c=(i?e||[]:e||{})[o],u=a.length&&(Array.isArray(c)||Hc(c))?di(c,a,n):n;if(i){const d=Number(o);if(e&&Array.isArray(e))return[...e.slice(0,d),u,...e.slice(d+1)];const h=[];return h[d]=u,h}return Gn(Ht({},e),{[o]:u})}function hd(e,t){const n={},r=Object.keys(e);for(const a of r){const o=e[a];Array.isArray(o)?n[a]=o.map(i=>Hc(i)?hd(i,t):t):Hc(o)?n[a]=hd(o,t):n[a]=t}return n}function U5(e,t=[]){return{get(n,r){if(["toString","valueOf",Symbol.toPrimitive].includes(r))return()=>t.join(".");const a=[...t,r],o=a.join(".");if(e[o])return e[o];const i=new Proxy(n,U5(e,a));return e[o]=i,i}}}function vE(e){return e==null?void 0:e.__unstableCallbacks}function yE(){const e=Object.create(null);return new Proxy(Object.create(null),U5(e))}function CE(e={}){var t;bu(e,e.store);const n=(t=e.store)==null?void 0:t.getState(),r=Kk(e),a=St(e.values,n==null?void 0:n.values,e.defaultValues,{}),o=St(e.errors,n==null?void 0:n.errors,e.defaultErrors,{}),i=St(e.touched,n==null?void 0:n.touched,e.defaultTouched,{}),c=Gn(Ht({},r.getState()),{values:a,errors:o,touched:i,validating:St(n==null?void 0:n.validating,!1),submitting:St(n==null?void 0:n.submitting,!1),submitSucceed:St(n==null?void 0:n.submitSucceed,0),submitFailed:St(n==null?void 0:n.submitFailed,0),valid:!fc(o)}),u=vr(c,r,e.store),d=vE(e.store),h=d==null?void 0:d.getState(),p={validate:(h==null?void 0:h.validate)||[],submit:(h==null?void 0:h.submit)||[]},f=vr(p,d);To(u,()=>Cu(f));const y=async()=>{u.setState("validating",!0),u.setState("errors",{});const g=f.getState().validate;try{for(const m of g)await m(u.getState());return await Xp(),!fc(u.getState().errors)}finally{u.setState("validating",!1)}};return Gn(Ht(Ht({},r),u),{names:yE(),setValues:g=>u.setState("values",g),getValue:g=>ha(u.getState().values,g),setValue:(g,m)=>u.setState("values",b=>{const w=ha(b,g),_=hc(m,w);return _===w?b:di(b,g,_)}),pushValue:(g,m)=>u.setState("values",b=>{const w=ha(b,g,[]);return di(b,g,[...w,m])}),removeValue:(g,m)=>u.setState("values",b=>{const w=ha(b,g,[]);return di(b,g,[...w.slice(0,m),null,...w.slice(m+1)])}),setErrors:g=>u.setState("errors",g),getError:g=>ha(u.getState().errors,g),setError:(g,m)=>u.setState("errors",b=>{const w=ha(b,g),_=hc(m,w);return _===w?b:di(b,g,_)}),setTouched:g=>u.setState("touched",g),getFieldTouched:g=>!!ha(u.getState().touched,g),setFieldTouched:(g,m)=>u.setState("touched",b=>{const w=ha(b,g),_=hc(m,w);return _===w?b:di(b,g,_)}),onValidate:g=>(f.setState("validate",m=>[...m,g]),()=>{f.setState("validate",m=>m.filter(b=>b!==g))}),validate:y,onSubmit:g=>(f.setState("submit",m=>[...m,g]),()=>{f.setState("submit",m=>m.filter(b=>b!==g))}),submit:async()=>{u.setState("submitting",!0),u.setState("touched",hd(u.getState().values,!0));try{if(await y()){const g=f.getState().submit;for(const m of g)await m(u.getState());if(await Xp(),!fc(u.getState().errors))return u.setState("submitSucceed",m=>m+1),!0}return u.setState("submitFailed",g=>g+1),!1}catch(g){throw u.setState("submitFailed",m=>m+1),g}finally{u.setState("submitting",!1)}},reset:()=>{u.setState("values",a),u.setState("errors",o),u.setState("touched",i),u.setState("validating",!1),u.setState("submitting",!1),u.setState("submitSucceed",0),u.setState("submitFailed",0)},__unstableCallbacks:f})}function bE(e,t,n){e=Xk(e,t,n),lr(e,n,"values","setValues"),lr(e,n,"errors","setErrors"),lr(e,n,"touched","setTouched");const r=C.useCallback(i=>e.useState(()=>e.getValue(i)),[e]),a=C.useCallback(i=>{i=Ye(i);const c=e.useState("items");C.useEffect(()=>e.onValidate(i),[c,i])},[e]),o=C.useCallback(i=>{i=Ye(i);const c=e.useState("items");C.useEffect(()=>e.onSubmit(i),[c,i])},[e]);return C.useMemo(()=>je(he({},e),{useValue:r,useValidate:a,useSubmit:o}),[])}function qo(e={}){const[t,n]=_u(CE,e);return bE(t,n,e)}var W5=Sa([I5],[M5]),zo=W5.useContext,_E=W5.ScopedContextProvider,q5="form";function xE(e,t){return t.some(n=>n.type==="field"&&n.element===e)}function wE(e){return e.find(t=>{var n;return t.type==="field"&&((n=t.element)==null?void 0:n.getAttribute("aria-invalid"))==="true"})}var SE=gt(function(e){var t=e,{store:n,validateOnChange:r=!0,validateOnBlur:a=!0,resetOnUnmount:o=!1,resetOnSubmit:i=!0,autoFocusOnSubmit:c=!0}=t,u=mt(t,["store","validateOnChange","validateOnBlur","resetOnUnmount","resetOnSubmit","autoFocusOnSubmit"]);const d=zo();n=n||d,$n(n,process.env.NODE_ENV!=="production"&&"Form must receive a `store` prop or be wrapped in a FormProvider component.");const h=C.useRef(null),p=n.useState("values"),f=n.useState("submitSucceed"),y=n.useState("submitFailed"),g=n.useState("items"),m=Ok(p);C.useEffect(()=>o?n==null?void 0:n.reset:void 0,[o,n]),yu(()=>{r&&p!==m&&(n==null||n.validate())},[r,p,m,n]),C.useEffect(()=>{i&&f&&(n==null||n.reset())},[i,f,n]);const[b,w]=C.useState(!1);C.useEffect(()=>{if(!b||!y)return;const T=wE(g),I=T==null?void 0:T.element;I&&(w(!1),I.focus(),Uo(I)&&I.select())},[c,y,g]);const _=u.onSubmit,x=Ye(T=>{_==null||_(T),!T.defaultPrevented&&(T.preventDefault(),n==null||n.submit(),c&&w(!0))}),j=u.onBlur,k=Ye(T=>{j==null||j(T),!T.defaultPrevented&&a&&n&&xE(T.target,n.getState().items)&&n.validate()}),L=u.onReset,D=Ye(T=>{L==null||L(T),!T.defaultPrevented&&(T.preventDefault(),n==null||n.reset())});u=qn(u,T=>l.jsx(_E,{value:n,children:T}),[n]);const S=Bi(h,q5);return u=je(he({role:S!=="form"?"form":void 0,noValidate:!0},u),{ref:Cn(h,u.ref),onSubmit:x,onBlur:k,onReset:D}),u}),Zo=rt(function(e){const t=SE(e);return ut(q5,t)}),jE="input";function kE(e,t){const n=e.current;return n?n.name===t?n:n.form?n.form.elements.namedItem(t):It(n).getElementsByName(t)[0]:null}function o1(e,t,n){return e.useState(r=>r.items.find(a=>a.type===n&&a.name===t))}var Eh=gt(function(e){var t=e,{store:n,name:r,getItem:a,touchOnBlur:o=!0}=t,i=mt(t,["store","name","getItem","touchOnBlur"]);const c=zo();n=n||c,$n(n,process.env.NODE_ENV!=="production"&&"FormControl must be wrapped in a Form component.");const u=`${r}`,d=lo(i.id),h=C.useRef(null);n.useValidate(async()=>{const j=kE(h,u);j&&(await Promise.resolve(),"validity"in j&&!j.validity.valid&&(n==null||n.setError(u,j.validationMessage)))});const p=C.useCallback(j=>{const k=je(he({},j),{id:d||j.id,name:u,type:"field"});return a?a(k):k},[d,u,a]),f=i.onBlur,y=ga(o),g=Ye(j=>{f==null||f(j),!j.defaultPrevented&&y(j)&&(n==null||n.setFieldTouched(u,!0))}),m=o1(n,u,"label"),b=o1(n,u,"error"),w=o1(n,u,"description"),_=bk(b==null?void 0:b.id,w==null?void 0:w.id,i["aria-describedby"]),x=n.useState(()=>!!(n!=null&&n.getError(u))&&n.getFieldTouched(u));return i=je(he({id:d,"aria-labelledby":m==null?void 0:m.id,"aria-invalid":x},i),{"aria-describedby":_||void 0,ref:Cn(h,i.ref),onBlur:g}),i=yl(je(he({store:n},i),{name:u,getItem:p})),i}),EE=Wo(rt(function(e){const t=Eh(e);return ut(jE,t)})),NE="div",TE=gt(function(e){var t=e,{store:n,name:r,getItem:a}=t,o=mt(t,["store","name","getItem"]);const i=zo();n=n||i,$n(n,process.env.NODE_ENV!=="production"&&"FormError must be wrapped in a Form component.");const c=lo(o.id),u=C.useRef(null),d=`${r}`,h=C.useCallback(f=>{const y=je(he({},f),{id:c||f.id,name:d,type:"error"});return a?a(y):y},[c,d,a]),p=n.useState(()=>{const f=n==null?void 0:n.getError(d);if(f!=null&&n!=null&&n.getFieldTouched(d))return f});return o=je(he({id:c,role:"alert",children:p},o),{ref:Cn(u,o.ref)}),o=yl(je(he({store:n},o),{getItem:h})),o}),Xa=Wo(rt(function(e){const t=TE(e);return ut(NE,t)})),PE=C.createContext(void 0),LE="div",z5=gt(function(e){const[t,n]=C.useState();return e=qn(e,r=>l.jsx(PE.Provider,{value:n,children:r}),[]),e=he({role:"group","aria-labelledby":t},e),Ii(e)});rt(function(e){const t=z5(e);return ut(LE,t)});var AE="div",Z5=gt(function(e){var t=e,n=mt(t,["store"]);return n=z5(n),n});rt(function(e){const t=Z5(e);return ut(AE,t)});var RE="input",DE=gt(function(e){var t=e,{store:n,name:r}=t,a=mt(t,["store","name"]);const o=zo();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"FormInput must be wrapped in a Form component.");const i=`${r}`,c=a.onChange,u=Ye(h=>{c==null||c(h),!h.defaultPrevented&&(n==null||n.setValue(i,h.target.value))}),d=n.useValue(i);return a=je(he({value:d},a),{onChange:u}),a=Cl(a),a=Eh(he({store:n,name:i},a)),a}),Hi=Wo(rt(function(e){const t=DE(e);return ut(RE,t)})),OE="label";function IE(e){return e==="input"||e==="textarea"||e==="select"||e==="meter"||e==="progress"}var ME=gt(function(e){var t=e,{store:n,name:r,getItem:a}=t,o=mt(t,["store","name","getItem"]);const i=zo();n=n||i,$n(n,process.env.NODE_ENV!=="production"&&"FormLabel must be wrapped in a Form component.");const c=lo(o.id),u=C.useRef(null),d=`${r}`,h=C.useCallback(b=>{const w=je(he({},b),{id:c||b.id,name:d,type:"label"});return a?a(w):w},[c,d,a]),p=n.useState(b=>b.items.find(w=>w.type==="field"&&w.name===d)),f=Bi(p==null?void 0:p.element,"input"),y=IE(f),g=o.onClick,m=Ye(b=>{if(g==null||g(b),b.defaultPrevented||y)return;const w=p==null?void 0:p.element;w&&queueMicrotask(()=>{const _=F5(w,!0,!0);_==null||_.focus(),(_==null?void 0:_.getAttribute("role"))!=="combobox"&&(_==null||_.click())})});return o=je(he({id:c,render:y?l.jsx("label",{}):l.jsx("span",{}),htmlFor:y?p==null?void 0:p.id:void 0},o),{ref:Cn(u,o.ref),onClick:m}),y||(o=je(he({},o),{style:he({cursor:"default"},o.style)})),o=yl(je(he({store:n},o),{getItem:h})),o}),bl=Wo(rt(function(e){const t=ME(e);return ut(OE,t)})),BE="div",FE=gt(function(e){var t=e,n=mt(t,["store"]);return n=he({role:"radiogroup"},n),n=Z5(n),n}),HE=rt(function(e){const t=FE(e);return ut(BE,t)}),Nh=Sa([I5],[M5]),$E=Nh.useContext,VE=Nh.ContextProvider,UE=Nh.ScopedContextProvider,WE=C.createContext(void 0),qE=C.createContext(void 0),zE=Sa([VE],[UE]),ZE=zE.useContext;function GE(e,t){return t&&e.item(t)||null}function YE(e,t=!1){if(Uo(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=It(e).getSelection();n==null||n.selectAllChildren(e),t&&(n==null||n.collapseToEnd())}}var KE=Symbol("FOCUS_SILENTLY");function XE(e){e[KE]=!0,e.focus({preventScroll:!0})}function G5(e,t,n){return!(!t||t===n||!e.item(t.id))}var JE="button";function QE(e){return cd(e)?!0:e.tagName==="INPUT"&&!Ca(e)}function eN(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),a=Math.max(n*.875,n-40)*1.5,o=t?n-a+r:a+r;return e.tagName==="HTML"?o+e.scrollTop:o}function tN(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function Jp(e,t,n,r=!1){var a;if(!t||!n)return;const{renderedItems:o}=t.getState(),i=N5(e);if(!i)return;const c=eN(i,r);let u,d;for(let h=0;h<o.length;h+=1){const p=u;if(u=n(h),!u)break;if(u===p)continue;const f=(a=GE(t,u))==null?void 0:a.element;if(!f)continue;const y=tN(f,r)-c,g=Math.abs(y);if(r&&y<=0||!r&&y>=0){d!==void 0&&d<g&&(u=p);break}d=g}return u}function nN(e,t){return Si(e)?!1:G5(t,e.target)}function rN(e,t){const n=t.role,[r,a]=C.useState(n);return Et(()=>{const o=e.current;o&&a(o.getAttribute("role")||n)},[n]),r}function aN(e){return e==="option"||e==="treeitem"}function oN(e){return e==="option"||e==="tab"||e==="treeitem"||e==="gridcell"||e==="row"||e==="columnheader"||e==="rowheader"}var Y5=gt(function(e){var t=e,{store:n,rowId:r,preventScrollOnKeyDown:a=!1,moveOnKeyPress:o=!0,tabbable:i=!1,getItem:c,"aria-setsize":u,"aria-posinset":d}=t,h=mt(t,["store","rowId","preventScrollOnKeyDown","moveOnKeyPress","tabbable","getItem","aria-setsize","aria-posinset"]);const p=$E();n=n||p;const f=lo(h.id),y=C.useRef(null),g=C.useContext(qE),m=pr(n,B=>{if(r)return r;if(B&&g!=null&&g.baseElement&&g.baseElement===B.baseElement)return g.id}),b=vl(h)&&!h.accessibleWhenDisabled,w=C.useCallback(B=>{const V=je(he({},B),{id:f||B.id,rowId:m,disabled:!!b});return c?c(V):V},[f,m,b,c]),_=h.onFocus,x=C.useRef(!1),j=Ye(B=>{if(_==null||_(B),B.defaultPrevented||P5(B)||!f||!n||nN(B,n))return;const{virtualFocus:V,baseElement:F}=n.getState();n.setActiveId(f),cd(B.currentTarget)&&YE(B.currentTarget),!(!V||!Si(B)||QE(B.currentTarget)||!(F!=null&&F.isConnected))&&(vh()&&B.currentTarget.hasAttribute("data-autofocus")&&B.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),x.current=!0,B.relatedTarget===F||G5(n,B.relatedTarget)?XE(F):F.focus())}),k=h.onBlurCapture,L=Ye(B=>{if(k==null||k(B),B.defaultPrevented)return;const V=n==null?void 0:n.getState();V!=null&&V.virtualFocus&&x.current&&(x.current=!1,B.preventDefault(),B.stopPropagation())}),D=h.onKeyDown,S=ga(a),T=ga(o),I=Ye(B=>{if(D==null||D(B),B.defaultPrevented||!Si(B)||!n)return;const{currentTarget:V}=B,F=n.getState(),W=n.item(f),J=!!(W!=null&&W.rowId),fe=F.orientation!=="horizontal",ee=F.orientation!=="vertical",re=()=>!!(J||ee||!F.baseElement||!Uo(F.baseElement)),se={ArrowUp:(J||fe)&&n.up,ArrowRight:(J||ee)&&n.next,ArrowDown:(J||fe)&&n.down,ArrowLeft:(J||ee)&&n.previous,Home:()=>{if(re())return!J||B.ctrlKey?n==null?void 0:n.first():n==null?void 0:n.previous(-1)},End:()=>{if(re())return!J||B.ctrlKey?n==null?void 0:n.last():n==null?void 0:n.next(-1)},PageUp:()=>Jp(V,n,n==null?void 0:n.up,!0),PageDown:()=>Jp(V,n,n==null?void 0:n.down)}[B.key];if(se){if(cd(V)){const ae=Lk(V),Oe=ee&&B.key==="ArrowLeft",q=ee&&B.key==="ArrowRight",Ce=fe&&B.key==="ArrowUp",xe=fe&&B.key==="ArrowDown";if(q||xe){const{length:Ae}=Pk(V);if(ae.end!==Ae)return}else if((Oe||Ce)&&ae.start!==0)return}const ge=se();if(S(B)||ge!==void 0){if(!T(B))return;B.preventDefault(),n.move(ge)}}}),A=pr(n,B=>(B==null?void 0:B.baseElement)||void 0),U=C.useMemo(()=>({id:f,baseElement:A}),[f,A]);h=qn(h,B=>l.jsx(WE.Provider,{value:U,children:B}),[U]);const K=pr(n,B=>!!B&&B.activeId===f),X=pr(n,"virtualFocus"),G=rN(y,h);let Q;K&&(aN(G)||X&&oN(G))&&(Q=!0);const oe=pr(n,B=>{if(u!=null)return u;if(B&&g!=null&&g.ariaSetSize&&g.baseElement===B.baseElement)return g.ariaSetSize}),le=pr(n,B=>{if(d!=null)return d;if(!B||!(g!=null&&g.ariaPosInSet)||g.baseElement!==B.baseElement)return;const V=B.renderedItems.filter(F=>F.rowId===m);return g.ariaPosInSet+V.findIndex(F=>F.id===f)}),de=pr(n,B=>B!=null&&B.renderedItems.length?B.virtualFocus?!1:i?!0:B.activeId===f:!0);return h=je(he({id:f,"aria-selected":Q,"data-active-item":K||void 0},h),{ref:Cn(y,h.ref),tabIndex:de?h.tabIndex:-1,onFocus:j,onBlurCapture:L,onKeyDown:I}),h=jh(h),h=yl(je(he({store:n},h),{getItem:w,shouldRegisterItem:f?h.shouldRegisterItem:!1})),Ii(je(he({},h),{"aria-setsize":oe,"aria-posinset":le}))});Wo(rt(function(e){const t=Y5(e);return ut(JE,t)}));var K5="input";function iN(e,t){if(t!==void 0)return e!=null&&t!=null?t===e:!!t}function sN(e,t){return e==="input"&&(!t||t==="radio")}var X5=gt(function(e){var t=e,{store:n,name:r,value:a,checked:o}=t,i=mt(t,["store","name","value","checked"]);const c=ZE();n=n||c;const u=lo(i.id),d=C.useRef(null),h=pr(n,L=>o??iN(a,L==null?void 0:L.value));C.useEffect(()=>{!u||!h||(n==null?void 0:n.getState().activeId)===u||n==null||n.setActiveId(u)},[n,h,u]);const p=i.onChange,f=Bi(d,K5),y=sN(f,i.type),g=vl(i),[m,b]=A5();C.useEffect(()=>{const L=d.current;L&&(y||(h!==void 0&&(L.checked=h),r!==void 0&&(L.name=r),a!==void 0&&(L.value=`${a}`)))},[m,y,h,r,a]);const w=Ye(L=>{if(g){L.preventDefault(),L.stopPropagation();return}y||(L.currentTarget.checked=!0,b()),p==null||p(L),!L.defaultPrevented&&(n==null||n.setValue(a))}),_=i.onClick,x=Ye(L=>{_==null||_(L),!L.defaultPrevented&&(y||w(L))}),j=i.onFocus,k=Ye(L=>{if(j==null||j(L),L.defaultPrevented||!y||!n)return;const{moves:D,activeId:S}=n.getState();D&&(u&&S!==u||w(L))});return i=je(he({id:u,role:y?void 0:"radio",type:y?"radio":void 0,"aria-checked":h},i),{ref:Cn(d,i.ref),onChange:w,onClick:x,onFocus:k}),i=Y5(he({store:n,clickOnEnter:!y},i)),Ii(he({name:y?r:void 0,value:y?a:void 0,checked:h},i))});Wo(rt(function(e){const t=X5(e);return ut(K5,t)}));var lN="input",cN=gt(function(e){var t=e,{store:n,name:r,value:a}=t,o=mt(t,["store","name","value"]);const i=zo();n=n||i,$n(n,process.env.NODE_ENV!=="production"&&"FormRadio must be wrapped in a Form component.");const c=`${r}`,u=o.onChange,d=Ye(f=>{u==null||u(f),!f.defaultPrevented&&(n==null||n.setValue(c,a))}),h=o.checked,p=n.useState(()=>h??(n==null?void 0:n.getValue(c))===a);return o=je(he({},o),{checked:p,onChange:d}),o=X5(he({value:a},o)),o=Eh(he({store:n,name:c,"aria-labelledby":void 0},o)),o}),uN=Wo(rt(function(e){const t=cN(e);return ut(lN,t)})),dN="button",hN=gt(function(e){var t=e,{store:n,accessibleWhenDisabled:r=!0}=t,a=mt(t,["store","accessibleWhenDisabled"]);const o=zo();return n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"FormSubmit must be wrapped in a Form component."),a=he({type:"submit",disabled:n.useState("submitting")},a),a=kh(je(he({},a),{accessibleWhenDisabled:r})),a}),$i=rt(function(e){const t=hN(e);return ut(dN,t)}),fN="span",J5=gt(function(e){return e=je(he({},e),{style:he({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)}),e});rt(function(e){const t=J5(e);return ut(fN,t)});var pN="span",mN=gt(function(e){return e=je(he({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:he({position:"fixed",top:0,left:0},e.style)}),e=J5(e),e}),$l=rt(function(e){const t=mN(e);return ut(pN,t)});function Q5(e={}){const t=O5(e.store,D5(e.disclosure,["contentElement","disclosureElement"]));bu(e,t);const n=t==null?void 0:t.getState(),r=St(e.open,n==null?void 0:n.open,e.defaultOpen,!1),a=St(e.animated,n==null?void 0:n.animated,!1),o={open:r,animated:a,animating:!!a&&r,mounted:r,contentElement:St(n==null?void 0:n.contentElement,null),disclosureElement:St(n==null?void 0:n.disclosureElement,null)},i=vr(o,t);return To(i,()=>Ka(i,["animated","animating"],c=>{c.animated||i.setState("animating",!1)})),To(i,()=>R5(i,["open"],()=>{i.getState().animated&&i.setState("animating",!0)})),To(i,()=>Ka(i,["open","animating"],c=>{i.setState("mounted",c.open||c.animating)})),Gn(Ht({},i),{disclosure:e.disclosure,setOpen:c=>i.setState("open",c),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",c=>!c),stopAnimation:()=>i.setState("animating",!1),setContentElement:c=>i.setState("contentElement",c),setDisclosureElement:c=>i.setState("disclosureElement",c)})}function e3(e,t,n){return yu(t,[n.store,n.disclosure]),lr(e,n,"open","setOpen"),lr(e,n,"mounted","setMounted"),lr(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}function gN(e={}){const[t,n]=_u(Q5,e);return e3(t,n,e)}var Th=Sa(),t3=Th.useProviderContext,vN=Th.ContextProvider,yN=Th.ScopedContextProvider,wu=Sa([vN],[yN]),CN=wu.useScopedContext,Ph=wu.useProviderContext,n3=wu.ContextProvider,Lh=wu.ScopedContextProvider,bN=C.createContext(void 0),_N=C.createContext(void 0),xN="div";function Qp(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function wN(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}function e0(...e){return e.join(", ").split(", ").reduce((t,n)=>{const r=n.endsWith("ms")?1:1e3,a=Number.parseFloat(n||"0s")*r;return a>t?a:t},0)}function r3(e,t,n){return!n&&t!==!1&&(!e||!!t)}var Ah=gt(function(e){var t=e,{store:n,alwaysVisible:r}=t,a=mt(t,["store","alwaysVisible"]);const o=t3();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component.");const i=C.useRef(null),c=lo(a.id),[u,d]=C.useState(null),h=n.useState("open"),p=n.useState("mounted"),f=n.useState("animated"),y=n.useState("contentElement"),g=pr(n.disclosure,"contentElement");Et(()=>{i.current&&(n==null||n.setContentElement(i.current))},[n]),Et(()=>{let _;return n==null||n.setState("animated",x=>(_=x,!0)),()=>{_!==void 0&&(n==null||n.setState("animated",_))}},[n]),Et(()=>{if(f){if(!(y!=null&&y.isConnected)){d(null);return}return wN(()=>{d(h?"enter":p?"leave":null)})}},[f,y,h,p]),Et(()=>{if(!n||!f)return;const _=()=>n==null?void 0:n.setState("animating",!1),x=()=>Sr.flushSync(_);if(!u||!y){_();return}if(u==="leave"&&h||u==="enter"&&!h)return;if(typeof f=="number")return Qp(f,x);const{transitionDuration:j,animationDuration:k,transitionDelay:L,animationDelay:D}=getComputedStyle(y),{transitionDuration:S="0",animationDuration:T="0",transitionDelay:I="0",animationDelay:A="0"}=g?getComputedStyle(g):{},U=e0(L,D,I,A),K=e0(j,k,S,T),X=U+K;if(!X){u==="enter"&&n.setState("animated",!1),_();return}const G=1e3/60,Q=Math.max(X-G,0);return Qp(Q,x)},[n,f,y,g,h,u]),a=qn(a,_=>l.jsx(Lh,{value:n,children:_}),[n]);const m=r3(p,a.hidden,r),b=a.style,w=C.useMemo(()=>m?je(he({},b),{display:"none"}):b,[m,b]);return a=je(he({id:c,"data-open":h||void 0,"data-enter":u==="enter"||void 0,"data-leave":u==="leave"||void 0,hidden:m},a),{ref:Cn(c?n.setContentElement:null,i,a.ref),style:w}),Ii(a)}),SN=rt(function(e){const t=Ah(e);return ut(xN,t)});rt(function(e){var t=e,{unmountOnHide:n}=t,r=mt(t,["unmountOnHide"]);const a=t3(),o=r.store||a;return pr(o,i=>!n||(i==null?void 0:i.mounted))===!1?null:l.jsx(SN,he({},r))});function a3(e={}){return Q5(e)}function o3(e,t,n){return e3(e,t,n)}function Vi(e={}){const[t,n]=_u(a3,e);return o3(t,n,e)}function i3(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return n==null?!1:n===""||n==="true"||!t.length?!0:t.some(r=>n===r)}var i1=new WeakMap;function _l(e,t,n){i1.has(e)||i1.set(e,new Map);const r=i1.get(e),a=r.get(t);if(!a)return r.set(t,n()),()=>{var c;(c=r.get(t))==null||c(),r.delete(t)};const o=n(),i=()=>{o(),a(),r.delete(t)};return r.set(t,i),()=>{r.get(t)===i&&(o(),r.set(t,a))}}function Rh(e,t,n){return _l(e,t,()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r==null?e.removeAttribute(t):e.setAttribute(t,r)}})}function Do(e,t,n){return _l(e,t,()=>{const r=t in e,a=e[t];return e[t]=n,()=>{r?e[t]=a:delete e[t]}})}function fd(e,t){return e?_l(e,"style",()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}):()=>{}}function jN(e,t,n){return e?_l(e,t,()=>{const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}):()=>{}}var kN=["SCRIPT","STYLE"];function pd(e){return`__ariakit-dialog-snapshot-${e}`}function EN(e,t){const n=It(t),r=pd(e);if(!n.body[r])return!0;do{if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}while(!0)}function NN(e,t,n){return kN.includes(t.tagName)||!EN(e,t)?!1:!n.some(r=>r&&Xt(t,r))}function Dh(e,t,n,r){for(let a of t){if(!(a!=null&&a.isConnected))continue;const o=t.some(u=>!u||u===a?!1:u.contains(a)),i=It(a),c=a;for(;a.parentElement&&a!==i.body;){if(r==null||r(a.parentElement,c),!o)for(const u of a.parentElement.children)NN(e,u,t)&&n(u,c);a=a.parentElement}}}function TN(e,t){const{body:n}=It(t[0]),r=[];return Dh(e,t,a=>{r.push(Do(a,pd(e),!0))}),Yn(Do(n,pd(e),!0),()=>{for(const a of r)a()})}function ji(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function PN(e,t=""){return Yn(Do(e,ji(),!0),Do(e,ji(t),!0))}function s3(e,t=""){return Yn(Do(e,ji("",!0),!0),Do(e,ji(t,!0),!0))}function Oh(e,t){const n=ji(t,!0);if(e[n])return!0;const r=ji(t);do{if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}while(!0)}function t0(e,t){const n=[],r=t.map(a=>a==null?void 0:a.id);return Dh(e,t,a=>{i3(a,...r)||n.unshift(PN(a,e))},(a,o)=>{o.hasAttribute("data-dialog")&&o.id!==e||n.unshift(s3(a,e))}),()=>{for(const a of n)a()}}var LN="div",AN=["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"];gt(function(e){return e});var md=rt(function(e){return ut(LN,e)});Object.assign(md,AN.reduce((e,t)=>(e[t]=rt(function(n){return ut(t,n)}),e),{}));function RN({store:e,backdrop:t,alwaysVisible:n,hidden:r}){const a=C.useRef(null),o=gN({disclosure:e}),i=e.useState("contentElement");Et(()=>{const d=a.current,h=i;d&&h&&(d.style.zIndex=getComputedStyle(h).zIndex)},[i]),Et(()=>{const d=i==null?void 0:i.id;if(!d)return;const h=a.current;if(h)return s3(h,d)},[i]);const c=Ah({ref:a,store:o,role:"presentation","data-backdrop":(i==null?void 0:i.id)||"",alwaysVisible:n,hidden:r??void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if(C.isValidElement(t))return l.jsx(md,je(he({},c),{render:t}));const u=typeof t!="boolean"?t:"div";return l.jsx(md,je(he({},c),{render:l.jsx(u,{})}))}function DN(e){return Rh(e,"aria-hidden","true")}function l3(){return"inert"in HTMLElement.prototype}function c3(e,t){if(!("style"in e))return dc;if(l3())return Do(e,"inert",!0);const n=xu(e,!0).map(r=>{if(t!=null&&t.some(o=>o&&Xt(o,r)))return dc;const a=_l(r,"focus",()=>(r.focus=dc,()=>{delete r.focus}));return Yn(Rh(r,"tabindex","-1"),a)});return Yn(...n,DN(e),fd(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ON(e,t){const n=[],r=t.map(a=>a==null?void 0:a.id);return Dh(e,t,a=>{i3(a,...r)||n.unshift(c3(a,t))},a=>{a.hasAttribute("role")&&(t.some(o=>o&&Xt(o,a))||n.unshift(Rh(a,"role","none")))}),()=>{for(const a of n)a()}}function IN({attribute:e,contentId:t,contentElement:n,enabled:r}){const[a,o]=A5(),i=C.useCallback(()=>{if(!r||!n)return!1;const{body:c}=It(n),u=c.getAttribute(e);return!u||u===t},[a,r,n,e,t]);return C.useEffect(()=>{if(!r||!t||!n)return;const{body:c}=It(n);if(i())return c.setAttribute(e,t),()=>c.removeAttribute(e);const u=new MutationObserver(()=>Sr.flushSync(o));return u.observe(c,{attributeFilter:[e]}),()=>u.disconnect()},[a,r,t,n,i,e]),i}function MN(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function BN(e,t,n){const r=IN({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});C.useEffect(()=>{if(!r()||!e)return;const a=It(e),o=Nk(e),{documentElement:i,body:c}=a,u=i.style.getPropertyValue("--scrollbar-width"),d=u?Number.parseInt(u):o.innerWidth-i.clientWidth,h=()=>jN(i,"--scrollbar-width",`${d}px`),p=MN(i),f=()=>fd(c,{overflow:"hidden",[p]:`${d}px`}),y=()=>{var m,b;const{scrollX:w,scrollY:_,visualViewport:x}=o,j=(m=x==null?void 0:x.offsetLeft)!=null?m:0,k=(b=x==null?void 0:x.offsetTop)!=null?b:0,L=fd(c,{position:"fixed",overflow:"hidden",top:`${-(_-Math.floor(k))}px`,left:`${-(w-Math.floor(j))}px`,right:"0",[p]:`${d}px`});return()=>{L(),process.env.NODE_ENV!=="test"&&o.scrollTo(w,_)}},g=T5()&&!Dk();return Yn(h(),g?y():f())},[r,e])}var n0=C.createContext({});function FN(e){const t=C.useContext(n0),[n,r]=C.useState([]),a=C.useCallback(i=>{var c;return r(u=>[...u,i]),Yn((c=t.add)==null?void 0:c.call(t,i),()=>{r(u=>u.filter(d=>d!==i))})},[t]);Et(()=>Ka(e,["open","contentElement"],i=>{var c;if(i.open&&i.contentElement)return(c=t.add)==null?void 0:c.call(t,e)}),[e,t]);const o=C.useMemo(()=>({store:e,add:a}),[e,a]);return{wrapElement:C.useCallback(i=>l.jsx(n0.Provider,{value:o,children:i}),[o]),nestedDialogs:n}}function HN(e){const t=C.useRef();return C.useEffect(()=>{if(!e){t.current=null;return}return gn("mousedown",n=>{t.current=n.target},!0)},[e]),t}function $N(e){return e.tagName==="HTML"?!0:Xt(It(e).body,e)}function VN(e,t){if(!e)return!1;if(Xt(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const r=It(e).getElementById(n);if(r)return Xt(e,r)}return!1}function UN(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function s1({store:e,type:t,listener:n,capture:r,domReady:a}){const o=Ye(n),i=e.useState("open"),c=C.useRef(!1);Et(()=>{if(!i||!a)return;const{contentElement:u}=e.getState();if(!u)return;const d=()=>{c.current=!0};return u.addEventListener("focusin",d,!0),()=>u.removeEventListener("focusin",d,!0)},[e,i,a]),C.useEffect(()=>i?gn(t,u=>{const{contentElement:d,disclosureElement:h}=e.getState(),p=u.target;!d||!p||!$N(p)||Xt(d,p)||VN(h,p)||p.hasAttribute("data-focus-trap")||UN(u,d)||c.current&&!Oh(p,d.id)||o(u)},r):void 0,[i,r])}function l1(e,t){return typeof e=="function"?e(t):!!e}function WN(e,t,n){const r=e.useState("open"),a=HN(r),o={store:e,domReady:n,capture:!0};s1(je(he({},o),{type:"click",listener:i=>{const{contentElement:c}=e.getState(),u=a.current;u&&E5(u)&&Oh(u,c==null?void 0:c.id)&&l1(t,i)&&e.hide()}})),s1(je(he({},o),{type:"focusin",listener:i=>{const{contentElement:c}=e.getState();c&&i.target!==It(c)&&l1(t,i)&&e.hide()}})),s1(je(he({},o),{type:"contextmenu",listener:i=>{l1(t,i)&&e.hide()}}))}function qN(e,t){const n=It(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}var zN="div",u3=gt(function(e){var t=e,{autoFocusOnShow:n=!0}=t,r=mt(t,["autoFocusOnShow"]);return r=qn(r,a=>l.jsx(B5.Provider,{value:n,children:a}),[n]),r});rt(function(e){const t=u3(e);return ut(zN,t)});var r0=C.createContext(0);function ZN({level:e,children:t}){const n=C.useContext(r0),r=Math.max(Math.min(e||n+1,6),1);return l.jsx(r0.Provider,{value:r,children:t})}var a0=C.createContext(null),GN="div";function YN(e){return It(e).body}function KN(e,t){return t?typeof t=="function"?t(e):t:It(e).createElement("div")}function XN(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).substr(2,6)}`}function Pa(e){queueMicrotask(()=>{e==null||e.focus()})}var d3=gt(function(e){var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:a,portalRef:o,portal:i=!0}=t,c=mt(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const u=C.useRef(null),d=Cn(u,c.ref),h=C.useContext(a0),[p,f]=C.useState(null),[y,g]=C.useState(null),m=C.useRef(null),b=C.useRef(null),w=C.useRef(null),_=C.useRef(null);return Et(()=>{const x=u.current;if(!x||!i){f(null);return}const j=KN(x,a);if(!j){f(null);return}const k=j.isConnected;if(k||(h||YN(x)).appendChild(j),j.id||(j.id=x.id?`portal/${x.id}`:XN()),f(j),ld(o,j),!k)return()=>{j.remove(),ld(o,null)}},[i,a,h,o]),Et(()=>{if(!i||!n||!r)return;const x=It(r).createElement("span");return x.style.position="fixed",r.insertAdjacentElement("afterend",x),g(x),()=>{x.remove(),g(null)}},[i,n,r]),C.useEffect(()=>{if(!p||!n)return;let x=0;const j=k=>{if(!ui(k))return;const L=k.type==="focusin";if(cancelAnimationFrame(x),L)return oE(p);x=requestAnimationFrame(()=>{aE(p,!0)})};return p.addEventListener("focusin",j,!0),p.addEventListener("focusout",j,!0),()=>{cancelAnimationFrame(x),p.removeEventListener("focusin",j,!0),p.removeEventListener("focusout",j,!0)}},[p,n]),c=qn(c,x=>{if(x=l.jsx(a0.Provider,{value:p||h,children:x}),!i)return x;if(!p)return l.jsx("span",{ref:d,id:c.id,style:{position:"fixed"},hidden:!0});x=l.jsxs(l.Fragment,{children:[n&&p&&l.jsx($l,{ref:b,className:"__focus-trap-inner-before",onFocus:k=>{ui(k,p)?Pa(r1()):Pa(m.current)}}),x,n&&p&&l.jsx($l,{ref:w,className:"__focus-trap-inner-after",onFocus:k=>{ui(k,p)?Pa(zp()):Pa(_.current)}})]}),p&&(x=Sr.createPortal(x,p));let j=l.jsxs(l.Fragment,{children:[n&&p&&l.jsx($l,{ref:m,className:"__focus-trap-outer-before",onFocus:k=>{k.relatedTarget!==_.current&&ui(k,p)?Pa(b.current):Pa(zp())}}),n&&l.jsx("span",{"aria-owns":p==null?void 0:p.id,style:{position:"fixed"}}),n&&p&&l.jsx($l,{ref:_,className:"__focus-trap-outer-after",onFocus:k=>{if(ui(k,p))Pa(w.current);else{const L=r1();if(L===b.current){requestAnimationFrame(()=>{var D;return(D=r1())==null?void 0:D.focus()});return}Pa(L)}}})]});return y&&n&&(j=Sr.createPortal(j,y)),l.jsxs(l.Fragment,{children:[j,x]})},[p,h,i,c.id,n,y]),c=je(he({},c),{ref:d}),c});rt(function(e){const t=d3(e);return ut(GN,t)});var JN="div",o0=vh();function QN(e){const t=so();return!t||e&&Xt(e,t)?!1:!!Qr(t)}function i0(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?Qr(n)?n:null:n:null}var h3=gt(function(e){var t=e,{store:n,open:r,onClose:a,focusable:o=!0,modal:i=!0,portal:c=!!i,backdrop:u=!!i,hideOnEscape:d=!0,hideOnInteractOutside:h=!0,getPersistentElements:p,preventBodyScroll:f=!!i,autoFocusOnShow:y=!0,autoFocusOnHide:g=!0,initialFocus:m,finalFocus:b,unmountOnHide:w,unstable_treeSnapshotKey:_}=t,x=mt(t,["store","open","onClose","focusable","modal","portal","backdrop","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide","unstable_treeSnapshotKey"]);const j=Ph(),k=C.useRef(null),L=Vi({store:n||j,open:r,setOpen(ue){if(ue)return;const Pe=k.current;if(!Pe)return;const Le=new Event("close",{bubbles:!1,cancelable:!0});a&&Pe.addEventListener("close",a,{once:!0}),Pe.dispatchEvent(Le),Le.defaultPrevented&&L.setOpen(!0)}}),{portalRef:D,domReady:S}=Ch(c,x.portalRef),T=x.preserveTabOrder,I=L.useState(ue=>T&&!i&&ue.mounted),A=lo(x.id),U=L.useState("open"),K=L.useState("mounted"),X=L.useState("contentElement"),G=r3(K,x.hidden,x.alwaysVisible);BN(X,A,f&&!G),WN(L,h,S);const{wrapElement:Q,nestedDialogs:oe}=FN(L);x=qn(x,Q,[Q]),Et(()=>{if(!U)return;const ue=k.current,Pe=so(ue,!0);Pe&&Pe.tagName!=="BODY"&&(ue&&Xt(ue,Pe)||L.setDisclosureElement(Pe))},[L,U]),o0&&C.useEffect(()=>{if(!K)return;const{disclosureElement:ue}=L.getState();if(!ue||!Ca(ue))return;const Pe=()=>{let Le=!1;const Ne=()=>{Le=!0},dt={capture:!0,once:!0};ue.addEventListener("focusin",Ne,dt),ws(ue,"mouseup",()=>{ue.removeEventListener("focusin",Ne,!0),!Le&&$5(ue)})};return ue.addEventListener("mousedown",Pe),()=>{ue.removeEventListener("mousedown",Pe)}},[L,K]),C.useEffect(()=>{if(!i||!K||!S)return;const ue=k.current;if(!(!ue||ue.querySelector("[data-dialog-dismiss]")))return qN(ue,L.hide)},[L,i,K,S]),Et(()=>{if(!l3()||U||!K||!S)return;const ue=k.current;if(ue)return c3(ue)},[U,K,S]);const le=U&&S;Et(()=>{if(!A||!le)return;const ue=k.current;return TN(A,[ue])},[A,le,_]);const de=Ye(p);Et(()=>{if(!A||!le)return;const{disclosureElement:ue}=L.getState(),Pe=k.current,Le=de()||[],Ne=[Pe,...Le,...oe.map(dt=>dt.getState().contentElement)];return i?Yn(t0(A,Ne),ON(A,Ne)):t0(A,[ue,...Ne])},[A,L,le,de,oe,i,_]);const B=!!y,V=ga(y),[F,W]=C.useState(!1);C.useEffect(()=>{if(!U||!B||!S||!(X!=null&&X.isConnected))return;const ue=i0(m,!0)||X.querySelector("[data-autofocus=true],[autofocus]")||F5(X,!0,c&&I)||X,Pe=Qr(ue);V(Pe?ue:null)&&(W(!0),queueMicrotask(()=>{ue.focus(),o0&&ue.scrollIntoView({block:"nearest",inline:"nearest"})}))},[U,B,S,X,m,c,I,V]);const J=!!g,fe=ga(g),[ee,re]=C.useState(!1);C.useEffect(()=>{if(U)return re(!0),()=>re(!1)},[U]);const se=C.useCallback((ue,Pe=!0)=>{const{disclosureElement:Le}=L.getState();if(QN(ue))return;let Ne=i0(b)||Le;if(Ne!=null&&Ne.id){const st=It(Ne),_t=`[aria-activedescendant="${Ne.id}"]`,Nt=st.querySelector(_t);Nt&&(Ne=Nt)}if(Ne&&!Qr(Ne)){const st=Ne.closest("[data-dialog]");if(st!=null&&st.id){const _t=It(st),Nt=`[aria-controls~="${st.id}"]`,Mt=_t.querySelector(Nt);Mt&&(Ne=Mt)}}const dt=Ne&&Qr(Ne);if(!dt&&Pe){requestAnimationFrame(()=>se(ue,!1));return}fe(dt?Ne:null)&&dt&&(Ne==null||Ne.focus())},[L,b,fe]),ge=C.useRef(!1);Et(()=>{if(U||!ee||!J)return;const ue=k.current;ge.current=!0,se(ue)},[U,ee,S,J,se]),C.useEffect(()=>{if(!ee||!J)return;const ue=k.current;return()=>{if(ge.current){ge.current=!1;return}se(ue)}},[ee,J,se]);const ae=ga(d);C.useEffect(()=>!S||!K?void 0:gn("keydown",ue=>{if(ue.key!=="Escape"||ue.defaultPrevented)return;const Pe=k.current;if(!Pe||Oh(Pe))return;const Le=ue.target;if(!Le)return;const{disclosureElement:Ne}=L.getState();(Le.tagName==="BODY"||Xt(Pe,Le)||!Ne||Xt(Ne,Le))&&ae(ue)&&L.hide()},!0),[L,S,K,ae]),x=qn(x,ue=>l.jsx(ZN,{level:i?1:void 0,children:ue}),[i]);const Oe=x.hidden,q=x.alwaysVisible;x=qn(x,ue=>u?l.jsxs(l.Fragment,{children:[l.jsx(RN,{store:L,backdrop:u,hidden:Oe,alwaysVisible:q}),ue]}):ue,[L,u,Oe,q]);const[Ce,xe]=C.useState(),[Ae,Be]=C.useState();return x=qn(x,ue=>l.jsx(Lh,{value:L,children:l.jsx(bN.Provider,{value:xe,children:l.jsx(_N.Provider,{value:Be,children:ue})})}),[L]),x=je(he({id:A,"data-dialog":"",role:"dialog",tabIndex:o?-1:void 0,"aria-labelledby":Ce,"aria-describedby":Ae},x),{ref:Cn(k,x.ref)}),x=u3(je(he({},x),{autoFocusOnShow:F})),x=Ah(he({store:L},x)),x=Cl(je(he({},x),{focusable:o})),x=d3(je(he({portal:c},x),{portalRef:D,preserveTabOrder:I})),x});function Su(e,t=Ph){return rt(function(n){const r=t(),a=n.store||r;return pr(a,o=>!n.unmountOnHide||(o==null?void 0:o.mounted)||!!n.open)?l.jsx(e,he({},n)):null})}var eT=Su(rt(function(e){const t=h3(e);return ut(JN,t)}),Ph);function tT(e={}){const t=Vi(e);return l.jsx(n3,{value:t,children:e.children})}var nT="button",rT=gt(function(e){var t=e,{store:n}=t,r=mt(t,["store"]);const a=CN();n=n||a;const o=r.onClick,i=Ye(u=>{o==null||o(u),!u.defaultPrevented&&(n==null||n.hide())}),c=C.useMemo(()=>l.jsxs("svg",{"aria-label":"Dismiss popup",display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:[l.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),l.jsx("line",{x1:"4",y1:"12",x2:"12",y2:"4"})]}),[]);return r=je(he({"data-dialog-dismiss":"",children:c},r),{onClick:i}),r=kh(r),r}),f3=rt(function(e){const t=rT(e);return ut(nT,t)});function aT(e={}){var t=e,{popover:n}=t,r=gk(t,["popover"]);const a=O5(r.store,D5(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));bu(r,a);const o=a==null?void 0:a.getState(),i=a3(Gn(Ht({},r),{store:a})),c=St(r.placement,o==null?void 0:o.placement,"bottom"),u=Gn(Ht({},i.getState()),{placement:c,currentPlacement:c,anchorElement:St(o==null?void 0:o.anchorElement,null),popoverElement:St(o==null?void 0:o.popoverElement,null),arrowElement:St(o==null?void 0:o.arrowElement,null),rendered:Symbol("rendered")}),d=vr(u,i,a);return Gn(Ht(Ht({},i),d),{setAnchorElement:h=>d.setState("anchorElement",h),setPopoverElement:h=>d.setState("popoverElement",h),setArrowElement:h=>d.setState("arrowElement",h),render:()=>d.setState("rendered",Symbol("rendered"))})}function oT(e,t,n){return yu(t,[n.popover]),lr(e,n,"placement"),o3(e,t,n)}var Ih=Sa([n3],[Lh]),p3=Ih.useProviderContext,iT=Ih.ContextProvider,m3=Ih.ScopedContextProvider;const Kr=Math.min,ar=Math.max,Uc=Math.round,Vl=Math.floor,Ja=e=>({x:e,y:e}),sT={left:"right",right:"left",bottom:"top",top:"bottom"},lT={start:"end",end:"start"};function gd(e,t,n){return ar(e,Kr(t,n))}function Qa(e,t){return typeof e=="function"?e(t):e}function ba(e){return e.split("-")[0]}function Ui(e){return e.split("-")[1]}function Mh(e){return e==="x"?"y":"x"}function Bh(e){return e==="y"?"height":"width"}function Wi(e){return["top","bottom"].includes(ba(e))?"y":"x"}function Fh(e){return Mh(Wi(e))}function cT(e,t,n){n===void 0&&(n=!1);const r=Ui(e),a=Fh(e),o=Bh(a);let i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Wc(i)),[i,Wc(i)]}function uT(e){const t=Wc(e);return[vd(e),t,vd(t)]}function vd(e){return e.replace(/start|end/g,t=>lT[t])}function dT(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:i;default:return[]}}function hT(e,t,n,r){const a=Ui(e);let o=dT(ba(e),n==="start",r);return a&&(o=o.map(i=>i+"-"+a),t&&(o=o.concat(o.map(vd)))),o}function Wc(e){return e.replace(/left|right|bottom|top/g,t=>sT[t])}function fT(e){return{top:0,right:0,bottom:0,left:0,...e}}function g3(e){return typeof e!="number"?fT(e):{top:e,right:e,bottom:e,left:e}}function qc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function s0(e,t,n){let{reference:r,floating:a}=e;const o=Wi(t),i=Fh(t),c=Bh(i),u=ba(t),d=o==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,f=r[c]/2-a[c]/2;let y;switch(u){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(Ui(t)){case"start":y[i]-=f*(n&&d?-1:1);break;case"end":y[i]+=f*(n&&d?-1:1);break}return y}const pT=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,c=o.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=s0(d,r,u),f=r,y={},g=0;for(let m=0;m<c.length;m++){const{name:b,fn:w}=c[m],{x:_,y:x,data:j,reset:k}=await w({x:h,y:p,initialPlacement:r,placement:f,strategy:a,middlewareData:y,rects:d,platform:i,elements:{reference:e,floating:t}});h=_??h,p=x??p,y={...y,[b]:{...y[b],...j}},k&&g<=50&&(g++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(d=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:h,y:p}=s0(d,f,u)),m=-1)}return{x:h,y:p,placement:f,strategy:a,middlewareData:y}};async function Hh(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:f=!1,padding:y=0}=Qa(t,e),g=g3(y),m=c[f?p==="floating"?"reference":"floating":p],b=qc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:u})),w=p==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),x=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},j=qc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:_,strategy:u}):w);return{top:(b.top-j.top+g.top)/x.y,bottom:(j.bottom-b.bottom+g.bottom)/x.y,left:(b.left-j.left+g.left)/x.x,right:(j.right-b.right+g.right)/x.x}}const mT=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:h=0}=Qa(e,t)||{};if(d==null)return{};const p=g3(h),f={x:n,y:r},y=Fh(a),g=Bh(y),m=await i.getDimensions(d),b=y==="y",w=b?"top":"left",_=b?"bottom":"right",x=b?"clientHeight":"clientWidth",j=o.reference[g]+o.reference[y]-f[y]-o.floating[g],k=f[y]-o.reference[y],L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let D=L?L[x]:0;(!D||!await(i.isElement==null?void 0:i.isElement(L)))&&(D=c.floating[x]||o.floating[g]);const S=j/2-k/2,T=D/2-m[g]/2-1,I=Kr(p[w],T),A=Kr(p[_],T),U=I,K=D-m[g]-A,X=D/2-m[g]/2+S,G=gd(U,X,K),Q=!u.arrow&&Ui(a)!=null&&X!==G&&o.reference[g]/2-(X<U?I:A)-m[g]/2<0,oe=Q?X<U?X-U:X-K:0;return{[y]:f[y]+oe,data:{[y]:G,centerOffset:X-G-oe,...Q&&{alignmentOffset:oe}},reset:Q}}}),gT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=Qa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=ba(a),_=ba(c)===c,x=await(u.isRTL==null?void 0:u.isRTL(d.floating)),j=f||(_||!m?[Wc(c)]:uT(c));!f&&g!=="none"&&j.push(...hT(c,m,g,x));const k=[c,...j],L=await Hh(t,b),D=[];let S=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&D.push(L[w]),p){const U=cT(a,i,x);D.push(L[U[0]],L[U[1]])}if(S=[...S,{placement:a,overflows:D}],!D.every(U=>U<=0)){var T,I;const U=(((T=o.flip)==null?void 0:T.index)||0)+1,K=k[U];if(K)return{data:{index:U,overflows:S},reset:{placement:K}};let X=(I=S.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:I.placement;if(!X)switch(y){case"bestFit":{var A;const G=(A=S.map(Q=>[Q.placement,Q.overflows.filter(oe=>oe>0).reduce((oe,le)=>oe+le,0)]).sort((Q,oe)=>Q[1]-oe[1])[0])==null?void 0:A[0];G&&(X=G);break}case"initialPlacement":X=c;break}if(a!==X)return{reset:{placement:X}}}return{}}}};async function vT(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=ba(n),c=Ui(n),u=Wi(n)==="y",d=["left","top"].includes(i)?-1:1,h=o&&u?-1:1,p=Qa(t,e);let{mainAxis:f,crossAxis:y,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return c&&typeof g=="number"&&(y=c==="end"?g*-1:g),u?{x:y*h,y:f*d}:{x:f*d,y:y*h}}const yT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:c}=t,u=await vT(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+u.x,y:o+u.y,data:{...u,placement:i}}}}},CT=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:c={fn:b=>{let{x:w,y:_}=b;return{x:w,y:_}}},...u}=Qa(e,t),d={x:n,y:r},h=await Hh(t,u),p=Wi(ba(a)),f=Mh(p);let y=d[f],g=d[p];if(o){const b=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=y+h[b],x=y-h[w];y=gd(_,y,x)}if(i){const b=p==="y"?"top":"left",w=p==="y"?"bottom":"right",_=g+h[b],x=g-h[w];g=gd(_,g,x)}const m=c.fn({...t,[f]:y,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},bT=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Qa(e,t),h={x:n,y:r},p=Wi(a),f=Mh(p);let y=h[f],g=h[p];const m=Qa(c,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const x=f==="y"?"height":"width",j=o.reference[f]-o.floating[x]+b.mainAxis,k=o.reference[f]+o.reference[x]-b.mainAxis;y<j?y=j:y>k&&(y=k)}if(d){var w,_;const x=f==="y"?"width":"height",j=["top","left"].includes(ba(a)),k=o.reference[p]-o.floating[x]+(j&&((w=i.offset)==null?void 0:w[p])||0)+(j?0:b.crossAxis),L=o.reference[p]+o.reference[x]+(j?0:((_=i.offset)==null?void 0:_[p])||0)-(j?b.crossAxis:0);g<k?g=k:g>L&&(g=L)}return{[f]:y,[p]:g}}}},_T=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:o}=t,{apply:i=()=>{},...c}=Qa(e,t),u=await Hh(t,c),d=ba(n),h=Ui(n),p=Wi(n)==="y",{width:f,height:y}=r.floating;let g,m;d==="top"||d==="bottom"?(g=d,m=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(m=d,g=h==="end"?"top":"bottom");const b=y-u.top-u.bottom,w=f-u.left-u.right,_=Kr(y-u[g],b),x=Kr(f-u[m],w),j=!t.middlewareData.shift;let k=_,L=x;if(p?L=h||j?Kr(x,w):w:k=h||j?Kr(_,b):b,j&&!h){const S=ar(u.left,0),T=ar(u.right,0),I=ar(u.top,0),A=ar(u.bottom,0);p?L=f-2*(S!==0||T!==0?S+T:ar(u.left,u.right)):k=y-2*(I!==0||A!==0?I+A:ar(u.top,u.bottom))}await i({...t,availableWidth:L,availableHeight:k});const D=await a.getDimensions(o.floating);return f!==D.width||y!==D.height?{reset:{rects:!0}}:{}}}};function qi(e){return v3(e)?(e.nodeName||"").toLowerCase():"#document"}function cr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ja(e){var t;return(t=(v3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function v3(e){return e instanceof Node||e instanceof cr(e).Node}function ra(e){return e instanceof Element||e instanceof cr(e).Element}function aa(e){return e instanceof HTMLElement||e instanceof cr(e).HTMLElement}function l0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof cr(e).ShadowRoot}function xl(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ar(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function xT(e){return["table","td","th"].includes(qi(e))}function $h(e){const t=Vh(),n=Ar(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function wT(e){let t=eo(e);for(;aa(t)&&!ki(t);){if($h(t))return t;t=eo(t)}return null}function Vh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ki(e){return["html","body","#document"].includes(qi(e))}function Ar(e){return cr(e).getComputedStyle(e)}function ju(e){return ra(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function eo(e){if(qi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||l0(e)&&e.host||ja(e);return l0(t)?t.host:t}function y3(e){const t=eo(e);return ki(t)?e.ownerDocument?e.ownerDocument.body:e.body:aa(t)&&xl(t)?t:y3(t)}function Gs(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=y3(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),i=cr(a);return o?t.concat(i,i.visualViewport||[],xl(a)?a:[],i.frameElement&&n?Gs(i.frameElement):[]):t.concat(a,Gs(a,[],n))}function C3(e){const t=Ar(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=aa(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,c=Uc(n)!==o||Uc(r)!==i;return c&&(n=o,r=i),{width:n,height:r,$:c}}function Uh(e){return ra(e)?e:e.contextElement}function vi(e){const t=Uh(e);if(!aa(t))return Ja(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=C3(t);let i=(o?Uc(n.width):n.width)/r,c=(o?Uc(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const ST=Ja(0);function b3(e){const t=cr(e);return!Vh()||!t.visualViewport?ST:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jT(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cr(e)?!1:t}function Oo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Uh(e);let i=Ja(1);t&&(r?ra(r)&&(i=vi(r)):i=vi(e));const c=jT(o,n,r)?b3(o):Ja(0);let u=(a.left+c.x)/i.x,d=(a.top+c.y)/i.y,h=a.width/i.x,p=a.height/i.y;if(o){const f=cr(o),y=r&&ra(r)?cr(r):r;let g=f,m=g.frameElement;for(;m&&r&&y!==g;){const b=vi(m),w=m.getBoundingClientRect(),_=Ar(m),x=w.left+(m.clientLeft+parseFloat(_.paddingLeft))*b.x,j=w.top+(m.clientTop+parseFloat(_.paddingTop))*b.y;u*=b.x,d*=b.y,h*=b.x,p*=b.y,u+=x,d+=j,g=cr(m),m=g.frameElement}}return qc({width:h,height:p,x:u,y:d})}const kT=[":popover-open",":modal"];function Wh(e){return kT.some(t=>{try{return e.matches(t)}catch{return!1}})}function ET(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",i=ja(r),c=t?Wh(t.floating):!1;if(r===i||c&&o)return n;let u={scrollLeft:0,scrollTop:0},d=Ja(1);const h=Ja(0),p=aa(r);if((p||!p&&!o)&&((qi(r)!=="body"||xl(i))&&(u=ju(r)),aa(r))){const f=Oo(r);d=vi(r),h.x=f.x+r.clientLeft,h.y=f.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x,y:n.y*d.y-u.scrollTop*d.y+h.y}}function NT(e){return Array.from(e.getClientRects())}function _3(e){return Oo(ja(e)).left+ju(e).scrollLeft}function TT(e){const t=ja(e),n=ju(e),r=e.ownerDocument.body,a=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_3(e);const c=-n.scrollTop;return Ar(r).direction==="rtl"&&(i+=ar(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:c}}function PT(e,t){const n=cr(e),r=ja(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,c=0,u=0;if(a){o=a.width,i=a.height;const d=Vh();(!d||d&&t==="fixed")&&(c=a.offsetLeft,u=a.offsetTop)}return{width:o,height:i,x:c,y:u}}function LT(e,t){const n=Oo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=aa(e)?vi(e):Ja(1),i=e.clientWidth*o.x,c=e.clientHeight*o.y,u=a*o.x,d=r*o.y;return{width:i,height:c,x:u,y:d}}function c0(e,t,n){let r;if(t==="viewport")r=PT(e,n);else if(t==="document")r=TT(ja(e));else if(ra(t))r=LT(t,n);else{const a=b3(e);r={...t,x:t.x-a.x,y:t.y-a.y}}return qc(r)}function x3(e,t){const n=eo(e);return n===t||!ra(n)||ki(n)?!1:Ar(n).position==="fixed"||x3(n,t)}function AT(e,t){const n=t.get(e);if(n)return n;let r=Gs(e,[],!1).filter(c=>ra(c)&&qi(c)!=="body"),a=null;const o=Ar(e).position==="fixed";let i=o?eo(e):e;for(;ra(i)&&!ki(i);){const c=Ar(i),u=$h(i);!u&&c.position==="fixed"&&(a=null),(o?!u&&!a:!u&&c.position==="static"&&a&&["absolute","fixed"].includes(a.position)||xl(i)&&!u&&x3(e,i))?r=r.filter(d=>d!==i):a=c,i=eo(i)}return t.set(e,r),r}function RT(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Wh(t)?[]:AT(t,this._c):[].concat(n),r],i=o[0],c=o.reduce((u,d)=>{const h=c0(t,d,a);return u.top=ar(h.top,u.top),u.right=Kr(h.right,u.right),u.bottom=Kr(h.bottom,u.bottom),u.left=ar(h.left,u.left),u},c0(t,i,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function DT(e){const{width:t,height:n}=C3(e);return{width:t,height:n}}function OT(e,t,n){const r=aa(t),a=ja(t),o=n==="fixed",i=Oo(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=Ja(0);if(r||!r&&!o)if((qi(t)!=="body"||xl(a))&&(c=ju(t)),r){const p=Oo(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else a&&(u.x=_3(a));const d=i.left+c.scrollLeft-u.x,h=i.top+c.scrollTop-u.y;return{x:d,y:h,width:i.width,height:i.height}}function c1(e){return Ar(e).position==="static"}function u0(e,t){return!aa(e)||Ar(e).position==="fixed"?null:t?t(e):e.offsetParent}function w3(e,t){const n=cr(e);if(Wh(e))return n;if(!aa(e)){let a=eo(e);for(;a&&!ki(a);){if(ra(a)&&!c1(a))return a;a=eo(a)}return n}let r=u0(e,t);for(;r&&xT(r)&&c1(r);)r=u0(r,t);return r&&ki(r)&&c1(r)&&!$h(r)?n:r||wT(e)||n}const IT=async function(e){const t=this.getOffsetParent||w3,n=this.getDimensions,r=await n(e.floating);return{reference:OT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function MT(e){return Ar(e).direction==="rtl"}const BT={convertOffsetParentRelativeRectToViewportRelativeRect:ET,getDocumentElement:ja,getClippingRect:RT,getOffsetParent:w3,getElementRects:IT,getClientRects:NT,getDimensions:DT,getScale:vi,isElement:ra,isRTL:MT};function FT(e,t){let n=null,r;const a=ja(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const{left:d,top:h,width:p,height:f}=e.getBoundingClientRect();if(c||t(),!p||!f)return;const y=Vl(h),g=Vl(a.clientWidth-(d+p)),m=Vl(a.clientHeight-(h+f)),b=Vl(d),w={rootMargin:-y+"px "+-g+"px "+-m+"px "+-b+"px",threshold:ar(0,Kr(1,u))||1};let _=!0;function x(j){const k=j[0].intersectionRatio;if(k!==u){if(!_)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(x,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return i(!0),o}function HT(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Uh(e),h=a||o?[...d?Gs(d):[],...Gs(t)]:[];h.forEach(w=>{a&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const p=d&&c?FT(d,n):null;let f=-1,y=null;i&&(y=new ResizeObserver(w=>{let[_]=w;_&&_.target===d&&y&&(y.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=y)==null||x.observe(t)})),n()}),d&&!u&&y.observe(d),y.observe(t));let g,m=u?Oo(e):null;u&&b();function b(){const w=Oo(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&n(),m=w,g=requestAnimationFrame(b)}return n(),()=>{var w;h.forEach(_=>{a&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),p==null||p(),(w=y)==null||w.disconnect(),y=null,u&&cancelAnimationFrame(g)}}const $T=yT,VT=CT,UT=gT,WT=_T,qT=mT,zT=bT,ZT=(e,t,n)=>{const r=new Map,a={platform:BT,...n},o={...a.platform,_c:r};return pT(e,t,{...a,platform:o})};var GT="div";function d0(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const a={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return je(he({},a),{toJSON:()=>a})}function YT(e){if(!e)return d0();const{x:t,y:n,width:r,height:a}=e;return d0(t,n,r,a)}function KT(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?YT(r):n.getBoundingClientRect()}}}function XT(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function h0(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function JT(e,t){return $T(({placement:n})=>{var r;const a=((e==null?void 0:e.clientHeight)||0)/2,o=typeof t.gutter=="number"?t.gutter+a:(r=t.gutter)!=null?r:a;return{crossAxis:n.split("-")[1]?void 0:t.shift,mainAxis:o,alignmentAxis:t.shift}})}function QT(e){if(e.flip===!1)return;const t=typeof e.flip=="string"?e.flip.split(" "):void 0;return $n(!t||t.every(XT),process.env.NODE_ENV!=="production"&&"`flip` expects a spaced-delimited list of placements"),UT({padding:e.overflowPadding,fallbackPlacements:t})}function eP(e){if(!(!e.slide&&!e.overlap))return VT({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:zT()})}function tP(e){return WT({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:a}){const o=t.floating,i=Math.round(a.reference.width);n=Math.floor(n),r=Math.floor(r),o.style.setProperty("--popover-anchor-width",`${i}px`),o.style.setProperty("--popover-available-width",`${n}px`),o.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(o.style.width=`${i}px`),e.fitViewport&&(o.style.maxWidth=`${n}px`,o.style.maxHeight=`${r}px`)}})}function nP(e,t){if(e)return qT({element:e,padding:t.arrowPadding})}var S3=gt(function(e){var t=e,{store:n,modal:r=!1,portal:a=!!r,preserveTabOrder:o=!0,autoFocusOnShow:i=!0,wrapperProps:c,fixed:u=!1,flip:d=!0,shift:h=0,slide:p=!0,overlap:f=!1,sameWidth:y=!1,fitViewport:g=!1,gutter:m,arrowPadding:b=4,overflowPadding:w=8,getAnchorRect:_,updatePosition:x}=t,j=mt(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const k=p3();n=n||k,$n(n,process.env.NODE_ENV!=="production"&&"Popover must receive a `store` prop or be wrapped in a PopoverProvider component.");const L=n.useState("arrowElement"),D=n.useState("anchorElement"),S=n.useState("disclosureElement"),T=n.useState("popoverElement"),I=n.useState("contentElement"),A=n.useState("placement"),U=n.useState("mounted"),K=n.useState("rendered"),X=C.useRef(null),[G,Q]=C.useState(!1),{portalRef:oe,domReady:le}=Ch(a,j.portalRef),de=Ye(_),B=Ye(x),V=!!x;Et(()=>{if(!(T!=null&&T.isConnected))return;T.style.setProperty("--popover-overflow-padding",`${w}px`);const W=KT(D,de),J=async()=>{if(!U)return;L||(X.current=X.current||document.createElement("div"));const ee=L||X.current,re=[JT(ee,{gutter:m,shift:h}),QT({flip:d,overflowPadding:w}),eP({slide:p,shift:h,overlap:f,overflowPadding:w}),nP(ee,{arrowPadding:b}),tP({sameWidth:y,fitViewport:g,overflowPadding:w})],se=await ZT(W,T,{placement:A,strategy:u?"fixed":"absolute",middleware:re});n==null||n.setState("currentPlacement",se.placement),Q(!0);const ge=h0(se.x),ae=h0(se.y);if(Object.assign(T.style,{top:"0",left:"0",transform:`translate3d(${ge}px,${ae}px,0)`}),ee&&se.middlewareData.arrow){const{x:Oe,y:q}=se.middlewareData.arrow,Ce=se.placement.split("-")[0],xe=ee.clientWidth/2,Ae=ee.clientHeight/2,Be=Oe!=null?Oe+xe:-xe,ue=q!=null?q+Ae:-Ae;T.style.setProperty("--popover-transform-origin",{top:`${Be}px calc(100% + ${Ae}px)`,bottom:`${Be}px ${-Ae}px`,left:`calc(100% + ${xe}px) ${ue}px`,right:`${-xe}px ${ue}px`}[Ce]),Object.assign(ee.style,{left:Oe!=null?`${Oe}px`:"",top:q!=null?`${q}px`:"",[Ce]:"100%"})}},fe=HT(W,T,async()=>{V?(await B({updatePosition:J}),Q(!0)):await J()},{elementResize:typeof ResizeObserver=="function"});return()=>{Q(!1),fe()}},[n,K,T,L,D,T,A,U,le,u,d,h,p,f,y,g,m,b,w,de,V,B]),Et(()=>{if(!U||!le||!(T!=null&&T.isConnected)||!(I!=null&&I.isConnected))return;const W=()=>{T.style.zIndex=getComputedStyle(I).zIndex};W();let J=requestAnimationFrame(()=>{J=requestAnimationFrame(W)});return()=>cancelAnimationFrame(J)},[U,le,T,I]);const F=u?"fixed":"absolute";return j=qn(j,W=>l.jsx("div",je(he({},c),{style:he({position:F,top:0,left:0,width:"max-content"},c==null?void 0:c.style),ref:n==null?void 0:n.setPopoverElement,children:W})),[n,F,c]),j=qn(j,W=>l.jsx(m3,{value:n,children:W}),[n]),j=je(he({"data-placing":!G||void 0},j),{style:he({position:"relative"},j.style)}),j=h3(je(he({store:n,modal:r,portal:a,preserveTabOrder:o,preserveTabOrderAnchor:S||D,autoFocusOnShow:G&&i},j),{portalRef:oe})),j});Su(rt(function(e){const t=S3(e);return ut(GT,t)}),p3);var qh=Sa([iT],[m3]),zh=qh.useProviderContext,rP=qh.ContextProvider,j3=qh.ScopedContextProvider;function aP(e={}){var t;const n=(t=e.store)==null?void 0:t.getState(),r=aT(Gn(Ht({},e),{placement:St(e.placement,n==null?void 0:n.placement,"bottom")})),a=St(e.timeout,n==null?void 0:n.timeout,500),o=Gn(Ht({},r.getState()),{timeout:a,showTimeout:St(e.showTimeout,n==null?void 0:n.showTimeout),hideTimeout:St(e.hideTimeout,n==null?void 0:n.hideTimeout),autoFocusOnShow:St(n==null?void 0:n.autoFocusOnShow,!1)}),i=vr(o,r,e.store);return Gn(Ht(Ht({},r),i),{setAutoFocusOnShow:c=>i.setState("autoFocusOnShow",c)})}function oP(e,t,n){return lr(e,n,"timeout"),lr(e,n,"showTimeout"),lr(e,n,"hideTimeout"),oT(e,t,n)}function u1(e){return[e.clientX,e.clientY]}function f0(e,t){const[n,r]=e;let a=!1;const o=t.length;for(let i=o,c=0,u=i-1;c<i;u=c++){const[d,h]=t[c],[p,f]=t[u],[,y]=t[u===0?i-1:u-1]||[0,0],g=(h-f)*(n-d)-(d-p)*(r-h);if(f<h){if(r>=f&&r<h){if(g===0)return!0;g>0&&(r===f?r>y&&(a=!a):a=!a)}}else if(h<f){if(r>h&&r<=f){if(g===0)return!0;g<0&&(r===f?r<y&&(a=!a):a=!a)}}else if(r===h&&(n>=p&&n<=d||n>=d&&n<=p))return!0}return a}function iP(e,t){const{top:n,right:r,bottom:a,left:o}=t,[i,c]=e,u=i<o?"left":i>r?"right":null,d=c<n?"top":c>a?"bottom":null;return[u,d]}function p0(e,t){const n=e.getBoundingClientRect(),{top:r,right:a,bottom:o,left:i}=n,[c,u]=iP(t,n),d=[t];return c?(u!=="top"&&d.push([c==="left"?i:a,r]),d.push([c==="left"?a:i,r]),d.push([c==="left"?a:i,o]),u!=="bottom"&&d.push([c==="left"?i:a,o])):u==="top"?(d.push([i,r]),d.push([i,o]),d.push([a,o]),d.push([a,r])):(d.push([i,o]),d.push([i,r]),d.push([a,r]),d.push([a,o])),d}var sP="div";function k3(e,t,n,r){return H5(t)?!0:e?!!(Xt(t,e)||n&&Xt(n,e)||r!=null&&r.some(a=>k3(e,a,n))):!1}function lP(e){var t=e,{store:n}=t,r=mt(t,["store"]);const[a,o]=C.useState(!1),i=n.useState("mounted");C.useEffect(()=>{i||o(!1)},[i]);const c=r.onFocus,u=Ye(h=>{c==null||c(h),!h.defaultPrevented&&o(!0)}),d=C.useRef(null);return C.useEffect(()=>Ka(n,["anchorElement"],h=>{d.current=h.anchorElement}),[]),r=je(he({autoFocusOnHide:a,finalFocus:d},r),{onFocus:u}),r}var m0=C.createContext(null),E3=gt(function(e){var t=e,{store:n,modal:r=!1,portal:a=!!r,hideOnEscape:o=!0,hideOnHoverOutside:i=!0,disablePointerEventsOnApproach:c=!!i}=t,u=mt(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const d=zh();n=n||d,$n(n,process.env.NODE_ENV!=="production"&&"Hovercard must receive a `store` prop or be wrapped in a HovercardProvider component.");const h=C.useRef(null),[p,f]=C.useState([]),y=C.useRef(0),g=C.useRef(null),{portalRef:m,domReady:b}=Ch(a,u.portalRef),w=!!i,_=ga(i),x=!!c,j=ga(c),k=n.useState("open"),L=n.useState("mounted");C.useEffect(()=>{if(!b||!L||!w&&!x)return;const A=h.current;return A?Yn(gn("mousemove",U=>{if(!n)return;const{anchorElement:K,hideTimeout:X,timeout:G}=n.getState(),Q=g.current,[oe]=U.composedPath(),le=K;if(k3(oe,A,le,p)){g.current=oe&&le&&Xt(le,oe)?u1(U):null,window.clearTimeout(y.current),y.current=0;return}if(!y.current){if(Q){const de=u1(U),B=p0(A,Q);if(f0(de,B)){if(g.current=de,!j(U))return;U.preventDefault(),U.stopPropagation();return}}_(U)&&(y.current=window.setTimeout(()=>{y.current=0,n==null||n.hide()},X??G))}},!0),()=>clearTimeout(y.current)):void 0},[n,b,L,w,x,p,j,_]),C.useEffect(()=>{if(!b||!L||!x)return;const A=U=>{const K=h.current;if(!K)return;const X=g.current;if(!X)return;const G=p0(K,X);if(f0(u1(U),G)){if(!j(U))return;U.preventDefault(),U.stopPropagation()}};return Yn(gn("mouseenter",A,!0),gn("mouseover",A,!0),gn("mouseout",A,!0),gn("mouseleave",A,!0))},[b,L,x,j]),C.useEffect(()=>{b&&(k||n==null||n.setAutoFocusOnShow(!1))},[n,b,k]);const D=L5(k);C.useEffect(()=>{if(b)return()=>{D.current||n==null||n.setAutoFocusOnShow(!1)}},[n,b]);const S=C.useContext(m0);Et(()=>{if(r||!a||!L||!b)return;const A=h.current;if(A)return S==null?void 0:S(A)},[r,a,L,b]);const T=C.useCallback(A=>{f(K=>[...K,A]);const U=S==null?void 0:S(A);return()=>{f(K=>K.filter(X=>X!==A)),U==null||U()}},[S]);u=qn(u,A=>l.jsx(j3,{value:n,children:l.jsx(m0.Provider,{value:T,children:A})}),[n,T]),u=je(he({},u),{ref:Cn(h,u.ref)}),u=lP(he({store:n},u));const I=n.useState(A=>r||A.autoFocusOnShow);return u=S3(je(he({store:n,modal:r,portal:a,autoFocusOnShow:I},u),{portalRef:m,hideOnEscape(A){return $c(o,A)?!1:(requestAnimationFrame(()=>{requestAnimationFrame(()=>{n==null||n.hide()})}),!0)}})),u});Su(rt(function(e){const t=E3(e);return ut(sP,t)}),zh);var cP="a",N3=gt(function(e){var t=e,{store:n,showOnHover:r=!0}=t,a=mt(t,["store","showOnHover"]);const o=zh();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"HovercardAnchor must receive a `store` prop or be wrapped in a HovercardProvider component.");const i=vl(a),c=C.useRef(0);C.useEffect(()=>()=>window.clearTimeout(c.current),[]),C.useEffect(()=>gn("mouseleave",m=>{if(!n)return;const{anchorElement:b}=n.getState();b&&m.target===b&&(window.clearTimeout(c.current),c.current=0)},!0),[n]);const u=a.onMouseMove,d=ga(r),h=Mk(),p=Ye(m=>{if(u==null||u(m),i||!n||m.defaultPrevented||c.current||!h()||!d(m))return;const b=m.currentTarget;n.setAnchorElement(b),n.setDisclosureElement(b);const{showTimeout:w,timeout:_}=n.getState(),x=()=>{c.current=0,h()&&(n==null||n.setAnchorElement(b),n==null||n.show(),queueMicrotask(()=>{n==null||n.setDisclosureElement(b)}))},j=w??_;j===0?x():c.current=window.setTimeout(x,j)}),f=a.onClick,y=Ye(m=>{f==null||f(m),n&&(window.clearTimeout(c.current),c.current=0)}),g=C.useCallback(m=>{if(!n)return;const{anchorElement:b}=n.getState();b!=null&&b.isConnected||n.setAnchorElement(m)},[n]);return a=je(he({},a),{ref:Cn(g,a.ref),onMouseMove:p,onClick:y}),a=Cl(a),a});rt(function(e){const t=N3(e);return ut(cP,t)});function uP(e={}){var t;process.env.NODE_ENV!=="production"&&e.type==="label"&&console.warn("The `type` option on the tooltip store is deprecated.","Render a visually hidden label or use the `aria-label` or `aria-labelledby` attributes on the anchor element instead.","See https://ariakit.org/components/tooltip#tooltip-anchors-must-have-accessible-names");const n=(t=e.store)==null?void 0:t.getState(),r=aP(Gn(Ht({},e),{placement:St(e.placement,n==null?void 0:n.placement,"top"),hideTimeout:St(e.hideTimeout,n==null?void 0:n.hideTimeout,0)})),a=Gn(Ht({},r.getState()),{type:St(e.type,n==null?void 0:n.type,"description"),skipTimeout:St(e.skipTimeout,n==null?void 0:n.skipTimeout,300)}),o=vr(a,r,e.store);return Ht(Ht({},r),o)}function dP(e,t,n){return lr(e,n,"type"),lr(e,n,"skipTimeout"),oP(e,t,n)}function hP(e={}){const[t,n]=_u(uP,e);return dP(t,n,e)}var Zh=Sa([rP],[j3]),Gh=Zh.useProviderContext,fP=Zh.ContextProvider,pP=Zh.ScopedContextProvider,mP="div",gP=gt(function(e){var t=e,{store:n,portal:r=!0,gutter:a=8,preserveTabOrder:o=!1,hideOnHoverOutside:i=!0,hideOnInteractOutside:c=!0}=t,u=mt(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const d=Gh();n=n||d,$n(n,process.env.NODE_ENV!=="production"&&"Tooltip must receive a `store` prop or be wrapped in a TooltipProvider component."),u=qn(u,p=>l.jsx(pP,{value:n,children:p}),[n]);const h=n.useState(p=>p.type==="description"?"tooltip":"none");return u=he({role:h},u),u=E3(je(he({},u),{store:n,portal:r,gutter:a,preserveTabOrder:o,hideOnHoverOutside(p){if($c(i,p))return!1;const f=n==null?void 0:n.getState().anchorElement;return f?!("focusVisible"in f.dataset):!0},hideOnInteractOutside:p=>{if($c(c,p))return!1;const f=n==null?void 0:n.getState().anchorElement;return f?!Xt(f,p.target):!0}})),u}),vP=Su(rt(function(e){const t=gP(e);return ut(mP,t)}),Gh);function yP(e={}){const t=hP(e);return l.jsx(fP,{value:t,children:e.children})}var CP="div",Co=vr({activeStore:null});function g0(e){return()=>{const{activeStore:t}=Co.getState();t===e&&Co.setState("activeStore",null)}}var bP=gt(function(e){var t=e,{store:n,showOnHover:r=!0}=t,a=mt(t,["store","showOnHover"]);const o=Gh();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"TooltipAnchor must receive a `store` prop or be wrapped in a TooltipProvider component.");const i=C.useRef(!1);C.useEffect(()=>Ka(n,["mounted"],m=>{m.mounted||(i.current=!1)}),[n]),C.useEffect(()=>{if(n)return Yn(g0(n),Ka(n,["mounted","skipTimeout"],m=>{if(!n)return;if(m.mounted){const{activeStore:w}=Co.getState();return w!==n&&(w==null||w.hide()),Co.setState("activeStore",n)}const b=setTimeout(g0(n),m.skipTimeout);return()=>clearTimeout(b)}))},[n]);const c=a.onMouseEnter,u=Ye(m=>{c==null||c(m),i.current=!0}),d=a.onFocusVisible,h=Ye(m=>{d==null||d(m),!m.defaultPrevented&&(n==null||n.setAnchorElement(m.currentTarget),n==null||n.show())}),p=a.onBlur,f=Ye(m=>{if(p==null||p(m),m.defaultPrevented)return;const{activeStore:b}=Co.getState();i.current=!1,b===n&&Co.setState("activeStore",null)}),y=n.useState("type"),g=n.useState(m=>{var b;return(b=m.contentElement)==null?void 0:b.id});return a=je(he({"aria-labelledby":y==="label"?g:void 0},a),{onMouseEnter:u,onFocusVisible:h,onBlur:f}),a=N3(he({store:n,showOnHover(m){if(!i.current||$c(r,m))return!1;const{activeStore:b}=Co.getState();return b?(n==null||n.show(),!1):!0}},a)),a}),_P=rt(function(e){const t=bP(e);return ut(CP,t)});const xP="_root_1b1uy_1",wP="_tooltip_1b1uy_10",SP="_tooltipText_1b1uy_19",v0={root:xP,tooltip:wP,tooltipText:SP},jP=({content:e})=>l.jsx("div",{className:v0.tooltip,children:l.jsx("p",{className:v0.tooltipText,children:e})}),kP="_root_4ee1r_1",EP="_coupon_4ee1r_8",NP="_couponApplied_4ee1r_14",TP="_discount_4ee1r_24",PP="_removeButton_4ee1r_30",LP="_removeButtonText_4ee1r_34",AP="_couponInput_4ee1r_38",RP="_applyButton_4ee1r_44",DP="_applyButtonText_4ee1r_48",La={root:kP,coupon:EP,couponApplied:NP,discount:TP,removeButton:PP,removeButtonText:LP,couponInput:AP,applyButton:RP,applyButtonText:DP},OP=({applyCoupon:e,couponData:t,discount:n,removeCoupon:r,gateway:a})=>{const[o,i]=C.useState("");return l.jsx("div",{className:La.coupon,children:t?l.jsxs("div",{className:La.couponApplied,children:[l.jsx(dl,{}),l.jsxs("p",{children:[o," is applied"," ",l.jsxs("span",{className:La.discount,children:["-",n," ",!t.isFixed&&`(${t.discount}%)`]})]}),l.jsx(Ee,{className:La.removeButton,type:"Secondary",onClick:r,children:l.jsx("span",{className:La.removeButtonText,children:"Remove"})})]}):l.jsxs("div",{className:La.couponInput,children:[l.jsx(wa,{placeholder:"Enter a discount code",value:o,onChange:c=>i(c.target.value)}),l.jsxs(yP,{children:[l.jsx(_P,{render:l.jsx("div",{children:l.jsx(Ee,{className:La.applyButton,onClick:()=>e(o),disabled:!a,children:l.jsx("span",{className:La.applyButtonText,children:"Apply"})})}),children:"Tooltip"}),!a&&l.jsx(vP,{children:l.jsx(jP,{content:"The discount is related to the method of payment. Select to enter."})})]})]})})},IP="_root_4p9sj_1",MP="_checkoutFooter_4p9sj_10",BP="_footerBranding_4p9sj_19",FP="_poweredText_4p9sj_24",HP="_footerNav_4p9sj_30",Ul={root:IP,checkoutFooter:MP,footerBranding:BP,poweredText:FP,footerNav:HP},_a=({className:e})=>{const[t]=me(r5),[n]=me(a5),[r]=me(o5);return l.jsxs("footer",{className:`${Ul.checkoutFooter} ${e}`,children:[l.jsxs("div",{className:Ul.footerBranding,children:[l.jsx("p",{className:Ul.poweredText,children:"Powered by"}),l.jsx(Gx,{})]}),l.jsx("nav",{children:l.jsxs("ul",{className:Ul.footerNav,children:[(t==null?void 0:t.showTermsOfServiceOnProduct)&&l.jsx("li",{children:l.jsx("a",{href:t.termsOfService,target:"_blank",rel:"noopener noreferrer",children:"Terms"})}),(n==null?void 0:n.showPrivacyPolicyOnProduct)&&l.jsx("li",{children:l.jsx("a",{href:n.privacyPolicy,target:"_blank",rel:"noopener noreferrer",children:"Privacy"})}),(r==null?void 0:r.showRefundPolicyOnProduct)&&l.jsx("li",{children:l.jsx("a",{href:r.refundPolicy,target:"_blank",rel:"noopener noreferrer",children:"Refund"})})]})})]})},$P="_root_xi9no_1",VP="_timerContainer_xi9no_10",UP="_timerText_xi9no_21",y0={root:$P,timerContainer:VP,timerText:UP},WP=({expiresAt:e})=>{const[t,n]=C.useState(r());function r(){const a=new Date,o=new Date(e).getTime()-a.getTime();if(o<=0)return{hours:"00",minutes:"00",seconds:"00"};const i=Math.floor(o/(1e3*60*60)),c=Math.floor(o%(1e3*60*60)/(1e3*60)),u=Math.floor(o%(1e3*60)/1e3);return{hours:String(i).padStart(2,"0"),minutes:String(c).padStart(2,"0"),seconds:String(u).padStart(2,"0")}}return C.useEffect(()=>{const a=setInterval(()=>{n(r())},1e3);return()=>clearInterval(a)},[e]),t.hours==="00"&&t.minutes==="00"&&t.seconds==="00"?null:l.jsxs("div",{className:y0.timerContainer,children:[l.jsx(xs,{}),l.jsxs("p",{className:y0.timerText,children:[t.hours,":",t.minutes,":",t.seconds]})]})},qP="_root_1bg1c_1",zP="_checkoutHeader_1bg1c_10",ZP="_leftContainer_1bg1c_30",GP="_backArrow_1bg1c_37",YP="_logoContainer_1bg1c_50",KP="_logo_1bg1c_50",as={root:qP,checkoutHeader:zP,leftContainer:ZP,backArrow:GP,logoContainer:YP,logo:KP},wl=({className:e,expiresAt:t})=>{const[n]=me(hl),r=ur();return l.jsxs("header",{className:`${as.checkoutHeader} ${e}`,children:[l.jsxs("div",{className:as.leftContainer,children:[l.jsx("div",{className:as.backArrow,onClick:()=>r(-1),children:l.jsx(Gm,{})}),(n==null?void 0:n.info.logo)&&l.jsx("div",{className:as.logoContainer,children:l.jsx("img",{className:as.logo,src:gr(n.info.logo.cfId),alt:n.info.name})})]}),t&&l.jsx(WP,{expiresAt:t})]})},XP="_root_1n4we_1",JP="_checkoutPrices_1n4we_10",QP="_priceRow_1n4we_22",eL="_label_1n4we_32",tL="_totalRow_1n4we_37",nL="_totalLabel_1n4we_48",rL="_totalValue_1n4we_53",Aa={root:XP,checkoutPrices:JP,priceRow:QP,label:eL,totalRow:tL,totalLabel:nL,totalValue:rL},ku=({formatter:e,coupon:t,discount:n,totalWithDiscount:r,total:a,className:o})=>l.jsxs("div",{className:`${Aa.checkoutPrices} ${o||""}`,children:[l.jsxs("div",{className:Aa.priceRow,children:[l.jsx("p",{className:Aa.label,children:"Subtotal"}),l.jsx("p",{children:e.format(a)})]}),t&&l.jsxs("div",{className:Aa.priceRow,children:[l.jsxs("p",{className:Aa.label,children:["Discount ",!t.isFixed&&`(${t.discount}%)`]}),l.jsxs("p",{children:["-",e.format(n)]})]}),l.jsxs("div",{className:Aa.totalRow,children:[l.jsx("p",{className:Aa.totalLabel,children:"Total Due"}),l.jsx("p",{className:Aa.totalValue,children:r?e.format(r):e.format(a)})]})]}),aL="_root_1gzhf_1",oL="_checkoutItemsContainer_1gzhf_11",iL="_innerContainer_1gzhf_26",sL="_headerSection_1gzhf_34",lL="_header_1gzhf_34",cL="_productsContainer_1gzhf_60",uL="_couponContainer_1gzhf_68",dL="_checkoutFooter_1gzhf_73",uo={root:aL,checkoutItemsContainer:oL,innerContainer:iL,headerSection:sL,header:lL,productsContainer:cL,couponContainer:uL,checkoutFooter:dL},hL=({cart:e,products:t,applyCoupon:n,applyCouponPending:r,coupon:a,totalAndDiscount:o,removeCoupon:i})=>{var c;const u=C.useMemo(()=>e.parts.map(f=>{const y=t.find(m=>m.id===f.productId),g=y==null?void 0:y.variants.find(m=>m.id===f.productVariantId);return{id:(y==null?void 0:y.id)||0,image:y==null?void 0:y.images[0],name:(g==null?void 0:g.name)||"",description:(g==null?void 0:g.description)||"",price:{quantity:f.quantity,amount:(g==null?void 0:g.price.amount)||0,currency:g==null?void 0:g.price.currency},subscriptionSettings:g==null?void 0:g.subscriptionSettings}}),[e,t]),d=((c=u[0])==null?void 0:c.price.currency)||"USD",h=new Intl.NumberFormat("en-US",{style:"currency",currency:d}),p=C.useMemo(()=>o.totalWithDiscount?o.total-o.totalWithDiscount:0,[o]);return l.jsx("div",{className:uo.checkoutItemsContainer,children:l.jsxs("div",{className:uo.innerContainer,children:[l.jsx(wl,{}),l.jsxs("div",{className:uo.headerSection,children:[l.jsx("header",{className:uo.header,children:l.jsx("h1",{children:"Checkout"})}),l.jsx("div",{className:uo.productsContainer,children:u.map(f=>l.jsx(mh,{product:f},f.id))}),l.jsx("div",{className:uo.couponContainer,children:l.jsx(OP,{applyCoupon:n,applyCouponPending:r,couponData:a,discount:h.format(p),removeCoupon:i,gateway:e.gateway})}),l.jsx(ku,{formatter:h,coupon:a,total:o.total,discount:p,totalWithDiscount:o.totalWithDiscount})]}),l.jsx("div",{className:uo.checkoutFooter,children:l.jsx(_a,{})})]})})},fL="_root_pw7xq_1",pL="_checkbox_pw7xq_10",mL="_checked_pw7xq_21",gL="_checkboxInput_pw7xq_27",d1={root:fL,checkbox:pL,checked:mL,checkboxInput:gL},Ss=({onCheckedChange:e,checked:t,...n})=>l.jsxs("label",{className:Ue(d1.checkbox,{[d1.checked]:t}),children:[l.jsx("input",{className:d1.checkboxInput,type:"checkbox",checked:t,onChange:r=>e&&e(r.target.checked),...n}),t&&l.jsx(Hx,{})]}),vL="_root_zd1pk_1",yL="_textareaContainer_zd1pk_10",CL="_textarea_zd1pk_10",bL="_textareaPrimary_zd1pk_29",_L="_textareaSecondary_zd1pk_32",xL="_textareaWithMaxLength_zd1pk_35",wL="_textareaMaxLength_zd1pk_40",pi={root:vL,textareaContainer:yL,textarea:CL,textareaPrimary:bL,textareaSecondary:_L,textareaWithMaxLength:xL,textareaMaxLength:wL},SL={primary:pi.primary,secondary:pi.secondary},Yh=({variant:e,className:t,...n})=>{var r;const a=n.maxLength?pi.withMaxLength:"";return l.jsxs("div",{className:pi.textareaContainer,children:[l.jsx("textarea",{className:Ue(pi.textarea,a,t,{[String(SL[e])]:e}),...n}),n.maxLength&&l.jsxs("span",{className:pi.textareaMaxLength,children:[((r=n.value)==null?void 0:r.toString().length)||0,"/",n.maxLength]})]})},jL="_root_f3544_1",kL="_customFields_f3544_8",EL="_checkboxWrapper_f3544_15",NL="_checkboxLabel_f3544_22",TL="_textareaWrapper_f3544_26",PL="_inputWrapper_f3544_27",LL="_label_f3544_33",mo={root:jL,customFields:kL,checkboxWrapper:EL,checkboxLabel:NL,textareaWrapper:TL,inputWrapper:PL,label:LL},AL=({customFields:e})=>{if(e.length===0)return null;const t=e.map(n=>l.jsx(RL,{customField:n},n.name));return l.jsx("div",{className:mo.customFields,children:t})},RL=({customField:e})=>{const[t,n]=me(e.valueAtom);return l.jsx(DL,{value:t,placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:n,label:e.name,regex:e.regex})},DL=({label:e,type:t,defaultValue:n,value:r,placeholder:a,regex:o,required:i,onValueChange:c})=>{if(t===Bl.Checkbox)return l.jsxs("label",{className:mo.checkboxWrapper,children:[l.jsx(Ss,{defaultChecked:typeof n=="boolean"?n:void 0,required:i,checked:!!r,onCheckedChange:d=>c(d)}),l.jsx("p",{className:mo.checkboxLabel,children:e})]});if(t==Bl.Hidden)return l.jsx("input",{type:"hidden",value:typeof n!="boolean"?n:void 0,required:i});const u=d=>{let h=/^\d*$/;t!=Bl.Number&&(h=o?new RegExp(o):new RegExp("")),h.test(d.target.value)&&c(d.target.value)};return t==Bl.Textarea?l.jsxs("div",{className:mo.textareaWrapper,children:[l.jsx("p",{className:mo.label,children:e}),l.jsx(Yh,{value:r,placeholder:a,required:i,onChange:u})]}):l.jsxs("div",{className:mo.inputWrapper,children:[l.jsx("p",{className:mo.label,children:e}),l.jsx(wa,{value:r,placeholder:a,required:i,onChange:u})]})},OL="_root_u58v5_1",IL="_activeBadge_u58v5_10",ML="_activeBadgeText_u58v5_22",C0={root:OL,activeBadge:IL,activeBadgeText:ML},BL=({className:e})=>l.jsxs("div",{className:Ue(C0.activeBadge,e),children:[l.jsx(Vx,{}),l.jsx("p",{className:C0.activeBadgeText,children:"Active"})]}),FL="_root_bjkpw_1",HL="_connectedContainer_bjkpw_8",$L="_userInfo_bjkpw_17",VL="_avatar_bjkpw_23",UL="_avatarImage_bjkpw_33",WL="_connectButton_bjkpw_39",qL="_connectText_bjkpw_47",ti={root:FL,connectedContainer:HL,userInfo:$L,avatar:VL,avatarImage:UL,connectButton:WL,connectText:qL},T3=ze(null).pipe(ch("customerDiscordConnection")),zL=({customerEmail:e})=>{const[t,n]=C.useState({authorized:!1}),[r,a]=C.useState(),[o,i]=me(T3);C.useEffect(()=>{(async()=>{if(!(!o||o.email!==e))try{const u=await Lp({id:o.id,customerEmail:o.email});n({authorized:!0,id:u.discordId,avatar:u.avatar,username:u.username})}catch(u){i(null),console.log("Still waiting for authorization.",u)}})()},[o,e,i]);const c=()=>{e.trim()!==""&&DS({customerEmail:e}).then(({id:u,redirectUrl:d})=>{let h=window.open(d);(!h||h.closed||typeof h.closed>"u")&&setTimeout(()=>{const f=document.createElement("a");f.href=d,f.target="_blank",f.click()});const p=setInterval(()=>{Lp({id:u,customerEmail:e}).then(f=>{n({authorized:!0,id:f.discordId,avatar:f.avatar,username:f.username}),i({id:u,email:e}),clearInterval(p),h&&h.close()}).catch(f=>{console.log("Still waiting for authorization.",f,{newWindow:h})})},3e3);a(p)}).catch(u=>{console.log("Could not initiate Discord authorization",u)})};return C.useEffect(()=>()=>{r&&clearInterval(r)},[r]),t.authorized?l.jsxs("div",{className:ti.connectedContainer,children:[l.jsxs("div",{className:ti.userInfo,children:[l.jsx("div",{className:ti.avatar,children:t.avatar?l.jsx("img",{className:ti.avatarImage,src:`https://cdn.discordapp.com/avatars/${t.id}/${t.avatar}.png?size=256`,alt:t.username}):l.jsx(Fx,{})}),l.jsx("p",{children:t.username}),l.jsx(BL,{})]}),l.jsx(Ee,{type:"Secondary",onClick:c,children:"Reconnect"})]}):l.jsxs(Ee,{type:"Secondary",className:`${ti.connectButton} text-textSecondary gap-1 w-full`,onClick:c,children:[l.jsx(Zx,{}),l.jsx("span",{className:ti.connectText,children:"Connect Your Discord"})]})},ZL="_root_14hfj_1",GL="_container_14hfj_7",YL="_icon_14hfj_17",KL="_text_14hfj_21",h1={root:ZL,container:GL,icon:YL,text:KL},P3=()=>l.jsxs("div",{className:h1.container,children:[l.jsx("div",{className:h1.icon,children:l.jsx(Xm,{})}),l.jsx("p",{className:h1.text,children:"By continuing to checkout, you agree to our terms of service and allow us to charge your payment method for this order."})]}),XL="_root_yc33x_1",JL="_securedBySsl_yc33x_8",QL="_iconWrapper_yc33x_18",eA="_text_yc33x_22",f1={root:XL,securedBySsl:JL,iconWrapper:QL,text:eA},L3=()=>l.jsxs("div",{className:f1.securedBySsl,children:[l.jsx("div",{className:f1.iconWrapper,children:l.jsx(Jm,{})}),l.jsx("p",{className:f1.text,children:"Your data is secured by extended validation SSL certificates (256-bit encryption). This complies with the strongest payment security standard available today."})]});var pn=(e=>(e.BankCard="BANK_CARD",e.BankTransfer="BANK_TRANSFER",e.PayPal="PAYPAL",e.CashApp="CASHAPP",e.Crypto="CRYPTO",e.AppleGooglePay="APPLE_AND_GOOGLE_PAY",e.Custom="CUSTOM",e))(pn||{});const tA="_root_1dej8_1",nA="_paymentMethod_1dej8_8",rA="_selected_1dej8_21",aA="_alignColumn_1dej8_24",oA="_paymentText_1dej8_31",iA="_balanceText_1dej8_36",sA="_signInLink_1dej8_40",lA="_iconContainer_1dej8_49",cA="_gatewayLogo_1dej8_57",uA="_poweredByLogo_1dej8_58",dA="_logo_1dej8_63",jn={root:tA,paymentMethod:nA,selected:rA,alignColumn:aA,paymentText:oA,balanceText:iA,signInLink:sA,iconContainer:lA,gatewayLogo:cA,poweredByLogo:uA,logo:dA},hA={[pn.CashApp]:l.jsx(Ix,{}),[pn.AppleGooglePay]:l.jsx(Bx,{}),[pn.BankCard]:l.jsx(Ox,{}),[pn.Crypto]:l.jsx(Dx,{}),[pn.PayPal]:l.jsx(Mx,{}),[pn.Custom]:l.jsx("div",{}),[pn.BankTransfer]:l.jsx($x,{})},fA={[pn.CashApp]:"Cash App",[pn.AppleGooglePay]:"Apple Pay / Google Pay",[pn.BankCard]:"Debit / Credit Card",[pn.Crypto]:"Cryptocurrency",[pn.PayPal]:"PayPal",[pn.Custom]:"",[pn.BankTransfer]:"Bank Transfer"},Kh=({align:e,paymentMethod:t,gatewayDisplayName:n,gateway:r,gatewayLogoCfId:a,poweredByLogoCfId:o,selected:i,onSelect:c})=>{const u=t===pn.Custom;return l.jsxs("div",{className:`${jn.paymentMethod} ${i?jn.selected:""} ${e==="column"?jn.alignColumn:""}`,onClick:()=>c&&c(t),children:[l.jsx("p",{className:jn.paymentText,children:u?n:fA[t]}),l.jsxs("div",{className:jn.iconContainer,children:[u?l.jsx("div",{className:jn.gatewayLogo,children:l.jsx("img",{className:jn.logo,src:gr(a),alt:n})}):hA[t],o&&l.jsx("div",{className:jn.poweredByLogo,children:l.jsx("img",{className:jn.logo,src:gr(o),alt:n})})]})]})},pA="_root_1yw3u_1",mA="_loadingSpinnerWrapper_1yw3u_10",gA="_loadingSpinner_1yw3u_10",vA="_spin_1yw3u_26",yA="_spinnerSizeDefault_1yw3u_26",CA="_spinnerSizeSmall_1yw3u_32",bA="_primary_1yw3u_47",_A="_secondary_1yw3u_54",Ei={root:pA,loadingSpinnerWrapper:mA,loadingSpinner:gA,spin:vA,spinnerSizeDefault:yA,spinnerSizeSmall:CA,primary:bA,secondary:_A},xA={primary:Ei.primary,secondary:Ei.secondary},wA={default:Ei.spinnerSizeDefault,small:Ei.spinnerSizeSmall},vn=({variant:e="primary",size:t="small"})=>l.jsx("div",{className:Ei.loadingSpinnerWrapper,children:l.jsx("div",{className:Ue(Ei.loadingSpinner,xA[e],wA[t])})}),SA="_root_1bd5b_1",jA="_bottomSheet_1bd5b_7",kA="_content_1bd5b_13",EA="_description_1bd5b_16",NA="_buttonGroup_1bd5b_20",TA="_buttonWrapper_1bd5b_31",PA="_fullWidthButton_1bd5b_34",ni={root:SA,bottomSheet:jA,content:kA,description:EA,buttonGroup:NA,buttonWrapper:TA,fullWidthButton:PA},LA=({isActive:e,setIsActive:t,balance:n})=>{const r=ur(),a=()=>{const o=`${pe.get(Wa).TopUp}?redirectRoute=${pe.get(Wa).Checkout}`;r(o)};return l.jsx(xa,{title:"Insufficient Customer Balance",isActive:e,setIsActive:t,children:l.jsxs("div",{className:ni.bottomSheet,children:[l.jsx("div",{className:ni.content,children:l.jsxs("p",{className:ni.description,children:["You currently have ",n&&Vt(n)," in your balance. After topping up the required amount, you can continue to checkout."]})}),l.jsxs("div",{className:ni.buttonGroup,children:[l.jsx("div",{className:ni.buttonWrapper,children:l.jsx(Ee,{type:"Secondary",className:"w-full",onClick:()=>t(!1),children:l.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),l.jsx("div",{className:ni.fullWidthButton,children:l.jsx(Ee,{type:"Primary",className:"w-full",onClick:a,children:l.jsx("span",{className:"text-[var(--text-inverted)]",children:"Add Balance"})})})]})]})})},A3=({align:e,gateway:t,gatewayDisplayName:n,selected:r,onSelect:a,balance:o,total:i,onSignInClick:c})=>{const[u]=me(oo),[d,h]=C.useState(!1),p=()=>{a&&a(t),o&&o.amount<i&&h(!0)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`${jn.paymentMethod} ${r?jn.selected:""} ${e==="column"?jn.alignColumn:""}`,onClick:p,children:[l.jsxs("p",{className:jn.paymentText,children:[n," ",l.jsxs("span",{className:jn.balanceText,children:["(",u?o&&Vt(o):l.jsx("a",{className:jn.signInLink,onClick:c,children:"Sign in"}),")"]})]}),l.jsx("div",{className:jn.iconContainer,children:l.jsx(px,{})})]}),l.jsx(LA,{isActive:d,setIsActive:h,balance:o})]})},AA="_root_kkjng_1",RA="_paymentMethodsContainer_kkjng_8",DA={root:AA,paymentMethodsContainer:RA},R3=({possibleGateways:e,setGateway:t,balance:n,totalAndDiscount:r,onSignInClick:a,setPaymentMethod:o})=>{const[i,c]=C.useState(),[u,d]=C.useState(),[h,p]=C.useState(),[f,y]=C.useState(!1),g=(m,b)=>{t(b),o(m),c(m),d(b)};return C.useEffect(()=>{const m=async()=>{y(!0);const b=await g5([...e.availableGateways,...e.requiresSignInGateways]);p(b),y(!1)};e.availableGateways.length&&m()},[e]),f?l.jsx(vn,{}):l.jsx("div",{className:DA.paymentMethodsContainer,children:h==null?void 0:h.map(m=>m.name==="Balance"?l.jsx(A3,{gateway:m.name,gatewayDisplayName:m.displayName,onSelect:b=>{d(b),t(b)},selected:m.name===u,balance:n,total:r.total,onSignInClick:a},m.name):m.paymentMethods.map(b=>l.jsx(Kh,{paymentMethod:b,gateway:m.name,gatewayDisplayName:m.displayName,gatewayLogoCfId:m.logoCfImageId,poweredByLogoCfId:m.poweredByImageCfImageId,onSelect:()=>g(b,m.name),selected:i===b&&u===m.name},`${m.name}-${b}`)))})},OA=E.array(E.object({name:E.string(),displayName:E.string(),logoCfImageId:E.string(),poweredByImageCfImageId:E.string().optional(),paymentMethods:E.array(E.nativeEnum(pn))})),Rr=tn(async(e,t)=>Xn(await g5(t),OA)).pipe(Fn(null)),IA=E.object({gateways:E.array(E.string()),currency:E.string()}),MA=E.object({topUpBonusEnabled:E.literal(!0),minimumTopUpForBonus:E.number(),bonusPercent:E.number().int()}),BA=E.object({topUpBonusEnabled:E.literal(!1),minimumTopUpForBonus:E.number().optional(),bonusPercent:E.number().int().optional()}),FA=E.object({cashbackEnabled:E.literal(!0),cashbackPercent:E.number().int()}),HA=E.object({cashbackEnabled:E.literal(!1),cashbackPercent:E.number().int().optional()}),$A=IA.and(MA.or(BA).and(FA.or(HA))),VA=E.object({isEnabled:E.literal(!1)}),UA=E.object({isEnabled:E.literal(!0),topUpSettings:$A}),WA=UA.or(VA),Io=tn(async e=>{var t;const n=Xn(await TS(),WA);if(n.isEnabled){const r=(t=n==null?void 0:n.topUpSettings)==null?void 0:t.gateways;r&&Rr(e,r)}return n}).pipe(Fn(null));dr(Io.dataAtom,Io);const qA=E.object({currency:E.string(),manualBalance:E.number(),realBalance:E.number()}),Mo=tn(async()=>{const e=Xn(await NS(),qA);return{amount:e.realBalance+e.manualBalance,currency:e.currency}}).pipe(Fn(null));dr(Mo.dataAtom,Mo);var yd={exports:{}},p1={exports:{}},ct={};/** @license React v16.13.1
139
+ */var qp;function $k(){return qp||(qp=1,process.env.NODE_ENV!=="production"&&function(){typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error);var e=C,t=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function n(x){{for(var j=arguments.length,k=new Array(j>1?j-1:0),L=1;L<j;L++)k[L-1]=arguments[L];r("error",x,k)}}function r(x,j,k){{var L=t.ReactDebugCurrentFrame,D=L.getStackAddendum();D!==""&&(j+="%s",k=k.concat([D]));var S=k.map(function(T){return String(T)});S.unshift("Warning: "+j),Function.prototype.apply.call(console[x],console,S)}}function a(x,j){return x===j&&(x!==0||1/x===1/j)||x!==x&&j!==j}var o=typeof Object.is=="function"?Object.is:a,i=e.useState,c=e.useEffect,u=e.useLayoutEffect,d=e.useDebugValue,h=!1,p=!1;function f(x,j,k){h||e.startTransition!==void 0&&(h=!0,n("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var L=j();if(!p){var D=j();o(L,D)||(n("The result of getSnapshot should be cached to avoid an infinite loop"),p=!0)}var S=i({inst:{value:L,getSnapshot:j}}),T=S[0].inst,I=S[1];return u(function(){T.value=L,T.getSnapshot=j,y(T)&&I({inst:T})},[x,L,j]),c(function(){y(T)&&I({inst:T});var A=function(){y(T)&&I({inst:T})};return x(A)},[x]),d(L),L}function y(x){var j=x.getSnapshot,k=x.value;try{var L=j();return!o(k,L)}catch{return!0}}function g(x,j,k){return j()}var m=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",b=!m,w=b?g:f,_=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:w;Wp.useSyncExternalStore=_,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error)}()),Wp}process.env.NODE_ENV==="production"?dd.exports=Hk():dd.exports=$k();var Vk=dd.exports;const Uk=ul(Vk);var{useSyncExternalStore:Wk}=Uk,qk=()=>()=>{};function pr(e,t=k5){const n=H.useCallback(a=>e?R5(e,null,a):qk(),[e]),r=()=>{const a=typeof t=="string"?t:null,o=typeof t=="function"?t:null,i=e==null?void 0:e.getState();if(o)return o(i);if(i&&a&&Ya(i,a))return i[a]};return Wk(n,r,r)}function lr(e,t,n,r){const a=Ya(t,n)?t[n]:void 0,o=r?t[r]:void 0,i=L5({value:a,setValue:o});Et(()=>Ka(e,[n],(c,u)=>{const{value:d,setValue:h}=i.current;h&&c[n]!==u[n]&&c[n]!==d&&h(c[n])}),[e,n]),Et(()=>{if(a!==void 0)return e.setState(n,a),ud(e,[n],()=>{a!==void 0&&e.setState(n,a)})})}function _u(e,t){const[n,r]=H.useState(()=>e(t));Et(()=>Cu(n),[n]);const a=H.useCallback(c=>pr(n,c),[n]),o=H.useMemo(()=>je(he({},n),{useState:a}),[n,a]),i=Ye(()=>{r(c=>e(he(he({},t),c.getState())))});return[o,i]}function zk(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function Zk(e){const t=e.map((r,a)=>[a,r]);let n=!1;return t.sort(([r,a],[o,i])=>{const c=a.element,u=i.element;return c===u||!c||!u?0:zk(c,u)?(r>o&&(n=!0),-1):(r<o&&(n=!0),1)}),n?t.map(([r,a])=>a):e}function Gk(e){var t;const n=e.find(o=>!!o.element),r=[...e].reverse().find(o=>!!o.element);let a=(t=n==null?void 0:n.element)==null?void 0:t.parentElement;for(;a&&r!=null&&r.element;){if(r&&a.contains(r.element))return a;a=a.parentElement}return It(a).body}function Yk(e){return e==null?void 0:e.__unstablePrivateStore}function Kk(e={}){var t;bu(e,e.store);const n=(t=e.store)==null?void 0:t.getState(),r=St(e.items,n==null?void 0:n.items,e.defaultItems,[]),a=new Map(r.map(f=>[f.id,f])),o={items:r,renderedItems:St(n==null?void 0:n.renderedItems,[])},i=Yk(e.store),c=vr({items:r,renderedItems:o.renderedItems},i),u=vr(o,e.store),d=f=>{const y=Zk(f);c.setState("renderedItems",y),u.setState("renderedItems",y)};To(u,()=>Cu(c)),To(c,()=>ud(c,["items"],f=>{u.setState("items",f.items)})),To(c,()=>ud(c,["renderedItems"],f=>{let y=!0,g=requestAnimationFrame(()=>{const{renderedItems:_}=u.getState();f.renderedItems!==_&&d(f.renderedItems)});if(typeof IntersectionObserver!="function")return()=>cancelAnimationFrame(g);const m=()=>{if(y){y=!1;return}cancelAnimationFrame(g),g=requestAnimationFrame(()=>d(f.renderedItems))},b=Gk(f.renderedItems),w=new IntersectionObserver(m,{root:b});for(const _ of f.renderedItems)_.element&&w.observe(_.element);return()=>{cancelAnimationFrame(g),w.disconnect()}}));const h=(f,y,g=!1)=>{let m;return y(b=>{const w=b.findIndex(({id:x})=>x===f.id),_=b.slice();if(w!==-1){m=b[w];const x=Ht(Ht({},m),f);_[w]=x,a.set(f.id,x)}else _.push(f),a.set(f.id,f);return _}),()=>{y(b=>{if(!m)return g&&a.delete(f.id),b.filter(({id:x})=>x!==f.id);const w=b.findIndex(({id:x})=>x===f.id);if(w===-1)return b;const _=b.slice();return _[w]=m,a.set(f.id,m),_})}},p=f=>h(f,y=>c.setState("items",y),!0);return Gn(Ht({},u),{registerItem:p,renderItem:f=>Yn(p(f),h(f,y=>c.setState("renderedItems",y))),item:f=>{if(!f)return null;let y=a.get(f);if(!y){const{items:g}=u.getState();y=g.find(m=>m.id===f),y&&a.set(f,y)}return y||null},__unstablePrivateStore:c})}function Xk(e,t,n){return yu(t,[n.store]),lr(e,n,"items","setItems"),e}function rt(e){const t=H.forwardRef((n,r)=>e(je(he({},n),{ref:r})));return t.displayName=e.displayName||e.name,t}function Wo(e,t){return H.memo(e,t)}function ut(e,t){const n=t,{wrapElement:r,render:a}=n,o=mt(n,["wrapElement","render"]),i=Cn(t.ref,jk(a));let c;if(H.isValidElement(a)){const u=je(he({},a.props),{ref:i});c=H.cloneElement(a,kk(o,u))}else a?c=a(o):c=l.jsx(e,he({},o));return r?r(c):c}function gt(e){const t=(n={})=>e(n);return t.displayName=e.name,t}function Sa(e=[],t=[]){const n=H.createContext(void 0),r=H.createContext(void 0),a=()=>H.useContext(n),o=(u=!1)=>{const d=H.useContext(r),h=a();return u?d:d||h},i=()=>{const u=H.useContext(r),d=a();if(!(u&&u===d))return d},c=u=>e.reduceRight((d,h)=>l.jsx(h,je(he({},u),{children:d})),l.jsx(n.Provider,he({},u)));return{context:n,scopedContext:r,useContext:a,useScopedContext:o,useProviderContext:i,ContextProvider:c,ScopedContextProvider:u=>l.jsx(c,je(he({},u),{children:t.reduceRight((d,h)=>l.jsx(h,je(he({},u),{children:d})),l.jsx(r.Provider,he({},u)))}))}}var _h=Sa(),Jk=_h.useContext,I5=_h.ContextProvider,M5=_h.ScopedContextProvider,Qk="div",yl=gt(function(e){var t=e,{store:n,shouldRegisterItem:r=!0,getItem:a=k5,element:o}=t,i=mt(t,["store","shouldRegisterItem","getItem","element"]);const c=Jk();n=n||c;const u=lo(i.id),d=C.useRef(o);return C.useEffect(()=>{const h=d.current;if(!u||!h||!r)return;const p=a({id:u,element:h});return n==null?void 0:n.renderItem(p)},[u,r,a,n]),i=je(he({},i),{ref:Cn(d,i.ref)}),Ii(i)});rt(function(e){const t=yl(e);return ut(Qk,t)});var B5=C.createContext(!0),xh="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";function eE(e){return Number.parseInt(e.getAttribute("tabindex")||"0",10)<0}function Qr(e){return!(!e.matches(xh)||!E5(e)||e.closest("[inert]"))}function Vc(e){if(!Qr(e)||eE(e))return!1;if(!("form"in e)||!e.form||e.checked||e.type!=="radio")return!0;const t=e.form.elements.namedItem(e.name);if(!t||!("length"in t))return!0;const n=so(e);return!n||n===e||!("form"in n)||n.form!==e.form||n.name!==e.name}function wh(e,t){const n=Array.from(e.querySelectorAll(xh));t&&n.unshift(e);const r=n.filter(Qr);return r.forEach((a,o)=>{if(gh(a)&&a.contentDocument){const i=a.contentDocument.body;r.splice(o,1,...wh(i))}}),r}function xu(e,t,n){const r=Array.from(e.querySelectorAll(xh)),a=r.filter(Vc);return t&&Vc(e)&&a.unshift(e),a.forEach((o,i)=>{if(gh(o)&&o.contentDocument){const c=o.contentDocument.body,u=xu(c,!1,n);a.splice(i,1,...u)}}),!a.length&&n?r:a}function F5(e,t,n){const[r]=xu(e,t,n);return r||null}function tE(e,t,n,r){const a=so(e),o=wh(e,t),i=o.indexOf(a);return o.slice(i+1).find(Vc)||null||null||null}function r1(e,t){return tE(document.body,!1)}function nE(e,t,n,r){const a=so(e),o=wh(e,t).reverse(),i=o.indexOf(a);return o.slice(i+1).find(Vc)||null||null||null}function zp(e,t){return nE(document.body,!1)}function Zp(e){const t=so(e);if(!t)return!1;if(t===e)return!0;const n=t.getAttribute("aria-activedescendant");return n?n===e.id:!1}function H5(e){const t=so(e);if(!t)return!1;if(Xt(e,t))return!0;const n=t.getAttribute("aria-activedescendant");return!n||!("id"in e)?!1:n===e.id?!0:!!e.querySelector(`#${CSS.escape(n)}`)}function $5(e){!H5(e)&&Qr(e)&&e.focus()}function rE(e){var t;const n=(t=e.getAttribute("tabindex"))!=null?t:"";e.setAttribute("data-tabindex",n),e.setAttribute("tabindex","-1")}function aE(e,t){const n=xu(e,t);for(const r of n)rE(r)}function oE(e){const t=e.querySelectorAll("[data-tabindex]"),n=r=>{const a=r.getAttribute("data-tabindex");r.removeAttribute("data-tabindex"),a?r.setAttribute("tabindex",a):r.removeAttribute("tabindex")};e.hasAttribute("data-tabindex")&&n(e);for(const r of t)n(r)}var iE="div",Gp=vh(),sE=["text","search","url","tel","email","password","number","date","month","week","time","datetime","datetime-local"];function lE(e){const{tagName:t,readOnly:n,type:r}=e;return t==="TEXTAREA"&&!n||t==="SELECT"&&!n?!0:t==="INPUT"&&!n?sE.includes(r):!!(e.isContentEditable||e.getAttribute("role")==="combobox"&&e.dataset.name)}function cE(e){return"labels"in e?e.labels:null}function Yp(e){return e.tagName.toLowerCase()==="input"&&e.type?e.type==="radio"||e.type==="checkbox":!1}function uE(e){return e?e==="button"||e==="summary"||e==="input"||e==="select"||e==="textarea"||e==="a":!0}function dE(e){return e?e==="button"||e==="input"||e==="select"||e==="textarea":!0}function hE(e,t,n,r,a){return e?t?n&&!r?-1:void 0:n?a:a||0:a}function a1(e,t){return Ye(n=>{e==null||e(n),!n.defaultPrevented&&t&&(n.stopPropagation(),n.preventDefault())})}var Sh=!0;function fE(e){const t=e.target;t&&"hasAttribute"in t&&(t.hasAttribute("data-focus-visible")||(Sh=!1))}function pE(e){e.metaKey||e.ctrlKey||e.altKey||(Sh=!0)}var Cl=gt(function(e){var t=e,{focusable:n=!0,accessibleWhenDisabled:r,autoFocus:a,onFocusVisible:o}=t,i=mt(t,["focusable","accessibleWhenDisabled","autoFocus","onFocusVisible"]);const c=C.useRef(null);C.useEffect(()=>{n&&(gn("mousedown",fE,!0),gn("keydown",pE,!0))},[n]),Gp&&C.useEffect(()=>{if(!n)return;const G=c.current;if(!G||!Yp(G))return;const Q=cE(G);if(!Q)return;const oe=()=>queueMicrotask(()=>G.focus());for(const le of Q)le.addEventListener("mouseup",oe);return()=>{for(const le of Q)le.removeEventListener("mouseup",oe)}},[n]);const u=n&&vl(i),d=!!u&&!r,[h,p]=C.useState(!1);C.useEffect(()=>{n&&d&&h&&p(!1)},[n,d,h]),C.useEffect(()=>{if(!n||!h)return;const G=c.current;if(!G||typeof IntersectionObserver>"u")return;const Q=new IntersectionObserver(()=>{Qr(G)||p(!1)});return Q.observe(G),()=>Q.disconnect()},[n,h]);const f=a1(i.onKeyPressCapture,u),y=a1(i.onMouseDownCapture,u),g=a1(i.onClickCapture,u),m=i.onMouseDown,b=Ye(G=>{if(m==null||m(G),G.defaultPrevented||!n)return;const Q=G.currentTarget;if(!Gp||P5(G)||!Ca(Q)&&!Yp(Q))return;let oe=!1;const le=()=>{oe=!0},de={capture:!0,once:!0};Q.addEventListener("focusin",le,de),ws(Q,"mouseup",()=>{Q.removeEventListener("focusin",le,!0),!oe&&$5(Q)})}),w=(G,Q)=>{if(Q&&(G.currentTarget=Q),!n)return;const oe=G.currentTarget;oe&&Zp(oe)&&(o==null||o(G),!G.defaultPrevented&&p(!0))},_=i.onKeyDownCapture,x=Ye(G=>{if(_==null||_(G),G.defaultPrevented||!n||h||G.metaKey||G.altKey||G.ctrlKey||!Si(G))return;const Q=G.currentTarget;ws(Q,"focusout",()=>w(G,Q))}),j=i.onFocusCapture,k=Ye(G=>{if(j==null||j(G),G.defaultPrevented||!n)return;if(!Si(G)){p(!1);return}const Q=G.currentTarget,oe=()=>w(G,Q);Sh||lE(G.target)?ws(G.target,"focusout",oe):p(!1)}),L=i.onBlur,D=Ye(G=>{L==null||L(G),n&&ui(G)&&p(!1)}),S=C.useContext(B5),T=Ye(G=>{n&&a&&G&&S&&queueMicrotask(()=>{Zp(G)||Qr(G)&&G.focus()})}),I=Bi(c),A=n&&uE(I),U=n&&dE(I),K=i.style,X=C.useMemo(()=>d?he({pointerEvents:"none"},K):K,[d,K]);return i=je(he({"data-focus-visible":n&&h||void 0,"data-autofocus":a||void 0,"aria-disabled":u||void 0},i),{ref:Cn(c,T,i.ref),style:X,tabIndex:hE(n,d,A,U,i.tabIndex),disabled:U&&d?!0:void 0,contentEditable:u?void 0:i.contentEditable,onKeyPressCapture:f,onClickCapture:g,onMouseDownCapture:y,onMouseDown:b,onKeyDownCapture:x,onFocusCapture:k,onBlur:D}),Ii(i)});rt(function(e){const t=Cl(e);return ut(iE,t)});var mE="button";function Kp(e){if(!e.isTrusted)return!1;const t=e.currentTarget;return e.key==="Enter"?Ca(t)||t.tagName==="SUMMARY"||t.tagName==="A":e.key===" "?Ca(t)||t.tagName==="SUMMARY"||t.tagName==="INPUT"||t.tagName==="SELECT":!1}var gE=Symbol("command"),jh=gt(function(e){var t=e,{clickOnEnter:n=!0,clickOnSpace:r=!0}=t,a=mt(t,["clickOnEnter","clickOnSpace"]);const o=C.useRef(null),i=Bi(o),c=a.type,[u,d]=C.useState(()=>!!i&&Ca({tagName:i,type:c}));C.useEffect(()=>{o.current&&d(Ca(o.current))},[]);const[h,p]=C.useState(!1),f=C.useRef(!1),y=vl(a),[g,m]=Ik(a,gE,!0),b=a.onKeyDown,w=Ye(j=>{b==null||b(j);const k=j.currentTarget;if(j.defaultPrevented||g||y||!Si(j)||Uo(k)||k.isContentEditable)return;const L=n&&j.key==="Enter",D=r&&j.key===" ",S=j.key==="Enter"&&!n,T=j.key===" "&&!r;if(S||T){j.preventDefault();return}if(L||D){const I=Kp(j);if(L){if(!I){j.preventDefault();const A=j,U=mt(A,["view"]),K=()=>Bp(k,U);Rk()?ws(k,"keyup",K):queueMicrotask(K)}}else D&&(f.current=!0,I||(j.preventDefault(),p(!0)))}}),_=a.onKeyUp,x=Ye(j=>{if(_==null||_(j),j.defaultPrevented||g||y||j.metaKey)return;const k=r&&j.key===" ";if(f.current&&k&&(f.current=!1,!Kp(j))){j.preventDefault(),p(!1);const L=j.currentTarget,D=j,S=mt(D,["view"]);queueMicrotask(()=>Bp(L,S))}});return a=je(he(he({"data-active":h||void 0,type:u?"button":void 0},m),a),{ref:Cn(o,a.ref),onKeyDown:w,onKeyUp:x}),a=Cl(a),a});rt(function(e){const t=jh(e);return ut(mE,t)});var V5="button",kh=gt(function(e){const t=C.useRef(null),n=Bi(t,V5),[r,a]=C.useState(()=>!!n&&Ca({tagName:n,type:e.type}));return C.useEffect(()=>{t.current&&a(Ca(t.current))},[]),e=je(he({role:!r&&n!=="a"?"button":void 0},e),{ref:Cn(t,e.ref)}),e=jh(e),e});rt(function(e){const t=kh(e);return ut(V5,t)});function Xp(){return new Promise(e=>requestAnimationFrame(()=>e()))}function fc(e){return Object.keys(e).some(t=>Hc(e[t])?fc(e[t]):!!e[t])}function ha(e,t,n){var r;const[a,...o]=Array.isArray(t)?t:`${t}`.split(".");return a==null||!e?n:o.length?ha(e[a],o,n):(r=e[a])!=null?r:n}function di(e,t,n){const[r,...a]=Array.isArray(t)?t:`${t}`.split(".");if(r==null)return e;const o=r,i=Ck(o),c=(i?e||[]:e||{})[o],u=a.length&&(Array.isArray(c)||Hc(c))?di(c,a,n):n;if(i){const d=Number(o);if(e&&Array.isArray(e))return[...e.slice(0,d),u,...e.slice(d+1)];const h=[];return h[d]=u,h}return Gn(Ht({},e),{[o]:u})}function hd(e,t){const n={},r=Object.keys(e);for(const a of r){const o=e[a];Array.isArray(o)?n[a]=o.map(i=>Hc(i)?hd(i,t):t):Hc(o)?n[a]=hd(o,t):n[a]=t}return n}function U5(e,t=[]){return{get(n,r){if(["toString","valueOf",Symbol.toPrimitive].includes(r))return()=>t.join(".");const a=[...t,r],o=a.join(".");if(e[o])return e[o];const i=new Proxy(n,U5(e,a));return e[o]=i,i}}}function vE(e){return e==null?void 0:e.__unstableCallbacks}function yE(){const e=Object.create(null);return new Proxy(Object.create(null),U5(e))}function CE(e={}){var t;bu(e,e.store);const n=(t=e.store)==null?void 0:t.getState(),r=Kk(e),a=St(e.values,n==null?void 0:n.values,e.defaultValues,{}),o=St(e.errors,n==null?void 0:n.errors,e.defaultErrors,{}),i=St(e.touched,n==null?void 0:n.touched,e.defaultTouched,{}),c=Gn(Ht({},r.getState()),{values:a,errors:o,touched:i,validating:St(n==null?void 0:n.validating,!1),submitting:St(n==null?void 0:n.submitting,!1),submitSucceed:St(n==null?void 0:n.submitSucceed,0),submitFailed:St(n==null?void 0:n.submitFailed,0),valid:!fc(o)}),u=vr(c,r,e.store),d=vE(e.store),h=d==null?void 0:d.getState(),p={validate:(h==null?void 0:h.validate)||[],submit:(h==null?void 0:h.submit)||[]},f=vr(p,d);To(u,()=>Cu(f));const y=async()=>{u.setState("validating",!0),u.setState("errors",{});const g=f.getState().validate;try{for(const m of g)await m(u.getState());return await Xp(),!fc(u.getState().errors)}finally{u.setState("validating",!1)}};return Gn(Ht(Ht({},r),u),{names:yE(),setValues:g=>u.setState("values",g),getValue:g=>ha(u.getState().values,g),setValue:(g,m)=>u.setState("values",b=>{const w=ha(b,g),_=hc(m,w);return _===w?b:di(b,g,_)}),pushValue:(g,m)=>u.setState("values",b=>{const w=ha(b,g,[]);return di(b,g,[...w,m])}),removeValue:(g,m)=>u.setState("values",b=>{const w=ha(b,g,[]);return di(b,g,[...w.slice(0,m),null,...w.slice(m+1)])}),setErrors:g=>u.setState("errors",g),getError:g=>ha(u.getState().errors,g),setError:(g,m)=>u.setState("errors",b=>{const w=ha(b,g),_=hc(m,w);return _===w?b:di(b,g,_)}),setTouched:g=>u.setState("touched",g),getFieldTouched:g=>!!ha(u.getState().touched,g),setFieldTouched:(g,m)=>u.setState("touched",b=>{const w=ha(b,g),_=hc(m,w);return _===w?b:di(b,g,_)}),onValidate:g=>(f.setState("validate",m=>[...m,g]),()=>{f.setState("validate",m=>m.filter(b=>b!==g))}),validate:y,onSubmit:g=>(f.setState("submit",m=>[...m,g]),()=>{f.setState("submit",m=>m.filter(b=>b!==g))}),submit:async()=>{u.setState("submitting",!0),u.setState("touched",hd(u.getState().values,!0));try{if(await y()){const g=f.getState().submit;for(const m of g)await m(u.getState());if(await Xp(),!fc(u.getState().errors))return u.setState("submitSucceed",m=>m+1),!0}return u.setState("submitFailed",g=>g+1),!1}catch(g){throw u.setState("submitFailed",m=>m+1),g}finally{u.setState("submitting",!1)}},reset:()=>{u.setState("values",a),u.setState("errors",o),u.setState("touched",i),u.setState("validating",!1),u.setState("submitting",!1),u.setState("submitSucceed",0),u.setState("submitFailed",0)},__unstableCallbacks:f})}function bE(e,t,n){e=Xk(e,t,n),lr(e,n,"values","setValues"),lr(e,n,"errors","setErrors"),lr(e,n,"touched","setTouched");const r=C.useCallback(i=>e.useState(()=>e.getValue(i)),[e]),a=C.useCallback(i=>{i=Ye(i);const c=e.useState("items");C.useEffect(()=>e.onValidate(i),[c,i])},[e]),o=C.useCallback(i=>{i=Ye(i);const c=e.useState("items");C.useEffect(()=>e.onSubmit(i),[c,i])},[e]);return C.useMemo(()=>je(he({},e),{useValue:r,useValidate:a,useSubmit:o}),[])}function qo(e={}){const[t,n]=_u(CE,e);return bE(t,n,e)}var W5=Sa([I5],[M5]),zo=W5.useContext,_E=W5.ScopedContextProvider,q5="form";function xE(e,t){return t.some(n=>n.type==="field"&&n.element===e)}function wE(e){return e.find(t=>{var n;return t.type==="field"&&((n=t.element)==null?void 0:n.getAttribute("aria-invalid"))==="true"})}var SE=gt(function(e){var t=e,{store:n,validateOnChange:r=!0,validateOnBlur:a=!0,resetOnUnmount:o=!1,resetOnSubmit:i=!0,autoFocusOnSubmit:c=!0}=t,u=mt(t,["store","validateOnChange","validateOnBlur","resetOnUnmount","resetOnSubmit","autoFocusOnSubmit"]);const d=zo();n=n||d,$n(n,process.env.NODE_ENV!=="production"&&"Form must receive a `store` prop or be wrapped in a FormProvider component.");const h=C.useRef(null),p=n.useState("values"),f=n.useState("submitSucceed"),y=n.useState("submitFailed"),g=n.useState("items"),m=Ok(p);C.useEffect(()=>o?n==null?void 0:n.reset:void 0,[o,n]),yu(()=>{r&&p!==m&&(n==null||n.validate())},[r,p,m,n]),C.useEffect(()=>{i&&f&&(n==null||n.reset())},[i,f,n]);const[b,w]=C.useState(!1);C.useEffect(()=>{if(!b||!y)return;const T=wE(g),I=T==null?void 0:T.element;I&&(w(!1),I.focus(),Uo(I)&&I.select())},[c,y,g]);const _=u.onSubmit,x=Ye(T=>{_==null||_(T),!T.defaultPrevented&&(T.preventDefault(),n==null||n.submit(),c&&w(!0))}),j=u.onBlur,k=Ye(T=>{j==null||j(T),!T.defaultPrevented&&a&&n&&xE(T.target,n.getState().items)&&n.validate()}),L=u.onReset,D=Ye(T=>{L==null||L(T),!T.defaultPrevented&&(T.preventDefault(),n==null||n.reset())});u=qn(u,T=>l.jsx(_E,{value:n,children:T}),[n]);const S=Bi(h,q5);return u=je(he({role:S!=="form"?"form":void 0,noValidate:!0},u),{ref:Cn(h,u.ref),onSubmit:x,onBlur:k,onReset:D}),u}),Zo=rt(function(e){const t=SE(e);return ut(q5,t)}),jE="input";function kE(e,t){const n=e.current;return n?n.name===t?n:n.form?n.form.elements.namedItem(t):It(n).getElementsByName(t)[0]:null}function o1(e,t,n){return e.useState(r=>r.items.find(a=>a.type===n&&a.name===t))}var Eh=gt(function(e){var t=e,{store:n,name:r,getItem:a,touchOnBlur:o=!0}=t,i=mt(t,["store","name","getItem","touchOnBlur"]);const c=zo();n=n||c,$n(n,process.env.NODE_ENV!=="production"&&"FormControl must be wrapped in a Form component.");const u=`${r}`,d=lo(i.id),h=C.useRef(null);n.useValidate(async()=>{const j=kE(h,u);j&&(await Promise.resolve(),"validity"in j&&!j.validity.valid&&(n==null||n.setError(u,j.validationMessage)))});const p=C.useCallback(j=>{const k=je(he({},j),{id:d||j.id,name:u,type:"field"});return a?a(k):k},[d,u,a]),f=i.onBlur,y=ga(o),g=Ye(j=>{f==null||f(j),!j.defaultPrevented&&y(j)&&(n==null||n.setFieldTouched(u,!0))}),m=o1(n,u,"label"),b=o1(n,u,"error"),w=o1(n,u,"description"),_=bk(b==null?void 0:b.id,w==null?void 0:w.id,i["aria-describedby"]),x=n.useState(()=>!!(n!=null&&n.getError(u))&&n.getFieldTouched(u));return i=je(he({id:d,"aria-labelledby":m==null?void 0:m.id,"aria-invalid":x},i),{"aria-describedby":_||void 0,ref:Cn(h,i.ref),onBlur:g}),i=yl(je(he({store:n},i),{name:u,getItem:p})),i}),EE=Wo(rt(function(e){const t=Eh(e);return ut(jE,t)})),NE="div",TE=gt(function(e){var t=e,{store:n,name:r,getItem:a}=t,o=mt(t,["store","name","getItem"]);const i=zo();n=n||i,$n(n,process.env.NODE_ENV!=="production"&&"FormError must be wrapped in a Form component.");const c=lo(o.id),u=C.useRef(null),d=`${r}`,h=C.useCallback(f=>{const y=je(he({},f),{id:c||f.id,name:d,type:"error"});return a?a(y):y},[c,d,a]),p=n.useState(()=>{const f=n==null?void 0:n.getError(d);if(f!=null&&n!=null&&n.getFieldTouched(d))return f});return o=je(he({id:c,role:"alert",children:p},o),{ref:Cn(u,o.ref)}),o=yl(je(he({store:n},o),{getItem:h})),o}),Xa=Wo(rt(function(e){const t=TE(e);return ut(NE,t)})),PE=C.createContext(void 0),LE="div",z5=gt(function(e){const[t,n]=C.useState();return e=qn(e,r=>l.jsx(PE.Provider,{value:n,children:r}),[]),e=he({role:"group","aria-labelledby":t},e),Ii(e)});rt(function(e){const t=z5(e);return ut(LE,t)});var AE="div",Z5=gt(function(e){var t=e,n=mt(t,["store"]);return n=z5(n),n});rt(function(e){const t=Z5(e);return ut(AE,t)});var RE="input",DE=gt(function(e){var t=e,{store:n,name:r}=t,a=mt(t,["store","name"]);const o=zo();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"FormInput must be wrapped in a Form component.");const i=`${r}`,c=a.onChange,u=Ye(h=>{c==null||c(h),!h.defaultPrevented&&(n==null||n.setValue(i,h.target.value))}),d=n.useValue(i);return a=je(he({value:d},a),{onChange:u}),a=Cl(a),a=Eh(he({store:n,name:i},a)),a}),Hi=Wo(rt(function(e){const t=DE(e);return ut(RE,t)})),OE="label";function IE(e){return e==="input"||e==="textarea"||e==="select"||e==="meter"||e==="progress"}var ME=gt(function(e){var t=e,{store:n,name:r,getItem:a}=t,o=mt(t,["store","name","getItem"]);const i=zo();n=n||i,$n(n,process.env.NODE_ENV!=="production"&&"FormLabel must be wrapped in a Form component.");const c=lo(o.id),u=C.useRef(null),d=`${r}`,h=C.useCallback(b=>{const w=je(he({},b),{id:c||b.id,name:d,type:"label"});return a?a(w):w},[c,d,a]),p=n.useState(b=>b.items.find(w=>w.type==="field"&&w.name===d)),f=Bi(p==null?void 0:p.element,"input"),y=IE(f),g=o.onClick,m=Ye(b=>{if(g==null||g(b),b.defaultPrevented||y)return;const w=p==null?void 0:p.element;w&&queueMicrotask(()=>{const _=F5(w,!0,!0);_==null||_.focus(),(_==null?void 0:_.getAttribute("role"))!=="combobox"&&(_==null||_.click())})});return o=je(he({id:c,render:y?l.jsx("label",{}):l.jsx("span",{}),htmlFor:y?p==null?void 0:p.id:void 0},o),{ref:Cn(u,o.ref),onClick:m}),y||(o=je(he({},o),{style:he({cursor:"default"},o.style)})),o=yl(je(he({store:n},o),{getItem:h})),o}),bl=Wo(rt(function(e){const t=ME(e);return ut(OE,t)})),BE="div",FE=gt(function(e){var t=e,n=mt(t,["store"]);return n=he({role:"radiogroup"},n),n=Z5(n),n}),HE=rt(function(e){const t=FE(e);return ut(BE,t)}),Nh=Sa([I5],[M5]),$E=Nh.useContext,VE=Nh.ContextProvider,UE=Nh.ScopedContextProvider,WE=C.createContext(void 0),qE=C.createContext(void 0),zE=Sa([VE],[UE]),ZE=zE.useContext;function GE(e,t){return t&&e.item(t)||null}function YE(e,t=!1){if(Uo(e))e.setSelectionRange(t?e.value.length:0,e.value.length);else if(e.isContentEditable){const n=It(e).getSelection();n==null||n.selectAllChildren(e),t&&(n==null||n.collapseToEnd())}}var KE=Symbol("FOCUS_SILENTLY");function XE(e){e[KE]=!0,e.focus({preventScroll:!0})}function G5(e,t,n){return!(!t||t===n||!e.item(t.id))}var JE="button";function QE(e){return cd(e)?!0:e.tagName==="INPUT"&&!Ca(e)}function eN(e,t=!1){const n=e.clientHeight,{top:r}=e.getBoundingClientRect(),a=Math.max(n*.875,n-40)*1.5,o=t?n-a+r:a+r;return e.tagName==="HTML"?o+e.scrollTop:o}function tN(e,t=!1){const{top:n}=e.getBoundingClientRect();return t?n+e.clientHeight:n}function Jp(e,t,n,r=!1){var a;if(!t||!n)return;const{renderedItems:o}=t.getState(),i=N5(e);if(!i)return;const c=eN(i,r);let u,d;for(let h=0;h<o.length;h+=1){const p=u;if(u=n(h),!u)break;if(u===p)continue;const f=(a=GE(t,u))==null?void 0:a.element;if(!f)continue;const y=tN(f,r)-c,g=Math.abs(y);if(r&&y<=0||!r&&y>=0){d!==void 0&&d<g&&(u=p);break}d=g}return u}function nN(e,t){return Si(e)?!1:G5(t,e.target)}function rN(e,t){const n=t.role,[r,a]=C.useState(n);return Et(()=>{const o=e.current;o&&a(o.getAttribute("role")||n)},[n]),r}function aN(e){return e==="option"||e==="treeitem"}function oN(e){return e==="option"||e==="tab"||e==="treeitem"||e==="gridcell"||e==="row"||e==="columnheader"||e==="rowheader"}var Y5=gt(function(e){var t=e,{store:n,rowId:r,preventScrollOnKeyDown:a=!1,moveOnKeyPress:o=!0,tabbable:i=!1,getItem:c,"aria-setsize":u,"aria-posinset":d}=t,h=mt(t,["store","rowId","preventScrollOnKeyDown","moveOnKeyPress","tabbable","getItem","aria-setsize","aria-posinset"]);const p=$E();n=n||p;const f=lo(h.id),y=C.useRef(null),g=C.useContext(qE),m=pr(n,B=>{if(r)return r;if(B&&g!=null&&g.baseElement&&g.baseElement===B.baseElement)return g.id}),b=vl(h)&&!h.accessibleWhenDisabled,w=C.useCallback(B=>{const V=je(he({},B),{id:f||B.id,rowId:m,disabled:!!b});return c?c(V):V},[f,m,b,c]),_=h.onFocus,x=C.useRef(!1),j=Ye(B=>{if(_==null||_(B),B.defaultPrevented||P5(B)||!f||!n||nN(B,n))return;const{virtualFocus:V,baseElement:F}=n.getState();n.setActiveId(f),cd(B.currentTarget)&&YE(B.currentTarget),!(!V||!Si(B)||QE(B.currentTarget)||!(F!=null&&F.isConnected))&&(vh()&&B.currentTarget.hasAttribute("data-autofocus")&&B.currentTarget.scrollIntoView({block:"nearest",inline:"nearest"}),x.current=!0,B.relatedTarget===F||G5(n,B.relatedTarget)?XE(F):F.focus())}),k=h.onBlurCapture,L=Ye(B=>{if(k==null||k(B),B.defaultPrevented)return;const V=n==null?void 0:n.getState();V!=null&&V.virtualFocus&&x.current&&(x.current=!1,B.preventDefault(),B.stopPropagation())}),D=h.onKeyDown,S=ga(a),T=ga(o),I=Ye(B=>{if(D==null||D(B),B.defaultPrevented||!Si(B)||!n)return;const{currentTarget:V}=B,F=n.getState(),W=n.item(f),J=!!(W!=null&&W.rowId),fe=F.orientation!=="horizontal",ee=F.orientation!=="vertical",re=()=>!!(J||ee||!F.baseElement||!Uo(F.baseElement)),se={ArrowUp:(J||fe)&&n.up,ArrowRight:(J||ee)&&n.next,ArrowDown:(J||fe)&&n.down,ArrowLeft:(J||ee)&&n.previous,Home:()=>{if(re())return!J||B.ctrlKey?n==null?void 0:n.first():n==null?void 0:n.previous(-1)},End:()=>{if(re())return!J||B.ctrlKey?n==null?void 0:n.last():n==null?void 0:n.next(-1)},PageUp:()=>Jp(V,n,n==null?void 0:n.up,!0),PageDown:()=>Jp(V,n,n==null?void 0:n.down)}[B.key];if(se){if(cd(V)){const ae=Lk(V),Oe=ee&&B.key==="ArrowLeft",q=ee&&B.key==="ArrowRight",Ce=fe&&B.key==="ArrowUp",xe=fe&&B.key==="ArrowDown";if(q||xe){const{length:Ae}=Pk(V);if(ae.end!==Ae)return}else if((Oe||Ce)&&ae.start!==0)return}const ge=se();if(S(B)||ge!==void 0){if(!T(B))return;B.preventDefault(),n.move(ge)}}}),A=pr(n,B=>(B==null?void 0:B.baseElement)||void 0),U=C.useMemo(()=>({id:f,baseElement:A}),[f,A]);h=qn(h,B=>l.jsx(WE.Provider,{value:U,children:B}),[U]);const K=pr(n,B=>!!B&&B.activeId===f),X=pr(n,"virtualFocus"),G=rN(y,h);let Q;K&&(aN(G)||X&&oN(G))&&(Q=!0);const oe=pr(n,B=>{if(u!=null)return u;if(B&&g!=null&&g.ariaSetSize&&g.baseElement===B.baseElement)return g.ariaSetSize}),le=pr(n,B=>{if(d!=null)return d;if(!B||!(g!=null&&g.ariaPosInSet)||g.baseElement!==B.baseElement)return;const V=B.renderedItems.filter(F=>F.rowId===m);return g.ariaPosInSet+V.findIndex(F=>F.id===f)}),de=pr(n,B=>B!=null&&B.renderedItems.length?B.virtualFocus?!1:i?!0:B.activeId===f:!0);return h=je(he({id:f,"aria-selected":Q,"data-active-item":K||void 0},h),{ref:Cn(y,h.ref),tabIndex:de?h.tabIndex:-1,onFocus:j,onBlurCapture:L,onKeyDown:I}),h=jh(h),h=yl(je(he({store:n},h),{getItem:w,shouldRegisterItem:f?h.shouldRegisterItem:!1})),Ii(je(he({},h),{"aria-setsize":oe,"aria-posinset":le}))});Wo(rt(function(e){const t=Y5(e);return ut(JE,t)}));var K5="input";function iN(e,t){if(t!==void 0)return e!=null&&t!=null?t===e:!!t}function sN(e,t){return e==="input"&&(!t||t==="radio")}var X5=gt(function(e){var t=e,{store:n,name:r,value:a,checked:o}=t,i=mt(t,["store","name","value","checked"]);const c=ZE();n=n||c;const u=lo(i.id),d=C.useRef(null),h=pr(n,L=>o??iN(a,L==null?void 0:L.value));C.useEffect(()=>{!u||!h||(n==null?void 0:n.getState().activeId)===u||n==null||n.setActiveId(u)},[n,h,u]);const p=i.onChange,f=Bi(d,K5),y=sN(f,i.type),g=vl(i),[m,b]=A5();C.useEffect(()=>{const L=d.current;L&&(y||(h!==void 0&&(L.checked=h),r!==void 0&&(L.name=r),a!==void 0&&(L.value=`${a}`)))},[m,y,h,r,a]);const w=Ye(L=>{if(g){L.preventDefault(),L.stopPropagation();return}y||(L.currentTarget.checked=!0,b()),p==null||p(L),!L.defaultPrevented&&(n==null||n.setValue(a))}),_=i.onClick,x=Ye(L=>{_==null||_(L),!L.defaultPrevented&&(y||w(L))}),j=i.onFocus,k=Ye(L=>{if(j==null||j(L),L.defaultPrevented||!y||!n)return;const{moves:D,activeId:S}=n.getState();D&&(u&&S!==u||w(L))});return i=je(he({id:u,role:y?void 0:"radio",type:y?"radio":void 0,"aria-checked":h},i),{ref:Cn(d,i.ref),onChange:w,onClick:x,onFocus:k}),i=Y5(he({store:n,clickOnEnter:!y},i)),Ii(he({name:y?r:void 0,value:y?a:void 0,checked:h},i))});Wo(rt(function(e){const t=X5(e);return ut(K5,t)}));var lN="input",cN=gt(function(e){var t=e,{store:n,name:r,value:a}=t,o=mt(t,["store","name","value"]);const i=zo();n=n||i,$n(n,process.env.NODE_ENV!=="production"&&"FormRadio must be wrapped in a Form component.");const c=`${r}`,u=o.onChange,d=Ye(f=>{u==null||u(f),!f.defaultPrevented&&(n==null||n.setValue(c,a))}),h=o.checked,p=n.useState(()=>h??(n==null?void 0:n.getValue(c))===a);return o=je(he({},o),{checked:p,onChange:d}),o=X5(he({value:a},o)),o=Eh(he({store:n,name:c,"aria-labelledby":void 0},o)),o}),uN=Wo(rt(function(e){const t=cN(e);return ut(lN,t)})),dN="button",hN=gt(function(e){var t=e,{store:n,accessibleWhenDisabled:r=!0}=t,a=mt(t,["store","accessibleWhenDisabled"]);const o=zo();return n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"FormSubmit must be wrapped in a Form component."),a=he({type:"submit",disabled:n.useState("submitting")},a),a=kh(je(he({},a),{accessibleWhenDisabled:r})),a}),$i=rt(function(e){const t=hN(e);return ut(dN,t)}),fN="span",J5=gt(function(e){return e=je(he({},e),{style:he({border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",whiteSpace:"nowrap",width:"1px"},e.style)}),e});rt(function(e){const t=J5(e);return ut(fN,t)});var pN="span",mN=gt(function(e){return e=je(he({"data-focus-trap":"",tabIndex:0,"aria-hidden":!0},e),{style:he({position:"fixed",top:0,left:0},e.style)}),e=J5(e),e}),$l=rt(function(e){const t=mN(e);return ut(pN,t)});function Q5(e={}){const t=O5(e.store,D5(e.disclosure,["contentElement","disclosureElement"]));bu(e,t);const n=t==null?void 0:t.getState(),r=St(e.open,n==null?void 0:n.open,e.defaultOpen,!1),a=St(e.animated,n==null?void 0:n.animated,!1),o={open:r,animated:a,animating:!!a&&r,mounted:r,contentElement:St(n==null?void 0:n.contentElement,null),disclosureElement:St(n==null?void 0:n.disclosureElement,null)},i=vr(o,t);return To(i,()=>Ka(i,["animated","animating"],c=>{c.animated||i.setState("animating",!1)})),To(i,()=>R5(i,["open"],()=>{i.getState().animated&&i.setState("animating",!0)})),To(i,()=>Ka(i,["open","animating"],c=>{i.setState("mounted",c.open||c.animating)})),Gn(Ht({},i),{disclosure:e.disclosure,setOpen:c=>i.setState("open",c),show:()=>i.setState("open",!0),hide:()=>i.setState("open",!1),toggle:()=>i.setState("open",c=>!c),stopAnimation:()=>i.setState("animating",!1),setContentElement:c=>i.setState("contentElement",c),setDisclosureElement:c=>i.setState("disclosureElement",c)})}function e3(e,t,n){return yu(t,[n.store,n.disclosure]),lr(e,n,"open","setOpen"),lr(e,n,"mounted","setMounted"),lr(e,n,"animated"),Object.assign(e,{disclosure:n.disclosure})}function gN(e={}){const[t,n]=_u(Q5,e);return e3(t,n,e)}var Th=Sa(),t3=Th.useProviderContext,vN=Th.ContextProvider,yN=Th.ScopedContextProvider,wu=Sa([vN],[yN]),CN=wu.useScopedContext,Ph=wu.useProviderContext,n3=wu.ContextProvider,Lh=wu.ScopedContextProvider,bN=C.createContext(void 0),_N=C.createContext(void 0),xN="div";function Qp(e,t){const n=setTimeout(t,e);return()=>clearTimeout(n)}function wN(e){let t=requestAnimationFrame(()=>{t=requestAnimationFrame(e)});return()=>cancelAnimationFrame(t)}function e0(...e){return e.join(", ").split(", ").reduce((t,n)=>{const r=n.endsWith("ms")?1:1e3,a=Number.parseFloat(n||"0s")*r;return a>t?a:t},0)}function r3(e,t,n){return!n&&t!==!1&&(!e||!!t)}var Ah=gt(function(e){var t=e,{store:n,alwaysVisible:r}=t,a=mt(t,["store","alwaysVisible"]);const o=t3();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component.");const i=C.useRef(null),c=lo(a.id),[u,d]=C.useState(null),h=n.useState("open"),p=n.useState("mounted"),f=n.useState("animated"),y=n.useState("contentElement"),g=pr(n.disclosure,"contentElement");Et(()=>{i.current&&(n==null||n.setContentElement(i.current))},[n]),Et(()=>{let _;return n==null||n.setState("animated",x=>(_=x,!0)),()=>{_!==void 0&&(n==null||n.setState("animated",_))}},[n]),Et(()=>{if(f){if(!(y!=null&&y.isConnected)){d(null);return}return wN(()=>{d(h?"enter":p?"leave":null)})}},[f,y,h,p]),Et(()=>{if(!n||!f)return;const _=()=>n==null?void 0:n.setState("animating",!1),x=()=>Sr.flushSync(_);if(!u||!y){_();return}if(u==="leave"&&h||u==="enter"&&!h)return;if(typeof f=="number")return Qp(f,x);const{transitionDuration:j,animationDuration:k,transitionDelay:L,animationDelay:D}=getComputedStyle(y),{transitionDuration:S="0",animationDuration:T="0",transitionDelay:I="0",animationDelay:A="0"}=g?getComputedStyle(g):{},U=e0(L,D,I,A),K=e0(j,k,S,T),X=U+K;if(!X){u==="enter"&&n.setState("animated",!1),_();return}const G=1e3/60,Q=Math.max(X-G,0);return Qp(Q,x)},[n,f,y,g,h,u]),a=qn(a,_=>l.jsx(Lh,{value:n,children:_}),[n]);const m=r3(p,a.hidden,r),b=a.style,w=C.useMemo(()=>m?je(he({},b),{display:"none"}):b,[m,b]);return a=je(he({id:c,"data-open":h||void 0,"data-enter":u==="enter"||void 0,"data-leave":u==="leave"||void 0,hidden:m},a),{ref:Cn(c?n.setContentElement:null,i,a.ref),style:w}),Ii(a)}),SN=rt(function(e){const t=Ah(e);return ut(xN,t)});rt(function(e){var t=e,{unmountOnHide:n}=t,r=mt(t,["unmountOnHide"]);const a=t3(),o=r.store||a;return pr(o,i=>!n||(i==null?void 0:i.mounted))===!1?null:l.jsx(SN,he({},r))});function a3(e={}){return Q5(e)}function o3(e,t,n){return e3(e,t,n)}function Vi(e={}){const[t,n]=_u(a3,e);return o3(t,n,e)}function i3(e,...t){if(!e)return!1;const n=e.getAttribute("data-backdrop");return n==null?!1:n===""||n==="true"||!t.length?!0:t.some(r=>n===r)}var i1=new WeakMap;function _l(e,t,n){i1.has(e)||i1.set(e,new Map);const r=i1.get(e),a=r.get(t);if(!a)return r.set(t,n()),()=>{var c;(c=r.get(t))==null||c(),r.delete(t)};const o=n(),i=()=>{o(),a(),r.delete(t)};return r.set(t,i),()=>{r.get(t)===i&&(o(),r.set(t,a))}}function Rh(e,t,n){return _l(e,t,()=>{const r=e.getAttribute(t);return e.setAttribute(t,n),()=>{r==null?e.removeAttribute(t):e.setAttribute(t,r)}})}function Do(e,t,n){return _l(e,t,()=>{const r=t in e,a=e[t];return e[t]=n,()=>{r?e[t]=a:delete e[t]}})}function fd(e,t){return e?_l(e,"style",()=>{const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}):()=>{}}function jN(e,t,n){return e?_l(e,t,()=>{const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}):()=>{}}var kN=["SCRIPT","STYLE"];function pd(e){return`__ariakit-dialog-snapshot-${e}`}function EN(e,t){const n=It(t),r=pd(e);if(!n.body[r])return!0;do{if(t===n.body)return!1;if(t[r])return!0;if(!t.parentElement)return!1;t=t.parentElement}while(!0)}function NN(e,t,n){return kN.includes(t.tagName)||!EN(e,t)?!1:!n.some(r=>r&&Xt(t,r))}function Dh(e,t,n,r){for(let a of t){if(!(a!=null&&a.isConnected))continue;const o=t.some(u=>!u||u===a?!1:u.contains(a)),i=It(a),c=a;for(;a.parentElement&&a!==i.body;){if(r==null||r(a.parentElement,c),!o)for(const u of a.parentElement.children)NN(e,u,t)&&n(u,c);a=a.parentElement}}}function TN(e,t){const{body:n}=It(t[0]),r=[];return Dh(e,t,a=>{r.push(Do(a,pd(e),!0))}),Yn(Do(n,pd(e),!0),()=>{for(const a of r)a()})}function ji(e="",t=!1){return`__ariakit-dialog-${t?"ancestor":"outside"}${e?`-${e}`:""}`}function PN(e,t=""){return Yn(Do(e,ji(),!0),Do(e,ji(t),!0))}function s3(e,t=""){return Yn(Do(e,ji("",!0),!0),Do(e,ji(t,!0),!0))}function Oh(e,t){const n=ji(t,!0);if(e[n])return!0;const r=ji(t);do{if(e[r])return!0;if(!e.parentElement)return!1;e=e.parentElement}while(!0)}function t0(e,t){const n=[],r=t.map(a=>a==null?void 0:a.id);return Dh(e,t,a=>{i3(a,...r)||n.unshift(PN(a,e))},(a,o)=>{o.hasAttribute("data-dialog")&&o.id!==e||n.unshift(s3(a,e))}),()=>{for(const a of n)a()}}var LN="div",AN=["a","button","details","dialog","div","form","h1","h2","h3","h4","h5","h6","header","img","input","label","li","nav","ol","p","section","select","span","summary","textarea","ul","svg"];gt(function(e){return e});var md=rt(function(e){return ut(LN,e)});Object.assign(md,AN.reduce((e,t)=>(e[t]=rt(function(n){return ut(t,n)}),e),{}));function RN({store:e,backdrop:t,alwaysVisible:n,hidden:r}){const a=C.useRef(null),o=gN({disclosure:e}),i=e.useState("contentElement");Et(()=>{const d=a.current,h=i;d&&h&&(d.style.zIndex=getComputedStyle(h).zIndex)},[i]),Et(()=>{const d=i==null?void 0:i.id;if(!d)return;const h=a.current;if(h)return s3(h,d)},[i]);const c=Ah({ref:a,store:o,role:"presentation","data-backdrop":(i==null?void 0:i.id)||"",alwaysVisible:n,hidden:r??void 0,style:{position:"fixed",top:0,right:0,bottom:0,left:0}});if(!t)return null;if(C.isValidElement(t))return l.jsx(md,je(he({},c),{render:t}));const u=typeof t!="boolean"?t:"div";return l.jsx(md,je(he({},c),{render:l.jsx(u,{})}))}function DN(e){return Rh(e,"aria-hidden","true")}function l3(){return"inert"in HTMLElement.prototype}function c3(e,t){if(!("style"in e))return dc;if(l3())return Do(e,"inert",!0);const n=xu(e,!0).map(r=>{if(t!=null&&t.some(o=>o&&Xt(o,r)))return dc;const a=_l(r,"focus",()=>(r.focus=dc,()=>{delete r.focus}));return Yn(Rh(r,"tabindex","-1"),a)});return Yn(...n,DN(e),fd(e,{pointerEvents:"none",userSelect:"none",cursor:"default"}))}function ON(e,t){const n=[],r=t.map(a=>a==null?void 0:a.id);return Dh(e,t,a=>{i3(a,...r)||n.unshift(c3(a,t))},a=>{a.hasAttribute("role")&&(t.some(o=>o&&Xt(o,a))||n.unshift(Rh(a,"role","none")))}),()=>{for(const a of n)a()}}function IN({attribute:e,contentId:t,contentElement:n,enabled:r}){const[a,o]=A5(),i=C.useCallback(()=>{if(!r||!n)return!1;const{body:c}=It(n),u=c.getAttribute(e);return!u||u===t},[a,r,n,e,t]);return C.useEffect(()=>{if(!r||!t||!n)return;const{body:c}=It(n);if(i())return c.setAttribute(e,t),()=>c.removeAttribute(e);const u=new MutationObserver(()=>Sr.flushSync(o));return u.observe(c,{attributeFilter:[e]}),()=>u.disconnect()},[a,r,t,n,i,e]),i}function MN(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function BN(e,t,n){const r=IN({attribute:"data-dialog-prevent-body-scroll",contentElement:e,contentId:t,enabled:n});C.useEffect(()=>{if(!r()||!e)return;const a=It(e),o=Nk(e),{documentElement:i,body:c}=a,u=i.style.getPropertyValue("--scrollbar-width"),d=u?Number.parseInt(u):o.innerWidth-i.clientWidth,h=()=>jN(i,"--scrollbar-width",`${d}px`),p=MN(i),f=()=>fd(c,{overflow:"hidden",[p]:`${d}px`}),y=()=>{var m,b;const{scrollX:w,scrollY:_,visualViewport:x}=o,j=(m=x==null?void 0:x.offsetLeft)!=null?m:0,k=(b=x==null?void 0:x.offsetTop)!=null?b:0,L=fd(c,{position:"fixed",overflow:"hidden",top:`${-(_-Math.floor(k))}px`,left:`${-(w-Math.floor(j))}px`,right:"0",[p]:`${d}px`});return()=>{L(),process.env.NODE_ENV!=="test"&&o.scrollTo(w,_)}},g=T5()&&!Dk();return Yn(h(),g?y():f())},[r,e])}var n0=C.createContext({});function FN(e){const t=C.useContext(n0),[n,r]=C.useState([]),a=C.useCallback(i=>{var c;return r(u=>[...u,i]),Yn((c=t.add)==null?void 0:c.call(t,i),()=>{r(u=>u.filter(d=>d!==i))})},[t]);Et(()=>Ka(e,["open","contentElement"],i=>{var c;if(i.open&&i.contentElement)return(c=t.add)==null?void 0:c.call(t,e)}),[e,t]);const o=C.useMemo(()=>({store:e,add:a}),[e,a]);return{wrapElement:C.useCallback(i=>l.jsx(n0.Provider,{value:o,children:i}),[o]),nestedDialogs:n}}function HN(e){const t=C.useRef();return C.useEffect(()=>{if(!e){t.current=null;return}return gn("mousedown",n=>{t.current=n.target},!0)},[e]),t}function $N(e){return e.tagName==="HTML"?!0:Xt(It(e).body,e)}function VN(e,t){if(!e)return!1;if(Xt(e,t))return!0;const n=t.getAttribute("aria-activedescendant");if(n){const r=It(e).getElementById(n);if(r)return Xt(e,r)}return!1}function UN(e,t){if(!("clientY"in e))return!1;const n=t.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=e.clientY&&e.clientY<=n.top+n.height&&n.left<=e.clientX&&e.clientX<=n.left+n.width}function s1({store:e,type:t,listener:n,capture:r,domReady:a}){const o=Ye(n),i=e.useState("open"),c=C.useRef(!1);Et(()=>{if(!i||!a)return;const{contentElement:u}=e.getState();if(!u)return;const d=()=>{c.current=!0};return u.addEventListener("focusin",d,!0),()=>u.removeEventListener("focusin",d,!0)},[e,i,a]),C.useEffect(()=>i?gn(t,u=>{const{contentElement:d,disclosureElement:h}=e.getState(),p=u.target;!d||!p||!$N(p)||Xt(d,p)||VN(h,p)||p.hasAttribute("data-focus-trap")||UN(u,d)||c.current&&!Oh(p,d.id)||o(u)},r):void 0,[i,r])}function l1(e,t){return typeof e=="function"?e(t):!!e}function WN(e,t,n){const r=e.useState("open"),a=HN(r),o={store:e,domReady:n,capture:!0};s1(je(he({},o),{type:"click",listener:i=>{const{contentElement:c}=e.getState(),u=a.current;u&&E5(u)&&Oh(u,c==null?void 0:c.id)&&l1(t,i)&&e.hide()}})),s1(je(he({},o),{type:"focusin",listener:i=>{const{contentElement:c}=e.getState();c&&i.target!==It(c)&&l1(t,i)&&e.hide()}})),s1(je(he({},o),{type:"contextmenu",listener:i=>{l1(t,i)&&e.hide()}}))}function qN(e,t){const n=It(e).createElement("button");return n.type="button",n.tabIndex=-1,n.textContent="Dismiss popup",Object.assign(n.style,{border:"0px",clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:"0px",position:"absolute",whiteSpace:"nowrap",width:"1px"}),n.addEventListener("click",t),e.prepend(n),()=>{n.removeEventListener("click",t),n.remove()}}var zN="div",u3=gt(function(e){var t=e,{autoFocusOnShow:n=!0}=t,r=mt(t,["autoFocusOnShow"]);return r=qn(r,a=>l.jsx(B5.Provider,{value:n,children:a}),[n]),r});rt(function(e){const t=u3(e);return ut(zN,t)});var r0=C.createContext(0);function ZN({level:e,children:t}){const n=C.useContext(r0),r=Math.max(Math.min(e||n+1,6),1);return l.jsx(r0.Provider,{value:r,children:t})}var a0=C.createContext(null),GN="div";function YN(e){return It(e).body}function KN(e,t){return t?typeof t=="function"?t(e):t:It(e).createElement("div")}function XN(e="id"){return`${e?`${e}-`:""}${Math.random().toString(36).substr(2,6)}`}function Pa(e){queueMicrotask(()=>{e==null||e.focus()})}var d3=gt(function(e){var t=e,{preserveTabOrder:n,preserveTabOrderAnchor:r,portalElement:a,portalRef:o,portal:i=!0}=t,c=mt(t,["preserveTabOrder","preserveTabOrderAnchor","portalElement","portalRef","portal"]);const u=C.useRef(null),d=Cn(u,c.ref),h=C.useContext(a0),[p,f]=C.useState(null),[y,g]=C.useState(null),m=C.useRef(null),b=C.useRef(null),w=C.useRef(null),_=C.useRef(null);return Et(()=>{const x=u.current;if(!x||!i){f(null);return}const j=KN(x,a);if(!j){f(null);return}const k=j.isConnected;if(k||(h||YN(x)).appendChild(j),j.id||(j.id=x.id?`portal/${x.id}`:XN()),f(j),ld(o,j),!k)return()=>{j.remove(),ld(o,null)}},[i,a,h,o]),Et(()=>{if(!i||!n||!r)return;const x=It(r).createElement("span");return x.style.position="fixed",r.insertAdjacentElement("afterend",x),g(x),()=>{x.remove(),g(null)}},[i,n,r]),C.useEffect(()=>{if(!p||!n)return;let x=0;const j=k=>{if(!ui(k))return;const L=k.type==="focusin";if(cancelAnimationFrame(x),L)return oE(p);x=requestAnimationFrame(()=>{aE(p,!0)})};return p.addEventListener("focusin",j,!0),p.addEventListener("focusout",j,!0),()=>{cancelAnimationFrame(x),p.removeEventListener("focusin",j,!0),p.removeEventListener("focusout",j,!0)}},[p,n]),c=qn(c,x=>{if(x=l.jsx(a0.Provider,{value:p||h,children:x}),!i)return x;if(!p)return l.jsx("span",{ref:d,id:c.id,style:{position:"fixed"},hidden:!0});x=l.jsxs(l.Fragment,{children:[n&&p&&l.jsx($l,{ref:b,className:"__focus-trap-inner-before",onFocus:k=>{ui(k,p)?Pa(r1()):Pa(m.current)}}),x,n&&p&&l.jsx($l,{ref:w,className:"__focus-trap-inner-after",onFocus:k=>{ui(k,p)?Pa(zp()):Pa(_.current)}})]}),p&&(x=Sr.createPortal(x,p));let j=l.jsxs(l.Fragment,{children:[n&&p&&l.jsx($l,{ref:m,className:"__focus-trap-outer-before",onFocus:k=>{k.relatedTarget!==_.current&&ui(k,p)?Pa(b.current):Pa(zp())}}),n&&l.jsx("span",{"aria-owns":p==null?void 0:p.id,style:{position:"fixed"}}),n&&p&&l.jsx($l,{ref:_,className:"__focus-trap-outer-after",onFocus:k=>{if(ui(k,p))Pa(w.current);else{const L=r1();if(L===b.current){requestAnimationFrame(()=>{var D;return(D=r1())==null?void 0:D.focus()});return}Pa(L)}}})]});return y&&n&&(j=Sr.createPortal(j,y)),l.jsxs(l.Fragment,{children:[j,x]})},[p,h,i,c.id,n,y]),c=je(he({},c),{ref:d}),c});rt(function(e){const t=d3(e);return ut(GN,t)});var JN="div",o0=vh();function QN(e){const t=so();return!t||e&&Xt(e,t)?!1:!!Qr(t)}function i0(e,t=!1){if(!e)return null;const n="current"in e?e.current:e;return n?t?Qr(n)?n:null:n:null}var h3=gt(function(e){var t=e,{store:n,open:r,onClose:a,focusable:o=!0,modal:i=!0,portal:c=!!i,backdrop:u=!!i,hideOnEscape:d=!0,hideOnInteractOutside:h=!0,getPersistentElements:p,preventBodyScroll:f=!!i,autoFocusOnShow:y=!0,autoFocusOnHide:g=!0,initialFocus:m,finalFocus:b,unmountOnHide:w,unstable_treeSnapshotKey:_}=t,x=mt(t,["store","open","onClose","focusable","modal","portal","backdrop","hideOnEscape","hideOnInteractOutside","getPersistentElements","preventBodyScroll","autoFocusOnShow","autoFocusOnHide","initialFocus","finalFocus","unmountOnHide","unstable_treeSnapshotKey"]);const j=Ph(),k=C.useRef(null),L=Vi({store:n||j,open:r,setOpen(ue){if(ue)return;const Pe=k.current;if(!Pe)return;const Le=new Event("close",{bubbles:!1,cancelable:!0});a&&Pe.addEventListener("close",a,{once:!0}),Pe.dispatchEvent(Le),Le.defaultPrevented&&L.setOpen(!0)}}),{portalRef:D,domReady:S}=Ch(c,x.portalRef),T=x.preserveTabOrder,I=L.useState(ue=>T&&!i&&ue.mounted),A=lo(x.id),U=L.useState("open"),K=L.useState("mounted"),X=L.useState("contentElement"),G=r3(K,x.hidden,x.alwaysVisible);BN(X,A,f&&!G),WN(L,h,S);const{wrapElement:Q,nestedDialogs:oe}=FN(L);x=qn(x,Q,[Q]),Et(()=>{if(!U)return;const ue=k.current,Pe=so(ue,!0);Pe&&Pe.tagName!=="BODY"&&(ue&&Xt(ue,Pe)||L.setDisclosureElement(Pe))},[L,U]),o0&&C.useEffect(()=>{if(!K)return;const{disclosureElement:ue}=L.getState();if(!ue||!Ca(ue))return;const Pe=()=>{let Le=!1;const Ne=()=>{Le=!0},dt={capture:!0,once:!0};ue.addEventListener("focusin",Ne,dt),ws(ue,"mouseup",()=>{ue.removeEventListener("focusin",Ne,!0),!Le&&$5(ue)})};return ue.addEventListener("mousedown",Pe),()=>{ue.removeEventListener("mousedown",Pe)}},[L,K]),C.useEffect(()=>{if(!i||!K||!S)return;const ue=k.current;if(!(!ue||ue.querySelector("[data-dialog-dismiss]")))return qN(ue,L.hide)},[L,i,K,S]),Et(()=>{if(!l3()||U||!K||!S)return;const ue=k.current;if(ue)return c3(ue)},[U,K,S]);const le=U&&S;Et(()=>{if(!A||!le)return;const ue=k.current;return TN(A,[ue])},[A,le,_]);const de=Ye(p);Et(()=>{if(!A||!le)return;const{disclosureElement:ue}=L.getState(),Pe=k.current,Le=de()||[],Ne=[Pe,...Le,...oe.map(dt=>dt.getState().contentElement)];return i?Yn(t0(A,Ne),ON(A,Ne)):t0(A,[ue,...Ne])},[A,L,le,de,oe,i,_]);const B=!!y,V=ga(y),[F,W]=C.useState(!1);C.useEffect(()=>{if(!U||!B||!S||!(X!=null&&X.isConnected))return;const ue=i0(m,!0)||X.querySelector("[data-autofocus=true],[autofocus]")||F5(X,!0,c&&I)||X,Pe=Qr(ue);V(Pe?ue:null)&&(W(!0),queueMicrotask(()=>{ue.focus(),o0&&ue.scrollIntoView({block:"nearest",inline:"nearest"})}))},[U,B,S,X,m,c,I,V]);const J=!!g,fe=ga(g),[ee,re]=C.useState(!1);C.useEffect(()=>{if(U)return re(!0),()=>re(!1)},[U]);const se=C.useCallback((ue,Pe=!0)=>{const{disclosureElement:Le}=L.getState();if(QN(ue))return;let Ne=i0(b)||Le;if(Ne!=null&&Ne.id){const st=It(Ne),_t=`[aria-activedescendant="${Ne.id}"]`,Nt=st.querySelector(_t);Nt&&(Ne=Nt)}if(Ne&&!Qr(Ne)){const st=Ne.closest("[data-dialog]");if(st!=null&&st.id){const _t=It(st),Nt=`[aria-controls~="${st.id}"]`,Mt=_t.querySelector(Nt);Mt&&(Ne=Mt)}}const dt=Ne&&Qr(Ne);if(!dt&&Pe){requestAnimationFrame(()=>se(ue,!1));return}fe(dt?Ne:null)&&dt&&(Ne==null||Ne.focus())},[L,b,fe]),ge=C.useRef(!1);Et(()=>{if(U||!ee||!J)return;const ue=k.current;ge.current=!0,se(ue)},[U,ee,S,J,se]),C.useEffect(()=>{if(!ee||!J)return;const ue=k.current;return()=>{if(ge.current){ge.current=!1;return}se(ue)}},[ee,J,se]);const ae=ga(d);C.useEffect(()=>!S||!K?void 0:gn("keydown",ue=>{if(ue.key!=="Escape"||ue.defaultPrevented)return;const Pe=k.current;if(!Pe||Oh(Pe))return;const Le=ue.target;if(!Le)return;const{disclosureElement:Ne}=L.getState();(Le.tagName==="BODY"||Xt(Pe,Le)||!Ne||Xt(Ne,Le))&&ae(ue)&&L.hide()},!0),[L,S,K,ae]),x=qn(x,ue=>l.jsx(ZN,{level:i?1:void 0,children:ue}),[i]);const Oe=x.hidden,q=x.alwaysVisible;x=qn(x,ue=>u?l.jsxs(l.Fragment,{children:[l.jsx(RN,{store:L,backdrop:u,hidden:Oe,alwaysVisible:q}),ue]}):ue,[L,u,Oe,q]);const[Ce,xe]=C.useState(),[Ae,Be]=C.useState();return x=qn(x,ue=>l.jsx(Lh,{value:L,children:l.jsx(bN.Provider,{value:xe,children:l.jsx(_N.Provider,{value:Be,children:ue})})}),[L]),x=je(he({id:A,"data-dialog":"",role:"dialog",tabIndex:o?-1:void 0,"aria-labelledby":Ce,"aria-describedby":Ae},x),{ref:Cn(k,x.ref)}),x=u3(je(he({},x),{autoFocusOnShow:F})),x=Ah(he({store:L},x)),x=Cl(je(he({},x),{focusable:o})),x=d3(je(he({portal:c},x),{portalRef:D,preserveTabOrder:I})),x});function Su(e,t=Ph){return rt(function(n){const r=t(),a=n.store||r;return pr(a,o=>!n.unmountOnHide||(o==null?void 0:o.mounted)||!!n.open)?l.jsx(e,he({},n)):null})}var eT=Su(rt(function(e){const t=h3(e);return ut(JN,t)}),Ph);function tT(e={}){const t=Vi(e);return l.jsx(n3,{value:t,children:e.children})}var nT="button",rT=gt(function(e){var t=e,{store:n}=t,r=mt(t,["store"]);const a=CN();n=n||a;const o=r.onClick,i=Ye(u=>{o==null||o(u),!u.defaultPrevented&&(n==null||n.hide())}),c=C.useMemo(()=>l.jsxs("svg",{"aria-label":"Dismiss popup",display:"block",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,viewBox:"0 0 16 16",height:"1em",width:"1em",children:[l.jsx("line",{x1:"4",y1:"4",x2:"12",y2:"12"}),l.jsx("line",{x1:"4",y1:"12",x2:"12",y2:"4"})]}),[]);return r=je(he({"data-dialog-dismiss":"",children:c},r),{onClick:i}),r=kh(r),r}),f3=rt(function(e){const t=rT(e);return ut(nT,t)});function aT(e={}){var t=e,{popover:n}=t,r=gk(t,["popover"]);const a=O5(r.store,D5(n,["arrowElement","anchorElement","contentElement","popoverElement","disclosureElement"]));bu(r,a);const o=a==null?void 0:a.getState(),i=a3(Gn(Ht({},r),{store:a})),c=St(r.placement,o==null?void 0:o.placement,"bottom"),u=Gn(Ht({},i.getState()),{placement:c,currentPlacement:c,anchorElement:St(o==null?void 0:o.anchorElement,null),popoverElement:St(o==null?void 0:o.popoverElement,null),arrowElement:St(o==null?void 0:o.arrowElement,null),rendered:Symbol("rendered")}),d=vr(u,i,a);return Gn(Ht(Ht({},i),d),{setAnchorElement:h=>d.setState("anchorElement",h),setPopoverElement:h=>d.setState("popoverElement",h),setArrowElement:h=>d.setState("arrowElement",h),render:()=>d.setState("rendered",Symbol("rendered"))})}function oT(e,t,n){return yu(t,[n.popover]),lr(e,n,"placement"),o3(e,t,n)}var Ih=Sa([n3],[Lh]),p3=Ih.useProviderContext,iT=Ih.ContextProvider,m3=Ih.ScopedContextProvider;const Kr=Math.min,ar=Math.max,Uc=Math.round,Vl=Math.floor,Ja=e=>({x:e,y:e}),sT={left:"right",right:"left",bottom:"top",top:"bottom"},lT={start:"end",end:"start"};function gd(e,t,n){return ar(e,Kr(t,n))}function Qa(e,t){return typeof e=="function"?e(t):e}function ba(e){return e.split("-")[0]}function Ui(e){return e.split("-")[1]}function Mh(e){return e==="x"?"y":"x"}function Bh(e){return e==="y"?"height":"width"}function Wi(e){return["top","bottom"].includes(ba(e))?"y":"x"}function Fh(e){return Mh(Wi(e))}function cT(e,t,n){n===void 0&&(n=!1);const r=Ui(e),a=Fh(e),o=Bh(a);let i=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(i=Wc(i)),[i,Wc(i)]}function uT(e){const t=Wc(e);return[vd(e),t,vd(t)]}function vd(e){return e.replace(/start|end/g,t=>lT[t])}function dT(e,t,n){const r=["left","right"],a=["right","left"],o=["top","bottom"],i=["bottom","top"];switch(e){case"top":case"bottom":return n?t?a:r:t?r:a;case"left":case"right":return t?o:i;default:return[]}}function hT(e,t,n,r){const a=Ui(e);let o=dT(ba(e),n==="start",r);return a&&(o=o.map(i=>i+"-"+a),t&&(o=o.concat(o.map(vd)))),o}function Wc(e){return e.replace(/left|right|bottom|top/g,t=>sT[t])}function fT(e){return{top:0,right:0,bottom:0,left:0,...e}}function g3(e){return typeof e!="number"?fT(e):{top:e,right:e,bottom:e,left:e}}function qc(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function s0(e,t,n){let{reference:r,floating:a}=e;const o=Wi(t),i=Fh(t),c=Bh(i),u=ba(t),d=o==="y",h=r.x+r.width/2-a.width/2,p=r.y+r.height/2-a.height/2,f=r[c]/2-a[c]/2;let y;switch(u){case"top":y={x:h,y:r.y-a.height};break;case"bottom":y={x:h,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:p};break;case"left":y={x:r.x-a.width,y:p};break;default:y={x:r.x,y:r.y}}switch(Ui(t)){case"start":y[i]-=f*(n&&d?-1:1);break;case"end":y[i]+=f*(n&&d?-1:1);break}return y}const pT=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:i}=n,c=o.filter(Boolean),u=await(i.isRTL==null?void 0:i.isRTL(t));let d=await i.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=s0(d,r,u),f=r,y={},g=0;for(let m=0;m<c.length;m++){const{name:b,fn:w}=c[m],{x:_,y:x,data:j,reset:k}=await w({x:h,y:p,initialPlacement:r,placement:f,strategy:a,middlewareData:y,rects:d,platform:i,elements:{reference:e,floating:t}});h=_??h,p=x??p,y={...y,[b]:{...y[b],...j}},k&&g<=50&&(g++,typeof k=="object"&&(k.placement&&(f=k.placement),k.rects&&(d=k.rects===!0?await i.getElementRects({reference:e,floating:t,strategy:a}):k.rects),{x:h,y:p}=s0(d,f,u)),m=-1)}return{x:h,y:p,placement:f,strategy:a,middlewareData:y}};async function Hh(e,t){var n;t===void 0&&(t={});const{x:r,y:a,platform:o,rects:i,elements:c,strategy:u}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:f=!1,padding:y=0}=Qa(t,e),g=g3(y),m=c[f?p==="floating"?"reference":"floating":p],b=qc(await o.getClippingRect({element:(n=await(o.isElement==null?void 0:o.isElement(m)))==null||n?m:m.contextElement||await(o.getDocumentElement==null?void 0:o.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:u})),w=p==="floating"?{x:r,y:a,width:i.floating.width,height:i.floating.height}:i.reference,_=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c.floating)),x=await(o.isElement==null?void 0:o.isElement(_))?await(o.getScale==null?void 0:o.getScale(_))||{x:1,y:1}:{x:1,y:1},j=qc(o.convertOffsetParentRelativeRectToViewportRelativeRect?await o.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:w,offsetParent:_,strategy:u}):w);return{top:(b.top-j.top+g.top)/x.y,bottom:(j.bottom-b.bottom+g.bottom)/x.y,left:(b.left-j.left+g.left)/x.x,right:(j.right-b.right+g.right)/x.x}}const mT=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:i,elements:c,middlewareData:u}=t,{element:d,padding:h=0}=Qa(e,t)||{};if(d==null)return{};const p=g3(h),f={x:n,y:r},y=Fh(a),g=Bh(y),m=await i.getDimensions(d),b=y==="y",w=b?"top":"left",_=b?"bottom":"right",x=b?"clientHeight":"clientWidth",j=o.reference[g]+o.reference[y]-f[y]-o.floating[g],k=f[y]-o.reference[y],L=await(i.getOffsetParent==null?void 0:i.getOffsetParent(d));let D=L?L[x]:0;(!D||!await(i.isElement==null?void 0:i.isElement(L)))&&(D=c.floating[x]||o.floating[g]);const S=j/2-k/2,T=D/2-m[g]/2-1,I=Kr(p[w],T),A=Kr(p[_],T),U=I,K=D-m[g]-A,X=D/2-m[g]/2+S,G=gd(U,X,K),Q=!u.arrow&&Ui(a)!=null&&X!==G&&o.reference[g]/2-(X<U?I:A)-m[g]/2<0,oe=Q?X<U?X-U:X-K:0;return{[y]:f[y]+oe,data:{[y]:G,centerOffset:X-G-oe,...Q&&{alignmentOffset:oe}},reset:Q}}}),gT=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:a,middlewareData:o,rects:i,initialPlacement:c,platform:u,elements:d}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:m=!0,...b}=Qa(e,t);if((n=o.arrow)!=null&&n.alignmentOffset)return{};const w=ba(a),_=ba(c)===c,x=await(u.isRTL==null?void 0:u.isRTL(d.floating)),j=f||(_||!m?[Wc(c)]:uT(c));!f&&g!=="none"&&j.push(...hT(c,m,g,x));const k=[c,...j],L=await Hh(t,b),D=[];let S=((r=o.flip)==null?void 0:r.overflows)||[];if(h&&D.push(L[w]),p){const U=cT(a,i,x);D.push(L[U[0]],L[U[1]])}if(S=[...S,{placement:a,overflows:D}],!D.every(U=>U<=0)){var T,I;const U=(((T=o.flip)==null?void 0:T.index)||0)+1,K=k[U];if(K)return{data:{index:U,overflows:S},reset:{placement:K}};let X=(I=S.filter(G=>G.overflows[0]<=0).sort((G,Q)=>G.overflows[1]-Q.overflows[1])[0])==null?void 0:I.placement;if(!X)switch(y){case"bestFit":{var A;const G=(A=S.map(Q=>[Q.placement,Q.overflows.filter(oe=>oe>0).reduce((oe,le)=>oe+le,0)]).sort((Q,oe)=>Q[1]-oe[1])[0])==null?void 0:A[0];G&&(X=G);break}case"initialPlacement":X=c;break}if(a!==X)return{reset:{placement:X}}}return{}}}};async function vT(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),i=ba(n),c=Ui(n),u=Wi(n)==="y",d=["left","top"].includes(i)?-1:1,h=o&&u?-1:1,p=Qa(t,e);let{mainAxis:f,crossAxis:y,alignmentAxis:g}=typeof p=="number"?{mainAxis:p,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...p};return c&&typeof g=="number"&&(y=c==="end"?g*-1:g),u?{x:y*h,y:f*d}:{x:f*d,y:y*h}}const yT=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:i,middlewareData:c}=t,u=await vT(t,e);return i===((n=c.offset)==null?void 0:n.placement)&&(r=c.arrow)!=null&&r.alignmentOffset?{}:{x:a+u.x,y:o+u.y,data:{...u,placement:i}}}}},CT=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:i=!1,limiter:c={fn:b=>{let{x:w,y:_}=b;return{x:w,y:_}}},...u}=Qa(e,t),d={x:n,y:r},h=await Hh(t,u),p=Wi(ba(a)),f=Mh(p);let y=d[f],g=d[p];if(o){const b=f==="y"?"top":"left",w=f==="y"?"bottom":"right",_=y+h[b],x=y-h[w];y=gd(_,y,x)}if(i){const b=p==="y"?"top":"left",w=p==="y"?"bottom":"right",_=g+h[b],x=g-h[w];g=gd(_,g,x)}const m=c.fn({...t,[f]:y,[p]:g});return{...m,data:{x:m.x-n,y:m.y-r}}}}},bT=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:i}=t,{offset:c=0,mainAxis:u=!0,crossAxis:d=!0}=Qa(e,t),h={x:n,y:r},p=Wi(a),f=Mh(p);let y=h[f],g=h[p];const m=Qa(c,t),b=typeof m=="number"?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(u){const x=f==="y"?"height":"width",j=o.reference[f]-o.floating[x]+b.mainAxis,k=o.reference[f]+o.reference[x]-b.mainAxis;y<j?y=j:y>k&&(y=k)}if(d){var w,_;const x=f==="y"?"width":"height",j=["top","left"].includes(ba(a)),k=o.reference[p]-o.floating[x]+(j&&((w=i.offset)==null?void 0:w[p])||0)+(j?0:b.crossAxis),L=o.reference[p]+o.reference[x]+(j?0:((_=i.offset)==null?void 0:_[p])||0)-(j?b.crossAxis:0);g<k?g=k:g>L&&(g=L)}return{[f]:y,[p]:g}}}},_T=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:a,elements:o}=t,{apply:i=()=>{},...c}=Qa(e,t),u=await Hh(t,c),d=ba(n),h=Ui(n),p=Wi(n)==="y",{width:f,height:y}=r.floating;let g,m;d==="top"||d==="bottom"?(g=d,m=h===(await(a.isRTL==null?void 0:a.isRTL(o.floating))?"start":"end")?"left":"right"):(m=d,g=h==="end"?"top":"bottom");const b=y-u.top-u.bottom,w=f-u.left-u.right,_=Kr(y-u[g],b),x=Kr(f-u[m],w),j=!t.middlewareData.shift;let k=_,L=x;if(p?L=h||j?Kr(x,w):w:k=h||j?Kr(_,b):b,j&&!h){const S=ar(u.left,0),T=ar(u.right,0),I=ar(u.top,0),A=ar(u.bottom,0);p?L=f-2*(S!==0||T!==0?S+T:ar(u.left,u.right)):k=y-2*(I!==0||A!==0?I+A:ar(u.top,u.bottom))}await i({...t,availableWidth:L,availableHeight:k});const D=await a.getDimensions(o.floating);return f!==D.width||y!==D.height?{reset:{rects:!0}}:{}}}};function qi(e){return v3(e)?(e.nodeName||"").toLowerCase():"#document"}function cr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function ja(e){var t;return(t=(v3(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function v3(e){return e instanceof Node||e instanceof cr(e).Node}function ra(e){return e instanceof Element||e instanceof cr(e).Element}function aa(e){return e instanceof HTMLElement||e instanceof cr(e).HTMLElement}function l0(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof cr(e).ShadowRoot}function xl(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=Ar(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(a)}function xT(e){return["table","td","th"].includes(qi(e))}function $h(e){const t=Vh(),n=Ar(e);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function wT(e){let t=eo(e);for(;aa(t)&&!ki(t);){if($h(t))return t;t=eo(t)}return null}function Vh(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function ki(e){return["html","body","#document"].includes(qi(e))}function Ar(e){return cr(e).getComputedStyle(e)}function ju(e){return ra(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function eo(e){if(qi(e)==="html")return e;const t=e.assignedSlot||e.parentNode||l0(e)&&e.host||ja(e);return l0(t)?t.host:t}function y3(e){const t=eo(e);return ki(t)?e.ownerDocument?e.ownerDocument.body:e.body:aa(t)&&xl(t)?t:y3(t)}function Gs(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=y3(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),i=cr(a);return o?t.concat(i,i.visualViewport||[],xl(a)?a:[],i.frameElement&&n?Gs(i.frameElement):[]):t.concat(a,Gs(a,[],n))}function C3(e){const t=Ar(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=aa(e),o=a?e.offsetWidth:n,i=a?e.offsetHeight:r,c=Uc(n)!==o||Uc(r)!==i;return c&&(n=o,r=i),{width:n,height:r,$:c}}function Uh(e){return ra(e)?e:e.contextElement}function vi(e){const t=Uh(e);if(!aa(t))return Ja(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=C3(t);let i=(o?Uc(n.width):n.width)/r,c=(o?Uc(n.height):n.height)/a;return(!i||!Number.isFinite(i))&&(i=1),(!c||!Number.isFinite(c))&&(c=1),{x:i,y:c}}const ST=Ja(0);function b3(e){const t=cr(e);return!Vh()||!t.visualViewport?ST:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function jT(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==cr(e)?!1:t}function Oo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=Uh(e);let i=Ja(1);t&&(r?ra(r)&&(i=vi(r)):i=vi(e));const c=jT(o,n,r)?b3(o):Ja(0);let u=(a.left+c.x)/i.x,d=(a.top+c.y)/i.y,h=a.width/i.x,p=a.height/i.y;if(o){const f=cr(o),y=r&&ra(r)?cr(r):r;let g=f,m=g.frameElement;for(;m&&r&&y!==g;){const b=vi(m),w=m.getBoundingClientRect(),_=Ar(m),x=w.left+(m.clientLeft+parseFloat(_.paddingLeft))*b.x,j=w.top+(m.clientTop+parseFloat(_.paddingTop))*b.y;u*=b.x,d*=b.y,h*=b.x,p*=b.y,u+=x,d+=j,g=cr(m),m=g.frameElement}}return qc({width:h,height:p,x:u,y:d})}const kT=[":popover-open",":modal"];function Wh(e){return kT.some(t=>{try{return e.matches(t)}catch{return!1}})}function ET(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",i=ja(r),c=t?Wh(t.floating):!1;if(r===i||c&&o)return n;let u={scrollLeft:0,scrollTop:0},d=Ja(1);const h=Ja(0),p=aa(r);if((p||!p&&!o)&&((qi(r)!=="body"||xl(i))&&(u=ju(r)),aa(r))){const f=Oo(r);d=vi(r),h.x=f.x+r.clientLeft,h.y=f.y+r.clientTop}return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-u.scrollLeft*d.x+h.x,y:n.y*d.y-u.scrollTop*d.y+h.y}}function NT(e){return Array.from(e.getClientRects())}function _3(e){return Oo(ja(e)).left+ju(e).scrollLeft}function TT(e){const t=ja(e),n=ju(e),r=e.ownerDocument.body,a=ar(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=ar(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+_3(e);const c=-n.scrollTop;return Ar(r).direction==="rtl"&&(i+=ar(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:i,y:c}}function PT(e,t){const n=cr(e),r=ja(e),a=n.visualViewport;let o=r.clientWidth,i=r.clientHeight,c=0,u=0;if(a){o=a.width,i=a.height;const d=Vh();(!d||d&&t==="fixed")&&(c=a.offsetLeft,u=a.offsetTop)}return{width:o,height:i,x:c,y:u}}function LT(e,t){const n=Oo(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=aa(e)?vi(e):Ja(1),i=e.clientWidth*o.x,c=e.clientHeight*o.y,u=a*o.x,d=r*o.y;return{width:i,height:c,x:u,y:d}}function c0(e,t,n){let r;if(t==="viewport")r=PT(e,n);else if(t==="document")r=TT(ja(e));else if(ra(t))r=LT(t,n);else{const a=b3(e);r={...t,x:t.x-a.x,y:t.y-a.y}}return qc(r)}function x3(e,t){const n=eo(e);return n===t||!ra(n)||ki(n)?!1:Ar(n).position==="fixed"||x3(n,t)}function AT(e,t){const n=t.get(e);if(n)return n;let r=Gs(e,[],!1).filter(c=>ra(c)&&qi(c)!=="body"),a=null;const o=Ar(e).position==="fixed";let i=o?eo(e):e;for(;ra(i)&&!ki(i);){const c=Ar(i),u=$h(i);!u&&c.position==="fixed"&&(a=null),(o?!u&&!a:!u&&c.position==="static"&&a&&["absolute","fixed"].includes(a.position)||xl(i)&&!u&&x3(e,i))?r=r.filter(d=>d!==i):a=c,i=eo(i)}return t.set(e,r),r}function RT(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const o=[...n==="clippingAncestors"?Wh(t)?[]:AT(t,this._c):[].concat(n),r],i=o[0],c=o.reduce((u,d)=>{const h=c0(t,d,a);return u.top=ar(h.top,u.top),u.right=Kr(h.right,u.right),u.bottom=Kr(h.bottom,u.bottom),u.left=ar(h.left,u.left),u},c0(t,i,a));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function DT(e){const{width:t,height:n}=C3(e);return{width:t,height:n}}function OT(e,t,n){const r=aa(t),a=ja(t),o=n==="fixed",i=Oo(e,!0,o,t);let c={scrollLeft:0,scrollTop:0};const u=Ja(0);if(r||!r&&!o)if((qi(t)!=="body"||xl(a))&&(c=ju(t)),r){const p=Oo(t,!0,o,t);u.x=p.x+t.clientLeft,u.y=p.y+t.clientTop}else a&&(u.x=_3(a));const d=i.left+c.scrollLeft-u.x,h=i.top+c.scrollTop-u.y;return{x:d,y:h,width:i.width,height:i.height}}function c1(e){return Ar(e).position==="static"}function u0(e,t){return!aa(e)||Ar(e).position==="fixed"?null:t?t(e):e.offsetParent}function w3(e,t){const n=cr(e);if(Wh(e))return n;if(!aa(e)){let a=eo(e);for(;a&&!ki(a);){if(ra(a)&&!c1(a))return a;a=eo(a)}return n}let r=u0(e,t);for(;r&&xT(r)&&c1(r);)r=u0(r,t);return r&&ki(r)&&c1(r)&&!$h(r)?n:r||wT(e)||n}const IT=async function(e){const t=this.getOffsetParent||w3,n=this.getDimensions,r=await n(e.floating);return{reference:OT(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function MT(e){return Ar(e).direction==="rtl"}const BT={convertOffsetParentRelativeRectToViewportRelativeRect:ET,getDocumentElement:ja,getClippingRect:RT,getOffsetParent:w3,getElementRects:IT,getClientRects:NT,getDimensions:DT,getScale:vi,isElement:ra,isRTL:MT};function FT(e,t){let n=null,r;const a=ja(e);function o(){var c;clearTimeout(r),(c=n)==null||c.disconnect(),n=null}function i(c,u){c===void 0&&(c=!1),u===void 0&&(u=1),o();const{left:d,top:h,width:p,height:f}=e.getBoundingClientRect();if(c||t(),!p||!f)return;const y=Vl(h),g=Vl(a.clientWidth-(d+p)),m=Vl(a.clientHeight-(h+f)),b=Vl(d),w={rootMargin:-y+"px "+-g+"px "+-m+"px "+-b+"px",threshold:ar(0,Kr(1,u))||1};let _=!0;function x(j){const k=j[0].intersectionRatio;if(k!==u){if(!_)return i();k?i(!1,k):r=setTimeout(()=>{i(!1,1e-7)},1e3)}_=!1}try{n=new IntersectionObserver(x,{...w,root:a.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return i(!0),o}function HT(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:i=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:u=!1}=r,d=Uh(e),h=a||o?[...d?Gs(d):[],...Gs(t)]:[];h.forEach(w=>{a&&w.addEventListener("scroll",n,{passive:!0}),o&&w.addEventListener("resize",n)});const p=d&&c?FT(d,n):null;let f=-1,y=null;i&&(y=new ResizeObserver(w=>{let[_]=w;_&&_.target===d&&y&&(y.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=y)==null||x.observe(t)})),n()}),d&&!u&&y.observe(d),y.observe(t));let g,m=u?Oo(e):null;u&&b();function b(){const w=Oo(e);m&&(w.x!==m.x||w.y!==m.y||w.width!==m.width||w.height!==m.height)&&n(),m=w,g=requestAnimationFrame(b)}return n(),()=>{var w;h.forEach(_=>{a&&_.removeEventListener("scroll",n),o&&_.removeEventListener("resize",n)}),p==null||p(),(w=y)==null||w.disconnect(),y=null,u&&cancelAnimationFrame(g)}}const $T=yT,VT=CT,UT=gT,WT=_T,qT=mT,zT=bT,ZT=(e,t,n)=>{const r=new Map,a={platform:BT,...n},o={...a.platform,_c:r};return pT(e,t,{...a,platform:o})};var GT="div";function d0(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const a={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return je(he({},a),{toJSON:()=>a})}function YT(e){if(!e)return d0();const{x:t,y:n,width:r,height:a}=e;return d0(t,n,r,a)}function KT(e,t){return{contextElement:e||void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?YT(r):n.getBoundingClientRect()}}}function XT(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}function h0(e){const t=window.devicePixelRatio||1;return Math.round(e*t)/t}function JT(e,t){return $T(({placement:n})=>{var r;const a=((e==null?void 0:e.clientHeight)||0)/2,o=typeof t.gutter=="number"?t.gutter+a:(r=t.gutter)!=null?r:a;return{crossAxis:n.split("-")[1]?void 0:t.shift,mainAxis:o,alignmentAxis:t.shift}})}function QT(e){if(e.flip===!1)return;const t=typeof e.flip=="string"?e.flip.split(" "):void 0;return $n(!t||t.every(XT),process.env.NODE_ENV!=="production"&&"`flip` expects a spaced-delimited list of placements"),UT({padding:e.overflowPadding,fallbackPlacements:t})}function eP(e){if(!(!e.slide&&!e.overlap))return VT({mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:zT()})}function tP(e){return WT({padding:e.overflowPadding,apply({elements:t,availableWidth:n,availableHeight:r,rects:a}){const o=t.floating,i=Math.round(a.reference.width);n=Math.floor(n),r=Math.floor(r),o.style.setProperty("--popover-anchor-width",`${i}px`),o.style.setProperty("--popover-available-width",`${n}px`),o.style.setProperty("--popover-available-height",`${r}px`),e.sameWidth&&(o.style.width=`${i}px`),e.fitViewport&&(o.style.maxWidth=`${n}px`,o.style.maxHeight=`${r}px`)}})}function nP(e,t){if(e)return qT({element:e,padding:t.arrowPadding})}var S3=gt(function(e){var t=e,{store:n,modal:r=!1,portal:a=!!r,preserveTabOrder:o=!0,autoFocusOnShow:i=!0,wrapperProps:c,fixed:u=!1,flip:d=!0,shift:h=0,slide:p=!0,overlap:f=!1,sameWidth:y=!1,fitViewport:g=!1,gutter:m,arrowPadding:b=4,overflowPadding:w=8,getAnchorRect:_,updatePosition:x}=t,j=mt(t,["store","modal","portal","preserveTabOrder","autoFocusOnShow","wrapperProps","fixed","flip","shift","slide","overlap","sameWidth","fitViewport","gutter","arrowPadding","overflowPadding","getAnchorRect","updatePosition"]);const k=p3();n=n||k,$n(n,process.env.NODE_ENV!=="production"&&"Popover must receive a `store` prop or be wrapped in a PopoverProvider component.");const L=n.useState("arrowElement"),D=n.useState("anchorElement"),S=n.useState("disclosureElement"),T=n.useState("popoverElement"),I=n.useState("contentElement"),A=n.useState("placement"),U=n.useState("mounted"),K=n.useState("rendered"),X=C.useRef(null),[G,Q]=C.useState(!1),{portalRef:oe,domReady:le}=Ch(a,j.portalRef),de=Ye(_),B=Ye(x),V=!!x;Et(()=>{if(!(T!=null&&T.isConnected))return;T.style.setProperty("--popover-overflow-padding",`${w}px`);const W=KT(D,de),J=async()=>{if(!U)return;L||(X.current=X.current||document.createElement("div"));const ee=L||X.current,re=[JT(ee,{gutter:m,shift:h}),QT({flip:d,overflowPadding:w}),eP({slide:p,shift:h,overlap:f,overflowPadding:w}),nP(ee,{arrowPadding:b}),tP({sameWidth:y,fitViewport:g,overflowPadding:w})],se=await ZT(W,T,{placement:A,strategy:u?"fixed":"absolute",middleware:re});n==null||n.setState("currentPlacement",se.placement),Q(!0);const ge=h0(se.x),ae=h0(se.y);if(Object.assign(T.style,{top:"0",left:"0",transform:`translate3d(${ge}px,${ae}px,0)`}),ee&&se.middlewareData.arrow){const{x:Oe,y:q}=se.middlewareData.arrow,Ce=se.placement.split("-")[0],xe=ee.clientWidth/2,Ae=ee.clientHeight/2,Be=Oe!=null?Oe+xe:-xe,ue=q!=null?q+Ae:-Ae;T.style.setProperty("--popover-transform-origin",{top:`${Be}px calc(100% + ${Ae}px)`,bottom:`${Be}px ${-Ae}px`,left:`calc(100% + ${xe}px) ${ue}px`,right:`${-xe}px ${ue}px`}[Ce]),Object.assign(ee.style,{left:Oe!=null?`${Oe}px`:"",top:q!=null?`${q}px`:"",[Ce]:"100%"})}},fe=HT(W,T,async()=>{V?(await B({updatePosition:J}),Q(!0)):await J()},{elementResize:typeof ResizeObserver=="function"});return()=>{Q(!1),fe()}},[n,K,T,L,D,T,A,U,le,u,d,h,p,f,y,g,m,b,w,de,V,B]),Et(()=>{if(!U||!le||!(T!=null&&T.isConnected)||!(I!=null&&I.isConnected))return;const W=()=>{T.style.zIndex=getComputedStyle(I).zIndex};W();let J=requestAnimationFrame(()=>{J=requestAnimationFrame(W)});return()=>cancelAnimationFrame(J)},[U,le,T,I]);const F=u?"fixed":"absolute";return j=qn(j,W=>l.jsx("div",je(he({},c),{style:he({position:F,top:0,left:0,width:"max-content"},c==null?void 0:c.style),ref:n==null?void 0:n.setPopoverElement,children:W})),[n,F,c]),j=qn(j,W=>l.jsx(m3,{value:n,children:W}),[n]),j=je(he({"data-placing":!G||void 0},j),{style:he({position:"relative"},j.style)}),j=h3(je(he({store:n,modal:r,portal:a,preserveTabOrder:o,preserveTabOrderAnchor:S||D,autoFocusOnShow:G&&i},j),{portalRef:oe})),j});Su(rt(function(e){const t=S3(e);return ut(GT,t)}),p3);var qh=Sa([iT],[m3]),zh=qh.useProviderContext,rP=qh.ContextProvider,j3=qh.ScopedContextProvider;function aP(e={}){var t;const n=(t=e.store)==null?void 0:t.getState(),r=aT(Gn(Ht({},e),{placement:St(e.placement,n==null?void 0:n.placement,"bottom")})),a=St(e.timeout,n==null?void 0:n.timeout,500),o=Gn(Ht({},r.getState()),{timeout:a,showTimeout:St(e.showTimeout,n==null?void 0:n.showTimeout),hideTimeout:St(e.hideTimeout,n==null?void 0:n.hideTimeout),autoFocusOnShow:St(n==null?void 0:n.autoFocusOnShow,!1)}),i=vr(o,r,e.store);return Gn(Ht(Ht({},r),i),{setAutoFocusOnShow:c=>i.setState("autoFocusOnShow",c)})}function oP(e,t,n){return lr(e,n,"timeout"),lr(e,n,"showTimeout"),lr(e,n,"hideTimeout"),oT(e,t,n)}function u1(e){return[e.clientX,e.clientY]}function f0(e,t){const[n,r]=e;let a=!1;const o=t.length;for(let i=o,c=0,u=i-1;c<i;u=c++){const[d,h]=t[c],[p,f]=t[u],[,y]=t[u===0?i-1:u-1]||[0,0],g=(h-f)*(n-d)-(d-p)*(r-h);if(f<h){if(r>=f&&r<h){if(g===0)return!0;g>0&&(r===f?r>y&&(a=!a):a=!a)}}else if(h<f){if(r>h&&r<=f){if(g===0)return!0;g<0&&(r===f?r<y&&(a=!a):a=!a)}}else if(r===h&&(n>=p&&n<=d||n>=d&&n<=p))return!0}return a}function iP(e,t){const{top:n,right:r,bottom:a,left:o}=t,[i,c]=e,u=i<o?"left":i>r?"right":null,d=c<n?"top":c>a?"bottom":null;return[u,d]}function p0(e,t){const n=e.getBoundingClientRect(),{top:r,right:a,bottom:o,left:i}=n,[c,u]=iP(t,n),d=[t];return c?(u!=="top"&&d.push([c==="left"?i:a,r]),d.push([c==="left"?a:i,r]),d.push([c==="left"?a:i,o]),u!=="bottom"&&d.push([c==="left"?i:a,o])):u==="top"?(d.push([i,r]),d.push([i,o]),d.push([a,o]),d.push([a,r])):(d.push([i,o]),d.push([i,r]),d.push([a,r]),d.push([a,o])),d}var sP="div";function k3(e,t,n,r){return H5(t)?!0:e?!!(Xt(t,e)||n&&Xt(n,e)||r!=null&&r.some(a=>k3(e,a,n))):!1}function lP(e){var t=e,{store:n}=t,r=mt(t,["store"]);const[a,o]=C.useState(!1),i=n.useState("mounted");C.useEffect(()=>{i||o(!1)},[i]);const c=r.onFocus,u=Ye(h=>{c==null||c(h),!h.defaultPrevented&&o(!0)}),d=C.useRef(null);return C.useEffect(()=>Ka(n,["anchorElement"],h=>{d.current=h.anchorElement}),[]),r=je(he({autoFocusOnHide:a,finalFocus:d},r),{onFocus:u}),r}var m0=C.createContext(null),E3=gt(function(e){var t=e,{store:n,modal:r=!1,portal:a=!!r,hideOnEscape:o=!0,hideOnHoverOutside:i=!0,disablePointerEventsOnApproach:c=!!i}=t,u=mt(t,["store","modal","portal","hideOnEscape","hideOnHoverOutside","disablePointerEventsOnApproach"]);const d=zh();n=n||d,$n(n,process.env.NODE_ENV!=="production"&&"Hovercard must receive a `store` prop or be wrapped in a HovercardProvider component.");const h=C.useRef(null),[p,f]=C.useState([]),y=C.useRef(0),g=C.useRef(null),{portalRef:m,domReady:b}=Ch(a,u.portalRef),w=!!i,_=ga(i),x=!!c,j=ga(c),k=n.useState("open"),L=n.useState("mounted");C.useEffect(()=>{if(!b||!L||!w&&!x)return;const A=h.current;return A?Yn(gn("mousemove",U=>{if(!n)return;const{anchorElement:K,hideTimeout:X,timeout:G}=n.getState(),Q=g.current,[oe]=U.composedPath(),le=K;if(k3(oe,A,le,p)){g.current=oe&&le&&Xt(le,oe)?u1(U):null,window.clearTimeout(y.current),y.current=0;return}if(!y.current){if(Q){const de=u1(U),B=p0(A,Q);if(f0(de,B)){if(g.current=de,!j(U))return;U.preventDefault(),U.stopPropagation();return}}_(U)&&(y.current=window.setTimeout(()=>{y.current=0,n==null||n.hide()},X??G))}},!0),()=>clearTimeout(y.current)):void 0},[n,b,L,w,x,p,j,_]),C.useEffect(()=>{if(!b||!L||!x)return;const A=U=>{const K=h.current;if(!K)return;const X=g.current;if(!X)return;const G=p0(K,X);if(f0(u1(U),G)){if(!j(U))return;U.preventDefault(),U.stopPropagation()}};return Yn(gn("mouseenter",A,!0),gn("mouseover",A,!0),gn("mouseout",A,!0),gn("mouseleave",A,!0))},[b,L,x,j]),C.useEffect(()=>{b&&(k||n==null||n.setAutoFocusOnShow(!1))},[n,b,k]);const D=L5(k);C.useEffect(()=>{if(b)return()=>{D.current||n==null||n.setAutoFocusOnShow(!1)}},[n,b]);const S=C.useContext(m0);Et(()=>{if(r||!a||!L||!b)return;const A=h.current;if(A)return S==null?void 0:S(A)},[r,a,L,b]);const T=C.useCallback(A=>{f(K=>[...K,A]);const U=S==null?void 0:S(A);return()=>{f(K=>K.filter(X=>X!==A)),U==null||U()}},[S]);u=qn(u,A=>l.jsx(j3,{value:n,children:l.jsx(m0.Provider,{value:T,children:A})}),[n,T]),u=je(he({},u),{ref:Cn(h,u.ref)}),u=lP(he({store:n},u));const I=n.useState(A=>r||A.autoFocusOnShow);return u=S3(je(he({store:n,modal:r,portal:a,autoFocusOnShow:I},u),{portalRef:m,hideOnEscape(A){return $c(o,A)?!1:(requestAnimationFrame(()=>{requestAnimationFrame(()=>{n==null||n.hide()})}),!0)}})),u});Su(rt(function(e){const t=E3(e);return ut(sP,t)}),zh);var cP="a",N3=gt(function(e){var t=e,{store:n,showOnHover:r=!0}=t,a=mt(t,["store","showOnHover"]);const o=zh();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"HovercardAnchor must receive a `store` prop or be wrapped in a HovercardProvider component.");const i=vl(a),c=C.useRef(0);C.useEffect(()=>()=>window.clearTimeout(c.current),[]),C.useEffect(()=>gn("mouseleave",m=>{if(!n)return;const{anchorElement:b}=n.getState();b&&m.target===b&&(window.clearTimeout(c.current),c.current=0)},!0),[n]);const u=a.onMouseMove,d=ga(r),h=Mk(),p=Ye(m=>{if(u==null||u(m),i||!n||m.defaultPrevented||c.current||!h()||!d(m))return;const b=m.currentTarget;n.setAnchorElement(b),n.setDisclosureElement(b);const{showTimeout:w,timeout:_}=n.getState(),x=()=>{c.current=0,h()&&(n==null||n.setAnchorElement(b),n==null||n.show(),queueMicrotask(()=>{n==null||n.setDisclosureElement(b)}))},j=w??_;j===0?x():c.current=window.setTimeout(x,j)}),f=a.onClick,y=Ye(m=>{f==null||f(m),n&&(window.clearTimeout(c.current),c.current=0)}),g=C.useCallback(m=>{if(!n)return;const{anchorElement:b}=n.getState();b!=null&&b.isConnected||n.setAnchorElement(m)},[n]);return a=je(he({},a),{ref:Cn(g,a.ref),onMouseMove:p,onClick:y}),a=Cl(a),a});rt(function(e){const t=N3(e);return ut(cP,t)});function uP(e={}){var t;process.env.NODE_ENV!=="production"&&e.type==="label"&&console.warn("The `type` option on the tooltip store is deprecated.","Render a visually hidden label or use the `aria-label` or `aria-labelledby` attributes on the anchor element instead.","See https://ariakit.org/components/tooltip#tooltip-anchors-must-have-accessible-names");const n=(t=e.store)==null?void 0:t.getState(),r=aP(Gn(Ht({},e),{placement:St(e.placement,n==null?void 0:n.placement,"top"),hideTimeout:St(e.hideTimeout,n==null?void 0:n.hideTimeout,0)})),a=Gn(Ht({},r.getState()),{type:St(e.type,n==null?void 0:n.type,"description"),skipTimeout:St(e.skipTimeout,n==null?void 0:n.skipTimeout,300)}),o=vr(a,r,e.store);return Ht(Ht({},r),o)}function dP(e,t,n){return lr(e,n,"type"),lr(e,n,"skipTimeout"),oP(e,t,n)}function hP(e={}){const[t,n]=_u(uP,e);return dP(t,n,e)}var Zh=Sa([rP],[j3]),Gh=Zh.useProviderContext,fP=Zh.ContextProvider,pP=Zh.ScopedContextProvider,mP="div",gP=gt(function(e){var t=e,{store:n,portal:r=!0,gutter:a=8,preserveTabOrder:o=!1,hideOnHoverOutside:i=!0,hideOnInteractOutside:c=!0}=t,u=mt(t,["store","portal","gutter","preserveTabOrder","hideOnHoverOutside","hideOnInteractOutside"]);const d=Gh();n=n||d,$n(n,process.env.NODE_ENV!=="production"&&"Tooltip must receive a `store` prop or be wrapped in a TooltipProvider component."),u=qn(u,p=>l.jsx(pP,{value:n,children:p}),[n]);const h=n.useState(p=>p.type==="description"?"tooltip":"none");return u=he({role:h},u),u=E3(je(he({},u),{store:n,portal:r,gutter:a,preserveTabOrder:o,hideOnHoverOutside(p){if($c(i,p))return!1;const f=n==null?void 0:n.getState().anchorElement;return f?!("focusVisible"in f.dataset):!0},hideOnInteractOutside:p=>{if($c(c,p))return!1;const f=n==null?void 0:n.getState().anchorElement;return f?!Xt(f,p.target):!0}})),u}),vP=Su(rt(function(e){const t=gP(e);return ut(mP,t)}),Gh);function yP(e={}){const t=hP(e);return l.jsx(fP,{value:t,children:e.children})}var CP="div",Co=vr({activeStore:null});function g0(e){return()=>{const{activeStore:t}=Co.getState();t===e&&Co.setState("activeStore",null)}}var bP=gt(function(e){var t=e,{store:n,showOnHover:r=!0}=t,a=mt(t,["store","showOnHover"]);const o=Gh();n=n||o,$n(n,process.env.NODE_ENV!=="production"&&"TooltipAnchor must receive a `store` prop or be wrapped in a TooltipProvider component.");const i=C.useRef(!1);C.useEffect(()=>Ka(n,["mounted"],m=>{m.mounted||(i.current=!1)}),[n]),C.useEffect(()=>{if(n)return Yn(g0(n),Ka(n,["mounted","skipTimeout"],m=>{if(!n)return;if(m.mounted){const{activeStore:w}=Co.getState();return w!==n&&(w==null||w.hide()),Co.setState("activeStore",n)}const b=setTimeout(g0(n),m.skipTimeout);return()=>clearTimeout(b)}))},[n]);const c=a.onMouseEnter,u=Ye(m=>{c==null||c(m),i.current=!0}),d=a.onFocusVisible,h=Ye(m=>{d==null||d(m),!m.defaultPrevented&&(n==null||n.setAnchorElement(m.currentTarget),n==null||n.show())}),p=a.onBlur,f=Ye(m=>{if(p==null||p(m),m.defaultPrevented)return;const{activeStore:b}=Co.getState();i.current=!1,b===n&&Co.setState("activeStore",null)}),y=n.useState("type"),g=n.useState(m=>{var b;return(b=m.contentElement)==null?void 0:b.id});return a=je(he({"aria-labelledby":y==="label"?g:void 0},a),{onMouseEnter:u,onFocusVisible:h,onBlur:f}),a=N3(he({store:n,showOnHover(m){if(!i.current||$c(r,m))return!1;const{activeStore:b}=Co.getState();return b?(n==null||n.show(),!1):!0}},a)),a}),_P=rt(function(e){const t=bP(e);return ut(CP,t)});const xP="_root_1b1uy_1",wP="_tooltip_1b1uy_10",SP="_tooltipText_1b1uy_19",v0={root:xP,tooltip:wP,tooltipText:SP},jP=({content:e})=>l.jsx("div",{className:v0.tooltip,children:l.jsx("p",{className:v0.tooltipText,children:e})}),kP="_root_4ee1r_1",EP="_coupon_4ee1r_8",NP="_couponApplied_4ee1r_14",TP="_discount_4ee1r_24",PP="_removeButton_4ee1r_30",LP="_removeButtonText_4ee1r_34",AP="_couponInput_4ee1r_38",RP="_applyButton_4ee1r_44",DP="_applyButtonText_4ee1r_48",La={root:kP,coupon:EP,couponApplied:NP,discount:TP,removeButton:PP,removeButtonText:LP,couponInput:AP,applyButton:RP,applyButtonText:DP},OP=({applyCoupon:e,couponData:t,discount:n,removeCoupon:r,gateway:a})=>{const[o,i]=C.useState("");return l.jsx("div",{className:La.coupon,children:t?l.jsxs("div",{className:La.couponApplied,children:[l.jsx(dl,{}),l.jsxs("p",{children:[o," is applied"," ",l.jsxs("span",{className:La.discount,children:["-",n," ",!t.isFixed&&`(${t.discount}%)`]})]}),l.jsx(Ee,{className:La.removeButton,type:"Secondary",onClick:r,children:l.jsx("span",{className:La.removeButtonText,children:"Remove"})})]}):l.jsxs("div",{className:La.couponInput,children:[l.jsx(wa,{placeholder:"Enter a discount code",value:o,onChange:c=>i(c.target.value)}),l.jsxs(yP,{children:[l.jsx(_P,{render:l.jsx("div",{children:l.jsx(Ee,{className:La.applyButton,onClick:()=>e(o),disabled:!a,children:l.jsx("span",{className:La.applyButtonText,children:"Apply"})})}),children:"Tooltip"}),!a&&l.jsx(vP,{children:l.jsx(jP,{content:"The discount is related to the method of payment. Select to enter."})})]})]})})},IP="_root_4p9sj_1",MP="_checkoutFooter_4p9sj_10",BP="_footerBranding_4p9sj_19",FP="_poweredText_4p9sj_24",HP="_footerNav_4p9sj_30",Ul={root:IP,checkoutFooter:MP,footerBranding:BP,poweredText:FP,footerNav:HP},_a=({className:e})=>{const[t]=me(r5),[n]=me(a5),[r]=me(o5);return l.jsxs("footer",{className:`${Ul.checkoutFooter} ${e}`,children:[l.jsxs("div",{className:Ul.footerBranding,children:[l.jsx("p",{className:Ul.poweredText,children:"Powered by"}),l.jsx(Gx,{})]}),l.jsx("nav",{children:l.jsxs("ul",{className:Ul.footerNav,children:[(t==null?void 0:t.showTermsOfServiceOnProduct)&&l.jsx("li",{children:l.jsx("a",{href:t.termsOfService,target:"_blank",rel:"noopener noreferrer",children:"Terms"})}),(n==null?void 0:n.showPrivacyPolicyOnProduct)&&l.jsx("li",{children:l.jsx("a",{href:n.privacyPolicy,target:"_blank",rel:"noopener noreferrer",children:"Privacy"})}),(r==null?void 0:r.showRefundPolicyOnProduct)&&l.jsx("li",{children:l.jsx("a",{href:r.refundPolicy,target:"_blank",rel:"noopener noreferrer",children:"Refund"})})]})})]})},$P="_root_xi9no_1",VP="_timerContainer_xi9no_10",UP="_timerText_xi9no_21",y0={root:$P,timerContainer:VP,timerText:UP},WP=({expiresAt:e})=>{const[t,n]=C.useState(r());function r(){const a=new Date,o=new Date(e).getTime()-a.getTime();if(o<=0)return{hours:"00",minutes:"00",seconds:"00"};const i=Math.floor(o/(1e3*60*60)),c=Math.floor(o%(1e3*60*60)/(1e3*60)),u=Math.floor(o%(1e3*60)/1e3);return{hours:String(i).padStart(2,"0"),minutes:String(c).padStart(2,"0"),seconds:String(u).padStart(2,"0")}}return C.useEffect(()=>{const a=setInterval(()=>{n(r())},1e3);return()=>clearInterval(a)},[e]),t.hours==="00"&&t.minutes==="00"&&t.seconds==="00"?null:l.jsxs("div",{className:y0.timerContainer,children:[l.jsx(xs,{}),l.jsxs("p",{className:y0.timerText,children:[t.hours,":",t.minutes,":",t.seconds]})]})},qP="_root_1bg1c_1",zP="_checkoutHeader_1bg1c_10",ZP="_leftContainer_1bg1c_30",GP="_backArrow_1bg1c_37",YP="_logoContainer_1bg1c_50",KP="_logo_1bg1c_50",as={root:qP,checkoutHeader:zP,leftContainer:ZP,backArrow:GP,logoContainer:YP,logo:KP},wl=({className:e,expiresAt:t})=>{const[n]=me(hl),r=ur();return l.jsxs("header",{className:`${as.checkoutHeader} ${e}`,children:[l.jsxs("div",{className:as.leftContainer,children:[l.jsx("div",{className:as.backArrow,onClick:()=>r("/"),children:l.jsx(Gm,{})}),(n==null?void 0:n.info.logo)&&l.jsx("div",{className:as.logoContainer,children:l.jsx("img",{className:as.logo,src:gr(n.info.logo.cfId),alt:n.info.name})})]}),t&&l.jsx(WP,{expiresAt:t})]})},XP="_root_1n4we_1",JP="_checkoutPrices_1n4we_10",QP="_priceRow_1n4we_22",eL="_label_1n4we_32",tL="_totalRow_1n4we_37",nL="_totalLabel_1n4we_48",rL="_totalValue_1n4we_53",Aa={root:XP,checkoutPrices:JP,priceRow:QP,label:eL,totalRow:tL,totalLabel:nL,totalValue:rL},ku=({formatter:e,coupon:t,discount:n,totalWithDiscount:r,total:a,className:o})=>l.jsxs("div",{className:`${Aa.checkoutPrices} ${o||""}`,children:[l.jsxs("div",{className:Aa.priceRow,children:[l.jsx("p",{className:Aa.label,children:"Subtotal"}),l.jsx("p",{children:e.format(a)})]}),t&&l.jsxs("div",{className:Aa.priceRow,children:[l.jsxs("p",{className:Aa.label,children:["Discount ",!t.isFixed&&`(${t.discount}%)`]}),l.jsxs("p",{children:["-",e.format(n)]})]}),l.jsxs("div",{className:Aa.totalRow,children:[l.jsx("p",{className:Aa.totalLabel,children:"Total Due"}),l.jsx("p",{className:Aa.totalValue,children:r?e.format(r):e.format(a)})]})]}),aL="_root_1gzhf_1",oL="_checkoutItemsContainer_1gzhf_11",iL="_innerContainer_1gzhf_26",sL="_headerSection_1gzhf_34",lL="_header_1gzhf_34",cL="_productsContainer_1gzhf_60",uL="_couponContainer_1gzhf_68",dL="_checkoutFooter_1gzhf_73",uo={root:aL,checkoutItemsContainer:oL,innerContainer:iL,headerSection:sL,header:lL,productsContainer:cL,couponContainer:uL,checkoutFooter:dL},hL=({cart:e,products:t,applyCoupon:n,applyCouponPending:r,coupon:a,totalAndDiscount:o,removeCoupon:i})=>{var c;const u=C.useMemo(()=>e.parts.map(f=>{const y=t.find(m=>m.id===f.productId),g=y==null?void 0:y.variants.find(m=>m.id===f.productVariantId);return{id:(y==null?void 0:y.id)||0,image:y==null?void 0:y.images[0],name:(g==null?void 0:g.name)||"",description:(g==null?void 0:g.description)||"",price:{quantity:f.quantity,amount:(g==null?void 0:g.price.amount)||0,currency:g==null?void 0:g.price.currency},subscriptionSettings:g==null?void 0:g.subscriptionSettings}}),[e,t]),d=((c=u[0])==null?void 0:c.price.currency)||"USD",h=new Intl.NumberFormat("en-US",{style:"currency",currency:d}),p=C.useMemo(()=>o.totalWithDiscount?o.total-o.totalWithDiscount:0,[o]);return l.jsx("div",{className:uo.checkoutItemsContainer,children:l.jsxs("div",{className:uo.innerContainer,children:[l.jsx(wl,{}),l.jsxs("div",{className:uo.headerSection,children:[l.jsx("header",{className:uo.header,children:l.jsx("h1",{children:"Checkout"})}),l.jsx("div",{className:uo.productsContainer,children:u.map(f=>l.jsx(mh,{product:f},f.id))}),l.jsx("div",{className:uo.couponContainer,children:l.jsx(OP,{applyCoupon:n,applyCouponPending:r,couponData:a,discount:h.format(p),removeCoupon:i,gateway:e.gateway})}),l.jsx(ku,{formatter:h,coupon:a,total:o.total,discount:p,totalWithDiscount:o.totalWithDiscount})]}),l.jsx("div",{className:uo.checkoutFooter,children:l.jsx(_a,{})})]})})},fL="_root_pw7xq_1",pL="_checkbox_pw7xq_10",mL="_checked_pw7xq_21",gL="_checkboxInput_pw7xq_27",d1={root:fL,checkbox:pL,checked:mL,checkboxInput:gL},Ss=({onCheckedChange:e,checked:t,...n})=>l.jsxs("label",{className:Ue(d1.checkbox,{[d1.checked]:t}),children:[l.jsx("input",{className:d1.checkboxInput,type:"checkbox",checked:t,onChange:r=>e&&e(r.target.checked),...n}),t&&l.jsx(Hx,{})]}),vL="_root_zd1pk_1",yL="_textareaContainer_zd1pk_10",CL="_textarea_zd1pk_10",bL="_textareaPrimary_zd1pk_29",_L="_textareaSecondary_zd1pk_32",xL="_textareaWithMaxLength_zd1pk_35",wL="_textareaMaxLength_zd1pk_40",pi={root:vL,textareaContainer:yL,textarea:CL,textareaPrimary:bL,textareaSecondary:_L,textareaWithMaxLength:xL,textareaMaxLength:wL},SL={primary:pi.primary,secondary:pi.secondary},Yh=({variant:e,className:t,...n})=>{var r;const a=n.maxLength?pi.withMaxLength:"";return l.jsxs("div",{className:pi.textareaContainer,children:[l.jsx("textarea",{className:Ue(pi.textarea,a,t,{[String(SL[e])]:e}),...n}),n.maxLength&&l.jsxs("span",{className:pi.textareaMaxLength,children:[((r=n.value)==null?void 0:r.toString().length)||0,"/",n.maxLength]})]})},jL="_root_f3544_1",kL="_customFields_f3544_8",EL="_checkboxWrapper_f3544_15",NL="_checkboxLabel_f3544_22",TL="_textareaWrapper_f3544_26",PL="_inputWrapper_f3544_27",LL="_label_f3544_33",mo={root:jL,customFields:kL,checkboxWrapper:EL,checkboxLabel:NL,textareaWrapper:TL,inputWrapper:PL,label:LL},AL=({customFields:e})=>{if(e.length===0)return null;const t=e.map(n=>l.jsx(RL,{customField:n},n.name));return l.jsx("div",{className:mo.customFields,children:t})},RL=({customField:e})=>{const[t,n]=me(e.valueAtom);return l.jsx(DL,{value:t,placeholder:e.placeholder,required:e.required,defaultValue:e.defaultValue,type:e.type,onValueChange:n,label:e.name,regex:e.regex})},DL=({label:e,type:t,defaultValue:n,value:r,placeholder:a,regex:o,required:i,onValueChange:c})=>{if(t===Bl.Checkbox)return l.jsxs("label",{className:mo.checkboxWrapper,children:[l.jsx(Ss,{defaultChecked:typeof n=="boolean"?n:void 0,required:i,checked:!!r,onCheckedChange:d=>c(d)}),l.jsx("p",{className:mo.checkboxLabel,children:e})]});if(t==Bl.Hidden)return l.jsx("input",{type:"hidden",value:typeof n!="boolean"?n:void 0,required:i});const u=d=>{let h=/^\d*$/;t!=Bl.Number&&(h=o?new RegExp(o):new RegExp("")),h.test(d.target.value)&&c(d.target.value)};return t==Bl.Textarea?l.jsxs("div",{className:mo.textareaWrapper,children:[l.jsx("p",{className:mo.label,children:e}),l.jsx(Yh,{value:r,placeholder:a,required:i,onChange:u})]}):l.jsxs("div",{className:mo.inputWrapper,children:[l.jsx("p",{className:mo.label,children:e}),l.jsx(wa,{value:r,placeholder:a,required:i,onChange:u})]})},OL="_root_u58v5_1",IL="_activeBadge_u58v5_10",ML="_activeBadgeText_u58v5_22",C0={root:OL,activeBadge:IL,activeBadgeText:ML},BL=({className:e})=>l.jsxs("div",{className:Ue(C0.activeBadge,e),children:[l.jsx(Vx,{}),l.jsx("p",{className:C0.activeBadgeText,children:"Active"})]}),FL="_root_bjkpw_1",HL="_connectedContainer_bjkpw_8",$L="_userInfo_bjkpw_17",VL="_avatar_bjkpw_23",UL="_avatarImage_bjkpw_33",WL="_connectButton_bjkpw_39",qL="_connectText_bjkpw_47",ti={root:FL,connectedContainer:HL,userInfo:$L,avatar:VL,avatarImage:UL,connectButton:WL,connectText:qL},T3=ze(null).pipe(ch("customerDiscordConnection")),zL=({customerEmail:e})=>{const[t,n]=C.useState({authorized:!1}),[r,a]=C.useState(),[o,i]=me(T3);C.useEffect(()=>{(async()=>{if(!(!o||o.email!==e))try{const u=await Lp({id:o.id,customerEmail:o.email});n({authorized:!0,id:u.discordId,avatar:u.avatar,username:u.username})}catch(u){i(null),console.log("Still waiting for authorization.",u)}})()},[o,e,i]);const c=()=>{e.trim()!==""&&DS({customerEmail:e}).then(({id:u,redirectUrl:d})=>{let h=window.open(d);(!h||h.closed||typeof h.closed>"u")&&setTimeout(()=>{const f=document.createElement("a");f.href=d,f.target="_blank",f.click()});const p=setInterval(()=>{Lp({id:u,customerEmail:e}).then(f=>{n({authorized:!0,id:f.discordId,avatar:f.avatar,username:f.username}),i({id:u,email:e}),clearInterval(p),h&&h.close()}).catch(f=>{console.log("Still waiting for authorization.",f,{newWindow:h})})},3e3);a(p)}).catch(u=>{console.log("Could not initiate Discord authorization",u)})};return C.useEffect(()=>()=>{r&&clearInterval(r)},[r]),t.authorized?l.jsxs("div",{className:ti.connectedContainer,children:[l.jsxs("div",{className:ti.userInfo,children:[l.jsx("div",{className:ti.avatar,children:t.avatar?l.jsx("img",{className:ti.avatarImage,src:`https://cdn.discordapp.com/avatars/${t.id}/${t.avatar}.png?size=256`,alt:t.username}):l.jsx(Fx,{})}),l.jsx("p",{children:t.username}),l.jsx(BL,{})]}),l.jsx(Ee,{type:"Secondary",onClick:c,children:"Reconnect"})]}):l.jsxs(Ee,{type:"Secondary",className:`${ti.connectButton} text-textSecondary gap-1 w-full`,onClick:c,children:[l.jsx(Zx,{}),l.jsx("span",{className:ti.connectText,children:"Connect Your Discord"})]})},ZL="_root_14hfj_1",GL="_container_14hfj_7",YL="_icon_14hfj_17",KL="_text_14hfj_21",h1={root:ZL,container:GL,icon:YL,text:KL},P3=()=>l.jsxs("div",{className:h1.container,children:[l.jsx("div",{className:h1.icon,children:l.jsx(Xm,{})}),l.jsx("p",{className:h1.text,children:"By continuing to checkout, you agree to our terms of service and allow us to charge your payment method for this order."})]}),XL="_root_yc33x_1",JL="_securedBySsl_yc33x_8",QL="_iconWrapper_yc33x_18",eA="_text_yc33x_22",f1={root:XL,securedBySsl:JL,iconWrapper:QL,text:eA},L3=()=>l.jsxs("div",{className:f1.securedBySsl,children:[l.jsx("div",{className:f1.iconWrapper,children:l.jsx(Jm,{})}),l.jsx("p",{className:f1.text,children:"Your data is secured by extended validation SSL certificates (256-bit encryption). This complies with the strongest payment security standard available today."})]});var pn=(e=>(e.BankCard="BANK_CARD",e.BankTransfer="BANK_TRANSFER",e.PayPal="PAYPAL",e.CashApp="CASHAPP",e.Crypto="CRYPTO",e.AppleGooglePay="APPLE_AND_GOOGLE_PAY",e.Custom="CUSTOM",e))(pn||{});const tA="_root_1dej8_1",nA="_paymentMethod_1dej8_8",rA="_selected_1dej8_21",aA="_alignColumn_1dej8_24",oA="_paymentText_1dej8_31",iA="_balanceText_1dej8_36",sA="_signInLink_1dej8_40",lA="_iconContainer_1dej8_49",cA="_gatewayLogo_1dej8_57",uA="_poweredByLogo_1dej8_58",dA="_logo_1dej8_63",jn={root:tA,paymentMethod:nA,selected:rA,alignColumn:aA,paymentText:oA,balanceText:iA,signInLink:sA,iconContainer:lA,gatewayLogo:cA,poweredByLogo:uA,logo:dA},hA={[pn.CashApp]:l.jsx(Ix,{}),[pn.AppleGooglePay]:l.jsx(Bx,{}),[pn.BankCard]:l.jsx(Ox,{}),[pn.Crypto]:l.jsx(Dx,{}),[pn.PayPal]:l.jsx(Mx,{}),[pn.Custom]:l.jsx("div",{}),[pn.BankTransfer]:l.jsx($x,{})},fA={[pn.CashApp]:"Cash App",[pn.AppleGooglePay]:"Apple Pay / Google Pay",[pn.BankCard]:"Debit / Credit Card",[pn.Crypto]:"Cryptocurrency",[pn.PayPal]:"PayPal",[pn.Custom]:"",[pn.BankTransfer]:"Bank Transfer"},Kh=({align:e,paymentMethod:t,gatewayDisplayName:n,gateway:r,gatewayLogoCfId:a,poweredByLogoCfId:o,selected:i,onSelect:c})=>{const u=t===pn.Custom;return l.jsxs("div",{className:`${jn.paymentMethod} ${i?jn.selected:""} ${e==="column"?jn.alignColumn:""}`,onClick:()=>c&&c(t),children:[l.jsx("p",{className:jn.paymentText,children:u?n:fA[t]}),l.jsxs("div",{className:jn.iconContainer,children:[u?l.jsx("div",{className:jn.gatewayLogo,children:l.jsx("img",{className:jn.logo,src:gr(a),alt:n})}):hA[t],o&&l.jsx("div",{className:jn.poweredByLogo,children:l.jsx("img",{className:jn.logo,src:gr(o),alt:n})})]})]})},pA="_root_1yw3u_1",mA="_loadingSpinnerWrapper_1yw3u_10",gA="_loadingSpinner_1yw3u_10",vA="_spin_1yw3u_26",yA="_spinnerSizeDefault_1yw3u_26",CA="_spinnerSizeSmall_1yw3u_32",bA="_primary_1yw3u_47",_A="_secondary_1yw3u_54",Ei={root:pA,loadingSpinnerWrapper:mA,loadingSpinner:gA,spin:vA,spinnerSizeDefault:yA,spinnerSizeSmall:CA,primary:bA,secondary:_A},xA={primary:Ei.primary,secondary:Ei.secondary},wA={default:Ei.spinnerSizeDefault,small:Ei.spinnerSizeSmall},vn=({variant:e="primary",size:t="small"})=>l.jsx("div",{className:Ei.loadingSpinnerWrapper,children:l.jsx("div",{className:Ue(Ei.loadingSpinner,xA[e],wA[t])})}),SA="_root_1bd5b_1",jA="_bottomSheet_1bd5b_7",kA="_content_1bd5b_13",EA="_description_1bd5b_16",NA="_buttonGroup_1bd5b_20",TA="_buttonWrapper_1bd5b_31",PA="_fullWidthButton_1bd5b_34",ni={root:SA,bottomSheet:jA,content:kA,description:EA,buttonGroup:NA,buttonWrapper:TA,fullWidthButton:PA},LA=({isActive:e,setIsActive:t,balance:n})=>{const r=ur(),a=()=>{const o=`${pe.get(Wa).TopUp}?redirectRoute=${pe.get(Wa).Checkout}`;r(o)};return l.jsx(xa,{title:"Insufficient Customer Balance",isActive:e,setIsActive:t,children:l.jsxs("div",{className:ni.bottomSheet,children:[l.jsx("div",{className:ni.content,children:l.jsxs("p",{className:ni.description,children:["You currently have ",n&&Vt(n)," in your balance. After topping up the required amount, you can continue to checkout."]})}),l.jsxs("div",{className:ni.buttonGroup,children:[l.jsx("div",{className:ni.buttonWrapper,children:l.jsx(Ee,{type:"Secondary",className:"w-full",onClick:()=>t(!1),children:l.jsx("span",{className:"text-[var(--text-secondary)]",children:"Cancel"})})}),l.jsx("div",{className:ni.fullWidthButton,children:l.jsx(Ee,{type:"Primary",className:"w-full",onClick:a,children:l.jsx("span",{className:"text-[var(--text-inverted)]",children:"Add Balance"})})})]})]})})},A3=({align:e,gateway:t,gatewayDisplayName:n,selected:r,onSelect:a,balance:o,total:i,onSignInClick:c})=>{const[u]=me(oo),[d,h]=C.useState(!1),p=()=>{a&&a(t),o&&o.amount<i&&h(!0)};return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:`${jn.paymentMethod} ${r?jn.selected:""} ${e==="column"?jn.alignColumn:""}`,onClick:p,children:[l.jsxs("p",{className:jn.paymentText,children:[n," ",l.jsxs("span",{className:jn.balanceText,children:["(",u?o&&Vt(o):l.jsx("a",{className:jn.signInLink,onClick:c,children:"Sign in"}),")"]})]}),l.jsx("div",{className:jn.iconContainer,children:l.jsx(px,{})})]}),l.jsx(LA,{isActive:d,setIsActive:h,balance:o})]})},AA="_root_kkjng_1",RA="_paymentMethodsContainer_kkjng_8",DA={root:AA,paymentMethodsContainer:RA},R3=({possibleGateways:e,setGateway:t,balance:n,totalAndDiscount:r,onSignInClick:a,setPaymentMethod:o})=>{const[i,c]=C.useState(),[u,d]=C.useState(),[h,p]=C.useState(),[f,y]=C.useState(!1),g=(m,b)=>{t(b),o(m),c(m),d(b)};return C.useEffect(()=>{const m=async()=>{y(!0);const b=await g5([...e.availableGateways,...e.requiresSignInGateways]);p(b),y(!1)};e.availableGateways.length&&m()},[e]),f?l.jsx(vn,{}):l.jsx("div",{className:DA.paymentMethodsContainer,children:h==null?void 0:h.map(m=>m.name==="Balance"?l.jsx(A3,{gateway:m.name,gatewayDisplayName:m.displayName,onSelect:b=>{d(b),t(b)},selected:m.name===u,balance:n,total:r.total,onSignInClick:a},m.name):m.paymentMethods.map(b=>l.jsx(Kh,{paymentMethod:b,gateway:m.name,gatewayDisplayName:m.displayName,gatewayLogoCfId:m.logoCfImageId,poweredByLogoCfId:m.poweredByImageCfImageId,onSelect:()=>g(b,m.name),selected:i===b&&u===m.name},`${m.name}-${b}`)))})},OA=E.array(E.object({name:E.string(),displayName:E.string(),logoCfImageId:E.string(),poweredByImageCfImageId:E.string().optional(),paymentMethods:E.array(E.nativeEnum(pn))})),Rr=tn(async(e,t)=>Xn(await g5(t),OA)).pipe(Fn(null)),IA=E.object({gateways:E.array(E.string()),currency:E.string()}),MA=E.object({topUpBonusEnabled:E.literal(!0),minimumTopUpForBonus:E.number(),bonusPercent:E.number().int()}),BA=E.object({topUpBonusEnabled:E.literal(!1),minimumTopUpForBonus:E.number().optional(),bonusPercent:E.number().int().optional()}),FA=E.object({cashbackEnabled:E.literal(!0),cashbackPercent:E.number().int()}),HA=E.object({cashbackEnabled:E.literal(!1),cashbackPercent:E.number().int().optional()}),$A=IA.and(MA.or(BA).and(FA.or(HA))),VA=E.object({isEnabled:E.literal(!1)}),UA=E.object({isEnabled:E.literal(!0),topUpSettings:$A}),WA=UA.or(VA),Io=tn(async e=>{var t;const n=Xn(await TS(),WA);if(n.isEnabled){const r=(t=n==null?void 0:n.topUpSettings)==null?void 0:t.gateways;r&&Rr(e,r)}return n}).pipe(Fn(null));dr(Io.dataAtom,Io);const qA=E.object({currency:E.string(),manualBalance:E.number(),realBalance:E.number()}),Mo=tn(async()=>{const e=Xn(await NS(),qA);return{amount:e.realBalance+e.manualBalance,currency:e.currency}}).pipe(Fn(null));dr(Mo.dataAtom,Mo);var yd={exports:{}},p1={exports:{}},ct={};/** @license React v16.13.1
140
140
  * react-is.production.min.js
141
141
  *
142
142
  * Copyright (c) Facebook, Inc. and its affiliates.