(self.webpackChunkextendify=self.webpackChunkextendify||[]).push([[788],{1984:(e,t,n)=>{"use strict";n.d(t,{Z:()=>i});var r=n(9307);const i=(0,r.forwardRef)((function({icon:e,size:t=24,...n},i){return(0,r.cloneElement)(e,{width:t,height:t,...n,ref:i})}))},1470:(e,t,n)=>{"use strict";var r=n(9196),i=n.n(r),s=n(9307),o=n(8817),a=n(5736),l=n(1984),u=n(6993);const c=(0,r.createElement)("svg",{fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,r.createElement)("path",{clipRule:"evenodd",d:"m13.505 4h3.3044c.936 0 1.2747.10161 1.6171.29127.3424.19042.6102.46965.7934.82489.1831.356.2801.70824.2801 1.6814v3.43584c0 .9731-.0977 1.3254-.2801 1.6814-.1832.356-.4517.6344-.7934.8248-.153.0852-.3057.1552-.5112.2054v2.7344c0 1.503-.151 2.047-.4327 2.5968-.2828.5498-.6976.9799-1.2252 1.274-.5288.294-1.052.4498-2.4975.4498h-5.10341c-1.44549 0-1.96869-.1569-2.49747-.4498-.52878-.2941-.94242-.7254-1.22526-1.274-.28284-.5487-.43376-1.0938-.43376-2.5968v-5.3051c0-1.50301.15092-2.04701.43264-2.59682.28284-.54981.6976-.98106 1.22638-1.27514.52767-.29293 1.05198-.44985 2.49747-.44985h2.18511c.041-.44652.1265-.69015.2522-.93557.1832-.356.4517-.63523.7941-.82565.3417-.18966.6812-.29127 1.6171-.29127zm-1.6984 2.18698c0-.63769.4973-1.15464 1.1106-1.15464h4.4793c.6133 0 1.1106.51695 1.1106 1.15464v4.65692c0 .6377-.4973 1.1547-1.1106 1.1547h-4.4793c-.6133 0-1.1106-.517-1.1106-1.1547z",fill:"currentColor",fillRule:"evenodd"}));var d=n(270),h=n(782);const p=e=>({open:!1,setOpen:t=>e({open:t}),missingCSSVars:[],addMissingCSSVar:t=>e((e=>e.missingCSSVars.includes(t)?e:{missingCSSVars:[...e.missingCSSVars,t]}))}),m=(0,d.Ue)((0,h.mW)(p,{name:"Extendify Library Globals"}),p),f=()=>{const{setOpen:e}=m(),{incrementActivity:t}=(0,u.j)();return(0,r.createElement)("div",{role:"button",onClick:()=>{window.dispatchEvent(new CustomEvent("extendify-hc:minimize")),e(!0),t("library-button-click")},className:"components-button has-icon is-primary h-8 min-w-0 cursor-pointer px-1 xs:h-9 xs:pl-2 xs:pr-3 sm:ml-2"},(0,r.createElement)(l.Z,{icon:c,size:24}),(0,r.createElement)("span",{className:"ml-1 hidden xs:inline"},(0,a.__)("Design Library","extendify-local")))};var v=n(9818),g=n(7887),y=n(3773),w=n(6989),b=n.n(w),E=n(7403);const x="/extendify/v1/library/settings",S={getItem:async()=>await b()({path:x}),setItem:async(e,t)=>await b()({path:x,method:"POST",data:{state:t}})},T={siteType:{},category:"",totalImports:0},P=(0,E.a)(window.extLibraryData.siteInfo),C=(0,d.Ue)((0,h.tJ)((e=>{var t,n,r;return{...T,...null!==(t=P?.state)&&void 0!==t?t:{},siteType:null!==(n=null!==(r=window.extSharedData?.siteType)&&void 0!==r?r:P.siteType)&&void 0!==n?n:{},setSiteType:async t=>{e({siteType:t}),await b()({path:`${x}/single`,method:"POST",data:{key:"siteType",value:t}})},setCategory:t=>e({category:t}),incrementImports:()=>e((e=>({totalImports:Number(e.totalImports)+1})))}}),{name:"extendify_library_site_data",storage:(0,h.FL)((()=>S)),skipHydration:!0})),A={getItem:async()=>await b()({path:"/wp/v2/users/me"}),setItem:async(e,t)=>await b()({path:"/wp/v2/users/me",method:"PUT",data:{extendify_library_user:t}})},k=(0,d.Ue)((0,h.tJ)(((e,t)=>{var n;return{openOnNewPage:!0,updateUserOption:(n,r)=>{Object.keys(t()).includes(n)&&e({[n]:r})},...null!==(n=(0,E.a)(window.extLibraryData.userInfo)?.state)&&void 0!==n?n:{}}}),{name:"extendify_library_user",storage:(0,h.FL)((()=>A)),partialize:e=>({...e,ready:!1}),skipHydration:!0})),R={"--wp--preset--spacing--30":"clamp(1.5rem, 5vw, 2rem)","--wp--preset--spacing--40":"clamp(1.8rem, 1.8rem + ((1vw - 0.48rem) * 2.885), 3rem)","--wp--preset--spacing--50":"clamp(2.5rem, 8vw, 4rem)","--wp--preset--spacing--60":"clamp(2.5rem, 8vw, 6rem)","--wp--preset--spacing--70":"clamp(3.75rem, 10vw, 7rem)","--wp--preset--spacing--80":"clamp(5rem, 5.25rem + ((1vw - 0.48rem) * 9.096), 8rem)"};var V=n(5609),O=(Object.defineProperty,new Map),D=new WeakMap,L=0;function M(e,t,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const i=e.getBoundingClientRect();return t(r,{isIntersecting:r,target:e,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:i,intersectionRect:i,rootBounds:i}),()=>{}}const{id:i,observer:s,elements:o}=function(e){const t=function(e){return Object.keys(e).sort().filter((t=>void 0!==e[t])).map((t=>{return`${t}_${"root"===t?(n=e.root,n?(D.has(n)||(L+=1,D.set(n,L.toString())),D.get(n)):"0"):e[t]}`;var n})).toString()}(e);let n=O.get(t);if(!n){const r=new Map;let i;const s=new IntersectionObserver((t=>{t.forEach((t=>{var n;const s=t.isIntersecting&&i.some((e=>t.intersectionRatio>=e));e.trackVisibility&&void 0===t.isVisible&&(t.isVisible=s),null==(n=r.get(t.target))||n.forEach((e=>{e(s,t)}))}))}),e);i=s.thresholds||(Array.isArray(e.threshold)?e.threshold:[e.threshold||0]),n={id:t,observer:s,elements:r},O.set(t,n)}return n}(n),a=o.get(e)||[];return o.has(e)||o.set(e,a),a.push(t),s.observe(e),function(){a.splice(a.indexOf(t),1),0===a.length&&(o.delete(e),s.unobserve(e)),0===o.size&&(s.disconnect(),O.delete(i))}}function F(){return F=Object.assign||function(e){for(var t=1;t{this.reCalculateColumnCount()}))):this.reCalculateColumnCount()}reCalculateColumnCount(){const e=window&&window.innerWidth||1/0;let t=this.props.breakpointCols;"object"!=typeof t&&(t={default:parseInt(t)||2});let n=1/0,r=t.default||2;for(let i in t){const s=parseInt(i);s>0&&e<=s&&si().createElement("div",F({},a,{key:t}),e)))}logDeprecated(e){console.error("[Masonry]",e)}render(){const e=this.props,{children:t,breakpointCols:n,columnClassName:r,columnAttrs:s,column:o,className:a}=e,l=function(e,t){if(null==e)return{};var n,r,i=function(e,t){if(null==e)return{};var n,r,i={},s=Object.keys(e);for(r=0;r=0||(i[n]=e[n]);return i}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(r=0;r=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}(e,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let u=a;return"string"!=typeof a&&(this.logDeprecated('The property "className" requires a string'),void 0===a&&(u="my-masonry-grid")),i().createElement("div",F({},l,{className:u}),this.renderColumns())}}_.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};const B=_;var U=n(1688),$=n(46);const z=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})),e)}),W={dedupe:!0};$.$l.defineProperty($.J$,"defaultValue",{value:$.u_});const H=(0,$.s6)(((e,t,n)=>{const{cache:i,compare:s,suspense:o,fallbackData:a,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p}=n,[m,f,v,g]=$.DY.get(i),[y,w]=(0,$.qC)(e),b=(0,r.useRef)(!1),E=(0,r.useRef)(!1),x=(0,r.useRef)(y),S=(0,r.useRef)(t),T=(0,r.useRef)(n),P=()=>T.current,C=()=>P().isVisible()&&P().isOnline(),[A,k,R,V]=(0,$.JN)(i,y),O=(0,r.useRef)({}).current,D=(0,$.o8)(a)?n.fallback[y]:a,L=(e,t)=>{for(const n in O){const r=n;if("data"===r){if(!s(e[r],t[r])){if(!(0,$.o8)(e[r]))return!1;if(!s(Y,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},M=(0,r.useMemo)((()=>{const e=!!y&&!!t&&((0,$.o8)(l)?!P().isPaused()&&!o&&(!!(0,$.o8)(u)||u):l),n=t=>{const n=(0,$.PM)(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=A(),i=V(),s=n(r),a=r===i?s:n(i);let c=s;return[()=>{const e=n(A());return L(e,c)?(c.data=e.data,c.isLoading=e.isLoading,c.isValidating=e.isValidating,c.error=e.error,c):(c=e,e)},()=>a]}),[i,y]),F=(0,U.useSyncExternalStore)((0,r.useCallback)((e=>R(y,((t,n)=>{L(n,t)||e()}))),[i,y]),M[0],M[1]),j=!b.current,N=m[y]&&m[y].length>0,I=F.data,_=(0,$.o8)(I)?D:I,B=F.error,H=(0,r.useRef)(_),Y=p?(0,$.o8)(I)?H.current:I:_,q=!(N&&!(0,$.o8)(B))&&(j&&!(0,$.o8)(l)?l:!P().isPaused()&&(o?!(0,$.o8)(_)&&u:(0,$.o8)(_)||u)),K=!!(y&&t&&j&&q),Z=(0,$.o8)(F.isValidating)?K:F.isValidating,G=(0,$.o8)(F.isLoading)?K:F.isLoading,X=(0,r.useCallback)((async e=>{const t=S.current;if(!y||!t||E.current||P().isPaused())return!1;let r,i,o=!0;const a=e||{},l=!v[y]||!a.dedupe,u=()=>$.w6?!E.current&&y===x.current&&b.current:y===x.current,c={isValidating:!1,isLoading:!1},d=()=>{k(c)},h=()=>{const e=v[y];e&&e[1]===i&&delete v[y]},p={isValidating:!0};(0,$.o8)(A().data)&&(p.isLoading=!0);try{if(l&&(k(p),n.loadingTimeout&&(0,$.o8)(A().data)&&setTimeout((()=>{o&&u()&&P().onLoadingSlow(y,n)}),n.loadingTimeout),v[y]=[t(w),(0,$.u3)()]),[r,i]=v[y],r=await r,l&&setTimeout(h,n.dedupingInterval),!v[y]||v[y][1]!==i)return l&&u()&&P().onDiscarded(y),!1;c.error=$.i_;const e=f[y];if(!(0,$.o8)(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return d(),l&&u()&&P().onDiscarded(y),!1;const a=A().data;c.data=s(a,r)?a:r,l&&u()&&P().onSuccess(r,y,n)}catch(e){h();const t=P(),{shouldRetryOnError:n}=t;t.isPaused()||(c.error=e,l&&u()&&(t.onError(e,y,t),(!0===n||(0,$.mf)(n)&&n(e))&&(P().revalidateOnFocus&&P().revalidateOnReconnect&&!C()||t.onErrorRetry(e,y,t,(e=>{const t=m[y];t&&t[0]&&t[0]($.sj.ERROR_REVALIDATE_EVENT,e)}),{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return o=!1,d(),!0}),[y,i]),J=(0,r.useCallback)(((...e)=>(0,$.BN)(i,x.current,...e)),[]);if((0,$.LI)((()=>{S.current=t,T.current=n,(0,$.o8)(I)||(H.current=I)})),(0,$.LI)((()=>{if(!y)return;const e=X.bind($.i_,W);let t=0;const n=(0,$.ko)(y,m,((n,r={})=>{if(n==$.sj.FOCUS_EVENT){const n=Date.now();P().revalidateOnFocus&&n>t&&C()&&(t=n+P().focusThrottleInterval,e())}else if(n==$.sj.RECONNECT_EVENT)P().revalidateOnReconnect&&C()&&e();else{if(n==$.sj.MUTATE_EVENT)return X();if(n==$.sj.ERROR_REVALIDATE_EVENT)return X(r)}}));return E.current=!1,x.current=y,b.current=!0,k({_k:w}),q&&((0,$.o8)(_)||$.W6?e():(0,$.kw)(e)),()=>{E.current=!0,n()}}),[y]),(0,$.LI)((()=>{let e;function t(){const t=(0,$.mf)(c)?c(A().data):c;t&&-1!==e&&(e=setTimeout(n,t))}function n(){A().error||!d&&!P().isVisible()||!h&&!P().isOnline()?t():X(W).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[c,d,h,y]),(0,r.useDebugValue)(Y),o&&(0,$.o8)(_)&&y){if(!$.w6&&$.W6)throw new Error("Fallback data is required when using suspense in SSR.");S.current=t,T.current=n,E.current=!1;const e=g[y];if(!(0,$.o8)(e)){const t=J(e);z(t)}if(!(0,$.o8)(B))throw B;{const e=X(W);(0,$.o8)(Y)||(e.status="fulfilled",e.value=!0),z(e)}}return{mutate:J,get data(){return O.data=!0,Y},get error(){return O.error=!0,B},get isValidating(){return O.isValidating=!0,Z},get isLoading(){return O.isLoading=!0,G}}})),Y=Promise.resolve(),q=(0,$.xD)(H,(e=>(t,n,i)=>{const s=(0,r.useRef)(!1),{cache:o,initialSize:a=1,revalidateAll:l=!1,persistSize:u=!1,revalidateFirstPage:c=!0,revalidateOnMount:d=!1,parallel:h=!1}=i,[,,,p]=$.DY.get($.Fs);let m;try{m=(e=>(0,$.qC)(e?e(0,null):null)[0])(t),m&&(m=$.UG+m)}catch(e){}const[f,v,g]=(0,$.JN)(o,m),y=(0,r.useCallback)((()=>(0,$.o8)(f()._l)?a:f()._l),[o,m,a]);(0,U.useSyncExternalStore)((0,r.useCallback)((e=>m?g(m,(()=>{e()})):()=>{}),[o,m]),y,y);const w=(0,r.useCallback)((()=>{const e=f()._l;return(0,$.o8)(e)?a:e}),[m,a]),b=(0,r.useRef)(w());(0,$.LI)((()=>{s.current?m&&v({_l:u?b.current:w()}):s.current=!0}),[m,o]);const E=d&&!s.current,x=e(m,(async e=>{const r=f()._i,s=f()._r;v({_r:$.i_});const a=[],u=w(),[d]=(0,$.JN)(o,e),m=d().data,g=[];let y=null;for(let e=0;e{if(u in p){const e=p[u];delete p[u],w=await e}else w=await n(d);v({data:w,_k:d}),a[e]=w};h?g.push(t):await t()}else a[e]=w;h||(y=w)}return h&&await Promise.all(g.map((e=>e()))),v({_i:$.i_}),a}),i),S=(0,r.useCallback)((function(e,t){const n="boolean"==typeof t?{revalidate:t}:t||{},r=!1!==n.revalidate;return m?(r&&((0,$.o8)(e)?v({_i:!0,_r:n.revalidate}):v({_i:!1,_r:n.revalidate})),arguments.length?x.mutate(e,{...n,revalidate:r}):x.mutate()):Y}),[m,o]),T=(0,r.useCallback)((e=>{if(!m)return Y;const[,n]=(0,$.JN)(o,m);let r;if((0,$.mf)(e)?r=e(w()):"number"==typeof e&&(r=e),"number"!=typeof r)return Y;n({_l:r}),b.current=r;const i=[],[s]=(0,$.JN)(o,m);let a=null;for(let e=0;efetch(e).then((e=>e.json()));var G=n(2175),X=n(4981),J=n(3967),Q=n.n(J),ee=n(2819);const te=(e,t=[])=>Array.from(t).some((t=>!!t.style&&Array.from(t.style).some((t=>t&&t.includes(e))))),ne=new WeakMap,re=({insertPattern:e,code:t})=>{const[n,i]=(0,s.useState)(!1),o=(0,s.useRef)(),l=(0,s.useMemo)((()=>(0,X.rawHandler)({HTML:ie(t)})),[t]),{ready:u}=(({container:e,onIFrameLoaded:t,ready:n,loadDelay:r})=>{const i=(()=>{const e=(0,s.useRef)(!1);return(0,s.useEffect)((()=>(e.current=!0,()=>e.current=!1))),e})(),[o,a]=(0,s.useState)(0),[l,u]=(0,s.useState)(null),[c,d]=(0,s.useState)(!1),h=(0,s.useRef)(!1),{addMissingCSSVar:p}=m(),f=(0,s.useCallback)((e=>{if(!e?.contentDocument)return;const t=getComputedStyle(e.contentDocument.documentElement),n=e.contentDocument.styleSheets;for(let r in R)t.getPropertyValue(r)||Array.from(n).filter((e=>{try{return e.cssRules}catch(e){return!1}})).some((e=>te(r,e.cssRules)))||(p(r),e.contentDocument.documentElement.style.setProperty(r,R[r]))}),[p]),v=(0,s.useCallback)((async(e,t)=>{var n;if(e.getBoundingClientRect().toprequestAnimationFrame(e))),await new Promise((e=>requestAnimationFrame(e)));for(const t of s){if(!e.contentDocument?.defaultView)return;const n=parseFloat(e.contentDocument.defaultView.getComputedStyle(t).height);t.offsetHeight,t.style.minHeight=n>500?"500px":n+"px"}e.style.setProperty("max-height","none","important"),h.current=!1}),[]);return(0,s.useEffect)((()=>{if(!n)return;const r=setTimeout((()=>{if(l)return;const n=e?.querySelector("iframe[title]");if(!n)return a((e=>e+1));u(n),requestAnimationFrame((()=>t(n,e)))}),100);return()=>clearTimeout(r)}),[l,n,o,e,t]),(0,s.useEffect)((()=>{if(d(!1),!l?.contentDocument)return;const t={attributes:!1,childList:!0,subtree:!0};requestAnimationFrame((()=>n(l,e)));const n=(0,ee.debounce)((async()=>{i.current&&!h.current&&(s.disconnect(),await v(l,e),"extendable"!==window.extSharedData.themeSlug&&await f(l,e),setTimeout((()=>d(!0)),r),i.current&&s.observe(l.contentDocument,t))}),300),s=new MutationObserver(n);return s.observe(l.contentDocument,t),()=>{n.cancel(),s?.disconnect()}}),[l,e,i,n,v,f,r]),{loading:!l,ready:c}})({container:o.current,ready:n,onIFrameLoaded:()=>{},loadDelay:50});return(0,s.useEffect)((()=>i(!0)),[]),(0,r.createElement)("button",{ref:o,type:"button","aria-label":(0,a.__)("Insert Pattern","extendify-local"),className:Q()("library-pattern relative z-10 m-0 mb-8 inline-block w-full cursor-pointer border bg-transparent p-0 focus:shadow-sm focus:outline-none focus:ring-wp focus:ring-design-main focus:ring-offset-2 focus:ring-offset-[#FAFAFA]",{"border-transparent opacity-0":!u,"border-gray-400 opacity-100":u}),onClick:()=>e(l)},(0,r.createElement)(G.BlockPreview,{blocks:l,live:!1,viewportWidth:1400,additionalStyles:[{css:'.rich-text [data-rich-text-placeholder]:after { content: "" }'}]}))},ie=e=>e.replace(/(https?:\/\/\S+\?w=\d+)/gi,"$1&q=10&auto=format,compress&fm=avif"),se=({insertPattern:e,siteType:t,category:n})=>{const{data:i,isLoading:o,setSize:l}=(e=>{const t={siteType:void 0,category:void 0,wpVersion:window.extSharedData.wpVersion,lang:window.extSharedData.wpLanguage||null,showLocalizedCopy:window.extSharedData.showLocalizedCopy||null,...e},{data:n,error:r,isLoading:i,isValidating:s,mutate:o,size:a,setSize:l}=q(((e,n)=>{if(!t.category)return null;if(n&&!n.length)return null;const r=new URLSearchParams({page:e+1});return Object.entries(t).filter((([,e])=>void 0!==e)).forEach((([e,t])=>{r.append(e,t)})),`${K.kE}/api/patterns?${r.toString()}`}),Z,{initialSize:2,revalidateFirstPage:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:n,error:r,isLoading:i,isValidating:s,mutate:o,size:a,setSize:l}})({siteType:t?.slug,category:n}),[u,c]=(0,s.useState)(!0),[d,h]=function({threshold:e,delay:t,trackVisibility:n,rootMargin:i,root:s,triggerOnce:o,skip:a,initialInView:l,fallbackInView:u,onChange:c}={}){var d;const[h,p]=r.useState(null),m=r.useRef(),[f,v]=r.useState({inView:!!l,entry:void 0});m.current=c,r.useEffect((()=>{if(a||!h)return;let r;return r=M(h,((e,t)=>{v({inView:e,entry:t}),m.current&&m.current(e,t),t.isIntersecting&&o&&r&&(r(),r=void 0)}),{root:s,rootMargin:i,threshold:e,trackVisibility:n,delay:t},u),()=>{r&&r()}}),[Array.isArray(e)?e.toString():e,h,s,i,o,a,n,u,t]);const g=null==(d=f.entry)?void 0:d.target,y=r.useRef();h||!g||o||a||y.current===g||(y.current=g,v({inView:!!l,entry:void 0}));const w=[p,f.inView,f.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}(),p=i?.at(-1)?.length<9;return(0,s.useEffect)((()=>{if(o)return c(!0);const e=setTimeout((()=>{c(!1)}),750);return()=>clearTimeout(e)}),[o]),(0,s.useEffect)((()=>{h&&!o&&l((e=>e+1))}),[h,o,l]),o||!i?.length?(0,r.createElement)("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center"},(0,r.createElement)(V.Spinner,null),(0,r.createElement)("span",{className:"sr-only"},(0,a.__)("Loading Patterns...","extendify-local"))):(0,r.createElement)(r.Fragment,null,(0,r.createElement)(B,{breakpointCols:{default:3,1600:2,1e3:1,783:2,600:1},columnClassName:"",className:"relative flex w-full gap-6 p-8 pt-2"},i.map((t=>t.map((({id:t,code:n})=>(0,r.createElement)(re,{key:t,insertPattern:e,code:n})))))),u?(0,r.createElement)("div",{className:"absolute inset-0 z-0 flex flex-col items-center justify-center text-center"},(0,r.createElement)(V.Spinner,null),(0,r.createElement)("span",{className:"sr-only"},(0,a.__)("Loading Patterns...","extendify-local"))):null,u||p?null:(0,r.createElement)("div",{ref:d,className:"mb-6 mt-6 flex w-full justify-center md:mt-2"},(0,r.createElement)(V.Spinner,null),(0,r.createElement)("span",{className:"sr-only"},(0,a.__)("Loading more patterns...","extendify-local"))))};var oe=n(9870);const ae=async()=>{const e=new URLSearchParams({wpVersion:window.extSharedData.wpVersion||null,lang:window.extSharedData.wpLanguage||null});return await fetch(`${K.kE}/api/categories?${e.toString()}`).then((e=>e.json()))},le=(0,d.Ue)((0,h.tJ)((e=>({categories:[],setCategories:t=>e({categories:t})})),{name:"extendify-library-cache"})),ue=()=>{const{category:e,siteType:t,setCategory:n}=C(),{data:i,isLoading:o,errorCount:l}=(()=>{var e;const[t,n]=(0,s.useState)(0),r=null!==(e=window.extSharedData?.wpLanguage)&&void 0!==e?e:"en_US",{data:i,error:o,isLoading:a}=(0,oe.Z)(`categories-${r}`,ae,{onError:()=>n((e=>e+1)),onSuccess:()=>n(0)});return{data:i,errorCount:t>1?t:o?1:0,isLoading:a}})(),{categories:u,setCategories:c}=le();return(0,s.useEffect)((()=>{o||l||c(i)}),[i,o,c,l]),(0,s.useEffect)((()=>{const r=e=>t?.name&&document.querySelector(`#extendify-library-category-${e}`)?.focus();if(u?.length){if(e){if("all"===e)return r("all");if(u?.find((({slug:t})=>t===e)))return r(e)}n("all"),r("all")}}),[e,n,u,t?.name]),(0,r.createElement)(V.PanelBody,{title:(0,a.__)("Design Type","extendify-local"),className:"ext-type-control p-0",initialOpen:!!t?.name},(0,r.createElement)(V.PanelRow,null,(0,r.createElement)(ce,{categories:u,errorCount:l,current:e,setCurrent:n})))},ce=({categories:e,errorCount:t,current:n,setCurrent:i})=>{const s=e=>Q()("text-sm w-full text-left px-3 py-1 mb-0.5 block cursor-pointer rounded",{"bg-design-main text-design-text":n===e,"bg-transparent text-gray-900 hover:bg-gray-100":n!==e});return e?.length?(0,r.createElement)("ul",{className:"m-0 -mt-1.5 max-h-half w-full overflow-y-auto rounded-b border border-gray-300 px-1 py-2"},(0,r.createElement)("li",{className:"m-0 p-0"},(0,r.createElement)("button",{type:"button",id:"extendify-library-category-all",onClick:()=>i("all"),className:s("all")},(0,a.__)("All","extendify-local"))),e.map((({slug:e,id:t,name:n})=>(0,r.createElement)("li",{key:t,className:"m-0 p-0"},(0,r.createElement)("button",{type:"button",id:`extendify-library-category-${e}`,onClick:()=>i(e),className:s(e)},n))))):t>1?(0,r.createElement)("div",{className:"-mt-1 flex w-full flex-col items-center justify-center gap-2 border-t border-gray-300 p-2"},(0,r.createElement)("span",null,(0,a.__)("Retrying...","extendify-local")),(0,r.createElement)(V.Spinner,null)):(0,r.createElement)("div",{className:"-mt-1 flex w-full justify-center border-t border-gray-300 p-2"},(0,r.createElement)("span",{className:"sr-only"},(0,a.__)("Fetching...","extendify-local")),(0,r.createElement)(V.Spinner,null))},de=()=>{const{siteType:e,setSiteType:t}=C(),n=!!e?.name,[i,o]=(0,s.useState)(!n),[l,u]=(0,s.useState)(""),[c,d]=(0,s.useState)(""),[h,p]=(0,s.useState)(!1),{data:m,loading:f}=(e=>{const{data:t,error:n}=(0,oe.Z)(e||"cold-boot",(async()=>{const{wpLanguage:t}=window.extSharedData,n=performance.now(),r=new URL(`${K.kE}/api/site-types`);e&&r.searchParams.append("search",e),e||r.searchParams.append("boot","true"),t&&r.searchParams.append("lang",t);const i=await fetch(r.toString(),{headers:{"Content-Type":"application/json"}});if(!e)return;if(!i.ok)throw new Error("Bad response from server");const s=await i.json();if(!Array.isArray(s))throw new Error("Bad response from server");return{siteTypes:s,time:((performance.now()-n)/1e3).toFixed(4)}}));return{data:t,error:n,loading:!t&&!n}})(c),v=(0,s.useRef)();return(0,s.useEffect)((()=>{i&&(u(""),v.current?.focus())}),[i]),(0,s.useEffect)((()=>{if(!m&&!f)return p(!1);p(f)}),[f,m]),(0,s.useEffect)((()=>{if(!l)return p(!1);p(!0);const e=setTimeout((()=>d(l)),300);return()=>clearTimeout(e)}),[l]),(0,r.createElement)(V.PanelBody,{title:n?(0,a.sprintf)( // translators: %s is the site type name (0,a.__)("Site Type: %s","extendify-local"),e.name):(0,a.__)("Site Type","extendify-local"),className:"ext-type-control p-0",onToggle:o,opened:i,initialOpen:i},(0,r.createElement)(V.PanelRow,{className:"m-0 -mt-1.5 flex max-h-half w-full flex-col gap-2 overflow-y-auto rounded-b border border-gray-300 p-4"},(0,r.createElement)(V.SearchControl,{ref:v,className:"w-full",label:(0,a.__)("Search for your site type","extendify-local"),placeholder:(0,a.__)("Search for your site type","extendify-local"),value:l,onChange:u}),h&&(0,r.createElement)("div",{className:"flex w-full justify-center p-2"},(0,r.createElement)("span",{className:"sr-only"},(0,a.__)("Fetching...","extendify-local")),(0,r.createElement)(V.Spinner,null)),m?.siteTypes?.length>0&&!h&&(0,r.createElement)("ul",{className:"m-0 w-full overflow-y-auto px-0 pb-2"},m.siteTypes.slice(0,5).map((e=>(0,r.createElement)("li",{key:e.id,className:"m-0 p-0"},(0,r.createElement)("button",{type:"button",id:`site-type-${e.id}`,onClick:()=>{t(e),u(""),o(!1)},className:"mb-0.5 block w-full cursor-pointer rounded bg-transparent px-3 py-1 text-left text-sm text-gray-900 hover:bg-gray-100"},e.name)))))))},{partnerLogo:he,partnerName:pe}=window.extSharedData,me=()=>(0,r.createElement)("div",{className:"hidden flex-shrink-0 flex-col gap-6 md:flex md:w-80"},he?(0,r.createElement)("div",{className:"flex justify-center bg-banner-main p-6 py-0"},(0,r.createElement)("div",{className:"flex h-20 w-40 items-center justify-center py-3"},(0,r.createElement)("img",{className:"max-h-full max-w-full",src:he,alt:pe}))):(0,r.createElement)("div",{className:"-mb-5 hidden px-5 py-3 text-extendify-black sm:flex sm:pt-5"},(0,r.createElement)(l.Z,{icon:c,size:40})),(0,r.createElement)("div",{className:"flex flex-col gap-4 overflow-y-auto pb-16"},(0,r.createElement)("div",{className:"hidden flex-col overflow-x-hidden px-4 md:flex"},(0,r.createElement)(de,null)),(0,r.createElement)("div",{id:"extendify-library-category-control","data-test":"category-control",className:"hidden flex-col overflow-x-hidden px-4 md:flex"},(0,r.createElement)(ue,null)))),fe=({onClose:e})=>(0,r.createElement)("button",{className:"block h-6 w-6 cursor-pointer bg-transparent p-px text-inherit outline-none focus:shadow-none focus:ring-wp focus:ring-design-main",type:"button",onClick:e,"data-test":"modal-close-button","aria-label":(0,a.__)("Close","extendify-local")},(0,r.createElement)("svg",{style:{fill:"currentColor"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)("path",{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}))),ve=({openOnNewPage:e,updateUserOption:t,onClose:n})=>(0,r.createElement)("div",{className:"mb-2 flex h-16 flex-shrink-0 items-center justify-end gap-6 px-8"},(0,r.createElement)("label",{className:"mt-4 flex items-center gap-2",htmlFor:"extendify-open-on-new-pages",title:(0,a.sprintf)( // translators: %s: Extendify Library term (0,a.__)("Toggle %s on new pages","extendify-local"),"Extendify Library")},(0,r.createElement)("input",{id:"extendify-open-on-new-pages",className:"m-0 rounded-sm border border-solid border-gray-900",type:"checkbox",checked:e,onChange:e=>t("openOnNewPage",e.target.checked)}),(0,r.createElement)("span",null,(0,a.__)("Open for new pages","extendify-local"))),(0,r.createElement)("div",{className:"mt-4"},(0,r.createElement)(fe,{onClose:n}))),ge=window?.location?.pathname?.includes("post-new.php"),ye=()=>{const{incrementActivity:e}=(0,u.j)(),{open:t,setOpen:n}=m(),{updateUserOption:i,openOnNewPage:o}=k(),{category:l,siteType:c,incrementImports:d}=C(),{createNotice:h}=(0,v.dispatch)("core/notices"),p=(0,s.useRef)(!1),f=()=>{n(!1)};return(0,s.useLayoutEffect)((()=>{if(!t&&!p.current)return p.current=!0,o&&ge?(window.dispatchEvent(new CustomEvent("extendify-hc:minimize")),e("library-auto-open"),void n(!0)):void(new URLSearchParams(window.location.search).has("ext-open")&&(n(!0),e("library-search-param-auto-open")))}),[o,n,e,t]),(0,s.useEffect)((()=>{const e=new URLSearchParams(window.location.search);e.has("ext-close")&&(n(!1),e.delete("ext-close"),window.history.replaceState({},"",window.location.pathname+"?"+e.toString()))}),[n,e]),(0,s.useEffect)((()=>{const e=()=>n(!0),t=()=>n(!1);return window.addEventListener("extendify::open-library",e),window.addEventListener("extendify::close-library",t),()=>{window.removeEventListener("extendify::open-library",e),window.removeEventListener("extendify::close-library",t)}}),[n,t]),t?(0,r.createElement)(g.Vq,{className:"extendify-library extendify-library-modal",open:t,static:!0,onClose:()=>{}},(0,r.createElement)("div",{className:"absolute mx-auto h-full w-full md:p-8"},(0,r.createElement)("div",{className:"fixed inset-0 bg-black/30",style:{backdropFilter:"blur(2px)"},"aria-hidden":"true"}),(0,r.createElement)(y.E.div,{key:"library-modal",initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.3},className:"relative mx-auto h-full w-full max-w-screen-3xl bg-white shadow-2xl sm:flex sm:overflow-hidden"},(0,r.createElement)(g.Vq.Title,{className:"sr-only"},(0,a.__)("Design Patterns","extendify-local")),(0,r.createElement)(me,null),(0,r.createElement)("div",{className:"relative flex w-full flex-col bg-[#FAFAFA]"},(0,r.createElement)(ve,{openOnNewPage:o,updateUserOption:i,onClose:f}),(0,r.createElement)("div",{id:"extendify-library-patterns-list",className:"flex-grow overflow-y-auto"},(0,r.createElement)(se,{insertPattern:async e=>{await(async e=>{const{insertBlocks:t,replaceBlock:n}=(0,v.dispatch)("core/block-editor"),{getSelectedBlock:r,getBlockHierarchyRootClientId:i,getBlockIndex:s,getGlobalBlockCount:o}=(0,v.select)("core/block-editor"),{clientId:a,name:l,attributes:u}=r()||{},c=a?i(a):"",d=(c?s(c):o())+1,{missingCSSVars:h}=m.getState();return h.forEach((e=>{document?.documentElement?.style?.setProperty(e,R[e]),document.querySelector('iframe[name="editor-canvas"]')?.contentDocument?.documentElement?.style?.setProperty(e,R[e])})),h.length&&(async e=>{var t;const n=window.extSharedData.globalStylesPostID,{styles:r,settings:i}=await b()({path:`/wp/v2/global-styles/${n}`});if(!(e=e.filter((e=>!r?.css?.includes(`${e}:`)))).length)return;const s=e.reduce(((e,t)=>e+`${t}: ${R[t]};\n`),":root {\n")+"\n}";b()({path:`/wp/v2/global-styles/${n}`,method:"PATCH",data:{id:n,settings:i,styles:{...r,css:(null!==(t=r?.css)&&void 0!==t?t:"")+(r?.css?"\n":"")+s}}})})(h),"core/paragraph"===l&&""===u?.content?await n(a,e):await t(e,d)})(e),d(),f(),h("info",(0,a.__)("Pattern added","extendify-local"),{isDismissible:!0,type:"snackbar"}),await(async(e,t)=>await b()({path:"/extendify/v1/library/settings/single",method:"POST",data:{key:"extendify_check_for_image_imports",value:!0}}))()},category:l,siteType:c})))))):null};(0,o.registerPlugin)("extendify-library",{render:()=>{if("function"!=typeof s.createRoot)return;const e="extendify-library-btn",t="extendify-library",n=".edit-post-header-toolbar",i=".edit-site-header-edit-mode__start";(document.querySelector(n)||document.querySelector(i))&&requestAnimationFrame((()=>{if(document.getElementById(e))return;const o=document.createElement("div"),a=Object.assign(o,{id:e,className:t});document.querySelector(n)?.append(a),document.querySelector(i)?.append(a),(0,s.createRoot)(a).render((0,r.createElement)(f,null));const l="extendify-library-modal";if(document.getElementById(l))return;const u=document.createElement("div"),c=Object.assign(u,{id:l,className:t});document.body.append(c),(0,s.createRoot)(c).render((0,r.createElement)(ye,null))}))}})},7403:(e,t,n)=>{"use strict";n.d(t,{a:()=>r});const r=e=>{try{return JSON.parse(e)}catch(e){return{}}}},6993:(e,t,n)=>{"use strict";n.d(t,{j:()=>h});var r=n(6989),i=n.n(r),s=n(7403),o=n(270),a=n(782);const l="/extendify/v1/shared/activity",u={getItem:()=>i()({path:l}),setItem:(e,t)=>i()({path:l,method:"POST",data:{state:t}})},c=(0,s.a)(window.extSharedData.activity),d={actions:{}},h=(0,o.Ue)((0,a.tJ)((0,a.mW)(((e,t)=>{var n;return{...d,...null!==(n=c?.state)&&void 0!==n?n:{},incrementActivity:n=>{e((e=>({...e,actions:{...e.actions,[n]:Number(t().actions[n]||0)+1}})))}}}),{name:"Extendify Activity"}),{name:"extendify_shared_activity",storage:(0,a.FL)((()=>u)),skipHydration:!0}))},2200:(e,t,n)=>{"use strict";n.d(t,{Ow:()=>o,Yy:()=>s,kE:()=>r,nX:()=>i});const r="https://patterns.extendify.com",i="https://kb.extendify.com",s="https://ai.extendify.com",o="https://insights.extendify.com"},5251:(e,t,n)=>{"use strict";var r=n(9196),i=Symbol.for("react.element"),s=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,a=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function u(e,t,n){var r,s={},u=null,c=null;for(r in void 0!==n&&(u=""+n),void 0!==t.key&&(u=""+t.key),void 0!==t.ref&&(c=t.ref),t)o.call(t,r)&&!l.hasOwnProperty(r)&&(s[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps)void 0===s[r]&&(s[r]=t[r]);return{$$typeof:i,type:e,key:u,ref:c,props:s,_owner:a.current}}t.Fragment=s,t.jsx=u,t.jsxs=u},5893:(e,t,n)=>{"use strict";e.exports=n(5251)},3250:(e,t,n)=>{"use strict";var r=n(9196),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!i(e,n)}catch(e){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),r=s({inst:{value:n,getSnapshot:t}}),i=r[0].inst,c=r[1];return a((function(){i.value=n,i.getSnapshot=t,u(i)&&c({inst:i})}),[e,n,t]),o((function(){return u(i)&&c({inst:i}),e((function(){u(i)&&c({inst:i})}))}),[e]),l(n),n};t.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},139:(e,t,n)=>{"use strict";var r=n(9196),i=n(1688),s="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=i.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,n,r,i){var d=a(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;d=u((function(){function e(e){if(!l){if(l=!0,o=e,e=r(e),void 0!==i&&h.hasValue){var t=h.value;if(i(t,e))return a=t}return a=e}if(t=a,s(o,e))return t;var n=r(e);return void 0!==i&&i(t,n)?t:(o=e,a=n)}var o,a,l=!1,u=void 0===n?null:n;return[function(){return e(t())},null===u?void 0:function(){return e(u())}]}),[t,n,r,i]);var p=o(e,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),c(p),p}},1688:(e,t,n)=>{"use strict";e.exports=n(3250)},2798:(e,t,n)=>{"use strict";e.exports=n(139)},9196:e=>{"use strict";e.exports=window.React},2819:e=>{"use strict";e.exports=window.lodash},6989:e=>{"use strict";e.exports=window.wp.apiFetch},2175:e=>{"use strict";e.exports=window.wp.blockEditor},4981:e=>{"use strict";e.exports=window.wp.blocks},5609:e=>{"use strict";e.exports=window.wp.components},9818:e=>{"use strict";e.exports=window.wp.data},9307:e=>{"use strict";e.exports=window.wp.element},5736:e=>{"use strict";e.exports=window.wp.i18n},8817:e=>{"use strict";e.exports=window.wp.plugins},3967:(e,t)=>{var n;!function(){"use strict";var r={}.hasOwnProperty;function i(){for(var e="",t=0;t{"use strict";n.d(t,{Vq:()=>Me,$N:()=>Le});var r=n(9196),i=n(1363),s=n(3855);function o(e,t,n,i){let o=(0,s.E)(n);(0,r.useEffect)((()=>{function n(e){o.current(e)}return(e=null!=e?e:window).addEventListener(t,n,i),()=>e.removeEventListener(t,n,i)}),[e,t,i])}class a extends Map{constructor(e){super(),this.factory=e}get(e){let t=super.get(e);return void 0===t&&(t=this.factory(e),this.set(e,t)),t}}function l(e,t){let n=e(),r=new Set;return{getSnapshot:()=>n,subscribe:e=>(r.add(e),()=>r.delete(e)),dispatch(e,...i){let s=t[e].call(n,...i);s&&(n=s,r.forEach((e=>e())))}}}var u=n(6723);function c(e){return(0,r.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot)}let d=new a((()=>l((()=>[]),{ADD(e){return this.includes(e)?this:[...this,e]},REMOVE(e){let t=this.indexOf(e);if(-1===t)return this;let n=this.slice();return n.splice(t,1),n}})));function h(e,t){let n=d.get(t),i=(0,r.useId)(),s=c(n);if((0,u.e)((()=>{if(e)return n.dispatch("ADD",i),()=>n.dispatch("REMOVE",i)}),[n,e]),!e)return!1;let o=s.indexOf(i),a=s.length;return-1===o&&(o=a,a+=1),o===a-1}var p=n(3781),m=n(9362),f=n(5466);let v=new Map,g=new Map;function y(e){var t;let n=null!=(t=g.get(e))?t:0;return g.set(e,n+1),0!==n||(v.set(e,{"aria-hidden":e.getAttribute("aria-hidden"),inert:e.inert}),e.setAttribute("aria-hidden","true"),e.inert=!0),()=>function(e){var t;let n=null!=(t=g.get(e))?t:1;if(1===n?g.delete(e):g.set(e,n-1),1!==n)return;let r=v.get(e);r&&(null===r["aria-hidden"]?e.removeAttribute("aria-hidden"):e.setAttribute("aria-hidden",r["aria-hidden"]),e.inert=r.inert,v.delete(e))}(e)}function w(e,{allowed:t,disallowed:n}={}){let r=h(e,"inert-others");(0,u.e)((()=>{var e,i;if(!r)return;let s=(0,m.k)();for(let t of null!=(e=null==n?void 0:n())?e:[])t&&s.add(y(t));let o=null!=(i=null==t?void 0:t())?i:[];for(let e of o){if(!e)continue;let t=(0,f.r)(e);if(!t)continue;let n=e.parentElement;for(;n&&n!==t.body;){for(let e of n.children)o.some((t=>e.contains(t)))||s.add(y(e));n=n.parentElement}}return s.dispose}),[r,t,n])}var b=n(8553),E=n(4575);function x(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function S(){return x()||/Android/gi.test(window.navigator.userAgent)}function T(e,t,n,i){let o=(0,s.E)(n);(0,r.useEffect)((()=>{if(e)return document.addEventListener(t,n,i),()=>document.removeEventListener(t,n,i);function n(e){o.current(e)}}),[e,t,i])}function P(e,t,n,i){let o=(0,s.E)(n);(0,r.useEffect)((()=>{if(e)return window.addEventListener(t,n,i),()=>window.removeEventListener(t,n,i);function n(e){o.current(e)}}),[e,t,i])}function C(...e){return(0,r.useMemo)((()=>(0,f.r)(...e)),[...e])}var A=n(6045);let k=(0,r.createContext)(null);function R({children:e,node:t}){let[n,i]=(0,r.useState)(null),s=V(null!=t?t:n);return r.createElement(k.Provider,{value:s},e,null===s&&r.createElement(A._,{features:A.x.Hidden,ref:e=>{var t,n;if(e)for(let r of null!=(n=null==(t=(0,f.r)(e))?void 0:t.querySelectorAll("html > *, body > *"))?n:[])if(r!==document.body&&r!==document.head&&r instanceof HTMLElement&&null!=r&&r.contains(e)){i(r);break}}}))}function V(e=null){var t;return null!=(t=(0,r.useContext)(k))?t:e}function O(){let e;return{before({doc:t}){var n;let r=t.documentElement,i=null!=(n=t.defaultView)?n:window;e=Math.max(0,i.innerWidth-r.clientWidth)},after({doc:t,d:n}){let r=t.documentElement,i=Math.max(0,r.clientWidth-r.offsetWidth),s=Math.max(0,e-i);n.style(r,"paddingRight",`${s}px`)}}}function D(){return x()?{before({doc:e,d:t,meta:n}){function r(e){return n.containers.flatMap((e=>e())).some((t=>t.contains(e)))}t.microTask((()=>{var n;if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let n=(0,m.k)();n.style(e.documentElement,"scrollBehavior","auto"),t.add((()=>t.microTask((()=>n.dispose()))))}let i=null!=(n=window.scrollY)?n:window.pageYOffset,s=null;t.addEventListener(e,"click",(t=>{if(t.target instanceof HTMLElement)try{let n=t.target.closest("a");if(!n)return;let{hash:i}=new URL(n.href),o=e.querySelector(i);o&&!r(o)&&(s=o)}catch{}}),!0),t.addEventListener(e,"touchstart",(e=>{if(e.target instanceof HTMLElement)if(r(e.target)){let n=e.target;for(;n.parentElement&&r(n.parentElement);)n=n.parentElement;t.style(n,"overscrollBehavior","contain")}else t.style(e.target,"touchAction","none")})),t.addEventListener(e,"touchmove",(e=>{if(e.target instanceof HTMLElement){if("INPUT"===e.target.tagName)return;if(r(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}}),{passive:!1}),t.add((()=>{var e;let t=null!=(e=window.scrollY)?e:window.pageYOffset;i!==t&&window.scrollTo(0,i),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)}))}))}}:{}}function L(e){let t={};for(let n of e)Object.assign(t,n(t));return t}let M=l((()=>new Map),{PUSH(e,t){var n;let r=null!=(n=this.get(e))?n:{doc:e,count:0,d:(0,m.k)(),meta:new Set};return r.count++,r.meta.add(t),this.set(e,r),this},POP(e,t){let n=this.get(e);return n&&(n.count--,n.meta.delete(t)),this},SCROLL_PREVENT({doc:e,d:t,meta:n}){let r={doc:e,d:t,meta:L(n)},i=[D(),O(),{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")}}];i.forEach((({before:e})=>null==e?void 0:e(r))),i.forEach((({after:e})=>null==e?void 0:e(r)))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});M.subscribe((()=>{let e=M.getSnapshot(),t=new Map;for(let[n]of e)t.set(n,n.documentElement.style.overflow);for(let n of e.values()){let e="hidden"===t.get(n.doc),r=0!==n.count;(r&&!e||!r&&e)&&M.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&M.dispatch("TEARDOWN",n)}}));var F=n(2180),j=n(3784),N=n(4782),I=n(6567);let _=(0,r.createContext)(!1);function B(){return(0,r.useContext)(_)}function U(e){return r.createElement(_.Provider,{value:e.force},e.children)}var $=n(2984),z=n(2351);let W=(0,r.createContext)(void 0),H=(0,r.createContext)(null);function Y(){let e=(0,r.useContext)(H);if(null===e){let e=new Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(e,Y),e}return e}H.displayName="DescriptionContext";let q=(0,z.yV)((function(e,t){let n=(0,r.useId)(),i=(0,r.useContext)(W),{id:s=`headlessui-description-${n}`,...o}=e,a=Y(),l=(0,j.T)(t);(0,u.e)((()=>a.register(s)),[s,a.register]);let c=i||!1,d=(0,r.useMemo)((()=>({...a.slot,disabled:c})),[a.slot,c]),h={ref:l,...a.props,id:s};return(0,z.sY)({ourProps:h,theirProps:o,slot:d,defaultTag:"p",name:a.name||"Description"})})),K=Object.assign(q,{});var Z=n(4192),G=n(4879),X=n(1021);function J(e){let t=(0,p.z)(e),n=(0,r.useRef)(!1);(0,r.useEffect)((()=>(n.current=!1,()=>{n.current=!0,(0,X.Y)((()=>{n.current&&t()}))})),[t])}var Q,ee=((Q=ee||{})[Q.Forwards=0]="Forwards",Q[Q.Backwards=1]="Backwards",Q);function te(e,t){let n=(0,r.useRef)([]),i=(0,p.z)(e);(0,r.useEffect)((()=>{let e=[...n.current];for(let[r,s]of t.entries())if(n.current[r]!==s){let r=i(t,e);return n.current=t,r}}),[i,...t])}let ne=[];function re(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let n of e.current)n.current instanceof HTMLElement&&t.add(n.current);return t}!function(e){function t(){"loading"!==document.readyState&&((()=>{function e(e){if(!(e.target instanceof HTMLElement)||e.target===document.body||ne[0]===e.target)return;let t=e.target;t=t.closest(E.y),ne.unshift(null!=t?t:e.target),ne=ne.filter((e=>null!=e&&e.isConnected)),ne.splice(10)}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}();var ie,se=((ie=se||{})[ie.None=0]="None",ie[ie.InitialFocus=1]="InitialFocus",ie[ie.TabLock=2]="TabLock",ie[ie.FocusLock=4]="FocusLock",ie[ie.RestoreFocus=8]="RestoreFocus",ie[ie.AutoFocus=16]="AutoFocus",ie);let oe=(0,z.yV)((function(e,t){let n=(0,r.useRef)(null),i=(0,j.T)(n,t),{initialFocus:s,initialFocusFallback:a,containers:l,features:u=15,...c}=e;(0,F.H)()||(u=0);let d=C(n);!function(e,{ownerDocument:t}){let n=!!(8&e),i=function(e=!0){let t=(0,r.useRef)(ne.slice());return te((([e],[n])=>{!0===n&&!1===e&&(0,X.Y)((()=>{t.current.splice(0)})),!1===n&&!0===e&&(t.current=ne.slice())}),[e,ne,t]),(0,p.z)((()=>{var e;return null!=(e=t.current.find((e=>null!=e&&e.isConnected)))?e:null}))}(n);te((()=>{n||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&(0,E.C5)(i())}),[n]),J((()=>{n&&(0,E.C5)(i())}))}(u,{ownerDocument:d});let m=function(e,{ownerDocument:t,container:n,initialFocus:i,initialFocusFallback:s}){let o=(0,r.useRef)(null),a=h(!!(1&e),"focus-trap#initial-focus"),l=(0,G.t)();return te((()=>{if(0===e)return;if(!a)return void(null!=s&&s.current&&(0,E.C5)(s.current));let r=n.current;r&&(0,X.Y)((()=>{if(!l.current)return;let n=null==t?void 0:t.activeElement;if(null!=i&&i.current){if((null==i?void 0:i.current)===n)return void(o.current=n)}else if(r.contains(n))return void(o.current=n);if(null!=i&&i.current)(0,E.C5)(i.current);else{if(16&e){if((0,E.jA)(r,E.TO.First|E.TO.AutoFocus)!==E.fE.Error)return}else if((0,E.jA)(r,E.TO.First)!==E.fE.Error)return;if(null!=s&&s.current&&((0,E.C5)(s.current),(null==t?void 0:t.activeElement)===s.current))return;console.warn("There are no focusable elements inside the ")}o.current=null==t?void 0:t.activeElement}))}),[s,a,e]),o}(u,{ownerDocument:d,container:n,initialFocus:s,initialFocusFallback:a});!function(e,{ownerDocument:t,container:n,containers:r,previousActiveElement:i}){let s=(0,G.t)(),a=!!(4&e);o(null==t?void 0:t.defaultView,"focus",(e=>{if(!a||!s.current)return;let t=re(r);n.current instanceof HTMLElement&&t.add(n.current);let o=i.current;if(!o)return;let l=e.target;l&&l instanceof HTMLElement?le(t,l)?(i.current=l,(0,E.C5)(l)):(e.preventDefault(),e.stopPropagation(),(0,E.C5)(o)):(0,E.C5)(i.current)}),!0)}(u,{ownerDocument:d,container:n,containers:l,previousActiveElement:m});let f=function(){let e=(0,r.useRef)(0);return P(!0,"keydown",(t=>{"Tab"===t.key&&(e.current=t.shiftKey?1:0)}),!0),e}(),v=(0,p.z)((e=>{let t=n.current;t&&(0,$.E)(f.current,{[ee.Forwards]:()=>{(0,E.jA)(t,E.TO.First,{skipElements:[e.relatedTarget,a]})},[ee.Backwards]:()=>{(0,E.jA)(t,E.TO.Last,{skipElements:[e.relatedTarget,a]})}})})),g=h(!!(2&u),"focus-trap#tab-lock"),y=(0,Z.G)(),w=(0,r.useRef)(!1),b={ref:i,onKeyDown(e){"Tab"==e.key&&(w.current=!0,y.requestAnimationFrame((()=>{w.current=!1})))},onBlur(e){if(!(4&u))return;let t=re(l);n.current instanceof HTMLElement&&t.add(n.current);let r=e.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(le(t,r)||(w.current?(0,E.jA)(n.current,(0,$.E)(f.current,{[ee.Forwards]:()=>E.TO.Next,[ee.Backwards]:()=>E.TO.Previous})|E.TO.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&(0,E.C5)(e.target)))}};return r.createElement(r.Fragment,null,g&&r.createElement(A._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:A.x.Focusable}),(0,z.sY)({ourProps:b,theirProps:c,defaultTag:"div",name:"FocusTrap"}),g&&r.createElement(A._,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:v,features:A.x.Focusable}))})),ae=Object.assign(oe,{features:se});function le(e,t){for(let n of e)if(n.contains(t))return!0;return!1}const ue=window.ReactDOM;var ce=n(7896);let de=r.Fragment,he=(0,z.yV)((function(e,t){let n=e,i=(0,r.useRef)(null),s=(0,j.T)((0,j.h)((e=>{i.current=e})),t),o=C(i),a=function(e){let t=B(),n=(0,r.useContext)(me),i=C(e),[s,o]=(0,r.useState)((()=>{var e;if(!t&&null!==n)return null!=(e=n.current)?e:null;if(ce.O.isServer)return null;let r=null==i?void 0:i.getElementById("headlessui-portal-root");if(r)return r;if(null===i)return null;let s=i.createElement("div");return s.setAttribute("id","headlessui-portal-root"),i.body.appendChild(s)}));return(0,r.useEffect)((()=>{null!==s&&(null!=i&&i.body.contains(s)||null==i||i.body.appendChild(s))}),[s,i]),(0,r.useEffect)((()=>{t||null!==n&&o(n.current)}),[n,o,t]),s}(i),[l]=(0,r.useState)((()=>{var e;return ce.O.isServer?null:null!=(e=null==o?void 0:o.createElement("div"))?e:null})),c=(0,r.useContext)(fe),d=(0,F.H)();return(0,u.e)((()=>{!a||!l||a.contains(l)||(l.setAttribute("data-headlessui-portal",""),a.appendChild(l))}),[a,l]),(0,u.e)((()=>{if(l&&c)return c.register(l)}),[c,l]),J((()=>{var e;!a||!l||(l instanceof Node&&a.contains(l)&&a.removeChild(l),a.childNodes.length<=0&&(null==(e=a.parentElement)||e.removeChild(a)))})),d&&a&&l?(0,ue.createPortal)((0,z.sY)({ourProps:{ref:s},theirProps:n,slot:{},defaultTag:de,name:"Portal"}),l):null})),pe=r.Fragment,me=(0,r.createContext)(null),fe=(0,r.createContext)(null);function ve(){let e=(0,r.useContext)(fe),t=(0,r.useRef)([]),n=(0,p.z)((n=>(t.current.push(n),e&&e.register(n),()=>i(n)))),i=(0,p.z)((n=>{let r=t.current.indexOf(n);-1!==r&&t.current.splice(r,1),e&&e.unregister(n)})),s=(0,r.useMemo)((()=>({register:n,unregister:i,portals:t})),[n,i,t]);return[t,(0,r.useMemo)((()=>function({children:e}){return r.createElement(fe.Provider,{value:s},e)}),[s])]}let ge=(0,z.yV)((function(e,t){let n=(0,j.T)(t),{enabled:i=!0,...s}=e;return i?r.createElement(he,{...s,ref:n}):(0,z.sY)({ourProps:{ref:n},theirProps:s,slot:{},defaultTag:de,name:"Portal"})})),ye=(0,z.yV)((function(e,t){let{target:n,...i}=e,s={ref:(0,j.T)(t)};return r.createElement(me.Provider,{value:n},(0,z.sY)({ourProps:s,theirProps:i,defaultTag:pe,name:"Popover.Group"}))})),we=Object.assign(ge,{Group:ye});var be,Ee=n(8687),xe=((be=xe||{})[be.Open=0]="Open",be[be.Closed=1]="Closed",be),Se=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Se||{});let Te={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},Pe=(0,r.createContext)(null);function Ce(e){let t=(0,r.useContext)(Pe);if(null===t){let t=new Error(`<${e} /> is missing a parent component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Ce),t}return t}function Ae(e,t){return(0,$.E)(t.type,Te,e,t)}Pe.displayName="DialogContext";let ke=(0,z.yV)((function(e,t){let n=(0,r.useId)(),{id:a=`headlessui-dialog-${n}`,open:l,onClose:d,initialFocus:m,role:f="dialog",autoFocus:v=!0,__demoMode:g=!1,unmount:y=!1,...x}=e,A=(0,r.useRef)(!1);f="dialog"===f||"alertdialog"===f?f:(A.current||(A.current=!0,console.warn(`Invalid role [${f}] passed to . Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog");let k=(0,I.oJ)();void 0===l&&null!==k&&(l=(k&I.ZM.Open)===I.ZM.Open);let R=(0,r.useRef)(null),O=(0,j.T)(R,t),D=C(R),L=l?0:1,[_,B]=(0,r.useReducer)(Ae,{titleId:null,descriptionId:null,panelRef:(0,r.createRef)()}),$=(0,p.z)((()=>d(!1))),W=(0,p.z)((e=>B({type:0,id:e}))),Y=!!(0,F.H)()&&0===L,[q,K]=ve(),Z={get current(){var e;return null!=(e=_.panelRef.current)?e:R.current}},G=V(),{resolveContainers:X}=function({defaultContainers:e=[],portals:t,mainTreeNode:n}={}){let r=C(n),i=(0,p.z)((()=>{var i,s;let o=[];for(let t of e)null!==t&&(t instanceof HTMLElement?o.push(t):"current"in t&&t.current instanceof HTMLElement&&o.push(t.current));if(null!=t&&t.current)for(let e of t.current)o.push(e);for(let e of null!=(i=null==r?void 0:r.querySelectorAll("html > *, body > *"))?i:[])e!==document.body&&e!==document.head&&e instanceof HTMLElement&&"headlessui-portal-root"!==e.id&&(n&&(e.contains(n)||e.contains(null==(s=null==n?void 0:n.getRootNode())?void 0:s.host))||o.some((t=>e.contains(t)))||o.push(e));return o}));return{resolveContainers:i,contains:(0,p.z)((e=>i().some((t=>t.contains(e)))))}}({mainTreeNode:G,portals:q,defaultContainers:[Z]}),J=null!==k&&(k&I.ZM.Closing)===I.ZM.Closing;w(!g&&!J&&Y,{allowed:(0,p.z)((()=>{var e,t;return[null!=(t=null==(e=R.current)?void 0:e.closest("[data-headlessui-portal]"))?t:null]})),disallowed:(0,p.z)((()=>{var e;return[null!=(e=null==G?void 0:G.closest("body > *:not(#headlessui-portal-root)"))?e:null]}))}),function(e,t,n){let i=h(e,"outside-click"),o=(0,s.E)(n),a=(0,r.useCallback)((function(e,n){if(e.defaultPrevented)return;let r=n(e);if(null===r||!r.getRootNode().contains(r)||!r.isConnected)return;let i=function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(t);for(let t of i){if(null===t)continue;let n=t instanceof HTMLElement?t:t.current;if(null!=n&&n.contains(r)||e.composed&&e.composedPath().includes(n))return}return!(0,E.sP)(r,E.tJ.Loose)&&-1!==r.tabIndex&&e.preventDefault(),o.current(e,r)}),[o]),l=(0,r.useRef)(null);T(i,"pointerdown",(e=>{var t,n;l.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),T(i,"mousedown",(e=>{var t,n;l.current=(null==(n=null==(t=e.composedPath)?void 0:t.call(e))?void 0:n[0])||e.target}),!0),T(i,"click",(e=>{S()||l.current&&(a(e,(()=>l.current)),l.current=null)}),!0);let u=(0,r.useRef)({x:0,y:0});T(i,"touchstart",(e=>{u.current.x=e.touches[0].clientX,u.current.y=e.touches[0].clientY}),!0),T(i,"touchend",(e=>{let t=e.changedTouches[0].clientX,n=e.changedTouches[0].clientY;if(!(Math.abs(t-u.current.x)>=30||Math.abs(n-u.current.y)>=30))return a(e,(()=>e.target instanceof HTMLElement?e.target:null))}),!0),P(i,"blur",(e=>a(e,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}(Y,X,(e=>{e.preventDefault(),$()})),function(e,t=("undefined"!=typeof document?document.defaultView:null),n){let r=h(e,"escape");o(t,"keydown",(e=>{r&&(e.defaultPrevented||e.key===i.R.Escape&&n(e))}))}(Y,null==D?void 0:D.defaultView,(e=>{e.preventDefault(),e.stopPropagation(),document.activeElement&&"blur"in document.activeElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur(),$()})),function(e,t,n=(()=>[document.body])){!function(e,t,n=(()=>({containers:[]}))){let r=c(M),i=t?r.get(t):void 0;i&&i.count,(0,u.e)((()=>{if(t&&e)return M.dispatch("PUSH",t,n),()=>M.dispatch("POP",t,n)}),[e,t])}(h(e,"scroll-lock"),t,(e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],n]}}))}(!g&&!J&&Y,D,X),(0,b.m)(Y,R,$);let[Q,ee]=function(){let[e,t]=(0,r.useState)([]);return[e.length>0?e.join(" "):void 0,(0,r.useMemo)((()=>function(e){let n=(0,p.z)((e=>(t((t=>[...t,e])),()=>t((t=>{let n=t.slice(),r=n.indexOf(e);return-1!==r&&n.splice(r,1),n}))))),i=(0,r.useMemo)((()=>({register:n,slot:e.slot,name:e.name,props:e.props,value:e.value})),[n,e.slot,e.name,e.props,e.value]);return r.createElement(H.Provider,{value:i},e.children)}),[t])]}(),te=(0,r.useMemo)((()=>[{dialogState:L,close:$,setTitleId:W,unmount:y},_]),[L,_,$,W,y]),ne=(0,r.useMemo)((()=>({open:0===L})),[L]),re={ref:O,id:a,role:f,tabIndex:-1,"aria-modal":g?void 0:0===L||void 0,"aria-labelledby":_.titleId,"aria-describedby":Q,unmount:y},ie=!function(){var e;let[t]=(0,r.useState)((()=>"undefined"!=typeof window&&"function"==typeof window.matchMedia?window.matchMedia("(pointer: coarse)"):null)),[n,i]=(0,r.useState)(null!=(e=null==t?void 0:t.matches)&&e);return(0,u.e)((()=>{if(t)return t.addEventListener("change",e),()=>t.removeEventListener("change",e);function e(e){i(e.matches)}}),[t]),n}(),oe=se.None;return Y&&!g&&(oe|=se.RestoreFocus,oe|=se.TabLock,v&&(oe|=se.AutoFocus),ie&&(oe|=se.InitialFocus)),r.createElement(I.uu,null,r.createElement(U,{force:!0},r.createElement(we,null,r.createElement(Pe.Provider,{value:te},r.createElement(ye,{target:R},r.createElement(U,{force:!1},r.createElement(ee,{slot:ne},r.createElement(K,null,r.createElement(ae,{initialFocus:m,initialFocusFallback:R,containers:X,features:oe},r.createElement(N.Z,{value:$},(0,z.sY)({ourProps:re,theirProps:x,slot:ne,defaultTag:Re,features:Ve,visible:0===L,name:"Dialog"})))))))))))})),Re="div",Ve=z.VN.RenderStrategy|z.VN.Static,Oe=(0,z.yV)((function(e,t){let{transition:n=!1,open:i,...s}=e,o=(0,I.oJ)(),a=e.hasOwnProperty("open")||null!==o,l=e.hasOwnProperty("onClose");if(!a&&!l)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!a)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!l)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(!o&&"boolean"!=typeof e.open)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${e.open}`);if("function"!=typeof e.onClose)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${e.onClose}`);return void 0===i&&!n||s.static?r.createElement(R,null,r.createElement(ke,{ref:t,open:i,...s})):r.createElement(R,null,r.createElement(Ee.u,{show:i,transition:n,unmount:s.unmount},r.createElement(ke,{ref:t,...s})))})),De=(0,z.yV)((function(e,t){let n=(0,r.useId)(),{id:i=`headlessui-dialog-panel-${n}`,transition:s=!1,...o}=e,[{dialogState:a,unmount:l},u]=Ce("Dialog.Panel"),c=(0,j.T)(t,u.panelRef),d=(0,r.useMemo)((()=>({open:0===a})),[a]),h={ref:c,id:i,onClick:(0,p.z)((e=>{e.stopPropagation()}))};return r.createElement(s?Ee.x:r.Fragment,{...s?{unmount:l}:{}},(0,z.sY)({ourProps:h,theirProps:o,slot:d,defaultTag:"div",name:"Dialog.Panel"}))})),Le=((0,z.yV)((function(e,t){let{transition:n=!1,...i}=e,[{dialogState:s,unmount:o}]=Ce("Dialog.Backdrop"),a=(0,r.useMemo)((()=>({open:0===s})),[s]),l={ref:t,"aria-hidden":!0};return r.createElement(n?Ee.x:r.Fragment,{...n?{unmount:o}:{}},(0,z.sY)({ourProps:l,theirProps:i,slot:a,defaultTag:"div",name:"Dialog.Backdrop"}))})),(0,z.yV)((function(e,t){let n=(0,r.useId)(),{id:i=`headlessui-dialog-title-${n}`,...s}=e,[{dialogState:o,setTitleId:a}]=Ce("Dialog.Title"),l=(0,j.T)(t);(0,r.useEffect)((()=>(a(i),()=>a(null))),[i,a]);let u=(0,r.useMemo)((()=>({open:0===o})),[o]);return(0,z.sY)({ourProps:{ref:l,id:i},theirProps:s,slot:u,defaultTag:"h2",name:"Dialog.Title"})}))),Me=Object.assign(Oe,{Panel:De,Title:Le,Description:K})},1363:(e,t,n)=>{"use strict";n.d(t,{R:()=>i});var r,i=((r=i||{}).Space=" ",r.Enter="Enter",r.Escape="Escape",r.Backspace="Backspace",r.Delete="Delete",r.ArrowLeft="ArrowLeft",r.ArrowUp="ArrowUp",r.ArrowRight="ArrowRight",r.ArrowDown="ArrowDown",r.Home="Home",r.End="End",r.PageUp="PageUp",r.PageDown="PageDown",r.Tab="Tab",r)},8687:(e,t,n)=>{"use strict";n.d(t,{u:()=>R,x:()=>k});var r=n(9196),i=n(4192),s=n(3781),o=n(4879),a=n(6723),l=n(3855),u=n(8553),c=n(2180),d=n(3784),h=n(5189),p=n(6567),m=n(4067),f=n(2984),v=n(2351);function g(e){var t;return!!(e.enter||e.enterFrom||e.enterTo||e.leave||e.leaveFrom||e.leaveTo)||(null!=(t=e.as)?t:T)!==r.Fragment||1===r.Children.count(e.children)}let y=(0,r.createContext)(null);y.displayName="TransitionContext";var w,b=((w=b||{}).Visible="visible",w.Hidden="hidden",w);let E=(0,r.createContext)(null);function x(e){return"children"in e?x(e.children):e.current.filter((({el:e})=>null!==e.current)).filter((({state:e})=>"visible"===e)).length>0}function S(e,t){let n=(0,l.E)(e),a=(0,r.useRef)([]),u=(0,o.t)(),c=(0,i.G)(),d=(0,s.z)(((e,t=v.l4.Hidden)=>{let r=a.current.findIndex((({el:t})=>t===e));-1!==r&&((0,f.E)(t,{[v.l4.Unmount](){a.current.splice(r,1)},[v.l4.Hidden](){a.current[r].state="hidden"}}),c.microTask((()=>{var e;!x(a)&&u.current&&(null==(e=n.current)||e.call(n))})))})),h=(0,s.z)((e=>{let t=a.current.find((({el:t})=>t===e));return t?"visible"!==t.state&&(t.state="visible"):a.current.push({el:e,state:"visible"}),()=>d(e,v.l4.Unmount)})),p=(0,r.useRef)([]),m=(0,r.useRef)(Promise.resolve()),g=(0,r.useRef)({enter:[],leave:[]}),y=(0,s.z)(((e,n,r)=>{p.current.splice(0),t&&(t.chains.current[n]=t.chains.current[n].filter((([t])=>t!==e))),null==t||t.chains.current[n].push([e,new Promise((e=>{p.current.push(e)}))]),null==t||t.chains.current[n].push([e,new Promise((e=>{Promise.all(g.current[n].map((([e,t])=>t))).then((()=>e()))}))]),"enter"===n?m.current=m.current.then((()=>null==t?void 0:t.wait.current)).then((()=>r(n))):r(n)})),w=(0,s.z)(((e,t,n)=>{Promise.all(g.current[t].splice(0).map((([e,t])=>t))).then((()=>{var e;null==(e=p.current.shift())||e()})).then((()=>n(t)))}));return(0,r.useMemo)((()=>({children:a,register:h,unregister:d,onStart:y,onStop:w,wait:m,chains:g})),[h,d,a,y,w,g,m])}E.displayName="NestingContext";let T=r.Fragment,P=v.VN.RenderStrategy,C=(0,v.yV)((function(e,t){let{show:n,appear:i=!1,unmount:o=!0,...l}=e,h=(0,r.useRef)(null),m=g(e),f=(0,d.T)(...m?[h,t]:null===t?[]:[t]);(0,c.H)();let w=(0,p.oJ)();if(void 0===n&&null!==w&&(n=(w&p.ZM.Open)===p.ZM.Open),void 0===n)throw new Error("A is used but it is missing a `show={true | false}` prop.");let[b,T]=(0,r.useState)(n?"visible":"hidden"),C=S((()=>{n||T("hidden")})),[k,R]=(0,r.useState)(!0),V=(0,r.useRef)([n]);(0,a.e)((()=>{!1!==k&&V.current[V.current.length-1]!==n&&(V.current.push(n),R(!1))}),[V,n]);let O=(0,r.useMemo)((()=>({show:n,appear:i,initial:k})),[n,i,k]);(0,u.m)(n,h,(()=>T("hidden"))),(0,a.e)((()=>{n?T("visible"):!x(C)&&null!==h.current&&T("hidden")}),[n,C]);let D={unmount:o},L=(0,s.z)((()=>{var t;k&&R(!1),null==(t=e.beforeEnter)||t.call(e)})),M=(0,s.z)((()=>{var t;k&&R(!1),null==(t=e.beforeLeave)||t.call(e)}));return r.createElement(E.Provider,{value:C},r.createElement(y.Provider,{value:O},(0,v.sY)({ourProps:{...D,as:r.Fragment,children:r.createElement(A,{ref:f,...D,...l,beforeEnter:L,beforeLeave:M})},theirProps:{},defaultTag:r.Fragment,features:P,visible:"visible"===b,name:"Transition"})))})),A=(0,v.yV)((function(e,t){var n,i;let{transition:o=!0,beforeEnter:l,afterEnter:u,beforeLeave:w,afterLeave:b,enter:C,enterFrom:A,enterTo:k,entered:R,leave:V,leaveFrom:O,leaveTo:D,...L}=e,M=(0,r.useRef)(null),F=g(e),j=(0,d.T)(...F?[M,t]:null===t?[]:[t]),N=null==(n=L.unmount)||n?v.l4.Unmount:v.l4.Hidden,{show:I,appear:_,initial:B}=function(){let e=(0,r.useContext)(y);if(null===e)throw new Error("A is used but it is missing a parent or .");return e}(),[U,$]=(0,r.useState)(I?"visible":"hidden"),z=function(){let e=(0,r.useContext)(E);if(null===e)throw new Error("A is used but it is missing a parent or .");return e}(),{register:W,unregister:H}=z;(0,a.e)((()=>W(M)),[W,M]),(0,a.e)((()=>{if(N===v.l4.Hidden&&M.current)return I&&"visible"!==U?void $("visible"):(0,f.E)(U,{hidden:()=>H(M),visible:()=>W(M)})}),[U,M,W,H,I,N]);let Y=(0,c.H)();(0,a.e)((()=>{if(F&&Y&&"visible"===U&&null===M.current)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")}),[M,U,Y,F]);let q=B&&!_,K=_&&I&&B,Z=(0,r.useRef)(!1),G=S((()=>{Z.current||($("hidden"),H(M))}),z),X=(0,s.z)((e=>{Z.current=!0;let t=e?"enter":"leave";G.onStart(M,t,(e=>{"enter"===e?null==l||l():"leave"===e&&(null==w||w())}))})),J=(0,s.z)((e=>{let t=e?"enter":"leave";Z.current=!1,G.onStop(M,t,(e=>{"enter"===e?null==u||u():"leave"===e&&(null==b||b())})),"leave"===t&&!x(G)&&($("hidden"),H(M))}));(0,r.useEffect)((()=>{F&&o||(X(I),J(I))}),[I,F,o]);let Q=!(!o||!F||!Y||q),[,ee]=(0,h.Y)(Q,M,I,{start:X,end:J}),te=(0,v.oA)({ref:j,className:(null==(i=(0,m.A)(L.className,K&&C,K&&A,ee.enter&&C,ee.enter&&ee.closed&&A,ee.enter&&!ee.closed&&k,ee.leave&&V,ee.leave&&!ee.closed&&O,ee.leave&&ee.closed&&D,!ee.transition&&I&&R))?void 0:i.trim())||void 0,...(0,h.X)(ee)}),ne=0;return"visible"===U&&(ne|=p.ZM.Open),"hidden"===U&&(ne|=p.ZM.Closed),ee.enter&&(ne|=p.ZM.Opening),ee.leave&&(ne|=p.ZM.Closing),r.createElement(E.Provider,{value:G},r.createElement(p.up,{value:ne},(0,v.sY)({ourProps:te,theirProps:L,defaultTag:T,features:P,visible:"visible"===U,name:"Transition.Child"})))})),k=(0,v.yV)((function(e,t){let n=null!==(0,r.useContext)(y),i=null!==(0,p.oJ)();return r.createElement(r.Fragment,null,!n&&i?r.createElement(C,{ref:t,...e}):r.createElement(A,{ref:t,...e}))})),R=Object.assign(C,{Child:k,Root:C})},4192:(e,t,n)=>{"use strict";n.d(t,{G:()=>s});var r=n(9196),i=n(9362);function s(){let[e]=(0,r.useState)(i.k);return(0,r.useEffect)((()=>()=>e.dispose()),[e]),e}},3781:(e,t,n)=>{"use strict";n.d(t,{z:()=>s});var r=n(9196),i=n(3855);let s=function(e){let t=(0,i.E)(e);return r.useCallback(((...e)=>t.current(...e)),[t])}},4879:(e,t,n)=>{"use strict";n.d(t,{t:()=>s});var r=n(9196),i=n(6723);function s(){let e=(0,r.useRef)(!1);return(0,i.e)((()=>(e.current=!0,()=>{e.current=!1})),[]),e}},6723:(e,t,n)=>{"use strict";n.d(t,{e:()=>s});var r=n(9196),i=n(7896);let s=(e,t)=>{i.O.isServer?(0,r.useEffect)(e,t):(0,r.useLayoutEffect)(e,t)}},3855:(e,t,n)=>{"use strict";n.d(t,{E:()=>s});var r=n(9196),i=n(6723);function s(e){let t=(0,r.useRef)(e);return(0,i.e)((()=>{t.current=e}),[e]),t}},8553:(e,t,n)=>{"use strict";n.d(t,{m:()=>o});var r=n(9196),i=n(9362),s=n(3855);function o(e,t,n){let o=(0,s.E)((e=>{let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&n()}));(0,r.useEffect)((()=>{if(!e)return;let n=null===t?null:t instanceof HTMLElement?t:t.current;if(!n)return;let r=(0,i.k)();if("undefined"!=typeof ResizeObserver){let e=new ResizeObserver((()=>o.current(n)));e.observe(n),r.add((()=>e.disconnect()))}if("undefined"!=typeof IntersectionObserver){let e=new IntersectionObserver((()=>o.current(n)));e.observe(n),r.add((()=>e.disconnect()))}return()=>r.dispose()}),[t,o,e])}},2180:(e,t,n)=>{"use strict";var r;n.d(t,{H:()=>o});var i=n(9196),s=n(7896);function o(){let e=function(){let e="undefined"==typeof document;return"useSyncExternalStore"in(r||(r=n.t(i,2)))&&(r||(r=n.t(i,2))).useSyncExternalStore((()=>()=>{}),(()=>!1),(()=>!e))}(),[t,o]=i.useState(s.O.isHandoffComplete);return t&&!1===s.O.isHandoffComplete&&o(!1),i.useEffect((()=>{!0!==t&&o(!0)}),[t]),i.useEffect((()=>s.O.handoff()),[]),!e&&t}},3784:(e,t,n)=>{"use strict";n.d(t,{T:()=>a,h:()=>o});var r=n(9196),i=n(3781);let s=Symbol();function o(e,t=!0){return Object.assign(e,{[s]:t})}function a(...e){let t=(0,r.useRef)(e);(0,r.useEffect)((()=>{t.current=e}),[e]);let n=(0,i.z)((e=>{for(let n of t.current)null!=n&&("function"==typeof n?n(e):n.current=e)}));return e.every((e=>null==e||(null==e?void 0:e[s])))?void 0:n}},5189:(e,t,n)=>{"use strict";n.d(t,{X:()=>u,Y:()=>c});var r,i=n(9196),s=n(9362),o=n(4192),a=n(6723),l=((r=l||{})[r.None=0]="None",r[r.Closed=1]="Closed",r[r.Enter=2]="Enter",r[r.Leave=4]="Leave",r);function u(e){let t={};for(let n in e)!0===e[n]&&(t[`data-${n}`]="");return t}function c(e,t,n,r){let[l,u]=(0,i.useState)(n),{hasFlag:c,addFlag:d,removeFlag:h}=function(e=0){let[t,n]=(0,i.useState)(e),r=(0,i.useCallback)((e=>n(e)),[t]),s=(0,i.useCallback)((e=>n((t=>t|e))),[t]),o=(0,i.useCallback)((e=>(t&e)===e),[t]),a=(0,i.useCallback)((e=>n((t=>t&~e))),[n]),l=(0,i.useCallback)((e=>n((t=>t^e))),[n]);return{flags:t,setFlag:r,addFlag:s,hasFlag:o,removeFlag:a,toggleFlag:l}}(e&&l?3:0),p=(0,i.useRef)(!1),m=(0,i.useRef)(!1),f=(0,o.G)();return(0,a.e)((function i(){var o;if(!e)return;n&&u(!0);let a=t.current;return a?(null==(o=null==r?void 0:r.start)||o.call(r,n),function(e,{prepare:t,run:n,done:r,inFlight:i}){let o=(0,s.k)();return function(e,{inFlight:t,prepare:n}){if(null!=t&&t.current)return void n();let r=e.style.transition;e.style.transition="none",n(),e.offsetHeight,e.style.transition=r}(e,{prepare:t,inFlight:i}),o.nextFrame((()=>{o.add(function(e,t){let n=function(e){let t={called:!1};return(...n)=>{if(!t.called)return t.called=!0,e(...n)}}(t),r=(0,s.k)();if(!e)return r.dispose;let{transitionDuration:i,transitionDelay:o}=getComputedStyle(e),[a,l]=[i,o].map((e=>{let[t=0]=e.split(",").filter(Boolean).map((e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e))).sort(((e,t)=>t-e));return t})),u=a+l;if(0!==u){let t=r.group((r=>{let i=r.setTimeout((()=>{n(),r.dispose()}),u);r.addEventListener(e,"transitionrun",(s=>{s.target===s.currentTarget&&(i(),r.addEventListener(e,"transitioncancel",(e=>{e.target===e.currentTarget&&(n(),t())})))}))}));r.addEventListener(e,"transitionend",(e=>{e.target===e.currentTarget&&(n(),r.dispose())}))}else n();return r.dispose}(e,r)),n()})),o.dispose}(a,{inFlight:p,prepare(){m.current?m.current=!1:m.current=p.current,p.current=!0,!m.current&&(n?(d(3),h(4)):(d(4),h(2)))},run(){m.current?n?(h(3),d(4)):(h(4),d(3)):n?h(1):d(1)},done(){var e;m.current&&"function"==typeof a.getAnimations&&a.getAnimations().length>0||(p.current=!1,h(7),n||u(!1),null==(e=null==r?void 0:r.end)||e.call(r,n))}})):n?(d(3),f.nextFrame((()=>i()))):void 0}),[e,n,t,f]),e?[l,{closed:c(1),enter:c(2),leave:c(4),transition:c(2)||c(4)}]:[n,{closed:void 0,enter:void 0,leave:void 0,transition:void 0}]}},4782:(e,t,n)=>{"use strict";n.d(t,{Z:()=>s});var r=n(9196);let i=(0,r.createContext)((()=>{}));function s({value:e,children:t}){return r.createElement(i.Provider,{value:e},t)}},6045:(e,t,n)=>{"use strict";n.d(t,{_:()=>o,x:()=>s});var r,i=n(2351),s=((r=s||{})[r.None=1]="None",r[r.Focusable=2]="Focusable",r[r.Hidden=4]="Hidden",r);let o=(0,i.yV)((function(e,t){var n;let{features:r=1,...s}=e,o={ref:t,"aria-hidden":2==(2&r)||(null!=(n=s["aria-hidden"])?n:void 0),hidden:4==(4&r)||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...4==(4&r)&&2!=(2&r)&&{display:"none"}}};return(0,i.sY)({ourProps:o,theirProps:s,slot:{},defaultTag:"span",name:"Hidden"})}))},6567:(e,t,n)=>{"use strict";n.d(t,{ZM:()=>o,oJ:()=>a,up:()=>l,uu:()=>u});var r=n(9196);let i=(0,r.createContext)(null);i.displayName="OpenClosedContext";var s,o=((s=o||{})[s.Open=1]="Open",s[s.Closed=2]="Closed",s[s.Closing=4]="Closing",s[s.Opening=8]="Opening",s);function a(){return(0,r.useContext)(i)}function l({value:e,children:t}){return r.createElement(i.Provider,{value:e},t)}function u({children:e}){return r.createElement(i.Provider,{value:null},e)}},4067:(e,t,n)=>{"use strict";function r(...e){return Array.from(new Set(e.flatMap((e=>"string"==typeof e?e.split(" "):[])))).filter(Boolean).join(" ")}n.d(t,{A:()=>r})},9362:(e,t,n)=>{"use strict";n.d(t,{k:()=>i});var r=n(1021);function i(){let e=[],t={addEventListener:(e,n,r,i)=>(e.addEventListener(n,r,i),t.add((()=>e.removeEventListener(n,r,i)))),requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add((()=>cancelAnimationFrame(n)))},nextFrame:(...e)=>t.requestAnimationFrame((()=>t.requestAnimationFrame(...e))),setTimeout(...e){let n=setTimeout(...e);return t.add((()=>clearTimeout(n)))},microTask(...e){let n={current:!0};return(0,r.Y)((()=>{n.current&&e[0]()})),t.add((()=>{n.current=!1}))},style(e,t,n){let r=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:n}),this.add((()=>{Object.assign(e.style,{[t]:r})}))},group(e){let t=i();return e(t),this.add((()=>t.dispose()))},add:t=>(e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}),dispose(){for(let t of e.splice(0))t()}};return t}},7896:(e,t,n)=>{"use strict";n.d(t,{O:()=>s});var r=Object.defineProperty,i=(e,t,n)=>(((e,t,n)=>{t in e?r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n})(e,"symbol"!=typeof t?t+"":t,n),n);let s=new class{constructor(){i(this,"current",this.detect()),i(this,"handoffState","pending"),i(this,"currentId",0)}set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}}},4575:(e,t,n)=>{"use strict";n.d(t,{C5:()=>v,TO:()=>c,fE:()=>d,jA:()=>w,sP:()=>m,tJ:()=>p,y:()=>s,z2:()=>y});var r=n(2984),i=n(5466);let s=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(","),o=["[data-autofocus]"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");var a,l,u,c=((u=c||{})[u.First=1]="First",u[u.Previous=2]="Previous",u[u.Next=4]="Next",u[u.Last=8]="Last",u[u.WrapAround=16]="WrapAround",u[u.NoScroll=32]="NoScroll",u[u.AutoFocus=64]="AutoFocus",u),d=((l=d||{})[l.Error=0]="Error",l[l.Overflow=1]="Overflow",l[l.Success=2]="Success",l[l.Underflow=3]="Underflow",l),h=((a=h||{})[a.Previous=-1]="Previous",a[a.Next=1]="Next",a);var p=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(p||{});function m(e,t=0){var n;return e!==(null==(n=(0,i.r)(e))?void 0:n.body)&&(0,r.E)(t,{0:()=>e.matches(s),1(){let t=e;for(;null!==t;){if(t.matches(s))return!0;t=t.parentElement}return!1}})}var f=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(f||{});function v(e){null==e||e.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",(e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")}),!0),document.addEventListener("click",(e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")}),!0));let g=["textarea","input"].join(",");function y(e,t=(e=>e)){return e.slice().sort(((e,n)=>{let r=t(e),i=t(n);if(null===r||null===i)return 0;let s=r.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}function w(e,t,{sorted:n=!0,relativeTo:r=null,skipElements:i=[]}={}){let a=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?n?y(e):e:64&t?function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(o)).sort(((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER))))}(e):function(e=document.body){return null==e?[]:Array.from(e.querySelectorAll(s)).sort(((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER))))}(e);i.length>0&&l.length>1&&(l=l.filter((e=>!i.some((t=>null!=t&&"current"in t?(null==t?void 0:t.current)===e:t===e))))),r=null!=r?r:a.activeElement;let u,c=(()=>{if(5&t)return 1;if(10&t)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,l.indexOf(r))-1;if(4&t)return Math.max(0,l.indexOf(r))+1;if(8&t)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),h=32&t?{preventScroll:!0}:{},p=0,m=l.length;do{if(p>=m||p+m<=0)return 0;let e=d+p;if(16&t)e=(e+m)%m;else{if(e<0)return 3;if(e>=m)return 1}u=l[e],null==u||u.focus(h),p+=c}while(u!==a.activeElement);return 6&t&&function(e){var t,n;return null!=(n=null==(t=null==e?void 0:e.matches)?void 0:t.call(e,g))&&n}(u)&&u.select(),2}},2984:(e,t,n)=>{"use strict";function r(e,t,...n){if(e in t){let r=t[e];return"function"==typeof r?r(...n):r}let i=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(t).map((e=>`"${e}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(i,r),i}n.d(t,{E:()=>r})},1021:(e,t,n)=>{"use strict";function r(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch((e=>setTimeout((()=>{throw e}))))}n.d(t,{Y:()=>r})},5466:(e,t,n)=>{"use strict";n.d(t,{r:()=>i});var r=n(7896);function i(e){return r.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}},2351:(e,t,n)=>{"use strict";n.d(t,{VN:()=>l,Y2:()=>h,dG:()=>f,l4:()=>u,oA:()=>g,sY:()=>c,yV:()=>v});var r,i,s=n(9196),o=n(4067),a=n(2984),l=((i=l||{})[i.None=0]="None",i[i.RenderStrategy=1]="RenderStrategy",i[i.Static=2]="Static",i),u=((r=u||{})[r.Unmount=0]="Unmount",r[r.Hidden=1]="Hidden",r);function c({ourProps:e,theirProps:t,slot:n,defaultTag:r,features:i,visible:s=!0,name:o,mergeRefs:l}){l=null!=l?l:p;let u=m(t,e);if(s)return d(u,n,r,o,l);let c=null!=i?i:0;if(2&c){let{static:e=!1,...t}=u;if(e)return d(t,n,r,o,l)}if(1&c){let{unmount:e=!0,...t}=u;return(0,a.E)(e?0:1,{0:()=>null,1:()=>d({...t,hidden:!0,style:{display:"none"}},n,r,o,l)})}return d(u,n,r,o,l)}function d(e,t={},n,r,i){let{as:a=n,children:l,refName:u="ref",...c}=y(e,["unmount","static"]),d=void 0!==e.ref?{[u]:e.ref}:{},h="function"==typeof l?l(t):l;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t)),c["aria-labelledby"]&&c["aria-labelledby"]===c.id&&(c["aria-labelledby"]=void 0);let p={};if(t){let e=!1,n=[];for(let[r,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&n.push(r.replace(/([A-Z])/g,(e=>`-${e.toLowerCase()}`)));if(e){p["data-headlessui-state"]=n.join(" ");for(let e of n)p[`data-${e}`]=""}}if(a===s.Fragment&&(Object.keys(g(c)).length>0||Object.keys(g(p)).length>0)){if((0,s.isValidElement)(h)&&!(Array.isArray(h)&&h.length>1)){let e=h.props,t=null==e?void 0:e.className,n="function"==typeof t?(...e)=>(0,o.A)(t(...e),c.className):(0,o.A)(t,c.className),r=n?{className:n}:{},a=m(h.props,g(y(c,["ref"])));for(let e in p)e in a&&delete p[e];return(0,s.cloneElement)(h,Object.assign({},a,p,d,{ref:i(h.ref,d.ref)},r))}if(Object.keys(g(c)).length>0)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(g(c)).concat(Object.keys(g(p))).map((e=>` - ${e}`)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map((e=>` - ${e}`)).join("\n")].join("\n"))}return(0,s.createElement)(a,Object.assign({},y(c,["ref"]),a!==s.Fragment&&d,a!==s.Fragment&&p),h)}function h(){let e=(0,s.useRef)([]),t=(0,s.useCallback)((t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)}),[]);return(...n)=>{if(!n.every((e=>null==e)))return e.current=n,t}}function p(...e){return e.every((e=>null==e))?void 0:t=>{for(let n of e)null!=n&&("function"==typeof n?n(t):n.current=t)}}function m(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];if(t.disabled||t["aria-disabled"])for(let e in n)/^(on(?:Click|Pointer|Mouse|Key)(?:Down|Up|Press)?)$/.test(e)&&(n[e]=[e=>{var t;return null==(t=null==e?void 0:e.preventDefault)?void 0:t.call(e)}]);for(let e in n)Object.assign(t,{[e](t,...r){let i=n[e];for(let e of i){if((t instanceof Event||(null==t?void 0:t.nativeEvent)instanceof Event)&&t.defaultPrevented)return;e(t,...r)}}});return t}function f(...e){if(0===e.length)return{};if(1===e.length)return e[0];let t={},n={};for(let r of e)for(let e in r)e.startsWith("on")&&"function"==typeof r[e]?(null!=n[e]||(n[e]=[]),n[e].push(r[e])):t[e]=r[e];for(let e in n)Object.assign(t,{[e](...t){let r=n[e];for(let e of r)null==e||e(...t)}});return t}function v(e){var t;return Object.assign((0,s.forwardRef)(e),{displayName:null!=(t=e.displayName)?t:e.name})}function g(e){let t=Object.assign({},e);for(let e in t)void 0===t[e]&&delete t[e];return t}function y(e,t=[]){let n=Object.assign({},e);for(let e of t)e in n&&delete n[e];return n}},5364:(e,t,n)=>{"use strict";n.d(t,{p:()=>r});const r=(0,n(9196).createContext)({})},6014:(e,t,n)=>{"use strict";n.d(t,{_:()=>r});const r=(0,n(9196).createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"})},240:(e,t,n)=>{"use strict";n.d(t,{O:()=>r});const r=(0,n(9196).createContext)(null)},3773:(e,t,n)=>{"use strict";n.d(t,{E:()=>Oo});var r=n(5893),i=n(9196),s=n(6014);const o=(0,i.createContext)({});var a=n(240),l=n(8868);const u=(0,i.createContext)({strict:!1}),c=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),d="data-"+c("framerAppearId"),h=["read","resolveKeyframes","update","preRender","render","postRender"];function p(e,t){let n=!1,r=!0;const i={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,o=h.reduce(((e,t)=>(e[t]=function(e){let t=new Set,n=new Set,r=!1,i=!1;const s=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1};function a(t){s.has(t)&&(l.schedule(t),e()),t(o)}const l={schedule:(e,i=!1,o=!1)=>{const a=o&&r?t:n;return i&&s.add(e),a.has(e)||a.add(e),e},cancel:e=>{n.delete(e),s.delete(e)},process:e=>{o=e,r?i=!0:(r=!0,[t,n]=[n,t],n.clear(),t.forEach(a),r=!1,i&&(i=!1,l.process(e)))}};return l}(s),e)),{}),{read:a,resolveKeyframes:l,update:u,preRender:c,render:d,postRender:p}=o,m=()=>{const s=performance.now();n=!1,i.delta=r?1e3/60:Math.max(Math.min(s-i.timestamp,40),1),i.timestamp=s,i.isProcessing=!0,a.process(i),l.process(i),u.process(i),c.process(i),d.process(i),p.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(m))};return{schedule:h.reduce(((t,s)=>{const a=o[s];return t[s]=(t,s=!1,o=!1)=>(n||(n=!0,r=!0,i.isProcessing||e(m)),a.schedule(t,s,o)),t}),{}),cancel:e=>{for(let t=0;t{S&&S.update(n,f)}));const P=(0,i.useRef)(Boolean(n[d]&&!window.HandoffComplete));return(0,l.L)((()=>{S&&(S.updateFeatures(),m.render(S.render),P.current&&S.animationState&&S.animationState.animateChanges())})),(0,i.useEffect)((()=>{S&&(!P.current&&S.animationState&&S.animationState.animateChanges(),P.current&&(P.current=!1,y||(y=!0,queueMicrotask(b))))})),S}function b(){window.HandoffComplete=!0}function E(e){if(e)return!1!==e.options.allowProjection?e.projection:E(e.parent)}function x(e,t,n){return(0,i.useCallback)((r=>{r&&e.mount&&e.mount(r),t&&(r?t.mount(r):t.unmount()),n&&("function"==typeof n?n(r):v(n)&&(n.current=r))}),[t])}function S(e){return"string"==typeof e||Array.isArray(e)}function T(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}const P=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],C=["initial",...P];function A(e){return T(e.animate)||C.some((t=>S(e[t])))}function k(e){return Boolean(A(e)||e.variants)}function R(e){return Array.isArray(e)?e.join(" "):e}const V={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"]},O={};for(const e in V)O[e]={isEnabled:t=>V[e].some((e=>!!t[e]))};var D=n(1741),L=n(5364);const M=Symbol.for("motionComponentSymbol");function F({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:a,Component:l}){e&&function(e){for(const t in e)O[t]={...O[t],...e[t]}}(e);const c=(0,i.forwardRef)((function(e,c){let d;const h={...(0,i.useContext)(s._),...e,layoutId:j(e)},{isStatic:p}=h,m=function(e){const{initial:t,animate:n}=function(e,t){if(A(e)){const{initial:t,animate:n}=e;return{initial:!1===t||S(t)?t:void 0,animate:S(n)?n:void 0}}return!1!==e.inherit?t:{}}(e,(0,i.useContext)(o));return(0,i.useMemo)((()=>({initial:t,animate:n})),[R(t),R(n)])}(e),f=a(e,p);if(!p&&D.j){(0,i.useContext)(u).strict;const e=function(e){const{drag:t,layout:n}=O;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==n?void 0:n.isEnabled(e))?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}(h);d=e.MeasureLayout,m.visualElement=w(l,f,h,t,e.ProjectionNode)}return(0,r.jsxs)(o.Provider,{value:m,children:[d&&m.visualElement?(0,r.jsx)(d,{visualElement:m.visualElement,...h}):null,n(l,e,x(f,m.visualElement,c),f,p,m.visualElement)]})}));return c[M]=l,c}function j({layoutId:e}){const t=(0,i.useContext)(L.p).id;return t&&void 0!==e?t+"-"+e:e}function N(e){function t(t,n={}){return F(e(t,n))}if("undefined"==typeof Proxy)return t;const n=new Map;return new Proxy(t,{get:(e,r)=>(n.has(r)||n.set(r,t(r)),n.get(r))})}const I=["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 _(e){return"string"==typeof e&&!e.includes("-")&&!!(I.indexOf(e)>-1||/[A-Z]/u.test(e))}const B={},U=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$=new Set(U);function z(e,{layout:t,layoutId:n}){return $.has(e)||e.startsWith("origin")||(t||void 0!==n)&&(!!B[e]||"opacity"===e)}const W=e=>Boolean(e&&e.getVelocity),H=(e,t)=>t&&"number"==typeof e?t.transform(e):e,Y=(e,t,n)=>n>t?t:n"number"==typeof e,parse:parseFloat,transform:e=>e},K={...q,transform:e=>Y(0,1,e)},Z={...q,default:1},G=e=>Math.round(1e5*e)/1e5,X=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,J=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,Q=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function ee(e){return"string"==typeof e}const te=e=>({test:t=>ee(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),ne=te("deg"),re=te("%"),ie=te("px"),se=te("vh"),oe=te("vw"),ae={...re,parse:e=>re.parse(e)/100,transform:e=>re.transform(100*e)},le={...q,transform:Math.round},ue={borderWidth:ie,borderTopWidth:ie,borderRightWidth:ie,borderBottomWidth:ie,borderLeftWidth:ie,borderRadius:ie,radius:ie,borderTopLeftRadius:ie,borderTopRightRadius:ie,borderBottomRightRadius:ie,borderBottomLeftRadius:ie,width:ie,maxWidth:ie,height:ie,maxHeight:ie,size:ie,top:ie,right:ie,bottom:ie,left:ie,padding:ie,paddingTop:ie,paddingRight:ie,paddingBottom:ie,paddingLeft:ie,margin:ie,marginTop:ie,marginRight:ie,marginBottom:ie,marginLeft:ie,rotate:ne,rotateX:ne,rotateY:ne,rotateZ:ne,scale:Z,scaleX:Z,scaleY:Z,scaleZ:Z,skew:ne,skewX:ne,skewY:ne,distance:ie,translateX:ie,translateY:ie,translateZ:ie,x:ie,y:ie,z:ie,perspective:ie,transformPerspective:ie,opacity:K,originX:ae,originY:ae,originZ:ie,zIndex:le,backgroundPositionX:ie,backgroundPositionY:ie,fillOpacity:K,strokeOpacity:K,numOctaves:le},ce={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},de=U.length,he=e=>t=>"string"==typeof t&&t.startsWith(e),pe=he("--"),me=he("var(--"),fe=e=>!!me(e)&&ve.test(e.split("/*")[0].trim()),ve=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function ge(e,t,n){const{style:r,vars:i,transformOrigin:s}=e;let o=!1,a=!1;for(const e in t){const n=t[e];if($.has(e))o=!0;else if(pe(e))i[e]=n;else{const t=H(n,ue[e]);e.startsWith("origin")?(a=!0,s[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=function(e,t,n){let r="",i=!0;for(let s=0;s({style:{},transform:{},transformOrigin:{},vars:{}});function we(e,t,n){for(const r in t)W(t[r])||z(r,n)||(e[r]=t[r])}function be(e,t){const n={},r=function(e,t){const n={};return we(n,e.style||{},e),Object.assign(n,function({transformTemplate:e},t){return(0,i.useMemo)((()=>{const n=ye();return ge(n,t,e),Object.assign({},n.vars,n.style)}),[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=!0===e.drag?"none":"pan-"+("x"===e.drag?"y":"x")),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}const Ee=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 xe(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Ee.has(e)}let Se=e=>!xe(e);try{(Te=require("@emotion/is-prop-valid").default)&&(Se=e=>e.startsWith("on")?!xe(e):Te(e))}catch(e){}var Te;function Pe(e,t,n){return"string"==typeof e?e:ie.transform(t+n*e)}const Ce={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ae={offset:"strokeDashoffset",array:"strokeDasharray"};function ke(e,{attrX:t,attrY:n,attrScale:r,originX:i,originY:s,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...u},c,d){if(ge(e,u,d),c)return void(e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox));e.attrs=e.style,e.style={};const{attrs:h,style:p,dimensions:m}=e;h.transform&&(m&&(p.transform=h.transform),delete h.transform),m&&(void 0!==i||void 0!==s||p.transform)&&(p.transformOrigin=function(e,t,n){return`${Pe(t,e.x,e.width)} ${Pe(n,e.y,e.height)}`}(m,void 0!==i?i:.5,void 0!==s?s:.5)),void 0!==t&&(h.x=t),void 0!==n&&(h.y=n),void 0!==r&&(h.scale=r),void 0!==o&&function(e,t,n=1,r=0,i=!0){e.pathLength=1;const s=i?Ce:Ae;e[s.offset]=ie.transform(-r);const o=ie.transform(t),a=ie.transform(n);e[s.array]=`${o} ${a}`}(h,o,a,l,!1)}const Re=()=>({...ye(),attrs:{}}),Ve=e=>"string"==typeof e&&"svg"===e.toLowerCase();function Oe(e,t,n,r){const s=(0,i.useMemo)((()=>{const n=Re();return ke(n,t,Ve(r),e.transformTemplate),{...n.attrs,style:{...n.style}}}),[t]);if(e.style){const t={};we(t,e.style,e),s.style={...t,...s.style}}return s}function De(e=!1){return(t,n,r,{latestValues:s},o)=>{const a=(_(t)?Oe:be)(n,s,o,t),l=function(e,t,n){const r={};for(const i in e)"values"===i&&"object"==typeof e.values||(Se(i)||!0===n&&xe(i)||!t&&!xe(i)||e.draggable&&i.startsWith("onDrag"))&&(r[i]=e[i]);return r}(n,"string"==typeof t,e),u=t!==i.Fragment?{...l,...a,ref:r}:{},{children:c}=n,d=(0,i.useMemo)((()=>W(c)?c.get():c),[c]);return(0,i.createElement)(t,{...u,children:d})}}function Le(e,{style:t,vars:n},r,i){Object.assign(e.style,t,i&&i.getProjectionStyles(r));for(const t in n)e.style.setProperty(t,n[t])}const Me=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 Fe(e,t,n,r){Le(e,t,void 0,r);for(const n in t.attrs)e.setAttribute(Me.has(n)?n:c(n),t.attrs[n])}function je(e,t,n){var r;const{style:i}=e,s={};for(const o in i)(W(i[o])||t.style&&W(t.style[o])||z(o,e)||void 0!==(null===(r=null==n?void 0:n.getValue(o))||void 0===r?void 0:r.liveStyle))&&(s[o]=i[o]);return n&&i&&"string"==typeof i.willChange&&(n.applyWillChange=!1),s}function Ne(e,t,n){const r=je(e,t,n);for(const n in e)(W(e[n])||W(t[n]))&&(r[-1!==U.indexOf(n)?"attr"+n.charAt(0).toUpperCase()+n.substring(1):n]=e[n]);return r}function Ie(e){const t=[{},{}];return null==e||e.values.forEach(((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()})),t}function _e(e,t,n,r){if("function"==typeof t){const[i,s]=Ie(r);t=t(void 0!==n?n:e.custom,i,s)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){const[i,s]=Ie(r);t=t(void 0!==n?n:e.custom,i,s)}return t}var Be=n(6681);const Ue=e=>Array.isArray(e),$e=e=>Boolean(e&&"object"==typeof e&&e.mix&&e.toValue),ze=e=>Ue(e)?e[e.length-1]||0:e;function We(e){const t=W(e)?e.get():e;return $e(t)?t.toValue():t}const He=new Set(["opacity","clipPath","filter","transform"]);function Ye(e){return $.has(e)?"transform":He.has(e)?c(e):void 0}function qe(e,t){-1===e.indexOf(t)&&e.push(t)}function Ke(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}const Ze=e=>(t,n)=>{const r=(0,i.useContext)(o),s=(0,i.useContext)(a.O),l=()=>function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:n,onMount:r},i,s,o,a){const l={latestValues:Je(i,s,o,!a&&e,t),renderState:n()};return r&&(l.mount=e=>r(i,e,l)),l}(e,t,r,s,n);return n?l():(0,Be.h)(l)};function Ge(e,t){const n=Ye(t);n&&qe(e,n)}function Xe(e,t,n){const r=Array.isArray(t)?t:[t];for(let t=0;t{for(const t in e){let n=e[t];Array.isArray(n)&&(n=n[m?n.length-1:0]),null!==n&&(o[t]=n)}for(const e in t)o[e]=t[e]})),l&&(d&&!1!==c&&!T(d)&&Xe(e,d,(e=>{for(const t in e)Ge(a,t)})),a.length&&(o.willChange=a.join(","))),o}var Qe=n(1662);const{schedule:et,cancel:tt,state:nt,steps:rt}=p("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Qe.Z,!0),it={useVisualState:Ze({scrapeMotionValuesFromProps:Ne,createRenderState:Re,onMount:(e,t,{renderState:n,latestValues:r})=>{et.read((()=>{try{n.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){n.dimensions={x:0,y:0,width:0,height:0}}})),et.render((()=>{ke(n,r,Ve(t.tagName),e.transformTemplate),Fe(t,n)}))}})},st={useVisualState:Ze({applyWillChange:!0,scrapeMotionValuesFromProps:je,createRenderState:ye})};function ot(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}const at=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function lt(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}const ut=e=>t=>at(t)&&e(t,lt(t));function ct(e,t,n,r){return ot(e,t,ut(n),r)}const dt=(e,t)=>n=>t(e(n)),ht=(...e)=>e.reduce(dt);function pt(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}const mt=pt("dragHorizontal"),ft=pt("dragVertical");function vt(e){let t=!1;if("y"===e)t=ft();else if("x"===e)t=mt();else{const e=mt(),n=ft();e&&n?t=()=>{e(),n()}:(e&&e(),n&&n())}return t}function gt(){const e=vt(!0);return!e||(e(),!1)}class yt{constructor(e){this.isMounted=!1,this.node=e}update(){}}function wt(e,t){const n=t?"pointerenter":"pointerleave",r=t?"onHoverStart":"onHoverEnd";return ct(e.current,n,((n,i)=>{if("touch"===n.pointerType||gt())return;const s=e.getProps();e.animationState&&s.whileHover&&e.animationState.setActive("whileHover",t);const o=s[r];o&&et.postRender((()=>o(n,i)))}),{passive:!e.getProps()[r]})}const bt=(e,t)=>!!t&&(e===t||bt(e,t.parentElement));function Et(e,t){if(!t)return;const n=new PointerEvent("pointer"+e);t(n,lt(n))}const xt=new WeakMap,St=new WeakMap,Tt=e=>{const t=xt.get(e.target);t&&t(e)},Pt=e=>{e.forEach(Tt)};const Ct={some:0,all:1},At={inView:{Feature:class extends yt{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r="some",once:i}=e,s={root:t?t.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Ct[r]};return function(e,t,n){const r=function({root:e,...t}){const n=e||document;St.has(n)||St.set(n,{});const r=St.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(Pt,{root:e,...t})),r[i]}(t);return xt.set(e,n),r.observe(e),()=>{xt.delete(e),r.unobserve(e)}}(this.node.current,s,(e=>{const{isIntersecting:t}=e;if(this.isInView===t)return;if(this.isInView=t,i&&!t&&this.hasEnteredView)return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),s=t?n:r;s&&s(e)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}(e,t))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends yt{constructor(){super(...arguments),this.removeStartListeners=Qe.Z,this.removeEndListeners=Qe.Z,this.removeAccessibleListeners=Qe.Z,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();const n=this.node.getProps(),r=ct(window,"pointerup",((e,t)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r,globalTapTarget:i}=this.node.getProps(),s=i||bt(this.node.current,e.target)?n:r;s&&et.update((()=>s(e,t)))}),{passive:!(n.onTap||n.onPointerUp)}),i=ct(window,"pointercancel",((e,t)=>this.cancelPress(e,t)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=ht(r,i),this.startPress(e,t)},this.startAccessiblePress=()=>{const e=ot(this.node.current,"keydown",(e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=ot(this.node.current,"keyup",(e=>{"Enter"===e.key&&this.checkPressEnd()&&Et("up",((e,t)=>{const{onTap:n}=this.node.getProps();n&&et.postRender((()=>n(e,t)))}))})),Et("down",((e,t)=>{this.startPress(e,t)})))})),t=ot(this.node.current,"blur",(()=>{this.isPressing&&Et("cancel",((e,t)=>this.cancelPress(e,t)))}));this.removeAccessibleListeners=ht(e,t)}}startPress(e,t){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&et.postRender((()=>n(e,t)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!gt()}cancelPress(e,t){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&et.postRender((()=>n(e,t)))}mount(){const e=this.node.getProps(),t=ct(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),n=ot(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=ht(t,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends yt{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){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=ht(ot(this.node.current,"focus",(()=>this.onFocus())),ot(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends yt{mount(){this.unmount=ht(wt(this.node,!0),wt(this.node,!1))}unmount(){}}}};function kt(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r1e3*e,Ot=e=>e/1e3,Dt={type:"spring",stiffness:500,damping:25,restSpeed:10},Lt={type:"keyframes",duration:.8},Mt={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ft=(e,{keyframes:t})=>t.length>2?Lt:$.has(e)?e.startsWith("scale")?{type:"spring",stiffness:550,damping:0===t[1]?2*Math.sqrt(550):30,restSpeed:10}:Dt:Mt;function jt(e,t){return e[t]||e.default||e}const Nt=e=>null!==e;function It(e,{repeat:t,repeatType:n="loop"},r){const i=e.filter(Nt),s=t&&"loop"!==n&&t%2==1?0:i.length-1;return s&&void 0!==r?r:i[s]}let _t;function Bt(){_t=void 0}const Ut={now:()=>(void 0===_t&&Ut.set(nt.isProcessing?nt.timestamp:performance.now()),_t),set:e=>{_t=e,queueMicrotask(Bt)}},$t=e=>/^0[^.\s]+$/u.test(e);var zt=n(5487);const Wt=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),Ht=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Yt(e,t,n=1){(0,zt.k)(n<=4,`Max CSS variable fallback depth detected in property "${e}". This may indicate a circular fallback dependency.`);const[r,i]=function(e){const t=Ht.exec(e);if(!t)return[,];const[,n,r,i]=t;return[`--${null!=n?n:r}`,i]}(e);if(!r)return;const s=window.getComputedStyle(t).getPropertyValue(r);if(s){const e=s.trim();return Wt(e)?parseFloat(e):e}return fe(i)?Yt(i,t,n+1):i}const qt=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),Kt=e=>e===q||e===ie,Zt=(e,t)=>parseFloat(e.split(", ")[t]),Gt=(e,t)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const i=r.match(/^matrix3d\((.+)\)$/u);if(i)return Zt(i[1],t);{const t=r.match(/^matrix\((.+)\)$/u);return t?Zt(t[1],e):0}},Xt=new Set(["x","y","z"]),Jt=U.filter((e=>!Xt.has(e))),Qt={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:Gt(4,13),y:Gt(5,14)};Qt.translateX=Qt.x,Qt.translateY=Qt.y;const en=e=>t=>t.test(e),tn=[q,ie,re,ne,oe,se,{test:e=>"auto"===e,parse:e=>e}],nn=e=>tn.find(en(e)),rn=new Set;let sn=!1,on=!1;function an(){if(on){const e=Array.from(rn).filter((e=>e.needsMeasurement)),t=new Set(e.map((e=>e.element))),n=new Map;t.forEach((e=>{const t=function(e){const t=[];return Jt.forEach((n=>{const r=e.getValue(n);void 0!==r&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),t}(e);t.length&&(n.set(e,t),e.render())})),e.forEach((e=>e.measureInitialState())),t.forEach((e=>{e.render();const t=n.get(e);t&&t.forEach((([t,n])=>{var r;null===(r=e.getValue(t))||void 0===r||r.set(n)}))})),e.forEach((e=>e.measureEndState())),e.forEach((e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)}))}on=!1,sn=!1,rn.forEach((e=>e.complete())),rn.clear()}function ln(){rn.forEach((e=>{e.readKeyframes(),e.needsMeasurement&&(on=!0)}))}class un{constructor(e,t,n,r,i,s=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=s}scheduleResolve(){this.isScheduled=!0,this.isAsync?(rn.add(this),sn||(sn=!0,et.read(ln),et.resolveKeyframes(an))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;for(let i=0;in=>Boolean(ee(n)&&Q.test(n)&&n.startsWith(e)||t&&!function(e){return null==e}(n)&&Object.prototype.hasOwnProperty.call(n,t)),dn=(e,t,n)=>r=>{if(!ee(r))return r;const[i,s,o,a]=r.match(X);return{[e]:parseFloat(i),[t]:parseFloat(s),[n]:parseFloat(o),alpha:void 0!==a?parseFloat(a):1}},hn={...q,transform:e=>Math.round((e=>Y(0,255,e))(e))},pn={test:cn("rgb","red"),parse:dn("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+hn.transform(e)+", "+hn.transform(t)+", "+hn.transform(n)+", "+G(K.transform(r))+")"},mn={test:cn("#"),parse:function(e){let t="",n="",r="",i="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}},transform:pn.transform},fn={test:cn("hsl","hue"),parse:dn("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+re.transform(G(t))+", "+re.transform(G(n))+", "+G(K.transform(r))+")"},vn={test:e=>pn.test(e)||mn.test(e)||fn.test(e),parse:e=>pn.test(e)?pn.parse(e):fn.test(e)?fn.parse(e):mn.parse(e),transform:e=>ee(e)?e:e.hasOwnProperty("red")?pn.transform(e):fn.transform(e)},gn="number",yn="color",wn="var",bn="var(",En="${}",xn=/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 Sn(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[];let s=0;const o=t.replace(xn,(e=>(vn.test(e)?(r.color.push(s),i.push(yn),n.push(vn.parse(e))):e.startsWith(bn)?(r.var.push(s),i.push(wn),n.push(e)):(r.number.push(s),i.push(gn),n.push(parseFloat(e))),++s,En))).split(En);return{values:n,split:o,indexes:r,types:i}}function Tn(e){return Sn(e).values}function Pn(e){const{split:t,types:n}=Sn(e),r=t.length;return e=>{let i="";for(let s=0;s"number"==typeof e?0:e,An={test:function(e){var t,n;return isNaN(e)&&ee(e)&&((null===(t=e.match(X))||void 0===t?void 0:t.length)||0)+((null===(n=e.match(J))||void 0===n?void 0:n.length)||0)>0},parse:Tn,createTransformer:Pn,getAnimatableNone:function(e){const t=Tn(e);return Pn(e)(t.map(Cn))}},kn=new Set(["brightness","contrast","saturate","opacity"]);function Rn(e){const[t,n]=e.slice(0,-1).split("(");if("drop-shadow"===t)return e;const[r]=n.match(X)||[];if(!r)return e;const i=n.replace(r,"");let s=kn.has(t)?1:0;return r!==n&&(s*=100),t+"("+s+i+")"}const Vn=/\b([a-z-]*)\(.*?\)/gu,On={...An,getAnimatableNone:e=>{const t=e.match(Vn);return t?t.map(Rn).join(" "):e}},Dn={...ue,color:vn,backgroundColor:vn,outlineColor:vn,fill:vn,stroke:vn,borderColor:vn,borderTopColor:vn,borderRightColor:vn,borderBottomColor:vn,borderLeftColor:vn,filter:On,WebkitFilter:On},Ln=e=>Dn[e];function Mn(e,t){let n=Ln(e);return n!==On&&(n=An),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const Fn=new Set(["auto","none","0"]);class jn extends un{constructor(e,t,n,r){super(e,t,n,r,null==r?void 0:r.owner,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:n}=this;if(!t.current)return;super.readKeyframes();for(let n=0;n{t.getValue(e).set(n)})),this.resolveNoneKeyframes()}}function Nn(e){let t;return()=>(void 0===t&&(t=e()),t)}const In=(e,t)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!An.test(e)&&"0"!==e||e.startsWith("url(")));class Bn{constructor({autoplay:e=!0,delay:t=0,type:n="keyframes",repeat:r=0,repeatDelay:i=0,repeatType:s="loop",...o}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:s,...o},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(ln(),an()),this._resolved}onKeyframesResolved(e,t){this.hasAttemptedResolve=!0;const{name:n,type:r,velocity:i,delay:s,onComplete:o,onUpdate:a,isGenerator:l}=this.options;if(!l&&!function(e,t,n,r){const i=e[0];if(null===i)return!1;if("display"===t||"visibility"===t)return!0;const s=e[e.length-1],o=In(i,t),a=In(s,t);return(0,zt.K)(o===a,`You are trying to animate ${t} from "${i}" to "${s}". ${i} is not an animatable value - to enable this animation set ${i} to a value animatable to ${s} via the \`style\` property.`),!(!o||!a)&&(function(e){const t=e[0];if(1===e.length)return!0;for(let n=0;n{this.resolveFinishedPromise=e}))}}function Un(e,t){return t?e*(1e3/t):0}const $n=5;function zn(e,t,n){const r=Math.max(t-$n,0);return Un(n-e(r),t-r)}const Wn=.001,Hn=.01,Yn=10,qn=.05,Kn=1;const Zn=12;function Gn(e,t){return e*Math.sqrt(1-t*t)}const Xn=["duration","bounce"],Jn=["stiffness","damping","mass"];function Qn(e,t){return t.some((t=>void 0!==e[t]))}function er({keyframes:e,restDelta:t,restSpeed:n,...r}){const i=e[0],s=e[e.length-1],o={done:!1,value:i},{stiffness:a,damping:l,mass:u,duration:c,velocity:d,isResolvedFromDuration:h}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!Qn(e,Jn)&&Qn(e,Xn)){const n=function({duration:e=800,bounce:t=.25,velocity:n=0,mass:r=1}){let i,s;(0,zt.K)(e<=Vt(Yn),"Spring duration must be 10 seconds or less");let o=1-t;o=Y(qn,Kn,o),e=Y(Hn,Yn,Ot(e)),o<1?(i=t=>{const r=t*o,i=r*e,s=r-n,a=Gn(t,o),l=Math.exp(-i);return Wn-s/a*l},s=t=>{const r=t*o*e,s=r*n+n,a=Math.pow(o,2)*Math.pow(t,2)*e,l=Math.exp(-r),u=Gn(Math.pow(t,2),o);return(-i(t)+Wn>0?-1:1)*((s-a)*l)/u}):(i=t=>Math.exp(-t*e)*((t-n)*e+1)-Wn,s=t=>Math.exp(-t*e)*(e*e*(n-t)));const a=function(e,t,n){let r=n;for(let n=1;n{const n=Math.exp(-m*v*t);return s-n*((p+m*v*f)/e*Math.sin(e*t)+f*Math.cos(e*t))}}else if(1===m)y=e=>s-Math.exp(-v*e)*(f+(p+v*f)*e);else{const e=v*Math.sqrt(m*m-1);y=t=>{const n=Math.exp(-m*v*t),r=Math.min(e*t,300);return s-n*((p+m*v*f)*Math.sinh(r)+e*f*Math.cosh(r))/e}}return{calculatedDuration:h&&c||null,next:e=>{const r=y(e);if(h)o.done=e>=c;else{let i=p;0!==e&&(i=m<1?zn(y,e,r):0);const a=Math.abs(i)<=n,l=Math.abs(s-r)<=t;o.done=a&&l}return o.value=o.done?s:r,o}}}function tr({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:s=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=e[0],h={done:!1,value:d},p=e=>void 0===a?l:void 0===l||Math.abs(a-e)-m*Math.exp(-e/r),y=e=>v+g(e),w=e=>{const t=g(e),n=y(e);h.done=Math.abs(t)<=u,h.value=h.done?v:n};let b,E;const x=e=>{var t;t=h.value,(void 0!==a&&tl)&&(b=e,E=er({keyframes:[h.value,p(h.value)],velocity:zn(y,e,h.value),damping:i,stiffness:s,restDelta:u,restSpeed:c}))};return x(0),{calculatedDuration:null,next:e=>{let t=!1;return E||void 0!==b||(t=!0,w(e),x(e)),void 0!==b&&e>=b?E.next(e-b):(!t&&w(e),h)}}}const nr=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e;function rr(e,t,n,r){if(e===t&&n===r)return Qe.Z;return i=>0===i||1===i?i:nr(function(e,t,n,r,i){let s,o,a=0;do{o=t+(n-t)/2,s=nr(o,r,i)-e,s>0?n=o:t=o}while(Math.abs(s)>1e-7&&++a<12);return o}(i,0,1,e,n),t,r)}const ir=rr(.42,0,1,1),sr=rr(0,0,.58,1),or=rr(.42,0,.58,1),ar=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,lr=e=>t=>1-e(1-t),ur=e=>1-Math.sin(Math.acos(e)),cr=lr(ur),dr=ar(ur),hr=rr(.33,1.53,.69,.99),pr=lr(hr),mr=ar(pr),fr={linear:Qe.Z,easeIn:ir,easeInOut:or,easeOut:sr,circIn:ur,circInOut:dr,circOut:cr,backIn:pr,backInOut:mr,backOut:hr,anticipate:e=>(e*=2)<1?.5*pr(e):.5*(2-Math.pow(2,-10*(e-1)))},vr=e=>{if(Array.isArray(e)){(0,zt.k)(4===e.length,"Cubic bezier arrays must contain four numerical values.");const[t,n,r,i]=e;return rr(t,n,r,i)}return"string"==typeof e?((0,zt.k)(void 0!==fr[e],`Invalid easing type '${e}'`),fr[e]):e},gr=(e,t,n)=>{const r=t-e;return 0===r?1:(n-e)/r},yr=(e,t,n)=>e+(t-e)*n;function wr(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function br(e,t){return n=>n>0?t:e}const Er=(e,t,n)=>{const r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},xr=[mn,pn,fn];function Sr(e){const t=(n=e,xr.find((e=>e.test(n))));var n;if((0,zt.K)(Boolean(t),`'${e}' is not an animatable color. Use the equivalent color code instead.`),!Boolean(t))return!1;let r=t.parse(e);return t===fn&&(r=function({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,n/=100;let i=0,s=0,o=0;if(t/=100){const r=n<.5?n*(1+t):n+t-n*t,a=2*n-r;i=wr(a,r,e+1/3),s=wr(a,r,e),o=wr(a,r,e-1/3)}else i=s=o=n;return{red:Math.round(255*i),green:Math.round(255*s),blue:Math.round(255*o),alpha:r}}(r)),r}const Tr=(e,t)=>{const n=Sr(e),r=Sr(t);if(!n||!r)return br(e,t);const i={...n};return e=>(i.red=Er(n.red,r.red,e),i.green=Er(n.green,r.green,e),i.blue=Er(n.blue,r.blue,e),i.alpha=yr(n.alpha,r.alpha,e),pn.transform(i))},Pr=new Set(["none","hidden"]);function Cr(e,t){return n=>yr(e,t,n)}function Ar(e){return"number"==typeof e?Cr:"string"==typeof e?fe(e)?br:vn.test(e)?Tr:Vr:Array.isArray(e)?kr:"object"==typeof e?vn.test(e)?Tr:Rr:br}function kr(e,t){const n=[...e],r=n.length,i=e.map(((e,n)=>Ar(e)(e,t[n])));return e=>{for(let t=0;t{for(const t in r)n[t]=r[t](e);return n}}const Vr=(e,t)=>{const n=An.createTransformer(t),r=Sn(e),i=Sn(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Pr.has(e)&&!i.values.length||Pr.has(t)&&!r.values.length?function(e,t){return Pr.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}(e,t):ht(kr(function(e,t){var n;const r=[],i={color:0,var:0,number:0};for(let s=0;sArray.isArray(e)&&"number"!=typeof e[0])(r)?r.map(vr):vr(r),s={done:!1,value:t[0]},o=function(e,t){return e.map((e=>e*t))}(n&&n.length===t.length?n:function(e){const t=[0];return function(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const i=gr(0,t,r);e.push(yr(n,1,i))}}(t,e.length-1),t}(t),e),a=function(e,t,{clamp:n=!0,ease:r,mixer:i}={}){const s=e.length;if((0,zt.k)(s===t.length,"Both input and output ranges must be the same length"),1===s)return()=>t[0];if(2===s&&e[0]===e[1])return()=>t[1];e[0]>e[s-1]&&(e=[...e].reverse(),t=[...t].reverse());const o=function(e,t,n){const r=[],i=n||Or,s=e.length-1;for(let n=0;n{let n=0;if(a>1)for(;nl(Y(e[0],e[s-1],t)):l}(o,t,{ease:Array.isArray(i)?i:(l=t,u=i,l.map((()=>u||or)).splice(0,l.length-1))});var l,u;return{calculatedDuration:e,next:t=>(s.value=a(t),s.done=t>=e,s)}}const Lr=e=>{const t=({timestamp:t})=>e(t);return{start:()=>et.update(t,!0),stop:()=>tt(t),now:()=>nt.isProcessing?nt.timestamp:Ut.now()}},Mr={decay:tr,inertia:tr,tween:Dr,keyframes:Dr,spring:er},Fr=e=>e/100;class jr extends Bn{constructor({KeyframeResolver:e=un,...t}){super(t),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();const{onStop:e}=this.options;e&&e()};const{name:n,motionValue:r,keyframes:i}=this.options,s=(e,t)=>this.onKeyframesResolved(e,t);n&&r&&r.owner?this.resolver=r.owner.resolveKeyframes(i,s,n,r):this.resolver=new e(i,s,n,r),this.resolver.scheduleResolve()}initPlayback(e){const{type:t="keyframes",repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:s=0}=this.options,o=Mr[t]||Dr;let a,l;o!==Dr&&"number"!=typeof e[0]&&(a=ht(Fr,Or(e[0],e[1])),e=[0,100]);const u=o({...this.options,keyframes:e});"mirror"===i&&(l=o({...this.options,keyframes:[...e].reverse(),velocity:-s})),null===u.calculatedDuration&&(u.calculatedDuration=function(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}(u));const{calculatedDuration:c}=u,d=c+r;return{generator:u,mirroredGenerator:l,mapPercentToKeyframes:a,calculatedDuration:c,resolvedDuration:d,totalDuration:d*(n+1)-r}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){const{resolved:n}=this;if(!n){const{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}const{finalKeyframe:r,generator:i,mirroredGenerator:s,mapPercentToKeyframes:o,keyframes:a,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=n;if(null===this.startTime)return i.next(0);const{delay:d,repeat:h,repeatType:p,repeatDelay:m,onUpdate:f}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const v=this.currentTime-d*(this.speed>=0?1:-1),g=this.speed>=0?v<0:v>u;this.currentTime=Math.max(v,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let y=this.currentTime,w=i;if(h){const e=Math.min(this.currentTime,u)/c;let t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),1===n&&t--,t=Math.min(t,h+1),Boolean(t%2)&&("reverse"===p?(n=1-n,m&&(n-=m/c)):"mirror"===p&&(w=s)),y=Y(0,1,n)*c}const b=g?{done:!1,value:a[0]}:w.next(y);o&&(b.value=o(b.value));let{done:E}=b;g||null===l||(E=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const x=null===this.holdTime&&("finished"===this.state||"running"===this.state&&E);return x&&void 0!==r&&(b.value=It(a,this.options,r)),f&&f(b.value),x&&this.finish(),b}get duration(){const{resolved:e}=this;return e?Ot(e.calculatedDuration):0}get time(){return Ot(this.currentTime)}set time(e){e=Vt(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Ot(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved)return void(this.pendingPlayState="running");if(this.isStopped)return;const{driver:e=Lr,onPlay:t}=this.options;this.driver||(this.driver=e((e=>this.tick(e)))),t&&t();const n=this.driver.now();null!==this.holdTime?this.startTime=n-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=n),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;this._resolved?(this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0):this.pendingPlayState="paused"}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&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)}}const Nr=e=>Array.isArray(e)&&"number"==typeof e[0];function Ir(e){return Boolean(!e||"string"==typeof e&&e in Br||Nr(e)||Array.isArray(e)&&e.every(Ir))}const _r=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Br={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_r([0,.65,.55,1]),circOut:_r([.55,0,1,.45]),backIn:_r([.31,.01,.66,-.59]),backOut:_r([.33,1.53,.69,.99])};function Ur(e){return $r(e)||Br.easeOut}function $r(e){return e?Nr(e)?_r(e):Array.isArray(e)?e.map(Ur):Br[e]:void 0}const zr=Nn((()=>Object.hasOwnProperty.call(Element.prototype,"animate")));class Wr extends Bn{constructor(e){super(e);const{name:t,motionValue:n,keyframes:r}=this.options;this.resolver=new jn(r,((e,t)=>this.onKeyframesResolved(e,t)),t,n),this.resolver.scheduleResolve()}initPlayback(e,t){var n;let{duration:r=300,times:i,ease:s,type:o,motionValue:a,name:l}=this.options;if(!(null===(n=a.owner)||void 0===n?void 0:n.current))return!1;if("spring"===(u=this.options).type||!Ir(u.ease)){const{onComplete:t,onUpdate:n,motionValue:a,...l}=this.options,u=function(e,t){const n=new jr({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const i=[];let s=0;for(;!r.done&&s<2e4;)r=n.sample(s),i.push(r.value),s+=10;return{times:void 0,keyframes:i,duration:s-10,ease:"linear"}}(e,l);1===(e=u.keyframes).length&&(e[1]=e[0]),r=u.duration,i=u.times,s=u.ease,o="keyframes"}var u;const c=function(e,t,n,{delay:r=0,duration:i=300,repeat:s=0,repeatType:o="loop",ease:a,times:l}={}){const u={[t]:n};l&&(u.offset=l);const c=$r(a);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:r,duration:i,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:s+1,direction:"reverse"===o?"alternate":"normal"})}(a.owner.current,l,e,{...this.options,duration:r,times:i,ease:s});return c.startTime=Ut.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{const{onComplete:n}=this.options;a.set(It(e,this.options,t)),n&&n(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:r,times:i,type:o,ease:s,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Ot(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Ot(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.currentTime=Vt(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}attachTimeline(e){if(this._resolved){const{resolved:t}=this;if(!t)return Qe.Z;const{animation:n}=t;n.timeline=e,n.onfinish=null}else this.pendingTimeline=e;return Qe.Z}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:n,duration:r,type:i,ease:s,times:o}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){const{motionValue:e,onUpdate:t,onComplete:a,...l}=this.options,u=new jr({...l,keyframes:n,duration:r,type:i,ease:s,times:o,isGenerator:!0}),c=Vt(this.time);e.setWithVelocity(u.sample(c-10).value,u.sample(c).value,10)}const{onStop:a}=this.options;a&&a(),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:t,name:n,repeatDelay:r,repeatType:i,damping:s,type:o}=e;return zr()&&n&&He.has(n)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!r&&"mirror"!==i&&0!==s&&"inertia"!==o}}const Hr=Nn((()=>void 0!==window.ScrollTimeline));class Yr{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let n=0;n{if(!Hr()||!t.attachTimeline)return t.pause(),function(e,n){let r;const i=()=>{const{currentTime:e}=n,i=(null===e?0:e.value)/100;r!==i&&(e=>{t.time=t.duration*e})(i),r=i};return et.update(i,!0),()=>tt(i)}(0,e);t.attachTimeline(e)}));return()=>{t.forEach(((e,t)=>{e&&e(),this.animations[t].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 duration(){let e=0;for(let t=0;tt[e]()))}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}const qr=(e,t,n,r={},i,s,o)=>a=>{const l=jt(r,e)||{},u=l.delay||r.delay||0;let{elapsed:c=0}=r;c-=Vt(u);let d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{a(),l.onComplete&&l.onComplete(),o&&o()},onStop:o,name:e,motionValue:t,element:s?void 0:i};(function({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:i,repeat:s,repeatType:o,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length})(l)||(d={...d,...Ft(e,d)}),d.duration&&(d.duration=Vt(d.duration)),d.repeatDelay&&(d.repeatDelay=Vt(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let h=!1;if((!1===d.type||0===d.duration&&!d.repeatDelay)&&(d.duration=0,0===d.delay&&(h=!0)),h&&!s&&void 0!==t.get()){const e=It(d.keyframes,l);if(void 0!==e)return et.update((()=>{d.onUpdate(e),d.onComplete()})),new Yr([])}return!s&&Wr.supports(d)?new Wr(d):new jr(d)};class Kr{constructor(){this.subscriptions=[]}add(e){return qe(this.subscriptions,e),()=>Ke(this.subscriptions,e)}notify(e,t,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](e,t,n);else for(let i=0;i{const n=Ut.now();this.updatedAt!==n&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){var t;this.current=e,this.updatedAt=Ut.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=(t=this.current,!isNaN(parseFloat(t))))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new Kr);const n=this.events[e].add(t);return"change"===e?()=>{n(),et.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Zr.current&&Zr.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=Ut.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return Un(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise((t=>{this.hasAnimated=!0,this.animation=e(t),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 Xr(e,t){return new Gr(e,t)}function Jr(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Xr(n))}function Qr(e){return e.getProps()[d]}class ei extends Gr{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){const t=Ye(e);if(!t)return;const n=this.counts.get(t)||0;this.counts.set(t,n+1),0===n&&(this.output.push(t),this.update());let r=!1;return()=>{if(r)return;r=!0;const e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&(Ke(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function ti(e,t){var n;if(!e.applyWillChange)return;let r=e.getValue("willChange");return r||(null===(n=e.props.style)||void 0===n?void 0:n.willChange)||(r=new ei("auto"),e.addValue("willChange",r)),i=r,Boolean(W(i)&&i.add)?r.add(t):void 0;var i}function ni({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&!0!==t[n];return t[n]=!1,r}function ri(e,t,{delay:n=0,transitionOverride:r,type:i}={}){var s;let{transition:o=e.getDefaultTransition(),transitionEnd:a,...l}=t;r&&(o=r);const u=[],c=i&&e.animationState&&e.animationState.getState()[i];for(const t in l){const r=e.getValue(t,null!==(s=e.latestValues[t])&&void 0!==s?s:null),i=l[t];if(void 0===i||c&&ni(c,t))continue;const a={delay:n,elapsed:0,...jt(o||{},t)};let d=!1;if(window.HandoffAppearAnimations){const n=Qr(e);if(n){const e=window.HandoffAppearAnimations(n,t,r,et);null!==e&&(a.elapsed=e,d=!0)}}r.start(qr(t,r,i,e.shouldReduceMotion&&$.has(t)?{type:!1}:a,e,d,ti(e,t)));const h=r.animation;h&&u.push(h)}return a&&Promise.all(u).then((()=>{et.update((()=>{a&&function(e,t){const n=Rt(e,t);let{transitionEnd:r={},transition:i={},...s}=n||{};s={...s,...r};for(const t in s)Jr(e,t,ze(s[t]))}(e,a)}))})),u}function ii(e,t,n={}){var r;const i=Rt(e,t,"exit"===n.type?null===(r=e.presenceContext)||void 0===r?void 0:r.custom:void 0);let{transition:s=e.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(s=n.transitionOverride);const o=i?()=>Promise.all(ri(e,i,n)):()=>Promise.resolve(),a=e.variantChildren&&e.variantChildren.size?(r=0)=>{const{delayChildren:i=0,staggerChildren:o,staggerDirection:a}=s;return function(e,t,n=0,r=0,i=1,s){const o=[],a=(e.variantChildren.size-1)*r,l=1===i?(e=0)=>e*r:(e=0)=>a-e*r;return Array.from(e.variantChildren).sort(si).forEach(((e,r)=>{e.notify("AnimationStart",t),o.push(ii(e,t,{...s,delay:n+l(r)}).then((()=>e.notify("AnimationComplete",t))))})),Promise.all(o)}(e,t,i+r,o,a,n)}:()=>Promise.resolve(),{when:l}=s;if(l){const[e,t]="beforeChildren"===l?[o,a]:[a,o];return e().then((()=>t()))}return Promise.all([o(),a(n.delay)])}function si(e,t){return e.sortNodePosition(t)}const oi=[...P].reverse(),ai=P.length;function li(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function ui(){return{animate:li(!0),whileInView:li(),whileHover:li(),whileTap:li(),whileDrag:li(),whileFocus:li(),exit:li()}}let ci=0;const di={animation:{Feature:class extends yt{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=function(e){return t=>Promise.all(t.map((({animation:t,options:n})=>function(e,t,n={}){let r;if(e.notify("AnimationStart",t),Array.isArray(t)){const i=t.map((t=>ii(e,t,n)));r=Promise.all(i)}else if("string"==typeof t)r=ii(e,t,n);else{const i="function"==typeof t?Rt(e,t,n.custom):t;r=Promise.all(ri(e,i,n))}return r.then((()=>{e.notify("AnimationComplete",t)}))}(e,t,n))))}(e),n=ui(),r=!0;const i=t=>(n,r)=>{var i;const s=Rt(e,r,"exit"===t?null===(i=e.presenceContext)||void 0===i?void 0:i.custom:void 0);if(s){const{transition:e,transitionEnd:t,...r}=s;n={...n,...r,...t}}return n};function s(s){const o=e.getProps(),a=e.getVariantContext(!0)||{},l=[],u=new Set;let c={},d=1/0;for(let t=0;td&&g),E=!1;const x=Array.isArray(v)?v:[v];let P=x.reduce(i(m),{});!1===y&&(P={});const{prevResolvedValues:C={}}=f,A={...C,...P},k=t=>{b=!0,u.has(t)&&(E=!0,u.delete(t)),f.needsAnimating[t]=!0;const n=e.getValue(t);n&&(n.liveStyle=!1)};for(const e in A){const t=P[e],n=C[e];if(c.hasOwnProperty(e))continue;let r=!1;r=Ue(t)&&Ue(n)?!kt(t,n):t!==n,r?null!=t?k(e):u.add(e):void 0!==t&&u.has(e)?k(e):f.protectedKeys[e]=!0}f.prevProp=v,f.prevResolvedValues=P,f.isActive&&(c={...c,...P}),r&&e.blockInitialAnimation&&(b=!1),!b||w&&!E||l.push(...x.map((e=>({animation:e,options:{type:m}}))))}var h,p;if(u.size){const t={};u.forEach((n=>{const r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=null!=r?r:null})),l.push({animation:t})}let m=Boolean(l.length);return!r||!1!==o.initial&&o.initial!==o.animate||e.manuallyAnimateOnMount||(m=!1),r=!1,m?t(l):Promise.resolve()}return{animateChanges:s,setActive:function(t,r){var i;if(n[t].isActive===r)return Promise.resolve();null===(i=e.variantChildren)||void 0===i||i.forEach((e=>{var n;return null===(n=e.animationState)||void 0===n?void 0:n.setActive(t,r)})),n[t].isActive=r;const o=s(t);for(const e in n)n[e].protectedKeys={};return o},setAnimateFunction:function(n){t=n(e)},getState:()=>n,reset:()=>{n=ui(),r=!0}}}(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();T(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}},exit:{Feature:class extends yt{constructor(){super(...arguments),this.id=ci++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then((()=>t(this.id)))}mount(){const{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}}},hi=(e,t)=>Math.abs(e-t);class pi{constructor(e,t,{transformPagePoint:n,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 e=vi(this.lastMoveEventInfo,this.history),t=null!==this.startEvent,n=function(e,t){const n=hi(e.x,t.x),r=hi(e.y,t.y);return Math.sqrt(n**2+r**2)}(e.offset,{x:0,y:0})>=3;if(!t&&!n)return;const{point:r}=e,{timestamp:i}=nt;this.history.push({...r,timestamp:i});const{onStart:s,onMove:o}=this.handlers;t||(s&&s(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=mi(t,this.transformPagePoint),et.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();const{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if(this.dragSnapToOrigin&&i&&i(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const s=vi("pointercancel"===e.type?this.lastMoveEventInfo:mi(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,s),r&&r(e,s)},!at(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.contextWindow=r||window;const s=mi(lt(e),this.transformPagePoint),{point:o}=s,{timestamp:a}=nt;this.history=[{...o,timestamp:a}];const{onSessionStart:l}=t;l&&l(e,vi(s,this.history)),this.removeListeners=ht(ct(this.contextWindow,"pointermove",this.handlePointerMove),ct(this.contextWindow,"pointerup",this.handlePointerUp),ct(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),tt(this.updatePoint)}}function mi(e,t){return t?{point:t(e.point)}:e}function fi(e,t){return{x:e.x-t.x,y:e.y-t.y}}function vi({point:e},t){return{point:e,delta:fi(e,yi(t)),offset:fi(e,gi(t)),velocity:wi(t,.1)}}function gi(e){return e[0]}function yi(e){return e[e.length-1]}function wi(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const i=yi(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>Vt(t)));)n--;if(!r)return{x:0,y:0};const s=Ot(i.timestamp-r.timestamp);if(0===s)return{x:0,y:0};const o={x:(i.x-r.x)/s,y:(i.y-r.y)/s};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}const bi=.9999,Ei=1.0001,xi=-.01,Si=.01;function Ti(e){return e.max-e.min}function Pi(e,t,n,r=.5){e.origin=r,e.originPoint=yr(t.min,t.max,e.origin),e.scale=Ti(n)/Ti(t),e.translate=yr(n.min,n.max,e.origin)-e.originPoint,(e.scale>=bi&&e.scale<=Ei||isNaN(e.scale))&&(e.scale=1),(e.translate>=xi&&e.translate<=Si||isNaN(e.translate))&&(e.translate=0)}function Ci(e,t,n,r){Pi(e.x,t.x,n.x,r?r.originX:void 0),Pi(e.y,t.y,n.y,r?r.originY:void 0)}function Ai(e,t,n){e.min=n.min+t.min,e.max=e.min+Ti(t)}function ki(e,t,n){e.min=t.min-n.min,e.max=e.min+Ti(t)}function Ri(e,t,n){ki(e.x,t.x,n.x),ki(e.y,t.y,n.y)}function Vi(e,t,n){return{min:void 0!==t?e.min+t:void 0,max:void 0!==n?e.max+n-(e.max-e.min):void 0}}function Oi(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),ji=()=>({x:{min:0,max:0},y:{min:0,max:0}});function Ni(e){return[e("x"),e("y")]}function Ii({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function _i(e){return void 0===e||1===e}function Bi({scale:e,scaleX:t,scaleY:n}){return!_i(e)||!_i(t)||!_i(n)}function Ui(e){return Bi(e)||$i(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function $i(e){return zi(e.x)||zi(e.y)}function zi(e){return e&&"0%"!==e}function Wi(e,t,n){return n+t*(e-n)}function Hi(e,t,n,r,i){return void 0!==i&&(e=Wi(e,i,r)),Wi(e,n,r)+t}function Yi(e,t=0,n=1,r,i){e.min=Hi(e.min,t,n,r,i),e.max=Hi(e.max,t,n,r,i)}function qi(e,{x:t,y:n}){Yi(e.x,t.translate,t.scale,t.originPoint),Yi(e.y,n.translate,n.scale,n.originPoint)}const Ki=.999999999999,Zi=1.0000000000001;function Gi(e,t){e.min=e.min+t,e.max=e.max+t}function Xi(e,t,n,r,i=.5){Yi(e,t,n,yr(e.min,e.max,i),r)}function Ji(e,t){Xi(e.x,t.x,t.scaleX,t.scale,t.originX),Xi(e.y,t.y,t.scaleY,t.scale,t.originY)}function Qi(e,t){return Ii(function(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(e.getBoundingClientRect(),t))}const es=({current:e})=>e?e.ownerDocument.defaultView:null,ts=new WeakMap;class ns{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=ji(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:n}=this.visualElement;if(n&&!1===n.isPresent)return;const{dragSnapToOrigin:r}=this.getProps();this.panSession=new pi(e,{onSessionStart:e=>{const{dragSnapToOrigin:n}=this.getProps();n?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(lt(e,"page").point)},onStart:(e,t)=>{var n;const{drag:r,dragPropagation:i,onDragStart:s}=this.getProps();if(r&&!i&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=vt(r),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Ni((e=>{let t=this.getAxisMotionValue(e).get()||0;if(re.test(t)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[e];r&&(t=Ti(r)*(parseFloat(t)/100))}}this.originPoint[e]=t})),s&&et.postRender((()=>s(e,t))),null===(n=this.removeWillChange)||void 0===n||n.call(this),this.removeWillChange=ti(this.visualElement,"transform");const{animationState:o}=this.visualElement;o&&o.setActive("whileDrag",!0)},onMove:(e,t)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:s}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:o}=t;if(r&&null===this.currentDirection)return this.currentDirection=function(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}(o),void(null!==this.currentDirection&&i&&i(this.currentDirection));this.updateAxis("x",t.point,o),this.updateAxis("y",t.point,o),this.visualElement.render(),s&&s(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>Ni((e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())}))},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:r,contextWindow:es(this.visualElement)})}stop(e,t){var n;null===(n=this.removeWillChange)||void 0===n||n.call(this);const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:i}=t;this.startAnimation(i);const{onDragEnd:s}=this.getProps();s&&et.postRender((()=>s(e,t)))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,n){const{drag:r}=this.getProps();if(!n||!rs(e,r,this.currentDirection))return;const i=this.getAxisMotionValue(e);let s=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(s=function(e,{min:t,max:n},r){return void 0!==t&&en&&(e=r?yr(n,e,r.max):Math.min(e,n)),e}(s,this.constraints[e],this.elastic[e])),i.set(s)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,i=this.constraints;t&&v(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!r)&&function(e,{top:t,left:n,bottom:r,right:i}){return{x:Vi(e.x,n,i),y:Vi(e.y,t,r)}}(r.layoutBox,t),this.elastic=function(e=Di){return!1===e?e=0:!0===e&&(e=Di),{x:Li(e,"left","right"),y:Li(e,"top","bottom")}}(n),i!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Ni((e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){const n={};return void 0!==t.min&&(n.min=t.min-e.min),void 0!==t.max&&(n.max=t.max-e.min),n}(r.layoutBox[e],this.constraints[e]))}))}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!v(e))return!1;const n=e.current;(0,zt.k)(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");const{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const i=function(e,t,n){const r=Qi(e,n),{scroll:i}=t;return i&&(Gi(r.x,i.offset.x),Gi(r.y,i.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let s=function(e,t){return{x:Oi(e.x,t.x),y:Oi(e.y,t.y)}}(r.layout.layoutBox,i);if(t){const e=t(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(s));this.hasMutatedConstraints=!!e,e&&(s=Ii(e))}return s}startAnimation(e){const{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:s,onDragTransitionEnd:o}=this.getProps(),a=this.constraints||{},l=Ni((o=>{if(!rs(o,t,this.currentDirection))return;let l=a&&a[o]||{};s&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?e[o]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...i,...l};return this.startAxisValueAnimation(o,d)}));return Promise.all(l).then(o)}startAxisValueAnimation(e,t){const n=this.getAxisMotionValue(e);return n.start(qr(e,n,0,t,this.visualElement,!1,ti(this.visualElement,e)))}stopAnimation(){Ni((e=>this.getAxisMotionValue(e).stop()))}pauseAnimation(){Ni((e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()}))}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,n=this.visualElement.getProps();return n[t]||this.visualElement.getValue(e,(n.initial?n.initial[e]:void 0)||0)}snapToCursor(e){Ni((t=>{const{drag:n}=this.getProps();if(!rs(t,n,this.currentDirection))return;const{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){const{min:n,max:s}=r.layout.layoutBox[t];i.set(e[t]-yr(n,s,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!v(t)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};Ni((e=>{const t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){const n=t.get();r[e]=function(e,t){let n=.5;const r=Ti(e),i=Ti(t);return i>r?n=gr(t.min,t.max-r,e.min):r>i&&(n=gr(e.min,e.max-i,t.min)),Y(0,1,n)}({min:n,max:n},this.constraints[e])}}));const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),Ni((t=>{if(!rs(t,e,null))return;const n=this.getAxisMotionValue(t),{min:i,max:s}=this.constraints[t];n.set(yr(i,s,r[t]))}))}addListeners(){if(!this.visualElement.current)return;ts.set(this.visualElement,this);const e=ct(this.visualElement.current,"pointerdown",(e=>{const{drag:t,dragListener:n=!0}=this.getProps();t&&n&&this.start(e)})),t=()=>{const{dragConstraints:e}=this.getProps();v(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",t);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),et.read(t);const i=ot(window,"resize",(()=>this.scalePositionWithinConstraints())),s=n.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(Ni((t=>{const n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))})),this.visualElement.render())}));return()=>{i(),e(),r(),s&&s()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:s=Di,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:s,dragMomentum:o}}}function rs(e,t,n){return!(!0!==t&&t!==e||null!==n&&n!==e)}const is=e=>(t,n)=>{e&&et.postRender((()=>e(t,n)))},ss={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function os(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const as={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!ie.test(e))return e;e=parseFloat(e)}return`${os(e,t.target.x)}% ${os(e,t.target.y)}%`}},ls={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,i=An.parse(e);if(i.length>5)return r;const s=An.createTransformer(e),o="number"!=typeof i[0]?1:0,a=n.x.scale*t.x,l=n.y.scale*t.y;i[0+o]/=a,i[1+o]/=l;const u=yr(a,l,.5);return"number"==typeof i[2+o]&&(i[2+o]/=u),"number"==typeof i[3+o]&&(i[3+o]/=u),s(i)}};class us extends i.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;var s;s=ds,Object.assign(B,s),i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),i.root.didUpdate(),i.addEventListener("animationComplete",(()=>{this.safeToRemove()})),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),ss.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,s=n.projection;return s?(s.isPresent=i,r||e.layoutDependency!==t||void 0===t?s.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?s.promote():s.relegate()||et.postRender((()=>{const e=s.getStack();e&&e.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),m.postRender((()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function cs(e){const[t,n]=function(){const e=(0,i.useContext)(a.O);if(null===e)return[!0,null];const{isPresent:t,onExitComplete:n,register:r}=e,s=(0,i.useId)();(0,i.useEffect)((()=>r(s)),[]);const o=(0,i.useCallback)((()=>n&&n(s)),[s,n]);return!t&&n?[!1,o]:[!0]}(),s=(0,i.useContext)(L.p);return(0,r.jsx)(us,{...e,layoutGroup:s,switchLayoutGroup:(0,i.useContext)(g),isPresent:t,safeToRemove:n})}const ds={borderRadius:{...as,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:as,borderTopRightRadius:as,borderBottomLeftRadius:as,borderBottomRightRadius:as,boxShadow:ls},hs=["TopLeft","TopRight","BottomLeft","BottomRight"],ps=hs.length,ms=e=>"string"==typeof e?parseFloat(e):e,fs=e=>"number"==typeof e||ie.test(e);function vs(e,t){return void 0!==e[t]?e[t]:e.borderRadius}const gs=ws(0,.5,cr),ys=ws(.5,.95,Qe.Z);function ws(e,t,n){return r=>rt?1:n(gr(e,t,r))}function bs(e,t){e.min=t.min,e.max=t.max}function Es(e,t){bs(e.x,t.x),bs(e.y,t.y)}function xs(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Ss(e,t,n,r,i){return e=Wi(e-=t,1/n,r),void 0!==i&&(e=Wi(e,1/i,r)),e}function Ts(e,t,[n,r,i],s,o){!function(e,t=0,n=1,r=.5,i,s=e,o=e){if(re.test(t)&&(t=parseFloat(t),t=yr(o.min,o.max,t/100)-o.min),"number"!=typeof t)return;let a=yr(s.min,s.max,r);e===s&&(a-=t),e.min=Ss(e.min,t,n,a,i),e.max=Ss(e.max,t,n,a,i)}(e,t[n],t[r],t[i],t.scale,s,o)}const Ps=["x","scaleX","originX"],Cs=["y","scaleY","originY"];function As(e,t,n,r){Ts(e.x,t,Ps,n?n.x:void 0,r?r.x:void 0),Ts(e.y,t,Cs,n?n.y:void 0,r?r.y:void 0)}function ks(e){return 0===e.translate&&1===e.scale}function Rs(e){return ks(e.x)&&ks(e.y)}function Vs(e,t){return e.min===t.min&&e.max===t.max}function Os(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Ds(e,t){return Os(e.x,t.x)&&Os(e.y,t.y)}function Ls(e){return Ti(e.x)/Ti(e.y)}function Ms(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class Fs{constructor(){this.members=[]}add(e){qe(this.members,e),e.scheduleRender()}remove(e){if(Ke(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){const t=this.members.findIndex((t=>e===t));if(0===t)return!1;let n;for(let e=t;e>=0;e--){const t=this.members[e];if(!1!==t.isPresent){n=t;break}}return!!n&&(this.promote(n),!0)}promote(e,t){const n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.instance&&n.scheduleRender(),e.scheduleRender(),e.resumeFrom=n,t&&(e.resumeFrom.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((e=>{const{options:t,resumingFrom:n}=e;t.onExitComplete&&t.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((e=>{e.instance&&e.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}const js=(e,t)=>e.depth-t.depth;class Ns{constructor(){this.children=[],this.isDirty=!1}add(e){qe(this.children,e),this.isDirty=!0}remove(e){Ke(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(js),this.isDirty=!1,this.children.forEach(e)}}const Is={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},_s="undefined"!=typeof window&&void 0!==window.MotionDebug,Bs=["","X","Y","Z"],Us={visibility:"hidden"};let $s=0;function zs(e,t,n,r){const{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Ws(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return!1;const{visualElement:t}=e.options;return!!t&&(!!Qr(t)||!(!e.parent||e.parent.hasCheckedOptimisedAppear)&&Ws(e.parent))}function Hs({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=(null==t?void 0:t())){this.id=$s++,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,_s&&(Is.totalNodes=Is.resolvedTargetDeltas=Is.recalculatedProjection=0),this.nodes.forEach(Ks),this.nodes.forEach(to),this.nodes.forEach(no),this.nodes.forEach(Zs),_s&&window.MotionDebug.record(Is)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(e,t){const n=Ut.now(),r=({timestamp:t})=>{const i=t-n;i>=250&&(tt(r),e(i-250))};return et.read(r,!0),()=>tt(r)}(r),ss.hasAnimatedSinceResize&&(ss.hasAnimatedSinceResize=!1,this.nodes.forEach(eo))}))}i&&this.root.registerSharedNode(i,this),!1!==this.options.animate&&o&&(i||s)&&this.addEventListener("didUpdate",(({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const i=this.options.transition||o.getDefaultTransition()||lo,{onLayoutAnimationStart:s,onLayoutAnimationComplete:a}=o.getProps(),l=!this.targetLayout||!Ds(this.targetLayout,r)||n,u=!t&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,u);const t={...jt(i,"layout"),onPlay:s,onComplete:a};(o.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||eo(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,tt(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(ro),this.animationId++)}getTransformTemplate(){const{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(window.HandoffCancelAllAnimations&&Ws(this)&&window.HandoffCancelAllAnimations(),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()}))}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance)return;if(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead()||this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;eKi&&(t.x=1),t.yKi&&(t.y=1)}(this.layoutCorrected,this.treeScale,this.path,n),!t.layout||t.target||1===this.treeScale.x&&1===this.treeScale.y||(t.target=t.layout.layoutBox,t.targetWithTransforms=ji());const{target:l}=t;l?(this.projectionDelta&&this.prevProjectionDelta?(xs(this.prevProjectionDelta.x,this.projectionDelta.x),xs(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),Ci(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===o&&this.treeScale.y===a&&Ms(this.projectionDelta.x,this.prevProjectionDelta.x)&&Ms(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),_s&&Is.recalculatedProjection++):this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender())}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){const e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Fi(),this.projectionDelta=Fi(),this.projectionDeltaWithTransform=Fi()}setAnimationOrigin(e,t=!1){const n=this.snapshot,r=n?n.latestValues:{},i={...this.latestValues},s=Fi();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;const o=ji(),a=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,c=Boolean(a&&!u&&!0===this.options.crossfade&&!this.path.some(ao));let d;this.animationProgress=0,this.mixTargetDelta=t=>{const n=t/1e3;var l,h,p,m,f,v;so(s.x,e.x,n),so(s.y,e.y,n),this.setTargetDelta(s),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Ri(o,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,m=this.relativeTargetOrigin,f=o,v=n,oo(p.x,m.x,f.x,v),oo(p.y,m.y,f.y,v),d&&(l=this.relativeTarget,h=d,Vs(l.x,h.x)&&Vs(l.y,h.y))&&(this.isProjectionDirty=!1),d||(d=ji()),Es(d,this.relativeTarget)),a&&(this.animationValues=i,function(e,t,n,r,i,s){i?(e.opacity=yr(0,void 0!==n.opacity?n.opacity:1,gs(r)),e.opacityExit=yr(void 0!==t.opacity?t.opacity:1,0,ys(r))):s&&(e.opacity=yr(void 0!==t.opacity?t.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let i=0;i{ss.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,n){const r=W(0)?0:Xr(0);return r.start(qr("",r,1e3,n)),r.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.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 e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const e=this.getLead();let{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(t&&n&&r){if(this!==e&&this.layout&&r&&po(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||ji();const t=Ti(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;const r=Ti(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Es(t,n),Ji(t,i),Ci(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Fs),this.sharedNodes.get(e).add(t);const n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){const e=this.getStack();return!e||e.lead===this}getLead(){var e;const{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;const{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){const{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){const e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){const{visualElement:e}=this.options;if(!e)return;let t=!1;const{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;const r={};n.z&&zs("z",e,r,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()})),this.root.nodes.forEach(Xs),this.root.sharedNodes.clear()}}}function Ys(e){e.updateLayout()}function qs(e){var t;const n=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:t,measuredBox:r}=e.layout,{animationType:i}=e.options,s=n.source!==e.layout.source;"size"===i?Ni((e=>{const r=s?n.measuredBox[e]:n.layoutBox[e],i=Ti(r);r.min=t[e].min,r.max=r.min+i})):po(i,n.layoutBox,t)&&Ni((r=>{const i=s?n.measuredBox[r]:n.layoutBox[r],o=Ti(t[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)}));const o=Fi();Ci(o,t,n.layoutBox);const a=Fi();s?Ci(a,e.applyTransform(r,!0),n.measuredBox):Ci(a,t,n.layoutBox);const l=!Rs(o);let u=!1;if(!e.resumeFrom){const r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:i,layout:s}=r;if(i&&s){const o=ji();Ri(o,n.layoutBox,i.layoutBox);const a=ji();Ri(a,t,s.layoutBox),Ds(o,a)||(u=!0),r.options.layoutRoot&&(e.relativeTarget=a,e.relativeTargetOrigin=o,e.relativeParent=r)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:n,delta:a,layoutDelta:o,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(e.isLead()){const{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Ks(e){_s&&Is.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=Boolean(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function Zs(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function Gs(e){e.clearSnapshot()}function Xs(e){e.clearMeasurements()}function Js(e){e.isLayoutDirty=!1}function Qs(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function eo(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function to(e){e.resolveTargetDelta()}function no(e){e.calcProjection()}function ro(e){e.resetSkewAndRotation()}function io(e){e.removeLeadSnapshot()}function so(e,t,n){e.translate=yr(t.translate,0,n),e.scale=yr(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function oo(e,t,n,r){e.min=yr(t.min,n.min,r),e.max=yr(t.max,n.max,r)}function ao(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}const lo={duration:.45,ease:[.4,0,.1,1]},uo=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),co=uo("applewebkit/")&&!uo("chrome/")?Math.round:Qe.Z;function ho(e){e.min=co(e.min),e.max=co(e.max)}function po(e,t,n){return"position"===e||"preserve-aspect"===e&&(r=Ls(t),i=Ls(n),.2,!(Math.abs(r-i)<=.2));var r,i}function mo(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}const fo=Hs({attachResizeListener:(e,t)=>ot(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),vo={current:void 0},go=Hs({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!vo.current){const e=new fo({});e.mount(window),e.setOptions({layoutScroll:!0}),vo.current=e}return vo.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>Boolean("fixed"===window.getComputedStyle(e).position)}),yo={pan:{Feature:class extends yt{constructor(){super(...arguments),this.removePointerDownListener=Qe.Z}onPointerDown(e){this.session=new pi(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:es(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:is(e),onStart:is(t),onMove:n,onEnd:(e,t)=>{delete this.session,r&&et.postRender((()=>r(e,t)))}}}mount(){this.removePointerDownListener=ct(this.node.current,"pointerdown",(e=>this.onPointerDown(e)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends yt{constructor(e){super(e),this.removeGroupControls=Qe.Z,this.removeListeners=Qe.Z,this.controls=new ns(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Qe.Z}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:go,MeasureLayout:cs}},wo={current:null},bo={current:!1},Eo=new WeakMap,xo=[...tn,vn,An],So=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],To=C.length;class Po{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,blockInitialAnimation:i,visualState:s},o={}){this.applyWillChange=!1,this.resolveKeyframes=(e,t,n,r)=>new this.KeyframeResolver(e,t,n,r,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=un,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,et.render(this.render,!1,!0))};const{latestValues:a,renderState:l}=s;this.latestValues=a,this.baseTarget={...a},this.initialValues=t.initial?{...a}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=o,this.blockInitialAnimation=Boolean(i),this.isControllingVariants=A(t),this.isVariantNode=k(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(e&&e.current);const{willChange:u,...c}=this.scrapeMotionValuesFromProps(t,{},this);for(const e in c){const t=c[e];void 0!==a[e]&&W(t)&&t.set(a[e],!1)}}mount(e){this.current=e,Eo.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(((e,t)=>this.bindToMotionValue(t,e))),bo.current||function(){if(bo.current=!0,D.j)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>wo.current=e.matches;e.addListener(t),t()}else wo.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||wo.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Eo.delete(this.current),this.projection&&this.projection.unmount(),tt(this.notifyUpdate),tt(this.render),this.valueSubscriptions.forEach((e=>e())),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 t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){const n=$.has(e),r=t.on("change",(t=>{this.latestValues[e]=t,this.props.onUpdate&&et.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0)})),i=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,(()=>{r(),i(),t.owner&&t.stop()}))}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in O){const t=O[e];if(!t)continue;const{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){const t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ji()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){const n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return void 0===n&&void 0!==t&&(n=Xr(null===t?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){var n;let r=void 0===this.latestValues[e]&&this.current?null!==(n=this.getBaseTargetFromProps(this.props,e))&&void 0!==n?n:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];var i;return null!=r&&("string"==typeof r&&(Wt(r)||$t(r))?r=parseFloat(r):(i=r,!xo.find(en(i))&&An.test(t)&&(r=Mn(e,t))),this.setBaseTarget(e,W(r)?r.get():r)),W(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:n}=this.props;let r;if("string"==typeof n||"object"==typeof n){const i=_e(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);i&&(r=i[e])}if(n&&void 0!==r)return r;const i=this.getBaseTargetFromProps(this.props,e);return void 0===i||W(i)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:i}on(e,t){return this.events[e]||(this.events[e]=new Kr),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class Co extends Po{constructor(){super(...arguments),this.KeyframeResolver=jn}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}}class Ao extends Co{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=Le}readValueFromInstance(e,t){if($.has(t)){const e=Ln(t);return e&&e.default||0}{const r=(n=e,window.getComputedStyle(n)),i=(pe(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof i?i.trim():i}var n}measureInstanceViewportBox(e,{transformPagePoint:t}){return Qi(e,t)}build(e,t,n){ge(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return je(e,t,n)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;W(e)&&(this.childSubscription=e.on("change",(e=>{this.current&&(this.current.textContent=`${e}`)})))}}class ko extends Co{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ji}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if($.has(t)){const e=Ln(t);return e&&e.default||0}return t=Me.has(t)?t:c(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ne(e,t,n)}build(e,t,n){ke(e,t,this.isSVGTag,n.transformTemplate)}renderInstance(e,t,n,r){Fe(e,t,0,r)}mount(e){this.isSVGTag=Ve(e.tagName),super.mount(e)}}const Ro=(e,t)=>_(e)?new ko(t):new Ao(t,{allowProjection:e!==i.Fragment}),Vo={...di,...At,...yo,layout:{ProjectionNode:go,MeasureLayout:cs}},Oo=N(((e,t)=>function(e,{forwardMotionProps:t=!1},n,r){return{..._(e)?it:st,preloadedFeatures:n,useRender:De(t),createVisualElement:r,Component:e}}(e,t,Vo,Ro)))},5487:(e,t,n)=>{"use strict";n.d(t,{K:()=>i,k:()=>s});var r=n(1662);let i=r.Z,s=r.Z},1741:(e,t,n)=>{"use strict";n.d(t,{j:()=>r});const r="undefined"!=typeof window},1662:(e,t,n)=>{"use strict";n.d(t,{Z:()=>r});const r=e=>e},6681:(e,t,n)=>{"use strict";n.d(t,{h:()=>i});var r=n(9196);function i(e){const t=(0,r.useRef)(null);return null===t.current&&(t.current=e()),t.current}},8868:(e,t,n)=>{"use strict";n.d(t,{L:()=>i});var r=n(9196);const i=n(1741).j?r.useLayoutEffect:r.useEffect},46:(e,t,n)=>{"use strict";n.d(t,{$l:()=>o,BN:()=>N,DY:()=>m,Fs:()=>B,J$:()=>H,JN:()=>b,LI:()=>R,PM:()=>u,UG:()=>Y,W6:()=>A,i_:()=>s,kY:()=>G,ko:()=>Q,kw:()=>k,mf:()=>l,o8:()=>a,qC:()=>D,s6:()=>J,sj:()=>j,u3:()=>M,u_:()=>$,w6:()=>C,xD:()=>ee});var r=n(9196);const i=()=>{},s=i(),o=Object,a=e=>e===s,l=e=>"function"==typeof e,u=(e,t)=>({...e,...t}),c=e=>l(e.then),d=new WeakMap;let h=0;const p=e=>{const t=typeof e,n=e&&e.constructor,r=n==Date;let i,s;if(o(e)!==e||r||n==RegExp)i=r?e.toJSON():"symbol"==t?e.toString():"string"==t?JSON.stringify(e):""+e;else{if(i=d.get(e),i)return i;if(i=++h+"~",d.set(e,i),n==Array){for(i="@",s=0;s{const n=m.get(e);return[()=>!a(t)&&e.get(t)||f,r=>{if(!a(t)){const i=e.get(t);t in v||(v[t]=i),n[5](t,u(i,r),i||f)}},n[6],()=>!a(t)&&t in v?v[t]:!a(t)&&e.get(t)||f]};let E=!0;const[x,S]=y&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[i,i],T={isOnline:()=>E,isVisible:()=>{const e=w&&document.visibilityState;return a(e)||"hidden"!==e}},P={initFocus:e=>(w&&document.addEventListener("visibilitychange",e),x("focus",e),()=>{w&&document.removeEventListener("visibilitychange",e),S("focus",e)}),initReconnect:e=>{const t=()=>{E=!0,e()},n=()=>{E=!1};return x("online",t),x("offline",n),()=>{S("online",t),S("offline",n)}}},C=!r.useId,A=!y||"Deno"in window,k=e=>y&&typeof window.requestAnimationFrame!=g?window.requestAnimationFrame(e):setTimeout(e,1),R=A?r.useEffect:r.useLayoutEffect,V="undefined"!=typeof navigator&&navigator.connection,O=!A&&V&&(["slow-2g","2g"].includes(V.effectiveType)||V.saveData),D=e=>{if(l(e))try{e=e()}catch(t){e=""}const t=e;return[e="string"==typeof e?e:(Array.isArray(e)?e.length:e)?p(e):"",t]};let L=0;const M=()=>++L,F=2;var j={__proto__:null,ERROR_REVALIDATE_EVENT:3,FOCUS_EVENT:0,MUTATE_EVENT:F,RECONNECT_EVENT:1};async function N(...e){const[t,n,r,i]=e,o=u({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let d=o.populateCache;const h=o.rollbackOnError;let p=o.optimisticData;const f=o.throwOnError;if(l(n)){const e=n,r=[],i=t.keys();for(const n of i)!/^\$(inf|sub)\$/.test(n)&&e(t.get(n)._k)&&r.push(n);return Promise.all(r.map(v))}return v(n);async function v(n){const[i]=D(n);if(!i)return;const[u,v]=b(t,i),[g,y,w,E]=m.get(t),x=()=>{const e=g[i];return(l(o.revalidate)?o.revalidate(u().data,n):!1!==o.revalidate)&&(delete w[i],delete E[i],e&&e[0])?e[0](F).then((()=>u().data)):u().data};if(e.length<3)return x();let S,T=r;const P=M();y[i]=[P,0];const C=!a(p),A=u(),k=A.data,R=A._c,V=a(R)?k:R;if(C&&(p=l(p)?p(V,k):p,v({data:p,_c:V})),l(T))try{T=T(V)}catch(e){S=e}if(T&&c(T)){if(T=await T.catch((e=>{S=e})),P!==y[i][0]){if(S)throw S;return T}S&&C&&(e=>"function"==typeof h?h(e):!1!==h)(S)&&(d=!0,v({data:V,_c:s}))}if(d&&!S)if(l(d)){const e=d(T,V);v({data:e,error:s,_c:s})}else v({data:T,error:s,_c:s});if(y[i][1]=M(),Promise.resolve(x()).then((()=>{v({_c:s})})),!S)return T;if(f)throw S}}const I=(e,t)=>{for(const n in e)e[n][0]&&e[n][0](t)},_=(e,t)=>{if(!m.has(e)){const n=u(P,t),r={},o=N.bind(s,e);let a=i;const l={},c=(e,t)=>{const n=l[e]||[];return l[e]=n,n.push(t),()=>n.splice(n.indexOf(t),1)},d=(t,n,r)=>{e.set(t,n);const i=l[t];if(i)for(const e of i)e(n,r)},h=()=>{if(!m.has(e)&&(m.set(e,[r,{},{},{},o,d,c]),!A)){const t=n.initFocus(setTimeout.bind(s,I.bind(s,r,0))),i=n.initReconnect(setTimeout.bind(s,I.bind(s,r,1)));a=()=>{t&&t(),i&&i(),m.delete(e)}}};return h(),[e,o,h,a]}return[e,m.get(e)[4]]},[B,U]=_(new Map),$=u({onLoadingSlow:i,onSuccess:i,onError:i,onErrorRetry:(e,__,t,n,r)=>{const i=t.errorRetryCount,s=r.retryCount,o=~~((Math.random()+.5)*(1<<(s<8?s:8)))*t.errorRetryInterval;!a(i)&&s>i||setTimeout(n,o,r)},onDiscarded:i,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:O?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:O?5e3:3e3,compare:(e,t)=>p(e)==p(t),isPaused:()=>!1,cache:B,mutate:U,fallback:{}},T),z=(e,t)=>{const n=u(e,t);if(t){const{use:r,fallback:i}=e,{use:s,fallback:o}=t;r&&s&&(n.use=r.concat(s)),i&&o&&(n.fallback=u(i,o))}return n},W=(0,r.createContext)({}),H=e=>{const{value:t}=e,n=(0,r.useContext)(W),i=l(t),o=(0,r.useMemo)((()=>i?t(n):t),[i,n,t]),a=(0,r.useMemo)((()=>i?o:z(n,o)),[i,n,o]),c=o&&o.provider,d=(0,r.useRef)(s);c&&!d.current&&(d.current=_(c(a.cache||B),o));const h=d.current;return h&&(a.cache=h[0],a.mutate=h[1]),R((()=>{if(h)return h[2]&&h[2](),h[3]}),[]),(0,r.createElement)(W.Provider,u(e,{value:a}))},Y="$inf$",q=y&&window.__SWR_DEVTOOLS_USE__,K=q?window.__SWR_DEVTOOLS_USE__:[],Z=e=>l(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(null===e[1]?e[2]:e[1])||{}],G=()=>u($,(0,r.useContext)(W)),X=K.concat((e=>(t,n,r)=>e(t,n&&((...e)=>{const[r]=D(t),[,,,i]=m.get(B);if(r.startsWith(Y))return n(...e);const s=i[r];return a(s)?n(...e):(delete i[r],s)}),r))),J=e=>function(...t){const n=G(),[r,i,s]=Z(t),o=z(n,s);let a=e;const{use:l}=o,u=(l||[]).concat(X);for(let e=u.length;e--;)a=u[e](a);return a(r,i||o.fetcher||null,o)},Q=(e,t,n)=>{const r=t[e]||(t[e]=[]);return r.push(n),()=>{const e=r.indexOf(n);e>=0&&(r[e]=r[r.length-1],r.pop())}},ee=(e,t)=>(...n)=>{const[r,i,s]=Z(n),o=(s.use||[]).concat(t);return e(r,i,{...s,use:o})};q&&(window.__SWR_DEVTOOLS_REACT__=r)},9870:(e,t,n)=>{"use strict";n.d(t,{Z:()=>u});var r=n(9196),i=n(1688),s=n(46);const o=r.use||(e=>{if("pending"===e.status)throw e;if("fulfilled"===e.status)return e.value;throw"rejected"===e.status?e.reason:(e.status="pending",e.then((t=>{e.status="fulfilled",e.value=t}),(t=>{e.status="rejected",e.reason=t})),e)}),a={dedupe:!0};s.$l.defineProperty(s.J$,"defaultValue",{value:s.u_});const l=(0,s.s6)(((e,t,n)=>{const{cache:l,compare:u,suspense:c,fallbackData:d,revalidateOnMount:h,revalidateIfStale:p,refreshInterval:m,refreshWhenHidden:f,refreshWhenOffline:v,keepPreviousData:g}=n,[y,w,b,E]=s.DY.get(l),[x,S]=(0,s.qC)(e),T=(0,r.useRef)(!1),P=(0,r.useRef)(!1),C=(0,r.useRef)(x),A=(0,r.useRef)(t),k=(0,r.useRef)(n),R=()=>k.current,V=()=>R().isVisible()&&R().isOnline(),[O,D,L,M]=(0,s.JN)(l,x),F=(0,r.useRef)({}).current,j=(0,s.o8)(d)?n.fallback[x]:d,N=(e,t)=>{for(const n in F){const r=n;if("data"===r){if(!u(e[r],t[r])){if(!(0,s.o8)(e[r]))return!1;if(!u(Y,t[r]))return!1}}else if(t[r]!==e[r])return!1}return!0},I=(0,r.useMemo)((()=>{const e=!!x&&!!t&&((0,s.o8)(h)?!R().isPaused()&&!c&&(!!(0,s.o8)(p)||p):h),n=t=>{const n=(0,s.PM)(t);return delete n._k,e?{isValidating:!0,isLoading:!0,...n}:n},r=O(),i=M(),o=n(r),a=r===i?o:n(i);let l=o;return[()=>{const e=n(O());return N(e,l)?(l.data=e.data,l.isLoading=e.isLoading,l.isValidating=e.isValidating,l.error=e.error,l):(l=e,e)},()=>a]}),[l,x]),_=(0,i.useSyncExternalStore)((0,r.useCallback)((e=>L(x,((t,n)=>{N(n,t)||e()}))),[l,x]),I[0],I[1]),B=!T.current,U=y[x]&&y[x].length>0,$=_.data,z=(0,s.o8)($)?j:$,W=_.error,H=(0,r.useRef)(z),Y=g?(0,s.o8)($)?H.current:$:z,q=!(U&&!(0,s.o8)(W))&&(B&&!(0,s.o8)(h)?h:!R().isPaused()&&(c?!(0,s.o8)(z)&&p:(0,s.o8)(z)||p)),K=!!(x&&t&&B&&q),Z=(0,s.o8)(_.isValidating)?K:_.isValidating,G=(0,s.o8)(_.isLoading)?K:_.isLoading,X=(0,r.useCallback)((async e=>{const t=A.current;if(!x||!t||P.current||R().isPaused())return!1;let r,i,o=!0;const a=e||{},l=!b[x]||!a.dedupe,c=()=>s.w6?!P.current&&x===C.current&&T.current:x===C.current,d={isValidating:!1,isLoading:!1},h=()=>{D(d)},p=()=>{const e=b[x];e&&e[1]===i&&delete b[x]},m={isValidating:!0};(0,s.o8)(O().data)&&(m.isLoading=!0);try{if(l&&(D(m),n.loadingTimeout&&(0,s.o8)(O().data)&&setTimeout((()=>{o&&c()&&R().onLoadingSlow(x,n)}),n.loadingTimeout),b[x]=[t(S),(0,s.u3)()]),[r,i]=b[x],r=await r,l&&setTimeout(p,n.dedupingInterval),!b[x]||b[x][1]!==i)return l&&c()&&R().onDiscarded(x),!1;d.error=s.i_;const e=w[x];if(!(0,s.o8)(e)&&(i<=e[0]||i<=e[1]||0===e[1]))return h(),l&&c()&&R().onDiscarded(x),!1;const a=O().data;d.data=u(a,r)?a:r,l&&c()&&R().onSuccess(r,x,n)}catch(e){p();const t=R(),{shouldRetryOnError:n}=t;t.isPaused()||(d.error=e,l&&c()&&(t.onError(e,x,t),(!0===n||(0,s.mf)(n)&&n(e))&&(R().revalidateOnFocus&&R().revalidateOnReconnect&&!V()||t.onErrorRetry(e,x,t,(e=>{const t=y[x];t&&t[0]&&t[0](s.sj.ERROR_REVALIDATE_EVENT,e)}),{retryCount:(a.retryCount||0)+1,dedupe:!0}))))}return o=!1,h(),!0}),[x,l]),J=(0,r.useCallback)(((...e)=>(0,s.BN)(l,C.current,...e)),[]);if((0,s.LI)((()=>{A.current=t,k.current=n,(0,s.o8)($)||(H.current=$)})),(0,s.LI)((()=>{if(!x)return;const e=X.bind(s.i_,a);let t=0;const n=(0,s.ko)(x,y,((n,r={})=>{if(n==s.sj.FOCUS_EVENT){const n=Date.now();R().revalidateOnFocus&&n>t&&V()&&(t=n+R().focusThrottleInterval,e())}else if(n==s.sj.RECONNECT_EVENT)R().revalidateOnReconnect&&V()&&e();else{if(n==s.sj.MUTATE_EVENT)return X();if(n==s.sj.ERROR_REVALIDATE_EVENT)return X(r)}}));return P.current=!1,C.current=x,T.current=!0,D({_k:S}),q&&((0,s.o8)(z)||s.W6?e():(0,s.kw)(e)),()=>{P.current=!0,n()}}),[x]),(0,s.LI)((()=>{let e;function t(){const t=(0,s.mf)(m)?m(O().data):m;t&&-1!==e&&(e=setTimeout(n,t))}function n(){O().error||!f&&!R().isVisible()||!v&&!R().isOnline()?t():X(a).then(t)}return t(),()=>{e&&(clearTimeout(e),e=-1)}}),[m,f,v,x]),(0,r.useDebugValue)(Y),c&&(0,s.o8)(z)&&x){if(!s.w6&&s.W6)throw new Error("Fallback data is required when using suspense in SSR.");A.current=t,k.current=n,P.current=!1;const e=E[x];if(!(0,s.o8)(e)){const t=J(e);o(t)}if(!(0,s.o8)(W))throw W;{const e=X(a);(0,s.o8)(Y)||(e.status="fulfilled",e.value=!0),o(e)}}return{mutate:J,get data(){return F.data=!0,Y},get error(){return F.error=!0,W},get isValidating(){return F.isValidating=!0,Z},get isLoading(){return F.isLoading=!0,G}}})),u=(0,s.xD)(l,(e=>(t,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,e(t,n,r))))},270:(e,t,n)=>{"use strict";n.d(t,{Ue:()=>d});const r=e=>{let t;const n=new Set,r=(e,r)=>{const i="function"==typeof e?e(t):e;if(!Object.is(i,t)){const e=t;t=(null!=r?r:"object"!=typeof i||null===i)?i:Object.assign({},t,i),n.forEach((n=>n(t,e)))}},i=()=>t,s={setState:r,getState:i,getInitialState:()=>o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},o=t=e(r,i,s);return s};var i=n(9196),s=n(2798);const{useDebugValue:o}=i,{useSyncExternalStoreWithSelector:a}=s;let l=!1;const u=e=>e,c=e=>{"function"!=typeof e&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const t="function"==typeof e?(e=>e?r(e):r)(e):e,n=(e,n)=>function(e,t=u,n){n&&!l&&(console.warn("[DEPRECATED] Use `createWithEqualityFn` instead of `create` or use `useStoreWithEqualityFn` instead of `useStore`. They can be imported from 'zustand/traditional'. https://github.com/pmndrs/zustand/discussions/1937"),l=!0);const r=a(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return o(r),r}(t,e,n);return Object.assign(n,t),n},d=e=>e?c(e):c},782:(e,t,n)=>{"use strict";n.d(t,{FL:()=>a,mW:()=>s,tJ:()=>u});const r=new Map,i=e=>{const t=r.get(e);return t?Object.fromEntries(Object.entries(t.stores).map((([e,t])=>[e,t.getState()]))):{}},s=(e,t={})=>(n,s,a)=>{const{enabled:l,anonymousActionType:u,store:c,...d}=t;let h;try{h=(null==l||l)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(e){}if(!h)return l&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,s,a);const{connection:p,...m}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const i=r.get(n.name);if(i)return{type:"tracked",store:e,...i};const s={connection:t.connect(n),stores:{}};return r.set(n.name,s),{type:"tracked",store:e,...s}})(c,h,d);let f=!0;a.setState=(e,t,r)=>{const o=n(e,t);if(!f)return o;const l=void 0===r?{type:u||"anonymous"}:"string"==typeof r?{type:r}:r;return void 0===c?(null==p||p.send(l,s()),o):(null==p||p.send({...l,type:`${c}/${l.type}`},{...i(d.name),[c]:a.getState()}),o)};const v=(...e)=>{const t=f;f=!1,n(...e),f=t},g=e(a.setState,s,a);if("untracked"===m.type?null==p||p.init(g):(m.stores[m.store]=a,null==p||p.init(Object.fromEntries(Object.entries(m.stores).map((([e,t])=>[e,e===m.store?g:t.getState()]))))),a.dispatchFromDevtools&&"function"==typeof a.dispatch){let e=!1;const t=a.dispatch;a.dispatch=(...n)=>{"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return p.subscribe((e=>{var t;switch(e.type){case"ACTION":return"string"!=typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):o(e.payload,(e=>{if("__setState"!==e.type)a.dispatchFromDevtools&&"function"==typeof a.dispatch&&a.dispatch(e);else{if(void 0===c)return void v(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const t=e.state[c];if(null==t)return;JSON.stringify(a.getState())!==JSON.stringify(t)&&v(t)}}));case"DISPATCH":switch(e.payload.type){case"RESET":return v(g),void 0===c?null==p?void 0:p.init(a.getState()):null==p?void 0:p.init(i(d.name));case"COMMIT":return void 0===c?void(null==p||p.init(a.getState())):null==p?void 0:p.init(i(d.name));case"ROLLBACK":return o(e.state,(e=>{if(void 0===c)return v(e),void(null==p||p.init(a.getState()));v(e[c]),null==p||p.init(i(d.name))}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return o(e.state,(e=>{void 0!==c?JSON.stringify(a.getState())!==JSON.stringify(e[c])&&v(e[c]):v(e)}));case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return v(void 0===c?r:r[c]),void(null==p||p.send(null,n))}case"PAUSE_RECORDING":return f=!f}return}})),g},o=(e,t)=>{let n;try{n=JSON.parse(e)}catch(e){console.error("[zustand devtools middleware] Could not parse the received json",e)}void 0!==n&&t(n)};function a(e,t){let n;try{n=e()}catch(e){return}return{getItem:e=>{var r;const i=e=>null===e?null:JSON.parse(e,null==t?void 0:t.reviver),s=null!=(r=n.getItem(e))?r:null;return s instanceof Promise?s.then(i):i(s)},setItem:(e,r)=>n.setItem(e,JSON.stringify(r,null==t?void 0:t.replacer)),removeItem:e=>n.removeItem(e)}}const l=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then:e=>l(e)(n),catch(e){return this}}}catch(e){return{then(e){return this},catch:t=>l(t)(e)}}},u=(e,t)=>"getStorage"in t||"serialize"in t||"deserialize"in t?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((e,t)=>(n,r,i)=>{let s={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1;const a=new Set,u=new Set;let c;try{c=s.getStorage()}catch(e){}if(!c)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)}),r,i);const d=l(s.serialize),h=()=>{const e=s.partialize({...r()});let t;const n=d({state:e,version:s.version}).then((e=>c.setItem(s.name,e))).catch((e=>{t=e}));if(t)throw t;return n},p=i.setState;i.setState=(e,t)=>{p(e,t),h()};const m=e(((...e)=>{n(...e),h()}),r,i);let f;const v=()=>{var e;if(!c)return;o=!1,a.forEach((e=>e(r())));const t=(null==(e=s.onRehydrateStorage)?void 0:e.call(s,r()))||void 0;return l(c.getItem.bind(c))(s.name).then((e=>{if(e)return s.deserialize(e)})).then((e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return e.state;if(s.migrate)return s.migrate(e.state,e.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((e=>{var t;return f=s.merge(e,null!=(t=r())?t:m),n(f,!0),h()})).then((()=>{null==t||t(f,void 0),o=!0,u.forEach((e=>e(f)))})).catch((e=>{null==t||t(void 0,e)}))};return i.persist={setOptions:e=>{s={...s,...e},e.getStorage&&(c=e.getStorage())},clearStorage:()=>{null==c||c.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:e=>(a.add(e),()=>{a.delete(e)}),onFinishHydration:e=>(u.add(e),()=>{u.delete(e)})},v(),f||m})(e,t)):((e,t)=>(n,r,i)=>{let s={storage:a((()=>localStorage)),partialize:e=>e,version:0,merge:(e,t)=>({...t,...e}),...t},o=!1;const u=new Set,c=new Set;let d=s.storage;if(!d)return e(((...e)=>{console.warn(`[zustand persist middleware] Unable to update item '${s.name}', the given storage is currently unavailable.`),n(...e)}),r,i);const h=()=>{const e=s.partialize({...r()});return d.setItem(s.name,{state:e,version:s.version})},p=i.setState;i.setState=(e,t)=>{p(e,t),h()};const m=e(((...e)=>{n(...e),h()}),r,i);let f;i.getInitialState=()=>m;const v=()=>{var e,t;if(!d)return;o=!1,u.forEach((e=>{var t;return e(null!=(t=r())?t:m)}));const i=(null==(t=s.onRehydrateStorage)?void 0:t.call(s,null!=(e=r())?e:m))||void 0;return l(d.getItem.bind(d))(s.name).then((e=>{if(e){if("number"!=typeof e.version||e.version===s.version)return[!1,e.state];if(s.migrate)return[!0,s.migrate(e.state,e.version)];console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}return[!1,void 0]})).then((e=>{var t;const[i,o]=e;if(f=s.merge(o,null!=(t=r())?t:m),n(f,!0),i)return h()})).then((()=>{null==i||i(f,void 0),f=r(),o=!0,c.forEach((e=>e(f)))})).catch((e=>{null==i||i(void 0,e)}))};return i.persist={setOptions:e=>{s={...s,...e},e.storage&&(d=e.storage)},clearStorage:()=>{null==d||d.removeItem(s.name)},getOptions:()=>s,rehydrate:()=>v(),hasHydrated:()=>o,onHydrate:e=>(u.add(e),()=>{u.delete(e)}),onFinishHydration:e=>(c.add(e),()=>{c.delete(e)})},s.skipHydration||v(),f||m})(e,t)}},e=>{e(e.s=1470)}]);