const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/StoriesPage-CX89pBbh.js","assets/query-vendor-CZu0EHPe.js","assets/react-vendor-0bvDbF03.js","assets/StoryDetailModal-yP_dicD9.js","assets/card-pTcm2vXd.js","assets/AnimatedStoryCard-By_rImom.js","assets/sesl-badge-utils-BvAx6z8X.js","assets/i18n-vendor-Cl4-lKeC.js","assets/book-check-BkF6kO9w.js","assets/bookmark-tKlyD94b.js","assets/dialog-t3AzRZZB.js","assets/UpgradeButton-Mbh59UVD.js","assets/book-marked-B6wwesv3.js","assets/clock-DXiDtTEC.js","assets/file-text-BtAYSzGw.js","assets/slider-YdEFi4JE.js","assets/chevron-left-CGIEBZW_.js","assets/input-DQxcCVQw.js","assets/collapsible-CadXAKFj.js","assets/index-Doa5m1Nz.js","assets/use-mobile-BN2Z-RJr.js","assets/BreadcrumbNavigation-D6teNZ8n.js","assets/skeleton-DY6NLZem.js","assets/search-DnoAz0fB.js","assets/chevron-down-DHDW2a1r.js","assets/rotate-ccw-BUIB8j7t.js","assets/supabase-vendor-CNV44oIa.js","assets/helmet-vendor-NlTFkN97.js","assets/TextCheckerPage-BHcTeG5R.js","assets/story-generation-service-BNAtMOGO.js","assets/textarea-DSqabm87.js","assets/sesl-algorithm-D1A7ymV6.js","assets/index-mXG3wuIW.js","assets/chevron-up-ChMRuakL.js","assets/copy-Dprm9toi.js","assets/chart-column-DQ4C1Lrr.js","assets/generateCategoricalChart-BEY6DqYP.js","assets/YAxis-BcaY2V4W.js","assets/ShareCard-JhgkH4yW.js","assets/refresh-ccw-MEV-_RDw.js","assets/ResearchPage-gnPTQOIO.js","assets/table-0ykl18xM.js","assets/download-B7ElRH1u.js","assets/sparkles-CLIXjZRi.js","assets/mail-CS4zEcsZ.js","assets/ProfessionalNarrationSection-Bmb7J3DU.js","assets/SyncedHighlightsSection-DPxvFBnP.js","assets/useIOSAudioContext-DtqQj9l7.js","assets/InteractiveWordsSection-CXpQfDOR.js","assets/VocabularySection-5DN3HJ-5.js","assets/ChooseYourPaceSection-ChHrbdV5.js","assets/turtle-BxMM1_CN.js","assets/DyslexiaSection-QTMGBu-e.js","assets/CheckTextSection-BXvzbFIj.js","assets/ThemesSection-cbv4--vE.js","assets/ExploreThemesButton-C19z3iqd.js","assets/compass-DYHKM3Jy.js","assets/StoryMakerSection-C7R_velo.js","assets/AchievementsSection-DbODflB2.js","assets/HotAirBalloon-Di9GAu7M.js","assets/QuillWipe-DnU5m4Yw.js","assets/index.es-C3Wz79fL.js","assets/StoryReaderPage-C751KdWa.js","assets/arrow-left-BO_DtHg0.js","assets/switch-CjG630Eq.js","assets/useStoryData-CKAQetaI.js","assets/vocabulary-service-sQ8bHye5.js","assets/volume-2-UAOgcBH4.js","assets/xp-service-CHq7VbHJ.js","assets/progress-b75OoscM.js","assets/refresh-cw-Co6bSOWT.js","assets/seo-utils-CxE1GU73.js","assets/AboutPage-D_N5S73S.js","assets/CreateFreeAccountButton-BZP_uxzE.js","assets/ContactPage-BkHCwg1Y.js","assets/accordion-C4s_K-y2.js","assets/SocialIcons-DWGIwkB0.js","assets/circle-check-big-D0jRH6XB.js","assets/ImproveReadingPage-CleWJ81u.js","assets/eye-sHUQ8xe5.js","assets/users-DoEqDmjS.js","assets/party-popper-BF9_Y-Eq.js","assets/calendar-check-_Sij35_r.js","assets/AuthPages-DrYIgUgT.js","assets/checkbox-4xYPp0Zy.js","assets/eye-off-CaH63rpp.js","assets/ResetPasswordPage-B2pUQpuX.js","assets/VerifyEmailPage-DwMCNtoa.js","assets/NotFound-D2lUJS8I.js","assets/ProgressPage-C_5Q8viI.js","assets/zap-DF3whGdE.js","assets/format-B9FvFmC1.js","assets/calendar-D4N4dAfb.js","assets/ReadingCartPage-C51oylI8.js","assets/VocabularyNotebookPage-CplzBmvB.js","assets/alert-dialog-UIEnzhEE.js","assets/trash-2-CjJs2ZZe.js","assets/AdminPage-CdoaX6dB.js","assets/separator-DG1TCl7D.js","assets/CurrencySelector-C2bHzS4F.js","assets/circle-x-C6iFSPin.js","assets/useBlogData-Bh2vSfCY.js","assets/purify.es-D9RiKzGB.js","assets/tabs-CrUQXi16.js","assets/alert-DM4LdulI.js","assets/image-pJKPzXdN.js","assets/FontManagementPage-DmFqf1g1.js","assets/TermsPage-DwXm6iCg.js","assets/PrivacyPage-CbYhipxS.js","assets/RefundPage-DZfjEnDG.js","assets/SubscriptionPage-DlqOYjc5.js","assets/PaymentStatusPage-oce1QZRf.js","assets/ThemeInfoPage-BKilbYGu.js","assets/BlogPage-BtM1R41V.js","assets/BlogCard-BH9lXdn6.js","assets/BlogPostPage-C6DEQg_b.js","assets/NewsletterPage-DlsskTwk.js","assets/StoryMakerPage-KV3jJ56H.js"])))=>i.map(i=>d[i]);
import{j as o,Q as Wy,a as Gy}from"./query-vendor-CZu0EHPe.js";import{b as Vi,R as L,r as f,d as Pf,e as Ky,u as wc,f as Ys,L as ie,B as qy,h as Yy,i as v}from"./react-vendor-0bvDbF03.js";import{c as Xy,_ as g}from"./supabase-vendor-CNV44oIa.js";import{H as Zy,a as Jy}from"./helmet-vendor-NlTFkN97.js";import{i as kf,a as Qy,u as Oe}from"./i18n-vendor-Cl4-lKeC.js";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const i of r)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&s(a)}).observe(document,{childList:!0,subtree:!0});function n(r){const i={};return r.integrity&&(i.integrity=r.integrity),r.referrerPolicy&&(i.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?i.credentials="include":r.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function s(r){if(r.ep)return;r.ep=!0;const i=n(r);fetch(r.href,i)}})();var Sf,od=Vi;Sf=od.createRoot,od.hydrateRoot;class Rf extends L.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0,error:e}}componentDidCatch(e,n){console.error("ErrorBoundary caught an error:",e,n)}render(){return this.state.hasError?this.props.fallback||o.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-50",children:o.jsxs("div",{className:"text-center p-8",children:[o.jsx("h1",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Something went wrong"}),o.jsx("p",{className:"text-gray-600 mb-4",children:this.state.error?.message||"An unexpected error occurred"}),o.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-blue-600 text-white rounded hover:bg-blue-700",children:"Reload Page"})]})}):this.props.children}}const ex=1,tx=1e6;let pa=0;function nx(){return pa=(pa+1)%Number.MAX_SAFE_INTEGER,pa.toString()}const fa=new Map,id=t=>{if(fa.has(t))return;const e=setTimeout(()=>{fa.delete(t),Or({type:"REMOVE_TOAST",toastId:t})},tx);fa.set(t,e)},sx=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,ex)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?id(n):t.toasts.forEach(s=>{id(s.id)}),{...t,toasts:t.toasts.map(s=>s.id===n||n===void 0?{...s,open:!1}:s)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Ko=[];let qo={toasts:[]};function Or(t){qo=sx(qo,t),Ko.forEach(e=>{e(qo)})}function rx({...t}){const e=nx(),n=r=>Or({type:"UPDATE_TOAST",toast:{...r,id:e}}),s=()=>Or({type:"DISMISS_TOAST",toastId:e});return Or({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:r=>{r||s()}}}),{id:e,dismiss:s,update:n}}function Af(){const[t,e]=f.useState(qo);return f.useEffect(()=>(Ko.push(e),()=>{const n=Ko.indexOf(e);n>-1&&Ko.splice(n,1)}),[t]),{...t,toast:rx,dismiss:n=>Or({type:"DISMISS_TOAST",toastId:n})}}function W(t,e,{checkForDefaultPrevented:n=!0}={}){return function(r){if(t?.(r),n===!1||!r.defaultPrevented)return e?.(r)}}function ox(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function Fi(...t){return e=>t.forEach(n=>ox(n,e))}function Ae(...t){return f.useCallback(Fi(...t),t)}function ix(t,e=[]){let n=[];function s(i,a){const l=f.createContext(a),c=n.length;n=[...n,a];function u(h){const{scope:p,children:m,...y}=h,_=p?.[t][c]||l,x=f.useMemo(()=>y,Object.values(y));return o.jsx(_.Provider,{value:x,children:m})}function d(h,p){const m=p?.[t][c]||l,y=f.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const r=()=>{const i=n.map(a=>f.createContext(a));return function(l){const c=l?.[t]||i;return f.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return r.scopeName=t,[s,ax(r,...e)]}function ax(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const s=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const a=s.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var rs=f.forwardRef((t,e)=>{const{children:n,...s}=t,r=f.Children.toArray(n),i=r.find(lx);if(i){const a=i.props.children,l=r.map(c=>c===i?f.Children.count(a)>1?f.Children.only(null):f.isValidElement(a)?a.props.children:null:c);return o.jsx(cl,{...s,ref:e,children:f.isValidElement(a)?f.cloneElement(a,void 0,l):null})}return o.jsx(cl,{...s,ref:e,children:n})});rs.displayName="Slot";var cl=f.forwardRef((t,e)=>{const{children:n,...s}=t;if(f.isValidElement(n)){const r=ux(n);return f.cloneElement(n,{...cx(s,n.props),ref:e?Fi(e,r):r})}return f.Children.count(n)>1?f.Children.only(null):null});cl.displayName="SlotClone";var Cf=({children:t})=>o.jsx(o.Fragment,{children:t});function lx(t){return f.isValidElement(t)&&t.type===Cf}function cx(t,e){const n={...e};for(const s in e){const r=t[s],i=e[s];/^on[A-Z]/.test(s)?r&&i?n[s]=(...l)=>{i(...l),r(...l)}:r&&(n[s]=r):s==="style"?n[s]={...r,...i}:s==="className"&&(n[s]=[r,i].filter(Boolean).join(" "))}return{...t,...n}}function ux(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function Ec(t){const e=t+"CollectionProvider",[n,s]=ix(e),[r,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),a=m=>{const{scope:y,children:_}=m,x=L.useRef(null),b=L.useRef(new Map).current;return o.jsx(r,{scope:y,itemMap:b,collectionRef:x,children:_})};a.displayName=e;const l=t+"CollectionSlot",c=L.forwardRef((m,y)=>{const{scope:_,children:x}=m,b=i(l,_),w=Ae(y,b.collectionRef);return o.jsx(rs,{ref:w,children:x})});c.displayName=l;const u=t+"CollectionItemSlot",d="data-radix-collection-item",h=L.forwardRef((m,y)=>{const{scope:_,children:x,...b}=m,w=L.useRef(null),E=Ae(y,w),T=i(u,_);return L.useEffect(()=>(T.itemMap.set(w,{ref:w,...b}),()=>void T.itemMap.delete(w))),o.jsx(rs,{[d]:"",ref:E,children:x})});h.displayName=u;function p(m){const y=i(t+"CollectionConsumer",m);return L.useCallback(()=>{const x=y.collectionRef.current;if(!x)return[];const b=Array.from(x.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((T,j)=>b.indexOf(T.ref.current)-b.indexOf(j.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:a,Slot:c,ItemSlot:h},p,s]}function dx(t,e){const n=f.createContext(e),s=i=>{const{children:a,...l}=i,c=f.useMemo(()=>l,Object.values(l));return o.jsx(n.Provider,{value:c,children:a})};s.displayName=t+"Provider";function r(i){const a=f.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[s,r]}function Xs(t,e=[]){let n=[];function s(i,a){const l=f.createContext(a),c=n.length;n=[...n,a];const u=h=>{const{scope:p,children:m,...y}=h,_=p?.[t]?.[c]||l,x=f.useMemo(()=>y,Object.values(y));return o.jsx(_.Provider,{value:x,children:m})};u.displayName=i+"Provider";function d(h,p){const m=p?.[t]?.[c]||l,y=f.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const r=()=>{const i=n.map(a=>f.createContext(a));return function(l){const c=l?.[t]||i;return f.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return r.scopeName=t,[s,hx(r,...e)]}function hx(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const s=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const a=s.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var px=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],de=px.reduce((t,e)=>{const n=f.forwardRef((s,r)=>{const{asChild:i,...a}=s,l=i?rs:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),o.jsx(l,{...a,ref:r})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function jc(t,e){t&&Vi.flushSync(()=>t.dispatchEvent(e))}function vt(t){const e=f.useRef(t);return f.useEffect(()=>{e.current=t}),f.useMemo(()=>(...n)=>e.current?.(...n),[])}function fx(t,e=globalThis?.document){const n=vt(t);f.useEffect(()=>{const s=r=>{r.key==="Escape"&&n(r)};return e.addEventListener("keydown",s,{capture:!0}),()=>e.removeEventListener("keydown",s,{capture:!0})},[n,e])}var mx="DismissableLayer",ul="dismissableLayer.update",gx="dismissableLayer.pointerDownOutside",vx="dismissableLayer.focusOutside",ad,If=f.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),uo=f.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:s,onPointerDownOutside:r,onFocusOutside:i,onInteractOutside:a,onDismiss:l,...c}=t,u=f.useContext(If),[d,h]=f.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=f.useState({}),y=Ae(e,k=>h(k)),_=Array.from(u.layers),[x]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=_.indexOf(x),w=d?_.indexOf(d):-1,E=u.layersWithOutsidePointerEventsDisabled.size>0,T=w>=b,j=yx(k=>{const S=k.target,D=[...u.branches].some(A=>A.contains(S));!T||D||(r?.(k),a?.(k),k.defaultPrevented||l?.())},p),P=xx(k=>{const S=k.target;[...u.branches].some(A=>A.contains(S))||(i?.(k),a?.(k),k.defaultPrevented||l?.())},p);return fx(k=>{w===u.layers.size-1&&(s?.(k),!k.defaultPrevented&&l&&(k.preventDefault(),l()))},p),f.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(ad=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),ld(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=ad)}},[d,p,n,u]),f.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),ld())},[d,u]),f.useEffect(()=>{const k=()=>m({});return document.addEventListener(ul,k),()=>document.removeEventListener(ul,k)},[]),o.jsx(de.div,{...c,ref:y,style:{pointerEvents:E?T?"auto":"none":void 0,...t.style},onFocusCapture:W(t.onFocusCapture,P.onFocusCapture),onBlurCapture:W(t.onBlurCapture,P.onBlurCapture),onPointerDownCapture:W(t.onPointerDownCapture,j.onPointerDownCapture)})});uo.displayName=mx;var _x="DismissableLayerBranch",Of=f.forwardRef((t,e)=>{const n=f.useContext(If),s=f.useRef(null),r=Ae(e,s);return f.useEffect(()=>{const i=s.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),o.jsx(de.div,{...t,ref:r})});Of.displayName=_x;function yx(t,e=globalThis?.document){const n=vt(t),s=f.useRef(!1),r=f.useRef(()=>{});return f.useEffect(()=>{const i=l=>{if(l.target&&!s.current){let c=function(){Df(gx,n,u,{discrete:!0})};const u={originalEvent:l};l.pointerType==="touch"?(e.removeEventListener("click",r.current),r.current=c,e.addEventListener("click",r.current,{once:!0})):c()}else e.removeEventListener("click",r.current);s.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",i),e.removeEventListener("click",r.current)}},[e,n]),{onPointerDownCapture:()=>s.current=!0}}function xx(t,e=globalThis?.document){const n=vt(t),s=f.useRef(!1);return f.useEffect(()=>{const r=i=>{i.target&&!s.current&&Df(vx,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",r),()=>e.removeEventListener("focusin",r)},[e,n]),{onFocusCapture:()=>s.current=!0,onBlurCapture:()=>s.current=!1}}function ld(){const t=new CustomEvent(ul);document.dispatchEvent(t)}function Df(t,e,n,{discrete:s}){const r=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),s?jc(r,i):r.dispatchEvent(i)}var bx=uo,wx=Of,ln=globalThis?.document?f.useLayoutEffect:()=>{},Ex="Portal",ho=f.forwardRef((t,e)=>{const{container:n,...s}=t,[r,i]=f.useState(!1);ln(()=>i(!0),[]);const a=n||r&&globalThis?.document?.body;return a?Pf.createPortal(o.jsx(de.div,{...s,ref:e}),a):null});ho.displayName=Ex;function jx(t,e){return f.useReducer((n,s)=>e[n][s]??n,t)}var Ut=t=>{const{present:e,children:n}=t,s=Tx(e),r=typeof n=="function"?n({present:s.isPresent}):f.Children.only(n),i=Ae(s.ref,Px(r));return typeof n=="function"||s.isPresent?f.cloneElement(r,{ref:i}):null};Ut.displayName="Presence";function Tx(t){const[e,n]=f.useState(),s=f.useRef({}),r=f.useRef(t),i=f.useRef("none"),a=t?"mounted":"unmounted",[l,c]=jx(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return f.useEffect(()=>{const u=So(s.current);i.current=l==="mounted"?u:"none"},[l]),ln(()=>{const u=s.current,d=r.current;if(d!==t){const p=i.current,m=So(u);t?c("MOUNT"):m==="none"||u?.display==="none"?c("UNMOUNT"):c(d&&p!==m?"ANIMATION_OUT":"UNMOUNT"),r.current=t}},[t,c]),ln(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=m=>{const _=So(s.current).includes(m.animationName);if(m.target===e&&_&&(c("ANIMATION_END"),!r.current)){const x=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=x)})}},p=m=>{m.target===e&&(i.current=So(s.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else c("ANIMATION_END")},[e,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:f.useCallback(u=>{u&&(s.current=getComputedStyle(u)),n(u)},[])}}function So(t){return t?.animationName||"none"}function Px(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function po({prop:t,defaultProp:e,onChange:n=()=>{}}){const[s,r]=kx({defaultProp:e,onChange:n}),i=t!==void 0,a=i?t:s,l=vt(n),c=f.useCallback(u=>{if(i){const h=typeof u=="function"?u(t):u;h!==t&&l(h)}else r(u)},[i,t,r,l]);return[a,c]}function kx({defaultProp:t,onChange:e}){const n=f.useState(t),[s]=n,r=f.useRef(s),i=vt(e);return f.useEffect(()=>{r.current!==s&&(i(s),r.current=s)},[s,r,i]),n}var Sx="VisuallyHidden",$i=f.forwardRef((t,e)=>o.jsx(de.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));$i.displayName=Sx;var Rx=$i,Tc="ToastProvider",[Pc,Ax,Cx]=Ec("Toast"),[Lf,xL]=Xs("Toast",[Cx]),[Ix,Bi]=Lf(Tc),Mf=t=>{const{__scopeToast:e,label:n="Notification",duration:s=5e3,swipeDirection:r="right",swipeThreshold:i=50,children:a}=t,[l,c]=f.useState(null),[u,d]=f.useState(0),h=f.useRef(!1),p=f.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Tc}\`. Expected non-empty \`string\`.`),o.jsx(Pc.Provider,{scope:e,children:o.jsx(Ix,{scope:e,label:n,duration:s,swipeDirection:r,swipeThreshold:i,toastCount:u,viewport:l,onViewportChange:c,onToastAdd:f.useCallback(()=>d(m=>m+1),[]),onToastRemove:f.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:p,children:a})})};Mf.displayName=Tc;var Nf="ToastViewport",Ox=["F8"],dl="toast.viewportPause",hl="toast.viewportResume",Vf=f.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:s=Ox,label:r="Notifications ({hotkey})",...i}=t,a=Bi(Nf,n),l=Ax(n),c=f.useRef(null),u=f.useRef(null),d=f.useRef(null),h=f.useRef(null),p=Ae(e,h,a.onViewportChange),m=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=a.toastCount>0;f.useEffect(()=>{const x=b=>{s.length!==0&&s.every(E=>b[E]||b.code===E)&&h.current?.focus()};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[s]),f.useEffect(()=>{const x=c.current,b=h.current;if(y&&x&&b){const w=()=>{if(!a.isClosePausedRef.current){const P=new CustomEvent(dl);b.dispatchEvent(P),a.isClosePausedRef.current=!0}},E=()=>{if(a.isClosePausedRef.current){const P=new CustomEvent(hl);b.dispatchEvent(P),a.isClosePausedRef.current=!1}},T=P=>{!x.contains(P.relatedTarget)&&E()},j=()=>{x.contains(document.activeElement)||E()};return x.addEventListener("focusin",w),x.addEventListener("focusout",T),x.addEventListener("pointermove",w),x.addEventListener("pointerleave",j),window.addEventListener("blur",w),window.addEventListener("focus",E),()=>{x.removeEventListener("focusin",w),x.removeEventListener("focusout",T),x.removeEventListener("pointermove",w),x.removeEventListener("pointerleave",j),window.removeEventListener("blur",w),window.removeEventListener("focus",E)}}},[y,a.isClosePausedRef]);const _=f.useCallback(({tabbingDirection:x})=>{const w=l().map(E=>{const T=E.ref.current,j=[T,...Gx(T)];return x==="forwards"?j:j.reverse()});return(x==="forwards"?w.reverse():w).flat()},[l]);return f.useEffect(()=>{const x=h.current;if(x){const b=w=>{const E=w.altKey||w.ctrlKey||w.metaKey;if(w.key==="Tab"&&!E){const j=document.activeElement,P=w.shiftKey;if(w.target===x&&P){u.current?.focus();return}const D=_({tabbingDirection:P?"backwards":"forwards"}),A=D.findIndex(B=>B===j);ma(D.slice(A+1))?w.preventDefault():P?u.current?.focus():d.current?.focus()}};return x.addEventListener("keydown",b),()=>x.removeEventListener("keydown",b)}},[l,_]),o.jsxs(wx,{ref:c,role:"region","aria-label":r.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&o.jsx(pl,{ref:u,onFocusFromOutsideViewport:()=>{const x=_({tabbingDirection:"forwards"});ma(x)}}),o.jsx(Pc.Slot,{scope:n,children:o.jsx(de.ol,{tabIndex:-1,...i,ref:p})}),y&&o.jsx(pl,{ref:d,onFocusFromOutsideViewport:()=>{const x=_({tabbingDirection:"backwards"});ma(x)}})]})});Vf.displayName=Nf;var Ff="ToastFocusProxy",pl=f.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:s,...r}=t,i=Bi(Ff,n);return o.jsx($i,{"aria-hidden":!0,tabIndex:0,...r,ref:e,style:{position:"fixed"},onFocus:a=>{const l=a.relatedTarget;!i.viewport?.contains(l)&&s()}})});pl.displayName=Ff;var zi="Toast",Dx="toast.swipeStart",Lx="toast.swipeMove",Mx="toast.swipeCancel",Nx="toast.swipeEnd",$f=f.forwardRef((t,e)=>{const{forceMount:n,open:s,defaultOpen:r,onOpenChange:i,...a}=t,[l=!0,c]=po({prop:s,defaultProp:r,onChange:i});return o.jsx(Ut,{present:n||l,children:o.jsx($x,{open:l,...a,ref:e,onClose:()=>c(!1),onPause:vt(t.onPause),onResume:vt(t.onResume),onSwipeStart:W(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:W(t.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:W(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:W(t.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),c(!1)})})})});$f.displayName=zi;var[Vx,Fx]=Lf(zi,{onClose(){}}),$x=f.forwardRef((t,e)=>{const{__scopeToast:n,type:s="foreground",duration:r,open:i,onClose:a,onEscapeKeyDown:l,onPause:c,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:p,onSwipeEnd:m,...y}=t,_=Bi(zi,n),[x,b]=f.useState(null),w=Ae(e,O=>b(O)),E=f.useRef(null),T=f.useRef(null),j=r||_.duration,P=f.useRef(0),k=f.useRef(j),S=f.useRef(0),{onToastAdd:D,onToastRemove:A}=_,B=vt(()=>{x?.contains(document.activeElement)&&_.viewport?.focus(),a()}),M=f.useCallback(O=>{!O||O===1/0||(window.clearTimeout(S.current),P.current=new Date().getTime(),S.current=window.setTimeout(B,O))},[B]);f.useEffect(()=>{const O=_.viewport;if(O){const q=()=>{M(k.current),u?.()},z=()=>{const U=new Date().getTime()-P.current;k.current=k.current-U,window.clearTimeout(S.current),c?.()};return O.addEventListener(dl,z),O.addEventListener(hl,q),()=>{O.removeEventListener(dl,z),O.removeEventListener(hl,q)}}},[_.viewport,j,c,u,M]),f.useEffect(()=>{i&&!_.isClosePausedRef.current&&M(j)},[i,j,_.isClosePausedRef,M]),f.useEffect(()=>(D(),()=>A()),[D,A]);const K=f.useMemo(()=>x?Kf(x):null,[x]);return _.viewport?o.jsxs(o.Fragment,{children:[K&&o.jsx(Bx,{__scopeToast:n,role:"status","aria-live":s==="foreground"?"assertive":"polite","aria-atomic":!0,children:K}),o.jsx(Vx,{scope:n,onClose:B,children:Vi.createPortal(o.jsx(Pc.ItemSlot,{scope:n,children:o.jsx(bx,{asChild:!0,onEscapeKeyDown:W(l,()=>{_.isFocusedToastEscapeKeyDownRef.current||B(),_.isFocusedToastEscapeKeyDownRef.current=!1}),children:o.jsx(de.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":_.swipeDirection,...y,ref:w,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:W(t.onKeyDown,O=>{O.key==="Escape"&&(l?.(O.nativeEvent),O.nativeEvent.defaultPrevented||(_.isFocusedToastEscapeKeyDownRef.current=!0,B()))}),onPointerDown:W(t.onPointerDown,O=>{O.button===0&&(E.current={x:O.clientX,y:O.clientY})}),onPointerMove:W(t.onPointerMove,O=>{if(!E.current)return;const q=O.clientX-E.current.x,z=O.clientY-E.current.y,U=!!T.current,C=["left","right"].includes(_.swipeDirection),I=["left","up"].includes(_.swipeDirection)?Math.min:Math.max,ee=C?I(0,q):0,H=C?0:I(0,z),Y=O.pointerType==="touch"?10:2,Z={x:ee,y:H},oe={originalEvent:O,delta:Z};U?(T.current=Z,Ro(Lx,h,oe,{discrete:!1})):cd(Z,_.swipeDirection,Y)?(T.current=Z,Ro(Dx,d,oe,{discrete:!1}),O.target.setPointerCapture(O.pointerId)):(Math.abs(q)>Y||Math.abs(z)>Y)&&(E.current=null)}),onPointerUp:W(t.onPointerUp,O=>{const q=T.current,z=O.target;if(z.hasPointerCapture(O.pointerId)&&z.releasePointerCapture(O.pointerId),T.current=null,E.current=null,q){const U=O.currentTarget,C={originalEvent:O,delta:q};cd(q,_.swipeDirection,_.swipeThreshold)?Ro(Nx,m,C,{discrete:!0}):Ro(Mx,p,C,{discrete:!0}),U.addEventListener("click",I=>I.preventDefault(),{once:!0})}})})})}),_.viewport)})]}):null}),Bx=t=>{const{__scopeToast:e,children:n,...s}=t,r=Bi(zi,e),[i,a]=f.useState(!1),[l,c]=f.useState(!1);return Hx(()=>a(!0)),f.useEffect(()=>{const u=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(u)},[]),l?null:o.jsx(ho,{asChild:!0,children:o.jsx($i,{...s,children:i&&o.jsxs(o.Fragment,{children:[r.label," ",n]})})})},zx="ToastTitle",Bf=f.forwardRef((t,e)=>{const{__scopeToast:n,...s}=t;return o.jsx(de.div,{...s,ref:e})});Bf.displayName=zx;var Ux="ToastDescription",zf=f.forwardRef((t,e)=>{const{__scopeToast:n,...s}=t;return o.jsx(de.div,{...s,ref:e})});zf.displayName=Ux;var Uf="ToastAction",Hf=f.forwardRef((t,e)=>{const{altText:n,...s}=t;return n.trim()?o.jsx(Gf,{altText:n,asChild:!0,children:o.jsx(kc,{...s,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${Uf}\`. Expected non-empty \`string\`.`),null)});Hf.displayName=Uf;var Wf="ToastClose",kc=f.forwardRef((t,e)=>{const{__scopeToast:n,...s}=t,r=Fx(Wf,n);return o.jsx(Gf,{asChild:!0,children:o.jsx(de.button,{type:"button",...s,ref:e,onClick:W(t.onClick,r.onClose)})})});kc.displayName=Wf;var Gf=f.forwardRef((t,e)=>{const{__scopeToast:n,altText:s,...r}=t;return o.jsx(de.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":s||void 0,...r,ref:e})});function Kf(t){const e=[];return Array.from(t.childNodes).forEach(s=>{if(s.nodeType===s.TEXT_NODE&&s.textContent&&e.push(s.textContent),Wx(s)){const r=s.ariaHidden||s.hidden||s.style.display==="none",i=s.dataset.radixToastAnnounceExclude==="";if(!r)if(i){const a=s.dataset.radixToastAnnounceAlt;a&&e.push(a)}else e.push(...Kf(s))}}),e}function Ro(t,e,n,{discrete:s}){const r=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&r.addEventListener(t,e,{once:!0}),s?jc(r,i):r.dispatchEvent(i)}var cd=(t,e,n=0)=>{const s=Math.abs(t.x),r=Math.abs(t.y),i=s>r;return e==="left"||e==="right"?i&&s>n:!i&&r>n};function Hx(t=()=>{}){const e=vt(t);ln(()=>{let n=0,s=0;return n=window.requestAnimationFrame(()=>s=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(s)}},[e])}function Wx(t){return t.nodeType===t.ELEMENT_NODE}function Gx(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function ma(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var Kx=Mf,qf=Vf,Yf=$f,Xf=Bf,Zf=zf,Jf=Hf,Qf=kc;function em(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var r=t.length;for(e=0;e<r;e++)t[e]&&(n=em(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function Sc(){for(var t,e,n=0,s="",r=arguments.length;n<r;n++)(t=arguments[n])&&(e=em(t))&&(s&&(s+=" "),s+=e);return s}const ud=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,dd=Sc,Ui=(t,e)=>n=>{var s;if(e?.variants==null)return dd(t,n?.class,n?.className);const{variants:r,defaultVariants:i}=e,a=Object.keys(r).map(u=>{const d=n?.[u],h=i?.[u];if(d===null)return null;const p=ud(d)||ud(h);return r[u][p]}),l=n&&Object.entries(n).reduce((u,d)=>{let[h,p]=d;return p===void 0||(u[h]=p),u},{}),c=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((u,d)=>{let{class:h,className:p,...m}=d;return Object.entries(m).every(y=>{let[_,x]=y;return Array.isArray(x)?x.includes({...i,...l}[_]):{...i,...l}[_]===x})?[...u,h,p]:u},[]);return dd(t,a,c,n?.class,n?.className)};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qx=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Yx=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase()),hd=t=>{const e=Yx(t);return e.charAt(0).toUpperCase()+e.slice(1)},tm=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim(),Xx=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var Zx={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Jx=f.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:r="",children:i,iconNode:a,...l},c)=>f.createElement("svg",{ref:c,...Zx,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:tm("lucide",r),...!i&&!Xx(l)&&{"aria-hidden":"true"},...l},[...a.map(([u,d])=>f.createElement(u,d)),...Array.isArray(i)?i:[i]]));/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const he=(t,e)=>{const n=f.forwardRef(({className:s,...r},i)=>f.createElement(Jx,{ref:i,iconNode:e,className:tm(`lucide-${qx(hd(t))}`,`lucide-${t}`,s),...r}));return n.displayName=hd(t),n};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Qx=[["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M19.38 6.813A9 9 0 0 1 20.8 10.2a2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"11xh7x"}],["path",{d:"M9 12h.01",key:"157uk2"}]],eb=he("baby",Qx);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tb=[["path",{d:"M10 22V7a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-5a1 1 0 0 0-1-1H2",key:"1ah6g2"}],["rect",{x:"14",y:"2",width:"8",height:"8",rx:"1",key:"88lufb"}]],nb=he("blocks",tb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sb=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],rb=he("book-open",sb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ob=[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],pd=he("camera",ob);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ib=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],ab=he("check",ib);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lb=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],cb=he("chevron-right",lb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ub=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],db=he("circle",ub);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hb=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],ar=he("crown",hb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const pb=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m9 15 2 2 4-4",key:"1grp1n"}]],fb=he("file-check",pb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mb=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],gb=he("gauge",mb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vb=[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]],nm=he("heart",vb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _b=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],yb=he("house",_b);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const xb=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],bb=he("info",xb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wb=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],fd=he("key-round",wb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Eb=[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]],jb=he("library-big",Eb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Tb=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],Pb=he("lightbulb",Tb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kb=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],md=he("loader-circle",kb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Sb=[["path",{d:"m10 17 5-5-5-5",key:"1bsop3"}],["path",{d:"M15 12H3",key:"6jk70r"}],["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}]],sm=he("log-in",Sb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Rb=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],gd=he("log-out",Rb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ab=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Cb=he("menu",Ab);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Ib=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],Ob=he("message-circle-question-mark",Ib);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Db=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],Lb=he("notebook-pen",Db);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Mb=[["path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z",key:"e79jfc"}],["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}]],Nb=he("palette",Mb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Vb=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Fb=he("smartphone",Vb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $b=[["path",{d:"m6 16 6-12 6 12",key:"1b4byz"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"m16 20 2 2 4-4",key:"13tcca"}]],Bb=he("spell-check",$b);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zb=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],Ub=he("trophy",zb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Hb=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],vd=he("upload",Hb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Wb=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],Gb=he("user",Wb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const Kb=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],rm=he("wand-sparkles",Kb);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const qb=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],om=he("x",qb),Rc="-",Yb=t=>{const e=Zb(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:a=>{const l=a.split(Rc);return l[0]===""&&l.length!==1&&l.shift(),im(l,e)||Xb(a)},getConflictingClassGroupIds:(a,l)=>{const c=n[a]||[];return l&&s[a]?[...c,...s[a]]:c}}},im=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],s=e.nextPart.get(n),r=s?im(t.slice(1),s):void 0;if(r)return r;if(e.validators.length===0)return;const i=t.join(Rc);return e.validators.find(({validator:a})=>a(i))?.classGroupId},_d=/^\[(.+)\]$/,Xb=t=>{if(_d.test(t)){const e=_d.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Zb=t=>{const{theme:e,prefix:n}=t,s={nextPart:new Map,validators:[]};return Qb(Object.entries(t.classGroups),n).forEach(([i,a])=>{fl(a,s,i,e)}),s},fl=(t,e,n,s)=>{t.forEach(r=>{if(typeof r=="string"){const i=r===""?e:yd(e,r);i.classGroupId=n;return}if(typeof r=="function"){if(Jb(r)){fl(r(s),e,n,s);return}e.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,a])=>{fl(a,yd(e,i),n,s)})})},yd=(t,e)=>{let n=t;return e.split(Rc).forEach(s=>{n.nextPart.has(s)||n.nextPart.set(s,{nextPart:new Map,validators:[]}),n=n.nextPart.get(s)}),n},Jb=t=>t.isThemeGetter,Qb=(t,e)=>e?t.map(([n,s])=>{const r=s.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,l])=>[e+a,l])):i);return[n,r]}):t,ew=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,s=new Map;const r=(i,a)=>{n.set(i,a),e++,e>t&&(e=0,s=n,n=new Map)};return{get(i){let a=n.get(i);if(a!==void 0)return a;if((a=s.get(i))!==void 0)return r(i,a),a},set(i,a){n.has(i)?n.set(i,a):r(i,a)}}},am="!",tw=t=>{const{separator:e,experimentalParseClassName:n}=t,s=e.length===1,r=e[0],i=e.length,a=l=>{const c=[];let u=0,d=0,h;for(let x=0;x<l.length;x++){let b=l[x];if(u===0){if(b===r&&(s||l.slice(x,x+i)===e)){c.push(l.slice(d,x)),d=x+i;continue}if(b==="/"){h=x;continue}}b==="["?u++:b==="]"&&u--}const p=c.length===0?l:l.substring(d),m=p.startsWith(am),y=m?p.substring(1):p,_=h&&h>d?h-d:void 0;return{modifiers:c,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:_}};return n?l=>n({className:l,parseClassName:a}):a},nw=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(s=>{s[0]==="["?(e.push(...n.sort(),s),n=[]):n.push(s)}),e.push(...n.sort()),e},sw=t=>({cache:ew(t.cacheSize),parseClassName:tw(t),...Yb(t)}),rw=/\s+/,ow=(t,e)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:r}=e,i=[],a=t.trim().split(rw);let l="";for(let c=a.length-1;c>=0;c-=1){const u=a[c],{modifiers:d,hasImportantModifier:h,baseClassName:p,maybePostfixModifierPosition:m}=n(u);let y=!!m,_=s(y?p.substring(0,m):p);if(!_){if(!y){l=u+(l.length>0?" "+l:l);continue}if(_=s(p),!_){l=u+(l.length>0?" "+l:l);continue}y=!1}const x=nw(d).join(":"),b=h?x+am:x,w=b+_;if(i.includes(w))continue;i.push(w);const E=r(_,y);for(let T=0;T<E.length;++T){const j=E[T];i.push(b+j)}l=u+(l.length>0?" "+l:l)}return l};function iw(){let t=0,e,n,s="";for(;t<arguments.length;)(e=arguments[t++])&&(n=lm(e))&&(s&&(s+=" "),s+=n);return s}const lm=t=>{if(typeof t=="string")return t;let e,n="";for(let s=0;s<t.length;s++)t[s]&&(e=lm(t[s]))&&(n&&(n+=" "),n+=e);return n};function aw(t,...e){let n,s,r,i=a;function a(c){const u=e.reduce((d,h)=>h(d),t());return n=sw(u),s=n.cache.get,r=n.cache.set,i=l,l(c)}function l(c){const u=s(c);if(u)return u;const d=ow(c,n);return r(c,d),d}return function(){return i(iw.apply(null,arguments))}}const xe=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},cm=/^\[(?:([a-z-]+):)?(.+)\]$/i,lw=/^\d+\/\d+$/,cw=new Set(["px","full","screen"]),uw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,dw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,hw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,pw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,fw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mn=t=>Os(t)||cw.has(t)||lw.test(t),Rn=t=>Zs(t,"length",ww),Os=t=>!!t&&!Number.isNaN(Number(t)),ga=t=>Zs(t,"number",Os),lr=t=>!!t&&Number.isInteger(Number(t)),mw=t=>t.endsWith("%")&&Os(t.slice(0,-1)),Q=t=>cm.test(t),An=t=>uw.test(t),gw=new Set(["length","size","percentage"]),vw=t=>Zs(t,gw,um),_w=t=>Zs(t,"position",um),yw=new Set(["image","url"]),xw=t=>Zs(t,yw,jw),bw=t=>Zs(t,"",Ew),cr=()=>!0,Zs=(t,e,n)=>{const s=cm.exec(t);return s?s[1]?typeof e=="string"?s[1]===e:e.has(s[1]):n(s[2]):!1},ww=t=>dw.test(t)&&!hw.test(t),um=()=>!1,Ew=t=>pw.test(t),jw=t=>fw.test(t),Tw=()=>{const t=xe("colors"),e=xe("spacing"),n=xe("blur"),s=xe("brightness"),r=xe("borderColor"),i=xe("borderRadius"),a=xe("borderSpacing"),l=xe("borderWidth"),c=xe("contrast"),u=xe("grayscale"),d=xe("hueRotate"),h=xe("invert"),p=xe("gap"),m=xe("gradientColorStops"),y=xe("gradientColorStopPositions"),_=xe("inset"),x=xe("margin"),b=xe("opacity"),w=xe("padding"),E=xe("saturate"),T=xe("scale"),j=xe("sepia"),P=xe("skew"),k=xe("space"),S=xe("translate"),D=()=>["auto","contain","none"],A=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",Q,e],M=()=>[Q,e],K=()=>["",mn,Rn],O=()=>["auto",Os,Q],q=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],z=()=>["solid","dashed","dotted","double","none"],U=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],C=()=>["start","end","center","between","around","evenly","stretch"],I=()=>["","0",Q],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Os,Q];return{cacheSize:500,separator:":",theme:{colors:[cr],spacing:[mn,Rn],blur:["none","",An,Q],brightness:H(),borderColor:[t],borderRadius:["none","","full",An,Q],borderSpacing:M(),borderWidth:K(),contrast:H(),grayscale:I(),hueRotate:H(),invert:I(),gap:M(),gradientColorStops:[t],gradientColorStopPositions:[mw,Rn],inset:B(),margin:B(),opacity:H(),padding:M(),saturate:H(),scale:H(),sepia:I(),skew:H(),space:M(),translate:M()},classGroups:{aspect:[{aspect:["auto","square","video",Q]}],container:["container"],columns:[{columns:[An]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...q(),Q]}],overflow:[{overflow:A()}],"overflow-x":[{"overflow-x":A()}],"overflow-y":[{"overflow-y":A()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[_]}],"inset-x":[{"inset-x":[_]}],"inset-y":[{"inset-y":[_]}],start:[{start:[_]}],end:[{end:[_]}],top:[{top:[_]}],right:[{right:[_]}],bottom:[{bottom:[_]}],left:[{left:[_]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",lr,Q]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Q]}],grow:[{grow:I()}],shrink:[{shrink:I()}],order:[{order:["first","last","none",lr,Q]}],"grid-cols":[{"grid-cols":[cr]}],"col-start-end":[{col:["auto",{span:["full",lr,Q]},Q]}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":[cr]}],"row-start-end":[{row:["auto",{span:[lr,Q]},Q]}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Q]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Q]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...C()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...C(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...C(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[x]}],mx:[{mx:[x]}],my:[{my:[x]}],ms:[{ms:[x]}],me:[{me:[x]}],mt:[{mt:[x]}],mr:[{mr:[x]}],mb:[{mb:[x]}],ml:[{ml:[x]}],"space-x":[{"space-x":[k]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[k]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Q,e]}],"min-w":[{"min-w":[Q,e,"min","max","fit"]}],"max-w":[{"max-w":[Q,e,"none","full","min","max","fit","prose",{screen:[An]},An]}],h:[{h:[Q,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Q,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Q,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Q,e,"auto","min","max","fit"]}],"font-size":[{text:["base",An,Rn]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ga]}],"font-family":[{font:[cr]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Q]}],"line-clamp":[{"line-clamp":["none",Os,ga]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",mn,Q]}],"list-image":[{"list-image":["none",Q]}],"list-style-type":[{list:["none","disc","decimal",Q]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[b]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[b]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...z(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",mn,Rn]}],"underline-offset":[{"underline-offset":["auto",mn,Q]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Q]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Q]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[b]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...q(),_w]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",vw]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},xw]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[b]}],"border-style":[{border:[...z(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[b]}],"divide-style":[{divide:z()}],"border-color":[{border:[r]}],"border-color-x":[{"border-x":[r]}],"border-color-y":[{"border-y":[r]}],"border-color-s":[{"border-s":[r]}],"border-color-e":[{"border-e":[r]}],"border-color-t":[{"border-t":[r]}],"border-color-r":[{"border-r":[r]}],"border-color-b":[{"border-b":[r]}],"border-color-l":[{"border-l":[r]}],"divide-color":[{divide:[r]}],"outline-style":[{outline:["",...z()]}],"outline-offset":[{"outline-offset":[mn,Q]}],"outline-w":[{outline:[mn,Rn]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:K()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[b]}],"ring-offset-w":[{"ring-offset":[mn,Rn]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",An,bw]}],"shadow-color":[{shadow:[cr]}],opacity:[{opacity:[b]}],"mix-blend":[{"mix-blend":[...U(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":U()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[s]}],contrast:[{contrast:[c]}],"drop-shadow":[{"drop-shadow":["","none",An,Q]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[E]}],sepia:[{sepia:[j]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[s]}],"backdrop-contrast":[{"backdrop-contrast":[c]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[b]}],"backdrop-saturate":[{"backdrop-saturate":[E]}],"backdrop-sepia":[{"backdrop-sepia":[j]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Q]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Q]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Q]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[T]}],"scale-x":[{"scale-x":[T]}],"scale-y":[{"scale-y":[T]}],rotate:[{rotate:[lr,Q]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[P]}],"skew-y":[{"skew-y":[P]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Q]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Q]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Q]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[mn,Rn,ga]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},Pw=aw(Tw);function ve(...t){return Pw(Sc(t))}const kw=Kx,dm=f.forwardRef(({className:t,...e},n)=>o.jsx(qf,{ref:n,className:ve("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));dm.displayName=qf.displayName;const Sw=Ui("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),hm=f.forwardRef(({className:t,variant:e,...n},s)=>o.jsx(Yf,{ref:s,className:ve(Sw({variant:e}),t),...n}));hm.displayName=Yf.displayName;const Rw=f.forwardRef(({className:t,...e},n)=>o.jsx(Jf,{ref:n,className:ve("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));Rw.displayName=Jf.displayName;const pm=f.forwardRef(({className:t,...e},n)=>o.jsx(Qf,{ref:n,className:ve("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:o.jsx(om,{className:"h-4 w-4"})}));pm.displayName=Qf.displayName;const fm=f.forwardRef(({className:t,...e},n)=>o.jsx(Xf,{ref:n,className:ve("text-sm font-semibold",t),...e}));fm.displayName=Xf.displayName;const mm=f.forwardRef(({className:t,...e},n)=>o.jsx(Zf,{ref:n,className:ve("text-sm opacity-90",t),...e}));mm.displayName=Zf.displayName;function Aw(){const{toasts:t}=Af();return o.jsxs(kw,{children:[t.map(function({id:e,title:n,description:s,action:r,...i}){return o.jsxs(hm,{...i,children:[o.jsxs("div",{className:"grid gap-1",children:[n&&o.jsx(fm,{children:n}),s&&o.jsx(mm,{children:s})]}),r,o.jsx(pm,{})]},e)}),o.jsx(dm,{})]})}var xd=["light","dark"],Cw="(prefers-color-scheme: dark)",Iw=f.createContext(void 0),Ow={setTheme:t=>{},themes:[]},Dw=()=>{var t;return(t=f.useContext(Iw))!=null?t:Ow};f.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:s,enableColorScheme:r,defaultTheme:i,value:a,attrs:l,nonce:c})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${l.map(y=>`'${y}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=r?xd.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",p=(y,_=!1,x=!0)=>{let b=a?a[y]:y,w=_?y+"|| ''":`'${b}'`,E="";return r&&x&&!_&&xd.includes(y)&&(E+=`d.style.colorScheme = '${y}';`),n==="class"?_||b?E+=`c.add(${w})`:E+="null":b&&(E+=`d[s](n,${w})`),E},m=t?`!function(){${d}${p(t)}}()`:s?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${Cw}',m=window.matchMedia(t);if(m.media!==t||m.matches){${p("dark")}}else{${p("light")}}}else if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}${u?"":"else{"+p(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${a?`var x=${JSON.stringify(a)};`:""}${p(a?"x[e]":"e",!0)}}else{${p(i,!1,!1)};}${h}}catch(t){}}();`;return f.createElement("script",{nonce:c,dangerouslySetInnerHTML:{__html:m}})});var Lw=t=>{switch(t){case"success":return Vw;case"info":return $w;case"warning":return Fw;case"error":return Bw;default:return null}},Mw=Array(12).fill(0),Nw=({visible:t})=>L.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},L.createElement("div",{className:"sonner-spinner"},Mw.map((e,n)=>L.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),Vw=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),Fw=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),$w=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),Bw=L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},L.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),zw=()=>{let[t,e]=L.useState(document.hidden);return L.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},ml=1,Uw=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:s,...r}=e,i=typeof e?.id=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:ml++,a=this.toasts.find(c=>c.id===i),l=e.dismissible===void 0?!0:e.dismissible;return a?this.toasts=this.toasts.map(c=>c.id===i?(this.publish({...c,...e,id:i,title:s}),{...c,...e,id:i,dismissible:l,title:s}):c):this.addToast({title:s,...r,dismissible:l,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(s=>s({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let s;n.loading!==void 0&&(s=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let r=e instanceof Promise?e:e(),i=s!==void 0;return r.then(async a=>{if(Ww(a)&&!a.ok){i=!1;let l=typeof n.error=="function"?await n.error(`HTTP error! status: ${a.status}`):n.error,c=typeof n.description=="function"?await n.description(`HTTP error! status: ${a.status}`):n.description;this.create({id:s,type:"error",message:l,description:c})}else if(n.success!==void 0){i=!1;let l=typeof n.success=="function"?await n.success(a):n.success,c=typeof n.description=="function"?await n.description(a):n.description;this.create({id:s,type:"success",message:l,description:c})}}).catch(async a=>{if(n.error!==void 0){i=!1;let l=typeof n.error=="function"?await n.error(a):n.error,c=typeof n.description=="function"?await n.description(a):n.description;this.create({id:s,type:"error",message:l,description:c})}}).finally(()=>{var a;i&&(this.dismiss(s),s=void 0),(a=n.finally)==null||a.call(n)}),s},this.custom=(e,n)=>{let s=n?.id||ml++;return this.create({jsx:e(s),id:s,...n}),s},this.subscribers=[],this.toasts=[]}},Pt=new Uw,Hw=(t,e)=>{let n=e?.id||ml++;return Pt.addToast({title:t,...e,id:n}),n},Ww=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Gw=Hw,Kw=()=>Pt.toasts,Qt=Object.assign(Gw,{success:Pt.success,info:Pt.info,warning:Pt.warning,error:Pt.error,custom:Pt.custom,message:Pt.message,promise:Pt.promise,dismiss:Pt.dismiss,loading:Pt.loading},{getHistory:Kw});function qw(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],s=document.createElement("style");s.type="text/css",e==="top"&&n.firstChild?n.insertBefore(s,n.firstChild):n.appendChild(s),s.styleSheet?s.styleSheet.cssText=t:s.appendChild(document.createTextNode(t))}qw(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
`);function Ao(t){return t.label!==void 0}var Yw=3,Xw="32px",Zw=4e3,Jw=356,Qw=14,e1=20,t1=200;function n1(...t){return t.filter(Boolean).join(" ")}var s1=t=>{var e,n,s,r,i,a,l,c,u,d;let{invert:h,toast:p,unstyled:m,interacting:y,setHeights:_,visibleToasts:x,heights:b,index:w,toasts:E,expanded:T,removeToast:j,defaultRichColors:P,closeButton:k,style:S,cancelButtonStyle:D,actionButtonStyle:A,className:B="",descriptionClassName:M="",duration:K,position:O,gap:q,loadingIcon:z,expandByDefault:U,classNames:C,icons:I,closeButtonAriaLabel:ee="Close toast",pauseWhenPageIsHidden:H,cn:Y}=t,[Z,oe]=L.useState(!1),[De,ne]=L.useState(!1),[_e,jt]=L.useState(!1),[pn,Be]=L.useState(!1),[sr,kn]=L.useState(0),[Gt,rr]=L.useState(0),or=L.useRef(null),fn=L.useRef(null),ir=w===0,Ny=w+1<=x,At=p.type,ps=p.dismissible!==!1,Vy=p.className||"",Fy=p.descriptionClassName||"",Po=L.useMemo(()=>b.findIndex(J=>J.toastId===p.id)||0,[b,p.id]),$y=L.useMemo(()=>{var J;return(J=p.closeButton)!=null?J:k},[p.closeButton,k]),ed=L.useMemo(()=>p.duration||K||Zw,[p.duration,K]),da=L.useRef(0),fs=L.useRef(0),td=L.useRef(0),ms=L.useRef(null),[nd,By]=O.split("-"),sd=L.useMemo(()=>b.reduce((J,ye,me)=>me>=Po?J:J+ye.height,0),[b,Po]),rd=zw(),zy=p.invert||h,ha=At==="loading";fs.current=L.useMemo(()=>Po*q+sd,[Po,sd]),L.useEffect(()=>{oe(!0)},[]),L.useLayoutEffect(()=>{if(!Z)return;let J=fn.current,ye=J.style.height;J.style.height="auto";let me=J.getBoundingClientRect().height;J.style.height=ye,rr(me),_(Kt=>Kt.find(qt=>qt.toastId===p.id)?Kt.map(qt=>qt.toastId===p.id?{...qt,height:me}:qt):[{toastId:p.id,height:me,position:p.position},...Kt])},[Z,p.title,p.description,_,p.id]);let Sn=L.useCallback(()=>{ne(!0),kn(fs.current),_(J=>J.filter(ye=>ye.toastId!==p.id)),setTimeout(()=>{j(p)},t1)},[p,j,_,fs]);L.useEffect(()=>{if(p.promise&&At==="loading"||p.duration===1/0||p.type==="loading")return;let J,ye=ed;return T||y||H&&rd?(()=>{if(td.current<da.current){let me=new Date().getTime()-da.current;ye=ye-me}td.current=new Date().getTime()})():ye!==1/0&&(da.current=new Date().getTime(),J=setTimeout(()=>{var me;(me=p.onAutoClose)==null||me.call(p,p),Sn()},ye)),()=>clearTimeout(J)},[T,y,U,p,ed,Sn,p.promise,At,H,rd]),L.useEffect(()=>{let J=fn.current;if(J){let ye=J.getBoundingClientRect().height;return rr(ye),_(me=>[{toastId:p.id,height:ye,position:p.position},...me]),()=>_(me=>me.filter(Kt=>Kt.toastId!==p.id))}},[_,p.id]),L.useEffect(()=>{p.delete&&Sn()},[Sn,p.delete]);function Uy(){return I!=null&&I.loading?L.createElement("div",{className:"sonner-loader","data-visible":At==="loading"},I.loading):z?L.createElement("div",{className:"sonner-loader","data-visible":At==="loading"},z):L.createElement(Nw,{visible:At==="loading"})}return L.createElement("li",{"aria-live":p.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:fn,className:Y(B,Vy,C?.toast,(e=p?.classNames)==null?void 0:e.toast,C?.default,C?.[At],(n=p?.classNames)==null?void 0:n[At]),"data-sonner-toast":"","data-rich-colors":(s=p.richColors)!=null?s:P,"data-styled":!(p.jsx||p.unstyled||m),"data-mounted":Z,"data-promise":!!p.promise,"data-removed":De,"data-visible":Ny,"data-y-position":nd,"data-x-position":By,"data-index":w,"data-front":ir,"data-swiping":_e,"data-dismissible":ps,"data-type":At,"data-invert":zy,"data-swipe-out":pn,"data-expanded":!!(T||U&&Z),style:{"--index":w,"--toasts-before":w,"--z-index":E.length-w,"--offset":`${De?sr:fs.current}px`,"--initial-height":U?"auto":`${Gt}px`,...S,...p.style},onPointerDown:J=>{ha||!ps||(or.current=new Date,kn(fs.current),J.target.setPointerCapture(J.pointerId),J.target.tagName!=="BUTTON"&&(jt(!0),ms.current={x:J.clientX,y:J.clientY}))},onPointerUp:()=>{var J,ye,me,Kt;if(pn||!ps)return;ms.current=null;let qt=Number(((J=fn.current)==null?void 0:J.style.getPropertyValue("--swipe-amount").replace("px",""))||0),ko=new Date().getTime()-((ye=or.current)==null?void 0:ye.getTime()),Hy=Math.abs(qt)/ko;if(Math.abs(qt)>=e1||Hy>.11){kn(fs.current),(me=p.onDismiss)==null||me.call(p,p),Sn(),Be(!0);return}(Kt=fn.current)==null||Kt.style.setProperty("--swipe-amount","0px"),jt(!1)},onPointerMove:J=>{var ye;if(!ms.current||!ps)return;let me=J.clientY-ms.current.y,Kt=J.clientX-ms.current.x,qt=(nd==="top"?Math.min:Math.max)(0,me),ko=J.pointerType==="touch"?10:2;Math.abs(qt)>ko?(ye=fn.current)==null||ye.style.setProperty("--swipe-amount",`${me}px`):Math.abs(Kt)>ko&&(ms.current=null)}},$y&&!p.jsx?L.createElement("button",{"aria-label":ee,"data-disabled":ha,"data-close-button":!0,onClick:ha||!ps?()=>{}:()=>{var J;Sn(),(J=p.onDismiss)==null||J.call(p,p)},className:Y(C?.closeButton,(r=p?.classNames)==null?void 0:r.closeButton)},L.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},L.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),L.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,p.jsx||L.isValidElement(p.title)?p.jsx||p.title:L.createElement(L.Fragment,null,At||p.icon||p.promise?L.createElement("div",{"data-icon":"",className:Y(C?.icon,(i=p?.classNames)==null?void 0:i.icon)},p.promise||p.type==="loading"&&!p.icon?p.icon||Uy():null,p.type!=="loading"?p.icon||I?.[At]||Lw(At):null):null,L.createElement("div",{"data-content":"",className:Y(C?.content,(a=p?.classNames)==null?void 0:a.content)},L.createElement("div",{"data-title":"",className:Y(C?.title,(l=p?.classNames)==null?void 0:l.title)},p.title),p.description?L.createElement("div",{"data-description":"",className:Y(M,Fy,C?.description,(c=p?.classNames)==null?void 0:c.description)},p.description):null),L.isValidElement(p.cancel)?p.cancel:p.cancel&&Ao(p.cancel)?L.createElement("button",{"data-button":!0,"data-cancel":!0,style:p.cancelButtonStyle||D,onClick:J=>{var ye,me;Ao(p.cancel)&&ps&&((me=(ye=p.cancel).onClick)==null||me.call(ye,J),Sn())},className:Y(C?.cancelButton,(u=p?.classNames)==null?void 0:u.cancelButton)},p.cancel.label):null,L.isValidElement(p.action)?p.action:p.action&&Ao(p.action)?L.createElement("button",{"data-button":!0,"data-action":!0,style:p.actionButtonStyle||A,onClick:J=>{var ye,me;Ao(p.action)&&(J.defaultPrevented||((me=(ye=p.action).onClick)==null||me.call(ye,J),Sn()))},className:Y(C?.actionButton,(d=p?.classNames)==null?void 0:d.actionButton)},p.action.label):null))};function bd(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var r1=t=>{let{invert:e,position:n="bottom-right",hotkey:s=["altKey","KeyT"],expand:r,closeButton:i,className:a,offset:l,theme:c="light",richColors:u,duration:d,style:h,visibleToasts:p=Yw,toastOptions:m,dir:y=bd(),gap:_=Qw,loadingIcon:x,icons:b,containerAriaLabel:w="Notifications",pauseWhenPageIsHidden:E,cn:T=n1}=t,[j,P]=L.useState([]),k=L.useMemo(()=>Array.from(new Set([n].concat(j.filter(H=>H.position).map(H=>H.position)))),[j,n]),[S,D]=L.useState([]),[A,B]=L.useState(!1),[M,K]=L.useState(!1),[O,q]=L.useState(c!=="system"?c:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),z=L.useRef(null),U=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),C=L.useRef(null),I=L.useRef(!1),ee=L.useCallback(H=>{var Y;(Y=j.find(Z=>Z.id===H.id))!=null&&Y.delete||Pt.dismiss(H.id),P(Z=>Z.filter(({id:oe})=>oe!==H.id))},[j]);return L.useEffect(()=>Pt.subscribe(H=>{if(H.dismiss){P(Y=>Y.map(Z=>Z.id===H.id?{...Z,delete:!0}:Z));return}setTimeout(()=>{Pf.flushSync(()=>{P(Y=>{let Z=Y.findIndex(oe=>oe.id===H.id);return Z!==-1?[...Y.slice(0,Z),{...Y[Z],...H},...Y.slice(Z+1)]:[H,...Y]})})})}),[]),L.useEffect(()=>{if(c!=="system"){q(c);return}c==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?q("dark"):q("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:H})=>{q(H?"dark":"light")})},[c]),L.useEffect(()=>{j.length<=1&&B(!1)},[j]),L.useEffect(()=>{let H=Y=>{var Z,oe;s.every(De=>Y[De]||Y.code===De)&&(B(!0),(Z=z.current)==null||Z.focus()),Y.code==="Escape"&&(document.activeElement===z.current||(oe=z.current)!=null&&oe.contains(document.activeElement))&&B(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[s]),L.useEffect(()=>{if(z.current)return()=>{C.current&&(C.current.focus({preventScroll:!0}),C.current=null,I.current=!1)}},[z.current]),j.length?L.createElement("section",{"aria-label":`${w} ${U}`,tabIndex:-1},k.map((H,Y)=>{var Z;let[oe,De]=H.split("-");return L.createElement("ol",{key:H,dir:y==="auto"?bd():y,tabIndex:-1,ref:z,className:a,"data-sonner-toaster":!0,"data-theme":O,"data-y-position":oe,"data-x-position":De,style:{"--front-toast-height":`${((Z=S[0])==null?void 0:Z.height)||0}px`,"--offset":typeof l=="number"?`${l}px`:l||Xw,"--width":`${Jw}px`,"--gap":`${_}px`,...h},onBlur:ne=>{I.current&&!ne.currentTarget.contains(ne.relatedTarget)&&(I.current=!1,C.current&&(C.current.focus({preventScroll:!0}),C.current=null))},onFocus:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||I.current||(I.current=!0,C.current=ne.relatedTarget)},onMouseEnter:()=>B(!0),onMouseMove:()=>B(!0),onMouseLeave:()=>{M||B(!1)},onPointerDown:ne=>{ne.target instanceof HTMLElement&&ne.target.dataset.dismissible==="false"||K(!0)},onPointerUp:()=>K(!1)},j.filter(ne=>!ne.position&&Y===0||ne.position===H).map((ne,_e)=>{var jt,pn;return L.createElement(s1,{key:ne.id,icons:b,index:_e,toast:ne,defaultRichColors:u,duration:(jt=m?.duration)!=null?jt:d,className:m?.className,descriptionClassName:m?.descriptionClassName,invert:e,visibleToasts:p,closeButton:(pn=m?.closeButton)!=null?pn:i,interacting:M,position:H,style:m?.style,unstyled:m?.unstyled,classNames:m?.classNames,cancelButtonStyle:m?.cancelButtonStyle,actionButtonStyle:m?.actionButtonStyle,removeToast:ee,toasts:j.filter(Be=>Be.position==ne.position),heights:S.filter(Be=>Be.position==ne.position),setHeights:D,expandByDefault:r,gap:_,loadingIcon:x,expanded:A,pauseWhenPageIsHidden:E,cn:T})}))})):null};const o1=({...t})=>{const{theme:e="system"}=Dw();return o.jsx(r1,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var i1=Ky.useId||(()=>{}),a1=0;function ts(t){const[e,n]=f.useState(i1());return ln(()=>{t||n(s=>s??String(a1++))},[t]),t||(e?`radix-${e}`:"")}const l1=["top","right","bottom","left"],Bn=Math.min,kt=Math.max,li=Math.round,Co=Math.floor,zn=t=>({x:t,y:t}),c1={left:"right",right:"left",bottom:"top",top:"bottom"},u1={start:"end",end:"start"};function gl(t,e,n){return kt(t,Bn(e,n))}function jn(t,e){return typeof t=="function"?t(e):t}function Tn(t){return t.split("-")[0]}function Js(t){return t.split("-")[1]}function Ac(t){return t==="x"?"y":"x"}function Cc(t){return t==="y"?"height":"width"}function Un(t){return["top","bottom"].includes(Tn(t))?"y":"x"}function Ic(t){return Ac(Un(t))}function d1(t,e,n){n===void 0&&(n=!1);const s=Js(t),r=Ic(t),i=Cc(r);let a=r==="x"?s===(n?"end":"start")?"right":"left":s==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(a=ci(a)),[a,ci(a)]}function h1(t){const e=ci(t);return[vl(t),e,vl(e)]}function vl(t){return t.replace(/start|end/g,e=>u1[e])}function p1(t,e,n){const s=["left","right"],r=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(t){case"top":case"bottom":return n?e?r:s:e?s:r;case"left":case"right":return e?i:a;default:return[]}}function f1(t,e,n,s){const r=Js(t);let i=p1(Tn(t),n==="start",s);return r&&(i=i.map(a=>a+"-"+r),e&&(i=i.concat(i.map(vl)))),i}function ci(t){return t.replace(/left|right|bottom|top/g,e=>c1[e])}function m1(t){return{top:0,right:0,bottom:0,left:0,...t}}function gm(t){return typeof t!="number"?m1(t):{top:t,right:t,bottom:t,left:t}}function ui(t){const{x:e,y:n,width:s,height:r}=t;return{width:s,height:r,top:n,left:e,right:e+s,bottom:n+r,x:e,y:n}}function wd(t,e,n){let{reference:s,floating:r}=t;const i=Un(e),a=Ic(e),l=Cc(a),c=Tn(e),u=i==="y",d=s.x+s.width/2-r.width/2,h=s.y+s.height/2-r.height/2,p=s[l]/2-r[l]/2;let m;switch(c){case"top":m={x:d,y:s.y-r.height};break;case"bottom":m={x:d,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:h};break;case"left":m={x:s.x-r.width,y:h};break;default:m={x:s.x,y:s.y}}switch(Js(e)){case"start":m[a]-=p*(n&&u?-1:1);break;case"end":m[a]+=p*(n&&u?-1:1);break}return m}const g1=async(t,e,n)=>{const{placement:s="bottom",strategy:r="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(e));let u=await a.getElementRects({reference:t,floating:e,strategy:r}),{x:d,y:h}=wd(u,s,c),p=s,m={},y=0;for(let _=0;_<l.length;_++){const{name:x,fn:b}=l[_],{x:w,y:E,data:T,reset:j}=await b({x:d,y:h,initialPlacement:s,placement:p,strategy:r,middlewareData:m,rects:u,platform:a,elements:{reference:t,floating:e}});d=w??d,h=E??h,m={...m,[x]:{...m[x],...T}},j&&y<=50&&(y++,typeof j=="object"&&(j.placement&&(p=j.placement),j.rects&&(u=j.rects===!0?await a.getElementRects({reference:t,floating:e,strategy:r}):j.rects),{x:d,y:h}=wd(u,p,c)),_=-1)}return{x:d,y:h,placement:p,strategy:r,middlewareData:m}};async function Hr(t,e){var n;e===void 0&&(e={});const{x:s,y:r,platform:i,rects:a,elements:l,strategy:c}=t,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:h="floating",altBoundary:p=!1,padding:m=0}=jn(e,t),y=gm(m),x=l[p?h==="floating"?"reference":"floating":h],b=ui(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=h==="floating"?{x:s,y:r,width:a.floating.width,height:a.floating.height}:a.reference,E=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),T=await(i.isElement==null?void 0:i.isElement(E))?await(i.getScale==null?void 0:i.getScale(E))||{x:1,y:1}:{x:1,y:1},j=ui(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:E,strategy:c}):w);return{top:(b.top-j.top+y.top)/T.y,bottom:(j.bottom-b.bottom+y.bottom)/T.y,left:(b.left-j.left+y.left)/T.x,right:(j.right-b.right+y.right)/T.x}}const v1=t=>({name:"arrow",options:t,async fn(e){const{x:n,y:s,placement:r,rects:i,platform:a,elements:l,middlewareData:c}=e,{element:u,padding:d=0}=jn(t,e)||{};if(u==null)return{};const h=gm(d),p={x:n,y:s},m=Ic(r),y=Cc(m),_=await a.getDimensions(u),x=m==="y",b=x?"top":"left",w=x?"bottom":"right",E=x?"clientHeight":"clientWidth",T=i.reference[y]+i.reference[m]-p[m]-i.floating[y],j=p[m]-i.reference[m],P=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let k=P?P[E]:0;(!k||!await(a.isElement==null?void 0:a.isElement(P)))&&(k=l.floating[E]||i.floating[y]);const S=T/2-j/2,D=k/2-_[y]/2-1,A=Bn(h[b],D),B=Bn(h[w],D),M=A,K=k-_[y]-B,O=k/2-_[y]/2+S,q=gl(M,O,K),z=!c.arrow&&Js(r)!=null&&O!==q&&i.reference[y]/2-(O<M?A:B)-_[y]/2<0,U=z?O<M?O-M:O-K:0;return{[m]:p[m]+U,data:{[m]:q,centerOffset:O-q-U,...z&&{alignmentOffset:U}},reset:z}}}),_1=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n,s;const{placement:r,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=e,{mainAxis:d=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:y="none",flipAlignment:_=!0,...x}=jn(t,e);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Tn(r),w=Un(l),E=Tn(l)===l,T=await(c.isRTL==null?void 0:c.isRTL(u.floating)),j=p||(E||!_?[ci(l)]:h1(l)),P=y!=="none";!p&&P&&j.push(...f1(l,_,y,T));const k=[l,...j],S=await Hr(e,x),D=[];let A=((s=i.flip)==null?void 0:s.overflows)||[];if(d&&D.push(S[b]),h){const O=d1(r,a,T);D.push(S[O[0]],S[O[1]])}if(A=[...A,{placement:r,overflows:D}],!D.every(O=>O<=0)){var B,M;const O=(((B=i.flip)==null?void 0:B.index)||0)+1,q=k[O];if(q)return{data:{index:O,overflows:A},reset:{placement:q}};let z=(M=A.filter(U=>U.overflows[0]<=0).sort((U,C)=>U.overflows[1]-C.overflows[1])[0])==null?void 0:M.placement;if(!z)switch(m){case"bestFit":{var K;const U=(K=A.filter(C=>{if(P){const I=Un(C.placement);return I===w||I==="y"}return!0}).map(C=>[C.placement,C.overflows.filter(I=>I>0).reduce((I,ee)=>I+ee,0)]).sort((C,I)=>C[1]-I[1])[0])==null?void 0:K[0];U&&(z=U);break}case"initialPlacement":z=l;break}if(r!==z)return{reset:{placement:z}}}return{}}}};function Ed(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function jd(t){return l1.some(e=>t[e]>=0)}const y1=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:s="referenceHidden",...r}=jn(t,e);switch(s){case"referenceHidden":{const i=await Hr(e,{...r,elementContext:"reference"}),a=Ed(i,n.reference);return{data:{referenceHiddenOffsets:a,referenceHidden:jd(a)}}}case"escaped":{const i=await Hr(e,{...r,altBoundary:!0}),a=Ed(i,n.floating);return{data:{escapedOffsets:a,escaped:jd(a)}}}default:return{}}}}};async function x1(t,e){const{placement:n,platform:s,elements:r}=t,i=await(s.isRTL==null?void 0:s.isRTL(r.floating)),a=Tn(n),l=Js(n),c=Un(n)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,h=jn(e,t);let{mainAxis:p,crossAxis:m,alignmentAxis:y}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&typeof y=="number"&&(m=l==="end"?y*-1:y),c?{x:m*d,y:p*u}:{x:p*u,y:m*d}}const b1=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,s;const{x:r,y:i,placement:a,middlewareData:l}=e,c=await x1(e,t);return a===((n=l.offset)==null?void 0:n.placement)&&(s=l.arrow)!=null&&s.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:a}}}}},w1=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:s,placement:r}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:x=>{let{x:b,y:w}=x;return{x:b,y:w}}},...c}=jn(t,e),u={x:n,y:s},d=await Hr(e,c),h=Un(Tn(r)),p=Ac(h);let m=u[p],y=u[h];if(i){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",w=m+d[x],E=m-d[b];m=gl(w,m,E)}if(a){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=y+d[x],E=y-d[b];y=gl(w,y,E)}const _=l.fn({...e,[p]:m,[h]:y});return{..._,data:{x:_.x-n,y:_.y-s,enabled:{[p]:i,[h]:a}}}}}},E1=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:s,placement:r,rects:i,middlewareData:a}=e,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=jn(t,e),d={x:n,y:s},h=Un(r),p=Ac(h);let m=d[p],y=d[h];const _=jn(l,e),x=typeof _=="number"?{mainAxis:_,crossAxis:0}:{mainAxis:0,crossAxis:0,..._};if(c){const E=p==="y"?"height":"width",T=i.reference[p]-i.floating[E]+x.mainAxis,j=i.reference[p]+i.reference[E]-x.mainAxis;m<T?m=T:m>j&&(m=j)}if(u){var b,w;const E=p==="y"?"width":"height",T=["top","left"].includes(Tn(r)),j=i.reference[h]-i.floating[E]+(T&&((b=a.offset)==null?void 0:b[h])||0)+(T?0:x.crossAxis),P=i.reference[h]+i.reference[E]+(T?0:((w=a.offset)==null?void 0:w[h])||0)-(T?x.crossAxis:0);y<j?y=j:y>P&&(y=P)}return{[p]:m,[h]:y}}}},j1=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,s;const{placement:r,rects:i,platform:a,elements:l}=e,{apply:c=()=>{},...u}=jn(t,e),d=await Hr(e,u),h=Tn(r),p=Js(r),m=Un(r)==="y",{width:y,height:_}=i.floating;let x,b;h==="top"||h==="bottom"?(x=h,b=p===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(b=h,x=p==="end"?"top":"bottom");const w=_-d.top-d.bottom,E=y-d.left-d.right,T=Bn(_-d[x],w),j=Bn(y-d[b],E),P=!e.middlewareData.shift;let k=T,S=j;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(S=E),(s=e.middlewareData.shift)!=null&&s.enabled.y&&(k=w),P&&!p){const A=kt(d.left,0),B=kt(d.right,0),M=kt(d.top,0),K=kt(d.bottom,0);m?S=y-2*(A!==0||B!==0?A+B:kt(d.left,d.right)):k=_-2*(M!==0||K!==0?M+K:kt(d.top,d.bottom))}await c({...e,availableWidth:S,availableHeight:k});const D=await a.getDimensions(l.floating);return y!==D.width||_!==D.height?{reset:{rects:!0}}:{}}}};function Hi(){return typeof window<"u"}function Qs(t){return vm(t)?(t.nodeName||"").toLowerCase():"#document"}function Rt(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function dn(t){var e;return(e=(vm(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function vm(t){return Hi()?t instanceof Node||t instanceof Rt(t).Node:!1}function $t(t){return Hi()?t instanceof Element||t instanceof Rt(t).Element:!1}function cn(t){return Hi()?t instanceof HTMLElement||t instanceof Rt(t).HTMLElement:!1}function Td(t){return!Hi()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof Rt(t).ShadowRoot}function fo(t){const{overflow:e,overflowX:n,overflowY:s,display:r}=Bt(t);return/auto|scroll|overlay|hidden|clip/.test(e+s+n)&&!["inline","contents"].includes(r)}function T1(t){return["table","td","th"].includes(Qs(t))}function Wi(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function Oc(t){const e=Dc(),n=$t(t)?Bt(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(s=>(n.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(n.contain||"").includes(s))}function P1(t){let e=Hn(t);for(;cn(e)&&!Vs(e);){if(Oc(e))return e;if(Wi(e))return null;e=Hn(e)}return null}function Dc(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Vs(t){return["html","body","#document"].includes(Qs(t))}function Bt(t){return Rt(t).getComputedStyle(t)}function Gi(t){return $t(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function Hn(t){if(Qs(t)==="html")return t;const e=t.assignedSlot||t.parentNode||Td(t)&&t.host||dn(t);return Td(e)?e.host:e}function _m(t){const e=Hn(t);return Vs(e)?t.ownerDocument?t.ownerDocument.body:t.body:cn(e)&&fo(e)?e:_m(e)}function Wr(t,e,n){var s;e===void 0&&(e=[]),n===void 0&&(n=!0);const r=_m(t),i=r===((s=t.ownerDocument)==null?void 0:s.body),a=Rt(r);if(i){const l=_l(a);return e.concat(a,a.visualViewport||[],fo(r)?r:[],l&&n?Wr(l):[])}return e.concat(r,Wr(r,[],n))}function _l(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ym(t){const e=Bt(t);let n=parseFloat(e.width)||0,s=parseFloat(e.height)||0;const r=cn(t),i=r?t.offsetWidth:n,a=r?t.offsetHeight:s,l=li(n)!==i||li(s)!==a;return l&&(n=i,s=a),{width:n,height:s,$:l}}function Lc(t){return $t(t)?t:t.contextElement}function Ds(t){const e=Lc(t);if(!cn(e))return zn(1);const n=e.getBoundingClientRect(),{width:s,height:r,$:i}=ym(e);let a=(i?li(n.width):n.width)/s,l=(i?li(n.height):n.height)/r;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const k1=zn(0);function xm(t){const e=Rt(t);return!Dc()||!e.visualViewport?k1:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function S1(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==Rt(t)?!1:e}function os(t,e,n,s){e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect(),i=Lc(t);let a=zn(1);e&&(s?$t(s)&&(a=Ds(s)):a=Ds(t));const l=S1(i,n,s)?xm(i):zn(0);let c=(r.left+l.x)/a.x,u=(r.top+l.y)/a.y,d=r.width/a.x,h=r.height/a.y;if(i){const p=Rt(i),m=s&&$t(s)?Rt(s):s;let y=p,_=_l(y);for(;_&&s&&m!==y;){const x=Ds(_),b=_.getBoundingClientRect(),w=Bt(_),E=b.left+(_.clientLeft+parseFloat(w.paddingLeft))*x.x,T=b.top+(_.clientTop+parseFloat(w.paddingTop))*x.y;c*=x.x,u*=x.y,d*=x.x,h*=x.y,c+=E,u+=T,y=Rt(_),_=_l(y)}}return ui({width:d,height:h,x:c,y:u})}function R1(t){let{elements:e,rect:n,offsetParent:s,strategy:r}=t;const i=r==="fixed",a=dn(s),l=e?Wi(e.floating):!1;if(s===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=zn(1);const d=zn(0),h=cn(s);if((h||!h&&!i)&&((Qs(s)!=="body"||fo(a))&&(c=Gi(s)),cn(s))){const p=os(s);u=Ds(s),d.x=p.x+s.clientLeft,d.y=p.y+s.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function A1(t){return Array.from(t.getClientRects())}function yl(t,e){const n=Gi(t).scrollLeft;return e?e.left+n:os(dn(t)).left+n}function C1(t){const e=dn(t),n=Gi(t),s=t.ownerDocument.body,r=kt(e.scrollWidth,e.clientWidth,s.scrollWidth,s.clientWidth),i=kt(e.scrollHeight,e.clientHeight,s.scrollHeight,s.clientHeight);let a=-n.scrollLeft+yl(t);const l=-n.scrollTop;return Bt(s).direction==="rtl"&&(a+=kt(e.clientWidth,s.clientWidth)-r),{width:r,height:i,x:a,y:l}}function I1(t,e){const n=Rt(t),s=dn(t),r=n.visualViewport;let i=s.clientWidth,a=s.clientHeight,l=0,c=0;if(r){i=r.width,a=r.height;const u=Dc();(!u||u&&e==="fixed")&&(l=r.offsetLeft,c=r.offsetTop)}return{width:i,height:a,x:l,y:c}}function O1(t,e){const n=os(t,!0,e==="fixed"),s=n.top+t.clientTop,r=n.left+t.clientLeft,i=cn(t)?Ds(t):zn(1),a=t.clientWidth*i.x,l=t.clientHeight*i.y,c=r*i.x,u=s*i.y;return{width:a,height:l,x:c,y:u}}function Pd(t,e,n){let s;if(e==="viewport")s=I1(t,n);else if(e==="document")s=C1(dn(t));else if($t(e))s=O1(e,n);else{const r=xm(t);s={...e,x:e.x-r.x,y:e.y-r.y}}return ui(s)}function bm(t,e){const n=Hn(t);return n===e||!$t(n)||Vs(n)?!1:Bt(n).position==="fixed"||bm(n,e)}function D1(t,e){const n=e.get(t);if(n)return n;let s=Wr(t,[],!1).filter(l=>$t(l)&&Qs(l)!=="body"),r=null;const i=Bt(t).position==="fixed";let a=i?Hn(t):t;for(;$t(a)&&!Vs(a);){const l=Bt(a),c=Oc(a);!c&&l.position==="fixed"&&(r=null),(i?!c&&!r:!c&&l.position==="static"&&!!r&&["absolute","fixed"].includes(r.position)||fo(a)&&!c&&bm(t,a))?s=s.filter(d=>d!==a):r=l,a=Hn(a)}return e.set(t,s),s}function L1(t){let{element:e,boundary:n,rootBoundary:s,strategy:r}=t;const a=[...n==="clippingAncestors"?Wi(e)?[]:D1(e,this._c):[].concat(n),s],l=a[0],c=a.reduce((u,d)=>{const h=Pd(e,d,r);return u.top=kt(h.top,u.top),u.right=Bn(h.right,u.right),u.bottom=Bn(h.bottom,u.bottom),u.left=kt(h.left,u.left),u},Pd(e,l,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function M1(t){const{width:e,height:n}=ym(t);return{width:e,height:n}}function N1(t,e,n){const s=cn(e),r=dn(e),i=n==="fixed",a=os(t,!0,i,e);let l={scrollLeft:0,scrollTop:0};const c=zn(0);if(s||!s&&!i)if((Qs(e)!=="body"||fo(r))&&(l=Gi(e)),s){const m=os(e,!0,i,e);c.x=m.x+e.clientLeft,c.y=m.y+e.clientTop}else r&&(c.x=yl(r));let u=0,d=0;if(r&&!s&&!i){const m=r.getBoundingClientRect();d=m.top+l.scrollTop,u=m.left+l.scrollLeft-yl(r,m)}const h=a.left+l.scrollLeft-c.x-u,p=a.top+l.scrollTop-c.y-d;return{x:h,y:p,width:a.width,height:a.height}}function va(t){return Bt(t).position==="static"}function kd(t,e){if(!cn(t)||Bt(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return dn(t)===n&&(n=n.ownerDocument.body),n}function wm(t,e){const n=Rt(t);if(Wi(t))return n;if(!cn(t)){let r=Hn(t);for(;r&&!Vs(r);){if($t(r)&&!va(r))return r;r=Hn(r)}return n}let s=kd(t,e);for(;s&&T1(s)&&va(s);)s=kd(s,e);return s&&Vs(s)&&va(s)&&!Oc(s)?n:s||P1(t)||n}const V1=async function(t){const e=this.getOffsetParent||wm,n=this.getDimensions,s=await n(t.floating);return{reference:N1(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function F1(t){return Bt(t).direction==="rtl"}const $1={convertOffsetParentRelativeRectToViewportRelativeRect:R1,getDocumentElement:dn,getClippingRect:L1,getOffsetParent:wm,getElementRects:V1,getClientRects:A1,getDimensions:M1,getScale:Ds,isElement:$t,isRTL:F1};function B1(t,e){let n=null,s;const r=dn(t);function i(){var l;clearTimeout(s),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:h,height:p}=t.getBoundingClientRect();if(l||e(),!h||!p)return;const m=Co(d),y=Co(r.clientWidth-(u+h)),_=Co(r.clientHeight-(d+p)),x=Co(u),w={rootMargin:-m+"px "+-y+"px "+-_+"px "+-x+"px",threshold:kt(0,Bn(1,c))||1};let E=!0;function T(j){const P=j[0].intersectionRatio;if(P!==c){if(!E)return a();P?a(!1,P):s=setTimeout(()=>{a(!1,1e-7)},1e3)}E=!1}try{n=new IntersectionObserver(T,{...w,root:r.ownerDocument})}catch{n=new IntersectionObserver(T,w)}n.observe(t)}return a(!0),i}function z1(t,e,n,s){s===void 0&&(s={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=s,u=Lc(t),d=r||i?[...u?Wr(u):[],...Wr(e)]:[];d.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const h=u&&l?B1(u,n):null;let p=-1,m=null;a&&(m=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&m&&(m.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(e)})),n()}),u&&!c&&m.observe(u),m.observe(e));let y,_=c?os(t):null;c&&x();function x(){const b=os(t);_&&(b.x!==_.x||b.y!==_.y||b.width!==_.width||b.height!==_.height)&&n(),_=b,y=requestAnimationFrame(x)}return n(),()=>{var b;d.forEach(w=>{r&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),h?.(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(y)}}const U1=b1,H1=w1,W1=_1,G1=j1,K1=y1,Sd=v1,q1=E1,Y1=(t,e,n)=>{const s=new Map,r={platform:$1,...n},i={...r.platform,_c:s};return g1(t,e,{...r,platform:i})};var Yo=typeof document<"u"?f.useLayoutEffect:f.useEffect;function di(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,s,r;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(s=n;s--!==0;)if(!di(t[s],e[s]))return!1;return!0}if(r=Object.keys(t),n=r.length,n!==Object.keys(e).length)return!1;for(s=n;s--!==0;)if(!{}.hasOwnProperty.call(e,r[s]))return!1;for(s=n;s--!==0;){const i=r[s];if(!(i==="_owner"&&t.$$typeof)&&!di(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function Em(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function Rd(t,e){const n=Em(t);return Math.round(e*n)/n}function _a(t){const e=f.useRef(t);return Yo(()=>{e.current=t}),e}function X1(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:s=[],platform:r,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,h]=f.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[p,m]=f.useState(s);di(p,s)||m(s);const[y,_]=f.useState(null),[x,b]=f.useState(null),w=f.useCallback(C=>{C!==P.current&&(P.current=C,_(C))},[]),E=f.useCallback(C=>{C!==k.current&&(k.current=C,b(C))},[]),T=i||y,j=a||x,P=f.useRef(null),k=f.useRef(null),S=f.useRef(d),D=c!=null,A=_a(c),B=_a(r),M=_a(u),K=f.useCallback(()=>{if(!P.current||!k.current)return;const C={placement:e,strategy:n,middleware:p};B.current&&(C.platform=B.current),Y1(P.current,k.current,C).then(I=>{const ee={...I,isPositioned:M.current!==!1};O.current&&!di(S.current,ee)&&(S.current=ee,Vi.flushSync(()=>{h(ee)}))})},[p,e,n,B,M]);Yo(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(C=>({...C,isPositioned:!1})))},[u]);const O=f.useRef(!1);Yo(()=>(O.current=!0,()=>{O.current=!1}),[]),Yo(()=>{if(T&&(P.current=T),j&&(k.current=j),T&&j){if(A.current)return A.current(T,j,K);K()}},[T,j,K,A,D]);const q=f.useMemo(()=>({reference:P,floating:k,setReference:w,setFloating:E}),[w,E]),z=f.useMemo(()=>({reference:T,floating:j}),[T,j]),U=f.useMemo(()=>{const C={position:n,left:0,top:0};if(!z.floating)return C;const I=Rd(z.floating,d.x),ee=Rd(z.floating,d.y);return l?{...C,transform:"translate("+I+"px, "+ee+"px)",...Em(z.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:ee}},[n,l,z.floating,d.x,d.y]);return f.useMemo(()=>({...d,update:K,refs:q,elements:z,floatingStyles:U}),[d,K,q,z,U])}const Z1=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:s,padding:r}=typeof t=="function"?t(n):t;return s&&e(s)?s.current!=null?Sd({element:s.current,padding:r}).fn(n):{}:s?Sd({element:s,padding:r}).fn(n):{}}}},J1=(t,e)=>({...U1(t),options:[t,e]}),Q1=(t,e)=>({...H1(t),options:[t,e]}),eE=(t,e)=>({...q1(t),options:[t,e]}),tE=(t,e)=>({...W1(t),options:[t,e]}),nE=(t,e)=>({...G1(t),options:[t,e]}),sE=(t,e)=>({...K1(t),options:[t,e]}),rE=(t,e)=>({...Z1(t),options:[t,e]});var oE="Arrow",jm=f.forwardRef((t,e)=>{const{children:n,width:s=10,height:r=5,...i}=t;return o.jsx(de.svg,{...i,ref:e,width:s,height:r,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:o.jsx("polygon",{points:"0,0 30,0 15,10"})})});jm.displayName=oE;var iE=jm;function aE(t,e=[]){let n=[];function s(i,a){const l=f.createContext(a),c=n.length;n=[...n,a];function u(h){const{scope:p,children:m,...y}=h,_=p?.[t][c]||l,x=f.useMemo(()=>y,Object.values(y));return o.jsx(_.Provider,{value:x,children:m})}function d(h,p){const m=p?.[t][c]||l,y=f.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const r=()=>{const i=n.map(a=>f.createContext(a));return function(l){const c=l?.[t]||i;return f.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return r.scopeName=t,[s,lE(r,...e)]}function lE(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const s=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const a=s.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}function cE(t){const[e,n]=f.useState(void 0);return ln(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const s=new ResizeObserver(r=>{if(!Array.isArray(r)||!r.length)return;const i=r[0];let a,l;if("borderBoxSize"in i){const c=i.borderBoxSize,u=Array.isArray(c)?c[0]:c;a=u.inlineSize,l=u.blockSize}else a=t.offsetWidth,l=t.offsetHeight;n({width:a,height:l})});return s.observe(t,{box:"border-box"}),()=>s.unobserve(t)}else n(void 0)},[t]),e}var Mc="Popper",[Tm,Ki]=aE(Mc),[uE,Pm]=Tm(Mc),km=t=>{const{__scopePopper:e,children:n}=t,[s,r]=f.useState(null);return o.jsx(uE,{scope:e,anchor:s,onAnchorChange:r,children:n})};km.displayName=Mc;var Sm="PopperAnchor",Rm=f.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:s,...r}=t,i=Pm(Sm,n),a=f.useRef(null),l=Ae(e,a);return f.useEffect(()=>{i.onAnchorChange(s?.current||a.current)}),s?null:o.jsx(de.div,{...r,ref:l})});Rm.displayName=Sm;var Nc="PopperContent",[dE,hE]=Tm(Nc),Am=f.forwardRef((t,e)=>{const{__scopePopper:n,side:s="bottom",sideOffset:r=0,align:i="center",alignOffset:a=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:y,..._}=t,x=Pm(Nc,n),[b,w]=f.useState(null),E=Ae(e,_e=>w(_e)),[T,j]=f.useState(null),P=cE(T),k=P?.width??0,S=P?.height??0,D=s+(i!=="center"?"-"+i:""),A=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},B=Array.isArray(u)?u:[u],M=B.length>0,K={padding:A,boundary:B.filter(fE),altBoundary:M},{refs:O,floatingStyles:q,placement:z,isPositioned:U,middlewareData:C}=X1({strategy:"fixed",placement:D,whileElementsMounted:(..._e)=>z1(..._e,{animationFrame:m==="always"}),elements:{reference:x.anchor},middleware:[J1({mainAxis:r+S,alignmentAxis:a}),c&&Q1({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?eE():void 0,...K}),c&&tE({...K}),nE({...K,apply:({elements:_e,rects:jt,availableWidth:pn,availableHeight:Be})=>{const{width:sr,height:kn}=jt.reference,Gt=_e.floating.style;Gt.setProperty("--radix-popper-available-width",`${pn}px`),Gt.setProperty("--radix-popper-available-height",`${Be}px`),Gt.setProperty("--radix-popper-anchor-width",`${sr}px`),Gt.setProperty("--radix-popper-anchor-height",`${kn}px`)}}),T&&rE({element:T,padding:l}),mE({arrowWidth:k,arrowHeight:S}),p&&sE({strategy:"referenceHidden",...K})]}),[I,ee]=Om(z),H=vt(y);ln(()=>{U&&H?.()},[U,H]);const Y=C.arrow?.x,Z=C.arrow?.y,oe=C.arrow?.centerOffset!==0,[De,ne]=f.useState();return ln(()=>{b&&ne(window.getComputedStyle(b).zIndex)},[b]),o.jsx("div",{ref:O.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:U?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:De,"--radix-popper-transform-origin":[C.transformOrigin?.x,C.transformOrigin?.y].join(" "),...C.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:o.jsx(dE,{scope:n,placedSide:I,onArrowChange:j,arrowX:Y,arrowY:Z,shouldHideArrow:oe,children:o.jsx(de.div,{"data-side":I,"data-align":ee,..._,ref:E,style:{..._.style,animation:U?void 0:"none"}})})})});Am.displayName=Nc;var Cm="PopperArrow",pE={top:"bottom",right:"left",bottom:"top",left:"right"},Im=f.forwardRef(function(e,n){const{__scopePopper:s,...r}=e,i=hE(Cm,s),a=pE[i.placedSide];return o.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:o.jsx(iE,{...r,ref:n,style:{...r.style,display:"block"}})})});Im.displayName=Cm;function fE(t){return t!==null}var mE=t=>({name:"transformOrigin",options:t,fn(e){const{placement:n,rects:s,middlewareData:r}=e,a=r.arrow?.centerOffset!==0,l=a?0:t.arrowWidth,c=a?0:t.arrowHeight,[u,d]=Om(n),h={start:"0%",center:"50%",end:"100%"}[d],p=(r.arrow?.x??0)+l/2,m=(r.arrow?.y??0)+c/2;let y="",_="";return u==="bottom"?(y=a?h:`${p}px`,_=`${-c}px`):u==="top"?(y=a?h:`${p}px`,_=`${s.floating.height+c}px`):u==="right"?(y=`${-c}px`,_=a?h:`${m}px`):u==="left"&&(y=`${s.floating.width+c}px`,_=a?h:`${m}px`),{data:{x:y,y:_}}}});function Om(t){const[e,n="center"]=t.split("-");return[e,n]}var Dm=km,Lm=Rm,Mm=Am,Nm=Im,[qi,wL]=Xs("Tooltip",[Ki]),Yi=Ki(),Vm="TooltipProvider",gE=700,xl="tooltip.open",[vE,Vc]=qi(Vm),Fm=t=>{const{__scopeTooltip:e,delayDuration:n=gE,skipDelayDuration:s=300,disableHoverableContent:r=!1,children:i}=t,[a,l]=f.useState(!0),c=f.useRef(!1),u=f.useRef(0);return f.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),o.jsx(vE,{scope:e,isOpenDelayed:a,delayDuration:n,onOpen:f.useCallback(()=>{window.clearTimeout(u.current),l(!1)},[]),onClose:f.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>l(!0),s)},[s]),isPointerInTransitRef:c,onPointerInTransitChange:f.useCallback(d=>{c.current=d},[]),disableHoverableContent:r,children:i})};Fm.displayName=Vm;var Xi="Tooltip",[_E,mo]=qi(Xi),$m=t=>{const{__scopeTooltip:e,children:n,open:s,defaultOpen:r=!1,onOpenChange:i,disableHoverableContent:a,delayDuration:l}=t,c=Vc(Xi,t.__scopeTooltip),u=Yi(e),[d,h]=f.useState(null),p=ts(),m=f.useRef(0),y=a??c.disableHoverableContent,_=l??c.delayDuration,x=f.useRef(!1),[b=!1,w]=po({prop:s,defaultProp:r,onChange:k=>{k?(c.onOpen(),document.dispatchEvent(new CustomEvent(xl))):c.onClose(),i?.(k)}}),E=f.useMemo(()=>b?x.current?"delayed-open":"instant-open":"closed",[b]),T=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,x.current=!1,w(!0)},[w]),j=f.useCallback(()=>{window.clearTimeout(m.current),m.current=0,w(!1)},[w]),P=f.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{x.current=!0,w(!0),m.current=0},_)},[_,w]);return f.useEffect(()=>()=>{m.current&&(window.clearTimeout(m.current),m.current=0)},[]),o.jsx(Dm,{...u,children:o.jsx(_E,{scope:e,contentId:p,open:b,stateAttribute:E,trigger:d,onTriggerChange:h,onTriggerEnter:f.useCallback(()=>{c.isOpenDelayed?P():T()},[c.isOpenDelayed,P,T]),onTriggerLeave:f.useCallback(()=>{y?j():(window.clearTimeout(m.current),m.current=0)},[j,y]),onOpen:T,onClose:j,disableHoverableContent:y,children:n})})};$m.displayName=Xi;var bl="TooltipTrigger",Bm=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...s}=t,r=mo(bl,n),i=Vc(bl,n),a=Yi(n),l=f.useRef(null),c=Ae(e,l,r.onTriggerChange),u=f.useRef(!1),d=f.useRef(!1),h=f.useCallback(()=>u.current=!1,[]);return f.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),o.jsx(Lm,{asChild:!0,...a,children:o.jsx(de.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...s,ref:c,onPointerMove:W(t.onPointerMove,p=>{p.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(r.onTriggerEnter(),d.current=!0)}),onPointerLeave:W(t.onPointerLeave,()=>{r.onTriggerLeave(),d.current=!1}),onPointerDown:W(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:W(t.onFocus,()=>{u.current||r.onOpen()}),onBlur:W(t.onBlur,r.onClose),onClick:W(t.onClick,r.onClose)})})});Bm.displayName=bl;var Fc="TooltipPortal",[yE,xE]=qi(Fc,{forceMount:void 0}),zm=t=>{const{__scopeTooltip:e,forceMount:n,children:s,container:r}=t,i=mo(Fc,e);return o.jsx(yE,{scope:e,forceMount:n,children:o.jsx(Ut,{present:n||i.open,children:o.jsx(ho,{asChild:!0,container:r,children:s})})})};zm.displayName=Fc;var Fs="TooltipContent",Um=f.forwardRef((t,e)=>{const n=xE(Fs,t.__scopeTooltip),{forceMount:s=n.forceMount,side:r="top",...i}=t,a=mo(Fs,t.__scopeTooltip);return o.jsx(Ut,{present:s||a.open,children:a.disableHoverableContent?o.jsx(Hm,{side:r,...i,ref:e}):o.jsx(bE,{side:r,...i,ref:e})})}),bE=f.forwardRef((t,e)=>{const n=mo(Fs,t.__scopeTooltip),s=Vc(Fs,t.__scopeTooltip),r=f.useRef(null),i=Ae(e,r),[a,l]=f.useState(null),{trigger:c,onClose:u}=n,d=r.current,{onPointerInTransitChange:h}=s,p=f.useCallback(()=>{l(null),h(!1)},[h]),m=f.useCallback((y,_)=>{const x=y.currentTarget,b={x:y.clientX,y:y.clientY},w=TE(b,x.getBoundingClientRect()),E=PE(b,w),T=kE(_.getBoundingClientRect()),j=RE([...E,...T]);l(j),h(!0)},[h]);return f.useEffect(()=>()=>p(),[p]),f.useEffect(()=>{if(c&&d){const y=x=>m(x,d),_=x=>m(x,c);return c.addEventListener("pointerleave",y),d.addEventListener("pointerleave",_),()=>{c.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",_)}}},[c,d,m,p]),f.useEffect(()=>{if(a){const y=_=>{const x=_.target,b={x:_.clientX,y:_.clientY},w=c?.contains(x)||d?.contains(x),E=!SE(b,a);w?p():E&&(p(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[c,d,a,u,p]),o.jsx(Hm,{...t,ref:i})}),[wE,EE]=qi(Xi,{isInside:!1}),Hm=f.forwardRef((t,e)=>{const{__scopeTooltip:n,children:s,"aria-label":r,onEscapeKeyDown:i,onPointerDownOutside:a,...l}=t,c=mo(Fs,n),u=Yi(n),{onClose:d}=c;return f.useEffect(()=>(document.addEventListener(xl,d),()=>document.removeEventListener(xl,d)),[d]),f.useEffect(()=>{if(c.trigger){const h=p=>{p.target?.contains(c.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[c.trigger,d]),o.jsx(uo,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:o.jsxs(Mm,{"data-state":c.stateAttribute,...u,...l,ref:e,style:{...l.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[o.jsx(Cf,{children:s}),o.jsx(wE,{scope:n,isInside:!0,children:o.jsx(Rx,{id:c.contentId,role:"tooltip",children:r||s})})]})})});Um.displayName=Fs;var Wm="TooltipArrow",jE=f.forwardRef((t,e)=>{const{__scopeTooltip:n,...s}=t,r=Yi(n);return EE(Wm,n).isInside?null:o.jsx(Nm,{...r,...s,ref:e})});jE.displayName=Wm;function TE(t,e){const n=Math.abs(e.top-t.y),s=Math.abs(e.bottom-t.y),r=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,s,r,i)){case i:return"left";case r:return"right";case n:return"top";case s:return"bottom";default:throw new Error("unreachable")}}function PE(t,e,n=5){const s=[];switch(e){case"top":s.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":s.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":s.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":s.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return s}function kE(t){const{top:e,right:n,bottom:s,left:r}=t;return[{x:r,y:e},{x:n,y:e},{x:n,y:s},{x:r,y:s}]}function SE(t,e){const{x:n,y:s}=t;let r=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const l=e[i].x,c=e[i].y,u=e[a].x,d=e[a].y;c>s!=d>s&&n<(u-l)*(s-c)/(d-c)+l&&(r=!r)}return r}function RE(t){const e=t.slice();return e.sort((n,s)=>n.x<s.x?-1:n.x>s.x?1:n.y<s.y?-1:n.y>s.y?1:0),AE(e)}function AE(t){if(t.length<=1)return t.slice();const e=[];for(let s=0;s<t.length;s++){const r=t[s];for(;e.length>=2;){const i=e[e.length-1],a=e[e.length-2];if((i.x-a.x)*(r.y-a.y)>=(i.y-a.y)*(r.x-a.x))e.pop();else break}e.push(r)}e.pop();const n=[];for(let s=t.length-1;s>=0;s--){const r=t[s];for(;n.length>=2;){const i=n[n.length-1],a=n[n.length-2];if((i.x-a.x)*(r.y-a.y)>=(i.y-a.y)*(r.x-a.x))n.pop();else break}n.push(r)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var CE=Fm,IE=$m,OE=Bm,DE=zm,Gm=Um;const LE=CE,ME=IE,NE=OE,Km=f.forwardRef(({className:t,sideOffset:e=4,...n},s)=>o.jsx(DE,{children:o.jsx(Gm,{ref:s,sideOffset:e,className:ve("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Km.displayName=Gm.displayName;const VE="https://pldrgdplxacehsmcyjnx.supabase.co",FE="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InBsZHJnZHBseGFjZWhzbWN5am54Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3NDM0MzU5MzEsImV4cCI6MjA1OTAxMTkzMX0.YnKo7pfbjg52NF6TL2pNilHkND5ZgkhbDuAtC_-IQL4",pe=Xy(VE,FE),EL=async()=>{try{const{data:t,error:e}=await pe.functions.invoke("get-stripe-prices");if(e)throw console.error("Error fetching Stripe prices:",e),e;return{prices:t?.prices||[],stripeMode:t?.stripeMode||"test"}}catch(t){throw console.error("Error in getActivePricingTiers:",t),t}},jL=async(t,e,n)=>{try{console.log("Creating Stripe subscription for plan:",t,"currency:",n);const{data:s,error:r}=await pe.functions.invoke("create-checkout",{body:{planType:t,currentLanguage:e||"en",currency:n||"GBP"}});if(r)throw console.error("Error creating Stripe subscription:",r),new Error(r.message||"Failed to create Stripe subscription");if(!s||!s.url)throw console.error("No URL returned from Stripe subscription:",s),new Error("Invalid response from server");return console.log("Stripe subscription created successfully:",s),s}catch(s){const r=s instanceof Error?s.message:String(s);throw console.error("Error in Stripe subscription service:",r),s}},TL=async()=>{try{console.log("Creating customer portal session");const{data:t,error:e}=await pe.functions.invoke("customer-portal");if(e)throw console.error("Error creating customer portal session:",e),new Error(e.message||"Failed to create customer portal session");if(!t||!t.url)throw console.error("No URL returned from customer portal session:",t),new Error("Invalid response from server");return console.log("Customer portal session created successfully:",t),t}catch(t){const e=t instanceof Error?t.message:String(t);throw console.error("Error in subscription service:",e),t}},$E=async(t=!1)=>{try{console.log("Checking subscription status",t?"(force refresh)":"");const{data:e,error:n}=await pe.functions.invoke("check-subscription",{body:t?{forceRefresh:!0,timestamp:new Date().getTime()}:void 0});if(n){const s=n.message||"";if(s.includes("401")||s.includes("Invalid user token")||s.includes("Unauthorized"))return console.warn("Session expired during subscription check, returning null"),null;throw console.error("Error checking subscription status:",n),new Error(s||"Failed to check subscription status")}return console.log("Subscription status checked successfully:",e),e}catch(e){const n=e instanceof Error?e.message:String(e);throw console.error("Error in subscription service:",n),e}};var R=typeof window<"u"?window:void 0,$e=typeof globalThis<"u"?globalThis:R;typeof self>"u"&&($e.self=$e),typeof File>"u"&&($e.File=function(){});var qm=Array.prototype,Ad=qm.forEach,Cd=qm.indexOf,St=$e?.navigator,N=$e?.document,Fe=$e?.location,wl=$e?.fetch,El=$e!=null&&$e.XMLHttpRequest&&"withCredentials"in new $e.XMLHttpRequest?$e.XMLHttpRequest:void 0,Id=$e?.AbortController,bt=St?.userAgent,G=R??{},_n={DEBUG:!1,LIB_VERSION:"1.354.0"};function Od(t,e,n,s,r,i,a){try{var l=t[i](a),c=l.value}catch(u){return void n(u)}l.done?e(c):Promise.resolve(c).then(s,r)}function yn(t){return function(){var e=this,n=arguments;return new Promise(function(s,r){var i=t.apply(e,n);function a(c){Od(i,s,r,a,l,"next",c)}function l(c){Od(i,s,r,a,l,"throw",c)}a(void 0)})}}function V(){return V=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var s in n)({}).hasOwnProperty.call(n,s)&&(t[s]=n[s])}return t},V.apply(null,arguments)}function Ym(t,e){if(t==null)return{};var n={};for(var s in t)if({}.hasOwnProperty.call(t,s)){if(e.indexOf(s)!==-1)continue;n[s]=t[s]}return n}var BE=["$snapshot","$pageview","$pageleave","$set","survey dismissed","survey sent","survey shown","$identify","$groupidentify","$create_alias","$$client_ingestion_warning","$web_experiment_applied","$feature_enrollment_update","$feature_flag_called"],zE=["amazonbot","amazonproductbot","app.hypefactors.com","applebot","archive.org_bot","awariobot","backlinksextendedbot","baiduspider","bingbot","bingpreview","chrome-lighthouse","dataforseobot","deepscan","duckduckbot","facebookexternal","facebookcatalog","http://yandex.com/bots","hubspot","ia_archiver","leikibot","linkedinbot","meta-externalagent","mj12bot","msnbot","nessus","petalbot","pinterest","prerender","rogerbot","screaming frog","sebot-wa","sitebulb","slackbot","slurp","trendictionbot","turnitin","twitterbot","vercel-screenshot","vercelbot","yahoo! slurp","yandexbot","zoombot","bot.htm","bot.php","(bot;","bot/","crawler","ahrefsbot","ahrefssiteaudit","semrushbot","siteauditbot","splitsignalbot","gptbot","oai-searchbot","chatgpt-user","perplexitybot","better uptime bot","sentryuptimebot","uptimerobot","headlesschrome","cypress","google-hoteladsverifier","adsbot-google","apis-google","duplexweb-google","feedfetcher-google","google favicon","google web preview","google-read-aloud","googlebot","googleother","google-cloudvertexbot","googleweblight","mediapartners-google","storebot-google","google-inspectiontool","bytespider"],Dd=function(t,e){if(e===void 0&&(e=[]),!t)return!1;var n=t.toLowerCase();return zE.concat(e).some(s=>{var r=s.toLowerCase();return n.indexOf(r)!==-1})};function te(t,e){return t.indexOf(e)!==-1}var Zi=function(t){return t.trim()},jl=function(t){return t.replace(/^\$/,"")},UE=Array.isArray,Xm=Object.prototype,Zm=Xm.hasOwnProperty,Ji=Xm.toString,ue=UE||function(t){return Ji.call(t)==="[object Array]"},bn=t=>typeof t=="function",Le=t=>t===Object(t)&&!ue(t),Ts=t=>{if(Le(t)){for(var e in t)if(Zm.call(t,e))return!1;return!0}return!1},F=t=>t===void 0,Ie=t=>Ji.call(t)=="[object String]",Tl=t=>Ie(t)&&t.trim().length===0,Ht=t=>t===null,se=t=>F(t)||Ht(t),Pn=t=>Ji.call(t)=="[object Number]"&&t==t,ws=t=>Pn(t)&&t>0,En=t=>Ji.call(t)==="[object Boolean]",HE=t=>t instanceof FormData,WE=t=>te(BE,t);function Pl(t){return t===null||typeof t!="object"}function hi(t,e){return Object.prototype.toString.call(t)==="[object "+e+"]"}function Jm(t){return!F(Event)&&function(e,n){try{return e instanceof n}catch{return!1}}(t,Event)}var GE=[!0,"true",1,"1","yes"],ya=t=>te(GE,t),KE=[!1,"false",0,"0","no"];function en(t,e,n,s,r){return e>n&&(s.warn("min cannot be greater than max."),e=n),Pn(t)?t>n?(s.warn(" cannot be greater than max: "+n+". Using max value instead."),n):t<e?(s.warn(" cannot be less than min: "+e+". Using min value instead."),e):t:(s.warn(" must be a number. using max or fallback. max: "+n+", fallback: "+r),en(r||n,e,n,s))}class qE{constructor(e){this.t={},this.i=e.i,this.o=en(e.bucketSize,0,100,e.h),this.m=en(e.refillRate,0,this.o,e.h),this.$=en(e.refillInterval,0,864e5,e.h)}S(e,n){var s=n-e.lastAccess,r=Math.floor(s/this.$);if(r>0){var i=r*this.m;e.tokens=Math.min(e.tokens+i,this.o),e.lastAccess=e.lastAccess+r*this.$}}consumeRateLimit(e){var n,s=Date.now(),r=String(e),i=this.t[r];return i?this.S(i,s):(i={tokens:this.o,lastAccess:s},this.t[r]=i),i.tokens===0||(i.tokens--,i.tokens===0&&((n=this.i)==null||n.call(this,e)),i.tokens===0)}stop(){this.t={}}}var Dt="Mobile",pi="iOS",wn="Android",Gr="Tablet",Qm=wn+" "+Gr,eg="iPad",tg="Apple",ng=tg+" Watch",Kr="Safari",$s="BlackBerry",sg="Samsung",rg=sg+"Browser",og=sg+" Internet",is="Chrome",YE=is+" OS",ig=is+" "+pi,$c="Internet Explorer",ag=$c+" "+Dt,Bc="Opera",XE=Bc+" Mini",zc="Edge",lg="Microsoft "+zc,Ls="Firefox",cg=Ls+" "+pi,qr="Nintendo",Yr="PlayStation",Ms="Xbox",ug=wn+" "+Dt,dg=Dt+" "+Kr,xr="Windows",kl=xr+" Phone",Ld="Nokia",Sl="Ouya",hg="Generic",ZE=hg+" "+Dt.toLowerCase(),pg=hg+" "+Gr.toLowerCase(),Rl="Konqueror",_t="(\\d+(\\.\\d+)?)",xa=new RegExp("Version/"+_t),JE=new RegExp(Ms,"i"),QE=new RegExp(Yr+" \\w+","i"),ej=new RegExp(qr+" \\w+","i"),Uc=new RegExp($s+"|PlayBook|BB10","i"),tj={"NT3.51":"NT 3.11","NT4.0":"NT 4.0","5.0":"2000",5.1:"XP",5.2:"XP","6.0":"Vista",6.1:"7",6.2:"8",6.3:"8.1",6.4:"10","10.0":"10"},Io,Md,ba,nj=(t,e)=>e&&te(e,tg)||function(n){return te(n,Kr)&&!te(n,is)&&!te(n,wn)}(t),fg=function(t,e){return e=e||"",te(t," OPR/")&&te(t,"Mini")?XE:te(t," OPR/")?Bc:Uc.test(t)?$s:te(t,"IE"+Dt)||te(t,"WPDesktop")?ag:te(t,rg)?og:te(t,zc)||te(t,"Edg/")?lg:te(t,"FBIOS")?"Facebook "+Dt:te(t,"UCWEB")||te(t,"UCBrowser")?"UC Browser":te(t,"CriOS")?ig:te(t,"CrMo")||te(t,is)?is:te(t,wn)&&te(t,Kr)?ug:te(t,"FxiOS")?cg:te(t.toLowerCase(),Rl.toLowerCase())?Rl:nj(t,e)?te(t,Dt)?dg:Kr:te(t,Ls)?Ls:te(t,"MSIE")||te(t,"Trident/")?$c:te(t,"Gecko")?Ls:""},sj={[ag]:[new RegExp("rv:"+_t)],[lg]:[new RegExp(zc+"?\\/"+_t)],[is]:[new RegExp("("+is+"|CrMo)\\/"+_t)],[ig]:[new RegExp("CriOS\\/"+_t)],"UC Browser":[new RegExp("(UCBrowser|UCWEB)\\/"+_t)],[Kr]:[xa],[dg]:[xa],[Bc]:[new RegExp("(Opera|OPR)\\/"+_t)],[Ls]:[new RegExp(Ls+"\\/"+_t)],[cg]:[new RegExp("FxiOS\\/"+_t)],[Rl]:[new RegExp("Konqueror[:/]?"+_t,"i")],[$s]:[new RegExp($s+" "+_t),xa],[ug]:[new RegExp("android\\s"+_t,"i")],[og]:[new RegExp(rg+"\\/"+_t)],[$c]:[new RegExp("(rv:|MSIE )"+_t)],Mozilla:[new RegExp("rv:"+_t)]},rj=function(t,e){var n=fg(t,e),s=sj[n];if(F(s))return null;for(var r=0;r<s.length;r++){var i=s[r],a=t.match(i);if(a)return parseFloat(a[a.length-2])}return null},Nd=[[new RegExp(Ms+"; "+Ms+" (.*?)[);]","i"),t=>[Ms,t&&t[1]||""]],[new RegExp(qr,"i"),[qr,""]],[new RegExp(Yr,"i"),[Yr,""]],[Uc,[$s,""]],[new RegExp(xr,"i"),(t,e)=>{if(/Phone/.test(e)||/WPDesktop/.test(e))return[kl,""];if(new RegExp(Dt).test(e)&&!/IEMobile\b/.test(e))return[xr+" "+Dt,""];var n=/Windows NT ([0-9.]+)/i.exec(e);if(n&&n[1]){var s=n[1],r=tj[s]||"";return/arm/i.test(e)&&(r="RT"),[xr,r]}return[xr,""]}],[/((iPhone|iPad|iPod).*?OS (\d+)_(\d+)_?(\d+)?|iPhone)/,t=>{if(t&&t[3]){var e=[t[3],t[4],t[5]||"0"];return[pi,e.join(".")]}return[pi,""]}],[/(watch.*\/(\d+\.\d+\.\d+)|watch os,(\d+\.\d+),)/i,t=>{var e="";return t&&t.length>=3&&(e=F(t[2])?t[3]:t[2]),["watchOS",e]}],[new RegExp("("+wn+" (\\d+)\\.(\\d+)\\.?(\\d+)?|"+wn+")","i"),t=>{if(t&&t[2]){var e=[t[2],t[3],t[4]||"0"];return[wn,e.join(".")]}return[wn,""]}],[/Mac OS X (\d+)[_.](\d+)[_.]?(\d+)?/i,t=>{var e=["Mac OS X",""];if(t&&t[1]){var n=[t[1],t[2],t[3]||"0"];e[1]=n.join(".")}return e}],[/Mac/i,["Mac OS X",""]],[/CrOS/,[YE,""]],[/Linux|debian/i,["Linux",""]]],Vd=function(t){return ej.test(t)?qr:QE.test(t)?Yr:JE.test(t)?Ms:new RegExp(Sl,"i").test(t)?Sl:new RegExp("("+kl+"|WPDesktop)","i").test(t)?kl:/iPad/.test(t)?eg:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?ng:Uc.test(t)?$s:/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(Ld,"i").test(t)?Ld:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Dt).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?wn:Qm:new RegExp("(pda|"+Dt+")","i").test(t)?ZE:new RegExp(Gr,"i").test(t)&&!new RegExp(Gr+" pc","i").test(t)?pg:""},oj=t=>t instanceof Error;function ij(t){var e=globalThis._posthogChunkIds;if(e){var n=Object.keys(e);return ba&&n.length===Md||(Md=n.length,ba=n.reduce((s,r)=>{Io||(Io={});var i=Io[r];if(i)s[i[0]]=i[1];else for(var a=t(r),l=a.length-1;l>=0;l--){var c=a[l],u=c?.filename,d=e[r];if(u&&d){s[u]=d,Io[r]=[u,d];break}}return s},{})),ba}}class aj{constructor(e,n,s){s===void 0&&(s=[]),this.coercers=e,this.stackParser=n,this.modifiers=s}buildFromUnknown(e,n){n===void 0&&(n={});var s=n&&n.mechanism||{handled:!0,type:"generic"},r=this.buildCoercingContext(s,n,0).apply(e),i=this.buildParsingContext(n),a=this.parseStacktrace(r,i);return{$exception_list:this.convertToExceptionList(a,s),$exception_level:"error"}}modifyFrames(e){var n=this;return yn(function*(){for(var s of e)s.stacktrace&&s.stacktrace.frames&&ue(s.stacktrace.frames)&&(s.stacktrace.frames=yield n.applyModifiers(s.stacktrace.frames));return e})()}coerceFallback(e){var n;return{type:"Error",value:"Unknown error",stack:(n=e.syntheticException)==null?void 0:n.stack,synthetic:!0}}parseStacktrace(e,n){var s,r;return e.cause!=null&&(s=this.parseStacktrace(e.cause,n)),e.stack!=""&&e.stack!=null&&(r=this.applyChunkIds(this.stackParser(e.stack,e.synthetic?n.skipFirstLines:0),n.chunkIdMap)),V({},e,{cause:s,stack:r})}applyChunkIds(e,n){return e.map(s=>(s.filename&&n&&(s.chunk_id=n[s.filename]),s))}applyCoercers(e,n){for(var s of this.coercers)if(s.match(e))return s.coerce(e,n);return this.coerceFallback(n)}applyModifiers(e){var n=this;return yn(function*(){var s=e;for(var r of n.modifiers)s=yield r(s);return s})()}convertToExceptionList(e,n){var s,r,i,a={type:e.type,value:e.value,mechanism:{type:(s=n.type)!==null&&s!==void 0?s:"generic",handled:(r=n.handled)===null||r===void 0||r,synthetic:(i=e.synthetic)!==null&&i!==void 0&&i}};e.stack&&(a.stacktrace={type:"raw",frames:e.stack});var l=[a];return e.cause!=null&&l.push(...this.convertToExceptionList(e.cause,V({},n,{handled:!0}))),l}buildParsingContext(e){var n;return{chunkIdMap:ij(this.stackParser),skipFirstLines:(n=e.skipFirstLines)!==null&&n!==void 0?n:1}}buildCoercingContext(e,n,s){s===void 0&&(s=0);var r=(i,a)=>{if(a<=4){var l=this.buildCoercingContext(e,n,a);return this.applyCoercers(i,l)}};return V({},n,{syntheticException:s==0?n.syntheticException:void 0,mechanism:e,apply:i=>r(i,s),next:i=>r(i,s+1)})}}var Bs="?";function Al(t,e,n,s,r){var i={platform:t,filename:e,function:n==="<anonymous>"?Bs:n,in_app:!0};return F(s)||(i.lineno=s),F(r)||(i.colno=r),i}var mg=(t,e)=>{var n=t.indexOf("safari-extension")!==-1,s=t.indexOf("safari-web-extension")!==-1;return n||s?[t.indexOf("@")!==-1?t.split("@")[0]:Bs,n?"safari-extension:"+e:"safari-web-extension:"+e]:[t,e]},lj=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,cj=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,uj=/\((\S*)(?::(\d+))(?::(\d+))\)/,dj=(t,e)=>{var n=lj.exec(t);if(n){var[,s,r,i]=n;return Al(e,s,Bs,+r,+i)}var a=cj.exec(t);if(a){if(a[2]&&a[2].indexOf("eval")===0){var l=uj.exec(a[2]);l&&(a[2]=l[1],a[3]=l[2],a[4]=l[3])}var[c,u]=mg(a[1]||Bs,a[2]);return Al(e,u,c,a[3]?+a[3]:void 0,a[4]?+a[4]:void 0)}},hj=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,pj=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,fj=(t,e)=>{var n=hj.exec(t);if(n){if(n[3]&&n[3].indexOf(" > eval")>-1){var s=pj.exec(n[3]);s&&(n[1]=n[1]||"eval",n[3]=s[1],n[4]=s[2],n[5]="")}var r=n[3],i=n[1]||Bs;return[i,r]=mg(i,r),Al(e,r,i,n[4]?+n[4]:void 0,n[5]?+n[5]:void 0)}},Fd=/\(error: (.*)\)/,$d=50;function mj(){return function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return function(r,i){i===void 0&&(i=0);for(var a=[],l=r.split(`
`),c=i;c<l.length;c++){var u=l[c];if(!(u.length>1024)){var d=Fd.test(u)?u.replace(Fd,"$1"):u;if(!d.match(/\S*Error: /)){for(var h of n){var p=h(d,t);if(p){a.push(p);break}}if(a.length>=$d)break}}}return function(m){if(!m.length)return[];var y=Array.from(m);return y.reverse(),y.slice(0,$d).map(_=>{return V({},_,{filename:_.filename||(x=y,x[x.length-1]||{}).filename,function:_.function||Bs});var x})}(a)}}("web:javascript",dj,fj)}class gj{match(e){return this.isDOMException(e)||this.isDOMError(e)}coerce(e,n){var s=Ie(e.stack);return{type:this.getType(e),value:this.getValue(e),stack:s?e.stack:void 0,cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return this.isDOMError(e)?"DOMError":"DOMException"}getValue(e){var n=e.name||(this.isDOMError(e)?"DOMError":"DOMException");return e.message?n+": "+e.message:n}isDOMException(e){return hi(e,"DOMException")}isDOMError(e){return hi(e,"DOMError")}}class vj{match(e){return(n=>n instanceof Error)(e)}coerce(e,n){return{type:this.getType(e),value:this.getMessage(e,n),stack:this.getStack(e),cause:e.cause?n.next(e.cause):void 0,synthetic:!1}}getType(e){return e.name||e.constructor.name}getMessage(e,n){var s=e.message;return s.error&&typeof s.error.message=="string"?String(s.error.message):String(s)}getStack(e){return e.stacktrace||e.stack||void 0}}class _j{constructor(){}match(e){return hi(e,"ErrorEvent")&&e.error!=null}coerce(e,n){var s,r=n.apply(e.error);return r||{type:"ErrorEvent",value:e.message,stack:(s=n.syntheticException)==null?void 0:s.stack,synthetic:!0}}}var yj=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;class xj{match(e){return typeof e=="string"}coerce(e,n){var s,[r,i]=this.getInfos(e);return{type:r??"Error",value:i??e,stack:(s=n.syntheticException)==null?void 0:s.stack,synthetic:!0}}getInfos(e){var n="Error",s=e,r=e.match(yj);return r&&(n=r[1],s=r[2]),[n,s]}}var bj=["fatal","error","warning","log","info","debug"];function gg(t,e){e===void 0&&(e=40);var n=Object.keys(t);if(n.sort(),!n.length)return"[object has no keys]";for(var s=n.length;s>0;s--){var r=n.slice(0,s).join(", ");if(!(r.length>e))return s===n.length||r.length<=e?r:r.slice(0,e)+"..."}return""}class wj{match(e){return typeof e=="object"&&e!==null}coerce(e,n){var s,r=this.getErrorPropertyFromObject(e);return r?n.apply(r):{type:this.getType(e),value:this.getValue(e),stack:(s=n.syntheticException)==null?void 0:s.stack,level:this.isSeverityLevel(e.level)?e.level:"error",synthetic:!0}}getType(e){return Jm(e)?e.constructor.name:"Error"}getValue(e){if("name"in e&&typeof e.name=="string"){var n="'"+e.name+"' captured as exception";return"message"in e&&typeof e.message=="string"&&(n+=" with message: '"+e.message+"'"),n}if("message"in e&&typeof e.message=="string")return e.message;var s=this.getObjectClassName(e);return(s&&s!=="Object"?"'"+s+"'":"Object")+" captured as exception with keys: "+gg(e)}isSeverityLevel(e){return Ie(e)&&!Tl(e)&&bj.indexOf(e)>=0}getErrorPropertyFromObject(e){for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var s=e[n];if(oj(s))return s}}getObjectClassName(e){try{var n=Object.getPrototypeOf(e);return n?n.constructor.name:void 0}catch{return}}}class Ej{match(e){return Jm(e)}coerce(e,n){var s,r=e.constructor.name;return{type:r,value:r+" captured as exception with keys: "+gg(e),stack:(s=n.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class jj{match(e){return Pl(e)}coerce(e,n){var s;return{type:"Error",value:"Primitive value captured as exception: "+String(e),stack:(s=n.syntheticException)==null?void 0:s.stack,synthetic:!0}}}class Tj{match(e){return hi(e,"PromiseRejectionEvent")}coerce(e,n){var s,r=this.getUnhandledRejectionReason(e);return Pl(r)?{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(r),stack:(s=n.syntheticException)==null?void 0:s.stack,synthetic:!0}:n.apply(r)}getUnhandledRejectionReason(e){if(Pl(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}}var vg=function(t,e){var{debugEnabled:n}=e===void 0?{}:e,s={k:function(r){if(R&&(_n.DEBUG||G.POSTHOG_DEBUG||n)&&!F(R.console)&&R.console){for(var i=("__rrweb_original__"in R.console[r])?R.console[r].__rrweb_original__:R.console[r],a=arguments.length,l=new Array(a>1?a-1:0),c=1;c<a;c++)l[c-1]=arguments[c];i(t,...l)}},info:function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];s.k("log",...i)},warn:function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];s.k("warn",...i)},error:function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];s.k("error",...i)},critical:function(){for(var r=arguments.length,i=new Array(r),a=0;a<r;a++)i[a]=arguments[a];console.error(t,...i)},uninitializedWarning:r=>{s.error("You must initialize PostHog before calling "+r)},createLogger:(r,i)=>vg(t+" "+r,i)};return s},$=vg("[PostHog.js]"),je=$.createLogger,Pj=je("[ExternalScriptsLoader]"),Bd=(t,e,n)=>{if(t.config.disable_external_dependency_loading)return Pj.warn(e+" was requested but loading of external scripts is disabled."),n("Loading of external scripts is disabled");var s=N?.querySelectorAll("script");if(s){for(var r,i=function(){if(s[a].src===e){var c=s[a];return c.__posthog_loading_callback_fired?{v:n()}:(c.addEventListener("load",u=>{c.__posthog_loading_callback_fired=!0,n(void 0,u)}),c.onerror=u=>n(u),{v:void 0})}},a=0;a<s.length;a++)if(r=i())return r.v}var l=()=>{if(!N)return n("document not found");var c=N.createElement("script");if(c.type="text/javascript",c.crossOrigin="anonymous",c.src=e,c.onload=h=>{c.__posthog_loading_callback_fired=!0,n(void 0,h)},c.onerror=h=>n(h),t.config.prepare_external_dependency_script&&(c=t.config.prepare_external_dependency_script(c)),!c)return n("prepare_external_dependency_script returned null");if(t.config.external_scripts_inject_target==="head")N.head.appendChild(c);else{var u,d=N.querySelectorAll("body > script");d.length>0?(u=d[0].parentNode)==null||u.insertBefore(c,d[0]):N.body.appendChild(c)}};N!=null&&N.body?l():N?.addEventListener("DOMContentLoaded",l)};G.__PosthogExtensions__=G.__PosthogExtensions__||{},G.__PosthogExtensions__.loadExternalDependency=(t,e,n)=>{var s="/static/"+e+".js?v="+t.version;if(e==="remote-config"&&(s="/array/"+t.config.token+"/config.js"),e==="toolbar"){var r=3e5;s=s+"&t="+Math.floor(Date.now()/r)*r}var i=t.requestRouter.endpointFor("assets",s);Bd(t,i,n)},G.__PosthogExtensions__.loadSiteApp=(t,e,n)=>{var s=t.requestRouter.endpointFor("api",e);Bd(t,s,n)};var fi={};function Vn(t,e,n){if(ue(t)){if(Ad&&t.forEach===Ad)t.forEach(e,n);else if("length"in t&&t.length===+t.length){for(var s=0,r=t.length;s<r;s++)if(s in t&&e.call(n,t[s],s)===fi)return}}}function ge(t,e,n){if(!se(t)){if(ue(t))return Vn(t,e,n);if(HE(t)){for(var s of t.entries())if(e.call(n,s[1],s[0])===fi)return}else for(var r in t)if(Zm.call(t,r)&&e.call(n,t[r],r)===fi)return}}var Re=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return Vn(n,function(r){for(var i in r)r[i]!==void 0&&(t[i]=r[i])}),t},zs=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),s=1;s<e;s++)n[s-1]=arguments[s];return Vn(n,function(r){Vn(r,function(i){t.push(i)})}),t};function Xo(t){for(var e=Object.keys(t),n=e.length,s=new Array(n);n--;)s[n]=[e[n],t[e[n]]];return s}var zd=function(t){try{return t()}catch{return}},kj=function(t){return function(){try{for(var e=arguments.length,n=new Array(e),s=0;s<e;s++)n[s]=arguments[s];return t.apply(this,n)}catch(r){$.critical("Implementation error. Please turn on debug mode and open a ticket on https://app.posthog.com/home#panel=support%3Asupport%3A."),$.critical(r)}}},Hc=function(t){var e={};return ge(t,function(n,s){(Ie(n)&&n.length>0||Pn(n))&&(e[s]=n)}),e};function Sj(t,e){return n=t,s=i=>Ie(i)&&!Ht(e)?i.slice(0,e):i,r=new Set,function i(a,l){return a!==Object(a)?s?s(a,l):a:r.has(a)?void 0:(r.add(a),ue(a)?(c=[],Vn(a,u=>{c.push(i(u))})):(c={},ge(a,(u,d)=>{r.has(u)||(c[d]=i(u,d))})),c);var c}(n);var n,s,r}var Rj=["herokuapp.com","vercel.app","netlify.app"];function Aj(t){var e=t?.hostname;if(!Ie(e))return!1;var n=e.split(".").slice(-2).join(".");for(var s of Rj)if(n===s)return!1;return!0}function _g(t,e){for(var n=0;n<t.length;n++)if(e(t[n]))return t[n]}function Ce(t,e,n,s){var{capture:r=!1,passive:i=!0}=s??{};t?.addEventListener(e,n,{capture:r,passive:i})}function yg(t){return t.name==="ph_toolbar_internal"}var xg="$people_distinct_id",br="__alias",wr="__timers",Ud="$autocapture_disabled_server_side",Cl="$heatmaps_enabled_server_side",Hd="$exception_capture_enabled_server_side",Il="$error_tracking_suppression_rules",Wd="$error_tracking_capture_extension_exceptions",Gd="$web_vitals_enabled_server_side",bg="$dead_clicks_enabled_server_side",Kd="$product_tours_enabled_server_side",qd="$web_vitals_allowed_metrics",Oo="$session_recording_remote_config",mi="$sesid",wg="$session_is_sampled",Ps="$enabled_feature_flags",Er="$early_access_features",Ol="$feature_flag_details",jr="$stored_person_properties",Zn="$stored_group_properties",Dl="$surveys",gi="$flag_call_reported",Ll="$feature_flag_errors",Yt="$user_state",Ml="$client_session_props",Nl="$capture_rate_limit",Vl="$initial_campaign_params",Fl="$initial_referrer_info",vi="$initial_person_info",_i="$epp",Eg="__POSTHOG_TOOLBAR__",ur="$posthog_cookieless",Cj=[xg,br,"__cmpns",wr,"$session_recording_enabled_server_side",Cl,mi,Ps,Il,Yt,Er,Ol,Zn,jr,Dl,gi,Ll,Ml,Nl,Vl,Fl,_i,vi];Math.trunc||(Math.trunc=function(t){return t<0?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Pn(t)&&isFinite(t)&&Math.floor(t)===t});var Yd="0123456789abcdef";class yi{constructor(e){if(this.bytes=e,e.length!==16)throw new TypeError("not 128-bit length")}static fromFieldsV7(e,n,s,r){if(!Number.isInteger(e)||!Number.isInteger(n)||!Number.isInteger(s)||!Number.isInteger(r)||e<0||n<0||s<0||r<0||e>0xffffffffffff||n>4095||s>1073741823||r>4294967295)throw new RangeError("invalid field value");var i=new Uint8Array(16);return i[0]=e/Math.pow(2,40),i[1]=e/Math.pow(2,32),i[2]=e/Math.pow(2,24),i[3]=e/Math.pow(2,16),i[4]=e/Math.pow(2,8),i[5]=e,i[6]=112|n>>>8,i[7]=n,i[8]=128|s>>>24,i[9]=s>>>16,i[10]=s>>>8,i[11]=s,i[12]=r>>>24,i[13]=r>>>16,i[14]=r>>>8,i[15]=r,new yi(i)}toString(){for(var e="",n=0;n<this.bytes.length;n++)e=e+Yd.charAt(this.bytes[n]>>>4)+Yd.charAt(15&this.bytes[n]),n!==3&&n!==5&&n!==7&&n!==9||(e+="-");if(e.length!==36)throw new Error("Invalid UUIDv7 was generated");return e}clone(){return new yi(this.bytes.slice(0))}equals(e){return this.compareTo(e)===0}compareTo(e){for(var n=0;n<16;n++){var s=this.bytes[n]-e.bytes[n];if(s!==0)return Math.sign(s)}return 0}}class Ij{constructor(){this.P=0,this.T=0,this.I=new Oj}generate(){var e=this.generateOrAbort();if(F(e)){this.P=0;var n=this.generateOrAbort();if(F(n))throw new Error("Could not generate UUID after timestamp reset");return n}return e}generateOrAbort(){var e=Date.now();if(e>this.P)this.P=e,this.C();else{if(!(e+1e4>this.P))return;this.T++,this.T>4398046511103&&(this.P++,this.C())}return yi.fromFieldsV7(this.P,Math.trunc(this.T/Math.pow(2,30)),this.T&Math.pow(2,30)-1,this.I.nextUint32())}C(){this.T=1024*this.I.nextUint32()+(1023&this.I.nextUint32())}}var Xd,jg=t=>{if(typeof UUIDV7_DENY_WEAK_RNG<"u"&&UUIDV7_DENY_WEAK_RNG)throw new Error("no cryptographically strong RNG available");for(var e=0;e<t.length;e++)t[e]=65536*Math.trunc(65536*Math.random())+Math.trunc(65536*Math.random());return t};R&&!F(R.crypto)&&crypto.getRandomValues&&(jg=t=>crypto.getRandomValues(t));class Oj{constructor(){this.R=new Uint32Array(8),this.F=1/0}nextUint32(){return this.F>=this.R.length&&(jg(this.R),this.F=0),this.R[this.F++]}}var Nn=()=>Dj().toString(),Dj=()=>(Xd||(Xd=new Ij)).generate(),dr="",Lj=/[a-z0-9][a-z0-9-]+\.[a-z]{2,}$/i;function Mj(t,e){if(e){var n=function(r,i){if(i===void 0&&(i=N),dr)return dr;if(!i||["localhost","127.0.0.1"].includes(r))return"";for(var a=r.split("."),l=Math.min(a.length,8),c="dmn_chk_"+Nn();!dr&&l--;){var u=a.slice(l).join("."),d=c+"=1;domain=."+u+";path=/";i.cookie=d+";max-age=3",i.cookie.includes(c)&&(i.cookie=d+";max-age=0",dr=u)}return dr}(t);if(!n){var s=(r=>{var i=r.match(Lj);return i?i[0]:""})(t);s!==n&&$.info("Warning: cookie subdomain discovery mismatch",s,n),n=s}return n?"; domain=."+n:""}return""}var Xt={O:()=>!!N,M:function(t){$.error("cookieStore error: "+t)},A:function(t){if(N){try{for(var e=t+"=",n=N.cookie.split(";").filter(i=>i.length),s=0;s<n.length;s++){for(var r=n[s];r.charAt(0)==" ";)r=r.substring(1,r.length);if(r.indexOf(e)===0)return decodeURIComponent(r.substring(e.length,r.length))}}catch{}return null}},j:function(t){var e;try{e=JSON.parse(Xt.A(t))||{}}catch{}return e},D:function(t,e,n,s,r){if(N)try{var i="",a="",l=Mj(N.location.hostname,s);if(n){var c=new Date;c.setTime(c.getTime()+24*n*60*60*1e3),i="; expires="+c.toUTCString()}r&&(a="; secure");var u=t+"="+encodeURIComponent(JSON.stringify(e))+i+"; SameSite=Lax; path=/"+l+a;return u.length>3686.4&&$.warn("cookieStore warning: large cookie, len="+u.length),N.cookie=u,u}catch{return}},L:function(t,e){if(N!=null&&N.cookie)try{Xt.D(t,"",-1,e)}catch{return}}},wa=null,we={O:function(){if(!Ht(wa))return wa;var t=!0;if(F(R))t=!1;else try{var e="__mplssupport__";we.D(e,"xyz"),we.A(e)!=='"xyz"'&&(t=!1),we.L(e)}catch{t=!1}return t||$.error("localStorage unsupported; falling back to cookie store"),wa=t,t},M:function(t){$.error("localStorage error: "+t)},A:function(t){try{return R?.localStorage.getItem(t)}catch(e){we.M(e)}return null},j:function(t){try{return JSON.parse(we.A(t))||{}}catch{}return null},D:function(t,e){try{R?.localStorage.setItem(t,JSON.stringify(e))}catch(n){we.M(n)}},L:function(t){try{R?.localStorage.removeItem(t)}catch(e){we.M(e)}}},Nj=["$device_id","distinct_id",mi,wg,_i,vi,Yt],Do={},Vj={O:function(){return!0},M:function(t){$.error("memoryStorage error: "+t)},A:function(t){return Do[t]||null},j:function(t){return Do[t]||null},D:function(t,e){Do[t]=e},L:function(t){delete Do[t]}},qn=null,Ve={O:function(){if(!Ht(qn))return qn;if(qn=!0,F(R))qn=!1;else try{var t="__support__";Ve.D(t,"xyz"),Ve.A(t)!=='"xyz"'&&(qn=!1),Ve.L(t)}catch{qn=!1}return qn},M:function(t){$.error("sessionStorage error: ",t)},A:function(t){try{return R?.sessionStorage.getItem(t)}catch(e){Ve.M(e)}return null},j:function(t){try{return JSON.parse(Ve.A(t))||null}catch{}return null},D:function(t,e){try{R?.sessionStorage.setItem(t,JSON.stringify(e))}catch(n){Ve.M(n)}},L:function(t){try{R?.sessionStorage.removeItem(t)}catch(e){Ve.M(e)}}},xn=function(t){return t[t.PENDING=-1]="PENDING",t[t.DENIED=0]="DENIED",t[t.GRANTED=1]="GRANTED",t}({});class Fj{constructor(e){this._instance=e}get N(){return this._instance.config}get consent(){return this.U()?xn.DENIED:this.H}isOptedOut(){return this.N.cookieless_mode==="always"||this.consent===xn.DENIED||this.consent===xn.PENDING&&(this.N.opt_out_capturing_by_default||this.N.cookieless_mode==="on_reject")}isOptedIn(){return!this.isOptedOut()}isExplicitlyOptedOut(){return this.consent===xn.DENIED}optInOut(e){this.B.D(this.q,e?1:0,this.N.cookie_expiration,this.N.cross_subdomain_cookie,this.N.secure_cookie)}reset(){this.B.L(this.q,this.N.cross_subdomain_cookie)}get q(){var{token:e,opt_out_capturing_cookie_prefix:n,consent_persistence_name:s}=this._instance.config;return s||(n?n+e:"__ph_opt_in_out_"+e)}get H(){var e=this.B.A(this.q);return ya(e)?xn.GRANTED:te(KE,e)?xn.DENIED:xn.PENDING}get B(){if(!this.W){var e=this.N.opt_out_capturing_persistence_type;this.W=e==="localStorage"?we:Xt;var n=e==="localStorage"?Xt:we;n.A(this.q)&&(this.W.A(this.q)||this.optInOut(ya(n.A(this.q))),n.L(this.q,this.N.cross_subdomain_cookie))}return this.W}U(){return!!this.N.respect_dnt&&!!_g([St?.doNotTrack,St?.msDoNotTrack,G.doNotTrack],e=>ya(e))}}var Lo=je("[Dead Clicks]"),$j=()=>!0,Bj=t=>{var e,n=!((e=t.instance.persistence)==null||!e.get_property(bg)),s=t.instance.config.capture_dead_clicks;return En(s)?s:!!Le(s)||n};class Zd{get lazyLoadedDeadClicksAutocapture(){return this.G}constructor(e,n,s){this.instance=e,this.isEnabled=n,this.onCapture=s,this.startIfEnabledOrStop()}onRemoteConfig(e){"captureDeadClicks"in e&&(this.instance.persistence&&this.instance.persistence.register({[bg]:e.captureDeadClicks}),this.startIfEnabledOrStop())}startIfEnabledOrStop(){this.isEnabled(this)?this.V(()=>{this.J()}):this.stop()}V(e){var n,s;(n=G.__PosthogExtensions__)!=null&&n.initDeadClicksAutocapture&&e(),(s=G.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this.instance,"dead-clicks-autocapture",r=>{r?Lo.error("failed to load script",r):e()})}J(){var e;if(N){if(!this.G&&(e=G.__PosthogExtensions__)!=null&&e.initDeadClicksAutocapture){var n=Le(this.instance.config.capture_dead_clicks)?this.instance.config.capture_dead_clicks:{};n.__onCapture=this.onCapture,this.G=G.__PosthogExtensions__.initDeadClicksAutocapture(this.instance,n),this.G.start(N),Lo.info("starting...")}}else Lo.error("`document` not found. Cannot start.")}stop(){this.G&&(this.G.stop(),this.G=void 0,Lo.info("stopping..."))}}var Ea=je("[SegmentIntegration]");function zj(t,e){var n=t.config.segment;if(!n)return e();(function(s,r){var i=s.config.segment;if(!i)return r();var a=c=>{var u=()=>c.anonymousId()||Nn();s.config.get_device_id=u,c.id()&&(s.register({distinct_id:c.id(),$device_id:u()}),s.persistence.set_property(Yt,"identified")),r()},l=i.user();"then"in l&&bn(l.then)?l.then(a):a(l)})(t,()=>{n.register((s=>{Promise&&Promise.resolve||Ea.warn("This browser does not have Promise support, and can not use the segment integration");var r=(i,a)=>{if(!a)return i;i.event.userId||i.event.anonymousId===s.get_distinct_id()||(Ea.info("No userId set, resetting PostHog"),s.reset()),i.event.userId&&i.event.userId!==s.get_distinct_id()&&(Ea.info("UserId set, identifying with PostHog"),s.identify(i.event.userId));var l=s.calculateEventProperties(a,i.event.properties);return i.event.properties=Object.assign({},l,i.event.properties),i};return{name:"PostHog JS",type:"enrichment",version:"1.0.0",isLoaded:()=>!0,load:()=>Promise.resolve(),track:i=>r(i,i.event.event),page:i=>r(i,"$pageview"),identify:i=>r(i,"$identify"),screen:i=>r(i,"$screen")}})(t)).then(()=>{e()})})}var Tg="posthog-js";function Pg(t,e){var{organization:n,projectId:s,prefix:r,severityAllowList:i=["error"],sendExceptionsToPostHog:a=!0}=e===void 0?{}:e;return l=>{var c,u,d,h,p;if(!(i==="*"||i.includes(l.level))||!t.__loaded)return l;l.tags||(l.tags={});var m=t.requestRouter.endpointFor("ui","/project/"+t.config.token+"/person/"+t.get_distinct_id());l.tags["PostHog Person URL"]=m,t.sessionRecordingStarted()&&(l.tags["PostHog Recording URL"]=t.get_session_replay_url({withTimestamp:!0}));var y=((c=l.exception)==null?void 0:c.values)||[],_=y.map(b=>V({},b,{stacktrace:b.stacktrace?V({},b.stacktrace,{type:"raw",frames:(b.stacktrace.frames||[]).map(w=>V({},w,{platform:"web:javascript"}))}):void 0})),x={$exception_message:((u=y[0])==null?void 0:u.value)||l.message,$exception_type:(d=y[0])==null?void 0:d.type,$exception_level:l.level,$exception_list:_,$sentry_event_id:l.event_id,$sentry_exception:l.exception,$sentry_exception_message:((h=y[0])==null?void 0:h.value)||l.message,$sentry_exception_type:(p=y[0])==null?void 0:p.type,$sentry_tags:l.tags};return n&&s&&(x.$sentry_url=(r||"https://sentry.io/organizations/")+n+"/issues/?project="+s+"&query="+l.event_id),a&&t.exceptions.sendExceptionEvent(x),l}}class Uj{constructor(e,n,s,r,i,a){this.name=Tg,this.setupOnce=function(l){l(Pg(e,{organization:n,projectId:s,prefix:r,severityAllowList:i,sendExceptionsToPostHog:a==null||a}))}}}var xi=t=>{var e=N?.createElement("a");return F(e)?null:(e.href=t,e)},Hj=function(t,e){var n,s;e===void 0&&(e="&");var r=[];return ge(t,function(i,a){F(i)||F(a)||a==="undefined"||(n=encodeURIComponent((l=>l instanceof File)(i)?i.name:i.toString()),s=encodeURIComponent(a),r[r.length]=s+"="+n)}),r.join(e)},bi=function(t,e){for(var n,s=((t.split("#")[0]||"").split(/\?(.*)/)[1]||"").replace(/^\?+/g,"").split("&"),r=0;r<s.length;r++){var i=s[r].split("=");if(i[0]===e){n=i;break}}if(!ue(n)||n.length<2)return"";var a=n[1];try{a=decodeURIComponent(a)}catch{$.error("Skipping decoding for malformed query param: "+a)}return a.replace(/\+/g," ")},Xr=function(t,e,n){if(!t||!e||!e.length)return t;for(var s=t.split("#"),r=s[0]||"",i=s[1],a=r.split("?"),l=a[1],c=a[0],u=(l||"").split("&"),d=[],h=0;h<u.length;h++){var p=u[h].split("=");ue(p)&&(e.includes(p[0])?d.push(p[0]+"="+n):d.push(u[h]))}var m=c;return l!=null&&(m+="?"+d.join("&")),i!=null&&(m+="#"+i),m},wi=function(t,e){var n=t.match(new RegExp(e+"=([^&]*)"));return n?n[1]:null},Wj=R!=null&&R.location?wi(R.location.hash,"__posthog")||wi(location.hash,"state"):null,Jd="_postHogToolbarParams",Qd=je("[Toolbar]"),On=function(t){return t[t.UNINITIALIZED=0]="UNINITIALIZED",t[t.LOADING=1]="LOADING",t[t.LOADED=2]="LOADED",t}(On||{});class Gj{constructor(e){this.instance=e}K(e){G.ph_toolbar_state=e}Y(){var e;return(e=G.ph_toolbar_state)!==null&&e!==void 0?e:On.UNINITIALIZED}maybeLoadToolbar(e,n,s){if(e===void 0&&(e=void 0),n===void 0&&(n=void 0),s===void 0&&(s=void 0),yg(this.instance.config)||!R||!N)return!1;e=e??R.location,s=s??R.history;try{if(!n){try{R.localStorage.setItem("test","test"),R.localStorage.removeItem("test")}catch{return!1}n=R?.localStorage}var r,i=Wj||wi(e.hash,"__posthog")||wi(e.hash,"state"),a=i?zd(()=>JSON.parse(atob(decodeURIComponent(i))))||zd(()=>JSON.parse(decodeURIComponent(i))):null;return a&&a.action==="ph_authorize"?((r=a).source="url",r&&Object.keys(r).length>0&&(a.desiredHash?e.hash=a.desiredHash:s?s.replaceState(s.state,"",e.pathname+e.search):e.hash="")):((r=JSON.parse(n.getItem(Jd)||"{}")).source="localstorage",delete r.userIntent),!(!r.token||this.instance.config.token!==r.token)&&(this.loadToolbar(r),!0)}catch{return!1}}X(e){var n=G.ph_load_toolbar||G.ph_load_editor;!se(n)&&bn(n)?n(e,this.instance):Qd.warn("No toolbar load function found")}loadToolbar(e){var n=!(N==null||!N.getElementById(Eg));if(!R||n)return!1;var s=this.instance.requestRouter.region==="custom"&&this.instance.config.advanced_disable_toolbar_metrics,r=V({token:this.instance.config.token},e,{apiURL:this.instance.requestRouter.endpointFor("ui")},s?{instrument:!1}:{});if(R.localStorage.setItem(Jd,JSON.stringify(V({},r,{source:void 0}))),this.Y()===On.LOADED)this.X(r);else if(this.Y()===On.UNINITIALIZED){var i;this.K(On.LOADING),(i=G.__PosthogExtensions__)==null||i.loadExternalDependency==null||i.loadExternalDependency(this.instance,"toolbar",a=>{if(a)return Qd.error("[Toolbar] Failed to load",a),void this.K(On.UNINITIALIZED);this.K(On.LOADED),this.X(r)}),Ce(R,"turbolinks:load",()=>{this.K(On.UNINITIALIZED),this.loadToolbar(r)})}return!0}Z(e){return this.loadToolbar(e)}maybeLoadEditor(e,n,s){return e===void 0&&(e=void 0),n===void 0&&(n=void 0),s===void 0&&(s=void 0),this.maybeLoadToolbar(e,n,s)}}class eh{constructor(e){this.tt=(n,s,r)=>{r&&(r.noSessionId||r.activityTimeout||r.sessionPastMaximumLength)&&($.info("[PageViewManager] Session rotated, clearing pageview state",{sessionId:n,changeReason:r}),this.it=void 0,this._instance.scrollManager.resetContext())},this._instance=e,this.et()}et(){var e;this.rt=(e=this._instance.sessionManager)==null?void 0:e.onSessionId(this.tt)}destroy(){var e;(e=this.rt)==null||e.call(this),this.rt=void 0}doPageView(e,n){var s,r=this.st(e,n);return this.it={pathname:(s=R?.location.pathname)!==null&&s!==void 0?s:"",pageViewId:n,timestamp:e},this._instance.scrollManager.resetContext(),r}doPageLeave(e){var n;return this.st(e,(n=this.it)==null?void 0:n.pageViewId)}doEvent(){var e;return{$pageview_id:(e=this.it)==null?void 0:e.pageViewId}}st(e,n){var s=this.it;if(!s)return{$pageview_id:n};var r={$pageview_id:n,$prev_pageview_id:s.pageViewId},i=this._instance.scrollManager.getContext();if(i&&!this._instance.config.disable_scroll_properties){var{maxScrollHeight:a,lastScrollY:l,maxScrollY:c,maxContentHeight:u,lastContentY:d,maxContentY:h}=i;if(!(F(a)||F(l)||F(c)||F(u)||F(d)||F(h))){a=Math.ceil(a),l=Math.ceil(l),c=Math.ceil(c),u=Math.ceil(u),d=Math.ceil(d),h=Math.ceil(h);var p=a<=1?1:en(l/a,0,1,$),m=a<=1?1:en(c/a,0,1,$),y=u<=1?1:en(d/u,0,1,$),_=u<=1?1:en(h/u,0,1,$);r=Re(r,{$prev_pageview_last_scroll:l,$prev_pageview_last_scroll_percentage:p,$prev_pageview_max_scroll:c,$prev_pageview_max_scroll_percentage:m,$prev_pageview_last_content:d,$prev_pageview_last_content_percentage:y,$prev_pageview_max_content:h,$prev_pageview_max_content_percentage:_})}}return s.pathname&&(r.$prev_pageview_pathname=s.pathname),s.timestamp&&(r.$prev_pageview_duration=(e.getTime()-s.timestamp.getTime())/1e3),r}}var Zt=function(t){return t.GZipJS="gzip-js",t.Base64="base64",t}({}),Lt=Uint8Array,wt=Uint16Array,Us=Uint32Array,Wc=new Lt([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),Gc=new Lt([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),th=new Lt([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),kg=function(t,e){for(var n=new wt(31),s=0;s<31;++s)n[s]=e+=1<<t[s-1];var r=new Us(n[30]);for(s=1;s<30;++s)for(var i=n[s];i<n[s+1];++i)r[i]=i-n[s]<<5|s;return[n,r]},Sg=kg(Wc,2),Kj=Sg[0],$l=Sg[1];Kj[28]=258,$l[258]=28;for(var nh=kg(Gc,0)[1],Rg=new wt(32768),be=0;be<32768;++be){var Yn=(43690&be)>>>1|(21845&be)<<1;Yn=(61680&(Yn=(52428&Yn)>>>2|(13107&Yn)<<2))>>>4|(3855&Yn)<<4,Rg[be]=((65280&Yn)>>>8|(255&Yn)<<8)>>>1}var Dr=function(t,e,n){for(var s=t.length,r=0,i=new wt(e);r<s;++r)++i[t[r]-1];var a,l=new wt(e);for(r=0;r<e;++r)l[r]=l[r-1]+i[r-1]<<1;for(a=new wt(s),r=0;r<s;++r)a[r]=Rg[l[t[r]-1]++]>>>15-t[r];return a},as=new Lt(288);for(be=0;be<144;++be)as[be]=8;for(be=144;be<256;++be)as[be]=9;for(be=256;be<280;++be)as[be]=7;for(be=280;be<288;++be)as[be]=8;var Ei=new Lt(32);for(be=0;be<32;++be)Ei[be]=5;var qj=Dr(as,9),Yj=Dr(Ei,5),Ag=function(t){return(t/8>>0)+(7&t&&1)},Cg=function(t,e,n){(n==null||n>t.length)&&(n=t.length);var s=new(t instanceof wt?wt:t instanceof Us?Us:Lt)(n-e);return s.set(t.subarray(e,n)),s},gn=function(t,e,n){n<<=7&e;var s=e/8>>0;t[s]|=n,t[s+1]|=n>>>8},hr=function(t,e,n){n<<=7&e;var s=e/8>>0;t[s]|=n,t[s+1]|=n>>>8,t[s+2]|=n>>>16},ja=function(t,e){for(var n=[],s=0;s<t.length;++s)t[s]&&n.push({s,f:t[s]});var r=n.length,i=n.slice();if(!r)return[new Lt(0),0];if(r==1){var a=new Lt(n[0].s+1);return a[n[0].s]=1,[a,1]}n.sort(function(j,P){return j.f-P.f}),n.push({s:-1,f:25001});var l=n[0],c=n[1],u=0,d=1,h=2;for(n[0]={s:-1,f:l.f+c.f,l,r:c};d!=r-1;)l=n[n[u].f<n[h].f?u++:h++],c=n[u!=d&&n[u].f<n[h].f?u++:h++],n[d++]={s:-1,f:l.f+c.f,l,r:c};var p=i[0].s;for(s=1;s<r;++s)i[s].s>p&&(p=i[s].s);var m=new wt(p+1),y=Bl(n[d-1],m,0);if(y>e){s=0;var _=0,x=y-e,b=1<<x;for(i.sort(function(j,P){return m[P.s]-m[j.s]||j.f-P.f});s<r;++s){var w=i[s].s;if(!(m[w]>e))break;_+=b-(1<<y-m[w]),m[w]=e}for(_>>>=x;_>0;){var E=i[s].s;m[E]<e?_-=1<<e-m[E]++-1:++s}for(;s>=0&&_;--s){var T=i[s].s;m[T]==e&&(--m[T],++_)}y=e}return[new Lt(m),y]},Bl=function(t,e,n){return t.s==-1?Math.max(Bl(t.l,e,n+1),Bl(t.r,e,n+1)):e[t.s]=n},sh=function(t){for(var e=t.length;e&&!t[--e];);for(var n=new wt(++e),s=0,r=t[0],i=1,a=function(c){n[s++]=c},l=1;l<=e;++l)if(t[l]==r&&l!=e)++i;else{if(!r&&i>2){for(;i>138;i-=138)a(32754);i>2&&(a(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(a(r),--i;i>6;i-=6)a(8304);i>2&&(a(i-3<<5|8208),i=0)}for(;i--;)a(r);i=1,r=t[l]}return[n.subarray(0,s),e]},pr=function(t,e){for(var n=0,s=0;s<e.length;++s)n+=t[s]*e[s];return n},zl=function(t,e,n){var s=n.length,r=Ag(e+2);t[r]=255&s,t[r+1]=s>>>8,t[r+2]=255^t[r],t[r+3]=255^t[r+1];for(var i=0;i<s;++i)t[r+i+4]=n[i];return 8*(r+4+s)},rh=function(t,e,n,s,r,i,a,l,c,u,d){gn(e,d++,n),++r[256];for(var h=ja(r,15),p=h[0],m=h[1],y=ja(i,15),_=y[0],x=y[1],b=sh(p),w=b[0],E=b[1],T=sh(_),j=T[0],P=T[1],k=new wt(19),S=0;S<w.length;++S)k[31&w[S]]++;for(S=0;S<j.length;++S)k[31&j[S]]++;for(var D=ja(k,7),A=D[0],B=D[1],M=19;M>4&&!A[th[M-1]];--M);var K,O,q,z,U=u+5<<3,C=pr(r,as)+pr(i,Ei)+a,I=pr(r,p)+pr(i,_)+a+14+3*M+pr(k,A)+(2*k[16]+3*k[17]+7*k[18]);if(U<=C&&U<=I)return zl(e,d,t.subarray(c,c+u));if(gn(e,d,1+(I<C)),d+=2,I<C){K=Dr(p,m),O=p,q=Dr(_,x),z=_;var ee=Dr(A,B);for(gn(e,d,E-257),gn(e,d+5,P-1),gn(e,d+10,M-4),d+=14,S=0;S<M;++S)gn(e,d+3*S,A[th[S]]);d+=3*M;for(var H=[w,j],Y=0;Y<2;++Y){var Z=H[Y];for(S=0;S<Z.length;++S){var oe=31&Z[S];gn(e,d,ee[oe]),d+=A[oe],oe>15&&(gn(e,d,Z[S]>>>5&127),d+=Z[S]>>>12)}}}else K=qj,O=as,q=Yj,z=Ei;for(S=0;S<l;++S)if(s[S]>255){oe=s[S]>>>18&31,hr(e,d,K[oe+257]),d+=O[oe+257],oe>7&&(gn(e,d,s[S]>>>23&31),d+=Wc[oe]);var De=31&s[S];hr(e,d,q[De]),d+=z[De],De>3&&(hr(e,d,s[S]>>>5&8191),d+=Gc[De])}else hr(e,d,K[s[S]]),d+=O[s[S]];return hr(e,d,K[256]),d+O[256]},Xj=new Us([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),Zj=function(){for(var t=new Us(256),e=0;e<256;++e){for(var n=e,s=9;--s;)n=(1&n&&3988292384)^n>>>1;t[e]=n}return t}(),Jj=function(t,e,n,s,r){return function(i,a,l,c,u,d){var h=i.length,p=new Lt(c+h+5*(1+Math.floor(h/7e3))+u),m=p.subarray(c,p.length-u),y=0;if(!a||h<8)for(var _=0;_<=h;_+=65535){var x=_+65535;x<h?y=zl(m,y,i.subarray(_,x)):(m[_]=d,y=zl(m,y,i.subarray(_,h)))}else{for(var b=Xj[a-1],w=b>>>13,E=8191&b,T=(1<<l)-1,j=new wt(32768),P=new wt(T+1),k=Math.ceil(l/3),S=2*k,D=function(ir){return(i[ir]^i[ir+1]<<k^i[ir+2]<<S)&T},A=new Us(25e3),B=new wt(288),M=new wt(32),K=0,O=0,q=(_=0,0),z=0,U=0;_<h;++_){var C=D(_),I=32767&_,ee=P[C];if(j[I]=ee,P[C]=I,z<=_){var H=h-_;if((K>7e3||q>24576)&&H>423){y=rh(i,m,0,A,B,M,O,q,U,_-U,y),q=K=O=0,U=_;for(var Y=0;Y<286;++Y)B[Y]=0;for(Y=0;Y<30;++Y)M[Y]=0}var Z=2,oe=0,De=E,ne=I-ee&32767;if(H>2&&C==D(_-ne))for(var _e=Math.min(w,H)-1,jt=Math.min(32767,_),pn=Math.min(258,H);ne<=jt&&--De&&I!=ee;){if(i[_+Z]==i[_+Z-ne]){for(var Be=0;Be<pn&&i[_+Be]==i[_+Be-ne];++Be);if(Be>Z){if(Z=Be,oe=ne,Be>_e)break;var sr=Math.min(ne,Be-2),kn=0;for(Y=0;Y<sr;++Y){var Gt=_-ne+Y+32768&32767,rr=Gt-j[Gt]+32768&32767;rr>kn&&(kn=rr,ee=Gt)}}}ne+=(I=ee)-(ee=j[I])+32768&32767}if(oe){A[q++]=268435456|$l[Z]<<18|nh[oe];var or=31&$l[Z],fn=31&nh[oe];O+=Wc[or]+Gc[fn],++B[257+or],++M[fn],z=_+Z,++K}else A[q++]=i[_],++B[i[_]]}}y=rh(i,m,d,A,B,M,O,q,U,_-U,y)}return Cg(p,0,c+Ag(y)+u)}(t,e.level==null?6:e.level,e.mem==null?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(t.length)))):12+e.mem,n,s,!0)},Ta=function(t,e,n){for(;n;++e)t[e]=n,n>>>=8};function Qj(t,e){e===void 0&&(e={});var n=function(){var l=4294967295;return{p:function(c){for(var u=l,d=0;d<c.length;++d)u=Zj[255&u^c[d]]^u>>>8;l=u},d:function(){return 4294967295^l}}}(),s=t.length;n.p(t);var r,i=Jj(t,e,10+((r=e).filename&&r.filename.length+1||0),8),a=i.length;return function(l,c){var u=c.filename;if(l[0]=31,l[1]=139,l[2]=8,l[8]=c.level<2?4:c.level==9?2:0,l[9]=3,c.mtime!=0&&Ta(l,4,Math.floor(new Date(c.mtime||Date.now())/1e3)),u){l[3]=8;for(var d=0;d<=u.length;++d)l[d+10]=u.charCodeAt(d)}}(i,e),Ta(i,a-8,n.d()),Ta(i,a-4,s),i}var eT=function(t){var e,n,s,r,i="";for(e=n=0,s=(t=(t+"").replace(/\r\n/g,`
`).replace(/\r/g,`
`)).length,r=0;r<s;r++){var a=t.charCodeAt(r),l=null;a<128?n++:l=a>127&&a<2048?String.fromCharCode(a>>6|192,63&a|128):String.fromCharCode(a>>12|224,a>>6&63|128,63&a|128),Ht(l)||(n>e&&(i+=t.substring(e,n)),i+=l,e=n=r+1)}return n>e&&(i+=t.substring(e,t.length)),i},tT=!!El||!!wl,oh="text/plain",ji=function(t,e,n){var s;n===void 0&&(n=!0);var[r,i]=t.split("?"),a=V({},e),l=(s=i?.split("&").map(u=>{var d,[h,p]=u.split("="),m=n&&(d=a[h])!==null&&d!==void 0?d:p;return delete a[h],h+"="+m}))!==null&&s!==void 0?s:[],c=Hj(a);return c&&l.push(c),r+"?"+l.join("&")},Tr=(t,e)=>JSON.stringify(t,(n,s)=>typeof s=="bigint"?s.toString():s,e),Pa=t=>{var{data:e,compression:n}=t;if(e){if(n===Zt.GZipJS){var s=Qj(function(c,u){var d=c.length;if(typeof TextEncoder<"u")return new TextEncoder().encode(c);for(var h=new Lt(c.length+(c.length>>>1)),p=0,m=function(b){h[p++]=b},y=0;y<d;++y){if(p+5>h.length){var _=new Lt(p+8+(d-y<<1));_.set(h),h=_}var x=c.charCodeAt(y);x<128||u?m(x):x<2048?(m(192|x>>>6),m(128|63&x)):x>55295&&x<57344?(m(240|(x=65536+(1047552&x)|1023&c.charCodeAt(++y))>>>18),m(128|x>>>12&63),m(128|x>>>6&63),m(128|63&x)):(m(224|x>>>12),m(128|x>>>6&63),m(128|63&x))}return Cg(h,0,p)}(Tr(e)),{mtime:0}),r=new Blob([s],{type:oh});return{contentType:oh,body:r,estimatedSize:r.size}}if(n===Zt.Base64){var i=function(c){var u,d,h,p,m,y="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_=0,x=0,b="",w=[];if(!c)return c;c=eT(c);do u=(m=c.charCodeAt(_++)<<16|c.charCodeAt(_++)<<8|c.charCodeAt(_++))>>18&63,d=m>>12&63,h=m>>6&63,p=63&m,w[x++]=y.charAt(u)+y.charAt(d)+y.charAt(h)+y.charAt(p);while(_<c.length);switch(b=w.join(""),c.length%3){case 1:b=b.slice(0,-2)+"==";break;case 2:b=b.slice(0,-1)+"="}return b}(Tr(e)),a=(c=>"data="+encodeURIComponent(typeof c=="string"?c:Tr(c)))(i);return{contentType:"application/x-www-form-urlencoded",body:a,estimatedSize:new Blob([a]).size}}var l=Tr(e);return{contentType:"application/json",body:l,estimatedSize:new Blob([l]).size}}},Zo=[];wl&&Zo.push({transport:"fetch",method:t=>{var e,n,{contentType:s,body:r,estimatedSize:i}=(e=Pa(t))!==null&&e!==void 0?e:{},a=new Headers;ge(t.headers,function(d,h){a.append(h,d)}),s&&a.append("Content-Type",s);var l=t.url,c=null;if(Id){var u=new Id;c={signal:u.signal,timeout:setTimeout(()=>u.abort(),t.timeout)}}wl(l,V({method:t?.method||"GET",headers:a,keepalive:t.method==="POST"&&(i||0)<52428.8,body:r,signal:(n=c)==null?void 0:n.signal},t.fetchOptions)).then(d=>d.text().then(h=>{var p={statusCode:d.status,text:h};if(d.status===200)try{p.json=JSON.parse(h)}catch(m){$.error(m)}t.callback==null||t.callback(p)})).catch(d=>{$.error(d),t.callback==null||t.callback({statusCode:0,error:d})}).finally(()=>c?clearTimeout(c.timeout):null)}}),El&&Zo.push({transport:"XHR",method:t=>{var e,n=new El;n.open(t.method||"GET",t.url,!0);var{contentType:s,body:r}=(e=Pa(t))!==null&&e!==void 0?e:{};ge(t.headers,function(i,a){n.setRequestHeader(a,i)}),s&&n.setRequestHeader("Content-Type",s),t.timeout&&(n.timeout=t.timeout),t.disableXHRCredentials||(n.withCredentials=!0),n.onreadystatechange=()=>{if(n.readyState===4){var i={statusCode:n.status,text:n.responseText};if(n.status===200)try{i.json=JSON.parse(n.responseText)}catch{}t.callback==null||t.callback(i)}},n.send(r)}}),St!=null&&St.sendBeacon&&Zo.push({transport:"sendBeacon",method:t=>{var e=ji(t.url,{beacon:"1"});try{var n,{contentType:s,body:r}=(n=Pa(t))!==null&&n!==void 0?n:{},i=typeof r=="string"?new Blob([r],{type:s}):r;St.sendBeacon(e,i)}catch{}}});var Ti=function(t,e){if(!function(n){try{new RegExp(n)}catch{return!1}return!0}(e))return!1;try{return new RegExp(e).test(t)}catch{return!1}};function ih(t,e,n){return Tr({distinct_id:t,userPropertiesToSet:e,userPropertiesToSetOnce:n})}var Ig={exact:(t,e)=>e.some(n=>t.some(s=>n===s)),is_not:(t,e)=>e.every(n=>t.every(s=>n!==s)),regex:(t,e)=>e.some(n=>t.some(s=>Ti(n,s))),not_regex:(t,e)=>e.every(n=>t.every(s=>!Ti(n,s))),icontains:(t,e)=>e.map(Mo).some(n=>t.map(Mo).some(s=>n.includes(s))),not_icontains:(t,e)=>e.map(Mo).every(n=>t.map(Mo).every(s=>!n.includes(s))),gt:(t,e)=>e.some(n=>{var s=parseFloat(n);return!isNaN(s)&&t.some(r=>s>parseFloat(r))}),lt:(t,e)=>e.some(n=>{var s=parseFloat(n);return!isNaN(s)&&t.some(r=>s<parseFloat(r))})},Mo=t=>t.toLowerCase();function Og(t,e){return!t||Object.entries(t).every(n=>{var[s,r]=n,i=e?.[s];if(F(i)||Ht(i))return!1;var a=[String(i)],l=Ig[r.operator];return!!l&&l(r.values,a)})}var ka=je("[Error tracking]");class nT{constructor(e){var n,s;this.nt=[],this.ot=new aj([new gj,new Tj,new _j,new vj,new Ej,new wj,new xj,new jj],mj()),this._instance=e,this.nt=(n=(s=this._instance.persistence)==null?void 0:s.get_property(Il))!==null&&n!==void 0?n:[]}onRemoteConfig(e){var n,s,r;if("errorTracking"in e){var i=(n=(s=e.errorTracking)==null?void 0:s.suppressionRules)!==null&&n!==void 0?n:[],a=(r=e.errorTracking)==null?void 0:r.captureExtensionExceptions;this.nt=i,this._instance.persistence&&this._instance.persistence.register({[Il]:this.nt,[Wd]:a})}}get ut(){var e,n=!!this._instance.get_property(Wd),s=this._instance.config.error_tracking.captureExtensionExceptions;return(e=s??n)!==null&&e!==void 0&&e}buildProperties(e,n){return this.ot.buildFromUnknown(e,{syntheticException:n?.syntheticException,mechanism:{handled:n?.handled}})}sendExceptionEvent(e){var n=e.$exception_list;if(this.ht(n)){if(this.dt(n))return void ka.info("Skipping exception capture because a suppression rule matched");if(!this.ut&&this.vt(n))return void ka.info("Skipping exception capture because it was thrown by an extension");if(!this._instance.config.error_tracking.__capturePostHogExceptions&&this.ct(n))return void ka.info("Skipping exception capture because it was thrown by the PostHog SDK")}return this._instance.capture("$exception",e,{_noTruncate:!0,_batchKey:"exceptionEvent",ft:!0})}dt(e){if(e.length===0)return!1;var n=e.reduce((s,r)=>{var{type:i,value:a}=r;return Ie(i)&&i.length>0&&s.$exception_types.push(i),Ie(a)&&a.length>0&&s.$exception_values.push(a),s},{$exception_types:[],$exception_values:[]});return this.nt.some(s=>{var r=s.values.map(i=>{var a,l=Ig[i.operator],c=ue(i.value)?i.value:[i.value],u=(a=n[i.key])!==null&&a!==void 0?a:[];return c.length>0&&l(c,u)});return s.type==="OR"?r.some(Boolean):r.every(Boolean)})}vt(e){return e.flatMap(n=>{var s,r;return(s=(r=n.stacktrace)==null?void 0:r.frames)!==null&&s!==void 0?s:[]}).some(n=>n.filename&&n.filename.startsWith("chrome-extension://"))}ct(e){if(e.length>0){var n,s,r,i,a=(n=(s=e[0].stacktrace)==null?void 0:s.frames)!==null&&n!==void 0?n:[],l=a[a.length-1];return(r=l==null||(i=l.filename)==null?void 0:i.includes("posthog.com/static"))!==null&&r!==void 0&&r}return!1}ht(e){return!se(e)&&ue(e)}}var No="https?://(.*)",Hs=["gclid","gclsrc","dclid","gbraid","wbraid","fbclid","msclkid","twclid","li_fat_id","igshid","ttclid","rdt_cid","epik","qclid","sccid","irclid","_kx"],sT=zs(["utm_source","utm_medium","utm_campaign","utm_content","utm_term","gad_source","mc_cid"],Hs),Zr="<masked>",rT=["li_fat_id"];function Dg(t,e,n){if(!N)return{};var s,r=e?zs([],Hs,n||[]):[],i=Lg(Xr(N.URL,r,Zr),t),a=(s={},ge(rT,function(l){var c=Xt.A(l);s[l]=c||null}),s);return Re(a,i)}function Lg(t,e){var n=sT.concat(e||[]),s={};return ge(n,function(r){var i=bi(t,r);s[r]=i||null}),s}function Mg(t){var e=function(i){return i?i.search(No+"google.([^/?]*)")===0?"google":i.search(No+"bing.com")===0?"bing":i.search(No+"yahoo.com")===0?"yahoo":i.search(No+"duckduckgo.com")===0?"duckduckgo":null:null}(t),n=e!="yahoo"?"q":"p",s={};if(!Ht(e)){s.$search_engine=e;var r=N?bi(N.referrer,n):"";r.length&&(s.ph_keyword=r)}return s}function ah(){return navigator.language||navigator.userLanguage}function Ng(){return N?.referrer||"$direct"}function Vg(t,e){var n=t?zs([],Hs,e||[]):[],s=Fe?.href.substring(0,1e3);return{r:Ng().substring(0,1e3),u:s?Xr(s,n,Zr):void 0}}function Fg(t){var e,{r:n,u:s}=t,r={$referrer:n,$referring_domain:n==null?void 0:n=="$direct"?"$direct":(e=xi(n))==null?void 0:e.host};if(s){r.$current_url=s;var i=xi(s);r.$host=i?.host,r.$pathname=i?.pathname;var a=Lg(s);Re(r,a)}if(n){var l=Mg(n);Re(r,l)}return r}function $g(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone}catch{return}}function oT(){try{return new Date().getTimezoneOffset()}catch{return}}function iT(t,e){if(!bt)return{};var n,s,r,i=t?zs([],Hs,e||[]):[],[a,l]=function(c){for(var u=0;u<Nd.length;u++){var[d,h]=Nd[u],p=d.exec(c),m=p&&(bn(h)?h(p,c):h);if(m)return m}return["",""]}(bt);return Re(Hc({$os:a,$os_version:l,$browser:fg(bt,navigator.vendor),$device:Vd(bt),$device_type:(s=bt,r=Vd(s),r===eg||r===Qm||r==="Kobo"||r==="Kindle Fire"||r===pg?Gr:r===qr||r===Ms||r===Yr||r===Sl?"Console":r===ng?"Wearable":r?Dt:"Desktop"),$timezone:$g(),$timezone_offset:oT()}),{$current_url:Xr(Fe?.href,i,Zr),$host:Fe?.host,$pathname:Fe?.pathname,$raw_user_agent:bt.length>1e3?bt.substring(0,997)+"...":bt,$browser_version:rj(bt,navigator.vendor),$browser_language:ah(),$browser_language_prefix:(n=ah(),typeof n=="string"?n.split("-")[0]:void 0),$screen_height:R?.screen.height,$screen_width:R?.screen.width,$viewport_height:R?.innerHeight,$viewport_width:R?.innerWidth,$lib:"web",$lib_version:_n.LIB_VERSION,$insert_id:Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10),$time:Date.now()/1e3})}var Tt=je("[FeatureFlags]"),fr=je("[FeatureFlags]",{debugEnabled:!0}),aT="errors_while_computing_flags",lT="flag_missing",cT="quota_limited",uT="timeout",dT="connection_error",hT="unknown_error",pT=t=>"api_error_"+t,Sa="$active_feature_flags",gs="$override_feature_flags",lh="$feature_flag_payloads",mr="$override_feature_flag_payloads",ch="$feature_flag_request_id",uh="$feature_flag_evaluated_at",dh=t=>{var e={};for(var[n,s]of Xo(t||{}))s&&(e[n]=s);return e},fT=t=>{var e=t.flags;return e?(t.featureFlags=Object.fromEntries(Object.keys(e).map(n=>{var s;return[n,(s=e[n].variant)!==null&&s!==void 0?s:e[n].enabled]})),t.featureFlagPayloads=Object.fromEntries(Object.keys(e).filter(n=>e[n].enabled).filter(n=>{var s;return(s=e[n].metadata)==null?void 0:s.payload}).map(n=>{var s;return[n,(s=e[n].metadata)==null?void 0:s.payload]}))):Tt.warn("Using an older version of the feature flags endpoint. Please upgrade your PostHog server to the latest version"),t},mT=function(t){return t.FeatureFlags="feature_flags",t.Recordings="recordings",t}({});class gT{constructor(e){this._t=!1,this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.Et=!1,this._instance=e,this.featureFlagEventHandlers=[]}St(){var e,n=(e=this._instance.config.evaluation_contexts)!==null&&e!==void 0?e:this._instance.config.evaluation_environments;return!this._instance.config.evaluation_environments||this._instance.config.evaluation_contexts||this.Et||(Tt.warn("evaluation_environments is deprecated. Use evaluation_contexts instead. evaluation_environments will be removed in a future version."),this.Et=!0),n!=null&&n.length?n.filter(s=>{var r=s&&typeof s=="string"&&s.trim().length>0;return r||Tt.error("Invalid evaluation context found:",s,"Expected non-empty string"),r}):[]}kt(){return this.St().length>0}get hasLoadedFlags(){return this.bt}getFlags(){return Object.keys(this.getFlagVariants())}getFlagsWithDetails(){var e=this._instance.get_property(Ol),n=this._instance.get_property(gs),s=this._instance.get_property(mr);if(!s&&!n)return e||{};var r=Re({},e||{}),i=[...new Set([...Object.keys(s||{}),...Object.keys(n||{})])];for(var a of i){var l,c,u=r[a],d=n?.[a],h=F(d)?(l=u?.enabled)!==null&&l!==void 0&&l:!!d,p=F(d)?u.variant:typeof d=="string"?d:void 0,m=s?.[a],y=V({},u,{enabled:h,variant:h?p??u?.variant:void 0});h!==u?.enabled&&(y.original_enabled=u?.enabled),p!==u?.variant&&(y.original_variant=u?.variant),m&&(y.metadata=V({},u?.metadata,{payload:m,original_payload:u==null||(c=u.metadata)==null?void 0:c.payload})),r[a]=y}return this._t||(Tt.warn(" Overriding feature flag details!",{flagDetails:e,overriddenPayloads:s,finalDetails:r}),this._t=!0),r}getFlagVariants(){var e=this._instance.get_property(Ps),n=this._instance.get_property(gs);if(!n)return e||{};for(var s=Re({},e),r=Object.keys(n),i=0;i<r.length;i++)s[r[i]]=n[r[i]];return this._t||(Tt.warn(" Overriding feature flags!",{enabledFlags:e,overriddenFlags:n,finalFlags:s}),this._t=!0),s}getFlagPayloads(){var e=this._instance.get_property(lh),n=this._instance.get_property(mr);if(!n)return e||{};for(var s=Re({},e||{}),r=Object.keys(n),i=0;i<r.length;i++)s[r[i]]=n[r[i]];return this._t||(Tt.warn(" Overriding feature flag payloads!",{flagPayloads:e,overriddenPayloads:n,finalPayloads:s}),this._t=!0),s}reloadFeatureFlags(){this.wt||this._instance.config.advanced_disable_feature_flags||this.Pt||(this._instance.Tt.emit("featureFlagsReloading",!0),this.Pt=setTimeout(()=>{this.It()},5))}Ct(){clearTimeout(this.Pt),this.Pt=void 0}ensureFlagsLoaded(){this.bt||this.yt||this.Pt||this.reloadFeatureFlags()}setAnonymousDistinctId(e){this.$anon_distinct_id=e}setReloadingPaused(e){this.wt=e}It(e){var n;if(this.Ct(),!this._instance.Rt())if(this.yt)this.xt=!0;else{var s=this._instance.config.token,r=this._instance.get_property("$device_id"),i={token:s,distinct_id:this._instance.get_distinct_id(),groups:this._instance.getGroups(),$anon_distinct_id:this.$anon_distinct_id,person_properties:V({},((n=this._instance.persistence)==null?void 0:n.get_initial_props())||{},this._instance.get_property(jr)||{}),group_properties:this._instance.get_property(Zn),timezone:$g()};Ht(r)||F(r)||(i.$device_id=r),(e!=null&&e.disableFlags||this._instance.config.advanced_disable_feature_flags)&&(i.disable_flags=!0),this.kt()&&(i.evaluation_contexts=this.St());var a=this._instance.config.advanced_only_evaluate_survey_feature_flags?"&only_evaluate_survey_feature_flags=true":"",l=this._instance.requestRouter.endpointFor("flags","/flags/?v=2"+a);this.yt=!0,this._instance._send_request({method:"POST",url:l,data:i,compression:this._instance.config.disable_compression?void 0:Zt.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:c=>{var u,d,h,p=!0;if(c.statusCode===200&&(this.xt||(this.$anon_distinct_id=void 0),p=!1),this.yt=!1,!i.disable_flags||this.xt){this.$t=!p;var m=[];c.error?c.error instanceof Error?m.push(c.error.name==="AbortError"?uT:dT):m.push(hT):c.statusCode!==200&&m.push(pT(c.statusCode)),(u=c.json)!=null&&u.errorsWhileComputingFlags&&m.push(aT);var y=!((d=c.json)==null||(d=d.quotaLimited)==null||!d.includes(mT.FeatureFlags));if(y&&m.push(cT),(h=this._instance.persistence)==null||h.register({[Ll]:m}),y)Tt.warn("You have hit your feature flags quota limit, and will not be able to load feature flags until the quota is reset. Please visit https://posthog.com/docs/billing/limits-alerts to learn more.");else{var _;i.disable_flags||this.receivedFeatureFlags((_=c.json)!==null&&_!==void 0?_:{},p),this.xt&&(this.xt=!1,this.It())}}}})}}getFeatureFlag(e,n){var s;if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var r=this.getFeatureFlagResult(e,n);return(s=r?.variant)!==null&&s!==void 0?s:r?.enabled}Tt.warn('getFeatureFlag for key "'+e+`" failed. Feature flags didn't load in time.`)}}getFeatureFlagDetails(e){return this.getFlagsWithDetails()[e]}getFeatureFlagPayload(e){var n=this.getFeatureFlagResult(e,{send_event:!1});return n?.payload}getFeatureFlagResult(e,n){if(n===void 0&&(n={}),!n.fresh||this.$t)if(this.bt||this.getFlags()&&this.getFlags().length>0){var s=this.getFlagVariants(),r=e in s,i=s[e],a=this.getFlagPayloads()[e],l=String(i),c=this._instance.get_property(ch)||void 0,u=this._instance.get_property(uh)||void 0,d=this._instance.get_property(gi)||{};if((n.send_event||!("send_event"in n))&&(!(e in d)||!d[e].includes(l))){var h,p,m,y,_,x,b,w,E,T;ue(d[e])?d[e].push(l):d[e]=[l],(h=this._instance.persistence)==null||h.register({[gi]:d});var j=this.getFeatureFlagDetails(e),P=[...(p=this._instance.get_property(Ll))!==null&&p!==void 0?p:[]];F(i)&&P.push(lT);var k={$feature_flag:e,$feature_flag_response:i,$feature_flag_payload:a||null,$feature_flag_request_id:c,$feature_flag_evaluated_at:u,$feature_flag_bootstrapped_response:((m=this._instance.config.bootstrap)==null||(m=m.featureFlags)==null?void 0:m[e])||null,$feature_flag_bootstrapped_payload:((y=this._instance.config.bootstrap)==null||(y=y.featureFlagPayloads)==null?void 0:y[e])||null,$used_bootstrap_value:!this.$t};F(j==null||(_=j.metadata)==null?void 0:_.version)||(k.$feature_flag_version=j.metadata.version);var S,D=(x=j==null||(b=j.reason)==null?void 0:b.description)!==null&&x!==void 0?x:j==null||(w=j.reason)==null?void 0:w.code;D&&(k.$feature_flag_reason=D),j!=null&&(E=j.metadata)!=null&&E.id&&(k.$feature_flag_id=j.metadata.id),F(j?.original_variant)&&F(j?.original_enabled)||(k.$feature_flag_original_response=F(j.original_variant)?j.original_enabled:j.original_variant),j!=null&&(T=j.metadata)!=null&&T.original_payload&&(k.$feature_flag_original_payload=j==null||(S=j.metadata)==null?void 0:S.original_payload),P.length&&(k.$feature_flag_error=P.join(",")),this._instance.capture("$feature_flag_called",k)}if(r){var A=a;if(!F(a))try{A=JSON.parse(a)}catch{}return{key:e,enabled:!!i,variant:typeof i=="string"?i:void 0,payload:A}}}else Tt.warn('getFeatureFlagResult for key "'+e+`" failed. Feature flags didn't load in time.`)}getRemoteConfigPayload(e,n){var s=this._instance.config.token,r={distinct_id:this._instance.get_distinct_id(),token:s};this.kt()&&(r.evaluation_contexts=this.St()),this._instance._send_request({method:"POST",url:this._instance.requestRouter.endpointFor("flags","/flags/?v=2"),data:r,compression:this._instance.config.disable_compression?void 0:Zt.Base64,timeout:this._instance.config.feature_flag_request_timeout_ms,callback:i=>{var a,l=(a=i.json)==null?void 0:a.featureFlagPayloads;n(l?.[e]||void 0)}})}isFeatureEnabled(e,n){if(n===void 0&&(n={}),!n.fresh||this.$t){if(this.bt||this.getFlags()&&this.getFlags().length>0){var s=this.getFeatureFlag(e,n);return F(s)?void 0:!!s}Tt.warn('isFeatureEnabled for key "'+e+`" failed. Feature flags didn't load in time.`)}}addFeatureFlagsHandler(e){this.featureFlagEventHandlers.push(e)}removeFeatureFlagsHandler(e){this.featureFlagEventHandlers=this.featureFlagEventHandlers.filter(n=>n!==e)}receivedFeatureFlags(e,n){if(this._instance.persistence){this.bt=!0;var s=this.getFlagVariants(),r=this.getFlagPayloads(),i=this.getFlagsWithDetails();(function(a,l,c,u,d){c===void 0&&(c={}),u===void 0&&(u={}),d===void 0&&(d={});var h=fT(a),p=h.flags,m=h.featureFlags,y=h.featureFlagPayloads;if(m){var _=a.requestId,x=a.evaluatedAt;if(ue(m)){Tt.warn("v1 of the feature flags endpoint is deprecated. Please use the latest version.");var b={};if(m)for(var w=0;w<m.length;w++)b[m[w]]=!0;l&&l.register({[Sa]:m,[Ps]:b})}else{var E=m,T=y,j=p;if(a.errorsWhileComputingFlags)if(p){var P=new Set(Object.keys(p).filter(k=>{var S;return!((S=p[k])!=null&&S.failed)}));E=V({},c,Object.fromEntries(Object.entries(E).filter(k=>{var[S]=k;return P.has(S)}))),T=V({},u,Object.fromEntries(Object.entries(T||{}).filter(k=>{var[S]=k;return P.has(S)}))),j=V({},d,Object.fromEntries(Object.entries(j||{}).filter(k=>{var[S]=k;return P.has(S)})))}else E=V({},c,E),T=V({},u,T),j=V({},d,j);l&&l.register(V({[Sa]:Object.keys(dh(E)),[Ps]:E||{},[lh]:T||{},[Ol]:j||{}},_?{[ch]:_}:{},x?{[uh]:x}:{}))}}})(e,this._instance.persistence,s,r,i),this.Ft(n)}}override(e,n){n===void 0&&(n=!1),Tt.warn("override is deprecated. Please use overrideFeatureFlags instead."),this.overrideFeatureFlags({flags:e,suppressWarning:n})}overrideFeatureFlags(e){if(!this._instance.__loaded||!this._instance.persistence)return Tt.uninitializedWarning("posthog.featureFlags.overrideFeatureFlags");if(e===!1)return this._instance.persistence.unregister(gs),this._instance.persistence.unregister(mr),this.Ft(),fr.info("All overrides cleared");if(e&&typeof e=="object"&&("flags"in e||"payloads"in e)){var n,s=e;if(this._t=!!((n=s.suppressWarning)!==null&&n!==void 0&&n),"flags"in s){if(s.flags===!1)this._instance.persistence.unregister(gs),fr.info("Flag overrides cleared");else if(s.flags){if(ue(s.flags)){for(var r={},i=0;i<s.flags.length;i++)r[s.flags[i]]=!0;this._instance.persistence.register({[gs]:r})}else this._instance.persistence.register({[gs]:s.flags});fr.info("Flag overrides set",{flags:s.flags})}}return"payloads"in s&&(s.payloads===!1?(this._instance.persistence.unregister(mr),fr.info("Payload overrides cleared")):s.payloads&&(this._instance.persistence.register({[mr]:s.payloads}),fr.info("Payload overrides set",{payloads:s.payloads}))),void this.Ft()}this.Ft()}onFeatureFlags(e){if(this.addFeatureFlagsHandler(e),this.bt){var{flags:n,flagVariants:s}=this.Ot();e(n,s)}return()=>this.removeFeatureFlagsHandler(e)}updateEarlyAccessFeatureEnrollment(e,n,s){var r,i=(this._instance.get_property(Er)||[]).find(u=>u.flagKey===e),a={["$feature_enrollment/"+e]:n},l={$feature_flag:e,$feature_enrollment:n,$set:a};i&&(l.$early_access_feature_name=i.name),s&&(l.$feature_enrollment_stage=s),this._instance.capture("$feature_enrollment_update",l),this.setPersonPropertiesForFlags(a,!1);var c=V({},this.getFlagVariants(),{[e]:n});(r=this._instance.persistence)==null||r.register({[Sa]:Object.keys(dh(c)),[Ps]:c}),this.Ft()}getEarlyAccessFeatures(e,n,s){n===void 0&&(n=!1);var r=this._instance.get_property(Er),i=s?"&"+s.map(a=>"stage="+a).join("&"):"";if(r&&!n)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/early_access_features/?token="+this._instance.config.token+i),method:"GET",callback:a=>{var l,c;if(a.json){var u=a.json.earlyAccessFeatures;return(l=this._instance.persistence)==null||l.unregister(Er),(c=this._instance.persistence)==null||c.register({[Er]:u}),e(u)}}})}Ot(){var e=this.getFlags(),n=this.getFlagVariants();return{flags:e.filter(s=>n[s]),flagVariants:Object.keys(n).filter(s=>n[s]).reduce((s,r)=>(s[r]=n[r],s),{})}}Ft(e){var{flags:n,flagVariants:s}=this.Ot();this.featureFlagEventHandlers.forEach(r=>r(n,s,{errorsLoading:e}))}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0);var s=this._instance.get_property(jr)||{};this._instance.register({[jr]:V({},s,e)}),n&&this._instance.reloadFeatureFlags()}resetPersonPropertiesForFlags(){this._instance.unregister(jr)}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0);var s=this._instance.get_property(Zn)||{};Object.keys(s).length!==0&&Object.keys(s).forEach(r=>{s[r]=V({},s[r],e[r]),delete e[r]}),this._instance.register({[Zn]:V({},s,e)}),n&&this._instance.reloadFeatureFlags()}resetGroupPropertiesForFlags(e){if(e){var n=this._instance.get_property(Zn)||{};this._instance.register({[Zn]:V({},n,{[e]:{}})})}else this._instance.unregister(Zn)}reset(){this.bt=!1,this.yt=!1,this.wt=!1,this.xt=!1,this.$t=!1,this.$anon_distinct_id=void 0,this.Ct(),this._t=!1}}var vT=["cookie","localstorage","localstorage+cookie","sessionstorage","memory"];class Ra{constructor(e,n){this.N=e,this.props={},this.Mt=!1,this.At=(s=>{var r="";return s.token&&(r=s.token.replace(/\+/g,"PL").replace(/\//g,"SL").replace(/=/g,"EQ")),s.persistence_name?"ph_"+s.persistence_name:"ph_"+r+"_posthog"})(e),this.B=this.jt(e),this.load(),e.debug&&$.info("Persistence loaded",e.persistence,V({},this.props)),this.update_config(e,e,n),this.save()}isDisabled(){return!!this.Dt}jt(e){vT.indexOf(e.persistence.toLowerCase())===-1&&($.critical("Unknown persistence type "+e.persistence+"; falling back to localStorage+cookie"),e.persistence="localStorage+cookie");var n=function(r){r===void 0&&(r=[]);var i=[...Nj,...r];return V({},we,{j:function(a){try{var l={};try{l=Xt.j(a)||{}}catch{}var c=Re(l,JSON.parse(we.A(a)||"{}"));return we.D(a,c),c}catch{}return null},D:function(a,l,c,u,d,h){try{we.D(a,l,void 0,void 0,h);var p={};i.forEach(m=>{l[m]&&(p[m]=l[m])}),Object.keys(p).length&&Xt.D(a,p,c,u,d,h)}catch(m){we.M(m)}},L:function(a,l){try{R?.localStorage.removeItem(a),Xt.L(a,l)}catch(c){we.M(c)}}})}(e.cookie_persisted_properties||[]),s=e.persistence.toLowerCase();return s==="localstorage"&&we.O()?we:s==="localstorage+cookie"&&n.O()?n:s==="sessionstorage"&&Ve.O()?Ve:s==="memory"?Vj:s==="cookie"?Xt:n.O()?n:Xt}properties(){var e={};return ge(this.props,function(n,s){if(s===Ps&&Le(n))for(var r=Object.keys(n),i=0;i<r.length;i++)e["$feature/"+r[i]]=n[r[i]];else l=s,c=!1,(Ht(a=Cj)?c:Cd&&a.indexOf===Cd?a.indexOf(l)!=-1:(ge(a,function(u){if(c||(c=u===l))return fi}),c))||(e[s]=n);var a,l,c}),e}load(){if(!this.Dt){var e=this.B.j(this.At);e&&(this.props=Re({},e))}}save(){this.Dt||this.B.D(this.At,this.props,this.Lt,this.Nt,this.Ut,this.N.debug)}remove(){this.B.L(this.At,!1),this.B.L(this.At,!0)}clear(){this.remove(),this.props={}}register_once(e,n,s){if(Le(e)){F(n)&&(n="None"),this.Lt=F(s)?this.zt:s;var r=!1;if(ge(e,(i,a)=>{this.props.hasOwnProperty(a)&&this.props[a]!==n||(this.props[a]=i,r=!0)}),r)return this.save(),!0}return!1}register(e,n){if(Le(e)){this.Lt=F(n)?this.zt:n;var s=!1;if(ge(e,(r,i)=>{e.hasOwnProperty(i)&&this.props[i]!==r&&(this.props[i]=r,s=!0)}),s)return this.save(),!0}return!1}unregister(e){e in this.props&&(delete this.props[e],this.save())}update_campaign_params(){if(!this.Mt){var e=Dg(this.N.custom_campaign_params,this.N.mask_personal_data_properties,this.N.custom_personal_data_properties);Ts(Hc(e))||this.register(e),this.Mt=!0}}update_search_keyword(){var e;this.register((e=N?.referrer)?Mg(e):{})}update_referrer_info(){var e;this.register_once({$referrer:Ng(),$referring_domain:N!=null&&N.referrer&&((e=xi(N.referrer))==null?void 0:e.host)||"$direct"},void 0)}set_initial_person_info(){this.props[Vl]||this.props[Fl]||this.register_once({[vi]:Vg(this.N.mask_personal_data_properties,this.N.custom_personal_data_properties)},void 0)}get_initial_props(){var e={};ge([Fl,Vl],a=>{var l=this.props[a];l&&ge(l,function(c,u){e["$initial_"+jl(u)]=c})});var n,s,r=this.props[vi];if(r){var i=(n=Fg(r),s={},ge(n,function(a,l){s["$initial_"+jl(l)]=a}),s);Re(e,i)}return e}safe_merge(e){return ge(this.props,function(n,s){s in e||(e[s]=n)}),e}update_config(e,n,s){if(this.zt=this.Lt=e.cookie_expiration,this.set_disabled(e.disable_persistence||!!s),this.set_cross_subdomain(e.cross_subdomain_cookie),this.set_secure(e.secure_cookie),e.persistence!==n.persistence||!((a,l)=>{if(a.length!==l.length)return!1;var c=[...a].sort(),u=[...l].sort();return c.every((d,h)=>d===u[h])})(e.cookie_persisted_properties||[],n.cookie_persisted_properties||[])){var r=this.jt(e),i=this.props;this.clear(),this.B=r,this.props=i,this.save()}}set_disabled(e){this.Dt=e,this.Dt?this.remove():this.save()}set_cross_subdomain(e){e!==this.Nt&&(this.Nt=e,this.remove(),this.save())}set_secure(e){e!==this.Ut&&(this.Ut=e,this.remove(),this.save())}set_event_timer(e,n){var s=this.props[wr]||{};s[e]=n,this.props[wr]=s,this.save()}remove_event_timer(e){var n=(this.props[wr]||{})[e];return F(n)||(delete this.props[wr][e],this.save()),n}get_property(e){return this.props[e]}set_property(e,n){this.props[e]=n,this.save()}}var Es=function(t){return t.Activation="events",t.Cancellation="cancelEvents",t}({});(function(t){return t.Button="button",t.Tab="tab",t.Selector="selector",t})({});(function(t){return t.TopLeft="top_left",t.TopRight="top_right",t.TopCenter="top_center",t.MiddleLeft="middle_left",t.MiddleRight="middle_right",t.MiddleCenter="middle_center",t.Left="left",t.Center="center",t.Right="right",t.NextToTrigger="next_to_trigger",t})({});(function(t){return t.Top="top",t.Left="left",t.Right="right",t.Bottom="bottom",t})({});var Jo=function(t){return t.Popover="popover",t.API="api",t.Widget="widget",t.ExternalSurvey="external_survey",t}({});(function(t){return t.Open="open",t.MultipleChoice="multiple_choice",t.SingleChoice="single_choice",t.Rating="rating",t.Link="link",t})({});(function(t){return t.NextQuestion="next_question",t.End="end",t.ResponseBased="response_based",t.SpecificQuestion="specific_question",t})({});(function(t){return t.Once="once",t.Recurring="recurring",t.Always="always",t})({});var ks=function(t){return t.SHOWN="survey shown",t.DISMISSED="survey dismissed",t.SENT="survey sent",t.ABANDONED="survey abandoned",t}({}),Qo=function(t){return t.SURVEY_ID="$survey_id",t.SURVEY_NAME="$survey_name",t.SURVEY_RESPONSE="$survey_response",t.SURVEY_ITERATION="$survey_iteration",t.SURVEY_ITERATION_START_DATE="$survey_iteration_start_date",t.SURVEY_PARTIALLY_COMPLETED="$survey_partially_completed",t.SURVEY_SUBMISSION_ID="$survey_submission_id",t.SURVEY_QUESTIONS="$survey_questions",t.SURVEY_COMPLETED="$survey_completed",t.PRODUCT_TOUR_ID="$product_tour_id",t.SURVEY_LAST_SEEN_DATE="$survey_last_seen_date",t}({}),Pi=function(t){return t.Popover="popover",t.Inline="inline",t}({}),fe=je("[Surveys]"),Bg="seenSurvey_",_T=(t,e)=>{var n="$survey_"+e+"/"+t.id;return t.current_iteration&&t.current_iteration>0&&(n="$survey_"+e+"/"+t.id+"/"+t.current_iteration),n},hh=t=>((e,n)=>{var s=""+e+n.id;return n.current_iteration&&n.current_iteration>0&&(s=""+e+n.id+"_"+n.current_iteration),s})(Bg,t),yT=[Jo.Popover,Jo.Widget,Jo.API],xT={ignoreConditions:!1,ignoreDelay:!1,displayType:Pi.Popover};class Kc{constructor(){this.Ht={},this.Ht={}}on(e,n){return this.Ht[e]||(this.Ht[e]=[]),this.Ht[e].push(n),()=>{this.Ht[e]=this.Ht[e].filter(s=>s!==n)}}emit(e,n){for(var s of this.Ht[e]||[])s(n);for(var r of this.Ht["*"]||[])r(e,n)}}function vs(t,e,n){if(se(t))return!1;switch(n){case"exact":return t===e;case"contains":var s=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(s,"i").test(t);case"regex":try{return new RegExp(e).test(t)}catch{return!1}default:return!1}}class bT{constructor(e){this.Bt=new Kc,this.qt=(n,s)=>this.Wt(n,s)&&this.Gt(n,s)&&this.Vt(n,s)&&this.Jt(n,s),this.Wt=(n,s)=>s==null||!s.event||n?.event===s?.event,this._instance=e,this.Kt=new Set,this.Yt=new Set}init(){var e;if(!F((e=this._instance)==null?void 0:e._addCaptureHook)){var n;(n=this._instance)==null||n._addCaptureHook((s,r)=>{this.on(s,r)})}}register(e){var n,s;if(!F((n=this._instance)==null?void 0:n._addCaptureHook)&&(e.forEach(a=>{var l,c;(l=this.Yt)==null||l.add(a),(c=a.steps)==null||c.forEach(u=>{var d;(d=this.Kt)==null||d.add(u?.event||"")})}),(s=this._instance)!=null&&s.autocapture)){var r,i=new Set;e.forEach(a=>{var l;(l=a.steps)==null||l.forEach(c=>{c!=null&&c.selector&&i.add(c?.selector)})}),(r=this._instance)==null||r.autocapture.setElementSelectors(i)}}on(e,n){var s;n!=null&&e.length!=0&&(this.Kt.has(e)||this.Kt.has(n?.event))&&this.Yt&&((s=this.Yt)==null?void 0:s.size)>0&&this.Yt.forEach(r=>{this.Xt(n,r)&&this.Bt.emit("actionCaptured",r.name)})}Qt(e){this.onAction("actionCaptured",n=>e(n))}Xt(e,n){if(n?.steps==null)return!1;for(var s of n.steps)if(this.qt(e,s))return!0;return!1}onAction(e,n){return this.Bt.on(e,n)}Gt(e,n){if(n!=null&&n.url){var s,r=e==null||(s=e.properties)==null?void 0:s.$current_url;if(!r||typeof r!="string"||!vs(r,n.url,n.url_matching||"contains"))return!1}return!0}Vt(e,n){return!!this.Zt(e,n)&&!!this.ti(e,n)&&!!this.ii(e,n)}Zt(e,n){var s;if(n==null||!n.href)return!0;var r=this.ei(e);if(r.length>0)return r.some(l=>vs(l.href,n.href,n.href_matching||"exact"));var i,a=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!a&&vs((i=a.match(/(?::|")href="(.*?)"/))?i[1]:"",n.href,n.href_matching||"exact")}ti(e,n){var s;if(n==null||!n.text)return!0;var r=this.ei(e);if(r.length>0)return r.some(u=>vs(u.text,n.text,n.text_matching||"exact")||vs(u.$el_text,n.text,n.text_matching||"exact"));var i,a,l,c=(e==null||(s=e.properties)==null?void 0:s.$elements_chain)||"";return!!c&&(i=function(u){for(var d,h=[],p=/(?::|")text="(.*?)"/g;!se(d=p.exec(u));)h.includes(d[1])||h.push(d[1]);return h}(c),a=n.text,l=n.text_matching||"exact",i.some(u=>vs(u,a,l)))}ii(e,n){var s,r;if(n==null||!n.selector)return!0;var i=e==null||(s=e.properties)==null?void 0:s.$element_selectors;if(i!=null&&i.includes(n.selector))return!0;var a=(e==null||(r=e.properties)==null?void 0:r.$elements_chain)||"";if(n.selector_regex&&a)try{return new RegExp(n.selector_regex).test(a)}catch{return!1}return!1}ei(e){var n;return(e==null||(n=e.properties)==null?void 0:n.$elements)==null?[]:e?.properties.$elements}Jt(e,n){return n==null||!n.properties||n.properties.length===0||Og(n.properties.reduce((s,r)=>{var i=ue(r.value)?r.value.map(String):r.value!=null?[String(r.value)]:[];return s[r.key]={values:i,operator:r.operator||"exact"},s},{}),e?.properties)}}class wT{constructor(e){this._instance=e,this.ri=new Map,this.si=new Map,this.ni=new Map}oi(e,n){return!!e&&Og(e.propertyFilters,n?.properties)}ai(e,n){var s=new Map;return e.forEach(r=>{var i;(i=r.conditions)==null||(i=i[n])==null||(i=i.values)==null||i.forEach(a=>{if(a!=null&&a.name){var l=s.get(a.name)||[];l.push(r.id),s.set(a.name,l)}})}),s}li(e,n,s){var r=(s===Es.Activation?this.ri:this.si).get(e),i=[];return this.ui(a=>{i=a.filter(l=>r?.includes(l.id))}),i.filter(a=>{var l,c=(l=a.conditions)==null||(l=l[s])==null||(l=l.values)==null?void 0:l.find(u=>u.name===e);return this.oi(c,n)})}register(e){var n;F((n=this._instance)==null?void 0:n._addCaptureHook)||(this.hi(e),this.di(e))}di(e){var n=e.filter(s=>{var r,i;return((r=s.conditions)==null?void 0:r.actions)&&((i=s.conditions)==null||(i=i.actions)==null||(i=i.values)==null?void 0:i.length)>0});n.length!==0&&(this.vi==null&&(this.vi=new bT(this._instance),this.vi.init(),this.vi.Qt(s=>{this.onAction(s)})),n.forEach(s=>{var r,i,a,l,c;s.conditions&&(r=s.conditions)!=null&&r.actions&&(i=s.conditions)!=null&&(i=i.actions)!=null&&i.values&&((a=s.conditions)==null||(a=a.actions)==null||(a=a.values)==null?void 0:a.length)>0&&((l=this.vi)==null||l.register(s.conditions.actions.values),(c=s.conditions)==null||(c=c.actions)==null||(c=c.values)==null||c.forEach(u=>{if(u&&u.name){var d=this.ni.get(u.name);d&&d.push(s.id),this.ni.set(u.name,d||[s.id])}}))}))}hi(e){var n,s=e.filter(i=>{var a,l;return((a=i.conditions)==null?void 0:a.events)&&((l=i.conditions)==null||(l=l.events)==null||(l=l.values)==null?void 0:l.length)>0}),r=e.filter(i=>{var a,l;return((a=i.conditions)==null?void 0:a.cancelEvents)&&((l=i.conditions)==null||(l=l.cancelEvents)==null||(l=l.values)==null?void 0:l.length)>0});(s.length!==0||r.length!==0)&&((n=this._instance)==null||n._addCaptureHook((i,a)=>{this.onEvent(i,a)}),this.ri=this.ai(e,Es.Activation),this.si=this.ai(e,Es.Cancellation))}onEvent(e,n){var s,r=this.ci(),i=this.fi(),a=this.pi(),l=((s=this._instance)==null||(s=s.persistence)==null?void 0:s.props[i])||[];if(a===e&&n&&l.length>0){var c,u;r.info("event matched, removing item from activated items",{event:e,eventPayload:n,existingActivatedItems:l});var d=(n==null||(c=n.properties)==null?void 0:c.$survey_id)||(n==null||(u=n.properties)==null?void 0:u.$product_tour_id);if(d){var h=l.indexOf(d);h>=0&&(l.splice(h,1),this.gi(l))}}else{if(this.si.has(e)){var p=this.li(e,n,Es.Cancellation);p.length>0&&(r.info("cancel event matched, cancelling items",{event:e,itemsToCancel:p.map(y=>y.id)}),p.forEach(y=>{var _=l.indexOf(y.id);_>=0&&l.splice(_,1),this.mi(y.id)}),this.gi(l))}if(this.ri.has(e)){r.info("event name matched",{event:e,eventPayload:n,items:this.ri.get(e)});var m=this.li(e,n,Es.Activation);this.gi(l.concat(m.map(y=>y.id)||[]))}}}onAction(e){var n,s=this.fi(),r=((n=this._instance)==null||(n=n.persistence)==null?void 0:n.props[s])||[];this.ni.has(e)&&this.gi(r.concat(this.ni.get(e)||[]))}gi(e){var n,s=this.ci(),r=this.fi(),i=[...new Set(e)].filter(a=>!this.bi(a));s.info("updating activated items",{activatedItems:i}),(n=this._instance)==null||(n=n.persistence)==null||n.register({[r]:i})}getActivatedIds(){var e,n=this.fi(),s=(e=this._instance)==null||(e=e.persistence)==null?void 0:e.props[n];return s||[]}getEventToItemsMap(){return this.ri}yi(){return this.vi}}class ET extends wT{constructor(e){super(e)}fi(){return"$surveys_activated"}pi(){return ks.SHOWN}ui(e){var n;(n=this._instance)==null||n.getSurveys(e)}mi(e){var n;(n=this._instance)==null||n.cancelPendingSurvey(e)}ci(){return fe}bi(){return!1}getSurveys(){return this.getActivatedIds()}getEventToSurveys(){return this.getEventToItemsMap()}}class jT{constructor(e){this.wi=void 0,this._surveyManager=null,this.xi=!1,this.$i=[],this.Ei=null,this._instance=e,this._surveyEventReceiver=null}onRemoteConfig(e){if(!this._instance.config.disable_surveys){var n=e.surveys;if(se(n))return fe.warn("Flags not loaded yet. Not loading surveys.");var s=ue(n);this.wi=s?n.length>0:n,fe.info("flags response received, isSurveysEnabled: "+this.wi),this.loadIfEnabled()}}reset(){localStorage.removeItem("lastSeenSurveyDate");for(var e=[],n=0;n<localStorage.length;n++){var s=localStorage.key(n);(s!=null&&s.startsWith(Bg)||s!=null&&s.startsWith("inProgressSurvey_"))&&e.push(s)}e.forEach(r=>localStorage.removeItem(r))}loadIfEnabled(){if(!this._surveyManager)if(this.xi)fe.info("Already initializing surveys, skipping...");else if(this._instance.config.disable_surveys)fe.info("Disabled. Not loading surveys.");else if(this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())fe.info("Not loading surveys in cookieless mode without consent.");else{var e=G?.__PosthogExtensions__;if(e){if(!F(this.wi)||this._instance.config.advanced_enable_surveys){var n=this.wi||this._instance.config.advanced_enable_surveys;this.xi=!0;try{var s=e.generateSurveys;if(s)return void this.Si(s,n);var r=e.loadExternalDependency;if(!r)return void this.ki("PostHog loadExternalDependency extension not found.");r(this._instance,"surveys",i=>{i||!e.generateSurveys?this.ki("Could not load surveys script",i):this.Si(e.generateSurveys,n)})}catch(i){throw this.ki("Error initializing surveys",i),i}finally{this.xi=!1}}}else fe.error("PostHog Extensions not found.")}}Si(e,n){this._surveyManager=e(this._instance,n),this._surveyEventReceiver=new ET(this._instance),fe.info("Surveys loaded successfully"),this.Pi({isLoaded:!0})}ki(e,n){fe.error(e,n),this.Pi({isLoaded:!1,error:e})}onSurveysLoaded(e){return this.$i.push(e),this._surveyManager&&this.Pi({isLoaded:!0}),()=>{this.$i=this.$i.filter(n=>n!==e)}}getSurveys(e,n){if(n===void 0&&(n=!1),this._instance.config.disable_surveys)return fe.info("Disabled. Not loading surveys."),e([]);var s,r=this._instance.get_property(Dl);if(r&&!n)return e(r,{isLoaded:!0});typeof Promise<"u"&&this.Ei?this.Ei.then(i=>{var{surveys:a,context:l}=i;return e(a,l)}):(typeof Promise<"u"&&(this.Ei=new Promise(i=>{s=i})),this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/surveys/?token="+this._instance.config.token),method:"GET",timeout:this._instance.config.surveys_request_timeout_ms,callback:i=>{var a;this.Ei=null;var l=i.statusCode;if(l!==200||!i.json){var c="Surveys API could not be loaded, status: "+l;fe.error(c);var u={isLoaded:!1,error:c};return e([],u),void(s==null||s({surveys:[],context:u}))}var d,h=i.json.surveys||[],p=h.filter(y=>function(_){return!(!_.start_date||_.end_date)}(y)&&(function(_){var x;return!((x=_.conditions)==null||(x=x.events)==null||(x=x.values)==null||!x.length)}(y)||function(_){var x;return!((x=_.conditions)==null||(x=x.actions)==null||(x=x.values)==null||!x.length)}(y)));p.length>0&&((d=this._surveyEventReceiver)==null||d.register(p)),(a=this._instance.persistence)==null||a.register({[Dl]:h});var m={isLoaded:!0};e(h,m),s?.({surveys:h,context:m})}}))}Pi(e){for(var n of this.$i)try{if(!e.isLoaded)return n([],e);this.getSurveys(n)}catch(s){fe.error("Error in survey callback",s)}}getActiveMatchingSurveys(e,n){if(n===void 0&&(n=!1),!se(this._surveyManager))return this._surveyManager.getActiveMatchingSurveys(e,n);fe.warn("init was not called")}Ti(e){var n=null;return this.getSurveys(s=>{var r;n=(r=s.find(i=>i.id===e))!==null&&r!==void 0?r:null}),n}Ii(e){if(se(this._surveyManager))return{eligible:!1,reason:"SDK is not enabled or survey functionality is not yet loaded"};var n=typeof e=="string"?this.Ti(e):e;return n?this._surveyManager.checkSurveyEligibility(n):{eligible:!1,reason:"Survey not found"}}canRenderSurvey(e){if(se(this._surveyManager))return fe.warn("init was not called"),{visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"};var n=this.Ii(e);return{visible:n.eligible,disabledReason:n.reason}}canRenderSurveyAsync(e,n){return se(this._surveyManager)?(fe.warn("init was not called"),Promise.resolve({visible:!1,disabledReason:"SDK is not enabled or survey functionality is not yet loaded"})):new Promise(s=>{this.getSurveys(r=>{var i,a=(i=r.find(c=>c.id===e))!==null&&i!==void 0?i:null;if(a){var l=this.Ii(a);s({visible:l.eligible,disabledReason:l.reason})}else s({visible:!1,disabledReason:"Survey not found"})},n)})}renderSurvey(e,n,s){var r;if(se(this._surveyManager))fe.warn("init was not called");else{var i=typeof e=="string"?this.Ti(e):e;if(i!=null&&i.id)if(yT.includes(i.type)){var a=N?.querySelector(n);if(a)return(r=i.appearance)!=null&&r.surveyPopupDelaySeconds?(fe.info("Rendering survey "+i.id+" with delay of "+i.appearance.surveyPopupDelaySeconds+" seconds"),void setTimeout(()=>{var l,c;fe.info("Rendering survey "+i.id+" with delay of "+((l=i.appearance)==null?void 0:l.surveyPopupDelaySeconds)+" seconds"),(c=this._surveyManager)==null||c.renderSurvey(i,a,s),fe.info("Survey "+i.id+" rendered")},1e3*i.appearance.surveyPopupDelaySeconds)):void this._surveyManager.renderSurvey(i,a,s);fe.warn("Survey element not found")}else fe.warn("Surveys of type "+i.type+" cannot be rendered in the app");else fe.warn("Survey not found")}}displaySurvey(e,n){var s;if(se(this._surveyManager))fe.warn("init was not called");else{var r=this.Ti(e);if(r){var i=r;if((s=r.appearance)!=null&&s.surveyPopupDelaySeconds&&n.ignoreDelay&&(i=V({},r,{appearance:V({},r.appearance,{surveyPopupDelaySeconds:0})})),n.displayType!==Pi.Popover&&n.initialResponses&&fe.warn("initialResponses is only supported for popover surveys. prefill will not be applied."),n.ignoreConditions===!1){var a=this.canRenderSurvey(r);if(!a.visible)return void fe.warn("Survey is not eligible to be displayed: ",a.disabledReason)}n.displayType!==Pi.Inline?this._surveyManager.handlePopoverSurvey(i,n):this.renderSurvey(i,n.selector,n.properties)}else fe.warn("Survey not found")}}cancelPendingSurvey(e){se(this._surveyManager)?fe.warn("init was not called"):this._surveyManager.cancelSurvey(e)}handlePageUnload(){var e;(e=this._surveyManager)==null||e.handlePageUnload()}}var Ct=je("[Conversations]");class TT{constructor(e){this.Ci=void 0,this._conversationsManager=null,this.Ri=!1,this.Fi=null,this._instance=e}onRemoteConfig(e){if(!this._instance.config.disable_conversations){var n=e.conversations;se(n)||(En(n)?this.Ci=n:(this.Ci=n.enabled,this.Fi=n),this.loadIfEnabled())}}reset(){var e;(e=this._conversationsManager)==null||e.reset(),this._conversationsManager=null,this.Ci=void 0,this.Fi=null}loadIfEnabled(){if(!(this._conversationsManager||this.Ri||this._instance.config.disable_conversations||yg(this._instance.config)||this._instance.config.cookieless_mode&&this._instance.consent.isOptedOut())){var e=G?.__PosthogExtensions__;if(e&&!F(this.Ci)&&this.Ci)if(this.Fi&&this.Fi.token){this.Ri=!0;try{var n=e.initConversations;if(n)return this.Oi(n),void(this.Ri=!1);var s=e.loadExternalDependency;if(!s)return void this.Mi("PostHog loadExternalDependency extension not found.");s(this._instance,"conversations",r=>{r||!e.initConversations?this.Mi("Could not load conversations script",r):this.Oi(e.initConversations),this.Ri=!1})}catch(r){this.Mi("Error initializing conversations",r),this.Ri=!1}}else Ct.error("Conversations enabled but missing token in remote config.")}}Oi(e){if(this.Fi)try{this._conversationsManager=e(this.Fi,this._instance),Ct.info("Conversations loaded successfully")}catch(n){this.Mi("Error completing conversations initialization",n)}else Ct.error("Cannot complete initialization: remote config is null")}Mi(e,n){Ct.error(e,n),this._conversationsManager=null,this.Ri=!1}show(){this._conversationsManager?this._conversationsManager.show():Ct.warn("Conversations not loaded yet.")}hide(){this._conversationsManager&&this._conversationsManager.hide()}isAvailable(){return this.Ci===!0&&!Ht(this._conversationsManager)}isVisible(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.isVisible())!==null&&e!==void 0&&e}sendMessage(e,n,s){var r=this;return yn(function*(){return r._conversationsManager?r._conversationsManager.sendMessage(e,n,s):(Ct.warn("Conversations not available yet."),null)})()}getMessages(e,n){var s=this;return yn(function*(){return s._conversationsManager?s._conversationsManager.getMessages(e,n):(Ct.warn("Conversations not available yet."),null)})()}markAsRead(e){var n=this;return yn(function*(){return n._conversationsManager?n._conversationsManager.markAsRead(e):(Ct.warn("Conversations not available yet."),null)})()}getTickets(e){var n=this;return yn(function*(){return n._conversationsManager?n._conversationsManager.getTickets(e):(Ct.warn("Conversations not available yet."),null)})()}requestRestoreLink(e){var n=this;return yn(function*(){return n._conversationsManager?n._conversationsManager.requestRestoreLink(e):(Ct.warn("Conversations not available yet."),null)})()}restoreFromToken(e){var n=this;return yn(function*(){return n._conversationsManager?n._conversationsManager.restoreFromToken(e):(Ct.warn("Conversations not available yet."),null)})()}restoreFromUrlToken(){var e=this;return yn(function*(){return e._conversationsManager?e._conversationsManager.restoreFromUrlToken():(Ct.warn("Conversations not available yet."),null)})()}getCurrentTicketId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getCurrentTicketId())!==null&&e!==void 0?e:null}getWidgetSessionId(){var e,n;return(e=(n=this._conversationsManager)==null?void 0:n.getWidgetSessionId())!==null&&e!==void 0?e:null}}class PT{constructor(e){var n;this.Ai=!1,this.ji=!1,this._instance=e,this._instance&&(n=this._instance.config.logs)!=null&&n.captureConsoleLogs&&(this.Ai=!0)}onRemoteConfig(e){var n,s=(n=e.logs)==null?void 0:n.captureConsoleLogs;!se(s)&&s&&(this.Ai=!0,this.loadIfEnabled())}reset(){}loadIfEnabled(){if(this.Ai&&!this.ji){var e=je("[logs]"),n=G?.__PosthogExtensions__;if(n){var s=n.loadExternalDependency;s?s(this._instance,"logs",r=>{var i;r||(i=n.logs)==null||!i.initializeLogs?e.error("Could not load logs script",r):(n.logs.initializeLogs(this._instance),this.ji=!0)}):e.error("PostHog loadExternalDependency extension not found.")}else e.error("PostHog Extensions not found.")}}}var ph=je("[RateLimiter]");class kT{constructor(e){this.serverLimits={},this.lastEventRateLimited=!1,this.checkForLimiting=n=>{var s=n.text;if(s&&s.length)try{(JSON.parse(s).quota_limited||[]).forEach(r=>{ph.info((r||"events")+" is quota limited."),this.serverLimits[r]=new Date().getTime()+6e4})}catch(r){return void ph.warn('could not rate limit - continuing. Error: "'+r?.message+'"',{text:s})}},this.instance=e,this.lastEventRateLimited=this.clientRateLimitContext(!0).isRateLimited}get captureEventsPerSecond(){var e;return((e=this.instance.config.rate_limiting)==null?void 0:e.events_per_second)||10}get captureEventsBurstLimit(){var e;return Math.max(((e=this.instance.config.rate_limiting)==null?void 0:e.events_burst_limit)||10*this.captureEventsPerSecond,this.captureEventsPerSecond)}clientRateLimitContext(e){var n,s,r;e===void 0&&(e=!1);var{captureEventsBurstLimit:i,captureEventsPerSecond:a}=this,l=new Date().getTime(),c=(n=(s=this.instance.persistence)==null?void 0:s.get_property(Nl))!==null&&n!==void 0?n:{tokens:i,last:l};c.tokens+=(l-c.last)/1e3*a,c.last=l,c.tokens>i&&(c.tokens=i);var u=c.tokens<1;return u||e||(c.tokens=Math.max(0,c.tokens-1)),!u||this.lastEventRateLimited||e||this.instance.capture("$$client_ingestion_warning",{$$client_ingestion_warning_message:"posthog-js client rate limited. Config is set to "+a+" events per second and "+i+" events burst limit."},{skip_client_rate_limiting:!0}),this.lastEventRateLimited=u,(r=this.instance.persistence)==null||r.set_property(Nl,c),{isRateLimited:u,remainingTokens:c.tokens}}isServerRateLimited(e){var n=this.serverLimits[e||"events"]||!1;return n!==!1&&new Date().getTime()<n}}var gr=je("[RemoteConfig]");class zg{constructor(e){this._instance=e}get remoteConfig(){var e;return(e=G._POSTHOG_REMOTE_CONFIG)==null||(e=e[this._instance.config.token])==null?void 0:e.config}Di(e){var n,s;(n=G.__PosthogExtensions__)!=null&&n.loadExternalDependency?(s=G.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,"remote-config",()=>e(this.remoteConfig)):e()}Li(e){this._instance._send_request({method:"GET",url:this._instance.requestRouter.endpointFor("assets","/array/"+this._instance.config.token+"/config"),callback:n=>{e(n.json)}})}load(){try{if(this.remoteConfig)return gr.info("Using preloaded remote config",this.remoteConfig),this.Ni(this.remoteConfig),void this.Ui();if(this._instance.Rt())return void gr.warn("Remote config is disabled. Falling back to local config.");this.Di(e=>{if(!e)return gr.info("No config found after loading remote JS config. Falling back to JSON."),void this.Li(n=>{this.Ni(n),this.Ui()});this.Ni(e),this.Ui()})}catch(e){gr.error("Error loading remote config",e)}}stop(){this.zi&&(clearInterval(this.zi),this.zi=void 0)}refresh(){this._instance.Rt()||N?.visibilityState==="hidden"||this._instance.featureFlags.reloadFeatureFlags()}Ui(){this.zi||(this.zi=setInterval(()=>{this.refresh()},3e5))}Ni(e){e||gr.error("Failed to fetch remote config from PostHog."),this._instance.Ni(e??{}),e?.hasFeatureFlags!==!1&&(this._instance.config.advanced_disable_feature_flags_on_first_load||this._instance.featureFlags.ensureFlagsLoaded())}}var Ul=3e3;class ST{constructor(e,n){this.Hi=!0,this.Bi=[],this.qi=en(n?.flush_interval_ms||Ul,250,5e3,$.createLogger("flush interval"),Ul),this.Wi=e}enqueue(e){this.Bi.push(e),this.Gi||this.Vi()}unload(){this.Ji();var e=this.Bi.length>0?this.Ki():{},n=Object.values(e);[...n.filter(s=>s.url.indexOf("/e")===0),...n.filter(s=>s.url.indexOf("/e")!==0)].map(s=>{this.Wi(V({},s,{transport:"sendBeacon"}))})}enable(){this.Hi=!1,this.Vi()}Vi(){var e=this;this.Hi||(this.Gi=setTimeout(()=>{if(this.Ji(),this.Bi.length>0){var n=this.Ki(),s=function(){var i=n[r],a=new Date().getTime();i.data&&ue(i.data)&&ge(i.data,l=>{l.offset=Math.abs(l.timestamp-a),delete l.timestamp}),e.Wi(i)};for(var r in n)s()}},this.qi))}Ji(){clearTimeout(this.Gi),this.Gi=void 0}Ki(){var e={};return ge(this.Bi,n=>{var s,r=n,i=(r?r.batchKey:null)||r.url;F(e[i])&&(e[i]=V({},r,{data:[]})),(s=e[i].data)==null||s.push(r.data)}),this.Bi=[],e}}var RT=["retriesPerformedSoFar"];class AT{constructor(e){this.Yi=!1,this.Xi=3e3,this.Bi=[],this._instance=e,this.Bi=[],this.Qi=!0,!F(R)&&"onLine"in R.navigator&&(this.Qi=R.navigator.onLine,this.Zi=()=>{this.Qi=!0,this.te()},this.ie=()=>{this.Qi=!1},Ce(R,"online",this.Zi),Ce(R,"offline",this.ie))}get length(){return this.Bi.length}retriableRequest(e){var{retriesPerformedSoFar:n}=e,s=Ym(e,RT);ws(n)&&(s.url=ji(s.url,{retry_count:n})),this._instance._send_request(V({},s,{callback:r=>{r.statusCode!==200&&(r.statusCode<400||r.statusCode>=500)&&(n??0)<10?this.ee(V({retriesPerformedSoFar:n},s)):s.callback==null||s.callback(r)}}))}ee(e){var n=e.retriesPerformedSoFar||0;e.retriesPerformedSoFar=n+1;var s=function(a){var l=3e3*Math.pow(2,a),c=l/2,u=Math.min(18e5,l),d=(Math.random()-.5)*(u-c);return Math.ceil(u+d)}(n),r=Date.now()+s;this.Bi.push({retryAt:r,requestOptions:e});var i="Enqueued failed request for retry in "+s;navigator.onLine||(i+=" (Browser is offline)"),$.warn(i),this.Yi||(this.Yi=!0,this.re())}re(){if(this.se&&clearTimeout(this.se),this.Bi.length===0)return this.Yi=!1,void(this.se=void 0);this.se=setTimeout(()=>{this.Qi&&this.Bi.length>0&&this.te(),this.re()},this.Xi)}te(){var e=Date.now(),n=[],s=this.Bi.filter(i=>i.retryAt<e||(n.push(i),!1));if(this.Bi=n,s.length>0)for(var{requestOptions:r}of s)this.retriableRequest(r)}unload(){for(var{requestOptions:e}of(this.se&&(clearTimeout(this.se),this.se=void 0),this.Yi=!1,F(R)||(this.Zi&&(R.removeEventListener("online",this.Zi),this.Zi=void 0),this.ie&&(R.removeEventListener("offline",this.ie),this.ie=void 0)),this.Bi))try{this._instance._send_request(V({},e,{transport:"sendBeacon"}))}catch(n){$.error(n)}this.Bi=[]}}class CT{constructor(e){this.ne=()=>{var n,s,r,i;this.oe||(this.oe={});var a=this.scrollElement(),l=this.scrollY(),c=a?Math.max(0,a.scrollHeight-a.clientHeight):0,u=l+(a?.clientHeight||0),d=a?.scrollHeight||0;this.oe.lastScrollY=Math.ceil(l),this.oe.maxScrollY=Math.max(l,(n=this.oe.maxScrollY)!==null&&n!==void 0?n:0),this.oe.maxScrollHeight=Math.max(c,(s=this.oe.maxScrollHeight)!==null&&s!==void 0?s:0),this.oe.lastContentY=u,this.oe.maxContentY=Math.max(u,(r=this.oe.maxContentY)!==null&&r!==void 0?r:0),this.oe.maxContentHeight=Math.max(d,(i=this.oe.maxContentHeight)!==null&&i!==void 0?i:0)},this._instance=e}getContext(){return this.oe}resetContext(){var e=this.oe;return setTimeout(this.ne,0),e}startMeasuringScrollPosition(){Ce(R,"scroll",this.ne,{capture:!0}),Ce(R,"scrollend",this.ne,{capture:!0}),Ce(R,"resize",this.ne)}scrollElement(){if(!this._instance.config.scroll_root_selector)return R?.document.documentElement;var e=ue(this._instance.config.scroll_root_selector)?this._instance.config.scroll_root_selector:[this._instance.config.scroll_root_selector];for(var n of e){var s=R?.document.querySelector(n);if(s)return s}}scrollY(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollTop||0}return R&&(R.scrollY||R.pageYOffset||R.document.documentElement.scrollTop)||0}scrollX(){if(this._instance.config.scroll_root_selector){var e=this.scrollElement();return e&&e.scrollLeft||0}return R&&(R.scrollX||R.pageXOffset||R.document.documentElement.scrollLeft)||0}}var IT=t=>Vg(t?.config.mask_personal_data_properties,t?.config.custom_personal_data_properties);class fh{constructor(e,n,s,r){this.ae=i=>{var a=this.le();if(!a||a.sessionId!==i){var l={sessionId:i,props:this.ue(this._instance)};this.he.register({[Ml]:l})}},this._instance=e,this.de=n,this.he=s,this.ue=r||IT,this.de.onSessionId(this.ae)}le(){return this.he.props[Ml]}getSetOnceProps(){var e,n=(e=this.le())==null?void 0:e.props;return n?"r"in n?Fg(n):{$referring_domain:n.referringDomain,$pathname:n.initialPathName,utm_source:n.utm_source,utm_campaign:n.utm_campaign,utm_medium:n.utm_medium,utm_content:n.utm_content,utm_term:n.utm_term}:{}}getSessionProps(){var e={};return ge(Hc(this.getSetOnceProps()),(n,s)=>{s==="$current_url"&&(s="url"),e["$session_entry_"+jl(s)]=n}),e}}var Aa=je("[SessionId]");class mh{on(e,n){return this.ve.on(e,n)}constructor(e,n,s){var r;if(this.ce=[],this.fe=void 0,this.ve=new Kc,this.pe=(d,h)=>!(!ws(d)||!ws(h))&&Math.abs(d-h)>this.sessionTimeoutMs,!e.persistence)throw new Error("SessionIdManager requires a PostHogPersistence instance");if(e.config.cookieless_mode==="always")throw new Error('SessionIdManager cannot be used with cookieless_mode="always"');this.N=e.config,this.he=e.persistence,this._e=void 0,this.ge=void 0,this._sessionStartTimestamp=null,this._sessionActivityTimestamp=null,this.me=n||Nn,this.be=s||Nn;var i=this.N.persistence_name||this.N.token,a=this.N.session_idle_timeout_seconds||1800;if(this._sessionTimeoutMs=1e3*en(a,60,36e3,Aa.createLogger("session_idle_timeout_seconds"),1800),e.register({$configured_session_timeout_ms:this._sessionTimeoutMs}),this.ye(),this.we="ph_"+i+"_window_id",this.xe="ph_"+i+"_primary_window_exists",this.$e()){var l=Ve.j(this.we),c=Ve.j(this.xe);l&&!c?this._e=l:Ve.L(this.we),Ve.D(this.xe,!0)}if((r=this.N.bootstrap)!=null&&r.sessionID)try{var u=(d=>{var h=d.replace(/-/g,"");if(h.length!==32)throw new Error("Not a valid UUID");if(h[12]!=="7")throw new Error("Not a UUIDv7");return parseInt(h.substring(0,12),16)})(this.N.bootstrap.sessionID);this.Ee(this.N.bootstrap.sessionID,new Date().getTime(),u)}catch(d){Aa.error("Invalid sessionID in bootstrap",d)}this.Se()}get sessionTimeoutMs(){return this._sessionTimeoutMs}onSessionId(e){return F(this.ce)&&(this.ce=[]),this.ce.push(e),this.ge&&e(this.ge,this._e),()=>{this.ce=this.ce.filter(n=>n!==e)}}$e(){return this.N.persistence!=="memory"&&!this.he.Dt&&Ve.O()}ke(e){e!==this._e&&(this._e=e,this.$e()&&Ve.D(this.we,e))}Pe(){return this._e?this._e:this.$e()?Ve.j(this.we):null}Ee(e,n,s){e===this.ge&&n===this._sessionActivityTimestamp&&s===this._sessionStartTimestamp||(this._sessionStartTimestamp=s,this._sessionActivityTimestamp=n,this.ge=e,this.he.register({[mi]:[n,e,s]}))}Te(){var e=this.he.props[mi];return ue(e)&&e.length===2&&e.push(e[0]),e||[0,null,0]}resetSessionId(){this.Ee(null,null,null)}destroy(){clearTimeout(this.Ie),this.Ie=void 0,this.fe&&R&&(R.removeEventListener("beforeunload",this.fe,{capture:!1}),this.fe=void 0),this.ce=[]}Se(){this.fe=()=>{this.$e()&&Ve.L(this.xe)},Ce(R,"beforeunload",this.fe,{capture:!1})}checkAndGetSessionAndWindowId(e,n){if(e===void 0&&(e=!1),n===void 0&&(n=null),this.N.cookieless_mode==="always")throw new Error('checkAndGetSessionAndWindowId should not be called with cookieless_mode="always"');var s=n||new Date().getTime(),[r,i,a]=this.Te(),l=this.Pe(),c=ws(a)&&Math.abs(s-a)>864e5,u=!1,d=!i,h=!d&&!e&&this.pe(s,r);d||h||c?(i=this.me(),l=this.be(),Aa.info("new session ID generated",{sessionId:i,windowId:l,changeReason:{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:c}}),a=s,u=!0):l||(l=this.be(),u=!0);var p=ws(r)&&e&&!c?r:s,m=ws(a)?a:new Date().getTime();return this.ke(l),this.Ee(i,p,m),e||this.ye(),u&&this.ce.forEach(y=>y(i,l,u?{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:c}:void 0)),{sessionId:i,windowId:l,sessionStartTimestamp:m,changeReason:u?{noSessionId:d,activityTimeout:h,sessionPastMaximumLength:c}:void 0,lastActivityTimestamp:r}}ye(){clearTimeout(this.Ie),this.Ie=setTimeout(()=>{var[e]=this.Te();if(this.pe(new Date().getTime(),e)){var n=this.ge;this.resetSessionId(),this.ve.emit("forcedIdleReset",{idleSessionId:n})}},1.1*this.sessionTimeoutMs)}}var Ug=function(t,e){if(!t)return!1;var n=t.userAgent;if(n&&Dd(n,e))return!0;try{var s=t?.userAgentData;if(s!=null&&s.brands&&s.brands.some(r=>Dd(r?.brand,e)))return!0}catch{}return!!t.webdriver},Pr=function(t){return t.US="us",t.EU="eu",t.CUSTOM="custom",t}({}),gh="i.posthog.com";class OT{constructor(e){this.Ce={},this.instance=e}get apiHost(){var e=this.instance.config.api_host.trim().replace(/\/$/,"");return e==="https://app.posthog.com"?"https://us.i.posthog.com":e}get flagsApiHost(){var e=this.instance.config.flags_api_host;return e?e.trim().replace(/\/$/,""):this.apiHost}get uiHost(){var e,n=(e=this.instance.config.ui_host)==null?void 0:e.replace(/\/$/,"");return n||(n=this.apiHost.replace("."+gh,".posthog.com")),n==="https://app.posthog.com"?"https://us.posthog.com":n}get region(){return this.Ce[this.apiHost]||(/https:\/\/(app|us|us-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=Pr.US:/https:\/\/(eu|eu-assets)(\.i)?\.posthog\.com/i.test(this.apiHost)?this.Ce[this.apiHost]=Pr.EU:this.Ce[this.apiHost]=Pr.CUSTOM),this.Ce[this.apiHost]}endpointFor(e,n){if(n===void 0&&(n=""),n&&(n=n[0]==="/"?n:"/"+n),e==="ui")return this.uiHost+n;if(e==="flags")return this.flagsApiHost+n;if(this.region===Pr.CUSTOM)return this.apiHost+n;var s=gh+n;switch(e){case"assets":return"https://"+this.region+"-assets."+s;case"api":return"https://"+this.region+"."+s}}}var DT={icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())>-1,not_icontains:(t,e)=>!!R&&e.href.toLowerCase().indexOf(t.toLowerCase())===-1,regex:(t,e)=>!!R&&Ti(e.href,t),not_regex:(t,e)=>!!R&&!Ti(e.href,t),exact:(t,e)=>e.href===t,is_not:(t,e)=>e.href!==t};class mt{constructor(e){var n=this;this.getWebExperimentsAndEvaluateDisplayLogic=function(s){s===void 0&&(s=!1),n.getWebExperiments(r=>{mt.Re("retrieved web experiments from the server"),n.Fe=new Map,r.forEach(i=>{if(i.feature_flag_key){var a;n.Fe&&(mt.Re("setting flag key ",i.feature_flag_key," to web experiment ",i),(a=n.Fe)==null||a.set(i.feature_flag_key,i));var l=n._instance.getFeatureFlag(i.feature_flag_key);Ie(l)&&i.variants[l]&&n.Oe(i.name,l,i.variants[l].transforms)}else if(i.variants)for(var c in i.variants){var u=i.variants[c];mt.Me(u)&&n.Oe(i.name,c,u.transforms)}})},s)},this._instance=e,this._instance.onFeatureFlags(s=>{this.onFeatureFlags(s)})}onFeatureFlags(e){if(this._is_bot())mt.Re("Refusing to render web experiment since the viewer is a likely bot");else if(!this._instance.config.disable_web_experiments){if(se(this.Fe))return this.Fe=new Map,this.loadIfEnabled(),void this.previewWebExperiment();mt.Re("applying feature flags",e),e.forEach(n=>{var s;if(this.Fe&&(s=this.Fe)!=null&&s.has(n)){var r,i=this._instance.getFeatureFlag(n),a=(r=this.Fe)==null?void 0:r.get(n);i&&a!=null&&a.variants[i]&&this.Oe(a.name,i,a.variants[i].transforms)}})}}previewWebExperiment(){var e=mt.getWindowLocation();if(e!=null&&e.search){var n=bi(e?.search,"__experiment_id"),s=bi(e?.search,"__experiment_variant");n&&s&&(mt.Re("previewing web experiments "+n+" && "+s),this.getWebExperiments(r=>{this.Ae(parseInt(n),s,r)},!1,!0))}}loadIfEnabled(){this._instance.config.disable_web_experiments||this.getWebExperimentsAndEvaluateDisplayLogic()}getWebExperiments(e,n,s){if(this._instance.config.disable_web_experiments&&!s)return e([]);var r=this._instance.get_property("$web_experiments");if(r&&!n)return e(r);this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/web_experiments/?token="+this._instance.config.token),method:"GET",callback:i=>{if(i.statusCode!==200||!i.json)return e([]);var a=i.json.experiments||[];return e(a)}})}Ae(e,n,s){var r=s.filter(i=>i.id===e);r&&r.length>0&&(mt.Re("Previewing web experiment ["+r[0].name+"] with variant ["+n+"]"),this.Oe(r[0].name,n,r[0].variants[n].transforms))}static Me(e){return!se(e.conditions)&&mt.je(e)&&mt.De(e)}static je(e){var n;if(se(e.conditions)||se((n=e.conditions)==null?void 0:n.url))return!0;var s,r,i,a=mt.getWindowLocation();return!!a&&((s=e.conditions)==null||!s.url||DT[(r=(i=e.conditions)==null?void 0:i.urlMatchType)!==null&&r!==void 0?r:"icontains"](e.conditions.url,a))}static getWindowLocation(){return R?.location}static De(e){var n;if(se(e.conditions)||se((n=e.conditions)==null?void 0:n.utm))return!0;var s=Dg();if(s.utm_source){var r,i,a,l,c,u,d,h,p=(r=e.conditions)==null||(r=r.utm)==null||!r.utm_campaign||((i=e.conditions)==null||(i=i.utm)==null?void 0:i.utm_campaign)==s.utm_campaign,m=(a=e.conditions)==null||(a=a.utm)==null||!a.utm_source||((l=e.conditions)==null||(l=l.utm)==null?void 0:l.utm_source)==s.utm_source,y=(c=e.conditions)==null||(c=c.utm)==null||!c.utm_medium||((u=e.conditions)==null||(u=u.utm)==null?void 0:u.utm_medium)==s.utm_medium,_=(d=e.conditions)==null||(d=d.utm)==null||!d.utm_term||((h=e.conditions)==null||(h=h.utm)==null?void 0:h.utm_term)==s.utm_term;return p&&y&&_&&m}return!1}static Re(e){for(var n=arguments.length,s=new Array(n>1?n-1:0),r=1;r<n;r++)s[r-1]=arguments[r];$.info("[WebExperiments] "+e,s)}Oe(e,n,s){this._is_bot()?mt.Re("Refusing to render web experiment since the viewer is a likely bot"):n!=="control"?s.forEach(r=>{if(r.selector){var i;mt.Re("applying transform of variant "+n+" for experiment "+e+" ",r);var a=(i=document)==null?void 0:i.querySelectorAll(r.selector);a?.forEach(l=>{var c=l;r.html&&(c.innerHTML=r.html),r.css&&c.setAttribute("style",r.css)})}}):mt.Re("Control variants leave the page unmodified.")}_is_bot(){return St&&this._instance?Ug(St,this._instance.config.custom_blocked_useragents):void 0}}var LT=je("[PostHog ExternalIntegrations]"),MT={intercom:"intercom-integration",crispChat:"crisp-chat-integration"};class NT{constructor(e){this._instance=e}V(e,n){var s;(s=G.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,e,r=>{if(r)return LT.error("failed to load script",r);n()})}startIfEnabledOrStop(){var e=this,n=function(a){var l,c,u;!r||(l=G.__PosthogExtensions__)!=null&&(l=l.integrations)!=null&&l[a]||e.V(MT[a],()=>{var d;(d=G.__PosthogExtensions__)==null||(d=d.integrations)==null||(d=d[a])==null||d.start(e._instance)}),!r&&(c=G.__PosthogExtensions__)!=null&&(c=c.integrations)!=null&&c[a]&&((u=G.__PosthogExtensions__)==null||(u=u.integrations)==null||(u=u[a])==null||u.stop())};for(var[s,r]of Object.entries((i=this._instance.config.integrations)!==null&&i!==void 0?i:{})){var i;n(s)}}}var Lr={},Ca=0,Hl=()=>{},js="posthog",Hg=!tT&&bt?.indexOf("MSIE")===-1&&bt?.indexOf("Mozilla")===-1,vh=t=>{var e;return V({api_host:"https://us.i.posthog.com",flags_api_host:null,ui_host:null,token:"",autocapture:!0,cross_subdomain_cookie:Aj(N?.location),persistence:"localStorage+cookie",persistence_name:"",cookie_persisted_properties:[],loaded:Hl,save_campaign_params:!0,custom_campaign_params:[],custom_blocked_useragents:[],save_referrer:!0,capture_pageleave:"if_capture_pageview",defaults:t??"unset",__preview_deferred_init_extensions:!1,debug:Fe&&Ie(Fe?.search)&&Fe.search.indexOf("__posthog_debug=true")!==-1||!1,cookie_expiration:365,upgrade:!1,disable_session_recording:!1,disable_persistence:!1,disable_web_experiments:!0,disable_surveys:!1,disable_surveys_automatic_display:!1,disable_conversations:!1,disable_product_tours:!1,disable_external_dependency_loading:!1,enable_recording_console_log:void 0,secure_cookie:(R==null||(e=R.location)==null?void 0:e.protocol)==="https:",ip:!1,opt_out_capturing_by_default:!1,opt_out_persistence_by_default:!1,opt_out_useragent_filter:!1,opt_out_capturing_persistence_type:"localStorage",consent_persistence_name:null,opt_out_capturing_cookie_prefix:null,opt_in_site_apps:!1,property_denylist:[],respect_dnt:!1,sanitize_properties:null,request_headers:{},request_batching:!0,properties_string_max_length:65535,mask_all_element_attributes:!1,mask_all_text:!1,mask_personal_data_properties:!1,custom_personal_data_properties:[],advanced_disable_flags:!1,advanced_disable_decide:!1,advanced_disable_feature_flags:!1,advanced_disable_feature_flags_on_first_load:!1,advanced_only_evaluate_survey_feature_flags:!1,advanced_enable_surveys:!1,advanced_disable_toolbar_metrics:!1,feature_flag_request_timeout_ms:3e3,surveys_request_timeout_ms:1e4,on_request_error:n=>{var s="Bad HTTP status: "+n.statusCode+" "+n.text;$.error(s)},get_device_id:n=>n,capture_performance:void 0,name:"posthog",bootstrap:{},disable_compression:!1,session_idle_timeout_seconds:1800,person_profiles:"identified_only",before_send:void 0,request_queue_config:{flush_interval_ms:Ul},error_tracking:{},_onCapture:Hl,__preview_eager_load_replay:!1},(n=>({rageclick:!(n&&n>="2025-11-30")||{content_ignorelist:!0},capture_pageview:!(n&&n>="2025-05-24")||"history_change",session_recording:n&&n>="2025-11-30"?{strictMinimumDuration:!0}:{},external_scripts_inject_target:n&&n>="2026-01-30"?"head":"body",internal_or_test_user_hostname:n&&n>="2026-01-30"?/^(localhost|127\.0\.0\.1)$/:void 0}))(t))},_h=t=>{var e={};F(t.process_person)||(e.person_profiles=t.process_person),F(t.xhr_headers)||(e.request_headers=t.xhr_headers),F(t.cookie_name)||(e.persistence_name=t.cookie_name),F(t.disable_cookie)||(e.disable_persistence=t.disable_cookie),F(t.store_google)||(e.save_campaign_params=t.store_google),F(t.verbose)||(e.debug=t.verbose);var n=Re({},e,t);return ue(t.property_blacklist)&&(F(t.property_denylist)?n.property_denylist=t.property_blacklist:ue(t.property_denylist)?n.property_denylist=[...t.property_blacklist,...t.property_denylist]:$.error("Invalid value for property_denylist config: "+t.property_denylist)),n};class VT{constructor(){this.__forceAllowLocalhost=!1}get Le(){return this.__forceAllowLocalhost}set Le(e){$.error("WebPerformanceObserver is deprecated and has no impact on network capture. Use `_forceAllowLocalhostNetworkCapture` on `posthog.sessionRecording`"),this.__forceAllowLocalhost=e}}class tn{get decideEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}get flagsEndpointWasHit(){var e,n;return(e=(n=this.featureFlags)==null?void 0:n.hasLoadedFlags)!==null&&e!==void 0&&e}constructor(){this.webPerformance=new VT,this.Ne=!1,this.version=_n.LIB_VERSION,this.Tt=new Kc,this._calculate_event_properties=this.calculateEventProperties.bind(this),this.config=vh(),this.SentryIntegration=Uj,this.sentryIntegration=e=>function(n,s){var r=Pg(n,s);return{name:Tg,processEvent:i=>r(i)}}(this,e),this.__request_queue=[],this.__loaded=!1,this.analyticsDefaultEndpoint="/e/",this.Ue=!1,this.ze=null,this.He=null,this.Be=null,this.featureFlags=new gT(this),this.toolbar=new Gj(this),this.scrollManager=new CT(this),this.pageViewManager=new eh(this),this.surveys=new jT(this),this.conversations=new TT(this),this.logs=new PT(this),this.experiments=new mt(this),this.exceptions=new nT(this),this.rateLimiter=new kT(this),this.requestRouter=new OT(this),this.consent=new Fj(this),this.externalIntegrations=new NT(this),this.people={set:(e,n,s)=>{var r=Ie(e)?{[e]:n}:e;this.setPersonProperties(r),s?.({})},set_once:(e,n,s)=>{var r=Ie(e)?{[e]:n}:e;this.setPersonProperties(void 0,r),s?.({})}},this.on("eventCaptured",e=>$.info('send "'+e?.event+'"',e))}init(e,n,s){if(s&&s!==js){var r,i=(r=Lr[s])!==null&&r!==void 0?r:new tn;return i._init(e,n,s),Lr[s]=i,Lr[js][s]=i,i}return this._init(e,n,s)}_init(e,n,s){var r;if(n===void 0&&(n={}),F(e)||Tl(e))return $.critical("PostHog was initialized without a token. This likely indicates a misconfiguration. Please check the first argument passed to posthog.init()"),this;if(this.__loaded)return console.warn("[PostHog.js]","You have already initialized PostHog! Re-initializing is a no-op"),this;this.__loaded=!0,this.config={},n.debug=this.qe(n.debug),this.We=n,this.Ge=[],n.person_profiles?this.He=n.person_profiles:n.process_person&&(this.He=n.process_person),this.set_config(Re({},vh(n.defaults),_h(n),{name:s,token:e})),this.config.on_xhr_error&&$.error("on_xhr_error is deprecated. Use on_request_error instead"),this.compression=n.disable_compression?void 0:Zt.GZipJS;var i=this.Ve();this.persistence=new Ra(this.config,i),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ra(V({},this.config,{persistence:"sessionStorage"}),i);var a=V({},this.persistence.props),l=V({},this.sessionPersistence.props);this.register({$initialization_time:new Date().toISOString()}),this.Je=new ST(w=>this.Ke(w),this.config.request_queue_config),this.Ye=new AT(this),this.__request_queue=[];var c=this.config.cookieless_mode==="always"||this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut();if(c||(this.sessionManager=new mh(this),this.sessionPropsManager=new fh(this,this.sessionManager,this.persistence)),this.config.__preview_deferred_init_extensions?($.info("Deferring extension initialization to improve startup performance"),setTimeout(()=>{this.Xe(c)},0)):($.info("Initializing extensions synchronously"),this.Xe(c)),_n.DEBUG=_n.DEBUG||this.config.debug,_n.DEBUG&&$.info("Starting in debug mode",{this:this,config:n,thisC:V({},this.config),p:a,s:l}),((r=n.bootstrap)==null?void 0:r.distinctID)!==void 0){var u,d,h=this.config.get_device_id(Nn()),p=(u=n.bootstrap)!=null&&u.isIdentifiedID?h:n.bootstrap.distinctID;this.persistence.set_property(Yt,(d=n.bootstrap)!=null&&d.isIdentifiedID?"identified":"anonymous"),this.register({distinct_id:n.bootstrap.distinctID,$device_id:p})}if(this.Qe()){var m,y,_=Object.keys(((m=n.bootstrap)==null?void 0:m.featureFlags)||{}).filter(w=>{var E;return!((E=n.bootstrap)==null||(E=E.featureFlags)==null||!E[w])}).reduce((w,E)=>{var T;return w[E]=((T=n.bootstrap)==null||(T=T.featureFlags)==null?void 0:T[E])||!1,w},{}),x=Object.keys(((y=n.bootstrap)==null?void 0:y.featureFlagPayloads)||{}).filter(w=>_[w]).reduce((w,E)=>{var T,j;return(T=n.bootstrap)!=null&&(T=T.featureFlagPayloads)!=null&&T[E]&&(w[E]=(j=n.bootstrap)==null||(j=j.featureFlagPayloads)==null?void 0:j[E]),w},{});this.featureFlags.receivedFeatureFlags({featureFlags:_,featureFlagPayloads:x})}if(c)this.register_once({distinct_id:ur,$device_id:null},"");else if(!this.get_distinct_id()){var b=this.config.get_device_id(Nn());this.register_once({distinct_id:b,$device_id:b},""),this.persistence.set_property(Yt,"anonymous")}return Ce(R,"onpagehide"in self?"pagehide":"unload",this._handle_unload.bind(this),{passive:!1}),this.toolbar.maybeLoadToolbar(),n.segment?zj(this,()=>this.Ze()):this.Ze(),bn(this.config._onCapture)&&this.config._onCapture!==Hl&&($.warn("onCapture is deprecated. Please use `before_send` instead"),this.on("eventCaptured",w=>this.config._onCapture(w.event,w))),this.config.ip&&$.warn('The `ip` config option has NO EFFECT AT ALL and has been deprecated. Use a custom transformation or "Discard IP data" project setting instead. See https://posthog.com/tutorials/web-redact-properties#hiding-customer-ip-address for more information.'),this}Xe(e){var n=performance.now(),s=V({},tn.__defaultExtensionClasses,this.config.__extensionClasses);s.historyAutocapture&&(this.historyAutocapture=new s.historyAutocapture(this),this.historyAutocapture.startIfEnabled());var r=[];s.tracingHeaders&&r.push(()=>{new s.tracingHeaders(this).startIfEnabledOrStop()}),s.siteApps&&r.push(()=>{var i;this.siteApps=new s.siteApps(this),(i=this.siteApps)==null||i.init()}),!e&&s.sessionRecording&&r.push(()=>{this.sessionRecording=new s.sessionRecording(this),this.sessionRecording.startIfEnabledOrStop()}),this.config.disable_scroll_properties||r.push(()=>{this.scrollManager.startMeasuringScrollPosition()}),s.autocapture&&r.push(()=>{this.autocapture=new s.autocapture(this),this.autocapture.startIfEnabled()}),r.push(()=>{this.surveys.loadIfEnabled()}),r.push(()=>{this.logs.loadIfEnabled()}),r.push(()=>{this.conversations.loadIfEnabled()}),s.productTours&&r.push(()=>{this.productTours=new s.productTours(this),this.productTours.loadIfEnabled()}),s.heatmaps&&r.push(()=>{this.heatmaps=new s.heatmaps(this),this.heatmaps.startIfEnabled()}),s.webVitalsAutocapture&&r.push(()=>{this.webVitalsAutocapture=new s.webVitalsAutocapture(this)}),s.exceptionObserver&&r.push(()=>{this.exceptionObserver=new s.exceptionObserver(this),this.exceptionObserver.startIfEnabledOrStop()}),s.deadClicksAutocapture&&r.push(()=>{this.deadClicksAutocapture=new s.deadClicksAutocapture(this,Bj),this.deadClicksAutocapture.startIfEnabledOrStop()}),r.push(()=>{if(this.tr){var i=this.tr;this.tr=void 0,this.Ni(i)}}),this.ir(r,n)}ir(e,n){for(;e.length>0;){if(this.config.__preview_deferred_init_extensions&&performance.now()-n>=30&&e.length>0)return void setTimeout(()=>{this.ir(e,n)},0);var s=e.shift();if(s)try{s()}catch(i){$.error("Error initializing extension:",i)}}var r=Math.round(performance.now()-n);this.register_for_session({$sdk_debug_extensions_init_method:this.config.__preview_deferred_init_extensions?"deferred":"synchronous",$sdk_debug_extensions_init_time_ms:r}),this.config.__preview_deferred_init_extensions&&$.info("PostHog extensions initialized ("+r+"ms)")}Ni(e){var n,s,r,i,a,l,c,u,d;if(!N||!N.body)return $.info("document not ready yet, trying again in 500 milliseconds..."),void setTimeout(()=>{this.Ni(e)},500);this.config.__preview_deferred_init_extensions&&(this.tr=e),this.compression=void 0,e.supportedCompression&&!this.config.disable_compression&&(this.compression=te(e.supportedCompression,Zt.GZipJS)?Zt.GZipJS:te(e.supportedCompression,Zt.Base64)?Zt.Base64:void 0),(n=e.analytics)!=null&&n.endpoint&&(this.analyticsDefaultEndpoint=e.analytics.endpoint),this.set_config({person_profiles:this.He?this.He:"identified_only"}),(s=this.siteApps)==null||s.onRemoteConfig(e),(r=this.sessionRecording)==null||r.onRemoteConfig(e),(i=this.autocapture)==null||i.onRemoteConfig(e),(a=this.heatmaps)==null||a.onRemoteConfig(e),this.surveys.onRemoteConfig(e),this.logs.onRemoteConfig(e),this.conversations.onRemoteConfig(e),(l=this.productTours)==null||l.onRemoteConfig(e),(c=this.webVitalsAutocapture)==null||c.onRemoteConfig(e),(u=this.exceptionObserver)==null||u.onRemoteConfig(e),this.exceptions.onRemoteConfig(e),(d=this.deadClicksAutocapture)==null||d.onRemoteConfig(e)}Ze(){try{this.config.loaded(this)}catch(s){$.critical("`loaded` function failed",s)}if(this.er(),this.config.internal_or_test_user_hostname&&Fe!=null&&Fe.hostname){var e=Fe.hostname,n=this.config.internal_or_test_user_hostname;(typeof n=="string"?e===n:n.test(e))&&this.setInternalOrTestUser()}this.config.capture_pageview&&setTimeout(()=>{(this.consent.isOptedIn()||this.config.cookieless_mode==="always")&&this.rr()},1),this.sr=new zg(this),this.sr.load()}er(){var e;this.is_capturing()&&this.config.request_batching&&((e=this.Je)==null||e.enable())}_dom_loaded(){this.is_capturing()&&Vn(this.__request_queue,e=>this.Ke(e)),this.__request_queue=[],this.er()}_handle_unload(){var e,n;this.surveys.handlePageUnload(),this.config.request_batching?(this.nr()&&this.capture("$pageleave"),(e=this.Je)==null||e.unload(),(n=this.Ye)==null||n.unload()):this.nr()&&this.capture("$pageleave",null,{transport:"sendBeacon"})}_send_request(e){this.__loaded&&(Hg?this.__request_queue.push(e):this.rateLimiter.isServerRateLimited(e.batchKey)||(e.transport=e.transport||this.config.api_transport,e.url=ji(e.url,{ip:this.config.ip?1:0}),e.headers=V({},this.config.request_headers,e.headers),e.compression=e.compression==="best-available"?this.compression:e.compression,e.disableXHRCredentials=this.config.__preview_disable_xhr_credentials,this.config.__preview_disable_beacon&&(e.disableTransport=["sendBeacon"]),e.fetchOptions=e.fetchOptions||this.config.fetch_options,(n=>{var s,r,i,a=V({},n);a.timeout=a.timeout||6e4,a.url=ji(a.url,{_:new Date().getTime().toString(),ver:_n.LIB_VERSION,compression:a.compression});var l=(s=a.transport)!==null&&s!==void 0?s:"fetch",c=Zo.filter(d=>!a.disableTransport||!d.transport||!a.disableTransport.includes(d.transport)),u=(r=(i=_g(c,d=>d.transport===l))==null?void 0:i.method)!==null&&r!==void 0?r:c[0].method;if(!u)throw new Error("No available transport method");u(a)})(V({},e,{callback:n=>{var s,r;this.rateLimiter.checkForLimiting(n),n.statusCode>=400&&((s=(r=this.config).on_request_error)==null||s.call(r,n)),e.callback==null||e.callback(n)}}))))}Ke(e){this.Ye?this.Ye.retriableRequest(e):this._send_request(e)}_execute_array(e){Ca++;try{var n,s=[],r=[],i=[];Vn(e,l=>{l&&(n=l[0],ue(n)?i.push(l):bn(l)?l.call(this):ue(l)&&n==="alias"?s.push(l):ue(l)&&n.indexOf("capture")!==-1&&bn(this[n])?i.push(l):r.push(l))});var a=function(l,c){Vn(l,function(u){if(ue(u[0])){var d=c;ge(u,function(h){d=d[h[0]].apply(d,h.slice(1))})}else this[u[0]].apply(this,u.slice(1))},c)};a(s,this),a(r,this),a(i,this)}finally{Ca--}}Qe(){var e,n;return((e=this.config.bootstrap)==null?void 0:e.featureFlags)&&Object.keys((n=this.config.bootstrap)==null?void 0:n.featureFlags).length>0||!1}push(e){if(Ca>0&&ue(e)&&Ie(e[0])){var n=tn.prototype[e[0]];bn(n)&&n.apply(this,e.slice(1))}else this._execute_array([e])}capture(e,n,s){var r;if(this.__loaded&&this.persistence&&this.sessionPersistence&&this.Je){if(this.is_capturing())if(!F(e)&&Ie(e)){var i=!this.config.opt_out_useragent_filter&&this._is_bot();if(!(i&&!this.config.__preview_capture_bot_pageviews)){var a=s!=null&&s.skip_client_rate_limiting?void 0:this.rateLimiter.clientRateLimitContext();if(a==null||!a.isRateLimited){n!=null&&n.$current_url&&!Ie(n?.$current_url)&&($.error("Invalid `$current_url` property provided to `posthog.capture`. Input must be a string. Ignoring provided value."),n==null||delete n.$current_url),e!=="$exception"||s!=null&&s.ft||$.warn("Using `posthog.capture('$exception')` is unreliable because it does not attach required metadata. Use `posthog.captureException(error)` instead, which attaches required metadata automatically."),this.sessionPersistence.update_search_keyword(),this.config.save_campaign_params&&this.sessionPersistence.update_campaign_params(),this.config.save_referrer&&this.sessionPersistence.update_referrer_info(),(this.config.save_campaign_params||this.config.save_referrer)&&this.persistence.set_initial_person_info();var l=new Date,c=s?.timestamp||l,u=Nn(),d={uuid:u,event:e,properties:this.calculateEventProperties(e,n||{},c,u)};e==="$pageview"&&this.config.__preview_capture_bot_pageviews&&i&&(d.event="$bot_pageview",d.properties.$browser_type="bot"),a&&(d.properties.$lib_rate_limit_remaining_tokens=a.remainingTokens),s?.$set&&(d.$set=s?.$set);var h,p=e!=="$groupidentify",m=this.ar(s?.$set_once,p);if(m&&(d.$set_once=m),(d=Sj(d,s!=null&&s._noTruncate?null:this.config.properties_string_max_length)).timestamp=c,F(s?.timestamp)||(d.properties.$event_time_override_provided=!0,d.properties.$event_time_override_system_time=l),e===ks.DISMISSED||e===ks.SENT){var y=n?.[Qo.SURVEY_ID],_=n?.[Qo.SURVEY_ITERATION];h={id:y,current_iteration:_},localStorage.getItem(hh(h))||localStorage.setItem(hh(h),"true"),d.$set=V({},d.$set,{[_T({id:y,current_iteration:_},e===ks.SENT?"responded":"dismissed")]:!0})}else e===ks.SHOWN&&(d.$set=V({},d.$set,{[Qo.SURVEY_LAST_SEEN_DATE]:new Date().toISOString()}));var x=V({},d.properties.$set,d.$set);if(Ts(x)||this.setPersonPropertiesForFlags(x),!se(this.config.before_send)){var b=this.lr(d);if(!b)return;d=b}this.Tt.emit("eventCaptured",d);var w={method:"POST",url:(r=s?._url)!==null&&r!==void 0?r:this.requestRouter.endpointFor("api",this.analyticsDefaultEndpoint),data:d,compression:"best-available",batchKey:s?._batchKey};return!this.config.request_batching||s&&(s==null||!s._batchKey)||s!=null&&s.send_instantly?this.Ke(w):this.Je.enqueue(w),d}$.critical("This capture call is ignored due to client rate limiting.")}}else $.error("No event name provided to posthog.capture")}else $.uninitializedWarning("posthog.capture")}_addCaptureHook(e){return this.on("eventCaptured",n=>e(n.event,n))}calculateEventProperties(e,n,s,r,i){if(s=s||new Date,!this.persistence||!this.sessionPersistence)return n;var a=i?void 0:this.persistence.remove_event_timer(e),l=V({},n);if(l.token=this.config.token,l.$config_defaults=this.config.defaults,(this.config.cookieless_mode=="always"||this.config.cookieless_mode=="on_reject"&&this.consent.isExplicitlyOptedOut())&&(l.$cookieless_mode=!0),e==="$snapshot"){var c=V({},this.persistence.properties(),this.sessionPersistence.properties());return l.distinct_id=c.distinct_id,(!Ie(l.distinct_id)&&!Pn(l.distinct_id)||Tl(l.distinct_id))&&$.error("Invalid distinct_id for replay event. This indicates a bug in your implementation"),l}var u,d=iT(this.config.mask_personal_data_properties,this.config.custom_personal_data_properties);if(this.sessionManager){var{sessionId:h,windowId:p}=this.sessionManager.checkAndGetSessionAndWindowId(i,s.getTime());l.$session_id=h,l.$window_id=p}this.sessionPropsManager&&Re(l,this.sessionPropsManager.getSessionProps());try{var m;this.sessionRecording&&Re(l,this.sessionRecording.sdkDebugProperties),l.$sdk_debug_retry_queue_size=(m=this.Ye)==null?void 0:m.length}catch(b){l.$sdk_debug_error_capturing_properties=String(b)}if(this.requestRouter.region===Pr.CUSTOM&&(l.$lib_custom_api_host=this.config.api_host),u=e!=="$pageview"||i?e!=="$pageleave"||i?this.pageViewManager.doEvent():this.pageViewManager.doPageLeave(s):this.pageViewManager.doPageView(s,r),l=Re(l,u),e==="$pageview"&&N&&(l.title=N.title),!F(a)){var y=s.getTime()-a;l.$duration=parseFloat((y/1e3).toFixed(3))}bt&&this.config.opt_out_useragent_filter&&(l.$browser_type=this._is_bot()?"bot":"browser"),(l=Re({},d,this.persistence.properties(),this.sessionPersistence.properties(),l)).$is_identified=this._isIdentified(),ue(this.config.property_denylist)?ge(this.config.property_denylist,function(b){delete l[b]}):$.error("Invalid value for property_denylist config: "+this.config.property_denylist+" or property_blacklist config: "+this.config.property_blacklist);var _=this.config.sanitize_properties;_&&($.error("sanitize_properties is deprecated. Use before_send instead"),l=_(l,e));var x=this.ur();return l.$process_person_profile=x,x&&!i&&this.hr("_calculate_event_properties"),l}ar(e,n){var s;if(n===void 0&&(n=!0),!this.persistence||!this.ur()||this.Ne)return e;var r=this.persistence.get_initial_props(),i=(s=this.sessionPropsManager)==null?void 0:s.getSetOnceProps(),a=Re({},r,i||{},e||{}),l=this.config.sanitize_properties;return l&&($.error("sanitize_properties is deprecated. Use before_send instead"),a=l(a,"$set_once")),n&&(this.Ne=!0),Ts(a)?void 0:a}register(e,n){var s;(s=this.persistence)==null||s.register(e,n)}register_once(e,n,s){var r;(r=this.persistence)==null||r.register_once(e,n,s)}register_for_session(e){var n;(n=this.sessionPersistence)==null||n.register(e)}unregister(e){var n;(n=this.persistence)==null||n.unregister(e)}unregister_for_session(e){var n;(n=this.sessionPersistence)==null||n.unregister(e)}dr(e,n){this.register({[e]:n})}getFeatureFlag(e,n){return this.featureFlags.getFeatureFlag(e,n)}getFeatureFlagPayload(e){return this.featureFlags.getFeatureFlagPayload(e)}getFeatureFlagResult(e,n){return this.featureFlags.getFeatureFlagResult(e,n)}isFeatureEnabled(e,n){return this.featureFlags.isFeatureEnabled(e,n)}reloadFeatureFlags(){this.featureFlags.reloadFeatureFlags()}updateFlags(e,n,s){var r=s!=null&&s.merge?this.featureFlags.getFlagVariants():{},i=s!=null&&s.merge?this.featureFlags.getFlagPayloads():{},a=V({},r,e),l=V({},i,n),c={};for(var[u,d]of Object.entries(a)){var h=typeof d=="string";c[u]={key:u,enabled:!!h||!!d,variant:h?d:void 0,reason:void 0,metadata:F(l?.[u])?void 0:{id:0,version:void 0,description:void 0,payload:l[u]}}}this.featureFlags.receivedFeatureFlags({flags:c})}updateEarlyAccessFeatureEnrollment(e,n,s){this.featureFlags.updateEarlyAccessFeatureEnrollment(e,n,s)}getEarlyAccessFeatures(e,n,s){return n===void 0&&(n=!1),this.featureFlags.getEarlyAccessFeatures(e,n,s)}on(e,n){return this.Tt.on(e,n)}onFeatureFlags(e){return this.featureFlags.onFeatureFlags(e)}onSurveysLoaded(e){return this.surveys.onSurveysLoaded(e)}onSessionId(e){var n,s;return(n=(s=this.sessionManager)==null?void 0:s.onSessionId(e))!==null&&n!==void 0?n:()=>{}}getSurveys(e,n){n===void 0&&(n=!1),this.surveys.getSurveys(e,n)}getActiveMatchingSurveys(e,n){n===void 0&&(n=!1),this.surveys.getActiveMatchingSurveys(e,n)}renderSurvey(e,n){this.surveys.renderSurvey(e,n)}displaySurvey(e,n){n===void 0&&(n=xT),this.surveys.displaySurvey(e,n)}cancelPendingSurvey(e){this.surveys.cancelPendingSurvey(e)}canRenderSurvey(e){return this.surveys.canRenderSurvey(e)}canRenderSurveyAsync(e,n){return n===void 0&&(n=!1),this.surveys.canRenderSurveyAsync(e,n)}identify(e,n,s){if(!this.__loaded||!this.persistence)return $.uninitializedWarning("posthog.identify");if(Pn(e)&&(e=e.toString(),$.warn("The first argument to posthog.identify was a number, but it should be a string. It has been converted to a string.")),e)if(["distinct_id","distinctid"].includes(e.toLowerCase()))$.critical('The string "'+e+'" was set in posthog.identify which indicates an error. This ID should be unique to the user and not a hardcoded string.');else if(e!==ur){if(this.hr("posthog.identify")){var r=this.get_distinct_id();if(this.register({$user_id:e}),!this.get_property("$device_id")){var i=r;this.register_once({$had_persisted_distinct_id:!0,$device_id:i},"")}e!==r&&e!==this.get_property(br)&&(this.unregister(br),this.register({distinct_id:e}));var a=(this.persistence.get_property(Yt)||"anonymous")==="anonymous";e!==r&&a?(this.persistence.set_property(Yt,"identified"),this.setPersonPropertiesForFlags(V({},s||{},n||{}),!1),this.capture("$identify",{distinct_id:e,$anon_distinct_id:r},{$set:n||{},$set_once:s||{}}),this.Be=ih(e,n,s),this.featureFlags.setAnonymousDistinctId(r)):(n||s)&&this.setPersonProperties(n,s),e!==r&&(this.reloadFeatureFlags(),this.unregister(gi))}}else $.critical('The string "'+ur+'" was set in posthog.identify which indicates an error. This ID is only used as a sentinel value.');else $.error("Unique user id has not been set in posthog.identify")}setPersonProperties(e,n){if((e||n)&&this.hr("posthog.setPersonProperties")){var s=ih(this.get_distinct_id(),e,n);this.Be!==s?(this.setPersonPropertiesForFlags(V({},n||{},e||{})),this.capture("$set",{$set:e||{},$set_once:n||{}}),this.Be=s):$.info("A duplicate setPersonProperties call was made with the same properties. It has been ignored.")}}group(e,n,s){if(e&&n){var r=this.getGroups();r[e]!==n&&this.resetGroupPropertiesForFlags(e),this.register({$groups:V({},r,{[e]:n})}),s&&(this.capture("$groupidentify",{$group_type:e,$group_key:n,$group_set:s}),this.setGroupPropertiesForFlags({[e]:s})),r[e]===n||s||this.reloadFeatureFlags()}else $.error("posthog.group requires a group type and group key")}resetGroups(){this.register({$groups:{}}),this.resetGroupPropertiesForFlags(),this.reloadFeatureFlags()}setPersonPropertiesForFlags(e,n){n===void 0&&(n=!0),this.featureFlags.setPersonPropertiesForFlags(e,n)}resetPersonPropertiesForFlags(){this.featureFlags.resetPersonPropertiesForFlags()}setGroupPropertiesForFlags(e,n){n===void 0&&(n=!0),this.hr("posthog.setGroupPropertiesForFlags")&&this.featureFlags.setGroupPropertiesForFlags(e,n)}resetGroupPropertiesForFlags(e){this.featureFlags.resetGroupPropertiesForFlags(e)}reset(e){var n,s,r,i,a;if($.info("reset"),!this.__loaded)return $.uninitializedWarning("posthog.reset");var l=this.get_property("$device_id");if(this.consent.reset(),(n=this.persistence)==null||n.clear(),(s=this.sessionPersistence)==null||s.clear(),this.surveys.reset(),(r=this.sr)==null||r.stop(),this.featureFlags.reset(),(i=this.persistence)==null||i.set_property(Yt,"anonymous"),(a=this.sessionManager)==null||a.resetSessionId(),this.Be=null,this.config.cookieless_mode==="always")this.register_once({distinct_id:ur,$device_id:null},"");else{var c=this.config.get_device_id(Nn());this.register_once({distinct_id:c,$device_id:e?c:l},"")}this.register({$last_posthog_reset:new Date().toISOString()},1)}get_distinct_id(){return this.get_property("distinct_id")}getGroups(){return this.get_property("$groups")||{}}get_session_id(){var e,n;return(e=(n=this.sessionManager)==null?void 0:n.checkAndGetSessionAndWindowId(!0).sessionId)!==null&&e!==void 0?e:""}get_session_replay_url(e){if(!this.sessionManager)return"";var{sessionId:n,sessionStartTimestamp:s}=this.sessionManager.checkAndGetSessionAndWindowId(!0),r=this.requestRouter.endpointFor("ui","/project/"+this.config.token+"/replay/"+n);if(e!=null&&e.withTimestamp&&s){var i,a=(i=e.timestampLookBack)!==null&&i!==void 0?i:10;if(!s)return r;r+="?t="+Math.max(Math.floor((new Date().getTime()-s)/1e3)-a,0)}return r}alias(e,n){return e===this.get_property(xg)?($.critical("Attempting to create alias for existing People user - aborting."),-2):this.hr("posthog.alias")?(F(n)&&(n=this.get_distinct_id()),e!==n?(this.dr(br,e),this.capture("$create_alias",{alias:e,distinct_id:n})):($.warn("alias matches current distinct_id - skipping api call."),this.identify(e),-1)):void 0}set_config(e){var n=V({},this.config);if(Le(e)){var s,r,i,a,l,c,u,d;Re(this.config,_h(e));var h=this.Ve();(s=this.persistence)==null||s.update_config(this.config,n,h),this.sessionPersistence=this.config.persistence==="sessionStorage"||this.config.persistence==="memory"?this.persistence:new Ra(V({},this.config,{persistence:"sessionStorage"}),h);var p=this.qe(this.config.debug);En(p)&&(this.config.debug=p),En(this.config.debug)&&(this.config.debug?(_n.DEBUG=!0,we.O()&&we.D("ph_debug","true"),$.info("set_config",{config:e,oldConfig:n,newConfig:V({},this.config)})):(_n.DEBUG=!1,we.O()&&we.L("ph_debug"))),(r=this.exceptionObserver)==null||r.onConfigChange(),(i=this.sessionRecording)==null||i.startIfEnabledOrStop(),(a=this.autocapture)==null||a.startIfEnabled(),(l=this.heatmaps)==null||l.startIfEnabled(),(c=this.exceptionObserver)==null||c.startIfEnabledOrStop(),(u=this.deadClicksAutocapture)==null||u.startIfEnabledOrStop(),this.surveys.loadIfEnabled(),this.vr(),(d=this.externalIntegrations)==null||d.startIfEnabledOrStop()}}startSessionRecording(e){var n=e===!0,s={sampling:n||!(e==null||!e.sampling),linked_flag:n||!(e==null||!e.linked_flag),url_trigger:n||!(e==null||!e.url_trigger),event_trigger:n||!(e==null||!e.event_trigger)};if(Object.values(s).some(Boolean)){var r,i,a,l,c;(r=this.sessionManager)==null||r.checkAndGetSessionAndWindowId(),s.sampling&&((i=this.sessionRecording)==null||i.overrideSampling()),s.linked_flag&&((a=this.sessionRecording)==null||a.overrideLinkedFlag()),s.url_trigger&&((l=this.sessionRecording)==null||l.overrideTrigger("url")),s.event_trigger&&((c=this.sessionRecording)==null||c.overrideTrigger("event"))}this.set_config({disable_session_recording:!1})}stopSessionRecording(){this.set_config({disable_session_recording:!0})}sessionRecordingStarted(){var e;return!((e=this.sessionRecording)==null||!e.started)}captureException(e,n){var s=new Error("PostHog syntheticException"),r=this.exceptions.buildProperties(e,{handled:!0,syntheticException:s});return this.exceptions.sendExceptionEvent(V({},r,n))}startExceptionAutocapture(e){this.set_config({capture_exceptions:e==null||e})}stopExceptionAutocapture(){this.set_config({capture_exceptions:!1})}loadToolbar(e){return this.toolbar.loadToolbar(e)}get_property(e){var n;return(n=this.persistence)==null?void 0:n.props[e]}getSessionProperty(e){var n;return(n=this.sessionPersistence)==null?void 0:n.props[e]}toString(){var e,n=(e=this.config.name)!==null&&e!==void 0?e:js;return n!==js&&(n=js+"."+n),n}_isIdentified(){var e,n;return((e=this.persistence)==null?void 0:e.get_property(Yt))==="identified"||((n=this.sessionPersistence)==null?void 0:n.get_property(Yt))==="identified"}ur(){var e,n;return!(this.config.person_profiles==="never"||this.config.person_profiles==="identified_only"&&!this._isIdentified()&&Ts(this.getGroups())&&((e=this.persistence)==null||(e=e.props)==null||!e[br])&&((n=this.persistence)==null||(n=n.props)==null||!n[_i]))}nr(){return this.config.capture_pageleave===!0||this.config.capture_pageleave==="if_capture_pageview"&&(this.config.capture_pageview===!0||this.config.capture_pageview==="history_change")}createPersonProfile(){this.ur()||this.hr("posthog.createPersonProfile")&&this.setPersonProperties({},{})}setInternalOrTestUser(){this.hr("posthog.setInternalOrTestUser")&&this.setPersonProperties({$internal_or_test_user:!0})}hr(e){return this.config.person_profiles==="never"?($.error(e+' was called, but process_person is set to "never". This call will be ignored.'),!1):(this.dr(_i,!0),!0)}Ve(){if(this.config.cookieless_mode==="always")return!0;var e=this.consent.isOptedOut(),n=this.config.opt_out_persistence_by_default||this.config.cookieless_mode==="on_reject";return this.config.disable_persistence||e&&!!n}vr(){var e,n,s,r,i=this.Ve();return((e=this.persistence)==null?void 0:e.Dt)!==i&&((s=this.persistence)==null||s.set_disabled(i)),((n=this.sessionPersistence)==null?void 0:n.Dt)!==i&&((r=this.sessionPersistence)==null||r.set_disabled(i)),i}opt_in_capturing(e){var n;if(this.config.cookieless_mode!=="always"){if(this.config.cookieless_mode==="on_reject"&&this.consent.isExplicitlyOptedOut()){var s,r,i,a,l;this.reset(!0),(s=this.sessionManager)==null||s.destroy(),(r=this.pageViewManager)==null||r.destroy(),this.sessionManager=new mh(this),this.pageViewManager=new eh(this),this.persistence&&(this.sessionPropsManager=new fh(this,this.sessionManager,this.persistence));var c=(i=(a=this.config.__extensionClasses)==null?void 0:a.sessionRecording)!==null&&i!==void 0?i:(l=tn.__defaultExtensionClasses)==null?void 0:l.sessionRecording;c&&(this.sessionRecording=new c(this),this.sessionRecording.startIfEnabledOrStop())}var u;this.consent.optInOut(!0),this.vr(),this.er(),(n=this.sessionRecording)==null||n.startIfEnabledOrStop(),this.config.cookieless_mode=="on_reject"&&this.surveys.loadIfEnabled(),(F(e?.captureEventName)||e!=null&&e.captureEventName)&&this.capture((u=e?.captureEventName)!==null&&u!==void 0?u:"$opt_in",e?.captureProperties,{send_instantly:!0}),this.config.capture_pageview&&this.rr()}else $.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}opt_out_capturing(){var e,n,s;this.config.cookieless_mode!=="always"?(this.config.cookieless_mode==="on_reject"&&this.consent.isOptedIn()&&this.reset(!0),this.consent.optInOut(!1),this.vr(),this.config.cookieless_mode==="on_reject"&&(this.register({distinct_id:ur,$device_id:null}),(e=this.sessionManager)==null||e.destroy(),(n=this.pageViewManager)==null||n.destroy(),this.sessionManager=void 0,this.sessionPropsManager=void 0,(s=this.sessionRecording)==null||s.stopRecording(),this.sessionRecording=void 0,this.rr())):$.warn('Consent opt in/out is not valid with cookieless_mode="always" and will be ignored')}has_opted_in_capturing(){return this.consent.isOptedIn()}has_opted_out_capturing(){return this.consent.isOptedOut()}get_explicit_consent_status(){var e=this.consent.consent;return e===xn.GRANTED?"granted":e===xn.DENIED?"denied":"pending"}is_capturing(){return this.config.cookieless_mode==="always"||(this.config.cookieless_mode==="on_reject"?this.consent.isExplicitlyOptedOut()||this.consent.isOptedIn():!this.has_opted_out_capturing())}clear_opt_in_out_capturing(){this.consent.reset(),this.vr()}_is_bot(){return St?Ug(St,this.config.custom_blocked_useragents):void 0}rr(){N&&(N.visibilityState==="visible"?this.Ue||(this.Ue=!0,this.capture("$pageview",{title:N.title},{send_instantly:!0}),this.ze&&(N.removeEventListener("visibilitychange",this.ze),this.ze=null)):this.ze||(this.ze=this.rr.bind(this),Ce(N,"visibilitychange",this.ze)))}debug(e){e===!1?(R?.console.log("You've disabled debug mode."),this.set_config({debug:!1})):(R?.console.log("You're now in debug mode. All calls to PostHog will be logged in your console.\nYou can disable this with `posthog.debug(false)`."),this.set_config({debug:!0}))}Rt(){var e,n,s,r,i,a,l,c=this.We||{};return"advanced_disable_flags"in c?!!c.advanced_disable_flags:this.config.advanced_disable_flags!==!1?!!this.config.advanced_disable_flags:this.config.advanced_disable_decide===!0?($.warn("Config field 'advanced_disable_decide' is deprecated. Please use 'advanced_disable_flags' instead. The old field will be removed in a future major version."),!0):(s="advanced_disable_decide",r=!1,i=$,a=(n="advanced_disable_flags")in(e=c)&&!se(e[n]),l=s in e&&!se(e[s]),a?e[n]:l?(i&&i.warn("Config field '"+s+"' is deprecated. Please use '"+n+"' instead. The old field will be removed in a future major version."),e[s]):r)}lr(e){if(se(this.config.before_send))return e;var n=ue(this.config.before_send)?this.config.before_send:[this.config.before_send],s=e;for(var r of n){if(s=r(s),se(s)){var i="Event '"+e.event+"' was rejected in beforeSend function";return WE(e.event)?$.warn(i+". This can cause unexpected behavior."):$.info(i),null}s.properties&&!Ts(s.properties)||$.warn("Event '"+e.event+"' has no properties after beforeSend function, this is likely an error.")}return s}getPageViewId(){var e;return(e=this.pageViewManager.it)==null?void 0:e.pageViewId}captureTraceFeedback(e,n){this.capture("$ai_feedback",{$ai_trace_id:String(e),$ai_feedback_text:n})}captureTraceMetric(e,n,s){this.capture("$ai_metric",{$ai_trace_id:String(e),$ai_metric_name:n,$ai_metric_value:String(s)})}qe(e){var n=En(e)&&!e,s=we.O()&&we.A("ph_debug")==="true";return!n&&(!!s||e)}}tn.__defaultExtensionClasses={},function(t,e){for(var n=0;n<e.length;n++)t.prototype[e[n]]=kj(t.prototype[e[n]])}(tn,["identify"]);function yh(t){return t instanceof Element&&(t.id===Eg||!(t.closest==null||!t.closest(".toolbar-global-fade-container")))}function Qi(t){return!!t&&t.nodeType===1}function Fn(t,e){return!!t&&!!t.tagName&&t.tagName.toLowerCase()===e.toLowerCase()}function Wg(t){return!!t&&t.nodeType===3}function Gg(t){return!!t&&t.nodeType===11}function qc(t){return t?Zi(t).split(/\s+/):[]}function xh(t){var e=R?.location.href;return!!(e&&t&&t.some(n=>e.match(n)))}function ki(t){var e="";switch(typeof t.className){case"string":e=t.className;break;case"object":e=(t.className&&"baseVal"in t.className?t.className.baseVal:null)||t.getAttribute("class")||"";break;default:e=""}return qc(e)}function Kg(t){return se(t)?null:Zi(t).split(/(\s+)/).filter(e=>Jr(e)).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)}function go(t){var e="";return Wl(t)&&!Zg(t)&&t.childNodes&&t.childNodes.length&&ge(t.childNodes,function(n){var s;Wg(n)&&n.textContent&&(e+=(s=Kg(n.textContent))!==null&&s!==void 0?s:"")}),Zi(e)}function bh(t){return F(t.target)?t.srcElement||null:(e=t.target)!=null&&e.shadowRoot?t.composedPath()[0]||null:t.target||null;var e}var Yc=["a","button","form","input","select","textarea","label"];function qg(t,e){if(F(e))return!0;var n,s=function(i){if(e.some(a=>i.matches(a)))return{v:!0}};for(var r of t)if(n=s(r))return n.v;return!1}function Yg(t){var e=t.parentNode;return!(!e||!Qi(e))&&e}var FT=["next","previous","prev",">","<"],wh=10,Eh=[".ph-no-rageclick",".ph-no-capture"];function $T(t,e){if(!R||Xc(t))return!1;var n,s,r;if(En(e)?(n=!!e&&Eh,s=void 0):(n=(r=e?.css_selector_ignorelist)!==null&&r!==void 0?r:Eh,s=e?.content_ignorelist),n===!1)return!1;var{targetElementList:i}=Xg(t,!1);return!function(a,l){if(a===!1||F(a))return!1;var c;if(a===!0)c=FT;else{if(!ue(a))return!1;if(a.length>wh)return $.error("[PostHog] content_ignorelist array cannot exceed "+wh+" items. Use css_selector_ignorelist for more complex matching."),!1;c=a.map(u=>u.toLowerCase())}return l.some(u=>{var{safeText:d,ariaLabel:h}=u;return c.some(p=>d.includes(p)||h.includes(p))})}(s,i.map(a=>{var l;return{safeText:go(a).toLowerCase(),ariaLabel:((l=a.getAttribute("aria-label"))==null?void 0:l.toLowerCase().trim())||""}}))&&!qg(i,n)}var Xc=t=>!t||Fn(t,"html")||!Qi(t),Xg=(t,e)=>{if(!R||Xc(t))return{parentIsUsefulElement:!1,targetElementList:[]};for(var n=!1,s=[t],r=t;r.parentNode&&!Fn(r,"body");)if(Gg(r.parentNode))s.push(r.parentNode.host),r=r.parentNode.host;else{var i=Yg(r);if(!i)break;if(e||Yc.indexOf(i.tagName.toLowerCase())>-1)n=!0;else{var a=R.getComputedStyle(i);a&&a.getPropertyValue("cursor")==="pointer"&&(n=!0)}s.push(i),r=i}return{parentIsUsefulElement:n,targetElementList:s}};function BT(t,e,n,s,r){var i,a,l,c;if(n===void 0&&(n=void 0),!R||Xc(t)||(i=n)!=null&&i.url_allowlist&&!xh(n.url_allowlist)||(a=n)!=null&&a.url_ignorelist&&xh(n.url_ignorelist))return!1;if((l=n)!=null&&l.dom_event_allowlist){var u=n.dom_event_allowlist;if(u&&!u.some(y=>e.type===y))return!1}var{parentIsUsefulElement:d,targetElementList:h}=Xg(t,s);if(!function(y,_){var x=_?.element_allowlist;if(F(x))return!0;var b,w=function(T){if(x.some(j=>T.tagName.toLowerCase()===j))return{v:!0}};for(var E of y)if(b=w(E))return b.v;return!1}(h,n)||!qg(h,(c=n)==null?void 0:c.css_selector_allowlist))return!1;var p=R.getComputedStyle(t);if(p&&p.getPropertyValue("cursor")==="pointer"&&e.type==="click")return!0;var m=t.tagName.toLowerCase();switch(m){case"html":return!1;case"form":return(r||["submit"]).indexOf(e.type)>=0;case"input":case"select":case"textarea":return(r||["change","click"]).indexOf(e.type)>=0;default:return d?(r||["click"]).indexOf(e.type)>=0:(r||["click"]).indexOf(e.type)>=0&&(Yc.indexOf(m)>-1||t.getAttribute("contenteditable")==="true")}}function Wl(t){for(var e=t;e.parentNode&&!Fn(e,"body");e=e.parentNode){var n=ki(e);if(te(n,"ph-sensitive")||te(n,"ph-no-capture"))return!1}if(te(ki(t),"ph-include"))return!0;var s=t.type||"";if(Ie(s))switch(s.toLowerCase()){case"hidden":case"password":return!1}var r=t.name||t.id||"";return!(Ie(r)&&/^cc|cardnum|ccnum|creditcard|csc|cvc|cvv|exp|pass|pwd|routing|seccode|securitycode|securitynum|socialsec|socsec|ssn/i.test(r.replace(/[^a-zA-Z0-9]/g,"")))}function Zg(t){return!!(Fn(t,"input")&&!["button","checkbox","submit","reset"].includes(t.type)||Fn(t,"select")||Fn(t,"textarea")||t.getAttribute("contenteditable")==="true")}var Jg="(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11})",zT=new RegExp("^(?:"+Jg+")$"),UT=new RegExp(Jg),Qg="\\d{3}-?\\d{2}-?\\d{4}",HT=new RegExp("^("+Qg+")$"),WT=new RegExp("("+Qg+")");function Jr(t,e){return e===void 0&&(e=!0),!(se(t)||Ie(t)&&(t=Zi(t),(e?zT:UT).test((t||"").replace(/[- ]/g,""))||(e?HT:WT).test(t)))}function ev(t){var e=go(t);return Jr(e=(e+" "+tv(t)).trim())?e:""}function tv(t){var e="";return t&&t.childNodes&&t.childNodes.length&&ge(t.childNodes,function(n){var s;if(n&&((s=n.tagName)==null?void 0:s.toLowerCase())==="span")try{var r=go(n);e=(e+" "+r).trim(),n.childNodes&&n.childNodes.length&&(e=(e+" "+tv(n)).trim())}catch(i){$.error("[AutoCapture]",i)}}),e}function GT(t){return function(e){var n=e.map(s=>{var r,i,a="";if(s.tag_name&&(a+=s.tag_name),s.attr_class)for(var l of(s.attr_class.sort(),s.attr_class))a+="."+l.replace(/"/g,"");var c=V({},s.text?{text:s.text}:{},{"nth-child":(r=s.nth_child)!==null&&r!==void 0?r:0,"nth-of-type":(i=s.nth_of_type)!==null&&i!==void 0?i:0},s.href?{href:s.href}:{},s.attr_id?{attr_id:s.attr_id}:{},s.attributes),u={};return Xo(c).sort((d,h)=>{var[p]=d,[m]=h;return p.localeCompare(m)}).forEach(d=>{var[h,p]=d;return u[jh(h.toString())]=jh(p.toString())}),a+=":",a+=Xo(u).map(d=>{var[h,p]=d;return h+'="'+p+'"'}).join("")});return n.join(";")}(function(e){return e.map(n=>{var s,r,i={text:(s=n.$el_text)==null?void 0:s.slice(0,400),tag_name:n.tag_name,href:(r=n.attr__href)==null?void 0:r.slice(0,2048),attr_class:KT(n),attr_id:n.attr__id,nth_child:n.nth_child,nth_of_type:n.nth_of_type,attributes:{}};return Xo(n).filter(a=>{var[l]=a;return l.indexOf("attr__")===0}).forEach(a=>{var[l,c]=a;return i.attributes[l]=c}),i})}(t))}function jh(t){return t.replace(/"|\\"/g,'\\"')}function KT(t){var e=t.attr__class;return e?ue(e)?e:qc(e):void 0}class Th{constructor(e){this.disabled=e===!1;var n=Le(e)?e:{};this.thresholdPx=n.threshold_px||30,this.timeoutMs=n.timeout_ms||1e3,this.clickCount=n.click_count||3,this.clicks=[]}isRageClick(e,n,s){if(this.disabled)return!1;var r=this.clicks[this.clicks.length-1];if(r&&Math.abs(e-r.x)+Math.abs(n-r.y)<this.thresholdPx&&s-r.timestamp<this.timeoutMs){if(this.clicks.push({x:e,y:n,timestamp:s}),this.clicks.length===this.clickCount)return!0}else this.clicks=[{x:e,y:n,timestamp:s}];return!1}}var Ia="$copy_autocapture",Ph=je("[AutoCapture]");function Oa(t,e){return e.length>t?e.slice(0,t)+"...":e}function qT(t){if(t.previousElementSibling)return t.previousElementSibling;var e=t;do e=e.previousSibling;while(e&&!Qi(e));return e}function YT(t,e,n,s){var r=t.tagName.toLowerCase(),i={tag_name:r};Yc.indexOf(r)>-1&&!n&&(r.toLowerCase()==="a"||r.toLowerCase()==="button"?i.$el_text=Oa(1024,ev(t)):i.$el_text=Oa(1024,go(t)));var a=ki(t);a.length>0&&(i.classes=a.filter(function(d){return d!==""})),ge(t.attributes,function(d){var h;if((!Zg(t)||["name","id","class","aria-label"].indexOf(d.name)!==-1)&&(s==null||!s.includes(d.name))&&!e&&Jr(d.value)&&(h=d.name,!Ie(h)||h.substring(0,10)!=="_ngcontent"&&h.substring(0,7)!=="_nghost")){var p=d.value;d.name==="class"&&(p=qc(p).join(" ")),i["attr__"+d.name]=Oa(1024,p)}});for(var l=1,c=1,u=t;u=qT(u);)l++,u.tagName===t.tagName&&c++;return i.nth_child=l,i.nth_of_type=c,i}function XT(t,e){for(var n,s,{e:r,maskAllElementAttributes:i,maskAllText:a,elementAttributeIgnoreList:l,elementsChainAsString:c}=e,u=[t],d=t;d.parentNode&&!Fn(d,"body");)Gg(d.parentNode)?(u.push(d.parentNode.host),d=d.parentNode.host):(u.push(d.parentNode),d=d.parentNode);var h,p=[],m={},y=!1,_=!1;if(ge(u,T=>{var j=Wl(T);T.tagName.toLowerCase()==="a"&&(y=T.getAttribute("href"),y=j&&y&&Jr(y)&&y),te(ki(T),"ph-no-capture")&&(_=!0),p.push(YT(T,i,a,l));var P=function(k){if(!Wl(k))return{};var S={};return ge(k.attributes,function(D){if(D.name&&D.name.indexOf("data-ph-capture-attribute")===0){var A=D.name.replace("data-ph-capture-attribute-",""),B=D.value;A&&B&&Jr(B)&&(S[A]=B)}}),S}(T);Re(m,P)}),_)return{props:{},explicitNoCapture:_};if(a||(t.tagName.toLowerCase()==="a"||t.tagName.toLowerCase()==="button"?p[0].$el_text=ev(t):p[0].$el_text=go(t)),y){var x,b;p[0].attr__href=y;var w=(x=xi(y))==null?void 0:x.host,E=R==null||(b=R.location)==null?void 0:b.host;w&&E&&w!==E&&(h=y)}return{props:Re({$event_type:r.type,$ce_version:1},c?{}:{$elements:p},{$elements_chain:GT(p)},(n=p[0])!=null&&n.$el_text?{$el_text:(s=p[0])==null?void 0:s.$el_text}:{},h&&r.type==="click"?{$external_click_url:h}:{},m)}}var vr=je("[ExceptionAutocapture]");function kh(t,e,n){try{if(!(e in t))return()=>{};var s=t[e],r=n(s);return bn(r)&&(r.prototype=r.prototype||{},Object.defineProperties(r,{__posthog_wrapped__:{enumerable:!1,value:!0}})),t[e]=r,()=>{t[e]=s}}catch{return()=>{}}}var ZT=je("[TracingHeaders]"),Cn=je("[Web Vitals]"),Sh=9e5;je("[SessionRecording]");var Gl="[SessionRecording]",_s=je(Gl),JT=je("[Heatmaps]");function Rh(t){return Le(t)&&"clientX"in t&&"clientY"in t&&Pn(t.clientX)&&Pn(t.clientY)}var Ah=je("[Product Tours]"),Da="ph_product_tours",QT=["$set_once","$set"],In=je("[SiteApps]"),eP={sessionRecording:class{get started(){var t;return!((t=this.cr)==null||!t.isStarted)}get status(){return this.cr?this.cr.status:this.pr&&!this._r?"disabled":"lazy_loading"}constructor(t){if(this._forceAllowLocalhostNetworkCapture=!1,this.pr=!1,this.gr=!1,this.mr=void 0,this._instance=t,!this._instance.sessionManager)throw _s.error("started without valid sessionManager"),new Error(Gl+" started without valid sessionManager. This is a bug.");if(this._instance.config.cookieless_mode==="always")throw new Error(Gl+' cannot be used with cookieless_mode="always"')}get _r(){var t,e=!((t=this._instance.get_property(Oo))==null||!t.enabled),n=!this._instance.config.disable_session_recording,s=this._instance.config.disable_session_recording||this._instance.consent.isOptedOut();return R&&e&&n&&!s}startIfEnabledOrStop(t){var e;if(!this._r||(e=this.cr)==null||!e.isStarted){var n=!F(Object.assign)&&!F(Array.from);this._r&&n?(this.br(t),_s.info("starting")):this.stopRecording()}}br(t){var e,n,s;this._r&&(G!=null&&(e=G.__PosthogExtensions__)!=null&&(e=e.rrweb)!=null&&e.record&&(n=G.__PosthogExtensions__)!=null&&n.initSessionRecording?this.yr(t):(s=G.__PosthogExtensions__)==null||s.loadExternalDependency==null||s.loadExternalDependency(this._instance,this.wr,r=>{if(r)return _s.error("could not load recorder",r);this.yr(t)}))}stopRecording(){var t,e;(t=this.mr)==null||t.call(this),this.mr=void 0,(e=this.cr)==null||e.stop()}$r(){var t;(t=this._instance.persistence)==null||t.unregister(wg)}Er(t){if(this._instance.persistence){var e,n,s=this._instance.persistence,r=()=>{var i=t.sessionRecording===!1?void 0:t.sessionRecording,a=i?.sampleRate,l=se(a)?null:parseFloat(a);se(l)&&this.$r();var c=i?.minimumDurationMilliseconds;s.register({[Oo]:V({cache_timestamp:Date.now(),enabled:!!i},i,{networkPayloadCapture:V({capturePerformance:t.capturePerformance},i?.networkPayloadCapture),canvasRecording:{enabled:i?.recordCanvas,fps:i?.canvasFps,quality:i?.canvasQuality},sampleRate:l,minimumDurationMilliseconds:F(c)?null:c,endpoint:i?.endpoint,triggerMatchType:i?.triggerMatchType,masking:i?.masking,urlTriggers:i?.urlTriggers})})};r(),(e=this.mr)==null||e.call(this),this.mr=(n=this._instance.sessionManager)==null?void 0:n.onSessionId(r)}}onRemoteConfig(t){"sessionRecording"in t?t.sessionRecording!==!1?(this.gr=!1,this.Er(t),this.pr=!0,this.startIfEnabledOrStop()):this.pr=!0:_s.info("skipping remote config with no sessionRecording",t)}log(t,e){var n;e===void 0&&(e="log"),(n=this.cr)!=null&&n.log?this.cr.log(t,e):_s.warn("log called before recorder was ready")}get wr(){var t,e,n=(t=this._instance)==null||(t=t.persistence)==null?void 0:t.get_property(Oo);return(n==null||(e=n.scriptConfig)==null?void 0:e.script)||"lazy-recorder"}Sr(){var t,e=this._instance.get_property(Oo);if(!e)return!1;var n=(t=(typeof e=="object"?e:JSON.parse(e)).cache_timestamp)!==null&&t!==void 0?t:Date.now();return Date.now()-n<=3e5}yr(t){var e,n;if((e=G.__PosthogExtensions__)==null||!e.initSessionRecording)throw Error("Called on script loaded before session recording is available");this.cr||(this.cr=(n=G.__PosthogExtensions__)==null?void 0:n.initSessionRecording(this._instance),this.cr._forceAllowLocalhostNetworkCapture=this._forceAllowLocalhostNetworkCapture),this.Sr()?this.cr.start(t):this.gr||(this.gr=!0,_s.info("persisted remote config is stale, requesting fresh config before starting"),new zg(this._instance).load())}onRRwebEmit(t){var e;(e=this.cr)==null||e.onRRwebEmit==null||e.onRRwebEmit(t)}overrideLinkedFlag(){var t,e;this.cr||(e=this._instance.persistence)==null||e.register({$replay_override_linked_flag:!0}),(t=this.cr)==null||t.overrideLinkedFlag()}overrideSampling(){var t,e;this.cr||(e=this._instance.persistence)==null||e.register({$replay_override_sampling:!0}),(t=this.cr)==null||t.overrideSampling()}overrideTrigger(t){var e,n;this.cr||(n=this._instance.persistence)==null||n.register({[t==="url"?"$replay_override_url_trigger":"$replay_override_event_trigger"]:!0}),(e=this.cr)==null||e.overrideTrigger(t)}get sdkDebugProperties(){var t;return((t=this.cr)==null?void 0:t.sdkDebugProperties)||{$recording_status:this.status}}tryAddCustomEvent(t,e){var n;return!((n=this.cr)==null||!n.tryAddCustomEvent(t,e))}}},tP={autocapture:class{constructor(t){this.kr=!1,this.Pr=null,this.Tr=!1,this.instance=t,this.rageclicks=new Th(t.config.rageclick),this.Ir=null}get N(){var t,e,n=Le(this.instance.config.autocapture)?this.instance.config.autocapture:{};return n.url_allowlist=(t=n.url_allowlist)==null?void 0:t.map(s=>new RegExp(s)),n.url_ignorelist=(e=n.url_ignorelist)==null?void 0:e.map(s=>new RegExp(s)),n}Cr(){if(this.isBrowserSupported()){if(R&&N){var t=n=>{n=n||R?.event;try{this.Rr(n)}catch(s){Ph.error("Failed to capture event",s)}};if(Ce(N,"submit",t,{capture:!0}),Ce(N,"change",t,{capture:!0}),Ce(N,"click",t,{capture:!0}),this.N.capture_copied_text){var e=n=>{n=n||R?.event,this.Rr(n,Ia)};Ce(N,"copy",e,{capture:!0}),Ce(N,"cut",e,{capture:!0})}}}else Ph.info("Disabling Automatic Event Collection because this browser is not supported")}startIfEnabled(){this.isEnabled&&!this.kr&&(this.Cr(),this.kr=!0)}onRemoteConfig(t){t.elementsChainAsString&&(this.Tr=t.elementsChainAsString),this.instance.persistence&&this.instance.persistence.register({[Ud]:!!t.autocapture_opt_out}),this.Pr=!!t.autocapture_opt_out,this.startIfEnabled()}setElementSelectors(t){this.Ir=t}getElementSelectors(t){var e,n=[];return(e=this.Ir)==null||e.forEach(s=>{var r=N?.querySelectorAll(s);r?.forEach(i=>{t===i&&n.push(s)})}),n}get isEnabled(){var t,e,n=(t=this.instance.persistence)==null?void 0:t.props[Ud],s=this.Pr;if(Ht(s)&&!En(n)&&!this.instance.Rt())return!1;var r=(e=this.Pr)!==null&&e!==void 0?e:!!n;return!!this.instance.config.autocapture&&!r}Rr(t,e){if(e===void 0&&(e="$autocapture"),this.isEnabled){var n,s=bh(t);Wg(s)&&(s=s.parentNode||null),e==="$autocapture"&&t.type==="click"&&t instanceof MouseEvent&&this.instance.config.rageclick&&(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,t.timeStamp||new Date().getTime())&&$T(s,this.instance.config.rageclick)&&this.Rr(t,"$rageclick");var r=e===Ia;if(s&&BT(s,t,this.N,r,r?["copy","cut"]:void 0)){var{props:i,explicitNoCapture:a}=XT(s,{e:t,maskAllElementAttributes:this.instance.config.mask_all_element_attributes,maskAllText:this.instance.config.mask_all_text,elementAttributeIgnoreList:this.N.element_attribute_ignorelist,elementsChainAsString:this.Tr});if(a)return!1;var l=this.getElementSelectors(s);if(l&&l.length>0&&(i.$element_selectors=l),e===Ia){var c,u=Kg(R==null||(c=R.getSelection())==null?void 0:c.toString()),d=t.type||"clipboard";if(!u)return!1;i.$selected_content=u,i.$copy_type=d}return this.instance.capture(e,i),!0}}}isBrowserSupported(){return bn(N?.querySelectorAll)}},historyAutocapture:class{constructor(t){var e;this._instance=t,this.Fr=(R==null||(e=R.location)==null?void 0:e.pathname)||""}get isEnabled(){return this._instance.config.capture_pageview==="history_change"}startIfEnabled(){this.isEnabled&&($.info("History API monitoring enabled, starting..."),this.monitorHistoryChanges())}stop(){this.Or&&this.Or(),this.Or=void 0,$.info("History API monitoring stopped")}monitorHistoryChanges(){var t,e;if(R&&R.history){var n=this;(t=R.history.pushState)!=null&&t.__posthog_wrapped__||kh(R.history,"pushState",s=>function(r,i,a){s.call(this,r,i,a),n.Mr("pushState")}),(e=R.history.replaceState)!=null&&e.__posthog_wrapped__||kh(R.history,"replaceState",s=>function(r,i,a){s.call(this,r,i,a),n.Mr("replaceState")}),this.Ar()}}Mr(t){try{var e,n=R==null||(e=R.location)==null?void 0:e.pathname;if(!n)return;n!==this.Fr&&this.isEnabled&&this._instance.capture("$pageview",{navigation_type:t}),this.Fr=n}catch(s){$.error("Error capturing "+t+" pageview",s)}}Ar(){if(!this.Or){var t=()=>{this.Mr("popstate")};Ce(R,"popstate",t),this.Or=()=>{R&&R.removeEventListener("popstate",t)}}}},heatmaps:class{constructor(t){var e;this.jr=!1,this.kr=!1,this.Dr=null,this.instance=t,this.jr=!((e=this.instance.persistence)==null||!e.props[Cl]),this.rageclicks=new Th(t.config.rageclick)}get flushIntervalMilliseconds(){var t=5e3;return Le(this.instance.config.capture_heatmaps)&&this.instance.config.capture_heatmaps.flush_interval_milliseconds&&(t=this.instance.config.capture_heatmaps.flush_interval_milliseconds),t}get isEnabled(){return se(this.instance.config.capture_heatmaps)?se(this.instance.config.enable_heatmaps)?this.jr:this.instance.config.enable_heatmaps:this.instance.config.capture_heatmaps!==!1}startIfEnabled(){if(this.isEnabled){if(this.kr)return;JT.info("starting..."),this.Lr(),this.Nr()}else{var t;clearInterval((t=this.Dr)!==null&&t!==void 0?t:void 0),this.Ur(),this.getAndClearBuffer()}}onRemoteConfig(t){if("heatmaps"in t){var e=!!t.heatmaps;this.instance.persistence&&this.instance.persistence.register({[Cl]:e}),this.jr=e,this.startIfEnabled()}}getAndClearBuffer(){var t=this.R;return this.R=void 0,t}zr(t){this.Hr(t.originalEvent,"deadclick")}Nr(){this.Dr&&clearInterval(this.Dr),this.Dr=function(t){return t?.visibilityState==="visible"}(N)?setInterval(this.te.bind(this),this.flushIntervalMilliseconds):null}Lr(){R&&N&&(this.Br=this.te.bind(this),Ce(R,"beforeunload",this.Br),this.qr=t=>this.Hr(t||R?.event),Ce(N,"click",this.qr,{capture:!0}),this.Wr=t=>this.Gr(t||R?.event),Ce(N,"mousemove",this.Wr,{capture:!0}),this.Vr=new Zd(this.instance,$j,this.zr.bind(this)),this.Vr.startIfEnabledOrStop(),this.Jr=this.Nr.bind(this),Ce(N,"visibilitychange",this.Jr),this.kr=!0)}Ur(){var t;R&&N&&(this.Br&&R.removeEventListener("beforeunload",this.Br),this.qr&&N.removeEventListener("click",this.qr,{capture:!0}),this.Wr&&N.removeEventListener("mousemove",this.Wr,{capture:!0}),this.Jr&&N.removeEventListener("visibilitychange",this.Jr),clearTimeout(this.Kr),(t=this.Vr)==null||t.stop(),this.kr=!1)}Yr(t,e){var n=this.instance.scrollManager.scrollY(),s=this.instance.scrollManager.scrollX(),r=this.instance.scrollManager.scrollElement(),i=function(a,l,c){for(var u=a;u&&Qi(u)&&!Fn(u,"body");){if(u===c)return!1;if(te(l,R?.getComputedStyle(u).position))return!0;u=Yg(u)}return!1}(bh(t),["fixed","sticky"],r);return{x:t.clientX+(i?0:s),y:t.clientY+(i?0:n),target_fixed:i,type:e}}Hr(t,e){var n;if(e===void 0&&(e="click"),!yh(t.target)&&Rh(t)){var s=this.Yr(t,e);(n=this.rageclicks)!=null&&n.isRageClick(t.clientX,t.clientY,new Date().getTime())&&this.Xr(V({},s,{type:"rageclick"})),this.Xr(s)}}Gr(t){!yh(t.target)&&Rh(t)&&(clearTimeout(this.Kr),this.Kr=setTimeout(()=>{this.Xr(this.Yr(t,"mousemove"))},500))}Xr(t){if(R){var e=R.location.href,n=this.instance.config.mask_personal_data_properties,s=this.instance.config.custom_personal_data_properties,r=n?zs([],Hs,s||[]):[],i=Xr(e,r,Zr);this.R=this.R||{},this.R[i]||(this.R[i]=[]),this.R[i].push(t)}}te(){this.R&&!Ts(this.R)&&this.instance.capture("$$heatmap",{$heatmap_data:this.getAndClearBuffer()})}},deadClicksAutocapture:Zd,webVitalsAutocapture:class{constructor(t){var e;this.jr=!1,this.kr=!1,this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0},this.Qr=()=>{clearTimeout(this.Zr),this.R.metrics.length!==0&&(this._instance.capture("$web_vitals",this.R.metrics.reduce((n,s)=>V({},n,{["$web_vitals_"+s.name+"_event"]:V({},s),["$web_vitals_"+s.name+"_value"]:s.value}),{})),this.R={url:void 0,metrics:[],firstMetricTimestamp:void 0})},this.ts=n=>{var s,r=(s=this._instance.sessionManager)==null?void 0:s.checkAndGetSessionAndWindowId(!0);if(F(r))Cn.error("Could not read session ID. Dropping metrics!");else{this.R=this.R||{url:void 0,metrics:[],firstMetricTimestamp:void 0};var i=this.es();F(i)||(se(n?.name)||se(n?.value)?Cn.error("Invalid metric received",n):this.rs&&n.value>=this.rs?Cn.error("Ignoring metric with value >= "+this.rs,n):(this.R.url!==i&&(this.Qr(),this.Zr=setTimeout(this.Qr,this.flushToCaptureTimeoutMs)),F(this.R.url)&&(this.R.url=i),this.R.firstMetricTimestamp=F(this.R.firstMetricTimestamp)?Date.now():this.R.firstMetricTimestamp,n.attribution&&n.attribution.interactionTargetElement&&(n.attribution.interactionTargetElement=void 0),this.R.metrics.push(V({},n,{$current_url:i,$session_id:r.sessionId,$window_id:r.windowId,timestamp:Date.now()})),this.R.metrics.length===this.allowedMetrics.length&&this.Qr()))}},this.ss=()=>{if(!this.kr){var n,s,r,i,a=G.__PosthogExtensions__;F(a)||F(a.postHogWebVitalsCallbacks)||({onLCP:n,onCLS:s,onFCP:r,onINP:i}=a.postHogWebVitalsCallbacks),n&&s&&r&&i?(this.allowedMetrics.indexOf("LCP")>-1&&n(this.ts.bind(this)),this.allowedMetrics.indexOf("CLS")>-1&&s(this.ts.bind(this)),this.allowedMetrics.indexOf("FCP")>-1&&r(this.ts.bind(this)),this.allowedMetrics.indexOf("INP")>-1&&i(this.ts.bind(this)),this.kr=!0):Cn.error("web vitals callbacks not loaded - not starting")}},this._instance=t,this.jr=!((e=this._instance.persistence)==null||!e.props[Gd]),this.startIfEnabled()}get allowedMetrics(){var t,e,n=Le(this._instance.config.capture_performance)?(t=this._instance.config.capture_performance)==null?void 0:t.web_vitals_allowed_metrics:void 0;return se(n)?((e=this._instance.persistence)==null?void 0:e.props[qd])||["CLS","FCP","INP","LCP"]:n}get flushToCaptureTimeoutMs(){return(Le(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_delayed_flush_ms:void 0)||5e3}get useAttribution(){var t=Le(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals_attribution:void 0;return t!=null&&t}get rs(){var t=Le(this._instance.config.capture_performance)&&Pn(this._instance.config.capture_performance.__web_vitals_max_value)?this._instance.config.capture_performance.__web_vitals_max_value:Sh;return 0<t&&t<=6e4?Sh:t}get isEnabled(){var t=Fe?.protocol;if(t!=="http:"&&t!=="https:")return Cn.info("Web Vitals are disabled on non-http/https protocols"),!1;var e=Le(this._instance.config.capture_performance)?this._instance.config.capture_performance.web_vitals:En(this._instance.config.capture_performance)?this._instance.config.capture_performance:void 0;return En(e)?e:this.jr}startIfEnabled(){this.isEnabled&&!this.kr&&(Cn.info("enabled, starting..."),this.V(this.ss))}onRemoteConfig(t){if("capturePerformance"in t){var e=Le(t.capturePerformance)&&!!t.capturePerformance.web_vitals,n=Le(t.capturePerformance)?t.capturePerformance.web_vitals_allowed_metrics:void 0;this._instance.persistence&&(this._instance.persistence.register({[Gd]:e}),this._instance.persistence.register({[qd]:n})),this.jr=e,this.startIfEnabled()}}V(t){var e,n;if((e=G.__PosthogExtensions__)!=null&&e.postHogWebVitalsCallbacks)t();else{var s=this.useAttribution?"web-vitals-with-attribution":"web-vitals";(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,s,r=>{r?Cn.error("failed to load script",r):t()})}}es(){var t=R?R.location.href:void 0;if(t){var e=this._instance.config.mask_personal_data_properties,n=this._instance.config.custom_personal_data_properties,s=e?zs([],Hs,n||[]):[];return Xr(t,s,Zr)}Cn.error("Could not determine current URL")}}},nP={exceptionObserver:class{constructor(t){var e,n,s;this.ss=()=>{var r;if(R&&this.isEnabled&&(r=G.__PosthogExtensions__)!=null&&r.errorWrappingFunctions){var i=G.__PosthogExtensions__.errorWrappingFunctions.wrapOnError,a=G.__PosthogExtensions__.errorWrappingFunctions.wrapUnhandledRejection,l=G.__PosthogExtensions__.errorWrappingFunctions.wrapConsoleError;try{!this.ns&&this.N.capture_unhandled_errors&&(this.ns=i(this.captureException.bind(this))),!this.os&&this.N.capture_unhandled_rejections&&(this.os=a(this.captureException.bind(this))),!this.ls&&this.N.capture_console_errors&&(this.ls=l(this.captureException.bind(this)))}catch(c){vr.error("failed to start",c),this.us()}}},this._instance=t,this.hs=!((e=this._instance.persistence)==null||!e.props[Hd]),this.ds=new qE({refillRate:(n=this._instance.config.error_tracking.__exceptionRateLimiterRefillRate)!==null&&n!==void 0?n:1,bucketSize:(s=this._instance.config.error_tracking.__exceptionRateLimiterBucketSize)!==null&&s!==void 0?s:10,refillInterval:1e4,h:vr}),this.N=this.vs(),this.startIfEnabledOrStop()}vs(){var t=this._instance.config.capture_exceptions,e={capture_unhandled_errors:!1,capture_unhandled_rejections:!1,capture_console_errors:!1};return Le(t)?e=V({},e,t):(F(t)?this.hs:t)&&(e=V({},e,{capture_unhandled_errors:!0,capture_unhandled_rejections:!0})),e}get isEnabled(){return this.N.capture_console_errors||this.N.capture_unhandled_errors||this.N.capture_unhandled_rejections}startIfEnabledOrStop(){this.isEnabled?(vr.info("enabled"),this.us(),this.V(this.ss)):this.us()}V(t){var e,n;(e=G.__PosthogExtensions__)!=null&&e.errorWrappingFunctions&&t(),(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"exception-autocapture",s=>{if(s)return vr.error("failed to load script",s);t()})}us(){var t,e,n;(t=this.ns)==null||t.call(this),this.ns=void 0,(e=this.os)==null||e.call(this),this.os=void 0,(n=this.ls)==null||n.call(this),this.ls=void 0}onRemoteConfig(t){if("autocaptureExceptions"in t){var e=t.autocaptureExceptions;this.hs=!!e||!1,this._instance.persistence&&this._instance.persistence.register({[Hd]:this.hs}),this.N=this.vs(),this.startIfEnabledOrStop()}}onConfigChange(){this.N=this.vs()}captureException(t){var e,n,s=(e=t==null||(n=t.$exception_list)==null||(n=n[0])==null?void 0:n.type)!==null&&e!==void 0?e:"Exception";this.ds.consumeRateLimit(s)?vr.info("Skipping exception capture because of client rate limiting.",{exception:s}):this._instance.exceptions.sendExceptionEvent(t)}}},sP={productTours:class{constructor(t){this.cs=null,this.fs=null,this._instance=t}onRemoteConfig(t){"productTours"in t&&(this._instance.persistence&&this._instance.persistence.register({[Kd]:!!t.productTours}),this.loadIfEnabled())}loadIfEnabled(){var t,e;this.cs||(t=this._instance).config.disable_product_tours||(e=t.persistence)==null||!e.get_property(Kd)||this.V(()=>this.ps())}V(t){var e,n;(e=G.__PosthogExtensions__)!=null&&e.generateProductTours?t():(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"product-tours",s=>{s?Ah.error("Could not load product tours script",s):t()})}ps(){var t;!this.cs&&(t=G.__PosthogExtensions__)!=null&&t.generateProductTours&&(this.cs=G.__PosthogExtensions__.generateProductTours(this._instance,!0))}getProductTours(t,e){if(e===void 0&&(e=!1),!ue(this.fs)||e){var n=this._instance.persistence;if(n){var s=n.props[Da];if(ue(s)&&!e)return this.fs=s,void t(s,{isLoaded:!0})}this._instance._send_request({url:this._instance.requestRouter.endpointFor("api","/api/product_tours/?token="+this._instance.config.token),method:"GET",callback:r=>{var i=r.statusCode;if(i!==200||!r.json){var a="Product Tours API could not be loaded, status: "+i;return Ah.error(a),void t([],{isLoaded:!1,error:a})}var l=ue(r.json.product_tours)?r.json.product_tours:[];this.fs=l,n&&n.register({[Da]:l}),t(l,{isLoaded:!0})}})}else t(this.fs,{isLoaded:!0})}getActiveProductTours(t){se(this.cs)?t([],{isLoaded:!1,error:"Product tours not loaded"}):this.cs.getActiveProductTours(t)}showProductTour(t){var e;(e=this.cs)==null||e.showTourById(t)}previewTour(t){this.cs?this.cs.previewTour(t):this.V(()=>{var e;this.ps(),(e=this.cs)==null||e.previewTour(t)})}dismissProductTour(){var t;(t=this.cs)==null||t.dismissTour("user_clicked_skip")}nextStep(){var t;(t=this.cs)==null||t.nextStep()}previousStep(){var t;(t=this.cs)==null||t.previousStep()}clearCache(){var t;this.fs=null,(t=this._instance.persistence)==null||t.unregister(Da)}resetTour(t){var e;(e=this.cs)==null||e.resetTour(t)}resetAllTours(){var t;(t=this.cs)==null||t.resetAllTours()}cancelPendingTour(t){var e;(e=this.cs)==null||e.cancelPendingTour(t)}}},rP={siteApps:class{constructor(t){this._instance=t,this._s=[],this.apps={}}get isEnabled(){return!!this._instance.config.opt_in_site_apps}gs(t,e){if(e){var n=this.globalsForEvent(e);this._s.push(n),this._s.length>1e3&&(this._s=this._s.slice(10))}}get siteAppLoaders(){var t;return(t=G._POSTHOG_REMOTE_CONFIG)==null||(t=t[this._instance.config.token])==null?void 0:t.siteApps}init(){if(this.isEnabled){var t=this._instance._addCaptureHook(this.gs.bind(this));this.bs=()=>{t(),this._s=[],this.bs=void 0}}}globalsForEvent(t){var e,n,s,r,i,a,l;if(!t)throw new Error("Event payload is required");var c={},u=this._instance.get_property("$groups")||[],d=this._instance.get_property("$stored_group_properties")||{};for(var[h,p]of Object.entries(d))c[h]={id:u[h],type:h,properties:p};var{$set_once:m,$set:y}=t;return{event:V({},Ym(t,QT),{properties:V({},t.properties,y?{$set:V({},(e=(n=t.properties)==null?void 0:n.$set)!==null&&e!==void 0?e:{},y)}:{},m?{$set_once:V({},(s=(r=t.properties)==null?void 0:r.$set_once)!==null&&s!==void 0?s:{},m)}:{}),elements_chain:(i=(a=t.properties)==null?void 0:a.$elements_chain)!==null&&i!==void 0?i:"",distinct_id:(l=t.properties)==null?void 0:l.distinct_id}),person:{properties:this._instance.get_property("$stored_person_properties")},groups:c}}setupSiteApp(t){var e=this.apps[t.id],n=()=>{var a;!e.errored&&this._s.length&&(In.info("Processing "+this._s.length+" events for site app with id "+t.id),this._s.forEach(l=>e.processEvent==null?void 0:e.processEvent(l)),e.processedBuffer=!0),Object.values(this.apps).every(l=>l.processedBuffer||l.errored)&&((a=this.bs)==null||a.call(this))},s=!1,r=a=>{e.errored=!a,e.loaded=!0,In.info("Site app with id "+t.id+" "+(a?"loaded":"errored")),s&&n()};try{var{processEvent:i}=t.init({posthog:this._instance,callback:a=>{r(a)}});i&&(e.processEvent=i),s=!0}catch(a){In.error("Error while initializing PostHog app with config id "+t.id,a),r(!1)}if(s&&e.loaded)try{n()}catch(a){In.error("Error while processing buffered events PostHog app with config id "+t.id,a),e.errored=!0}}ys(){var t=this.siteAppLoaders||[];for(var e of t)this.apps[e.id]={id:e.id,loaded:!1,errored:!1,processedBuffer:!1};for(var n of t)this.setupSiteApp(n)}ws(t){if(Object.keys(this.apps).length!==0){var e=this.globalsForEvent(t);for(var n of Object.values(this.apps))try{n.processEvent==null||n.processEvent(e)}catch(s){In.error("Error while processing event "+t.event+" for site app "+n.id,s)}}}onRemoteConfig(t){var e,n,s,r=this;if((e=this.siteAppLoaders)!=null&&e.length)return this.isEnabled?(this.ys(),void this._instance.on("eventCaptured",c=>this.ws(c))):void In.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.');if((n=this.bs)==null||n.call(this),(s=t.siteApps)!=null&&s.length)if(this.isEnabled){var i=function(c){var u;G["__$$ph_site_app_"+c]=r._instance,(u=G.__PosthogExtensions__)==null||u.loadSiteApp==null||u.loadSiteApp(r._instance,l,d=>{if(d)return In.error("Error while initializing PostHog app with config id "+c,d)})};for(var{id:a,url:l}of t.siteApps)i(a)}else In.error('PostHog site apps are disabled. Enable the "opt_in_site_apps" config to proceed.')}}},oP=V({},eP,tP,nP,sP,rP,{tracingHeaders:class{constructor(t){this.xs=void 0,this.$s=void 0,this.ss=()=>{var e,n;F(this.xs)&&((e=G.__PosthogExtensions__)==null||(e=e.tracingHeadersPatchFns)==null||e._patchXHR(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager)),F(this.$s)&&((n=G.__PosthogExtensions__)==null||(n=n.tracingHeadersPatchFns)==null||n._patchFetch(this._instance.config.__add_tracing_headers||[],this._instance.get_distinct_id(),this._instance.sessionManager))},this._instance=t}V(t){var e,n;(e=G.__PosthogExtensions__)!=null&&e.tracingHeadersPatchFns&&t(),(n=G.__PosthogExtensions__)==null||n.loadExternalDependency==null||n.loadExternalDependency(this._instance,"tracing-headers",s=>{if(s)return ZT.error("failed to load script",s);t()})}startIfEnabledOrStop(){var t,e;this._instance.config.__add_tracing_headers?this.V(this.ss):((t=this.xs)==null||t.call(this),(e=this.$s)==null||e.call(this),this.xs=void 0,this.$s=void 0)}}});tn.__defaultExtensionClasses=V({},oP);var Ch;(function(t){return t.SHOWN="product tour shown",t.DISMISSED="product tour dismissed",t.COMPLETED="product tour completed",t.STEP_SHOWN="product tour step shown",t.STEP_COMPLETED="product tour step completed",t.BUTTON_CLICKED="product tour button clicked",t.STEP_SELECTOR_FAILED="product tour step selector failed",t.BANNER_CONTAINER_SELECTOR_FAILED="product tour banner container selector failed",t.BANNER_ACTION_CLICKED="product tour banner action clicked",t})({});(function(t){return t.TOUR_ID="$product_tour_id",t.TOUR_NAME="$product_tour_name",t.TOUR_ITERATION="$product_tour_iteration",t.TOUR_RENDER_REASON="$product_tour_render_reason",t.TOUR_STEP_ID="$product_tour_step_id",t.TOUR_STEP_ORDER="$product_tour_step_order",t.TOUR_STEP_TYPE="$product_tour_step_type",t.TOUR_DISMISS_REASON="$product_tour_dismiss_reason",t.TOUR_BUTTON_TEXT="$product_tour_button_text",t.TOUR_BUTTON_ACTION="$product_tour_button_action",t.TOUR_BUTTON_LINK="$product_tour_button_link",t.TOUR_BUTTON_TOUR_ID="$product_tour_button_tour_id",t.TOUR_STEPS_COUNT="$product_tour_steps_count",t.TOUR_STEP_SELECTOR="$product_tour_step_selector",t.TOUR_STEP_SELECTOR_FOUND="$product_tour_step_selector_found",t.TOUR_STEP_ELEMENT_TAG="$product_tour_step_element_tag",t.TOUR_STEP_ELEMENT_ID="$product_tour_step_element_id",t.TOUR_STEP_ELEMENT_CLASSES="$product_tour_step_element_classes",t.TOUR_STEP_ELEMENT_TEXT="$product_tour_step_element_text",t.TOUR_ERROR="$product_tour_error",t.TOUR_MATCHES_COUNT="$product_tour_matches_count",t.TOUR_FAILURE_PHASE="$product_tour_failure_phase",t.TOUR_WAITED_FOR_ELEMENT="$product_tour_waited_for_element",t.TOUR_WAIT_DURATION_MS="$product_tour_wait_duration_ms",t.TOUR_BANNER_SELECTOR="$product_tour_banner_selector",t.TOUR_LINKED_SURVEY_ID="$product_tour_linked_survey_id",t.USE_MANUAL_SELECTOR="$use_manual_selector",t.INFERENCE_DATA_PRESENT="$inference_data_present",t})({});var Mr=(Ch=Lr[js]=new tn,function(){function t(){t.done||(t.done=!0,Hg=!1,ge(Lr,function(e){e._dom_loaded()}))}N!=null&&N.addEventListener?N.readyState==="complete"?t():Ce(N,"DOMContentLoaded",t,{capture:!1}):R&&$.error("Browser doesn't support `document.addEventListener` so PostHog couldn't be initialized")}(),Ch);const iP=Object.freeze(Object.defineProperty({__proto__:null,Compression:Zt,DisplaySurveyType:Pi,PostHog:tn,SurveyEventName:ks,SurveyEventProperties:Qo,SurveyEventType:Es,SurveyType:Jo,default:Mr,posthog:Mr},Symbol.toStringTag,{value:"Module"})),La={trackPageView:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("config","G-RKW2321F04",{page_path:t,page_title:e||document.title})},trackEvent:(t,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event",t,e),typeof window<"u"&&Mr.capture(t,e)},identifyUser:(t,e)=>{typeof window<"u"&&Mr.identify(t,e)},resetUser:()=>{typeof window<"u"&&Mr.reset()},initialize:()=>{typeof window<"u"&&window.gtag&&window.gtag("config","G-RKW2321F04",{page_path:window.location.pathname,page_title:document.title})}},nv=f.createContext(void 0),Ih=(t,e)=>Promise.race([t,new Promise((n,s)=>setTimeout(()=>s(new Error("Timeout")),e))]),aP=()=>{try{const t=e=>{const n=[];for(let s=0;s<e.length;s++){const r=e.key(s);r&&(r.includes("-auth-token")||r.includes("-code-verifier"))&&n.push(r)}n.forEach(s=>e.removeItem(s))};t(localStorage),t(sessionStorage),sessionStorage.removeItem("pendingAuthRedirect")}catch(t){console.warn("Error purging auth storage:",t)}},lP=({children:t})=>{const[e,n]=f.useState(null),[s,r]=f.useState(null),[i,a]=f.useState(!0),l=f.useRef(!1),c=f.useRef(0),{toast:u}=Af(),d=f.useCallback(async E=>{const T=E||e?.id;if(T)try{console.log("[AUTH] Refreshing subscription for:",T),await $E(!0)}catch(j){console.error("[AUTH] Error refreshing subscription:",j),Qt.error("Subscription refresh failed",{description:"Could not update your subscription status. Please try again later."})}},[e?.id]);f.useEffect(()=>{const{data:{subscription:E}}=pe.auth.onAuthStateChange((T,j)=>{if(console.log("[AUTH] Event:",T),l.current&&T!=="SIGNED_OUT"){console.log("[AUTH] Ignoring event during sign-out:",T);return}if(Date.now()<c.current&&(T==="SIGNED_IN"||T==="TOKEN_REFRESHED")){console.log("[AUTH] Ignoring late rehydration event after sign-out:",T);return}r(j);const P=j?.user?.id??null;n(k=>{const S=k?.id??null;return S===P&&S!==null?k:j?.user??null}),T==="SIGNED_OUT"&&(La.resetUser(),l.current=!1),a(!1)});return pe.auth.getSession().then(({data:{session:T}})=>{r(T),n(T?.user??null),a(!1)}),()=>E.unsubscribe()},[]),f.useEffect(()=>{if(!e||l.current)return;let E=!1;return(async()=>{La.identifyUser(e.id,{email:e.email,user_type:e.user_metadata?.user_type});try{const j=e.user_metadata,P=j?.avatar_url||j?.picture;if(P){const{data:k}=await pe.from("profiles").select("avatar_url").eq("id",e.id).single();!E&&!k?.avatar_url&&await pe.from("profiles").update({avatar_url:P}).eq("id",e.id)}}catch(j){console.error("[AUTH] Avatar sync error:",j)}if(!E)try{await d(e.id)}catch(j){console.error("[AUTH] Subscription refresh error on sign-in:",j)}})(),()=>{E=!0}},[e?.id]);const h=async(E,T)=>{try{a(!0);const{data:j,error:P}=await pe.auth.signInWithPassword({email:E,password:T});if(P)throw P}catch(j){throw console.error("Error signing in:",j),j}finally{a(!1)}},p=async(E,T,j,P)=>{try{a(!0);const{error:k}=await pe.auth.signUp({email:E,password:T,options:{data:{user_type:j||"free",display_name:P}}});if(k)throw u({title:"Sign up failed",description:k.message,variant:"destructive"}),k}catch(k){throw console.error("Error signing up:",k),k}finally{a(!1)}},m=async(E,T)=>{try{a(!0);const{error:j}=await pe.auth.signInWithOAuth({provider:E});if(j)throw u({title:`${T} sign in failed`,description:j.message,variant:"destructive"}),j}catch(j){throw console.error(`Error signing in with ${T}:`,j),j}finally{a(!1)}},y=()=>m("google","Google"),_=()=>m("facebook","Facebook"),x=()=>m("twitter","X"),b=()=>m("azure","Microsoft"),w=async()=>{l.current=!0;try{a(!0),La.resetUser();try{await Ih(pe.auth.signOut(),3e3)}catch(E){console.warn("[AUTH] Global sign-out failed/timed out:",E);try{await Ih(pe.auth.signOut({scope:"local"}),2e3)}catch(T){console.warn("[AUTH] Local sign-out also failed:",T)}}}catch(E){console.error("[AUTH] Sign-out error:",E)}finally{aP(),n(null),r(null),a(!1),c.current=Date.now()+2e3,l.current=!1}};return o.jsx(nv.Provider,{value:{user:e,session:s,isLoading:i,signIn:h,signUp:p,signInWithGoogle:y,signInWithFacebook:_,signInWithTwitter:x,signInWithMicrosoft:b,signOut:w,refreshSubscription:d},children:t})},Zc=()=>{const t=f.useContext(nv);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},cP=(t,e,n)=>{const s=t[e];return s?typeof s=="function"?s():Promise.resolve(s):new Promise((r,i)=>{(typeof queueMicrotask=="function"?queueMicrotask:setTimeout)(i.bind(null,new Error("Unknown variable dynamic import: "+e+(e.split("/").length!==n?". Note that variables only represent file names one level deep.":""))))})};var uP=function(e){return{type:"backend",init:function(s,r,i){},read:function(s,r,i){if(typeof e=="function"){if(e.length<3){try{var a=e(s,r);a&&typeof a.then=="function"?a.then(function(l){return i(null,l&&l.default||l)}).catch(i):i(null,a)}catch(l){i(l)}return}e(s,r,i);return}i(null,e&&e[s]&&e[s][r])}}};const ls=["en","zh","bn","es","ja","ko","th","vi","hi","pt","fil","ms","id","my","km","lo"],sv=["navbar","footer"],dP={"":["home","landing"],subscription:["subscription"],stories:["stories"],themes:["themes"],theme:["themes"],about:["about"],contact:["contact"],"improve-reading":["improve-reading"],"text-checker":["text-checker"],"reading-cart":["reading-cart"],vocabulary:["vocabulary"],progress:["progress"],research:["research"],blog:["blog","newsletter"],"story-maker":["story-maker","generation"],story:["story-reader"],auth:["auth"],login:["auth"],signup:["auth"],"verify-email":["auth"],"reset-password":["auth"],terms:["terms"],privacy:["privacy"],refund:["refund"],newsletter:["newsletter"],"payment-status":["payment-status"],payment:["payment-status"],stripe:["payment-status"]};function Kl(t){const e=t.split("/").filter(Boolean)[0]?.toLowerCase();return ls.includes(e)?e:"en"}function ql(t){const e=t.split("/").filter(Boolean),n=e[0]?.toLowerCase(),r=((ls.includes(n)?e.slice(1):e)[0]||"").toLowerCase(),i=dP[r]??[];return Array.from(new Set([...sv,...i]))}const hP=typeof window<"u"?Kl(window.location.pathname):"en";kf.use(uP((t,e)=>cP(Object.assign({"../locales/bn/about.json":()=>g(()=>import("./about-Bahok3B1.js"),[]),"../locales/bn/auth.json":()=>g(()=>import("./auth-527YGbra.js"),[]),"../locales/bn/blog.json":()=>g(()=>import("./blog-KPJWYw1V.js"),[]),"../locales/bn/contact.json":()=>g(()=>import("./contact-3LVKK4oT.js"),[]),"../locales/bn/footer.json":()=>g(()=>import("./footer-BSxBqHhD.js"),[]),"../locales/bn/generation.json":()=>g(()=>import("./generation-BIUqfZDd.js"),[]),"../locales/bn/home.json":()=>g(()=>import("./home-DsWRNyhF.js"),[]),"../locales/bn/improve-reading.json":()=>g(()=>import("./improve-reading-DixZypLF.js"),[]),"../locales/bn/landing.json":()=>g(()=>import("./landing-D7aa6PYC.js"),[]),"../locales/bn/navbar.json":()=>g(()=>import("./navbar-Deb7htdo.js"),[]),"../locales/bn/newsletter.json":()=>g(()=>import("./newsletter-1T6UBzkr.js"),[]),"../locales/bn/notfound.json":()=>g(()=>import("./notfound-B7cD9va5.js"),[]),"../locales/bn/payment-status.json":()=>g(()=>import("./payment-status-wgfjMmgM.js"),[]),"../locales/bn/privacy.json":()=>g(()=>import("./privacy-DTLzvZAR.js"),[]),"../locales/bn/progress.json":()=>g(()=>import("./progress-C1zb2HRu.js"),[]),"../locales/bn/reading-cart.json":()=>g(()=>import("./reading-cart-BCd2nmAM.js"),[]),"../locales/bn/refund.json":()=>g(()=>import("./refund-75w9UWZs.js"),[]),"../locales/bn/research.json":()=>g(()=>import("./research-BMeL84r3.js"),[]),"../locales/bn/stories.json":()=>g(()=>import("./stories-Dk76aJuS.js"),[]),"../locales/bn/story-maker.json":()=>g(()=>import("./story-maker-RziEAVPr.js"),[]),"../locales/bn/story-reader.json":()=>g(()=>import("./story-reader-CePz6kk4.js"),[]),"../locales/bn/subscription.json":()=>g(()=>import("./subscription-BmVRD77r.js"),[]),"../locales/bn/terms.json":()=>g(()=>import("./terms-DKuS4yZL.js"),[]),"../locales/bn/text-checker.json":()=>g(()=>import("./text-checker-C2oaz7Xi.js"),[]),"../locales/bn/themes.json":()=>g(()=>import("./themes-CmGQZeiD.js"),[]),"../locales/bn/vocabulary.json":()=>g(()=>import("./vocabulary-wO2ezrz2.js"),[]),"../locales/en/about.json":()=>g(()=>import("./about-J97YaPfh.js"),[]),"../locales/en/auth.json":()=>g(()=>import("./auth-jb3xF8pC.js"),[]),"../locales/en/blog.json":()=>g(()=>import("./blog-C3rIA2IU.js"),[]),"../locales/en/contact.json":()=>g(()=>import("./contact-B1ewm6S_.js"),[]),"../locales/en/footer.json":()=>g(()=>import("./footer-Cj59KvtR.js"),[]),"../locales/en/generation.json":()=>g(()=>import("./generation-Cu8T4Lr0.js"),[]),"../locales/en/home.json":()=>g(()=>import("./home-DMV0mI9M.js"),[]),"../locales/en/improve-reading.json":()=>g(()=>import("./improve-reading-D7vUD39L.js"),[]),"../locales/en/landing.json":()=>g(()=>import("./landing-CcLSFaO6.js"),[]),"../locales/en/navbar.json":()=>g(()=>import("./navbar-CdB_AQQ-.js"),[]),"../locales/en/newsletter.json":()=>g(()=>import("./newsletter-BaqeoYHu.js"),[]),"../locales/en/notfound.json":()=>g(()=>import("./notfound-B-SFY30Q.js"),[]),"../locales/en/payment-status.json":()=>g(()=>import("./payment-status-C7SHYdC9.js"),[]),"../locales/en/privacy.json":()=>g(()=>import("./privacy-D9qnP2jO.js"),[]),"../locales/en/progress.json":()=>g(()=>import("./progress-CwSuqtP-.js"),[]),"../locales/en/reading-cart.json":()=>g(()=>import("./reading-cart-BptBWt_r.js"),[]),"../locales/en/refund.json":()=>g(()=>import("./refund-CC1P1Dku.js"),[]),"../locales/en/research.json":()=>g(()=>import("./research-DsxMnzL1.js"),[]),"../locales/en/stories.json":()=>g(()=>import("./stories-C52kGUJW.js"),[]),"../locales/en/story-maker.json":()=>g(()=>import("./story-maker-BphXyo_N.js"),[]),"../locales/en/story-reader.json":()=>g(()=>import("./story-reader-DWBjNZym.js"),[]),"../locales/en/subscription.json":()=>g(()=>import("./subscription-CKGSubQA.js"),[]),"../locales/en/terms.json":()=>g(()=>import("./terms-NVC40PjG.js"),[]),"../locales/en/text-checker.json":()=>g(()=>import("./text-checker-BhNJ_QKw.js"),[]),"../locales/en/themes.json":()=>g(()=>import("./themes-B2TyhWSH.js"),[]),"../locales/en/vocabulary.json":()=>g(()=>import("./vocabulary-C67iu2IS.js"),[]),"../locales/es/about.json":()=>g(()=>import("./about-_5B24CX4.js"),[]),"../locales/es/auth.json":()=>g(()=>import("./auth-CWyG6RSy.js"),[]),"../locales/es/blog.json":()=>g(()=>import("./blog-BkG02Bvo.js"),[]),"../locales/es/contact.json":()=>g(()=>import("./contact-BZPyAx2-.js"),[]),"../locales/es/footer.json":()=>g(()=>import("./footer-BZPiJHxT.js"),[]),"../locales/es/generation.json":()=>g(()=>import("./generation-qNRtdZgJ.js"),[]),"../locales/es/home.json":()=>g(()=>import("./home-Ctw8bWwS.js"),[]),"../locales/es/improve-reading.json":()=>g(()=>import("./improve-reading-DoQhr0LR.js"),[]),"../locales/es/landing.json":()=>g(()=>import("./landing-D6efA0py.js"),[]),"../locales/es/navbar.json":()=>g(()=>import("./navbar-Be_Y4fHp.js"),[]),"../locales/es/newsletter.json":()=>g(()=>import("./newsletter-C7lJho9h.js"),[]),"../locales/es/notfound.json":()=>g(()=>import("./notfound-nm5EuQDx.js"),[]),"../locales/es/payment-status.json":()=>g(()=>import("./payment-status-B32pY1CE.js"),[]),"../locales/es/privacy.json":()=>g(()=>import("./privacy-CLStpuoK.js"),[]),"../locales/es/progress.json":()=>g(()=>import("./progress-CozMjnoE.js"),[]),"../locales/es/reading-cart.json":()=>g(()=>import("./reading-cart-GwQBdftB.js"),[]),"../locales/es/refund.json":()=>g(()=>import("./refund-CHPr9L0z.js"),[]),"../locales/es/research.json":()=>g(()=>import("./research-DsbUjOLQ.js"),[]),"../locales/es/stories.json":()=>g(()=>import("./stories-DgTBOhEj.js"),[]),"../locales/es/story-maker.json":()=>g(()=>import("./story-maker-DXkYKt0-.js"),[]),"../locales/es/story-reader.json":()=>g(()=>import("./story-reader-DKCqupPI.js"),[]),"../locales/es/subscription.json":()=>g(()=>import("./subscription-NRUybcue.js"),[]),"../locales/es/terms.json":()=>g(()=>import("./terms-CTcFR6yJ.js"),[]),"../locales/es/text-checker.json":()=>g(()=>import("./text-checker-u8eWC-gI.js"),[]),"../locales/es/themes.json":()=>g(()=>import("./themes-DFXdVEzC.js"),[]),"../locales/es/vocabulary.json":()=>g(()=>import("./vocabulary-D2MvKQCN.js"),[]),"../locales/fil/about.json":()=>g(()=>import("./about-Dx72XNnD.js"),[]),"../locales/fil/auth.json":()=>g(()=>import("./auth-BZIWTf5-.js"),[]),"../locales/fil/blog.json":()=>g(()=>import("./blog-DQX9fxZO.js"),[]),"../locales/fil/contact.json":()=>g(()=>import("./contact-D0vEEtNz.js"),[]),"../locales/fil/footer.json":()=>g(()=>import("./footer-BCEcZdKp.js"),[]),"../locales/fil/generation.json":()=>g(()=>import("./generation-DFwgGw3X.js"),[]),"../locales/fil/home.json":()=>g(()=>import("./home-8dHN0CA6.js"),[]),"../locales/fil/improve-reading.json":()=>g(()=>import("./improve-reading-Cze8A-p7.js"),[]),"../locales/fil/landing.json":()=>g(()=>import("./landing-DLiKORUf.js"),[]),"../locales/fil/navbar.json":()=>g(()=>import("./navbar-BislnSmr.js"),[]),"../locales/fil/newsletter.json":()=>g(()=>import("./newsletter-Bl_GXLZj.js"),[]),"../locales/fil/notfound.json":()=>g(()=>import("./notfound-Cme_XJYk.js"),[]),"../locales/fil/payment-status.json":()=>g(()=>import("./payment-status-DjVuwLiT.js"),[]),"../locales/fil/privacy.json":()=>g(()=>import("./privacy-C45sz_d9.js"),[]),"../locales/fil/progress.json":()=>g(()=>import("./progress-wsTDsZL8.js"),[]),"../locales/fil/reading-cart.json":()=>g(()=>import("./reading-cart-4wtoyrTV.js"),[]),"../locales/fil/refund.json":()=>g(()=>import("./refund-RPhirmx6.js"),[]),"../locales/fil/research.json":()=>g(()=>import("./research-Bb_tjaOn.js"),[]),"../locales/fil/stories.json":()=>g(()=>import("./stories-CN8JmZ9y.js"),[]),"../locales/fil/story-maker.json":()=>g(()=>import("./story-maker-DnTAAV5w.js"),[]),"../locales/fil/story-reader.json":()=>g(()=>import("./story-reader-PYG8l9Dc.js"),[]),"../locales/fil/subscription.json":()=>g(()=>import("./subscription-DHg-C8Go.js"),[]),"../locales/fil/terms.json":()=>g(()=>import("./terms-enX_CnbE.js"),[]),"../locales/fil/text-checker.json":()=>g(()=>import("./text-checker-BbwLhKWn.js"),[]),"../locales/fil/themes.json":()=>g(()=>import("./themes-CSOYTL9V.js"),[]),"../locales/fil/vocabulary.json":()=>g(()=>import("./vocabulary-B1GTwI_7.js"),[]),"../locales/hi/about.json":()=>g(()=>import("./about-Cp3HBjTC.js"),[]),"../locales/hi/auth.json":()=>g(()=>import("./auth-BYRbFzPq.js"),[]),"../locales/hi/blog.json":()=>g(()=>import("./blog-CS4O0F6k.js"),[]),"../locales/hi/contact.json":()=>g(()=>import("./contact-DXHOo928.js"),[]),"../locales/hi/footer.json":()=>g(()=>import("./footer-Bn0E0dhq.js"),[]),"../locales/hi/generation.json":()=>g(()=>import("./generation-BvMOm4hl.js"),[]),"../locales/hi/home.json":()=>g(()=>import("./home-DmHRM-GM.js"),[]),"../locales/hi/improve-reading.json":()=>g(()=>import("./improve-reading-kYPt4zsp.js"),[]),"../locales/hi/landing.json":()=>g(()=>import("./landing-C9KrU4m9.js"),[]),"../locales/hi/navbar.json":()=>g(()=>import("./navbar-CcuwK1Gy.js"),[]),"../locales/hi/newsletter.json":()=>g(()=>import("./newsletter-BUy6iHak.js"),[]),"../locales/hi/notfound.json":()=>g(()=>import("./notfound-CN83UgZB.js"),[]),"../locales/hi/payment-status.json":()=>g(()=>import("./payment-status-DB3q3O9v.js"),[]),"../locales/hi/privacy.json":()=>g(()=>import("./privacy-CkC-dwgD.js"),[]),"../locales/hi/progress.json":()=>g(()=>import("./progress-hFgyQawK.js"),[]),"../locales/hi/reading-cart.json":()=>g(()=>import("./reading-cart-CFWIAvC8.js"),[]),"../locales/hi/refund.json":()=>g(()=>import("./refund-C_HkoAKF.js"),[]),"../locales/hi/research.json":()=>g(()=>import("./research-B5dfEpCk.js"),[]),"../locales/hi/stories.json":()=>g(()=>import("./stories-B0CxHMjA.js"),[]),"../locales/hi/story-maker.json":()=>g(()=>import("./story-maker-CWqyFxHN.js"),[]),"../locales/hi/story-reader.json":()=>g(()=>import("./story-reader-D3SCaEm1.js"),[]),"../locales/hi/subscription.json":()=>g(()=>import("./subscription-BSDdwYxJ.js"),[]),"../locales/hi/terms.json":()=>g(()=>import("./terms-DbkrS4R2.js"),[]),"../locales/hi/text-checker.json":()=>g(()=>import("./text-checker-DjT4yWeu.js"),[]),"../locales/hi/themes.json":()=>g(()=>import("./themes-CowRO4BH.js"),[]),"../locales/hi/vocabulary.json":()=>g(()=>import("./vocabulary-HA8QZqn1.js"),[]),"../locales/id/about.json":()=>g(()=>import("./about-BpI0MEU4.js"),[]),"../locales/id/auth.json":()=>g(()=>import("./auth-IUGODwrg.js"),[]),"../locales/id/blog.json":()=>g(()=>import("./blog-uesbcAo4.js"),[]),"../locales/id/contact.json":()=>g(()=>import("./contact-Dk0rznfa.js"),[]),"../locales/id/footer.json":()=>g(()=>import("./footer-BkUMqRI2.js"),[]),"../locales/id/generation.json":()=>g(()=>import("./generation-D2XoXfYV.js"),[]),"../locales/id/home.json":()=>g(()=>import("./home-D2qYPseY.js"),[]),"../locales/id/improve-reading.json":()=>g(()=>import("./improve-reading-DzmfjMox.js"),[]),"../locales/id/landing.json":()=>g(()=>import("./landing-BBEEo5li.js"),[]),"../locales/id/navbar.json":()=>g(()=>import("./navbar-CPLCnyCI.js"),[]),"../locales/id/newsletter.json":()=>g(()=>import("./newsletter-AxewWafC.js"),[]),"../locales/id/notfound.json":()=>g(()=>import("./notfound-CEK5dbpt.js"),[]),"../locales/id/payment-status.json":()=>g(()=>import("./payment-status-DCFbo8xj.js"),[]),"../locales/id/privacy.json":()=>g(()=>import("./privacy-e21m_Y_C.js"),[]),"../locales/id/progress.json":()=>g(()=>import("./progress-CV47eIVt.js"),[]),"../locales/id/reading-cart.json":()=>g(()=>import("./reading-cart-sl6gJF9y.js"),[]),"../locales/id/refund.json":()=>g(()=>import("./refund-CdTSwtl3.js"),[]),"../locales/id/research.json":()=>g(()=>import("./research-Dj-3hzVZ.js"),[]),"../locales/id/stories.json":()=>g(()=>import("./stories-E45j0Oj-.js"),[]),"../locales/id/story-maker.json":()=>g(()=>import("./story-maker-BIObPAge.js"),[]),"../locales/id/story-reader.json":()=>g(()=>import("./story-reader-2Z2UZjGf.js"),[]),"../locales/id/subscription.json":()=>g(()=>import("./subscription-CUAXvtb4.js"),[]),"../locales/id/terms.json":()=>g(()=>import("./terms-CwoueMBB.js"),[]),"../locales/id/text-checker.json":()=>g(()=>import("./text-checker-DlmhxSRC.js"),[]),"../locales/id/themes.json":()=>g(()=>import("./themes-B9_Drngn.js"),[]),"../locales/id/vocabulary.json":()=>g(()=>import("./vocabulary-DA_G8jTq.js"),[]),"../locales/ja/about.json":()=>g(()=>import("./about-9H-iambc.js"),[]),"../locales/ja/auth.json":()=>g(()=>import("./auth-dV0lN-LO.js"),[]),"../locales/ja/blog.json":()=>g(()=>import("./blog-Bft55yPZ.js"),[]),"../locales/ja/contact.json":()=>g(()=>import("./contact-BBFLer9D.js"),[]),"../locales/ja/footer.json":()=>g(()=>import("./footer-D-BMgFYB.js"),[]),"../locales/ja/generation.json":()=>g(()=>import("./generation-PVAuT4tb.js"),[]),"../locales/ja/home.json":()=>g(()=>import("./home-Cj5cDrB0.js"),[]),"../locales/ja/improve-reading.json":()=>g(()=>import("./improve-reading-CknT9bJm.js"),[]),"../locales/ja/landing.json":()=>g(()=>import("./landing-qQ_tOTMx.js"),[]),"../locales/ja/navbar.json":()=>g(()=>import("./navbar-DIePm4DF.js"),[]),"../locales/ja/newsletter.json":()=>g(()=>import("./newsletter-DJBHGpWh.js"),[]),"../locales/ja/notfound.json":()=>g(()=>import("./notfound-S7xtzxW2.js"),[]),"../locales/ja/payment-status.json":()=>g(()=>import("./payment-status-BwvT-6IN.js"),[]),"../locales/ja/privacy.json":()=>g(()=>import("./privacy-DI-ylDP2.js"),[]),"../locales/ja/progress.json":()=>g(()=>import("./progress-D18WvTY3.js"),[]),"../locales/ja/reading-cart.json":()=>g(()=>import("./reading-cart-D1G8OPkf.js"),[]),"../locales/ja/refund.json":()=>g(()=>import("./refund-CYHonIjU.js"),[]),"../locales/ja/research.json":()=>g(()=>import("./research-DuCSNcWD.js"),[]),"../locales/ja/stories.json":()=>g(()=>import("./stories-vm7SPOvs.js"),[]),"../locales/ja/story-maker.json":()=>g(()=>import("./story-maker-DusArRzP.js"),[]),"../locales/ja/story-reader.json":()=>g(()=>import("./story-reader-nR-vV99c.js"),[]),"../locales/ja/subscription.json":()=>g(()=>import("./subscription-nyDaLj5g.js"),[]),"../locales/ja/terms.json":()=>g(()=>import("./terms-CssJnV-J.js"),[]),"../locales/ja/text-checker.json":()=>g(()=>import("./text-checker-DGq3HA9U.js"),[]),"../locales/ja/themes.json":()=>g(()=>import("./themes-DDgrK7FC.js"),[]),"../locales/ja/vocabulary.json":()=>g(()=>import("./vocabulary-DqvcLIhm.js"),[]),"../locales/km/about.json":()=>g(()=>import("./about-r7hn2DmP.js"),[]),"../locales/km/auth.json":()=>g(()=>import("./auth-yCrXn-WO.js"),[]),"../locales/km/blog.json":()=>g(()=>import("./blog-B4jeS0WY.js"),[]),"../locales/km/contact.json":()=>g(()=>import("./contact-BaN5uuLi.js"),[]),"../locales/km/footer.json":()=>g(()=>import("./footer-C_HEDlEe.js"),[]),"../locales/km/generation.json":()=>g(()=>import("./generation-vAUHyaHq.js"),[]),"../locales/km/home.json":()=>g(()=>import("./home-Dsl0AoIQ.js"),[]),"../locales/km/improve-reading.json":()=>g(()=>import("./improve-reading-Crl05jNO.js"),[]),"../locales/km/landing.json":()=>g(()=>import("./landing-BtJ-ka4Q.js"),[]),"../locales/km/navbar.json":()=>g(()=>import("./navbar-DB6PC3b2.js"),[]),"../locales/km/newsletter.json":()=>g(()=>import("./newsletter-D6cJuhDc.js"),[]),"../locales/km/notfound.json":()=>g(()=>import("./notfound-BoEwv3Ys.js"),[]),"../locales/km/payment-status.json":()=>g(()=>import("./payment-status-CMnm4UE4.js"),[]),"../locales/km/privacy.json":()=>g(()=>import("./privacy-wh-2zf51.js"),[]),"../locales/km/progress.json":()=>g(()=>import("./progress-BAwrJzO5.js"),[]),"../locales/km/reading-cart.json":()=>g(()=>import("./reading-cart-BXZimMrv.js"),[]),"../locales/km/refund.json":()=>g(()=>import("./refund-COHlwiX_.js"),[]),"../locales/km/research.json":()=>g(()=>import("./research-D8IV2T4Y.js"),[]),"../locales/km/stories.json":()=>g(()=>import("./stories-CFfmcbYB.js"),[]),"../locales/km/story-maker.json":()=>g(()=>import("./story-maker-CmBDGIKH.js"),[]),"../locales/km/story-reader.json":()=>g(()=>import("./story-reader-Cs5hK48D.js"),[]),"../locales/km/subscription.json":()=>g(()=>import("./subscription-D90W18X5.js"),[]),"../locales/km/terms.json":()=>g(()=>import("./terms-DLR0eWQ4.js"),[]),"../locales/km/text-checker.json":()=>g(()=>import("./text-checker-CdXRu-PA.js"),[]),"../locales/km/themes.json":()=>g(()=>import("./themes-Cqd0q-0S.js"),[]),"../locales/km/vocabulary.json":()=>g(()=>import("./vocabulary-BBR6udJ7.js"),[]),"../locales/ko/about.json":()=>g(()=>import("./about-DiF1LEP_.js"),[]),"../locales/ko/auth.json":()=>g(()=>import("./auth-DJqLEUuc.js"),[]),"../locales/ko/blog.json":()=>g(()=>import("./blog-BvIRadeT.js"),[]),"../locales/ko/contact.json":()=>g(()=>import("./contact-x1ZskxyG.js"),[]),"../locales/ko/footer.json":()=>g(()=>import("./footer-DBTKH-Oj.js"),[]),"../locales/ko/generation.json":()=>g(()=>import("./generation-Cm3xlOE8.js"),[]),"../locales/ko/home.json":()=>g(()=>import("./home-B53NCSOc.js"),[]),"../locales/ko/improve-reading.json":()=>g(()=>import("./improve-reading-mMRLlEH1.js"),[]),"../locales/ko/landing.json":()=>g(()=>import("./landing-8HjZT36F.js"),[]),"../locales/ko/navbar.json":()=>g(()=>import("./navbar-2dQtXT44.js"),[]),"../locales/ko/newsletter.json":()=>g(()=>import("./newsletter-BksSboPo.js"),[]),"../locales/ko/notfound.json":()=>g(()=>import("./notfound-FYyFdfHR.js"),[]),"../locales/ko/payment-status.json":()=>g(()=>import("./payment-status-ChbkjUSO.js"),[]),"../locales/ko/privacy.json":()=>g(()=>import("./privacy-DcwIjlNa.js"),[]),"../locales/ko/progress.json":()=>g(()=>import("./progress-C54rdmgT.js"),[]),"../locales/ko/reading-cart.json":()=>g(()=>import("./reading-cart-Dm-p6pE1.js"),[]),"../locales/ko/refund.json":()=>g(()=>import("./refund-BE8h33fk.js"),[]),"../locales/ko/research.json":()=>g(()=>import("./research-DaiuHAnK.js"),[]),"../locales/ko/stories.json":()=>g(()=>import("./stories-B2C0hIGN.js"),[]),"../locales/ko/story-maker.json":()=>g(()=>import("./story-maker-1ZlZ1KC_.js"),[]),"../locales/ko/story-reader.json":()=>g(()=>import("./story-reader-C8EGXK12.js"),[]),"../locales/ko/subscription.json":()=>g(()=>import("./subscription-EvzCHQ9H.js"),[]),"../locales/ko/terms.json":()=>g(()=>import("./terms-NUbOcsbC.js"),[]),"../locales/ko/text-checker.json":()=>g(()=>import("./text-checker-CrvvtgiE.js"),[]),"../locales/ko/themes.json":()=>g(()=>import("./themes-CdsZfpNB.js"),[]),"../locales/ko/vocabulary.json":()=>g(()=>import("./vocabulary-CEJ-XQHR.js"),[]),"../locales/lo/about.json":()=>g(()=>import("./about-BF0PL3cx.js"),[]),"../locales/lo/auth.json":()=>g(()=>import("./auth-CH-6brIc.js"),[]),"../locales/lo/blog.json":()=>g(()=>import("./blog-Dz6Wmllk.js"),[]),"../locales/lo/contact.json":()=>g(()=>import("./contact-Dt96ZcUc.js"),[]),"../locales/lo/footer.json":()=>g(()=>import("./footer-7GPptpW1.js"),[]),"../locales/lo/generation.json":()=>g(()=>import("./generation-Bwm08rwA.js"),[]),"../locales/lo/home.json":()=>g(()=>import("./home-wJar71_x.js"),[]),"../locales/lo/improve-reading.json":()=>g(()=>import("./improve-reading-7TtQsqms.js"),[]),"../locales/lo/landing.json":()=>g(()=>import("./landing-SmyvoPq4.js"),[]),"../locales/lo/navbar.json":()=>g(()=>import("./navbar-BRQNeSnU.js"),[]),"../locales/lo/newsletter.json":()=>g(()=>import("./newsletter-CWQ9n19_.js"),[]),"../locales/lo/notfound.json":()=>g(()=>import("./notfound-BMBZdh8i.js"),[]),"../locales/lo/payment-status.json":()=>g(()=>import("./payment-status-DyjqNuOS.js"),[]),"../locales/lo/privacy.json":()=>g(()=>import("./privacy-Cfx54hqa.js"),[]),"../locales/lo/progress.json":()=>g(()=>import("./progress-dxgP4RAI.js"),[]),"../locales/lo/reading-cart.json":()=>g(()=>import("./reading-cart-BJsINgBD.js"),[]),"../locales/lo/refund.json":()=>g(()=>import("./refund-CG5dNc3H.js"),[]),"../locales/lo/research.json":()=>g(()=>import("./research-Dl9OZMpW.js"),[]),"../locales/lo/stories.json":()=>g(()=>import("./stories-CpZSXRjt.js"),[]),"../locales/lo/story-maker.json":()=>g(()=>import("./story-maker-Brok2cDe.js"),[]),"../locales/lo/story-reader.json":()=>g(()=>import("./story-reader-GO5Oxb1I.js"),[]),"../locales/lo/subscription.json":()=>g(()=>import("./subscription-nOVtGQUS.js"),[]),"../locales/lo/terms.json":()=>g(()=>import("./terms-Br5Uwn39.js"),[]),"../locales/lo/text-checker.json":()=>g(()=>import("./text-checker-B-yFaXbB.js"),[]),"../locales/lo/themes.json":()=>g(()=>import("./themes-Dfn3Wyos.js"),[]),"../locales/lo/vocabulary.json":()=>g(()=>import("./vocabulary-VLhO259h.js"),[]),"../locales/ms/about.json":()=>g(()=>import("./about-CXgQLHH4.js"),[]),"../locales/ms/auth.json":()=>g(()=>import("./auth-D-k4gD2K.js"),[]),"../locales/ms/blog.json":()=>g(()=>import("./blog-DMO8hXvZ.js"),[]),"../locales/ms/contact.json":()=>g(()=>import("./contact-BaYb8eiF.js"),[]),"../locales/ms/footer.json":()=>g(()=>import("./footer-CjmyHzTz.js"),[]),"../locales/ms/generation.json":()=>g(()=>import("./generation-qj9KGvWy.js"),[]),"../locales/ms/home.json":()=>g(()=>import("./home-CiL76YQC.js"),[]),"../locales/ms/improve-reading.json":()=>g(()=>import("./improve-reading-C4izNOPU.js"),[]),"../locales/ms/landing.json":()=>g(()=>import("./landing-CMdFATsx.js"),[]),"../locales/ms/navbar.json":()=>g(()=>import("./navbar-C3VpRFAq.js"),[]),"../locales/ms/newsletter.json":()=>g(()=>import("./newsletter-HsqT5F0u.js"),[]),"../locales/ms/notfound.json":()=>g(()=>import("./notfound-BCcddZ6I.js"),[]),"../locales/ms/payment-status.json":()=>g(()=>import("./payment-status-b1mAin25.js"),[]),"../locales/ms/privacy.json":()=>g(()=>import("./privacy-BcQwZpjo.js"),[]),"../locales/ms/progress.json":()=>g(()=>import("./progress-BIm2UpaG.js"),[]),"../locales/ms/reading-cart.json":()=>g(()=>import("./reading-cart-wR1TCbCv.js"),[]),"../locales/ms/refund.json":()=>g(()=>import("./refund-CWv5ymuK.js"),[]),"../locales/ms/research.json":()=>g(()=>import("./research-BgIvS1ZK.js"),[]),"../locales/ms/stories.json":()=>g(()=>import("./stories-YJn9R9za.js"),[]),"../locales/ms/story-maker.json":()=>g(()=>import("./story-maker-B2s8PWXA.js"),[]),"../locales/ms/story-reader.json":()=>g(()=>import("./story-reader-DOiqZ20L.js"),[]),"../locales/ms/subscription.json":()=>g(()=>import("./subscription-B8lcCYOg.js"),[]),"../locales/ms/terms.json":()=>g(()=>import("./terms-D4-POClR.js"),[]),"../locales/ms/text-checker.json":()=>g(()=>import("./text-checker-DEh4WgYJ.js"),[]),"../locales/ms/themes.json":()=>g(()=>import("./themes-BAJQmr8E.js"),[]),"../locales/ms/vocabulary.json":()=>g(()=>import("./vocabulary-D_aIyhqY.js"),[]),"../locales/my/about.json":()=>g(()=>import("./about-fk3vED2W.js"),[]),"../locales/my/auth.json":()=>g(()=>import("./auth-DJlclIcv.js"),[]),"../locales/my/blog.json":()=>g(()=>import("./blog-CIsbIRX9.js"),[]),"../locales/my/contact.json":()=>g(()=>import("./contact-BccRrC1v.js"),[]),"../locales/my/footer.json":()=>g(()=>import("./footer-BLmmHq6h.js"),[]),"../locales/my/generation.json":()=>g(()=>import("./generation-BkLNnSxn.js"),[]),"../locales/my/home.json":()=>g(()=>import("./home-BvdV-yBF.js"),[]),"../locales/my/improve-reading.json":()=>g(()=>import("./improve-reading-yJaMFEcn.js"),[]),"../locales/my/landing.json":()=>g(()=>import("./landing-Bf1Za6OQ.js"),[]),"../locales/my/navbar.json":()=>g(()=>import("./navbar-DcTChkwT.js"),[]),"../locales/my/newsletter.json":()=>g(()=>import("./newsletter-Bm-EqrXC.js"),[]),"../locales/my/notfound.json":()=>g(()=>import("./notfound-DaB8YmU7.js"),[]),"../locales/my/payment-status.json":()=>g(()=>import("./payment-status-Bnm_j6qm.js"),[]),"../locales/my/privacy.json":()=>g(()=>import("./privacy-BQTfDH9_.js"),[]),"../locales/my/progress.json":()=>g(()=>import("./progress-iB06zAI5.js"),[]),"../locales/my/reading-cart.json":()=>g(()=>import("./reading-cart-DK1JxbQu.js"),[]),"../locales/my/refund.json":()=>g(()=>import("./refund-CbxSkgZ9.js"),[]),"../locales/my/research.json":()=>g(()=>import("./research-Dy6zuYG9.js"),[]),"../locales/my/stories.json":()=>g(()=>import("./stories-FiV_cVvY.js"),[]),"../locales/my/story-maker.json":()=>g(()=>import("./story-maker-CWjYbOSJ.js"),[]),"../locales/my/story-reader.json":()=>g(()=>import("./story-reader-BVgxvf-o.js"),[]),"../locales/my/subscription.json":()=>g(()=>import("./subscription-DADzpCUx.js"),[]),"../locales/my/terms.json":()=>g(()=>import("./terms-l7e8Rauy.js"),[]),"../locales/my/text-checker.json":()=>g(()=>import("./text-checker-6EDRwp-Z.js"),[]),"../locales/my/themes.json":()=>g(()=>import("./themes-9qaCSYb_.js"),[]),"../locales/my/vocabulary.json":()=>g(()=>import("./vocabulary-CeAqYExb.js"),[]),"../locales/pt/about.json":()=>g(()=>import("./about-BSGurmEM.js"),[]),"../locales/pt/auth.json":()=>g(()=>import("./auth-C7qKtjQZ.js"),[]),"../locales/pt/blog.json":()=>g(()=>import("./blog-CM6YKmSa.js"),[]),"../locales/pt/contact.json":()=>g(()=>import("./contact-tqc8bEI8.js"),[]),"../locales/pt/footer.json":()=>g(()=>import("./footer-C_qNFj2o.js"),[]),"../locales/pt/generation.json":()=>g(()=>import("./generation-XrlRS6Zo.js"),[]),"../locales/pt/home.json":()=>g(()=>import("./home-l5UjQtqX.js"),[]),"../locales/pt/improve-reading.json":()=>g(()=>import("./improve-reading-2UjOqduY.js"),[]),"../locales/pt/landing.json":()=>g(()=>import("./landing-DUB9FlxZ.js"),[]),"../locales/pt/navbar.json":()=>g(()=>import("./navbar-Ch-Ug3lo.js"),[]),"../locales/pt/newsletter.json":()=>g(()=>import("./newsletter-ipzVLZbu.js"),[]),"../locales/pt/notfound.json":()=>g(()=>import("./notfound-pyIcecs_.js"),[]),"../locales/pt/payment-status.json":()=>g(()=>import("./payment-status-BcvFPL5g.js"),[]),"../locales/pt/privacy.json":()=>g(()=>import("./privacy-iWy0tBcT.js"),[]),"../locales/pt/progress.json":()=>g(()=>import("./progress-Z2_TS_JQ.js"),[]),"../locales/pt/reading-cart.json":()=>g(()=>import("./reading-cart-DlEu9kVT.js"),[]),"../locales/pt/refund.json":()=>g(()=>import("./refund-gjmk5GSP.js"),[]),"../locales/pt/research.json":()=>g(()=>import("./research-Eelds43d.js"),[]),"../locales/pt/stories.json":()=>g(()=>import("./stories-mFPd1WZR.js"),[]),"../locales/pt/story-maker.json":()=>g(()=>import("./story-maker-DhUN8N40.js"),[]),"../locales/pt/story-reader.json":()=>g(()=>import("./story-reader-ChjGH43i.js"),[]),"../locales/pt/subscription.json":()=>g(()=>import("./subscription-CDPiWLFO.js"),[]),"../locales/pt/terms.json":()=>g(()=>import("./terms-C0YDX0Wa.js"),[]),"../locales/pt/text-checker.json":()=>g(()=>import("./text-checker-CZ2tvwc7.js"),[]),"../locales/pt/themes.json":()=>g(()=>import("./themes-B0cO5PQt.js"),[]),"../locales/pt/vocabulary.json":()=>g(()=>import("./vocabulary-Cn50NpZR.js"),[]),"../locales/th/about.json":()=>g(()=>import("./about-CPD7D8UI.js"),[]),"../locales/th/auth.json":()=>g(()=>import("./auth-D9tCgD-G.js"),[]),"../locales/th/blog.json":()=>g(()=>import("./blog-lq9thkGX.js"),[]),"../locales/th/contact.json":()=>g(()=>import("./contact-Bk_EtW2q.js"),[]),"../locales/th/footer.json":()=>g(()=>import("./footer-D99GGkBk.js"),[]),"../locales/th/generation.json":()=>g(()=>import("./generation-CtWmM0O1.js"),[]),"../locales/th/home.json":()=>g(()=>import("./home-C8gefMaD.js"),[]),"../locales/th/improve-reading.json":()=>g(()=>import("./improve-reading-Bzg_GQEI.js"),[]),"../locales/th/landing.json":()=>g(()=>import("./landing-Br1QSPwx.js"),[]),"../locales/th/navbar.json":()=>g(()=>import("./navbar-C7LjGQU5.js"),[]),"../locales/th/newsletter.json":()=>g(()=>import("./newsletter-DR8eALoU.js"),[]),"../locales/th/notfound.json":()=>g(()=>import("./notfound-DzxKM3jh.js"),[]),"../locales/th/payment-status.json":()=>g(()=>import("./payment-status-CKa_MCbe.js"),[]),"../locales/th/privacy.json":()=>g(()=>import("./privacy-Dm6TbjVg.js"),[]),"../locales/th/progress.json":()=>g(()=>import("./progress-D_Wv48Gv.js"),[]),"../locales/th/reading-cart.json":()=>g(()=>import("./reading-cart-BVTDzVk3.js"),[]),"../locales/th/refund.json":()=>g(()=>import("./refund-DsnSqAtW.js"),[]),"../locales/th/research.json":()=>g(()=>import("./research-BvYK3be6.js"),[]),"../locales/th/stories.json":()=>g(()=>import("./stories-CWYz6ddH.js"),[]),"../locales/th/story-maker.json":()=>g(()=>import("./story-maker-CwQ6QiQo.js"),[]),"../locales/th/story-reader.json":()=>g(()=>import("./story-reader-KA8l28-C.js"),[]),"../locales/th/subscription.json":()=>g(()=>import("./subscription-DaD11Va4.js"),[]),"../locales/th/terms.json":()=>g(()=>import("./terms-BhE9fxdU.js"),[]),"../locales/th/text-checker.json":()=>g(()=>import("./text-checker-Ul69X85l.js"),[]),"../locales/th/themes.json":()=>g(()=>import("./themes-Cnl3epmL.js"),[]),"../locales/th/vocabulary.json":()=>g(()=>import("./vocabulary-CPgo2N2F.js"),[]),"../locales/vi/about.json":()=>g(()=>import("./about-BnqsduhT.js"),[]),"../locales/vi/auth.json":()=>g(()=>import("./auth-BGfcJULA.js"),[]),"../locales/vi/blog.json":()=>g(()=>import("./blog-M41NjzXI.js"),[]),"../locales/vi/contact.json":()=>g(()=>import("./contact-BSqzZQuw.js"),[]),"../locales/vi/footer.json":()=>g(()=>import("./footer-CIK9t4_l.js"),[]),"../locales/vi/generation.json":()=>g(()=>import("./generation-BNRPBduT.js"),[]),"../locales/vi/home.json":()=>g(()=>import("./home-BVGO2y4x.js"),[]),"../locales/vi/improve-reading.json":()=>g(()=>import("./improve-reading-DIp-7WE6.js"),[]),"../locales/vi/landing.json":()=>g(()=>import("./landing-D8FDkU-K.js"),[]),"../locales/vi/navbar.json":()=>g(()=>import("./navbar-DTA7T4dF.js"),[]),"../locales/vi/newsletter.json":()=>g(()=>import("./newsletter-BHahPilQ.js"),[]),"../locales/vi/notfound.json":()=>g(()=>import("./notfound-BzE0g0SH.js"),[]),"../locales/vi/payment-status.json":()=>g(()=>import("./payment-status-CcSJMXeR.js"),[]),"../locales/vi/privacy.json":()=>g(()=>import("./privacy-CGV1fVVB.js"),[]),"../locales/vi/progress.json":()=>g(()=>import("./progress-BN7spRkP.js"),[]),"../locales/vi/reading-cart.json":()=>g(()=>import("./reading-cart-Bc2VXFU8.js"),[]),"../locales/vi/refund.json":()=>g(()=>import("./refund-BxcMDtXh.js"),[]),"../locales/vi/research.json":()=>g(()=>import("./research-CU2ZYjBR.js"),[]),"../locales/vi/stories.json":()=>g(()=>import("./stories-CFPRQUo5.js"),[]),"../locales/vi/story-maker.json":()=>g(()=>import("./story-maker-JMCydV8V.js"),[]),"../locales/vi/story-reader.json":()=>g(()=>import("./story-reader-B44LG7pc.js"),[]),"../locales/vi/subscription.json":()=>g(()=>import("./subscription-CUsqES-g.js"),[]),"../locales/vi/terms.json":()=>g(()=>import("./terms-BOBUQPx_.js"),[]),"../locales/vi/text-checker.json":()=>g(()=>import("./text-checker-C_MQ9b9F.js"),[]),"../locales/vi/themes.json":()=>g(()=>import("./themes-C2DaOhB6.js"),[]),"../locales/vi/vocabulary.json":()=>g(()=>import("./vocabulary-DJZtk-iW.js"),[]),"../locales/zh/about.json":()=>g(()=>import("./about-D3eT9WaA.js"),[]),"../locales/zh/auth.json":()=>g(()=>import("./auth-CvR0HAI4.js"),[]),"../locales/zh/blog.json":()=>g(()=>import("./blog-DFLZJglZ.js"),[]),"../locales/zh/contact.json":()=>g(()=>import("./contact-TRjNzjJw.js"),[]),"../locales/zh/footer.json":()=>g(()=>import("./footer-CZTn0yOr.js"),[]),"../locales/zh/generation.json":()=>g(()=>import("./generation-C6DVAL14.js"),[]),"../locales/zh/home.json":()=>g(()=>import("./home-DOWCMOhT.js"),[]),"../locales/zh/improve-reading.json":()=>g(()=>import("./improve-reading-DOxfe7y7.js"),[]),"../locales/zh/landing.json":()=>g(()=>import("./landing-Cz5v1E14.js"),[]),"../locales/zh/navbar.json":()=>g(()=>import("./navbar-B8S1iedS.js"),[]),"../locales/zh/newsletter.json":()=>g(()=>import("./newsletter-wGuJRvTc.js"),[]),"../locales/zh/notfound.json":()=>g(()=>import("./notfound-Cqt5gBKM.js"),[]),"../locales/zh/payment-status.json":()=>g(()=>import("./payment-status-ubxHsmFd.js"),[]),"../locales/zh/privacy.json":()=>g(()=>import("./privacy-y1aPYI4v.js"),[]),"../locales/zh/progress.json":()=>g(()=>import("./progress-BJTB4V31.js"),[]),"../locales/zh/reading-cart.json":()=>g(()=>import("./reading-cart-DvJQrLvq.js"),[]),"../locales/zh/refund.json":()=>g(()=>import("./refund-VHDYVAUj.js"),[]),"../locales/zh/research.json":()=>g(()=>import("./research-B-HQbgFB.js"),[]),"../locales/zh/stories.json":()=>g(()=>import("./stories-DVgriTV9.js"),[]),"../locales/zh/story-maker.json":()=>g(()=>import("./story-maker-QF-WsIM9.js"),[]),"../locales/zh/story-reader.json":()=>g(()=>import("./story-reader-BQ1EfpTv.js"),[]),"../locales/zh/subscription.json":()=>g(()=>import("./subscription-CAIJ5q9P.js"),[]),"../locales/zh/terms.json":()=>g(()=>import("./terms-oJg-2cMy.js"),[]),"../locales/zh/text-checker.json":()=>g(()=>import("./text-checker-BzvEFLKg.js"),[]),"../locales/zh/themes.json":()=>g(()=>import("./themes-D2mWuh-g.js"),[]),"../locales/zh/vocabulary.json":()=>g(()=>import("./vocabulary-C8ynczMq.js"),[])}),`../locales/${t}/${e}.json`,4))).use(Qy).init({lng:hP,fallbackLng:"en",defaultNS:"home",ns:[...sv],partialBundledLanguages:!0,load:"languageOnly",supportedLngs:ls,nonExplicitSupportedLngs:!0,interpolation:{escapeValue:!1},react:{useSuspense:!0}});const rv=f.createContext(void 0),pP=({children:t})=>{const[e,n]=f.useState(0),s=f.useRef(!1),r=f.useCallback(a=>{s.current!==a&&(s.current=a,n(l=>Math.max(0,l+(a?1:-1))))},[]),i=f.useMemo(()=>({isBusy:e>0,setBusy:r}),[e,r]);return o.jsx(rv.Provider,{value:i,children:t})},ov=()=>{const t=f.useContext(rv);return t||{isBusy:!1,setBusy:()=>{}}},iv=f.createContext(void 0),fP=({children:t})=>{const{i18n:e}=Oe(),n=wc(),s=Ys(),{isBusy:r}=ov(),[i,a]=f.useState(()=>Kl(typeof window<"u"?window.location.pathname:"/")),[l,c]=f.useState(!1),u=f.useRef(null),d=[],h={ko:{id:"noto-sans-kr",family:"Noto+Sans+KR:wght@100..900"},th:{id:"noto-sans-thai",family:"Noto+Sans+Thai:wght@100..900"},vi:{id:"noto-sans-vietnamese",family:"Noto+Sans:wght@100..900"},hi:{id:"noto-sans-devanagari",family:"Noto+Sans+Devanagari:wght@100..900"},pt:{id:"noto-sans-latin-ext",family:"Noto+Sans:wght@100..900"},my:{id:"noto-sans-myanmar",family:"Noto+Sans+Myanmar:wght@100..900"},km:{id:"noto-sans-khmer",family:"Noto+Sans+Khmer:wght@100..900"},lo:{id:"noto-sans-lao",family:"Noto+Sans+Lao:wght@100..900"}};f.useEffect(()=>{if(typeof document>"u")return;const y=h[i];if(!y||document.getElementById(y.id))return;const _=document.createElement("link");_.rel="preconnect",_.href="https://fonts.gstatic.com",_.crossOrigin="anonymous",document.head.appendChild(_);const x=document.createElement("link");x.id=y.id,x.rel="stylesheet",x.href=`https://fonts.googleapis.com/css2?family=${y.family}&display=swap`,document.head.appendChild(x)},[i]),f.useEffect(()=>{const y=Kl(s.pathname),_=ql(s.pathname);a(y);let x=!1;return e.loadNamespaces(_).finally(()=>{!x&&e.language!==y?e.changeLanguage(y):x||e.changeLanguage(y),x||(c(!1),u.current&&(clearTimeout(u.current),u.current=null))}),()=>{x=!0}},[s.pathname,e]);const p=async y=>{if(y===i||r)return;c(!0),u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{c(!1)},4e3);const _=ls.filter(P=>P!=="en"),x=new RegExp(`^/(${_.join("|")})(?=/|$)`);let b=s.pathname;for(;x.test(b);)b=b.replace(x,"")||"/";b===""&&(b="/");const w=d.includes(b);let E=b;!w&&y!=="en"&&(E=b==="/"?`/${y}/`:`/${y}${b}`);const T=ql(E),j=new Promise(P=>setTimeout(P,400));try{await Promise.all([e.loadNamespaces(T),j])}catch{}a(y),await e.changeLanguage(y),E!==s.pathname&&n(E),c(!1),u.current&&(clearTimeout(u.current),u.current=null)},m=y=>!d.includes(y)&&i!=="en"&&ls.includes(i)?y==="/"?`/${i}/`:`/${i}${y}`:y;return o.jsx(iv.Provider,{value:{currentLanguage:i,changeLanguage:p,getLocalizedPath:m,isSwitchingLanguage:l},children:t})},hn=()=>{const t=f.useContext(iv);if(t===void 0)throw new Error("useLanguage must be used within a LanguageProvider");return t},av=f.createContext({targetElement:null,setLumiTarget:()=>{},onTargetReached:void 0,setOnTargetReached:()=>{}}),lv=()=>f.useContext(av),mP=({children:t})=>{const[e,n]=f.useState(null),s=f.useRef(void 0),[,r]=f.useState(0),i=f.useCallback(l=>{n(l)},[]),a=f.useCallback(l=>{s.current=l,r(c=>c+1)},[]);return o.jsx(av.Provider,{value:{targetElement:e,setLumiTarget:i,onTargetReached:s.current,setOnTargetReached:a},children:t})},Jc=f.createContext({});function Wn(t){const e=f.useRef(null);return e.current===null&&(e.current=t()),e.current}const Qc=typeof window<"u",vo=Qc?f.useLayoutEffect:f.useEffect,ea=f.createContext(null),_o=f.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});class gP extends f.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const s=n.offsetParent,r=s instanceof HTMLElement&&s.offsetWidth||0,i=this.props.sizeRef.current;i.height=n.offsetHeight||0,i.width=n.offsetWidth||0,i.top=n.offsetTop,i.left=n.offsetLeft,i.right=r-i.width-i.left}return null}componentDidUpdate(){}render(){return this.props.children}}function vP({children:t,isPresent:e,anchorX:n}){const s=f.useId(),r=f.useRef(null),i=f.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:a}=f.useContext(_o);return f.useInsertionEffect(()=>{const{width:l,height:c,top:u,left:d,right:h}=i.current;if(e||!r.current||!l||!c)return;const p=n==="left"?`left: ${d}`:`right: ${h}`;r.current.dataset.motionPopId=s;const m=document.createElement("style");return a&&(m.nonce=a),document.head.appendChild(m),m.sheet&&m.sheet.insertRule(`
[data-motion-pop-id="${s}"] {
position: absolute !important;
width: ${l}px !important;
height: ${c}px !important;
${p}px !important;
top: ${u}px !important;
}
`),()=>{document.head.removeChild(m)}},[e]),o.jsx(gP,{isPresent:e,childRef:r,sizeRef:i,children:f.cloneElement(t,{ref:r})})}const _P=({children:t,initial:e,isPresent:n,onExitComplete:s,custom:r,presenceAffectsLayout:i,mode:a,anchorX:l})=>{const c=Wn(yP),u=f.useId(),d=f.useCallback(p=>{c.set(p,!0);for(const m of c.values())if(!m)return;s&&s()},[c,s]),h=f.useMemo(()=>({id:u,initial:e,isPresent:n,custom:r,onExitComplete:d,register:p=>(c.set(p,!1),()=>c.delete(p))}),i?[Math.random(),d]:[n,d]);return f.useMemo(()=>{c.forEach((p,m)=>c.set(m,!1))},[n]),f.useEffect(()=>{!n&&!c.size&&s&&s()},[n]),a==="popLayout"&&(t=o.jsx(vP,{isPresent:n,anchorX:l,children:t})),o.jsx(ea.Provider,{value:h,children:t})};function yP(){return new Map}function cv(t=!0){const e=f.useContext(ea);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:s,register:r}=e,i=f.useId();f.useEffect(()=>{if(t)return r(i)},[t]);const a=f.useCallback(()=>t&&s&&s(i),[i,s,t]);return!n&&s?[!1,a]:[!0]}const Vo=t=>t.key||"";function Oh(t){const e=[];return f.Children.forEach(t,n=>{f.isValidElement(n)&&e.push(n)}),e}const xP=({children:t,custom:e,initial:n=!0,onExitComplete:s,presenceAffectsLayout:r=!0,mode:i="sync",propagate:a=!1,anchorX:l="left"})=>{const[c,u]=cv(a),d=f.useMemo(()=>Oh(t),[t]),h=a&&!c?[]:d.map(Vo),p=f.useRef(!0),m=f.useRef(d),y=Wn(()=>new Map),[_,x]=f.useState(d),[b,w]=f.useState(d);vo(()=>{p.current=!1,m.current=d;for(let j=0;j<b.length;j++){const P=Vo(b[j]);h.includes(P)?y.delete(P):y.get(P)!==!0&&y.set(P,!1)}},[b,h.length,h.join("-")]);const E=[];if(d!==_){let j=[...d];for(let P=0;P<b.length;P++){const k=b[P],S=Vo(k);h.includes(S)||(j.splice(P,0,k),E.push(k))}return i==="wait"&&E.length&&(j=E),w(Oh(j)),x(d),null}const{forceRender:T}=f.useContext(Jc);return o.jsx(o.Fragment,{children:b.map(j=>{const P=Vo(j),k=a&&!c?!1:d===b||h.includes(P),S=()=>{if(y.has(P))y.set(P,!0);else return;let D=!0;y.forEach(A=>{A||(D=!1)}),D&&(T?.(),w(m.current),a&&u?.(),s&&s())};return o.jsx(_P,{isPresent:k,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:r,mode:i,onExitComplete:k?void 0:S,anchorX:l,children:j},P)})})};function eu(t,e){t.indexOf(e)===-1&&t.push(e)}function tu(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}let bP=()=>{},Yl=()=>{};const wP={skipAnimations:!1,useManualTiming:!1};function nu(t){let e;return()=>(e===void 0&&(e=t()),e)}const Et=t=>t,Ws=(t,e,n)=>{const s=e-t;return s===0?1:(n-t)/s};class su{constructor(){this.subscriptions=[]}add(e){return eu(this.subscriptions,e),()=>tu(this.subscriptions,e)}notify(e,n,s){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,n,s);else for(let i=0;i<r;i++){const a=this.subscriptions[i];a&&a(e,n,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const sn=t=>t*1e3,rn=t=>t/1e3;function ru(t,e){return e?t*(1e3/e):0}const uv=nu(()=>window.ScrollTimeline!==void 0);class EP{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>e.finished))}getAll(e){return this.animations[0][e]}setAll(e,n){for(let s=0;s<this.animations.length;s++)this.animations[s][e]=n}attachTimeline(e,n){const s=this.animations.map(r=>{if(uv()&&r.attachTimeline)return r.attachTimeline(e);if(typeof n=="function")return n(r)});return()=>{s.forEach((r,i)=>{r&&r(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let n=0;n<this.animations.length;n++)e=Math.max(e,this.animations[n].duration);return e}runAll(e){this.animations.forEach(n=>n[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class jP extends EP{then(e,n){return this.finished.finally(e).then(()=>{})}}const Dh={value:null,addProjectionMetrics:null},ou=t=>Array.isArray(t)&&typeof t[0]=="number",TP={};function PP(t,e){const n=nu(t);return()=>TP[e]??n()}const Qr=PP(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),dv=(t,e,n=10)=>{let s="";const r=Math.max(Math.round(e/n),2);for(let i=0;i<r;i++)s+=t(i/(r-1))+", ";return`linear(${s.substring(0,s.length-2)})`},kr=([t,e,n,s])=>`cubic-bezier(${t}, ${e}, ${n}, ${s})`,Xl={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:kr([0,.65,.55,1]),circOut:kr([.55,0,1,.45]),backIn:kr([.31,.01,.66,-.59]),backOut:kr([.33,1.53,.69,.99])};function hv(t,e){if(t)return typeof t=="function"&&Qr()?dv(t,e):ou(t)?kr(t):Array.isArray(t)?t.map(n=>hv(n,e)||Xl.easeOut):Xl[t]}function kP(t,e,n,{delay:s=0,duration:r=300,repeat:i=0,repeatType:a="loop",ease:l="easeInOut",times:c}={},u=void 0){const d={[e]:n};c&&(d.offset=c);const h=hv(l,r);return Array.isArray(h)&&(d.easing=h),t.animate(d,{delay:s,duration:r,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:a==="reverse"?"alternate":"normal",pseudoElement:u})}function iu(t){return typeof t=="function"&&"applyToOptions"in t}function au(t,e){return t?.[e]??t?.default??t}const Si=2e4;function lu(t){let e=0;const n=50;let s=t.next(e);for(;!s.done&&e<Si;)e+=n,s=t.next(e);return e>=Si?1/0:e}function SP(t,e=100,n){const s=n({...t,keyframes:[0,e]}),r=Math.min(lu(s),Si);return{type:"keyframes",ease:i=>s.next(r*i).value/e,duration:rn(r)}}function pv(t){return!!(typeof t=="function"&&Qr()||!t||typeof t=="string"&&(t in Xl||Qr())||ou(t)||Array.isArray(t)&&t.every(pv))}function Lh(t,e){t.timeline=e,t.onfinish=null}const Fo=["read","resolveKeyframes","update","preRender","render","postRender"];function RP(t,e){let n=new Set,s=new Set,r=!1,i=!1;const a=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1},c=0;function u(h){a.has(h)&&(d.schedule(h),t()),c++,h(l)}const d={schedule:(h,p=!1,m=!1)=>{const _=m&&r?n:s;return p&&a.add(h),_.has(h)||_.add(h),h},cancel:h=>{s.delete(h),a.delete(h)},process:h=>{if(l=h,r){i=!0;return}r=!0,[n,s]=[s,n],n.forEach(u),e&&Dh.value&&Dh.value.frameloop[e].push(c),c=0,n.clear(),r=!1,i&&(i=!1,d.process(h))}};return d}const AP=40;function fv(t,e){let n=!1,s=!0;const r={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,a=Fo.reduce((b,w)=>(b[w]=RP(i,e?w:void 0),b),{}),{read:l,resolveKeyframes:c,update:u,preRender:d,render:h,postRender:p}=a,m=()=>{const b=performance.now();n=!1,r.delta=s?1e3/60:Math.max(Math.min(b-r.timestamp,AP),1),r.timestamp=b,r.isProcessing=!0,l.process(r),c.process(r),u.process(r),d.process(r),h.process(r),p.process(r),r.isProcessing=!1,n&&e&&(s=!1,t(m))},y=()=>{n=!0,s=!0,r.isProcessing||t(m)};return{schedule:Fo.reduce((b,w)=>{const E=a[w];return b[w]=(T,j=!1,P=!1)=>(n||y(),E.schedule(T,j,P)),b},{}),cancel:b=>{for(let w=0;w<Fo.length;w++)a[Fo[w]].cancel(b)},state:r,steps:a}}const{schedule:ae,cancel:zt,state:Me,steps:Ma}=fv(typeof requestAnimationFrame<"u"?requestAnimationFrame:Et,!0),{schedule:cu,cancel:PL}=fv(queueMicrotask,!1);let ei;function CP(){ei=void 0}const on={now:()=>(ei===void 0&&on.set(Me.isProcessing||wP.useManualTiming?Me.timestamp:performance.now()),ei),set:t=>{ei=t,queueMicrotask(CP)}},Ft={x:!1,y:!1};function mv(){return Ft.x||Ft.y}function IP(t){return t==="x"||t==="y"?Ft[t]?null:(Ft[t]=!0,()=>{Ft[t]=!1}):Ft.x||Ft.y?null:(Ft.x=Ft.y=!0,()=>{Ft.x=Ft.y=!1})}function uu(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let s=document;const r=n?.[t]??s.querySelectorAll(t);return r?Array.from(r):[]}return Array.from(t)}function gv(t,e){const n=uu(t),s=new AbortController,r={passive:!0,...e,signal:s.signal};return[n,r,()=>s.abort()]}function Mh(t){return!(t.pointerType==="touch"||mv())}function OP(t,e,n={}){const[s,r,i]=gv(t,n),a=l=>{if(!Mh(l))return;const{target:c}=l,u=e(c,l);if(typeof u!="function"||!c)return;const d=h=>{Mh(h)&&(u(h),c.removeEventListener("pointerleave",d))};c.addEventListener("pointerleave",d,r)};return s.forEach(l=>{l.addEventListener("pointerenter",a,r)}),i}const vv=(t,e)=>e?t===e?!0:vv(t,e.parentElement):!1,du=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,DP=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function LP(t){return DP.has(t.tagName)||t.tabIndex!==-1}const Sr=new WeakSet;function Nh(t){return e=>{e.key==="Enter"&&t(e)}}function Na(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const MP=(t,e)=>{const n=t.currentTarget;if(!n)return;const s=Nh(()=>{if(Sr.has(n))return;Na(n,"down");const r=Nh(()=>{Na(n,"up")}),i=()=>Na(n,"cancel");n.addEventListener("keyup",r,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",s,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",s),e)};function Vh(t){return du(t)&&!mv()}function NP(t,e,n={}){const[s,r,i]=gv(t,n),a=l=>{const c=l.currentTarget;if(!Vh(l)||Sr.has(c))return;Sr.add(c);const u=e(c,l),d=(m,y)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",p),!(!Vh(m)||!Sr.has(c))&&(Sr.delete(c),typeof u=="function"&&u(m,{success:y}))},h=m=>{d(m,c===window||c===document||n.useGlobalTarget||vv(c,m.target))},p=m=>{d(m,!1)};window.addEventListener("pointerup",h,r),window.addEventListener("pointercancel",p,r)};return s.forEach(l=>{(n.useGlobalTarget?window:l).addEventListener("pointerdown",a,r),l instanceof HTMLElement&&(l.addEventListener("focus",u=>MP(u,r)),!LP(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),i}const Fh=30,VP=t=>!isNaN(parseFloat(t)),Nr={current:void 0};class FP{constructor(e,n={}){this.version="12.6.3",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,r=!0)=>{const i=on.now();this.updatedAt!==i&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=on.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=VP(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new su);const s=this.events[e].add(n);return e==="change"?()=>{s(),ae.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e,n=!0){!n||!this.passiveEffect?this.updateAndNotify(e,n):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,n,s){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-s}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Nr.current&&Nr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=on.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Fh)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,Fh);return ru(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function nn(t,e){return new FP(t,e)}const _v=f.createContext({strict:!1}),$h={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Gs={};for(const t in $h)Gs[t]={isEnabled:e=>$h[t].some(n=>!!e[n])};function $P(t){for(const e in t)Gs[e]={...Gs[e],...t[e]}}const BP=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function Ri(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||BP.has(t)}let yv=t=>!Ri(t);function zP(t){t&&(yv=e=>e.startsWith("on")?!Ri(e):t(e))}try{zP(require("@emotion/is-prop-valid").default)}catch{}function UP(t,e,n){const s={};for(const r in t)r==="values"&&typeof t.values=="object"||(yv(r)||n===!0&&Ri(r)||!e&&!Ri(r)||t.draggable&&r.startsWith("onDrag"))&&(s[r]=t[r]);return s}function HP(t){if(typeof Proxy>"u")return t;const e=new Map,n=(...s)=>t(...s);return new Proxy(n,{get:(s,r)=>r==="create"?t:(e.has(r)||e.set(r,t(r)),e.get(r))})}const ta=f.createContext({});function na(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function eo(t){return typeof t=="string"||Array.isArray(t)}const hu=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],pu=["initial",...hu];function sa(t){return na(t.animate)||pu.some(e=>eo(t[e]))}function xv(t){return!!(sa(t)||t.variants)}function WP(t,e){if(sa(t)){const{initial:n,animate:s}=t;return{initial:n===!1||eo(n)?n:void 0,animate:eo(s)?s:void 0}}return t.inherit!==!1?e:{}}function GP(t){const{initial:e,animate:n}=WP(t,f.useContext(ta));return f.useMemo(()=>({initial:e,animate:n}),[Bh(e),Bh(n)])}function Bh(t){return Array.isArray(t)?t.join(" "):t}const KP=Symbol.for("motionComponentSymbol");function Ss(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function qP(t,e,n){return f.useCallback(s=>{s&&t.onMount&&t.onMount(s),e&&(s?e.mount(s):e.unmount()),n&&(typeof n=="function"?n(s):Ss(n)&&(n.current=s))},[e])}const fu=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),YP="framerAppearId",bv="data-"+fu(YP),wv=f.createContext({});function XP(t,e,n,s,r){const{visualElement:i}=f.useContext(ta),a=f.useContext(_v),l=f.useContext(ea),c=f.useContext(_o).reducedMotion,u=f.useRef(null);s=s||a.renderer,!u.current&&s&&(u.current=s(t,{visualState:e,parent:i,props:n,presenceContext:l,blockInitialAnimation:l?l.initial===!1:!1,reducedMotionConfig:c}));const d=u.current,h=f.useContext(wv);d&&!d.projection&&r&&(d.type==="html"||d.type==="svg")&&ZP(u.current,n,r,h);const p=f.useRef(!1);f.useInsertionEffect(()=>{d&&p.current&&d.update(n,l)});const m=n[bv],y=f.useRef(!!m&&!window.MotionHandoffIsComplete?.(m)&&window.MotionHasOptimisedAnimation?.(m));return vo(()=>{d&&(p.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),cu.render(d.render),y.current&&d.animationState&&d.animationState.animateChanges())}),f.useEffect(()=>{d&&(!y.current&&d.animationState&&d.animationState.animateChanges(),y.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(m)}),y.current=!1))}),d}function ZP(t,e,n,s){const{layoutId:r,layout:i,drag:a,dragConstraints:l,layoutScroll:c,layoutRoot:u}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:Ev(t.parent)),t.projection.setOptions({layoutId:r,layout:i,alwaysMeasureLayout:!!a||l&&Ss(l),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:s,layoutScroll:c,layoutRoot:u})}function Ev(t){if(t)return t.options.allowProjection!==!1?t.projection:Ev(t.parent)}function JP({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:s,Component:r}){t&&$P(t);function i(l,c){let u;const d={...f.useContext(_o),...l,layoutId:QP(l)},{isStatic:h}=d,p=GP(l),m=s(l,h);if(!h&&Qc){ek();const y=tk(d);u=y.MeasureLayout,p.visualElement=XP(r,m,d,e,y.ProjectionNode)}return o.jsxs(ta.Provider,{value:p,children:[u&&p.visualElement?o.jsx(u,{visualElement:p.visualElement,...d}):null,n(r,l,qP(m,p.visualElement,c),m,h,p.visualElement)]})}i.displayName=`motion.${typeof r=="string"?r:`create(${r.displayName??r.name??""})`}`;const a=f.forwardRef(i);return a[KP]=r,a}function QP({layoutId:t}){const e=f.useContext(Jc).id;return e&&t!==void 0?e+"-"+t:t}function ek(t,e){f.useContext(_v).strict}function tk(t){const{drag:e,layout:n}=Gs;if(!e&&!n)return{};const s={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}const jv=t=>e=>typeof e=="string"&&e.startsWith(t),mu=jv("--"),nk=jv("var(--"),gu=t=>nk(t)?sk.test(t.split("/*")[0].trim()):!1,sk=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,to={};function rk(t){for(const e in t)to[e]=t[e],mu(e)&&(to[e].isCSSVariable=!0)}const er=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],us=new Set(er);function Tv(t,{layout:e,layoutId:n}){return us.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!to[t]||t==="opacity")}const Ne=t=>!!(t&&t.getVelocity),Pv=(t,e)=>e&&typeof t=="number"?e.transform(t):t,un=(t,e,n)=>n>e?e:n<t?t:n,tr={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},no={...tr,transform:t=>un(0,1,t)},$o={...tr,default:1},yo=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Dn=yo("deg"),an=yo("%"),X=yo("px"),ok=yo("vh"),ik=yo("vw"),zh={...an,parse:t=>an.parse(t)/100,transform:t=>an.transform(t*100)},ak={borderWidth:X,borderTopWidth:X,borderRightWidth:X,borderBottomWidth:X,borderLeftWidth:X,borderRadius:X,radius:X,borderTopLeftRadius:X,borderTopRightRadius:X,borderBottomRightRadius:X,borderBottomLeftRadius:X,width:X,maxWidth:X,height:X,maxHeight:X,top:X,right:X,bottom:X,left:X,padding:X,paddingTop:X,paddingRight:X,paddingBottom:X,paddingLeft:X,margin:X,marginTop:X,marginRight:X,marginBottom:X,marginLeft:X,backgroundPositionX:X,backgroundPositionY:X},lk={rotate:Dn,rotateX:Dn,rotateY:Dn,rotateZ:Dn,scale:$o,scaleX:$o,scaleY:$o,scaleZ:$o,skew:Dn,skewX:Dn,skewY:Dn,distance:X,translateX:X,translateY:X,translateZ:X,x:X,y:X,z:X,perspective:X,transformPerspective:X,opacity:no,originX:zh,originY:zh,originZ:X},Uh={...tr,transform:Math.round},vu={...ak,...lk,zIndex:Uh,size:X,fillOpacity:no,strokeOpacity:no,numOctaves:Uh},ck={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},uk=er.length;function dk(t,e,n){let s="",r=!0;for(let i=0;i<uk;i++){const a=er[i],l=t[a];if(l===void 0)continue;let c=!0;if(typeof l=="number"?c=l===(a.startsWith("scale")?1:0):c=parseFloat(l)===0,!c||n){const u=Pv(l,vu[a]);if(!c){r=!1;const d=ck[a]||a;s+=`${d}(${u}) `}n&&(e[a]=u)}}return s=s.trim(),n?s=n(e,r?"":s):r&&(s="none"),s}function _u(t,e,n){const{style:s,vars:r,transformOrigin:i}=t;let a=!1,l=!1;for(const c in e){const u=e[c];if(us.has(c)){a=!0;continue}else if(mu(c)){r[c]=u;continue}else{const d=Pv(u,vu[c]);c.startsWith("origin")?(l=!0,i[c]=d):s[c]=d}}if(e.transform||(a||n?s.transform=dk(e,t.transform,n):s.transform&&(s.transform="none")),l){const{originX:c="50%",originY:u="50%",originZ:d=0}=i;s.transformOrigin=`${c} ${u} ${d}`}}const yu=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function kv(t,e,n){for(const s in e)!Ne(e[s])&&!Tv(s,n)&&(t[s]=e[s])}function hk({transformTemplate:t},e){return f.useMemo(()=>{const n=yu();return _u(n,e,t),Object.assign({},n.vars,n.style)},[e])}function pk(t,e){const n=t.style||{},s={};return kv(s,n,t),Object.assign(s,hk(t,e)),s}function fk(t,e){const n={},s=pk(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,s.userSelect=s.WebkitUserSelect=s.WebkitTouchCallout="none",s.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=s,n}const mk=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function xu(t){return typeof t!="string"||t.includes("-")?!1:!!(mk.indexOf(t)>-1||/[A-Z]/u.test(t))}const gk={offset:"stroke-dashoffset",array:"stroke-dasharray"},vk={offset:"strokeDashoffset",array:"strokeDasharray"};function _k(t,e,n=1,s=0,r=!0){t.pathLength=1;const i=r?gk:vk;t[i.offset]=X.transform(-s);const a=X.transform(e),l=X.transform(n);t[i.array]=`${a} ${l}`}function Hh(t,e,n){return typeof t=="string"?t:X.transform(e+n*t)}function yk(t,e,n){const s=Hh(e,t.x,t.width),r=Hh(n,t.y,t.height);return`${s} ${r}`}function bu(t,{attrX:e,attrY:n,attrScale:s,originX:r,originY:i,pathLength:a,pathSpacing:l=1,pathOffset:c=0,...u},d,h){if(_u(t,u,h),d){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:p,style:m,dimensions:y}=t;p.transform&&(y&&(m.transform=p.transform),delete p.transform),y&&(r!==void 0||i!==void 0||m.transform)&&(m.transformOrigin=yk(y,r!==void 0?r:.5,i!==void 0?i:.5)),e!==void 0&&(p.x=e),n!==void 0&&(p.y=n),s!==void 0&&(p.scale=s),a!==void 0&&_k(p,a,l,c,!1)}const Sv=()=>({...yu(),attrs:{}}),wu=t=>typeof t=="string"&&t.toLowerCase()==="svg";function xk(t,e,n,s){const r=f.useMemo(()=>{const i=Sv();return bu(i,e,wu(s),t.transformTemplate),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};kv(i,t.style,t),r.style={...i,...r.style}}return r}function bk(t=!1){return(n,s,r,{latestValues:i},a)=>{const c=(xu(n)?xk:fk)(s,i,a,n),u=UP(s,typeof n=="string",t),d=n!==f.Fragment?{...u,...c,ref:r}:{},{children:h}=s,p=f.useMemo(()=>Ne(h)?h.get():h,[h]);return f.createElement(n,{...d,children:p})}}function Wh(t){const e=[{},{}];return t?.values.forEach((n,s)=>{e[0][s]=n.get(),e[1][s]=n.getVelocity()}),e}function Eu(t,e,n,s){if(typeof e=="function"){const[r,i]=Wh(s);e=e(n!==void 0?n:t.custom,r,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[r,i]=Wh(s);e=e(n!==void 0?n:t.custom,r,i)}return e}const Zl=t=>Array.isArray(t),wk=t=>!!(t&&typeof t=="object"&&t.mix&&t.toValue),Ek=t=>Zl(t)?t[t.length-1]||0:t;function ti(t){const e=Ne(t)?t.get():t;return wk(e)?e.toValue():e}function jk({scrapeMotionValuesFromProps:t,createRenderState:e,onUpdate:n},s,r,i){const a={latestValues:Tk(s,r,i,t),renderState:e()};return n&&(a.onMount=l=>n({props:s,current:l,...a}),a.onUpdate=l=>n(l)),a}const Rv=t=>(e,n)=>{const s=f.useContext(ta),r=f.useContext(ea),i=()=>jk(t,e,s,r);return n?i():Wn(i)};function Tk(t,e,n,s){const r={},i=s(t,{});for(const p in i)r[p]=ti(i[p]);let{initial:a,animate:l}=t;const c=sa(t),u=xv(t);e&&u&&!c&&t.inherit!==!1&&(a===void 0&&(a=e.initial),l===void 0&&(l=e.animate));let d=n?n.initial===!1:!1;d=d||a===!1;const h=d?l:a;if(h&&typeof h!="boolean"&&!na(h)){const p=Array.isArray(h)?h:[h];for(let m=0;m<p.length;m++){const y=Eu(t,p[m]);if(y){const{transitionEnd:_,transition:x,...b}=y;for(const w in b){let E=b[w];if(Array.isArray(E)){const T=d?E.length-1:0;E=E[T]}E!==null&&(r[w]=E)}for(const w in _)r[w]=_[w]}}}return r}function ju(t,e,n){const{style:s}=t,r={};for(const i in s)(Ne(s[i])||e.style&&Ne(e.style[i])||Tv(i,t)||n?.getValue(i)?.liveStyle!==void 0)&&(r[i]=s[i]);return r}const Pk={useVisualState:Rv({scrapeMotionValuesFromProps:ju,createRenderState:yu})};function Av(t,e){try{e.dimensions=typeof t.getBBox=="function"?t.getBBox():t.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}function Cv(t,{style:e,vars:n},s,r){Object.assign(t.style,e,r&&r.getProjectionStyles(s));for(const i in n)t.style.setProperty(i,n[i])}const Iv=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function Ov(t,e,n,s){Cv(t,e,void 0,s);for(const r in e.attrs)t.setAttribute(Iv.has(r)?r:fu(r),e.attrs[r])}function Dv(t,e,n){const s=ju(t,e,n);for(const r in t)if(Ne(t[r])||Ne(e[r])){const i=er.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;s[i]=t[r]}return s}const Gh=["x","y","width","height","cx","cy","r"],kk={useVisualState:Rv({scrapeMotionValuesFromProps:Dv,createRenderState:Sv,onUpdate:({props:t,prevProps:e,current:n,renderState:s,latestValues:r})=>{if(!n)return;let i=!!t.drag;if(!i){for(const l in r)if(us.has(l)){i=!0;break}}if(!i)return;let a=!e;if(e)for(let l=0;l<Gh.length;l++){const c=Gh[l];t[c]!==e[c]&&(a=!0)}a&&ae.read(()=>{Av(n,s),ae.render(()=>{bu(s,r,wu(n.tagName),t.transformTemplate),Ov(n,s)})})}})};function Sk(t,e){return function(s,{forwardMotionProps:r}={forwardMotionProps:!1}){const a={...xu(s)?kk:Pk,preloadedFeatures:t,useRender:bk(r),createVisualElement:e,Component:s};return JP(a)}}function so(t,e,n){const s=t.getProps();return Eu(s,e,n!==void 0?n:s.custom,t)}const Lv=new Set(["width","height","top","left","right","bottom",...er]);function Rk(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,nn(n))}function Ak(t,e){const n=so(t,e);let{transitionEnd:s={},transition:r={},...i}=n||{};i={...i,...s};for(const a in i){const l=Ek(i[a]);Rk(t,a,l)}}function Ck(t){return!!(Ne(t)&&t.add)}function Jl(t,e){const n=t.getValue("willChange");if(Ck(n))return n.add(e)}function Mv(t){return t.props[bv]}const Nv=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,Ik=1e-7,Ok=12;function Dk(t,e,n,s,r){let i,a,l=0;do a=e+(n-e)/2,i=Nv(a,s,r)-t,i>0?n=a:e=a;while(Math.abs(i)>Ik&&++l<Ok);return a}function xo(t,e,n,s){if(t===e&&n===s)return Et;const r=i=>Dk(i,0,1,t,n);return i=>i===0||i===1?i:Nv(r(i),e,s)}const Vv=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Fv=t=>e=>1-t(1-e),$v=xo(.33,1.53,.69,.99),Tu=Fv($v),Bv=Vv(Tu),zv=t=>(t*=2)<1?.5*Tu(t):.5*(2-Math.pow(2,-10*(t-1))),Pu=t=>1-Math.sin(Math.acos(t)),Uv=Fv(Pu),Hv=Vv(Pu),Wv=t=>/^0[^.\s]+$/u.test(t);function Lk(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Wv(t):!0}const Vr=t=>Math.round(t*1e5)/1e5,ku=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Mk(t){return t==null}const Nk=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Su=(t,e)=>n=>!!(typeof n=="string"&&Nk.test(n)&&n.startsWith(t)||e&&!Mk(n)&&Object.prototype.hasOwnProperty.call(n,e)),Gv=(t,e,n)=>s=>{if(typeof s!="string")return s;const[r,i,a,l]=s.match(ku);return{[t]:parseFloat(r),[e]:parseFloat(i),[n]:parseFloat(a),alpha:l!==void 0?parseFloat(l):1}},Vk=t=>un(0,255,t),Va={...tr,transform:t=>Math.round(Vk(t))},Qn={test:Su("rgb","red"),parse:Gv("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:s=1})=>"rgba("+Va.transform(t)+", "+Va.transform(e)+", "+Va.transform(n)+", "+Vr(no.transform(s))+")"};function Fk(t){let e="",n="",s="",r="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),s=t.substring(5,7),r=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),s=t.substring(3,4),r=t.substring(4,5),e+=e,n+=n,s+=s,r+=r),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(s,16),alpha:r?parseInt(r,16)/255:1}}const Ql={test:Su("#"),parse:Fk,transform:Qn.transform},Rs={test:Su("hsl","hue"),parse:Gv("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:s=1})=>"hsla("+Math.round(t)+", "+an.transform(Vr(e))+", "+an.transform(Vr(n))+", "+Vr(no.transform(s))+")"},gt={test:t=>Qn.test(t)||Ql.test(t)||Rs.test(t),parse:t=>Qn.test(t)?Qn.parse(t):Rs.test(t)?Rs.parse(t):Ql.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Qn.transform(t):Rs.transform(t)},$k=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Bk(t){return isNaN(t)&&typeof t=="string"&&(t.match(ku)?.length||0)+(t.match($k)?.length||0)>0}const Kv="number",qv="color",zk="var",Uk="var(",Kh="${}",Hk=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ro(t){const e=t.toString(),n=[],s={color:[],number:[],var:[]},r=[];let i=0;const l=e.replace(Hk,c=>(gt.test(c)?(s.color.push(i),r.push(qv),n.push(gt.parse(c))):c.startsWith(Uk)?(s.var.push(i),r.push(zk),n.push(c)):(s.number.push(i),r.push(Kv),n.push(parseFloat(c))),++i,Kh)).split(Kh);return{values:n,split:l,indexes:s,types:r}}function Yv(t){return ro(t).values}function Xv(t){const{split:e,types:n}=ro(t),s=e.length;return r=>{let i="";for(let a=0;a<s;a++)if(i+=e[a],r[a]!==void 0){const l=n[a];l===Kv?i+=Vr(r[a]):l===qv?i+=gt.transform(r[a]):i+=r[a]}return i}}const Wk=t=>typeof t=="number"?0:t;function Gk(t){const e=Yv(t);return Xv(t)(e.map(Wk))}const Gn={test:Bk,parse:Yv,createTransformer:Xv,getAnimatableNone:Gk},Kk=new Set(["brightness","contrast","saturate","opacity"]);function qk(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[s]=n.match(ku)||[];if(!s)return t;const r=n.replace(s,"");let i=Kk.has(e)?1:0;return s!==n&&(i*=100),e+"("+i+r+")"}const Yk=/\b([a-z-]*)\(.*?\)/gu,ec={...Gn,getAnimatableNone:t=>{const e=t.match(Yk);return e?e.map(qk).join(" "):t}},Xk={...vu,color:gt,backgroundColor:gt,outlineColor:gt,fill:gt,stroke:gt,borderColor:gt,borderTopColor:gt,borderRightColor:gt,borderBottomColor:gt,borderLeftColor:gt,filter:ec,WebkitFilter:ec},Zv=t=>Xk[t];function Jv(t,e){let n=Zv(t);return n!==ec&&(n=Gn),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const Zk=new Set(["auto","none","0"]);function Jk(t,e,n){let s=0,r;for(;s<t.length&&!r;){const i=t[s];typeof i=="string"&&!Zk.has(i)&&ro(i).values.length&&(r=t[s]),s++}if(r&&n)for(const i of e)t[i]=Jv(n,r)}const es=t=>t*180/Math.PI,tc=t=>{const e=es(Math.atan2(t[1],t[0]));return nc(e)},Qk={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:tc,rotateZ:tc,skewX:t=>es(Math.atan(t[1])),skewY:t=>es(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},nc=t=>(t=t%360,t<0&&(t+=360),t),qh=tc,Yh=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),Xh=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),eS={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Yh,scaleY:Xh,scale:t=>(Yh(t)+Xh(t))/2,rotateX:t=>nc(es(Math.atan2(t[6],t[5]))),rotateY:t=>nc(es(Math.atan2(-t[2],t[0]))),rotateZ:qh,rotate:qh,skewX:t=>es(Math.atan(t[4])),skewY:t=>es(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Zh(t){return t.includes("scale")?1:0}function sc(t,e){if(!t||t==="none")return Zh(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,r;if(n)s=eS,r=n;else{const l=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Qk,r=l}if(!r)return Zh(e);const i=s[e],a=r[1].split(",").map(nS);return typeof i=="function"?i(a):a[i]}const tS=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return sc(n,e)};function nS(t){return parseFloat(t.trim())}const Jh=t=>t===tr||t===X,sS=new Set(["x","y","z"]),rS=er.filter(t=>!sS.has(t));function oS(t){const e=[];return rS.forEach(n=>{const s=t.getValue(n);s!==void 0&&(e.push([n,s.get()]),s.set(n.startsWith("scale")?1:0))}),e}const Ks={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>sc(e,"x"),y:(t,{transform:e})=>sc(e,"y")};Ks.translateX=Ks.x;Ks.translateY=Ks.y;const ns=new Set;let rc=!1,oc=!1;function Qv(){if(oc){const t=Array.from(ns).filter(s=>s.needsMeasurement),e=new Set(t.map(s=>s.element)),n=new Map;e.forEach(s=>{const r=oS(s);r.length&&(n.set(s,r),s.render())}),t.forEach(s=>s.measureInitialState()),e.forEach(s=>{s.render();const r=n.get(s);r&&r.forEach(([i,a])=>{s.getValue(i)?.set(a)})}),t.forEach(s=>s.measureEndState()),t.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}oc=!1,rc=!1,ns.forEach(t=>t.complete()),ns.clear()}function e0(){ns.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(oc=!0)})}function iS(){e0(),Qv()}class Ru{constructor(e,n,s,r,i,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=s,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(ns.add(this),rc||(rc=!0,ae.read(e0),ae.resolveKeyframes(Qv))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:s,motionValue:r}=this;for(let i=0;i<e.length;i++)if(e[i]===null)if(i===0){const a=r?.get(),l=e[e.length-1];if(a!==void 0)e[0]=a;else if(s&&n){const c=s.readValue(n,l);c!=null&&(e[0]=c)}e[0]===void 0&&(e[0]=l),r&&a===void 0&&r.set(e[0])}else e[i]=e[i-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),ns.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,ns.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const t0=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t),aS=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function lS(t){const e=aS.exec(t);if(!e)return[,];const[,n,s,r]=e;return[`--${n??s}`,r]}function n0(t,e,n=1){const[s,r]=lS(t);if(!s)return;const i=window.getComputedStyle(e).getPropertyValue(s);if(i){const a=i.trim();return t0(a)?parseFloat(a):a}return gu(r)?n0(r,e,n+1):r}const s0=t=>e=>e.test(t),cS={test:t=>t==="auto",parse:t=>t},r0=[tr,X,an,Dn,ik,ok,cS],Qh=t=>r0.find(s0(t));class o0 extends Ru{constructor(e,n,s,r,i){super(e,n,s,r,i,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:s}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let u=e[c];if(typeof u=="string"&&(u=u.trim(),gu(u))){const d=n0(u,n.current);d!==void 0&&(e[c]=d),c===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!Lv.has(s)||e.length!==2)return;const[r,i]=e,a=Qh(r),l=Qh(i);if(a!==l)if(Jh(a)&&Jh(l))for(let c=0;c<e.length;c++){const u=e[c];typeof u=="string"&&(e[c]=parseFloat(u))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,s=[];for(let r=0;r<e.length;r++)Lk(e[r])&&s.push(r);s.length&&Jk(e,s,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:s}=this;if(!e||!e.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ks[s](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const r=n[n.length-1];r!==void 0&&e.getValue(s,r).jump(r,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:s}=this;if(!e||!e.current)return;const r=e.getValue(n);r&&r.jump(this.measuredOrigin,!1);const i=s.length-1,a=s[i];s[i]=Ks[n](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const ep=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Gn.test(t)||t==="0")&&!t.startsWith("url("));function uS(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function dS(t,e,n,s){const r=t[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const i=t[t.length-1],a=ep(r,e),l=ep(i,e);return!a||!l?!1:uS(t)||(n==="spring"||iu(n))&&s}const hS=t=>t!==null;function ra(t,{repeat:e,repeatType:n="loop"},s){const r=t.filter(hS),i=e&&n!=="loop"&&e%2===1?0:r.length-1;return!i||s===void 0?r[i]:s}const pS=40;class i0{constructor({autoplay:e=!0,delay:n=0,type:s="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:a="loop",...l}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=on.now(),this.options={autoplay:e,delay:n,type:s,repeat:r,repeatDelay:i,repeatType:a,...l},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>pS?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&iS(),this._resolved}onKeyframesResolved(e,n){this.resolvedAt=on.now(),this.hasAttemptedResolve=!0;const{name:s,type:r,velocity:i,delay:a,onComplete:l,onUpdate:c,isGenerator:u}=this.options;if(!u&&!dS(e,s,r,i))if(a)this.options.duration=0;else{c&&c(ra(e,this.options,n)),l&&l(),this.resolveFinishedPromise();return}const d=this.initPlayback(e,n);d!==!1&&(this._resolved={keyframes:e,finalKeyframe:n,...d},this.onPostResolved())}onPostResolved(){}then(e,n){return this.currentFinishedPromise.then(e,n)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const Ee=(t,e,n)=>t+(e-t)*n;function Fa(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function fS({hue:t,saturation:e,lightness:n,alpha:s}){t/=360,e/=100,n/=100;let r=0,i=0,a=0;if(!e)r=i=a=n;else{const l=n<.5?n*(1+e):n+e-n*e,c=2*n-l;r=Fa(c,l,t+1/3),i=Fa(c,l,t),a=Fa(c,l,t-1/3)}return{red:Math.round(r*255),green:Math.round(i*255),blue:Math.round(a*255),alpha:s}}function Ai(t,e){return n=>n>0?e:t}const $a=(t,e,n)=>{const s=t*t,r=n*(e*e-s)+s;return r<0?0:Math.sqrt(r)},mS=[Ql,Qn,Rs],gS=t=>mS.find(e=>e.test(t));function tp(t){const e=gS(t);if(!e)return!1;let n=e.parse(t);return e===Rs&&(n=fS(n)),n}const np=(t,e)=>{const n=tp(t),s=tp(e);if(!n||!s)return Ai(t,e);const r={...n};return i=>(r.red=$a(n.red,s.red,i),r.green=$a(n.green,s.green,i),r.blue=$a(n.blue,s.blue,i),r.alpha=Ee(n.alpha,s.alpha,i),Qn.transform(r))},vS=(t,e)=>n=>e(t(n)),bo=(...t)=>t.reduce(vS),ic=new Set(["none","hidden"]);function _S(t,e){return ic.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function yS(t,e){return n=>Ee(t,e,n)}function Au(t){return typeof t=="number"?yS:typeof t=="string"?gu(t)?Ai:gt.test(t)?np:wS:Array.isArray(t)?a0:typeof t=="object"?gt.test(t)?np:xS:Ai}function a0(t,e){const n=[...t],s=n.length,r=t.map((i,a)=>Au(i)(i,e[a]));return i=>{for(let a=0;a<s;a++)n[a]=r[a](i);return n}}function xS(t,e){const n={...t,...e},s={};for(const r in n)t[r]!==void 0&&e[r]!==void 0&&(s[r]=Au(t[r])(t[r],e[r]));return r=>{for(const i in s)n[i]=s[i](r);return n}}function bS(t,e){const n=[],s={color:0,var:0,number:0};for(let r=0;r<e.values.length;r++){const i=e.types[r],a=t.indexes[i][s[i]],l=t.values[a]??0;n[r]=l,s[i]++}return n}const wS=(t,e)=>{const n=Gn.createTransformer(e),s=ro(t),r=ro(e);return s.indexes.var.length===r.indexes.var.length&&s.indexes.color.length===r.indexes.color.length&&s.indexes.number.length>=r.indexes.number.length?ic.has(t)&&!r.values.length||ic.has(e)&&!s.values.length?_S(t,e):bo(a0(bS(s,r),r.values),n):Ai(t,e)};function l0(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Ee(t,e,n):Au(t)(t,e)}const ES=5;function c0(t,e,n){const s=Math.max(e-ES,0);return ru(n-t(s),e-s)}const Pe={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Ba=.001;function jS({duration:t=Pe.duration,bounce:e=Pe.bounce,velocity:n=Pe.velocity,mass:s=Pe.mass}){let r,i,a=1-e;a=un(Pe.minDamping,Pe.maxDamping,a),t=un(Pe.minDuration,Pe.maxDuration,rn(t)),a<1?(r=u=>{const d=u*a,h=d*t,p=d-n,m=ac(u,a),y=Math.exp(-h);return Ba-p/m*y},i=u=>{const h=u*a*t,p=h*n+n,m=Math.pow(a,2)*Math.pow(u,2)*t,y=Math.exp(-h),_=ac(Math.pow(u,2),a);return(-r(u)+Ba>0?-1:1)*((p-m)*y)/_}):(r=u=>{const d=Math.exp(-u*t),h=(u-n)*t+1;return-Ba+d*h},i=u=>{const d=Math.exp(-u*t),h=(n-u)*(t*t);return d*h});const l=5/t,c=PS(r,i,l);if(t=sn(t),isNaN(c))return{stiffness:Pe.stiffness,damping:Pe.damping,duration:t};{const u=Math.pow(c,2)*s;return{stiffness:u,damping:a*2*Math.sqrt(s*u),duration:t}}}const TS=12;function PS(t,e,n){let s=n;for(let r=1;r<TS;r++)s=s-t(s)/e(s);return s}function ac(t,e){return t*Math.sqrt(1-e*e)}const kS=["duration","bounce"],SS=["stiffness","damping","mass"];function sp(t,e){return e.some(n=>t[n]!==void 0)}function RS(t){let e={velocity:Pe.velocity,stiffness:Pe.stiffness,damping:Pe.damping,mass:Pe.mass,isResolvedFromDuration:!1,...t};if(!sp(t,SS)&&sp(t,kS))if(t.visualDuration){const n=t.visualDuration,s=2*Math.PI/(n*1.2),r=s*s,i=2*un(.05,1,1-(t.bounce||0))*Math.sqrt(r);e={...e,mass:Pe.mass,stiffness:r,damping:i}}else{const n=jS(t);e={...e,...n,mass:Pe.mass},e.isResolvedFromDuration=!0}return e}function Ci(t=Pe.visualDuration,e=Pe.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:s,restDelta:r}=n;const i=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],l={done:!1,value:i},{stiffness:c,damping:u,mass:d,duration:h,velocity:p,isResolvedFromDuration:m}=RS({...n,velocity:-rn(n.velocity||0)}),y=p||0,_=u/(2*Math.sqrt(c*d)),x=a-i,b=rn(Math.sqrt(c/d)),w=Math.abs(x)<5;s||(s=w?Pe.restSpeed.granular:Pe.restSpeed.default),r||(r=w?Pe.restDelta.granular:Pe.restDelta.default);let E;if(_<1){const j=ac(b,_);E=P=>{const k=Math.exp(-_*b*P);return a-k*((y+_*b*x)/j*Math.sin(j*P)+x*Math.cos(j*P))}}else if(_===1)E=j=>a-Math.exp(-b*j)*(x+(y+b*x)*j);else{const j=b*Math.sqrt(_*_-1);E=P=>{const k=Math.exp(-_*b*P),S=Math.min(j*P,300);return a-k*((y+_*b*x)*Math.sinh(S)+j*x*Math.cosh(S))/j}}const T={calculatedDuration:m&&h||null,next:j=>{const P=E(j);if(m)l.done=j>=h;else{let k=0;_<1&&(k=j===0?sn(y):c0(E,j,P));const S=Math.abs(k)<=s,D=Math.abs(a-P)<=r;l.done=S&&D}return l.value=l.done?a:P,l},toString:()=>{const j=Math.min(lu(T),Si),P=dv(k=>T.next(j*k).value,j,30);return j+"ms "+P},toTransition:()=>{}};return T}Ci.applyToOptions=t=>{const e=SP(t,100,Ci);return t.ease=Qr()?e.ease:"easeOut",t.duration=sn(e.duration),t.type="keyframes",t};function rp({keyframes:t,velocity:e=0,power:n=.8,timeConstant:s=325,bounceDamping:r=10,bounceStiffness:i=500,modifyTarget:a,min:l,max:c,restDelta:u=.5,restSpeed:d}){const h=t[0],p={done:!1,value:h},m=S=>l!==void 0&&S<l||c!==void 0&&S>c,y=S=>l===void 0?c:c===void 0||Math.abs(l-S)<Math.abs(c-S)?l:c;let _=n*e;const x=h+_,b=a===void 0?x:a(x);b!==x&&(_=b-h);const w=S=>-_*Math.exp(-S/s),E=S=>b+w(S),T=S=>{const D=w(S),A=E(S);p.done=Math.abs(D)<=u,p.value=p.done?b:A};let j,P;const k=S=>{m(p.value)&&(j=S,P=Ci({keyframes:[p.value,y(p.value)],velocity:c0(E,S,p.value),damping:r,stiffness:i,restDelta:u,restSpeed:d}))};return k(0),{calculatedDuration:null,next:S=>{let D=!1;return!P&&j===void 0&&(D=!0,T(S),k(S)),j!==void 0&&S>=j?P.next(S-j):(!D&&T(S),p)}}}const AS=xo(.42,0,1,1),CS=xo(0,0,.58,1),u0=xo(.42,0,.58,1),IS=t=>Array.isArray(t)&&typeof t[0]!="number",op={linear:Et,easeIn:AS,easeInOut:u0,easeOut:CS,circIn:Pu,circInOut:Hv,circOut:Uv,backIn:Tu,backInOut:Bv,backOut:$v,anticipate:zv},ip=t=>{if(ou(t)){Yl(t.length===4);const[e,n,s,r]=t;return xo(e,n,s,r)}else if(typeof t=="string")return Yl(op[t]!==void 0),op[t];return t};function OS(t,e,n){const s=[],r=n||l0,i=t.length-1;for(let a=0;a<i;a++){let l=r(t[a],t[a+1]);if(e){const c=Array.isArray(e)?e[a]||Et:e;l=bo(c,l)}s.push(l)}return s}function Cu(t,e,{clamp:n=!0,ease:s,mixer:r}={}){const i=t.length;if(Yl(i===e.length),i===1)return()=>e[0];if(i===2&&e[0]===e[1])return()=>e[1];const a=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const l=OS(e,s,r),c=l.length,u=d=>{if(a&&d<t[0])return e[0];let h=0;if(c>1)for(;h<t.length-2&&!(d<t[h+1]);h++);const p=Ws(t[h],t[h+1],d);return l[h](p)};return n?d=>u(un(t[0],t[i-1],d)):u}function DS(t,e){const n=t[t.length-1];for(let s=1;s<=e;s++){const r=Ws(0,e,s);t.push(Ee(n,1,r))}}function d0(t){const e=[0];return DS(e,t.length-1),e}function LS(t,e){return t.map(n=>n*e)}function MS(t,e){return t.map(()=>e||u0).splice(0,t.length-1)}function Ii({duration:t=300,keyframes:e,times:n,ease:s="easeInOut"}){const r=IS(s)?s.map(ip):ip(s),i={done:!1,value:e[0]},a=LS(n&&n.length===e.length?n:d0(e),t),l=Cu(a,e,{ease:Array.isArray(r)?r:MS(e,r)});return{calculatedDuration:t,next:c=>(i.value=l(c),i.done=c>=t,i)}}const NS=t=>{const e=({timestamp:n})=>t(n);return{start:()=>ae.update(e,!0),stop:()=>zt(e),now:()=>Me.isProcessing?Me.timestamp:on.now()}},VS={decay:rp,inertia:rp,tween:Ii,keyframes:Ii,spring:Ci},FS=t=>t/100;class oa extends i0{constructor(e){super(e),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:c}=this.options;c&&c()};const{name:n,motionValue:s,element:r,keyframes:i}=this.options,a=r?.KeyframeResolver||Ru,l=(c,u)=>this.onKeyframesResolved(c,u);this.resolver=new a(i,l,n,s,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:n="keyframes",repeat:s=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=this.options,l=iu(n)?n:VS[n]||Ii;let c,u;l!==Ii&&typeof e[0]!="number"&&(c=bo(FS,l0(e[0],e[1])),e=[0,100]);const d=l({...this.options,keyframes:e});i==="mirror"&&(u=l({...this.options,keyframes:[...e].reverse(),velocity:-a})),d.calculatedDuration===null&&(d.calculatedDuration=lu(d));const{calculatedDuration:h}=d,p=h+r,m=p*(s+1)-r;return{generator:d,mirroredGenerator:u,mapPercentToKeyframes:c,calculatedDuration:h,resolvedDuration:p,totalDuration:m}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,n=!1){const{resolved:s}=this;if(!s){const{keyframes:S}=this.options;return{done:!0,value:S[S.length-1]}}const{finalKeyframe:r,generator:i,mirroredGenerator:a,mapPercentToKeyframes:l,keyframes:c,calculatedDuration:u,totalDuration:d,resolvedDuration:h}=s;if(this.startTime===null)return i.next(0);const{delay:p,repeat:m,repeatType:y,repeatDelay:_,onUpdate:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-d/this.speed,this.startTime)),n?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const b=this.currentTime-p*(this.speed>=0?1:-1),w=this.speed>=0?b<0:b>d;this.currentTime=Math.max(b,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=d);let E=this.currentTime,T=i;if(m){const S=Math.min(this.currentTime,d)/h;let D=Math.floor(S),A=S%1;!A&&S>=1&&(A=1),A===1&&D--,D=Math.min(D,m+1),!!(D%2)&&(y==="reverse"?(A=1-A,_&&(A-=_/h)):y==="mirror"&&(T=a)),E=un(0,1,A)*h}const j=w?{done:!1,value:c[0]}:T.next(E);l&&(j.value=l(j.value));let{done:P}=j;!w&&u!==null&&(P=this.speed>=0?this.currentTime>=d:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&P);return k&&r!==void 0&&(j.value=ra(c,this.options,r)),x&&x(j.value),k&&this.finish(),j}get duration(){const{resolved:e}=this;return e?rn(e.calculatedDuration):0}get time(){return rn(this.currentTime)}set time(e){e=sn(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=rn(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=NS,onPlay:n,startTime:s}=this.options;this.driver||(this.driver=e(i=>this.tick(i))),n&&n();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=this.currentTime??0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}get finished(){return this.currentFinishedPromise}}function $S(t){return new oa(t)}const BS=new Set(["opacity","clipPath","filter","transform"]),zS=nu(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Oi=10,US=2e4;function HS(t){return iu(t.type)||t.type==="spring"||!pv(t.ease)}function WS(t,e){const n=new oa({...e,keyframes:t,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:t[0]};const r=[];let i=0;for(;!s.done&&i<US;)s=n.sample(i),r.push(s.value),i+=Oi;return{times:void 0,keyframes:r,duration:i-Oi,ease:"linear"}}const h0={anticipate:zv,backInOut:Bv,circInOut:Hv};function GS(t){return t in h0}class ap extends i0{constructor(e){super(e);const{name:n,motionValue:s,element:r,keyframes:i}=this.options;this.resolver=new o0(i,(a,l)=>this.onKeyframesResolved(a,l),n,s,r),this.resolver.scheduleResolve()}initPlayback(e,n){let{duration:s=300,times:r,ease:i,type:a,motionValue:l,name:c,startTime:u}=this.options;if(!l.owner||!l.owner.current)return!1;if(typeof i=="string"&&Qr()&&GS(i)&&(i=h0[i]),HS(this.options)){const{onComplete:h,onUpdate:p,motionValue:m,element:y,..._}=this.options,x=WS(e,_);e=x.keyframes,e.length===1&&(e[1]=e[0]),s=x.duration,r=x.times,i=x.ease,a="keyframes"}const d=kP(l.owner.current,c,e,{...this.options,duration:s,times:r,ease:i});return d.startTime=u??this.calcStartTime(),this.pendingTimeline?(Lh(d,this.pendingTimeline),this.pendingTimeline=void 0):d.onfinish=()=>{const{onComplete:h}=this.options;l.set(ra(e,this.options,n)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:d,duration:s,times:r,type:a,ease:i,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:n}=e;return rn(n)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:n}=e;return rn(n.currentTime||0)}set time(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.currentTime=sn(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:n}=e;return n.playbackRate}get finished(){return this.resolved.animation.finished}set speed(e){const{resolved:n}=this;if(!n)return;const{animation:s}=n;s.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:n}=e;return n.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:n}=e;return n.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:n}=this;if(!n)return Et;const{animation:s}=n;Lh(s,e)}return Et}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:n}=e;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:n,keyframes:s,duration:r,type:i,ease:a,times:l}=e;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:u,onUpdate:d,onComplete:h,element:p,...m}=this.options,y=new oa({...m,keyframes:s,duration:r,type:i,ease:a,times:l,isGenerator:!0}),_=sn(this.time);u.setWithVelocity(y.sample(_-Oi).value,y.sample(_).value,Oi)}const{onStop:c}=this.options;c&&c(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:n,name:s,repeatDelay:r,repeatType:i,damping:a,type:l}=e;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=n.owner.getProps();return zS()&&s&&BS.has(s)&&(s!=="transform"||!u)&&!c&&!r&&i!=="mirror"&&a!==0&&l!=="inertia"}}const KS={type:"spring",stiffness:500,damping:25,restSpeed:10},qS=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),YS={type:"keyframes",duration:.8},XS={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},ZS=(t,{keyframes:e})=>e.length>2?YS:us.has(t)?t.startsWith("scale")?qS(e[1]):KS:XS;function JS({when:t,delay:e,delayChildren:n,staggerChildren:s,staggerDirection:r,repeat:i,repeatType:a,repeatDelay:l,from:c,elapsed:u,...d}){return!!Object.keys(d).length}const Iu=(t,e,n,s={},r,i)=>a=>{const l=au(s,t)||{},c=l.delay||s.delay||0;let{elapsed:u=0}=s;u=u-sn(c);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-u,onUpdate:p=>{e.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{a(),l.onComplete&&l.onComplete()},name:t,motionValue:e,element:i?void 0:r};JS(l)||(d={...d,...ZS(t,d)}),d.duration&&(d.duration=sn(d.duration)),d.repeatDelay&&(d.repeatDelay=sn(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(d.duration=0,d.delay===0&&(h=!0)),d.allowFlatten=!l.type&&!l.ease,h&&!i&&e.get()!==void 0){const p=ra(d.keyframes,l);if(p!==void 0)return ae.update(()=>{d.onUpdate(p),d.onComplete()}),new jP([])}return!i&&ap.supports(d)?new ap(d):new oa(d)};function QS({protectedKeys:t,needsAnimating:e},n){const s=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,s}function p0(t,e,{delay:n=0,transitionOverride:s,type:r}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:a,...l}=e;s&&(i=s);const c=[],u=r&&t.animationState&&t.animationState.getState()[r];for(const d in l){const h=t.getValue(d,t.latestValues[d]??null),p=l[d];if(p===void 0||u&&QS(u,d))continue;const m={delay:n,...au(i||{},d)};let y=!1;if(window.MotionHandoffAnimation){const x=Mv(t);if(x){const b=window.MotionHandoffAnimation(x,d,ae);b!==null&&(m.startTime=b,y=!0)}}Jl(t,d),h.start(Iu(d,h,p,t.shouldReduceMotion&&Lv.has(d)?{type:!1}:m,t,y));const _=h.animation;_&&c.push(_)}return a&&Promise.all(c).then(()=>{ae.update(()=>{a&&Ak(t,a)})}),c}function lc(t,e,n={}){const s=so(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:r=t.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(r=n.transitionOverride);const i=s?()=>Promise.all(p0(t,s,n)):()=>Promise.resolve(),a=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:d,staggerDirection:h}=r;return eR(t,e,u+c,d,h,n)}:()=>Promise.resolve(),{when:l}=r;if(l){const[c,u]=l==="beforeChildren"?[i,a]:[a,i];return c().then(()=>u())}else return Promise.all([i(),a(n.delay)])}function eR(t,e,n=0,s=0,r=1,i){const a=[],l=(t.variantChildren.size-1)*s,c=r===1?(u=0)=>u*s:(u=0)=>l-u*s;return Array.from(t.variantChildren).sort(tR).forEach((u,d)=>{u.notify("AnimationStart",e),a.push(lc(u,e,{...i,delay:n+c(d)}).then(()=>u.notify("AnimationComplete",e)))}),Promise.all(a)}function tR(t,e){return t.sortNodePosition(e)}function nR(t,e,n={}){t.notify("AnimationStart",e);let s;if(Array.isArray(e)){const r=e.map(i=>lc(t,i,n));s=Promise.all(r)}else if(typeof e=="string")s=lc(t,e,n);else{const r=typeof e=="function"?so(t,e,n.custom):e;s=Promise.all(p0(t,r,n))}return s.then(()=>{t.notify("AnimationComplete",e)})}function f0(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let s=0;s<n;s++)if(e[s]!==t[s])return!1;return!0}const sR=pu.length;function m0(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?m0(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<sR;n++){const s=pu[n],r=t.props[s];(eo(r)||r===!1)&&(e[s]=r)}return e}const rR=[...hu].reverse(),oR=hu.length;function iR(t){return e=>Promise.all(e.map(({animation:n,options:s})=>nR(t,n,s)))}function aR(t){let e=iR(t),n=lp(),s=!0;const r=c=>(u,d)=>{const h=so(t,d,c==="exit"?t.presenceContext?.custom:void 0);if(h){const{transition:p,transitionEnd:m,...y}=h;u={...u,...y,...m}}return u};function i(c){e=c(t)}function a(c){const{props:u}=t,d=m0(t.parent)||{},h=[],p=new Set;let m={},y=1/0;for(let x=0;x<oR;x++){const b=rR[x],w=n[b],E=u[b]!==void 0?u[b]:d[b],T=eo(E),j=b===c?w.isActive:null;j===!1&&(y=x);let P=E===d[b]&&E!==u[b]&&T;if(P&&s&&t.manuallyAnimateOnMount&&(P=!1),w.protectedKeys={...m},!w.isActive&&j===null||!E&&!w.prevProp||na(E)||typeof E=="boolean")continue;const k=lR(w.prevProp,E);let S=k||b===c&&w.isActive&&!P&&T||x>y&&T,D=!1;const A=Array.isArray(E)?E:[E];let B=A.reduce(r(b),{});j===!1&&(B={});const{prevResolvedValues:M={}}=w,K={...M,...B},O=U=>{S=!0,p.has(U)&&(D=!0,p.delete(U)),w.needsAnimating[U]=!0;const C=t.getValue(U);C&&(C.liveStyle=!1)};for(const U in K){const C=B[U],I=M[U];if(m.hasOwnProperty(U))continue;let ee=!1;Zl(C)&&Zl(I)?ee=!f0(C,I):ee=C!==I,ee?C!=null?O(U):p.add(U):C!==void 0&&p.has(U)?O(U):w.protectedKeys[U]=!0}w.prevProp=E,w.prevResolvedValues=B,w.isActive&&(m={...m,...B}),s&&t.blockInitialAnimation&&(S=!1),S&&(!(P&&k)||D)&&h.push(...A.map(U=>({animation:U,options:{type:b}})))}if(p.size){const x={};if(typeof u.initial!="boolean"){const b=so(t,Array.isArray(u.initial)?u.initial[0]:u.initial);b&&b.transition&&(x.transition=b.transition)}p.forEach(b=>{const w=t.getBaseTarget(b),E=t.getValue(b);E&&(E.liveStyle=!0),x[b]=w??null}),h.push({animation:x})}let _=!!h.length;return s&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(_=!1),s=!1,_?e(h):Promise.resolve()}function l(c,u){if(n[c].isActive===u)return Promise.resolve();t.variantChildren?.forEach(h=>h.animationState?.setActive(c,u)),n[c].isActive=u;const d=a(c);for(const h in n)n[h].protectedKeys={};return d}return{animateChanges:a,setActive:l,setAnimateFunction:i,getState:()=>n,reset:()=>{n=lp(),s=!0}}}function lR(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!f0(e,t):!1}function Xn(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function lp(){return{animate:Xn(!0),whileInView:Xn(),whileHover:Xn(),whileTap:Xn(),whileDrag:Xn(),whileFocus:Xn(),exit:Xn()}}class Kn{constructor(e){this.isMounted=!1,this.node=e}update(){}}class cR extends Kn{constructor(e){super(e),e.animationState||(e.animationState=aR(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();na(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let uR=0;class dR extends Kn{constructor(){super(...arguments),this.id=uR++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:s}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===s)return;const r=this.node.animationState.setActive("exit",!e);n&&!e&&r.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const hR={animation:{Feature:cR},exit:{Feature:dR}};function oo(t,e,n,s={passive:!0}){return t.addEventListener(e,n,s),()=>t.removeEventListener(e,n)}function wo(t){return{point:{x:t.pageX,y:t.pageY}}}const pR=t=>e=>du(e)&&t(e,wo(e));function Fr(t,e,n,s){return oo(t,e,pR(n),s)}function g0({top:t,left:e,right:n,bottom:s}){return{x:{min:e,max:n},y:{min:t,max:s}}}function fR({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function mR(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),s=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:s.y,right:s.x}}const v0=1e-4,gR=1-v0,vR=1+v0,_0=.01,_R=0-_0,yR=0+_0;function yt(t){return t.max-t.min}function xR(t,e,n){return Math.abs(t-e)<=n}function cp(t,e,n,s=.5){t.origin=s,t.originPoint=Ee(e.min,e.max,t.origin),t.scale=yt(n)/yt(e),t.translate=Ee(n.min,n.max,t.origin)-t.originPoint,(t.scale>=gR&&t.scale<=vR||isNaN(t.scale))&&(t.scale=1),(t.translate>=_R&&t.translate<=yR||isNaN(t.translate))&&(t.translate=0)}function $r(t,e,n,s){cp(t.x,e.x,n.x,s?s.originX:void 0),cp(t.y,e.y,n.y,s?s.originY:void 0)}function up(t,e,n){t.min=n.min+e.min,t.max=t.min+yt(e)}function bR(t,e,n){up(t.x,e.x,n.x),up(t.y,e.y,n.y)}function dp(t,e,n){t.min=e.min-n.min,t.max=t.min+yt(e)}function Br(t,e,n){dp(t.x,e.x,n.x),dp(t.y,e.y,n.y)}const hp=()=>({translate:0,scale:1,origin:0,originPoint:0}),As=()=>({x:hp(),y:hp()}),pp=()=>({min:0,max:0}),Se=()=>({x:pp(),y:pp()});function Ot(t){return[t("x"),t("y")]}function za(t){return t===void 0||t===1}function cc({scale:t,scaleX:e,scaleY:n}){return!za(t)||!za(e)||!za(n)}function Jn(t){return cc(t)||y0(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function y0(t){return fp(t.x)||fp(t.y)}function fp(t){return t&&t!=="0%"}function Di(t,e,n){const s=t-n,r=e*s;return n+r}function mp(t,e,n,s,r){return r!==void 0&&(t=Di(t,r,s)),Di(t,n,s)+e}function uc(t,e=0,n=1,s,r){t.min=mp(t.min,e,n,s,r),t.max=mp(t.max,e,n,s,r)}function x0(t,{x:e,y:n}){uc(t.x,e.translate,e.scale,e.originPoint),uc(t.y,n.translate,n.scale,n.originPoint)}const gp=.999999999999,vp=1.0000000000001;function wR(t,e,n,s=!1){const r=n.length;if(!r)return;e.x=e.y=1;let i,a;for(let l=0;l<r;l++){i=n[l],a=i.projectionDelta;const{visualElement:c}=i.options;c&&c.props.style&&c.props.style.display==="contents"||(s&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Is(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),a&&(e.x*=a.x.scale,e.y*=a.y.scale,x0(t,a)),s&&Jn(i.latestValues)&&Is(t,i.latestValues))}e.x<vp&&e.x>gp&&(e.x=1),e.y<vp&&e.y>gp&&(e.y=1)}function Cs(t,e){t.min=t.min+e,t.max=t.max+e}function _p(t,e,n,s,r=.5){const i=Ee(t.min,t.max,r);uc(t,e,n,i,s)}function Is(t,e){_p(t.x,e.x,e.scaleX,e.scale,e.originX),_p(t.y,e.y,e.scaleY,e.scale,e.originY)}function b0(t,e){return g0(mR(t.getBoundingClientRect(),e))}function ER(t,e,n){const s=b0(t,n),{scroll:r}=e;return r&&(Cs(s.x,r.offset.x),Cs(s.y,r.offset.y)),s}const w0=({current:t})=>t?t.ownerDocument.defaultView:null,yp=(t,e)=>Math.abs(t-e);function jR(t,e){const n=yp(t.x,e.x),s=yp(t.y,e.y);return Math.sqrt(n**2+s**2)}class E0{constructor(e,n,{transformPagePoint:s,contextWindow:r,dragSnapToOrigin:i=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const h=Ha(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,m=jR(h.offset,{x:0,y:0})>=3;if(!p&&!m)return;const{point:y}=h,{timestamp:_}=Me;this.history.push({...y,timestamp:_});const{onStart:x,onMove:b}=this.handlers;p||(x&&x(this.lastMoveEvent,h),this.startEvent=this.lastMoveEvent),b&&b(this.lastMoveEvent,h)},this.handlePointerMove=(h,p)=>{this.lastMoveEvent=h,this.lastMoveEventInfo=Ua(p,this.transformPagePoint),ae.update(this.updatePoint,!0)},this.handlePointerUp=(h,p)=>{this.end();const{onEnd:m,onSessionEnd:y,resumeAnimation:_}=this.handlers;if(this.dragSnapToOrigin&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const x=Ha(h.type==="pointercancel"?this.lastMoveEventInfo:Ua(p,this.transformPagePoint),this.history);this.startEvent&&m&&m(h,x),y&&y(h,x)},!du(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=s,this.contextWindow=r||window;const a=wo(e),l=Ua(a,this.transformPagePoint),{point:c}=l,{timestamp:u}=Me;this.history=[{...c,timestamp:u}];const{onSessionStart:d}=n;d&&d(e,Ha(l,this.history)),this.removeListeners=bo(Fr(this.contextWindow,"pointermove",this.handlePointerMove),Fr(this.contextWindow,"pointerup",this.handlePointerUp),Fr(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),zt(this.updatePoint)}}function Ua(t,e){return e?{point:e(t.point)}:t}function xp(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Ha({point:t},e){return{point:t,delta:xp(t,j0(e)),offset:xp(t,TR(e)),velocity:PR(e,.1)}}function TR(t){return t[0]}function j0(t){return t[t.length-1]}function PR(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,s=null;const r=j0(t);for(;n>=0&&(s=t[n],!(r.timestamp-s.timestamp>sn(e)));)n--;if(!s)return{x:0,y:0};const i=rn(r.timestamp-s.timestamp);if(i===0)return{x:0,y:0};const a={x:(r.x-s.x)/i,y:(r.y-s.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function kR(t,{min:e,max:n},s){return e!==void 0&&t<e?t=s?Ee(e,t,s.min):Math.max(t,e):n!==void 0&&t>n&&(t=s?Ee(n,t,s.max):Math.min(t,n)),t}function bp(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function SR(t,{top:e,left:n,bottom:s,right:r}){return{x:bp(t.x,n,r),y:bp(t.y,e,s)}}function wp(t,e){let n=e.min-t.min,s=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,s]=[s,n]),{min:n,max:s}}function RR(t,e){return{x:wp(t.x,e.x),y:wp(t.y,e.y)}}function AR(t,e){let n=.5;const s=yt(t),r=yt(e);return r>s?n=Ws(e.min,e.max-s,t.min):s>r&&(n=Ws(t.min,t.max-r,e.min)),un(0,1,n)}function CR(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const dc=.35;function IR(t=dc){return t===!1?t=0:t===!0&&(t=dc),{x:Ep(t,"left","right"),y:Ep(t,"top","bottom")}}function Ep(t,e,n){return{min:jp(t,e),max:jp(t,n)}}function jp(t,e){return typeof t=="number"?t:t[e]||0}const OR=new WeakMap;class DR{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Se(),this.visualElement=e}start(e,{snapToCursor:n=!1}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const r=d=>{const{dragSnapToOrigin:h}=this.getProps();h?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(wo(d).point)},i=(d,h)=>{const{drag:p,dragPropagation:m,onDragStart:y}=this.getProps();if(p&&!m&&(this.openDragLock&&this.openDragLock(),this.openDragLock=IP(p),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ot(x=>{let b=this.getAxisMotionValue(x).get()||0;if(an.test(b)){const{projection:w}=this.visualElement;if(w&&w.layout){const E=w.layout.layoutBox[x];E&&(b=yt(E)*(parseFloat(b)/100))}}this.originPoint[x]=b}),y&&ae.postRender(()=>y(d,h)),Jl(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},a=(d,h)=>{const{dragPropagation:p,dragDirectionLock:m,onDirectionLock:y,onDrag:_}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:x}=h;if(m&&this.currentDirection===null){this.currentDirection=LR(x),this.currentDirection!==null&&y&&y(this.currentDirection);return}this.updateAxis("x",h.point,x),this.updateAxis("y",h.point,x),this.visualElement.render(),_&&_(d,h)},l=(d,h)=>this.stop(d,h),c=()=>Ot(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:u}=this.getProps();this.panSession=new E0(e,{onSessionStart:r,onStart:i,onMove:a,onSessionEnd:l,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:u,contextWindow:w0(this.visualElement)})}stop(e,n){const s=this.isDragging;if(this.cancel(),!s)return;const{velocity:r}=n;this.startAnimation(r);const{onDragEnd:i}=this.getProps();i&&ae.postRender(()=>i(e,n))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:s}=this.getProps();!s&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,s){const{drag:r}=this.getProps();if(!s||!Bo(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let a=this.originPoint[e]+s[e];this.constraints&&this.constraints[e]&&(a=kR(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&Ss(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&s?this.constraints=SR(s.layoutBox,e):this.constraints=!1,this.elastic=IR(n),r!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Ot(i=>{this.constraints!==!1&&this.getAxisMotionValue(i)&&(this.constraints[i]=CR(s.layoutBox[i],this.constraints[i]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!Ss(e))return!1;const s=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=ER(s,r.root,this.visualElement.getTransformPagePoint());let a=RR(r.layout.layoutBox,i);if(n){const l=n(fR(a));this.hasMutatedConstraints=!!l,l&&(a=g0(l))}return a}startAnimation(e){const{drag:n,dragMomentum:s,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},u=Ot(d=>{if(!Bo(d,n,this.currentDirection))return;let h=c&&c[d]||{};a&&(h={min:0,max:0});const p=r?200:1e6,m=r?40:1e7,y={type:"inertia",velocity:s?e[d]:0,bounceStiffness:p,bounceDamping:m,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(d,y)});return Promise.all(u).then(l)}startAxisValueAnimation(e,n){const s=this.getAxisMotionValue(e);return Jl(this.visualElement,e),s.start(Iu(e,s,0,n,this.visualElement,!1))}stopAnimation(){Ot(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Ot(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps(),r=s[n];return r||this.visualElement.getValue(e,(s.initial?s.initial[e]:void 0)||0)}snapToCursor(e){Ot(n=>{const{drag:s}=this.getProps();if(!Bo(n,s,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(n);if(r&&r.layout){const{min:a,max:l}=r.layout.layoutBox[n];i.set(e[n]-Ee(a,l,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:s}=this.visualElement;if(!Ss(n)||!s||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Ot(a=>{const l=this.getAxisMotionValue(a);if(l&&this.constraints!==!1){const c=l.get();r[a]=AR({min:c,max:c},this.constraints[a])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",s.root&&s.root.updateScroll(),s.updateLayout(),this.resolveConstraints(),Ot(a=>{if(!Bo(a,e,null))return;const l=this.getAxisMotionValue(a),{min:c,max:u}=this.constraints[a];l.set(Ee(c,u,r[a]))})}addListeners(){if(!this.visualElement.current)return;OR.set(this.visualElement,this);const e=this.visualElement.current,n=Fr(e,"pointerdown",c=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(c)}),s=()=>{const{dragConstraints:c}=this.getProps();Ss(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,i=r.addEventListener("measure",s);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ae.read(s);const a=oo(window,"resize",()=>this.scalePositionWithinConstraints()),l=r.addEventListener("didUpdate",({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(Ot(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=c[d].translate,h.set(h.get()+c[d].translate))}),this.visualElement.render())});return()=>{a(),n(),i(),l&&l()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:s=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=dc,dragMomentum:l=!0}=e;return{...e,drag:n,dragDirectionLock:s,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:l}}}function Bo(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function LR(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class MR extends Kn{constructor(e){super(e),this.removeGroupControls=Et,this.removeListeners=Et,this.controls=new DR(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Et}unmount(){this.removeGroupControls(),this.removeListeners()}}const Tp=t=>(e,n)=>{t&&ae.postRender(()=>t(e,n))};class NR extends Kn{constructor(){super(...arguments),this.removePointerDownListener=Et}onPointerDown(e){this.session=new E0(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:w0(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:s,onPanEnd:r}=this.node.getProps();return{onSessionStart:Tp(e),onStart:Tp(n),onMove:s,onEnd:(i,a)=>{delete this.session,r&&ae.postRender(()=>r(i,a))}}}mount(){this.removePointerDownListener=Fr(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ni={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Pp(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const _r={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(X.test(t))t=parseFloat(t);else return t;const n=Pp(t,e.target.x),s=Pp(t,e.target.y);return`${n}% ${s}%`}},VR={correct:(t,{treeScale:e,projectionDelta:n})=>{const s=t,r=Gn.parse(t);if(r.length>5)return s;const i=Gn.createTransformer(t),a=typeof r[0]!="number"?1:0,l=n.x.scale*e.x,c=n.y.scale*e.y;r[0+a]/=l,r[1+a]/=c;const u=Ee(l,c,.5);return typeof r[2+a]=="number"&&(r[2+a]/=u),typeof r[3+a]=="number"&&(r[3+a]/=u),i(r)}};class FR extends f.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s,layoutId:r}=this.props,{projection:i}=e;rk($R),i&&(n.group&&n.group.add(i),s&&s.register&&r&&s.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),ni.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:s,drag:r,isPresent:i}=this.props,a=s.projection;return a&&(a.isPresent=i,r||e.layoutDependency!==n||n===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||ae.postRender(()=>{const l=a.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),cu.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:s}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(r),s&&s.deregister&&s.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function T0(t){const[e,n]=cv(),s=f.useContext(Jc);return o.jsx(FR,{...t,layoutGroup:s,switchLayoutGroup:f.useContext(wv),isPresent:e,safeToRemove:n})}const $R={borderRadius:{..._r,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:_r,borderTopRightRadius:_r,borderBottomLeftRadius:_r,borderBottomRightRadius:_r,boxShadow:VR};function BR(t,e,n){const s=Ne(t)?t:nn(t);return s.start(Iu("",s,e,n)),s.animation}function zR(t){return t instanceof SVGElement&&t.tagName!=="svg"}const UR=(t,e)=>t.depth-e.depth;class HR{constructor(){this.children=[],this.isDirty=!1}add(e){eu(this.children,e),this.isDirty=!0}remove(e){tu(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(UR),this.isDirty=!1,this.children.forEach(e)}}function WR(t,e){const n=on.now(),s=({timestamp:r})=>{const i=r-n;i>=e&&(zt(s),t(i-e))};return ae.read(s,!0),()=>zt(s)}const P0=["TopLeft","TopRight","BottomLeft","BottomRight"],GR=P0.length,kp=t=>typeof t=="string"?parseFloat(t):t,Sp=t=>typeof t=="number"||X.test(t);function KR(t,e,n,s,r,i){r?(t.opacity=Ee(0,n.opacity!==void 0?n.opacity:1,qR(s)),t.opacityExit=Ee(e.opacity!==void 0?e.opacity:1,0,YR(s))):i&&(t.opacity=Ee(e.opacity!==void 0?e.opacity:1,n.opacity!==void 0?n.opacity:1,s));for(let a=0;a<GR;a++){const l=`border${P0[a]}Radius`;let c=Rp(e,l),u=Rp(n,l);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||Sp(c)===Sp(u)?(t[l]=Math.max(Ee(kp(c),kp(u),s),0),(an.test(u)||an.test(c))&&(t[l]+="%")):t[l]=u}(e.rotate||n.rotate)&&(t.rotate=Ee(e.rotate||0,n.rotate||0,s))}function Rp(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const qR=k0(0,.5,Uv),YR=k0(.5,.95,Et);function k0(t,e,n){return s=>s<t?0:s>e?1:n(Ws(t,e,s))}function Ap(t,e){t.min=e.min,t.max=e.max}function It(t,e){Ap(t.x,e.x),Ap(t.y,e.y)}function Cp(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function Ip(t,e,n,s,r){return t-=e,t=Di(t,1/n,s),r!==void 0&&(t=Di(t,1/r,s)),t}function XR(t,e=0,n=1,s=.5,r,i=t,a=t){if(an.test(e)&&(e=parseFloat(e),e=Ee(a.min,a.max,e/100)-a.min),typeof e!="number")return;let l=Ee(i.min,i.max,s);t===i&&(l-=e),t.min=Ip(t.min,e,n,l,r),t.max=Ip(t.max,e,n,l,r)}function Op(t,e,[n,s,r],i,a){XR(t,e[n],e[s],e[r],e.scale,i,a)}const ZR=["x","scaleX","originX"],JR=["y","scaleY","originY"];function Dp(t,e,n,s){Op(t.x,e,ZR,n?n.x:void 0,s?s.x:void 0),Op(t.y,e,JR,n?n.y:void 0,s?s.y:void 0)}function Lp(t){return t.translate===0&&t.scale===1}function S0(t){return Lp(t.x)&&Lp(t.y)}function Mp(t,e){return t.min===e.min&&t.max===e.max}function QR(t,e){return Mp(t.x,e.x)&&Mp(t.y,e.y)}function Np(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function R0(t,e){return Np(t.x,e.x)&&Np(t.y,e.y)}function Vp(t){return yt(t.x)/yt(t.y)}function Fp(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class eA{constructor(){this.members=[]}add(e){eu(this.members,e),e.scheduleRender()}remove(e){if(tu(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(r=>e===r);if(n===0)return!1;let s;for(let r=n;r>=0;r--){const i=this.members[r];if(i.isPresent!==!1){s=i;break}}return s?(this.promote(s),!0):!1}promote(e,n){const s=this.lead;if(e!==s&&(this.prevLead=s,this.lead=e,e.show(),s)){s.instance&&s.scheduleRender(),e.scheduleRender(),e.resumeFrom=s,n&&(e.resumeFrom.preserveOpacity=!0),s.snapshot&&(e.snapshot=s.snapshot,e.snapshot.latestValues=s.animationValues||s.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&s.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:s}=e;n.onExitComplete&&n.onExitComplete(),s&&s.options.onExitComplete&&s.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function tA(t,e,n){let s="";const r=t.x.translate/e.x,i=t.y.translate/e.y,a=n?.z||0;if((r||i||a)&&(s=`translate3d(${r}px, ${i}px, ${a}px) `),(e.x!==1||e.y!==1)&&(s+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:p,skewX:m,skewY:y}=n;u&&(s=`perspective(${u}px) ${s}`),d&&(s+=`rotate(${d}deg) `),h&&(s+=`rotateX(${h}deg) `),p&&(s+=`rotateY(${p}deg) `),m&&(s+=`skewX(${m}deg) `),y&&(s+=`skewY(${y}deg) `)}const l=t.x.scale*e.x,c=t.y.scale*e.y;return(l!==1||c!==1)&&(s+=`scale(${l}, ${c})`),s||"none"}const Wa=["","X","Y","Z"],nA={visibility:"hidden"},$p=1e3;let sA=0;function Ga(t,e,n,s){const{latestValues:r}=e;r[t]&&(n[t]=r[t],e.setStaticValue(t,0),s&&(s[t]=0))}function A0(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=Mv(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:r,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ae,!(r||i))}const{parent:s}=t;s&&!s.hasCheckedOptimisedAppear&&A0(s)}function C0({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:s,resetTransform:r}){return class{constructor(a={},l=e?.()){this.id=sA++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(iA),this.nodes.forEach(dA),this.nodes.forEach(hA),this.nodes.forEach(aA)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new HR)}addEventListener(a,l){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new su),this.eventHandlers.get(a).add(l)}notifyListeners(a,...l){const c=this.eventHandlers.get(a);c&&c.notify(...l)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,l=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=zR(a),this.instance=a;const{layoutId:c,layout:u,visualElement:d}=this.options;if(d&&!d.current&&d.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),l&&(u||c)&&(this.isLayoutDirty=!0),t){let h;const p=()=>this.root.updateBlockedByResize=!1;t(a,()=>{this.root.updateBlockedByResize=!0,h&&h(),h=WR(p,250),ni.hasAnimatedSinceResize&&(ni.hasAnimatedSinceResize=!1,this.nodes.forEach(zp))})}c&&this.root.registerSharedNode(c,this),this.options.animate!==!1&&d&&(c||u)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p,hasRelativeLayoutChanged:m,layout:y})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const _=this.options.transition||d.getDefaultTransition()||vA,{onLayoutAnimationStart:x,onLayoutAnimationComplete:b}=d.getProps(),w=!this.targetLayout||!R0(this.targetLayout,y),E=!p&&m;if(this.options.layoutRoot||this.resumeFrom||E||p&&(w||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(h,E);const T={...au(_,"layout"),onPlay:x,onComplete:b};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T)}else p||zp(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=y})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,zt(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(pA),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&A0(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d<this.path.length;d++){const h=this.path[d];h.shouldResetTransform=!0,h.updateScroll("snapshot"),h.options.layoutRoot&&h.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(Bp);return}this.isUpdating||this.nodes.forEach(cA),this.isUpdating=!1,this.nodes.forEach(uA),this.nodes.forEach(rA),this.nodes.forEach(oA),this.clearAllSnapshots();const l=on.now();Me.delta=un(0,1e3/60,l-Me.timestamp),Me.timestamp=l,Me.isProcessing=!0,Ma.update.process(Me),Ma.preRender.process(Me),Ma.render.process(Me),Me.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,cu.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(lA),this.sharedNodes.forEach(fA)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ae.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ae.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!yt(this.snapshot.measuredBox.x)&&!yt(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Se(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(l=!1),l){const c=s(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!r)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!S0(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,d=u!==this.prevTransformTemplateValue;a&&(l||Jn(this.latestValues)||d)&&(r(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return a&&(c=this.removeTransform(c)),_A(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:a}=this.options;if(!a)return Se();const l=a.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(yA))){const{scroll:u}=this.root;u&&(Cs(l.x,u.offset.x),Cs(l.y,u.offset.y))}return l}removeElementScroll(a){const l=Se();if(It(l,a),this.scroll?.wasRoot)return l;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:d,options:h}=u;u!==this.root&&d&&h.layoutScroll&&(d.wasRoot&&It(l,a),Cs(l.x,d.offset.x),Cs(l.y,d.offset.y))}return l}applyTransform(a,l=!1){const c=Se();It(c,a);for(let u=0;u<this.path.length;u++){const d=this.path[u];!l&&d.options.layoutScroll&&d.scroll&&d!==d.root&&Is(c,{x:-d.scroll.offset.x,y:-d.scroll.offset.y}),Jn(d.latestValues)&&Is(c,d.latestValues)}return Jn(this.latestValues)&&Is(c,this.latestValues),c}removeTransform(a){const l=Se();It(l,a);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Jn(u.latestValues))continue;cc(u.latestValues)&&u.updateSnapshot();const d=Se(),h=u.measurePageBox();It(d,h),Dp(l,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,d)}return Jn(this.latestValues)&&Dp(l,this.latestValues),l}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Me.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(a||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:d,layoutId:h}=this.options;if(!(!this.layout||!(d||h))){if(this.resolvedRelativeTargetAt=Me.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Br(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),It(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Se(),this.targetWithTransforms=Se()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),bR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):It(this.target,this.layout.layoutBox),x0(this.target,this.targetDelta)):It(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget)){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Se(),this.relativeTargetOrigin=Se(),Br(this.relativeTargetOrigin,this.target,p.target),It(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}}}getClosestProjectingParent(){if(!(!this.parent||cc(this.parent.latestValues)||y0(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const a=this.getLead(),l=!!this.resumingFrom||this!==a;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===Me.timestamp&&(c=!1),c)return;const{layout:u,layoutId:d}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||d))return;It(this.layoutCorrected,this.layout.layoutBox);const h=this.treeScale.x,p=this.treeScale.y;wR(this.layoutCorrected,this.treeScale,this.path,l),a.layout&&!a.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(a.target=a.layout.layoutBox,a.targetWithTransforms=Se());const{target:m}=a;if(!m){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Cp(this.prevProjectionDelta.x,this.projectionDelta.x),Cp(this.prevProjectionDelta.y,this.projectionDelta.y)),$r(this.projectionDelta,this.layoutCorrected,m,this.latestValues),(this.treeScale.x!==h||this.treeScale.y!==p||!Fp(this.projectionDelta.x,this.prevProjectionDelta.x)||!Fp(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",m))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){if(this.options.visualElement?.scheduleRender(),a){const l=this.getStack();l&&l.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=As(),this.projectionDelta=As(),this.projectionDeltaWithTransform=As()}setAnimationOrigin(a,l=!1){const c=this.snapshot,u=c?c.latestValues:{},d={...this.latestValues},h=As();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const p=Se(),m=c?c.source:void 0,y=this.layout?this.layout.source:void 0,_=m!==y,x=this.getStack(),b=!x||x.members.length<=1,w=!!(_&&!b&&this.options.crossfade===!0&&!this.path.some(gA));this.animationProgress=0;let E;this.mixTargetDelta=T=>{const j=T/1e3;Up(h.x,a.x,j),Up(h.y,a.y,j),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Br(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),mA(this.relativeTarget,this.relativeTargetOrigin,p,j),E&&QR(this.relativeTarget,E)&&(this.isProjectionDirty=!1),E||(E=Se()),It(E,this.relativeTarget)),_&&(this.animationValues=d,KR(d,u,this.latestValues,j,w,b)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=j},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(zt(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ae.update(()=>{ni.hasAnimatedSinceResize=!0,this.currentAnimation=BR(0,$p,{...a,onUpdate:l=>{this.mixTargetDelta(l),a.onUpdate&&a.onUpdate(l)},onStop:()=>{},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta($p),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:l,target:c,layout:u,latestValues:d}=a;if(!(!l||!c||!u)){if(this!==a&&this.layout&&u&&I0(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||Se();const h=yt(this.layout.layoutBox.x);c.x.min=a.target.x.min,c.x.max=c.x.min+h;const p=yt(this.layout.layoutBox.y);c.y.min=a.target.y.min,c.y.max=c.y.min+p}It(l,c),Is(l,d),$r(this.projectionDeltaWithTransform,this.layoutCorrected,l,d)}}registerSharedNode(a,l){this.sharedNodes.has(a)||this.sharedNodes.set(a,new eA),this.sharedNodes.get(a).add(l);const u=l.options.initialPromotionConfig;l.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(l):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){const{layoutId:a}=this.options;return a?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:a}=this.options;return a?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:l,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),a&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let l=!1;const{latestValues:c}=a;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const u={};c.z&&Ga("z",a,u,this.animationValues);for(let d=0;d<Wa.length;d++)Ga(`rotate${Wa[d]}`,a,u,this.animationValues),Ga(`skew${Wa[d]}`,a,u,this.animationValues);a.render();for(const d in u)a.setStaticValue(d,u[d]),this.animationValues&&(this.animationValues[d]=u[d]);a.scheduleRender()}getProjectionStyles(a){if(!this.instance||this.isSVG)return;if(!this.isVisible)return nA;const l={visibility:""},c=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,l.opacity="",l.pointerEvents=ti(a?.pointerEvents)||"",l.transform=c?c(this.latestValues,""):"none",l;const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){const m={};return this.options.layoutId&&(m.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,m.pointerEvents=ti(a?.pointerEvents)||""),this.hasProjected&&!Jn(this.latestValues)&&(m.transform=c?c({},""):"none",this.hasProjected=!1),m}const d=u.animationValues||u.latestValues;this.applyTransformsToTarget(),l.transform=tA(this.projectionDeltaWithTransform,this.treeScale,d),c&&(l.transform=c(d,l.transform));const{x:h,y:p}=this.projectionDelta;l.transformOrigin=`${h.origin*100}% ${p.origin*100}% 0`,u.animationValues?l.opacity=u===this?d.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:d.opacityExit:l.opacity=u===this?d.opacity!==void 0?d.opacity:"":d.opacityExit!==void 0?d.opacityExit:0;for(const m in to){if(d[m]===void 0)continue;const{correct:y,applyTo:_,isCSSVariable:x}=to[m],b=l.transform==="none"?d[m]:y(d[m],u);if(_){const w=_.length;for(let E=0;E<w;E++)l[_[E]]=b}else x?this.options.visualElement.renderState.vars[m]=b:l[m]=b}return this.options.layoutId&&(l.pointerEvents=u===this?ti(a?.pointerEvents)||"":"none"),l}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>a.currentAnimation?.stop()),this.root.nodes.forEach(Bp),this.root.sharedNodes.clear()}}}function rA(t){t.updateLayout()}function oA(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:s}=t.layout,{animationType:r}=t.options,i=e.source!==t.layout.source;r==="size"?Ot(d=>{const h=i?e.measuredBox[d]:e.layoutBox[d],p=yt(h);h.min=n[d].min,h.max=h.min+p}):I0(r,e.layoutBox,n)&&Ot(d=>{const h=i?e.measuredBox[d]:e.layoutBox[d],p=yt(n[d]);h.max=h.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[d].max=t.relativeTarget[d].min+p)});const a=As();$r(a,n,e.layoutBox);const l=As();i?$r(l,t.applyTransform(s,!0),e.measuredBox):$r(l,n,e.layoutBox);const c=!S0(a);let u=!1;if(!t.resumeFrom){const d=t.getClosestProjectingParent();if(d&&!d.resumeFrom){const{snapshot:h,layout:p}=d;if(h&&p){const m=Se();Br(m,e.layoutBox,h.layoutBox);const y=Se();Br(y,n,p.layoutBox),R0(m,y)||(u=!0),d.options.layoutRoot&&(t.relativeTarget=y,t.relativeTargetOrigin=m,t.relativeParent=d)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function iA(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function aA(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function lA(t){t.clearSnapshot()}function Bp(t){t.clearMeasurements()}function cA(t){t.isLayoutDirty=!1}function uA(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function zp(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function dA(t){t.resolveTargetDelta()}function hA(t){t.calcProjection()}function pA(t){t.resetSkewAndRotation()}function fA(t){t.removeLeadSnapshot()}function Up(t,e,n){t.translate=Ee(e.translate,0,n),t.scale=Ee(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Hp(t,e,n,s){t.min=Ee(e.min,n.min,s),t.max=Ee(e.max,n.max,s)}function mA(t,e,n,s){Hp(t.x,e.x,n.x,s),Hp(t.y,e.y,n.y,s)}function gA(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const vA={duration:.45,ease:[.4,0,.1,1]},Wp=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Gp=Wp("applewebkit/")&&!Wp("chrome/")?Math.round:Et;function Kp(t){t.min=Gp(t.min),t.max=Gp(t.max)}function _A(t){Kp(t.x),Kp(t.y)}function I0(t,e,n){return t==="position"||t==="preserve-aspect"&&!xR(Vp(e),Vp(n),.2)}function yA(t){return t!==t.root&&t.scroll?.wasRoot}const xA=C0({attachResizeListener:(t,e)=>oo(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ka={current:void 0},O0=C0({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ka.current){const t=new xA({});t.mount(window),t.setOptions({layoutScroll:!0}),Ka.current=t}return Ka.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),bA={pan:{Feature:NR},drag:{Feature:MR,ProjectionNode:O0,MeasureLayout:T0}};function qp(t,e,n){const{props:s}=t;t.animationState&&s.whileHover&&t.animationState.setActive("whileHover",n==="Start");const r="onHover"+n,i=s[r];i&&ae.postRender(()=>i(e,wo(e)))}class wA extends Kn{mount(){const{current:e}=this.node;e&&(this.unmount=OP(e,(n,s)=>(qp(this.node,s,"Start"),r=>qp(this.node,r,"End"))))}unmount(){}}class EA extends Kn{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=bo(oo(this.node.current,"focus",()=>this.onFocus()),oo(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Yp(t,e,n){const{props:s}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&s.whileTap&&t.animationState.setActive("whileTap",n==="Start");const r="onTap"+(n==="End"?"":n),i=s[r];i&&ae.postRender(()=>i(e,wo(e)))}class jA extends Kn{mount(){const{current:e}=this.node;e&&(this.unmount=NP(e,(n,s)=>(Yp(this.node,s,"Start"),(r,{success:i})=>Yp(this.node,r,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const hc=new WeakMap,qa=new WeakMap,TA=t=>{const e=hc.get(t.target);e&&e(t)},PA=t=>{t.forEach(TA)};function kA({root:t,...e}){const n=t||document;qa.has(n)||qa.set(n,{});const s=qa.get(n),r=JSON.stringify(e);return s[r]||(s[r]=new IntersectionObserver(PA,{root:t,...e})),s[r]}function SA(t,e,n){const s=kA(e);return hc.set(t,n),s.observe(t),()=>{hc.delete(t),s.unobserve(t)}}const RA={some:0,all:1};class AA extends Kn{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:s,amount:r="some",once:i}=e,a={root:n?n.current:void 0,rootMargin:s,threshold:typeof r=="number"?r:RA[r]},l=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),p=u?d:h;p&&p(c)};return SA(this.node.current,a,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(CA(e,n))&&this.startObserver()}unmount(){}}function CA({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const IA={inView:{Feature:AA},tap:{Feature:jA},focus:{Feature:EA},hover:{Feature:wA}},OA={layout:{ProjectionNode:O0,MeasureLayout:T0}},pc={current:null},D0={current:!1};function DA(){if(D0.current=!0,!!Qc)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>pc.current=t.matches;t.addListener(e),e()}else pc.current=!1}const LA=[...r0,gt,Gn],MA=t=>LA.find(s0(t)),NA=new WeakMap;function VA(t,e,n){for(const s in e){const r=e[s],i=n[s];if(Ne(r))t.addValue(s,r);else if(Ne(i))t.addValue(s,nn(r,{owner:t}));else if(i!==r)if(t.hasValue(s)){const a=t.getValue(s);a.liveStyle===!0?a.jump(r):a.hasAnimated||a.set(r)}else{const a=t.getStaticValue(s);t.addValue(s,nn(a!==void 0?a:r,{owner:t}))}}for(const s in n)e[s]===void 0&&t.removeValue(s);return e}const Xp=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class FA{scrapeMotionValuesFromProps(e,n,s){return{}}constructor({parent:e,props:n,presenceContext:s,reducedMotionConfig:r,blockInitialAnimation:i,visualState:a},l={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Ru,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=on.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,ae.render(this.render,!1,!0))};const{latestValues:c,renderState:u,onUpdate:d}=a;this.onUpdate=d,this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=s,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=l,this.blockInitialAnimation=!!i,this.isControllingVariants=sa(n),this.isVariantNode=xv(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...p}=this.scrapeMotionValuesFromProps(n,{},this);for(const m in p){const y=p[m];c[m]!==void 0&&Ne(y)&&y.set(c[m],!1)}}mount(e){this.current=e,NA.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,s)=>this.bindToMotionValue(s,n)),D0.current||DA(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:pc.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),zt(this.notifyUpdate),zt(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const s=us.has(e);s&&this.onBindTransform&&this.onBindTransform();const r=n.on("change",l=>{this.latestValues[e]=l,this.props.onUpdate&&ae.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),i=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{r(),i(),a&&a(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Gs){const n=Gs[e];if(!n)continue;const{isEnabled:s,Feature:r}=n;if(!this.features[e]&&r&&s(this.props)&&(this.features[e]=new r(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Se()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let s=0;s<Xp.length;s++){const r=Xp[s];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const i="on"+r,a=e[i];a&&(this.propEventSubscriptions[r]=this.on(r,a))}this.prevMotionValues=VA(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const s=this.values.get(e);n!==s&&(s&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let s=this.values.get(e);return s===void 0&&n!==void 0&&(s=nn(n===null?void 0:n,{owner:this}),this.addValue(e,s)),s}readValue(e,n){let s=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return s!=null&&(typeof s=="string"&&(t0(s)||Wv(s))?s=parseFloat(s):!MA(s)&&Gn.test(n)&&(s=Jv(e,n)),this.setBaseTarget(e,Ne(s)?s.get():s)),Ne(s)?s.get():s}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let s;if(typeof n=="string"||typeof n=="object"){const i=Eu(this.props,n,this.presenceContext?.custom);i&&(s=i[e])}if(n&&s!==void 0)return s;const r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!Ne(r)?r:this.initialValues[e]!==void 0&&s===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new su),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}}class L0 extends FA{constructor(){super(...arguments),this.KeyframeResolver=o0}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:s}){delete n[e],delete s[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Ne(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function $A(t){return window.getComputedStyle(t)}class BA extends L0{constructor(){super(...arguments),this.type="html",this.renderInstance=Cv}readValueFromInstance(e,n){if(us.has(n))return tS(e,n);{const s=$A(e),r=(mu(n)?s.getPropertyValue(n):s[n])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:n}){return b0(e,n)}build(e,n,s){_u(e,n,s.transformTemplate)}scrapeMotionValuesFromProps(e,n,s){return ju(e,n,s)}}class zA extends L0{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Se,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&Av(this.current,this.renderState)}}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(us.has(n)){const s=Zv(n);return s&&s.default||0}return n=Iv.has(n)?n:fu(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,s){return Dv(e,n,s)}onBindTransform(){this.current&&!this.renderState.dimensions&&ae.postRender(this.updateDimensions)}build(e,n,s){bu(e,n,this.isSVGTag,s.transformTemplate)}renderInstance(e,n,s,r){Ov(e,n,s,r)}mount(e){this.isSVGTag=wu(e.tagName),super.mount(e)}}const UA=(t,e)=>xu(t)?new zA(e):new BA(e,{allowProjection:t!==f.Fragment}),HA=Sk({...hR,...IA,...bA,...OA},UA),ke=HP(HA);function M0(t,e){let n;const s=()=>{const{currentTime:r}=e,a=(r===null?0:r.value)/100;n!==a&&t(a),n=a};return ae.update(s,!0),()=>zt(s)}const si=new WeakMap;let ri;function WA(t,e){if(e){const{inlineSize:n,blockSize:s}=e[0];return{width:n,height:s}}else return t instanceof SVGElement&&"getBBox"in t?t.getBBox():{width:t.offsetWidth,height:t.offsetHeight}}function GA({target:t,contentRect:e,borderBoxSize:n}){si.get(t)?.forEach(s=>{s({target:t,contentSize:e,get size(){return WA(t,n)}})})}function KA(t){t.forEach(GA)}function qA(){typeof ResizeObserver>"u"||(ri=new ResizeObserver(KA))}function YA(t,e){ri||qA();const n=uu(t);return n.forEach(s=>{let r=si.get(s);r||(r=new Set,si.set(s,r)),r.add(e),ri?.observe(s)}),()=>{n.forEach(s=>{const r=si.get(s);r?.delete(e),r?.size||ri?.unobserve(s)})}}const oi=new Set;let zr;function XA(){zr=()=>{const t={width:window.innerWidth,height:window.innerHeight},e={target:window,size:t,contentSize:t};oi.forEach(n=>n(e))},window.addEventListener("resize",zr)}function ZA(t){return oi.add(t),zr||XA(),()=>{oi.delete(t),!oi.size&&zr&&(zr=void 0)}}function JA(t,e){return typeof t=="function"?ZA(t):YA(t,e)}const QA=50,Zp=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),eC=()=>({time:0,x:Zp(),y:Zp()}),tC={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function Jp(t,e,n,s){const r=n[e],{length:i,position:a}=tC[e],l=r.current,c=n.time;r.current=t[`scroll${a}`],r.scrollLength=t[`scroll${i}`]-t[`client${i}`],r.offset.length=0,r.offset[0]=0,r.offset[1]=r.scrollLength,r.progress=Ws(0,r.scrollLength,r.current);const u=s-c;r.velocity=u>QA?0:ru(r.current-l,u)}function nC(t,e,n){Jp(t,"x",e,n),Jp(t,"y",e,n),e.time=n}function sC(t,e){const n={x:0,y:0};let s=t;for(;s&&s!==e;)if(s instanceof HTMLElement)n.x+=s.offsetLeft,n.y+=s.offsetTop,s=s.offsetParent;else if(s.tagName==="svg"){const r=s.getBoundingClientRect();s=s.parentElement;const i=s.getBoundingClientRect();n.x+=r.left-i.left,n.y+=r.top-i.top}else if(s instanceof SVGGraphicsElement){const{x:r,y:i}=s.getBBox();n.x+=r,n.y+=i;let a=null,l=s.parentNode;for(;!a;)l.tagName==="svg"&&(a=l),l=s.parentNode;s=a}else break;return n}const fc={start:0,center:.5,end:1};function Qp(t,e,n=0){let s=0;if(t in fc&&(t=fc[t]),typeof t=="string"){const r=parseFloat(t);t.endsWith("px")?s=r:t.endsWith("%")?t=r/100:t.endsWith("vw")?s=r/100*document.documentElement.clientWidth:t.endsWith("vh")?s=r/100*document.documentElement.clientHeight:t=r}return typeof t=="number"&&(s=e*t),n+s}const rC=[0,0];function oC(t,e,n,s){let r=Array.isArray(t)?t:rC,i=0,a=0;return typeof t=="number"?r=[t,t]:typeof t=="string"&&(t=t.trim(),t.includes(" ")?r=t.split(" "):r=[t,fc[t]?t:"0"]),i=Qp(r[0],n,s),a=Qp(r[1],e),i-a}const iC={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},aC={x:0,y:0};function lC(t){return"getBBox"in t&&t.tagName!=="svg"?t.getBBox():{width:t.clientWidth,height:t.clientHeight}}function cC(t,e,n){const{offset:s=iC.All}=n,{target:r=t,axis:i="y"}=n,a=i==="y"?"height":"width",l=r!==t?sC(r,t):aC,c=r===t?{width:t.scrollWidth,height:t.scrollHeight}:lC(r),u={width:t.clientWidth,height:t.clientHeight};e[i].offset.length=0;let d=!e[i].interpolate;const h=s.length;for(let p=0;p<h;p++){const m=oC(s[p],u[a],c[a],l[i]);!d&&m!==e[i].interpolatorOffsets[p]&&(d=!0),e[i].offset[p]=m}d&&(e[i].interpolate=Cu(e[i].offset,d0(s),{clamp:!1}),e[i].interpolatorOffsets=[...e[i].offset]),e[i].progress=un(0,1,e[i].interpolate(e[i].current))}function uC(t,e=t,n){if(n.x.targetOffset=0,n.y.targetOffset=0,e!==t){let s=e;for(;s&&s!==t;)n.x.targetOffset+=s.offsetLeft,n.y.targetOffset+=s.offsetTop,s=s.offsetParent}n.x.targetLength=e===t?e.scrollWidth:e.clientWidth,n.y.targetLength=e===t?e.scrollHeight:e.clientHeight,n.x.containerLength=t.clientWidth,n.y.containerLength=t.clientHeight}function dC(t,e,n,s={}){return{measure:()=>uC(t,s.target,n),update:r=>{nC(t,n,r),(s.offset||s.target)&&cC(t,n,s)},notify:()=>e(n)}}const yr=new WeakMap,ef=new WeakMap,Ya=new WeakMap,tf=t=>t===document.documentElement?window:t;function Ou(t,{container:e=document.documentElement,...n}={}){let s=Ya.get(e);s||(s=new Set,Ya.set(e,s));const r=eC(),i=dC(e,t,r,n);if(s.add(i),!yr.has(e)){const l=()=>{for(const p of s)p.measure()},c=()=>{for(const p of s)p.update(Me.timestamp)},u=()=>{for(const p of s)p.notify()},d=()=>{ae.read(l,!1,!0),ae.read(c,!1,!0),ae.update(u,!1,!0)};yr.set(e,d);const h=tf(e);window.addEventListener("resize",d,{passive:!0}),e!==document.documentElement&&ef.set(e,JA(e,d)),h.addEventListener("scroll",d,{passive:!0})}const a=yr.get(e);return ae.read(a,!1,!0),()=>{zt(a);const l=Ya.get(e);if(!l||(l.delete(i),l.size))return;const c=yr.get(e);yr.delete(e),c&&(tf(e).removeEventListener("scroll",c),ef.get(e)?.(),window.removeEventListener("resize",c))}}function hC({source:t,container:e,axis:n="y"}){t&&(e=t);const s={value:0},r=Ou(i=>{s.value=i[n].progress*100},{container:e,axis:n});return{currentTime:s,cancel:r}}const Xa=new Map;function N0({source:t,container:e=document.documentElement,axis:n="y"}={}){t&&(e=t),Xa.has(e)||Xa.set(e,{});const s=Xa.get(e);return s[n]||(s[n]=uv()?new ScrollTimeline({source:e,axis:n}):hC({source:e,axis:n})),s[n]}function pC(t){return t.length===2}function V0(t){return t&&(t.target||t.offset)}function fC(t,e){return pC(t)||V0(e)?Ou(n=>{t(n[e.axis].progress,n)},e):M0(t,N0(e))}function mC(t,e){if(t.flatten(),V0(e))return t.pause(),Ou(n=>{t.time=t.duration*n[e.axis].progress},e);{const n=N0(e);return t.attachTimeline?t.attachTimeline(n,s=>(s.pause(),M0(r=>{s.time=s.duration*r},n))):Et}}function gC(t,{axis:e="y",...n}={}){const s={axis:e,...n};return typeof t=="function"?fC(t,s):mC(t,s)}function nf(t,e){bP(!!(!e||e.current))}const vC=()=>({scrollX:nn(0),scrollY:nn(0),scrollXProgress:nn(0),scrollYProgress:nn(0)});function _C({container:t,target:e,layoutEffect:n=!0,...s}={}){const r=Wn(vC);return(n?vo:f.useEffect)(()=>(nf("target",e),nf("container",t),gC((a,{x:l,y:c})=>{r.scrollX.set(l.current),r.scrollXProgress.set(l.progress),r.scrollY.set(c.current),r.scrollYProgress.set(c.progress)},{...s,container:t?.current||void 0,target:e?.current||void 0})),[t,e,JSON.stringify(s.offset)]),r}function F0(t){const e=Wn(()=>nn(t)),{isStatic:n}=f.useContext(_o);if(n){const[,s]=f.useState(t);f.useEffect(()=>e.on("change",s),[])}return e}function $0(t,e){const n=F0(e()),s=()=>n.set(e());return s(),vo(()=>{const r=()=>ae.preRender(s,!1,!0),i=t.map(a=>a.on("change",r));return()=>{i.forEach(a=>a()),zt(s)}}),n}function sf(t,e={}){const{isStatic:n}=f.useContext(_o),s=f.useRef(null),r=Wn(()=>Ne(t)?t.get():t),i=Wn(()=>typeof r=="string"?r.replace(/[\d.-]/g,""):void 0),a=F0(r),l=f.useRef(r),c=f.useRef(Et),u=()=>{d(),s.current=$S({keyframes:[of(a.get()),of(l.current)],velocity:a.getVelocity(),type:"spring",restDelta:.001,restSpeed:.01,...e,onUpdate:c.current})},d=()=>{s.current&&s.current.stop()};return f.useInsertionEffect(()=>a.attach((h,p)=>n?p(h):(l.current=h,c.current=m=>p(rf(m,i)),ae.postRender(u),a.get()),d),[JSON.stringify(e)]),vo(()=>{if(Ne(t))return t.on("change",h=>a.set(rf(h,i)))},[a,i]),a}function rf(t,e){return e?t+e:t}function of(t){return typeof t=="number"?t:parseFloat(t)}const yC=t=>t&&typeof t=="object"&&t.mix,xC=t=>yC(t)?t.mix:void 0;function bC(...t){const e=!Array.isArray(t[0]),n=e?0:-1,s=t[0+n],r=t[1+n],i=t[2+n],a=t[3+n],l=Cu(r,i,{mixer:xC(i[0]),...a});return e?l(s):l}function wC(t){Nr.current=[],t();const e=$0(Nr.current,t);return Nr.current=void 0,e}function af(t,e,n,s){if(typeof t=="function")return wC(t);const r=typeof e=="function"?e:bC(e,n,s);return Array.isArray(t)?lf(t,r):lf([t],([i])=>r(i))}function lf(t,e){const n=Wn(()=>[]);return $0(t,()=>{n.length=0;const s=t.length;for(let r=0;r<s;r++)n[r]=t[r].get();return e(n)})}const EC={some:0,all:1};function jC(t,e,{root:n,margin:s,amount:r="some"}={}){const i=uu(t),a=new WeakMap,l=u=>{u.forEach(d=>{const h=a.get(d.target);if(d.isIntersecting!==!!h)if(d.isIntersecting){const p=e(d.target,d);typeof p=="function"?a.set(d.target,p):c.unobserve(d.target)}else typeof h=="function"&&(h(d),a.delete(d.target))})},c=new IntersectionObserver(l,{root:n,rootMargin:s,threshold:typeof r=="number"?r:EC[r]});return i.forEach(u=>c.observe(u)),()=>c.disconnect()}function TC(t,{root:e,margin:n,amount:s,once:r=!1,initial:i=!1}={}){const[a,l]=f.useState(i);return f.useEffect(()=>{if(!t.current||r&&a)return;const c=()=>(l(!0),r?void 0:()=>l(!1)),u={root:e&&e.current||void 0,margin:n,amount:s};return jC(t.current,c,u)},[e,t,n,r,s]),a}const B0="/assets/lumi-idle-0POIBpsz.webp",z0="/assets/lumi-flying-BYO-JzK3.webp",PC=({flyingGifSrc:t=z0,idleGifSrc:e=B0,targetElement:n,onTargetReached:s})=>{const[r,i]=f.useState(!1),[a,l]=f.useState(!1),[c,u]=f.useState(!1),[d,h]=f.useState(!1),p=f.useRef({x:0,y:0}),m=f.useRef(!1),y={stiffness:150,damping:15,mass:1},_=sf(0,y),x=sf(0,y);if(f.useEffect(()=>{if(n){h(!0),m.current=!1;const w=n.getBoundingClientRect(),E=w.left+w.width/2+20,T=w.top-30;_.set(E),x.set(T);const j=setTimeout(()=>{m.current||(m.current=!0,s?.())},500);return()=>clearTimeout(j)}else h(!1)},[n,_,x,s]),f.useEffect(()=>{if(d)return;let w=0;const E=T=>{const j=performance.now();if(j-w<16)return;w=j,c||u(!0),_.set(T.clientX+20),x.set(T.clientY-20);const k=T.target.closest("[data-lumi-interactive]")!==null;i(k)};return window.addEventListener("mousemove",E,{passive:!0}),()=>{window.removeEventListener("mousemove",E)}},[c,_,x,d]),f.useEffect(()=>{if(d)return;let w=0;const E=j=>{const P=j.touches[0];if(!P)return;const k=performance.now();if(k-w<16)return;w=k,c||u(!0),_.set(P.clientX+20),x.set(P.clientY-50);const D=j.target.closest("[data-lumi-interactive]")!==null;i(D)},T=j=>{const P=j.touches[0];P&&(c||u(!0),_.set(P.clientX+20),x.set(P.clientY-50))};return window.addEventListener("touchstart",T,{passive:!0}),window.addEventListener("touchmove",E,{passive:!0}),()=>{window.removeEventListener("touchstart",T),window.removeEventListener("touchmove",E)}},[c,_,x,d]),f.useEffect(()=>{const w=setInterval(()=>{const E=_.get(),T=x.get(),j=E-p.current.x,P=T-p.current.y,k=Math.sqrt(j*j+P*P);l(k>1),p.current={x:E,y:T}},50);return()=>clearInterval(w)},[_,x]),!c)return null;const b=a&&!r&&!(d&&m.current);return o.jsxs(ke.div,{className:"fixed top-0 left-0 pointer-events-none z-[9999]",style:{x:_,y:x,willChange:"transform"},children:[o.jsx(ke.div,{animate:{scale:r||d?1.3:1,filter:r||d?"drop-shadow(0 0 20px rgba(255, 200, 100, 0.9)) drop-shadow(0 0 40px rgba(255, 180, 50, 0.6))":"drop-shadow(0 0 8px rgba(255, 200, 100, 0.4))"},transition:{duration:.25,ease:"easeOut"},children:o.jsxs("div",{className:"relative w-14 h-14",children:[o.jsx("img",{src:e,alt:"Lumi",className:"absolute inset-0 w-14 h-14 object-contain transition-opacity duration-150",style:{opacity:b?0:1},draggable:!1,decoding:"async"}),o.jsx("img",{src:t,alt:"","aria-hidden":"true",className:"absolute inset-0 w-14 h-14 object-contain transition-opacity duration-150",style:{opacity:b?1:0},draggable:!1,decoding:"async"})]})}),(r||d)&&o.jsx(ke.div,{className:"absolute inset-0 -z-10 rounded-full",initial:{scale:.8,opacity:0},animate:{scale:1.5,opacity:1},transition:{duration:.3},style:{background:"radial-gradient(circle, rgba(255, 200, 100, 0.4) 0%, transparent 70%)"}})]})};let zo=null;function kC(t){"requestIdleCallback"in window?window.requestIdleCallback(t,{timeout:4e3}):setTimeout(t,2e3)}function SC(){return zo||(zo=new Promise(t=>{if(typeof window>"u"){t(null);return}kC(async()=>{const{default:e}=await g(async()=>{const{default:n}=await Promise.resolve().then(()=>iP);return{default:n}},void 0);e.init("phc_5WxlAFQoA7g6daYB1QX9p6OsJMQkzmwgbjaBKG28S5m",{api_host:"https://us.i.posthog.com",loaded:()=>{},capture_pageview:!1,capture_pageleave:!0}),t(e)})}),zo)}function RC(){const t=Ys();return f.useEffect(()=>{SC().then(e=>{e?.capture("$pageview")})},[t.pathname]),null}function AC({children:t}){return o.jsxs(o.Fragment,{children:[o.jsx(RC,{}),t]})}const CC=[{key:"nature-coral",label:"Coral",defaultHex:"#F27E7E",group:"brand",role:"PRIMARY intent — the one action on this screen (Read, Continue, Save, Submit).",tailwind:"bg-nature-coral"},{key:"nature-forest",label:"Forest",defaultHex:"#3F7468",group:"brand",role:"LEARN intent — learning tools (Vocabulary, Themes, Check Text, SESL, Check Progress).",tailwind:"bg-nature-forest"},{key:"nature-purple",label:"Purple",defaultHex:"#9b87f5",group:"brand",role:"CREATE intent — generative actions (Story Maker, Send Message, Start Creating).",tailwind:"bg-nature-purple"},{key:"nature-honey",label:"Honey",defaultHex:"#FEF3C7",group:"brand",role:"PREMIUM surface — soft honey background for premium tags, upgrade CTAs, and paid highlights. Pair with `text-nature-honey-ink` for AA.",tailwind:"bg-nature-honey"},{key:"nature-honey-ink",label:"Honey Ink",defaultHex:"#B45309",group:"brand",role:"Text/icon colour that sits on `nature-honey`.",tailwind:"text-nature-honey-ink"},{key:"nature-red",label:"Red",defaultHex:"#BF0404",group:"brand",role:"DESTRUCTIVE only (delete, cancel subscription). Never a CTA.",tailwind:"bg-nature-red"},{key:"ink",label:"Ink (body text)",defaultHex:"#2B2B2B",group:"neutral",role:"Body copy on light surfaces. Use `text-ink` instead of `text-black`.",tailwind:"bg-ink"},{key:"cream",label:"Cream (warm surface)",defaultHex:"#FFF8E7",group:"neutral",role:"Warm surface tone — matches hero. Use for Claymation-friendly card backgrounds.",tailwind:"bg-cream"},{key:"page-surface",label:"Page surface (canvas)",defaultHex:"#FBF7F0",group:"neutral",role:"Universal page canvas — solid Claymation-friendly cream that replaces per-page gradients. Applied via `bg-page-surface` on every page except Home / 404 / MP4-loader pages.",tailwind:"bg-page-surface"}],IC="design_tokens",OC=CC.reduce((t,e)=>(t[e.key]=e.defaultHex,t),{}),DC=t=>/^#([0-9a-f]{3}|[0-9a-f]{6})$/i.test(t.trim());function LC(t){const e=t.trim().replace("#",""),n=e.length===3?e.split("").map(a=>a+a).join(""):e,s=parseInt(n.slice(0,2),16),r=parseInt(n.slice(2,4),16),i=parseInt(n.slice(4,6),16);return`${s} ${r} ${i}`}function cf(t,e=document.documentElement){for(const[n,s]of Object.entries(t))DC(s)&&(e.style.setProperty(`--${n}`,s.trim()),n.startsWith("nature-")&&e.style.setProperty(`--${n}-rgb`,LC(s)))}const MC=({children:t})=>(f.useEffect(()=>{let e=!1;(async()=>{try{const{data:s}=await pe.from("app_settings").select("value").eq("key",IC).maybeSingle();if(e||!s?.value)return;const r=JSON.parse(s.value);cf({...OC,...r})}catch{}})();const n=s=>{const r=s.detail;r&&cf(r)};return window.addEventListener("design-tokens:apply",n),()=>{e=!0,window.removeEventListener("design-tokens:apply",n)}},[]),o.jsx(o.Fragment,{children:t})),NC=()=>{const{user:t,session:e}=Zc(),[n,s]=f.useState("guest"),[r,i]=f.useState({status:"none",isExpired:!0,isCancelledAtPeriodEnd:!1,planType:null}),[a,l]=f.useState(null),[c,u]=f.useState(null),[d,h]=f.useState(!0),[p,m]=f.useState(!1),[y,_]=f.useState(null),[x,b]=f.useState(!1),w=f.useRef(null),E=f.useCallback(async(P=!1)=>{if(!t){s("guest"),i({status:"none",isExpired:!0,isCancelledAtPeriodEnd:!1,planType:null}),h(!1),b(!0),w.current=null;return}if(!(x&&w.current===t.id&&!P))try{h(!0),P&&m(!0),_(null);const{data:k,error:S}=await pe.from("profiles").select("user_type, avatar_url, display_name").eq("id",t.id).single();if(S)throw console.error("[ACCESS-CONTROL] Profile error:",S),S;const{data:D,error:A}=await pe.from("user_payments").select("subscription_status, subscription_start_date, subscription_end_date, cancel_at_period_end, plan_type").eq("user_id",t.id).maybeSingle();if(A&&console.error("[ACCESS-CONTROL] Payment error:",A),k){l(k.avatar_url||null);const B=k.display_name||t.user_metadata?.display_name||t.user_metadata?.name||t.user_metadata?.full_name||null;u(B);const M=k.user_type||"free",K=new Date,O=D?.subscription_end_date?new Date(D.subscription_end_date):void 0,q=O?K>O:!0;i({status:D?.subscription_status||"none",startDate:D?.subscription_start_date?new Date(D.subscription_start_date):void 0,endDate:O,isExpired:q,isCancelledAtPeriodEnd:D?.cancel_at_period_end??!1,planType:D?.plan_type??null}),M!=="admin"?D?.subscription_status==="active"&&!q?s("paid"):k.user_type!=="guest"&&s("free"):s(M)}}catch(k){console.error("[ACCESS-CONTROL] Error:",k);const S=k instanceof Error?k.message:String(k);_(S),P&&Qt.error("Failed to refresh profile data",{description:"Please try again later or contact support."})}finally{h(!1),b(!0),w.current=t.id,P&&m(!1)}},[t?.id,x]);f.useEffect(()=>{t?.id!==w.current&&b(!1)},[t?.id]),f.useEffect(()=>{E()},[E]);const T=P=>P==="guest"?!0:P==="free"?n==="free"||n==="paid"||n==="admin":P==="paid"?n==="paid"||n==="admin"||r.status==="active"&&!r.isExpired:!1,j=f.useCallback(async()=>{await E(!0)},[E]);return{userType:n,subscription:r,avatarUrl:a,displayName:c,isLoading:d,isRefreshing:p,lastRefreshError:y,canAccessStory:T,isAuthenticated:!!t,refreshSubscriptionStatus:j}},U0=Ui("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 hover:scale-[1.02] active:scale-[0.98]",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-nature-red text-white hover:bg-nature-red/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",primary:"bg-nature-coral text-white shadow-md hover:bg-nature-coral/90 hover:shadow-lg",create:"bg-nature-purple text-white shadow-md hover:bg-nature-purple/90 hover:shadow-lg",learn:"bg-nature-forest text-white shadow-md hover:bg-nature-forest/90 hover:shadow-lg",premium:"bg-nature-honey text-nature-honey-ink shadow-md hover:bg-nature-honey/90 hover:shadow-lg"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10",pill:"h-11 rounded-full px-6 uppercase tracking-wide text-sm font-bold",pillIcon:"h-9 w-9 rounded-full p-0 gap-0",pillSm:"h-8 rounded-full px-3 text-xs font-semibold"},animated:{true:"animate-pulse-gentle",false:""}},defaultVariants:{variant:"default",size:"default",animated:!1}}),$n=f.forwardRef(({className:t,variant:e,size:n,animated:s,asChild:r=!1,...i},a)=>{const l=r?rs:"button";return o.jsx(l,{className:ve(U0({variant:e,size:n,animated:s,className:t})),ref:a,...i})});$n.displayName="Button";var VC=f.createContext(void 0);function H0(t){const e=f.useContext(VC);return t||e||"ltr"}var Za=0;function W0(){f.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??uf()),document.body.insertAdjacentElement("beforeend",t[1]??uf()),Za++,()=>{Za===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Za--}},[])}function uf(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var Ja="focusScope.autoFocusOnMount",Qa="focusScope.autoFocusOnUnmount",df={bubbles:!1,cancelable:!0},FC="FocusScope",Du=f.forwardRef((t,e)=>{const{loop:n=!1,trapped:s=!1,onMountAutoFocus:r,onUnmountAutoFocus:i,...a}=t,[l,c]=f.useState(null),u=vt(r),d=vt(i),h=f.useRef(null),p=Ae(e,_=>c(_)),m=f.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;f.useEffect(()=>{if(s){let _=function(E){if(m.paused||!l)return;const T=E.target;l.contains(T)?h.current=T:Ln(h.current,{select:!0})},x=function(E){if(m.paused||!l)return;const T=E.relatedTarget;T!==null&&(l.contains(T)||Ln(h.current,{select:!0}))},b=function(E){if(document.activeElement===document.body)for(const j of E)j.removedNodes.length>0&&Ln(l)};document.addEventListener("focusin",_),document.addEventListener("focusout",x);const w=new MutationObserver(b);return l&&w.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",_),document.removeEventListener("focusout",x),w.disconnect()}}},[s,l,m.paused]),f.useEffect(()=>{if(l){pf.add(m);const _=document.activeElement;if(!l.contains(_)){const b=new CustomEvent(Ja,df);l.addEventListener(Ja,u),l.dispatchEvent(b),b.defaultPrevented||($C(WC(G0(l)),{select:!0}),document.activeElement===_&&Ln(l))}return()=>{l.removeEventListener(Ja,u),setTimeout(()=>{const b=new CustomEvent(Qa,df);l.addEventListener(Qa,d),l.dispatchEvent(b),b.defaultPrevented||Ln(_??document.body,{select:!0}),l.removeEventListener(Qa,d),pf.remove(m)},0)}}},[l,u,d,m]);const y=f.useCallback(_=>{if(!n&&!s||m.paused)return;const x=_.key==="Tab"&&!_.altKey&&!_.ctrlKey&&!_.metaKey,b=document.activeElement;if(x&&b){const w=_.currentTarget,[E,T]=BC(w);E&&T?!_.shiftKey&&b===T?(_.preventDefault(),n&&Ln(E,{select:!0})):_.shiftKey&&b===E&&(_.preventDefault(),n&&Ln(T,{select:!0})):b===w&&_.preventDefault()}},[n,s,m.paused]);return o.jsx(de.div,{tabIndex:-1,...a,ref:p,onKeyDown:y})});Du.displayName=FC;function $C(t,{select:e=!1}={}){const n=document.activeElement;for(const s of t)if(Ln(s,{select:e}),document.activeElement!==n)return}function BC(t){const e=G0(t),n=hf(e,t),s=hf(e.reverse(),t);return[n,s]}function G0(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:s=>{const r=s.tagName==="INPUT"&&s.type==="hidden";return s.disabled||s.hidden||r?NodeFilter.FILTER_SKIP:s.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function hf(t,e){for(const n of t)if(!zC(n,{upTo:e}))return n}function zC(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function UC(t){return t instanceof HTMLInputElement&&"select"in t}function Ln(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&UC(t)&&e&&t.select()}}var pf=HC();function HC(){let t=[];return{add(e){const n=t[0];e!==n&&n?.pause(),t=ff(t,e),t.unshift(e)},remove(e){t=ff(t,e),t[0]?.resume()}}}function ff(t,e){const n=[...t],s=n.indexOf(e);return s!==-1&&n.splice(s,1),n}function WC(t){return t.filter(e=>e.tagName!=="A")}function GC(t,e=[]){let n=[];function s(i,a){const l=f.createContext(a),c=n.length;n=[...n,a];function u(h){const{scope:p,children:m,...y}=h,_=p?.[t][c]||l,x=f.useMemo(()=>y,Object.values(y));return o.jsx(_.Provider,{value:x,children:m})}function d(h,p){const m=p?.[t][c]||l,y=f.useContext(m);if(y)return y;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const r=()=>{const i=n.map(a=>f.createContext(a));return function(l){const c=l?.[t]||i;return f.useMemo(()=>({[`__scope${t}`]:{...l,[t]:c}}),[l,c])}};return r.scopeName=t,[s,KC(r,...e)]}function KC(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const s=t.map(r=>({useScope:r(),scopeName:r.scopeName}));return function(i){const a=s.reduce((l,{useScope:c,scopeName:u})=>{const h=c(i)[`__scope${u}`];return{...l,...h}},{});return f.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var el="rovingFocusGroup.onEntryFocus",qC={bubbles:!1,cancelable:!0},ia="RovingFocusGroup",[mc,K0,YC]=Ec(ia),[XC,q0]=GC(ia,[YC]),[ZC,JC]=XC(ia),Y0=f.forwardRef((t,e)=>o.jsx(mc.Provider,{scope:t.__scopeRovingFocusGroup,children:o.jsx(mc.Slot,{scope:t.__scopeRovingFocusGroup,children:o.jsx(QC,{...t,ref:e})})}));Y0.displayName=ia;var QC=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,orientation:s,loop:r=!1,dir:i,currentTabStopId:a,defaultCurrentTabStopId:l,onCurrentTabStopIdChange:c,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...h}=t,p=f.useRef(null),m=Ae(e,p),y=H0(i),[_=null,x]=po({prop:a,defaultProp:l,onChange:c}),[b,w]=f.useState(!1),E=vt(u),T=K0(n),j=f.useRef(!1),[P,k]=f.useState(0);return f.useEffect(()=>{const S=p.current;if(S)return S.addEventListener(el,E),()=>S.removeEventListener(el,E)},[E]),o.jsx(ZC,{scope:n,orientation:s,dir:y,loop:r,currentTabStopId:_,onItemFocus:f.useCallback(S=>x(S),[x]),onItemShiftTab:f.useCallback(()=>w(!0),[]),onFocusableItemAdd:f.useCallback(()=>k(S=>S+1),[]),onFocusableItemRemove:f.useCallback(()=>k(S=>S-1),[]),children:o.jsx(de.div,{tabIndex:b||P===0?-1:0,"data-orientation":s,...h,ref:m,style:{outline:"none",...t.style},onMouseDown:W(t.onMouseDown,()=>{j.current=!0}),onFocus:W(t.onFocus,S=>{const D=!j.current;if(S.target===S.currentTarget&&D&&!b){const A=new CustomEvent(el,qC);if(S.currentTarget.dispatchEvent(A),!A.defaultPrevented){const B=T().filter(z=>z.focusable),M=B.find(z=>z.active),K=B.find(z=>z.id===_),q=[M,K,...B].filter(Boolean).map(z=>z.ref.current);J0(q,d)}}j.current=!1}),onBlur:W(t.onBlur,()=>w(!1))})})}),X0="RovingFocusGroupItem",Z0=f.forwardRef((t,e)=>{const{__scopeRovingFocusGroup:n,focusable:s=!0,active:r=!1,tabStopId:i,...a}=t,l=ts(),c=i||l,u=JC(X0,n),d=u.currentTabStopId===c,h=K0(n),{onFocusableItemAdd:p,onFocusableItemRemove:m}=u;return f.useEffect(()=>{if(s)return p(),()=>m()},[s,p,m]),o.jsx(mc.ItemSlot,{scope:n,id:c,focusable:s,active:r,children:o.jsx(de.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...a,ref:e,onMouseDown:W(t.onMouseDown,y=>{s?u.onItemFocus(c):y.preventDefault()}),onFocus:W(t.onFocus,()=>u.onItemFocus(c)),onKeyDown:W(t.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const _=nI(y,u.orientation,u.dir);if(_!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let b=h().filter(w=>w.focusable).map(w=>w.ref.current);if(_==="last")b.reverse();else if(_==="prev"||_==="next"){_==="prev"&&b.reverse();const w=b.indexOf(y.currentTarget);b=u.loop?sI(b,w+1):b.slice(w+1)}setTimeout(()=>J0(b))}})})})});Z0.displayName=X0;var eI={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function tI(t,e){return e!=="rtl"?t:t==="ArrowLeft"?"ArrowRight":t==="ArrowRight"?"ArrowLeft":t}function nI(t,e,n){const s=tI(t.key,n);if(!(e==="vertical"&&["ArrowLeft","ArrowRight"].includes(s))&&!(e==="horizontal"&&["ArrowUp","ArrowDown"].includes(s)))return eI[s]}function J0(t,e=!1){const n=document.activeElement;for(const s of t)if(s===n||(s.focus({preventScroll:e}),document.activeElement!==n))return}function sI(t,e){return t.map((n,s)=>t[(e+s)%t.length])}var rI=Y0,oI=Z0,iI=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},ys=new WeakMap,Uo=new WeakMap,Ho={},tl=0,Q0=function(t){return t&&(t.host||Q0(t.parentNode))},aI=function(t,e){return e.map(function(n){if(t.contains(n))return n;var s=Q0(n);return s&&t.contains(s)?s:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},lI=function(t,e,n,s){var r=aI(e,Array.isArray(t)?t:[t]);Ho[n]||(Ho[n]=new WeakMap);var i=Ho[n],a=[],l=new Set,c=new Set(r),u=function(h){!h||l.has(h)||(l.add(h),u(h.parentNode))};r.forEach(u);var d=function(h){!h||c.has(h)||Array.prototype.forEach.call(h.children,function(p){if(l.has(p))d(p);else try{var m=p.getAttribute(s),y=m!==null&&m!=="false",_=(ys.get(p)||0)+1,x=(i.get(p)||0)+1;ys.set(p,_),i.set(p,x),a.push(p),_===1&&y&&Uo.set(p,!0),x===1&&p.setAttribute(n,"true"),y||p.setAttribute(s,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return d(e),l.clear(),tl++,function(){a.forEach(function(h){var p=ys.get(h)-1,m=i.get(h)-1;ys.set(h,p),i.set(h,m),p||(Uo.has(h)||h.removeAttribute(s),Uo.delete(h)),m||h.removeAttribute(n)}),tl--,tl||(ys=new WeakMap,ys=new WeakMap,Uo=new WeakMap,Ho={})}},e_=function(t,e,n){n===void 0&&(n="data-aria-hidden");var s=Array.from(Array.isArray(t)?t:[t]),r=iI(t);return r?(s.push.apply(s,Array.from(r.querySelectorAll("[aria-live]"))),lI(s,r,n,"aria-hidden")):function(){return null}},Jt=function(){return Jt=Object.assign||function(e){for(var n,s=1,r=arguments.length;s<r;s++){n=arguments[s];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e},Jt.apply(this,arguments)};function t_(t,e){var n={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(n[s]=t[s]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(t);r<s.length;r++)e.indexOf(s[r])<0&&Object.prototype.propertyIsEnumerable.call(t,s[r])&&(n[s[r]]=t[s[r]]);return n}function cI(t,e,n){if(n||arguments.length===2)for(var s=0,r=e.length,i;s<r;s++)(i||!(s in e))&&(i||(i=Array.prototype.slice.call(e,0,s)),i[s]=e[s]);return t.concat(i||Array.prototype.slice.call(e))}var ii="right-scroll-bar-position",ai="width-before-scroll-bar",uI="with-scroll-bars-hidden",dI="--removed-body-scroll-bar-size";function nl(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function hI(t,e){var n=f.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(s){var r=n.value;r!==s&&(n.value=s,n.callback(s,r))}}}})[0];return n.callback=e,n.facade}var pI=typeof window<"u"?f.useLayoutEffect:f.useEffect,mf=new WeakMap;function fI(t,e){var n=hI(null,function(s){return t.forEach(function(r){return nl(r,s)})});return pI(function(){var s=mf.get(n);if(s){var r=new Set(s),i=new Set(t),a=n.current;r.forEach(function(l){i.has(l)||nl(l,null)}),i.forEach(function(l){r.has(l)||nl(l,a)})}mf.set(n,t)},[t]),n}function mI(t){return t}function gI(t,e){e===void 0&&(e=mI);var n=[],s=!1,r={read:function(){if(s)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(i){var a=e(i,s);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(s=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){s=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var c=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return r}function vI(t){t===void 0&&(t={});var e=gI(null);return e.options=Jt({async:!0,ssr:!1},t),e}var n_=function(t){var e=t.sideCar,n=t_(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var s=e.read();if(!s)throw new Error("Sidecar medium not found");return f.createElement(s,Jt({},n))};n_.isSideCarExport=!0;function _I(t,e){return t.useMedium(e),n_}var s_=vI(),sl=function(){},aa=f.forwardRef(function(t,e){var n=f.useRef(null),s=f.useState({onScrollCapture:sl,onWheelCapture:sl,onTouchMoveCapture:sl}),r=s[0],i=s[1],a=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,h=t.shards,p=t.sideCar,m=t.noIsolation,y=t.inert,_=t.allowPinchZoom,x=t.as,b=x===void 0?"div":x,w=t.gapMode,E=t_(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=p,j=fI([n,e]),P=Jt(Jt({},E),r);return f.createElement(f.Fragment,null,d&&f.createElement(T,{sideCar:s_,removeScrollBar:u,shards:h,noIsolation:m,inert:y,setCallbacks:i,allowPinchZoom:!!_,lockRef:n,gapMode:w}),a?f.cloneElement(f.Children.only(l),Jt(Jt({},P),{ref:j})):f.createElement(b,Jt({},P,{className:c,ref:j}),l))});aa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};aa.classNames={fullWidth:ai,zeroRight:ii};var yI=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function xI(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=yI();return e&&t.setAttribute("nonce",e),t}function bI(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function wI(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var EI=function(){var t=0,e=null;return{add:function(n){t==0&&(e=xI())&&(bI(e,n),wI(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},jI=function(){var t=EI();return function(e,n){f.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},r_=function(){var t=jI(),e=function(n){var s=n.styles,r=n.dynamic;return t(s,r),null};return e},TI={left:0,top:0,right:0,gap:0},rl=function(t){return parseInt(t||"",10)||0},PI=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],s=e[t==="padding"?"paddingTop":"marginTop"],r=e[t==="padding"?"paddingRight":"marginRight"];return[rl(n),rl(s),rl(r)]},kI=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return TI;var e=PI(t),n=document.documentElement.clientWidth,s=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,s-n+e[2]-e[0])}},SI=r_(),Ns="data-scroll-locked",RI=function(t,e,n,s){var r=t.left,i=t.top,a=t.right,l=t.gap;return n===void 0&&(n="margin"),`
.`.concat(uI,` {
overflow: hidden `).concat(s,`;
padding-right: `).concat(l,"px ").concat(s,`;
}
body[`).concat(Ns,`] {
overflow: hidden `).concat(s,`;
overscroll-behavior: contain;
`).concat([e&&"position: relative ".concat(s,";"),n==="margin"&&`
padding-left: `.concat(r,`px;
padding-top: `).concat(i,`px;
padding-right: `).concat(a,`px;
margin-left:0;
margin-top:0;
margin-right: `).concat(l,"px ").concat(s,`;
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(s,";")].filter(Boolean).join(""),`
}
.`).concat(ii,` {
right: `).concat(l,"px ").concat(s,`;
}
.`).concat(ai,` {
margin-right: `).concat(l,"px ").concat(s,`;
}
.`).concat(ii," .").concat(ii,` {
right: 0 `).concat(s,`;
}
.`).concat(ai," .").concat(ai,` {
margin-right: 0 `).concat(s,`;
}
body[`).concat(Ns,`] {
`).concat(dI,": ").concat(l,`px;
}
`)},gf=function(){var t=parseInt(document.body.getAttribute(Ns)||"0",10);return isFinite(t)?t:0},AI=function(){f.useEffect(function(){return document.body.setAttribute(Ns,(gf()+1).toString()),function(){var t=gf()-1;t<=0?document.body.removeAttribute(Ns):document.body.setAttribute(Ns,t.toString())}},[])},CI=function(t){var e=t.noRelative,n=t.noImportant,s=t.gapMode,r=s===void 0?"margin":s;AI();var i=f.useMemo(function(){return kI(r)},[r]);return f.createElement(SI,{styles:RI(i,!e,r,n?"":"!important")})},gc=!1;if(typeof window<"u")try{var Wo=Object.defineProperty({},"passive",{get:function(){return gc=!0,!0}});window.addEventListener("test",Wo,Wo),window.removeEventListener("test",Wo,Wo)}catch{gc=!1}var xs=gc?{passive:!1}:!1,II=function(t){return t.tagName==="TEXTAREA"},o_=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!II(t)&&n[e]==="visible")},OI=function(t){return o_(t,"overflowY")},DI=function(t){return o_(t,"overflowX")},vf=function(t,e){var n=e.ownerDocument,s=e;do{typeof ShadowRoot<"u"&&s instanceof ShadowRoot&&(s=s.host);var r=i_(t,s);if(r){var i=a_(t,s),a=i[1],l=i[2];if(a>l)return!0}s=s.parentNode}while(s&&s!==n.body);return!1},LI=function(t){var e=t.scrollTop,n=t.scrollHeight,s=t.clientHeight;return[e,n,s]},MI=function(t){var e=t.scrollLeft,n=t.scrollWidth,s=t.clientWidth;return[e,n,s]},i_=function(t,e){return t==="v"?OI(e):DI(e)},a_=function(t,e){return t==="v"?LI(e):MI(e)},NI=function(t,e){return t==="h"&&e==="rtl"?-1:1},VI=function(t,e,n,s,r){var i=NI(t,window.getComputedStyle(e).direction),a=i*s,l=n.target,c=e.contains(l),u=!1,d=a>0,h=0,p=0;do{var m=a_(t,l),y=m[0],_=m[1],x=m[2],b=_-x-i*y;(y||b)&&i_(t,l)&&(h+=b,p+=y),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(e.contains(l)||e===l));return(d&&(Math.abs(h)<1||!r)||!d&&(Math.abs(p)<1||!r))&&(u=!0),u},Go=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},_f=function(t){return[t.deltaX,t.deltaY]},yf=function(t){return t&&"current"in t?t.current:t},FI=function(t,e){return t[0]===e[0]&&t[1]===e[1]},$I=function(t){return`
.block-interactivity-`.concat(t,` {pointer-events: none;}
.allow-interactivity-`).concat(t,` {pointer-events: all;}
`)},BI=0,bs=[];function zI(t){var e=f.useRef([]),n=f.useRef([0,0]),s=f.useRef(),r=f.useState(BI++)[0],i=f.useState(r_)[0],a=f.useRef(t);f.useEffect(function(){a.current=t},[t]),f.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(r));var _=cI([t.lockRef.current],(t.shards||[]).map(yf),!0).filter(Boolean);return _.forEach(function(x){return x.classList.add("allow-interactivity-".concat(r))}),function(){document.body.classList.remove("block-interactivity-".concat(r)),_.forEach(function(x){return x.classList.remove("allow-interactivity-".concat(r))})}}},[t.inert,t.lockRef.current,t.shards]);var l=f.useCallback(function(_,x){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!a.current.allowPinchZoom;var b=Go(_),w=n.current,E="deltaX"in _?_.deltaX:w[0]-b[0],T="deltaY"in _?_.deltaY:w[1]-b[1],j,P=_.target,k=Math.abs(E)>Math.abs(T)?"h":"v";if("touches"in _&&k==="h"&&P.type==="range")return!1;var S=vf(k,P);if(!S)return!0;if(S?j=k:(j=k==="v"?"h":"v",S=vf(k,P)),!S)return!1;if(!s.current&&"changedTouches"in _&&(E||T)&&(s.current=j),!j)return!0;var D=s.current||j;return VI(D,x,_,D==="h"?E:T,!0)},[]),c=f.useCallback(function(_){var x=_;if(!(!bs.length||bs[bs.length-1]!==i)){var b="deltaY"in x?_f(x):Go(x),w=e.current.filter(function(j){return j.name===x.type&&(j.target===x.target||x.target===j.shadowParent)&&FI(j.delta,b)})[0];if(w&&w.should){x.cancelable&&x.preventDefault();return}if(!w){var E=(a.current.shards||[]).map(yf).filter(Boolean).filter(function(j){return j.contains(x.target)}),T=E.length>0?l(x,E[0]):!a.current.noIsolation;T&&x.cancelable&&x.preventDefault()}}},[]),u=f.useCallback(function(_,x,b,w){var E={name:_,delta:x,target:b,should:w,shadowParent:UI(b)};e.current.push(E),setTimeout(function(){e.current=e.current.filter(function(T){return T!==E})},1)},[]),d=f.useCallback(function(_){n.current=Go(_),s.current=void 0},[]),h=f.useCallback(function(_){u(_.type,_f(_),_.target,l(_,t.lockRef.current))},[]),p=f.useCallback(function(_){u(_.type,Go(_),_.target,l(_,t.lockRef.current))},[]);f.useEffect(function(){return bs.push(i),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",c,xs),document.addEventListener("touchmove",c,xs),document.addEventListener("touchstart",d,xs),function(){bs=bs.filter(function(_){return _!==i}),document.removeEventListener("wheel",c,xs),document.removeEventListener("touchmove",c,xs),document.removeEventListener("touchstart",d,xs)}},[]);var m=t.removeScrollBar,y=t.inert;return f.createElement(f.Fragment,null,y?f.createElement(i,{styles:$I(r)}):null,m?f.createElement(CI,{gapMode:t.gapMode}):null)}function UI(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const HI=_I(s_,zI);var Lu=f.forwardRef(function(t,e){return f.createElement(aa,Jt({},t,{ref:e,sideCar:HI}))});Lu.classNames=aa.classNames;var vc=["Enter"," "],WI=["ArrowDown","PageUp","Home"],l_=["ArrowUp","PageDown","End"],GI=[...WI,...l_],KI={ltr:[...vc,"ArrowRight"],rtl:[...vc,"ArrowLeft"]},qI={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Eo="Menu",[io,YI,XI]=Ec(Eo),[ds,c_]=Xs(Eo,[XI,Ki,q0]),la=Ki(),u_=q0(),[ZI,hs]=ds(Eo),[JI,jo]=ds(Eo),d_=t=>{const{__scopeMenu:e,open:n=!1,children:s,dir:r,onOpenChange:i,modal:a=!0}=t,l=la(e),[c,u]=f.useState(null),d=f.useRef(!1),h=vt(i),p=H0(r);return f.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),o.jsx(Dm,{...l,children:o.jsx(ZI,{scope:e,open:n,onOpenChange:h,content:c,onContentChange:u,children:o.jsx(JI,{scope:e,onClose:f.useCallback(()=>h(!1),[h]),isUsingKeyboardRef:d,dir:p,modal:a,children:s})})})};d_.displayName=Eo;var QI="MenuAnchor",Mu=f.forwardRef((t,e)=>{const{__scopeMenu:n,...s}=t,r=la(n);return o.jsx(Lm,{...r,...s,ref:e})});Mu.displayName=QI;var Nu="MenuPortal",[eO,h_]=ds(Nu,{forceMount:void 0}),p_=t=>{const{__scopeMenu:e,forceMount:n,children:s,container:r}=t,i=hs(Nu,e);return o.jsx(eO,{scope:e,forceMount:n,children:o.jsx(Ut,{present:n||i.open,children:o.jsx(ho,{asChild:!0,container:r,children:s})})})};p_.displayName=Nu;var Mt="MenuContent",[tO,Vu]=ds(Mt),f_=f.forwardRef((t,e)=>{const n=h_(Mt,t.__scopeMenu),{forceMount:s=n.forceMount,...r}=t,i=hs(Mt,t.__scopeMenu),a=jo(Mt,t.__scopeMenu);return o.jsx(io.Provider,{scope:t.__scopeMenu,children:o.jsx(Ut,{present:s||i.open,children:o.jsx(io.Slot,{scope:t.__scopeMenu,children:a.modal?o.jsx(nO,{...r,ref:e}):o.jsx(sO,{...r,ref:e})})})})}),nO=f.forwardRef((t,e)=>{const n=hs(Mt,t.__scopeMenu),s=f.useRef(null),r=Ae(e,s);return f.useEffect(()=>{const i=s.current;if(i)return e_(i)},[]),o.jsx(Fu,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:W(t.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),sO=f.forwardRef((t,e)=>{const n=hs(Mt,t.__scopeMenu);return o.jsx(Fu,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Fu=f.forwardRef((t,e)=>{const{__scopeMenu:n,loop:s=!1,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,disableOutsidePointerEvents:l,onEntryFocus:c,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:m,disableOutsideScroll:y,..._}=t,x=hs(Mt,n),b=jo(Mt,n),w=la(n),E=u_(n),T=YI(n),[j,P]=f.useState(null),k=f.useRef(null),S=Ae(e,k,x.onContentChange),D=f.useRef(0),A=f.useRef(""),B=f.useRef(0),M=f.useRef(null),K=f.useRef("right"),O=f.useRef(0),q=y?Lu:f.Fragment,z=y?{as:rs,allowPinchZoom:!0}:void 0,U=I=>{const ee=A.current+I,H=T().filter(_e=>!_e.disabled),Y=document.activeElement,Z=H.find(_e=>_e.ref.current===Y)?.textValue,oe=H.map(_e=>_e.textValue),De=mO(oe,ee,Z),ne=H.find(_e=>_e.textValue===De)?.ref.current;(function _e(jt){A.current=jt,window.clearTimeout(D.current),jt!==""&&(D.current=window.setTimeout(()=>_e(""),1e3))})(ee),ne&&setTimeout(()=>ne.focus())};f.useEffect(()=>()=>window.clearTimeout(D.current),[]),W0();const C=f.useCallback(I=>K.current===M.current?.side&&vO(I,M.current?.area),[]);return o.jsx(tO,{scope:n,searchRef:A,onItemEnter:f.useCallback(I=>{C(I)&&I.preventDefault()},[C]),onItemLeave:f.useCallback(I=>{C(I)||(k.current?.focus(),P(null))},[C]),onTriggerLeave:f.useCallback(I=>{C(I)&&I.preventDefault()},[C]),pointerGraceTimerRef:B,onPointerGraceIntentChange:f.useCallback(I=>{M.current=I},[]),children:o.jsx(q,{...z,children:o.jsx(Du,{asChild:!0,trapped:r,onMountAutoFocus:W(i,I=>{I.preventDefault(),k.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:a,children:o.jsx(uo,{asChild:!0,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,onDismiss:m,children:o.jsx(rI,{asChild:!0,...E,dir:b.dir,orientation:"vertical",loop:s,currentTabStopId:j,onCurrentTabStopIdChange:P,onEntryFocus:W(c,I=>{b.isUsingKeyboardRef.current||I.preventDefault()}),preventScrollOnEntryFocus:!0,children:o.jsx(Mm,{role:"menu","aria-orientation":"vertical","data-state":A_(x.open),"data-radix-menu-content":"",dir:b.dir,...w,..._,ref:S,style:{outline:"none",..._.style},onKeyDown:W(_.onKeyDown,I=>{const H=I.target.closest("[data-radix-menu-content]")===I.currentTarget,Y=I.ctrlKey||I.altKey||I.metaKey,Z=I.key.length===1;H&&(I.key==="Tab"&&I.preventDefault(),!Y&&Z&&U(I.key));const oe=k.current;if(I.target!==oe||!GI.includes(I.key))return;I.preventDefault();const ne=T().filter(_e=>!_e.disabled).map(_e=>_e.ref.current);l_.includes(I.key)&&ne.reverse(),pO(ne)}),onBlur:W(t.onBlur,I=>{I.currentTarget.contains(I.target)||(window.clearTimeout(D.current),A.current="")}),onPointerMove:W(t.onPointerMove,ao(I=>{const ee=I.target,H=O.current!==I.clientX;if(I.currentTarget.contains(ee)&&H){const Y=I.clientX>O.current?"right":"left";K.current=Y,O.current=I.clientX}}))})})})})})})});f_.displayName=Mt;var rO="MenuGroup",$u=f.forwardRef((t,e)=>{const{__scopeMenu:n,...s}=t;return o.jsx(de.div,{role:"group",...s,ref:e})});$u.displayName=rO;var oO="MenuLabel",m_=f.forwardRef((t,e)=>{const{__scopeMenu:n,...s}=t;return o.jsx(de.div,{...s,ref:e})});m_.displayName=oO;var Li="MenuItem",xf="menu.itemSelect",ca=f.forwardRef((t,e)=>{const{disabled:n=!1,onSelect:s,...r}=t,i=f.useRef(null),a=jo(Li,t.__scopeMenu),l=Vu(Li,t.__scopeMenu),c=Ae(e,i),u=f.useRef(!1),d=()=>{const h=i.current;if(!n&&h){const p=new CustomEvent(xf,{bubbles:!0,cancelable:!0});h.addEventListener(xf,m=>s?.(m),{once:!0}),jc(h,p),p.defaultPrevented?u.current=!1:a.onClose()}};return o.jsx(g_,{...r,ref:c,disabled:n,onClick:W(t.onClick,d),onPointerDown:h=>{t.onPointerDown?.(h),u.current=!0},onPointerUp:W(t.onPointerUp,h=>{u.current||h.currentTarget?.click()}),onKeyDown:W(t.onKeyDown,h=>{const p=l.searchRef.current!=="";n||p&&h.key===" "||vc.includes(h.key)&&(h.currentTarget.click(),h.preventDefault())})})});ca.displayName=Li;var g_=f.forwardRef((t,e)=>{const{__scopeMenu:n,disabled:s=!1,textValue:r,...i}=t,a=Vu(Li,n),l=u_(n),c=f.useRef(null),u=Ae(e,c),[d,h]=f.useState(!1),[p,m]=f.useState("");return f.useEffect(()=>{const y=c.current;y&&m((y.textContent??"").trim())},[i.children]),o.jsx(io.ItemSlot,{scope:n,disabled:s,textValue:r??p,children:o.jsx(oI,{asChild:!0,...l,focusable:!s,children:o.jsx(de.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":s||void 0,"data-disabled":s?"":void 0,...i,ref:u,onPointerMove:W(t.onPointerMove,ao(y=>{s?a.onItemLeave(y):(a.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:W(t.onPointerLeave,ao(y=>a.onItemLeave(y))),onFocus:W(t.onFocus,()=>h(!0)),onBlur:W(t.onBlur,()=>h(!1))})})})}),iO="MenuCheckboxItem",v_=f.forwardRef((t,e)=>{const{checked:n=!1,onCheckedChange:s,...r}=t;return o.jsx(w_,{scope:t.__scopeMenu,checked:n,children:o.jsx(ca,{role:"menuitemcheckbox","aria-checked":Mi(n)?"mixed":n,...r,ref:e,"data-state":zu(n),onSelect:W(r.onSelect,()=>s?.(Mi(n)?!0:!n),{checkForDefaultPrevented:!1})})})});v_.displayName=iO;var __="MenuRadioGroup",[aO,lO]=ds(__,{value:void 0,onValueChange:()=>{}}),y_=f.forwardRef((t,e)=>{const{value:n,onValueChange:s,...r}=t,i=vt(s);return o.jsx(aO,{scope:t.__scopeMenu,value:n,onValueChange:i,children:o.jsx($u,{...r,ref:e})})});y_.displayName=__;var x_="MenuRadioItem",b_=f.forwardRef((t,e)=>{const{value:n,...s}=t,r=lO(x_,t.__scopeMenu),i=n===r.value;return o.jsx(w_,{scope:t.__scopeMenu,checked:i,children:o.jsx(ca,{role:"menuitemradio","aria-checked":i,...s,ref:e,"data-state":zu(i),onSelect:W(s.onSelect,()=>r.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});b_.displayName=x_;var Bu="MenuItemIndicator",[w_,cO]=ds(Bu,{checked:!1}),E_=f.forwardRef((t,e)=>{const{__scopeMenu:n,forceMount:s,...r}=t,i=cO(Bu,n);return o.jsx(Ut,{present:s||Mi(i.checked)||i.checked===!0,children:o.jsx(de.span,{...r,ref:e,"data-state":zu(i.checked)})})});E_.displayName=Bu;var uO="MenuSeparator",j_=f.forwardRef((t,e)=>{const{__scopeMenu:n,...s}=t;return o.jsx(de.div,{role:"separator","aria-orientation":"horizontal",...s,ref:e})});j_.displayName=uO;var dO="MenuArrow",T_=f.forwardRef((t,e)=>{const{__scopeMenu:n,...s}=t,r=la(n);return o.jsx(Nm,{...r,...s,ref:e})});T_.displayName=dO;var hO="MenuSub",[SL,P_]=ds(hO),Rr="MenuSubTrigger",k_=f.forwardRef((t,e)=>{const n=hs(Rr,t.__scopeMenu),s=jo(Rr,t.__scopeMenu),r=P_(Rr,t.__scopeMenu),i=Vu(Rr,t.__scopeMenu),a=f.useRef(null),{pointerGraceTimerRef:l,onPointerGraceIntentChange:c}=i,u={__scopeMenu:t.__scopeMenu},d=f.useCallback(()=>{a.current&&window.clearTimeout(a.current),a.current=null},[]);return f.useEffect(()=>d,[d]),f.useEffect(()=>{const h=l.current;return()=>{window.clearTimeout(h),c(null)}},[l,c]),o.jsx(Mu,{asChild:!0,...u,children:o.jsx(g_,{id:r.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":r.contentId,"data-state":A_(n.open),...t,ref:Fi(e,r.onTriggerChange),onClick:h=>{t.onClick?.(h),!(t.disabled||h.defaultPrevented)&&(h.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:W(t.onPointerMove,ao(h=>{i.onItemEnter(h),!h.defaultPrevented&&!t.disabled&&!n.open&&!a.current&&(i.onPointerGraceIntentChange(null),a.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:W(t.onPointerLeave,ao(h=>{d();const p=n.content?.getBoundingClientRect();if(p){const m=n.content?.dataset.side,y=m==="right",_=y?-5:5,x=p[y?"left":"right"],b=p[y?"right":"left"];i.onPointerGraceIntentChange({area:[{x:h.clientX+_,y:h.clientY},{x,y:p.top},{x:b,y:p.top},{x:b,y:p.bottom},{x,y:p.bottom}],side:m}),window.clearTimeout(l.current),l.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(h),h.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:W(t.onKeyDown,h=>{const p=i.searchRef.current!=="";t.disabled||p&&h.key===" "||KI[s.dir].includes(h.key)&&(n.onOpenChange(!0),n.content?.focus(),h.preventDefault())})})})});k_.displayName=Rr;var S_="MenuSubContent",R_=f.forwardRef((t,e)=>{const n=h_(Mt,t.__scopeMenu),{forceMount:s=n.forceMount,...r}=t,i=hs(Mt,t.__scopeMenu),a=jo(Mt,t.__scopeMenu),l=P_(S_,t.__scopeMenu),c=f.useRef(null),u=Ae(e,c);return o.jsx(io.Provider,{scope:t.__scopeMenu,children:o.jsx(Ut,{present:s||i.open,children:o.jsx(io.Slot,{scope:t.__scopeMenu,children:o.jsx(Fu,{id:l.contentId,"aria-labelledby":l.triggerId,...r,ref:u,align:"start",side:a.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{a.isUsingKeyboardRef.current&&c.current?.focus(),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:W(t.onFocusOutside,d=>{d.target!==l.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:W(t.onEscapeKeyDown,d=>{a.onClose(),d.preventDefault()}),onKeyDown:W(t.onKeyDown,d=>{const h=d.currentTarget.contains(d.target),p=qI[a.dir].includes(d.key);h&&p&&(i.onOpenChange(!1),l.trigger?.focus(),d.preventDefault())})})})})})});R_.displayName=S_;function A_(t){return t?"open":"closed"}function Mi(t){return t==="indeterminate"}function zu(t){return Mi(t)?"indeterminate":t?"checked":"unchecked"}function pO(t){const e=document.activeElement;for(const n of t)if(n===e||(n.focus(),document.activeElement!==e))return}function fO(t,e){return t.map((n,s)=>t[(e+s)%t.length])}function mO(t,e,n){const r=e.length>1&&Array.from(e).every(u=>u===e[0])?e[0]:e,i=n?t.indexOf(n):-1;let a=fO(t,Math.max(i,0));r.length===1&&(a=a.filter(u=>u!==n));const c=a.find(u=>u.toLowerCase().startsWith(r.toLowerCase()));return c!==n?c:void 0}function gO(t,e){const{x:n,y:s}=t;let r=!1;for(let i=0,a=e.length-1;i<e.length;a=i++){const l=e[i].x,c=e[i].y,u=e[a].x,d=e[a].y;c>s!=d>s&&n<(u-l)*(s-c)/(d-c)+l&&(r=!r)}return r}function vO(t,e){if(!e)return!1;const n={x:t.clientX,y:t.clientY};return gO(n,e)}function ao(t){return e=>e.pointerType==="mouse"?t(e):void 0}var _O=d_,yO=Mu,xO=p_,bO=f_,wO=$u,EO=m_,jO=ca,TO=v_,PO=y_,kO=b_,SO=E_,RO=j_,AO=T_,CO=k_,IO=R_,Uu="DropdownMenu",[OO,RL]=Xs(Uu,[c_]),xt=c_(),[DO,C_]=OO(Uu),I_=t=>{const{__scopeDropdownMenu:e,children:n,dir:s,open:r,defaultOpen:i,onOpenChange:a,modal:l=!0}=t,c=xt(e),u=f.useRef(null),[d=!1,h]=po({prop:r,defaultProp:i,onChange:a});return o.jsx(DO,{scope:e,triggerId:ts(),triggerRef:u,contentId:ts(),open:d,onOpenChange:h,onOpenToggle:f.useCallback(()=>h(p=>!p),[h]),modal:l,children:o.jsx(_O,{...c,open:d,onOpenChange:h,dir:s,modal:l,children:n})})};I_.displayName=Uu;var O_="DropdownMenuTrigger",D_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,disabled:s=!1,...r}=t,i=C_(O_,n),a=xt(n);return o.jsx(yO,{asChild:!0,...a,children:o.jsx(de.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":s?"":void 0,disabled:s,...r,ref:Fi(e,i.triggerRef),onPointerDown:W(t.onPointerDown,l=>{!s&&l.button===0&&l.ctrlKey===!1&&(i.onOpenToggle(),i.open||l.preventDefault())}),onKeyDown:W(t.onKeyDown,l=>{s||(["Enter"," "].includes(l.key)&&i.onOpenToggle(),l.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(l.key)&&l.preventDefault())})})})});D_.displayName=O_;var LO="DropdownMenuPortal",L_=t=>{const{__scopeDropdownMenu:e,...n}=t,s=xt(e);return o.jsx(xO,{...s,...n})};L_.displayName=LO;var M_="DropdownMenuContent",N_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=C_(M_,n),i=xt(n),a=f.useRef(!1);return o.jsx(bO,{id:r.contentId,"aria-labelledby":r.triggerId,...i,...s,ref:e,onCloseAutoFocus:W(t.onCloseAutoFocus,l=>{a.current||r.triggerRef.current?.focus(),a.current=!1,l.preventDefault()}),onInteractOutside:W(t.onInteractOutside,l=>{const c=l.detail.originalEvent,u=c.button===0&&c.ctrlKey===!0,d=c.button===2||u;(!r.modal||d)&&(a.current=!0)}),style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});N_.displayName=M_;var MO="DropdownMenuGroup",NO=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(wO,{...r,...s,ref:e})});NO.displayName=MO;var VO="DropdownMenuLabel",V_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(EO,{...r,...s,ref:e})});V_.displayName=VO;var FO="DropdownMenuItem",F_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(jO,{...r,...s,ref:e})});F_.displayName=FO;var $O="DropdownMenuCheckboxItem",$_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(TO,{...r,...s,ref:e})});$_.displayName=$O;var BO="DropdownMenuRadioGroup",zO=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(PO,{...r,...s,ref:e})});zO.displayName=BO;var UO="DropdownMenuRadioItem",B_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(kO,{...r,...s,ref:e})});B_.displayName=UO;var HO="DropdownMenuItemIndicator",z_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(SO,{...r,...s,ref:e})});z_.displayName=HO;var WO="DropdownMenuSeparator",U_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(RO,{...r,...s,ref:e})});U_.displayName=WO;var GO="DropdownMenuArrow",KO=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(AO,{...r,...s,ref:e})});KO.displayName=GO;var qO="DropdownMenuSubTrigger",H_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(CO,{...r,...s,ref:e})});H_.displayName=qO;var YO="DropdownMenuSubContent",W_=f.forwardRef((t,e)=>{const{__scopeDropdownMenu:n,...s}=t,r=xt(n);return o.jsx(IO,{...r,...s,ref:e,style:{...t.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});W_.displayName=YO;var XO=I_,ZO=D_,JO=L_,G_=N_,K_=V_,q_=F_,Y_=$_,X_=B_,Z_=z_,J_=U_,Q_=H_,ey=W_;const ty=XO,ny=ZO,QO=f.forwardRef(({className:t,inset:e,children:n,...s},r)=>o.jsxs(Q_,{ref:r,className:ve("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground",e&&"pl-8",t),...s,children:[n,o.jsx(cb,{className:"ml-auto h-4 w-4"})]}));QO.displayName=Q_.displayName;const eD=f.forwardRef(({className:t,...e},n)=>o.jsx(ey,{ref:n,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...e}));eD.displayName=ey.displayName;const Hu=f.forwardRef(({className:t,sideOffset:e=4,...n},s)=>o.jsx(JO,{children:o.jsx(G_,{ref:s,sideOffset:e,className:ve("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n})}));Hu.displayName=G_.displayName;const Mn=f.forwardRef(({className:t,inset:e,...n},s)=>o.jsx(q_,{ref:s,className:ve("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e&&"pl-8",t),...n}));Mn.displayName=q_.displayName;const tD=f.forwardRef(({className:t,children:e,checked:n,...s},r)=>o.jsxs(Y_,{ref:r,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),checked:n,...s,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Z_,{children:o.jsx(ab,{className:"h-4 w-4"})})}),e]}));tD.displayName=Y_.displayName;const nD=f.forwardRef(({className:t,children:e,...n},s)=>o.jsxs(X_,{ref:s,className:ve("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",t),...n,children:[o.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Z_,{children:o.jsx(db,{className:"h-2 w-2 fill-current"})})}),e]}));nD.displayName=X_.displayName;const sD=f.forwardRef(({className:t,inset:e,...n},s)=>o.jsx(K_,{ref:s,className:ve("px-2 py-1.5 text-sm font-semibold",e&&"pl-8",t),...n}));sD.displayName=K_.displayName;const Ar=f.forwardRef(({className:t,...e},n)=>o.jsx(J_,{ref:n,className:ve("-mx-1 my-1 h-px bg-muted",t),...e}));Ar.displayName=J_.displayName;var Wu="Dialog",[sy,AL]=Xs(Wu),[rD,Wt]=sy(Wu),ry=t=>{const{__scopeDialog:e,children:n,open:s,defaultOpen:r,onOpenChange:i,modal:a=!0}=t,l=f.useRef(null),c=f.useRef(null),[u=!1,d]=po({prop:s,defaultProp:r,onChange:i});return o.jsx(rD,{scope:e,triggerRef:l,contentRef:c,contentId:ts(),titleId:ts(),descriptionId:ts(),open:u,onOpenChange:d,onOpenToggle:f.useCallback(()=>d(h=>!h),[d]),modal:a,children:n})};ry.displayName=Wu;var oy="DialogTrigger",iy=f.forwardRef((t,e)=>{const{__scopeDialog:n,...s}=t,r=Wt(oy,n),i=Ae(e,r.triggerRef);return o.jsx(de.button,{type:"button","aria-haspopup":"dialog","aria-expanded":r.open,"aria-controls":r.contentId,"data-state":qu(r.open),...s,ref:i,onClick:W(t.onClick,r.onOpenToggle)})});iy.displayName=oy;var Gu="DialogPortal",[oD,ay]=sy(Gu,{forceMount:void 0}),ly=t=>{const{__scopeDialog:e,forceMount:n,children:s,container:r}=t,i=Wt(Gu,e);return o.jsx(oD,{scope:e,forceMount:n,children:f.Children.map(s,a=>o.jsx(Ut,{present:n||i.open,children:o.jsx(ho,{asChild:!0,container:r,children:a})}))})};ly.displayName=Gu;var Ni="DialogOverlay",cy=f.forwardRef((t,e)=>{const n=ay(Ni,t.__scopeDialog),{forceMount:s=n.forceMount,...r}=t,i=Wt(Ni,t.__scopeDialog);return i.modal?o.jsx(Ut,{present:s||i.open,children:o.jsx(iD,{...r,ref:e})}):null});cy.displayName=Ni;var iD=f.forwardRef((t,e)=>{const{__scopeDialog:n,...s}=t,r=Wt(Ni,n);return o.jsx(Lu,{as:rs,allowPinchZoom:!0,shards:[r.contentRef],children:o.jsx(de.div,{"data-state":qu(r.open),...s,ref:e,style:{pointerEvents:"auto",...s.style}})})}),cs="DialogContent",uy=f.forwardRef((t,e)=>{const n=ay(cs,t.__scopeDialog),{forceMount:s=n.forceMount,...r}=t,i=Wt(cs,t.__scopeDialog);return o.jsx(Ut,{present:s||i.open,children:i.modal?o.jsx(aD,{...r,ref:e}):o.jsx(lD,{...r,ref:e})})});uy.displayName=cs;var aD=f.forwardRef((t,e)=>{const n=Wt(cs,t.__scopeDialog),s=f.useRef(null),r=Ae(e,n.contentRef,s);return f.useEffect(()=>{const i=s.current;if(i)return e_(i)},[]),o.jsx(dy,{...t,ref:r,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:W(t.onCloseAutoFocus,i=>{i.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:W(t.onPointerDownOutside,i=>{const a=i.detail.originalEvent,l=a.button===0&&a.ctrlKey===!0;(a.button===2||l)&&i.preventDefault()}),onFocusOutside:W(t.onFocusOutside,i=>i.preventDefault())})}),lD=f.forwardRef((t,e)=>{const n=Wt(cs,t.__scopeDialog),s=f.useRef(!1),r=f.useRef(!1);return o.jsx(dy,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{t.onCloseAutoFocus?.(i),i.defaultPrevented||(s.current||n.triggerRef.current?.focus(),i.preventDefault()),s.current=!1,r.current=!1},onInteractOutside:i=>{t.onInteractOutside?.(i),i.defaultPrevented||(s.current=!0,i.detail.originalEvent.type==="pointerdown"&&(r.current=!0));const a=i.target;n.triggerRef.current?.contains(a)&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&r.current&&i.preventDefault()}})}),dy=f.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:s,onOpenAutoFocus:r,onCloseAutoFocus:i,...a}=t,l=Wt(cs,n),c=f.useRef(null),u=Ae(e,c);return W0(),o.jsxs(o.Fragment,{children:[o.jsx(Du,{asChild:!0,loop:!0,trapped:s,onMountAutoFocus:r,onUnmountAutoFocus:i,children:o.jsx(uo,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":qu(l.open),...a,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),o.jsxs(o.Fragment,{children:[o.jsx(cD,{titleId:l.titleId}),o.jsx(dD,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Ku="DialogTitle",hy=f.forwardRef((t,e)=>{const{__scopeDialog:n,...s}=t,r=Wt(Ku,n);return o.jsx(de.h2,{id:r.titleId,...s,ref:e})});hy.displayName=Ku;var py="DialogDescription",fy=f.forwardRef((t,e)=>{const{__scopeDialog:n,...s}=t,r=Wt(py,n);return o.jsx(de.p,{id:r.descriptionId,...s,ref:e})});fy.displayName=py;var my="DialogClose",gy=f.forwardRef((t,e)=>{const{__scopeDialog:n,...s}=t,r=Wt(my,n);return o.jsx(de.button,{type:"button",...s,ref:e,onClick:W(t.onClick,()=>r.onOpenChange(!1))})});gy.displayName=my;function qu(t){return t?"open":"closed"}var vy="DialogTitleWarning",[CL,_y]=dx(vy,{contentName:cs,titleName:Ku,docsSlug:"dialog"}),cD=({titleId:t})=>{const e=_y(vy),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return f.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},uD="DialogDescriptionWarning",dD=({contentRef:t,descriptionId:e})=>{const s=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${_y(uD).contentName}}.`;return f.useEffect(()=>{const r=t.current?.getAttribute("aria-describedby");e&&r&&(document.getElementById(e)||console.warn(s))},[s,t,e]),null},hD=ry,pD=iy,fD=ly,yy=cy,xy=uy,by=hy,wy=fy,mD=gy;const gD=hD,vD=pD,_D=fD,Ey=f.forwardRef(({className:t,...e},n)=>o.jsx(yy,{className:ve("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...e,ref:n}));Ey.displayName=yy.displayName;const yD=Ui("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:duration-300 data-[state=open]:duration-500",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),jy=f.forwardRef(({side:t="right",className:e,children:n,...s},r)=>o.jsxs(_D,{children:[o.jsx(Ey,{}),o.jsxs(xy,{ref:r,className:ve(yD({side:t}),e),...s,children:[n,o.jsxs(mD,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[o.jsx(om,{className:"h-4 w-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));jy.displayName=xy.displayName;const xD=f.forwardRef(({className:t,...e},n)=>o.jsx(by,{ref:n,className:ve("text-lg font-semibold text-foreground",t),...e}));xD.displayName=by.displayName;const bD=f.forwardRef(({className:t,...e},n)=>o.jsx(wy,{ref:n,className:ve("text-sm text-muted-foreground",t),...e}));bD.displayName=wy.displayName;var Yu="Avatar",[wD,IL]=Xs(Yu),[ED,Ty]=wD(Yu),Py=f.forwardRef((t,e)=>{const{__scopeAvatar:n,...s}=t,[r,i]=f.useState("idle");return o.jsx(ED,{scope:n,imageLoadingStatus:r,onImageLoadingStatusChange:i,children:o.jsx(de.span,{...s,ref:e})})});Py.displayName=Yu;var ky="AvatarImage",Sy=f.forwardRef((t,e)=>{const{__scopeAvatar:n,src:s,onLoadingStatusChange:r=()=>{},...i}=t,a=Ty(ky,n),l=jD(s,i.referrerPolicy),c=vt(u=>{r(u),a.onImageLoadingStatusChange(u)});return ln(()=>{l!=="idle"&&c(l)},[l,c]),l==="loaded"?o.jsx(de.img,{...i,ref:e,src:s}):null});Sy.displayName=ky;var Ry="AvatarFallback",Ay=f.forwardRef((t,e)=>{const{__scopeAvatar:n,delayMs:s,...r}=t,i=Ty(Ry,n),[a,l]=f.useState(s===void 0);return f.useEffect(()=>{if(s!==void 0){const c=window.setTimeout(()=>l(!0),s);return()=>window.clearTimeout(c)}},[s]),a&&i.imageLoadingStatus!=="loaded"?o.jsx(de.span,{...r,ref:e}):null});Ay.displayName=Ry;function jD(t,e){const[n,s]=f.useState("idle");return ln(()=>{if(!t){s("error");return}let r=!0;const i=new window.Image,a=l=>()=>{r&&s(l)};return s("loading"),i.onload=a("loaded"),i.onerror=a("error"),i.src=t,e&&(i.referrerPolicy=e),()=>{r=!1}},[t,e]),n}var Cy=Py,Iy=Sy,Oy=Ay;const _c=f.forwardRef(({className:t,...e},n)=>o.jsx(Cy,{ref:n,className:ve("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",t),...e}));_c.displayName=Cy.displayName;const yc=f.forwardRef(({className:t,...e},n)=>o.jsx(Iy,{ref:n,className:ve("aspect-square h-full w-full",t),...e}));yc.displayName=Iy.displayName;const xc=f.forwardRef(({className:t,...e},n)=>o.jsx(Oy,{ref:n,className:ve("flex h-full w-full items-center justify-center rounded-full bg-nature-red text-white hover:bg-nature-coral transition-colors",t),...e}));xc.displayName=Oy.displayName;const bf=Ui("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-nature-coral text-white hover:bg-nature-coral/90",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-nature-red text-white hover:bg-nature-red/90",outline:"text-foreground",create:"border-transparent bg-nature-purple text-white hover:bg-nature-purple/90",premium:"border-transparent bg-nature-honey text-nature-honey-ink hover:bg-nature-honey/90"}},defaultVariants:{variant:"default"}});function TD({className:t,variant:e,animated:n=!1,...s}){if(n){const r={className:ve(bf({variant:e}),t),initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{type:"spring",stiffness:400,damping:10},whileHover:{scale:1.1}};return o.jsx(ke.div,{...r,children:s.children})}return o.jsx("div",{className:ve(bf({variant:e}),t),...s})}const Nt=({Icon:t,className:e="",size:n=24,hoverEffect:s="bounce"})=>{const r=()=>{switch(s){case"bounce":return{scale:[1,1.2,1],y:[0,-4,0],transition:{duration:.3}};case"rotate":return{rotate:[0,15,-15,0],transition:{duration:.4}};case"scale":return{scale:1.15,transition:{duration:.2}};case"wiggle":return{rotate:[0,-3,3,-3,3,0],scale:1.5,transition:{duration:.5}};default:return{}}},i=()=>({scale:1.2,rotate:[0,-2,2,0],transition:{duration:.15}});return o.jsx(ke.div,{className:`inline-block touch-manipulation ${e}`,whileHover:r(),whileTap:i(),style:{WebkitTapHighlightColor:"transparent",touchAction:"manipulation"},children:o.jsx(t,{size:n})})},ol=({countryCode:t,size:e=20,className:n=""})=>o.jsx("img",{src:`https://flagcdn.com/w40/${t.toLowerCase()}.png`,alt:`${t} flag`,className:`rounded-full object-cover ${n}`,style:{width:e,height:e},loading:"lazy"}),il={en:"gb",zh:"cn",bn:"in",es:"es",ja:"jp",ko:"kr",th:"th",vi:"vn",hi:"in",pt:"br",fil:"ph",ms:"my",id:"id",my:"mm",km:"kh",lo:"la"},OL={"zh-Hans":"cn",ja:"jp",ko:"kr",hi:"in",bn:"in",es:"es",pt:"br",th:"th",vi:"vn",fil:"ph",ms:"my",lo:"la",id:"id",km:"kh",my:"mm"},PD=()=>{const{currentLanguage:t,changeLanguage:e}=hn(),{isBusy:n}=ov(),{t:s}=Oe("navbar"),r=[{code:"en",name:"English"},{code:"zh",name:"䏿–‡"},{code:"bn",name:"বাংলা"},{code:"es",name:"Español"},{code:"ja",name:"日本語"},{code:"ko",name:"한êµì–´"},{code:"th",name:"ไทย"},{code:"vi",name:"Tiếng Việt"},{code:"hi",name:"हिनà¥à¤¦à¥€"},{code:"pt",name:"Português"},{code:"fil",name:"Filipino"},{code:"ms",name:"Bahasa Melayu"},{code:"id",name:"Bahasa Indonesia"},{code:"my",name:"မြန်မာ"},{code:"km",name:"ážáŸ’មែរ"},{code:"lo",name:"ລາວ"}],i=r.find(a=>a.code===t)?.name||"English";return n?o.jsxs(ME,{children:[o.jsx(NE,{asChild:!0,children:o.jsx("span",{tabIndex:0,children:o.jsxs($n,{variant:"ghost",size:"sm",className:"gap-2 opacity-50 cursor-not-allowed",disabled:!0,children:[o.jsx(ol,{countryCode:il[t]||"gb",size:20}),o.jsx("span",{className:"hidden sm:inline",children:i})]})})}),o.jsx(Km,{side:"bottom",children:s("languageLockedDuringGeneration",{defaultValue:"Please wait — your story is being generated."})})]}):o.jsxs(ty,{children:[o.jsx(ny,{asChild:!0,children:o.jsxs($n,{variant:"ghost",size:"sm",className:"gap-2",children:[o.jsx(ol,{countryCode:il[t]||"gb",size:20}),o.jsx("span",{className:"hidden sm:inline",children:i})]})}),o.jsx(Hu,{align:"end",className:"bg-white",children:r.map(a=>o.jsxs(Mn,{onClick:()=>e(a.code),className:`flex items-center gap-2 ${t===a.code?"bg-gray-100":""}`,children:[o.jsx(ol,{countryCode:il[a.code]||"gb",size:16}),a.name]},a.code))})]})},To=({to:t,href:e,external:n,onClick:s,type:r="button",disabled:i,className:a="",variant:l,size:c="pill",leftIcon:u,children:d,linkProps:h,ariaLabel:p})=>{const m=ve(U0({variant:l,size:c}),"whitespace-nowrap gap-2",a),_=c==="pillIcon"?o.jsxs("span",{className:"inline-flex items-center justify-center [&_svg]:h-4 [&_svg]:w-4",children:[u,d]}):o.jsxs(o.Fragment,{children:[u?o.jsx("span",{className:"inline-flex items-center [&_svg]:h-4 [&_svg]:w-4",children:u}):null,o.jsx("span",{children:d})]});return e?o.jsx(ke.span,{className:"inline-flex",whileHover:{scale:1.03},whileTap:{scale:.97},transition:{type:"spring",stiffness:400,damping:20},children:o.jsx("a",{href:e,onClick:s,"aria-label":p,className:m,...n?{target:"_blank",rel:"noopener noreferrer"}:{},...h,children:_})}):t?o.jsx(ke.span,{className:"inline-flex",whileHover:{scale:1.03},whileTap:{scale:.97},transition:{type:"spring",stiffness:400,damping:20},children:o.jsx(ie,{to:t,onClick:s,"aria-label":p,className:m,...h,children:_})}):o.jsx(ke.button,{type:r,onClick:s,disabled:i,"aria-label":p,className:m,whileHover:i?void 0:{scale:1.03},whileTap:i?void 0:{scale:.97},transition:{type:"spring",stiffness:400,damping:20},children:_})},kD=({className:t="",onClick:e})=>{const{getLocalizedPath:n}=hn(),{t:s}=Oe("subscription");return o.jsx(To,{variant:"primary",to:e?void 0:n("/login"),onClick:e,leftIcon:o.jsx(sm,{}),className:t,children:s("currentSubscription.unauthenticated.loginButton")})},wf="https://cdn.storysparkle.org/logo_assets/favicon.webp",SD=()=>{const[t,e]=f.useState(!1),[n,s]=f.useState(!1),r=Ys(),i=wc(),{user:a,signOut:l}=Zc(),{userType:c,subscription:u,avatarUrl:d,displayName:h,refreshSubscriptionStatus:p}=NC(),m=f.useRef(null),[y,_]=f.useState(!1),x=async A=>{const B=A.target.files?.[0];if(!(!B||!a)){if(B.size>5*1024*1024){Qt.error("Image must be under 5MB");return}_(!0),Qt.loading("Uploading photo...",{id:"avatar-upload"});try{const M=B.name.split(".").pop()||"jpg",K=`${a.id}/avatar.${M}`,{error:O}=await pe.storage.from("avatars").upload(K,B,{upsert:!0});if(O)throw O;const{data:{publicUrl:q}}=pe.storage.from("avatars").getPublicUrl(K),z=`${q}?t=${Date.now()}`,{error:U}=await pe.from("profiles").update({avatar_url:z}).eq("id",a.id);if(U)throw U;Qt.success("Profile photo updated!",{id:"avatar-upload"}),p()}catch(M){console.error("Avatar upload error:",M),Qt.error("Failed to upload photo",{id:"avatar-upload"})}finally{_(!1),m.current&&(m.current.value="")}}},{t:b}=Oe("navbar"),{getLocalizedPath:w}=hn(),E=A=>r.pathname===A,T=[{name:b("home"),path:"/",icon:yb},{name:b("stories"),path:"/stories",icon:jb},{name:b("improveReading"),path:"/improve-reading",icon:eb},{name:b("themes"),path:"/themes",icon:Nb},{name:b("blog"),path:"/blog",icon:Pb},{name:b("about"),path:"/about",icon:bb},{name:b("contact"),path:"/contact",icon:Ob},{name:b("premiumPlans"),path:"/subscription",icon:ar}];T.splice(2,0,{name:b("storyMaker"),path:"/story-maker",icon:rm}),T.splice(3,0,{name:b("textChecker"),path:"/text-checker",icon:fb});const j=[{name:b("readingCart"),path:"/reading-cart",icon:nm},{name:b("vocabulary"),path:"/vocabulary",icon:Lb},{name:b("progress"),path:"/progress",icon:Ub}],P=()=>e(!1),k=async()=>{if(!n){s(!0);try{await l(),i("/")}finally{s(!1)}}},S=(A,B)=>A?A.charAt(0).toUpperCase():B?B.charAt(0).toUpperCase():"U",D=c==="paid"||c==="admin"||u?.status==="active"&&!u?.isExpired;return o.jsxs("header",{className:"sticky top-0 z-50 w-full border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[o.jsxs("div",{className:"container flex h-14 items-center",children:[o.jsxs(ie,{to:w("/"),className:"flex items-center gap-2 mr-6",children:[o.jsx("img",{src:wf,alt:"StorySparkle Logo",width:24,height:24,fetchPriority:"high",decoding:"async",className:"h-6 w-6"}),o.jsxs("span",{className:"font-bold text-lg hidden sm:inline-block",children:[o.jsx("span",{className:"text-nature-red",children:"Story"}),o.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})]}),o.jsxs("nav",{className:"hidden xl:flex items-center space-x-4 xl:space-x-6 mx-6",children:[T.map(A=>o.jsx(ie,{to:w(A.path),className:`text-sm font-medium transition-colors hover:text-foreground/80 flex items-center justify-center p-2 ${E(A.path)?"text-nature-coral":"text-foreground/60"}`,title:A.name,children:E(A.path)?o.jsx(ke.div,{animate:{y:[0,-3,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:o.jsx(Nt,{Icon:A.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer text-nature-coral"})}):o.jsx(Nt,{Icon:A.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer"})},A.path)),a&&o.jsx(o.Fragment,{children:j.map(A=>o.jsx(ie,{to:w(A.path),className:`text-sm font-medium transition-colors hover:text-foreground/80 flex items-center justify-center p-2 ${E(A.path)?"text-nature-coral":"text-foreground/60"}`,title:A.name,children:E(A.path)?o.jsx(ke.div,{animate:{y:[0,-3,0]},transition:{duration:2,repeat:1/0,ease:"easeInOut"},children:o.jsx(Nt,{Icon:A.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer text-nature-coral"})}):o.jsx(Nt,{Icon:A.icon,size:20,hoverEffect:"wiggle",className:"cursor-pointer"})},A.path))})]}),o.jsxs("div",{className:"flex items-center ml-auto gap-2",children:[o.jsx(PD,{}),a?o.jsxs(ty,{children:[o.jsx(ny,{asChild:!0,children:o.jsxs($n,{variant:"ghost",className:"relative h-8 w-8 rounded-full",children:[o.jsxs(_c,{className:"h-8 w-8",children:[o.jsx(yc,{src:d||"",alt:a.email||"User"}),o.jsx(xc,{children:S(h,a.email)})]}),D&&o.jsx("span",{className:"absolute -top-1 -right-1",children:o.jsx(TD,{variant:"outline",className:"h-4 w-4 p-0 flex items-center justify-center bg-nature-honey rounded-full",children:o.jsx(ar,{className:"h-3 w-3 text-nature-honey-ink"})})})]})}),o.jsxs(Hu,{align:"end",className:"bg-background border border-border shadow-lg",children:[o.jsx("div",{className:"flex items-center justify-start gap-2 p-2",children:o.jsxs("div",{className:"flex flex-col space-y-1 leading-none",children:[h&&o.jsx("p",{className:"text-sm font-medium leading-none",children:h}),D&&o.jsxs("p",{className:"font-medium text-sm flex items-center gap-1",children:[o.jsx(ar,{className:"h-3 w-3 text-nature-honey-ink"}),"Premium"]}),o.jsx("p",{className:"text-xs text-muted-foreground",children:a.email})]})}),o.jsx(Ar,{}),c==="admin"&&o.jsx(Mn,{asChild:!0,children:o.jsx(ie,{to:"/admin",children:"Admin Dashboard"})}),c==="admin"&&o.jsx(Ar,{}),j.map(A=>o.jsx(Mn,{asChild:!0,children:o.jsxs(ie,{to:A.path,className:"flex items-center gap-2",children:[A.icon&&o.jsx(A.icon,{className:"h-4 w-4"}),A.name]})},A.path)),o.jsx(Ar,{}),o.jsxs(Mn,{onSelect:()=>m.current?.click(),disabled:y,className:"flex items-center gap-2 cursor-pointer",children:[o.jsx(pd,{className:"h-4 w-4"}),b(y?"uploading":"updatePhoto")]}),o.jsx(Mn,{asChild:!0,children:o.jsxs(ie,{to:w("/subscription"),className:"flex items-center gap-2",children:[o.jsx(ar,{className:"h-4 w-4"}),b(D?"manageSubscription":"upgradeToPremium")]})}),o.jsx(Mn,{asChild:!0,children:o.jsxs(ie,{to:w("/reset-password"),className:"flex items-center gap-2",children:[o.jsx(fd,{className:"h-4 w-4"}),b("resetPassword","Reset Password")]})}),o.jsx(Ar,{}),o.jsxs(Mn,{className:"cursor-pointer",disabled:n,onSelect:A=>{A.preventDefault(),k()},children:[o.jsx(gd,{className:"mr-2 h-4 w-4"}),o.jsx("span",{children:n?"Signing out...":b("logOut")})]})]})]}):o.jsx(kD,{}),o.jsxs(gD,{open:t,onOpenChange:e,children:[o.jsx(vD,{asChild:!0,children:o.jsxs($n,{variant:"outline",size:"icon",className:"xl:hidden",children:[o.jsx(Nt,{Icon:Cb,size:20,hoverEffect:"wiggle",className:"cursor-pointer"}),o.jsx("span",{className:"sr-only",children:"Toggle menu"})]})}),o.jsxs(jy,{side:"right",className:"bg-white",children:[o.jsxs(ie,{to:w("/"),className:"flex items-center gap-2 mb-8",onClick:P,children:[o.jsx("img",{src:wf,alt:"StorySparkle Logo",width:24,height:24,decoding:"async",className:"h-6 w-6"}),o.jsxs("span",{className:"font-bold text-lg",children:[o.jsx("span",{className:"text-nature-red",children:"Story"}),o.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})]}),o.jsxs("nav",{className:"flex flex-col gap-4",children:[T.map(A=>o.jsxs(ie,{to:w(A.path),className:`hover:text-foreground flex items-center gap-2 ${E(A.path)?"text-nature-coral font-medium":"text-foreground/60"}`,onClick:P,children:[o.jsx(Nt,{Icon:A.icon,size:16,hoverEffect:"wiggle",className:`cursor-pointer touch-manipulation ${E(A.path)?"text-nature-coral":""}`}),A.name,E(A.path)&&o.jsx(ke.div,{className:"ml-auto w-2 h-2 bg-nature-coral rounded-full",animate:{scale:[1,1.2,1]},transition:{duration:1,repeat:1/0}})]},A.path)),o.jsx("div",{className:"border-t my-2 pt-2"}),a?o.jsxs(o.Fragment,{children:[j.map(A=>o.jsxs(ie,{to:w(A.path),className:`hover:text-foreground flex items-center gap-2 ${E(A.path)?"text-nature-coral font-medium":"text-foreground/60"}`,onClick:P,children:[o.jsx(Nt,{Icon:A.icon,size:16,hoverEffect:"wiggle",className:`cursor-pointer touch-manipulation ${E(A.path)?"text-nature-coral":""}`}),A.name,E(A.path)&&o.jsx(ke.div,{className:"ml-auto w-2 h-2 bg-nature-coral rounded-full",animate:{scale:[1,1.2,1]},transition:{duration:1,repeat:1/0}})]},A.path)),o.jsx("div",{className:"border-t my-2 pt-2"}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs(_c,{className:"h-8 w-8",children:[o.jsx(yc,{src:d||"",alt:a.email||"User"}),o.jsx(xc,{children:S(h,a.email)})]}),o.jsxs("div",{className:"flex flex-col",children:[h&&o.jsx("span",{className:"text-sm font-medium",children:h}),o.jsx("span",{className:"text-xs text-muted-foreground",children:a.email})]})]}),c==="admin"&&o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"border-t my-2 pt-2"}),o.jsxs(ie,{to:"/admin",className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:P,children:[o.jsx(Nt,{Icon:nb,size:16,hoverEffect:"wiggle",className:"cursor-pointer touch-manipulation"}),b("adminDashboard")]})]}),o.jsx("div",{className:"border-t my-2 pt-2"}),o.jsxs("button",{onClick:()=>m.current?.click(),disabled:y,className:"hover:text-foreground flex items-center gap-2 text-foreground/60 text-left",children:[o.jsx(pd,{className:"h-4 w-4"}),b(y?"uploading":"updatePhoto")]}),o.jsxs(ie,{to:w("/subscription"),className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:P,children:[o.jsx(ar,{className:"h-4 w-4"}),b(D?"manageSubscription":"upgradeToPremium")]}),o.jsxs(ie,{to:w("/reset-password"),className:"hover:text-foreground flex items-center gap-2 text-foreground/60",onClick:P,children:[o.jsx(fd,{className:"h-4 w-4"}),b("resetPassword","Reset Password")]}),o.jsx("div",{className:"border-t my-2 pt-2"}),o.jsxs($n,{variant:"outline",disabled:n,onClick:async()=>{await k(),P()},children:[o.jsx(Nt,{Icon:gd,size:16,hoverEffect:"scale",className:"cursor-pointer mr-2 touch-manipulation"}),n?"Signing out...":b("logOut")]})]}):o.jsxs(o.Fragment,{children:[o.jsxs(ie,{to:w("/login"),className:"flex items-center gap-2",onClick:P,children:[o.jsx(Nt,{Icon:sm,size:16,hoverEffect:"scale",className:"cursor-pointer touch-manipulation"}),b("signIn")]}),o.jsxs(ie,{to:w("/signup"),className:"flex items-center gap-2",onClick:P,children:[o.jsx(Nt,{Icon:Gb,size:16,hoverEffect:"wiggle",className:"cursor-pointer touch-manipulation"}),b("createAccount")]})]})]})]})]})]})]}),a&&o.jsx("input",{type:"file",ref:m,className:"hidden",accept:"image/*",onChange:x})]})},RD="https://cdn.storysparkle.org/logo_assets/favicon.webp",AD=()=>{const{t,i18n:e}=Oe("footer"),{getLocalizedPath:n}=hn(),s=new Date().getFullYear(),{pathname:r}=Ys(),i=l=>{const c=n(l);return l==="/"?r===c:r===c||r.startsWith(c+"/")||r.startsWith(c+"#")},a=l=>`text-sm transition-colors ${i(l)?"text-nature-coral font-medium":"text-foreground/60 hover:text-nature-coral"}`;return o.jsxs("footer",{className:"text-ink py-12 px-4 md:px-8 bg-page-surface",children:[o.jsxs("div",{className:"max-w-7xl mx-auto grid grid-cols-1 lg:grid-cols-4 gap-8",children:[o.jsxs("div",{className:"flex flex-col gap-4",children:[o.jsxs(ie,{to:n("/"),className:"flex items-center gap-2",children:[o.jsx("img",{src:RD,alt:"StorySparkle Logo",width:32,height:32,loading:"lazy",decoding:"async",className:"h-8 w-8"}),o.jsxs("span",{className:"font-bold text-xl",children:[o.jsx("span",{className:"text-nature-red",children:t("companyTitleStart")}),o.jsx("span",{className:"text-nature-coral",children:t("companyTitleEnd")})]})]}),o.jsx("p",{className:"text-foreground/70 text-sm max-w-xs text-left",children:t("companyDescription")})]}),o.jsxs("div",{className:"text-left ",children:[o.jsx("h3",{className:"font-medium text-lg mb-4 text-foreground",children:t("quickLinks")}),o.jsxs("ul",{className:"space-y-2",children:[o.jsx("li",{children:o.jsx(ie,{to:n("/"),className:a("/"),children:t("home")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/stories"),className:a("/stories"),children:t("stories")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/story-maker"),className:a("/story-maker"),children:t("storyMaker")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/about"),className:a("/about"),children:t("about")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/subscription"),className:a("/subscription"),children:t("subscription")})})]})]}),o.jsx("div",{children:o.jsxs("div",{className:"text-left ",children:[o.jsx("h3",{className:"font-medium text-lg mb-4 text-foreground",children:t("resources")}),o.jsxs("ul",{className:"space-y-2",children:[o.jsx("li",{children:o.jsx(ie,{to:n("/text-checker"),className:a("/text-checker"),children:t("textChecker")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/improve-reading"),className:a("/improve-reading"),children:t("improveReading")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/themes"),className:a("/themes"),children:t("themes")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/research"),className:a("/research"),children:t("seslAlgorithm")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/blog"),className:a("/blog"),children:t("blog")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/blog/newsletter"),className:a("/blog/newsletter"),children:t("newsletter")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/contact#faq-section"),className:a("/contact"),children:t("faq")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/contact"),className:a("/contact"),children:t("contact")})})]})]})}),o.jsxs("div",{className:"text-left ",children:[o.jsx("h3",{className:"font-medium text-lg mb-4 text-foreground",children:t("legal")}),o.jsxs("ul",{className:"space-y-2",children:[o.jsx("li",{children:o.jsx(ie,{to:n("/terms"),className:a("/terms"),children:t("terms")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/refund"),className:a("/refund"),children:t("refund")})}),o.jsx("li",{children:o.jsx(ie,{to:n("/privacy"),className:a("/privacy"),children:t("privacy")})})]})]})]}),o.jsxs("div",{className:"max-w-7xl mx-auto mt-12 pt-6 border-t border-border flex flex-col lg:flex-row justify-between items-center gap-4",children:[o.jsx("p",{className:"text-sm text-foreground/60",children:t("copyright",{year:s})}),o.jsxs("p",{className:"text-sm flex items-center gap-1 text-foreground/60",children:[t("madeWith")," ",o.jsx(nm,{className:"h-3 w-3 text-nature-red"})," ",t("forYoungReaders")]})]})]})},CD=()=>{const[t,e]=f.useState({}),[n,s]=f.useState(!0);f.useEffect(()=>{(async()=>{try{const{data:l,error:c}=await pe.from("landing_assets").select("*");if(c)throw c;const u={};l?.forEach(d=>{u[d.section_id]||(u[d.section_id]={}),u[d.section_id][d.asset_key]=d.asset_url}),e(u)}catch(l){console.error("Failed to fetch landing assets:",l)}finally{s(!1)}})()},[]);const r=f.useCallback(async(a,l,c,u="image")=>{try{const{error:d}=await pe.from("landing_assets").upsert({section_id:a,asset_key:l,asset_url:c,asset_type:u},{onConflict:"section_id,asset_key"});if(d)throw d;return e(h=>({...h,[a]:{...h[a],[l]:c}})),!0}catch(d){return console.error("Failed to save landing asset:",d),!1}},[]),i=f.useCallback((a,l)=>t[a]?.[l],[t]);return{assets:t,isLoading:n,saveAsset:r,getAsset:i}},ID={en:"en_US",bn:"bn_BD",es:"es_ES",zh:"zh_CN",ja:"ja_JP",ko:"ko_KR",th:"th_TH",vi:"vi_VN",hi:"hi_IN",pt:"pt_PT",fil:"fil_PH",ms:"ms_MY",id:"id_ID",my:"my_MM",km:"km_KH",lo:"lo_LA"},nr=({title:t="StorySparkle - Interactive Reading Experiences for Children",description:e="StorySparkle—reading practice app for kids with interactive leveled stories, adjustable-speed video narration, vocabulary builder, and custom AI story maker.",canonical:n,ogImage:s="https://cdn.storysparkle.org/logo_assets/favicon_512x512.png",ogType:r="website",structuredData:i,noIndex:a=!1,keywords:l})=>{const{currentLanguage:c}=hn(),u=t.includes("StorySparkle")?t:`${t} | StorySparkle`,h=(n||window.location.pathname).replace(/^https?:\/\/[^/]+/i,"")||"/",p="https://storysparkle.org",m=ls.filter(w=>w!=="en"),y=new RegExp(`^/(${m.join("|")})(?=/|$)`);let _=h.replace(y,"");_===""&&(_="/");const x=w=>w==="en"?p+(_==="/"?"/":_):p+"/"+w+(_==="/"?"":_),b=x(c);return o.jsxs(Zy,{defer:!1,children:[o.jsx("title",{children:u}),o.jsx("meta",{name:"description",content:e}),o.jsx("meta",{name:"author",content:"StorySparkle"}),l&&o.jsx("meta",{name:"keywords",content:l}),o.jsx("link",{rel:"icon",href:"/favicon.webp",type:"image/webp"}),o.jsx("link",{rel:"apple-touch-icon",href:"/favicon.webp"}),o.jsx("html",{lang:c}),o.jsx("link",{rel:"canonical",href:b}),ls.map(w=>o.jsx("link",{rel:"alternate",href:x(w),hrefLang:w},w)),o.jsx("link",{rel:"alternate",href:x("en"),hrefLang:"x-default"}),o.jsx("meta",{property:"og:title",content:u}),o.jsx("meta",{property:"og:description",content:e}),o.jsx("meta",{property:"og:type",content:r}),o.jsx("meta",{property:"og:url",content:b}),o.jsx("meta",{property:"og:image",content:s}),o.jsx("meta",{property:"og:site_name",content:"StorySparkle"}),o.jsx("meta",{property:"og:locale",content:ID[c]||"en_US"}),o.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),o.jsx("meta",{name:"twitter:title",content:u}),o.jsx("meta",{name:"twitter:description",content:e}),o.jsx("meta",{name:"twitter:image",content:s}),o.jsx("meta",{name:"viewport",content:"width=device-width, initial-scale=1.0"}),o.jsx("meta",{name:"robots",content:a?"noindex,nofollow":"index,follow"}),o.jsx("meta",{name:"googlebot",content:a?"noindex,nofollow":"index,follow"}),o.jsx("meta",{name:"language",content:c}),i&&o.jsx("script",{type:"application/ld+json",children:JSON.stringify(i)})]})},lo={A1:{label:"A1 (Beginner)",shortLabel:"A1",ageBand:"5-7",classes:"bg-nature-forest/15 text-nature-forest border border-nature-forest/30"},A2:{label:"A2 (Elementary)",shortLabel:"A2",ageBand:"7-9",classes:"bg-nature-forest text-white"},B1:{label:"B1 (Intermediate)",shortLabel:"B1",ageBand:"9-12",classes:"bg-nature-honey/50 text-nature-honey-ink border border-nature-honey-ink/20"},B2:{label:"B2 (Upper-Intermediate)",shortLabel:"B2",ageBand:"12-15",classes:"bg-nature-honey text-nature-honey-ink"},C1:{label:"C1 (Advanced)",shortLabel:"C1",ageBand:"15-18",classes:"bg-nature-coral/20 text-nature-coral border border-nature-coral/40"},C2:{label:"C2 (Proficient)",shortLabel:"C2",ageBand:"18+",classes:"bg-nature-coral text-white"}},DL=["A1","A2","B1","B2","C1","C2"],LL=t=>!t||!(t in lo)?{label:"Unknown",shortLabel:"?",ageBand:"Unknown",classes:"bg-gray-100 text-gray-800"}:lo[t],Ef=t=>!t||!(t in lo)?"Unknown":lo[t].ageBand,ML=t=>{if(!t)return null;const e=Object.entries(lo).find(([n,s])=>s.ageBand===t);return e?e[0]:null},NL=t=>t==null?"bg-gray-100 text-gray-800":t<=250?"bg-green-200 text-green-900":t<=400?"bg-green-500 text-green-50":t<=550?"bg-yellow-200 text-yellow-900":t<=700?"bg-yellow-500 text-yellow-50":t<=850?"bg-red-200 text-red-900":"bg-red-600 text-red-50",OD={"@context":"https://schema.org","@type":"Organization","@id":"https://storysparkle.org/#organization",name:"StorySparkle",description:"Interactive reading platform for children aged 5–15 learning English as a second language, with synchronised RP UK narration, CEFR-levelled stories, vocabulary building, and dyslexia-friendly design.",url:"https://storysparkle.org",logo:"https://storysparkle.org/favicon.webp",foundingDate:"2024",slogan:"The Reading App for Kids Learning English",contactPoint:{"@type":"ContactPoint",contactType:"customer service",email:"support@storysparkle.org",availableLanguage:["English","Bengali","Spanish","Chinese","Japanese","Korean","Thai","Vietnamese","Hindi","Portuguese","Filipino","Malay","Indonesian","Burmese","Khmer","Lao"]}},DD={"@context":"https://schema.org","@type":"WebSite","@id":"https://storysparkle.org/#website",name:"StorySparkle",description:"Interactive reading platform for children learning English",url:"https://storysparkle.org",publisher:{"@id":"https://storysparkle.org/#organization"},inLanguage:["en","bn","es","zh","ja","ko","th","vi","hi","pt","fil","ms","id","my","km","lo"],potentialAction:{"@type":"SearchAction",target:"https://storysparkle.org/stories?search={search_term_string}","query-input":"required name=search_term_string"}},LD={"@context":"https://schema.org","@type":"SoftwareApplication","@id":"https://storysparkle.org/#software",name:"StorySparkle",description:"Interactive reading app for children aged 5–15 learning English. Levelled stories, RP UK narration, vocabulary notebook, dyslexia-friendly design and AI Story Maker.",url:"https://storysparkle.org",applicationCategory:"EducationalApplication",applicationSubCategory:"Reading",operatingSystem:"Web, iOS, Android",inLanguage:["en","bn","es","zh","ja","ko","th","vi","hi","pt","fil","ms","id","my","km","lo"],publisher:{"@id":"https://storysparkle.org/#organization"},audience:{"@type":"PeopleAudience",suggestedMinAge:5,suggestedMaxAge:15},featureList:["Professional Received Pronunciation UK English narration","Word-by-word synchronised highlighting","SESL© 109-parameter difficulty algorithm","CEFR-levelled stories (Pre-A1 to B2)","Tap-to-translate vocabulary in 15 languages","Smart Vocabulary Notebook","Adjustable reading pace","Dyslexia-friendly OpenDyslexic mode","AI Story Maker with printable storybook","Text Suitability Checker","4-dimension reading progress tracking","Talking-head animated narrator videos"],offers:[{"@type":"Offer",name:"Monthly subscription",price:"3.99",priceCurrency:"GBP",category:"subscription",url:"https://storysparkle.org/subscription",availability:"https://schema.org/InStock"},{"@type":"Offer",name:"Annual subscription",price:"29.99",priceCurrency:"GBP",category:"subscription",url:"https://storysparkle.org/subscription",availability:"https://schema.org/InStock"}]},MD={"@context":"https://schema.org","@type":"Course","@id":"https://storysparkle.org/#course",name:"English Reading for Kids — CEFR Pre-A1 to B2",description:"A CEFR-aligned reading pathway for children learning English as a second language. Every story is graded by the SESL© 109-parameter algorithm and mapped to a CEFR band from Pre-A1 through B2.",provider:{"@id":"https://storysparkle.org/#organization"},educationalLevel:["CEFR Pre-A1","CEFR A1","CEFR A2","CEFR B1","CEFR B2"],educationalCredentialAwarded:"Reading fluency progression across four skill dimensions",inLanguage:"en",audience:{"@type":"EducationalAudience",educationalRole:"student"},hasCourseInstance:[{"@type":"CourseInstance",courseMode:"online",courseWorkload:"PT15M",inLanguage:"en"}],offers:{"@type":"Offer",category:"Free",price:"0",priceCurrency:"GBP",url:"https://storysparkle.org/stories"}},ND={"@context":"https://schema.org","@type":"ItemList","@id":"https://storysparkle.org/#features",name:"StorySparkle landing page features",itemListOrder:"https://schema.org/ItemListOrderAscending",numberOfItems:12,itemListElement:[{"@type":"ListItem",position:1,name:"Interactive stories that help children read fluently and expressively"},{"@type":"ListItem",position:2,name:"Professional Visual Narration"},{"@type":"ListItem",position:3,name:"Synced Word Highlights"},{"@type":"ListItem",position:4,name:"Interactive Words"},{"@type":"ListItem",position:5,name:"Smart Vocabulary Notebook"},{"@type":"ListItem",position:6,name:"Choose your Pace"},{"@type":"ListItem",position:7,name:"Dyslexia Friendly"},{"@type":"ListItem",position:8,name:"Read at the Right Level"},{"@type":"ListItem",position:9,name:"Curated Story Themes"},{"@type":"ListItem",position:10,name:"Intelligent Story Maker"},{"@type":"ListItem",position:11,name:"Smarter Reading Practice. Visible Progress."},{"@type":"ListItem",position:12,name:"Give the Gift of Fluency"}]},VL=t=>({"@context":"https://schema.org","@type":"CreativeWork",name:t.title,description:t.description,author:{"@type":"Organization",name:"StorySparkle"},publisher:{"@type":"Organization",name:"StorySparkle",logo:"https://storysparkle.org/favicon.webp"},audience:(()=>{const e=Ef(t.cefrLevel),n=e.includes("+")?parseInt(e):parseInt(e.split("-")[0])||3,s=e.includes("+")?99:parseInt(e.split("-")[1])||12;return{"@type":"Audience",audienceType:"Children",suggestedMinAge:n,suggestedMaxAge:s}})(),educationalAlignment:{"@type":"AlignmentObject",educationalFramework:"CEFR Language Levels",targetDescription:`CEFR ${t.cefrLevel||"Unknown"} reading level`},learningResourceType:"Interactive Story",interactivityType:"active",typicalAgeRange:`${Ef(t.cefrLevel)} years`,timeRequired:`PT${Math.floor(t.duration/60)}M${t.duration%60}S`,wordCount:t.wordCount,genre:t.theme,accessibilityFeature:["audioDescription","synchronizedAudioText","dyslexiaSupport"],isAccessibleForFree:!1,hasPart:{"@type":"WebPageElement",isAccessibleForFree:!1,cssSelector:".story-body-gated"}}),FL=t=>({"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((e,n)=>({"@type":"ListItem",position:n+1,name:e.name,item:`https://storysparkle.org${e.url}`}))}),VD={1:"M0,64 C120,20 240,100 480,64 C720,28 960,96 1200,64 C1320,48 1380,80 1440,64 L1440,120 L0,120 Z",2:"M0,40 C180,100 360,20 540,60 C720,100 900,30 1080,70 C1200,90 1340,40 1440,50 L1440,120 L0,120 Z",3:"M0,80 C160,30 320,90 480,50 C640,10 800,80 960,40 C1120,0 1280,70 1440,30 L1440,120 L0,120 Z",4:"M0,60 C240,110 480,10 720,70 C960,130 1200,20 1440,60 L1440,120 L0,120 Z",5:"M0,50 C100,20 200,80 360,40 C520,0 640,90 800,50 C960,10 1100,85 1260,45 C1360,25 1400,60 1440,55 L1440,120 L0,120 Z",6:"M0,45 C180,36 360,58 540,45 S900,32 1080,45 S1260,54 1440,45 L1440,120 L0,120 Z",7:"M0,30 C180,90 360,10 600,70 C840,130 1020,20 1200,60 C1320,80 1400,40 1440,50 L1440,120 L0,120 Z",8:"M0,70 C80,20 160,100 300,50 C440,0 520,80 660,60 C800,40 880,100 1020,30 C1160,-10 1300,80 1440,55 L1440,120 L0,120 Z",9:"M0,55 C60,90 140,15 260,65 C380,115 440,20 580,55 C720,90 800,10 940,50 C1080,90 1180,25 1300,60 C1380,80 1420,50 1440,60 L1440,120 L0,120 Z",10:"M0,80 C240,20 480,100 720,40 C960,-10 1200,90 1440,35 L1440,120 L0,120 Z",11:"M0,25 C100,70 220,10 380,55 C540,100 660,15 820,65 C980,110 1120,30 1280,70 C1360,90 1420,45 1440,55 L1440,120 L0,120 Z",12:"M0,40 C180,90 360,100 540,30 C720,-20 900,-10 1080,50 C1200,90 1340,80 1440,45 L1440,120 L0,120 Z"},Vt=({topColor:t,bottomColor:e,variant:n=1,flip:s=!1,className:r=""})=>o.jsx("div",{className:`relative w-full overflow-hidden leading-[0] ${r}`,style:{backgroundColor:t},"aria-hidden":"true",children:o.jsx("svg",{viewBox:"0 0 1440 120",preserveAspectRatio:"none",className:"block w-full h-[60px] md:h-[80px] lg:h-[120px]",style:{transform:s?"scaleX(-1)":void 0},children:o.jsx("path",{d:VD[n],fill:e})})});function FD(t,e,n){const s=t(e,{returnObjects:!0});return Array.isArray(s)?s:[]}const $D=({words:t,className:e="",typingSpeed:n=100,deletingSpeed:s=60,pauseAfterWord:r=1500,finalWordMultiplier:i=5})=>{const[a,l]=f.useState(0),[c,u]=f.useState(""),[d,h]=f.useState(!1),[p,m]=f.useState(!1),y=Array.isArray(t)&&t.length>0?t:[];f.useEffect(()=>{l(0),u(""),h(!1),m(!1)},[y.join("|")]);const _=y[a]??"",x=a===y.length-1,b=f.useCallback(()=>{if(!(p||!_))if(d)c.length>0?u(c.slice(0,-1)):(h(!1),l(w=>y.length?(w+1)%y.length:0));else if(c.length<_.length)u(_.slice(0,c.length+1));else{m(!0);const w=x?r*i:r;setTimeout(()=>{m(!1),h(!0)},w)}},[c,d,p,_,x,r,i,y.length]);return f.useEffect(()=>{if(p||!_)return;const E=setTimeout(b,d?s:n);return()=>clearTimeout(E)},[b,d,p,n,s,_]),_?o.jsxs("span",{className:e,children:[c,o.jsx("span",{className:"animate-blink",children:"|"})]}):null};function Xu(t){const e=f.useCallback(()=>{try{t().catch(()=>{})}catch{}},[t]);return{onMouseEnter:e,onFocus:e,onTouchStart:e}}const Zu=({className:t="",labelOverride:e})=>{const{getLocalizedPath:n}=hn(),{t:s}=Oe("landing"),r=Xu(()=>g(()=>import("./StoriesPage-CX89pBbh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27])));return o.jsx(To,{variant:"primary",to:n("/stories"),leftIcon:o.jsx(rb,{}),className:t,linkProps:r,children:e||s("buttons.readStories")})},BD=({className:t=""})=>{const{t:e}=Oe("landing"),{getLocalizedPath:n}=hn();return o.jsx(To,{variant:"create",to:n("/story-maker"),onClick:()=>window.scrollTo({top:0,behavior:"instant"}),leftIcon:o.jsx(rm,{}),className:t,children:e("buttons.startCreating")})},zD=({className:t=""})=>{const{t:e}=Oe("landing"),{getLocalizedPath:n}=hn(),s=Xu(()=>g(()=>import("./TextCheckerPage-BHcTeG5R.js"),__vite__mapDeps([28,1,2,29,30,4,31,32,24,33,7,34,23,35,36,37,6,22,21,38,27,39,26])));return o.jsx(To,{variant:"learn",to:n("/text-checker"),leftIcon:o.jsx(Bb,{}),className:t,linkProps:s,children:e("checkText.buttonText")})},UD="https://cdn.storysparkle.org/logo_assets/Logo%20Claymation%20Transparent%20Square%20WEBP.webp",HD="https://cdn.storysparkle.org/landing_assets/Claymation%20Wordmark%20Transparent%20WEBP.webp",WD="https://cdn.storysparkle.org/landing_assets/Ethnic%20Circle%20Transparent%20WEBP.webp",GD=()=>{const{t}=Oe("landing"),e=FD(t,"hero.typewriterWords");return o.jsx("section",{className:"relative bg-white min-h-[calc(100vh-3.5rem)] flex items-center",children:o.jsx("div",{className:"container mx-auto px-8 py-10 md:py-16",children:o.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-10 md:gap-10",children:[o.jsxs("div",{className:"w-full md:w-[55%] flex flex-col items-center md:items-start text-center md:text-left",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-6 md:mb-8",children:[o.jsx("img",{src:UD,alt:t("hero.alt.logo"),className:"h-14 md:h-16 w-auto",width:128,height:128,fetchPriority:"high",decoding:"async"}),o.jsx("img",{src:HD,alt:t("hero.alt.wordmark"),className:"h-8 md:h-10 w-auto",fetchPriority:"high",decoding:"async"})]}),o.jsx("h1",{className:"sr-only",children:t("hero.h1")}),o.jsx("div",{"aria-hidden":"true",className:"font-bold text-muted-foreground text-3xl md:text-4xl lg:text-5xl leading-tight tracking-tight",children:t("hero.headlineTemplate").split(`
`).map((n,s)=>{const r=n.split("{{word}}");return o.jsx("div",{className:"whitespace-nowrap",children:r.map((i,a)=>o.jsxs(L.Fragment,{children:[o.jsx("span",{children:i}),a<r.length-1&&o.jsx($D,{words:e.length?e:["magical"],typingSpeed:90,deletingSpeed:60,pauseAfterWord:1400,finalWordMultiplier:1,className:"text-nature-coral"})]},a))},s)})}),o.jsx("p",{className:"mt-5 md:mt-6 max-w-xl md:max-w-[34rem] text-base md:text-lg text-muted-foreground font-noto [text-wrap:pretty]",children:t("hero.subtext")}),o.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-center md:justify-start gap-4",children:[o.jsx(Zu,{}),o.jsx(BD,{}),o.jsx(zD,{})]}),o.jsx("p",{className:"mt-6 text-sm italic text-muted-foreground",children:t("hero.footnote")})]}),o.jsx("div",{className:"w-full md:w-[45%] flex items-center justify-center",children:o.jsx(ke.img,{src:WD,alt:t("hero.alt.circle"),className:"w-[70vw] md:w-[42vw] max-w-xl h-auto max-h-[45vh] md:max-h-none object-contain",animate:{rotate:360},transition:{repeat:1/0,ease:"linear",duration:10},fetchPriority:"high",decoding:"async"})})]})})})},KD="https://cdn.storysparkle.org/landing_assets/flicker-reading-reduced-size.mp4",qD=()=>{const t=f.useRef(null),e=TC(t,{amount:.3}),{t:n}=Oe("landing");return o.jsx("section",{ref:t,className:"relative min-h-0 py-8 lg:py-0 lg:min-h-screen flex items-center overflow-hidden",style:{background:"#FFF8E7"},children:o.jsx("div",{className:"container mx-auto max-w-6xl px-6",children:o.jsxs("div",{className:"flex flex-col lg:flex-row items-center gap-4 lg:gap-12",children:[o.jsxs("div",{className:"max-w-lg text-center lg:text-left flex flex-col",children:[o.jsxs("div",{className:"space-y-2 lg:space-y-4",children:[o.jsx("h2",{className:"section-header text-[22px] lg:text-[32px]",children:n("description.heading")}),o.jsx("h3",{className:"section-subtext text-sm lg:text-xl",children:n("description.subtext")})]}),o.jsx("div",{className:"mt-4 lg:mt-8",children:o.jsx(Zu,{})})]}),o.jsx("div",{className:"flex-1 flex justify-center items-center",children:o.jsx(ke.div,{className:"w-40 md:w-80 lg:w-96",initial:{x:200,opacity:0},animate:{x:e?0:200,opacity:e?1:0},transition:{duration:1.2,ease:[.25,.1,.25,1]},children:o.jsx("video",{src:KD,autoPlay:!0,muted:!0,loop:!0,playsInline:!0,className:"w-full object-contain"})})})]})})})},YD=({className:t=""})=>{const{getLocalizedPath:e}=hn(),{t:n}=Oe("landing"),s=Xu(()=>g(()=>import("./ResearchPage-gnPTQOIO.js"),__vite__mapDeps([40,1,2,21,7,4,41,38,14,42,43,35,44,26,27])));return o.jsx(To,{variant:"learn",to:e("/research"),leftIcon:o.jsx(gb,{}),className:t,linkProps:s,children:n("buttons.seslAlgorithm")})},XD="https://cdn.storysparkle.org/landing_assets/xp-chart-card.webp",ZD=({sectionRef:t})=>{const e=f.useRef(null),n=t??e,{t:s}=Oe("landing"),[r,i]=f.useState(!1);return f.useEffect(()=>{const a=n.current;if(!a)return;const l=new IntersectionObserver(c=>{c.forEach(u=>i(u.isIntersecting))},{rootMargin:"-50% 0px -50% 0px",threshold:0});return l.observe(a),()=>l.disconnect()},[n]),o.jsx("section",{ref:n,className:"relative h-[150vh]",style:{background:"#ECF4E8"},children:o.jsxs("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] overflow-hidden flex flex-col justify-start pt-16 md:pt-0 md:justify-center",children:[o.jsxs("div",{className:"relative z-10 px-6 md:absolute md:top-16 md:left-0 md:right-0 md:px-12 lg:px-20",children:[o.jsx("h2",{className:"section-header text-[22px] lg:text-[32px] mb-4",children:s("seslProgress.heading")}),o.jsx("h3",{className:"section-subtext text-sm lg:text-xl max-w-6xl",children:s("seslProgress.subtext")})]}),o.jsx("div",{className:"relative z-10 mt-6 px-6 flex justify-center md:block md:absolute md:top-[30%] md:left-0 md:mt-0 md:px-12 lg:px-20",children:o.jsx(YD,{})}),o.jsx(ke.div,{className:"relative mt-8 w-full px-6 md:absolute md:left-0 md:top-[45%] md:-translate-y-1/2 md:w-[75vw] md:max-w-6xl md:mt-0 md:px-0 md:pl-12 lg:pl-20",initial:{x:"30%",opacity:0},animate:r?{x:"0%",opacity:1}:{x:"30%",opacity:0},transition:{duration:.8,ease:[.22,1,.36,1]},children:o.jsx("img",{src:XD,alt:"XP Points Progress Chart",className:"w-full h-auto rounded-2xl shadow-2xl",width:1600,height:1e3,loading:"lazy",decoding:"async"})})]})})},JD=({variant:t="inline",className:e="",as:n="span"})=>{let s="",r="";switch(t){case"navbar":s="text-lg",r="font-bold";break;case"footer":s="text-xl",r="font-bold";break;case"auth":s="text-xl",r="font-bold";break;default:s="",r="";break}return o.jsxs(n,{className:Sc(e,r,s,"whitespace-nowrap font-noto inline"),children:[o.jsx("span",{className:"text-nature-red",children:"Story"}),o.jsx("span",{className:"text-nature-coral",children:"Sparkle"})]})},QD="https://cdn.storysparkle.org/landing_assets/castle-on-cloud.webp",e2=()=>{const{t}=Oe("landing");return o.jsx("section",{className:"relative h-[200vh]",children:o.jsxs("div",{className:"sticky top-14 h-[calc(100vh-3.5rem)] flex flex-col overflow-hidden",style:{background:"#FFF7ED"},children:[o.jsx(ke.img,{src:QD,alt:"Castle on Cloud",className:"absolute bottom-0 left-0 h-[35vh] md:h-[75vh] max-[1366px]:lg:h-[55vh] ipad-portrait:!h-[42vh] w-auto object-contain animate-bob pl-4 md:pl-8",initial:{opacity:0},whileInView:{opacity:1},viewport:{once:!0},transition:{duration:1.5,ease:"easeOut"}}),o.jsxs("div",{className:"relative flex flex-col items-center justify-start md:justify-center ipad-portrait:!justify-start text-center z-10 px-4 md:px-8 flex-1",children:[o.jsxs("div",{className:"absolute top-[12%] left-0 right-0 px-4 md:relative md:top-auto md:px-0 md:pt-0 ipad-portrait:!absolute ipad-portrait:!top-[12%] ipad-portrait:!px-4",children:[o.jsx(ke.h2,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6},className:"section-header text-[22px] lg:text-[32px] text-center mb-3",children:t("cta.heading")}),o.jsxs(ke.h3,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.2},className:"section-subtext text-sm lg:text-xl text-center max-w-lg ipad-portrait:!max-w-md mx-auto mb-8",children:[t("cta.subtextPart1")," ",o.jsx(JD,{})," ",t("cta.subtextPart2")]})]}),o.jsxs("div",{className:"absolute top-[45%] left-0 right-0 -translate-y-1/2 md:relative md:top-auto md:translate-y-0 ipad-portrait:!absolute ipad-portrait:!top-[45%] ipad-portrait:!-translate-y-1/2",children:[o.jsx(ke.div,{initial:{y:30,opacity:0},whileInView:{y:0,opacity:1},viewport:{once:!0},transition:{delay:.5},children:o.jsx(Zu,{})}),o.jsx(ke.p,{initial:{opacity:0,y:20},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.6,delay:.3},className:"section-footnote mt-3 text-center",children:t("cta.footnote")})]})]})]})})},vn=()=>o.jsx("div",{style:{minHeight:"100vh"},"aria-hidden":"true"}),bc="https://cdn.storysparkle.org";function al(t){let n="";for(let s=0;s<t.length;s+=32768){const r=t.subarray(s,s+32768);n+=String.fromCharCode.apply(null,r)}return btoa(n)}async function t2(t,e,n,s){let r,i=s;if(n instanceof File){i=i||n.type;const c=await n.arrayBuffer();r=al(new Uint8Array(c))}else if(n instanceof Blob){i=i||n.type;const c=await n.arrayBuffer();r=al(new Uint8Array(c))}else r=al(n);const{data:a,error:l}=await pe.functions.invoke("r2-upload",{body:{bucket:t,path:e,content:r,contentType:i||"application/octet-stream"}});if(l)throw new Error(`R2 upload failed: ${l.message}`);if(a?.error)throw new Error(`R2 upload failed: ${a.error}`);return a.url}async function $L(t,e){const{data:n,error:s}=await pe.functions.invoke("r2-delete",{body:{bucket:t,path:e}});if(s)throw new Error(`R2 delete failed: ${s.message}`);if(n?.error)throw new Error(`R2 delete failed: ${n.error}`);return!0}async function BL(t){const{data:e,error:n}=await pe.functions.invoke("r2-list",{body:{prefix:t}});if(n)throw new Error(`R2 list failed: ${n.message}`);if(e?.error)throw new Error(`R2 list failed: ${e.error}`);return e.files||[]}function n2(t,e){return`${bc}/${t}/${e}`}function zL(t){if(!t.startsWith(bc))return null;const n=t.replace(`${bc}/`,"").split("/");return n.length<2?null:{bucket:n[0],path:n.slice(1).join("/")}}function s2(t){const e=t.split(".").pop(),n=Date.now(),s=Math.random().toString(36).substring(2,8);return`${n}-${s}.${e}`}const r2=({placeholder:t,description:e,aspectRatio:n="square",className:s="",imageSrc:r,size:i="md",uploadPath:a="landing",onUpload:l})=>{const c=f.useRef(null),[u,d]=f.useState(!1),[h,p]=f.useState(r),m={square:"aspect-square","16:9":"aspect-video","4:3":"aspect-[4/3]",auto:""},y={sm:"w-16 h-16",md:"w-24 h-24",lg:"w-32 h-32",full:"w-full"},_=()=>{c.current?.click()},x=async b=>{const w=b.target.files?.[0];if(!w)return;if(!["image/jpeg","image/png","image/gif","image/webp"].includes(w.type)){Qt.error("Please upload an image file (JPEG, PNG, GIF, or WebP)");return}if(w.size>10*1024*1024){Qt.error("File size must be less than 10MB");return}d(!0);try{const T=s2(w.name),j=`${a}/${T}`;await t2("landing_assets",j,w,w.type);const P=n2("landing_assets",j);p(P),l?.(P),Qt.success("Image uploaded successfully!")}catch(T){console.error("Upload failed:",T),Qt.error("Failed to upload image")}finally{d(!1),c.current&&(c.current.value="")}};return h?o.jsxs("div",{className:"relative group",children:[o.jsx("img",{src:h,alt:e,className:`object-cover rounded-xl ${n!=="auto"?m[n]:""} ${i!=="full"?y[i]:"w-full"} ${s}`}),o.jsx("input",{ref:c,type:"file",accept:"image/*",onChange:x,className:"hidden"}),o.jsx($n,{variant:"secondary",size:"sm",onClick:_,disabled:u,className:"absolute bottom-2 right-2 opacity-0 group-hover:opacity-100 transition-opacity",children:u?o.jsx(md,{className:"w-4 h-4 animate-spin"}):o.jsx(vd,{className:"w-4 h-4"})})]}):o.jsxs("div",{className:`relative border-2 border-dashed border-muted-foreground/40 rounded-xl bg-muted/20 flex flex-col items-center justify-center p-4 text-center ${n!=="auto"?m[n]:"min-h-[100px]"} ${i!=="full"?y[i]:"w-full"} ${s}`,children:[o.jsx("input",{ref:c,type:"file",accept:"image/*",onChange:x,className:"hidden"}),o.jsx("div",{className:"text-2xl mb-2",children:"🖼ï¸"}),o.jsx($n,{variant:"outline",size:"sm",onClick:_,disabled:u,className:"text-xs",children:u?o.jsxs(o.Fragment,{children:[o.jsx(md,{className:"w-3 h-3 mr-1 animate-spin"}),"Uploading..."]}):o.jsxs(o.Fragment,{children:[o.jsx(vd,{className:"w-3 h-3 mr-1"}),"Upload"]})})]})},o2=({isVisible:t,beanstalkImageSrc:e,onBeanstalkUpload:n})=>o.jsx(xP,{children:t&&o.jsx(ke.div,{initial:{y:"100%"},animate:{y:0},exit:{y:"100%"},transition:{duration:1.2,ease:[.4,0,.2,1]},className:"fixed bottom-0 right-0 z-30 h-screen ipad-portrait:!h-[45vh] pointer-events-none",children:e?o.jsx("img",{src:e,alt:"Magical beanstalk",className:"h-full w-auto object-contain"}):o.jsx("div",{className:"h-full w-32 pointer-events-auto",children:o.jsx(r2,{placeholder:"BEANSTALK",description:"Claymation beanstalk growing from bottom to top",aspectRatio:"auto",size:"full",className:"h-full",imageSrc:e,onUpload:n})})})}),i2="401989987777-08lbeuo9pch9kt8lfk5lprok19vp4bc0.apps.googleusercontent.com",a2="googleOneTapDismissed",l2=1e3*60*60,c2=async t=>{const e=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",e);return Array.from(new Uint8Array(n)).map(s=>s.toString(16).padStart(2,"0")).join("")},u2=()=>{const{user:t,isLoading:e}=Zc(),n=f.useRef(!1);return f.useEffect(()=>{if(t||e||n.current)return;const s=sessionStorage.getItem(a2);if(s&&Date.now()-Number(s)<l2)return;const r=()=>new Promise(c=>{if(document.querySelector('script[src="https://accounts.google.com/gsi/client"]')){c();return}const u=document.createElement("script");u.src="https://accounts.google.com/gsi/client",u.async=!0,u.onload=()=>c(),u.onerror=()=>c(),document.head.appendChild(u)});let i,a;const l=async()=>{if(!window.google?.accounts?.id)return!1;const c=crypto.randomUUID(),u=await c2(c);return window.google.accounts.id.initialize({client_id:i2,callback:async d=>{try{const{error:h}=await pe.auth.signInWithIdToken({provider:"google",token:d.credential,nonce:c});h&&console.error("[OneTap] Supabase signInWithIdToken error:",h)}catch(h){console.error("Google One Tap callback error:",h)}},use_fedcm_for_prompt:!0,auto_select:!1,cancel_on_tap_outside:!0,context:"signup",itp_support:!0,nonce:u,params:{nonce:u}}),window.google.accounts.id.prompt(),n.current=!0,!0};return r().then(()=>{l().then(c=>{c||(i=setInterval(()=>{l().then(u=>{u&&i&&clearInterval(i)})},300),a=setTimeout(()=>{i&&clearInterval(i)},5e3))})}),()=>{i&&clearInterval(i),a&&clearTimeout(a),window.google?.accounts?.id&&window.google.accounts.id.cancel()}},[t,e]),null},d2=f.lazy(()=>g(()=>import("./ProfessionalNarrationSection-Bmb7J3DU.js"),__vite__mapDeps([45,1,2,7,26,27]))),h2=f.lazy(()=>g(()=>import("./SyncedHighlightsSection-DPxvFBnP.js"),__vite__mapDeps([46,1,2,47,7,26,27]))),p2=f.lazy(()=>g(()=>import("./InteractiveWordsSection-CXpQfDOR.js"),__vite__mapDeps([48,1,2,7,26,27]))),f2=f.lazy(()=>g(()=>import("./VocabularySection-5DN3HJ-5.js"),__vite__mapDeps([49,1,2,20,7,26,27]))),m2=f.lazy(()=>g(()=>import("./ChooseYourPaceSection-ChHrbdV5.js"),__vite__mapDeps([50,1,2,20,7,51,26,27]))),g2=f.lazy(()=>g(()=>import("./DyslexiaSection-QTMGBu-e.js"),__vite__mapDeps([52,1,2,47,7,26,27]))),v2=f.lazy(()=>g(()=>import("./CheckTextSection-BXvzbFIj.js"),__vite__mapDeps([53,1,2,47,16,20,7,26,27]))),_2=f.lazy(()=>g(()=>import("./ThemesSection-cbv4--vE.js"),__vite__mapDeps([54,1,2,47,55,7,56,26,27]))),y2=f.lazy(()=>g(()=>import("./StoryMakerSection-C7R_velo.js"),__vite__mapDeps([57,1,2,20,7,26,27]))),x2=f.lazy(()=>g(()=>import("./AchievementsSection-DbODflB2.js"),__vite__mapDeps([58,1,2,20,7,26,27]))),b2=f.lazy(()=>g(()=>import("./HotAirBalloon-Di9GAu7M.js"),__vite__mapDeps([59,1,2,26,27,7]))),w2=f.lazy(()=>g(()=>import("./QuillWipe-DnU5m4Yw.js"),__vite__mapDeps([60,1,2,26,27,7]))),E2="https://cdn.storysparkle.org/landing_assets/flicker-on-beanstalk.webp",Te={white:"#FFFFFF",buttercream:"#FFF8E7",lavender:"#F3E8FF",sky:"#E0F2FE",lemon:"#FEF9C3",pink:"#FCE7F3",mint:"#F0FDF4",violet:"#EDE9FE",peach:"#FFF7ED",apricot:"#FFECD2",seafoam:"#E0F5F0",rose:"#FFE4E6",sage:"#ECF4E8"},ze=()=>{const{t}=Oe("home"),{getAsset:e,saveAsset:n}=CD(),s={"@context":"https://schema.org","@type":"FAQPage",mainEntity:t("faq.items",{returnObjects:!0,defaultValue:[]}).map(E=>({"@type":"Question",name:E.q,acceptedAnswer:{"@type":"Answer",text:E.a}}))},[r,i]=f.useState(!1),[a,l]=f.useState(!1),[c,u]=f.useState(0),d=f.useRef(null),h=f.useRef(null),{scrollYProgress:p}=_C({target:h,offset:["start start","end end"]}),m=af(p,[.4,.9],["100%","0%"]),y=af(p,[.4,.7],[0,1]),{setLumiTarget:_,setOnTargetReached:x}=lv(),[b,w]=f.useState(!1);return f.useEffect(()=>(x(()=>{w(!0),setTimeout(()=>{w(!1),_(null)},1e3)}),()=>x(void 0)),[x,_,w]),f.useEffect(()=>{const E=()=>{const T=window.scrollY,j=window.innerHeight,P=Math.floor(T/j);u(Math.min(P,10))};return window.addEventListener("scroll",E),()=>window.removeEventListener("scroll",E)},[]),o.jsxs(o.Fragment,{children:[o.jsx(u2,{}),o.jsx(nr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/",structuredData:[OD,DD,LD,MD,ND,s]}),o.jsxs("div",{className:"min-h-screen overflow-x-clip",style:{background:Te.white},children:[o.jsx(GD,{}),o.jsx(Vt,{topColor:Te.white,bottomColor:Te.buttercream,variant:8,flip:!0}),o.jsx(qD,{}),o.jsx(Vt,{topColor:Te.buttercream,bottomColor:Te.lavender,variant:8}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(d2,{})}),o.jsx(Vt,{topColor:Te.lavender,bottomColor:Te.sky,variant:2,flip:!0}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(h2,{})}),o.jsx(Vt,{topColor:Te.sky,bottomColor:Te.apricot,variant:9}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(p2,{videoSrc:e("interactive_words","main_video"),onVideoUpload:E=>n("interactive_words","main_video",E,"video"),onLumiTarget:E=>_(E),isWordHovered:b})}),o.jsx(Vt,{topColor:Te.apricot,bottomColor:Te.lemon,variant:4,flip:!0}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(f2,{})}),o.jsx(Vt,{topColor:Te.lemon,bottomColor:Te.seafoam,variant:10}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(m2,{})}),o.jsx("div",{className:"relative -mt-12 z-20 pointer-events-none",children:o.jsx(Vt,{topColor:"transparent",bottomColor:Te.pink,variant:6,flip:!0})}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(g2,{})}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(v2,{})}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(_2,{onInteractionComplete:()=>{},hasCarouselInteracted:!0})}),o.jsx(f.Suspense,{fallback:null,children:o.jsx(b2,{isActive:r,onComplete:()=>i(!1)})}),o.jsxs(f.Suspense,{fallback:null,children:[o.jsx(Vt,{topColor:Te.mint,bottomColor:Te.rose,variant:11}),o.jsx(y2,{flickerWritingImageSrc:e("story_maker","flicker_writing_image")}),o.jsx(w2,{isActive:a,onComplete:()=>l(!1)})]}),o.jsx(Vt,{topColor:Te.rose,bottomColor:Te.violet,variant:3,flip:!0}),o.jsx(f.Suspense,{fallback:o.jsx(vn,{}),children:o.jsx(x2,{})}),o.jsx(Vt,{topColor:Te.violet,bottomColor:Te.sage,variant:12}),o.jsxs("div",{className:"relative",children:[o.jsx(ZD,{sectionRef:h}),o.jsx(Vt,{topColor:Te.sage,bottomColor:Te.peach,variant:5,flip:!0}),o.jsx("div",{ref:d,children:o.jsx(e2,{})}),o.jsx("div",{className:"sticky bottom-0 h-0 z-30 pointer-events-none",children:o.jsx("div",{className:"absolute bottom-0 right-[5vw] w-[24vw] sm:w-[40vw] max-w-[250px] sm:max-w-[420px] h-[312px] sm:h-[65vh] ipad-portrait:!w-[30vw] ipad-portrait:!max-w-[280px] ipad-portrait:!h-[45vh] overflow-hidden",children:o.jsx(ke.img,{src:E2,alt:"Flicker on Beanstalk",className:"absolute inset-0 w-full h-full object-contain object-bottom will-change-transform",width:420,height:650,loading:"lazy",decoding:"async",style:{y:m,opacity:y}})})})]}),o.jsx(o2,{isVisible:!1,beanstalkImageSrc:e("progress","beanstalk_image"),onBeanstalkUpload:E=>n("progress","beanstalk_image",E,"image")})]})]})},j2="https://cdn.storysparkle.org";async function T2(){try{return[{name:"OpenDyslexic-Regular.woff2",format:"woff2"},{name:"OpenDyslexic-Regular.woff",format:"woff"},{name:"OpenDyslexic-Bold.woff2",format:"woff2"},{name:"OpenDyslexic-Bold.woff",format:"woff"}].map(e=>({name:e.name,url:`${j2}/fonts/${e.name}`,format:e.format}))}catch(t){return console.error("Failed to load fonts:",t),[]}}function P2(){const[t,e]=f.useState(!1);return f.useEffect(()=>{(async()=>{await new Promise(s=>{"requestIdleCallback"in window?window.requestIdleCallback(()=>s(),{timeout:5e3}):setTimeout(s,3e3)});try{const s=await T2();if(s.length===0){console.log("No fonts found in storage, using fallback"),e(!0);return}const r=s.map(i=>{const a=i.name.includes("Bold");return new FontFace("OpenDyslexic",`url(${i.url}) format('${i.format}')`,{weight:a?"700":"400",style:"normal",display:"swap"}).load().then(c=>(document.fonts.add(c),c))});await Promise.all(r),e(!0),console.log("All fonts loaded from Supabase")}catch(s){console.error("Error loading fonts (using fallback):",s),e(!0)}})()},[]),null}const k2=()=>{const{pathname:t}=Ys();return f.useEffect(()=>{window.scrollTo(0,0)},[t]),null},S2="Main Scene",R2=0,A2=260.1941560444079,C2=260.1941046463815,I2={g:"@lottiefiles/creator@1.88.0"},O2=[{ty:0,nm:"StorySparkle Logo",sr:1,st:0,op:90,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[92,92]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[130.09706517269734,130.09706517269737]},r:{a:1,k:[{o:{x:.66,y:0},i:{x:.34,y:1},s:[50],t:0},{o:{x:.66,y:0},i:{x:.34,y:1},s:[-50],t:22.63},{o:{x:.66,y:0},i:{x:.34,y:1},s:[50],t:45.25},{o:{x:.66,y:0},i:{x:.34,y:1},s:[-50],t:67.87},{s:[50],t:90}]},sa:{a:0,k:0},o:{a:0,k:100}},w:184,h:184,refId:"precomp_Shape Layer - SVG_ktGbUW1Zv3_b371b8fc-0abe-40ce-b884-13b7441df0ed",ind:1}],D2="5.7.0",L2=30,M2=90,N2=0,V2=[{nm:"StorySparkle Logo",id:"precomp_Shape Layer - SVG_ktGbUW1Zv3_b371b8fc-0abe-40ce-b884-13b7441df0ed",fr:30,layers:[{ty:4,nm:"Shape Layer 1",sr:1,st:0,op:90,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[24.356674043576486,24.364452763262335]},s:{a:0,k:[377.95,377.95]},sk:{a:0,k:0},p:{a:0,k:[92.05604954769733,92.08544921875]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},shapes:[{ty:"gr",bm:0,hd:!1,nm:"g1893",np:3,it:[{ty:"gr",bm:0,hd:!1,nm:"g1747",np:5,it:[{ty:"gr",bm:0,hd:!1,nm:"g14158-7",np:3,it:[{ty:"gr",bm:0,hd:!1,nm:"path14149-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 1",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,-1.61]],o:[[0,1.61],[0,0]],v:[[83.2,135.12],[83.2,139.95]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.8,.0196]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[83.19985747300423,137.5333392562743]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.19985747300423,137.5333392562743]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"g14147-7",np:3,it:[{ty:"gr",bm:0,hd:!1,nm:"g13994-6",np:2,it:[{ty:"gr",bm:0,hd:!1,nm:"path13986-2",np:4,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 2",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,0],[3.33,1.13],[2.63,.45],[1.99,-1.31],[1.05,-1.31],[0,0],[0,0]],o:[[0,0],[-4.33,-.06],[-3.33,-1.13],[-2.63,-.45],[-1.99,1.31],[0,0],[0,0],[0,0]],v:[[113.56,144.76],[113.56,140.3],[101.56,139.06],[93.25,135.27],[85.7,137.43],[81.61,141.35],[81.64,144.76],[113.56,144.76]]}}},{ty:"sh",bm:0,hd:!1,nm:"Path 3",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,0],[-3.33,1.13],[-2.63,.45],[-1.99,-1.31],[-1.05,-1.31],[0,0],[0,0]],o:[[0,0],[4.33,-.06],[3.33,-1.13],[2.63,-.45],[1.99,1.31],[0,0],[0,0],[0,0]],v:[[49.66,144.76],[49.66,140.3],[61.66,139.06],[69.97,135.27],[77.52,137.43],[81.61,141.35],[81.64,144.76],[49.66,144.76]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.8,.0196]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[81.60584766273162,139.893564781624]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[81.60584766273162,139.893564781624]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[81.60584766273162,139.893564781624]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17584766273161,131.313564781624]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"rect13980-5",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 4",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,0],[0,-1.33],[0,0],[1.63,0],[0,0],[0,1.33],[0,0],[-1.63,0]],o:[[0,0],[1.63,0],[0,0],[0,1.33],[0,0],[-1.63,0],[0,0],[0,-1.33],[0,0]],v:[[51.44,136.18],[114.92,136.18],[117.87,138.59],[117.87,138.59],[114.92,141],[51.44,141],[48.48,138.59],[48.48,138.59],[51.44,136.18]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.8,.0196]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[83.17104570067707,138.5885372942198]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17104570067707,138.5885372942198]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[83.17104570067707,133.72414973299237]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17104570067707,132.66414973299237]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[83.17104570067707,132.66895169504693]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[83.17104570067707,127.37895169504692]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path16323-5",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 5",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[0,-6.99],[-2.37,-2.37],[-3.36,0],[-2.15,4.28],[.93,0],[0,5.67],[-2.59,1.94],[.81,0]],o:[[-6.99,0],[0,3.36],[2.37,2.37],[4.79,0],[-.89,.25],[-5.67,0],[0,-3.23],[-.8,-.16],[0,0]],v:[[65.73,68.45],[53.07,81.11],[56.78,90.06],[65.73,93.77],[77.04,86.79],[74.31,87.17],[64.04,76.9],[68.15,68.68],[65.73,68.45]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:2,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.349,.749,.6784]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[65.09165856541426,81.10724533770491]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[65.09165856541426,81.10724533770491]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"g4820-5",np:10,it:[{ty:"gr",bm:0,hd:!1,nm:"path4510-1-1-9-9-9",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 6",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[95.63,92.56],[93.06,95.13]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[94.34130335898263,93.83873294507185]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[94.34130335898263,93.83873294507185]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-0-8-6-4",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 7",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[112.32,75.86],[109.75,78.43]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[111.03292346048953,77.14231088151041]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[111.03292346048953,77.14231088151041]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-1-1-9-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 8",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[92.7,85.5],[89.07,85.5]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[90.8838906797292,85.49772485637291]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[90.8838906797292,85.49772485637291]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-0-8-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 9",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[116.31,85.5],[112.68,85.5]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[114.49033613974304,85.49772485637291]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[114.49033613974304,85.49772485637291]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-1-1-7",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 10",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[95.63,78.43],[93.06,75.86]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[94.34130335898263,77.14231088151041]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[94.34130335898263,77.14231088151041]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-0-2",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 11",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[112.32,95.13],[109.75,92.56]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[111.03292346048953,93.83873294507185]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[111.03292346048953,93.83873294507185]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-1-8",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 12",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[102.69,95.48],[102.69,99.12]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[102.68711340973613,97.29614562432529]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[102.68711340973613,97.29614562432529]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path4510-06",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 13",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,0]],o:[[0,0],[0,0]],v:[[102.69,71.87],[102.69,75.51]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[102.68711340973613,73.68970016431149]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[102.68711340973613,73.68970016431149]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path3766-8",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 14",d:1,ks:{a:0,k:{c:!0,i:[[0,0],[1.21,-1.21],[1.71,0],[1.21,1.21],[0,1.71],[-1.21,1.21],[-1.71,0],[-1.21,-1.21],[0,-1.71]],o:[[0,1.71],[-1.21,1.21],[-1.71,0],[-1.21,-1.21],[0,-1.71],[1.21,-1.21],[1.71,0],[1.21,1.21],[0,0]],v:[[109.13,85.5],[107.25,90.05],[102.69,91.94],[98.13,90.05],[96.24,85.5],[98.13,80.94],[102.69,79.05],[107.25,80.94],[109.13,85.5]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.749,.0196,.0118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[102.67750948562706,85.48812093226385]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[102.67750948562706,85.48812093226385]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[102.68711340973613,85.49292289431838]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[101.93711340973613,85.21292289431838]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"g13931-2",np:4,it:[{ty:"gr",bm:0,hd:!1,nm:"path13914-1",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 15",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.71],[-4.96,0],[0,-4.96],[.92,-1.44]],o:[[-.92,-1.44],[0,-4.96],[4.96,0],[0,1.71],[0,0]],v:[[75.31,130.68],[73.9,125.86],[82.88,116.88],[91.86,125.86],[90.45,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[1,1,1]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,123.81589585059405]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,123.81589585059405]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path13918-5",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 16",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.64],[-8.18,0],[0,-8.18],[.53,-1.55]],o:[[-.53,-1.55],[0,-8.18],[8.18,0],[0,1.64],[0,0]],v:[[68.88,130.68],[68.07,125.86],[82.88,111.05],[97.69,125.86],[96.88,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.349,.749,.6784]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,120.90110488350122]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,120.90110488350122]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path13922-0",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 17",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.62],[-11.9,0],[0,-11.9],[.36,-1.58]],o:[[-.36,-1.58],[0,-11.9],[11.9,0],[0,1.62],[0,0]],v:[[61.88,130.68],[61.33,125.86],[82.88,104.32],[104.43,125.86],[103.88,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.4,.651,.2118]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,117.53012752122908]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,117.53012752122908]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"gr",bm:0,hd:!1,nm:"path5706-9-2-2-4",np:3,it:[{ty:"sh",bm:0,hd:!1,nm:"Path 18",d:1,ks:{a:0,k:{c:!1,i:[[0,0],[0,1.62],[-15.27,0],[0,-15.27],[0,0],[.28,-1.59]],o:[[-.28,-1.59],[0,-15.27],[15.27,0],[0,0],[0,1.62],[0,0]],v:[[55.65,130.68],[55.22,125.86],[82.88,98.2],[110.54,125.86],[110.54,125.86],[110.11,130.68]]}}},{ty:"st",bm:0,hd:!1,nm:"Stroke",lc:2,lj:1,ml:4,o:{a:0,k:100},w:{a:0,k:1.41},c:{a:0,k:[0,0,0]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[.949,.4902,.4902]},r:1,o:{a:0,k:100}},{ty:"tr",a:{a:0,k:[82.87332405329694,114.45206984428263]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,114.45206984428263]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[82.87332405329694,114.4760796545552]},s:{a:0,k:[100,100]},sk:{a:0,k:0},p:{a:0,k:[82.87332405329694,114.4760796545552]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[83.17104570067707,101.55399976584549]},s:{a:0,k:[58.42,58.42]},sk:{a:0,k:0},p:{a:0,k:[-193.43147510166446,151.09784666320695]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]},{ty:"tr",a:{a:0,k:[-193.43001765741099,151.09500848229226]},s:{a:0,k:[62.05,62.05]},sk:{a:0,k:0},p:{a:0,k:[24.35667404357649,24.364452763262335]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}}]}],ind:1},{ty:4,nm:"Ellipse 2",sr:1,st:0,op:90,ip:0,hd:!1,ddd:0,bm:0,hasMask:!1,ao:0,ks:{a:{a:0,k:[0,0]},s:{a:0,k:[110.58860990667239,102.92084485785465]},sk:{a:0,k:0},p:{a:0,k:[91.99999833904434,92.00000410170529]},r:{a:0,k:0},sa:{a:0,k:0},o:{a:0,k:100}},shapes:[{ty:"el",bm:0,hd:!1,nm:"Ellipse Shape 1",d:1,p:{a:0,k:[0,0]},s:{a:0,k:[155.76450914731709,173.36591162188924]}},{ty:"fl",bm:0,hd:!1,nm:"Fill",c:{a:0,k:[1,1,1]},r:1,o:{a:0,k:100}}],ind:2}]}],F2={nm:S2,ddd:R2,h:A2,w:C2,meta:I2,layers:O2,v:D2,fr:L2,op:M2,ip:N2,assets:V2},$2=f.lazy(()=>g(()=>import("./index.es-C3Wz79fL.js"),__vite__mapDeps([61,2]))),Dy=({delay:t=150,label:e="Loading…",overlay:n=!0,minHeight:s="60vh",transparent:r=!1})=>{const[i,a]=f.useState(!1),[l,c]=f.useState(!1);f.useEffect(()=>{const h=window.matchMedia("(prefers-reduced-motion: reduce)");c(h.matches);const p=setTimeout(()=>a(!0),t);return()=>clearTimeout(p)},[t]),f.useEffect(()=>{if(!n)return;const h=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=h}},[n]);const u=r?{}:{background:"radial-gradient(circle at center, white 0%, white 30%, #a5f3fc 100%)"},d=n?`fixed inset-0 z-40 w-screen h-screen flex items-center justify-center${r?" pointer-events-auto":""}`:"w-full flex items-center justify-center";return o.jsxs("div",{role:"status","aria-busy":"true","aria-live":"polite","aria-label":e,className:d,style:n?u:{...u,minHeight:s},children:[i&&o.jsx(f.Suspense,{fallback:o.jsx("span",{className:"sr-only",children:e}),children:o.jsx("div",{className:"w-32 h-32 md:w-40 md:h-40",style:r?{filter:"drop-shadow(0 6px 14px rgba(0,0,0,0.12)) drop-shadow(0 2px 4px rgba(0,0,0,0.08))",willChange:"transform"}:void 0,children:o.jsx($2,{animationData:F2,loop:!0,autoplay:!l,initialSegment:[0,90],"aria-hidden":"true"})})}),o.jsx("span",{className:"sr-only",children:e})]})},B2=()=>{const{isSwitchingLanguage:t}=hn();return t?o.jsx(Dy,{overlay:!0,transparent:!0}):null},z2=()=>{const{t}=Oe("landing"),[e,n]=f.useState(!1);return f.useEffect(()=>{if(typeof window>"u"||!window.matchMedia)return;const s=window.matchMedia("(max-width: 767px) and (orientation: landscape)"),r=()=>n(s.matches);return r(),s.addEventListener?.("change",r),()=>s.removeEventListener?.("change",r)},[]),f.useEffect(()=>{const s=window.screen?.orientation;if(s?.lock)try{s.lock("portrait").catch(()=>{})}catch{}},[e]),f.useEffect(()=>{if(!e)return;const s=document.body.style.overflow;return document.body.style.overflow="hidden",()=>{document.body.style.overflow=s}},[e]),e?o.jsxs("div",{role:"alertdialog","aria-modal":"true",className:"fixed inset-0 z-[9999] flex flex-col items-center justify-center gap-4 bg-background text-foreground px-6 text-center",children:[o.jsx(Fb,{className:"h-14 w-14 text-primary",style:{animation:"rotateHint 1.8s ease-in-out infinite"}}),o.jsx("h2",{className:"text-xl font-semibold",children:t("rotate.title")}),o.jsx("p",{className:"text-sm text-muted-foreground max-w-xs",children:t("rotate.subtitle")}),o.jsx("style",{children:`
@keyframes rotateHint {
0%, 100% { transform: rotate(-90deg); }
50% { transform: rotate(0deg); }
}
`})]}):null},U2=["en","es","bn","zh","ja","ko","th","vi","hi","pt","fil","ms","id","my","km","lo"],H2=t=>{const e=t.match(/^\/([a-z]{2})(\/|$)/);return e&&U2.includes(e[1])?e[1]:null},W2=t=>t?`/${t}/subscription`:"/subscription",G2=t=>{const e=t.match(/^(?:\/[a-z]{2})?\/story\/([^/?#]+)/);return e?e[1]:null},K2=()=>{const t=wc();f.useEffect(()=>{const{data:{subscription:e}}=pe.auth.onAuthStateChange((n,s)=>{if(n!=="SIGNED_IN")return;const r=sessionStorage.getItem("pendingAuthRedirect");if(!r)return;sessionStorage.removeItem("pendingAuthRedirect");const i=G2(r);if(!i||!s?.user){setTimeout(()=>t(r),0);return}(async()=>{try{const a=H2(r),[l,c,u]=await Promise.all([pe.from("stories").select("access_level").eq("id",i).maybeSingle(),pe.from("profiles").select("user_type").eq("id",s.user.id).maybeSingle(),pe.from("user_payments").select("subscription_status, subscription_end_date").eq("user_id",s.user.id).maybeSingle()]),d=l.data?.access_level??"paid",h=c.data?.user_type??"free",p=u.data?.subscription_status,m=u.data?.subscription_end_date?new Date(u.data.subscription_end_date):null,y=p==="active"&&(!m||m>new Date);let _=!1;h==="admin"||d==="guest"||d==="free"?_=!0:d==="paid"&&(_=h==="paid"||y),_?setTimeout(()=>t(r),0):(sessionStorage.setItem("postSubscriptionRedirect",r),setTimeout(()=>t(W2(a)),0))}catch(a){console.error("[useAuthRedirect] story access check failed:",a),setTimeout(()=>t(r),0)}})()});return()=>e.unsubscribe()},[t])},Ue=()=>{const{t}=Oe("improve-reading");return o.jsx(nr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/improve-reading"})},He=()=>{const{t}=Oe("contact");return o.jsx(nr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/contact"})},We=()=>{const{t}=Oe("subscription");return o.jsx(nr,{title:t("meta.title"),description:t("meta.description"),keywords:t("meta.keywords",{defaultValue:""})||void 0,canonical:"/subscription"})},Ge=()=>{const{t}=Oe("auth");return o.jsx(nr,{title:t("meta.login.title"),description:t("meta.login.description"),keywords:t("meta.login.keywords",{defaultValue:""})||void 0,canonical:"/login",noIndex:!0})},Ke=()=>{const{t}=Oe("auth");return o.jsx(nr,{title:t("meta.signup.title"),description:t("meta.signup.description"),keywords:t("meta.signup.keywords",{defaultValue:""})||void 0,canonical:"/signup"})},qe=f.lazy(()=>g(()=>import("./StoriesPage-CX89pBbh.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27]))),le=f.lazy(()=>g(()=>import("./StoryReaderPage-C751KdWa.js"),__vite__mapDeps([62,1,2,63,64,32,65,15,66,7,51,34,56,24,10,11,67,38,8,20,68,4,69,70,33,43,47,71,21,26,27]))),Ye=f.lazy(()=>g(()=>import("./AboutPage-D_N5S73S.js"),__vite__mapDeps([72,1,2,21,7,55,56,73,9,26,27]))),Xe=f.lazy(()=>g(()=>import("./ContactPage-BkHCwg1Y.js"),__vite__mapDeps([74,1,2,17,30,75,19,24,76,21,7,44,77,26,27]))),Ze=f.lazy(()=>g(()=>import("./ImproveReadingPage-CleWJ81u.js"),__vite__mapDeps([78,1,2,4,21,7,38,79,80,81,82,26,27]))),Je=f.lazy(()=>g(()=>import("./AuthPages-DrYIgUgT.js"),__vite__mapDeps([83,1,2,17,84,32,76,7,44,85,79,26,27])).then(t=>({default:t.LoginPage}))),Qe=f.lazy(()=>g(()=>import("./AuthPages-DrYIgUgT.js"),__vite__mapDeps([83,1,2,17,84,32,76,7,44,85,79,26,27])).then(t=>({default:t.SignupPage}))),et=f.lazy(()=>g(()=>import("./ResetPasswordPage-B2pUQpuX.js"),__vite__mapDeps([86,1,2,17,7,44,63,77,85,79,26,27]))),tt=f.lazy(()=>g(()=>import("./VerifyEmailPage-DwMCNtoa.js"),__vite__mapDeps([87,1,2,4,7,44,13,77,63,26,27]))),q2=f.lazy(()=>g(()=>import("./NotFound-D2lUJS8I.js"),__vite__mapDeps([88,1,2,7,63,26,27]))),nt=f.lazy(()=>g(()=>import("./ProgressPage-C_5Q8viI.js"),__vite__mapDeps([89,1,2,4,68,22,21,7,90,36,37,91,69,6,82,12,13,92,23,26,27]))),st=f.lazy(()=>g(()=>import("./ReadingCartPage-C51oylI8.js"),__vite__mapDeps([93,1,2,3,4,5,6,7,8,9,10,11,12,13,14,21,26,27]))),rt=f.lazy(()=>g(()=>import("./VocabularyNotebookPage-CplzBmvB.js"),__vite__mapDeps([94,1,2,4,17,95,66,18,19,21,7,11,23,67,96,33,24,26,27]))),Y2=f.lazy(()=>g(()=>import("./AdminPage-CdoaX6dB.js"),__vite__mapDeps([97,1,2,15,17,31,32,24,33,4,98,30,18,19,41,95,65,66,7,23,79,75,96,64,99,91,70,39,90,34,84,43,14,42,100,13,101,16,102,92,103,20,10,104,77,26,25,6,85,105,35,69,36,44,80,56,27]))),X2=f.lazy(()=>g(()=>import("./FontManagementPage-DmFqf1g1.js"),__vite__mapDeps([106,1,2,4,17,104,70,96,26,27,7]))),ot=f.lazy(()=>g(()=>import("./TermsPage-DwXm6iCg.js"),__vite__mapDeps([107,1,2,98,21,7,26,27]))),it=f.lazy(()=>g(()=>import("./PrivacyPage-CbYhipxS.js"),__vite__mapDeps([108,1,2,98,21,7,26,27]))),at=f.lazy(()=>g(()=>import("./RefundPage-DZfjEnDG.js"),__vite__mapDeps([109,1,2,98,21,7,26,27]))),lt=f.lazy(()=>g(()=>import("./SubscriptionPage-DlqOYjc5.js"),__vite__mapDeps([110,1,2,69,29,7,91,99,5,81,21,73,4,71,92,26,27]))),re=f.lazy(()=>g(()=>import("./PaymentStatusPage-oce1QZRf.js"),__vite__mapDeps([111,1,2,4,7,77,100,26,27]))),ct=f.lazy(()=>g(()=>import("./ThemeInfoPage-BKilbYGu.js"),__vite__mapDeps([112,1,2,4,98,21,7,38,9,26,27]))),ut=f.lazy(()=>g(()=>import("./BlogPage-BtM1R41V.js"),__vite__mapDeps([113,1,2,17,114,4,13,101,7,21,23,26,27]))),ce=f.lazy(()=>g(()=>import("./BlogPostPage-C6DEQg_b.js"),__vite__mapDeps([115,1,2,102,4,22,105,25,38,7,101,21,63,92,13,26,27]))),dt=f.lazy(()=>g(()=>import("./NewsletterPage-DlsskTwk.js"),__vite__mapDeps([116,1,2,17,114,4,13,101,21,7,23,26,27]))),ht=f.lazy(()=>g(()=>import("./StoryMakerPage-KV3jJ56H.js"),__vite__mapDeps([117,1,2,29,21,7,4,95,17,103,64,32,69,25,43,16,42,39,105,26,27]))),pt=f.lazy(()=>g(()=>import("./ResearchPage-gnPTQOIO.js"),__vite__mapDeps([40,1,2,21,7,4,41,38,14,42,43,35,44,26,27]))),ft=f.lazy(()=>g(()=>import("./TextCheckerPage-BHcTeG5R.js"),__vite__mapDeps([28,1,2,29,30,4,31,32,24,33,7,34,23,35,36,37,6,22,21,38,27,39,26]))),Z2=new Wy({defaultOptions:{queries:{retry:1,refetchOnWindowFocus:!1,staleTime:5*60*1e3}}}),J2=()=>(K2(),null),Q2=()=>{const{targetElement:t,onTargetReached:e}=lv();return o.jsx(PC,{targetElement:t,onTargetReached:e})},eL=()=>o.jsx(Dy,{}),tL=({children:t})=>{const e=Ys();return o.jsx(Rf,{children:t},e.pathname)};function nL(){return o.jsx(Jy,{children:o.jsx(Gy,{client:Z2,children:o.jsx(LE,{children:o.jsx(qy,{children:o.jsx(AC,{children:o.jsx(lP,{children:o.jsx(pP,{children:o.jsx(fP,{children:o.jsxs(mP,{children:[o.jsx(MC,{}),o.jsx(P2,{}),o.jsx(k2,{}),o.jsx(J2,{}),o.jsx(Q2,{}),o.jsx(B2,{}),o.jsx(z2,{}),o.jsxs("div",{className:"min-h-screen flex flex-col",children:[o.jsx(SD,{}),o.jsx("main",{className:"flex-1",children:o.jsx(tL,{children:o.jsx(f.Suspense,{fallback:o.jsx(eL,{}),children:o.jsxs(Yy,{children:[o.jsx(v,{path:"/",element:o.jsx(ze,{})}),o.jsx(v,{path:"/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/admin",element:o.jsx(Y2,{})}),o.jsx(v,{path:"/admin/fonts",element:o.jsx(X2,{})}),o.jsx(v,{path:"/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/payment/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/payment/cancel",element:o.jsx(re,{})}),o.jsx(v,{path:"/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/es",element:o.jsx(ze,{})}),o.jsx(v,{path:"/es/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/es/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/es/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/es/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/es/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/es/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/es/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/es/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/es/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/es/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/es/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/es/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/es/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/es/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/es/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/es/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/es/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/es/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/es/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/es/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/es/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/es/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/es/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/es/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/es/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/es/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/bn",element:o.jsx(ze,{})}),o.jsx(v,{path:"/bn/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/bn/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/bn/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/bn/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/bn/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/bn/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/bn/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/bn/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/bn/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/bn/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/bn/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/bn/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/bn/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/bn/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/bn/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/bn/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/bn/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/bn/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/bn/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/bn/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/bn/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/bn/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/bn/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/bn/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/bn/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/bn/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/zh",element:o.jsx(ze,{})}),o.jsx(v,{path:"/zh/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/zh/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/zh/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/zh/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/zh/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/zh/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/zh/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/zh/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/zh/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/zh/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/zh/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/zh/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/zh/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/zh/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/zh/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/zh/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/zh/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/zh/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/zh/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/zh/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/zh/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/zh/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/zh/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/zh/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/zh/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/zh/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/ja",element:o.jsx(ze,{})}),o.jsx(v,{path:"/ja/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/ja/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/ja/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/ja/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/ja/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/ja/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/ja/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/ja/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/ja/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/ja/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/ja/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/ja/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/ja/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/ja/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/ja/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/ja/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/ja/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/ja/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/ja/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/ja/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/ja/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/ja/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/ja/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/ja/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/ja/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/ja/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/ko",element:o.jsx(ze,{})}),o.jsx(v,{path:"/ko/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/ko/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/ko/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/ko/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/ko/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/ko/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/ko/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/ko/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/ko/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/ko/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/ko/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/ko/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/ko/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/ko/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/ko/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/ko/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/ko/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/ko/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/ko/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/ko/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/ko/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/ko/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/ko/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/ko/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/ko/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/ko/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/th",element:o.jsx(ze,{})}),o.jsx(v,{path:"/th/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/th/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/th/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/th/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/th/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/th/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/th/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/th/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/th/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/th/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/th/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/th/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/th/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/th/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/th/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/th/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/th/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/th/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/th/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/th/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/th/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/th/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/th/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/th/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/th/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/th/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/vi",element:o.jsx(ze,{})}),o.jsx(v,{path:"/vi/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/vi/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/vi/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/vi/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/vi/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/vi/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/vi/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/vi/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/vi/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/vi/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/vi/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/vi/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/vi/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/vi/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/vi/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/vi/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/vi/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/vi/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/vi/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/vi/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/vi/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/vi/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/vi/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/vi/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/vi/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/vi/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/hi",element:o.jsx(ze,{})}),o.jsx(v,{path:"/hi/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/hi/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/hi/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/hi/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/hi/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/hi/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/hi/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/hi/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/hi/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/hi/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/hi/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/hi/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/hi/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/hi/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/hi/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/hi/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/hi/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/hi/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/hi/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/hi/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/hi/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/hi/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/hi/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/hi/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/hi/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/hi/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/pt",element:o.jsx(ze,{})}),o.jsx(v,{path:"/pt/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/pt/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/pt/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/pt/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/pt/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/pt/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/pt/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/pt/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/pt/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/pt/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/pt/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/pt/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/pt/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/pt/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/pt/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/pt/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/pt/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/pt/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/pt/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/pt/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/pt/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/pt/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/pt/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/pt/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/pt/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/pt/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/fil",element:o.jsx(ze,{})}),o.jsx(v,{path:"/fil/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/fil/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/fil/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/fil/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/fil/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/fil/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/fil/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/fil/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/fil/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/fil/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/fil/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/fil/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/fil/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/fil/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/fil/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/fil/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/fil/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/fil/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/fil/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/fil/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/fil/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/fil/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/fil/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/fil/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/fil/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/fil/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/ms",element:o.jsx(ze,{})}),o.jsx(v,{path:"/ms/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/ms/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/ms/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/ms/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/ms/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/ms/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/ms/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/ms/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/ms/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/ms/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/ms/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/ms/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/ms/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/ms/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/ms/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/ms/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/ms/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/ms/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/ms/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/ms/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/ms/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/ms/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/ms/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/ms/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/ms/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/ms/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/id",element:o.jsx(ze,{})}),o.jsx(v,{path:"/id/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/id/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/id/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/id/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/id/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/id/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/id/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/id/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/id/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/id/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/id/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/id/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/id/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/id/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/id/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/id/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/id/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/id/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/id/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/id/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/id/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/id/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/id/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/id/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/id/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/id/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/my",element:o.jsx(ze,{})}),o.jsx(v,{path:"/my/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/my/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/my/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/my/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/my/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/my/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/my/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/my/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/my/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/my/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/my/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/my/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/my/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/my/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/my/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/my/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/my/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/my/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/my/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/my/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/my/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/my/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/my/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/my/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/my/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/my/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/es/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/bn/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/zh/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/ja/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/ko/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/th/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/vi/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/hi/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/pt/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/fil/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/ms/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/id/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/my/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/km",element:o.jsx(ze,{})}),o.jsx(v,{path:"/km/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/km/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/km/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/km/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/km/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/km/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/km/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/km/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/km/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/km/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/km/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/km/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/km/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/km/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/km/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/km/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/km/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/km/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/km/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/km/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/km/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/km/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/km/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/km/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/km/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/km/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/km/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"/lo",element:o.jsx(ze,{})}),o.jsx(v,{path:"/lo/stories",element:o.jsx(qe,{})}),o.jsx(v,{path:"/lo/story-maker",element:o.jsx(ht,{})}),o.jsx(v,{path:"/lo/stories/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/lo/story/:id",element:o.jsx(le,{})}),o.jsx(v,{path:"/lo/improve-reading",element:o.jsxs(o.Fragment,{children:[o.jsx(Ue,{}),o.jsx(Ze,{})]})}),o.jsx(v,{path:"/lo/themes",element:o.jsx(ct,{})}),o.jsx(v,{path:"/lo/about",element:o.jsx(Ye,{})}),o.jsx(v,{path:"/lo/contact",element:o.jsxs(o.Fragment,{children:[o.jsx(He,{}),o.jsx(Xe,{})]})}),o.jsx(v,{path:"/lo/blog",element:o.jsx(ut,{})}),o.jsx(v,{path:"/lo/blog/newsletter",element:o.jsx(dt,{})}),o.jsx(v,{path:"/lo/blog/newsletter/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/lo/blog/:slug",element:o.jsx(ce,{})}),o.jsx(v,{path:"/lo/research",element:o.jsx(pt,{})}),o.jsx(v,{path:"/lo/login",element:o.jsxs(o.Fragment,{children:[o.jsx(Ge,{}),o.jsx(Je,{})]})}),o.jsx(v,{path:"/lo/signup",element:o.jsxs(o.Fragment,{children:[o.jsx(Ke,{}),o.jsx(Qe,{})]})}),o.jsx(v,{path:"/lo/reset-password",element:o.jsx(et,{})}),o.jsx(v,{path:"/lo/verify-email",element:o.jsx(tt,{})}),o.jsx(v,{path:"/lo/progress",element:o.jsx(nt,{})}),o.jsx(v,{path:"/lo/reading-cart",element:o.jsx(st,{})}),o.jsx(v,{path:"/lo/vocabulary",element:o.jsx(rt,{})}),o.jsx(v,{path:"/lo/terms",element:o.jsx(ot,{})}),o.jsx(v,{path:"/lo/privacy",element:o.jsx(it,{})}),o.jsx(v,{path:"/lo/refund",element:o.jsx(at,{})}),o.jsx(v,{path:"/lo/subscription",element:o.jsxs(o.Fragment,{children:[o.jsx(We,{}),o.jsx(lt,{})]})}),o.jsx(v,{path:"/lo/stripe/success",element:o.jsx(re,{})}),o.jsx(v,{path:"/lo/stripe/failure",element:o.jsx(re,{})}),o.jsx(v,{path:"/lo/text-checker",element:o.jsx(ft,{})}),o.jsx(v,{path:"*",element:o.jsx(q2,{})})]})})})}),o.jsx(AD,{})]}),o.jsx(Aw,{}),o.jsx(o1,{})]})})})})})})})})})}const jf="ss_build_id",sL=60*1e3,rL=2e3,oL="ss-build";let qs=null,ll=null,Ur=null;const co=()=>{try{const t=window.location.pathname;return t.includes("/story/")||t.includes("/story-maker")}catch{return!1}},Ly=()=>{try{return"1786250525221-slvyfd"}catch{return"dev"}};async function iL(){try{const t=Ly();if(localStorage.getItem(jf)===t)return;if("caches"in window){const n=await caches.keys();await Promise.all(n.map(s=>caches.delete(s)))}if("serviceWorker"in navigator){const n=await navigator.serviceWorker.getRegistrations();await Promise.all(n.map(s=>s.update().catch(()=>{})))}localStorage.setItem(jf,t)}catch{}}function My(t,e=!1){if(!(t===Ly()||t===qs)){if(qs=t,console.info("[build-version] new build detected:",t),!e&&Ur)try{Ur.postMessage({type:"stale",buildId:t})}catch{}typeof document<"u"&&document.visibilityState==="hidden"&&!co()&&window.location.reload()}}async function Cr(){try{const t=await fetch(`/version.json?t=${Date.now()}`,{cache:"no-store",headers:{"cache-control":"no-cache"}});if(!t.ok)return;const n=(await t.json())?.buildId;if(!n)return;My(n)}catch{}}function aL(){if(typeof window>"u")return;const t=window;if(t.__ssNavReloadInstalled)return;t.__ssNavReloadInstalled=!0;const e=l=>{if(!qs||co())return!1;const c=l?String(l):window.location.pathname+window.location.search;return window.location.href=c,!0},n=history.pushState.bind(history),s=history.replaceState.bind(history);history.pushState=function(l,c,u){if(!e(u))return n(l,c,u??null)},history.replaceState=function(l,c,u){if(!e(u))return s(l,c,u??null)},window.addEventListener("popstate",()=>{qs&&!co()&&window.location.reload()});const r=()=>{Cr()},i=history.pushState,a=history.replaceState;history.pushState=function(...l){const c=i.apply(this,l);return r(),c},history.replaceState=function(...l){const c=a.apply(this,l);return r(),c}}function lL(){if(!(typeof window>"u")){aL();try{Ur=new BroadcastChannel(oL),Ur.onmessage=t=>{const e=t?.data?.buildId;typeof e=="string"&&My(e,!0)}}catch{Ur=null}setTimeout(()=>void Cr(),rL),ll&&clearInterval(ll),ll=setInterval(()=>void Cr(),sL),document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(qs&&!co()){window.location.reload();return}Cr()}}),window.addEventListener("focus",()=>{if(qs&&!co()){window.location.reload();return}Cr()})}}const ss="storyMakerDraft",Ir="storyMakerDraft",Ju=2,cL=24*60*60*1e3,ua=()=>typeof window<"u",uL=()=>{if(ua())try{const t=sessionStorage.getItem(Ir);if(!t)return;if(localStorage.getItem(ss)){sessionStorage.removeItem(Ir);return}let e;try{e=JSON.parse(t)}catch{sessionStorage.removeItem(Ir);return}const n={v:Ju,savedAt:Date.now(),data:e};localStorage.setItem(ss,JSON.stringify(n)),sessionStorage.removeItem(Ir)}catch(t){console.warn("[storyMakerDraft] legacy migration failed:",t)}},UL=t=>{if(ua())try{const e={v:Ju,savedAt:Date.now(),data:t};localStorage.setItem(ss,JSON.stringify(e))}catch(e){console.warn("[storyMakerDraft] save failed:",e)}},HL=()=>{if(!ua())return null;try{const t=localStorage.getItem(ss);if(!t)return null;const e=JSON.parse(t);return!e||e.v!==Ju||typeof e.savedAt!="number"||Date.now()-e.savedAt>cL?(localStorage.removeItem(ss),null):e.data||null}catch(t){return console.warn("[storyMakerDraft] load failed:",t),null}},WL=()=>{if(ua())try{localStorage.removeItem(ss),sessionStorage.removeItem(Ir)}catch{}},Qu=document.getElementById("root");if(!Qu)throw new Error("Root element not found");Qu.innerHTML="";uL();iL().finally(()=>{lL()});const dL=Sf(Qu),hL=ql(window.location.pathname),pL=()=>dL.render(o.jsx(L.StrictMode,{children:o.jsx(Rf,{children:o.jsx(nL,{})})})),fL=new Promise(t=>setTimeout(t,1500));Promise.race([kf.loadNamespaces(hL),fL]).finally(pL);const Tf=()=>{[B0,z0].forEach(t=>{const e=new Image;e.decoding="async",e.src=t})};typeof window.requestIdleCallback=="function"?window.requestIdleCallback(Tf,{timeout:3e3}):setTimeout(Tf,1500);export{hD as $,xP as A,$n as B,cb as C,ty as D,Km as E,ol as F,u2 as G,rb as H,nm as I,Qt as J,fd as K,sm as L,TD as M,Lb as N,LL as O,ar as P,yy as Q,Zu as R,nr as S,OL as T,Gb as U,xy as V,pD as W,om as X,mD as Y,by as Z,wy as _,Af as a,TC as a$,fD as a0,de as a1,Ui as a2,s2 as a3,t2 as a4,bb as a5,rs as a6,rx as a7,ls as a8,vd as a9,Lu as aA,W0 as aB,Du as aC,uo as aD,Mm as aE,Nm as aF,ho as aG,Dm as aH,ts as aI,Ec as aJ,BL as aK,$E as aL,EL as aM,jL as aN,TL as aO,kD as aP,j2 as aQ,ov as aR,HL as aS,UL as aT,WL as aU,AL as aV,CL as aW,Cf as aX,ML as aY,$i as aZ,yb as a_,Xs as aa,Ae as ab,W as ac,Ut as ad,cE as ae,q0 as af,H0 as ag,po as ah,rI as ai,oI as aj,db as ak,NL as al,vt as am,ln as an,rm as ao,$L as ap,zL as aq,OC as ar,IC as as,CC as at,DC as au,cf as av,Nb as aw,Ki as ax,Lm as ay,e_ as az,ve as b,_C as b0,af as b1,T2 as b2,Vt as b3,zD as b4,r2 as b5,IS as b6,uu as b7,Ee as b8,tu as b9,Ne as ba,d0 as bb,SP as bc,DS as bd,Ws as be,iu as bf,sn as bg,FA as bh,Se as bi,zR as bj,zA as bk,BA as bl,NA as bm,BR as bn,p0 as bo,Ci as bp,jP as bq,BD as br,F0 as bs,he as c,U0 as d,hn as e,NC as f,Ef as g,lo as h,ab as i,DL as j,ny as k,Hu as l,ke as m,Mn as n,To as o,md as p,VL as q,FL as r,pe as s,JD as t,Zc as u,FD as v,Sc as w,LE as x,ME as y,NE as z};
//# sourceMappingURL=index-DmqBj0U5.js.map