?? GreyFile — Mystic File Browser

Current path: home/webdevt/www/wdp/wp-content/plugins/extendify/public/build/



?? Go up: /home/webdevt/www/wdp/wp-content/plugins/extendify/public

?? Viewing: extendify-library-eb89a68fdb3660f9c9d3.js

!function(){var t,e,n={184:function(t,e){var n;!function(){"use strict";var r={}.hasOwnProperty;function o(){for(var t=[],e=0;e<arguments.length;e++){var n=arguments[e];if(n){var i=typeof n;if("string"===i||"number"===i)t.push(n);else if(Array.isArray(n)){if(n.length){var s=o.apply(null,n);s&&t.push(s)}}else if("object"===i){if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]")){t.push(n.toString());continue}for(var a in n)r.call(n,a)&&n[a]&&t.push(a)}}}return t.join(" ")}t.exports?(o.default=o,t.exports=o):void 0===(n=function(){return o}.apply(e,[]))||(t.exports=n)}()},250:function(t,e,n){"use strict";var r=n(196),o="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},i=r.useState,s=r.useEffect,a=r.useLayoutEffect,l=r.useDebugValue;function u(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!o(t,n)}catch(t){return!0}}var c="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=i({inst:{value:n,getSnapshot:e}}),o=r[0].inst,c=r[1];return a((function(){o.value=n,o.getSnapshot=e,u(o)&&c({inst:o})}),[t,n,e]),s((function(){return u(o)&&c({inst:o}),t((function(){u(o)&&c({inst:o})}))}),[t]),l(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:c},139:function(t,e,n){"use strict";var r=n(196),o=n(688),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=o.useSyncExternalStore,a=r.useRef,l=r.useEffect,u=r.useMemo,c=r.useDebugValue;e.useSyncExternalStoreWithSelector=function(t,e,n,r,o){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 t(t){if(!l){if(l=!0,s=t,t=r(t),void 0!==o&&h.hasValue){var e=h.value;if(o(e,t))return a=e}return a=t}if(e=a,i(s,t))return e;var n=r(t);return void 0!==o&&o(e,n)?e:(s=t,a=n)}var s,a,l=!1,u=void 0===n?null:n;return[function(){return t(e())},null===u?void 0:function(){return t(u())}]}),[e,n,r,o]);var p=s(t,d[0],d[1]);return l((function(){h.hasValue=!0,h.value=p}),[p]),c(p),p}},688:function(t,e,n){"use strict";t.exports=n(250)},798:function(t,e,n){"use strict";t.exports=n(139)},196:function(t){"use strict";t.exports=window.React}},r={};function o(t){var e=r[t];if(void 0!==e)return e.exports;var i=r[t]={exports:{}};return n[t](i,i.exports,o),i.exports}o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},e=Object.getPrototypeOf?function(t){return Object.getPrototypeOf(t)}:function(t){return t.__proto__},o.t=function(n,r){if(1&r&&(n=this(n)),8&r)return n;if("object"==typeof n&&n){if(4&r&&n.__esModule)return n;if(16&r&&"function"==typeof n.then)return n}var i=Object.create(null);o.r(i);var s={};t=t||[null,e({}),e([]),e(e)];for(var a=2&r&&n;"object"==typeof a&&!~t.indexOf(a);a=e(a))Object.getOwnPropertyNames(a).forEach((function(t){s[t]=function(){return n[t]}}));return s.default=function(){return n},o.d(i,s),i},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){"use strict";var t=window.wp.element,e=window.wp.plugins,n=window.wp.i18n,r=(0,t.forwardRef)((function({icon:e,size:n=24,...r},o){return(0,t.cloneElement)(e,{width:n,height:n,...r,ref:o})}));const i=(0,t.createElement)("svg",{fill:"none",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,t.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"})),s=t=>{let e;const n=new Set,r=(t,r)=>{const o="function"==typeof t?t(e):t;if(!Object.is(o,e)){const t=e;e=(null!=r?r:"object"!=typeof o)?o:Object.assign({},e,o),n.forEach((n=>n(e,t)))}},o=()=>e,i={setState:r,getState:o,subscribe:t=>(n.add(t),()=>n.delete(t)),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()}};return e=t(r,o,i),i};var a=o(196),l=o.t(a,2),u=o.n(a),c=o(798);const{useSyncExternalStoreWithSelector:d}=c;let h=!1;const p=t=>{"function"!=typeof t&&console.warn("[DEPRECATED] Passing a vanilla store will be unsupported in a future version. Instead use `import { useStore } from 'zustand'`.");const e="function"==typeof t?(t=>t?s(t):s)(t):t,n=(t,n)=>function(t,e=t.getState,n){n&&!h&&(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"),h=!0);const r=d(t.subscribe,t.getState,t.getServerState||t.getState,e,n);return(0,a.useDebugValue)(r),r}(e,t,n);return Object.assign(n,e),n},f=t=>t?p(t):p,m=new Map,g=t=>{const e=m.get(t);return e?Object.fromEntries(Object.entries(e.stores).map((([t,e])=>[t,e.getState()]))):{}},y=(t,e)=>{let n;try{n=JSON.parse(t)}catch(t){console.error("[zustand devtools middleware] Could not parse the received json",t)}void 0!==n&&e(n)};function v(t,e){let n;try{n=t()}catch(t){return}return{getItem:t=>{var r;const o=t=>null===t?null:JSON.parse(t,null==e?void 0:e.reviver),i=null!=(r=n.getItem(t))?r:null;return i instanceof Promise?i.then(o):o(i)},setItem:(t,r)=>n.setItem(t,JSON.stringify(r,null==e?void 0:e.replacer)),removeItem:t=>n.removeItem(t)}}const w=t=>e=>{try{const n=t(e);return n instanceof Promise?n:{then(t){return w(t)(n)},catch(t){return this}}}catch(t){return{then(t){return this},catch(e){return w(e)(t)}}}},b=(t,e)=>"getStorage"in e||"serialize"in e||"deserialize"in e?(console.warn("[DEPRECATED] `getStorage`, `serialize` and `deserialize` options are deprecated. Use `storage` option instead."),((t,e)=>(n,r,o)=>{let i={getStorage:()=>localStorage,serialize:JSON.stringify,deserialize:JSON.parse,partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u;try{u=i.getStorage()}catch(t){}if(!u)return t(((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...t)}),r,o);const c=w(i.serialize),d=()=>{const t=i.partialize({...r()});let e;const n=c({state:t,version:i.version}).then((t=>u.setItem(i.name,t))).catch((t=>{e=t}));if(e)throw e;return n},h=o.setState;o.setState=(t,e)=>{h(t,e),d()};const p=t(((...t)=>{n(...t),d()}),r,o);let f;const m=()=>{var t;if(!u)return;s=!1,a.forEach((t=>t(r())));const e=(null==(t=i.onRehydrateStorage)?void 0:t.call(i,r()))||void 0;return w(u.getItem.bind(u))(i.name).then((t=>{if(t)return i.deserialize(t)})).then((t=>{if(t){if("number"!=typeof t.version||t.version===i.version)return t.state;if(i.migrate)return i.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((t=>{var e;return f=i.merge(t,null!=(e=r())?e:p),n(f,!0),d()})).then((()=>{null==e||e(f,void 0),s=!0,l.forEach((t=>t(f)))})).catch((t=>{null==e||e(void 0,t)}))};return o.persist={setOptions:t=>{i={...i,...t},t.getStorage&&(u=t.getStorage())},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>m(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},m(),f||p})(t,e)):((t,e)=>(n,r,o)=>{let i={storage:v((()=>localStorage)),partialize:t=>t,version:0,merge:(t,e)=>({...e,...t}),...e},s=!1;const a=new Set,l=new Set;let u=i.storage;if(!u)return t(((...t)=>{console.warn(`[zustand persist middleware] Unable to update item '${i.name}', the given storage is currently unavailable.`),n(...t)}),r,o);const c=()=>{const t=i.partialize({...r()});return u.setItem(i.name,{state:t,version:i.version})},d=o.setState;o.setState=(t,e)=>{d(t,e),c()};const h=t(((...t)=>{n(...t),c()}),r,o);let p;const f=()=>{var t,e;if(!u)return;s=!1,a.forEach((t=>{var e;return t(null!=(e=r())?e:h)}));const o=(null==(e=i.onRehydrateStorage)?void 0:e.call(i,null!=(t=r())?t:h))||void 0;return w(u.getItem.bind(u))(i.name).then((t=>{if(t){if("number"!=typeof t.version||t.version===i.version)return t.state;if(i.migrate)return i.migrate(t.state,t.version);console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}})).then((t=>{var e;return p=i.merge(t,null!=(e=r())?e:h),n(p,!0),c()})).then((()=>{null==o||o(p,void 0),p=r(),s=!0,l.forEach((t=>t(p)))})).catch((t=>{null==o||o(void 0,t)}))};return o.persist={setOptions:t=>{i={...i,...t},t.storage&&(u=t.storage)},clearStorage:()=>{null==u||u.removeItem(i.name)},getOptions:()=>i,rehydrate:()=>f(),hasHydrated:()=>s,onHydrate:t=>(a.add(t),()=>{a.delete(t)}),onFinishHydration:t=>(l.add(t),()=>{l.delete(t)})},i.skipHydration||f(),p||h})(t,e),x=f(((t,e={})=>(n,r,o)=>{const{enabled:i,anonymousActionType:s,store:a,...l}=e;let u;try{u=(null==i||i)&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(t){}if(!u)return i&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),t(n,r,o);const{connection:c,...d}=((t,e,n)=>{if(void 0===t)return{type:"untracked",connection:e.connect(n)};const r=m.get(n.name);if(r)return{type:"tracked",store:t,...r};const o={connection:e.connect(n),stores:{}};return m.set(n.name,o),{type:"tracked",store:t,...o}})(a,u,l);let h=!0;o.setState=(t,e,i)=>{const u=n(t,e);if(!h)return u;const d=void 0===i?{type:s||"anonymous"}:"string"==typeof i?{type:i}:i;return void 0===a?(null==c||c.send(d,r()),u):(null==c||c.send({...d,type:`${a}/${d.type}`},{...g(l.name),[a]:o.getState()}),u)};const p=(...t)=>{const e=h;h=!1,n(...t),h=e},f=t(o.setState,r,o);if("untracked"===d.type?null==c||c.init(f):(d.stores[d.store]=o,null==c||c.init(Object.fromEntries(Object.entries(d.stores).map((([t,e])=>[t,t===d.store?f:e.getState()]))))),o.dispatchFromDevtools&&"function"==typeof o.dispatch){let t=!1;const e=o.dispatch;o.dispatch=(...n)=>{"__setState"!==n[0].type||t||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),t=!0),e(...n)}}return c.subscribe((t=>{var e;switch(t.type){case"ACTION":return"string"!=typeof t.payload?void console.error("[zustand devtools middleware] Unsupported action format"):y(t.payload,(t=>{if("__setState"!==t.type)o.dispatchFromDevtools&&"function"==typeof o.dispatch&&o.dispatch(t);else{if(void 0===a)return void p(t.state);1!==Object.keys(t.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 e=t.state[a];if(null==e)return;JSON.stringify(o.getState())!==JSON.stringify(e)&&p(e)}}));case"DISPATCH":switch(t.payload.type){case"RESET":return p(f),void 0===a?null==c?void 0:c.init(o.getState()):null==c?void 0:c.init(g(l.name));case"COMMIT":return void 0===a?void(null==c||c.init(o.getState())):null==c?void 0:c.init(g(l.name));case"ROLLBACK":return y(t.state,(t=>{if(void 0===a)return p(t),void(null==c||c.init(o.getState()));p(t[a]),null==c||c.init(g(l.name))}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return y(t.state,(t=>{void 0!==a?JSON.stringify(o.getState())!==JSON.stringify(t[a])&&p(t[a]):p(t)}));case"IMPORT_STATE":{const{nextLiftedState:n}=t.payload,r=null==(e=n.computedStates.slice(-1)[0])?void 0:e.state;if(!r)return;return p(void 0===a?r:r[a]),void(null==c||c.send(null,n))}case"PAUSE_RECORDING":return h=!h}return}})),f})((t=>({open:!1,setOpen:e=>t({open:e}),missingCSSVars:[],addMissingCSSVar:e=>t((t=>t.missingCSSVars.includes(e)?t:{missingCSSVars:[...t.missingCSSVars,e]}))})),{name:"Extendify Library Globals"})),E=()=>{const{setOpen:e}=x();return(0,t.createElement)("div",{role:"button",onClick:()=>e(!0),className:"components-button has-icon is-primary cursor-pointer h-8 xs:h-9 px-1 min-w-0 xs:pl-2 xs:pr-3 sm:ml-2"},(0,t.createElement)(r,{icon:i,size:24}),(0,t.createElement)("span",{className:"hidden xs:inline ml-1"},(0,n.__)("Design Library","extendify-local")))};var S=window.wp.data;function P(t,e,...n){if(t in e){let r=e[t];return"function"==typeof r?r(...n):r}let r=new Error(`Tried to handle "${t}" but there is no handler defined. Only defined handlers are: ${Object.keys(e).map((t=>`"${t}"`)).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,P),r}function T(...t){return Array.from(new Set(t.flatMap((t=>"string"==typeof t?t.split(" "):[])))).filter(Boolean).join(" ")}var C,A=((C=A||{})[C.None=0]="None",C[C.RenderStrategy=1]="RenderStrategy",C[C.Static=2]="Static",C),D=(t=>(t[t.Unmount=0]="Unmount",t[t.Hidden=1]="Hidden",t))(D||{});function k({ourProps:t,theirProps:e,slot:n,defaultTag:r,features:o,visible:i=!0,name:s}){let a=O(e,t);if(i)return L(a,n,r,s);let l=null!=o?o:0;if(2&l){let{static:t=!1,...e}=a;if(t)return L(e,n,r,s)}if(1&l){let{unmount:t=!0,...e}=a;return P(t?0:1,{0(){return null},1(){return L({...e,hidden:!0,style:{display:"none"}},n,r,s)}})}return L(a,n,r,s)}function L(t,e={},n,r){let{as:o=n,children:i,refName:s="ref",...l}=M(t,["unmount","static"]),u=void 0!==t.ref?{[s]:t.ref}:{},c="function"==typeof i?i(e):i;"className"in l&&l.className&&"function"==typeof l.className&&(l.className=l.className(e));let d={};if(e){let t=!1,n=[];for(let[r,o]of Object.entries(e))"boolean"==typeof o&&(t=!0),!0===o&&n.push(r);t&&(d["data-headlessui-state"]=n.join(" "))}if(o===a.Fragment&&Object.keys(R(l)).length>0){if(!(0,a.isValidElement)(c)||Array.isArray(c)&&c.length>1)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(l).map((t=>`  - ${t}`)).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((t=>`  - ${t}`)).join("\n")].join("\n"));let t=c.props,e="function"==typeof(null==t?void 0:t.className)?(...e)=>T(null==t?void 0:t.className(...e),l.className):T(null==t?void 0:t.className,l.className),n=e?{className:e}:{};return(0,a.cloneElement)(c,Object.assign({},O(c.props,R(M(l,["ref"]))),d,u,function(...t){return{ref:t.every((t=>null==t))?void 0:e=>{for(let n of t)null!=n&&("function"==typeof n?n(e):n.current=e)}}}(c.ref,u.ref),n))}return(0,a.createElement)(o,Object.assign({},M(l,["ref"]),o!==a.Fragment&&u,o!==a.Fragment&&d),c)}function O(...t){if(0===t.length)return{};if(1===t.length)return t[0];let e={},n={};for(let r of t)for(let t in r)t.startsWith("on")&&"function"==typeof r[t]?(null!=n[t]||(n[t]=[]),n[t].push(r[t])):e[t]=r[t];if(e.disabled||e["aria-disabled"])return Object.assign(e,Object.fromEntries(Object.keys(n).map((t=>[t,void 0]))));for(let t in n)Object.assign(e,{[t](e,...r){let o=n[t];for(let t of o){if((e instanceof Event||(null==e?void 0:e.nativeEvent)instanceof Event)&&e.defaultPrevented)return;t(e,...r)}}});return e}function V(t){var e;return Object.assign((0,a.forwardRef)(t),{displayName:null!=(e=t.displayName)?e:t.name})}function R(t){let e=Object.assign({},t);for(let t in e)void 0===e[t]&&delete e[t];return e}function M(t,e=[]){let n=Object.assign({},t);for(let t of e)t in n&&delete n[t];return n}var F=Object.defineProperty,j=(t,e,n)=>(((t,e,n)=>{e in t?F(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n})(t,"symbol"!=typeof e?e+"":e,n),n);let N=new class{constructor(){j(this,"current",this.detect()),j(this,"handoffState","pending"),j(this,"currentId",0)}set(t){this.current!==t&&(this.handoffState="pending",this.currentId=0,this.current=t)}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}},I=(t,e)=>{N.isServer?(0,a.useEffect)(t,e):(0,a.useLayoutEffect)(t,e)};function B(t){let e=(0,a.useRef)(t);return I((()=>{e.current=t}),[t]),e}let _=function(t){let e=B(t);return a.useCallback(((...t)=>e.current(...t)),[e])},U=Symbol();function $(...t){let e=(0,a.useRef)(t);(0,a.useEffect)((()=>{e.current=t}),[t]);let n=_((t=>{for(let n of e.current)null!=n&&("function"==typeof n?n(t):n.current=t)}));return t.every((t=>null==t||(null==t?void 0:t[U])))?void 0:n}var H,z=(t=>(t.Space=" ",t.Enter="Enter",t.Escape="Escape",t.Backspace="Backspace",t.Delete="Delete",t.ArrowLeft="ArrowLeft",t.ArrowUp="ArrowUp",t.ArrowRight="ArrowRight",t.ArrowDown="ArrowDown",t.Home="Home",t.End="End",t.PageUp="PageUp",t.PageDown="PageDown",t.Tab="Tab",t))(z||{});function W(){let t=function(){let t="undefined"==typeof document;return"useSyncExternalStore"in l&&l.useSyncExternalStore((()=>()=>{}),(()=>!1),(()=>!t))}(),[e,n]=a.useState(N.isHandoffComplete);return e&&!1===N.isHandoffComplete&&n(!1),a.useEffect((()=>{!0!==e&&n(!0)}),[e]),a.useEffect((()=>N.handoff()),[]),!t&&e}let q=null!=(H=a.useId)?H:function(){let t=W(),[e,n]=a.useState(t?()=>N.nextId():null);return I((()=>{null===e&&n(N.nextId())}),[e]),null!=e?""+e:void 0};var Y=(t=>(t[t.None=1]="None",t[t.Focusable=2]="Focusable",t[t.Hidden=4]="Hidden",t))(Y||{});let G=V((function(t,e){let{features:n=1,...r}=t;return k({ourProps:{ref:e,"aria-hidden":2==(2&n)||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&n)&&2!=(2&n)&&{display:"none"}}},theirProps:r,slot:{},defaultTag:"div",name:"Hidden"})}));function X(t){return N.isServer?null:t instanceof Node?t.ownerDocument:null!=t&&t.hasOwnProperty("current")&&t.current instanceof Node?t.current.ownerDocument:document}let K=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((t=>`${t}:not([tabindex='-1'])`)).join(",");var Z,J,Q=(t=>(t[t.First=1]="First",t[t.Previous=2]="Previous",t[t.Next=4]="Next",t[t.Last=8]="Last",t[t.WrapAround=16]="WrapAround",t[t.NoScroll=32]="NoScroll",t))(Q||{}),tt=((J=tt||{})[J.Error=0]="Error",J[J.Overflow=1]="Overflow",J[J.Success=2]="Success",J[J.Underflow=3]="Underflow",J),et=((Z=et||{})[Z.Previous=-1]="Previous",Z[Z.Next=1]="Next",Z);var nt=(t=>(t[t.Strict=0]="Strict",t[t.Loose=1]="Loose",t))(nt||{});var rt=(t=>(t[t.Keyboard=0]="Keyboard",t[t.Mouse=1]="Mouse",t))(rt||{});function ot(t){null==t||t.focus({preventScroll:!0})}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",(t=>{t.metaKey||t.altKey||t.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")}),!0),document.addEventListener("click",(t=>{1===t.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===t.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")}),!0));let it=["textarea","input"].join(",");function st(t,e,{sorted:n=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(t)?t.length>0?t[0].ownerDocument:document:t.ownerDocument,s=Array.isArray(t)?n?function(t,e=(t=>t)){return t.slice().sort(((t,n)=>{let r=e(t),o=e(n);if(null===r||null===o)return 0;let i=r.compareDocumentPosition(o);return i&Node.DOCUMENT_POSITION_FOLLOWING?-1:i&Node.DOCUMENT_POSITION_PRECEDING?1:0}))}(t):t:function(t=document.body){return null==t?[]:Array.from(t.querySelectorAll(K)).sort(((t,e)=>Math.sign((t.tabIndex||Number.MAX_SAFE_INTEGER)-(e.tabIndex||Number.MAX_SAFE_INTEGER))))}(t);o.length>0&&s.length>1&&(s=s.filter((t=>!o.includes(t)))),r=null!=r?r:i.activeElement;let a,l=(()=>{if(5&e)return 1;if(10&e)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),u=(()=>{if(1&e)return 0;if(2&e)return Math.max(0,s.indexOf(r))-1;if(4&e)return Math.max(0,s.indexOf(r))+1;if(8&e)return s.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),c=32&e?{preventScroll:!0}:{},d=0,h=s.length;do{if(d>=h||d+h<=0)return 0;let t=u+d;if(16&e)t=(t+h)%h;else{if(t<0)return 3;if(t>=h)return 1}a=s[t],null==a||a.focus(c),d+=l}while(a!==i.activeElement);return 6&e&&function(t){var e,n;return null!=(n=null==(e=null==t?void 0:t.matches)?void 0:e.call(t,it))&&n}(a)&&a.select(),2}function at(t,e,n){let r=B(e);(0,a.useEffect)((()=>{function e(t){r.current(t)}return window.addEventListener(t,e,n),()=>window.removeEventListener(t,e,n)}),[t,n])}var lt=(t=>(t[t.Forwards=0]="Forwards",t[t.Backwards=1]="Backwards",t))(lt||{});function ut(){let t=(0,a.useRef)(!1);return I((()=>(t.current=!0,()=>{t.current=!1})),[]),t}function ct(...t){return(0,a.useMemo)((()=>X(...t)),[...t])}function dt(t,e,n,r){let o=B(n);(0,a.useEffect)((()=>{function n(t){o.current(t)}return(t=null!=t?t:window).addEventListener(e,n,r),()=>t.removeEventListener(e,n,r)}),[t,e,r])}function ht(t){"function"==typeof queueMicrotask?queueMicrotask(t):Promise.resolve().then(t).catch((t=>setTimeout((()=>{throw t}))))}function pt(t,e){let n=(0,a.useRef)([]),r=_(t);(0,a.useEffect)((()=>{let t=[...n.current];for(let[o,i]of e.entries())if(n.current[o]!==i){let o=r(e,t);return n.current=e,o}}),[r,...e])}function ft(){let t=[],e={addEventListener(t,n,r,o){return t.addEventListener(n,r,o),e.add((()=>t.removeEventListener(n,r,o)))},requestAnimationFrame(...t){let n=requestAnimationFrame(...t);return e.add((()=>cancelAnimationFrame(n)))},nextFrame(...t){return e.requestAnimationFrame((()=>e.requestAnimationFrame(...t)))},setTimeout(...t){let n=setTimeout(...t);return e.add((()=>clearTimeout(n)))},microTask(...t){let n={current:!0};return ht((()=>{n.current&&t[0]()})),e.add((()=>{n.current=!1}))},style(t,e,n){let r=t.style.getPropertyValue(e);return Object.assign(t.style,{[e]:n}),this.add((()=>{Object.assign(t.style,{[e]:r})}))},group(t){let e=ft();return t(e),this.add((()=>e.dispose()))},add(e){return t.push(e),()=>{let n=t.indexOf(e);if(n>=0)for(let e of t.splice(n,1))e()}},dispose(){for(let e of t.splice(0))e()}};return e}function mt(t){let e=_(t),n=(0,a.useRef)(!1);(0,a.useEffect)((()=>(n.current=!1,()=>{n.current=!0,ht((()=>{n.current&&e()}))})),[e])}function gt(t){if(!t)return new Set;if("function"==typeof t)return new Set(t());let e=new Set;for(let n of t.current)n.current instanceof HTMLElement&&e.add(n.current);return e}var yt=(t=>(t[t.None=1]="None",t[t.InitialFocus=2]="InitialFocus",t[t.TabLock=4]="TabLock",t[t.FocusLock=8]="FocusLock",t[t.RestoreFocus=16]="RestoreFocus",t[t.All=30]="All",t))(yt||{});let vt=V((function(t,e){let n=(0,a.useRef)(null),r=$(n,e),{initialFocus:o,containers:i,features:s=30,...l}=t;W()||(s=1);let u=ct(n);!function({ownerDocument:t},e){let n=function(t=!0){let e=(0,a.useRef)(bt.slice());return pt((([t],[n])=>{!0===n&&!1===t&&ht((()=>{e.current.splice(0)})),!1===n&&!0===t&&(e.current=bt.slice())}),[t,bt,e]),_((()=>{var t;return null!=(t=e.current.find((t=>null!=t&&t.isConnected)))?t:null}))}(e);pt((()=>{e||(null==t?void 0:t.activeElement)===(null==t?void 0:t.body)&&ot(n())}),[e]),mt((()=>{e&&ot(n())}))}({ownerDocument:u},Boolean(16&s));let c=function({ownerDocument:t,container:e,initialFocus:n},r){let o=(0,a.useRef)(null),i=ut();return pt((()=>{if(!r)return;let s=e.current;s&&ht((()=>{if(!i.current)return;let e=null==t?void 0:t.activeElement;if(null!=n&&n.current){if((null==n?void 0:n.current)===e)return void(o.current=e)}else if(s.contains(e))return void(o.current=e);null!=n&&n.current?ot(n.current):st(s,Q.First)===tt.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=null==t?void 0:t.activeElement}))}),[r]),o}({ownerDocument:u,container:n,initialFocus:o},Boolean(2&s));!function({ownerDocument:t,container:e,containers:n,previousActiveElement:r},o){let i=ut();dt(null==t?void 0:t.defaultView,"focus",(t=>{if(!o||!i.current)return;let s=gt(n);e.current instanceof HTMLElement&&s.add(e.current);let a=r.current;if(!a)return;let l=t.target;l&&l instanceof HTMLElement?xt(s,l)?(r.current=l,ot(l)):(t.preventDefault(),t.stopPropagation(),ot(a)):ot(r.current)}),!0)}({ownerDocument:u,container:n,containers:i,previousActiveElement:c},Boolean(8&s));let d=function(){let t=(0,a.useRef)(0);return at("keydown",(e=>{"Tab"===e.key&&(t.current=e.shiftKey?1:0)}),!0),t}(),h=_((t=>{let e=n.current;e&&P(d.current,{[lt.Forwards]:()=>{st(e,Q.First,{skipElements:[t.relatedTarget]})},[lt.Backwards]:()=>{st(e,Q.Last,{skipElements:[t.relatedTarget]})}})})),p=function(){let[t]=(0,a.useState)(ft);return(0,a.useEffect)((()=>()=>t.dispose()),[t]),t}(),f=(0,a.useRef)(!1),m={ref:r,onKeyDown(t){"Tab"==t.key&&(f.current=!0,p.requestAnimationFrame((()=>{f.current=!1})))},onBlur(t){let e=gt(i);n.current instanceof HTMLElement&&e.add(n.current);let r=t.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(xt(e,r)||(f.current?st(n.current,P(d.current,{[lt.Forwards]:()=>Q.Next,[lt.Backwards]:()=>Q.Previous})|Q.WrapAround,{relativeTo:t.target}):t.target instanceof HTMLElement&&ot(t.target)))}};return a.createElement(a.Fragment,null,Boolean(4&s)&&a.createElement(G,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Y.Focusable}),k({ourProps:m,theirProps:l,defaultTag:"div",name:"FocusTrap"}),Boolean(4&s)&&a.createElement(G,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:Y.Focusable}))})),wt=Object.assign(vt,{features:yt}),bt=[];function xt(t,e){for(let n of t)if(n.contains(e))return!0;return!1}!function(t){function e(){"loading"!==document.readyState&&((()=>{function t(t){t.target instanceof HTMLElement&&t.target!==document.body&&bt[0]!==t.target&&(bt.unshift(t.target),bt=bt.filter((t=>null!=t&&t.isConnected)),bt.splice(10))}window.addEventListener("click",t,{capture:!0}),window.addEventListener("mousedown",t,{capture:!0}),window.addEventListener("focus",t,{capture:!0}),document.body.addEventListener("click",t,{capture:!0}),document.body.addEventListener("mousedown",t,{capture:!0}),document.body.addEventListener("focus",t,{capture:!0})})(),document.removeEventListener("DOMContentLoaded",e))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",e),e())}();var Et=window.ReactDOM;let St=(0,a.createContext)(!1);function Pt(){return(0,a.useContext)(St)}function Tt(t){return a.createElement(St.Provider,{value:t.force},t.children)}let Ct=a.Fragment,At=a.Fragment,Dt=(0,a.createContext)(null),kt=(0,a.createContext)(null),Lt=V((function(t,e){let n=t,r=(0,a.useRef)(null),o=$(function(t,e=!0){return Object.assign(t,{[U]:e})}((t=>{r.current=t})),e),i=ct(r),s=function(t){let e=Pt(),n=(0,a.useContext)(Dt),r=ct(t),[o,i]=(0,a.useState)((()=>{if(!e&&null!==n||N.isServer)return null;let t=null==r?void 0:r.getElementById("headlessui-portal-root");if(t)return t;if(null===r)return null;let o=r.createElement("div");return o.setAttribute("id","headlessui-portal-root"),r.body.appendChild(o)}));return(0,a.useEffect)((()=>{null!==o&&(null!=r&&r.body.contains(o)||null==r||r.body.appendChild(o))}),[o,r]),(0,a.useEffect)((()=>{e||null!==n&&i(n.current)}),[n,i,e]),o}(r),[l]=(0,a.useState)((()=>{var t;return N.isServer?null:null!=(t=null==i?void 0:i.createElement("div"))?t:null})),u=(0,a.useContext)(kt),c=W();return I((()=>{!s||!l||s.contains(l)||(l.setAttribute("data-headlessui-portal",""),s.appendChild(l))}),[s,l]),I((()=>{if(l&&u)return u.register(l)}),[u,l]),mt((()=>{var t;!s||!l||(l instanceof Node&&s.contains(l)&&s.removeChild(l),s.childNodes.length<=0&&(null==(t=s.parentElement)||t.removeChild(s)))})),c&&s&&l?(0,Et.createPortal)(k({ourProps:{ref:o},theirProps:n,defaultTag:Ct,name:"Portal"}),l):null})),Ot=V((function(t,e){let{target:n,...r}=t,o={ref:$(e)};return a.createElement(Dt.Provider,{value:n},k({ourProps:o,theirProps:r,defaultTag:At,name:"Popover.Group"}))})),Vt=Object.assign(Lt,{Group:Ot}),Rt=(0,a.createContext)(null);function Mt(){let t=(0,a.useContext)(Rt);if(null===t){let t=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,Mt),t}return t}let Ft=V((function(t,e){let n=q(),{id:r=`headlessui-description-${n}`,...o}=t,i=Mt(),s=$(e);return I((()=>i.register(r)),[r,i.register]),k({ourProps:{ref:s,...i.props,id:r},theirProps:o,slot:i.slot||{},defaultTag:"p",name:i.name||"Description"})})),jt=Object.assign(Ft,{}),Nt=(0,a.createContext)(null);Nt.displayName="OpenClosedContext";var It=(t=>(t[t.Open=1]="Open",t[t.Closed=2]="Closed",t[t.Closing=4]="Closing",t[t.Opening=8]="Opening",t))(It||{});function Bt(){return(0,a.useContext)(Nt)}let _t=(0,a.createContext)((()=>{}));_t.displayName="StackContext";var Ut=(t=>(t[t.Add=0]="Add",t[t.Remove=1]="Remove",t))(Ut||{});function $t({children:t,onUpdate:e,type:n,element:r,enabled:o}){let i=(0,a.useContext)(_t),s=_(((...t)=>{null==e||e(...t),i(...t)}));return I((()=>{let t=void 0===o||!0===o;return t&&s(0,n,r),()=>{t&&s(1,n,r)}}),[s,n,r,o]),a.createElement(_t.Provider,{value:s},t)}function Ht(t,e,n){let r=B(e);(0,a.useEffect)((()=>{function e(t){r.current(t)}return document.addEventListener(t,e,n),()=>document.removeEventListener(t,e,n)}),[t,n])}function zt(t,e,n=!0){let r=(0,a.useRef)(!1);function o(n,o){if(!r.current||n.defaultPrevented)return;let i=o(n);if(null===i||!i.getRootNode().contains(i)||!i.isConnected)return;let s=function t(e){return"function"==typeof e?t(e()):Array.isArray(e)||e instanceof Set?e:[e]}(t);for(let t of s){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(i)||n.composed&&n.composedPath().includes(e))return}return!function(t,e=0){var n;return t!==(null==(n=X(t))?void 0:n.body)&&P(e,{0(){return t.matches(K)},1(){let e=t;for(;null!==e;){if(e.matches(K))return!0;e=e.parentElement}return!1}})}(i,nt.Loose)&&-1!==i.tabIndex&&n.preventDefault(),e(n,i)}(0,a.useEffect)((()=>{requestAnimationFrame((()=>{r.current=n}))}),[n]);let i=(0,a.useRef)(null);Ht("pointerdown",(t=>{var e,n;r.current&&(i.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)}),!0),Ht("mousedown",(t=>{var e,n;r.current&&(i.current=(null==(n=null==(e=t.composedPath)?void 0:e.call(t))?void 0:n[0])||t.target)}),!0),Ht("click",(t=>{i.current&&(o(t,(()=>i.current)),i.current=null)}),!0),Ht("touchend",(t=>o(t,(()=>t.target instanceof HTMLElement?t.target:null))),!0),at("blur",(t=>o(t,(()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null))),!0)}const Wt="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},{useState:qt,useEffect:Yt,useLayoutEffect:Gt,useDebugValue:Xt}=l;function Kt(t){const e=t.getSnapshot,n=t.value;try{const t=e();return!Wt(n,t)}catch{return!0}}const Zt="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e,n){return e()}:function(t,e,n){const r=e(),[{inst:o},i]=qt({inst:{value:r,getSnapshot:e}});return Gt((()=>{o.value=r,o.getSnapshot=e,Kt(o)&&i({inst:o})}),[t,r,e]),Yt((()=>(Kt(o)&&i({inst:o}),t((()=>{Kt(o)&&i({inst:o})})))),[t]),Xt(r),r},Jt="useSyncExternalStore"in l?(t=>t.useSyncExternalStore)(l):Zt;function Qt(){let t;return{before({doc:e}){var n;let r=e.documentElement;t=(null!=(n=e.defaultView)?n:window).innerWidth-r.clientWidth},after({doc:e,d:n}){let r=e.documentElement,o=r.clientWidth-r.offsetWidth,i=t-o;n.style(r,"paddingRight",`${i}px`)}}}function te(){if(!(/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0))return{};let t;return{before(){t=window.pageYOffset},after({doc:e,d:n,meta:r}){function o(t){return r.containers.flatMap((t=>t())).some((e=>e.contains(t)))}n.microTask((()=>{if("auto"!==window.getComputedStyle(e.documentElement).scrollBehavior){let t=ft();t.style(e.documentElement,"scroll-behavior","auto"),n.add((()=>n.microTask((()=>t.dispose()))))}n.style(e.body,"marginTop",`-${t}px`),window.scrollTo(0,0);let r=null;n.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),s=e.querySelector(i);s&&!o(s)&&(r=s)}catch{}}),!0),n.addEventListener(e,"touchmove",(t=>{t.target instanceof HTMLElement&&!o(t.target)&&t.preventDefault()}),{passive:!1}),n.add((()=>{window.scrollTo(0,window.pageYOffset+t),r&&r.isConnected&&(r.scrollIntoView({block:"nearest"}),r=null)}))}))}}}function ee(t){let e={};for(let n of t)Object.assign(e,n(e));return e}let ne=function(t,e){let n=new Map,r=new Set;return{getSnapshot(){return n},subscribe(t){return r.add(t),()=>r.delete(t)},dispatch(t,...o){let i=e[t].call(n,...o);i&&(n=i,r.forEach((t=>t())))}}}(0,{PUSH(t,e){var n;let r=null!=(n=this.get(t))?n:{doc:t,count:0,d:ft(),meta:new Set};return r.count++,r.meta.add(e),this.set(t,r),this},POP(t,e){let n=this.get(t);return n&&(n.count--,n.meta.delete(e)),this},SCROLL_PREVENT({doc:t,d:e,meta:n}){let r={doc:t,d:e,meta:ee(n)},o=[te(),Qt(),{before({doc:t,d:e}){e.style(t.documentElement,"overflow","hidden")}}];o.forEach((({before:t})=>null==t?void 0:t(r))),o.forEach((({after:t})=>null==t?void 0:t(r)))},SCROLL_ALLOW({d:t}){t.dispose()},TEARDOWN({doc:t}){this.delete(t)}});ne.subscribe((()=>{let t=ne.getSnapshot(),e=new Map;for(let[n]of t)e.set(n,n.documentElement.style.overflow);for(let n of t.values()){let t="hidden"===e.get(n.doc),r=0!==n.count;(r&&!t||!r&&t)&&ne.dispatch(n.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",n),0===n.count&&ne.dispatch("TEARDOWN",n)}}));let re=new Map,oe=new Map;function ie(t,e=!0){I((()=>{var n;if(!e)return;let r="function"==typeof t?t():t.current;if(!r)return;let o=null!=(n=oe.get(r))?n:0;return oe.set(r,o+1),0!==o||(re.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),function(){var t;if(!r)return;let e=null!=(t=oe.get(r))?t:1;if(1===e?oe.delete(r):oe.set(r,e-1),1!==e)return;let n=re.get(r);n&&(null===n["aria-hidden"]?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",n["aria-hidden"]),r.inert=n.inert,re.delete(r))}}),[t,e])}function se({defaultContainers:t=[],portals:e,mainTreeNodeRef:n}={}){var r;let o=(0,a.useRef)(null!=(r=null==n?void 0:n.current)?r:null),i=ct(o),s=_((()=>{var n;let r=[];for(let e of t)null!==e&&(e instanceof HTMLElement?r.push(e):"current"in e&&e.current instanceof HTMLElement&&r.push(e.current));if(null!=e&&e.current)for(let t of e.current)r.push(t);for(let t of null!=(n=null==i?void 0:i.querySelectorAll("html > *, body > *"))?n:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(o.current)||r.some((e=>t.contains(e)))||r.push(t));return r}));return{resolveContainers:s,contains:_((t=>s().some((e=>e.contains(t))))),mainTreeNodeRef:o,MainTreeNode:(0,a.useMemo)((()=>function(){return null!=n?null:a.createElement(G,{features:Y.Hidden,ref:o})}),[o,n])}}var ae=(t=>(t[t.Open=0]="Open",t[t.Closed=1]="Closed",t))(ae||{}),le=(t=>(t[t.SetTitleId=0]="SetTitleId",t))(le||{});let ue={0(t,e){return t.titleId===e.id?t:{...t,titleId:e.id}}},ce=(0,a.createContext)(null);function de(t){let e=(0,a.useContext)(ce);if(null===e){let e=new Error(`<${t} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(e,de),e}return e}function he(t,e){return P(e.type,ue,t,e)}ce.displayName="DialogContext";let pe=A.RenderStrategy|A.Static,fe=V((function(t,e){var n;let r=q(),{id:o=`headlessui-dialog-${r}`,open:i,onClose:s,initialFocus:l,__demoMode:u=!1,...c}=t,[d,h]=(0,a.useState)(0),p=Bt();void 0===i&&null!==p&&(i=(p&It.Open)===It.Open);let f=(0,a.useRef)(null),m=$(f,e),g=ct(f),y=t.hasOwnProperty("open")||null!==p,v=t.hasOwnProperty("onClose");if(!y&&!v)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!y)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!v)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof i)throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${i}`);if("function"!=typeof s)throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${s}`);let w=i?0:1,[b,x]=(0,a.useReducer)(he,{titleId:null,descriptionId:null,panelRef:(0,a.createRef)()}),E=_((()=>s(!1))),S=_((t=>x({type:0,id:t}))),T=!!W()&&!u&&0===w,C=d>1,A=null!==(0,a.useContext)(ce),[D,L]=function(){let t=(0,a.useContext)(kt),e=(0,a.useRef)([]),n=_((n=>(e.current.push(n),t&&t.register(n),()=>r(n)))),r=_((n=>{let r=e.current.indexOf(n);-1!==r&&e.current.splice(r,1),t&&t.unregister(n)})),o=(0,a.useMemo)((()=>({register:n,unregister:r,portals:e})),[n,r,e]);return[e,(0,a.useMemo)((()=>function({children:t}){return a.createElement(kt.Provider,{value:o},t)}),[o])]}(),{resolveContainers:O,mainTreeNodeRef:V,MainTreeNode:R}=se({portals:D,defaultContainers:[null!=(n=b.panelRef.current)?n:f.current]}),M=C?"parent":"leaf",F=null!==p&&(p&It.Closing)===It.Closing,j=!A&&!F&&T,N=(0,a.useCallback)((()=>{var t,e;return null!=(e=Array.from(null!=(t=null==g?void 0:g.querySelectorAll("body > *"))?t:[]).find((t=>"headlessui-portal-root"!==t.id&&t.contains(V.current)&&t instanceof HTMLElement)))?e:null}),[V]);ie(N,j);let B=!!C||T,U=(0,a.useCallback)((()=>{var t,e;return null!=(e=Array.from(null!=(t=null==g?void 0:g.querySelectorAll("[data-headlessui-portal]"))?t:[]).find((t=>t.contains(V.current)&&t instanceof HTMLElement)))?e:null}),[V]);ie(U,B),zt(O,E,!(!T||C));let H=!(C||0!==w);dt(null==g?void 0:g.defaultView,"keydown",(t=>{H&&(t.defaultPrevented||t.key===z.Escape&&(t.preventDefault(),t.stopPropagation(),E()))})),function(t,e,n=(()=>[document.body])){!function(t,e,n){let r=function(t){return Jt(t.subscribe,t.getSnapshot,t.getSnapshot)}(ne),o=t?r.get(t):void 0,i=!!o&&o.count>0;I((()=>{if(t&&e)return ne.dispatch("PUSH",t,n),()=>ne.dispatch("POP",t,n)}),[e,t])}(t,e,(t=>{var e;return{containers:[...null!=(e=t.containers)?e:[],n]}}))}(g,!(F||0!==w||A),O),(0,a.useEffect)((()=>{if(0!==w||!f.current)return;let t=new ResizeObserver((t=>{for(let e of t){let t=e.target.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&E()}}));return t.observe(f.current),()=>t.disconnect()}),[w,f,E]);let[Y,G]=function(){let[t,e]=(0,a.useState)([]);return[t.length>0?t.join(" "):void 0,(0,a.useMemo)((()=>function(t){let n=_((t=>(e((e=>[...e,t])),()=>e((e=>{let n=e.slice(),r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}))))),r=(0,a.useMemo)((()=>({register:n,slot:t.slot,name:t.name,props:t.props})),[n,t.slot,t.name,t.props]);return a.createElement(Rt.Provider,{value:r},t.children)}),[e])]}(),X=(0,a.useMemo)((()=>[{dialogState:w,close:E,setTitleId:S},b]),[w,b,E,S]),K=(0,a.useMemo)((()=>({open:0===w})),[w]),Z={ref:m,id:o,role:"dialog","aria-modal":0===w||void 0,"aria-labelledby":b.titleId,"aria-describedby":Y};return a.createElement($t,{type:"Dialog",enabled:0===w,element:f,onUpdate:_(((t,e)=>{"Dialog"===e&&P(t,{[Ut.Add]:()=>h((t=>t+1)),[Ut.Remove]:()=>h((t=>t-1))})}))},a.createElement(Tt,{force:!0},a.createElement(Vt,null,a.createElement(ce.Provider,{value:X},a.createElement(Vt.Group,{target:f},a.createElement(Tt,{force:!1},a.createElement(G,{slot:K,name:"Dialog.Description"},a.createElement(wt,{initialFocus:l,containers:O,features:T?P(M,{parent:wt.features.RestoreFocus,leaf:wt.features.All&~wt.features.FocusLock}):wt.features.None},a.createElement(L,null,k({ourProps:Z,theirProps:c,slot:K,defaultTag:"div",features:pe,visible:0===w,name:"Dialog"}))))))))),a.createElement(R,null))})),me=V((function(t,e){let n=q(),{id:r=`headlessui-dialog-backdrop-${n}`,...o}=t,[{dialogState:i},s]=de("Dialog.Backdrop"),l=$(e);(0,a.useEffect)((()=>{if(null===s.panelRef.current)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")}),[s.panelRef]);let u=(0,a.useMemo)((()=>({open:0===i})),[i]);return a.createElement(Tt,{force:!0},a.createElement(Vt,null,k({ourProps:{ref:l,id:r,"aria-hidden":!0},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Backdrop"})))})),ge=V((function(t,e){let n=q(),{id:r=`headlessui-dialog-panel-${n}`,...o}=t,[{dialogState:i},s]=de("Dialog.Panel"),l=$(e,s.panelRef),u=(0,a.useMemo)((()=>({open:0===i})),[i]);return k({ourProps:{ref:l,id:r,onClick:_((t=>{t.stopPropagation()}))},theirProps:o,slot:u,defaultTag:"div",name:"Dialog.Panel"})})),ye=V((function(t,e){let n=q(),{id:r=`headlessui-dialog-overlay-${n}`,...o}=t,[{dialogState:i,close:s}]=de("Dialog.Overlay");return k({ourProps:{ref:$(e),id:r,"aria-hidden":!0,onClick:_((t=>{if(t.target===t.currentTarget){if(function(t){let e=t.parentElement,n=null;for(;e&&!(e instanceof HTMLFieldSetElement);)e instanceof HTMLLegendElement&&(n=e),e=e.parentElement;let r=""===(null==e?void 0:e.getAttribute("disabled"));return(!r||!function(t){if(!t)return!1;let e=t.previousElementSibling;for(;null!==e;){if(e instanceof HTMLLegendElement)return!1;e=e.previousElementSibling}return!0}(n))&&r}(t.currentTarget))return t.preventDefault();t.preventDefault(),t.stopPropagation(),s()}}))},theirProps:o,slot:(0,a.useMemo)((()=>({open:0===i})),[i]),defaultTag:"div",name:"Dialog.Overlay"})})),ve=V((function(t,e){let n=q(),{id:r=`headlessui-dialog-title-${n}`,...o}=t,[{dialogState:i,setTitleId:s}]=de("Dialog.Title"),l=$(e);(0,a.useEffect)((()=>(s(r),()=>s(null))),[r,s]);let u=(0,a.useMemo)((()=>({open:0===i})),[i]);return k({ourProps:{ref:l,id:r},theirProps:o,slot:u,defaultTag:"h2",name:"Dialog.Title"})})),we=Object.assign(fe,{Backdrop:me,Panel:ge,Overlay:ye,Title:ve,Description:jt});const be=(0,a.createContext)({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"}),xe=(0,a.createContext)({}),Ee=(0,a.createContext)(null),Se="undefined"!=typeof document,Pe=Se?a.useLayoutEffect:a.useEffect,Te=(0,a.createContext)({strict:!1});function Ce(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ae(t){return"string"==typeof t||Array.isArray(t)}function De(t){return"object"==typeof t&&"function"==typeof t.start}const ke=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Le=["initial",...ke];function Oe(t){return De(t.animate)||Le.some((e=>Ae(t[e])))}function Ve(t){return Boolean(Oe(t)||t.variants)}function Re(t){return Array.isArray(t)?t.join(" "):t}const Me={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"]},Fe={};for(const t in Me)Fe[t]={isEnabled:e=>Me[t].some((t=>!!e[t]))};const je=(0,a.createContext)({}),Ne=(0,a.createContext)({}),Ie=Symbol.for("motionComponentSymbol");function Be({preloadedFeatures:t,createVisualElement:e,useRender:n,useVisualState:r,Component:o}){t&&function(t){for(const e in t)Fe[e]={...Fe[e],...t[e]}}(t);const i=(0,a.forwardRef)((function(i,s){let l;const u={...(0,a.useContext)(be),...i,layoutId:_e(i)},{isStatic:c}=u,d=function(t){const{initial:e,animate:n}=function(t,e){if(Oe(t)){const{initial:e,animate:n}=t;return{initial:!1===e||Ae(e)?e:void 0,animate:Ae(n)?n:void 0}}return!1!==t.inherit?e:{}}(t,(0,a.useContext)(xe));return(0,a.useMemo)((()=>({initial:e,animate:n})),[Re(e),Re(n)])}(i),h=r(i,c);if(!c&&Se){d.visualElement=function(t,e,n,r){const{visualElement:o}=(0,a.useContext)(xe),i=(0,a.useContext)(Te),s=(0,a.useContext)(Ee),l=(0,a.useContext)(be).reducedMotion,u=(0,a.useRef)();r=r||i.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:o,props:n,presenceContext:s,blockInitialAnimation:!!s&&!1===s.initial,reducedMotionConfig:l}));const c=u.current;(0,a.useInsertionEffect)((()=>{c&&c.update(n,s)}));const d=(0,a.useRef)(Boolean(window.HandoffAppearAnimations));return Pe((()=>{c&&(c.render(),d.current&&c.animationState&&c.animationState.animateChanges())})),(0,a.useEffect)((()=>{c&&(c.updateFeatures(),!d.current&&c.animationState&&c.animationState.animateChanges(),window.HandoffAppearAnimations=void 0,d.current=!1)})),c}(o,h,u,e);const n=(0,a.useContext)(Ne),r=(0,a.useContext)(Te).strict;d.visualElement&&(l=d.visualElement.loadFeatures(u,r,t,n))}return a.createElement(xe.Provider,{value:d},l&&d.visualElement?a.createElement(l,{visualElement:d.visualElement,...u}):null,n(o,i,function(t,e,n){return(0,a.useCallback)((r=>{r&&t.mount&&t.mount(r),e&&(r?e.mount(r):e.unmount()),n&&("function"==typeof n?n(r):Ce(n)&&(n.current=r))}),[e])}(h,d.visualElement,s),h,c,d.visualElement))}));return i[Ie]=o,i}function _e({layoutId:t}){const e=(0,a.useContext)(je).id;return e&&void 0!==t?e+"-"+t:t}function Ue(t){function e(e,n={}){return Be(t(e,n))}if("undefined"==typeof Proxy)return e;const n=new Map;return new Proxy(e,{get:(t,r)=>(n.has(r)||n.set(r,e(r)),n.get(r))})}const $e=["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 He(t){return"string"==typeof t&&!t.includes("-")&&!!($e.indexOf(t)>-1||/[A-Z]/.test(t))}const ze={},We=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],qe=new Set(We);function Ye(t,{layout:e,layoutId:n}){return qe.has(t)||t.startsWith("origin")||(e||void 0!==n)&&(!!ze[t]||"opacity"===t)}const Ge=t=>Boolean(t&&t.getVelocity),Xe={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},Ke=We.length,Ze=t=>e=>"string"==typeof e&&e.startsWith(t),Je=Ze("--"),Qe=Ze("var(--"),tn=(t,e)=>e&&"number"==typeof t?e.transform(t):t,en=(t,e,n)=>Math.min(Math.max(n,t),e),nn={test:t=>"number"==typeof t,parse:parseFloat,transform:t=>t},rn={...nn,transform:t=>en(0,1,t)},on={...nn,default:1},sn=t=>Math.round(1e5*t)/1e5,an=/(-)?([\d]*\.?[\d])+/g,ln=/(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))/gi,un=/^(#[0-9a-f]{3,8}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2}(-?[\d\.]+%?)\s*[\,\/]?\s*[\d\.]*%?\))$/i;function cn(t){return"string"==typeof t}const dn=t=>({test:e=>cn(e)&&e.endsWith(t)&&1===e.split(" ").length,parse:parseFloat,transform:e=>`${e}${t}`}),hn=dn("deg"),pn=dn("%"),fn=dn("px"),mn=dn("vh"),gn=dn("vw"),yn={...pn,parse:t=>pn.parse(t)/100,transform:t=>pn.transform(100*t)},vn={...nn,transform:Math.round},wn={borderWidth:fn,borderTopWidth:fn,borderRightWidth:fn,borderBottomWidth:fn,borderLeftWidth:fn,borderRadius:fn,radius:fn,borderTopLeftRadius:fn,borderTopRightRadius:fn,borderBottomRightRadius:fn,borderBottomLeftRadius:fn,width:fn,maxWidth:fn,height:fn,maxHeight:fn,size:fn,top:fn,right:fn,bottom:fn,left:fn,padding:fn,paddingTop:fn,paddingRight:fn,paddingBottom:fn,paddingLeft:fn,margin:fn,marginTop:fn,marginRight:fn,marginBottom:fn,marginLeft:fn,rotate:hn,rotateX:hn,rotateY:hn,rotateZ:hn,scale:on,scaleX:on,scaleY:on,scaleZ:on,skew:hn,skewX:hn,skewY:hn,distance:fn,translateX:fn,translateY:fn,translateZ:fn,x:fn,y:fn,z:fn,perspective:fn,transformPerspective:fn,opacity:rn,originX:yn,originY:yn,originZ:fn,zIndex:vn,fillOpacity:rn,strokeOpacity:rn,numOctaves:vn};function bn(t,e,n,r){const{style:o,vars:i,transform:s,transformOrigin:a}=t;let l=!1,u=!1,c=!0;for(const t in e){const n=e[t];if(Je(t)){i[t]=n;continue}const r=wn[t],d=tn(n,r);if(qe.has(t)){if(l=!0,s[t]=d,!c)continue;n!==(r.default||0)&&(c=!1)}else t.startsWith("origin")?(u=!0,a[t]=d):o[t]=d}if(e.transform||(l||r?o.transform=function(t,{enableHardwareAcceleration:e=!0,allowTransformNone:n=!0},r,o){let i="";for(let e=0;e<Ke;e++){const n=We[e];void 0!==t[n]&&(i+=`${Xe[n]||n}(${t[n]}) `)}return e&&!t.z&&(i+="translateZ(0)"),i=i.trim(),o?i=o(t,r?"":i):n&&r&&(i="none"),i}(t.transform,n,c,r):o.transform&&(o.transform="none")),u){const{originX:t="50%",originY:e="50%",originZ:n=0}=a;o.transformOrigin=`${t} ${e} ${n}`}}const xn=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function En(t,e,n){for(const r in e)Ge(e[r])||Ye(r,n)||(t[r]=e[r])}function Sn(t,e,n){const r={},o=function(t,e,n){const r={};return En(r,t.style||{},t),Object.assign(r,function({transformTemplate:t},e,n){return(0,a.useMemo)((()=>{const r=xn();return bn(r,e,{enableHardwareAcceleration:!n},t),Object.assign({},r.vars,r.style)}),[e])}(t,e,n)),t.transformValues?t.transformValues(r):r}(t,e,n);return t.drag&&!1!==t.dragListener&&(r.draggable=!1,o.userSelect=o.WebkitUserSelect=o.WebkitTouchCallout="none",o.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),void 0===t.tabIndex&&(t.onTap||t.onTapStart||t.whileTap)&&(r.tabIndex=0),r.style=o,r}const Pn=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","transformValues","custom","inherit","onLayoutAnimationStart","onLayoutAnimationComplete","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","ignoreStrict","viewport"]);function Tn(t){return t.startsWith("while")||t.startsWith("drag")&&"draggable"!==t||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||Pn.has(t)}let Cn=t=>!Tn(t);try{(An=require("@emotion/is-prop-valid").default)&&(Cn=t=>t.startsWith("on")?!Tn(t):An(t))}catch(t){}var An;function Dn(t,e,n){return"string"==typeof t?t:fn.transform(e+n*t)}const kn={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ln={offset:"strokeDashoffset",array:"strokeDasharray"};function On(t,{attrX:e,attrY:n,attrScale:r,originX:o,originY:i,pathLength:s,pathSpacing:a=1,pathOffset:l=0,...u},c,d,h){if(bn(t,u,c,h),d)return void(t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox));t.attrs=t.style,t.style={};const{attrs:p,style:f,dimensions:m}=t;p.transform&&(m&&(f.transform=p.transform),delete p.transform),m&&(void 0!==o||void 0!==i||f.transform)&&(f.transformOrigin=function(t,e,n){return`${Dn(e,t.x,t.width)} ${Dn(n,t.y,t.height)}`}(m,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==e&&(p.x=e),void 0!==n&&(p.y=n),void 0!==r&&(p.scale=r),void 0!==s&&function(t,e,n=1,r=0,o=!0){t.pathLength=1;const i=o?kn:Ln;t[i.offset]=fn.transform(-r);const s=fn.transform(e),a=fn.transform(n);t[i.array]=`${s} ${a}`}(p,s,a,l,!1)}const Vn=()=>({...xn(),attrs:{}}),Rn=t=>"string"==typeof t&&"svg"===t.toLowerCase();function Mn(t,e,n,r){const o=(0,a.useMemo)((()=>{const n=Vn();return On(n,e,{enableHardwareAcceleration:!1},Rn(r),t.transformTemplate),{...n.attrs,style:{...n.style}}}),[e]);if(t.style){const e={};En(e,t.style,t),o.style={...e,...o.style}}return o}function Fn(t=!1){return(e,n,r,{latestValues:o},i)=>{const s=(He(e)?Mn:Sn)(n,o,i,e),l=function(t,e,n){const r={};for(const o in t)"values"===o&&"object"==typeof t.values||(Cn(o)||!0===n&&Tn(o)||!e&&!Tn(o)||t.draggable&&o.startsWith("onDrag"))&&(r[o]=t[o]);return r}(n,"string"==typeof e,t),u={...l,...s,ref:r},{children:c}=n,d=(0,a.useMemo)((()=>Ge(c)?c.get():c),[c]);return(0,a.createElement)(e,{...u,children:d})}}const jn=t=>t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();function Nn(t,{style:e,vars:n},r,o){Object.assign(t.style,e,o&&o.getProjectionStyles(r));for(const e in n)t.style.setProperty(e,n[e])}const In=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 Bn(t,e,n,r){Nn(t,e,void 0,r);for(const n in e.attrs)t.setAttribute(In.has(n)?n:jn(n),e.attrs[n])}function Un(t,e){const{style:n}=t,r={};for(const o in n)(Ge(n[o])||e.style&&Ge(e.style[o])||Ye(o,t))&&(r[o]=n[o]);return r}function $n(t,e){const n=Un(t,e);for(const r in t)(Ge(t[r])||Ge(e[r]))&&(n[-1!==We.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=t[r]);return n}function Hn(t,e,n,r={},o={}){return"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),"string"==typeof e&&(e=t.variants&&t.variants[e]),"function"==typeof e&&(e=e(void 0!==n?n:t.custom,r,o)),e}const zn=t=>Array.isArray(t),Wn=t=>Boolean(t&&"object"==typeof t&&t.mix&&t.toValue),qn=t=>zn(t)?t[t.length-1]||0:t;function Yn(t){const e=Ge(t)?t.get():t;return Wn(e)?e.toValue():e}const Gn=t=>(e,n)=>{const r=(0,a.useContext)(xe),o=(0,a.useContext)(Ee),i=()=>function({scrapeMotionValuesFromProps:t,createRenderState:e,onMount:n},r,o,i){const s={latestValues:Xn(r,o,i,t),renderState:e()};return n&&(s.mount=t=>n(r,t,s)),s}(t,e,r,o);return n?i():function(t){const e=(0,a.useRef)(null);return null===e.current&&(e.current=t()),e.current}(i)};function Xn(t,e,n,r){const o={},i=r(t,{});for(const t in i)o[t]=Yn(i[t]);let{initial:s,animate:a}=t;const l=Oe(t),u=Ve(t);e&&u&&!l&&!1!==t.inherit&&(void 0===s&&(s=e.initial),void 0===a&&(a=e.animate));let c=!!n&&!1===n.initial;c=c||!1===s;const d=c?a:s;return d&&"boolean"!=typeof d&&!De(d)&&(Array.isArray(d)?d:[d]).forEach((e=>{const n=Hn(t,e);if(!n)return;const{transitionEnd:r,transition:i,...s}=n;for(const t in s){let e=s[t];Array.isArray(e)&&(e=e[c?e.length-1:0]),null!==e&&(o[t]=e)}for(const t in r)o[t]=r[t]})),o}const Kn=t=>t;class Zn{constructor(){this.order=[],this.scheduled=new Set}add(t){if(!this.scheduled.has(t))return this.scheduled.add(t),this.order.push(t),!0}remove(t){const e=this.order.indexOf(t);-1!==e&&(this.order.splice(e,1),this.scheduled.delete(t))}clear(){this.order.length=0,this.scheduled.clear()}}const Jn=["prepare","read","update","preRender","render","postRender"],{schedule:Qn,cancel:tr,state:er,steps:nr}=function(t,e){let n=!1,r=!0;const o={delta:0,timestamp:0,isProcessing:!1},i=Jn.reduce(((t,e)=>(t[e]=function(t){let e=new Zn,n=new Zn,r=0,o=!1,i=!1;const s=new WeakSet,a={schedule:(t,i=!1,a=!1)=>{const l=a&&o,u=l?e:n;return i&&s.add(t),u.add(t)&&l&&o&&(r=e.order.length),t},cancel:t=>{n.remove(t),s.delete(t)},process:l=>{if(o)i=!0;else{if(o=!0,[e,n]=[n,e],n.clear(),r=e.order.length,r)for(let n=0;n<r;n++){const r=e.order[n];r(l),s.has(r)&&(a.schedule(r),t())}o=!1,i&&(i=!1,a.process(l))}}};return a}((()=>n=!0)),t)),{}),s=t=>i[t].process(o),a=()=>{const e=performance.now();n=!1,o.delta=r?1e3/60:Math.max(Math.min(e-o.timestamp,40),1),o.timestamp=e,o.isProcessing=!0,Jn.forEach(s),o.isProcessing=!1,n&&(r=!1,t(a))};return{schedule:Jn.reduce(((e,s)=>{const l=i[s];return e[s]=(e,i=!1,s=!1)=>(n||(n=!0,r=!0,o.isProcessing||t(a)),l.schedule(e,i,s)),e}),{}),cancel:t=>Jn.forEach((e=>i[e].cancel(t))),state:o,steps:i}}("undefined"!=typeof requestAnimationFrame?requestAnimationFrame:Kn),rr={useVisualState:Gn({scrapeMotionValuesFromProps:$n,createRenderState:Vn,onMount:(t,e,{renderState:n,latestValues:r})=>{Qn.read((()=>{try{n.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){n.dimensions={x:0,y:0,width:0,height:0}}})),Qn.render((()=>{On(n,r,{enableHardwareAcceleration:!1},Rn(e.tagName),t.transformTemplate),Bn(e,n)}))}})},or={useVisualState:Gn({scrapeMotionValuesFromProps:Un,createRenderState:xn})};function ir(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}const sr=t=>"mouse"===t.pointerType?"number"!=typeof t.button||t.button<=0:!1!==t.isPrimary;function ar(t,e="page"){return{point:{x:t[e+"X"],y:t[e+"Y"]}}}const lr=t=>e=>sr(e)&&t(e,ar(e));function ur(t,e,n,r){return ir(t,e,lr(n),r)}const cr=(t,e)=>n=>e(t(n)),dr=(...t)=>t.reduce(cr);function hr(t){let e=null;return()=>null===e&&(e=t,()=>{e=null})}const pr=hr("dragHorizontal"),fr=hr("dragVertical");function mr(t){let e=!1;if("y"===t)e=fr();else if("x"===t)e=pr();else{const t=pr(),n=fr();t&&n?e=()=>{t(),n()}:(t&&t(),n&&n())}return e}function gr(){const t=mr(!0);return!t||(t(),!1)}class yr{constructor(t){this.isMounted=!1,this.node=t}update(){}}function vr(t,e){const n="pointer"+(e?"enter":"leave"),r="onHover"+(e?"Start":"End");return ur(t.current,n,((n,o)=>{if("touch"===n.type||gr())return;const i=t.getProps();t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",e),i[r]&&Qn.update((()=>i[r](n,o)))}),{passive:!t.getProps()[r]})}const wr=(t,e)=>!!e&&(t===e||wr(t,e.parentElement));function br(t,e){if(!e)return;const n=new PointerEvent("pointer"+t);e(n,ar(n))}const xr=new WeakMap,Er=new WeakMap,Sr=t=>{const e=xr.get(t.target);e&&e(t)},Pr=t=>{t.forEach(Sr)};const Tr={some:0,all:1},Cr={inView:{Feature:class extends yr{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:e,margin:n,amount:r="some",once:o}=t,i={root:e?e.current:void 0,rootMargin:n,threshold:"number"==typeof r?r:Tr[r]};return function(t,e,n){const r=function({root:t,...e}){const n=t||document;Er.has(n)||Er.set(n,{});const r=Er.get(n),o=JSON.stringify(e);return r[o]||(r[o]=new IntersectionObserver(Pr,{root:t,...e})),r[o]}(e);return xr.set(t,n),r.observe(t),()=>{xr.delete(t),r.unobserve(t)}}(this.node.current,i,(t=>{const{isIntersecting:e}=t;if(this.isInView===e)return;if(this.isInView=e,o&&!e&&this.hasEnteredView)return;e&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",e);const{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),i=e?n:r;i&&i(t)}))}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;const{props:t,prevProps:e}=this.node;["amount","margin","root"].some(function({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}(t,e))&&this.startObserver()}unmount(){}}},tap:{Feature:class extends yr{constructor(){super(...arguments),this.removeStartListeners=Kn,this.removeEndListeners=Kn,this.removeAccessibleListeners=Kn,this.startPointerPress=(t,e)=>{if(this.removeEndListeners(),this.isPressing)return;const n=this.node.getProps(),r=ur(window,"pointerup",((t,e)=>{if(!this.checkPressEnd())return;const{onTap:n,onTapCancel:r}=this.node.getProps();Qn.update((()=>{wr(this.node.current,t.target)?n&&n(t,e):r&&r(t,e)}))}),{passive:!(n.onTap||n.onPointerUp)}),o=ur(window,"pointercancel",((t,e)=>this.cancelPress(t,e)),{passive:!(n.onTapCancel||n.onPointerCancel)});this.removeEndListeners=dr(r,o),this.startPress(t,e)},this.startAccessiblePress=()=>{const t=ir(this.node.current,"keydown",(t=>{"Enter"!==t.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=ir(this.node.current,"keyup",(t=>{"Enter"===t.key&&this.checkPressEnd()&&br("up",((t,e)=>{const{onTap:n}=this.node.getProps();n&&Qn.update((()=>n(t,e)))}))})),br("down",((t,e)=>{this.startPress(t,e)})))})),e=ir(this.node.current,"blur",(()=>{this.isPressing&&br("cancel",((t,e)=>this.cancelPress(t,e)))}));this.removeAccessibleListeners=dr(t,e)}}startPress(t,e){this.isPressing=!0;const{onTapStart:n,whileTap:r}=this.node.getProps();r&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),n&&Qn.update((()=>n(t,e)))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!gr()}cancelPress(t,e){if(!this.checkPressEnd())return;const{onTapCancel:n}=this.node.getProps();n&&Qn.update((()=>n(t,e)))}mount(){const t=this.node.getProps(),e=ur(this.node.current,"pointerdown",this.startPointerPress,{passive:!(t.onTapStart||t.onPointerStart)}),n=ir(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=dr(e,n)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}},focus:{Feature:class extends yr{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch(e){t=!0}t&&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=dr(ir(this.node.current,"focus",(()=>this.onFocus())),ir(this.node.current,"blur",(()=>this.onBlur())))}unmount(){}}},hover:{Feature:class extends yr{mount(){this.unmount=dr(vr(this.node,!0),vr(this.node,!1))}unmount(){}}}};function Ar(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;r<n;r++)if(e[r]!==t[r])return!1;return!0}function Dr(t,e,n){const r=t.getProps();return Hn(r,e,void 0!==n?n:r.custom,function(t){const e={};return t.values.forEach(((t,n)=>e[n]=t.get())),e}(t),function(t){const e={};return t.values.forEach(((t,n)=>e[n]=t.getVelocity())),e}(t))}const kr="data-"+jn("framerAppearId");let Lr=Kn,Or=Kn;const Vr=t=>1e3*t,Rr=t=>t/1e3,Mr=t=>Array.isArray(t)&&"number"==typeof t[0];function Fr(t){return Boolean(!t||"string"==typeof t&&Nr[t]||Mr(t)||Array.isArray(t)&&t.every(Fr))}const jr=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,Nr={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:jr([0,.65,.55,1]),circOut:jr([.55,0,1,.45]),backIn:jr([.31,.01,.66,-.59]),backOut:jr([.33,1.53,.69,.99])};function Ir(t){if(t)return Mr(t)?jr(t):Array.isArray(t)?t.map(Ir):Nr[t]}const Br=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t;function _r(t,e,n,r){if(t===e&&n===r)return Kn;return o=>0===o||1===o?o:Br(function(t,e,n,r,o){let i,s,a=0;do{s=e+(n-e)/2,i=Br(s,r,o)-t,i>0?n=s:e=s}while(Math.abs(i)>1e-7&&++a<12);return s}(o,0,1,t,n),e,r)}const Ur=_r(.42,0,1,1),$r=_r(0,0,.58,1),Hr=_r(.42,0,.58,1),zr=t=>Array.isArray(t)&&"number"!=typeof t[0],Wr=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,qr=t=>e=>1-t(1-e),Yr=t=>1-Math.sin(Math.acos(t)),Gr=qr(Yr),Xr=Wr(Gr),Kr=_r(.33,1.53,.69,.99),Zr=qr(Kr),Jr=Wr(Zr),Qr={linear:Kn,easeIn:Ur,easeInOut:Hr,easeOut:$r,circIn:Yr,circInOut:Xr,circOut:Gr,backIn:Zr,backInOut:Jr,backOut:Kr,anticipate:t=>(t*=2)<1?.5*Zr(t):.5*(2-Math.pow(2,-10*(t-1)))},to=t=>{if(Array.isArray(t)){Or(4===t.length,"Cubic bezier arrays must contain four numerical values.");const[e,n,r,o]=t;return _r(e,n,r,o)}return"string"==typeof t?(Or(void 0!==Qr[t],`Invalid easing type '${t}'`),Qr[t]):t},eo=(t,e)=>n=>Boolean(cn(n)&&un.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e)),no=(t,e,n)=>r=>{if(!cn(r))return r;const[o,i,s,a]=r.match(an);return{[t]:parseFloat(o),[e]:parseFloat(i),[n]:parseFloat(s),alpha:void 0!==a?parseFloat(a):1}},ro={...nn,transform:t=>Math.round((t=>en(0,255,t))(t))},oo={test:eo("rgb","red"),parse:no("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+ro.transform(t)+", "+ro.transform(e)+", "+ro.transform(n)+", "+sn(rn.transform(r))+")"},io={test:eo("#"),parse:function(t){let e="",n="",r="",o="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),o=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),o=t.substring(4,5),e+=e,n+=n,r+=r,o+=o),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:o?parseInt(o,16)/255:1}},transform:oo.transform},so={test:eo("hsl","hue"),parse:no("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+pn.transform(sn(e))+", "+pn.transform(sn(n))+", "+sn(rn.transform(r))+")"},ao={test:t=>oo.test(t)||io.test(t)||so.test(t),parse:t=>oo.test(t)?oo.parse(t):so.test(t)?so.parse(t):io.parse(t),transform:t=>cn(t)?t:t.hasOwnProperty("red")?oo.transform(t):so.transform(t)},lo=(t,e,n)=>-n*t+n*e+t;function uo(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+6*(e-t)*n:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}const co=(t,e,n)=>{const r=t*t;return Math.sqrt(Math.max(0,n*(e*e-r)+r))},ho=[io,oo,so];function po(t){const e=(t=>ho.find((e=>e.test(t))))(t);Or(Boolean(e),`'${t}' is not an animatable color. Use the equivalent color code instead.`);let n=e.parse(t);return e===so&&(n=function({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,n/=100;let o=0,i=0,s=0;if(e/=100){const r=n<.5?n*(1+e):n+e-n*e,a=2*n-r;o=uo(a,r,t+1/3),i=uo(a,r,t),s=uo(a,r,t-1/3)}else o=i=s=n;return{red:Math.round(255*o),green:Math.round(255*i),blue:Math.round(255*s),alpha:r}}(n)),n}const fo=(t,e)=>{const n=po(t),r=po(e),o={...n};return t=>(o.red=co(n.red,r.red,t),o.green=co(n.green,r.green,t),o.blue=co(n.blue,r.blue,t),o.alpha=lo(n.alpha,r.alpha,t),oo.transform(o))},mo={regex:/var\s*\(\s*--[\w-]+(\s*,\s*(?:(?:[^)(]|\((?:[^)(]+|\([^)(]*\))*\))*)+)?\s*\)/g,countKey:"Vars",token:"${v}",parse:Kn},go={regex:ln,countKey:"Colors",token:"${c}",parse:ao.parse},yo={regex:an,countKey:"Numbers",token:"${n}",parse:nn.parse};function vo(t,{regex:e,countKey:n,token:r,parse:o}){const i=t.tokenised.match(e);i&&(t["num"+n]=i.length,t.tokenised=t.tokenised.replace(e,r),t.values.push(...i.map(o)))}function wo(t){const e=t.toString(),n={value:e,tokenised:e,values:[],numVars:0,numColors:0,numNumbers:0};return n.value.includes("var(--")&&vo(n,mo),vo(n,go),vo(n,yo),n}function bo(t){return wo(t).values}function xo(t){const{values:e,numColors:n,numVars:r,tokenised:o}=wo(t),i=e.length;return t=>{let e=o;for(let o=0;o<i;o++)e=o<r?e.replace(mo.token,t[o]):o<r+n?e.replace(go.token,ao.transform(t[o])):e.replace(yo.token,sn(t[o]));return e}}const Eo=t=>"number"==typeof t?0:t,So={test:function(t){var e,n;return isNaN(t)&&cn(t)&&((null===(e=t.match(an))||void 0===e?void 0:e.length)||0)+((null===(n=t.match(ln))||void 0===n?void 0:n.length)||0)>0},parse:bo,createTransformer:xo,getAnimatableNone:function(t){const e=bo(t);return xo(t)(e.map(Eo))}},Po=(t,e)=>n=>`${n>0?e:t}`;function To(t,e){return"number"==typeof t?n=>lo(t,e,n):ao.test(t)?fo(t,e):t.startsWith("var(")?Po(t,e):Do(t,e)}const Co=(t,e)=>{const n=[...t],r=n.length,o=t.map(((t,n)=>To(t,e[n])));return t=>{for(let e=0;e<r;e++)n[e]=o[e](t);return n}},Ao=(t,e)=>{const n={...t,...e},r={};for(const o in n)void 0!==t[o]&&void 0!==e[o]&&(r[o]=To(t[o],e[o]));return t=>{for(const e in r)n[e]=r[e](t);return n}},Do=(t,e)=>{const n=So.createTransformer(e),r=wo(t),o=wo(e);return r.numVars===o.numVars&&r.numColors===o.numColors&&r.numNumbers>=o.numNumbers?dr(Co(r.values,o.values),n):(Lr(!0,`Complex values '${t}' and '${e}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`),Po(t,e))},ko=(t,e,n)=>{const r=e-t;return 0===r?1:(n-t)/r},Lo=(t,e)=>n=>lo(t,e,n);function Oo(t,e,{clamp:n=!0,ease:r,mixer:o}={}){const i=t.length;if(Or(i===e.length,"Both input and output ranges must be the same length"),1===i)return()=>e[0];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const s=function(t,e,n){const r=[],o=n||function(t){return"number"==typeof t?Lo:"string"==typeof t?ao.test(t)?fo:Do:Array.isArray(t)?Co:"object"==typeof t?Ao:Lo}(t[0]),i=t.length-1;for(let n=0;n<i;n++){let i=o(t[n],t[n+1]);if(e){const t=Array.isArray(e)?e[n]||Kn:e;i=dr(t,i)}r.push(i)}return r}(e,r,o),a=s.length,l=e=>{let n=0;if(a>1)for(;n<t.length-2&&!(e<t[n+1]);n++);const r=ko(t[n],t[n+1],e);return s[n](r)};return n?e=>l(en(t[0],t[i-1],e)):l}function Vo({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const o=zr(r)?r.map(to):to(r),i={done:!1,value:e[0]},s=function(t,e){return t.map((t=>t*e))}(n&&n.length===e.length?n:function(t){const e=[0];return function(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const o=ko(0,e,r);t.push(lo(n,1,o))}}(e,t.length-1),e}(e),t),a=Oo(s,e,{ease:Array.isArray(o)?o:(l=e,u=o,l.map((()=>u||Hr)).splice(0,l.length-1))});var l,u;return{calculatedDuration:t,next:e=>(i.value=a(e),i.done=e>=t,i)}}function Ro(t,e){return e?t*(1e3/e):0}const Mo=5;function Fo(t,e,n){const r=Math.max(e-Mo,0);return Ro(n-t(r),e-r)}const jo=.001,No=.01,Io=10,Bo=.05,_o=1;const Uo=12;function $o(t,e){return t*Math.sqrt(1-e*e)}const Ho=["duration","bounce"],zo=["stiffness","damping","mass"];function Wo(t,e){return e.some((e=>void 0!==t[e]))}function qo({keyframes:t,restDelta:e,restSpeed:n,...r}){const o=t[0],i=t[t.length-1],s={done:!1,value:o},{stiffness:a,damping:l,mass:u,velocity:c,duration:d,isResolvedFromDuration:h}=function(t){let e={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...t};if(!Wo(t,zo)&&Wo(t,Ho)){const n=function({duration:t=800,bounce:e=.25,velocity:n=0,mass:r=1}){let o,i;Lr(t<=Vr(Io),"Spring duration must be 10 seconds or less");let s=1-e;s=en(Bo,_o,s),t=en(No,Io,Rr(t)),s<1?(o=e=>{const r=e*s,o=r*t,i=r-n,a=$o(e,s),l=Math.exp(-o);return jo-i/a*l},i=e=>{const r=e*s*t,i=r*n+n,a=Math.pow(s,2)*Math.pow(e,2)*t,l=Math.exp(-r),u=$o(Math.pow(e,2),s);return(-o(e)+jo>0?-1:1)*((i-a)*l)/u}):(o=e=>Math.exp(-e*t)*((e-n)*t+1)-jo,i=e=>Math.exp(-e*t)*(t*t*(n-e)));const a=function(t,e,n){let r=n;for(let n=1;n<Uo;n++)r-=t(r)/e(r);return r}(o,i,5/t);if(t=Vr(t),isNaN(a))return{stiffness:100,damping:10,duration:t};{const e=Math.pow(a,2)*r;return{stiffness:e,damping:2*s*Math.sqrt(r*e),duration:t}}}(t);e={...e,...n,velocity:0,mass:1},e.isResolvedFromDuration=!0}return e}(r),p=c?-Rr(c):0,f=l/(2*Math.sqrt(a*u)),m=i-o,g=Rr(Math.sqrt(a/u)),y=Math.abs(m)<5;let v;if(n||(n=y?.01:2),e||(e=y?.005:.5),f<1){const t=$o(g,f);v=e=>{const n=Math.exp(-f*g*e);return i-n*((p+f*g*m)/t*Math.sin(t*e)+m*Math.cos(t*e))}}else if(1===f)v=t=>i-Math.exp(-g*t)*(m+(p+g*m)*t);else{const t=g*Math.sqrt(f*f-1);v=e=>{const n=Math.exp(-f*g*e),r=Math.min(t*e,300);return i-n*((p+f*g*m)*Math.sinh(r)+t*m*Math.cosh(r))/t}}return{calculatedDuration:h&&d||null,next:t=>{const r=v(t);if(h)s.done=t>=d;else{let o=p;0!==t&&(o=f<1?Fo(v,t,r):0);const a=Math.abs(o)<=n,l=Math.abs(i-r)<=e;s.done=a&&l}return s.value=s.done?i:r,s}}}function Yo({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:s,min:a,max:l,restDelta:u=.5,restSpeed:c}){const d=t[0],h={done:!1,value:d},p=t=>void 0===a?l:void 0===l||Math.abs(a-t)<Math.abs(l-t)?a:l;let f=n*e;const m=d+f,g=void 0===s?m:s(m);g!==m&&(f=g-d);const y=t=>-f*Math.exp(-t/r),v=t=>g+y(t),w=t=>{const e=y(t),n=v(t);h.done=Math.abs(e)<=u,h.value=h.done?g:n};let b,x;const E=t=>{(t=>void 0!==a&&t<a||void 0!==l&&t>l)(h.value)&&(b=t,x=qo({keyframes:[h.value,p(h.value)],velocity:Fo(v,t,h.value),damping:o,stiffness:i,restDelta:u,restSpeed:c}))};return E(0),{calculatedDuration:null,next:t=>{let e=!1;return x||void 0!==b||(e=!0,w(t),E(t)),void 0!==b&&t>b?x.next(t-b):(!e&&w(t),h)}}}const Go=t=>{const e=({timestamp:e})=>t(e);return{start:()=>Qn.update(e,!0),stop:()=>tr(e),now:()=>er.isProcessing?er.timestamp:performance.now()}},Xo=2e4;function Ko(t){let e=0,n=t.next(e);for(;!n.done&&e<Xo;)e+=50,n=t.next(e);return e>=Xo?1/0:e}const Zo={decay:Yo,inertia:Yo,tween:Vo,keyframes:Vo,spring:qo};function Jo({autoplay:t=!0,delay:e=0,driver:n=Go,keyframes:r,type:o="keyframes",repeat:i=0,repeatDelay:s=0,repeatType:a="loop",onPlay:l,onStop:u,onComplete:c,onUpdate:d,...h}){let p,f,m=1,g=!1;const y=()=>{f=new Promise((t=>{p=t}))};let v;y();const w=Zo[o]||Vo;let b;w!==Vo&&"number"!=typeof r[0]&&(b=Oo([0,100],r,{clamp:!1}),r=[0,100]);const x=w({...h,keyframes:r});let E;"mirror"===a&&(E=w({...h,keyframes:[...r].reverse(),velocity:-(h.velocity||0)}));let S="idle",P=null,T=null,C=null;null===x.calculatedDuration&&i&&(x.calculatedDuration=Ko(x));const{calculatedDuration:A}=x;let D=1/0,k=1/0;null!==A&&(D=A+s,k=D*(i+1)-s);let L=0;const O=t=>{if(null===T)return;m>0&&(T=Math.min(T,t)),m<0&&(T=Math.min(t-k/m,T)),L=null!==P?P:Math.round(t-T)*m;const n=L-e*(m>=0?1:-1),o=m>=0?n<0:n>k;L=Math.max(n,0),"finished"===S&&null===P&&(L=k);let l=L,u=x;if(i){const t=L/D;let e=Math.floor(t),n=t%1;!n&&t>=1&&(n=1),1===n&&e--,e=Math.min(e,i+1);const r=Boolean(e%2);r&&("reverse"===a?(n=1-n,s&&(n-=s/D)):"mirror"===a&&(u=E));let o=en(0,1,n);L>k&&(o="reverse"===a&&r?1:0),l=o*D}const c=o?{done:!1,value:r[0]}:u.next(l);b&&(c.value=b(c.value));let{done:h}=c;o||null===A||(h=m>=0?L>=k:L<=0);const p=null===P&&("finished"===S||"running"===S&&h);return d&&d(c.value),p&&M(),c},V=()=>{v&&v.stop(),v=void 0},R=()=>{S="idle",V(),p(),y(),T=C=null},M=()=>{S="finished",c&&c(),V(),p()},F=()=>{if(g)return;v||(v=n(O));const t=v.now();l&&l(),null!==P?T=t-P:T&&"finished"!==S||(T=t),"finished"===S&&y(),C=T,P=null,S="running",v.start()};t&&F();const j={then(t,e){return f.then(t,e)},get time(){return Rr(L)},set time(t){t=Vr(t),L=t,null===P&&v&&0!==m?T=v.now()-t/m:P=t},get duration(){const t=null===x.calculatedDuration?Ko(x):x.calculatedDuration;return Rr(t)},get speed(){return m},set speed(t){t!==m&&v&&(m=t,j.time=Rr(L))},get state(){return S},play:F,pause:()=>{S="paused",P=L},stop:()=>{g=!0,"idle"!==S&&(S="idle",u&&u(),R())},cancel:()=>{null!==C&&O(C),R()},complete:()=>{S="finished"},sample:t=>(T=0,O(t))};return j}const Qo=function(t){let e;return()=>(void 0===e&&(e=Object.hasOwnProperty.call(Element.prototype,"animate")),e)}(),ti=new Set(["opacity","clipPath","filter","transform","backgroundColor"]);const ei={type:"spring",stiffness:500,damping:25,restSpeed:10},ni={type:"keyframes",duration:.8},ri={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},oi=(t,{keyframes:e})=>e.length>2?ni:qe.has(t)?t.startsWith("scale")?{type:"spring",stiffness:550,damping:0===e[1]?2*Math.sqrt(550):30,restSpeed:10}:ei:ri,ii=(t,e)=>!("zIndex"===t||"number"!=typeof e&&!Array.isArray(e)&&("string"!=typeof e||!So.test(e)&&"0"!==e||e.startsWith("url("))),si=new Set(["brightness","contrast","saturate","opacity"]);function ai(t){const[e,n]=t.slice(0,-1).split("(");if("drop-shadow"===e)return t;const[r]=n.match(an)||[];if(!r)return t;const o=n.replace(r,"");let i=si.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+o+")"}const li=/([a-z-]*)\(.*?\)/g,ui={...So,getAnimatableNone:t=>{const e=t.match(li);return e?e.map(ai).join(" "):t}},ci={...wn,color:ao,backgroundColor:ao,outlineColor:ao,fill:ao,stroke:ao,borderColor:ao,borderTopColor:ao,borderRightColor:ao,borderBottomColor:ao,borderLeftColor:ao,filter:ui,WebkitFilter:ui},di=t=>ci[t];function hi(t,e){let n=di(t);return n!==ui&&(n=So),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const pi=t=>/^0[^.\s]+$/.test(t);function fi(t){return"number"==typeof t?0===t:null!==t?"none"===t||"0"===t||pi(t):void 0}function mi(t,e){return t[e]||t.default||t}const gi=(t,e,n,r={})=>o=>{const i=mi(r,t)||{},s=i.delay||r.delay||0;let{elapsed:a=0}=r;a-=Vr(s);const l=function(t,e,n,r){const o=ii(e,n);let i;i=Array.isArray(n)?[...n]:[null,n];const s=void 0!==r.from?r.from:t.get();let a;const l=[];for(let t=0;t<i.length;t++)null===i[t]&&(i[t]=0===t?s:i[t-1]),fi(i[t])&&l.push(t),"string"==typeof i[t]&&"none"!==i[t]&&"0"!==i[t]&&(a=i[t]);if(o&&l.length&&a)for(let t=0;t<l.length;t++)i[l[t]]=hi(e,a);return i}(e,t,n,i),u=l[0],c=l[l.length-1],d=ii(t,u),h=ii(t,c);Lr(d===h,`You are trying to animate ${t} from "${u}" to "${c}". ${u} is not an animatable value - to enable this animation set ${u} to a value animatable to ${c} via the \`style\` property.`);let p={keyframes:l,velocity:e.getVelocity(),ease:"easeOut",...i,delay:-a,onUpdate:t=>{e.set(t),i.onUpdate&&i.onUpdate(t)},onComplete:()=>{o(),i.onComplete&&i.onComplete()}};if(function({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:o,repeat:i,repeatType:s,repeatDelay:a,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(i)||(p={...p,...oi(t,p)}),p.duration&&(p.duration=Vr(p.duration)),p.repeatDelay&&(p.repeatDelay=Vr(p.repeatDelay)),!d||!h||!1===i.type)return function({keyframes:t,delay:e,onUpdate:n,onComplete:r}){const o=()=>(n&&n(t[t.length-1]),r&&r(),{time:0,speed:1,duration:0,play:Kn,pause:Kn,stop:Kn,then:t=>(t(),Promise.resolve()),cancel:Kn,complete:Kn});return e?Jo({keyframes:[0,1],duration:0,delay:e,onComplete:o}):o()}(p);if(e.owner&&e.owner.current instanceof HTMLElement&&!e.owner.getProps().onUpdate){const n=function(t,e,{onUpdate:n,onComplete:r,...o}){if(!Qo()||!ti.has(e)||o.repeatDelay||"mirror"===o.repeatType||0===o.damping||"inertia"===o.type)return!1;let i,s,a=!1;const l=()=>{s=new Promise((t=>{i=t}))};l();let{keyframes:u,duration:c=300,ease:d,times:h}=o;if(((t,e)=>"spring"===e.type||"backgroundColor"===t||!Fr(e.ease))(e,o)){const t=Jo({...o,repeat:0,delay:0});let e={done:!1,value:u[0]};const n=[];let r=0;for(;!e.done&&r<2e4;)e=t.sample(r),n.push(e.value),r+=10;h=void 0,u=n,c=r-10,d="linear"}const p=function(t,e,n,{delay:r=0,duration:o,repeat:i=0,repeatType:s="loop",ease:a,times:l}={}){const u={[e]:n};l&&(u.offset=l);const c=Ir(a);return Array.isArray(c)&&(u.easing=c),t.animate(u,{delay:r,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===s?"alternate":"normal"})}(t.owner.current,e,u,{...o,duration:c,ease:d,times:h});o.syncStart&&(p.startTime=er.isProcessing?er.timestamp:document.timeline?document.timeline.currentTime:performance.now());const f=()=>p.cancel(),m=()=>{Qn.update(f),i(),l()};return p.onfinish=()=>{t.set(function(t,{repeat:e,repeatType:n="loop"}){return t[e&&"loop"!==n&&e%2==1?0:t.length-1]}(u,o)),r&&r(),m()},{then(t,e){return s.then(t,e)},attachTimeline(t){return p.timeline=t,p.onfinish=null,Kn},get time(){return Rr(p.currentTime||0)},set time(t){p.currentTime=Vr(t)},get speed(){return p.playbackRate},set speed(t){p.playbackRate=t},get duration(){return Rr(c)},play:()=>{a||(p.play(),tr(f))},pause:()=>p.pause(),stop:()=>{if(a=!0,"idle"===p.playState)return;const{currentTime:e}=p;if(e){const n=Jo({...o,autoplay:!1});t.setWithVelocity(n.sample(e-10).value,n.sample(e).value,10)}m()},complete:()=>p.finish(),cancel:m}}(e,t,p);if(n)return n}return Jo(p)};function yi(t){return Boolean(Ge(t)&&t.add)}const vi=t=>/^\-?\d*\.?\d+$/.test(t);function wi(t,e){-1===t.indexOf(e)&&t.push(e)}function bi(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}class xi{constructor(){this.subscriptions=[]}add(t){return wi(this.subscriptions,t),()=>bi(this.subscriptions,t)}notify(t,e,n){const r=this.subscriptions.length;if(r)if(1===r)this.subscriptions[0](t,e,n);else for(let o=0;o<r;o++){const r=this.subscriptions[o];r&&r(t,e,n)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const Ei={current:void 0};class Si{constructor(t,e={}){var n;this.version="10.16.4",this.timeDelta=0,this.lastUpdated=0,this.canTrackVelocity=!1,this.events={},this.updateAndNotify=(t,e=!0)=>{this.prev=this.current,this.current=t;const{delta:n,timestamp:r}=er;this.lastUpdated!==r&&(this.timeDelta=n,this.lastUpdated=r,Qn.postRender(this.scheduleVelocityCheck)),this.prev!==this.current&&this.events.change&&this.events.change.notify(this.current),this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()),e&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.scheduleVelocityCheck=()=>Qn.postRender(this.velocityCheck),this.velocityCheck=({timestamp:t})=>{t!==this.lastUpdated&&(this.prev=this.current,this.events.velocityChange&&this.events.velocityChange.notify(this.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(n=this.current,!isNaN(parseFloat(n))),this.owner=e.owner}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new xi);const n=this.events[t].add(e);return"change"===t?()=>{n(),Qn.read((()=>{this.events.change.getSize()||this.stop()}))}:n}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)}setWithVelocity(t,e,n){this.set(e),this.prev=t,this.timeDelta=n}jump(t){this.updateAndNotify(t),this.prev=t,this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return Ei.current&&Ei.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){return this.canTrackVelocity?Ro(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0}start(t){return this.stop(),new Promise((e=>{this.hasAnimated=!0,this.animation=t(e),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 Pi(t,e){return new Si(t,e)}const Ti=t=>e=>e.test(t),Ci=[nn,fn,pn,hn,gn,mn,{test:t=>"auto"===t,parse:t=>t}],Ai=t=>Ci.find(Ti(t)),Di=[...Ci,ao,So],ki=t=>Di.find(Ti(t));function Li(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Pi(n))}function Oi(t,e){if(e)return(e[t]||e.default||e).from}function Vi({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&!0!==e[n];return e[n]=!1,r}function Ri(t,e,{delay:n=0,transitionOverride:r,type:o}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:s,...a}=t.makeTargetAnimatable(e);const l=t.getValue("willChange");r&&(i=r);const u=[],c=o&&t.animationState&&t.animationState.getState()[o];for(const e in a){const r=t.getValue(e),o=a[e];if(!r||void 0===o||c&&Vi(c,e))continue;const s={delay:n,elapsed:0,...i};if(window.HandoffAppearAnimations&&!r.hasAnimated){const n=t.getProps()[kr];n&&(s.elapsed=window.HandoffAppearAnimations(n,e,r,Qn),s.syncStart=!0)}r.start(gi(e,r,o,t.shouldReduceMotion&&qe.has(e)?{type:!1}:s));const d=r.animation;yi(l)&&(l.add(e),d.then((()=>l.remove(e)))),u.push(d)}return s&&Promise.all(u).then((()=>{s&&function(t,e){const n=Dr(t,e);let{transitionEnd:r={},transition:o={},...i}=n?t.makeTargetAnimatable(n,!1):{};i={...i,...r};for(const e in i)Li(t,e,qn(i[e]))}(t,s)})),u}function Mi(t,e,n={}){const r=Dr(t,e,n.custom);let{transition:o=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(o=n.transitionOverride);const i=r?()=>Promise.all(Ri(t,r,n)):()=>Promise.resolve(),s=t.variantChildren&&t.variantChildren.size?(r=0)=>{const{delayChildren:i=0,staggerChildren:s,staggerDirection:a}=o;return function(t,e,n=0,r=0,o=1,i){const s=[],a=(t.variantChildren.size-1)*r,l=1===o?(t=0)=>t*r:(t=0)=>a-t*r;return Array.from(t.variantChildren).sort(Fi).forEach(((t,r)=>{t.notify("AnimationStart",e),s.push(Mi(t,e,{...i,delay:n+l(r)}).then((()=>t.notify("AnimationComplete",e))))})),Promise.all(s)}(t,e,i+r,s,a,n)}:()=>Promise.resolve(),{when:a}=o;if(a){const[t,e]="beforeChildren"===a?[i,s]:[s,i];return t().then((()=>e()))}return Promise.all([i(),s(n.delay)])}function Fi(t,e){return t.sortNodePosition(e)}const ji=[...ke].reverse(),Ni=ke.length;function Ii(t){let e=function(t){return e=>Promise.all(e.map((({animation:e,options:n})=>function(t,e,n={}){let r;if(t.notify("AnimationStart",e),Array.isArray(e)){const o=e.map((e=>Mi(t,e,n)));r=Promise.all(o)}else if("string"==typeof e)r=Mi(t,e,n);else{const o="function"==typeof e?Dr(t,e,n.custom):e;r=Promise.all(Ri(t,o,n))}return r.then((()=>t.notify("AnimationComplete",e)))}(t,e,n))))}(t);const n={animate:Bi(!0),whileInView:Bi(),whileHover:Bi(),whileTap:Bi(),whileDrag:Bi(),whileFocus:Bi(),exit:Bi()};let r=!0;const o=(e,n)=>{const r=Dr(t,n);if(r){const{transition:t,transitionEnd:n,...o}=r;e={...e,...o,...n}}return e};function i(i,s){const a=t.getProps(),l=t.getVariantContext(!0)||{},u=[],c=new Set;let d={},h=1/0;for(let e=0;e<Ni;e++){const m=ji[e],g=n[m],y=void 0!==a[m]?a[m]:l[m],v=Ae(y),w=m===s?g.isActive:null;!1===w&&(h=e);let b=y===l[m]&&y!==a[m]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),g.protectedKeys={...d},!g.isActive&&null===w||!y&&!g.prevProp||De(y)||"boolean"==typeof y)continue;const x=(p=g.prevProp,"string"==typeof(f=y)?f!==p:!!Array.isArray(f)&&!Ar(f,p));let E=x||m===s&&g.isActive&&!b&&v||e>h&&v;const S=Array.isArray(y)?y:[y];let P=S.reduce(o,{});!1===w&&(P={});const{prevResolvedValues:T={}}=g,C={...T,...P},A=t=>{E=!0,c.delete(t),g.needsAnimating[t]=!0};for(const t in C){const e=P[t],n=T[t];d.hasOwnProperty(t)||(e!==n?zn(e)&&zn(n)?!Ar(e,n)||x?A(t):g.protectedKeys[t]=!0:void 0!==e?A(t):c.add(t):void 0!==e&&c.has(t)?A(t):g.protectedKeys[t]=!0)}g.prevProp=y,g.prevResolvedValues=P,g.isActive&&(d={...d,...P}),r&&t.blockInitialAnimation&&(E=!1),E&&!b&&u.push(...S.map((t=>({animation:t,options:{type:m,...i}}))))}var p,f;if(c.size){const e={};c.forEach((n=>{const r=t.getBaseTarget(n);void 0!==r&&(e[n]=r)})),u.push({animation:e})}let m=Boolean(u.length);return r&&!1===a.initial&&!t.manuallyAnimateOnMount&&(m=!1),r=!1,m?e(u):Promise.resolve()}return{animateChanges:i,setActive:function(e,r,o){var s;if(n[e].isActive===r)return Promise.resolve();null===(s=t.variantChildren)||void 0===s||s.forEach((t=>{var n;return null===(n=t.animationState)||void 0===n?void 0:n.setActive(e,r)})),n[e].isActive=r;const a=i(o,e);for(const t in n)n[t].protectedKeys={};return a},setAnimateFunction:function(n){e=n(t)},getState:()=>n}}function Bi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}let _i=0;const Ui={animation:{Feature:class extends yr{constructor(t){super(t),t.animationState||(t.animationState=Ii(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();this.unmount(),De(t)&&(this.unmount=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:e}=this.node.prevProps||{};t!==e&&this.updateAnimationControlsSubscription()}unmount(){}}},exit:{Feature:class extends yr{constructor(){super(...arguments),this.id=_i++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:e,custom:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const o=this.node.animationState.setActive("exit",!t,{custom:null!=n?n:this.node.getProps().custom});e&&!t&&o.then((()=>e(this.id)))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}}},$i=(t,e)=>Math.abs(t-e);class Hi{constructor(t,e,{transformPagePoint:n}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=()=>{if(!this.lastMoveEvent||!this.lastMoveEventInfo)return;const t=qi(this.lastMoveEventInfo,this.history),e=null!==this.startEvent,n=function(t,e){const n=$i(t.x,e.x),r=$i(t.y,e.y);return Math.sqrt(n**2+r**2)}(t.offset,{x:0,y:0})>=3;if(!e&&!n)return;const{point:r}=t,{timestamp:o}=er;this.history.push({...r,timestamp:o});const{onStart:i,onMove:s}=this.handlers;e||(i&&i(this.lastMoveEvent,t),this.startEvent=this.lastMoveEvent),s&&s(this.lastMoveEvent,t)},this.handlePointerMove=(t,e)=>{this.lastMoveEvent=t,this.lastMoveEventInfo=zi(e,this.transformPagePoint),Qn.update(this.updatePoint,!0)},this.handlePointerUp=(t,e)=>{if(this.end(),!this.lastMoveEvent||!this.lastMoveEventInfo)return;const{onEnd:n,onSessionEnd:r}=this.handlers,o=qi("pointercancel"===t.type?this.lastMoveEventInfo:zi(e,this.transformPagePoint),this.history);this.startEvent&&n&&n(t,o),r&&r(t,o)},!sr(t))return;this.handlers=e,this.transformPagePoint=n;const r=zi(ar(t),this.transformPagePoint),{point:o}=r,{timestamp:i}=er;this.history=[{...o,timestamp:i}];const{onSessionStart:s}=e;s&&s(t,qi(r,this.history)),this.removeListeners=dr(ur(window,"pointermove",this.handlePointerMove),ur(window,"pointerup",this.handlePointerUp),ur(window,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),tr(this.updatePoint)}}function zi(t,e){return e?{point:e(t.point)}:t}function Wi(t,e){return{x:t.x-e.x,y:t.y-e.y}}function qi({point:t},e){return{point:t,delta:Wi(t,Gi(e)),offset:Wi(t,Yi(e)),velocity:Xi(e,.1)}}function Yi(t){return t[0]}function Gi(t){return t[t.length-1]}function Xi(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const o=Gi(t);for(;n>=0&&(r=t[n],!(o.timestamp-r.timestamp>Vr(e)));)n--;if(!r)return{x:0,y:0};const i=Rr(o.timestamp-r.timestamp);if(0===i)return{x:0,y:0};const s={x:(o.x-r.x)/i,y:(o.y-r.y)/i};return s.x===1/0&&(s.x=0),s.y===1/0&&(s.y=0),s}function Ki(t){return t.max-t.min}function Zi(t,e=0,n=.01){return Math.abs(t-e)<=n}function Ji(t,e,n,r=.5){t.origin=r,t.originPoint=lo(e.min,e.max,t.origin),t.scale=Ki(n)/Ki(e),(Zi(t.scale,1,1e-4)||isNaN(t.scale))&&(t.scale=1),t.translate=lo(n.min,n.max,t.origin)-t.originPoint,(Zi(t.translate)||isNaN(t.translate))&&(t.translate=0)}function Qi(t,e,n,r){Ji(t.x,e.x,n.x,r?r.originX:void 0),Ji(t.y,e.y,n.y,r?r.originY:void 0)}function ts(t,e,n){t.min=n.min+e.min,t.max=t.min+Ki(e)}function es(t,e,n){t.min=e.min-n.min,t.max=t.min+Ki(e)}function ns(t,e,n){es(t.x,e.x,n.x),es(t.y,e.y,n.y)}function rs(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function os(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,r]=[r,n]),{min:n,max:r}}const is=.35;function ss(t,e,n){return{min:as(t,e),max:as(t,n)}}function as(t,e){return"number"==typeof t?t:t[e]||0}const ls=()=>({x:{translate:0,scale:1,origin:0,originPoint:0},y:{translate:0,scale:1,origin:0,originPoint:0}}),us=()=>({x:{min:0,max:0},y:{min:0,max:0}});function cs(t){return[t("x"),t("y")]}function ds({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function hs(t){return void 0===t||1===t}function ps({scale:t,scaleX:e,scaleY:n}){return!hs(t)||!hs(e)||!hs(n)}function fs(t){return ps(t)||ms(t)||t.z||t.rotate||t.rotateX||t.rotateY}function ms(t){return gs(t.x)||gs(t.y)}function gs(t){return t&&"0%"!==t}function ys(t,e,n){return n+e*(t-n)}function vs(t,e,n,r,o){return void 0!==o&&(t=ys(t,o,r)),ys(t,n,r)+e}function ws(t,e=0,n=1,r,o){t.min=vs(t.min,e,n,r,o),t.max=vs(t.max,e,n,r,o)}function bs(t,{x:e,y:n}){ws(t.x,e.translate,e.scale,e.originPoint),ws(t.y,n.translate,n.scale,n.originPoint)}function xs(t){return Number.isInteger(t)||t>1.0000000000001||t<.999999999999?t:1}function Es(t,e){t.min=t.min+e,t.max=t.max+e}function Ss(t,e,[n,r,o]){const i=void 0!==e[o]?e[o]:.5,s=lo(t.min,t.max,i);ws(t,e[n],e[r],s,e.scale)}const Ps=["x","scaleX","originX"],Ts=["y","scaleY","originY"];function Cs(t,e){Ss(t.x,e,Ps),Ss(t.y,e,Ts)}function As(t,e){return ds(function(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}(t.getBoundingClientRect(),e))}const Ds=new WeakMap;class ks{constructor(t){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=us(),this.visualElement=t}start(t,{snapToCursor:e=!1}={}){const{presenceContext:n}=this.visualElement;n&&!1===n.isPresent||(this.panSession=new Hi(t,{onSessionStart:t=>{this.stopAnimation(),e&&this.snapToCursor(ar(t,"page").point)},onStart:(t,e)=>{const{drag:n,dragPropagation:r,onDragStart:o}=this.getProps();if(n&&!r&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=mr(n),!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),cs((t=>{let e=this.getAxisMotionValue(t).get()||0;if(pn.test(e)){const{projection:n}=this.visualElement;if(n&&n.layout){const r=n.layout.layoutBox[t];r&&(e=Ki(r)*(parseFloat(e)/100))}}this.originPoint[t]=e})),o&&Qn.update((()=>o(t,e)),!1,!0);const{animationState:i}=this.visualElement;i&&i.setActive("whileDrag",!0)},onMove:(t,e)=>{const{dragPropagation:n,dragDirectionLock:r,onDirectionLock:o,onDrag:i}=this.getProps();if(!n&&!this.openGlobalLock)return;const{offset:s}=e;if(r&&null===this.currentDirection)return this.currentDirection=function(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}(s),void(null!==this.currentDirection&&o&&o(this.currentDirection));this.updateAxis("x",e.point,s),this.updateAxis("y",e.point,s),this.visualElement.render(),i&&i(t,e)},onSessionEnd:(t,e)=>this.stop(t,e)},{transformPagePoint:this.visualElement.getTransformPagePoint()}))}stop(t,e){const n=this.isDragging;if(this.cancel(),!n)return;const{velocity:r}=e;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&Qn.update((()=>o(t,e)))}cancel(){this.isDragging=!1;const{projection:t,animationState:e}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:n}=this.getProps();!n&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),e&&e.setActive("whileDrag",!1)}updateAxis(t,e,n){const{drag:r}=this.getProps();if(!n||!Ls(t,r,this.currentDirection))return;const o=this.getAxisMotionValue(t);let i=this.originPoint[t]+n[t];this.constraints&&this.constraints[t]&&(i=function(t,{min:e,max:n},r){return void 0!==e&&t<e?t=r?lo(e,t,r.min):Math.max(t,e):void 0!==n&&t>n&&(t=r?lo(n,t,r.max):Math.min(t,n)),t}(i,this.constraints[t],this.elastic[t])),o.set(i)}resolveConstraints(){const{dragConstraints:t,dragElastic:e}=this.getProps(),{layout:n}=this.visualElement.projection||{},r=this.constraints;t&&Ce(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):this.constraints=!(!t||!n)&&function(t,{top:e,left:n,bottom:r,right:o}){return{x:rs(t.x,n,o),y:rs(t.y,e,r)}}(n.layoutBox,t),this.elastic=function(t=is){return!1===t?t=0:!0===t&&(t=is),{x:ss(t,"left","right"),y:ss(t,"top","bottom")}}(e),r!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&cs((t=>{this.getAxisMotionValue(t)&&(this.constraints[t]=function(t,e){const n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(n.layoutBox[t],this.constraints[t]))}))}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:e}=this.getProps();if(!t||!Ce(t))return!1;const n=t.current;Or(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 o=function(t,e,n){const r=As(t,n),{scroll:o}=e;return o&&(Es(r.x,o.offset.x),Es(r.y,o.offset.y)),r}(n,r.root,this.visualElement.getTransformPagePoint());let i=function(t,e){return{x:os(t.x,e.x),y:os(t.y,e.y)}}(r.layout.layoutBox,o);if(e){const t=e(function({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}(i));this.hasMutatedConstraints=!!t,t&&(i=ds(t))}return i}startAnimation(t){const{drag:e,dragMomentum:n,dragElastic:r,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:s}=this.getProps(),a=this.constraints||{},l=cs((s=>{if(!Ls(s,e,this.currentDirection))return;let l=a&&a[s]||{};i&&(l={min:0,max:0});const u=r?200:1e6,c=r?40:1e7,d={type:"inertia",velocity:n?t[s]:0,bounceStiffness:u,bounceDamping:c,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(s,d)}));return Promise.all(l).then(s)}startAxisValueAnimation(t,e){const n=this.getAxisMotionValue(t);return n.start(gi(t,n,0,e))}stopAnimation(){cs((t=>this.getAxisMotionValue(t).stop()))}getAxisMotionValue(t){const e="_drag"+t.toUpperCase(),n=this.visualElement.getProps();return n[e]||this.visualElement.getValue(t,(n.initial?n.initial[t]:void 0)||0)}snapToCursor(t){cs((e=>{const{drag:n}=this.getProps();if(!Ls(e,n,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(e);if(r&&r.layout){const{min:n,max:i}=r.layout.layoutBox[e];o.set(t[e]-lo(n,i,.5))}}))}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:e}=this.getProps(),{projection:n}=this.visualElement;if(!Ce(e)||!n||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};cs((t=>{const e=this.getAxisMotionValue(t);if(e){const n=e.get();r[t]=function(t,e){let n=.5;const r=Ki(t),o=Ki(e);return o>r?n=ko(e.min,e.max-r,t.min):r>o&&(n=ko(t.min,t.max-o,e.min)),en(0,1,n)}({min:n,max:n},this.constraints[t])}}));const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",n.root&&n.root.updateScroll(),n.updateLayout(),this.resolveConstraints(),cs((e=>{if(!Ls(e,t,null))return;const n=this.getAxisMotionValue(e),{min:o,max:i}=this.constraints[e];n.set(lo(o,i,r[e]))}))}addListeners(){if(!this.visualElement.current)return;Ds.set(this.visualElement,this);const t=ur(this.visualElement.current,"pointerdown",(t=>{const{drag:e,dragListener:n=!0}=this.getProps();e&&n&&this.start(t)})),e=()=>{const{dragConstraints:t}=this.getProps();Ce(t)&&(this.constraints=this.resolveRefConstraints())},{projection:n}=this.visualElement,r=n.addEventListener("measure",e);n&&!n.layout&&(n.root&&n.root.updateScroll(),n.updateLayout()),e();const o=ir(window,"resize",(()=>this.scalePositionWithinConstraints())),i=n.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e})=>{this.isDragging&&e&&(cs((e=>{const n=this.getAxisMotionValue(e);n&&(this.originPoint[e]+=t[e].translate,n.set(n.get()+t[e].translate))})),this.visualElement.render())}));return()=>{o(),t(),r(),i&&i()}}getProps(){const t=this.visualElement.getProps(),{drag:e=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:i=is,dragMomentum:s=!0}=t;return{...t,drag:e,dragDirectionLock:n,dragPropagation:r,dragConstraints:o,dragElastic:i,dragMomentum:s}}}function Ls(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}const Os=t=>(e,n)=>{t&&Qn.update((()=>t(e,n)))},Vs={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Rs(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Ms={correct:(t,e)=>{if(!e.target)return t;if("string"==typeof t){if(!fn.test(t))return t;t=parseFloat(t)}return`${Rs(t,e.target.x)}% ${Rs(t,e.target.y)}%`}},Fs={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,o=So.parse(t);if(o.length>5)return r;const i=So.createTransformer(t),s="number"!=typeof o[0]?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;o[0+s]/=a,o[1+s]/=l;const u=lo(a,l,.5);return"number"==typeof o[2+s]&&(o[2+s]/=u),"number"==typeof o[3+s]&&(o[3+s]/=u),i(o)}};class js extends a.Component{componentDidMount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n,layoutId:r}=this.props,{projection:o}=t;var i;i=Is,Object.assign(ze,i),o&&(e.group&&e.group.add(o),n&&n.register&&r&&n.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",(()=>{this.safeToRemove()})),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),Vs.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:e,visualElement:n,drag:r,isPresent:o}=this.props,i=n.projection;return i?(i.isPresent=o,r||t.layoutDependency!==e||void 0===e?i.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?i.promote():i.relegate()||Qn.postRender((()=>{const t=i.getStack();t&&t.members.length||this.safeToRemove()}))),null):null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),queueMicrotask((()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()})))}componentWillUnmount(){const{visualElement:t,layoutGroup:e,switchLayoutGroup:n}=this.props,{projection:r}=t;r&&(r.scheduleCheckAfterUnmount(),e&&e.group&&e.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ns(t){const[e,n]=function(){const t=(0,a.useContext)(Ee);if(null===t)return[!0,null];const{isPresent:e,onExitComplete:n,register:r}=t,o=(0,a.useId)();return(0,a.useEffect)((()=>r(o)),[]),!e&&n?[!1,()=>n&&n(o)]:[!0]}(),r=(0,a.useContext)(je);return a.createElement(js,{...t,layoutGroup:r,switchLayoutGroup:(0,a.useContext)(Ne),isPresent:e,safeToRemove:n})}const Is={borderRadius:{...Ms,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Ms,borderTopRightRadius:Ms,borderBottomLeftRadius:Ms,borderBottomRightRadius:Ms,boxShadow:Fs},Bs=["TopLeft","TopRight","BottomLeft","BottomRight"],_s=Bs.length,Us=t=>"string"==typeof t?parseFloat(t):t,$s=t=>"number"==typeof t||fn.test(t);function Hs(t,e){return void 0!==t[e]?t[e]:t.borderRadius}const zs=qs(0,.5,Gr),Ws=qs(.5,.95,Kn);function qs(t,e,n){return r=>r<t?0:r>e?1:n(ko(t,e,r))}function Ys(t,e){t.min=e.min,t.max=e.max}function Gs(t,e){Ys(t.x,e.x),Ys(t.y,e.y)}function Xs(t,e,n,r,o){return t=ys(t-=e,1/n,r),void 0!==o&&(t=ys(t,1/o,r)),t}function Ks(t,e,[n,r,o],i,s){!function(t,e=0,n=1,r=.5,o,i=t,s=t){if(pn.test(e)&&(e=parseFloat(e),e=lo(s.min,s.max,e/100)-s.min),"number"!=typeof e)return;let a=lo(i.min,i.max,r);t===i&&(a-=e),t.min=Xs(t.min,e,n,a,o),t.max=Xs(t.max,e,n,a,o)}(t,e[n],e[r],e[o],e.scale,i,s)}const Zs=["x","scaleX","originX"],Js=["y","scaleY","originY"];function Qs(t,e,n,r){Ks(t.x,e,Zs,n?n.x:void 0,r?r.x:void 0),Ks(t.y,e,Js,n?n.y:void 0,r?r.y:void 0)}function ta(t){return 0===t.translate&&1===t.scale}function ea(t){return ta(t.x)&&ta(t.y)}function na(t,e){return Math.round(t.x.min)===Math.round(e.x.min)&&Math.round(t.x.max)===Math.round(e.x.max)&&Math.round(t.y.min)===Math.round(e.y.min)&&Math.round(t.y.max)===Math.round(e.y.max)}function ra(t){return Ki(t.x)/Ki(t.y)}class oa{constructor(){this.members=[]}add(t){wi(this.members,t),t.scheduleRender()}remove(t){if(bi(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(t){const e=this.members.findIndex((e=>t===e));if(0===e)return!1;let n;for(let t=e;t>=0;t--){const e=this.members[t];if(!1!==e.isPresent){n=e;break}}return!!n&&(this.promote(n),!0)}promote(t,e){const n=this.lead;if(t!==n&&(this.prevLead=n,this.lead=t,t.show(),n)){n.instance&&n.scheduleRender(),t.scheduleRender(),t.resumeFrom=n,e&&(t.resumeFrom.preserveOpacity=!0),n.snapshot&&(t.snapshot=n.snapshot,t.snapshot.latestValues=n.animationValues||n.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:r}=t.options;!1===r&&n.hide()}}exitAnimationComplete(){this.members.forEach((t=>{const{options:e,resumingFrom:n}=t;e.onExitComplete&&e.onExitComplete(),n&&n.options.onExitComplete&&n.options.onExitComplete()}))}scheduleRender(){this.members.forEach((t=>{t.instance&&t.scheduleRender(!1)}))}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function ia(t,e,n){let r="";const o=t.x.translate/e.x,i=t.y.translate/e.y;if((o||i)&&(r=`translate3d(${o}px, ${i}px, 0) `),1===e.x&&1===e.y||(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{rotate:t,rotateX:e,rotateY:o}=n;t&&(r+=`rotate(${t}deg) `),e&&(r+=`rotateX(${e}deg) `),o&&(r+=`rotateY(${o}deg) `)}const s=t.x.scale*e.x,a=t.y.scale*e.y;return 1===s&&1===a||(r+=`scale(${s}, ${a})`),r||"none"}const sa=(t,e)=>t.depth-e.depth;class aa{constructor(){this.children=[],this.isDirty=!1}add(t){wi(this.children,t),this.isDirty=!0}remove(t){bi(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(sa),this.isDirty=!1,this.children.forEach(t)}}const la=["","X","Y","Z"];let ua=0;const ca={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0};function da({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:o}){return class{constructor(t={},n=(null==e?void 0:e())){this.id=ua++,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.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{var t;ca.totalNodes=ca.resolvedTargetDeltas=ca.recalculatedProjection=0,this.nodes.forEach(fa),this.nodes.forEach(xa),this.nodes.forEach(Ea),this.nodes.forEach(ma),t=ca,window.MotionDebug&&window.MotionDebug.record(t)},this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=t,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 t=0;t<this.path.length;t++)this.path[t].shouldResetTransform=!0;this.root===this&&(this.nodes=new aa)}addEventListener(t,e){return this.eventHandlers.has(t)||this.eventHandlers.set(t,new xi),this.eventHandlers.get(t).add(e)}notifyListeners(t,...e){const n=this.eventHandlers.get(t);n&&n.notify(...e)}hasListeners(t){return this.eventHandlers.has(t)}mount(e,n=this.root.hasTreeAnimated){if(this.instance)return;var r;this.isSVG=(r=e)instanceof SVGElement&&"svg"!==r.tagName,this.instance=e;const{layoutId:o,layout:i,visualElement:s}=this.options;if(s&&!s.current&&s.mount(e),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),n&&(i||o)&&(this.isLayoutDirty=!0),t){let n;const r=()=>this.root.updateBlockedByResize=!1;t(e,(()=>{this.root.updateBlockedByResize=!0,n&&n(),n=function(t,e){const n=performance.now(),r=({timestamp:e})=>{const o=e-n;o>=250&&(tr(r),t(o-250))};return Qn.read(r,!0),()=>tr(r)}(r),Vs.hasAnimatedSinceResize&&(Vs.hasAnimatedSinceResize=!1,this.nodes.forEach(ba))}))}o&&this.root.registerSharedNode(o,this),!1!==this.options.animate&&s&&(o||i)&&this.addEventListener("didUpdate",(({delta:t,hasLayoutChanged:e,hasRelativeTargetChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked())return this.target=void 0,void(this.relativeTarget=void 0);const o=this.options.transition||s.getDefaultTransition()||Da,{onLayoutAnimationStart:i,onLayoutAnimationComplete:a}=s.getProps(),l=!this.targetLayout||!na(this.targetLayout,r)||n,u=!e&&n;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||e&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(t,u);const e={...mi(o,"layout"),onPlay:i,onComplete:a};(s.shouldReduceMotion||this.options.layoutRoot)&&(e.delay=0,e.type=!1),this.startAnimation(e)}else e||ba(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r}))}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const t=this.getStack();t&&t.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,tr(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(Sa),this.animationId++)}getTransformTemplate(){const{visualElement:t}=this.options;return t&&t.getProps().transformTemplate}willUpdate(t=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked())return void(this.options.onExitComplete&&this.options.onExitComplete());if(!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let t=0;t<this.path.length;t++){const e=this.path[t];e.shouldResetTransform=!0,e.updateScroll("snapshot"),e.options.layoutRoot&&e.willUpdate(!1)}const{layoutId:e,layout:n}=this.options;if(void 0===e&&!n)return;const r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,""):void 0,this.updateSnapshot(),t&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked())return this.unblockUpdate(),this.clearAllSnapshots(),void this.nodes.forEach(ya);this.isUpdating||this.nodes.forEach(va),this.isUpdating=!1,this.nodes.forEach(wa),this.nodes.forEach(ha),this.nodes.forEach(pa),this.clearAllSnapshots();const t=performance.now();er.delta=en(0,1e3/60,t-er.timestamp),er.timestamp=t,er.isProcessing=!0,nr.update.process(er),nr.preRender.process(er),nr.render.process(er),er.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,queueMicrotask((()=>this.update())))}clearAllSnapshots(){this.nodes.forEach(ga),this.sharedNodes.forEach(Pa)}scheduleUpdateProjection(){Qn.preRender(this.updateProjection,!1,!0)}scheduleCheckAfterUnmount(){Qn.postRender((()=>{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 t=0;t<this.path.length;t++)this.path[t].updateScroll();const t=this.layout;this.layout=this.measure(!1),this.layoutCorrected=us(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:e}=this.options;e&&e.notify("LayoutMeasure",this.layout.layoutBox,t?t.layoutBox:void 0)}updateScroll(t="measure"){let e=Boolean(this.options.layoutScroll&&this.instance);this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===t&&(e=!1),e&&(this.scroll={animationId:this.root.animationId,phase:t,isRoot:r(this.instance),offset:n(this.instance)})}resetTransform(){if(!o)return;const t=this.isLayoutDirty||this.shouldResetTransform,e=this.projectionDelta&&!ea(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,""):void 0,i=r!==this.prevTransformTemplateValue;t&&(e||fs(this.latestValues)||i)&&(o(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(t=!0){const e=this.measurePageBox();let n=this.removeElementScroll(e);var r;return t&&(n=this.removeTransform(n)),Oa((r=n).x),Oa(r.y),{animationId:this.root.animationId,measuredBox:e,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:t}=this.options;if(!t)return us();const e=t.measureViewportBox(),{scroll:n}=this.root;return n&&(Es(e.x,n.offset.x),Es(e.y,n.offset.y)),e}removeElementScroll(t){const e=us();Gs(e,t);for(let n=0;n<this.path.length;n++){const r=this.path[n],{scroll:o,options:i}=r;if(r!==this.root&&o&&i.layoutScroll){if(o.isRoot){Gs(e,t);const{scroll:n}=this.root;n&&(Es(e.x,-n.offset.x),Es(e.y,-n.offset.y))}Es(e.x,o.offset.x),Es(e.y,o.offset.y)}}return e}applyTransform(t,e=!1){const n=us();Gs(n,t);for(let t=0;t<this.path.length;t++){const r=this.path[t];!e&&r.options.layoutScroll&&r.scroll&&r!==r.root&&Cs(n,{x:-r.scroll.offset.x,y:-r.scroll.offset.y}),fs(r.latestValues)&&Cs(n,r.latestValues)}return fs(this.latestValues)&&Cs(n,this.latestValues),n}removeTransform(t){const e=us();Gs(e,t);for(let t=0;t<this.path.length;t++){const n=this.path[t];if(!n.instance)continue;if(!fs(n.latestValues))continue;ps(n.latestValues)&&n.updateSnapshot();const r=us();Gs(r,n.measurePageBox()),Qs(e,n.latestValues,n.snapshot?n.snapshot.layoutBox:void 0,r)}return fs(this.latestValues)&&Qs(e,this.latestValues),e}setTargetDelta(t){this.targetDelta=t,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(t){this.options={...this.options,...t,crossfade:void 0===t.crossfade||t.crossfade}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==er.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(t=!1){var e;const n=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=n.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=n.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=n.isSharedProjectionDirty);const r=Boolean(this.resumingFrom)||this!==n;if(!(t||r&&this.isSharedProjectionDirty||this.isProjectionDirty||(null===(e=this.parent)||void 0===e?void 0:e.isProjectionDirty)||this.attemptToResolveRelativeTarget))return;const{layout:o,layoutId:i}=this.options;if(this.layout&&(o||i)){if(this.resolvedRelativeTargetAt=er.timestamp,!this.targetDelta&&!this.relativeTarget){const t=this.getClosestProjectingParent();t&&t.layout&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=us(),this.relativeTargetOrigin=us(),ns(this.relativeTargetOrigin,this.layout.layoutBox,t.layout.layoutBox),Gs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(this.relativeTarget||this.targetDelta){var s,a,l;if(this.target||(this.target=us(),this.targetWithTransforms=us()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),s=this.target,a=this.relativeTarget,l=this.relativeParent.target,ts(s.x,a.x,l.x),ts(s.y,a.y,l.y)):this.targetDelta?(Boolean(this.resumingFrom)?this.target=this.applyTransform(this.layout.layoutBox):Gs(this.target,this.layout.layoutBox),bs(this.target,this.targetDelta)):Gs(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const t=this.getClosestProjectingParent();t&&Boolean(t.resumingFrom)===Boolean(this.resumingFrom)&&!t.options.layoutScroll&&t.target&&1!==this.animationProgress?(this.relativeParent=t,this.forceRelativeParentToResolveTarget(),this.relativeTarget=us(),this.relativeTargetOrigin=us(),ns(this.relativeTargetOrigin,this.target,t.target),Gs(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}ca.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(this.parent&&!ps(this.parent.latestValues)&&!ms(this.parent.latestValues))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return Boolean((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var t;const e=this.getLead(),n=Boolean(this.resumingFrom)||this!==e;let r=!0;if((this.isProjectionDirty||(null===(t=this.parent)||void 0===t?void 0:t.isProjectionDirty))&&(r=!1),n&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(r=!1),this.resolvedRelativeTargetAt===er.timestamp&&(r=!1),r)return;const{layout:o,layoutId:i}=this.options;if(this.isTreeAnimating=Boolean(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!o&&!i)return;Gs(this.layoutCorrected,this.layout.layoutBox);const s=this.treeScale.x,a=this.treeScale.y;!function(t,e,n,r=!1){const o=n.length;if(!o)return;let i,s;e.x=e.y=1;for(let a=0;a<o;a++){i=n[a],s=i.projectionDelta;const o=i.instance;o&&o.style&&"contents"===o.style.display||(r&&i.options.layoutScroll&&i.scroll&&i!==i.root&&Cs(t,{x:-i.scroll.offset.x,y:-i.scroll.offset.y}),s&&(e.x*=s.x.scale,e.y*=s.y.scale,bs(t,s)),r&&fs(i.latestValues)&&Cs(t,i.latestValues))}e.x=xs(e.x),e.y=xs(e.y)}(this.layoutCorrected,this.treeScale,this.path,n),!e.layout||e.target||1===this.treeScale.x&&1===this.treeScale.y||(e.target=e.layout.layoutBox);const{target:l}=e;if(!l)return void(this.projectionTransform&&(this.projectionDelta=ls(),this.projectionTransform="none",this.scheduleRender()));this.projectionDelta||(this.projectionDelta=ls(),this.projectionDeltaWithTransform=ls());const u=this.projectionTransform;Qi(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.projectionTransform=ia(this.projectionDelta,this.treeScale),this.projectionTransform===u&&this.treeScale.x===s&&this.treeScale.y===a||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),ca.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(t=!0){if(this.options.scheduleRender&&this.options.scheduleRender(),t){const t=this.getStack();t&&t.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}setAnimationOrigin(t,e=!1){const n=this.snapshot,r=n?n.latestValues:{},o={...this.latestValues},i=ls();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!e;const s=us(),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(Aa));let d;this.animationProgress=0,this.mixTargetDelta=e=>{const n=e/1e3;Ta(i.x,t.x,n),Ta(i.y,t.y,n),this.setTargetDelta(i),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(ns(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),function(t,e,n,r){Ca(t.x,e.x,n.x,r),Ca(t.y,e.y,n.y,r)}(this.relativeTarget,this.relativeTargetOrigin,s,n),d&&function(t,e){return t.x.min===e.x.min&&t.x.max===e.x.max&&t.y.min===e.y.min&&t.y.max===e.y.max}(this.relativeTarget,d)&&(this.isProjectionDirty=!1),d||(d=us()),Gs(d,this.relativeTarget)),a&&(this.animationValues=o,function(t,e,n,r,o,i){o?(t.opacity=lo(0,void 0!==n.opacity?n.opacity:1,zs(r)),t.opacityExit=lo(void 0!==e.opacity?e.opacity:1,0,Ws(r))):i&&(t.opacity=lo(void 0!==e.opacity?e.opacity:1,void 0!==n.opacity?n.opacity:1,r));for(let o=0;o<_s;o++){const i=`border${Bs[o]}Radius`;let s=Hs(e,i),a=Hs(n,i);void 0===s&&void 0===a||(s||(s=0),a||(a=0),0===s||0===a||$s(s)===$s(a)?(t[i]=Math.max(lo(Us(s),Us(a),r),0),(pn.test(a)||pn.test(s))&&(t[i]+="%")):t[i]=a)}(e.rotate||n.rotate)&&(t.rotate=lo(e.rotate||0,n.rotate||0,r))}(o,r,this.latestValues,n,c,u)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(t){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(tr(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qn.update((()=>{Vs.hasAnimatedSinceResize=!0,this.currentAnimation=function(t,e,n){const r=Ge(0)?0:Pi(0);return r.start(gi("",r,1e3,n)),r.animation}(0,0,{...t,onUpdate:e=>{this.mixTargetDelta(e),t.onUpdate&&t.onUpdate(e)},onComplete:()=>{t.onComplete&&t.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 t=this.getStack();t&&t.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 t=this.getLead();let{targetWithTransforms:e,target:n,layout:r,latestValues:o}=t;if(e&&n&&r){if(this!==t&&this.layout&&r&&Va(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||us();const e=Ki(this.layout.layoutBox.x);n.x.min=t.target.x.min,n.x.max=n.x.min+e;const r=Ki(this.layout.layoutBox.y);n.y.min=t.target.y.min,n.y.max=n.y.min+r}Gs(e,n),Cs(e,o),Qi(this.projectionDeltaWithTransform,this.layoutCorrected,e,o)}}registerSharedNode(t,e){this.sharedNodes.has(t)||this.sharedNodes.set(t,new oa),this.sharedNodes.get(t).add(e);const n=e.options.initialPromotionConfig;e.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(e):void 0})}isLead(){const t=this.getStack();return!t||t.lead===this}getLead(){var t;const{layoutId:e}=this.options;return e&&(null===(t=this.getStack())||void 0===t?void 0:t.lead)||this}getPrevLead(){var t;const{layoutId:e}=this.options;return e?null===(t=this.getStack())||void 0===t?void 0:t.prevLead:void 0}getStack(){const{layoutId:t}=this.options;if(t)return this.root.sharedNodes.get(t)}promote({needsReset:t,transition:e,preserveFollowOpacity:n}={}){const r=this.getStack();r&&r.promote(this,n),t&&(this.projectionDelta=void 0,this.needsReset=!0),e&&this.setOptions({transition:e})}relegate(){const t=this.getStack();return!!t&&t.relegate(this)}resetRotation(){const{visualElement:t}=this.options;if(!t)return;let e=!1;const{latestValues:n}=t;if((n.rotate||n.rotateX||n.rotateY||n.rotateZ)&&(e=!0),!e)return;const r={};for(let e=0;e<la.length;e++){const o="rotate"+la[e];n[o]&&(r[o]=n[o],t.setStaticValue(o,0))}t.render();for(const e in r)t.setStaticValue(e,r[e]);t.scheduleRender()}getProjectionStyles(t={}){var e,n;const r={};if(!this.instance||this.isSVG)return r;if(!this.isVisible)return{visibility:"hidden"};r.visibility="";const o=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,r.opacity="",r.pointerEvents=Yn(t.pointerEvents)||"",r.transform=o?o(this.latestValues,""):"none",r;const i=this.getLead();if(!this.projectionDelta||!this.layout||!i.target){const e={};return this.options.layoutId&&(e.opacity=void 0!==this.latestValues.opacity?this.latestValues.opacity:1,e.pointerEvents=Yn(t.pointerEvents)||""),this.hasProjected&&!fs(this.latestValues)&&(e.transform=o?o({},""):"none",this.hasProjected=!1),e}const s=i.animationValues||i.latestValues;this.applyTransformsToTarget(),r.transform=ia(this.projectionDeltaWithTransform,this.treeScale,s),o&&(r.transform=o(s,r.transform));const{x:a,y:l}=this.projectionDelta;r.transformOrigin=`${100*a.origin}% ${100*l.origin}% 0`,i.animationValues?r.opacity=i===this?null!==(n=null!==(e=s.opacity)&&void 0!==e?e:this.latestValues.opacity)&&void 0!==n?n:1:this.preserveOpacity?this.latestValues.opacity:s.opacityExit:r.opacity=i===this?void 0!==s.opacity?s.opacity:"":void 0!==s.opacityExit?s.opacityExit:0;for(const t in ze){if(void 0===s[t])continue;const{correct:e,applyTo:n}=ze[t],o="none"===r.transform?s[t]:e(s[t],i);if(n){const t=n.length;for(let e=0;e<t;e++)r[n[e]]=o}else r[t]=o}return this.options.layoutId&&(r.pointerEvents=i===this?Yn(t.pointerEvents)||"":"none"),r}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach((t=>{var e;return null===(e=t.currentAnimation)||void 0===e?void 0:e.stop()})),this.root.nodes.forEach(ya),this.root.sharedNodes.clear()}}}function ha(t){t.updateLayout()}function pa(t){var e;const n=(null===(e=t.resumeFrom)||void 0===e?void 0:e.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&n&&t.hasListeners("didUpdate")){const{layoutBox:e,measuredBox:r}=t.layout,{animationType:o}=t.options,i=n.source!==t.layout.source;"size"===o?cs((t=>{const r=i?n.measuredBox[t]:n.layoutBox[t],o=Ki(r);r.min=e[t].min,r.max=r.min+o})):Va(o,n.layoutBox,e)&&cs((r=>{const o=i?n.measuredBox[r]:n.layoutBox[r],s=Ki(e[r]);o.max=o.min+s,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[r].max=t.relativeTarget[r].min+s)}));const s=ls();Qi(s,e,n.layoutBox);const a=ls();i?Qi(a,t.applyTransform(r,!0),n.measuredBox):Qi(a,e,n.layoutBox);const l=!ea(s);let u=!1;if(!t.resumeFrom){const r=t.getClosestProjectingParent();if(r&&!r.resumeFrom){const{snapshot:o,layout:i}=r;if(o&&i){const s=us();ns(s,n.layoutBox,o.layoutBox);const a=us();ns(a,e,i.layoutBox),na(s,a)||(u=!0),r.options.layoutRoot&&(t.relativeTarget=a,t.relativeTargetOrigin=s,t.relativeParent=r)}}}t.notifyListeners("didUpdate",{layout:e,snapshot:n,delta:a,layoutDelta:s,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(t.isLead()){const{onExitComplete:e}=t.options;e&&e()}t.options.transition=void 0}function fa(t){ca.totalNodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=Boolean(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function ma(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function ga(t){t.clearSnapshot()}function ya(t){t.clearMeasurements()}function va(t){t.isLayoutDirty=!1}function wa(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function ba(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function xa(t){t.resolveTargetDelta()}function Ea(t){t.calcProjection()}function Sa(t){t.resetRotation()}function Pa(t){t.removeLeadSnapshot()}function Ta(t,e,n){t.translate=lo(e.translate,0,n),t.scale=lo(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Ca(t,e,n,r){t.min=lo(e.min,n.min,r),t.max=lo(e.max,n.max,r)}function Aa(t){return t.animationValues&&void 0!==t.animationValues.opacityExit}const Da={duration:.45,ease:[.4,0,.1,1]},ka=t=>"undefined"!=typeof navigator&&navigator.userAgent.toLowerCase().includes(t),La=ka("applewebkit/")&&!ka("chrome/")?Math.round:Kn;function Oa(t){t.min=La(t.min),t.max=La(t.max)}function Va(t,e,n){return"position"===t||"preserve-aspect"===t&&!Zi(ra(e),ra(n),.2)}const Ra=da({attachResizeListener:(t,e)=>ir(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),Ma={current:void 0},Fa=da({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!Ma.current){const t=new Ra({});t.mount(window),t.setOptions({layoutScroll:!0}),Ma.current=t}return Ma.current},resetTransform:(t,e)=>{t.style.transform=void 0!==e?e:"none"},checkIsScrollRoot:t=>Boolean("fixed"===window.getComputedStyle(t).position)}),ja={pan:{Feature:class extends yr{constructor(){super(...arguments),this.removePointerDownListener=Kn}onPointerDown(t){this.session=new Hi(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint()})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:e,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:Os(t),onStart:Os(e),onMove:n,onEnd:(t,e)=>{delete this.session,r&&Qn.update((()=>r(t,e)))}}}mount(){this.removePointerDownListener=ur(this.node.current,"pointerdown",(t=>this.onPointerDown(t)))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}},drag:{Feature:class extends yr{constructor(t){super(t),this.removeGroupControls=Kn,this.removeListeners=Kn,this.controls=new ks(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Kn}unmount(){this.removeGroupControls(),this.removeListeners()}},ProjectionNode:Fa,MeasureLayout:Ns}},Na=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function Ia(t,e,n=1){Or(n<=4,`Max CSS variable fallback depth detected in property "${t}". This may indicate a circular fallback dependency.`);const[r,o]=function(t){const e=Na.exec(t);if(!e)return[,];const[,n,r]=e;return[n,r]}(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const t=i.trim();return vi(t)?parseFloat(t):t}return Qe(o)?Ia(o,e,n+1):o}const Ba=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),_a=t=>Ba.has(t),Ua=t=>t===nn||t===fn,$a=(t,e)=>parseFloat(t.split(", ")[e]),Ha=(t,e)=>(n,{transform:r})=>{if("none"===r||!r)return 0;const o=r.match(/^matrix3d\((.+)\)$/);if(o)return $a(o[1],e);{const e=r.match(/^matrix\((.+)\)$/);return e?$a(e[1],t):0}},za=new Set(["x","y","z"]),Wa=We.filter((t=>!za.has(t))),qa={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:Ha(4,13),y:Ha(5,14)};qa.translateX=qa.x,qa.translateY=qa.y;function Ya(t,e,n,r){return(t=>Object.keys(t).some(_a))(e)?((t,e,n={},r={})=>{e={...e},r={...r};const o=Object.keys(e).filter(_a);let i=[],s=!1;const a=[];if(o.forEach((o=>{const l=t.getValue(o);if(!t.hasValue(o))return;let u=n[o],c=Ai(u);const d=e[o];let h;if(zn(d)){const t=d.length,e=null===d[0]?1:0;u=d[e],c=Ai(u);for(let n=e;n<t&&null!==d[n];n++)h?Or(Ai(d[n])===h,"All keyframes must be of the same type"):(h=Ai(d[n]),Or(h===c||Ua(c)&&Ua(h),"Keyframes must be of the same dimension as the current value"))}else h=Ai(d);if(c!==h)if(Ua(c)&&Ua(h)){const t=l.get();"string"==typeof t&&l.set(parseFloat(t)),"string"==typeof d?e[o]=parseFloat(d):Array.isArray(d)&&h===fn&&(e[o]=d.map(parseFloat))}else(null==c?void 0:c.transform)&&(null==h?void 0:h.transform)&&(0===u||0===d)?0===u?l.set(h.transform(u)):e[o]=c.transform(d):(s||(i=function(t){const e=[];return Wa.forEach((n=>{const r=t.getValue(n);void 0!==r&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))})),e.length&&t.render(),e}(t),s=!0),a.push(o),r[o]=void 0!==r[o]?r[o]:e[o],l.jump(d))})),a.length){const n=a.indexOf("height")>=0?window.pageYOffset:null,o=((t,e,n)=>{const r=e.measureViewportBox(),o=e.current,i=getComputedStyle(o),{display:s}=i,a={};"none"===s&&e.setStaticValue("display",t.display||"block"),n.forEach((t=>{a[t]=qa[t](r,i)})),e.render();const l=e.measureViewportBox();return n.forEach((n=>{const r=e.getValue(n);r&&r.jump(a[n]),t[n]=qa[n](l,i)})),t})(e,t,a);return i.length&&i.forEach((([e,n])=>{t.getValue(e).set(n)})),t.render(),Se&&null!==n&&window.scrollTo({top:n}),{target:o,transitionEnd:r}}return{target:e,transitionEnd:r}})(t,e,n,r):{target:e,transitionEnd:r}}const Ga={current:null},Xa={current:!1},Ka=new WeakMap,Za=Object.keys(Fe),Ja=Za.length,Qa=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],tl=Le.length;class el{constructor({parent:t,props:e,presenceContext:n,reducedMotionConfig:r,visualState:o},i={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.scheduleRender=()=>Qn.render(this.render,!1,!0);const{latestValues:s,renderState:a}=o;this.latestValues=s,this.baseTarget={...s},this.initialValues=e.initial?{...s}:{},this.renderState=a,this.parent=t,this.props=e,this.presenceContext=n,this.depth=t?t.depth+1:0,this.reducedMotionConfig=r,this.options=i,this.isControllingVariants=Oe(e),this.isVariantNode=Ve(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=Boolean(t&&t.current);const{willChange:l,...u}=this.scrapeMotionValuesFromProps(e,{});for(const t in u){const e=u[t];void 0!==s[t]&&Ge(e)&&(e.set(s[t],!1),yi(l)&&l.add(t))}}scrapeMotionValuesFromProps(t,e){return{}}mount(t){this.current=t,Ka.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach(((t,e)=>this.bindToMotionValue(e,t))),Xa.current||function(){if(Xa.current=!0,Se)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Ga.current=t.matches;t.addListener(e),e()}else Ga.current=!1}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||Ga.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){Ka.delete(this.current),this.projection&&this.projection.unmount(),tr(this.notifyUpdate),tr(this.render),this.valueSubscriptions.forEach((t=>t())),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features)this.features[t].unmount();this.current=null}bindToMotionValue(t,e){const n=qe.has(t),r=e.on("change",(e=>{this.latestValues[t]=e,this.props.onUpdate&&Qn.update(this.notifyUpdate,!1,!0),n&&this.projection&&(this.projection.isTransformDirty=!0)})),o=e.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(t,(()=>{r(),o()}))}sortNodePosition(t){return this.current&&this.sortInstanceNodePosition&&this.type===t.type?this.sortInstanceNodePosition(this.current,t.current):0}loadFeatures({children:t,...e},n,r,o){let i,s;for(let t=0;t<Ja;t++){const n=Za[t],{isEnabled:r,Feature:o,ProjectionNode:a,MeasureLayout:l}=Fe[n];a&&(i=a),r(e)&&(!this.features[n]&&o&&(this.features[n]=new o(this)),l&&(s=l))}if(!this.projection&&i){this.projection=new i(this.latestValues,this.parent&&this.parent.projection);const{layoutId:t,layout:n,drag:r,dragConstraints:s,layoutScroll:a,layoutRoot:l}=e;this.projection.setOptions({layoutId:t,layout:n,alwaysMeasureLayout:Boolean(r)||s&&Ce(s),visualElement:this,scheduleRender:()=>this.scheduleRender(),animationType:"string"==typeof n?n:"both",initialPromotionConfig:o,layoutScroll:a,layoutRoot:l})}return s}updateFeatures(){for(const t in this.features){const e=this.features[t];e.isMounted?e.update():(e.mount(),e.isMounted=!0)}}triggerBuild(){this.build(this.renderState,this.latestValues,this.options,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):us()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}makeTargetAnimatable(t,e=!0){return this.makeTargetAnimatableFromInstance(t,this.props,e)}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let e=0;e<Qa.length;e++){const n=Qa[e];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);const r=t["on"+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=function(t,e,n){const{willChange:r}=e;for(const o in e){const i=e[o],s=n[o];if(Ge(i))t.addValue(o,i),yi(r)&&r.add(o);else if(Ge(s))t.addValue(o,Pi(i,{owner:t})),yi(r)&&r.remove(o);else if(s!==i)if(t.hasValue(o)){const e=t.getValue(o);!e.hasAnimated&&e.set(i)}else{const e=t.getStaticValue(o);t.addValue(o,Pi(void 0!==e?e:i,{owner:t}))}}for(const r in n)void 0===e[r]&&t.removeValue(r);return e}(this,this.scrapeMotionValuesFromProps(t,this.prevProps),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}getVariantContext(t=!1){if(t)return this.parent?this.parent.getVariantContext():void 0;if(!this.isControllingVariants){const t=this.parent&&this.parent.getVariantContext()||{};return void 0!==this.props.initial&&(t.initial=this.props.initial),t}const e={};for(let t=0;t<tl;t++){const n=Le[t],r=this.props[n];(Ae(r)||!1===r)&&(e[n]=r)}return e}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){e!==this.values.get(t)&&(this.removeValue(t),this.bindToMotionValue(t,e)),this.values.set(t,e),this.latestValues[t]=e.get()}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let n=this.values.get(t);return void 0===n&&void 0!==e&&(n=Pi(e,{owner:this}),this.addValue(t,n)),n}readValue(t){var e;return void 0===this.latestValues[t]&&this.current?null!==(e=this.getBaseTargetFromProps(this.props,t))&&void 0!==e?e:this.readValueFromInstance(this.current,t,this.options):this.latestValues[t]}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:n}=this.props,r="string"==typeof n||"object"==typeof n?null===(e=Hn(this.props,n))||void 0===e?void 0:e[t]:void 0;if(n&&void 0!==r)return r;const o=this.getBaseTargetFromProps(this.props,t);return void 0===o||Ge(o)?void 0!==this.initialValues[t]&&void 0===r?void 0:this.baseTarget[t]:o}on(t,e){return this.events[t]||(this.events[t]=new xi),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class nl extends el{sortInstanceNodePosition(t,e){return 2&t.compareDocumentPosition(e)?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:n}){delete e[t],delete n[t]}makeTargetAnimatableFromInstance({transition:t,transitionEnd:e,...n},{transformValues:r},o){let i=function(t,e,n){const r={};for(const o in t){const t=Oi(o,e);if(void 0!==t)r[o]=t;else{const t=n.getValue(o);t&&(r[o]=t.get())}}return r}(n,t||{},this);if(r&&(e&&(e=r(e)),n&&(n=r(n)),i&&(i=r(i))),o){!function(t,e,n){var r,o;const i=Object.keys(e).filter((e=>!t.hasValue(e))),s=i.length;if(s)for(let a=0;a<s;a++){const s=i[a],l=e[s];let u=null;Array.isArray(l)&&(u=l[0]),null===u&&(u=null!==(o=null!==(r=n[s])&&void 0!==r?r:t.readValue(s))&&void 0!==o?o:e[s]),null!=u&&("string"==typeof u&&(vi(u)||pi(u))?u=parseFloat(u):!ki(u)&&So.test(l)&&(u=hi(s,l)),t.addValue(s,Pi(u,{owner:t})),void 0===n[s]&&(n[s]=u),null!==u&&t.setBaseTarget(s,u))}}(this,n,i);const t=((t,e,n,r)=>{const o=function(t,{...e},n){const r=t.current;if(!(r instanceof Element))return{target:e,transitionEnd:n};n&&(n={...n}),t.values.forEach((t=>{const e=t.get();if(!Qe(e))return;const n=Ia(e,r);n&&t.set(n)}));for(const t in e){const o=e[t];if(!Qe(o))continue;const i=Ia(o,r);i&&(e[t]=i,n||(n={}),void 0===n[t]&&(n[t]=o))}return{target:e,transitionEnd:n}}(t,e,r);return Ya(t,e=o.target,n,r=o.transitionEnd)})(this,n,i,e);e=t.transitionEnd,n=t.target}return{transition:t,transitionEnd:e,...n}}}class rl extends nl{readValueFromInstance(t,e){if(qe.has(e)){const t=di(e);return t&&t.default||0}{const r=(n=t,window.getComputedStyle(n)),o=(Je(e)?r.getPropertyValue(e):r[e])||0;return"string"==typeof o?o.trim():o}var n}measureInstanceViewportBox(t,{transformPagePoint:e}){return As(t,e)}build(t,e,n,r){bn(t,e,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,e){return Un(t,e)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Ge(t)&&(this.childSubscription=t.on("change",(t=>{this.current&&(this.current.textContent=`${t}`)})))}renderInstance(t,e,n,r){Nn(t,e,n,r)}}class ol extends nl{constructor(){super(...arguments),this.isSVGTag=!1}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(qe.has(e)){const t=di(e);return t&&t.default||0}return e=In.has(e)?e:jn(e),t.getAttribute(e)}measureInstanceViewportBox(){return us()}scrapeMotionValuesFromProps(t,e){return $n(t,e)}build(t,e,n,r){On(t,e,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,e,n,r){Bn(t,e,0,r)}mount(t){this.isSVGTag=Rn(t.tagName),super.mount(t)}}const il=(t,e)=>He(t)?new ol(e,{enableHardwareAcceleration:!1}):new rl(e,{enableHardwareAcceleration:!0}),sl={...Ui,...Cr,...ja,layout:{ProjectionNode:Fa,MeasureLayout:Ns}},al=Ue(((t,e)=>function(t,{forwardMotionProps:e=!1},n,r){return{...He(t)?rr:or,preloadedFeatures:n,useRender:Fn(e),createVisualElement:r,Component:t}}(t,e,sl,il)));var ll=window.wp.apiFetch,ul=o.n(ll);const cl="/extendify/v1/library/settings",dl={getItem:async()=>await ul()({path:cl}),setItem:async(t,e)=>await ul()({path:cl,method:"POST",data:{state:e}})},hl={siteType:{},category:"",totalImports:0},pl=f(b((t=>{var e;return{...hl,...null!==(e=window.extLibraryData?.siteInfo?.state)&&void 0!==e?e:{},setSiteType:async e=>{t({siteType:e}),await ul()({path:`${cl}/single`,method:"POST",data:{key:"extendify_siteType",value:e}})},setCategory:e=>t({category:e}),incrementImports:()=>t((t=>({totalImports:t.totalImports+1})))}}),{name:"extendify_library_site_data",storage:v((()=>dl)),skipHydration:!0})),fl={getItem:async()=>await ul()({path:"/wp/v2/users/me"}),setItem:async(t,e)=>await ul()({path:"/wp/v2/users/me",method:"PUT",data:{extendify_library_user:e}})},ml=f(b(((t,e)=>{var n;return{openOnNewPage:!0,updateUserOption:(n,r)=>{Object.keys(e()).includes(n)&&t({[n]:r})},...null!==(n=window.extLibraryData?.userInfo?.state)&&void 0!==n?n:{}}}),{name:"extendify_library_user",storage:v((()=>fl)),partialize:t=>({...t,ready:!1}),skipHydration:!0})),gl={"--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 yl=window.wp.components,vl=(Object.defineProperty,new Map),wl=new WeakMap,bl=0;function xl(t,e,n={},r=undefined){if(void 0===window.IntersectionObserver&&void 0!==r){const o=t.getBoundingClientRect();return e(r,{isIntersecting:r,target:t,intersectionRatio:"number"==typeof n.threshold?n.threshold:0,time:0,boundingClientRect:o,intersectionRect:o,rootBounds:o}),()=>{}}const{id:o,observer:i,elements:s}=function(t){let e=function(t){return Object.keys(t).sort().filter((e=>void 0!==t[e])).map((e=>{return`${e}_${"root"===e?(n=t.root,n?(wl.has(n)||(bl+=1,wl.set(n,bl.toString())),wl.get(n)):"0"):t[e]}`;var n})).toString()}(t),n=vl.get(e);if(!n){const r=new Map;let o;const i=new IntersectionObserver((e=>{e.forEach((e=>{var n;const i=e.isIntersecting&&o.some((t=>e.intersectionRatio>=t));t.trackVisibility&&void 0===e.isVisible&&(e.isVisible=i),null==(n=r.get(e.target))||n.forEach((t=>{t(i,e)}))}))}),t);o=i.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:i,elements:r},vl.set(e,n)}return n}(n);let a=s.get(t)||[];return s.has(t)||s.set(t,a),a.push(e),i.observe(t),function(){a.splice(a.indexOf(e),1),0===a.length&&(s.delete(t),i.unobserve(t)),0===s.size&&(i.disconnect(),vl.delete(o))}}function El(){return El=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},El.apply(this,arguments)}function Sl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function Pl(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?Sl(Object(n),!0).forEach((function(e){Tl(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Sl(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}function Tl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}a.Component;class Cl extends u().Component{constructor(t){let e;super(t),this.reCalculateColumnCount=this.reCalculateColumnCount.bind(this),this.reCalculateColumnCountDebounce=this.reCalculateColumnCountDebounce.bind(this),e=this.props.breakpointCols&&this.props.breakpointCols.default?this.props.breakpointCols.default:parseInt(this.props.breakpointCols)||2,this.state={columnCount:e}}componentDidMount(){this.reCalculateColumnCount(),window&&window.addEventListener("resize",this.reCalculateColumnCountDebounce)}componentDidUpdate(){this.reCalculateColumnCount()}componentWillUnmount(){window&&window.removeEventListener("resize",this.reCalculateColumnCountDebounce)}reCalculateColumnCountDebounce(){window&&window.requestAnimationFrame?(window.cancelAnimationFrame&&window.cancelAnimationFrame(this._lastRecalculateAnimationFrame),this._lastRecalculateAnimationFrame=window.requestAnimationFrame((()=>{this.reCalculateColumnCount()}))):this.reCalculateColumnCount()}reCalculateColumnCount(){const t=window&&window.innerWidth||1/0;let e=this.props.breakpointCols;"object"!=typeof e&&(e={default:parseInt(e)||2});let n=1/0,r=e.default||2;for(let o in e){const i=parseInt(o);i>0&&t<=i&&i<n&&(n=i,r=e[o])}r=Math.max(1,parseInt(r)||1),this.state.columnCount!==r&&this.setState({columnCount:r})}itemsInColumns(){const t=this.state.columnCount,e=new Array(t),n=u().Children.toArray(this.props.children);for(let r=0;r<n.length;r++){const o=r%t;e[o]||(e[o]=[]),e[o].push(n[r])}return e}renderColumns(){const{column:t,columnAttrs:e={},columnClassName:n}=this.props,r=this.itemsInColumns(),o=100/r.length+"%";let i=n;i&&"string"!=typeof i&&(this.logDeprecated('The property "columnClassName" requires a string'),void 0===i&&(i="my-masonry-grid_column"));const s=Pl(Pl(Pl({},t),e),{},{style:Pl(Pl({},e.style),{},{width:o}),className:i});return r.map(((t,e)=>u().createElement("div",El({},s,{key:e}),t)))}logDeprecated(t){console.error("[Masonry]",t)}render(){const t=this.props,{children:e,breakpointCols:n,columnClassName:r,columnAttrs:o,column:i,className:s}=t,a=function(t,e){if(null==t)return{};var n,r,o=function(t,e){if(null==t)return{};var n,r,o={},i=Object.keys(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||(o[n]=t[n]);return o}(t,e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(r=0;r<i.length;r++)n=i[r],e.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(t,n)&&(o[n]=t[n])}return o}(t,["children","breakpointCols","columnClassName","columnAttrs","column","className"]);let l=s;return"string"!=typeof s&&(this.logDeprecated('The property "className" requires a string'),void 0===s&&(l="my-masonry-grid")),u().createElement("div",El({},a,{className:l}),this.renderColumns())}}Cl.defaultProps={breakpointCols:void 0,className:void 0,columnClassName:void 0,children:void 0,columnAttrs:void 0,column:void 0};var Al=Cl,Dl=o(688);const kl=()=>{},Ll=kl(),Ol=Object,Vl=t=>t===Ll,Rl=t=>"function"==typeof t,Ml=(t,e)=>({...t,...e}),Fl=new WeakMap;let jl=0;const Nl=t=>{const e=typeof t,n=t&&t.constructor,r=n==Date;let o,i;if(Ol(t)!==t||r||n==RegExp)o=r?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(o=Fl.get(t),o)return o;if(o=++jl+"~",Fl.set(t,o),n==Array){for(o="@",i=0;i<t.length;i++)o+=Nl(t[i])+",";Fl.set(t,o)}if(n==Ol){o="#";const e=Ol.keys(t).sort();for(;!Vl(i=e.pop());)Vl(t[i])||(o+=i+":"+Nl(t[i])+",");Fl.set(t,o)}}return o},Il=new WeakMap,Bl={},_l={},Ul="undefined",$l=typeof window!=Ul,Hl=typeof document!=Ul,zl=(t,e)=>{const n=Il.get(t);return[()=>!Vl(e)&&t.get(e)||Bl,r=>{if(!Vl(e)){const o=t.get(e);e in _l||(_l[e]=o),n[5](e,Ml(o,r),o||Bl)}},n[6],()=>!Vl(e)&&e in _l?_l[e]:!Vl(e)&&t.get(e)||Bl]};let Wl=!0;const[ql,Yl]=$l&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[kl,kl],Gl={isOnline:()=>Wl,isVisible:()=>{const t=Hl&&document.visibilityState;return Vl(t)||"hidden"!==t}},Xl={initFocus:t=>(Hl&&document.addEventListener("visibilitychange",t),ql("focus",t),()=>{Hl&&document.removeEventListener("visibilitychange",t),Yl("focus",t)}),initReconnect:t=>{const e=()=>{Wl=!0,t()},n=()=>{Wl=!1};return ql("online",e),ql("offline",n),()=>{Yl("online",e),Yl("offline",n)}}},Kl=!a.useId,Zl=!$l||"Deno"in window,Jl=Zl?a.useEffect:a.useLayoutEffect,Ql="undefined"!=typeof navigator&&navigator.connection,tu=!Zl&&Ql&&(["slow-2g","2g"].includes(Ql.effectiveType)||Ql.saveData),eu=t=>{if(Rl(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?Nl(t):"",e]};let nu=0;const ru=()=>++nu;async function ou(...t){const[e,n,r,o]=t,i=Ml({populateCache:!0,throwOnError:!0},"boolean"==typeof o?{revalidate:o}:o||{});let s=i.populateCache;const a=i.rollbackOnError;let l=i.optimisticData;const u=!1!==i.revalidate,c=i.throwOnError;if(Rl(n)){const t=n,r=[],o=e.keys();for(const n of o)!/^\$(inf|sub)\$/.test(n)&&t(e.get(n)._k)&&r.push(n);return Promise.all(r.map(d))}return d(n);async function d(n){const[o]=eu(n);if(!o)return;const[i,d]=zl(e,o),[h,p,f,m]=Il.get(e),g=()=>{const t=h[o];return u&&(delete f[o],delete m[o],t&&t[0])?t[0](2).then((()=>i().data)):i().data};if(t.length<3)return g();let y,v=r;const w=ru();p[o]=[w,0];const b=!Vl(l),x=i(),E=x.data,S=x._c,P=Vl(S)?E:S;if(b&&(l=Rl(l)?l(P,E):l,d({data:l,_c:P})),Rl(v))try{v=v(P)}catch(t){y=t}if(v&&Rl(v.then)){if(v=await v.catch((t=>{y=t})),w!==p[o][0]){if(y)throw y;return v}y&&b&&(t=>"function"==typeof a?a(t):!1!==a)(y)&&(s=!0,d({data:P,_c:Ll}))}if(s&&!y)if(Rl(s)){const t=s(v,P);d({data:t,error:Ll,_c:Ll})}else d({data:v,error:Ll,_c:Ll});if(p[o][1]=ru(),Promise.resolve(g()).then((()=>{d({_c:Ll})})),!y)return v;if(c)throw y}}const iu=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},su=(t,e)=>{if(!Il.has(t)){const n=Ml(Xl,e),r={},o=ou.bind(Ll,t);let i=kl;const s={},a=(t,e)=>{const n=s[t]||[];return s[t]=n,n.push(e),()=>n.splice(n.indexOf(e),1)},l=(e,n,r)=>{t.set(e,n);const o=s[e];if(o)for(const t of o)t(n,r)},u=()=>{if(!Il.has(t)&&(Il.set(t,[r,{},{},{},o,l,a]),!Zl)){const e=n.initFocus(setTimeout.bind(Ll,iu.bind(Ll,r,0))),o=n.initReconnect(setTimeout.bind(Ll,iu.bind(Ll,r,1)));i=()=>{e&&e(),o&&o(),Il.delete(t)}}};return u(),[t,o,u,i]}return[t,Il.get(t)[4]]},[au,lu]=su(new Map),uu=Ml({onLoadingSlow:kl,onSuccess:kl,onError:kl,onErrorRetry:(t,__,e,n,r)=>{const o=e.errorRetryCount,i=r.retryCount,s=~~((Math.random()+.5)*(1<<(i<8?i:8)))*e.errorRetryInterval;!Vl(o)&&i>o||setTimeout(n,s,r)},onDiscarded:kl,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:tu?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:tu?5e3:3e3,compare:(t,e)=>Nl(t)==Nl(e),isPaused:()=>!1,cache:au,mutate:lu,fallback:{}},Gl),cu=(t,e)=>{const n=Ml(t,e);if(e){const{use:r,fallback:o}=t,{use:i,fallback:s}=e;r&&i&&(n.use=r.concat(i)),o&&s&&(n.fallback=Ml(o,s))}return n},du=(0,a.createContext)({}),hu="$inf$",pu=$l&&window.__SWR_DEVTOOLS_USE__,fu=pu?window.__SWR_DEVTOOLS_USE__:[],mu=t=>Rl(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}],gu=fu.concat((t=>(e,n,r)=>t(e,n&&((...t)=>{const[r]=eu(e),[,,,o]=Il.get(au);if(r.startsWith(hu))return n(...t);const i=o[r];return Vl(i)?n(...t):(delete o[r],i)}),r))),yu=(t,e)=>(...n)=>{const[r,o,i]=mu(n),s=(i.use||[]).concat(e);return t(r,o,{...i,use:s})};pu&&(window.__SWR_DEVTOOLS_REACT__=a);const vu=a.use||(t=>{if("pending"===t.status)throw t;if("fulfilled"===t.status)return t.value;throw"rejected"===t.status?t.reason:(t.status="pending",t.then((e=>{t.status="fulfilled",t.value=e}),(e=>{t.status="rejected",t.reason=e})),t)}),wu={dedupe:!0},bu=(Ol.defineProperty((t=>{const{value:e}=t,n=(0,a.useContext)(du),r=Rl(e),o=(0,a.useMemo)((()=>r?e(n):e),[r,n,e]),i=(0,a.useMemo)((()=>r?o:cu(n,o)),[r,n,o]),s=o&&o.provider,l=(0,a.useRef)(Ll);s&&!l.current&&(l.current=su(s(i.cache||au),o));const u=l.current;return u&&(i.cache=u[0],i.mutate=u[1]),Jl((()=>{if(u)return u[2]&&u[2](),u[3]}),[]),(0,a.createElement)(du.Provider,Ml(t,{value:i}))}),"defaultValue",{value:uu}),xu=(t,e,n)=>{const{cache:r,compare:o,suspense:i,fallbackData:s,revalidateOnMount:l,revalidateIfStale:u,refreshInterval:c,refreshWhenHidden:d,refreshWhenOffline:h,keepPreviousData:p}=n,[f,m,g,y]=Il.get(r),[v,w]=eu(t),b=(0,a.useRef)(!1),x=(0,a.useRef)(!1),E=(0,a.useRef)(v),S=(0,a.useRef)(e),P=(0,a.useRef)(n),T=()=>P.current,C=()=>T().isVisible()&&T().isOnline(),[A,D,k,L]=zl(r,v),O=(0,a.useRef)({}).current,V=Vl(s)?n.fallback[v]:s,R=(t,e)=>{for(const n in O){const r=n;if("data"===r){if(!o(t[r],e[r])){if(!Vl(t[r]))return!1;if(!o($,e[r]))return!1}}else if(e[r]!==t[r])return!1}return!0},M=(0,a.useMemo)((()=>{const t=!!v&&!!e&&(Vl(l)?!T().isPaused()&&!i&&(!!Vl(u)||u):l),n=e=>{const n=Ml(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n},r=A(),o=L(),s=n(r),a=r===o?s:n(o);let c=s;return[()=>{const t=n(A());return R(t,c)?(c.data=t.data,c.isLoading=t.isLoading,c.isValidating=t.isValidating,c.error=t.error,c):(c=t,t)},()=>a]}),[r,v]),F=(0,Dl.useSyncExternalStore)((0,a.useCallback)((t=>k(v,((e,n)=>{R(n,e)||t()}))),[r,v]),M[0],M[1]),j=!b.current,N=f[v]&&f[v].length>0,I=F.data,B=Vl(I)?V:I,_=F.error,U=(0,a.useRef)(B),$=p?Vl(I)?U.current:I:B,H=!(N&&!Vl(_))&&(j&&!Vl(l)?l:!T().isPaused()&&(i?!Vl(B)&&u:Vl(B)||u)),z=!!(v&&e&&j&&H),W=Vl(F.isValidating)?z:F.isValidating,q=Vl(F.isLoading)?z:F.isLoading,Y=(0,a.useCallback)((async t=>{const e=S.current;if(!v||!e||x.current||T().isPaused())return!1;let r,i,s=!0;const a=t||{},l=!g[v]||!a.dedupe,u=()=>Kl?!x.current&&v===E.current&&b.current:v===E.current,c={isValidating:!1,isLoading:!1},d=()=>{D(c)},h=()=>{const t=g[v];t&&t[1]===i&&delete g[v]},p={isValidating:!0};Vl(A().data)&&(p.isLoading=!0);try{if(l&&(D(p),n.loadingTimeout&&Vl(A().data)&&setTimeout((()=>{s&&u()&&T().onLoadingSlow(v,n)}),n.loadingTimeout),g[v]=[e(w),ru()]),[r,i]=g[v],r=await r,l&&setTimeout(h,n.dedupingInterval),!g[v]||g[v][1]!==i)return l&&u()&&T().onDiscarded(v),!1;c.error=Ll;const t=m[v];if(!Vl(t)&&(i<=t[0]||i<=t[1]||0===t[1]))return d(),l&&u()&&T().onDiscarded(v),!1;const a=A().data;c.data=o(a,r)?a:r,l&&u()&&T().onSuccess(r,v,n)}catch(t){h();const e=T(),{shouldRetryOnError:n}=e;e.isPaused()||(c.error=t,l&&u()&&(e.onError(t,v,e),(!0===n||Rl(n)&&n(t))&&C()&&e.onErrorRetry(t,v,e,(t=>{const e=f[v];e&&e[0]&&e[0](3,t)}),{retryCount:(a.retryCount||0)+1,dedupe:!0})))}return s=!1,d(),!0}),[v,r]),G=(0,a.useCallback)(((...t)=>ou(r,E.current,...t)),[]);if(Jl((()=>{S.current=e,P.current=n,Vl(I)||(U.current=I)})),Jl((()=>{if(!v)return;const t=Y.bind(Ll,wu);let e=0;const n=((t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const t=r.indexOf(n);t>=0&&(r[t]=r[r.length-1],r.pop())}})(v,f,((n,r={})=>{if(0==n){const n=Date.now();T().revalidateOnFocus&&n>e&&C()&&(e=n+T().focusThrottleInterval,t())}else if(1==n)T().revalidateOnReconnect&&C()&&t();else{if(2==n)return Y();if(3==n)return Y(r)}}));return x.current=!1,E.current=v,b.current=!0,D({_k:w}),H&&(Vl(B)||Zl?t():(t=>{$l&&typeof window.requestAnimationFrame!=Ul?window.requestAnimationFrame(t):setTimeout(t,1)})(t)),()=>{x.current=!0,n()}}),[v]),Jl((()=>{let t;function e(){const e=Rl(c)?c(A().data):c;e&&-1!==t&&(t=setTimeout(n,e))}function n(){A().error||!d&&!T().isVisible()||!h&&!T().isOnline()?e():Y(wu).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}}),[c,d,h,v]),(0,a.useDebugValue)($),i&&Vl(B)&&v){if(!Kl&&Zl)throw new Error("Fallback data is required when using suspense in SSR.");S.current=e,P.current=n,x.current=!1;const t=y[v];if(!Vl(t)){const e=G(t);vu(e)}if(!Vl(_))throw _;{const t=Y(wu);Vl($)||(t.status="fulfilled",t.value=!0),vu(t)}}return{mutate:G,get data(){return O.data=!0,$},get error(){return O.error=!0,_},get isValidating(){return O.isValidating=!0,W},get isLoading(){return O.isLoading=!0,q}}},function(...t){const e=Ml(uu,(0,a.useContext)(du)),[n,r,o]=mu(t),i=cu(e,o);let s=xu;const{use:l}=i,u=(l||[]).concat(gu);for(let t=u.length;t--;)s=u[t](s);return s(n,r||i.fetcher||null,i)});var xu;const Eu=Promise.resolve(),Su=yu(bu,(t=>(e,n,r)=>{const o=(0,a.useRef)(!1),{cache:i,initialSize:s=1,revalidateAll:l=!1,persistSize:u=!1,revalidateFirstPage:c=!0,revalidateOnMount:d=!1,parallel:h=!1}=r,[,,,p]=Il.get(au);let f;try{f=(t=>eu(t?t(0,null):null)[0])(e),f&&(f=hu+f)}catch(t){}const[m,g,y]=zl(i,f),v=(0,a.useCallback)((()=>Vl(m()._l)?s:m()._l),[i,f,s]);(0,Dl.useSyncExternalStore)((0,a.useCallback)((t=>f?y(f,(()=>{t()})):()=>{}),[i,f]),v,v);const w=(0,a.useCallback)((()=>{const t=m()._l;return Vl(t)?s:t}),[f,s]),b=(0,a.useRef)(w());Jl((()=>{o.current?f&&g({_l:u?b.current:w()}):o.current=!0}),[f,i]);const x=d&&!o.current,E=t(f,(async t=>{const o=m()._i,s=[],a=w(),[u]=zl(i,t),d=u().data,f=[];let y=null;for(let t=0;t<a;++t){const[a,u]=eu(e(t,h?null:y));if(!a)break;const[m,g]=zl(i,a);let v=m().data;const w=l||o||Vl(v)||c&&!t&&!Vl(d)||x||d&&!Vl(d[t])&&!r.compare(d[t],v);if(n&&w){const e=async()=>{if(a in p){const t=p[a];delete p[a],v=await t}else v=await n(u);g({data:v,_k:u}),s[t]=v};h?f.push(e):await e()}else s[t]=v;h||(y=v)}return h&&await Promise.all(f.map((t=>t()))),g({_i:Ll}),s}),r),S=(0,a.useCallback)((function(t,e){const n="boolean"==typeof e?{revalidate:e}:e||{},r=!1!==n.revalidate;return f?(r&&(Vl(t)?g({_i:!0}):g({_i:!1})),arguments.length?E.mutate(t,{...n,revalidate:r}):E.mutate()):Eu}),[f,i]),P=(0,a.useCallback)((t=>{if(!f)return Eu;const[,n]=zl(i,f);let r;if(Rl(t)?r=t(w()):"number"==typeof t&&(r=t),"number"!=typeof r)return Eu;n({_l:r}),b.current=r;const o=[],[s]=zl(i,f);let a=null;for(let t=0;t<r;++t){const[n]=eu(e(t,a)),[r]=zl(i,n),l=n?r().data:Ll;if(Vl(l))return S(s().data);o.push(l),a=l}return S(o)}),[f,i,S,w]);return{size:w(),setSize:P,mutate:S,get data(){return E.data},get error(){return E.error},get isValidating(){return E.isValidating},get isLoading(){return E.isLoading}}})),Pu="https://patterns.extendify.com",Tu=t=>fetch(t).then((t=>t.json()));var Cu=window.wp.blockEditor,Au=window.wp.blocks,Du=o(184),ku=o.n(Du),Lu=window.lodash;const Ou=(t,e=[])=>Array.from(e).some((e=>!!e.style&&Array.from(e.style).some((e=>e&&e.includes(t))))),Vu=new WeakMap,Ru=({insertPattern:e,code:r})=>{const[o,i]=(0,t.useState)(!1),s=(0,t.useRef)(),a=(0,t.useMemo)((()=>(0,Au.rawHandler)({HTML:Mu(r)})),[r]),{ready:l}=(({container:e,onIFrameLoaded:n,ready:r,loadDelay:o})=>{const i=(()=>{const e=(0,t.useRef)(!1);return(0,t.useEffect)((()=>(e.current=!0,()=>e.current=!1))),e})(),[s,a]=(0,t.useState)(0),[l,u]=(0,t.useState)(null),[c,d]=(0,t.useState)(!1),h=(0,t.useRef)(!1),{addMissingCSSVar:p}=x(),f=(0,t.useCallback)((t=>{if(!t?.contentDocument)return;const e=getComputedStyle(t.contentDocument.documentElement),n=t.contentDocument.styleSheets;for(let r in gl)e.getPropertyValue(r)||Array.from(n).filter((t=>{try{return t.cssRules}catch(t){return!1}})).some((t=>Ou(r,t.cssRules)))||(p(r),t.contentDocument.documentElement.style.setProperty(r,gl[r]))}),[p]),m=(0,t.useCallback)((async(t,e)=>{var n;if(t.getBoundingClientRect().top<e.getBoundingClientRect().top)return;h.current=!0;let r=e.querySelector('[style*="scale"]')?.style?.transform?.match(/scale\((.*?)\)/)?.[1];r=r?parseFloat(r):null;const o=e.offsetHeight/(null!==(n=r)&&void 0!==n?n:1);t.style.setProperty("max-height",`${o}px`,"important");const i=t.contentDocument.querySelectorAll(".wp-block-cover");for(const t of i)Vu.has(t)||Vu.set(t,t.style.minHeight),t.style.minHeight=Vu.get(t);e.offsetHeight,await new Promise((t=>requestAnimationFrame(t))),await new Promise((t=>requestAnimationFrame(t)));for(const e of i){const n=parseFloat(t.contentDocument.defaultView.getComputedStyle(e).height);e.offsetHeight,e.style.minHeight=n>500?"500px":n+"px"}t.style.setProperty("max-height","none","important"),h.current=!1}),[]);return(0,t.useEffect)((()=>{if(!r)return;const t=setTimeout((()=>{if(l)return;const t=e?.querySelector("iframe[title]");if(!t)return a((t=>t+1));u(t),requestAnimationFrame((()=>n(t,e)))}),100);return()=>clearTimeout(t)}),[l,r,s,e,n]),(0,t.useEffect)((()=>{if(d(!1),!l?.contentDocument)return;const t={attributes:!1,childList:!0,subtree:!0};requestAnimationFrame((()=>n(l,e)));const n=(0,Lu.debounce)((async()=>{i.current&&!h.current&&(r.disconnect(),await m(l,e),"extendable"!==window.extLibraryData.themeSlug&&await f(l,e),setTimeout((()=>d(!0)),o),i.current&&r.observe(l.contentDocument,t))}),300),r=new MutationObserver(n);return r.observe(l.contentDocument,t),()=>{n.cancel(),r?.disconnect()}}),[l,e,i,r,m,f,o]),{loading:!l,ready:c}})({container:s.current,ready:o,onIFrameLoaded:()=>{},loadDelay:50});return(0,t.useEffect)((()=>i(!0)),[]),(0,t.createElement)("button",{ref:s,type:"button","aria-label":(0,n.__)("Insert Pattern","extendify-local"),className:ku()("library-pattern mb-8 inline-block w-full bg-transparent p-0 m-0 focus:ring-design-main focus:ring-wp focus:ring-offset-2 focus:ring-offset-[#FAFAFA] focus:shadow-sm border focus:outline-none relative z-10 cursor-pointer",{"opacity-0 border-transparent":!l,"opacity-100 border-gray-400":l}),onClick:()=>e(a)},(0,t.createElement)(Cu.BlockPreview,{blocks:a,live:!1,viewportWidth:1400,additionalStyles:[{css:'.rich-text [data-rich-text-placeholder]:after { content: "" }'}]}))},Mu=t=>t.replace(/(https?:\/\/\S+\?w=\d+)/gi,"$1&q=10&auto=format,compress&fm=avif"),Fu=({insertPattern:e,siteType:r,category:o})=>{const{data:i,isLoading:s,setSize:l}=(t=>{const e={siteType:void 0,category:void 0,wpVersion:window.extLibraryData.wpVersion,lang:window.extLibraryData.wpLanguage||null,showLocalizedCopy:window.extLibraryData.showLocalizedCopy||null,...t},{data:n,error:r,isLoading:o,isValidating:i,mutate:s,size:a,setSize:l}=Su(((t,n)=>{if(!e.category)return null;if(n&&!n.length)return null;const r=new URLSearchParams({page:t+1});return Object.entries(e).filter((([,t])=>void 0!==t)).forEach((([t,e])=>{r.append(t,e)})),`${Pu}/api/patterns?${r.toString()}`}),Tu,{initialSize:2,revalidateFirstPage:!1,revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1});return{data:n,error:r,isLoading:o,isValidating:i,mutate:s,size:a,setSize:l}})({siteType:r?.slug,category:o}),[u,c]=(0,t.useState)(!0),[d,h]=function({threshold:t,delay:e,trackVisibility:n,rootMargin:r,root:o,triggerOnce:i,skip:s,initialInView:l,fallbackInView:u,onChange:c}={}){var d;const[h,p]=a.useState(null),f=a.useRef(),[m,g]=a.useState({inView:!!l,entry:void 0});f.current=c,a.useEffect((()=>{if(s||!h)return;let a;return a=xl(h,((t,e)=>{g({inView:t,entry:e}),f.current&&f.current(t,e),e.isIntersecting&&i&&a&&(a(),a=void 0)}),{root:o,rootMargin:r,threshold:t,trackVisibility:n,delay:e},u),()=>{a&&a()}}),[Array.isArray(t)?t.toString():t,h,o,r,i,s,n,u,e]);const y=null==(d=m.entry)?void 0:d.target,v=a.useRef();h||!y||i||s||v.current===y||(v.current=y,g({inView:!!l,entry:void 0}));const w=[p,m.inView,m.entry];return w.ref=w[0],w.inView=w[1],w.entry=w[2],w}(),p=i?.at(-1)?.length<9;return(0,t.useEffect)((()=>{if(s)return c(!0);const t=setTimeout((()=>{c(!1)}),750);return()=>clearTimeout(t)}),[s]),(0,t.useEffect)((()=>{h&&!s&&l((t=>t+1))}),[h,s,l]),s||!i?.length?(0,t.createElement)("div",{className:"text-center absolute inset-0 flex flex-col items-center justify-center"},(0,t.createElement)(yl.Spinner,null),(0,t.createElement)("span",{className:"sr-only"},(0,n.__)("Loading Patterns...","extendify-local"))):(0,t.createElement)(t.Fragment,null,(0,t.createElement)(Al,{breakpointCols:{default:3,1600:2,1e3:1,783:2,600:1},columnClassName:"",className:"w-full relative p-8 pt-2 flex gap-6"},i.map((n=>n.map((({id:n,code:r})=>(0,t.createElement)(Ru,{key:n,insertPattern:e,code:r})))))),u?(0,t.createElement)("div",{className:"text-center absolute inset-0 flex flex-col items-center justify-center z-0"},(0,t.createElement)(yl.Spinner,null),(0,t.createElement)("span",{className:"sr-only"},(0,n.__)("Loading Patterns...","extendify-local"))):null,u||p?null:(0,t.createElement)("div",{ref:d,className:"mt-6 md:mt-2 mb-6 flex w-full justify-center"},(0,t.createElement)(yl.Spinner,null),(0,t.createElement)("span",{className:"sr-only"},(0,n.__)("Loading more patterns...","extendify-local"))))},ju=yu(bu,(t=>(e,n,r)=>(r.revalidateOnFocus=!1,r.revalidateIfStale=!1,r.revalidateOnReconnect=!1,t(e,n,r)))),Nu=async()=>{const t=new URLSearchParams({wpVersion:window.extLibraryData.wpVersion||null,lang:window.extLibraryData.wpLanguage||null});return await fetch(`${Pu}/api/categories?${t.toString()}`).then((t=>t.json()))},Iu=f(b((t=>({categories:[],setCategories:e=>t({categories:e})})),{name:"extendify-library-cache"})),Bu=()=>{const{category:e,siteType:r,setCategory:o}=pl(),{data:i,isLoading:s,errorCount:a}=(()=>{var e;const[n,r]=(0,t.useState)(0),o=null!==(e=window.extLibraryData?.wpLanguage)&&void 0!==e?e:"en_US",{data:i,error:s,isLoading:a}=ju(`categories-${o}`,Nu,{onError:()=>r((t=>t+1)),onSuccess:()=>r(0)});return{data:i,errorCount:n>1?n:s?1:0,isLoading:a}})(),{categories:l,setCategories:u}=Iu();return(0,t.useEffect)((()=>{s||a||u(i)}),[i,s,u,a]),(0,t.useEffect)((()=>{const t=t=>r?.name&&document.querySelector(`#extendify-library-category-${t}`)?.focus();if(l?.length){if(e){if("all"===e)return t("all");if(l?.find((({slug:t})=>t===e)))return t(e)}o("all"),t("all")}}),[e,o,l,r?.name]),(0,t.createElement)(yl.PanelBody,{title:(0,n.__)("Design Type","extendify-local"),className:"ext-type-control p-0",initialOpen:!!r?.name},(0,t.createElement)(yl.PanelRow,null,(0,t.createElement)(_u,{categories:l,errorCount:a,current:e,setCurrent:o})))},_u=({categories:e,errorCount:r,current:o,setCurrent:i})=>{const s=t=>ku()("text-sm w-full text-left px-3 py-1 mb-0.5 block cursor-pointer rounded",{"bg-design-main text-design-text":o===t,"bg-transparent text-gray-900 hover:bg-gray-100":o!==t});return e?.length?(0,t.createElement)("ul",{className:"m-0 w-full py-2 px-1 border border-gray-300 overflow-y-auto max-h-half -mt-1.5 rounded-b"},(0,t.createElement)("li",{className:"m-0 p-0"},(0,t.createElement)("button",{type:"button",id:"extendify-library-category-all",onClick:()=>i("all"),className:s("all")},(0,n.__)("All","extendify-local"))),e.map((({slug:e,id:n,name:r})=>(0,t.createElement)("li",{key:n,className:"m-0 p-0"},(0,t.createElement)("button",{type:"button",id:`extendify-library-category-${e}`,onClick:()=>i(e),className:s(e)},r))))):r>1?(0,t.createElement)("div",{className:"flex flex-col w-full justify-center items-center gap-2 border-t border-gray-300 -mt-1 p-2"},(0,t.createElement)("span",null,(0,n.__)("Retrying...","extendify-local")),(0,t.createElement)(yl.Spinner,null)):(0,t.createElement)("div",{className:"flex w-full justify-center border-t border-gray-300 -mt-1 p-2"},(0,t.createElement)("span",{className:"sr-only"},(0,n.__)("Fetching...","extendify-local")),(0,t.createElement)(yl.Spinner,null))},Uu=()=>{const{siteType:e,setSiteType:r}=pl(),o=!!e?.name,[i,s]=(0,t.useState)(!o),[a,l]=(0,t.useState)(""),[u,c]=(0,t.useState)(""),[d,h]=(0,t.useState)(!1),{data:p,loading:f}=(t=>{const{data:e,error:n}=ju(t||"cold-boot",(async()=>{const{wpLanguage:e}=window.extLibraryData,n=performance.now(),r=new URL(`${Pu}/api/site-types`);t&&r.searchParams.append("search",t),t||r.searchParams.append("boot","true"),e&&r.searchParams.append("lang",e);const o=await fetch(r.toString(),{headers:{"Content-Type":"application/json"}});if(!t)return;if(!o.ok)throw new Error("Bad response from server");const i=await o.json();if(!Array.isArray(i))throw new Error("Bad response from server");return{siteTypes:i,time:((performance.now()-n)/1e3).toFixed(4)}}));return{data:e,error:n,loading:!e&&!n}})(u),m=(0,t.useRef)();return(0,t.useEffect)((()=>{i&&(l(""),m.current?.focus())}),[i]),(0,t.useEffect)((()=>{if(!p&&!f)return h(!1);h(f)}),[f,p]),(0,t.useEffect)((()=>{if(!a)return h(!1);h(!0);const t=setTimeout((()=>c(a)),300);return()=>clearTimeout(t)}),[a]),(0,t.createElement)(yl.PanelBody,{title:o?(0,n.sprintf)(
// translators: %s is the site type name
(0,n.__)("Site Type: %s","extendify-local"),e.name):(0,n.__)("Site Type","extendify-local"),className:"ext-type-control p-0",onToggle:s,opened:i,initialOpen:i},(0,t.createElement)(yl.PanelRow,{className:"m-0 w-full p-4 border border-gray-300 overflow-y-auto max-h-half -mt-1.5 rounded-b flex flex-col gap-2"},(0,t.createElement)(yl.SearchControl,{ref:m,className:"w-full",label:(0,n.__)("Search for your business type","extendify-local"),placeholder:(0,n.__)("Search for your business type","extendify-local"),value:a,onChange:l}),d&&(0,t.createElement)("div",{className:"flex w-full justify-center p-2"},(0,t.createElement)("span",{className:"sr-only"},(0,n.__)("Fetching...","extendify-local")),(0,t.createElement)(yl.Spinner,null)),p?.siteTypes?.length>0&&!d&&(0,t.createElement)("ul",{className:"m-0 w-full pb-2 px-0 overflow-y-auto"},p.siteTypes.slice(0,5).map((e=>(0,t.createElement)("li",{key:e.id,className:"m-0 p-0"},(0,t.createElement)("button",{type:"button",id:`site-type-${e.id}`,onClick:()=>{r(e),l(""),s(!1)},className:"text-sm w-full text-left px-3 py-1 mb-0.5 block cursor-pointer rounded bg-transparent text-gray-900 hover:bg-gray-100"},e.name)))))))},{partnerLogo:$u,partnerName:Hu}=window.extLibraryData,zu=()=>(0,t.createElement)("div",{className:"md:w-80 gap-6 flex-shrink-0 hidden md:flex flex-col"},$u?(0,t.createElement)("div",{className:"bg-banner-main p-6 py-0 flex justify-center"},(0,t.createElement)("div",{className:"flex h-20 py-3 items-center justify-center w-40"},(0,t.createElement)("img",{className:"max-h-full max-w-full",src:$u,alt:Hu}))):(0,t.createElement)("div",{className:"hidden py-3 px-5 text-extendify-black sm:flex sm:pt-5 -mb-5"},(0,t.createElement)(r,{icon:i,size:40})),(0,t.createElement)("div",{className:"overflow-y-auto pb-16 flex flex-col gap-4"},(0,t.createElement)("div",{className:"hidden md:flex flex-col px-4 overflow-x-hidden"},(0,t.createElement)(Uu,null)),(0,t.createElement)("div",{"data-test":"category-control",className:"hidden md:flex flex-col px-4 overflow-x-hidden"},(0,t.createElement)(Bu,null)))),Wu=({onClose:e})=>(0,t.createElement)("button",{className:"block w-6 h-6 p-px bg-transparent cursor-pointer outline-none focus:shadow-none focus:ring-wp focus:ring-design-main text-inherit",type:"button",onClick:e,"data-test":"modal-close-button","aria-label":(0,n.__)("Close","extendify-local")},(0,t.createElement)("svg",{style:{fill:"currentColor"},xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,t.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"}))),qu=({openOnNewPage:e,updateUserOption:r,onClose:o})=>(0,t.createElement)("div",{className:"flex gap-6 items-center justify-end px-8 h-16 mb-2 flex-shrink-0"},(0,t.createElement)("label",{className:"flex gap-2 items-center mt-4",htmlFor:"extendify-open-on-new-pages",title:(0,n.sprintf)(
// translators: %s: Extendify Library term
(0,n.__)("Toggle %s on new pages","extendify-local"),"Extendify Library")},(0,t.createElement)("input",{id:"extendify-open-on-new-pages",className:"border border-solid border-gray-900 rounded-sm m-0",type:"checkbox",checked:e,onChange:t=>r("openOnNewPage",t.target.checked)}),(0,t.createElement)("span",null,(0,n.__)("Open for new pages","extendify-local"))),(0,t.createElement)("div",{className:"mt-4"},(0,t.createElement)(Wu,{onClose:o}))),Yu=window?.location?.pathname?.includes("post-new.php"),Gu=()=>{const{open:e,setOpen:r}=x(),{updateUserOption:o,openOnNewPage:i}=ml(),{category:s,siteType:a,incrementImports:l}=pl(),{createNotice:u}=(0,S.dispatch)("core/notices"),c=()=>r(!1);return(0,t.useLayoutEffect)((()=>{(i&&Yu||new URLSearchParams(window.location.search).has("ext-open"))&&r(!0)}),[i,r]),e?(0,t.createElement)(we,{className:"extendify-library extendify-library-modal",open:e,static:!0,onClose:c},(0,t.createElement)("div",{className:"absolute mx-auto w-full h-full md:p-8"},(0,t.createElement)("div",{className:"fixed inset-0 bg-black/30",style:{backdropFilter:"blur(2px)"},"aria-hidden":"true"}),(0,t.createElement)(al.div,{key:"library-modal",initial:{y:30,opacity:0},animate:{y:0,opacity:1},exit:{y:0,opacity:0},transition:{duration:.3},className:"sm:flex h-full w-full relative shadow-2xl sm:overflow-hidden mx-auto bg-white max-w-screen-3xl"},(0,t.createElement)(we.Title,{className:"sr-only"},(0,n.__)("Design Patterns","extendify-local")),(0,t.createElement)(zu,null),(0,t.createElement)("div",{className:"flex flex-col w-full relative bg-[#FAFAFA]"},(0,t.createElement)(qu,{openOnNewPage:i,updateUserOption:o,onClose:c}),(0,t.createElement)("div",{className:"overflow-y-auto flex-grow"},(0,t.createElement)(Fu,{insertPattern:async t=>{await(async t=>{const{insertBlocks:e,replaceBlock:n}=(0,S.dispatch)("core/block-editor"),{getSelectedBlock:r,getBlockHierarchyRootClientId:o,getBlockIndex:i,getGlobalBlockCount:s}=(0,S.select)("core/block-editor"),{clientId:a,name:l,attributes:u}=r()||{},c=a?o(a):"",d=(c?i(c):s())+1,{missingCSSVars:h}=x.getState();return h.forEach((t=>{document?.documentElement?.style?.setProperty(t,gl[t]),document.querySelector('iframe[name="editor-canvas"]')?.contentDocument?.documentElement?.style?.setProperty(t,gl[t])})),h.length&&(async t=>{var e;const n=window.extLibraryData.globalStylesPostID,{styles:r,settings:o}=await ul()({path:`/wp/v2/global-styles/${n}`});if(!(t=t.filter((t=>!r?.css?.includes(`${t}:`)))).length)return;const i=t.reduce(((t,e)=>t+`${e}: ${gl[e]};\n`),":root {\n")+"\n}";ul()({path:`/wp/v2/global-styles/${n}`,method:"PATCH",data:{id:n,settings:o,styles:{...r,css:(null!==(e=r?.css)&&void 0!==e?e:"")+(r?.css?"\n":"")+i}}})})(h),"core/paragraph"===l&&""===u?.content?await n(a,t):await e(t,d)})(t),l(),c(),u("info",(0,n.__)("Pattern added","extendify-local"),{isDismissible:!0,type:"snackbar"})},category:s,siteType:a})))))):null};(0,e.registerPlugin)("extendify-library",{render:()=>{if("function"!=typeof t.createRoot)return;const e="extendify-library-btn",n="extendify-library",r=".edit-post-header-toolbar",o=".edit-site-header-edit-mode__start";(document.querySelector(r)||document.querySelector(o))&&requestAnimationFrame((()=>{if(document.getElementById(e))return;const i=document.createElement("div"),s=Object.assign(i,{id:e,className:n});document.querySelector(r)?.append(s),document.querySelector(o)?.append(s),(0,t.createRoot)(s).render((0,t.createElement)(E,null));const a="extendify-library-modal";if(document.getElementById(a))return;const l=document.createElement("div"),u=Object.assign(l,{id:a,className:n});document.body.append(u),(0,t.createRoot)(u).render((0,t.createElement)(Gu,null))}))}})}()}();


??

??