intlayer-editor 9.3.0 → 9.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/dist/assets/CodeBlockShiki-CYkk3yQg.js +2 -0
- package/client/dist/assets/MarkDownRender-BK2SjJub.js +22 -0
- package/client/dist/assets/MarkDownRender-CDk9zs5-.js +1 -0
- package/client/dist/assets/MarkdownEditor-o0H3vQy2.js +198 -0
- package/client/dist/assets/{bundle-web-Dicb3av4.js → bundle-web-BvRQkvKs.js} +1 -1
- package/client/dist/assets/c-BXFGequq.js +1 -0
- package/client/dist/assets/cpp-B-FuqbHP.js +1 -0
- package/client/dist/assets/csharp-D87KiH5q.js +1 -0
- package/client/dist/assets/csv-BjES08DR.js +1 -0
- package/client/dist/assets/dart-D76ST_ms.js +1 -0
- package/client/dist/assets/diff-CGoPSmAs.js +1 -0
- package/client/dist/assets/{dist-7R9OYxMo.js → dist-QZxj0AIG.js} +1 -1
- package/client/dist/assets/docker-B0VNDs-l.js +1 -0
- package/client/dist/assets/go-ByX_zvWx.js +1 -0
- package/client/dist/assets/graphql-BhltWPVB.js +1 -0
- package/client/dist/assets/http-NCBdpUR_.js +1 -0
- package/client/dist/assets/index-Dem7H_is.js +166 -0
- package/client/dist/assets/ini-CxAuzHS9.js +1 -0
- package/client/dist/assets/java-DacLdzTj.js +1 -0
- package/client/dist/assets/kotlin-DFAlwc6n.js +1 -0
- package/client/dist/assets/less-BAH4QT9G.js +1 -0
- package/client/dist/assets/lua-9Gg56-4d.js +1 -0
- package/client/dist/assets/{mojo-CFuIV2fl.js → mojo-fg40_ntQ.js} +1 -1
- package/client/dist/assets/nginx-D0i2Z83b.js +1 -0
- package/client/dist/assets/php-B3WFIgcK.js +1 -0
- package/client/dist/assets/powershell-npZ7I2uH.js +1 -0
- package/client/dist/assets/prisma-DMUTjaHc.js +1 -0
- package/client/dist/assets/python-6UJTEiNq.js +1 -0
- package/client/dist/assets/ruby-BwZ6L1bt.js +1 -0
- package/client/dist/assets/rust-hysUUyJr.js +1 -0
- package/client/dist/assets/scss-BcTpOuGQ.js +1 -0
- package/client/dist/assets/sql-cVYxS3zp.js +1 -0
- package/client/dist/assets/swift-DD8iODVb.js +1 -0
- package/client/dist/assets/toml-ClfFv0hG.js +1 -0
- package/client/dist/assets/typst-C40W_gC6.js +1 -0
- package/client/dist/index.html +1 -1
- package/package.json +15 -15
- package/server/dist/_virtual/_rolldown/runtime.cjs +1 -2
- package/server/dist/controllers/configuration.controller.cjs +2 -1
- package/server/dist/controllers/configuration.controller.cjs.map +1 -1
- package/server/dist/controllers/configuration.controller.mjs +2 -1
- package/server/dist/controllers/configuration.controller.mjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.cjs +7 -8
- package/server/dist/controllers/dictionary.controller.cjs.map +1 -1
- package/server/dist/controllers/dictionary.controller.mjs +7 -8
- package/server/dist/controllers/dictionary.controller.mjs.map +1 -1
- package/server/dist/index.cjs.map +1 -1
- package/server/dist/index.mjs.map +1 -1
- package/server/dist/routes/config.routes.cjs.map +1 -1
- package/server/dist/routes/dictionary.routes.cjs.map +1 -1
- package/server/dist/utils/httpStatusCodes.cjs +0 -1
- package/server/dist/utils/httpStatusCodes.cjs.map +1 -1
- package/client/dist/assets/CodeBlockShiki-sjnyRwc6.js +0 -2
- package/client/dist/assets/MarkDownRender-Blk0s4Ef.js +0 -22
- package/client/dist/assets/MarkDownRender-CNd64XFH.js +0 -1
- package/client/dist/assets/MarkdownEditor-D2lBE3SS.js +0 -198
- package/client/dist/assets/index-CADcenUL.js +0 -166
- package/client/dist/assets/typst-DI99ib-x.js +0 -1
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkDownRender-CDk9zs5-.js","assets/MarkDownRender-BK2SjJub.js","assets/rolldown-runtime-hePW80VL.js","assets/react-CwJFpaho.js","assets/MarkdownEditor-o0H3vQy2.js","assets/dist-QZxj0AIG.js","assets/dist-BMR831Ty.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{t as r}from"./react-CwJFpaho.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var i=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&j(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&j(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,A=k.port2;k.port1.onmessage=D,O=function(){A.postMessage(null)}}else O=function(){_(D,0)};function j(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,j(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),a=n(((e,t)=>{t.exports=i()})),o=n((e=>{var t=r();function n(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(n(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return s(e,t,null,r)},e.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)}},e.requestFormReset=function(e){a.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},e.useFormStatus=function(){return c.H.useHostTransitionStatus()},e.version=`19.2.8`})),s=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=o()})),c=n((e=>{var t=a(),n=r(),i=s();function o(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function l(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function u(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function d(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f(e){if(l(e)!==e)throw Error(o(188))}function p(e){var t=e.alternate;if(!t){if(t=l(e),t===null)throw Error(o(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var a=i.alternate;if(a===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===n)return f(i),e;if(a===r)return f(i),t;a=a.sibling}throw Error(o(188))}if(n.return!==r.return)n=i,r=a;else{for(var s=!1,c=i.child;c;){if(c===n){s=!0,n=i,r=a;break}if(c===r){s=!0,r=i,n=a;break}c=c.sibling}if(!s){for(c=a.child;c;){if(c===n){s=!0,n=a,r=i;break}if(c===r){s=!0,r=a,n=i;break}c=c.sibling}if(!s)throw Error(o(189))}}if(n.alternate!==r)throw Error(o(190))}if(n.tag!==3)throw Error(o(188));return n.stateNode.current===n?e:t}function m(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=m(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),E=Symbol.for(`react.suspense_list`),D=Symbol.for(`react.memo`),O=Symbol.for(`react.lazy`),k=Symbol.for(`react.activity`),A=Symbol.for(`react.memo_cache_sentinel`),j=Symbol.iterator;function M(e){return typeof e!=`object`||!e?null:(e=j&&e[j]||e[`@@iterator`],typeof e==`function`?e:null)}var N=Symbol.for(`react.client.reference`);function P(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===N?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case E:return`SuspenseList`;case k:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case D:return t=e.displayName||null,t===null?P(e.type)||`Memo`:t;case O:t=e._payload,e=e._init;try{return P(e(t))}catch{}}return null}var F=Array.isArray,I=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},te=[],ne=-1;function R(e){return{current:e}}function z(e){0>ne||(e.current=te[ne],te[ne]=null,ne--)}function B(e,t){ne++,te[ne]=e.current,e.current=t}var re=R(null),ie=R(null),ae=R(null),oe=R(null);function se(e,t){switch(B(ae,t),B(ie,e),B(re,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Jd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Jd(t),e=Yd(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}z(re),B(re,e)}function ce(){z(re),z(ie),z(ae)}function le(e){e.memoizedState!==null&&B(oe,e);var t=re.current,n=Yd(t,e.type);t!==n&&(B(ie,e),B(re,n))}function ue(e){ie.current===e&&(z(re),z(ie)),oe.current===e&&(z(oe),ap._currentValue=ee)}var de,fe;function pe(e){if(de===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);de=t&&t[1]||``,fe=-1<e.stack.indexOf(`
|
|
3
|
+
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
+
`+de+e+fe}var me=!1;function he(e,t){if(!e||me)return``;me=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
+
`),l=s.split(`
|
|
6
|
+
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
+
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{me=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?pe(n):``}function ge(e,t){switch(e.tag){case 26:case 27:case 5:return pe(e.type);case 16:return pe(`Lazy`);case 13:return e.child!==t&&t!==null?pe(`Suspense Fallback`):pe(`Suspense`);case 19:return pe(`SuspenseList`);case 0:case 15:return he(e.type,!1);case 11:return he(e.type.render,!1);case 1:return he(e.type,!0);case 31:return pe(`Activity`);default:return``}}function _e(e){try{var t=``,n=null;do t+=ge(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
+
Error generating stack: `+e.message+`
|
|
9
|
+
`+e.stack}}var ve=Object.prototype.hasOwnProperty,ye=t.unstable_scheduleCallback,be=t.unstable_cancelCallback,xe=t.unstable_shouldYield,Se=t.unstable_requestPaint,Ce=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Te=t.unstable_ImmediatePriority,Ee=t.unstable_UserBlockingPriority,De=t.unstable_NormalPriority,Oe=t.unstable_LowPriority,ke=t.unstable_IdlePriority,Ae=t.log,je=t.unstable_setDisableYieldValue,Me=null,Ne=null;function Pe(e){if(typeof Ae==`function`&&je(e),Ne&&typeof Ne.setStrictMode==`function`)try{Ne.setStrictMode(Me,e)}catch{}}var Fe=Math.clz32?Math.clz32:Re,Ie=Math.log,Le=Math.LN2;function Re(e){return e>>>=0,e===0?32:31-(Ie(e)/Le|0)|0}var ze=256,Be=262144,Ve=4194304;function He(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ue(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=He(n))):i=He(o):i=He(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=He(n))):i=He(o)):i=He(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function We(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ge(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ke(){var e=Ve;return Ve<<=1,!(Ve&62914560)&&(Ve=4194304),e}function qe(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Je(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ye(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Fe(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&Xe(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function Xe(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Fe(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function Ze(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Fe(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function Qe(e,t){var n=t&-t;return n=n&42?1:$e(n),(n&(e.suspendedLanes|t))===0?n:0}function $e(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function et(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function tt(){var e=L.p;return e===0?(e=window.event,e===void 0?32:xp(e.type)):e}function nt(e,t){var n=L.p;try{return L.p=e,t()}finally{L.p=n}}var rt=Math.random().toString(36).slice(2),it=`__reactFiber$`+rt,at=`__reactProps$`+rt,ot=`__reactContainer$`+rt,st=`__reactEvents$`+rt,ct=`__reactListeners$`+rt,lt=`__reactHandles$`+rt,ut=`__reactResources$`+rt,dt=`__reactMarker$`+rt;function ft(e){delete e[it],delete e[at],delete e[st],delete e[ct],delete e[lt]}function pt(e){var t=e[it];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ot]||n[it]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vf(e);e!==null;){if(n=e[it])return n;e=vf(e)}return t}e=n,n=e.parentNode}return null}function mt(e){if(e=e[it]||e[ot]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ht(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function V(e){var t=e[ut];return t||=e[ut]={hoistableStyles:new Map,hoistableScripts:new Map},t}function gt(e){e[dt]=!0}var _t=new Set,vt={};function yt(e,t){bt(e,t),bt(e+`Capture`,t)}function bt(e,t){for(vt[e]=t,e=0;e<t.length;e++)_t.add(t[e])}var xt=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),St={},Ct={};function wt(e){return ve.call(Ct,e)?!0:ve.call(St,e)?!1:xt.test(e)?Ct[e]=!0:(St[e]=!0,!1)}function Tt(e,t,n){if(wt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Et(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,``+n)}}function Dt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ot(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function kt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function At(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function jt(e){if(!e._valueTracker){var t=kt(e)?`checked`:`value`;e._valueTracker=At(e,t,``+e[t])}}function Mt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=kt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Nt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Pt=/[\n"\\]/g;function Ft(e){return e.replace(Pt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function It(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ot(t)):e.value!==``+Ot(t)&&(e.value=``+Ot(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Rt(e,o,Ot(n)):Rt(e,o,Ot(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ot(s):e.removeAttribute(`name`)}function Lt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){jt(e);return}n=n==null?``:``+Ot(n),t=t==null?n:``+Ot(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),jt(e)}function Rt(e,t,n){t===`number`&&Nt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function zt(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ot(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Bt(e,t,n){if(t!=null&&(t=``+Ot(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ot(n)}function Vt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(o(92));if(F(r)){if(1<r.length)throw Error(o(93));r=r[0]}n=r}n??=``,t=n}n=Ot(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),jt(e)}function Ht(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ut=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function Wt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Ut.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Gt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(o(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&Wt(e,i,r)}else for(var a in t)t.hasOwnProperty(a)&&Wt(e,a,t[a])}function Kt(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var qt=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),Jt=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Yt(e){return Jt.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function Xt(){}var Zt=null;function Qt(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $t=null,en=null;function tn(e){var t=mt(e);if(t&&(e=t.stateNode)){var n=e[at]||null;a:switch(e=t.stateNode,t.type){case`input`:if(It(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+Ft(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[at]||null;if(!i)throw Error(o(90));It(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&Mt(r)}break a;case`textarea`:Bt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&zt(e,!!n.multiple,t,!1)}}}var nn=!1;function rn(e,t,n){if(nn)return e(t,n);nn=!0;try{return e(t)}finally{if(nn=!1,($t!==null||en!==null)&&(wu(),$t&&(t=$t,e=en,en=$t=null,tn(t),e)))for(t=0;t<e.length;t++)tn(e[t])}}function an(e,t){var n=e.stateNode;if(n===null)return null;var r=n[at]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(o(231,t,typeof n));return n}var on=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),sn=!1;if(on)try{var cn={};Object.defineProperty(cn,"passive",{get:function(){sn=!0}}),window.addEventListener(`test`,cn,cn),window.removeEventListener(`test`,cn,cn)}catch{sn=!1}var ln=null,un=null,dn=null;function fn(){if(dn)return dn;var e,t=un,n=t.length,r,i=`value`in ln?ln.value:ln.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return dn=i.slice(e,1<r?1-r:void 0)}function pn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function mn(){return!0}function hn(){return!1}function gn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?mn:hn,this.isPropagationStopped=hn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=mn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=mn)},persist:function(){},isPersistent:mn}),t}var _n={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},vn=gn(_n),yn=h({},_n,{view:0,detail:0}),bn=gn(yn),xn,Sn,Cn,wn=h({},yn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Fn,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Cn&&(Cn&&e.type===`mousemove`?(xn=e.screenX-Cn.screenX,Sn=e.screenY-Cn.screenY):Sn=xn=0,Cn=e),xn)},movementY:function(e){return`movementY`in e?e.movementY:Sn}}),Tn=gn(wn),En=gn(h({},wn,{dataTransfer:0})),Dn=gn(h({},yn,{relatedTarget:0})),On=gn(h({},_n,{animationName:0,elapsedTime:0,pseudoElement:0})),kn=gn(h({},_n,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),An=gn(h({},_n,{data:0})),jn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},Mn={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},Nn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Pn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Nn[e])?!!t[e]:!1}function Fn(){return Pn}var In=gn(h({},yn,{key:function(e){if(e.key){var t=jn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=pn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?Mn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Fn,charCode:function(e){return e.type===`keypress`?pn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?pn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Ln=gn(h({},wn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Rn=gn(h({},yn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Fn})),zn=gn(h({},_n,{propertyName:0,elapsedTime:0,pseudoElement:0})),Bn=gn(h({},wn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),Vn=gn(h({},_n,{newState:0,oldState:0})),Hn=[9,13,27,32],Un=on&&`CompositionEvent`in window,Wn=null;on&&`documentMode`in document&&(Wn=document.documentMode);var Gn=on&&`TextEvent`in window&&!Wn,Kn=on&&(!Un||Wn&&8<Wn&&11>=Wn),qn=` `,Jn=!1;function Yn(e,t){switch(e){case`keyup`:return Hn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function Xn(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var Zn=!1;function Qn(e,t){switch(e){case`compositionend`:return Xn(t);case`keypress`:return t.which===32?(Jn=!0,qn):null;case`textInput`:return e=t.data,e===qn&&Jn?null:e;default:return null}}function $n(e,t){if(Zn)return e===`compositionend`||!Un&&Yn(e,t)?(e=fn(),dn=un=ln=null,Zn=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return Kn&&t.locale!==`ko`?null:t.data;default:return null}}var er={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!er[e.type]:t===`textarea`}function nr(e,t,n,r){$t?en?en.push(r):en=[r]:$t=r,t=Md(t,`onChange`),0<t.length&&(n=new vn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var rr=null,ir=null;function ar(e){wd(e,0)}function or(e){if(Mt(ht(e)))return e}function sr(e,t){if(e===`change`)return t}var cr=!1;if(on){var lr;if(on){var ur=`oninput`in document;if(!ur){var dr=document.createElement(`div`);dr.setAttribute(`oninput`,`return;`),ur=typeof dr.oninput==`function`}lr=ur}else lr=!1;cr=lr&&(!document.documentMode||9<document.documentMode)}function fr(){rr&&(rr.detachEvent(`onpropertychange`,pr),ir=rr=null)}function pr(e){if(e.propertyName===`value`&&or(ir)){var t=[];nr(t,ir,e,Qt(e)),rn(ar,t)}}function mr(e,t,n){e===`focusin`?(fr(),rr=t,ir=n,rr.attachEvent(`onpropertychange`,pr)):e===`focusout`&&fr()}function hr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return or(ir)}function gr(e,t){if(e===`click`)return or(t)}function _r(e,t){if(e===`input`||e===`change`)return or(t)}function vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var yr=typeof Object.is==`function`?Object.is:vr;function br(e,t){if(yr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!ve.call(t,i)||!yr(e[i],t[i]))return!1}return!0}function xr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Sr(e,t){var n=xr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=xr(n)}}function Cr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Cr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Nt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Nt(e.document)}return t}function Tr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Er=on&&`documentMode`in document&&11>=document.documentMode,Dr=null,Or=null,kr=null,Ar=!1;function jr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Ar||Dr==null||Dr!==Nt(r)||(r=Dr,`selectionStart`in r&&Tr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),kr&&br(kr,r)||(kr=r,r=Md(Or,`onSelect`),0<r.length&&(t=new vn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Dr)))}function Mr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var Nr={animationend:Mr(`Animation`,`AnimationEnd`),animationiteration:Mr(`Animation`,`AnimationIteration`),animationstart:Mr(`Animation`,`AnimationStart`),transitionrun:Mr(`Transition`,`TransitionRun`),transitionstart:Mr(`Transition`,`TransitionStart`),transitioncancel:Mr(`Transition`,`TransitionCancel`),transitionend:Mr(`Transition`,`TransitionEnd`)},Pr={},Fr={};on&&(Fr=document.createElement(`div`).style,`AnimationEvent`in window||(delete Nr.animationend.animation,delete Nr.animationiteration.animation,delete Nr.animationstart.animation),`TransitionEvent`in window||delete Nr.transitionend.transition);function Ir(e){if(Pr[e])return Pr[e];if(!Nr[e])return e;var t=Nr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Fr)return Pr[e]=t[n];return e}var Lr=Ir(`animationend`),Rr=Ir(`animationiteration`),zr=Ir(`animationstart`),Br=Ir(`transitionrun`),Vr=Ir(`transitionstart`),Hr=Ir(`transitioncancel`),Ur=Ir(`transitionend`),Wr=new Map,Gr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Gr.push(`scrollEnd`);function Kr(e,t){Wr.set(e,t),yt(t,[e])}var qr=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Jr=[],Yr=0,Xr=0;function Zr(){for(var e=Yr,t=Xr=Yr=0;t<e;){var n=Jr[t];Jr[t++]=null;var r=Jr[t];Jr[t++]=null;var i=Jr[t];Jr[t++]=null;var a=Jr[t];if(Jr[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ti(n,i,a)}}function Qr(e,t,n,r){Jr[Yr++]=e,Jr[Yr++]=t,Jr[Yr++]=n,Jr[Yr++]=r,Xr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function $r(e,t,n,r){return Qr(e,t,n,r),ni(e)}function ei(e,t){return Qr(e,null,null,t),ni(e)}function ti(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Fe(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function ni(e){if(50<hu)throw hu=0,gu=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ri={};function ii(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ai(e,t,n,r){return new ii(e,t,n,r)}function oi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function si(e,t){var n=e.alternate;return n===null?(n=ai(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function ci(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function li(e,t,n,r,i,a){var s=0;if(r=e,typeof e==`function`)oi(e)&&(s=1);else if(typeof e==`string`)s=Xf(e,n,re.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case k:return e=ai(31,n,t,i),e.elementType=k,e.lanes=a,e;case y:return ui(n.children,i,a,t);case b:s=8,i|=24;break;case x:return e=ai(12,n,t,i|2),e.elementType=x,e.lanes=a,e;case T:return e=ai(13,n,t,i),e.elementType=T,e.lanes=a,e;case E:return e=ai(19,n,t,i),e.elementType=E,e.lanes=a,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case D:s=14;break a;case O:s=16,r=null;break a}s=29,n=Error(o(130,e===null?`null`:typeof e,``)),r=null}return t=ai(s,n,t,i),t.elementType=e,t.type=r,t.lanes=a,t}function ui(e,t,n,r){return e=ai(7,e,r,t),e.lanes=n,e}function di(e,t,n){return e=ai(6,e,null,t),e.lanes=n,e}function fi(e){var t=ai(18,null,null,0);return t.stateNode=e,t}function pi(e,t,n){return t=ai(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var mi=new WeakMap;function hi(e,t){if(typeof e==`object`&&e){var n=mi.get(e);return n===void 0?(t={value:e,source:t,stack:_e(t)},mi.set(e,t),t):n}return{value:e,source:t,stack:_e(t)}}var gi=[],_i=0,vi=null,yi=0,bi=[],xi=0,Si=null,Ci=1,wi=``;function Ti(e,t){gi[_i++]=yi,gi[_i++]=vi,vi=e,yi=t}function Ei(e,t,n){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Si=e;var r=Ci;e=wi;var i=32-Fe(r)-1;r&=~(1<<i),n+=1;var a=32-Fe(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Ci=1<<32-Fe(t)+i|n<<i|r,wi=a+e}else Ci=1<<a|n<<i|r,wi=e}function Di(e){e.return!==null&&(Ti(e,1),Ei(e,1,0))}function Oi(e){for(;e===vi;)vi=gi[--_i],gi[_i]=null,yi=gi[--_i],gi[_i]=null;for(;e===Si;)Si=bi[--xi],bi[xi]=null,wi=bi[--xi],bi[xi]=null,Ci=bi[--xi],bi[xi]=null}function ki(e,t){bi[xi++]=Ci,bi[xi++]=wi,bi[xi++]=Si,Ci=t.id,wi=t.overflow,Si=e}var Ai=null,ji=null,Mi=!1,Ni=null,Pi=!1,Fi=Error(o(519));function Ii(e){throw Hi(hi(Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Fi}function Li(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[it]=e,t[at]=r,n){case`dialog`:Td(`cancel`,t),Td(`close`,t);break;case`iframe`:case`object`:case`embed`:Td(`load`,t);break;case`video`:case`audio`:for(n=0;n<Sd.length;n++)Td(Sd[n],t);break;case`source`:Td(`error`,t);break;case`img`:case`image`:case`link`:Td(`error`,t),Td(`load`,t);break;case`details`:Td(`toggle`,t);break;case`input`:Td(`invalid`,t),Lt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Td(`invalid`,t);break;case`textarea`:Td(`invalid`,t),Vt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Rd(t.textContent,n)?(r.popover!=null&&(Td(`beforetoggle`,t),Td(`toggle`,t)),r.onScroll!=null&&Td(`scroll`,t),r.onScrollEnd!=null&&Td(`scrollend`,t),r.onClick!=null&&(t.onclick=Xt),t=!0):t=!1,t||Ii(e,!0)}function Ri(e){for(Ai=e.return;Ai;)switch(Ai.tag){case 5:case 31:case 13:Pi=!1;return;case 27:case 3:Pi=!0;return;default:Ai=Ai.return}}function zi(e){if(e!==Ai)return!1;if(!Mi)return Ri(e),Mi=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Xd(e.type,e.memoizedProps)),n=!n),n&&ji&&Ii(e),Ri(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ji=_f(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(317));ji=_f(e)}else t===27?(t=ji,af(e.type)?(e=gf,gf=null,ji=e):ji=t):ji=Ai?hf(e.stateNode.nextSibling):null;return!0}function Bi(){ji=Ai=null,Mi=!1}function Vi(){var e=Ni;return e!==null&&(tu===null?tu=e:tu.push.apply(tu,e),Ni=null),e}function Hi(e){Ni===null?Ni=[e]:Ni.push(e)}var Ui=R(null),Wi=null,Gi=null;function Ki(e,t,n){B(Ui,t._currentValue),t._currentValue=n}function qi(e){e._currentValue=Ui.current,z(Ui)}function Ji(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Yi(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){var s=i.child;a=a.firstContext;a:for(;a!==null;){var c=a;a=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){a.lanes|=n,c=a.alternate,c!==null&&(c.lanes|=n),Ji(a.return,n,e),r||(s=null);break a}a=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(o(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Ji(s,n,e),s=null}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Xi(e,t,n,r){e=null;for(var i=t,a=!1;i!==null;){if(!a){if(i.flags&524288)a=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(o(387));if(s=s.memoizedProps,s!==null){var c=i.type;yr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===oe.current){if(s=i.alternate,s===null)throw Error(o(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[ap]:e.push(ap))}i=i.return}e!==null&&Yi(t,e,n,r),t.flags|=262144}function Zi(e){for(e=e.firstContext;e!==null;){if(!yr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Qi(e){Wi=e,Gi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function $i(e){return ta(Wi,e)}function ea(e,t){return Wi===null&&Qi(e),ta(e,t)}function ta(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Gi===null){if(e===null)throw Error(o(308));Gi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Gi=Gi.next=t;return n}var na=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ra=t.unstable_scheduleCallback,ia=t.unstable_NormalPriority,aa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function oa(){return{controller:new na,data:new Map,refCount:0}}function sa(e){e.refCount--,e.refCount===0&&ra(ia,function(){e.controller.abort()})}var ca=null,la=0,ua=0,da=null;function fa(e,t){if(ca===null){var n=ca=[];la=0,ua=gd(),da={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return la++,t.then(pa,pa),t}function pa(){if(--la===0&&ca!==null){da!==null&&(da.status=`fulfilled`);var e=ca;ca=null,ua=0,da=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ma(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var ha=I.S;I.S=function(e,t){iu=Ce(),typeof t==`object`&&t&&typeof t.then==`function`&&fa(e,t),ha!==null&&ha(e,t)};var ga=R(null);function _a(){var e=ga.current;return e===null?K.pooledCache:e}function va(e,t){t===null?B(ga,ga.current):B(ga,t.pool)}function ya(){var e=_a();return e===null?null:{parent:aa._currentValue,pool:e}}var ba=Error(o(460)),xa=Error(o(474)),Sa=Error(o(542)),Ca={then:function(){}};function wa(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Ta(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Xt,Xt),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e;default:if(typeof t.status==`string`)t.then(Xt,Xt);else{if(e=K,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ka(e),e}throw Da=t,ba}}function Ea(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(Da=e,ba):e}}var Da=null;function Oa(){if(Da===null)throw Error(o(459));var e=Da;return Da=null,e}function ka(e){if(e===ba||e===Sa)throw Error(o(483))}var Aa=null,ja=0;function Ma(e){var t=ja;return ja+=1,Aa===null&&(Aa=[]),Ta(Aa,e,t)}function Na(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Pa(e,t){throw t.$$typeof===g?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function Fa(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=si(e,t),e.index=0,e.sibling=null,e}function a(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=di(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===O&&Ea(a)===t.type)?(t=i(t,n.props),Na(t,n),t.return=e,t):(t=li(n.type,n.key,n.props,null,e.mode,r),Na(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=pi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=ui(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=di(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=li(t.type,t.key,t.props,null,e.mode,n),Na(n,t),n.return=e,n;case v:return t=pi(t,e.mode,n),t.return=e,t;case O:return t=Ea(t),f(e,t,n)}if(F(t)||M(t))return t=ui(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Ma(t),n);if(t.$$typeof===C)return f(e,ea(e,t),n);Pa(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case O:return n=Ea(n),p(e,t,n,r)}if(F(n)||M(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Ma(n),r);if(n.$$typeof===C)return p(e,t,ea(e,n),r);Pa(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case O:return r=Ea(r),m(e,t,n,r,i)}if(F(r)||M(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Ma(r),i);if(r.$$typeof===C)return m(e,t,n,ea(t,r),i);Pa(t,r)}return null}function h(i,o,s,c){for(var l=null,u=null,d=o,h=o=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),o=a(_,o,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),Mi&&Ti(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(o=a(d,o,h),u===null?l=d:u.sibling=d,u=d);return Mi&&Ti(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),o=a(g,o,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),Mi&&Ti(i,h),l}function g(i,s,c,l){if(c==null)throw Error(o(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=a(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),Mi&&Ti(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return Mi&&Ti(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=a(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),Mi&&Ti(i,g),u}function b(e,r,a,c){if(typeof a==`object`&&a&&a.type===y&&a.key===null&&(a=a.props.children),typeof a==`object`&&a){switch(a.$$typeof){case _:a:{for(var l=a.key;r!==null;){if(r.key===l){if(l=a.type,l===y){if(r.tag===7){n(e,r.sibling),c=i(r,a.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Ea(l)===r.type){n(e,r.sibling),c=i(r,a.props),Na(c,a),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}a.type===y?(c=ui(a.props.children,e.mode,c,a.key),c.return=e,e=c):(c=li(a.type,a.key,a.props,null,e.mode,c),Na(c,a),c.return=e,e=c)}return s(e);case v:a:{for(l=a.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===a.containerInfo&&r.stateNode.implementation===a.implementation){n(e,r.sibling),c=i(r,a.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=pi(a,e.mode,c),c.return=e,e=c}return s(e);case O:return a=Ea(a),b(e,r,a,c)}if(F(a))return h(e,r,a,c);if(M(a)){if(l=M(a),typeof l!=`function`)throw Error(o(150));return a=l.call(a),g(e,r,a,c)}if(typeof a.then==`function`)return b(e,r,Ma(a),c);if(a.$$typeof===C)return b(e,r,ea(e,a),c);Pa(e,a)}return typeof a==`string`&&a!==``||typeof a==`number`||typeof a==`bigint`?(a=``+a,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,a),c.return=e,e=c):(n(e,r),c=di(a,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{ja=0;var i=b(e,t,n,r);return Aa=null,i}catch(t){if(t===ba||t===Sa)throw t;var a=ai(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ia=Fa(!0),La=Fa(!1),Ra=!1;function za(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ba(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ha(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,zl&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=ni(e),ti(e,null,n),t}return Qr(e,r,t,n),ni(e)}function Ua(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ze(e,n)}}function Wa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Ga=!1;function Ka(){if(Ga){var e=da;if(e!==null)throw e}}function qa(e,t,n,r){Ga=!1;var i=e.updateQueue;Ra=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(Vl&f)===f:(r&f)===f){f!==0&&f===ua&&(Ga=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ra=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Yl|=o,e.lanes=o,e.memoizedState=d}}function Ja(e,t){if(typeof e!=`function`)throw Error(o(191,e));e.call(t)}function Ya(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Ja(n[e],t)}var Xa=R(null),Za=R(0);function Qa(e,t){e=ql,B(Za,e),B(Xa,t),ql=e|t.baseLanes}function $a(){B(Za,ql),B(Xa,Xa.current)}function eo(){ql=Za.current,z(Xa),z(Za)}var to=R(null),no=null;function ro(e){var t=e.alternate;B(co,co.current&1),B(to,e),no===null&&(t===null||Xa.current!==null||t.memoizedState!==null)&&(no=e)}function io(e){B(co,co.current),B(to,e),no===null&&(no=e)}function ao(e){e.tag===22?(B(co,co.current),B(to,e),no===null&&(no=e)):oo(e)}function oo(){B(co,co.current),B(to,to.current)}function so(e){z(to),no===e&&(no=null),z(co)}var co=R(0);function lo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ff(n)||pf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var uo=0,fo=null,po=null,mo=null,ho=!1,go=!1,_o=!1,vo=0,yo=0,bo=null,xo=0;function So(){throw Error(o(321))}function Co(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!yr(e[n],t[n]))return!1;return!0}function wo(e,t,n,r,i,a){return uo=a,fo=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Vs:Hs,_o=!1,a=n(r,i),_o=!1,go&&(a=Eo(t,n,r,i)),To(e),a}function To(e){I.H=Bs;var t=po!==null&&po.next!==null;if(uo=0,mo=po=fo=null,ho=!1,yo=0,bo=null,t)throw Error(o(300));e===null||ac||(e=e.dependencies,e!==null&&Zi(e)&&(ac=!0))}function Eo(e,t,n,r){fo=e;var i=0;do{if(go&&(bo=null),yo=0,go=!1,25<=i)throw Error(o(301));if(i+=1,mo=po=null,e.updateQueue!=null){var a=e.updateQueue;a.lastEffect=null,a.events=null,a.stores=null,a.memoCache!=null&&(a.memoCache.index=0)}I.H=Us,a=t(n,r)}while(go);return a}function Do(){var e=I.H,t=e.useState()[0];return t=typeof t.then==`function`?Po(t):t,e=e.useState()[0],(po===null?null:po.memoizedState)!==e&&(fo.flags|=1024),t}function Oo(){var e=vo!==0;return vo=0,e}function ko(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Ao(e){if(ho){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ho=!1}uo=0,mo=po=fo=null,go=!1,yo=vo=0,bo=null}function jo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mo===null?fo.memoizedState=mo=e:mo=mo.next=e,mo}function Mo(){if(po===null){var e=fo.alternate;e=e===null?null:e.memoizedState}else e=po.next;var t=mo===null?fo.memoizedState:mo.next;if(t!==null)mo=t,po=e;else{if(e===null)throw fo.alternate===null?Error(o(467)):Error(o(310));po=e,e={memoizedState:po.memoizedState,baseState:po.baseState,baseQueue:po.baseQueue,queue:po.queue,next:null},mo===null?fo.memoizedState=mo=e:mo=mo.next=e}return mo}function No(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Po(e){var t=yo;return yo+=1,bo===null&&(bo=[]),e=Ta(bo,e,t),t=fo,(mo===null?t.memoizedState:mo.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Vs:Hs),e}function Fo(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Po(e);if(e.$$typeof===C)return $i(e)}throw Error(o(438,String(e)))}function Io(e){var t=null,n=fo.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=fo.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=No(),fo.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=A;return t.index++,n}function Lo(e,t){return typeof t==`function`?t(e):t}function Ro(e){return zo(Mo(),po,e)}function zo(e,t,n){var r=e.queue;if(r===null)throw Error(o(311));r.lastRenderedReducer=n;var i=e.baseQueue,a=r.pending;if(a!==null){if(i!==null){var s=i.next;i.next=a.next,a.next=s}t.baseQueue=i=a,r.pending=null}if(a=e.baseState,i===null)e.memoizedState=a;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(uo&f)===f:(Vl&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===ua&&(d=!0);else if((uo&p)===p){u=u.next,p===ua&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=a):l=l.next=f,fo.lanes|=p,Yl|=p;f=u.action,_o&&n(a,f),a=u.hasEagerState?u.eagerState:n(a,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=a):l=l.next=p,fo.lanes|=f,Yl|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=a:l.next=c,!yr(a,e.memoizedState)&&(ac=!0,d&&(n=da,n!==null)))throw n;e.memoizedState=a,e.baseState=s,e.baseQueue=l,r.lastRenderedState=a}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Bo(e){var t=Mo(),n=t.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,a=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do a=e(a,s.action),s=s.next;while(s!==i);yr(a,t.memoizedState)||(ac=!0),t.memoizedState=a,t.baseQueue===null&&(t.baseState=a),n.lastRenderedState=a}return[a,r]}function Vo(e,t,n){var r=fo,i=Mo(),a=Mi;if(a){if(n===void 0)throw Error(o(407));n=n()}else n=t();var s=!yr((po||i).memoizedState,n);if(s&&(i.memoizedState=n,ac=!0),i=i.queue,fs(Wo.bind(null,r,i,e),[e]),i.getSnapshot!==t||s||mo!==null&&mo.memoizedState.tag&1){if(r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,i,n,t),null),K===null)throw Error(o(349));a||uo&127||Ho(r,t,n)}return n}function Ho(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=fo.updateQueue,t===null?(t=No(),fo.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Uo(e,t,n,r){t.value=n,t.getSnapshot=r,Go(t)&&Ko(e)}function Wo(e,t,n){return n(function(){Go(t)&&Ko(e)})}function Go(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!yr(e,n)}catch{return!0}}function Ko(e){var t=ei(e,2);t!==null&&yu(t,e,2)}function qo(e){var t=jo();if(typeof e==`function`){var n=e;if(e=n(),_o){Pe(!0);try{n()}finally{Pe(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:e},t}function Jo(e,t,n,r){return e.baseState=n,zo(e,po,typeof r==`function`?r:Lo)}function Yo(e,t,n,r,i){if(Ls(e))throw Error(o(485));if(e=t.action,e!==null){var a={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){a.listeners.push(e)}};I.T===null?a.isTransition=!1:n(!0),r(a),n=t.pending,n===null?(a.next=t.pending=a,Xo(t,a)):(a.next=n.next,t.pending=n.next=a)}}function Xo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=I.T,o={};I.T=o;try{var s=n(i,r),c=I.S;c!==null&&c(o,s),Zo(e,t,s)}catch(n){$o(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),I.T=a}}else try{a=n(i,r),Zo(e,t,a)}catch(n){$o(e,t,n)}}function Zo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Qo(e,t,n)},function(n){return $o(e,t,n)}):Qo(e,t,n)}function Qo(e,t,n){t.status=`fulfilled`,t.value=n,es(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Xo(e,n)))}function $o(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,es(t),t=t.next;while(t!==r)}e.action=null}function es(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ts(e,t){return t}function ns(e,t){if(Mi){var n=K.formState;if(n!==null){a:{var r=fo;if(Mi){if(ji){b:{for(var i=ji,a=Pi;i.nodeType!==8;){if(!a){i=null;break b}if(i=hf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ji=hf(i.nextSibling),r=i.data===`F!`;break a}}Ii(r)}r=!1}r&&(t=n[0])}}return n=jo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ts,lastRenderedState:t},n.queue=r,n=Ps.bind(null,fo,r),r.dispatch=n,r=qo(!1),a=Is.bind(null,fo,!1,r.queue),r=jo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Yo.bind(null,fo,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function rs(e){return is(Mo(),po,e)}function is(e,t,n){if(t=zo(e,t,ts)[0],e=Ro(Lo)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Po(t)}catch(e){throw e===ba?Sa:e}else r=t;t=Mo();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(fo.flags|=2048,ss(9,{destroy:void 0},as.bind(null,i,n),null)),[r,a,e]}function as(e,t){e.action=t}function os(e){var t=Mo(),n=po;if(n!==null)return is(t,n,e);Mo(),t=t.memoizedState,n=Mo();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function ss(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=fo.updateQueue,t===null&&(t=No(),fo.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function cs(){return Mo().memoizedState}function ls(e,t,n,r){var i=jo();fo.flags|=e,i.memoizedState=ss(1|t,{destroy:void 0},n,r===void 0?null:r)}function us(e,t,n,r){var i=Mo();r=r===void 0?null:r;var a=i.memoizedState.inst;po!==null&&r!==null&&Co(r,po.memoizedState.deps)?i.memoizedState=ss(t,a,n,r):(fo.flags|=e,i.memoizedState=ss(1|t,a,n,r))}function ds(e,t){ls(8390656,8,e,t)}function fs(e,t){us(2048,8,e,t)}function ps(e){fo.flags|=4;var t=fo.updateQueue;if(t===null)t=No(),fo.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function ms(e){var t=Mo().memoizedState;return ps({ref:t,nextImpl:e}),function(){if(zl&2)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function hs(e,t){return us(4,2,e,t)}function gs(e,t){return us(4,4,e,t)}function _s(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function vs(e,t,n){n=n==null?null:n.concat([e]),us(4,4,_s.bind(null,t,e),n)}function ys(){}function bs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&Co(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function xs(e,t){var n=Mo();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&Co(t,r[1]))return r[0];if(r=e(),_o){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r}function Ss(e,t,n){return n===void 0||uo&1073741824&&!(Vl&261930)?e.memoizedState=t:(e.memoizedState=n,e=vu(),fo.lanes|=e,Yl|=e,n)}function Cs(e,t,n,r){return yr(n,t)?n:Xa.current===null?!(uo&42)||uo&1073741824&&!(Vl&261930)?(ac=!0,e.memoizedState=n):(e=vu(),fo.lanes|=e,Yl|=e,t):(e=Ss(e,n,r),yr(e,t)||(ac=!0),e)}function ws(e,t,n,r,i){var a=L.p;L.p=a!==0&&8>a?a:8;var o=I.T,s={};I.T=s,Is(e,!1,t,n);try{var c=i(),l=I.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Fs(e,t,ma(c,r),_u(e)):Fs(e,t,r,_u(e))}catch(n){Fs(e,t,{then:function(){},status:`rejected`,reason:n},_u())}finally{L.p=a,o!==null&&s.types!==null&&(o.types=s.types),I.T=o}}function Ts(){}function Es(e,t,n,r){if(e.tag!==5)throw Error(o(476));var i=Ds(e).queue;ws(e,i,t,ee,n===null?Ts:function(){return Os(e),n(r)})}function Ds(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:ee},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Os(e){var t=Ds(e);t.next===null&&(t=e.alternate.memoizedState),Fs(e,t.next.queue,{},_u())}function ks(){return $i(ap)}function As(){return Mo().memoizedState}function js(){return Mo().memoizedState}function Ms(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=_u();e=Va(n);var r=Ha(t,e,n);r!==null&&(yu(r,t,n),Ua(r,t,n)),t={cache:oa()},e.payload=t;return}t=t.return}}function Ns(e,t,n){var r=_u();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ls(e)?Rs(t,n):(n=$r(e,t,n,r),n!==null&&(yu(n,e,r),zs(n,t,r)))}function Ps(e,t,n){Fs(e,t,n,_u())}function Fs(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ls(e))Rs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,yr(s,o))return Qr(e,t,i,0),K===null&&Zr(),!1}catch{}if(n=$r(e,t,i,r),n!==null)return yu(n,e,r),zs(n,t,r),!0}return!1}function Is(e,t,n,r){if(r={lane:2,revertLane:gd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ls(e)){if(t)throw Error(o(479))}else t=$r(e,n,r,2),t!==null&&yu(t,e,2)}function Ls(e){var t=e.alternate;return e===fo||t!==null&&t===fo}function Rs(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function zs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Ze(e,n)}}var Bs={readContext:$i,use:Fo,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};Bs.useEffectEvent=So;var Vs={readContext:$i,use:Fo,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:$i,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,_s.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(_o){Pe(!0);try{e()}finally{Pe(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(_o){Pe(!0);try{n(t)}finally{Pe(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ns.bind(null,fo,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ps.bind(null,fo,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:ys,useDeferredValue:function(e,t){return Ss(jo(),e,t)},useTransition:function(){var e=qo(!1);return e=ws.bind(null,fo,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=fo,i=jo();if(Mi){if(n===void 0)throw Error(o(407));n=n()}else{if(n=t(),K===null)throw Error(o(349));Vl&127||Ho(r,t,n)}i.memoizedState=n;var a={value:n,getSnapshot:t};return i.queue=a,ds(Wo.bind(null,r,a,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,a,n,t),null),n},useId:function(){var e=jo(),t=K.identifierPrefix;if(Mi){var n=wi,r=Ci;n=(r&~(1<<32-Fe(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=xo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ks,useFormState:ns,useActionState:ns,useOptimistic:function(e){var t=jo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Is.bind(null,fo,!0,n),n.dispatch=t,[e,t]},useMemoCache:Io,useCacheRefresh:function(){return jo().memoizedState=Ms.bind(null,fo)},useEffectEvent:function(e){var t=jo(),n={impl:e};return t.memoizedState=n,function(){if(zl&2)throw Error(o(440));return n.impl.apply(void 0,arguments)}}},Hs={readContext:$i,use:Fo,useCallback:bs,useContext:$i,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Ro,useRef:cs,useState:function(){return Ro(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){return Cs(Mo(),po.memoizedState,e,t)},useTransition:function(){var e=Ro(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:rs,useActionState:rs,useOptimistic:function(e,t){return Jo(Mo(),po,e,t)},useMemoCache:Io,useCacheRefresh:js};Hs.useEffectEvent=ms;var Us={readContext:$i,use:Fo,useCallback:bs,useContext:$i,useEffect:fs,useImperativeHandle:vs,useInsertionEffect:hs,useLayoutEffect:gs,useMemo:xs,useReducer:Bo,useRef:cs,useState:function(){return Bo(Lo)},useDebugValue:ys,useDeferredValue:function(e,t){var n=Mo();return po===null?Ss(n,e,t):Cs(n,po.memoizedState,e,t)},useTransition:function(){var e=Bo(Lo)[0],t=Mo().memoizedState;return[typeof e==`boolean`?e:Po(e),t]},useSyncExternalStore:Vo,useId:As,useHostTransitionStatus:ks,useFormState:os,useActionState:os,useOptimistic:function(e,t){var n=Mo();return po===null?(n.baseState=e,[e,n.queue.dispatch]):Jo(n,po,e,t)},useMemoCache:Io,useCacheRefresh:js};Us.useEffectEvent=ms;function Ws(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Gs={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Va(r);i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(yu(t,e,r),Ua(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_u(),i=Va(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ha(e,i,r),t!==null&&(yu(t,e,r),Ua(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_u(),r=Va(n);r.tag=2,t!=null&&(r.callback=t),t=Ha(e,r,n),t!==null&&(yu(t,e,n),Ua(t,e,n))}};function Ks(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!br(n,r)||!br(i,a):!0}function qs(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Gs.enqueueReplaceState(t,t.state,null)}function Js(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Ys(e){qr(e)}function Xs(e){console.error(e)}function Zs(e){qr(e)}function Qs(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function $s(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){return n=Va(n),n.tag=3,n.payload={element:null},n.callback=function(){Qs(e,t)},n}function tc(e){return e=Va(e),e.tag=3,e}function nc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){$s(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){$s(t,n,r),typeof i!=`function`&&(su===null?su=new Set([this]):su.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function rc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Xi(t,n,i,!0),n=to.current,n!==null){switch(n.tag){case 31:case 13:return no===null?ju():n.alternate===null&&Jl===0&&(Jl=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Xu(e,r,i)),!1;case 22:return n.flags|=65536,r===Ca?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Xu(e,r,i)),!1}throw Error(o(435,n.tag))}return Xu(e,r,i),ju(),!1}if(Mi)return t=to.current,t===null?(r!==Fi&&(t=Error(o(423),{cause:r}),Hi(hi(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=hi(r,n),i=ec(e.stateNode,r,i),Wa(e,i),Jl!==4&&(Jl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==Fi&&(e=Error(o(422),{cause:r}),Hi(hi(e,n)))),!1;var a=Error(o(520),{cause:r});if(a=hi(a,n),eu===null?eu=[a]:eu.push(a),Jl!==4&&(Jl=2),t===null)return!0;r=hi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=ec(n.stateNode,r,e),Wa(n,e),!1;case 1:if(t=n.type,a=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||a!==null&&typeof a.componentDidCatch==`function`&&(su===null||!su.has(a))))return n.flags|=65536,i&=-i,n.lanes|=i,i=tc(i),nc(i,e,n,r),Wa(n,i),!1}n=n.return}while(n!==null);return!1}var ic=Error(o(461)),ac=!1;function oc(e,t,n,r){t.child=e===null?La(t,null,n,r):Ia(t,e.child,n,r)}function sc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return Qi(t),r=wo(e,t,n,o,a,i),s=Oo(),e!==null&&!ac?(ko(e,t,i),Ac(e,t,i)):(Mi&&s&&Di(t),t.flags|=1,oc(e,t,r,i),t.child)}function cc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!oi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,lc(e,t,a,r,i)):(e=li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!jc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?br:n,n(o,r)&&e.ref===t.ref)return Ac(e,t,i)}return t.flags|=1,e=si(a,r),e.ref=t.ref,e.return=t,t.child=e}function lc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(br(a,r)&&e.ref===t.ref){if(ac=!1,t.pendingProps=r=a,jc(e,i))e.flags&131072&&(ac=!0);else return t.lanes=e.lanes,Ac(e,t,i)}}return _c(e,t,n,r,i)}function uc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return fc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&va(t,a===null?null:a.cachePool),a===null?$a():Qa(t,a),ao(t);else return r=t.lanes=536870912,fc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&va(t,null),$a(),oo(t)):(va(t,a.cachePool),Qa(t,a),oo(t),t.memoizedState=null);return oc(e,t,i,n),t.child}function dc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function fc(e,t,n,r,i){var a=_a();return a=a===null?null:{parent:aa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&va(t,null),$a(),ao(t),e!==null&&Xi(e,t,r,!0),t.childLanes=i,null}function pc(e,t){return t=Ec({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function mc(e,t,n){return Ia(t,e.child,null,n),e=pc(t,t.pendingProps),e.flags|=2,so(t),t.memoizedState=null,e}function hc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(Mi){if(r.mode===`hidden`)return e=pc(t,r),t.lanes=536870912,dc(null,e);if(io(t),(e=ji)?(e=df(e,Pi),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return t.lanes=536870912,null}return pc(t,r)}var a=e.memoizedState;if(a!==null){var s=a.dehydrated;if(io(t),i){if(t.flags&256)t.flags&=-257,t=mc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558))}else if(ac||Xi(e,t,n,!1),i=(n&e.childLanes)!==0,ac||i){if(r=K,r!==null&&(s=Qe(r,n),s!==0&&s!==a.retryLane))throw a.retryLane=s,ei(e,s),yu(r,e,s),ic;ju(),t=mc(e,t,n)}else e=a.treeContext,ji=hf(s.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=pc(t,r),t.flags|=4096;return t}return e=si(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function gc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(o(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function _c(e,t,n,r,i){return Qi(t),n=wo(e,t,n,r,void 0,i),r=Oo(),e!==null&&!ac?(ko(e,t,i),Ac(e,t,i)):(Mi&&r&&Di(t),t.flags|=1,oc(e,t,n,i),t.child)}function vc(e,t,n,r,i,a){return Qi(t),t.updateQueue=null,n=Eo(t,r,n,i),To(e),r=Oo(),e!==null&&!ac?(ko(e,t,a),Ac(e,t,a)):(Mi&&r&&Di(t),t.flags|=1,oc(e,t,n,a),t.child)}function yc(e,t,n,r,i){if(Qi(t),t.stateNode===null){var a=ri,o=n.contextType;typeof o==`object`&&o&&(a=$i(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Gs,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},za(t),o=n.contextType,a.context=typeof o==`object`&&o?$i(o):ri,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Ws(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Gs.enqueueReplaceState(a,a.state,null),qa(t,r,a,i),Ka(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Js(n,s);a.props=c;var l=a.context,u=n.contextType;o=ri,typeof u==`object`&&u&&(o=$i(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&qs(t,a,r,o),Ra=!1;var f=t.memoizedState;a.state=f,qa(t,r,a,i),Ka(),l=t.memoizedState,s||f!==l||Ra?(typeof d==`function`&&(Ws(t,n,d,r),l=t.memoizedState),(c=Ra||Ks(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ba(e,t),o=t.memoizedProps,u=Js(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ri,typeof l==`object`&&l&&(c=$i(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&qs(t,a,r,c),Ra=!1,f=t.memoizedState,a.state=f,qa(t,r,a,i),Ka();var p=t.memoizedState;o!==d||f!==p||Ra||e!==null&&e.dependencies!==null&&Zi(e.dependencies)?(typeof s==`function`&&(Ws(t,n,s,r),p=t.memoizedState),(u=Ra||Ks(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Zi(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,gc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ia(t,e.child,null,i),t.child=Ia(t,null,n,i)):oc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Ac(e,t,i),e}function bc(e,t,n,r){return Bi(),t.flags|=256,oc(e,t,n,r),t.child}var xc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Sc(e){return{baseLanes:e,cachePool:ya()}}function Cc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Ql),e}function wc(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),s;if((s=a)||(s=e!==null&&e.memoizedState===null?!1:!!(co.current&2)),s&&(i=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(Mi){if(i?ro(t):oo(t),(e=ji)?(e=df(e,Pi),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Si===null?null:{id:Ci,overflow:wi},retryLane:536870912,hydrationErrors:null},n=fi(e),n.return=t,t.child=n,Ai=t,ji=null)):e=null,e===null)throw Ii(t);return pf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,i?(oo(t),i=t.mode,c=Ec({mode:`hidden`,children:c},i),r=ui(r,i,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(null,r)):(ro(t),Tc(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(a)t.flags&256?(ro(t),t.flags&=-257,t=Dc(e,t,n)):t.memoizedState===null?(oo(t),c=r.fallback,i=t.mode,r=Ec({mode:`visible`,children:r.children},i),c=ui(c,i,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ia(t,e.child,null,n),r=t.child,r.memoizedState=Sc(n),r.childLanes=Cc(e,s,n),t.memoizedState=xc,t=dc(null,r)):(oo(t),t.child=e.child,t.flags|=128,t=null);else if(ro(t),pf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(o(419)),r.stack=``,r.digest=s,Hi({value:r,source:null,stack:null}),t=Dc(e,t,n)}else if(ac||Xi(e,t,n,!1),s=(n&e.childLanes)!==0,ac||s){if(s=K,s!==null&&(r=Qe(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ei(e,r),yu(s,e,r),ic;ff(c)||ju(),t=Dc(e,t,n)}else ff(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,ji=hf(c.nextSibling),Ai=t,Mi=!0,Ni=null,Pi=!1,e!==null&&ki(t,e),t=Tc(t,r.children),t.flags|=4096);return t}return i?(oo(t),c=r.fallback,i=t.mode,l=e.child,u=l.sibling,r=si(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=ui(c,i,n,null),c.flags|=2):c=si(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,dc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Sc(n):(i=c.cachePool,i===null?i=ya():(l=aa._currentValue,i=i.parent===l?i:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:i}),r.memoizedState=c,r.childLanes=Cc(e,s,n),t.memoizedState=xc,dc(e.child,r)):(ro(t),n=e.child,e=n.sibling,n=si(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Tc(e,t){return t=Ec({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Ec(e,t){return e=ai(22,e,null,t),e.lanes=0,e}function Dc(e,t,n){return Ia(t,e.child,null,n),e=Tc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Oc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ji(e.return,t,n)}function kc(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function H(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=co.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,B(co,o),oc(e,t,r,n),r=Mi?yi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Oc(e,n,t);else if(e.tag===19)Oc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&lo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),kc(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&lo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}kc(t,!0,n,null,a,r);break;case`together`:kc(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Ac(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Yl|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Xi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,n=si(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=si(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function jc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Zi(e)))}function Mc(e,t,n){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),Ki(t,aa,e.memoizedState.cache),Bi();break;case 27:case 5:le(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:Ki(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ro(t),e=Ac(e,t,n),e===null?null:e.sibling):wc(e,t,n):(ro(t),t.flags|=128,null);ro(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Xi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return H(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),B(co,co.current),r)break;return null;case 22:return t.lanes=0,uc(e,t,n,t.pendingProps);case 24:Ki(t,aa,e.memoizedState.cache)}return Ac(e,t,n)}function Nc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)ac=!0;else{if(!jc(e,n)&&!(t.flags&128))return ac=!1,Mc(e,t,n);ac=!!(e.flags&131072)}}else ac=!1,Mi&&t.flags&1048576&&Ei(t,yi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Ea(t.elementType),t.type=e,typeof e==`function`)oi(e)?(r=Js(e,r),t.tag=1,t=yc(null,t,e,r,n)):(t.tag=0,t=_c(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===w){t.tag=11,t=sc(null,t,e,r,n);break a}if(i===D){t.tag=14,t=cc(null,t,e,r,n);break a}}throw t=P(e)||e,Error(o(306,t,``))}}return t;case 0:return _c(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=Js(r,t.pendingProps),yc(e,t,r,i,n);case 3:a:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(o(387));r=t.pendingProps;var a=t.memoizedState;i=a.element,Ba(e,t),qa(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ki(t,aa,r),r!==a.cache&&Yi(t,[aa],n,!0),Ka(),r=s.element,a.isDehydrated){if(a={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=a,t.memoizedState=a,t.flags&256){t=bc(e,t,r,n);break a}if(r!==i){i=hi(Error(o(424)),t),Hi(i),t=bc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ji=hf(e.firstChild),Ai=t,Mi=!0,Ni=null,Pi=!0,n=La(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Bi(),r===i){t=Ac(e,t,n);break a}oc(e,t,r,n)}t=t.child}return t;case 26:return gc(e,t),e===null?(n=If(t.type,null,t.pendingProps,null))?t.memoizedState=n:Mi||(n=t.type,e=t.pendingProps,r=qd(ae.current).createElement(n),r[it]=t,r[at]=e,Vd(r,n,e),gt(r),t.stateNode=r):t.memoizedState=If(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return le(t),e===null&&Mi&&(r=t.stateNode=yf(t.type,t.pendingProps,ae.current),Ai=t,Pi=!0,i=ji,af(t.type)?(gf=i,ji=hf(r.firstChild)):ji=i),oc(e,t,t.pendingProps.children,n),gc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Mi&&((i=r=ji)&&(r=lf(r,t.type,t.pendingProps,Pi),r===null?i=!1:(t.stateNode=r,Ai=t,ji=hf(r.firstChild),Pi=!1,i=!0)),i||Ii(t)),le(t),i=t.type,a=t.pendingProps,s=e===null?null:e.memoizedProps,r=a.children,Xd(i,a)?r=null:s!==null&&Xd(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=wo(e,t,Do,null,null,n),ap._currentValue=i),gc(e,t),oc(e,t,r,n),t.child;case 6:return e===null&&Mi&&((e=n=ji)&&(n=uf(n,t.pendingProps,Pi),n===null?e=!1:(t.stateNode=n,Ai=t,ji=null,e=!0)),e||Ii(t)),null;case 13:return wc(e,t,n);case 4:return se(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ia(t,null,r,n):oc(e,t,r,n),t.child;case 11:return sc(e,t,t.type,t.pendingProps,n);case 7:return oc(e,t,t.pendingProps,n),t.child;case 8:return oc(e,t,t.pendingProps.children,n),t.child;case 12:return oc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ki(t,t.type,r.value),oc(e,t,r.children,n),t.child;case 9:return i=t.type._context,r=t.pendingProps.children,Qi(t),i=$i(i),r=r(i),t.flags|=1,oc(e,t,r,n),t.child;case 14:return cc(e,t,t.type,t.pendingProps,n);case 15:return lc(e,t,t.type,t.pendingProps,n);case 19:return H(e,t,n);case 31:return hc(e,t,n);case 22:return uc(e,t,n,t.pendingProps);case 24:return Qi(t),r=$i(aa),e===null?(i=_a(),i===null&&(i=K,a=oa(),i.pooledCache=a,a.refCount++,a!==null&&(i.pooledCacheLanes|=n),i=a),t.memoizedState={parent:r,cache:i},za(t),Ki(t,aa,i)):((e.lanes&n)!==0&&(Ba(e,t),qa(t,null,null,n),Ka()),i=e.memoizedState,a=t.memoizedState,i.parent===r?(r=a.cache,Ki(t,aa,r),r!==i.cache&&Yi(t,[aa],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ki(t,aa,r))),oc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function Pc(e){e.flags|=4}function Fc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Ou())e.flags|=8192;else throw Da=Ca,xa}}else e.flags&=-16777217}function Ic(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Zf(t)){if(Ou())e.flags|=8192;else throw Da=Ca,xa}}function U(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:Ke(),e.lanes|=t,$l|=t)}function Lc(e,t){if(!Mi)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Rc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function zc(e,t,n){var r=t.pendingProps;switch(Oi(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Rc(t),null;case 1:return Rc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),qi(aa),ce(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(zi(t)?Pc(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Vi())),Rc(t),null;case 26:var i=t.type,a=t.memoizedState;return e===null?(Pc(t),a===null?(Rc(t),Fc(t,i,null,r,n)):(Rc(t),Ic(t,a))):a?a===e.memoizedState?(Rc(t),t.flags&=-16777217):(Pc(t),Rc(t),Ic(t,a)):(e=e.memoizedProps,e!==r&&Pc(t),Rc(t),Fc(t,i,e,r,n)),null;case 27:if(ue(t),n=ae.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Rc(t),null}e=re.current,zi(t)?Li(t,e):(e=yf(i,r,n),t.stateNode=e,Pc(t))}return Rc(t),null;case 5:if(ue(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(!r){if(t.stateNode===null)throw Error(o(166));return Rc(t),null}if(a=re.current,zi(t))Li(t,a);else{var s=qd(ae.current);switch(a){case 1:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:a=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:a=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:a=s.createElement(`div`),a.innerHTML=`<script><\/script>`,a=a.removeChild(a.firstChild);break;case`select`:a=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?a.multiple=!0:r.size&&(a.size=r.size);break;default:a=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}a[it]=t,a[at]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)a.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=a;a:switch(Vd(a,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Pc(t)}}return Rc(t),Fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Pc(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(o(166));if(e=ae.current,zi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=Ai,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[it]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Rd(e.nodeValue,n)),e||Ii(t,!0)}else e=qd(e).createTextNode(r),e[it]=t,t.stateNode=e}return Rc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=zi(t),n!==null){if(e===null){if(!r)throw Error(o(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(o(557));e[it]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),e=!1}else n=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(so(t),t):(so(t),null);if(t.flags&128)throw Error(o(558))}return Rc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=zi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(o(317));i[it]=t}else Bi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Rc(t),i=!1}else i=Vi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(so(t),t):(so(t),null)}return so(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),U(t,t.updateQueue),Rc(t),null);case 4:return ce(),e===null&&Od(t.stateNode.containerInfo),Rc(t),null;case 10:return qi(t.type),Rc(t),null;case 19:if(z(co),r=t.memoizedState,r===null)return Rc(t),null;if(i=!!(t.flags&128),a=r.rendering,a===null){if(i)Lc(r,!1);else{if(Jl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=lo(e),a!==null){for(t.flags|=128,Lc(r,!1),e=a.updateQueue,t.updateQueue=e,U(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)ci(n,e),n=n.sibling;return B(co,co.current&1|2),Mi&&Ti(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ce()>au&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304)}}else{if(!i){if(e=lo(a),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,U(t,e),Lc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!a.alternate&&!Mi)return Rc(t),null}else 2*Ce()-r.renderingStartTime>au&&n!==536870912&&(t.flags|=128,i=!0,Lc(r,!1),t.lanes=4194304)}r.isBackwards?(a.sibling=t.child,t.child=a):(e=r.last,e===null?t.child=a:e.sibling=a,r.last=a)}return r.tail===null?(Rc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ce(),e.sibling=null,n=co.current,B(co,i?n&1|2:n&1),Mi&&Ti(t,r.treeForkCount),e);case 22:case 23:return so(t),eo(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Rc(t),t.subtreeFlags&6&&(t.flags|=8192)):Rc(t),n=t.updateQueue,n!==null&&U(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&z(ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),qi(aa),Rc(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function Bc(e,t){switch(Oi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return qi(aa),ce(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ue(t),null;case 31:if(t.memoizedState!==null){if(so(t),t.alternate===null)throw Error(o(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(so(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));Bi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return z(co),null;case 4:return ce(),null;case 10:return qi(t.type),null;case 22:case 23:return so(t),eo(),e!==null&&z(ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return qi(aa),null;case 25:return null;default:return null}}function Vc(e,t){switch(Oi(t),t.tag){case 3:qi(aa),ce();break;case 26:case 27:case 5:ue(t);break;case 4:ce();break;case 31:t.memoizedState!==null&&so(t);break;case 13:so(t);break;case 19:z(co);break;case 10:qi(t.type);break;case 22:case 23:so(t),eo(),e!==null&&z(ga);break;case 24:qi(aa)}}function Hc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Yu(t,t.return,e)}}function Uc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Yu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Yu(t,t.return,e)}}function Wc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Ya(t,n)}catch(t){Yu(e,e.return,t)}}}function Gc(e,t,n){n.props=Js(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Yu(e,t,n)}}function Kc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Yu(e,t,n)}}function qc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Yu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Yu(e,t,n)}else n.current=null}}function Jc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Yu(e,e.return,t)}}function Yc(e,t,n){try{var r=e.stateNode;Hd(r,e.type,n,t),r[at]=t}catch(t){Yu(e,e.return,t)}}function Xc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&af(e.type)||e.tag===4}function Zc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Xc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&af(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Qc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Xt));else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Qc(e,t,n),e=e.sibling;e!==null;)Qc(e,t,n),e=e.sibling}function $c(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&af(e.type)&&(n=e.stateNode),e=e.child,e!==null))for($c(e,t,n),e=e.sibling;e!==null;)$c(e,t,n),e=e.sibling}function el(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Vd(t,r,n),t[it]=e,t[at]=n}catch(t){Yu(e,e.return,t)}}var tl=!1,nl=!1,rl=!1,il=typeof WeakSet==`function`?WeakSet:Set,al=null;function W(e,t){if(e=e.containerInfo,Gd=mp,e=wr(e),Tr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,a=r.focusNode;r=r.focusOffset;try{n.nodeType,a.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||i!==0&&f.nodeType!==3||(c=s+i),f!==a||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===i&&(c=s),p===a&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Kd={focusedElem:e,selectionRange:n},mp=!1,al=t;al!==null;)if(t=al,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,al=e;else for(;al!==null;){switch(t=al,a=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&a!==null){e=void 0,n=t,i=a.memoizedProps,a=a.memoizedState,r=n.stateNode;try{var h=Js(n.type,i);e=r.getSnapshotBeforeUpdate(h,a),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){Yu(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)cf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:cf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,al=e;break}al=t.return}}function ol(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Hc(5,n);break;case 1:if(bl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){Yu(n,n.return,e)}else{var i=Js(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){Yu(n,n.return,e)}}}r&64&&Wc(n),r&512&&Kc(n,n.return);break;case 3:if(bl(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Ya(e,t)}catch(e){Yu(n,n.return,e)}}break;case 27:t===null&&r&4&&el(n);case 26:case 5:bl(e,n),t===null&&r&4&&Jc(n),r&512&&Kc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&dl(e,n);break;case 13:bl(e,n),r&4&&fl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=$u.bind(null,n),mf(e,n))));break;case 22:if(r=n.memoizedState!==null||tl,!r){t=t!==null&&t.memoizedState!==null||nl,i=tl;var a=nl;tl=r,(nl=t)&&!a?Sl(e,n,!!(n.subtreeFlags&8772)):bl(e,n),tl=i,nl=a}break;case 30:break;default:bl(e,n)}}function sl(e){var t=e.alternate;t!==null&&(e.alternate=null,sl(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ft(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var cl=null,G=!1;function ll(e,t,n){for(n=n.child;n!==null;)ul(e,t,n),n=n.sibling}function ul(e,t,n){if(Ne&&typeof Ne.onCommitFiberUnmount==`function`)try{Ne.onCommitFiberUnmount(Me,n)}catch{}switch(n.tag){case 26:nl||qc(n,t),ll(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:nl||qc(n,t);var r=cl,i=G;af(n.type)&&(cl=n.stateNode,G=!1),ll(e,t,n),bf(n.stateNode),cl=r,G=i;break;case 5:nl||qc(n,t);case 6:if(r=cl,i=G,cl=null,ll(e,t,n),cl=r,G=i,cl!==null){if(G)try{(cl.nodeType===9?cl.body:cl.nodeName===`HTML`?cl.ownerDocument.body:cl).removeChild(n.stateNode)}catch(e){Yu(n,t,e)}else try{cl.removeChild(n.stateNode)}catch(e){Yu(n,t,e)}}break;case 18:cl!==null&&(G?(e=cl,of(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Bp(e)):of(cl,n.stateNode));break;case 4:r=cl,i=G,cl=n.stateNode.containerInfo,G=!0,ll(e,t,n),cl=r,G=i;break;case 0:case 11:case 14:case 15:Uc(2,n,t),nl||Uc(4,n,t),ll(e,t,n);break;case 1:nl||(qc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Gc(n,t,r)),ll(e,t,n);break;case 21:ll(e,t,n);break;case 22:nl=(r=nl)||n.memoizedState!==null,ll(e,t,n),nl=r;break;default:ll(e,t,n)}}function dl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Bp(e)}catch(e){Yu(t,t.return,e)}}}function fl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Bp(e)}catch(e){Yu(t,t.return,e)}}function pl(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new il),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new il),t;default:throw Error(o(435,e.tag))}}function ml(e,t){var n=pl(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=ed.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r],a=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(af(c.type)){cl=c.stateNode,G=!1;break a}break;case 5:cl=c.stateNode,G=!1;break a;case 3:case 4:cl=c.stateNode.containerInfo,G=!0;break a}c=c.return}if(cl===null)throw Error(o(160));ul(a,s,i),cl=null,G=!1,a=i.alternate,a!==null&&(a.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Uc(3,e,e.return),Hc(3,e),Uc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(nl||n===null||qc(n,n.return)),r&64&&tl&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var i=gl;if(hl(t,e),vl(e),r&512&&(nl||n===null||qc(n,n.return)),r&4){var a=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,i=i.ownerDocument||i;b:switch(r){case`title`:a=i.getElementsByTagName(`title`)[0],(!a||a[dt]||a[it]||a.namespaceURI===`http://www.w3.org/2000/svg`||a.hasAttribute(`itemprop`))&&(a=i.createElement(r),i.head.insertBefore(a,i.querySelector(`head > title`))),Vd(a,r,n),a[it]=e,gt(a),r=a;break a;case`link`:var s=Jf(`link`,`href`,i).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&a.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&a.getAttribute(`title`)===(n.title==null?null:n.title)&&a.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}a=i.createElement(r),Vd(a,r,n),i.head.appendChild(a);break;case`meta`:if(s=Jf(`meta`,`content`,i).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(a=s[c],a.getAttribute(`content`)===(n.content==null?null:``+n.content)&&a.getAttribute(`name`)===(n.name==null?null:n.name)&&a.getAttribute(`property`)===(n.property==null?null:n.property)&&a.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&a.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}a=i.createElement(r),Vd(a,r,n),i.head.appendChild(a);break;default:throw Error(o(468,r))}a[it]=e,gt(a),r=a}e.stateNode=r}else Yf(i,e.type,e.stateNode)}else e.stateNode=Uf(i,r,e.memoizedProps)}else a===r?r===null&&e.stateNode!==null&&Yc(e,e.memoizedProps,n.memoizedProps):(a===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):a.count--,r===null?Yf(i,e.type,e.stateNode):Uf(i,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(nl||n===null||qc(n,n.return)),n!==null&&r&4&&Yc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(nl||n===null||qc(n,n.return)),e.flags&32){i=e.stateNode;try{Ht(i,``)}catch(t){Yu(e,e.return,t)}}r&4&&e.stateNode!=null&&(i=e.memoizedProps,Yc(e,i,n===null?i:n.memoizedProps)),r&1024&&(rl=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(o(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){Yu(e,e.return,t)}}break;case 3:if(qf=null,i=gl,gl=Cf(t.containerInfo),hl(t,e),gl=i,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Bp(t.containerInfo)}catch(t){Yu(e,e.return,t)}rl&&(rl=!1,yl(e));break;case 4:r=gl,gl=Cf(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(ru=Ce()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 22:i=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=tl,d=nl;if(tl=u||i,nl=d||l,hl(t,e),nl=d,tl=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||l||tl||nl||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(a=l.stateNode,i)s=a.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){Yu(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=i?``:l.memoizedProps}catch(e){Yu(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;i?sf(m,!0):sf(l.stateNode,!1)}catch(e){Yu(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,ml(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ml(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Xc(r)){n=r;break}r=r.return}if(n==null)throw Error(o(160));switch(n.tag){case 27:var i=n.stateNode;$c(e,Zc(e),i);break;case 5:var a=n.stateNode;n.flags&32&&(Ht(a,``),n.flags&=-33),$c(e,Zc(e),a);break;case 3:case 4:var s=n.stateNode.containerInfo;Qc(e,Zc(e),s);break;default:throw Error(o(161))}}catch(t){Yu(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ol(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Uc(4,t,t.return),xl(t);break;case 1:qc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Gc(t,t.return,n),xl(t);break;case 27:bf(t.stateNode);case 26:case 5:qc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Hc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){Yu(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Ja(c[i],s)}catch(e){Yu(r,r.return,e)}}n&&o&64&&Wc(a),Kc(a,a.return);break;case 27:el(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Jc(a),Kc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&dl(i,a);break;case 13:Sl(i,a,n),n&&o&4&&fl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Kc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&sa(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Hc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&sa(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){Yu(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Hc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Qf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=Cf(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Uc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];al=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Uc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;al!==null;){var n=al;switch(n.tag){case 0:case 11:case 15:Uc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:sa(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,al=r;else a:for(n=e;al!==null;){r=al;var i=r.sibling,a=r.return;if(sl(r),r===n){al=null;break a}if(i!==null){i.return=a,al=i;break a}al=a}}}var Ll={getCacheForType:function(e){var t=$i(aa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return $i(aa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,zl=0,K=null,Bl=null,Vl=0,Hl=0,Ul=null,Wl=!1,Gl=!1,Kl=!1,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=0,$l=0,eu=null,tu=null,nu=!1,ru=0,iu=0,au=1/0,ou=null,su=null,cu=0,lu=null,uu=null,du=0,fu=0,pu=null,mu=null,hu=0,gu=null;function _u(){return zl&2&&Vl!==0?Vl&-Vl:I.T===null?tt():gd()}function vu(){if(Ql===0){if(!(Vl&536870912)||Mi){var e=Be;Be<<=1,!(Be&3932160)&&(Be=262144),Ql=e}else Ql=536870912}return e=to.current,e!==null&&(e.flags|=32),Ql}function yu(e,t,n){(e===K&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)&&(Eu(e,0),Cu(e,Vl,Ql,!1)),Je(e,n),(!(zl&2)||e!==K)&&(e===K&&(!(zl&2)&&(Xl|=n),Jl===4&&Cu(e,Vl,Ql,!1)),cd(e))}function bu(e,t,n){if(zl&6)throw Error(o(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||We(e,t),i=r?Pu(e,t):Mu(e,t,!0),a=r;do{if(i===0){Gl&&!r&&Cu(e,t,0,!1);break}if(n=e.current.alternate,a&&!Su(n)){i=Mu(e,t,!1),a=!1;continue}if(i===2){if(a=t,e.errorRecoveryDisabledLanes&a)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=eu;var l=c.current.memoizedState.isDehydrated;if(l&&(Eu(c,s).flags|=256),s=Mu(c,s,!1),s!==2){if(Kl&&!l){c.errorRecoveryDisabledLanes|=a,Xl|=a,i=4;break a}a=tu,tu=i,a!==null&&(tu===null?tu=a:tu.push.apply(tu,a))}i=s}if(a=!1,i!==2)continue}}if(i===1){Eu(e,0),Cu(e,t,0,!0);break}a:{switch(r=e,a=i,a){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Cu(r,t,Ql,!Wl);break a;case 2:tu=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=ru+300-Ce(),10<i)){if(Cu(r,t,Ql,!Wl),Ue(r,0,!0)!==0)break a;du=t,r.timeoutHandle=$d(xu.bind(null,r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,a,`Throttled`,-0,0),i);break a}xu(r,n,tu,ou,nu,t,Ql,Xl,$l,Wl,a,null,-0,0)}break}while(1);cd(e)}function xu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Xt},jl(t,a,d);var m=(a&62914560)===a?ru-Ce():(a&4194048)===a?iu-Ce():0;if(m=ep(d,m),m!==null){du=a,e.cancelPendingCommit=m(Vu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),Cu(e,a,o,!l);return}}Vu(e,t,a,n,r,i,o,s,c)}function Su(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!yr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Cu(e,t,n,r){t&=~Zl,t&=~Xl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Fe(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&Xe(e,n,t)}function wu(){return zl&6?!0:(ld(0,!1),!1)}function Tu(){if(Bl!==null){if(Hl===0)var e=Bl.return;else e=Bl,Gi=Wi=null,Ao(e),Aa=null,ja=0,e=Bl;for(;e!==null;)Vc(e.alternate,e),e=e.return;Bl=null}}function Eu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,ef(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),du=0,Tu(),K=e,Bl=n=si(e.current,null),Vl=t,Hl=0,Ul=null,Wl=!1,Gl=We(e,t),Kl=!1,$l=Ql=Zl=Xl=Yl=Jl=0,tu=eu=null,nu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Fe(r),a=1<<i;t|=e[i],r&=~a}return ql=t,Zr(),n}function Du(e,t){fo=null,I.H=Bs,t===ba||t===Sa?(t=Oa(),Hl=3):t===xa?(t=Oa(),Hl=4):Hl=t===ic?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Ul=t,Bl===null&&(Jl=1,Qs(e,hi(t,e.current)))}function Ou(){var e=to.current;return e===null?!0:(Vl&4194048)===Vl?no===null:(Vl&62914560)===Vl||Vl&536870912?e===no:!1}function ku(){var e=I.H;return I.H=Bs,e===null?Bs:e}function Au(){var e=I.A;return I.A=Ll,e}function ju(){Jl=4,Wl||(Vl&4194048)!==Vl&&to.current!==null||(Gl=!0),!(Yl&134217727)&&!(Xl&134217727)||K===null||Cu(K,Vl,Ql,!1)}function Mu(e,t,n){var r=zl;zl|=2;var i=ku(),a=Au();(K!==e||Vl!==t)&&(ou=null,Eu(e,t)),t=!1;var o=Jl;a:do try{if(Hl!==0&&Bl!==null){var s=Bl,c=Ul;switch(Hl){case 8:Tu(),o=6;break a;case 3:case 2:case 9:case 6:to.current===null&&(t=!0);var l=Hl;if(Hl=0,Ul=null,Ru(e,s,c,l),n&&Gl){o=0;break a}break;default:l=Hl,Hl=0,Ul=null,Ru(e,s,c,l)}}Nu(),o=Jl;break}catch(t){Du(e,t)}while(1);return t&&e.shellSuspendCounter++,Gi=Wi=null,zl=r,I.H=i,I.A=a,Bl===null&&(K=null,Vl=0,Zr()),o}function Nu(){for(;Bl!==null;)Iu(Bl)}function Pu(e,t){var n=zl;zl|=2;var r=ku(),i=Au();K!==e||Vl!==t?(ou=null,au=Ce()+500,Eu(e,t)):Gl=We(e,t);a:do try{if(Hl!==0&&Bl!==null){t=Bl;var a=Ul;b:switch(Hl){case 1:Hl=0,Ul=null,Ru(e,t,a,1);break;case 2:case 9:if(wa(a)){Hl=0,Ul=null,Lu(t);break}t=function(){Hl!==2&&Hl!==9||K!==e||(Hl=7),cd(e)},a.then(t,t);break a;case 3:Hl=7;break a;case 4:Hl=5;break a;case 7:wa(a)?(Hl=0,Ul=null,Lu(t)):(Hl=0,Ul=null,Ru(e,t,a,7));break;case 5:var s=null;switch(Bl.tag){case 26:s=Bl.memoizedState;case 5:case 27:var c=Bl;if(s?Zf(s):c.stateNode.complete){Hl=0,Ul=null;var l=c.sibling;if(l!==null)Bl=l;else{var u=c.return;u===null?Bl=null:(Bl=u,zu(u))}break b}}Hl=0,Ul=null,Ru(e,t,a,5);break;case 6:Hl=0,Ul=null,Ru(e,t,a,6);break;case 8:Tu(),Jl=6;break a;default:throw Error(o(462))}}Fu();break}catch(t){Du(e,t)}while(1);return Gi=Wi=null,I.H=r,I.A=i,zl=n,Bl===null?(K=null,Vl=0,Zr(),Jl):0}function Fu(){for(;Bl!==null&&!xe();)Iu(Bl)}function Iu(e){var t=Nc(e.alternate,e,ql);e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Lu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=vc(n,t,t.pendingProps,t.type,void 0,Vl);break;case 11:t=vc(n,t,t.pendingProps,t.type.render,t.ref,Vl);break;case 5:Ao(t);default:Vc(n,t),t=Bl=ci(t,ql),t=Nc(n,t,ql)}e.memoizedProps=e.pendingProps,t===null?zu(e):Bl=t}function Ru(e,t,n,r){Gi=Wi=null,Ao(t),Aa=null,ja=0;var i=t.return;try{if(rc(e,i,t,n,Vl)){Jl=1,Qs(e,hi(n,e.current)),Bl=null;return}}catch(t){if(i!==null)throw Bl=i,t;Jl=1,Qs(e,hi(n,e.current)),Bl=null;return}t.flags&32768?(Mi||r===1?e=!0:Gl||Vl&536870912?e=!1:(Wl=e=!0,(r===2||r===9||r===3||r===6)&&(r=to.current,r!==null&&r.tag===13&&(r.flags|=16384))),Bu(t,e)):zu(t)}function zu(e){var t=e;do{if(t.flags&32768){Bu(t,Wl);return}e=t.return;var n=zc(t.alternate,t,ql);if(n!==null){Bl=n;return}if(t=t.sibling,t!==null){Bl=t;return}Bl=t=e}while(t!==null);Jl===0&&(Jl=5)}function Bu(e,t){do{var n=Bc(e.alternate,e);if(n!==null){n.flags&=32767,Bl=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Bl=e;return}Bl=e=n}while(e!==null);Jl=6,Bl=null}function Vu(e,t,n,r,i,a,s,c,l){e.cancelPendingCommit=null;do Ku();while(cu!==0);if(zl&6)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(a=t.lanes|t.childLanes,a|=Xr,Ye(e,n,a,s,c,l),e===K&&(Bl=K=null,Vl=0),uu=t,lu=e,du=n,fu=a,pu=i,mu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,td(De,function(){return qu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=I.T,I.T=null,i=L.p,L.p=2,s=zl,zl|=4;try{W(e,t,n)}finally{zl=s,L.p=i,I.T=r}}cu=1,Hu(),Uu(),Wu()}}function Hu(){if(cu===1){cu=0;var e=lu,t=uu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{_l(t,e);var a=Kd,o=wr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Cr(s.ownerDocument.documentElement,s)){if(c!==null&&Tr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Sr(s,h),v=Sr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}mp=!!Gd,Kd=Gd=null}finally{zl=i,L.p=r,I.T=n}}e.current=t,cu=2}}function Uu(){if(cu===2){cu=0;var e=lu,t=uu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=I.T,I.T=null;var r=L.p;L.p=2;var i=zl;zl|=4;try{ol(e,t.alternate,t)}finally{zl=i,L.p=r,I.T=n}}cu=3}}function Wu(){if(cu===4||cu===3){cu=0,Se();var e=lu,t=uu,n=du,r=mu;t.subtreeFlags&10256||t.flags&10256?cu=5:(cu=0,uu=lu=null,Gu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(su=null),et(n),t=t.stateNode,Ne&&typeof Ne.onCommitFiberRoot==`function`)try{Ne.onCommitFiberRoot(Me,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=I.T,i=L.p,L.p=2,I.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{I.T=t,L.p=i}}du&3&&Ku(),cd(e),i=e.pendingLanes,n&261930&&i&42?e===gu?hu++:(hu=0,gu=e):hu=0,ld(0,!1)}}function Gu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,sa(t)))}function Ku(){return Hu(),Uu(),Wu(),qu()}function qu(){if(cu!==5)return!1;var e=lu,t=fu;fu=0;var n=et(du),r=I.T,i=L.p;try{L.p=32>n?32:n,I.T=null,n=pu,pu=null;var a=lu,s=du;if(cu=0,uu=lu=null,du=0,zl&6)throw Error(o(331));var c=zl;if(zl|=4,Pl(a.current),El(a,a.current,s,n),zl=c,ld(0,!1),Ne&&typeof Ne.onPostCommitFiberRoot==`function`)try{Ne.onPostCommitFiberRoot(Me,a)}catch{}return!0}finally{L.p=i,I.T=r,Gu(e,t)}}function Ju(e,t,n){t=hi(n,t),t=ec(e.stateNode,t,2),e=Ha(e,t,2),e!==null&&(Je(e,2),cd(e))}function Yu(e,t,n){if(e.tag===3)Ju(e,e,n);else for(;t!==null;){if(t.tag===3){Ju(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(su===null||!su.has(r))){e=hi(n,e),n=tc(2),r=Ha(t,n,2),r!==null&&(nc(n,r,t,e),Je(r,2),cd(r));break}}t=t.return}}function Xu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Kl=!0,i.add(n),e=Zu.bind(null,e,t,n),t.then(e,e))}function Zu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,K===e&&(Vl&n)===n&&(Jl===4||Jl===3&&(Vl&62914560)===Vl&&300>Ce()-ru?!(zl&2)&&Eu(e,0):Zl|=n,$l===Vl&&($l=0)),cd(e)}function Qu(e,t){t===0&&(t=Ke()),e=ei(e,t),e!==null&&(Je(e,t),cd(e))}function $u(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function ed(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(o(314))}r!==null&&r.delete(t),Qu(e,n)}function td(e,t){return ye(e,t)}var nd=null,rd=null,id=!1,ad=!1,od=!1,sd=0;function cd(e){e!==rd&&e.next===null&&(rd===null?nd=rd=e:rd=rd.next=e),ad=!0,id||(id=!0,hd())}function ld(e,t){if(!od&&ad){od=!0;do for(var n=!1,r=nd;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Fe(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,md(r,a))}else a=Vl,a=Ue(r,r===K?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||We(r,a)||(n=!0,md(r,a))}r=r.next}while(n);od=!1}}function ud(){dd()}function dd(){ad=id=!1;var e=0;sd!==0&&Qd()&&(e=sd);for(var t=Ce(),n=null,r=nd;r!==null;){var i=r.next,a=fd(r,t);a===0?(r.next=null,n===null?nd=i:n.next=i,i===null&&(rd=n)):(n=r,(e!==0||a&3)&&(ad=!0)),r=i}cu!==0&&cu!==5||ld(e,!1),sd!==0&&(sd=0)}function fd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Fe(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=Ge(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=K,n=Vl,n=Ue(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Hl===2||Hl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&be(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||We(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&be(r),et(n)){case 2:case 8:n=Ee;break;case 32:n=De;break;case 268435456:n=ke;break;default:n=De}return r=pd.bind(null,e),n=ye(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&be(r),e.callbackPriority=2,e.callbackNode=null,2}function pd(e,t){if(cu!==0&&cu!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Ku()&&e.callbackNode!==n)return null;var r=Vl;return r=Ue(e,e===K?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(bu(e,r,t),fd(e,Ce()),e.callbackNode!=null&&e.callbackNode===n?pd.bind(null,e):null)}function md(e,t){if(Ku())return null;bu(e,t,!0)}function hd(){nf(function(){zl&6?ye(Te,ud):dd()})}function gd(){if(sd===0){var e=ua;e===0&&(e=ze,ze<<=1,!(ze&261888)&&(ze=256)),sd=e}return sd}function _d(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:Yt(``+e)}function vd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function yd(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=_d((i[at]||null).action),o=r.submitter;o&&(t=(t=o[at]||null)?_d(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new vn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(sd!==0){var e=o?vd(i,o):new FormData(i);Es(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?vd(i,o):new FormData(i),Es(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var bd=0;bd<Gr.length;bd++){var xd=Gr[bd];Kr(xd.toLowerCase(),`on`+(xd[0].toUpperCase()+xd.slice(1)))}Kr(Lr,`onAnimationEnd`),Kr(Rr,`onAnimationIteration`),Kr(zr,`onAnimationStart`),Kr(`dblclick`,`onDoubleClick`),Kr(`focusin`,`onFocus`),Kr(`focusout`,`onBlur`),Kr(Br,`onTransitionRun`),Kr(Vr,`onTransitionStart`),Kr(Hr,`onTransitionCancel`),Kr(Ur,`onTransitionEnd`),bt(`onMouseEnter`,[`mouseout`,`mouseover`]),bt(`onMouseLeave`,[`mouseout`,`mouseover`]),bt(`onPointerEnter`,[`pointerout`,`pointerover`]),bt(`onPointerLeave`,[`pointerout`,`pointerover`]),yt(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),yt(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),yt(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),yt(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),yt(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Sd=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Cd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Sd));function wd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){qr(e)}i.currentTarget=null,a=c}}}}function Td(e,t){var n=t[st];n===void 0&&(n=t[st]=new Set);var r=e+`__bubble`;n.has(r)||(kd(t,e,2,!1),n.add(r))}function Ed(e,t,n){var r=0;t&&(r|=4),kd(n,e,r,t)}var Dd=`_reactListening`+Math.random().toString(36).slice(2);function Od(e){if(!e[Dd]){e[Dd]=!0,_t.forEach(function(t){t!==`selectionchange`&&(Cd.has(t)||Ed(t,!1,e),Ed(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Dd]||(t[Dd]=!0,Ed(`selectionchange`,!1,t))}}function kd(e,t,n,r){switch(xp(t)){case 2:var i=hp;break;case 8:i=gp;break;default:i=_p}n=i.bind(null,t,n,e),i=void 0,!sn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Ad(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var s=r.stateNode.containerInfo;if(s===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;s!==null;){if(o=pt(s),o===null)return;if(c=o.tag,c===5||c===6||c===26||c===27){r=a=o;continue a}s=s.parentNode}}r=r.return}rn(function(){var r=a,i=Qt(n),o=[];a:{var s=Wr.get(e);if(s!==void 0){var c=vn,u=e;switch(e){case`keypress`:if(pn(n)===0)break a;case`keydown`:case`keyup`:c=In;break;case`focusin`:u=`focus`,c=Dn;break;case`focusout`:u=`blur`,c=Dn;break;case`beforeblur`:case`afterblur`:c=Dn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:c=Tn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:c=En;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:c=Rn;break;case Lr:case Rr:case zr:c=On;break;case Ur:c=zn;break;case`scroll`:case`scrollend`:c=bn;break;case`wheel`:c=Bn;break;case`copy`:case`cut`:case`paste`:c=kn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:c=Ln;break;case`toggle`:case`beforetoggle`:c=Vn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?s===null?null:s+`Capture`:s;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=an(m,p),g!=null&&d.push(jd(m,g,h))),f)break;m=m.return}0<d.length&&(s=new c(s,u,null,n,i),o.push({event:s,listeners:d}))}}if(!(t&7)){a:{if(s=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,s&&n!==Zt&&(u=n.relatedTarget||n.fromElement)&&(pt(u)||u[ot]))break a;if((c||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,c?(u=n.relatedTarget||n.toElement,c=r,u=u?pt(u):null,u!==null&&(f=l(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(c=null,u=r),c!==u)){if(d=Tn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Ln,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?s:ht(c),h=u==null?s:ht(u),s=new d(g,m+`leave`,c,n,i),s.target=f,s.relatedTarget=h,g=null,pt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,c&&u)b:{for(d=Nd,p=c,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;c!==null&&Pd(o,s,c,d,!1),u!==null&&f!==null&&Pd(o,f,u,d,!0)}}a:{if(s=r?ht(r):window,c=s.nodeName&&s.nodeName.toLowerCase(),c===`select`||c===`input`&&s.type===`file`)var v=sr;else if(tr(s)){if(cr)v=_r;else{v=hr;var y=mr}}else c=s.nodeName,!c||c.toLowerCase()!==`input`||s.type!==`checkbox`&&s.type!==`radio`?r&&Kt(r.elementType)&&(v=sr):v=gr;if(v&&=v(e,r)){nr(o,v,n,i);break a}y&&y(e,s,r),e===`focusout`&&r&&s.type===`number`&&r.memoizedProps.value!=null&&Rt(s,`number`,s.value)}switch(y=r?ht(r):window,e){case`focusin`:(tr(y)||y.contentEditable===`true`)&&(Dr=y,Or=r,kr=null);break;case`focusout`:kr=Or=Dr=null;break;case`mousedown`:Ar=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Ar=!1,jr(o,n,i);break;case`selectionchange`:if(Er)break;case`keydown`:case`keyup`:jr(o,n,i)}var b;if(Un)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else Zn?Yn(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&(Kn&&n.locale!==`ko`&&(Zn||x!==`onCompositionStart`?x===`onCompositionEnd`&&Zn&&(b=fn()):(ln=i,un=`value`in ln?ln.value:ln.textContent,Zn=!0)),y=Md(r,x),0<y.length&&(x=new An(x,e,null,n,i),o.push({event:x,listeners:y}),b?x.data=b:(b=Xn(n),b!==null&&(x.data=b)))),(b=Gn?Qn(e,n):$n(e,n))&&(x=Md(r,`onBeforeInput`),0<x.length&&(y=new An(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:y,listeners:x}),y.data=b)),yd(o,e,r,n,i)}wd(o,t)})}function jd(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Md(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=an(e,n),i!=null&&r.unshift(jd(e,i,a)),i=an(e,t),i!=null&&r.push(jd(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Nd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pd(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=an(n,a),l!=null&&o.unshift(jd(n,l,c))):i||(l=an(n,a),l!=null&&o.push(jd(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var Fd=/\r\n?/g,Id=/\u0000|\uFFFD/g;function Ld(e){return(typeof e==`string`?e:``+e).replace(Fd,`
|
|
10
|
+
`).replace(Id,``)}function Rd(e,t){return t=Ld(t),Ld(e)===t}function zd(e,t,n,r,i,a){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Ht(e,``+r);break;case`className`:Et(e,`class`,r);break;case`tabIndex`:Et(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Et(e,n,r);break;case`style`:Gt(e,r,a);break;case`data`:if(t!==`object`){Et(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof a==`function`&&(n===`formAction`?(t!==`input`&&zd(e,t,`name`,i.name,i,null),zd(e,t,`formEncType`,i.formEncType,i,null),zd(e,t,`formMethod`,i.formMethod,i,null),zd(e,t,`formTarget`,i.formTarget,i,null)):(zd(e,t,`encType`,i.encType,i,null),zd(e,t,`method`,i.method,i,null),zd(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=Yt(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=Yt(``+r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Td(`beforetoggle`,e),Td(`toggle`,e),Tt(e,`popover`,r);break;case`xlinkActuate`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Dt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Dt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Tt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=qt.get(n)||n,Tt(e,n,r))}}function Bd(e,t,n,r,i,a){switch(n){case`style`:Gt(e,r,a);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(o(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Ht(e,r):(typeof r==`number`||typeof r==`bigint`)&&Ht(e,``+r);break;case`onScroll`:r!=null&&Td(`scroll`,e);break;case`onScrollEnd`:r!=null&&Td(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=Xt);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),t=n.slice(2,i?n.length-7:void 0),a=e[at]||null,a=a==null?null:a[n],typeof a==`function`&&e.removeEventListener(t,a,i),typeof r==`function`)){typeof a!=`function`&&a!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,i);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Tt(e,n,r)}}}function Vd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Td(`error`,e),Td(`load`,e);var r=!1,i=!1,a;for(a in n)if(n.hasOwnProperty(a)){var s=n[a];if(s!=null)switch(a){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:zd(e,t,a,s,n,null)}}i&&zd(e,t,`srcSet`,n.srcSet,n,null),r&&zd(e,t,`src`,n.src,n,null);return;case`input`:Td(`invalid`,e);var c=a=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:a=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(o(137,t));break;default:zd(e,t,r,d,n,null)}}Lt(e,a,c,l,u,s,i,!1);return;case`select`:for(i in Td(`invalid`,e),r=s=a=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:a=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:zd(e,t,i,c,n,null)}t=a,n=s,e.multiple=!!r,t==null?n!=null&&zt(e,!!r,n,!0):zt(e,!!r,t,!1);return;case`textarea`:for(s in Td(`invalid`,e),a=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:a=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(o(91));break;default:zd(e,t,s,c,n,null)}Vt(e,r,i,a);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:zd(e,t,l,r,n,null)}return;case`dialog`:Td(`beforetoggle`,e),Td(`toggle`,e),Td(`cancel`,e),Td(`close`,e);break;case`iframe`:case`object`:Td(`load`,e);break;case`video`:case`audio`:for(r=0;r<Sd.length;r++)Td(Sd[r],e);break;case`image`:Td(`error`,e),Td(`load`,e);break;case`details`:Td(`toggle`,e);break;case`embed`:case`source`:case`link`:Td(`error`,e),Td(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(o(137,t));default:zd(e,t,u,r,n,null)}return;default:if(Kt(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Bd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&zd(e,t,c,r,n,null))}function Hd(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,a=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||zd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:a=m;break;case`name`:i=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(o(137,t));break;default:m!==f&&zd(e,t,p,m,r,f)}}It(e,s,c,l,u,d,a,i);return;case`select`:for(a in m=s=c=p=null,n)if(l=n[a],n.hasOwnProperty(a)&&l!=null)switch(a){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(a)||zd(e,t,a,null,r,l)}for(i in r)if(a=r[i],l=n[i],r.hasOwnProperty(i)&&(a!=null||l!=null))switch(i){case`value`:p=a;break;case`defaultValue`:c=a;break;case`multiple`:s=a;default:a!==l&&zd(e,t,i,a,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?zt(e,!!n,n?[]:``,!1):zt(e,!!n,t,!0)):zt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:zd(e,t,c,null,r,i)}for(s in r)if(i=r[s],a=n[s],r.hasOwnProperty(s)&&(i!=null||a!=null))switch(s){case`value`:p=i;break;case`defaultValue`:m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(o(91));break;default:i!==a&&zd(e,t,s,i,r,a)}Bt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:zd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:zd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&zd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(o(137,t));break;default:zd(e,t,u,p,r,m)}return;default:if(Kt(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Bd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Bd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&zd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||zd(e,t,f,p,r,m)}function Ud(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Wd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ud(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ud(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var Gd=null,Kd=null;function qd(e){return e.nodeType===9?e:e.ownerDocument}function Jd(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function Yd(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function Xd(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Zd=null;function Qd(){var e=window.event;return e&&e.type===`popstate`?e!==Zd&&(Zd=e,!0):(Zd=null,!1)}var $d=typeof setTimeout==`function`?setTimeout:void 0,ef=typeof clearTimeout==`function`?clearTimeout:void 0,tf=typeof Promise==`function`?Promise:void 0,nf=typeof queueMicrotask==`function`?queueMicrotask:tf===void 0?$d:function(e){return tf.resolve(null).then(e).catch(rf)};function rf(e){setTimeout(function(){throw e})}function af(e){return e===`head`}function of(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Bp(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)bf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,bf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[dt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&bf(e.ownerDocument.body)}n=i}while(n);Bp(t)}function sf(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function cf(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cf(n),ft(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[dt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hf(e.nextSibling),e===null)break}return null}function uf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hf(e.nextSibling),e===null))return null;return e}function df(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hf(e.nextSibling),e===null))return null;return e}function ff(e){return e.data===`$?`||e.data===`$~`}function pf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hf(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gf=null;function _f(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function yf(e,t,n){switch(t=qd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(o(452));return e;case`head`:if(e=t.head,!e)throw Error(o(453));return e;case`body`:if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function bf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ft(e)}var xf=new Map,Sf=new Set;function Cf(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var wf=L.d;L.d={f:Tf,r:Ef,D:kf,C:Af,L:jf,m:Mf,X:Pf,S:Nf,M:Ff};function Tf(){var e=wf.f(),t=wu();return e||t}function Ef(e){var t=mt(e);t!==null&&t.tag===5&&t.type===`form`?Os(t):wf.r(e)}var Df=typeof document>`u`?null:document;function Of(e,t,n){var r=Df;if(r&&typeof t==`string`&&t){var i=Ft(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Sf.has(i)||(Sf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Vd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function kf(e){wf.D(e),Of(`dns-prefetch`,e,null)}function Af(e,t){wf.C(e,t),Of(`preconnect`,e,t)}function jf(e,t,n){wf.L(e,t,n);var r=Df;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ft(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ft(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ft(n.imageSizes)+`"]`)):i+=`[href="`+Ft(e)+`"]`;var a=i;switch(t){case`style`:a=Lf(e);break;case`script`:a=Vf(e)}xf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),xf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Rf(a))||t===`script`&&r.querySelector(Hf(a))||(t=r.createElement(`link`),Vd(t,`link`,e),gt(t),r.head.appendChild(t)))}}function Mf(e,t){wf.m(e,t);var n=Df;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ft(r)+`"][href="`+Ft(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Vf(e)}if(!xf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),xf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Hf(a)))return}r=n.createElement(`link`),Vd(r,`link`,e),gt(r),n.head.appendChild(r)}}}function Nf(e,t,n){wf.S(e,t,n);var r=Df;if(r&&e){var i=V(r).hoistableStyles,a=Lf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Rf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=xf.get(a))&&Gf(e,n);var c=o=r.createElement(`link`);gt(c),Vd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Wf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Pf(e,t){wf.X(e,t);var n=Df;if(n&&e){var r=V(n).hoistableScripts,i=Vf(e),a=r.get(i);a||(a=n.querySelector(Hf(i)),a||(e=h({src:e,async:!0},t),(t=xf.get(i))&&Kf(e,t),a=n.createElement(`script`),gt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Ff(e,t){wf.M(e,t);var n=Df;if(n&&e){var r=V(n).hoistableScripts,i=Vf(e),a=r.get(i);a||(a=n.querySelector(Hf(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=xf.get(i))&&Kf(e,t),a=n.createElement(`script`),gt(a),Vd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function If(e,t,n,r){var i=(i=ae.current)?Cf(i):null;if(!i)throw Error(o(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Lf(n.href),n=V(i).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Lf(n.href);var a=V(i).hoistableStyles,s=a.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},a.set(e,s),(a=i.querySelector(Rf(e)))&&!a._p&&(s.instance=a,s.state.loading=5),xf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},xf.set(e,n),a||Bf(i,e,n,s.state))),t&&r===null)throw Error(o(528,``));return s}if(t&&r!==null)throw Error(o(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Vf(n),n=V(i).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(o(444,e))}}function Lf(e){return`href="`+Ft(e)+`"`}function Rf(e){return`link[rel="stylesheet"][`+e+`]`}function zf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Bf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Vd(t,`link`,n),gt(t),e.head.appendChild(t))}function Vf(e){return`[src="`+Ft(e)+`"]`}function Hf(e){return`script[async]`+e}function Uf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ft(n.href)+`"]`);if(r)return t.instance=r,gt(r),r;var i=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),gt(r),Vd(r,`style`,i),Wf(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Lf(n.href);var a=e.querySelector(Rf(i));if(a)return t.state.loading|=4,t.instance=a,gt(a),a;r=zf(n),(i=xf.get(i))&&Gf(r,i),a=(e.ownerDocument||e).createElement(`link`),gt(a);var s=a;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Vd(a,`link`,r),t.state.loading|=4,Wf(a,n.precedence,e),t.instance=a;case`script`:return a=Vf(n.src),(i=e.querySelector(Hf(a)))?(t.instance=i,gt(i),i):(r=n,(i=xf.get(a))&&(r=h({},n),Kf(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),gt(i),Vd(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(o(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Wf(r,n.precedence,e));return t.instance}function Wf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Gf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Kf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var qf=null;function Jf(e,t,n){if(qf===null){var r=new Map,i=qf=new Map;i.set(n,r)}else i=qf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[dt]||a[it]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Yf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Xf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Zf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Qf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Lf(r.href),a=t.querySelector(Rf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=tp.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,gt(a);return}a=t.ownerDocument||t,r=zf(r),(i=xf.get(i))&&Gf(r,i),a=a.createElement(`link`),gt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Vd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=tp.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var $f=0;function ep(e,t){return e.stylesheets&&e.count===0&&rp(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&$f===0&&($f=62500*Wd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&rp(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>$f?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function tp(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)rp(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var np=null;function rp(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,np=new Map,t.forEach(ip,e),np=null,tp.call(e))}function ip(e,t){if(!(t.state.loading&4)){var n=np.get(e);if(n)var r=n.get(null);else{n=new Map,np.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=tp.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ap={$$typeof:C,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function op(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=qe(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qe(0),this.hiddenUpdates=qe(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function sp(e,t,n,r,i,a,o,s,c,l,u,d){return e=new op(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ai(3,null,null,t),e.current=a,a.stateNode=e,t=oa(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},za(a),e}function cp(e){return e?(e=ri,e):ri}function lp(e,t,n,r,i,a){i=cp(i),r.context===null?r.context=i:r.pendingContext=i,r=Va(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Ha(e,r,t),n!==null&&(yu(n,e,t),Ua(n,e,t))}function up(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function dp(e,t){up(e,t),(e=e.alternate)&&up(e,t)}function fp(e){if(e.tag===13||e.tag===31){var t=ei(e,67108864);t!==null&&yu(t,e,67108864),dp(e,67108864)}}function pp(e){if(e.tag===13||e.tag===31){var t=_u();t=$e(t);var n=ei(e,t);n!==null&&yu(n,e,t),dp(e,t)}}var mp=!0;function hp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=2,_p(e,t,n,r)}finally{L.p=a,I.T=i}}function gp(e,t,n,r){var i=I.T;I.T=null;var a=L.p;try{L.p=8,_p(e,t,n,r)}finally{L.p=a,I.T=i}}function _p(e,t,n,r){if(mp){var i=vp(r);if(i===null)Ad(e,t,r,yp,n),Ap(e,r);else if(Mp(i,e,t,n,r))r.stopPropagation();else if(Ap(e,r),t&4&&-1<kp.indexOf(e)){for(;i!==null;){var a=mt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=He(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Fe(o);s.entanglements[1]|=c,o&=~c}cd(a),!(zl&6)&&(au=Ce()+500,ld(0,!1))}}break;case 31:case 13:s=ei(a,2),s!==null&&yu(s,a,2),wu(),dp(a,2)}if(a=vp(r),a===null&&Ad(e,t,r,yp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Ad(e,t,r,null,n)}}function vp(e){return e=Qt(e),bp(e)}var yp=null;function bp(e){if(yp=null,e=pt(e),e!==null){var t=l(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=u(t),e!==null)return e;e=null}else if(n===31){if(e=d(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return yp=e,null}function xp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(we()){case Te:return 2;case Ee:return 8;case De:case Oe:return 32;case ke:return 268435456;default:return 32}default:return 32}}var Sp=!1,Cp=null,wp=null,Tp=null,Ep=new Map,Dp=new Map,Op=[],kp=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Ap(e,t){switch(e){case`focusin`:case`focusout`:Cp=null;break;case`dragenter`:case`dragleave`:wp=null;break;case`mouseover`:case`mouseout`:Tp=null;break;case`pointerover`:case`pointerout`:Ep.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Dp.delete(t.pointerId)}}function jp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=mt(t),t!==null&&fp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Mp(e,t,n,r,i){switch(t){case`focusin`:return Cp=jp(Cp,e,t,n,r,i),!0;case`dragenter`:return wp=jp(wp,e,t,n,r,i),!0;case`mouseover`:return Tp=jp(Tp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ep.set(a,jp(Ep.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Dp.set(a,jp(Dp.get(a)||null,e,t,n,r,i)),!0}return!1}function Np(e){var t=pt(e.target);if(t!==null){var n=l(t);if(n!==null){if(t=n.tag,t===13){if(t=u(n),t!==null){e.blockedOn=t,nt(e.priority,function(){pp(n)});return}}else if(t===31){if(t=d(n),t!==null){e.blockedOn=t,nt(e.priority,function(){pp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=vp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Zt=r,n.target.dispatchEvent(r),Zt=null}else return t=mt(n),t!==null&&fp(t),e.blockedOn=n,!1;t.shift()}return!0}function Fp(e,t,n){Pp(e)&&n.delete(t)}function Ip(){Sp=!1,Cp!==null&&Pp(Cp)&&(Cp=null),wp!==null&&Pp(wp)&&(wp=null),Tp!==null&&Pp(Tp)&&(Tp=null),Ep.forEach(Fp),Dp.forEach(Fp)}function Lp(e,n){e.blockedOn===n&&(e.blockedOn=null,Sp||(Sp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Ip)))}var Rp=null;function zp(e){Rp!==e&&(Rp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Rp===e&&(Rp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(bp(r||n)===null)continue;break}var a=mt(n);a!==null&&(e.splice(t,3),t-=3,Es(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Bp(e){function t(t){return Lp(t,e)}Cp!==null&&Lp(Cp,e),wp!==null&&Lp(wp,e),Tp!==null&&Lp(Tp,e),Ep.forEach(t),Dp.forEach(t);for(var n=0;n<Op.length;n++){var r=Op[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Op.length&&(n=Op[0],n.blockedOn===null);)Np(n),n.blockedOn===null&&Op.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[at]||null;if(typeof a==`function`)o||zp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[at]||null)s=o.formAction;else if(bp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),zp(n)}}}function Vp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Hp(e){this._internalRoot=e}Up.prototype.render=Hp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var n=t.current;lp(n,_u(),e,t,null,null)},Up.prototype.unmount=Hp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lp(e.current,2,null,e,null,null),wu(),t[ot]=null}};function Up(e){this._internalRoot=e}Up.prototype.unstable_scheduleHydration=function(e){if(e){var t=tt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Op.length&&t!==0&&t<Op[n].priority;n++);Op.splice(n,0,e),n===0&&Np(e)}};var Wp=n.version;if(Wp!==`19.2.8`)throw Error(o(527,Wp,`19.2.8`));L.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(o(188)):(e=Object.keys(e).join(`,`),Error(o(268,e)));return e=p(t),e=e===null?null:m(e),e=e===null?null:e.stateNode,e};var Gp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:I,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var Kp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Kp.isDisabled&&Kp.supportsFiber)try{Me=Kp.inject(Gp),Ne=Kp}catch{}}e.createRoot=function(e,t){if(!c(e))throw Error(o(299));var n=!1,r=``,i=Ys,a=Xs,s=Zs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(a=t.onCaughtError),t.onRecoverableError!==void 0&&(s=t.onRecoverableError)),t=sp(e,1,!1,null,null,n,r,null,i,a,s,Vp),e[ot]=t.current,Od(e),new Hp(t)}})),l=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=c()})),u=n((e=>{var t=r().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),d=n(((e,t)=>{t.exports=u()})),f={locales:[`en`,`en-GB`,`fr`,`es`,`de`,`ja`,`ko`,`zh`,`it`,`pt`,`hi`,`ar`,`ru`],requiredLocales:[`en`,`en-GB`,`fr`,`es`,`de`,`ja`,`ko`,`zh`,`it`,`pt`,`hi`,`ar`,`ru`],strictMode:`strict`,defaultLocale:`en`},p={mode:`prefix-no-default`,storage:{cookies:[{name:`INTLAYER_LOCALE`,attributes:{path:`/`}}],headers:[{name:`x-intlayer-locale`}]},basePath:``},m={editorURL:`http://localhost:8000`,cmsURL:`https://app.intlayer.org`,backendURL:`https://back.intlayer.org`,port:8e3,enabled:!1,dictionaryPriorityStrategy:`local_first`,liveSync:!1,liveSyncPort:4e3,liveSyncURL:`http://localhost:4000`},h={mode:`default`,prefix:`\x1B[38;5;239m[intlayer] \x1B[0m`},g=n((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),_=n(((e,t)=>{t.exports=g()})),v=t(r(),1),y=_(),b=({children:e,value:t,additionalProps:n})=>{let r=(0,v.isValidElement)(e)?e:(0,y.jsx)(y.Fragment,{children:e});return new Proxy(r,{get(e,r,i){if(r===`value`)return t;if(r===Symbol.toPrimitive)return()=>t??``;if(r===`toString`)return()=>String(t??``);if(r===`valueOf`)return()=>t;if(n&&Object.hasOwn(n,r))return n[r];if(t!=null&&typeof r==`string`&&r!==`constructor`&&!(r in e)){let e=Object(t);if(r in e){let n=e[r];return typeof n==`function`?n.bind(t):n}}return Reflect.get(e,r,i)}})},x=(e,t)=>{let n=Object.keys(e),r=n[n.length-1];return e[`${t}`]??e.fallback??e[r]},S=`translation`,C=`enumeration`,w=`plural`,T=`condition`,E=`insertion`,D=`file`,O=`object`,k=`array`,A=`nested`,j=`reactNode`,M=`preactNode`,N=`solidNode`,P=`markdown`,F=`html`,I=`text`,L=`number`,ee=`boolean`,te=`gender`,ne=`select`,R=`null`,z=`unknown`,B=(e,t)=>{for(let n of t.plugins??[])if(n.canHandle(e))return n.transform(e,t,(e,t)=>B(e,t));if(typeof e!=`object`||!e||e.$$typeof!==void 0||e.__v_isVNode!==void 0||e._isVNode!==void 0||e.isJSX!==void 0||typeof e==`function`)return e;if(Array.isArray(e))return e.map((e,n)=>B(e,{...t,children:e,keyPath:[...t.keyPath,{type:k,key:n}]}));let n={};for(let r in e){let i={...t,children:e[r],keyPath:[...t.keyPath,{type:O,key:r}]};if(t.eager){n[r]=B(e[r],i);continue}Object.defineProperty(n,r,{enumerable:!0,configurable:!0,get:function(){let t=B(e[r],i);return Object.defineProperty(this,r,{value:t,enumerable:!0,configurable:!0}),t}})}return n},re=(e,t)=>e.replace(/\{\{\s*(.*?)\s*\}\}/g,(e,n)=>(t[n.trim()]??``).toString()),ie=`default`,ae=/[^A-Za-z0-9._&=-]/g,oe=/[^A-Za-z0-9._-]/g,se=e=>`%${e.charCodeAt(0).toString(16).toUpperCase().padStart(4,`0`)}`,ce=(e,t)=>{if(e===``)return`%`;let n=e.replace(t,se);return n===`.`||n===`..`?n.replace(/\./g,`%002E`):n},le=e=>e===void 0?ie:typeof e==`string`?ce(e,ae):Object.keys(e).sort().map(t=>`${ce(t,oe)}=${ce(String(e[t]),oe)}`).join(`&`),ue=e=>Array.isArray(e)?e.length===0?[ie]:e.map(le):[le(e)],de=(e,t)=>{for(let n of e)if(t(n))return n;return t(`default`)?ie:e[0]??`default`},fe=(e,t,n,r)=>{let i=e.split(`/`);return t.every((e,t)=>e===`variant`?i[t]===r:n?.item===void 0||i[t]===String(n.item))},pe=e=>typeof e==`object`&&!!e&&`qualifierTypes`in e&&Array.isArray(e.qualifierTypes)&&`content`in e,me=(e,t)=>{let n=t.split(`/`),r={key:e.key,content:e.content[t]};return e.qualifierTypes.forEach((e,t)=>{e===`variant`?r.variant=n[t]:e===`item`&&(r.item=Number(n[t]))}),r},he=(e,t)=>{if(!pe(e))return e;let{qualifierTypes:n,content:r}=e,i=n.includes(`item`)&&t?.item===void 0,a=Object.keys(r),o=n.indexOf(`variant`),s=o===-1?ie:de(ue(t?.variant),e=>a.some(t=>t.split(`/`)[o]===e)),c=a.filter(e=>fe(e,n,t,s)).map(t=>me(e,t));return i?c.sort((e,t)=>(e.item??0)-(t.item??0)):c[0]??null},ge=e=>typeof e==`object`&&e?{locale:e.locale,selector:e}:{locale:e},_e=e=>e?Object.keys(e).filter(e=>e!==`locale`).sort().map(t=>{let n=e[t];return`${t}:${t===`variant`?ue(n).join(`,`):String(n)}`}).join(`|`):``,ve=`\x1B[0m`,ye=`\x1B[34m`,be=`\x1B[31m`,xe=`\x1B[32m`,Se=`\x1B[38;5;3m`,Ce,we=e=>Ce===void 0?e:Ce,Te=(e,t)=>{let n=t?.config??{},r=n.mode??`default`;if(r===`disabled`||t?.isVerbose&&r!==`verbose`)return;let i=we(n.prefix),a=i?[i,...[e].flat()]:[e].flat(),o=t?.level??`info`;(n[o]??console[o]??n.log??console.log)(...a)},Ee=(e,t)=>(n,r)=>Te(n,{...r??{},config:{...e?.log,...t?.config,...r?.config??{}}}),De=(e,t,n)=>t&&typeof window>`u`?`${t}${e}${n?typeof n==`boolean`?ve:n:ve}`:e,Oe=(e,t=Se,n=ve)=>[e].flat().map(e=>De(e,t,n)).join(`, `);De(`✗`,be),De(`✓`,xe),De(`⏲`,ye);var ke={},Ae=()=>ke,je=(e=``)=>new Proxy({},{get:(t,n)=>n===`toJSON`||n===Symbol.toPrimitive||n===`toString`||n===`valueOf`?()=>e:n===`then`?void 0:n===Symbol.iterator?function*(){yield e}:je(e?`${e}.${String(n)}`:String(n))}),Me=new Map,Ne=new Set,Pe=(e,t,n)=>{let r=Ae()[e];if(!r)return Ne.has(e)||(Ee({log:h})(typeof window>`u`?`Dictionary ${Oe(e)} was not found. Using fallback proxy.`:`Dictionary ${e} was not found. Using fallback proxy.`,{level:`warn`}),Ne.add(e)),je(e);let i;i=t;let a=`${e}_${i??`default`}__${n?`custom_plugins`:`default_plugins`}`;if(Me.has(a))return Me.get(a);let o=ct(r,t,n);return Me.set(a,o),o},Fe=50,Ie=new Map,Le=new Set,Re=e=>{Le.has(e)||(Le.add(e),console.warn(`[intlayer] \`Intl.${e}\` is not available in this JavaScript engine. A degraded fallback is used instead. On React Native, load a polyfill (e.g. \`@formatjs/intl-${e.toLowerCase()}/polyfill\`) before rendering your app.`))},ze={DisplayNames:class{of(e){return e}},ListFormat:class{format(e){return Array.from(e).join(`, `)}formatToParts(e){return Array.from(e).flatMap((e,t)=>t===0?[{type:`element`,value:e}]:[{type:`literal`,value:`, `},{type:`element`,value:e}])}},Segmenter:class{segment(e){let t=0;return Array.from(e).map(e=>{let n=t;return t+=e.length,{segment:e,index:n}})}}},Be=e=>{let t=Intl[e];return typeof t==`function`?t:(Re(e),ze[e])};function Ve(e,t,n){let r=t??f?.defaultLocale,i=`${r}|${n?JSON.stringify(n):``}`,a=e,o=Ie.get(a);o||(o=new Map,Ie.set(a,o));let s=o.get(i);if(!s){let t=typeof e==`string`?Be(e):e;if(typeof t!=`function`)throw Error(`[intlayer] \`Intl.${String(e)}\` is not available in this JavaScript engine and has no fallback. Load the matching polyfill before formatting.`);o.size>Fe&&o.clear(),s=new t(r,n),o.set(i,s)}return s}var He={Collator:function(e,t){return Ve(`Collator`,e,t)},DateTimeFormat:function(e,t){return Ve(`DateTimeFormat`,e,t)},DisplayNames:function(e,t){return Ve(`DisplayNames`,e,t)},ListFormat:function(e,t){return Ve(`ListFormat`,e,t)},NumberFormat:function(e,t){return Ve(`NumberFormat`,e,t)},PluralRules:function(e,t){return Ve(`PluralRules`,e,t)},RelativeTimeFormat:function(e,t){return Ve(`RelativeTimeFormat`,e,t)},Segmenter:function(e,t){return Ve(`Segmenter`,e,t)}},Ue=e=>{if(typeof e!=`object`||!e||typeof e.then==`function`||e.$$typeof!==void 0||e.__v_isVNode!==void 0||e._isVNode!==void 0||e.isJSX!==void 0)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Array.isArray(e)},We=(e,t)=>{if(e===void 0)return t;if(t===void 0||Array.isArray(e))return e;if(Ue(e)&&Ue(t)){let n={...e};for(let r of Object.keys(t))r!==`__proto__`&&r!==`constructor`&&t[r]!==void 0&&(n[r]=e[r]===void 0?t[r]:We(e[r],t[r]));return n}return e},Ge=(e,t,n)=>{let r=t=>e[t],i=new Set,a=[],o=e=>{e&&!i.has(e)&&(i.add(e),a.push(e))};o(t),t.includes(`-`)&&o(t.split(`-`)[0]),o(n),n?.includes(`-`)&&o(n.split(`-`)[0]);let s=[];for(let e of a){let t=r(e);if(t!==void 0){if(typeof t==`string`){if(s.length===0)return t;continue}s.push(t)}}if(s.length!==0)return s.length===1||Array.isArray(s[0])?s[0]:s.reduce((e,t)=>We(e,t))},Ke=e=>{if(typeof e!=`object`||!e||!(`nodeType`in e))return!1;let{nodeType:t}=e;return!1},qe=e=>{if(typeof e==`string`)return e;if(Ke(e))return e.nodeType===`html`?e[F]:e[P]},Je=(e,t)=>{if(typeof e==`string`)return t;if(Ke(e)){let n=e.nodeType===`html`?F:P;return{...e,[n]:t}}return e},Ye=(e,t,n,r,i)=>{let a=Je(e,re(qe(e),t));return i(a,{...n,plugins:r,children:a})},Xe={id:`fallback-plugin`,canHandle:()=>!1,transform:e=>e},Ze=(e,t)=>({}).INTLAYER_NODE_TYPE_TRANSLATION===`false`?Xe:{id:`translation-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===`translation`,transform:(n,r,i)=>{let a=n.translation??{},o={};for(let e in a){let t={...r,children:a[e],keyPath:[...r.keyPath,{type:S,key:e}]};o[e]=i(a[e],t)}return Ge(o,e,t)}},Qe=Xe,$e=e=>Xe,et={}.INTLAYER_NODE_TYPE_CONDITION===`false`?Xe:{id:`condition-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===`condition`,transform:(e,t,n)=>{let r=e[T],i={};for(let e in r){let a=r[e];i[e]=n(a,{...t,children:a,keyPath:[...t.keyPath,{type:T,key:e}]})}return e=>{let t=typeof e==`boolean`?e:e.value,n=x(i,t);return typeof n==`function`&&typeof e==`object`?n(e):n}}},tt={}.INTLAYER_NODE_TYPE_INSERTION===`false`?Xe:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===`insertion`,transform:(e,t,n)=>{let r=[...t.keyPath,{type:E}],i=e[E],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||Ke(e),transform:(e,n,r)=>{if(Ke(e))return i=>Ye(e,i,n,t.plugins,r);let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let a=re(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}},nt=Xe,rt=Xe,it=e=>Xe,at=Xe,ot=(e,t=!0)=>[Ze(e??f.defaultLocale,t?f.defaultLocale:void 0),Qe,et,tt,it(e??f.defaultLocale),at,nt,rt],st=(e,t,n=[])=>B(e,{...t,plugins:n}),ct=(e,t,n)=>{let{locale:r,selector:i}=ge(t),a=n??ot(r),o=he(e,i),s=e=>{let t={dictionaryKey:e.key,dictionaryPath:e.filePath,keyPath:[],plugins:a,nestedDictionaries:e.nestedDictionaries};return st(e.content,t,a)};return o===null?null:Array.isArray(o)?o.map(s):s(o)},lt=e=>e!=null&&typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`,ut=/\{\{\s*(.*?)\s*\}\}/g,dt=(e,t={})=>{if(!Object.values(t).some(lt))return{isSimple:!0,parts:e.replace(ut,(e,n)=>(t[n.trim()]??``).toString())};let n=e.split(ut),r=[];for(let e=0;e<n.length;e++)if(e%2==0)n[e]&&r.push(n[e]);else{let i=t[n[e].trim()];i!=null&&r.push(i)}return{isSimple:!1,parts:r}},ft=`modulepreload`,pt=function(e){return`/`+e},mt={},ht=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href},a=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=pt(e,n),e=i(e),e in mt)return;mt[e]=!0;let t=e.endsWith(`.css`);for(let n=a.length-1;n>=0;n--){let r=a[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}let r=document.createElement(`link`);if(r.rel=t?`stylesheet`:ft,t||(r.as=`script`),r.crossOrigin=``,r.href=e,s&&r.setAttribute(`nonce`,s),document.head.appendChild(r),t)return new Promise((t,n)=>{r.addEventListener(`load`,t),r.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},V=d(),gt={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{plugins:t,...n})=>b({...n,value:n.children,children:n.children})},_t=Xe,vt=(e,t)=>{let n=dt(e,t);return n.isSimple?n.parts:(0,v.createElement)(v.Fragment,null,...n.parts.map((e,t)=>(0,v.createElement)(v.Fragment,{key:t},e)))},yt={}.INTLAYER_NODE_TYPE_INSERTION===`false`?Xe:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===`insertion`,transform:(e,t,n)=>{let r=[...t.keyPath,{type:E}],i=e[E],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||Ke(e),transform:(e,n,r)=>{if(Ke(e))return i=>Ye(e,i,n,t.plugins,r);let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let a=vt(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}},o=n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]});return typeof i==`object`&&i&&`nodeType`in i&&[`enumeration`,`condition`].includes(i.nodeType)?e=>t=>{let n=o(t);return typeof n==`function`?n(e):n}:o}},bt=Xe,xt=Xe,St=new Map,Ct=(e,t=!0)=>{let n=`${e??f.defaultLocale}_${t}`;if(St.has(n))return St.get(n);let r=[Ze(e??f.defaultLocale,t?f.defaultLocale:void 0),Qe,$e(e??f.defaultLocale),et,it(e??f.defaultLocale),at,nt,rt,gt,_t,yt,bt,xt];return St.set(n,r),r},wt=(e,t)=>Pe(e,t,Ct(typeof t==`object`&&t?t.locale:t)),Tt=(e,t)=>ct(e,t,Ct(typeof t==`object`&&t?t.locale:t)),Et=e=>typeof e==`object`&&e?.key!==void 0&&e?.props!==void 0,Dt=e=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e),Ot=e=>{if(typeof e==`number`)return Date.now()+e*1e3;if(typeof e==`string`){let t=Date.parse(e);return Number.isNaN(t)?void 0:t}},kt=(e,t,n)=>{let r=[`${e}=${encodeURIComponent(t)}`];n.path&&r.push(`Path=${n.path}`),n.domain&&r.push(`Domain=${n.domain}`);let i=Ot(n.expires);return i!==void 0&&r.push(`Expires=${new Date(i).toUTCString()}`),n.secure&&r.push(`Secure`),n.sameSite&&r.push(`SameSite=${n.sameSite}`),r.join(`; `)},At={}.INTLAYER_ROUTING_STORAGE_COOKIES===`false`;({}).INTLAYER_ROUTING_STORAGE_HEADERS;var jt={getCookie:e=>document.cookie.split(`;`).find(t=>t.trim().startsWith(`${e}=`))?.split(`=`)[1],getLocaleStorage:e=>localStorage.getItem(e),getSessionStorage:e=>sessionStorage.getItem(e),isCookieEnabled:!0,setCookieStore:(e,t,n)=>cookieStore.set({name:e,value:t,path:n.path,domain:n.domain,expires:n.expires,sameSite:n.sameSite}),setCookieString:(e,t)=>{document.cookie=t},setSessionStorage:(e,t)=>sessionStorage.setItem(e,t),setLocaleStorage:(e,t)=>localStorage.setItem(e,t)},Mt=(e=jt)=>{let{locales:t}=f;if(e?.isCookieEnabled===!1)return;let n=e=>!!e&&t.includes(e);if(!At)for(let t=0;t<(p.storage.cookies??[]).length;t++)try{let r=e?.getCookie?.(p.storage.cookies[t].name);if(n(r))return r}catch{}},Nt=(e,t)=>{if(t?.isCookieEnabled!==!1&&!At&&p.storage.cookies)for(let n=0;n<p.storage.cookies.length;n++){let{name:r,attributes:i}=p.storage.cookies[n];try{t?.setCookieStore&&t.setCookieStore(r,e,{...i,expires:Ot(i.expires)})}catch{try{t?.setCookieString&&t.setCookieString(r,kt(r,e,i))}catch{}}}},Pt=(e,t)=>e.every((e,n)=>t[n]&&t[n].key===e.key&&t[n].type===e.type),Ft=Mt(jt),It=(e,t)=>Nt(e,{...jt,isCookieEnabled:t}),Lt=()=>{typeof window<`u`&&(window.intlayer={enabled:!0})},Rt=e=>{if(!e||typeof e!=`string`)return``;let t=e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},zt=`https://back.intlayer.org`,Bt=[`en`],Vt=(e,t=f?.locales)=>{let n=Dt(e),r=e;e?.endsWith(`/`)&&(r=e.slice(0,-1));let i=n?new URL(r):new URL(r,`http://example.com`),a=i.pathname;a.startsWith(`/`)||(i.pathname=`/${a}`);{let e=a.split(`/`),n=e[1];t?.includes(n)&&(e.splice(1,1),i.pathname=e.join(`/`)??`/`)}return n?i.toString():i.toString().replace(`http://example.com`,``)},Ht=(e={})=>({defaultLocale:f?.defaultLocale??`en`,mode:p?.mode??`prefix-no-default`,locales:f?.locales??Bt,rewrite:p?.rewrite,domains:p?.domains,...e}),Ut=(e,t={})=>{let{defaultLocale:n,mode:r,locales:i,domains:a}=Ht(t);return!e||!i.includes(e)?{prefix:``,localePrefix:void 0}:r===`prefix-all`||r===`prefix-no-default`&&n!==e?{prefix:`${e}/`,localePrefix:e}:{prefix:``,localePrefix:void 0}},Wt=(e,t,n)=>e,Gt=(e,t,n)=>({path:e,isRewritten:!1}),Kt=(e,t=f?.defaultLocale,n={})=>{let{defaultLocale:r,mode:i,locales:a,rewrite:o,domains:s,currentDomain:c}=Ht(n),l=Vt(e,a),u=Dt(l),d=u?new URL(l):new URL(l,`http://example.com`),p=Gt(Wt(d.pathname,void 0,void 0),t,void 0).path,m=u?`${d.protocol}//${d.host}`:``,{prefix:h}=Ut(t,{defaultLocale:r,mode:i,locales:a,domains:s}),g=`/${h}${p}`.replace(/\/+/g,`/`);return g.length>1&&g.endsWith(`/`)&&(g=g.slice(0,-1)),`${m}${g}${d.search}${d.hash}`},qt=(e,t=f?.locales,n=f?.defaultLocale)=>{let r=[e].flat(),i=e=>e.trim().toLowerCase();try{for(let e of r){let n=i(e),r=t.find(e=>i(e)===n);if(r)return r;let[a]=n.split(`-`),o=t.find(e=>i(e).split(`-`)[0]===a);if(o)return o}}catch{}return n},Jt=e=>{if(!e)return`ltr`;try{let t=new Intl.Locale(e);if(`getTextInfo`in t)return t.getTextInfo().direction;if(`textInfo`in t)return t.textInfo.direction;let n=t.maximize();return[`Arab`,`Hebr`,`Thaa`,`Syrc`,`Mand`,`Adlm`,`Rohg`,`Nkoo`].includes(n.script??``)?`rtl`:`ltr`}catch{return`ltr`}},Yt=(e,t=e)=>new He.DisplayNames(t,{type:`language`}).of(e)??`Unknown locale`,Xt=(0,v.createContext)({locale:Ft??f?.defaultLocale,setLocale:()=>null,isCookieEnabled:!0}),Zt=e=>{let t=(0,V.c)(6),{locale:n,defaultLocale:r,variant:i,children:a,setLocale:o,disableEditor:s,isCookieEnabled:c}=e,{locales:l,defaultLocale:u}=f??{},[d,p]=(0,v.useState)(n??Ft??r??u),m;t[0]!==d||t[1]!==n?(m=()=>{n&&n!==d&&p(n)},t[0]=d,t[1]=n,t[2]=m):m=t[2];let h;t[3]===n?h=t[4]:(h=[n],t[3]=n,t[4]=h),(0,v.useEffect)(m,h);let g;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(g=[],t[5]=g):g=t[5],(0,v.useEffect)(Qt,g);let _=o??(e=>{if(d.toString()!==e.toString()){if(!l?.map(String).includes(e)){console.error(`Locale ${e} is not available`);return}p(e),It(e,c)}}),b=qt(d);return(0,y.jsx)(Xt.Provider,{value:{locale:b,setLocale:_,variant:i,disableEditor:s},children:a})};function Qt(){Lt()}var $t=(e,t,n)=>{let r=e,i=null,a=[];if(t.length===0)return n;try{for(let e=0;e<t.length;e++){let o=t[e];if(i=r,(o?.type===`object`||o?.type===`array`)&&(a=[o.key],(!r[o.key]||typeof r[o.key]!=`object`)&&(r[o.key]={}),r=r[o.key]),(o?.type===`translation`||o?.type===`enumeration`||o?.type===`plural`||o?.type===`gender`||o?.type===`select`)&&(a=[o.type,o.key],(!r[o.type]||typeof r[o.type]!=`object`)&&(r[o.type]={}),(!r[o.type][o.key]||typeof r[o.type][o.key]!=`object`)&&(r[o.type][o.key]={}),r=r[o.type][o.key]),(o?.type===`enumeration`||o?.type===`plural`||o?.type===`condition`)&&o.type!==`enumeration`&&o.type!==`plural`&&(a=[o.type,o.key],r=r[o.type][o.key]),(o?.type===`markdown`||o?.type===`html`||o?.type===`insertion`)&&(a=[o.type],r[o.type]??(r[o.type]=``),r=r[o.type]),o?.type===`file`&&(a=[`content`],r=r.content),e===t.length-1&&i&&a.length>0){let e=i;for(let t of a.slice(0,-1))e=e[t];let t=a[a.length-1];if(n===void 0){if(Array.isArray(e)){let n=Number(t);!Number.isNaN(n)&&n>=0&&n<e.length&&e.splice(n,1)}else delete e[t]}else e[t]=n}}return e}catch(r){return console.error(`Cannot edit dictionary by key path`,{dictionaryContent:e,keyPath:t,newValue:n},r),e}},en=(e,t,n)=>{let r=structuredClone(e);for(let e of t)n&&r?.nodeType===`translation`&&(r=r?.[S]?.[n]),(e.type===`object`||e.type===`array`)&&(r=r?.[e.key]),(e.type===`translation`||e.type===`condition`||e.type===`enumeration`||e.type===`plural`||e.type===`gender`||e.type===`select`)&&(r=r?.[e.type]?.[e.key]),(e.type===`markdown`||e.type===`html`||e.type===`insertion`||e.type===`file`)&&(r=r?.[e.type]);return r},tn=(e,t,n)=>{let r=structuredClone(n);switch(e){case S:return{nodeType:S,[S]:Object.assign({},...t.map(e=>({[e]:structuredClone(r)??``})))};case C:return{nodeType:C,[C]:{1:r??``}};case w:return{nodeType:w,[w]:{one:r??``,other:r??``}};case T:return{nodeType:T,[T]:{true:r??``,false:r??``}};case te:return{nodeType:te,[te]:{male:r??``,female:r??``,fallback:r??``}};case ne:return{nodeType:ne,[ne]:{case1:r??``,fallback:r??``}};case E:return{nodeType:E,[E]:{insertion:r??``}};case A:return{nodeType:A,[A]:{dictionaryKey:``}};case P:return{nodeType:P,[P]:r??``};case F:return{nodeType:F,[F]:r??``,customComponents:[]};case D:return{nodeType:D,[D]:r??``};case O:return{newKey:r??``};case k:return[r??``];case I:return r??``;case L:return r??0;case ee:return r??!0;default:return r??``}},nn=e=>{if(typeof e==`string`)return``;if(typeof e==`number`)return 0;if(typeof e==`boolean`)return!0;if(typeof e?.nodeType==`string`){let t=e,n=t[t.nodeType];return t.nodeType===`translation`||t.nodeType===`enumeration`||t.nodeType===`plural`||t.nodeType===`condition`||t.nodeType===`insertion`||t.nodeType===`gender`||t.nodeType===`select`||t.nodeType===`html`?nn(n):t.nodeType===`nested`?`dictionary-key`:t.nodeType===`file`?`file/path`:t.nodeType===`markdown`?nn(n):n}if(!e||typeof e!=`object`)return e;if(Array.isArray(e))return e.map(nn);let t=Object.entries(e).map(([e,t])=>[e,nn(t)]);return Object.fromEntries(t)},rn=e=>{if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e;if(typeof e?.nodeType==`string`){let t=e,n=t[t.nodeType];return t.nodeType===`markdown`||t.nodeType===`html`?n:t.nodeType===`translation`||t.nodeType===`enumeration`||t.nodeType===`plural`||t.nodeType===`condition`||t.nodeType===`insertion`||t.nodeType===`gender`||t.nodeType===`select`||t.nodeType===`file`?n[Object.keys(n)[0]]:t.nodeType===`nested`?void 0:n}return!e||typeof e!=`object`?e:Array.isArray(e)?e[0]:e},an=e=>typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`string`,on={[S]:!0,[C]:!0,[w]:!0,[T]:!0,[E]:!0,[D]:!0,[O]:!0,[k]:!0,[A]:!0,[j]:!0,[M]:!0,[N]:!0,[P]:!0,[F]:!0,[I]:!0,[L]:!0,[ee]:!0,[te]:!0,[ne]:!0,[R]:!0,[z]:!0},sn=e=>Object.hasOwn(on,e),cn=e=>{if(typeof e==`string`)return I;if(an(e)){let t=e.nodeType;return sn(t)?t:z}return Array.isArray(e)?k:Et(e)?j:typeof e==`number`?L:typeof e==`boolean`?ee:e&&typeof e==`object`?O:e===null?R:z},ln=(e,t,n)=>{let r=e,i=null,a=null;for(let e of n)i=r,(e.type===`object`||e.type===`array`)&&(a=e.key,r=r[e.key]),(e.type===`translation`||e.type===`enumeration`||e.type===`plural`||e.type===`condition`||e.type===`gender`||e.type===`select`)&&(a=e.type,r=r[e.type][e.key]),(e.type===`markdown`||e.type===`reactNode`||e.type===`html`||e.type===`insertion`||e.type===`file`)&&(a=e.type,r=r[e.type]);if(i&&a!==null){if(Array.isArray(i))i[a]=r;else{let e={};for(let n of Object.keys(i))n===a&&t!==void 0?e[t]=r:e[n]=i[n];Object.keys(i).forEach(e=>{delete i[e]}),Object.assign(i,e)}}return e},un=(e,t)=>{let{locale:n,variant:r}=(0,v.useContext)(Xt)??{},i=t??n,a=typeof i==`object`&&i?`${i.locale??``}|${_e(i)}`:i;return(0,v.useMemo)(()=>Tt(e,i),[e.key,a])},dn=(e,t)=>{let{locale:n,variant:r}=(0,v.useContext)(Xt)??{},i=t??n,a=typeof i==`object`&&i?`${i.locale??``}|${_e(i)}`:i;return(0,v.useMemo)(()=>wt(e,i),[e,a])},fn=({isCookieEnabled:e,onLocaleChange:t}={})=>{let{defaultLocale:n,locales:r}=f??{},{locale:i,setLocale:a,isCookieEnabled:o}=(0,v.useContext)(Xt)??{};return{locale:i,defaultLocale:n,availableLocales:r,setLocale:(0,v.useCallback)(n=>{if(!r?.map(String).includes(n)){console.error(`Locale ${n} is not available`);return}a(n),It(n,e??o??!0),t?.(n)},[r,t,a,e])}},pn=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,mn=/^[\\/]{2}/;function hn(e,t){return t+e.replace(/\\/g,`/`)}var gn=`popstate`;function _n(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function vn(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return Cn(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:wn(t)}return En(t,n,null,e)}function yn(e,t){if(e===!1||e==null)throw Error(t)}function bn(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function xn(){return Math.random().toString(36).substring(2,10)}function Sn(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Cn(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?Tn(t):t,state:n,key:t&&t.key||r||xn(),mask:i}}function wn({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function Tn(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function En(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=_n(e)?e:Cn(h.location,e,t);n&&n(r,e),l=u()+1;let d=Sn(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=_n(e)?e:Cn(h.location,e,t);n&&n(r,e),l=u();let i=Sn(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return Dn(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(gn,d),c=e,()=>{i.removeEventListener(gn,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function Dn(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),yn(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:wn(t);return i=i.replace(/ $/,`%20`),!n&&mn.test(i)&&(i=r+i),new URL(i,r)}function On(e,t,n=`/`){return kn(e,t,n,!1)}function kn(e,t,n,r,i){let a=Jn((typeof t==`string`?Tn(t):t).pathname||`/`,n);if(a==null)return null;let o=i??An(e),s=null,c=qn(a);for(let e=0;s==null&&e<o.length;++e)s=Un(o[e],c,r);return s}function An(e){let t=jn(e);return Nn(t),t}function jn(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;yn(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=nr([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(yn(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),jn(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:Vn(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Kn(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of Mn(e.path))a(e,t,!0,n)}),t}function Mn(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=Mn(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function Nn(e){e.sort((e,t)=>e.score===t.score?Hn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var Pn=/^:[\w-]+$/,Fn=3,In=2,Ln=1,Rn=10,zn=-2,Bn=e=>e===`*`;function Vn(e,t){let n=e.split(`/`),r=n.length;return n.some(Bn)&&(r+=zn),t&&(r+=In),n.filter(e=>!Bn(e)).reduce((e,t)=>e+(Pn.test(t)?Fn:t===``?Ln:Rn),r)}function Hn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function Un(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Gn(u,l,s.matcher,s.compiledParams):Wn(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Wn({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:nr([a,d.pathname]),pathnameBase:ir(nr([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=nr([a,d.pathnameBase]))}return o}function Wn(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Kn(e.path,e.caseSensitive,e.end);return Gn(e,t,n,r)}function Gn(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Kn(e,t=!1,n=!0){bn(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function qn(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return bn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Jn(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Yn(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?Tn(e):e,a;return n?(n=tr(n),a=n.startsWith(`/`)?Xn(n.substring(1),`/`):Xn(n,t)):a=t,{pathname:a,search:ar(r),hash:or(i)}}function Xn(e,t){let n=rr(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Zn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Qn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function $n(e){let t=Qn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function er(e,t,n,r=!1){let i;typeof e==`string`?i=Tn(e):(i={...e},yn(!i.pathname||!i.pathname.includes(`?`),Zn(`?`,`pathname`,`search`,i)),yn(!i.pathname||!i.pathname.includes(`#`),Zn(`#`,`pathname`,`hash`,i)),yn(!i.search||!i.search.includes(`#`),Zn(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Yn(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var tr=e=>e.replace(/[\\/]{2,}/g,`/`),nr=e=>tr(e.join(`/`)),rr=e=>e.replace(/\/+$/,``),ir=e=>rr(e).replace(/^\/*/,`/`),ar=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,or=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,sr=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function cr(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function lr(e){return nr(e.map(e=>e.route.path).filter(Boolean))||`/`}var ur=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function dr(e,t){let n=e;if(typeof n!=`string`||!pn.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(ur)try{let e=new URL(window.location.href),r=mn.test(n)?new URL(hn(n,e.protocol)):new URL(n),a=Jn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{bn(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var fr=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(fr);var pr=[`GET`,...fr];new Set(pr);var mr=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function hr(e){try{return mr.includes(new URL(e).protocol)}catch{return!1}}var gr=v.createContext(null);gr.displayName=`DataRouter`;var _r=v.createContext(null);_r.displayName=`DataRouterState`;var vr=v.createContext(!1);function yr(){return v.useContext(vr)}var br=v.createContext({isTransitioning:!1});br.displayName=`ViewTransition`;var xr=v.createContext(new Map);xr.displayName=`Fetchers`;var Sr=v.createContext(null);Sr.displayName=`Await`;var Cr=v.createContext(null);Cr.displayName=`Navigation`;var wr=v.createContext(null);wr.displayName=`Location`;var Tr=v.createContext({outlet:null,matches:[],isDataRoute:!1});Tr.displayName=`Route`;var Er=v.createContext(null);Er.displayName=`RouteError`;var Dr=`REACT_ROUTER_ERROR`,Or=`REDIRECT`,kr=`ROUTE_ERROR_RESPONSE`;function Ar(e){if(e.startsWith(`${Dr}:${Or}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function jr(e){if(e.startsWith(`${Dr}:${kr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new sr(t.status,t.statusText,t.data)}catch{}}function Mr(e,{relative:t}={}){yn(Nr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=v.useContext(Cr),{hash:i,pathname:a,search:o}=zr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:nr([n,a])),r.createHref({pathname:s,search:o,hash:i})}function Nr(){return v.useContext(wr)!=null}function Pr(){return yn(Nr(),`useLocation() may be used only in the context of a <Router> component.`),v.useContext(wr).location}var Fr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Ir(e){v.useContext(Cr).static||v.useLayoutEffect(e)}function Lr(){let{isDataRoute:e}=v.useContext(Tr);return e?ni():Rr()}function Rr(){yn(Nr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=v.useContext(gr),{basename:t,navigator:n}=v.useContext(Cr),{matches:r}=v.useContext(Tr),{pathname:i}=Pr(),a=JSON.stringify($n(r)),o=v.useRef(!1);return Ir(()=>{o.current=!0}),v.useCallback((r,s={})=>{if(bn(o.current,Fr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=er(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:nr([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}v.createContext(null);function zr(e,{relative:t}={}){let{matches:n}=v.useContext(Tr),{pathname:r}=Pr(),i=JSON.stringify($n(n));return v.useMemo(()=>er(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Br(e,t){return Vr(e,t)}function Vr(e,t,n){yn(Nr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=v.useContext(Cr),{matches:i}=v.useContext(Tr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;ii(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
+
|
|
12
|
+
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=Pr(),d;if(t){let e=typeof t==`string`?Tn(t):t;yn(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):On(e,{pathname:p});bn(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),bn(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Jr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:nr([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:nr([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?v.createElement(wr.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Hr(){let e=ti(),t=cr(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=v.createElement(v.Fragment,null,v.createElement(`p`,null,`💿 Hey developer 👋`),v.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,v.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,v.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),v.createElement(v.Fragment,null,v.createElement(`h2`,null,`Unexpected Application Error!`),v.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?v.createElement(`pre`,{style:i},n):null,o)}var Ur=v.createElement(Hr,null),Wr=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=jr(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:v.createElement(Tr.Provider,{value:this.props.routeContext},v.createElement(Er.Provider,{value:e,children:this.props.component}));return this.context?v.createElement(Kr,{error:e},t):t}};Wr.contextType=vr;var Gr=new WeakMap;function Kr({children:e,error:t}){let{basename:n}=v.useContext(Cr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=Ar(t.digest);if(e){let r=Gr.get(t);if(r)throw r;let i=dr(e.location,n),a=i.absoluteURL||i.to;if(hr(a))throw Error(`Invalid redirect location`);if(ur&&!Gr.get(t)){if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw Gr.set(t,n),n}}return v.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function qr({routeContext:e,match:t,children:n}){let r=v.useContext(gr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(Tr.Provider,{value:e},n)}function Jr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);yn(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:lr(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||Ur,o&&(s<0&&c===0?(ii(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?v.createElement(n.route.Component,null):n.route.element?n.route.element:e,v.createElement(qr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?v.createElement(Wr,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Yr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Xr(e){let t=v.useContext(gr);return yn(t,Yr(e)),t}function Zr(e){let t=v.useContext(_r);return yn(t,Yr(e)),t}function Qr(e){let t=v.useContext(Tr);return yn(t,Yr(e)),t}function $r(e){let t=Qr(e),n=t.matches[t.matches.length-1];return yn(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function ei(){return $r(`useRouteId`)}function ti(){let e=v.useContext(Er),t=Zr(`useRouteError`),n=$r(`useRouteError`);return e===void 0?t.errors?.[n]:e}function ni(){let{router:e}=Xr(`useNavigate`),t=$r(`useNavigate`),n=v.useRef(!1);return Ir(()=>{n.current=!0}),v.useCallback(async(r,i={})=>{bn(n.current,Fr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var ri={};function ii(e,t,n){!t&&!ri[e]&&(ri[e]=!0,bn(!1,n))}v.memo(ai);function ai({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Vr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function oi(e){yn(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function si({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){yn(!Nr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=v.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=Tn(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=v.useMemo(()=>{let e=Jn(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return bn(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:v.createElement(Cr.Provider,{value:c},v.createElement(wr.Provider,{children:t,value:h}))}function ci({children:e,location:t}){return Br(li(e),t)}v.Component;function li(e,t=[]){let n=[];return v.Children.forEach(e,(e,r)=>{if(!v.isValidElement(e))return;let i=[...t,r];if(e.type===v.Fragment){n.push.apply(n,li(e.props.children,i));return}yn(e.type===oi,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yn(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=li(e.props.children,i)),n.push(a)}),n}var ui=`get`,di=`application/x-www-form-urlencoded`;function fi(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function pi(e){return fi(e)&&e.tagName.toLowerCase()===`button`}function mi(e){return fi(e)&&e.tagName.toLowerCase()===`form`}function hi(e){return fi(e)&&e.tagName.toLowerCase()===`input`}function gi(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function _i(e,t){return e.button===0&&(!t||t===`_self`)&&!gi(e)}var vi=null;function yi(){if(vi===null)try{new FormData(document.createElement(`form`),0),vi=!1}catch{vi=!0}return vi}var bi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function xi(e){return e!=null&&!bi.has(e)?(bn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${di}"`),null):e}function Si(e,t){let n,r,i,a,o;if(mi(e)){let o=e.getAttribute(`action`);r=o?Jn(o,t):null,n=e.getAttribute(`method`)||ui,i=xi(e.getAttribute(`enctype`))||di,a=new FormData(e)}else if(pi(e)||hi(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Jn(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||ui,i=xi(e.getAttribute(`formenctype`))||xi(o.getAttribute(`enctype`))||di,a=new FormData(o,e),!yi()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(fi(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=ui,r=null,i=di,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function Ci(e,t){if(e===!1||e==null)throw Error(t)}function wi(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Jn(i.pathname,t)===`/`?`${rr(t)}/_root.${r}`:`${rr(i.pathname)}.${r}`,i}async function Ti(e,t){if(e.id in t)return t[e.id];try{let n=await ht(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Ei(e){return e!=null&&typeof e.page==`string`}function Di(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function Oi(e,t,n){return Ni((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await Ti(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(Di).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function ki(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function Ai(e,t,{includeHydrateFallback:n}={}){return ji(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function ji(e){return[...new Set(e)]}function Mi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function Ni(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!Ei(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(Mi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function Pi(){let e=v.useContext(gr);return Ci(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function Fi(){let e=v.useContext(_r);return Ci(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Ii=v.createContext(void 0);Ii.displayName=`FrameworkContext`;function Li(){let e=v.useContext(Ii);return Ci(e,`You must render this element inside a <HydratedRouter> element`),e}function Ri(e,t){let n=v.useContext(Ii),[r,i]=v.useState(!1),[a,o]=v.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=v.useRef(null);v.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),v.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:zi(s,p),onBlur:zi(c,m),onMouseEnter:zi(l,p),onMouseLeave:zi(u,m),onTouchStart:zi(d,p)}]:[a,f,{}]:[!1,f,{}]}function zi(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Bi({page:e,...t}){let n=yr(),{nonce:r}=Li(),{router:i}=Pi(),a=v.useMemo(()=>On(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?v.createElement(Hi,{page:e,matches:a,...t}):v.createElement(Ui,{page:e,matches:a,...t})):null}function Vi(e){let{manifest:t,routeModules:n}=Li(),[r,i]=v.useState([]);return v.useEffect(()=>{let r=!1;return Oi(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Hi({page:e,matches:t,...n}){let r=Pr(),{future:i}=Li(),{basename:a}=Pi(),o=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=wi(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return v.createElement(v.Fragment,null,o.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Ui({page:e,matches:t,...n}){let r=Pr(),{future:i,manifest:a,routeModules:o}=Li(),{basename:s}=Pi(),{loaderData:c,matches:l}=Fi(),u=v.useMemo(()=>ki(e,t,l,a,r,`data`),[e,t,l,a,r]),d=v.useMemo(()=>ki(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=wi(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=v.useMemo(()=>Ai(d,a),[d,a]),m=Vi(d);return v.createElement(v.Fragment,null,f.map(e=>v.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>v.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>v.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Wi(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}v.Component;var Gi=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Gi&&(window.__reactRouterVersion=`7.18.2`)}catch{}function Ki({basename:e,children:t,useTransitions:n,window:r}){let i=v.useRef();i.current??=vn({window:r,v5Compat:!0});let a=i.current,[o,s]=v.useState({action:a.action,location:a.location}),c=v.useCallback(e=>{n===!1?s(e):v.startTransition(()=>s(e))},[n]);return v.useLayoutEffect(()=>a.listen(c),[a,c]),v.createElement(si,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var qi=v.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=v.useContext(Cr),y=typeof l==`string`&&pn.test(l),b=dr(l,h);l=b.to;let x=Mr(l,{relative:r}),S=Pr(),C=null;if(o){let e=er(o,[],S.mask?S.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:nr([h,e.pathname])),C=g.createHref(e)}let[w,T,E]=Ri(n,p),D=Qi(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function O(t){e&&e(t),t.defaultPrevented||D(t)}let k=!(b.isExternal||i),A=v.createElement(`a`,{...p,...E,href:(k?C:void 0)||b.absoluteURL||x,onClick:k?O:e,ref:Wi(m,T),target:c,"data-discover":!y&&t===`render`?`true`:void 0});return w&&!y?v.createElement(v.Fragment,null,A,v.createElement(Bi,{page:x})):A});qi.displayName=`Link`;var Ji=v.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=zr(a,{relative:c.relative}),d=Pr(),f=v.useContext(_r),{navigator:p,basename:m}=v.useContext(Cr),h=f!=null&&ra(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,y=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),y=y?y.toLowerCase():null,g=g.toLowerCase()),y&&m&&(y=Jn(y,m)||y);let b=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,x=_===g||!r&&_.startsWith(g)&&_.charAt(b)===`/`,S=y!=null&&(y===g||!r&&y.startsWith(g)&&y.charAt(g.length)===`/`),C={isActive:x,isPending:S,isTransitioning:h},w=x?e:void 0,T;T=typeof n==`function`?n(C):[n,x?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let E=typeof i==`function`?i(C):i;return v.createElement(qi,{...c,"aria-current":w,className:T,ref:l,style:E,to:a,viewTransition:o},typeof s==`function`?s(C):s)});Ji.displayName=`NavLink`;var Yi=v.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=ui,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=v.useContext(Cr),g=ta(),_=na(s,{relative:l}),y=o.toLowerCase()===`get`?`get`:`post`,b=typeof s==`string`&&pn.test(s);return v.createElement(`form`,{ref:m,method:y,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?v.startTransition(()=>p()):p()},...p,"data-discover":!b&&e===`render`?`true`:void 0})});Yi.displayName=`Form`;function Xi(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Zi(e){let t=v.useContext(gr);return yn(t,Xi(e)),t}function Qi(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Lr(),d=Pr(),f=zr(e,{relative:o});return v.useCallback(p=>{if(_i(p,t)){p.preventDefault();let t=n===void 0?wn(d)===wn(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?v.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var $i=0,ea=()=>`__${String(++$i)}__`;function ta(){let{router:e}=Zi(`useSubmit`),{basename:t}=v.useContext(Cr),n=ei(),r=e.fetch,i=e.navigate;return v.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=Si(e,t);if(a.navigate===!1){let e=a.fetcherKey||ea();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function na(e,{relative:t}={}){let{basename:n}=v.useContext(Cr),r=v.useContext(Tr);yn(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...zr(e||`.`,{relative:t})},o=Pr();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:nr([n,a.pathname])),wn(a)}function ra(e,{relative:t}={}){let n=v.useContext(br);yn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Zi(`useViewTransitionState`),i=zr(e,{relative:t});if(!n.isTransitioning)return!1;let a=Jn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Jn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Wn(i.pathname,o)!=null||Wn(i.pathname,a)!=null}var ia=(0,v.createContext)(!0),aa=()=>(0,v.useContext)(ia),oa=1,sa=9e5,ca=0,la=()=>(ca=(ca+1)%(2**53-1),ca.toString()),ua=new Map,da=e=>{if(ua.has(e))return;let t=setTimeout(()=>{ua.delete(e),ha({type:`REMOVE_TOAST`,toastId:e})},sa);ua.set(e,t)},fa=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,oa)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?da(n):e.toasts.forEach(e=>{da(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},pa=[],ma={toasts:[]},ha=e=>{ma=fa(ma,e),pa.forEach(e=>{e(ma)})},ga=({...e})=>{let t=la(),n=e=>ha({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>ha({type:`DISMISS_TOAST`,toastId:t});return ha({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}},_a=()=>{let e=(0,V.c)(5),[t,n]=(0,v.useState)(ma),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>(pa.push(n),()=>{let e=pa.indexOf(n);e>-1&&pa.splice(e,1)}),e[0]=r):r=e[0];let i;e[1]===t?i=e[2]:(i=[t],e[1]=t,e[2]=i),(0,v.useEffect)(r,i);let a;return e[3]===t?a=e[4]:(a={...t,toast:ga,dismiss:va},e[3]=t,e[4]=a),a};function va(e){return ha({type:`DISMISS_TOAST`,toastId:e})}var ya=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},ba=new class extends ya{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},xa={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Sa=new class{#e=xa;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Ca(e){setTimeout(e,0)}var wa=typeof window>`u`||`Deno`in globalThis;function Ta(){}function Ea(e,t){return typeof e==`function`?e(t):e}function Da(e){return typeof e==`number`&&e>=0&&e!==1/0}function Oa(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ka(e,t){return typeof e==`function`?e(t):e}function Aa(e,t){return typeof e==`function`?e(t):e}function ja(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==Na(o,t.options))return!1}else if(!Fa(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function Ma(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(Pa(t.options.mutationKey)!==Pa(a))return!1}else if(!Fa(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function Na(e,t){return(t?.queryKeyHashFn||Pa)(e)}function Pa(e){return JSON.stringify(e,(e,t)=>Ba(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function Fa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!Fa(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!Fa(e[r],t[r]))return!1;return!0}return!1}var Ia=Object.prototype.hasOwnProperty;function La(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=za(e)&&za(t);if(!r&&!(Ba(e)&&Ba(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:Ia.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=La(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function Ra(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function za(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ba(e){if(!Va(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Va(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Va(e){return Object.prototype.toString.call(e)===`[object Object]`}function Ha(e){return new Promise(t=>{Sa.setTimeout(t,e)})}function Ua(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:La(e,t)}function Wa(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Ga(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Ka=Symbol();function qa(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Ka?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Ja(e,t){return typeof e==`function`?e(...t):!!e}function Ya(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Xa=(()=>{let e=()=>wa;return{isServer(){return e()},setIsServer(t){e=t}}})();function Za(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}function Qa(e){let t;if(e.then(e=>(t=e,e),Ta)?.catch(Ta),t!==void 0)return{data:t}}function $a(e){return e}function eo(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function to(e,t,n){let r=()=>{let r=e.promise?.then(t).catch(e=>n(e)?Promise.reject(Error(`redacted`)):Promise.reject(e));return r?.catch(Ta),r};return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t(e.state.data)}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:r()},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function no(e){return e.state.isPaused}function ro(e){return e.state.status===`success`}function io(e){return!0}function ao(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??no,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[eo(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??ro,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors??io,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData??$a;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[to(e,o,a)]:[])}}function oo(e,t,n){if(typeof t!=`object`||!t)return;let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData??$a,o=t.mutations||[],s=t.queries||[];o.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),s.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?Qa(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a(f),m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l!==void 0&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l??Date.now(),...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l??Date.now()}});c&&!d&&!h&&!g&&(l===void 0||l>m.state.dataUpdatedAt)&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(Ta)})}var so=Ca;function co(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=so,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var lo=co(),uo=new class extends ya{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function fo(e){return Math.min(1e3*2**e,3e4)}function po(e){return(e??`online`)!==`online`||uo.isOnline()}var mo=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function ho(e){let t=!1,n=0,r,i=Za(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new mo(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>ba.isFocused()&&(e.networkMode===`always`||uo.isOnline())&&e.canRun(),u=()=>po(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Xa.isServer()?0:3),o=e.retryDelay??fo,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),Ha(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var go=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Da(this.gcTime)&&(this.#e=Sa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Xa.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Sa.clearTimeout(this.#e),this.#e=void 0)}};function _o(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Ya(e,()=>t.signal,()=>n=!0)},u=qa(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Ga:Wa;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?yo:vo,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:vo(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function vo(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function yo(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var bo=class extends go{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Co(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Co(this.options);e.data!==void 0&&(this.setState(So(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ua(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(Ta).catch(Ta):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Aa(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Ka||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>ka(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Oa(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=qa(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?_o(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=ho({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof mo&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof mo){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...xo(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...So(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),lo.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function xo(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:po(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function So(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Co(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var wo=class extends ya{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=Za(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),Eo(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Do(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Do(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Aa(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!Ra(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&Oo(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Aa(this.options.enabled,this.#t)!==Aa(t.enabled,this.#t)||ka(this.options.staleTime,this.#t)!==ka(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Aa(this.options.enabled,this.#t)!==Aa(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Ao(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(Ta)),t}#g(){this.#b();let e=ka(this.options.staleTime,this.#t);if(Xa.isServer()||this.#r.isStale||!Da(e))return;let t=Oa(this.#r.dataUpdatedAt,e)+1;this.#d=Sa.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(Xa.isServer()||Aa(this.options.enabled,this.#t)===!1||!Da(this.#p)||this.#p===0)&&(this.#f=Sa.setInterval(()=>{(this.options.refetchIntervalInBackground||ba.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Sa.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Sa.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&Eo(e,t),o=i&&Oo(e,n,t,r);(a||o)&&(l={...l,...xo(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=Ua(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=Ua(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:ko(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Aa(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=Za();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!Ra(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){lo.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function To(e,t){return Aa(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Aa(t.retryOnMount,e)!==!1)}function Eo(e,t){return To(e,t)||e.state.data!==void 0&&Do(e,t,t.refetchOnMount)}function Do(e,t,n){if(Aa(t.enabled,e)!==!1&&ka(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&ko(e,t)}return!1}function Oo(e,t,n,r){return(e!==t||Aa(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&ko(e,n)}function ko(e,t){return Aa(t.enabled,e)!==!1&&e.isStaleByTime(ka(t.staleTime,e))}function Ao(e,t){return!Ra(e.getCurrentResult(),t)}var jo=class extends go{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Mo(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=ho({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),lo.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Mo(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var No=class extends ya{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new jo({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Po(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Po(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Po(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Po(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){lo.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>Ma(t,e))}findAll(e={}){return this.getAll().filter(t=>Ma(e,t))}notify(e){lo.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return lo.batch(()=>Promise.all(e.map(e=>e.continue().catch(Ta))))}};function Po(e){return e.options.scope?.id}var Fo=class extends ya{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),Ra(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&Pa(t.mutationKey)!==Pa(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Mo();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){lo.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},Io=class extends ya{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??Na(r,t),a=this.get(i);return a||(a=new bo({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){lo.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ja(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>ja(e,t)):t}notify(e){lo.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){lo.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){lo.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Lo=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Io,this.#t=e.mutationCache||new No,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=ba.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=uo.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ka(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Ea(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return lo.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;lo.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return lo.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=lo.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(Ta).catch(Ta)}invalidateQueries(e,t={}){return lo.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=lo.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(Ta)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(Ta)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ka(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Ta).catch(Ta)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Ta).catch(Ta)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return uo.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(Pa(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{Fa(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(Pa(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{Fa(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=Na(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Ka&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function Ro(){}function zo(e,{interval:t=1e3,onError:n=Ro}={}){if(typeof e!=`function`)throw Error(`argument is not function.`);let r=0,i=null,a=!1,o=!1;return async(...s)=>{if(i=s,!o){for(o=!0;a;)await new Promise(e=>Sa.setTimeout(e,t));for(;Date.now()<r;)await new Promise(e=>Sa.setTimeout(e,r-Date.now()));o=!1,a=!0;try{await e(...i)}catch(e){try{n(e)}catch{}}r=Date.now()+t,a=!1}}}var Bo=({storage:e,key:t=`REACT_QUERY_OFFLINE_CACHE`,throttleTime:n=1e3,serialize:r=JSON.stringify,deserialize:i=JSON.parse,retry:a})=>{if(e){let o=async n=>{try{let i=await r(n);await e.setItem(t,i);return}catch(e){return e}};return{persistClient:zo(async e=>{let t=e,n=await o(t),r=0;for(;n&&t;)r++,t=await a?.({persistedClient:t,error:n,errorCount:r}),t&&(n=await o(t))},{interval:n}),restoreClient:async()=>{let n=await e.getItem(t);if(n)return await i(n)},removeClient:()=>e.removeItem(t)}}return{persistClient:Ro,restoreClient:()=>Promise.resolve(void 0),removeClient:Ro}},Vo=v.createContext(void 0),Ho=e=>{let t=v.useContext(Vo);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Uo=({client:e,children:t})=>(v.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,y.jsx)(Vo.Provider,{value:e,children:t})),Wo=v.createContext(!1),Go=()=>v.useContext(Wo),Ko=Wo.Provider;function qo(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var Jo=v.createContext(qo()),Yo=()=>v.useContext(Jo),Xo=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Ja(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},Zo=e=>{v.useEffect(()=>{e.clearReset()},[e])},Qo=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Ja(n,[e.error,r])),$o=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},es=(e,t)=>e.isLoading&&e.isFetching&&!t,ts=(e,t)=>e?.suspense&&t.isPending,ns=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function rs(e,t,n){let r=Go(),i=Yo(),a=Ho(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,$o(o),Xo(o,i,s),Zo(i);let l=!a.getQueryCache().get(o.queryHash),[u]=v.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(v.useSyncExternalStore(v.useCallback(e=>{let t=f?u.subscribe(lo.batchCalls(e)):Ta;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),v.useEffect(()=>{u.setOptions(o)},[o,u]),ts(o,d))throw ns(o,u,i);if(Qo({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!Xa.isServer()&&es(d,r)&&(l?ns(o,u,i):s?.promise)?.catch(Ta).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function is(e,t){return rs(e,wo,t)}function as(e,t){let n=Ho(t),[r]=v.useState(()=>new Fo(n,e));v.useEffect(()=>{r.setOptions(e)},[r,e]);let i=v.useSyncExternalStore(v.useCallback(e=>r.subscribe(lo.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=v.useCallback((e,t)=>{r.mutate(e,t).catch(Ta)},[r]);if(i.error&&Ja(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var os=[`added`,`removed`,`updated`];function ss(e){return os.includes(e)}async function cs({queryClient:e,persister:t,maxAge:n=864e5,buster:r=``,hydrateOptions:i}){try{let a=await t.restoreClient();if(a){if(a.timestamp){let o=Date.now()-a.timestamp>n,s=a.buster!==r;if(o||s)return t.removeClient();oo(e,a.clientState,i)}else return t.removeClient()}}catch(e){throw await t.removeClient(),e}}async function ls({queryClient:e,persister:t,buster:n=``,dehydrateOptions:r}){let i={buster:n,timestamp:Date.now(),clientState:ao(e,r)};await t.persistClient(i)}function us(e){let t=e.queryClient.getQueryCache().subscribe(t=>{ss(t.type)&&ls(e)}),n=e.queryClient.getMutationCache().subscribe(t=>{ss(t.type)&&ls(e)});return()=>{t(),n()}}var ds=({children:e,persistOptions:t,onSuccess:n,onError:r,...i})=>{let[a,o]=v.useState(!0),s=v.useRef({persistOptions:t,onSuccess:n,onError:r}),c=v.useRef(!1);return v.useEffect(()=>{s.current={persistOptions:t,onSuccess:n,onError:r}}),v.useEffect(()=>{let e={...s.current.persistOptions,queryClient:i.client};return c.current||(c.current=!0,cs(e).then(()=>s.current.onSuccess?.()).catch(()=>s.current.onError?.()).finally(()=>{o(!1)})),a?void 0:us(e)},[i.client,a]),(0,y.jsx)(Uo,{...i,children:(0,y.jsx)(Ko,{value:a,children:e})})},fs=864e5,ps=`v1`;if(typeof window>`u`){let e=e=>{typeof e==`object`&&e&&`unref`in e&&typeof e.unref==`function`&&e.unref()};Sa.setTimeoutProvider({setTimeout:(t,n)=>{let r=setTimeout(t,n);return e(r),r},clearTimeout:e=>clearTimeout(e),setInterval:(t,n)=>{let r=setInterval(t,n);return e(r),r},clearInterval:e=>clearInterval(e)})}var ms={queries:{retry:1,staleTime:3e4,gcTime:fs,refetchOnMount:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1},mutations:{retry:0}},hs=Bo({storage:typeof window<`u`?{getItem:e=>Promise.resolve(window.localStorage.getItem(e)),setItem:(e,t)=>Promise.resolve(window.localStorage.setItem(e,t)),removeItem:e=>Promise.resolve(window.localStorage.removeItem(e))}:{getItem:()=>Promise.resolve(null),setItem:()=>Promise.resolve(),removeItem:()=>Promise.resolve()},key:`intlayer-rq-cache`}),gs=e=>e.split(`_`).join(` `),_s=()=>{let e=(0,V.c)(7),{toast:t}=_a(),n;e[0]===t?n=e[1]:(n=e=>{[(()=>{try{if(typeof e==`string`)return JSON.parse(e);if(e instanceof Error)return JSON.parse(e.message)}catch{}return e})()].flat().forEach(e=>{let n=e?.error??e;if(n?.code===`RATE_LIMIT_EXCEEDED_UNAUTHENTICATED`){t({title:n.message,variant:`error`});return}t({title:gs(n?.title??e?.title??`Error`),description:n?.message??e?.message??String(n??`An error occurred`),variant:`error`})})},e[0]=t,e[1]=n);let r=n,i;e[2]===t?i=e[3]:(i=e=>{e?.error&&t({title:gs(e.error.title??e.error.code??`Error`),description:e.error.message??e.error.code??`An error occurred`,variant:`error`}),e?.message&&t({title:e.message,description:e.description,variant:`success`})},e[2]=t,e[3]=i);let a=i,o;return e[4]!==r||e[5]!==a?(o={onError:r,onSuccess:a},e[4]=r,e[5]=a,e[6]=o):o=e[6],o},vs=({children:e,client:t})=>{let{onError:n,onSuccess:r}=_s(),i=(0,v.useRef)({onSuccess:r,onError:n});i.current={onSuccess:r,onError:n};let a=(0,v.useRef)(t??null);a.current||=new Lo({defaultOptions:ms,mutationCache:new No});let o=(0,v.useRef)(!1);if(!o.current){o.current=!0;let e=a.current.getMutationCache();e.config.onSuccess=(e,t,n,r,a)=>i.current.onSuccess?.(e,t,n,r,a),e.config.onError=(e,t,n,r,a)=>i.current.onError?.(e,t,n,r,a),e.config.onSettled=(e,t,n,r,i)=>{i.meta?.invalidateQueries&&i.meta.invalidateQueries.forEach(e=>{a.current?.invalidateQueries({queryKey:e})}),i.meta?.resetQueries&&i.meta.resetQueries.forEach(e=>{a.current?.resetQueries({queryKey:e})})}}return t||typeof window>`u`?(0,y.jsx)(Uo,{client:a.current,children:e}):(0,y.jsx)(ds,{client:a.current,persistOptions:{persister:hs,maxAge:fs,buster:ps,dehydrateOptions:{shouldDehydrateQuery:e=>e.state.status===`success`}},children:e})},ys=Array.isArray,bs=e=>{if(!e)return``;if(typeof e==`string`)return e;if(typeof e==`number`)return``+e;let t=``;if(ys(e)){let n=e.length;for(let r=0;r<n;r++){let n=e[r];if(!n)continue;let i=typeof n==`string`?n:bs(n);i&&(t&&(t+=` `),t+=i)}return t}if(typeof e==`object`)for(let n in e)e[n]&&(t&&(t+=` `),t+=n);return t},xs=(e,t)=>{let n=e.length,r=t.length,i=Array(n+r);for(let t=0;t<n;t++)i[t]=e[t];for(let e=0;e<r;e++)i[n+e]=t[e];return i},Ss=(e,t)=>({classGroupId:e,validator:t}),Cs=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),ws=`-`,Ts=[],Es=`arbitrary..`,Ds=e=>{let t=As(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e[0]===`[`&&e[e.length-1]===`]`)return ks(e);let n=e.split(ws);return Os(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?xs(i,t):t:i||Ts}return n[e]||Ts}}},Os=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Os(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(ws):e.slice(t).join(ws),s=a.length;for(let e=0;e<s;e++){let t=a[e];if(t.validator(o))return t.classGroupId}},ks=e=>{let t=e.slice(1,-1),n=t.indexOf(`:`);if(n===-1)return;let r=t.slice(0,n);return r?Es+r:void 0},As=e=>{let{theme:t,classGroups:n}=e;return js(n,t)},js=(e,t)=>{let n=Cs();for(let r in e){let i=e[r];Ms(i,n,r,t)}return n},Ms=(e,t,n,r)=>{let i=e.length;for(let a=0;a<i;a++){let i=e[a];Ns(i,t,n,r)}},Ns=(e,t,n,r)=>{if(typeof e==`string`){Ps(e,t,n);return}if(typeof e==`function`){Fs(e,t,n,r);return}Is(e,t,n,r)},Ps=(e,t,n)=>{let r=e===``?t:Ls(t,e);r.classGroupId=n},Fs=(e,t,n,r)=>{if(Rs(e)){Ms(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Ss(n,e))},Is=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e<a;e++){let[a,o]=i[e];Ms(o,Ls(t,a),n,r)}},Ls=(e,t)=>{let n=e,r=t.split(ws),i=r.length;for(let e=0;e<i;e++){let t=r[e],i=n.nextPart.get(t);i||(i=Cs(),n.nextPart.set(t,i)),n=i}return n},Rs=e=>`isThemeGetter`in e&&e.isThemeGetter===!0,zs=58,Bs=47,Vs=91,Hs=93,Us=40,Ws=41,Gs=33,Ks=(e,t,n,r)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:void 0}),qs=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;s<o;s++){let o=e.charCodeAt(s);if(n===0&&r===0){if(o===zs){t.push(e.slice(i,s)),i=s+1;continue}if(o===Bs){a=s;continue}}o===Vs?n++:o===Hs?n--:o===Us?r++:o===Ws&&r--}let s=t.length===0?e:e.slice(i),c=s,l=!1,u=s.length-1;s.charCodeAt(u)===Gs?(c=s.slice(0,-1),l=!0):s.charCodeAt(0)===Gs&&(c=s.slice(1),l=!0);let d=a&&a>i?a-i:void 0;return Ks(t,l,c,d)},Js=e=>{let t=new Set(e.orderSensitiveModifiers);return e=>{let n=[],r=[];for(let i=0;i<e.length;i++){let a=e[i],o=a[0]===`[`,s=t.has(a);if(o||s){if(r.length>0){r.sort();for(let e=0;e<r.length;e++)n.push(r[e]);r=[]}n.push(a)}else r.push(a)}if(r.length>0){r.sort();for(let e=0;e<r.length;e++)n.push(r[e])}return n}},Ys={isExternal:!0,classId:-1,conflictIds:[]},Xs=4096,Zs=16384,Qs=e=>{let t=Js(e),n=$s(e),{getClassGroupId:r,getConflictingClassGroupIds:i}=Ds(e),a=Object.create(null),o=Object.create(null),s=0,c=new Int32Array(256),l=0,u=new Uint8Array(64),d=!1,f=e=>{let t=[],n=e.length,r=-1;d=!1;for(let i=0;i<n;i++){let n=e.charCodeAt(i);n===32?r!==-1&&(t.push(e.slice(r,i)),r=-1):n>=9&&n<=13?(d=!0,r!==-1&&(t.push(e.slice(r,i)),r=-1)):r===-1&&(r=i)}return r!==-1&&t.push(e.slice(r)),t},p=new Map,m=0,h=e=>{let t=p.get(e);if(t===void 0&&(t=m++,p.set(e,t),t>=c.length)){let e=new Int32Array(c.length*2);e.set(c),c=e}return t},g=e=>{let{isExternal:a,modifiers:o,hasImportantModifier:s,baseClassName:c,maybePostfixModifierPosition:l}=qs(e);if(a)return Ys;let u=!!l,d;if(u){d=r(c.substring(0,l));let e=d&&n[d]?r(c):void 0;e&&e!==d&&(d=e,u=!1)}else d=r(c);if(!d){if(!u||(d=r(c),!d))return Ys;u=!1}let f=o.length===0?``:o.length===1?o[0]:t(o).join(`:`),p=s?f+`!`:f,m=i(d,u),g=[];for(let e=0;e<m.length;e++)g.push(h(p+m[e]));return{isExternal:!1,classId:h(p+d),conflictIds:g}},_=e=>{let t=a[e];return t===void 0?(t=o[e],t===void 0&&(t=g(e)),a[e]=t,++s>Xs&&(s=0,o=a,a=Object.create(null)),t):t};return{parseClassName:qs,sortModifiers:t,postfixLookupClassGroupIds:n,getClassGroupId:r,getConflictingClassGroupIds:i,getClassDescriptor:_,mergeClassList:e=>{let t=f(e),n=t.length;if(n===1)return t[0];m>Zs&&(p.clear(),m=0,a=Object.create(null),o=Object.create(null),s=0),l=l+1|0,l===0&&(l=1);let r=l;if(n>u.length){let e=u.length;for(;e<n;)e*=2;u=new Uint8Array(e)}let i=!1,h=0;for(let e=n-1;e>=0;--e){let n=t[e];h+=n.length;let a=_(n);if(a.isExternal){u[e]=1;continue}let o=a.classId;if(c[o]===r){u[e]=0,i=!0;continue}c[o]=r;let s=a.conflictIds;for(let e=0;e<s.length;e++)c[s[e]]=r;u[e]=1}if(!i&&!d&&e.length===h+n-1)return e;let g=``;for(let e=0;e<n;e++)u[e]===1&&(g&&(g+=` `),g+=t[e]);return g}}},$s=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e<n.length;e++)t[n[e]]=!0;return t},ec=(...e)=>{let t=0,n,r,i=``;for(;t<e.length;)(n=e[t++])&&(r=tc(n))&&(i&&(i+=` `),i+=r);return i},tc=e=>{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r<e.length;r++)e[r]&&(t=tc(e[r]))&&(n&&(n+=` `),n+=t);return n},nc=500,rc=e=>{let t,n,r=Object.create(null),i=Object.create(null),a=0,o=r=>(t=Qs(e()),n=t.mergeClassList,c.mergeString=s,s(r)),s=e=>{let t=r[e];return t===void 0?(t=i[e],t===void 0&&(t=n(e)),r[e]=t,++a>nc&&(a=0,i=r,r=Object.create(null)),t):t},c=(...e)=>c.mergeString(ec(...e));return c.mergeString=o,c},ic=[],ac=e=>{let t=t=>t[e]||ic;return t.isThemeGetter=!0,t},oc=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,sc=/^\((?:(\w[\w-]*):)?(.+)\)$/i,cc=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,lc=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,uc=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,dc=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,fc=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,pc=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,mc=Number,hc=Number.isNaN,gc=Number.isInteger,_c=e=>cc.test(e),vc=e=>!!e&&!hc(mc(e)),yc=e=>!!e&&gc(mc(e)),bc=e=>e.endsWith(`%`)&&vc(e.slice(0,-1)),xc=e=>lc.test(e),Sc=()=>!0,Cc=e=>uc.test(e)&&!dc.test(e),wc=()=>!1,Tc=e=>fc.test(e),Ec=e=>pc.test(e),Dc=e=>!H(e)&&!U(e),Oc=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),kc=e=>Wc(e,Jc,wc),H=e=>oc.test(e),Ac=e=>Wc(e,Yc,Cc),jc=e=>Wc(e,Xc,vc),Mc=e=>Wc(e,Qc,Sc),Nc=e=>Wc(e,Zc,wc),Pc=e=>Wc(e,Kc,wc),Fc=e=>Wc(e,qc,Ec),Ic=e=>Wc(e,$c,Tc),U=e=>sc.test(e),Lc=e=>Gc(e,Yc),Rc=e=>Gc(e,Zc),zc=e=>Gc(e,Kc),Bc=e=>Gc(e,Jc),Vc=e=>Gc(e,qc),Hc=e=>Gc(e,$c,!0),Uc=e=>Gc(e,Qc,!0),Wc=(e,t,n)=>{let r=oc.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Gc=(e,t,n=!1)=>{let r=sc.exec(e);return r?r[1]?t(r[1]):n:!1},Kc=e=>e===`position`||e===`percentage`,qc=e=>e===`image`||e===`url`,Jc=e=>e===`length`||e===`size`||e===`bg-size`,Yc=e=>e===`length`,Xc=e=>e===`number`,Zc=e=>e===`family-name`,Qc=e=>e===`number`||e===`weight`,$c=e=>e===`shadow`,el=rc(()=>{let e=ac(`color`),t=ac(`font`),n=ac(`text`),r=ac(`font-weight`),i=ac(`tracking`),a=ac(`leading`),o=ac(`breakpoint`),s=ac(`container`),c=ac(`spacing`),l=ac(`radius`),u=ac(`shadow`),d=ac(`inset-shadow`),f=ac(`text-shadow`),p=ac(`drop-shadow`),m=ac(`blur`),h=ac(`perspective`),g=ac(`aspect`),_=ac(`ease`),v=ac(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),U,H],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[U,H,c],T=()=>[_c,`full`,`auto`,...w()],E=()=>[yc,`none`,`subgrid`,U,H],D=()=>[`auto`,{span:[`full`,yc,U,H]},yc,U,H],O=()=>[yc,`auto`,U,H],k=()=>[`auto`,`min`,`max`,`fr`,U,H],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],j=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],M=()=>[`auto`,...w()],N=()=>[_c,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],P=()=>[_c,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],F=()=>[_c,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],I=()=>[e,U,H],L=()=>[...b(),zc,Pc,{position:[U,H]}],ee=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],te=()=>[`auto`,`cover`,`contain`,Bc,kc,{size:[U,H]}],ne=()=>[bc,Lc,Ac],R=()=>[``,`none`,`full`,l,U,H],z=()=>[``,vc,Lc,Ac],B=()=>[`solid`,`dashed`,`dotted`,`double`],re=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ie=()=>[vc,bc,zc,Pc],ae=()=>[``,`none`,m,U,H],oe=()=>[`none`,vc,U,H],se=()=>[`none`,vc,U,H],ce=()=>[vc,U,H],le=()=>[_c,`full`,...w()];return{theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[xc],breakpoint:[xc],color:[Sc],container:[xc],"drop-shadow":[xc],ease:[`in`,`out`,`in-out`],font:[Dc],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[xc],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[xc],shadow:[xc],spacing:[`px`,vc],text:[xc],"text-shadow":[xc],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,_c,H,U,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,U,H]}],"container-named":[Oc],columns:[{columns:[vc,H,U,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[yc,`auto`,U,H]}],basis:[{basis:[_c,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[vc,_c,`auto`,`initial`,`none`,H]}],grow:[{grow:[``,vc,U,H]}],shrink:[{shrink:[``,vc,U,H]}],order:[{order:[yc,`first`,`last`,`none`,U,H]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...j(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...j()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...j(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...j(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...j(),`baseline`]}],"place-self":[{"place-self":[`auto`,...j()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mbs:[{mbs:M()}],mbe:[{mbe:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:N()}],"inline-size":[{inline:[`auto`,...P()]}],"min-inline-size":[{"min-inline":[`auto`,...P()]}],"max-inline-size":[{"max-inline":[`none`,...P()]}],"block-size":[{block:[`auto`,...F()]}],"min-block-size":[{"min-block":[`auto`,...F()]}],"max-block-size":[{"max-block":[`none`,...F()]}],w:[{w:[s,`screen`,...N()]}],"min-w":[{"min-w":[s,`screen`,`none`,...N()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...N()]}],h:[{h:[`screen`,`lh`,...N()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...N()]}],"max-h":[{"max-h":[`screen`,`lh`,...N()]}],"font-size":[{text:[`base`,n,Lc,Ac]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Uc,Mc]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,bc,H]}],"font-family":[{font:[Rc,Nc,t]}],"font-features":[{"font-features":[H]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,U,H]}],"line-clamp":[{"line-clamp":[vc,`none`,U,jc]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,U,H]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,U,H]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:I()}],"text-color":[{text:I()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...B(),`wavy`]}],"text-decoration-thickness":[{decoration:[vc,`from-font`,`auto`,U,Ac]}],"text-decoration-color":[{decoration:I()}],"underline-offset":[{"underline-offset":[vc,`auto`,U,H]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[yc,U,H]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,U,H]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,U,H]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:L()}],"bg-repeat":[{bg:ee()}],"bg-size":[{bg:te()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},yc,U,H],radial:[``,U,H],conic:[yc,U,H]},Vc,Fc]}],"bg-color":[{bg:I()}],"gradient-from-pos":[{from:ne()}],"gradient-via-pos":[{via:ne()}],"gradient-to-pos":[{to:ne()}],"gradient-from":[{from:I()}],"gradient-via":[{via:I()}],"gradient-to":[{to:I()}],rounded:[{rounded:R()}],"rounded-s":[{"rounded-s":R()}],"rounded-e":[{"rounded-e":R()}],"rounded-t":[{"rounded-t":R()}],"rounded-r":[{"rounded-r":R()}],"rounded-b":[{"rounded-b":R()}],"rounded-l":[{"rounded-l":R()}],"rounded-ss":[{"rounded-ss":R()}],"rounded-se":[{"rounded-se":R()}],"rounded-ee":[{"rounded-ee":R()}],"rounded-es":[{"rounded-es":R()}],"rounded-tl":[{"rounded-tl":R()}],"rounded-tr":[{"rounded-tr":R()}],"rounded-br":[{"rounded-br":R()}],"rounded-bl":[{"rounded-bl":R()}],"border-w":[{border:z()}],"border-w-x":[{"border-x":z()}],"border-w-y":[{"border-y":z()}],"border-w-s":[{"border-s":z()}],"border-w-e":[{"border-e":z()}],"border-w-bs":[{"border-bs":z()}],"border-w-be":[{"border-be":z()}],"border-w-t":[{"border-t":z()}],"border-w-r":[{"border-r":z()}],"border-w-b":[{"border-b":z()}],"border-w-l":[{"border-l":z()}],"divide-x":[{"divide-x":z()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":z()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...B(),`hidden`,`none`]}],"divide-style":[{divide:[...B(),`hidden`,`none`]}],"border-color":[{border:I()}],"border-color-x":[{"border-x":I()}],"border-color-y":[{"border-y":I()}],"border-color-s":[{"border-s":I()}],"border-color-e":[{"border-e":I()}],"border-color-bs":[{"border-bs":I()}],"border-color-be":[{"border-be":I()}],"border-color-t":[{"border-t":I()}],"border-color-r":[{"border-r":I()}],"border-color-b":[{"border-b":I()}],"border-color-l":[{"border-l":I()}],"divide-color":[{divide:I()}],"outline-style":[{outline:[...B(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[vc,U,H]}],"outline-w":[{outline:[``,vc,Lc,Ac]}],"outline-color":[{outline:I()}],shadow:[{shadow:[``,`none`,u,Hc,Ic]}],"shadow-color":[{shadow:I()}],"inset-shadow":[{"inset-shadow":[`none`,d,Hc,Ic]}],"inset-shadow-color":[{"inset-shadow":I()}],"ring-w":[{ring:z()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:I()}],"ring-offset-w":[{"ring-offset":[vc,Ac]}],"ring-offset-color":[{"ring-offset":I()}],"inset-ring-w":[{"inset-ring":z()}],"inset-ring-color":[{"inset-ring":I()}],"text-shadow":[{"text-shadow":[`none`,f,Hc,Ic]}],"text-shadow-color":[{"text-shadow":I()}],opacity:[{opacity:[vc,U,H]}],"mix-blend":[{"mix-blend":[...re(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":re()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[vc]}],"mask-image-linear-from-pos":[{"mask-linear-from":ie()}],"mask-image-linear-to-pos":[{"mask-linear-to":ie()}],"mask-image-linear-from-color":[{"mask-linear-from":I()}],"mask-image-linear-to-color":[{"mask-linear-to":I()}],"mask-image-t-from-pos":[{"mask-t-from":ie()}],"mask-image-t-to-pos":[{"mask-t-to":ie()}],"mask-image-t-from-color":[{"mask-t-from":I()}],"mask-image-t-to-color":[{"mask-t-to":I()}],"mask-image-r-from-pos":[{"mask-r-from":ie()}],"mask-image-r-to-pos":[{"mask-r-to":ie()}],"mask-image-r-from-color":[{"mask-r-from":I()}],"mask-image-r-to-color":[{"mask-r-to":I()}],"mask-image-b-from-pos":[{"mask-b-from":ie()}],"mask-image-b-to-pos":[{"mask-b-to":ie()}],"mask-image-b-from-color":[{"mask-b-from":I()}],"mask-image-b-to-color":[{"mask-b-to":I()}],"mask-image-l-from-pos":[{"mask-l-from":ie()}],"mask-image-l-to-pos":[{"mask-l-to":ie()}],"mask-image-l-from-color":[{"mask-l-from":I()}],"mask-image-l-to-color":[{"mask-l-to":I()}],"mask-image-x-from-pos":[{"mask-x-from":ie()}],"mask-image-x-to-pos":[{"mask-x-to":ie()}],"mask-image-x-from-color":[{"mask-x-from":I()}],"mask-image-x-to-color":[{"mask-x-to":I()}],"mask-image-y-from-pos":[{"mask-y-from":ie()}],"mask-image-y-to-pos":[{"mask-y-to":ie()}],"mask-image-y-from-color":[{"mask-y-from":I()}],"mask-image-y-to-color":[{"mask-y-to":I()}],"mask-image-radial":[{"mask-radial":[U,H]}],"mask-image-radial-from-pos":[{"mask-radial-from":ie()}],"mask-image-radial-to-pos":[{"mask-radial-to":ie()}],"mask-image-radial-from-color":[{"mask-radial-from":I()}],"mask-image-radial-to-color":[{"mask-radial-to":I()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[vc]}],"mask-image-conic-from-pos":[{"mask-conic-from":ie()}],"mask-image-conic-to-pos":[{"mask-conic-to":ie()}],"mask-image-conic-from-color":[{"mask-conic-from":I()}],"mask-image-conic-to-color":[{"mask-conic-to":I()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:L()}],"mask-repeat":[{mask:ee()}],"mask-size":[{mask:te()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,U,H]}],filter:[{filter:[``,`none`,U,H]}],blur:[{blur:ae()}],brightness:[{brightness:[vc,U,H]}],contrast:[{contrast:[vc,U,H]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,Hc,Ic]}],"drop-shadow-color":[{"drop-shadow":I()}],grayscale:[{grayscale:[``,vc,U,H]}],"hue-rotate":[{"hue-rotate":[vc,U,H]}],invert:[{invert:[``,vc,U,H]}],saturate:[{saturate:[vc,U,H]}],sepia:[{sepia:[``,vc,U,H]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,U,H]}],"backdrop-blur":[{"backdrop-blur":ae()}],"backdrop-brightness":[{"backdrop-brightness":[vc,U,H]}],"backdrop-contrast":[{"backdrop-contrast":[vc,U,H]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,vc,U,H]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[vc,U,H]}],"backdrop-invert":[{"backdrop-invert":[``,vc,U,H]}],"backdrop-opacity":[{"backdrop-opacity":[vc,U,H]}],"backdrop-saturate":[{"backdrop-saturate":[vc,U,H]}],"backdrop-sepia":[{"backdrop-sepia":[``,vc,U,H]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,U,H]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[vc,`initial`,U,H]}],ease:[{ease:[`linear`,`initial`,_,U,H]}],delay:[{delay:[vc,U,H]}],animate:[{animate:[`none`,v,U,H]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,U,H]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:oe()}],"rotate-x":[{"rotate-x":oe()}],"rotate-y":[{"rotate-y":oe()}],"rotate-z":[{"rotate-z":oe()}],scale:[{scale:se()}],"scale-x":[{"scale-x":se()}],"scale-y":[{"scale-y":se()}],"scale-z":[{"scale-z":se()}],"scale-3d":[`scale-3d`],skew:[{skew:ce()}],"skew-x":[{"skew-x":ce()}],"skew-y":[{"skew-y":ce()}],transform:[{transform:[U,H,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:le()}],"translate-x":[{"translate-x":le()}],"translate-y":[{"translate-y":le()}],"translate-z":[{"translate-z":le()}],"translate-none":[`translate-none`],zoom:[{zoom:[yc,U,H]}],accent:[{accent:I()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:I()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,U,H]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":I()}],"scrollbar-track-color":[{"scrollbar-track":I()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,U,H]}],fill:[{fill:[`none`,...I()]}],"stroke-w":[{stroke:[vc,Lc,Ac,jc]}],stroke:[{stroke:[`none`,...I()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}}),tl=8,nl=e=>{let t=new WeakMap;return(n,r)=>{let i=r.length,a=!0;for(let e=0;e<i;e++){let t=r[e];if(t&&typeof t!=`string`){a=!1;break}}if(a){let e=t.get(n);if(e!==void 0)for(let t=0;t<e.length;t++){let n=e[t],a=n.values,o=!0;for(let e=0;e<i;e++)if(a[e]!==r[e]){o=!1;break}if(o)return n.result}}let o=n[0];for(let e=0;e<i;e++){let t=r[e];t&&(o+=typeof t==`string`?t:bs(t)),o+=n[e+1]}let s=e.mergeString(o);if(a){let e=t.get(n);e===void 0&&(e=[],t.set(n,e)),e.length>=tl&&e.shift(),e.push({values:r,result:s})}return s}},rl=(()=>{let e=Error();return!(`line`in e)&&!(`lineNumber`in e)})(),il=64,al=500,W=(e=>{let t=nl(e),n=new Map,r=new Map,i=0,a=t=>{let a=t.length,o=``,s=-1,c=0,l=!0;for(let e=0;e<a;e++){let n=t[e];if(n){if(typeof n!=`string`){l=!1;break}s===-1&&(o=n,s=e),c++}}if(l){if(c===0)return``;if(c===1)return e.mergeString(o);let l=n.get(o);if(l===void 0&&(l=r.get(o)),l!==void 0)for(let e=0;e<l.length;e++){let n=l[e],r=n.rest;if(r.length!==c-1)continue;let i=0,o=!0;for(let e=s+1;e<a;e++){let n=t[e];if(n&&n!==r[i++]){o=!1;break}}if(o)return n.result}let u=o,d=[];for(let e=s+1;e<a;e++){let n=t[e];n&&(u+=` `+n,d.push(n))}let f=e.mergeString(u),p=n.get(o);return p===void 0&&(p=[],n.set(o,p)),p.length>=il&&p.shift(),p.push({rest:d,result:f}),++i>al&&(i=0,r=n,n=new Map),f}let u=``;for(let e=0;e<a;e++){let n=t[e];if(!n)continue;let r=typeof n==`string`?n:bs(n);r&&(u&&(u+=` `),u+=r)}return e.mergeString(u)};return function(){let n=arguments[0];if(Array.isArray(n)&&`raw`in n){let e=n,r=arguments.length,i=[];for(let e=1;e<r;e++)i.push(arguments[e]);return t(e,i)}let r=arguments.length;if(r===1)return typeof n==`string`?e.mergeString(n):e.mergeString(bs(n));if(rl){let e=[];for(let t=0;t<r;t++)e.push(arguments[t]);return a(e)}let i=``;for(let e=0;e<r;e++){let t=arguments[e];if(!t)continue;let n=typeof t==`string`?t:bs(t);n&&(i&&(i+=` `),i+=n)}return e.mergeString(i)}})(el),ol=Object.defineProperty,sl=(e,t)=>ol(e,`name`,{value:t,configurable:!0}),cl=!!(typeof window<`u`&&window.document&&window.document.createElement);function G(e,t,{checkForDefaultPrevented:n=!0}={}){return sl(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}sl(G,`composeEventHandlers`);function ll(e){if(!cl)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}sl(ll,`getOwnerWindow`);function ul(e){if(!cl)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}sl(ul,`getOwnerDocument`);function dl(e,t=!1){let{activeElement:n}=ul(e);if(!n?.nodeName)return null;if(fl(n)&&n.contentDocument)return dl(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=ul(n).getElementById(e);if(t)return t}}return n}sl(dl,`getActiveElement`);function fl(e){return e.tagName===`IFRAME`}sl(fl,`isFrame`);var pl=Object.defineProperty,ml=(e,t)=>pl(e,`name`,{value:t,configurable:!0});function hl(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ml(hl,`setRef`);function gl(...e){return t=>{let n=!1,r=e.map(e=>{let r=hl(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():hl(e[t],null)}}}}ml(gl,`composeRefs`);function _l(...e){return v.useCallback(gl(...e),e)}ml(_l,`useComposedRefs`);var vl=Object.defineProperty,yl=(e,t)=>vl(e,`name`,{value:t,configurable:!0});function bl(e,t){let n=v.createContext(t);n.displayName=e+`Context`;let r=yl(e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,y.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=v.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return yl(i,`useContext`),[r,i]}yl(bl,`createContext`);function xl(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=yl(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,y.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=v.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return yl(s,`useContext`),[o,s]}yl(r,`createContext`);let i=yl(()=>{let t=n.map(e=>v.createContext(e));return yl(function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,Sl(i,...t)]}yl(xl,`createContextScope`);function Sl(...e){let t=e[0];if(e.length===1)return t;let n=yl(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return yl(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}yl(Sl,`composeContextScopes`);var Cl=Object.defineProperty,wl=(e,t)=>Cl(e,`name`,{value:t,configurable:!0});function Tl(e){let t=v.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];Pl(r)&&typeof Rl==`function`&&(r=Rl(r._payload)),v.Children.forEach(r,e=>{if(Ml(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;Pl(n)&&typeof Rl==`function`&&(n=Rl(n._payload)),a=kl(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=v.cloneElement(a,void 0,s):!o&&v.Children.count(r)===1&&v.isValidElement(r)&&(a=r);let c=a?jl(a):void 0,l=_l(n,c);if(!a){if(r||r===0)throw Error(o?Ll(e):Il(e));return r}let u=Al(i,a.props??{});return a.type!==v.Fragment&&(u.ref=n?l:c),v.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}wl(Tl,`createSlot`);var El=Tl(`Slot`),Dl=Symbol.for(`radix.slottable`);function Ol(e){let t=wl(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=Dl,t}wl(Ol,`createSlottable`);var kl=wl((e,t)=>{if(`child`in e.props){let t=e.props.child;return v.isValidElement(t)?v.cloneElement(t,void 0,e.props.children(t.props.children)):null}return v.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function Al(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}wl(Al,`mergeProps`);function jl(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}wl(jl,`getElementRef`);function Ml(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===Dl}wl(Ml,`isSlottable`);var Nl=Symbol.for(`react.lazy`);function Pl(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===Nl&&`_payload`in e&&Fl(e._payload)}wl(Pl,`isLazyComponent`);function Fl(e){return typeof e==`object`&&!!e&&`then`in e}wl(Fl,`isPromiseLike`);var Il=wl(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),Ll=wl(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),Rl=v.use,zl=Object.defineProperty,K=(e,t)=>zl(e,`name`,{value:t,configurable:!0});function Bl(e){let t=e+`CollectionProvider`,[n,r]=xl(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=K(e=>{let{scope:t,children:n}=e,r=v.useRef(null),a=v.useRef(new Map).current;return(0,y.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=Tl(s),l=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=_l(t,a(s,n).collectionRef);return(0,y.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=Tl(u),p=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),s=_l(t,o),c=a(u,n);return v.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,y.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return v.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return K(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}K(Bl,`createCollection`);var Vl=new WeakMap,Hl=class e extends Map{static{K(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Vl.set(this,!0)}set(e,t){return Vl.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Gl(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e<c;e++)if(o===e){let i=l[e];l[e]===t&&(i=l[e+1]),r&&this.delete(t),u=this.get(i),this.set(t,n)}else{!d&&l[e-1]===t&&(d=!0);let n=l[d?e:e-1],r=u;u=this.get(n),this.delete(n),this.set(n,r)}return this}with(t,n,r){let i=new e(this);return i.insert(t,n,r),i}before(e){let t=this.#e.indexOf(e)-1;if(!(t<0))return this.entryAt(t)}setBefore(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r,t,n)}after(e){let t=this.#e.indexOf(e);if(t=t===-1||t===this.size-1?-1:t+1,t!==-1)return this.entryAt(t)}setAfter(e,t,n){let r=this.#e.indexOf(e);return r===-1?this:this.insert(r+1,t,n)}first(){return this.entryAt(0)}last(){return this.entryAt(-1)}clear(){return this.#e=[],super.clear()}delete(e){let t=super.delete(e);return t&&this.#e.splice(this.#e.indexOf(e),1),t}deleteAt(e){let t=this.keyAt(e);return t!==void 0&&this.delete(t)}at(e){let t=Ul(this.#e,e);if(t!==void 0)return this.get(t)}entryAt(e){let t=Ul(this.#e,e);if(t!==void 0)return[t,this.get(t)]}indexOf(e){return this.#e.indexOf(e)}keyAt(e){return Ul(this.#e,e)}from(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Ul(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Wl(e,t);return n===-1?void 0:e[n]}K(Ul,`at`);function Wl(e,t){let n=e.length,r=Gl(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}K(Wl,`toSafeIndex`);function Gl(e){return e!==e||e===0?0:Math.trunc(e)}K(Gl,`toSafeInteger`);function Kl(e){let t=e+`CollectionProvider`,[n,r]=xl(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new Hl,setItemMap:K(()=>void 0,`setItemMap`)}),o=K(({state:e,...t})=>e?(0,y.jsx)(c,{...t,state:e}):(0,y.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=K(e=>{let t=h();return(0,y.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=K(e=>{let{scope:t,children:n,state:r}=e,a=v.useRef(null),[o,s]=v.useState(null),c=_l(a,s),[l,u]=r;return v.useEffect(()=>{if(!o)return;let e=Xl(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,y.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=Tl(l),d=v.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=_l(t,a(l,n).collectionRef);return(0,y.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=Tl(f),m=v.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=v.useRef(null),[s,c]=v.useState(null),l=_l(t,o,c),{setItemMap:u}=a(f,n),d=v.useRef(i);ql(d.current,i)||(d.current=i);let m=d.current;return v.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Yl):(t.set(s,{...e,element:s}),t.toSorted(Yl)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new Hl(e)))}},[s,m,u]),(0,y.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return v.useState(new Hl)}K(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return K(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}K(Kl,`createCollection`);function ql(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}K(ql,`shallowEqual`);function Jl(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}K(Jl,`isElementPreceding`);function Yl(e,t){return!e[1].element||!t[1].element?0:Jl(e[1].element,t[1].element)?-1:1}K(Yl,`sortByDocumentPosition`);function Xl(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}K(Xl,`getChildListObserver`);var Zl=t(s(),1),Ql=Object.defineProperty,$l=(e,t)=>Ql(e,`name`,{value:t,configurable:!0}),eu=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=Tl(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,y.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function tu(e,t){e&&Zl.flushSync(()=>e.dispatchEvent(t))}$l(tu,`dispatchDiscreteCustomEvent`);var nu=Object.defineProperty,ru=(e,t)=>nu(e,`name`,{value:t,configurable:!0});function iu(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}ru(iu,`useCallbackRef`);var au=Object.defineProperty,ou=(e,t)=>au(e,`name`,{value:t,configurable:!0}),su=`dismissableLayer.update`,cu=`dismissableLayer.pointerDownOutside`,lu=`dismissableLayer.focusOutside`,uu,du=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),fu=v.forwardRef(ou(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=v.useContext(du),[d,f]=v.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=v.useState({}),h=_l(t,f),g=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=_?g.indexOf(_):-1,x=d?g.indexOf(d):-1,S=u.layersWithOutsidePointerEventsDisabled.size>0,C=x>=b,w=v.useRef(!1),T=gu(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:w,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:v.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return C&&!t},[u.branches,C])}),E=_u(e=>{if(r&&w.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),D=d?x===g.length-1:!1,O=iu(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return v.useEffect(()=>{if(D)return p.addEventListener(`keydown`,O,{capture:!0}),()=>p.removeEventListener(`keydown`,O,{capture:!0})},[p,D,O]),v.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(uu=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),vu(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=uu))}},[d,p,n,u]),v.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),vu())},[d,u]),v.useEffect(()=>{let e=ou(()=>m({}),`handleUpdate`);return document.addEventListener(su,e),()=>document.removeEventListener(su,e)},[]),(0,y.jsx)(eu.div,{...l,ref:h,style:{pointerEvents:S?C?`auto`:`none`:void 0,...e.style},onFocusCapture:G(e.onFocusCapture,E.onFocusCapture),onBlurCapture:G(e.onBlurCapture,E.onBlurCapture),onPointerDownCapture:G(e.onPointerDownCapture,T.onPointerDownCapture)})},`DismissableLayer`)),pu=v.forwardRef(ou(function(e,t){let n=v.useContext(du),r=v.useRef(null),i=_l(t,r);return v.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,y.jsx)(eu.div,{...e,ref:i})},`DismissableLayerBranch`));function mu(){let e=v.useContext(du),[t,n]=v.useState(null);return v.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}ou(mu,`useDismissableLayerSurface`);var hu=ou(()=>!0,`IS_TRUE`);function gu(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=hu}=t,s=iu(e),c=v.useRef(!1),l=v.useRef(!1),u=v.useRef(new Map),d=v.useRef(()=>{});return v.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}ou(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}ou(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}ou(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}ou(p,`handleInteractionBubble`);let m=ou(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||yu(cu,s,p,{discrete:!0})};if(ou(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:ou(()=>c.current=!0,`onPointerDownCapture`)}}ou(gu,`usePointerDownOutside`);function _u(e,t=globalThis?.document){let n=iu(e),r=v.useRef(!1);return v.useEffect(()=>{let e=ou(e=>{e.target&&!r.current&&yu(lu,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:ou(()=>r.current=!0,`onFocusCapture`),onBlurCapture:ou(()=>r.current=!1,`onBlurCapture`)}}ou(_u,`useFocusOutside`);function vu(){let e=new CustomEvent(su);document.dispatchEvent(e)}ou(vu,`dispatchUpdate`);function yu(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?tu(i,a):i.dispatchEvent(a)}ou(yu,`handleAndDispatchCustomEvent`);var bu=fu,xu=pu,Su=globalThis?.document?v.useLayoutEffect:()=>{},Cu=Object.defineProperty,wu=v.forwardRef(((e,t)=>Cu(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=v.useState(!1);Su(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Zl.createPortal((0,y.jsx)(eu.div,{...r,ref:t}),o):null},`Portal`)),Tu=Object.defineProperty,Eu=(e,t)=>Tu(e,`name`,{value:t,configurable:!0});function Du(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}Eu(Du,`useStateMachine`);var Ou=Eu(e=>{let{present:t,children:n}=e,r=ku(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=ju(r.ref,Nu(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null},`Presence`);function ku(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),o=v.useRef(void 0),[s,c]=Du(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{s===`mounted`?(a.current=o.current??Mu(r.current),o.current=void 0):a.current=`none`},[s]),Su(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=Mu(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),Su(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=Eu(a=>{let o=Mu(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=Eu(e=>{e.target===t&&(a.current=Mu(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:v.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=Mu(t)}else r.current=null;n(e)},[])}}Eu(ku,`usePresence`);function Au(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}Eu(Au,`setRef`);function ju(...e){let t=v.useRef(e);return t.current=e,v.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Au(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;e<i.length;e++){let t=i[e];typeof t==`function`?t():Au(n[e],null)}}},[])}Eu(ju,`useStableComposedRefs`);function Mu(e){return e?.animationName||`none`}Eu(Mu,`getAnimationName`);function Nu(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}Eu(Nu,`getElementRef`);var Pu=Object.defineProperty,Fu=(e,t)=>Pu(e,`name`,{value:t,configurable:!0}),Iu=v.useEffectEvent,Lu=v.useInsertionEffect;function Ru(e){if(typeof Iu==`function`)return Iu(e);let t=v.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Lu==`function`?Lu(()=>{t.current=e}):Su(()=>{t.current=e}),v.useMemo(()=>((...e)=>t.current?.(...e)),[])}Fu(Ru,`useEffectEvent`);var zu=Object.defineProperty,Bu=(e,t)=>zu(e,`name`,{value:t,configurable:!0}),Vu=v.useInsertionEffect||Su;function Hu({prop:e,defaultProp:t,onChange:n=Bu(()=>{},`onChange`),caller:r}){let[i,a,o]=Uu({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,v.useCallback(t=>{if(s){let n=Wu(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Bu(Hu,`useControllableState`);function Uu({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return Vu(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Bu(Uu,`useUncontrolledState`);function Wu(e){return typeof e==`function`}Bu(Wu,`isFunction`);var Gu=Symbol(`RADIX:SYNC_STATE`);function Ku(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Ru(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=v.useReducer((t,n)=>{if(n.type===Gu)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=v.useRef(p);v.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=v.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return v.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Gu,state:i})},[i,d.state,c]),[h,f]}Bu(Ku,`useControllableStateReducer`);var qu=Object.defineProperty,Ju=(e,t)=>qu(e,`name`,{value:t,configurable:!0}),Yu=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Xu=v.forwardRef(Ju(function(e,t){return(0,y.jsx)(eu.span,{...e,ref:t,style:{...Yu,...e.style}})},`VisuallyHidden`)),Zu=e({Action:()=>Gd,Close:()=>Kd,Description:()=>Wd,Provider:()=>Bd,Root:()=>Hd,Title:()=>Ud,Toast:()=>xd,ToastAction:()=>kd,ToastClose:()=>jd,ToastDescription:()=>Dd,ToastProvider:()=>cd,ToastTitle:()=>Ed,ToastViewport:()=>pd,Viewport:()=>Vd,createToastScope:()=>ad}),Qu=Object.defineProperty,$u=(e,t)=>Qu(e,`name`,{value:t,configurable:!0}),ed=`ToastProvider`,[td,nd,rd]=Bl(`Toast`),[id,ad]=xl(`Toast`,[rd]),[od,sd]=id(ed),cd=$u(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=v.useState(null),[u,d]=v.useState(0),f=v.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ed}\`. Expected non-empty \`string\`.`),(0,y.jsx)(td.Provider,{scope:t,children:(0,y.jsx)(od,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:v.useCallback(()=>d(e=>e+1),[]),onToastRemove:v.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),ld=`ToastViewport`,ud=[`F8`],dd=`toast.viewportPause`,fd=`toast.viewportResume`,pd=v.forwardRef($u(function(e,t){let{__scopeToast:n,hotkey:r=ud,label:i=`Notifications ({hotkey})`,...a}=e,o=sd(ld,n),s=nd(n),c=v.useRef(null),l=v.useRef(null),u=v.useRef(null),d=v.useRef(null),f=_l(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;v.useEffect(()=>{let e=$u(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),v.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=$u(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(dd);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=$u(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(fd);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=$u(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=$u(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=v.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Rd(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return v.useEffect(()=>{let e=d.current;if(e){let t=$u(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);zd(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,y.jsxs)(xu,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,y.jsx)(hd,{ref:l,onFocusFromOutsideViewport:()=>{zd(h({tabbingDirection:`forwards`}))}}),(0,y.jsx)(td.Slot,{scope:n,children:(0,y.jsx)(eu.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,y.jsx)(hd,{ref:u,onFocusFromOutsideViewport:()=>{zd(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),md=`ToastFocusProxy`,hd=v.forwardRef($u(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=sd(md,n);return(0,y.jsx)(Xu,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),gd=`Toast`,_d=`toast.swipeStart`,vd=`toast.swipeMove`,yd=`toast.swipeCancel`,bd=`toast.swipeEnd`,xd=v.forwardRef($u(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Hu({prop:r,defaultProp:i??!0,onChange:a,caller:gd});return(0,y.jsx)(Ou,{present:n||s,children:(0,y.jsx)(wd,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:iu(e.onPause),onResume:iu(e.onResume),onSwipeStart:G(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:G(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:G(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:G(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[Sd,Cd]=id(gd,{onClose(){}}),wd=v.forwardRef($u(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=sd(gd,n),g=nd(n),[_,b]=v.useState(null),x=_l(t,b),S=v.useRef(null),C=v.useRef(null),w=i||h.duration,T=v.useRef(0),E=v.useRef(w),D=v.useRef(0),{onToastAdd:O,onToastRemove:k}=h,A=iu(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),j=v.useCallback(e=>{!e||e===1/0||(window.clearTimeout(D.current),T.current=new Date().getTime(),D.current=window.setTimeout(A,e))},[A]);v.useEffect(()=>{let e=h.viewport;if(e){let t=$u(()=>{j(E.current),l?.()},`handleResume`),n=$u(()=>{let e=new Date().getTime()-T.current;E.current-=e,window.clearTimeout(D.current),c?.()},`handlePause`);return e.addEventListener(dd,n),e.addEventListener(fd,t),()=>{e.removeEventListener(dd,n),e.removeEventListener(fd,t)}}},[h.viewport,w,c,l,j]),v.useEffect(()=>{a&&!h.isClosePausedRef.current&&j(w)},[a,w,h.isClosePausedRef,j]),v.useEffect(()=>()=>{window.clearTimeout(D.current)},[]),v.useEffect(()=>(O(),()=>k()),[O,k]);let M=v.useMemo(()=>_?Nd(_):null,[_]);return h.viewport?(0,y.jsxs)(y.Fragment,{children:[M&&(0,y.jsx)(Td,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:M}),(0,y.jsx)(Sd,{scope:n,onClose:A,children:Zl.createPortal((0,y.jsx)(td.ItemSlot,{scope:n,children:(0,y.jsx)(bu,{asChild:!0,onEscapeKeyDown:G(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||A()}),children:(0,y.jsx)(eu.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:x,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:G(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||A())}),onPointerDown:G(e.onPointerDown,e=>{e.button===0&&(S.current={x:e.clientX,y:e.clientY})}),onPointerMove:G(e.onPointerMove,e=>{if(!S.current)return;let t=e.clientX-S.current.x,n=e.clientY-S.current.y,r=!!C.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(C.current=l,Pd(vd,d,f,{discrete:!1})):Fd(l,h.swipeDirection,c)?(C.current=l,Pd(_d,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(S.current=null)}),onPointerUp:G(e.onPointerUp,e=>{let t=C.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),C.current=null,S.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Fd(t,h.swipeDirection,h.swipeThreshold)?Pd(bd,p,r,{discrete:!0}):Pd(yd,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),Td=$u(e=>{let{__scopeToast:t,children:n,...r}=e,i=sd(gd,t),[a,o]=v.useState(!1),[s,c]=v.useState(!1);return Id(()=>o(!0)),v.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,y.jsx)(wu,{asChild:!0,container:i.announcerContainer||void 0,children:(0,y.jsx)(Xu,{...r,children:a&&(0,y.jsxs)(y.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),Ed=v.forwardRef($u(function(e,t){let{__scopeToast:n,...r}=e;return(0,y.jsx)(eu.div,{...r,ref:t})},`ToastTitle`)),Dd=v.forwardRef($u(function(e,t){let{__scopeToast:n,...r}=e;return(0,y.jsx)(eu.div,{...r,ref:t})},`ToastDescription`)),Od=`ToastAction`,kd=v.forwardRef($u(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,y.jsx)(Md,{altText:n,asChild:!0,children:(0,y.jsx)(jd,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Od}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),Ad=`ToastClose`,jd=v.forwardRef($u(function(e,t){let{__scopeToast:n,...r}=e,i=Cd(Ad,n);return(0,y.jsx)(Md,{asChild:!0,children:(0,y.jsx)(eu.button,{type:`button`,...r,ref:t,onClick:G(e.onClick,i.onClose)})})},`ToastClose`)),Md=v.forwardRef($u(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,y.jsx)(eu.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Nd(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),Ld(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Nd(e))}}}),t}$u(Nd,`getAnnounceTextContent`);function Pd(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?tu(i,a):i.dispatchEvent(a)}$u(Pd,`handleAndDispatchCustomEvent`);var Fd=$u((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function Id(e=()=>{}){let t=iu(e);Su(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}$u(Id,`useNextFrame`);function Ld(e){return e.nodeType===e.ELEMENT_NODE}$u(Ld,`isHTMLElement`);function Rd(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:$u(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}$u(Rd,`getTabbableCandidates`);function zd(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}$u(zd,`focusFirst`);var Bd=cd,Vd=pd,Hd=xd,Ud=Ed,Wd=Dd,Gd=kd,Kd=jd,qd=l();function Jd(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Jd(e[t]))&&(r&&(r+=` `),r+=n)}else for(n in e)e[n]&&(r&&(r+=` `),r+=n)}return r}function Yd(){for(var e,t,n=0,r=``,i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Jd(e))&&(r&&(r+=` `),r+=t);return r}var Xd=e=>typeof e==`boolean`?`${e}`:e===0?`0`:e,Zd=Yd,Qd=(e,t)=>n=>{if(t?.variants==null)return Zd(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=Xd(t)||Xd(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return Zd(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},$d=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),ef=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),tf=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),nf=e=>{let t=tf(e);return t.charAt(0).toUpperCase()+t.slice(1)},rf={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},af=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},of=(0,v.createContext)({}),sf=()=>(0,v.useContext)(of),cf=(0,v.forwardRef)(({color:e,size:t,strokeWidth:n,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>{let{size:l=24,strokeWidth:u=2,absoluteStrokeWidth:d=!1,color:f=`currentColor`,className:p=``}=sf()??{},m=r??d?Number(n??u)*24/Number(t??l):n??u;return(0,v.createElement)(`svg`,{ref:c,...rf,width:t??l??rf.width,height:t??l??rf.height,stroke:e??f,strokeWidth:m,className:$d(`lucide`,p,i),...!a&&!af(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,v.createElement)(e,t)),...Array.isArray(a)?a:[a]])}),lf=(e,t)=>{let n=(0,v.forwardRef)(({className:n,...r},i)=>(0,v.createElement)(cf,{ref:i,iconNode:t,className:$d(`lucide-${ef(nf(e))}`,`lucide-${e}`,n),...r}));return n.displayName=nf(e),n},uf=lf(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),df=lf(`arrow-up-from-line`,[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]),ff=lf(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),pf=lf(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),mf=lf(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),hf=lf(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),gf=lf(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),_f=lf(`chevrons-up-down`,[[`path`,{d:`m7 15 5 5 5-5`,key:`1hf1tw`}],[`path`,{d:`m7 9 5-5 5 5`,key:`sgt6xg`}]]),vf=lf(`copy-check`,[[`path`,{d:`m12 15 2 2 4-4`,key:`2c609p`}],[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),yf=lf(`copy`,[[`rect`,{width:`14`,height:`14`,x:`8`,y:`8`,rx:`2`,ry:`2`,key:`17jyea`}],[`path`,{d:`M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2`,key:`zix9uf`}]]),bf=lf(`download`,[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]),xf=lf(`ellipsis`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]]),Sf=lf(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),Cf=lf(`globe`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]),wf=lf(`move-right`,[[`path`,{d:`M18 8L22 12L18 16`,key:`1r0oui`}],[`path`,{d:`M2 12H22`,key:`1m8cig`}]]),Tf=lf(`move-vertical`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]),Ef=lf(`pencil-ruler`,[[`path`,{d:`M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13`,key:`orapub`}],[`path`,{d:`m8 6 2-2`,key:`115y1s`}],[`path`,{d:`m18 16 2-2`,key:`ee94s4`}],[`path`,{d:`m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17`,key:`cfq27r`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Df=lf(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),Of=lf(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),kf=lf(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),Af=lf(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]),jf=lf(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),Mf=lf(`trash`,[[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Nf=lf(`wand-sparkles`,[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]]),Pf=lf(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),Ff=Zu,If=({className:e,...t})=>(0,y.jsx)(Vd,{className:W(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-105`,e),...t}),Lf=Qd(`group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-xl p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all [corner-shape:squircle] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none supports-[corner-shape:squircle]:rounded-3xl`,{variants:{variant:{error:`bg-error/40 text-text`,success:`bg-success/30 text-text`,default:`bg-card/80 text-text`}},defaultVariants:{variant:`default`}}),Rf=({className:e,variant:t,...n})=>(0,y.jsx)(Hd,{className:W(Lf({variant:t}),e),...n}),zf=({className:e,...t})=>(0,y.jsx)(Kd,{className:W(`absolute top-1 right-1 rounded-md p-1 text-text/50 opacity-0 transition-opacity hover:text-text/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.error]:text-red-300 group-[.error]:focus:ring-red-400 group-[.error]:focus:ring-offset-red-600 group-[.error]:hover:text-red-50`,e),"toast-close":``,...t,children:(0,y.jsx)(Pf,{className:`size-5`})}),Bf=({className:e,...t})=>(0,y.jsx)(Ud,{className:W(`font-semibold text-sm [&+div]:text-xs`,e),...t}),Vf=({className:e,...t})=>(0,y.jsx)(Wd,{className:W(`overflow-scroll text-sm opacity-90`,e),...t}),Hf=()=>{let e=(0,V.c)(2),{toasts:t}=_a(),n;return e[0]===t?n=e[1]:(n=(0,y.jsxs)(Ff.Provider,{children:[t.map(Uf),(0,y.jsx)(If,{})]}),e[0]=t,e[1]=n),n};function Uf(e){let{id:t,title:n,description:r,action:i,...a}=e;return(0,y.jsxs)(Rf,{...a,children:[(0,y.jsxs)(`div`,{className:`grid gap-1`,children:[n&&(0,y.jsx)(Bf,{children:n}),r&&(0,y.jsx)(Vf,{children:r})]}),i,(0,y.jsx)(zf,{})]},t)}var Wf=(0,v.createContext)({});function Gf(e){let t=(0,v.useRef)(null);return t.current===null&&(t.current=e()),t.current}var Kf=typeof window<`u`?v.useLayoutEffect:v.useEffect,qf=(0,v.createContext)(null);function Jf(e,t){e.indexOf(t)===-1&&e.push(t)}function Yf(e,t){let n=e.indexOf(t);n>-1&&e.splice(n,1)}var Xf=(e,t,n)=>n>t?t:n<e?e:n,Zf={},Qf=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),$f=e=>typeof e==`object`&&!!e,ep=e=>/^0[^.\s]+$/u.test(e);function tp(e){let t;return()=>(t===void 0&&(t=e()),t)}var np=e=>e,rp=(...e)=>e.reduce((e,t)=>n=>t(e(n))),ip=(e,t,n)=>{let r=t-e;return r?(n-e)/r:1},ap=class{constructor(){this.subscriptions=[]}add(e){return Jf(this.subscriptions,e),()=>Yf(this.subscriptions,e)}notify(e,t,n){let r=this.subscriptions.length;if(r){if(r===1)this.subscriptions[0](e,t,n);else for(let i=0;i<r;i++){let r=this.subscriptions[i];r&&r(e,t,n)}}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}},op=e=>e*1e3,sp=e=>e/1e3,cp=(e,t)=>t?1e3/t*e:0,lp=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,up=1e-7,dp=12;function fp(e,t,n,r,i){let a,o,s=0;do o=t+(n-t)/2,a=lp(o,r,i)-e,a>0?n=o:t=o;while(Math.abs(a)>up&&++s<dp);return o}function pp(e,t,n,r){if(e===t&&n===r)return np;let i=t=>fp(t,0,1,e,n);return e=>e===0||e===1?e:lp(i(e),t,r)}var mp=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,hp=e=>t=>1-e(1-t),gp=pp(.33,1.53,.69,.99),_p=hp(gp),vp=mp(_p),yp=e=>e>=1?1:(e*=2)<1?.5*_p(e):.5*(2-2**(-10*(e-1))),bp=e=>1-Math.sin(Math.acos(e)),xp=hp(bp),Sp=mp(bp),Cp=pp(.42,0,1,1),wp=pp(0,0,.58,1),Tp=pp(.42,0,.58,1),Ep=e=>Array.isArray(e)&&typeof e[0]!=`number`,Dp=e=>Array.isArray(e)&&typeof e[0]==`number`,Op={linear:np,easeIn:Cp,easeInOut:Tp,easeOut:wp,circIn:bp,circInOut:Sp,circOut:xp,backIn:_p,backInOut:vp,backOut:gp,anticipate:yp},kp=e=>typeof e==`string`,Ap=e=>{if(Dp(e)){e.length;let[t,n,r,i]=e;return pp(t,n,r,i)}return kp(e)?(Op[e],`${e}`,Op[e]):e},jp=[`setup`,`read`,`resolveKeyframes`,`preUpdate`,`update`,`preRender`,`render`,`postRender`];function Mp(e){let t=new Set,n=new Set,r=!1,i=!1,a=new WeakSet,o={delta:0,timestamp:0,isProcessing:!1};function s(t){a.has(t)&&(c.schedule(t),e()),t(o)}let c={schedule:(e,i=!1,o=!1)=>{let s=o&&r?t:n;return i&&a.add(e),s.add(e),e},cancel:e=>{n.delete(e),a.delete(e)},process:e=>{if(o=e,r){i=!0;return}r=!0;let a=t;t=n,n=a,t.forEach(s),t.clear(),r=!1,i&&(i=!1,c.process(e))}};return c}var Np=40;function Pp(e,t){let n=!1,r=!0,i={delta:0,timestamp:0,isProcessing:!1},a=()=>n=!0,o=jp.reduce((e,t)=>(e[t]=Mp(a),e),{}),{setup:s,read:c,resolveKeyframes:l,preUpdate:u,update:d,preRender:f,render:p,postRender:m}=o,h=()=>{let a=Zf.useManualTiming,o=a?i.timestamp:performance.now();n=!1,a||(i.delta=r?1e3/60:Math.max(Math.min(o-i.timestamp,Np),1)),i.timestamp=o,i.isProcessing=!0,s.process(i),c.process(i),l.process(i),u.process(i),d.process(i),f.process(i),p.process(i),m.process(i),i.isProcessing=!1,n&&t&&(r=!1,e(h))},g=()=>{n=!0,r=!0,i.isProcessing||e(h)};return{schedule:jp.reduce((e,t)=>{let r=o[t];return e[t]=(e,t=!1,i=!1)=>(n||g(),r.schedule(e,t,i)),e},{}),cancel:e=>{for(let t=0;t<jp.length;t++)o[jp[t]].cancel(e)},state:i,steps:o}}var{schedule:Fp,cancel:Ip,state:Lp,steps:Rp}=Pp(typeof requestAnimationFrame<`u`?requestAnimationFrame:np,!0),zp;function Bp(){zp=void 0}var Vp={now:()=>(zp===void 0&&Vp.set(Lp.isProcessing||Zf.useManualTiming?Lp.timestamp:performance.now()),zp),set:e=>{zp=e,queueMicrotask(Bp)}},Hp=e=>t=>typeof t==`string`&&t.startsWith(e),Up=Hp(`--`),Wp=Hp(`var(--`),Gp=e=>Wp(e)?Kp.test(e.split(`/*`)[0].trim()):!1,Kp=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function qp(e){return typeof e==`string`&&e.split(`/*`)[0].includes(`var(--`)}var Jp={test:e=>typeof e==`number`,parse:parseFloat,transform:e=>e},Yp={...Jp,transform:e=>Xf(0,1,e)},Xp={...Jp,default:1},Zp=e=>Math.round(e*1e5)/1e5,Qp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function $p(e){return e==null}var em=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,tm=(e,t)=>n=>!!(typeof n==`string`&&em.test(n)&&n.startsWith(e)||t&&!$p(n)&&Object.prototype.hasOwnProperty.call(n,t)),nm=(e,t,n)=>r=>{if(typeof r!=`string`)return r;let[i,a,o,s]=r.match(Qp);return{[e]:parseFloat(i),[t]:parseFloat(a),[n]:parseFloat(o),alpha:s===void 0?1:parseFloat(s)}},rm=e=>Xf(0,255,e),im={...Jp,transform:e=>Math.round(rm(e))},am={test:tm(`rgb`,`red`),parse:nm(`red`,`green`,`blue`),transform:({red:e,green:t,blue:n,alpha:r=1})=>`rgba(`+im.transform(e)+`, `+im.transform(t)+`, `+im.transform(n)+`, `+Zp(Yp.transform(r))+`)`};function om(e){let t=``,n=``,r=``,i=``;return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),i=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),i=e.substring(4,5),t+=t,n+=n,r+=r,i+=i),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:i?parseInt(i,16)/255:1}}var sm={test:tm(`#`),parse:om,transform:am.transform},cm=e=>({test:t=>typeof t==`string`&&t.endsWith(e)&&t.split(` `).length===1,parse:parseFloat,transform:t=>`${t}${e}`}),lm=cm(`deg`),um=cm(`%`),q=cm(`px`),dm=cm(`vh`),fm=cm(`vw`),pm={...um,parse:e=>um.parse(e)/100,transform:e=>um.transform(e*100)},mm={test:tm(`hsl`,`hue`),parse:nm(`hue`,`saturation`,`lightness`),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>`hsla(`+Math.round(e)+`, `+um.transform(Zp(t))+`, `+um.transform(Zp(n))+`, `+Zp(Yp.transform(r))+`)`},hm={test:e=>am.test(e)||sm.test(e)||mm.test(e),parse:e=>am.test(e)?am.parse(e):mm.test(e)?mm.parse(e):sm.parse(e),transform:e=>typeof e==`string`?e:e.hasOwnProperty(`red`)?am.transform(e):mm.transform(e),getAnimatableNone:e=>{let t=hm.parse(e);return t.alpha=0,hm.transform(t)}},gm=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function _m(e){return isNaN(e)&&typeof e==`string`&&(e.match(Qp)?.length||0)+(e.match(gm)?.length||0)>0}var vm=`number`,ym=`color`,bm=`var`,xm=`var(`,Sm="${}",Cm=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function wm(e){let t=e.toString(),n=[],r={color:[],number:[],var:[]},i=[],a=0;return{values:n,split:t.replace(Cm,e=>(hm.test(e)?(r.color.push(a),i.push(ym),n.push(hm.parse(e))):e.startsWith(xm)?(r.var.push(a),i.push(bm),n.push(e)):(r.number.push(a),i.push(vm),n.push(parseFloat(e))),++a,Sm)).split(Sm),indexes:r,types:i}}function Tm(e){return wm(e).values}function Em({split:e,types:t}){let n=e.length;return r=>{let i=``;for(let a=0;a<n;a++)if(i+=e[a],r[a]!==void 0){let e=t[a];i+=e===vm?Zp(r[a]):e===ym?hm.transform(r[a]):r[a]}return i}}function Dm(e){return Em(wm(e))}var Om=e=>typeof e==`number`?0:hm.test(e)?hm.getAnimatableNone(e):e,km=(e,t)=>typeof e==`number`?t?.trim().endsWith(`/`)?e:0:Om(e);function Am(e){let t=wm(e);return Em(t)(t.values.map((e,n)=>km(e,t.split[n])))}var jm={test:_m,parse:Tm,createTransformer:Dm,getAnimatableNone:Am};function Mm(e,t,n){return n<0&&(n+=1),n>1&&--n,n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Nm({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let i=0,a=0,o=0;if(!t)i=a=o=n;else{let r=n<.5?n*(1+t):n+t-n*t,s=2*n-r;i=Mm(s,r,e+1/3),a=Mm(s,r,e),o=Mm(s,r,e-1/3)}return{red:Math.round(i*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function Pm(e,t){return n=>n>0?t:e}var Fm=(e,t,n)=>e+(t-e)*n,Im=(e,t,n)=>{let r=e*e,i=n*(t*t-r)+r;return i<0?0:Math.sqrt(i)},Lm=[sm,am,mm],Rm=e=>Lm.find(t=>t.test(e));function zm(e){let t=Rm(e);if(`${e}`,!t)return!1;let n=t.parse(e);return t===mm&&(n=Nm(n)),n}var Bm=(e,t)=>{let n=zm(e),r=zm(t);if(!n||!r)return Pm(e,t);let i={...n};return e=>(i.red=Im(n.red,r.red,e),i.green=Im(n.green,r.green,e),i.blue=Im(n.blue,r.blue,e),i.alpha=Fm(n.alpha,r.alpha,e),am.transform(i))},Vm=new Set([`none`,`hidden`]);function Hm(e,t){return Vm.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function Um(e,t){return n=>Fm(e,t,n)}function Wm(e){return typeof e==`number`?Um:typeof e==`string`?Gp(e)?Pm:hm.test(e)?Bm:Jm:Array.isArray(e)?Gm:typeof e==`object`?hm.test(e)?Bm:Km:Pm}function Gm(e,t){let n=[...e],r=n.length,i=e.map((e,n)=>Wm(e)(e,t[n]));return e=>{for(let t=0;t<r;t++)n[t]=i[t](e);return n}}function Km(e,t){let n={...e,...t},r={};for(let i in n)e[i]!==void 0&&t[i]!==void 0&&(r[i]=Wm(e[i])(e[i],t[i]));return e=>{for(let t in r)n[t]=r[t](e);return n}}function qm(e,t){let n=[],r={color:0,var:0,number:0};for(let i=0;i<t.values.length;i++){let a=t.types[i],o=e.indexes[a][r[a]],s=e.values[o]??0;n[i]=s,r[a]++}return n}var Jm=(e,t)=>{let n=jm.createTransformer(t),r=wm(e),i=wm(t);return r.indexes.var.length===i.indexes.var.length&&r.indexes.color.length===i.indexes.color.length&&r.indexes.number.length>=i.indexes.number.length?Vm.has(e)&&!i.values.length||Vm.has(t)&&!r.values.length?Hm(e,t):rp(Gm(qm(r,i),i.values),n):(`${e}${t}`,Pm(e,t))};function Ym(e,t,n){return typeof e==`number`&&typeof t==`number`&&typeof n==`number`?Fm(e,t,n):Wm(e)(e,t)}var Xm=e=>{let t=({timestamp:t})=>e(t);return{start:(e=!0)=>Fp.update(t,e),stop:()=>Ip(t),now:()=>Lp.isProcessing?Lp.timestamp:Vp.now()}},Zm=(e,t,n=10)=>{let r=``,i=Math.max(Math.round(t/n),2);for(let t=0;t<i;t++)r+=Math.round(e(t/(i-1))*1e4)/1e4+`, `;return`linear(${r.substring(0,r.length-2)})`},Qm=2e4;function $m(e){let t=0,n=e.next(t);for(;!n.done&&t<2e4;)t+=50,n=e.next(t);return t>=2e4?1/0:t}function eh(e,t=100,n){let r=n({...e,keyframes:[0,t]}),i=Math.min($m(r),Qm);return{type:`keyframes`,ease:e=>r.next(i*e).value/t,duration:sp(i)}}var th={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function nh(e,t){return e*Math.sqrt(1-t*t)}var rh=12;function ih(e,t,n){let r=n;for(let n=1;n<rh;n++)r-=e(r)/t(r);return r}var ah=.001;function oh({duration:e=th.duration,bounce:t=th.bounce,velocity:n=th.velocity,mass:r=th.mass}){let i,a;th.maxDuration;let o=1-t;o=Xf(th.minDamping,th.maxDamping,o),e=Xf(th.minDuration,th.maxDuration,sp(e)),o<1?(i=t=>{let r=t*o,i=r*e,a=r-n,s=nh(t,o),c=Math.exp(-i);return ah-a/s*c},a=t=>{let r=t*o*e,a=r*n+n,s=o**2*t**2*e,c=Math.exp(-r),l=nh(t**2,o);return(-i(t)+ah>0?-1:1)*((a-s)*c)/l}):(i=t=>-.001+Math.exp(-t*e)*((t-n)*e+1),a=t=>Math.exp(-t*e)*((n-t)*(e*e)));let s=5/e,c=ih(i,a,s);if(e=op(e),isNaN(c))return{stiffness:th.stiffness,damping:th.damping,duration:e};{let t=c**2*r;return{stiffness:t,damping:o*2*Math.sqrt(r*t),duration:e}}}var sh=[`duration`,`bounce`],ch=[`stiffness`,`damping`,`mass`];function lh(e,t){return t.some(t=>e[t]!==void 0)}function uh(e){let t={velocity:th.velocity,stiffness:th.stiffness,damping:th.damping,mass:th.mass,isResolvedFromDuration:!1,...e};if(!lh(e,ch)&&lh(e,sh)){if(t.velocity=0,e.visualDuration){let n=e.visualDuration,r=2*Math.PI/(n*1.2),i=r*r,a=2*Xf(.05,1,1-(e.bounce||0))*Math.sqrt(i);t={...t,mass:th.mass,stiffness:i,damping:a}}else{let n=oh({...e,velocity:0});t={...t,...n,mass:th.mass},t.isResolvedFromDuration=!0}}return t}function dh(e=th.visualDuration,t=th.bounce){let n=typeof e==`object`?e:{visualDuration:e,keyframes:[0,1],bounce:t},{restSpeed:r,restDelta:i}=n,a=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],s={done:!1,value:a},{stiffness:c,damping:l,mass:u,duration:d,velocity:f,isResolvedFromDuration:p}=uh({...n,velocity:-sp(n.velocity||0)}),m=f||0,h=l/(2*Math.sqrt(c*u)),g=o-a,_=sp(Math.sqrt(c/u)),v=Math.abs(g)<5;r||=v?th.restSpeed.granular:th.restSpeed.default,i||=v?th.restDelta.granular:th.restDelta.default;let y,b,x,S,C,w;if(h<1)x=nh(_,h),S=(m+h*_*g)/x,y=e=>{let t=Math.exp(-h*_*e);return o-t*(S*Math.sin(x*e)+g*Math.cos(x*e))},C=h*_*S+g*x,w=h*_*g-S*x,b=e=>Math.exp(-h*_*e)*(C*Math.sin(x*e)+w*Math.cos(x*e));else if(h===1){y=e=>o-Math.exp(-_*e)*(g+(m+_*g)*e);let e=m+_*g;b=t=>Math.exp(-_*t)*(_*e*t-m)}else{let e=_*Math.sqrt(h*h-1);y=t=>{let n=Math.exp(-h*_*t),r=Math.min(e*t,300);return o-n*((m+h*_*g)*Math.sinh(r)+e*g*Math.cosh(r))/e};let t=(m+h*_*g)/e,n=h*_*t-g*e,r=h*_*g-t*e;b=t=>{let i=Math.exp(-h*_*t),a=Math.min(e*t,300);return i*(n*Math.sinh(a)+r*Math.cosh(a))}}let T={calculatedDuration:p&&d||null,velocity:e=>op(b(e)),next:e=>{if(!p&&h<1){let t=Math.exp(-h*_*e),n=Math.sin(x*e),a=Math.cos(x*e),c=o-t*(S*n+g*a),l=op(t*(C*n+w*a));return s.done=Math.abs(l)<=r&&Math.abs(o-c)<=i,s.value=s.done?o:c,s}let t=y(e);if(p)s.done=e>=d;else{let n=op(b(e));s.done=Math.abs(n)<=r&&Math.abs(o-t)<=i}return s.value=s.done?o:t,s},toString:()=>{let e=Math.min($m(T),Qm),t=Zm(t=>T.next(e*t).value,e,30);return e+`ms `+t},toTransition:()=>{}};return T}dh.applyToOptions=e=>{let t=eh(e,100,dh);return e.ease=t.ease,e.duration=op(t.duration),e.type=`keyframes`,e};var fh=5;function ph(e,t,n){let r=Math.max(t-fh,0);return cp(n-e(r),t-r)}function mh({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:i=10,bounceStiffness:a=500,modifyTarget:o,min:s,max:c,restDelta:l=.5,restSpeed:u}){let d=e[0],f={done:!1,value:d},p=e=>s!==void 0&&e<s||c!==void 0&&e>c,m=e=>s===void 0?c:c===void 0||Math.abs(s-e)<Math.abs(c-e)?s:c,h=n*t,g=d+h,_=o===void 0?g:o(g);_!==g&&(h=_-d);let v=e=>-h*Math.exp(-e/r),y=e=>_+v(e),b=e=>{let t=v(e),n=y(e);f.done=Math.abs(t)<=l,f.value=f.done?_:n},x,S,C=e=>{p(f.value)&&(x=e,S=dh({keyframes:[f.value,m(f.value)],velocity:ph(y,e,f.value),damping:i,stiffness:a,restDelta:l,restSpeed:u}))};return C(0),{calculatedDuration:null,next:e=>{let t=!1;return!S&&x===void 0&&(t=!0,b(e),C(e)),x!==void 0&&e>=x?S.next(e-x):(!t&&b(e),f)}}}function hh(e,t,n){let r=[],i=n||Zf.mix||Ym,a=e.length-1;for(let n=0;n<a;n++){let a=i(e[n],e[n+1]);t&&(a=rp(Array.isArray(t)?t[n]||np:t,a)),r.push(a)}return r}function gh(e,t,{clamp:n=!0,ease:r,mixer:i}={}){let a=e.length;if(t.length,a===1)return()=>t[0];if(a===2&&t[0]===t[1])return()=>t[1];let o=e[0]===e[1];e[0]>e[a-1]&&(e=[...e].reverse(),t=[...t].reverse());let s=hh(t,r,i),c=s.length,l=n=>{if(o&&n<e[0])return t[0];let r=0;if(c>1)for(;r<e.length-2&&!(n<e[r+1]);r++);let i=ip(e[r],e[r+1],n);return s[r](i)};return n?t=>l(Xf(e[0],e[a-1],t)):l}function _h(e,t){let n=e[e.length-1];for(let r=1;r<=t;r++){let i=ip(0,t,r);e.push(Fm(n,1,i))}}function vh(e){let t=[0];return _h(t,e.length-1),t}function yh(e,t){return e.map(e=>e*t)}function bh(e,t){return e.map(()=>t||Tp).splice(0,e.length-1)}function xh({duration:e=300,keyframes:t,times:n,ease:r=`easeInOut`}){let i=Ep(r)?r.map(Ap):Ap(r),a={done:!1,value:t[0]},o=gh(yh(n&&n.length===t.length?n:vh(t),e),t,{ease:Array.isArray(i)?i:bh(t,i)});return{calculatedDuration:e,next:t=>(a.value=o(t),a.done=t>=e,a)}}var Sh=e=>e!==null;function Ch(e,{repeat:t,repeatType:n=`loop`},r,i=1){let a=e.filter(Sh),o=i<0||t&&n!==`loop`&&t%2==1?0:a.length-1;return!o||r===void 0?a[o]:r}var wh={decay:mh,inertia:mh,tween:xh,keyframes:xh,spring:dh};function Th(e){typeof e.type==`string`&&(e.type=wh[e.type])}var Eh=class{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}},Dh=e=>e/100,Oh=class extends Eh{constructor(e){super(),this.state=`idle`,this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{let{motionValue:e}=this.options;e&&e.updatedAt!==Vp.now()&&this.tick(Vp.now()),this.isStopped=!0,this.state!==`idle`&&(this.teardown(),this.options.onStop?.())},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){let{options:e}=this;Th(e);let{type:t=xh,repeat:n=0,repeatDelay:r=0,repeatType:i,velocity:a=0}=e,{keyframes:o}=e,s=t||xh;s!==xh&&typeof o[0]!=`number`&&(this.mixKeyframes=rp(Dh,Ym(o[0],o[1])),o=[0,100]);let c=s({...e,keyframes:o});i===`mirror`&&(this.mirroredGenerator=s({...e,keyframes:[...o].reverse(),velocity:-a})),c.calculatedDuration===null&&(c.calculatedDuration=$m(c));let{calculatedDuration:l}=c;this.calculatedDuration=l,this.resolvedDuration=l+r,this.totalDuration=this.resolvedDuration*(n+1)-r,this.generator=c}updateTime(e){let t=Math.round(e-this.startTime)*this.playbackSpeed;this.currentTime=this.holdTime===null?t:this.holdTime}tick(e,t=!1){let{generator:n,totalDuration:r,mixKeyframes:i,mirroredGenerator:a,resolvedDuration:o,calculatedDuration:s}=this;if(this.startTime===null)return n.next(0);let{delay:c=0,keyframes:l,repeat:u,repeatType:d,repeatDelay:f,type:p,onUpdate:m,finalKeyframe:h}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-r/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);let g=this.currentTime-c*(this.playbackSpeed>=0?1:-1),_=this.playbackSpeed>=0?g<0:g>r;this.currentTime=Math.max(g,0),this.state===`finished`&&this.holdTime===null&&(this.currentTime=r);let v=this.currentTime,y=n;if(u){let e=Math.min(this.currentTime,r)/o,t=Math.floor(e),n=e%1;!n&&e>=1&&(n=1),n===1&&t--,t=Math.min(t,u+1),t%2&&(d===`reverse`?(n=1-n,f&&(n-=f/o)):d===`mirror`&&(y=a)),v=Xf(0,1,n)*o}let b;_?(this.delayState.value=l[0],b=this.delayState):b=y.next(v),i&&!_&&(b.value=i(b.value));let{done:x}=b;!_&&s!==null&&(x=this.playbackSpeed>=0?this.currentTime>=r:this.currentTime<=0);let S=this.holdTime===null&&(this.state===`finished`||this.state===`running`&&x);return S&&p!==mh&&(b.value=Ch(l,this.options,h,this.speed)),m&&m(b.value),S&&this.finish(),b}then(e,t){return this.finished.then(e,t)}get duration(){return sp(this.calculatedDuration)}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+sp(e)}get time(){return sp(this.currentTime)}set time(e){e=op(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state=`paused`,this.holdTime=e,this.tick(e))}getGeneratorVelocity(){let e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);let t=this.generator.next(e).value;return ph(e=>this.generator.next(e).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(Vp.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=sp(this.currentTime))}play(){if(this.isStopped)return;let{driver:e=Xm,startTime:t}=this.options;this.driver||=e(e=>this.tick(e)),this.options.onPlay?.();let n=this.driver.now();this.state===`finished`?(this.updateFinished(),this.startTime=n):this.holdTime===null?this.startTime||=t??n:this.startTime=n-this.holdTime,this.state===`finished`&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state=`running`,this.driver.start()}pause(){this.state=`paused`,this.updateTime(Vp.now()),this.holdTime=this.currentTime}complete(){this.state!==`running`&&this.play(),this.state=`finished`,this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state=`finished`,this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state=`idle`,this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&=(this.driver.stop(),void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type=`keyframes`,this.options.ease=`linear`,this.initAnimation()),this.driver?.stop(),e.observe(this)}};function kh(e){for(let t=1;t<e.length;t++)e[t]??(e[t]=e[t-1])}var Ah=e=>e*180/Math.PI,jh=e=>Nh(Ah(Math.atan2(e[1],e[0]))),Mh={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:e=>(Math.abs(e[0])+Math.abs(e[3]))/2,rotate:jh,rotateZ:jh,skewX:e=>Ah(Math.atan(e[1])),skewY:e=>Ah(Math.atan(e[2])),skew:e=>(Math.abs(e[1])+Math.abs(e[2]))/2},Nh=e=>(e%=360,e<0&&(e+=360),e),Ph=jh,Fh=e=>Math.sqrt(e[0]*e[0]+e[1]*e[1]),Ih=e=>Math.sqrt(e[4]*e[4]+e[5]*e[5]),Lh={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Fh,scaleY:Ih,scale:e=>(Fh(e)+Ih(e))/2,rotateX:e=>Nh(Ah(Math.atan2(e[6],e[5]))),rotateY:e=>Nh(Ah(Math.atan2(-e[2],e[0]))),rotateZ:Ph,rotate:Ph,skewX:e=>Ah(Math.atan(e[4])),skewY:e=>Ah(Math.atan(e[1])),skew:e=>(Math.abs(e[1])+Math.abs(e[4]))/2};function Rh(e){return+!!e.includes(`scale`)}function zh(e,t){if(!e||e===`none`)return Rh(t);let n=e.match(/^matrix3d\(([-\d.e\s,]+)\)$/u),r,i;if(n)r=Lh,i=n;else{let t=e.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=Mh,i=t}if(!i)return Rh(t);let a=r[t],o=i[1].split(`,`).map(Vh);return typeof a==`function`?a(o):o[a]}var Bh=(e,t)=>{let{transform:n=`none`}=getComputedStyle(e);return zh(n,t)};function Vh(e){return parseFloat(e.trim())}var Hh=[`transformPerspective`,`x`,`y`,`z`,`translateX`,`translateY`,`translateZ`,`scale`,`scaleX`,`scaleY`,`rotate`,`rotateX`,`rotateY`,`rotateZ`,`skew`,`skewX`,`skewY`],Uh=new Set([...Hh,`pathRotation`]),Wh=e=>e===Jp||e===q,Gh=new Set([`x`,`y`,`z`]),Kh=Hh.filter(e=>!Gh.has(e));function qh(e){let t=[];return Kh.forEach(n=>{let r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(+!!n.startsWith(`scale`)))}),t}var Jh={width:({x:e},{paddingLeft:t=`0`,paddingRight:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},height:({y:e},{paddingTop:t=`0`,paddingBottom:n=`0`,boxSizing:r})=>{let i=e.max-e.min;return r===`border-box`?i:i-parseFloat(t)-parseFloat(n)},top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:(e,{transform:t})=>zh(t,`x`),y:(e,{transform:t})=>zh(t,`y`)};Jh.translateX=Jh.x,Jh.translateY=Jh.y;var Yh=new Set,Xh=!1,Zh=!1,Qh=!1;function $h(){if(Zh){let e=Array.from(Yh).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),n=new Map;t.forEach(e=>{let t=qh(e);t.length&&(n.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=n.get(e);t&&t.forEach(([t,n])=>{e.getValue(t)?.set(n)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{e.suspendedScrollY!==void 0&&window.scrollTo(0,e.suspendedScrollY)})}Zh=!1,Xh=!1,Yh.forEach(e=>e.complete(Qh)),Yh.clear()}function eg(){Yh.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(Zh=!0)})}function tg(){Qh=!0,eg(),$h(),Qh=!1}var ng=class{constructor(e,t,n,r,i,a=!1){this.state=`pending`,this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=n,this.motionValue=r,this.element=i,this.isAsync=a}scheduleResolve(){this.state=`scheduled`,this.isAsync?(Yh.add(this),Xh||(Xh=!0,Fp.read(eg),Fp.resolveKeyframes($h))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:n,motionValue:r}=this;if(e[0]===null){let i=r?.get(),a=e[e.length-1];if(i!==void 0)e[0]=i;else if(n&&t){let r=n.readValue(t,a);r!=null&&(e[0]=r)}e[0]===void 0&&(e[0]=a),r&&i===void 0&&r.set(e[0])}kh(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state=`complete`,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),Yh.delete(this)}cancel(){this.state===`scheduled`&&(Yh.delete(this),this.state=`pending`)}resume(){this.state===`pending`&&this.scheduleResolve()}},rg=e=>e.startsWith(`--`);function ig(e,t,n){rg(t)?e.style.setProperty(t,n):e.style[t]=n}var ag={};function og(e,t){let n=tp(e);return()=>ag[t]??n()}var sg=og(()=>window.ScrollTimeline!==void 0,`scrollTimeline`),cg=og(()=>{try{document.createElement(`div`).animate({opacity:0},{easing:`linear(0, 1)`})}catch{return!1}return!0},`linearEasing`),lg=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,ug={linear:`linear`,ease:`ease`,easeIn:`ease-in`,easeOut:`ease-out`,easeInOut:`ease-in-out`,circIn:lg([0,.65,.55,1]),circOut:lg([.55,0,1,.45]),backIn:lg([.31,.01,.66,-.59]),backOut:lg([.33,1.53,.69,.99])};function dg(e,t){if(e)return typeof e==`function`?cg()?Zm(e,t):`ease-out`:Dp(e)?lg(e):Array.isArray(e)?e.map(e=>dg(e,t)||ug.easeOut):ug[e]}function fg(e,t,n,{delay:r=0,duration:i=300,repeat:a=0,repeatType:o=`loop`,ease:s=`easeOut`,times:c}={},l=void 0){let u={[t]:n};c&&(u.offset=c);let d=dg(s,i);Array.isArray(d)&&(u.easing=d);let f={delay:r,duration:i,easing:Array.isArray(d)?`linear`:d,fill:`both`,iterations:a+1,direction:o===`reverse`?`alternate`:`normal`};return l&&(f.pseudoElement=l),e.animate(u,f)}function pg(e){return typeof e==`function`&&`applyToOptions`in e}function mg({type:e,...t}){return pg(e)&&cg()?e.applyToOptions(t):(t.duration??=300,t.ease??=`easeOut`,t)}var hg=class extends Eh{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;let{element:t,name:n,keyframes:r,pseudoElement:i,allowFlatten:a=!1,finalKeyframe:o,onComplete:s}=e;this.isPseudoElement=!!i,this.allowFlatten=a,this.options=e,e.type;let c=mg(e);this.animation=fg(t,n,r,c,i),c.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){let e=Ch(r,this.options,o,this.speed);this.updateMotionValue&&this.updateMotionValue(e),ig(t,n,e),this.animation.cancel()}s?.(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state===`finished`&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;let{state:e}=this;e!==`idle`&&e!==`finished`&&(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){let e=this.options?.element;!this.isPseudoElement&&e?.isConnected&&this.animation.commitStyles?.()}get duration(){let e=this.animation.effect?.getComputedTiming?.().duration||0;return sp(Number(e))}get iterationDuration(){let{delay:e=0}=this.options||{};return this.duration+sp(e)}get time(){return sp(Number(this.animation.currentTime)||0)}set time(e){let t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=op(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime===null?this.animation.playState:`finished`}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:n,observe:r}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:`linear`}),this.animation.onfinish=null,e&&sg()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),n&&(this.animation.rangeEnd=n),np):r(this)}},gg={anticipate:yp,backInOut:vp,circInOut:Sp};function _g(e){return e in gg}function vg(e){typeof e.ease==`string`&&_g(e.ease)&&(e.ease=gg[e.ease])}var yg=10,bg=class extends hg{constructor(e){vg(e),Th(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){let{motionValue:t,onUpdate:n,onComplete:r,element:i,...a}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}let o=new Oh({...a,autoplay:!1}),s=Math.max(yg,Vp.now()-this.startTime),c=Xf(0,yg,s-yg),l=o.sample(s).value,{name:u}=this.options;i&&u&&ig(i,u,l),t.setWithVelocity(o.sample(Math.max(0,s-c)).value,l,c),o.stop()}},xg=(e,t)=>t!==`zIndex`&&!!(typeof e==`number`||Array.isArray(e)||typeof e==`string`&&(jm.test(e)||e===`0`)&&!e.startsWith(`url(`));function Sg(e){let t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function Cg(e,t,n,r){let i=e[0];if(i===null)return!1;if(t===`display`||t===`visibility`)return!0;let a=e[e.length-1],o=xg(i,t),s=xg(a,t);return`${t}${i}${a}${o?a:i}`,!o||!s?!1:Sg(e)||(n===`spring`||pg(n))&&r}function wg(e){e.duration=0,e.type=`keyframes`}var Tg=new Set([`opacity`,`clipPath`,`filter`,`transform`,`backgroundColor`]),Eg=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Dg(e){for(let t=0;t<e.length;t++)if(typeof e[t]==`string`&&Eg.test(e[t]))return!0;return!1}var Og=new Set([`color`,`backgroundColor`,`outlineColor`,`fill`,`stroke`,`borderColor`,`borderTopColor`,`borderRightColor`,`borderBottomColor`,`borderLeftColor`]),kg=tp(()=>Object.hasOwnProperty.call(Element.prototype,`animate`));function Ag(e){let{motionValue:t,name:n,repeatDelay:r,repeatType:i,damping:a,type:o,keyframes:s}=e,c=t?.owner?.current;if(!(c instanceof HTMLElement)&&!(c instanceof SVGElement))return!1;let{onUpdate:l,transformTemplate:u}=t.owner.getProps();return kg()&&n&&(Tg.has(n)||Og.has(n)&&Dg(s))&&(n!==`transform`||!u)&&!l&&!r&&i!==`mirror`&&a!==0&&o!==`inertia`}var jg=40,Mg=class extends Eh{constructor({autoplay:e=!0,delay:t=0,type:n=`keyframes`,repeat:r=0,repeatDelay:i=0,repeatType:a=`loop`,keyframes:o,name:s,motionValue:c,element:l,...u}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=Vp.now();let d={autoplay:e,delay:t,type:n,repeat:r,repeatDelay:i,repeatType:a,name:s,motionValue:c,element:l,...u},f=l?.KeyframeResolver||ng;this.keyframeResolver=new f(o,(e,t,n)=>this.onKeyframesResolved(e,t,d,!n),s,c,l),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,t,n,r){this.keyframeResolver=void 0;let{name:i,type:a,velocity:o,delay:s,isHandoff:c,onUpdate:l}=n;this.resolvedAt=Vp.now();let u=!0;Cg(e,i,a,o)||(u=!1,(Zf.instantAnimations||!s)&&l?.(Ch(e,n,t)),e[0]=e[e.length-1],wg(n),n.repeat=0);let d={startTime:r?this.resolvedAt&&this.resolvedAt-this.createdAt>jg?this.resolvedAt:this.createdAt:void 0,finalKeyframe:t,...n,keyframes:e},f=u&&!c&&Ag(d),p=d.motionValue?.owner?.current,m;if(f)try{m=new bg({...d,element:p})}catch{m=new Oh(d)}else m=new Oh(d);m.finished.then(()=>{this.notifyFinished()}).catch(np),this.pendingTimeline&&=(this.stopTimeline=m.attachTimeline(this.pendingTimeline),void 0),this._animation=m}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),tg()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}};function Ng(e,t,n,r=0,i=1){let a=Array.from(e).sort((e,t)=>e.sortNodePosition(t)).indexOf(t),o=e.size,s=(o-1)*r;return typeof n==`function`?n(a,o):i===1?a*r:s-a*r}var Pg=30,Fg=e=>!isNaN(parseFloat(e)),Ig={current:void 0},Lg=class{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=e=>{let t=Vp.now();if(this.updatedAt!==t&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(let e of this.dependents)e.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Vp.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Fg(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on(`change`,e)}on(e,t){this.events[e]||(this.events[e]=new ap);let n=this.events[e].add(t);return e===`change`?()=>{n(),Fp.read(()=>{this.events.change.getSize()||this.stop()})}:n}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,n){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-n}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||=new Set,this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Ig.current&&Ig.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=Vp.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Pg)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,Pg);return cp(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}};function Rg(e,t){return new Lg(e,t)}function zg(e,t){if(e?.inherit&&t){let{inherit:n,...r}=e;return{...t,...r}}return e}function Bg(e,t){let n=e?.[t]??e?.default??e;return n===e?n:zg(n,e)}var Vg={type:`spring`,stiffness:500,damping:25,restSpeed:10},Hg=e=>({type:`spring`,stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),Ug={type:`keyframes`,duration:.8},Wg={type:`keyframes`,ease:[.25,.1,.35,1],duration:.3},Gg=(e,{keyframes:t})=>t.length>2?Ug:Uh.has(e)?e.startsWith(`scale`)?Hg(t[1]):Vg:Wg,Kg=new Set([`when`,`delay`,`delayChildren`,`staggerChildren`,`staggerDirection`,`repeat`,`repeatType`,`repeatDelay`,`from`,`elapsed`]);function qg(e){for(let t in e)if(!Kg.has(t))return!0;return!1}var Jg=(e,t,n,r={},i,a)=>o=>{let s=Bg(r,e)||{},c=s.delay||r.delay||0,{elapsed:l=0}=r;l-=op(c);let u={keyframes:Array.isArray(n)?n:[null,n],ease:`easeOut`,velocity:t.getVelocity(),...s,delay:-l,onUpdate:e=>{t.set(e),s.onUpdate&&s.onUpdate(e)},onComplete:()=>{o(),s.onComplete&&s.onComplete()},name:e,motionValue:t,element:a?void 0:i};qg(s)||Object.assign(u,Gg(e,u)),u.duration&&=op(u.duration),u.repeatDelay&&=op(u.repeatDelay),u.from!==void 0&&(u.keyframes[0]=u.from);let d=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(wg(u),u.delay===0&&(d=!0)),(Zf.instantAnimations||Zf.skipAnimations||i?.shouldSkipAnimations||s.skipAnimations)&&(d=!0,wg(u),u.delay=0),u.allowFlatten=!s.type&&!s.ease,d&&!a&&t.get()!==void 0){let e=Ch(u.keyframes,s);if(e!==void 0){Fp.update(()=>{u.onUpdate(e),u.onComplete()});return}}return s.isSync?new Oh(u):new Mg(u)},Yg=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Xg(e){let t=Yg.exec(e);if(!t)return[,];let[,n,r,i]=t;return[`--${n??r}`,i]}function Zg(e,t,n=1){`${e}`;let[r,i]=Xg(e);if(!r)return;let a=window.getComputedStyle(t).getPropertyValue(r);if(a){let e=a.trim();return Qf(e)?parseFloat(e):e}return Gp(i)?Zg(i,t,n+1):i}function Qg(e){let t=[{},{}];return e?.values.forEach((e,n)=>{t[0][n]=e.get(),t[1][n]=e.getVelocity()}),t}function $g(e,t,n,r){if(typeof t==`function`){let[i,a]=Qg(r);t=t(n===void 0?e.custom:n,i,a)}if(typeof t==`string`&&(t=e.variants&&e.variants[t]),typeof t==`function`){let[i,a]=Qg(r);t=t(n===void 0?e.custom:n,i,a)}return t}function e_(e,t,n){let r=e.getProps();return $g(r,t,n===void 0?r.custom:n,e)}var t_=new Set([`width`,`height`,`top`,`left`,`right`,`bottom`,...Hh]),n_=e=>Array.isArray(e);function r_(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,Rg(n))}function i_(e){return n_(e)?e[e.length-1]||0:e}function a_(e,t){let{transitionEnd:n={},transition:r={},...i}=e_(e,t)||{};i={...i,...n};for(let t in i)r_(e,t,i_(i[t]))}var o_=e=>!!(e&&e.getVelocity);function s_(e){return!!(o_(e)&&e.add)}function c_(e,t){let n=e.getValue(`willChange`);if(s_(n))return n.add(t);if(!n&&Zf.WillChange){let n=new Zf.WillChange(`auto`);e.addValue(`willChange`,n),n.add(t)}}function l_(e){return e.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}var u_=`data-`+l_(`framerAppearId`);function d_(e){return e.props[u_]}function f_({protectedKeys:e,needsAnimating:t},n){let r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function p_(e,t,{delay:n=0,transitionOverride:r,type:i}={}){let{transition:a,transitionEnd:o,...s}=t,c=e.getDefaultTransition();a=a?zg(a,c):c;let l=a?.reduceMotion,u=a?.skipAnimations;r&&(a=r);let d=[],f=i&&e.animationState&&e.animationState.getState()[i],p=a?.path;p&&p.animateVisualElement(e,s,a,n,d);for(let t in s){let r=e.getValue(t,e.latestValues[t]??null),i=s[t];if(i===void 0||f&&f_(f,t))continue;let o={delay:n,...Bg(a||{},t)};u&&(o.skipAnimations=!0);let c=r.get();if(c!==void 0&&!r.isAnimating()&&!Array.isArray(i)&&i===c&&!o.velocity){Fp.update(()=>r.set(i));continue}let p=!1;if(window.MotionHandoffAnimation){let n=d_(e);if(n){let e=window.MotionHandoffAnimation(n,t,Fp);e!==null&&(o.startTime=e,p=!0)}}c_(e,t);let m=l??e.shouldReduceMotion;r.start(Jg(t,r,i,m&&t_.has(t)?{type:!1}:o,e,p));let h=r.animation;h&&d.push(h)}if(o){let t=()=>Fp.update(()=>{o&&a_(e,o)});d.length?Promise.all(d).then(t):t()}return d}function m_(e,t,n={}){let r=e_(e,t,n.type===`exit`?e.presenceContext?.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(i=n.transitionOverride);let a=r?()=>Promise.all(p_(e,r,n)):()=>Promise.resolve(),o=e.variantChildren&&e.variantChildren.size?(r=0)=>{let{delayChildren:a=0,staggerChildren:o,staggerDirection:s}=i;return h_(e,t,r,a,o,s,n)}:()=>Promise.resolve(),{when:s}=i;if(s){let[e,t]=s===`beforeChildren`?[a,o]:[o,a];return e().then(()=>t())}return Promise.all([a(),o(n.delay)])}function h_(e,t,n=0,r=0,i=0,a=1,o){let s=[];for(let c of e.variantChildren)c.notify(`AnimationStart`,t),s.push(m_(c,t,{...o,delay:n+(typeof r==`function`?0:r)+Ng(e.variantChildren,c,r,i,a)}).then(()=>c.notify(`AnimationComplete`,t)));return Promise.all(s)}function g_(e,t,n={}){e.notify(`AnimationStart`,t);let r;if(Array.isArray(t)){let i=t.map(t=>m_(e,t,n));r=Promise.all(i)}else if(typeof t==`string`)r=m_(e,t,n);else{let i=typeof t==`function`?e_(e,t,n.custom):t;r=Promise.all(p_(e,i,n))}return r.then(()=>{e.notify(`AnimationComplete`,t)})}var __={test:e=>e===`auto`,parse:e=>e},v_=e=>t=>t.test(e),y_=[Jp,q,um,lm,fm,dm,__],b_=e=>y_.find(v_(e));function x_(e){return typeof e==`number`?e===0:e===null||e===`none`||e===`0`||ep(e)}var S_=new Set([`brightness`,`contrast`,`saturate`,`opacity`]);function C_(e){let[t,n]=e.slice(0,-1).split(`(`);if(t===`drop-shadow`)return e;let[r]=n.match(Qp)||[];if(!r)return e;let i=n.replace(r,``),a=+!!S_.has(t);return r!==n&&(a*=100),t+`(`+a+i+`)`}var w_=/\b([a-z-]*)\(.*?\)/gu,T_={...jm,getAnimatableNone:e=>{let t=e.match(w_);return t?t.map(C_).join(` `):e}},E_={...jm,getAnimatableNone:e=>{let t=jm.parse(e);return jm.createTransformer(e)(t.map(e=>typeof e==`number`?0:typeof e==`object`?{...e,alpha:1}:e))}},D_={...Jp,transform:Math.round},O_={borderWidth:q,borderTopWidth:q,borderRightWidth:q,borderBottomWidth:q,borderLeftWidth:q,borderRadius:q,borderTopLeftRadius:q,borderTopRightRadius:q,borderBottomRightRadius:q,borderBottomLeftRadius:q,width:q,maxWidth:q,height:q,maxHeight:q,top:q,right:q,bottom:q,left:q,inset:q,insetBlock:q,insetBlockStart:q,insetBlockEnd:q,insetInline:q,insetInlineStart:q,insetInlineEnd:q,padding:q,paddingTop:q,paddingRight:q,paddingBottom:q,paddingLeft:q,paddingBlock:q,paddingBlockStart:q,paddingBlockEnd:q,paddingInline:q,paddingInlineStart:q,paddingInlineEnd:q,margin:q,marginTop:q,marginRight:q,marginBottom:q,marginLeft:q,marginBlock:q,marginBlockStart:q,marginBlockEnd:q,marginInline:q,marginInlineStart:q,marginInlineEnd:q,fontSize:q,backgroundPositionX:q,backgroundPositionY:q,rotate:lm,pathRotation:lm,rotateX:lm,rotateY:lm,rotateZ:lm,scale:Xp,scaleX:Xp,scaleY:Xp,scaleZ:Xp,skew:lm,skewX:lm,skewY:lm,distance:q,translateX:q,translateY:q,translateZ:q,x:q,y:q,z:q,perspective:q,transformPerspective:q,opacity:Yp,originX:pm,originY:pm,originZ:q,zIndex:D_,fillOpacity:Yp,strokeOpacity:Yp,numOctaves:D_},k_={...O_,color:hm,backgroundColor:hm,outlineColor:hm,fill:hm,stroke:hm,borderColor:hm,borderTopColor:hm,borderRightColor:hm,borderBottomColor:hm,borderLeftColor:hm,filter:T_,WebkitFilter:T_,mask:E_,WebkitMask:E_},A_=e=>k_[e],j_=new Set([T_,E_]);function M_(e,t){let n=A_(e);return j_.has(n)||(n=jm),n.getAnimatableNone?n.getAnimatableNone(t):void 0}var N_=new Set([`auto`,`none`,`0`]);function P_(e,t,n){let r=0,i;for(;r<e.length&&!i;){let t=e[r];typeof t==`string`&&!N_.has(t)&&wm(t).values.length&&(i=e[r]),r++}if(i&&n)for(let r of t)e[r]=M_(n,i)}var F_=class extends ng{constructor(e,t,n,r,i){super(e,t,n,r,i,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:n}=this;if(!t||!t.current)return;super.readKeyframes();for(let n=0;n<e.length;n++){let r=e[n];if(typeof r==`string`&&(r=r.trim(),Gp(r))){let i=Zg(r,t.current);i!==void 0&&(e[n]=i),n===e.length-1&&(this.finalKeyframe=r)}}if(this.resolveNoneKeyframes(),!t_.has(n)||e.length!==2)return;let[r,i]=e,a=b_(r),o=b_(i);if(qp(r)!==qp(i)&&Jh[n]){this.needsMeasurement=!0;return}if(a!==o){if(Wh(a)&&Wh(o))for(let t=0;t<e.length;t++){let n=e[t];typeof n==`string`&&(e[t]=parseFloat(n))}else Jh[n]&&(this.needsMeasurement=!0)}}resolveNoneKeyframes(){let{unresolvedKeyframes:e,name:t}=this,n=[];for(let t=0;t<e.length;t++)(e[t]===null||x_(e[t]))&&n.push(t);n.length&&P_(e,n,t)}measureInitialState(){let{element:e,unresolvedKeyframes:t,name:n}=this;if(!e||!e.current)return;n===`height`&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Jh[n](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;let r=t[t.length-1];r!==void 0&&e.getValue(n,r).jump(r,!1)}measureEndState(){let{element:e,name:t,unresolvedKeyframes:n}=this;if(!e||!e.current)return;let r=e.getValue(t);r&&r.jump(this.measuredOrigin,!1);let i=n.length-1,a=n[i];n[i]=Jh[t](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),this.removedTransforms?.length&&this.removedTransforms.forEach(([t,n])=>{e.getValue(t).set(n)}),this.resolveNoneKeyframes()}},I_=[`borderTopLeftRadius`,`borderTopRightRadius`,`borderBottomRightRadius`,`borderBottomLeftRadius`];function L_(e,t,n){if(e==null)return[];if(e instanceof EventTarget)return[e];if(typeof e==`string`){let r=document;t&&(r=t.current);let i=n?.[e]??r.querySelectorAll(e);return i?Array.from(i):[]}return Array.from(e).filter(e=>e!=null)}var R_=(e,t)=>t&&typeof e==`number`?t.transform(e):e;function z_(e){return $f(e)&&`offsetHeight`in e&&!(`ownerSVGElement`in e)}var{schedule:B_,cancel:V_}=Pp(queueMicrotask,!1),H_={x:!1,y:!1};function U_(){return H_.x||H_.y}function W_(e){return e===`x`||e===`y`?H_[e]?null:(H_[e]=!0,()=>{H_[e]=!1}):H_.x||H_.y?null:(H_.x=H_.y=!0,()=>{H_.x=H_.y=!1})}function G_(e,t){let n=L_(e),r=new AbortController;return[n,{passive:!0,...t,signal:r.signal},()=>r.abort()]}function K_(e){return!(e.pointerType===`touch`||U_())}function q_(e,t,n={}){let[r,i,a]=G_(e,n);return r.forEach(e=>{let n=!1,r=!1,a,o=()=>{e.removeEventListener(`pointerleave`,u)},s=e=>{a&&=(a(e),void 0),o()},c=e=>{n=!1,window.removeEventListener(`pointerup`,c),window.removeEventListener(`pointercancel`,c),r&&(r=!1,s(e))},l=()=>{n=!0,window.addEventListener(`pointerup`,c,i),window.addEventListener(`pointercancel`,c,i)},u=e=>{if(e.pointerType!==`touch`){if(n){r=!0;return}s(e)}};e.addEventListener(`pointerenter`,n=>{if(!K_(n))return;r=!1;let o=t(e,n);typeof o==`function`&&(a=o,e.addEventListener(`pointerleave`,u,i))},i),e.addEventListener(`pointerdown`,l,i)}),a}var J_=(e,t)=>t?e===t||J_(e,t.parentElement):!1,Y_=e=>e.pointerType===`mouse`?typeof e.button!=`number`||e.button<=0:e.isPrimary!==!1,X_=new Set([`BUTTON`,`INPUT`,`SELECT`,`TEXTAREA`,`A`]);function Z_(e){return X_.has(e.tagName)||e.isContentEditable===!0}var Q_=new Set([`INPUT`,`SELECT`,`TEXTAREA`]);function $_(e){return Q_.has(e.tagName)||e.isContentEditable===!0}var ev=new WeakSet;function tv(e){return t=>{t.key===`Enter`&&e(t)}}function nv(e,t){e.dispatchEvent(new PointerEvent(`pointer`+t,{isPrimary:!0,bubbles:!0}))}var rv=(e,t)=>{let n=e.currentTarget;if(!n)return;let r=tv(()=>{if(ev.has(n))return;nv(n,`down`);let e=tv(()=>{nv(n,`up`)});n.addEventListener(`keyup`,e,t),n.addEventListener(`blur`,()=>nv(n,`cancel`),t)});n.addEventListener(`keydown`,r,t),n.addEventListener(`blur`,()=>n.removeEventListener(`keydown`,r),t)};function iv(e){return Y_(e)&&!U_()}var av=new WeakSet;function ov(e,t,n={}){let[r,i,a]=G_(e,n),o=e=>{let r=e.currentTarget;if(!iv(e)||av.has(e))return;ev.add(r),n.stopPropagation&&av.add(e);let a=t(r,e),o={...i,capture:!0},s=(e,t)=>{window.removeEventListener(`pointerup`,c,o),window.removeEventListener(`pointercancel`,l,o),ev.has(r)&&ev.delete(r),iv(e)&&typeof a==`function`&&a(e,{success:t})},c=e=>{s(e,r===window||r===document||n.useGlobalTarget||J_(r,e.target))},l=e=>{s(e,!1)};window.addEventListener(`pointerup`,c,o),window.addEventListener(`pointercancel`,l,o)};return r.forEach(e=>{(n.useGlobalTarget?window:e).addEventListener(`pointerdown`,o,i),z_(e)&&(e.addEventListener(`focus`,e=>rv(e,i)),!Z_(e)&&!e.hasAttribute(`tabindex`)&&(e.tabIndex=0))}),a}function sv(e){return $f(e)&&`ownerSVGElement`in e}var cv=new WeakMap,lv,uv=(e,t,n)=>(r,i)=>i&&i[0]?i[0][e+`Size`]:sv(r)&&`getBBox`in r?r.getBBox()[t]:r[n],dv=uv(`inline`,`width`,`offsetWidth`),fv=uv(`block`,`height`,`offsetHeight`);function pv({target:e,borderBoxSize:t}){cv.get(e)?.forEach(n=>{n(e,{get width(){return dv(e,t)},get height(){return fv(e,t)}})})}function mv(e){e.forEach(pv)}function hv(){typeof ResizeObserver>`u`||(lv=new ResizeObserver(mv))}function gv(e,t){lv||hv();let n=L_(e);return n.forEach(e=>{let n=cv.get(e);n||(n=new Set,cv.set(e,n)),n.add(t),lv?.observe(e)}),()=>{n.forEach(e=>{let n=cv.get(e);n?.delete(t),n?.size||lv?.unobserve(e)})}}var _v=new Set,vv;function yv(){vv=()=>{let e={get width(){return window.innerWidth},get height(){return window.innerHeight}};_v.forEach(t=>t(e))},window.addEventListener(`resize`,vv)}function bv(e){return _v.add(e),vv||yv(),()=>{_v.delete(e),!_v.size&&typeof vv==`function`&&(window.removeEventListener(`resize`,vv),vv=void 0)}}function xv(e,t){return typeof e==`function`?bv(e):gv(e,t)}var Sv={value:null,addProjectionMetrics:null};function Cv(e){return sv(e)&&e.tagName===`svg`}var wv=[...y_,hm,jm],Tv=e=>wv.find(v_(e)),Ev=()=>({translate:0,scale:1,origin:0,originPoint:0}),Dv=()=>({x:Ev(),y:Ev()}),Ov=()=>({min:0,max:0}),kv=()=>({x:Ov(),y:Ov()}),Av=new WeakMap;function jv(e){return typeof e==`object`&&!!e&&typeof e.start==`function`}function Mv(e){return typeof e==`string`||Array.isArray(e)}var Nv=[`animate`,`whileInView`,`whileFocus`,`whileHover`,`whileTap`,`whileDrag`,`exit`],Pv=[`initial`,...Nv];function Fv(e){return jv(e.animate)||Pv.some(t=>Mv(e[t]))}function Iv(e){return!!(Fv(e)||e.variants)}function Lv(e,t,n){for(let r in t){let i=t[r],a=n[r];if(o_(i))e.addValue(r,i);else if(o_(a))e.addValue(r,Rg(i,{owner:e}));else if(a!==i){if(e.hasValue(r)){let t=e.getValue(r);t.liveStyle===!0?t.jump(i):t.hasAnimated||t.set(i)}else{let t=e.getStaticValue(r);e.addValue(r,Rg(t===void 0?i:t,{owner:e}))}}}for(let r in n)t[r]===void 0&&e.removeValue(r);return t}var Rv={current:null},zv={current:!1},Bv=typeof window<`u`;function Vv(){if(zv.current=!0,Bv){if(window.matchMedia){let e=window.matchMedia(`(prefers-reduced-motion)`),t=()=>Rv.current=e.matches;e.addEventListener(`change`,t),t()}else Rv.current=!1}}var Hv=[`AnimationStart`,`AnimationComplete`,`Update`,`BeforeLayoutMeasure`,`LayoutMeasure`,`LayoutAnimationStart`,`LayoutAnimationComplete`],Uv={};function Wv(e){Uv=e}function Gv(){return Uv}var Kv=class{scrapeMotionValuesFromProps(e,t,n){return{}}constructor({parent:e,props:t,presenceContext:n,reducedMotionConfig:r,skipAnimations:i,blockInitialAnimation:a,visualState:o},s={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=ng,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify(`Update`,this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{let e=Vp.now();this.renderScheduledAt<e&&(this.renderScheduledAt=e,Fp.render(this.render,!1,!0))};let{latestValues:c,renderState:l}=o;this.latestValues=c,this.baseTarget={...c},this.initialValues=t.initial?{...c}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=n,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.skipAnimationsConfig=i,this.options=s,this.blockInitialAnimation=!!a,this.isControllingVariants=Fv(t),this.isVariantNode=Iv(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...d}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in d){let t=d[e];c[e]!==void 0&&o_(t)&&t.set(c[e])}}mount(e){if(this.hasBeenMounted)for(let e in this.initialValues)this.values.get(e)?.jump(this.initialValues[e]),this.latestValues[e]=this.initialValues[e];this.current=e,Av.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),this.reducedMotionConfig===`never`?this.shouldReduceMotion=!1:this.reducedMotionConfig===`always`?this.shouldReduceMotion=!0:(zv.current||Vv(),this.shouldReduceMotion=Rv.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,this.parent?.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){this.projection&&this.projection.unmount(),Ip(this.notifyUpdate),Ip(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(let e in this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??=new Set,this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&Tg.has(e)&&this.current instanceof HTMLElement){let{factory:n,keyframes:r,times:i,ease:a,duration:o}=t.accelerate,s=new hg({element:this.current,name:e,keyframes:r,times:i,ease:a,duration:op(o)}),c=n(s);this.valueSubscriptions.set(e,()=>{c(),s.cancel()});return}let n=Uh.has(e);n&&this.onBindTransform&&this.onBindTransform();let r=t.on(`change`,t=>{this.latestValues[e]=t,this.props.onUpdate&&Fp.preRender(this.notifyUpdate),n&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()}),i;typeof window<`u`&&window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),i&&i()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e=`animation`;for(e in Uv){let t=Uv[e];if(!t)continue;let{isEnabled:n,Feature:r}=t;if(!this.features[e]&&r&&n(this.props)&&(this.features[e]=new r(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):kv()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;t<Hv.length;t++){let n=Hv[t];this.propEventSubscriptions[n]&&(this.propEventSubscriptions[n](),delete this.propEventSubscriptions[n]);let r=e[`on`+n];r&&(this.propEventSubscriptions[n]=this.on(n,r))}this.prevMotionValues=Lv(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){let t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){let n=this.values.get(e);t!==n&&(n&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let n=this.values.get(e);return n===void 0&&t!==void 0&&(n=Rg(t===null?void 0:t,{owner:this}),this.addValue(e,n)),n}readValue(e,t){let n=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return n!=null&&(typeof n==`string`&&(Qf(n)||ep(n))?n=parseFloat(n):!Tv(n)&&jm.test(t)&&(n=M_(e,t)),this.setBaseTarget(e,o_(n)?n.get():n)),o_(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){let{initial:t}=this.props,n;if(typeof t==`string`||typeof t==`object`){let r=$g(this.props,t,this.presenceContext?.custom);r&&(n=r[e])}if(t&&n!==void 0)return n;let r=this.getBaseTargetFromProps(this.props,e);return r!==void 0&&!o_(r)?r:this.initialValues[e]!==void 0&&n===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ap),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){B_.render(this.render)}},qv=class extends Kv{constructor(){super(...arguments),this.KeyframeResolver=F_}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){let n=e.style;return n?n[t]:void 0}removeValueFromRenderState(e,{vars:t,style:n}){delete t[e],delete n[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;o_(e)&&(this.childSubscription=e.on(`change`,e=>{this.current&&(this.current.textContent=`${e}`)}))}},Jv=class{constructor(e){this.isMounted=!1,this.node=e}update(){}};function Yv({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function Xv({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function Zv(e,t){if(!t)return e;let n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Qv(e){return e===void 0||e===1}function $v({scale:e,scaleX:t,scaleY:n}){return!Qv(e)||!Qv(t)||!Qv(n)}function ey(e){return $v(e)||ty(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function ty(e){return ny(e.x)||ny(e.y)}function ny(e){return e&&e!==`0%`}function ry(e,t,n){return n+t*(e-n)}function iy(e,t,n,r,i){return i!==void 0&&(e=ry(e,i,r)),ry(e,n,r)+t}function ay(e,t=0,n=1,r,i){e.min=iy(e.min,t,n,r,i),e.max=iy(e.max,t,n,r,i)}function oy(e,{x:t,y:n}){ay(e.x,t.translate,t.scale,t.originPoint),ay(e.y,n.translate,n.scale,n.originPoint)}var sy=.999999999999,cy=1.0000000000001;function ly(e,t,n,r=!1){let i=n.length;if(!i)return;t.x=t.y=1;let a,o;for(let s=0;s<i;s++){a=n[s],o=a.projectionDelta;let{visualElement:i}=a.options;i&&i.props.style&&i.props.style.display===`contents`||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(uy(e.x,-a.scroll.offset.x),uy(e.y,-a.scroll.offset.y)),o&&(t.x*=o.x.scale,t.y*=o.y.scale,oy(e,o)),r&&ey(a.latestValues)&&py(e,a.latestValues,a.layout?.layoutBox))}t.x<cy&&t.x>sy&&(t.x=1),t.y<cy&&t.y>sy&&(t.y=1)}function uy(e,t){e.min+=t,e.max+=t}function dy(e,t,n,r,i=.5){ay(e,t,n,Fm(e.min,e.max,i),r)}function fy(e,t){return typeof e==`string`?parseFloat(e)/100*(t.max-t.min):e}function py(e,t,n){let r=n??e;dy(e.x,fy(t.x,r.x),t.scaleX,t.scale,t.originX),dy(e.y,fy(t.y,r.y),t.scaleY,t.scale,t.originY)}function my(e,t){return Yv(Zv(e.getBoundingClientRect(),t))}function hy(e,t,n){let r=my(e,n),{scroll:i}=t;return i&&(uy(r.x,i.offset.x),uy(r.y,i.offset.y)),r}var gy={x:`translateX`,y:`translateY`,z:`translateZ`,transformPerspective:`perspective`},_y=Hh.length;function vy(e,t,n){let r=``,i=!0;for(let a=0;a<_y;a++){let o=Hh[a],s=e[o];if(s===void 0)continue;let c=!0;if(typeof s==`number`)c=s===+!!o.startsWith(`scale`);else{let e=parseFloat(s);c=o.startsWith(`scale`)?e===1:e===0}if(!c||n){let e=R_(s,O_[o]);if(!c){i=!1;let t=gy[o]||o;r+=`${t}(${e}) `}n&&(t[o]=e)}}let a=e.pathRotation;return a&&(i=!1,r+=`rotate(${R_(a,O_.pathRotation)}) `),r=r.trim(),n?r=n(t,i?``:r):i&&(r=`none`),r}function yy(e,t,n){let{style:r,vars:i,transformOrigin:a}=e,o=!1,s=!1;for(let e in t){let n=t[e];if(Uh.has(e)){o=!0;continue}if(Up(e)){i[e]=n;continue}{let t=R_(n,O_[e]);e.startsWith(`origin`)?(s=!0,a[e]=t):r[e]=t}}if(t.transform||(o||n?r.transform=vy(t,e.transform,n):r.transform&&=`none`),s){let{originX:e=`50%`,originY:t=`50%`,originZ:n=0}=a;r.transformOrigin=`${e} ${t} ${n}`}}function by(e,{style:t,vars:n},r,i){let a=e.style,o;for(o in t)a[o]=t[o];for(o in i?.applyProjectionStyles(a,r),n)a.setProperty(o,n[o])}function xy(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}var Sy={correct:(e,t)=>{if(!t.target)return e;if(typeof e==`string`){if(q.test(e))e=parseFloat(e);else return e}return`${xy(e,t.target.x)}% ${xy(e,t.target.y)}%`}},Cy={correct:(e,{treeScale:t,projectionDelta:n})=>{let r=e,i=jm.parse(e);if(i.length>5)return r;let a=jm.createTransformer(e),o=typeof i[0]==`number`?0:1,s=n.x.scale*t.x,c=n.y.scale*t.y;i[0+o]/=s,i[1+o]/=c;let l=Fm(s,c,.5);return typeof i[2+o]==`number`&&(i[2+o]/=l),typeof i[3+o]==`number`&&(i[3+o]/=l),a(i)}},wy={borderRadius:{...Sy,applyTo:[...I_]},borderTopLeftRadius:Sy,borderTopRightRadius:Sy,borderBottomLeftRadius:Sy,borderBottomRightRadius:Sy,boxShadow:Cy};function Ty(e,{layout:t,layoutId:n}){return Uh.has(e)||e.startsWith(`origin`)||(t||n!==void 0)&&(!!wy[e]||e===`opacity`)}function Ey(e,t,n){let r=e.style,i=t?.style,a={};if(!r)return a;for(let t in r)(o_(r[t])||i&&o_(i[t])||Ty(t,e)||n?.getValue(t)?.liveStyle!==void 0)&&(a[t]=r[t]);return a}function Dy(e){return window.getComputedStyle(e)}var Oy=class extends qv{constructor(){super(...arguments),this.type=`html`,this.renderInstance=by}mount(e){e.style,super.mount(e)}readValueFromInstance(e,t){if(Uh.has(t))return this.projection?.isProjecting?Rh(t):Bh(e,t);{let n=Dy(e),r=(Up(t)?n.getPropertyValue(t):n[t])||0;return typeof r==`string`?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return my(e,t)}build(e,t,n){yy(e,t,n.transformTemplate)}scrapeMotionValuesFromProps(e,t,n){return Ey(e,t,n)}},ky={offset:`stroke-dashoffset`,array:`stroke-dasharray`},Ay={offset:`strokeDashoffset`,array:`strokeDasharray`};function jy(e,t,n=1,r=0,i=!0){e.pathLength=1;let a=i?ky:Ay;e[a.offset]=`${-r}`,e[a.array]=`${t} ${n}`}var My=[`transform`,`opacity`,`offsetDistance`,`offsetPath`,`offsetRotate`,`offsetAnchor`];function Ny(e,{attrX:t,attrY:n,attrScale:r,pathLength:i,pathSpacing:a=1,pathOffset:o=0,...s},c,l,u){if(yy(e,s,l),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:d,style:f}=e;for(let e of My)d[e]!==void 0&&(f[e]=d[e],delete d[e]);(f.transform||d.transformOrigin)&&(f.transformOrigin=d.transformOrigin??`50% 50%`,delete d.transformOrigin),f.transform&&(f.transformBox=u?.transformBox??`fill-box`,delete d.transformBox),t!==void 0&&(d.x=t),n!==void 0&&(d.y=n),r!==void 0&&(d.scale=r),i!==void 0&&jy(d,i,a,o,!1)}var Py=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`]),Fy=e=>typeof e==`string`&&e.toLowerCase()===`svg`;function Iy(e,t,n,r){by(e,t,void 0,r);for(let n in t.attrs)e.setAttribute(Py.has(n)?n:l_(n),t.attrs[n])}function Ly(e,t,n){let r=Ey(e,t,n);for(let n in e)if(o_(e[n])||o_(t[n])){let t=Hh.indexOf(n)===-1?n:`attr`+n.charAt(0).toUpperCase()+n.substring(1);r[t]=e[n]}return r}var Ry=class extends qv{constructor(){super(...arguments),this.type=`svg`,this.isSVGTag=!1,this.measureInstanceViewportBox=kv}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Uh.has(t)){let e=A_(t);return e&&e.default||0}if(My.includes(t)){let n=getComputedStyle(e)[t];if(typeof n==`string`&&n)return n.trim()}return t=Py.has(t)?t:l_(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,n){return Ly(e,t,n)}build(e,t,n){Ny(e,t,this.isSVGTag,n.transformTemplate,n.style)}renderInstance(e,t,n,r){Iy(e,t,n,r)}mount(e){this.isSVGTag=Fy(e.tagName),super.mount(e)}},zy=Pv.length;function By(e){if(!e)return;if(!e.isControllingVariants){let t=e.parent&&By(e.parent)||{};return e.props.initial!==void 0&&(t.initial=e.props.initial),t}let t={};for(let n=0;n<zy;n++){let r=Pv[n],i=e.props[r];(Mv(i)||i===!1)&&(t[r]=i)}return t}function Vy(e,t){if(!Array.isArray(t))return!1;let n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}var Hy=[...Nv].reverse(),Uy=Nv.length;function Wy(e){return t=>Promise.all(t.map(({animation:t,options:n})=>g_(e,t,n)))}function Gy(e){let t=Wy(e),n=Jy(),r=!0,i=!1,a=t=>(n,r)=>{let i=e_(e,r,t===`exit`?e.presenceContext?.custom:void 0);if(i){let{transition:e,transitionEnd:t,...r}=i;n={...n,...r,...t}}return n};function o(n){t=n(e)}function s(o){let{props:s}=e,c=By(e.parent)||{},l=[],u=new Set,d={},f=1/0;for(let t=0;t<Uy;t++){let p=Hy[t],m=n[p],h=s[p]===void 0?c[p]:s[p],g=Mv(h),_=p===o?m.isActive:null;_===!1&&(f=t);let v=h===c[p]&&h!==s[p]&&g;if(v&&(r||i)&&e.manuallyAnimateOnMount&&(v=!1),m.protectedKeys={...d},!m.isActive&&_===null||!h&&!m.prevProp||jv(h)||typeof h==`boolean`)continue;if(p===`exit`&&m.isActive&&_!==!0){m.prevResolvedValues&&(d={...d,...m.prevResolvedValues});continue}let y=Ky(m.prevProp,h),b=y||p===o&&m.isActive&&!v&&g||t>f&&g,x=!1,S=Array.isArray(h)?h:[h],C=S.reduce(a(p),{});_===!1&&(C={});let{prevResolvedValues:w={}}=m,T={...w,...C},E=t=>{b=!0,u.has(t)&&(x=!0,u.delete(t)),m.needsAnimating[t]=!0;let n=e.getValue(t);n&&(n.liveStyle=!1)};for(let e in T){let t=C[e],n=w[e];if(d.hasOwnProperty(e))continue;let r=!1;r=n_(t)&&n_(n)?!Vy(t,n)||y:t!==n,r?t==null?u.add(e):E(e):t!==void 0&&u.has(e)?E(e):m.protectedKeys[e]=!0}m.prevProp=h,m.prevResolvedValues=C,m.isActive&&(d={...d,...C}),(r||i)&&e.blockInitialAnimation&&(b=!1);let D=v&&y;b&&(!D||x)&&l.push(...S.map(t=>{let n={type:p};if(typeof t==`string`&&(r||i)&&!D&&e.manuallyAnimateOnMount&&e.parent){let{parent:r}=e,i=e_(r,t);if(r.enteringChildren&&i){let{delayChildren:t}=i.transition||{};n.delay=Ng(r.enteringChildren,e,t)}}return{animation:t,options:n}}))}if(u.size){let t={};if(typeof s.initial!=`boolean`){let n=e_(e,Array.isArray(s.initial)?s.initial[0]:s.initial);n&&n.transition&&(t.transition=n.transition)}u.forEach(n=>{let r=e.getBaseTarget(n),i=e.getValue(n);i&&(i.liveStyle=!0),t[n]=r??null}),l.push({animation:t})}let p=!!l.length;return r&&(s.initial===!1||s.initial===s.animate)&&!e.manuallyAnimateOnMount&&(p=!1),r=!1,i=!1,p?t(l):Promise.resolve()}function c(t,r){if(n[t].isActive===r)return Promise.resolve();e.variantChildren?.forEach(e=>e.animationState?.setActive(t,r)),n[t].isActive=r;let i=s(t);for(let e in n)n[e].protectedKeys={};return i}return{animateChanges:s,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Jy(),i=!0}}}function Ky(e,t){return typeof t==`string`?t!==e:Array.isArray(t)?!Vy(t,e):!1}function qy(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Jy(){return{animate:qy(!0),whileInView:qy(),whileHover:qy(),whileTap:qy(),whileDrag:qy(),whileFocus:qy(),exit:qy()}}function Yy(e,t){e.min=t.min,e.max=t.max}function Xy(e,t){Yy(e.x,t.x),Yy(e.y,t.y)}function Zy(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}var Qy=.9999,$y=1.0001,eb=-.01,tb=.01;function nb(e){return e.max-e.min}function rb(e,t,n){return Math.abs(e-t)<=n}function ib(e,t,n,r=.5){e.origin=r,e.originPoint=Fm(t.min,t.max,e.origin),e.scale=nb(n)/nb(t),e.translate=Fm(n.min,n.max,e.origin)-e.originPoint,(e.scale>=Qy&&e.scale<=$y||isNaN(e.scale))&&(e.scale=1),(e.translate>=eb&&e.translate<=tb||isNaN(e.translate))&&(e.translate=0)}function ab(e,t,n,r){ib(e.x,t.x,n.x,r?r.originX:void 0),ib(e.y,t.y,n.y,r?r.originY:void 0)}function ob(e,t,n,r=0){e.min=(r?Fm(n.min,n.max,r):n.min)+t.min,e.max=e.min+nb(t)}function sb(e,t,n,r){ob(e.x,t.x,n.x,r?.x),ob(e.y,t.y,n.y,r?.y)}function cb(e,t,n,r=0){let i=r?Fm(n.min,n.max,r):n.min;e.min=t.min-i,e.max=e.min+nb(t)}function lb(e,t,n,r){cb(e.x,t.x,n.x,r?.x),cb(e.y,t.y,n.y,r?.y)}function ub(e,t,n,r,i){return e-=t,e=ry(e,1/n,r),i!==void 0&&(e=ry(e,1/i,r)),e}function db(e,t=0,n=1,r=.5,i,a=e,o=e){if(um.test(t)&&(t=parseFloat(t),t=Fm(o.min,o.max,t/100)-o.min),typeof t!=`number`)return;let s=Fm(a.min,a.max,r);e===a&&(s-=t),e.min=ub(e.min,t,n,s,i),e.max=ub(e.max,t,n,s,i)}function fb(e,t,[n,r,i],a,o){db(e,t[n],t[r],t[i],t.scale,a,o)}var pb=[`x`,`scaleX`,`originX`],mb=[`y`,`scaleY`,`originY`];function hb(e,t,n,r){fb(e.x,t,pb,n?n.x:void 0,r?r.x:void 0),fb(e.y,t,mb,n?n.y:void 0,r?r.y:void 0)}function gb(e){return e.translate===0&&e.scale===1}function _b(e){return gb(e.x)&&gb(e.y)}function vb(e,t){return e.min===t.min&&e.max===t.max}function yb(e,t){return vb(e.x,t.x)&&vb(e.y,t.y)}function bb(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function xb(e,t){return bb(e.x,t.x)&&bb(e.y,t.y)}function Sb(e){return nb(e.x)/nb(e.y)}function Cb(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}function wb(e){return[e(`x`),e(`y`)]}function Tb(e,t,n){let r=``,i=e.x.translate/t.x,a=e.y.translate/t.y,o=n?.z||0;if((i||a||o)&&(r=`translate3d(${i}px, ${a}px, ${o}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){let{transformPerspective:e,rotate:t,pathRotation:i,rotateX:a,rotateY:o,skewX:s,skewY:c}=n;e&&(r=`perspective(${e}px) ${r}`),t&&(r+=`rotate(${t}deg) `),i&&(r+=`rotate(${i}deg) `),a&&(r+=`rotateX(${a}deg) `),o&&(r+=`rotateY(${o}deg) `),s&&(r+=`skewX(${s}deg) `),c&&(r+=`skewY(${c}deg) `)}let s=e.x.scale*t.x,c=e.y.scale*t.y;return(s!==1||c!==1)&&(r+=`scale(${s}, ${c})`),r||`none`}var Eb=I_.length,Db=e=>typeof e==`string`?parseFloat(e):e,Ob=e=>typeof e==`number`||q.test(e);function kb(e,t,n,r,i,a){i?(e.opacity=Fm(0,n.opacity??1,jb(r)),e.opacityExit=Fm(t.opacity??1,0,Mb(r))):a&&(e.opacity=Fm(t.opacity??1,n.opacity??1,r));for(let i=0;i<Eb;i++){let a=I_[i],o=Ab(t,a),s=Ab(n,a);(o!==void 0||s!==void 0)&&(o||=0,s||=0,o===0||s===0||Ob(o)===Ob(s)?(e[a]=Math.max(Fm(Db(o),Db(s),r),0),(um.test(s)||um.test(o))&&(e[a]+=`%`)):e[a]=s)}(t.rotate||n.rotate)&&(e.rotate=Fm(t.rotate||0,n.rotate||0,r))}function Ab(e,t){return e[t]===void 0?e.borderRadius:e[t]}var jb=Nb(0,.5,xp),Mb=Nb(.5,.95,np);function Nb(e,t,n){return r=>r<e?0:r>t?1:n(ip(e,t,r))}function Pb(e,t,n){let r=o_(e)?e:Rg(e);return r.start(Jg(``,r,t,n)),r.animation}function Fb(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}var Ib=(e,t)=>e.depth-t.depth,Lb=class{constructor(){this.children=[],this.isDirty=!1}add(e){Jf(this.children,e),this.isDirty=!0}remove(e){Yf(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Ib),this.isDirty=!1,this.children.forEach(e)}};function Rb(e,t){let n=Vp.now(),r=({timestamp:i})=>{let a=i-n;a>=t&&(Ip(r),e(a-t))};return Fp.setup(r,!0),()=>Ip(r)}function zb(e){return o_(e)?e.get():e}var Bb=class{constructor(){this.members=[]}add(e){Jf(this.members,e);for(let t=this.members.length-1;t>=0;t--){let n=this.members[t];if(n===e||n===this.lead||n===this.prevLead)continue;let r=n.instance;(!r||r.isConnected===!1)&&!n.snapshot&&(Yf(this.members,n),n.unmount())}e.scheduleRender()}remove(e){if(Yf(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){for(let t=this.members.indexOf(e)-1;t>=0;t--){let e=this.members[t];if(e.isPresent!==!1&&e.instance?.isConnected!==!1)return this.promote(e),!0}return!1}promote(e,t){let n=this.lead;if(e!==n&&(this.prevLead=n,this.lead=e,e.show(),n)){n.updateSnapshot(),e.scheduleRender();let{layoutDependency:r}=n.options,{layoutDependency:i}=e.options;(r===void 0||r!==i)&&(e.resumeFrom=n,t&&(n.preserveOpacity=!0),n.snapshot&&(e.snapshot=n.snapshot,e.snapshot.latestValues=n.animationValues||n.latestValues),e.root?.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&n.hide()}}exitAnimationComplete(){this.members.forEach(e=>{e.options.onExitComplete?.(),e.resumingFrom?.options.onExitComplete?.()})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){this.lead?.snapshot&&(this.lead.snapshot=void 0)}},Vb={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Hb={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},Ub=[``,`X`,`Y`,`Z`],Wb=1e3,Gb=0;function Kb(e,t,n,r){let{latestValues:i}=t;i[e]&&(n[e]=i[e],t.setStaticValue(e,0),r&&(r[e]=0))}function qb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;let{visualElement:t}=e.options;if(!t)return;let n=d_(t);if(window.MotionHasOptimisedAnimation(n,`transform`)){let{layout:t,layoutId:r}=e.options;window.MotionCancelOptimisedAnimation(n,`transform`,Fp,!(t||r))}let{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&qb(r)}function Jb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:i}){return class{constructor(e={},n=t?.()){this.id=Gb++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Sv.value&&(Hb.nodes=Hb.calculatedTargetDeltas=Hb.calculatedProjections=0),this.nodes.forEach(Zb),this.nodes.forEach(ox),this.nodes.forEach(sx),this.nodes.forEach(Qb),Sv.addProjectionMetrics&&Sv.addProjectionMetrics(Hb)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=n?n.root||n:this,this.path=n?[...n.path,n]:[],this.parent=n,this.depth=n?n.depth+1:0;for(let e=0;e<this.path.length;e++)this.path[e].shouldResetTransform=!0;this.root===this&&(this.nodes=new Lb)}addEventListener(e,t){return this.eventHandlers.has(e)||this.eventHandlers.set(e,new ap),this.eventHandlers.get(e).add(t)}notifyListeners(e,...t){let n=this.eventHandlers.get(e);n&&n.notify(...t)}hasListeners(e){return this.eventHandlers.has(e)}mount(t){if(this.instance)return;this.isSVG=sv(t)&&!Cv(t),this.instance=t;let{layoutId:n,layout:r,visualElement:i}=this.options;if(i&&!i.current&&i.mount(t),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(r||n)&&(this.isLayoutDirty=!0),e){let n,r=0,i=()=>this.root.updateBlockedByResize=!1;Fp.read(()=>{r=window.innerWidth}),e(t,()=>{let e=window.innerWidth;e!==r&&(r=e,this.root.updateBlockedByResize=!0,n&&n(),n=Rb(i,250),Vb.hasAnimatedSinceResize&&(Vb.hasAnimatedSinceResize=!1,this.nodes.forEach(ax)))})}n&&this.root.registerSharedNode(n,this),this.options.animate!==!1&&i&&(n||r)&&this.addEventListener(`didUpdate`,({delta:e,hasLayoutChanged:t,hasRelativeLayoutChanged:n,layout:r})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let a=this.options.transition||i.getDefaultTransition()||mx,{onLayoutAnimationStart:o,onLayoutAnimationComplete:s}=i.getProps(),c=!this.targetLayout||!xb(this.targetLayout,r),l=!t&&n;if(this.options.layoutRoot||this.resumeFrom||l||t&&(c||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);let t={...Bg(a,`layout`),onPlay:o,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t),this.setAnimationOrigin(e,l,t.path)}else t||ax(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=r})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Ip(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(cx),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&qb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e<this.path.length;e++){let t=this.path[e];t.shouldResetTransform=!0,(typeof t.latestValues.x==`string`||typeof t.latestValues.y==`string`)&&(t.isLayoutDirty=!0),t.updateScroll(`snapshot`),t.options.layoutRoot&&t.willUpdate(!1)}let{layoutId:t,layout:n}=this.options;if(t===void 0&&!n)return;let r=this.getTransformTemplate();this.prevTransformTemplateValue=r?r(this.latestValues,``):void 0,this.updateSnapshot(),e&&this.notifyListeners(`willUpdate`)}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){let e=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),e&&this.nodes.forEach(tx),this.nodes.forEach(ex);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(nx);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(rx),this.nodes.forEach(ix),this.nodes.forEach(Yb),this.nodes.forEach(Xb)):this.nodes.forEach(nx),this.clearAllSnapshots();let e=Vp.now();Lp.delta=Xf(0,1e3/60,e-Lp.timestamp),Lp.timestamp=e,Lp.isProcessing=!0,Rp.update.process(Lp),Rp.preRender.process(Lp),Rp.render.process(Lp),Lp.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,B_.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach($b),this.sharedNodes.forEach(lx)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,Fp.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){Fp.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!nb(this.snapshot.measuredBox.x)&&!nb(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e<this.path.length;e++)this.path[e].updateScroll();let e=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||=kv(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners(`measure`,this.layout.layoutBox);let{visualElement:t}=this.options;t&&t.notify(`LayoutMeasure`,this.layout.layoutBox,e?e.layoutBox:void 0)}updateScroll(e=`measure`){let t=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===e&&(t=!1),t&&this.instance){let t=r(this.instance);this.scroll={animationId:this.root.animationId,phase:e,isRoot:t,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:t}}}resetTransform(){if(!i)return;let e=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,t=this.projectionDelta&&!_b(this.projectionDelta),n=this.getTransformTemplate(),r=n?n(this.latestValues,``):void 0,a=r!==this.prevTransformTemplateValue;e&&this.instance&&(t||ey(this.latestValues)||a)&&(i(this.instance,r),this.shouldResetTransform=!1,this.scheduleRender())}measure(e=!0){let t=this.measurePageBox(),n=this.removeElementScroll(t);return e&&(n=this.removeTransform(n)),vx(n),{animationId:this.root.animationId,measuredBox:t,layoutBox:n,latestValues:{},source:this.id}}measurePageBox(){let{visualElement:e}=this.options;if(!e)return kv();let t=e.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(bx))){let{scroll:e}=this.root;e&&(uy(t.x,e.offset.x),uy(t.y,e.offset.y))}return t}removeElementScroll(e){let t=kv();if(Xy(t,e),this.scroll?.wasRoot)return t;for(let n=0;n<this.path.length;n++){let r=this.path[n],{scroll:i,options:a}=r;r!==this.root&&i&&a.layoutScroll&&(i.wasRoot&&Xy(t,e),uy(t.x,i.offset.x),uy(t.y,i.offset.y))}return t}applyTransform(e,t=!1,n){let r=n||kv();Xy(r,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];!t&&n.options.layoutScroll&&n.scroll&&n!==n.root&&(uy(r.x,-n.scroll.offset.x),uy(r.y,-n.scroll.offset.y)),ey(n.latestValues)&&py(r,n.latestValues,n.layout?.layoutBox)}return ey(this.latestValues)&&py(r,this.latestValues,this.layout?.layoutBox),r}removeTransform(e){let t=kv();Xy(t,e);for(let e=0;e<this.path.length;e++){let n=this.path[e];if(!ey(n.latestValues))continue;let r;n.instance&&($v(n.latestValues)&&n.updateSnapshot(),r=kv(),Xy(r,n.measurePageBox())),hb(t,n.latestValues,n.snapshot?.layoutBox,r)}return ey(this.latestValues)&&hb(t,this.latestValues),t}setTargetDelta(e){this.targetDelta=e,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(e){this.options={...this.options,...e,crossfade:e.crossfade===void 0||e.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!==Lp.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(e=!1){let t=this.getLead();this.isProjectionDirty||=t.isProjectionDirty,this.isTransformDirty||=t.isTransformDirty,this.isSharedProjectionDirty||=t.isSharedProjectionDirty;let n=!!this.resumingFrom||this!==t;if(!(e||n&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;let{layout:r,layoutId:i}=this.options;if(!this.layout||!(r||i))return;this.resolvedRelativeTargetAt=Lp.timestamp;let a=this.getClosestProjectingParent();a&&this.linkedParentVersion!==a.layoutVersion&&!a.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&a&&a.layout?this.createRelativeTarget(a,this.layout.layoutBox,a.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=kv(),this.targetWithTransforms=kv()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sb(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Xy(this.target,this.layout.layoutBox),oy(this.target,this.targetDelta)):Xy(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&a&&!!a.resumingFrom==!!this.resumingFrom&&!a.options.layoutScroll&&a.target&&this.animationProgress!==1?this.createRelativeTarget(a,this.target,a.target):this.relativeParent=this.relativeTarget=void 0),Sv.value&&Hb.calculatedTargetDeltas++)}getClosestProjectingParent(){if(!(!this.parent||$v(this.parent.latestValues)||ty(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(e,t,n){this.relativeParent=e,this.linkedParentVersion=e.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=kv(),this.relativeTargetOrigin=kv(),lb(this.relativeTargetOrigin,t,n,this.options.layoutAnchor||void 0),Xy(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){let e=this.getLead(),t=!!this.resumingFrom||this!==e,n=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(n=!1),t&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(n=!1),this.resolvedRelativeTargetAt===Lp.timestamp&&(n=!1),n)return;let{layout:r,layoutId:i}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(r||i))return;Xy(this.layoutCorrected,this.layout.layoutBox);let a=this.treeScale.x,o=this.treeScale.y;ly(this.layoutCorrected,this.treeScale,this.path,t),e.layout&&!e.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(e.target=e.layout.layoutBox,e.targetWithTransforms=kv());let{target:s}=e;if(!s){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Zy(this.prevProjectionDelta.x,this.projectionDelta.x),Zy(this.prevProjectionDelta.y,this.projectionDelta.y)),ab(this.projectionDelta,this.layoutCorrected,s,this.latestValues),(this.treeScale.x!==a||this.treeScale.y!==o||!Cb(this.projectionDelta.x,this.prevProjectionDelta.x)||!Cb(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners(`projectionUpdate`,s)),Sv.value&&Hb.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){if(this.options.visualElement?.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Dv(),this.projectionDelta=Dv(),this.projectionDeltaWithTransform=Dv()}setAnimationOrigin(e,t=!1,n){let r=this.snapshot,i=r?r.latestValues:{},a={...this.latestValues},o=Dv();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=kv(),c=(r?r.source:void 0)!==(this.layout?this.layout.source:void 0),l=this.getStack(),u=!l||l.members.length<=1,d=!!(c&&!u&&this.options.crossfade===!0&&!this.path.some(px));this.animationProgress=0;let f,p=n?.interpolateProjection(e);this.mixTargetDelta=t=>{let n=t/1e3,r=p?.(n);r?(o.x.translate=r.x,o.x.scale=Fm(e.x.scale,1,n),o.x.origin=e.x.origin,o.x.originPoint=e.x.originPoint,o.y.translate=r.y,o.y.scale=Fm(e.y.scale,1,n),o.y.origin=e.y.origin,o.y.originPoint=e.y.originPoint):(ux(o.x,e.x,n),ux(o.y,e.y,n)),this.setTargetDelta(o),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(lb(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),fx(this.relativeTarget,this.relativeTargetOrigin,s,n),f&&yb(this.relativeTarget,f)&&(this.isProjectionDirty=!1),f||=kv(),Xy(f,this.relativeTarget)),c&&(this.animationValues=a,kb(a,i,this.latestValues,n,d,u)),r&&r.rotate!==void 0&&(this.animationValues||=a,this.animationValues.pathRotation=r.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=n},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(e){this.notifyListeners(`animationStart`),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&=(Ip(this.pendingAnimation),void 0),this.pendingAnimation=Fp.update(()=>{Vb.hasAnimatedSinceResize=!0,this.motionValue||=Rg(0),this.motionValue.jump(0,!1),this.currentAnimation=Pb(this.motionValue,[0,1e3],{...e,velocity:0,isSync:!0,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners(`animationComplete`)}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Wb),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:n,layout:r,latestValues:i}=e;if(!(!t||!n||!r)){if(this!==e&&this.layout&&r&&yx(this.options.animationType,this.layout.layoutBox,r.layoutBox)){n=this.target||kv();let t=nb(this.layout.layoutBox.x);n.x.min=e.target.x.min,n.x.max=n.x.min+t;let r=nb(this.layout.layoutBox.y);n.y.min=e.target.y.min,n.y.max=n.y.min+r}Xy(t,n),py(t,i),ab(this.projectionDeltaWithTransform,this.layoutCorrected,t,i)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new Bb),this.sharedNodes.get(e).add(t);let n=t.options.initialPromotionConfig;t.promote({transition:n?n.transition:void 0,preserveFollowOpacity:n&&n.shouldPreserveFollowOpacity?n.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){let{layoutId:e}=this.options;return e&&this.getStack()?.lead||this}getPrevLead(){let{layoutId:e}=this.options;return e?this.getStack()?.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:n}={}){let r=this.getStack();r&&r.promote(this,n),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return e?e.relegate(this):!1}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:n}=e;if((n.z||n.rotate||n.rotateX||n.rotateY||n.rotateZ||n.skewX||n.skewY)&&(t=!0),!t)return;let r={};n.z&&Kb(`z`,e,r,this.animationValues);for(let t=0;t<Ub.length;t++)Kb(`rotate${Ub[t]}`,e,r,this.animationValues),Kb(`skew${Ub[t]}`,e,r,this.animationValues);e.render();for(let t in r)e.setStaticValue(t,r[t]),this.animationValues&&(this.animationValues[t]=r[t]);e.scheduleRender()}applyProjectionStyles(e,t){if(!this.instance||this.isSVG)return;if(!this.isVisible){e.visibility=`hidden`;return}let n=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,e.visibility=``,e.opacity=``,e.pointerEvents=zb(t?.pointerEvents)||``,e.transform=n?n(this.latestValues,``):`none`;return}let r=this.getLead();if(!this.projectionDelta||!this.layout||!r.target){this.options.layoutId&&(e.opacity=this.latestValues.opacity===void 0?1:this.latestValues.opacity,e.pointerEvents=zb(t?.pointerEvents)||``),this.hasProjected&&!ey(this.latestValues)&&(e.transform=n?n({},``):`none`,this.hasProjected=!1);return}e.visibility=``;let i=r.animationValues||r.latestValues;this.applyTransformsToTarget();let a=Tb(this.projectionDeltaWithTransform,this.treeScale,i);n&&(a=n(i,a)),e.transform=a;let{x:o,y:s}=this.projectionDelta;e.transformOrigin=`${o.origin*100}% ${s.origin*100}% 0`,e.opacity=r.animationValues?r===this?i.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:i.opacityExit:r===this?i.opacity===void 0?``:i.opacity:i.opacityExit===void 0?0:i.opacityExit;for(let t in wy){if(i[t]===void 0)continue;let{correct:n,applyTo:o,isCSSVariable:s}=wy[t],c=a===`none`?i[t]:n(i[t],r);if(o){let t=o.length;for(let n=0;n<t;n++)e[o[n]]=c}else s?this.options.visualElement.renderState.vars[t]=c:e[t]=c}this.options.layoutId&&(e.pointerEvents=r===this?zb(t?.pointerEvents)||``:`none`)}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(e=>e.currentAnimation?.stop()),this.root.nodes.forEach(ex),this.root.sharedNodes.clear()}}}function Yb(e){e.updateLayout()}function Xb(e){let t=e.resumeFrom?.snapshot||e.snapshot;if(e.isLead()&&e.layout&&t&&e.hasListeners(`didUpdate`)){let{layoutBox:n,measuredBox:r}=e.layout,{animationType:i}=e.options,a=t.source!==e.layout.source;if(i===`size`)wb(e=>{let r=a?t.measuredBox[e]:t.layoutBox[e],i=nb(r);r.min=n[e].min,r.max=r.min+i});else if(i===`x`||i===`y`){let e=i===`x`?`y`:`x`;Yy(a?t.measuredBox[e]:t.layoutBox[e],n[e])}else yx(i,t.layoutBox,n)&&wb(r=>{let i=a?t.measuredBox[r]:t.layoutBox[r],o=nb(n[r]);i.max=i.min+o,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[r].max=e.relativeTarget[r].min+o)});let o=Dv();ab(o,n,t.layoutBox);let s=Dv();a?ab(s,e.applyTransform(r,!0),t.measuredBox):ab(s,n,t.layoutBox);let c=!_b(o),l=!1;if(!e.resumeFrom){let r=e.getClosestProjectingParent();if(r&&!r.resumeFrom){let{snapshot:i,layout:a}=r;if(i&&a){let o=e.options.layoutAnchor||void 0,s=kv();lb(s,t.layoutBox,i.layoutBox,o);let c=kv();lb(c,n,a.layoutBox,o),xb(s,c)||(l=!0),r.options.layoutRoot&&(e.relativeTarget=c,e.relativeTargetOrigin=s,e.relativeParent=r)}}}e.notifyListeners(`didUpdate`,{layout:n,snapshot:t,delta:s,layoutDelta:o,hasLayoutChanged:c,hasRelativeLayoutChanged:l})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function Zb(e){Sv.value&&Hb.nodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty),e.isTransformDirty||=e.parent.isTransformDirty)}function Qb(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function $b(e){e.clearSnapshot()}function ex(e){e.clearMeasurements()}function tx(e){e.isLayoutDirty=!0,e.updateLayout()}function nx(e){e.isLayoutDirty=!1}function rx(e){e.isAnimationBlocked&&e.layout&&!e.isLayoutDirty&&(e.snapshot=e.layout,e.isLayoutDirty=!0)}function ix(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify(`BeforeLayoutMeasure`),e.resetTransform()}function ax(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function ox(e){e.resolveTargetDelta()}function sx(e){e.calcProjection()}function cx(e){e.resetSkewAndRotation()}function lx(e){e.removeLeadSnapshot()}function ux(e,t,n){e.translate=Fm(t.translate,0,n),e.scale=Fm(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function dx(e,t,n,r){e.min=Fm(t.min,n.min,r),e.max=Fm(t.max,n.max,r)}function fx(e,t,n,r){dx(e.x,t.x,n.x,r),dx(e.y,t.y,n.y,r)}function px(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}var mx={duration:.45,ease:[.4,0,.1,1]},hx=e=>typeof navigator<`u`&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),gx=hx(`applewebkit/`)&&!hx(`chrome/`)?Math.round:np;function _x(e){e.min=gx(e.min),e.max=gx(e.max)}function vx(e){_x(e.x),_x(e.y)}function yx(e,t,n){return e===`position`||e===`preserve-aspect`&&!rb(Sb(t),Sb(n),.2)}function bx(e){return e!==e.root&&e.scroll?.wasRoot}var xx=Jb({attachResizeListener:(e,t)=>Fb(e,`resize`,t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body?.scrollLeft||0,y:document.documentElement.scrollTop||document.body?.scrollTop||0}),checkIsScrollRoot:()=>!0}),Sx={current:void 0},Cx=Jb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!Sx.current){let e=new xx({});e.mount(window),e.setOptions({layoutScroll:!0}),Sx.current=e}return Sx.current},resetTransform:(e,t)=>{e.style.transform=t===void 0?`none`:t},checkIsScrollRoot:e=>window.getComputedStyle(e).position===`fixed`}),wx=(0,v.createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:`never`});function Tx(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ex(...e){return t=>{let n=!1,r=e.map(e=>{let r=Tx(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Tx(e[t],null)}}}}function Dx(...e){return v.useCallback(Ex(...e),e)}var Ox=class extends v.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(z_(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=z_(e)&&e.offsetWidth||0,r=z_(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function kx({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,v.useId)(),s=(0,v.useRef)(null),c=(0,v.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,v.useContext)(wx),u=Dx(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,v.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
13
|
+
[data-motion-pop-id="${o}"] {
|
|
14
|
+
position: absolute !important;
|
|
15
|
+
width: ${e}px !important;
|
|
16
|
+
height: ${u}px !important;
|
|
17
|
+
${_}px !important;
|
|
18
|
+
${v}px !important;
|
|
19
|
+
}
|
|
20
|
+
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,y.jsx)(Ox,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:v.cloneElement(e,{ref:u})})}var Ax=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Gf(jx),d=(0,v.useId)(),f=(0,v.useRef)(n),p=(0,v.useRef)(r);Kf(()=>{f.current=n,p.current=r});let m=!0,h=(0,v.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,v.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),v.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,y.jsx)(kx,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,y.jsx)(qf.Provider,{value:h,children:e})};function jx(){return new Map}function Mx(e=!0){let t=(0,v.useContext)(qf);if(t===null)return[!0,null];let{isPresent:n,onExitComplete:r,register:i}=t,a=(0,v.useId)();(0,v.useEffect)(()=>{if(e)return i(a)},[e]);let o=(0,v.useCallback)(()=>e&&r&&r(a),[a,r,e]);return!n&&r?[!1,o]:[!0]}var Nx=e=>e.key||``;function Px(e){let t=[];return v.Children.forEach(e,e=>{(0,v.isValidElement)(e)&&t.push(e)}),t}var Fx=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=Mx(o),f=(0,v.useMemo)(()=>Px(e),[e]),p=o&&!u?[]:f.map(Nx),m=(0,v.useRef)(!0),h=(0,v.useRef)(f),g=Gf(()=>new Map),_=(0,v.useRef)(new Set),[b,x]=(0,v.useState)(f),[S,C]=(0,v.useState)(f);Kf(()=>{o&&!u&&!S.length&&d?.()},[u,o,S.length,d]),Kf(()=>{m.current=!1,h.current=f;for(let e=0;e<S.length;e++){let t=Nx(S[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[S,p.length,p.join(`-`)]);let w=[];if(f!==b){let e=[...f];for(let t=0;t<S.length;t++){let n=S[t],r=Nx(n);p.includes(r)||(e.splice(t,0,n),w.push(n))}return a===`wait`&&w.length&&(e=w),C(Px(e)),x(f),null}let{forceRender:T}=(0,v.useContext)(Wf);return(0,y.jsx)(y.Fragment,{children:S.map(e=>{let v=Nx(e),b=o&&!u?!1:f===S||p.includes(v);return(0,y.jsx)(Ax,{isPresent:b,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:b?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(T?.(),C(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})},Ix=(0,v.createContext)({strict:!1}),Lx={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`]},Rx=!1;function zx(){if(Rx)return;let e={};for(let t in Lx)e[t]={isEnabled:e=>Lx[t].some(t=>!!e[t])};Wv(e),Rx=!0}function Bx(){return zx(),Gv()}function Vx(e){let t=Bx();for(let n in e)t[n]={...t[n],...e[n]};Wv(t)}function Hx({children:e,features:t,strict:n=!1}){let[,r]=(0,v.useState)(!Ux(t)),i=(0,v.useRef)(void 0);if(!Ux(t)){let{renderer:e,...n}=t;i.current=e,Vx(n)}return(0,v.useEffect)(()=>{Ux(t)&&t().then(({renderer:e,...t})=>{Vx(t),i.current=e,r(!0)})},[]),(0,y.jsx)(Ix.Provider,{value:{renderer:i.current,strict:n},children:e})}function Ux(e){return typeof e==`function`}var Wx=(0,v.createContext)({});function Gx(e,t){if(Fv(e)){let{initial:t,animate:n}=e;return{initial:t===!1||Mv(t)?t:void 0,animate:Mv(n)?n:void 0}}return e.inherit===!1?{}:t}function Kx(e){let{initial:t,animate:n}=Gx(e,(0,v.useContext)(Wx));return(0,v.useMemo)(()=>({initial:t,animate:n}),[qx(t),qx(n)])}function qx(e){return Array.isArray(e)?e.join(` `):e}var Jx=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function Yx(e,t,n){for(let r in t)!o_(t[r])&&!Ty(r,n)&&(e[r]=t[r])}function Xx({transformTemplate:e},t){return(0,v.useMemo)(()=>{let n=Jx();return yy(n,t,e),Object.assign({},n.vars,n.style)},[t])}function Zx(e,t){let n=e.style||{},r={};return Yx(r,n,e),Object.assign(r,Xx(e,t)),r}function Qx(e,t){let n={},r=Zx(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout=`none`,r.touchAction=e.drag===!0?`none`:`pan-${e.drag===`x`?`y`:`x`}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}var $x=()=>({...Jx(),attrs:{}});function eS(e,t,n,r){let i=(0,v.useMemo)(()=>{let n=$x();return Ny(n,t,Fy(r),e.transformTemplate,e.style),{...n.attrs,style:{...n.style}}},[t]);if(e.style){let t={};Yx(t,e.style,e),i.style={...t,...i.style}}return i}var tS=new Set(`animate.exit.variants.initial.style.values.variants.transition.transformTemplate.custom.inherit.onBeforeLayoutMeasure.onAnimationStart.onAnimationComplete.onUpdate.onDragStart.onDrag.onDragEnd.onMeasureDragConstraints.onDirectionLock.onDragTransitionEnd._dragX._dragY.onHoverStart.onHoverEnd.onViewportEnter.onViewportLeave.globalTapTarget.propagate.ignoreStrict.viewport`.split(`.`));function nS(e){return e.startsWith(`while`)||e.startsWith(`drag`)&&e!==`draggable`||e.startsWith(`layout`)||e.startsWith(`onTap`)||e.startsWith(`onPan`)||e.startsWith(`onLayout`)||tS.has(e)}function rS(e,t){return e.startsWith(`on`)?!nS(e):t?.(e)??!nS(e)}function iS(e,t,n,r){let i={};for(let a in e)(a!==`values`||typeof e.values!=`object`)&&(o_(e[a])||(rS(a,r)||n===!0&&nS(a)||!t&&!nS(a)||e.draggable&&a.startsWith(`onDrag`))&&(i[a]=e[a]));return i}var aS=[`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 oS(e){return typeof e!=`string`||e.includes(`-`)?!1:!!(aS.indexOf(e)>-1||/[A-Z]/u.test(e))}function sS(e,t,n,{latestValues:r},i,a=!1,o,s){let c=(o??oS(e)?eS:Qx)(t,r,i,e),l=iS(t,typeof e==`string`,a,s),u=e===v.Fragment?{}:{...l,...c,ref:n},{children:d}=t,f=(0,v.useMemo)(()=>o_(d)?d.get():d,[d]);return(0,v.createElement)(e,{...u,children:f})}function cS({scrapeMotionValuesFromProps:e,createRenderState:t},n,r,i){return{latestValues:lS(n,r,i,e),renderState:t()}}function lS(e,t,n,r){let i={},a=r(e,{});for(let e in a)i[e]=zb(a[e]);let{initial:o,animate:s}=e,c=Fv(e),l=Iv(e);t&&l&&!c&&e.inherit!==!1&&(o===void 0&&(o=t.initial),s===void 0&&(s=t.animate));let u=n?n.initial===!1:!1;u||=o===!1;let d=u?s:o;if(d&&typeof d!=`boolean`&&!jv(d)){let t=Array.isArray(d)?d:[d];for(let n=0;n<t.length;n++){let r=$g(e,t[n]);if(r){let{transitionEnd:e,transition:t,...n}=r;for(let e in n){let t=n[e];if(Array.isArray(t)){let e=u?t.length-1:0;t=t[e]}t!==null&&(i[e]=t)}for(let t in e)i[t]=e[t]}}}return i}var uS=e=>(t,n)=>{let r=(0,v.useContext)(Wx),i=(0,v.useContext)(qf),a=()=>cS(e,t,r,i);return n?a():Gf(a)},dS=uS({scrapeMotionValuesFromProps:Ey,createRenderState:Jx}),fS=uS({scrapeMotionValuesFromProps:Ly,createRenderState:$x}),pS=Symbol.for(`motionComponentSymbol`);function mS(e,t,n){let r=(0,v.useRef)(n);(0,v.useInsertionEffect)(()=>{r.current=n});let i=(0,v.useRef)(null);return(0,v.useCallback)(n=>{n&&e.onMount?.(n),t&&(n?t.mount(n):t.unmount());let a=r.current;if(typeof a==`function`){if(n){let e=a(n);typeof e==`function`&&(i.current=e)}else i.current?(i.current(),i.current=null):a(n)}else a&&(a.current=n)},[t])}var hS=(0,v.createContext)({});function gS(e){return e&&typeof e==`object`&&Object.prototype.hasOwnProperty.call(e,`current`)}function _S(e,t,n,r,i,a){let{visualElement:o}=(0,v.useContext)(Wx),s=(0,v.useContext)(Ix),c=(0,v.useContext)(qf),l=(0,v.useContext)(wx),u=l.reducedMotion,d=l.skipAnimations,f=(0,v.useRef)(null),p=(0,v.useRef)(!1);r||=s.renderer,!f.current&&r&&(f.current=r(e,{visualState:t,parent:o,props:n,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:u,skipAnimations:d,isSVG:a}),p.current&&f.current&&(f.current.manuallyAnimateOnMount=!0));let m=f.current,h=(0,v.useContext)(hS);m&&!m.projection&&i&&(m.type===`html`||m.type===`svg`)&&vS(f.current,n,i,h);let g=(0,v.useRef)(!1);(0,v.useInsertionEffect)(()=>{m&&g.current&&m.update(n,c)});let _=n[u_],y=(0,v.useRef)(!!_&&typeof window<`u`&&!window.MotionHandoffIsComplete?.(_)&&window.MotionHasOptimisedAnimation?.(_));return Kf(()=>{p.current=!0,m&&(g.current=!0,window.MotionIsMounted=!0,m.updateFeatures(),m.scheduleRenderMicrotask(),y.current&&m.animationState&&m.animationState.animateChanges())}),(0,v.useEffect)(()=>{m&&(!y.current&&m.animationState&&m.animationState.animateChanges(),y.current&&=(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(_)}),!1),m.enteringChildren=void 0)}),m}function vS(e,t,n,r){let{layoutId:i,layout:a,drag:o,dragConstraints:s,layoutScroll:c,layoutRoot:l,layoutAnchor:u,layoutCrossfade:d}=t;e.projection=new n(e.latestValues,t[`data-framer-portal-id`]?void 0:yS(e.parent)),e.projection.setOptions({layoutId:i,layout:a,alwaysMeasureLayout:!!o||s&&gS(s),visualElement:e,animationType:typeof a==`string`?a:`both`,initialPromotionConfig:r,crossfade:d,layoutScroll:c,layoutRoot:l,layoutAnchor:u})}function yS(e){if(e)return e.options.allowProjection===!1?yS(e.parent):e.projection}function bS(e,{forwardMotionProps:t=!1,type:n}={},r,i){r&&Vx(r);let a=n?n===`svg`:oS(e),o=a?fS:dS;function s(n,s){let c,l={...(0,v.useContext)(wx),...n,layoutId:xS(n)},{isStatic:u,isValidProp:d}=l,f=Kx(n),p=o(n,u);if(!u&&typeof window<`u`){SS(l,r);let t=CS(l);c=t.MeasureLayout,f.visualElement=_S(e,p,l,i,t.ProjectionNode,a)}return(0,y.jsxs)(Wx.Provider,{value:f,children:[c&&f.visualElement?(0,y.jsx)(c,{visualElement:f.visualElement,...l}):null,sS(e,n,mS(p,f.visualElement,s),p,u,t,a,d)]})}s.displayName=`motion.${typeof e==`string`?e:`create(${e.displayName??e.name??``})`}`;let c=(0,v.forwardRef)(s);return c[pS]=e,c}function xS({layoutId:e}){let t=(0,v.useContext)(Wf).id;return t&&e!==void 0?t+`-`+e:e}function SS(e,t){(0,v.useContext)(Ix).strict}function CS(e){let{drag:t,layout:n}=Bx();if(!t&&!n)return{};let r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function wS(e,t){if(typeof Proxy>`u`)return bS;let n=new Map,r=(n,r)=>bS(n,r,e,t);return new Proxy((e,t)=>r(e,t),{get:(i,a)=>a===`create`?r:(n.has(a)||n.set(a,bS(a,void 0,e,t)),n.get(a))})}var TS=(e,t)=>t.isSVG??oS(e)?new Ry(t):new Oy(t,{allowProjection:e!==v.Fragment}),ES=class extends Jv{constructor(e){super(e),e.animationState||=Gy(e)}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();jv(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}},DS=0,OS={animation:{Feature:ES},exit:{Feature:class extends Jv{constructor(){super(...arguments),this.id=DS++,this.isExitComplete=!1}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:n}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===n)return;if(e&&n===!1){if(this.isExitComplete){let{initial:e,custom:t}=this.node.getProps();if(typeof e==`string`||typeof e==`object`&&e&&!Array.isArray(e)){let n=e_(this.node,e,t);if(n){let{transition:e,transitionEnd:t,...r}=n;for(let e in r)this.node.getValue(e)?.jump(r[e])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive(`exit`,!1);this.isExitComplete=!1;return}let r=this.node.animationState.setActive(`exit`,!e);t&&!e&&r.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){let{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}}};function kS(e){return{point:{x:e.pageX,y:e.pageY}}}var AS=e=>t=>Y_(t)&&e(t,kS(t));function jS(e,t,n,r){return Fb(e,t,AS(n),r)}var MS=({current:e})=>e?e.ownerDocument.defaultView:null,NS=(e,t)=>Math.abs(e-t);function PS(e,t){let n=NS(e.x,t.x),r=NS(e.y,t.y);return Math.sqrt(n**2+r**2)}var FS=new Set([`auto`,`scroll`]),IS=class{constructor(e,t,{transformPagePoint:n,contextWindow:r=window,dragSnapToOrigin:i=!1,distanceThreshold:a=3,element:o}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=e=>{this.handleScroll(e.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=LS(this.lastRawMoveEventInfo,this.transformPagePoint));let e=zS(this.lastMoveEventInfo,this.history),t=this.startEvent!==null,n=PS(e.offset,{x:0,y:0})>=this.distanceThreshold;if(!t&&!n)return;let{point:r}=e,{timestamp:i}=Lp;this.history.push({...r,timestamp:i});let{onStart:a,onMove:o}=this.handlers;t||(a&&a(this.lastMoveEvent,e),this.startEvent=this.lastMoveEvent),o&&o(this.lastMoveEvent,e)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastRawMoveEventInfo=t,this.lastMoveEventInfo=LS(t,this.transformPagePoint),Fp.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:n,onSessionEnd:r,resumeAnimation:i}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&i&&i(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let a=zS(e.type===`pointercancel`?this.lastMoveEventInfo:LS(t,this.transformPagePoint),this.history);this.startEvent&&n&&n(e,a),r&&r(e,a)},!Y_(e))return;this.dragSnapToOrigin=i,this.handlers=t,this.transformPagePoint=n,this.distanceThreshold=a,this.contextWindow=r||window;let s=LS(kS(e),this.transformPagePoint),{point:c}=s,{timestamp:l}=Lp;this.history=[{...c,timestamp:l}];let{onSessionStart:u}=t;u&&u(e,zS(s,this.history));let d={passive:!0,capture:!0};this.removeListeners=rp(jS(this.contextWindow,`pointermove`,this.handlePointerMove,d),jS(this.contextWindow,`pointerup`,this.handlePointerUp,d),jS(this.contextWindow,`pointercancel`,this.handlePointerUp,d)),o&&this.startScrollTracking(o)}startScrollTracking(e){let t=e.parentElement;for(;t;){let e=getComputedStyle(t);(FS.has(e.overflowX)||FS.has(e.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.addEventListener(`scroll`,this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener(`scroll`,this.onElementScroll,{capture:!0}),window.removeEventListener(`scroll`,this.onWindowScroll)}}handleScroll(e){let t=this.scrollPositions.get(e);if(!t)return;let n=e===window,r=n?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},i={x:r.x-t.x,y:r.y-t.y};(i.x!==0||i.y!==0)&&(n?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=i.x,this.lastMoveEventInfo.point.y+=i.y):this.history.length>0&&(this.history[0].x-=i.x,this.history[0].y-=i.y),this.scrollPositions.set(e,r),Fp.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Ip(this.updatePoint)}};function LS(e,t){return t?{point:t(e.point)}:e}function RS(e,t){return{x:e.x-t.x,y:e.y-t.y}}function zS({point:e},t){return{point:e,delta:RS(e,VS(t)),offset:RS(e,BS(t)),velocity:HS(t,.1)}}function BS(e){return e[0]}function VS(e){return e[e.length-1]}function HS(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null,i=VS(e);for(;n>=0&&(r=e[n],!(i.timestamp-r.timestamp>op(t)));)n--;if(!r)return{x:0,y:0};r===e[0]&&e.length>2&&i.timestamp-r.timestamp>op(t)*2&&(r=e[1]);let a=sp(i.timestamp-r.timestamp);if(a===0)return{x:0,y:0};let o={x:(i.x-r.x)/a,y:(i.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function US(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?Fm(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?Fm(n,e,r.max):Math.min(e,n)),e}function WS(e,t,n){return{min:t===void 0?void 0:e.min+t,max:n===void 0?void 0:e.max+n-(e.max-e.min)}}function GS(e,{top:t,left:n,bottom:r,right:i}){return{x:WS(e.x,n,i),y:WS(e.y,t,r)}}function KS(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function qS(e,t){return{x:KS(e.x,t.x),y:KS(e.y,t.y)}}function JS(e,t){let n=.5,r=nb(e),i=nb(t);return i>r?n=ip(t.min,t.max-r,e.min):r>i&&(n=ip(e.min,e.max-i,t.min)),Xf(0,1,n)}function YS(e,t){let n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}var XS=.35;function ZS(e=XS){return e===!1?e=0:e===!0&&(e=XS),{x:QS(e,`left`,`right`),y:QS(e,`top`,`bottom`)}}function QS(e,t,n){return{min:$S(e,t),max:$S(e,n)}}function $S(e,t){return typeof e==`number`?e:e[t]||0}var eC=new WeakMap,tC=class{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=kv(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:n}={}){let{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;let i=e=>{t&&this.snapToCursor(kS(e).point),this.stopAnimation()},a=(e,t)=>{let{drag:n,dragPropagation:r,onDragStart:i}=this.getProps();if(n&&!r&&(this.openDragLock&&this.openDragLock(),this.openDragLock=W_(n),!this.openDragLock))return;this.latestPointerEvent=e,this.latestPanInfo=t,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),wb(e=>{let t=this.getAxisMotionValue(e).get()||0;if(um.test(t)){let{projection:n}=this.visualElement;if(n&&n.layout){let r=n.layout.layoutBox[e];r&&(t=nb(r)*(parseFloat(t)/100))}}this.originPoint[e]=t}),i&&Fp.update(()=>i(e,t),!1,!0),c_(this.visualElement,`transform`);let{animationState:a}=this.visualElement;a&&a.setActive(`whileDrag`,!0)},o=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t;let{dragPropagation:n,dragDirectionLock:r,onDirectionLock:i,onDrag:a}=this.getProps();if(!n&&!this.openDragLock)return;let{offset:o}=t;if(r&&this.currentDirection===null){this.currentDirection=aC(o),this.currentDirection!==null&&i&&i(this.currentDirection);return}this.updateAxis(`x`,t.point,o),this.updateAxis(`y`,t.point,o),this.visualElement.render(),a&&Fp.update(()=>a(e,t),!1,!0)},s=(e,t)=>{this.latestPointerEvent=e,this.latestPanInfo=t,this.stop(e,t),this.latestPointerEvent=null,this.latestPanInfo=null},c=()=>{let{dragSnapToOrigin:e}=this.getProps();(e||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:l}=this.getProps();this.panSession=new IS(e,{onSessionStart:i,onStart:a,onMove:o,onSessionEnd:s,resumeAnimation:c},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:l,distanceThreshold:n,contextWindow:MS(this.visualElement),element:this.visualElement.current})}stop(e,t){let n=e||this.latestPointerEvent,r=t||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!r||!n)return;let{velocity:a}=r;this.startAnimation(a);let{onDragEnd:o}=this.getProps();o&&Fp.postRender(()=>o(n,r))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();let{dragPropagation:n}=this.getProps();!n&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive(`whileDrag`,!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,n){let{drag:r}=this.getProps();if(!n||!iC(e,r,this.currentDirection))return;let i=this.getAxisMotionValue(e),a=this.originPoint[e]+n[e];this.constraints&&this.constraints[e]&&(a=US(a,this.constraints[e],this.elastic[e])),i.set(a)}resolveConstraints(){let{dragConstraints:e,dragElastic:t}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,r=this.constraints;e&&gS(e)?this.constraints||=this.resolveRefConstraints():this.constraints=e&&n?GS(n.layoutBox,e):!1,this.elastic=ZS(t),r!==this.constraints&&!gS(e)&&n&&this.constraints&&!this.hasMutatedConstraints&&wb(e=>{this.constraints!==!1&&this.getAxisMotionValue(e)&&(this.constraints[e]=YS(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){let{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!gS(e))return!1;let n=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;r.root&&(r.root.scroll=void 0,r.root.updateScroll());let i=hy(n,r.root,this.visualElement.getTransformPagePoint()),a=qS(r.layout.layoutBox,i);if(t){let e=t(Xv(a));this.hasMutatedConstraints=!!e,e&&(a=Yv(e))}return a}startAnimation(e){let{drag:t,dragMomentum:n,dragElastic:r,dragTransition:i,dragSnapToOrigin:a,onDragTransitionEnd:o}=this.getProps(),s=this.constraints||{},c=wb(o=>{if(!iC(o,t,this.currentDirection))return;let c=s&&s[o]||{};(a===!0||a===o)&&(c={min:0,max:0});let l=r?200:1e6,u=r?40:1e7,d={type:`inertia`,velocity:n?e[o]:0,bounceStiffness:l,bounceDamping:u,timeConstant:750,restDelta:1,restSpeed:10,...i,...c};return this.startAxisValueAnimation(o,d)});return Promise.all(c).then(o)}startAxisValueAnimation(e,t){let n=this.getAxisMotionValue(e);return c_(this.visualElement,e),n.start(Jg(e,n,0,t,this.visualElement,!1))}stopAnimation(){wb(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`;return this.visualElement.getProps()[t]||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){wb(t=>{let{drag:n}=this.getProps();if(!iC(t,n,this.currentDirection))return;let{projection:r}=this.visualElement,i=this.getAxisMotionValue(t);if(r&&r.layout){let{min:n,max:a}=r.layout.layoutBox[t],o=i.get()||0;i.set(e[t]-Fm(n,a,.5)+o)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:n}=this.visualElement;if(!gS(t)||!n||!this.constraints)return;this.stopAnimation();let r={x:0,y:0};wb(e=>{let t=this.getAxisMotionValue(e);if(t&&this.constraints!==!1){let n=t.get();r[e]=JS({min:n,max:n},this.constraints[e])}});let{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},``):`none`,n.root&&n.root.updateScroll(),n.updateLayout(),this.constraints=!1,this.resolveConstraints(),wb(t=>{if(!iC(t,e,null))return;let n=this.getAxisMotionValue(t),{min:i,max:a}=this.constraints[t];n.set(Fm(i,a,r[t]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;eC.set(this.visualElement,this);let e=this.visualElement.current,t=jS(e,`pointerdown`,t=>{let{drag:n,dragListener:r=!0}=this.getProps(),i=t.target,a=i!==e&&$_(i);n&&r&&!a&&this.start(t)}),n,r=()=>{let{dragConstraints:t}=this.getProps();gS(t)&&t.current&&(this.constraints=this.resolveRefConstraints(),n||=rC(e,t.current,()=>this.scalePositionWithinConstraints()))},{projection:i}=this.visualElement,a=i.addEventListener(`measure`,r);i&&!i.layout&&(i.root&&i.root.updateScroll(),i.updateLayout()),Fp.read(r);let o=Fb(window,`resize`,()=>this.scalePositionWithinConstraints()),s=i.addEventListener(`didUpdate`,(({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(wb(t=>{let n=this.getAxisMotionValue(t);n&&(this.originPoint[t]+=e[t].translate,n.set(n.get()+e[t].translate))}),this.visualElement.render())}));return()=>{o(),t(),a(),s&&s(),n&&n()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:n=!1,dragPropagation:r=!1,dragConstraints:i=!1,dragElastic:a=XS,dragMomentum:o=!0}=e;return{...e,drag:t,dragDirectionLock:n,dragPropagation:r,dragConstraints:i,dragElastic:a,dragMomentum:o}}};function nC(e){let t=!0;return()=>{if(t){t=!1;return}e()}}function rC(e,t,n){let r=xv(e,nC(n)),i=xv(t,nC(n));return()=>{r(),i()}}function iC(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function aC(e,t=10){let n=null;return Math.abs(e.y)>t?n=`y`:Math.abs(e.x)>t&&(n=`x`),n}var oC=class extends Jv{constructor(e){super(e),this.removeGroupControls=np,this.removeListeners=np,this.controls=new tC(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||np}update(){let{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}},sC=e=>(t,n)=>{e&&Fp.update(()=>e(t,n),!1,!0)},cC=class extends Jv{constructor(){super(...arguments),this.removePointerDownListener=np}onPointerDown(e){this.session=new IS(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:MS(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:n,onPanEnd:r}=this.node.getProps();return{onSessionStart:sC(e),onStart:sC(t),onMove:sC(n),onEnd:(e,t)=>{delete this.session,r&&Fp.postRender(()=>r(e,t))}}}mount(){this.removePointerDownListener=jS(this.node.current,`pointerdown`,e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}},lC=!1,uC=class extends v.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n,layoutId:r}=this.props,{projection:i}=e;i&&(t.group&&t.group.add(i),n&&n.register&&r&&n.register(i),lC&&i.root.didUpdate(),i.addEventListener(`animationComplete`,()=>{this.safeToRemove()}),i.setOptions({...i.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),Vb.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:n,drag:r,isPresent:i}=this.props,{projection:a}=n;return a?(a.isPresent=i,e.layoutDependency!==t&&a.setOptions({...a.options,layoutDependency:t}),lC=!0,r||e.layoutDependency!==t||t===void 0||e.isPresent!==i?a.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?a.promote():a.relegate()||Fp.postRender(()=>{let e=a.getStack();(!e||!e.members.length)&&this.safeToRemove()})),null):null}componentDidUpdate(){let{visualElement:e,layoutAnchor:t}=this.props,{projection:n}=e;n&&(n.options.layoutAnchor=t,n.root.didUpdate(),B_.postRender(()=>{!n.currentAnimation&&n.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:n}=this.props,{projection:r}=e;lC=!0,r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),n&&n.deregister&&n.deregister(r))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}};function dC(e){let[t,n]=Mx(),r=(0,v.useContext)(Wf);return(0,y.jsx)(uC,{...e,layoutGroup:r,switchLayoutGroup:(0,v.useContext)(hS),isPresent:t,safeToRemove:n})}var fC={pan:{Feature:cC},drag:{Feature:oC,ProjectionNode:Cx,MeasureLayout:dC}};function pC(e,t,n){let{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive(`whileHover`,n===`Start`);let i=r[`onHover`+n];i&&Fp.postRender(()=>i(t,kS(t)))}var mC=class extends Jv{mount(){let{current:e}=this.node;e&&(this.unmount=q_(e,(e,t)=>(pC(this.node,t,`Start`),e=>pC(this.node,e,`End`))))}unmount(){}},hC=class extends Jv{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(`:focus-visible`)}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive(`whileFocus`,!1),this.isActive=!1)}mount(){this.unmount=rp(Fb(this.node.current,`focus`,()=>this.onFocus()),Fb(this.node.current,`blur`,()=>this.onBlur()))}unmount(){}};function gC(e,t,n){let{props:r}=e;if(e.current instanceof HTMLButtonElement&&e.current.disabled)return;e.animationState&&r.whileTap&&e.animationState.setActive(`whileTap`,n===`Start`);let i=r[`onTap`+(n===`End`?``:n)];i&&Fp.postRender(()=>i(t,kS(t)))}var _C=class extends Jv{mount(){let{current:e}=this.node;if(!e)return;let{globalTapTarget:t,propagate:n}=this.node.props;this.unmount=ov(e,(e,t)=>(gC(this.node,t,`Start`),(e,{success:t})=>gC(this.node,e,t?`End`:`Cancel`)),{useGlobalTarget:t,stopPropagation:n?.tap===!1})}unmount(){}},vC=new WeakMap,yC=new WeakMap,bC=e=>{let t=vC.get(e.target);t&&t(e)},xC=e=>{e.forEach(bC)};function SC({root:e,...t}){let n=e||document;yC.has(n)||yC.set(n,{});let r=yC.get(n),i=JSON.stringify(t);return r[i]||(r[i]=new IntersectionObserver(xC,{root:e,...t})),r[i]}function CC(e,t,n){let r=SC(t);return vC.set(e,n),r.observe(e),()=>{vC.delete(e),r.unobserve(e)}}var wC={some:0,all:1},TC=class extends Jv{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.stopObserver?.();let{viewport:e={}}=this.node.getProps(),{root:t,margin:n,amount:r=`some`,once:i}=e,a={root:t?t.current:void 0,rootMargin:n,threshold:typeof r==`number`?r:wC[r]},o=e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,i&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive(`whileInView`,t);let{onViewportEnter:n,onViewportLeave:r}=this.node.getProps(),a=t?n:r;a&&a(e)};this.stopObserver=CC(this.node.current,a,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>`u`)return;let{props:e,prevProps:t}=this.node;[`amount`,`margin`,`root`].some(EC(e,t))&&this.startObserver()}unmount(){this.stopObserver?.(),this.hasEnteredView=!1,this.isInView=!1}};function EC({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}var DC={inView:{Feature:TC},tap:{Feature:_C},focus:{Feature:hC},hover:{Feature:mC}},OC={layout:{ProjectionNode:Cx,MeasureLayout:dC}},kC=wS({...OS,...DC,...fC,...OC},TS),AC={renderer:TS,...OS,...DC},jC=e=>{let t=(0,V.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,y.jsx)(Hx,{features:AC,children:n}),t[0]=n,t[1]=r),r},MC=e=>{let t=(0,V.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,y.jsx)(Hf,{}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,y.jsx)(jC,{children:(0,y.jsxs)(vs,{children:[r,n]})}),t[1]=n,t[2]=i),i},NC=e=>{let t=(0,V.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,y.jsx)(Ki,{children:(0,y.jsx)(ci,{children:(0,y.jsx)(oi,{path:`*`,element:n})})}),t[0]=n,t[1]=r),r},PC={key:`dictionary-edition-drawer`,content:{nodeType:`translation`,translation:{en:{openDictionaryEditor:{popoverContent:`Open Dictionary in Editor`,label:`Click to open the dictionary in the editor`},backButtonText:`Dictionary list`,modalTitle:`Edit dictionary`,noDictionaryFocused:`No dictionary focused`,focusedDictionaryNotFound:`Focused dictionary not found`},"en-GB":{openDictionaryEditor:{popoverContent:`Click to open the dictionary in the editor`,label:`Click to open the dictionary in the editor`},backButtonText:`Dictionary list`,modalTitle:`Edit dictionary`,noDictionaryFocused:`No dictionary focused`,focusedDictionaryNotFound:`Focused dictionary not found`},fr:{openDictionaryEditor:{popoverContent:`Ouvrir le dictionnaire dans l’éditeur`,label:`Cliquez pour ouvrir le dictionnaire dans l’éditeur`},backButtonText:`Liste des dictionnaires`,modalTitle:`Modifier le dictionnaire`,noDictionaryFocused:`Aucun dictionnaire sélectionné`,focusedDictionaryNotFound:`Dictionnaire focalisé non trouvé`},es:{openDictionaryEditor:{popoverContent:`Abrir el diccionario en el editor`,label:`Haga clic para abrir el diccionario en el editor`},backButtonText:`Lista de diccionarios`,modalTitle:`Editar el diccionario`,noDictionaryFocused:`No hay diccionario enfocado`,focusedDictionaryNotFound:`Diccionario enfocado no encontrado`},de:{openDictionaryEditor:{popoverContent:`Wörterbuch im Editor öffnen`,label:`Klicken Sie hier, um das Wörterbuch im Editor zu öffnen`},backButtonText:`Wörterbuchliste`,modalTitle:`Wörterbuch bearbeiten`,noDictionaryFocused:`Kein Wörterbuch ausgewählt`,focusedDictionaryNotFound:`Ausgewähltes Wörterbuch nicht gefunden`},ja:{openDictionaryEditor:{popoverContent:`エディターで辞書を開く`,label:`エディターで辞書を開く`},backButtonText:`辞書リスト`,modalTitle:`辞書を編集`,noDictionaryFocused:`フォーカスされた辞書がありません`,focusedDictionaryNotFound:`フォーカスされた辞書が見つかりません`},ko:{openDictionaryEditor:{popoverContent:`편집기에서 사전 열기`,label:`편집기에서 사전 열기`},backButtonText:`사전 목록`,modalTitle:`사전 편집`,noDictionaryFocused:`포커스가 있는 사전이 없습니다`,focusedDictionaryNotFound:`포커스가 있는 사전이 없습니다`},zh:{openDictionaryEditor:{popoverContent:`点击打开词典到编辑器`,label:`点击打开词典到编辑器`},backButtonText:`词典列表`,modalTitle:`编辑词典`,noDictionaryFocused:`没有聚焦的词典`,focusedDictionaryNotFound:`没有聚焦的词典`},it:{openDictionaryEditor:{popoverContent:`Apri il dizionario nell’editor`,label:`Fai clic per aprire il dizionario nell’editor`},backButtonText:`Elenco di dizionari`,modalTitle:`Modifica dizionario`,noDictionaryFocused:`Nessun dizionario selezionato`,focusedDictionaryNotFound:`Nessun dizionario selezionato`},pt:{openDictionaryEditor:{popoverContent:`Abrir o dicionário no editor`,label:`Clique para abrir o dicionário no editor`},backButtonText:`Lista de dicionários`,modalTitle:`Editar dicionário`,noDictionaryFocused:`Nenhum dicionário focalizado`,focusedDictionaryNotFound:`Nenhum dicionário focalizado`},hi:{openDictionaryEditor:{popoverContent:`एडिटर में शब्दकोश खोलने के लिए क्लिक करें`,label:`एडिटर में शब्दकोश खोलने के लिए क्लिक करें`},backButtonText:`शब्दकोश सूची`,modalTitle:`शब्दकोश संपादित करें`,noDictionaryFocused:`कोई फोकस शब्दकोश नहीं है`,focusedDictionaryNotFound:`कोई फोकस शब्दकोश नहीं है`},ar:{openDictionaryEditor:{popoverContent:`انقر لفتح قاموس في المحرر`,label:`انقر لفتح قاموس في المحرر`},backButtonText:`قائمة القوامل`,modalTitle:`تحرير قاموس`,noDictionaryFocused:`لا يوجد قاموس مرتبط`,focusedDictionaryNotFound:`لا يوجد قاموس مرتبط`},ru:{openDictionaryEditor:{popoverContent:`Нажмите, чтобы открыть словарь в редакторе`,label:`Нажмите, чтобы открыть словарь в редакторе`},backButtonText:`Список словарей`,modalTitle:`Редактировать словарь`,noDictionaryFocused:`Нет фокусированного словаря`,focusedDictionaryNotFound:`Нет фокусированного словаря`}}},location:`local`,localId:`dictionary-edition-drawer::local::client/src/components/Editor/DictionaryEditionDrawer/dictionaryEditionDrawer.content.ts`,filePath:`client/src/components/Editor/DictionaryEditionDrawer/dictionaryEditionDrawer.content.ts`},FC=class extends Error{status;code;data;constructor(e,t){super(e),this.name=`FetcherError`,this.status=t.status,this.code=t.code,this.data=t.data}},IC={method:`GET`,headers:{"Content-Type":`application/json`},credentials:`include`},LC=e=>(Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e),RC=e=>e.reduce((e,t)=>{let n=e??{},r=LC(t??{});return typeof n==`object`&&typeof r==`object`?{...n,...r}:r??n},{}),J=async(e,...t)=>{let{signal:n}=new AbortController,r=``,i,a=RC([IC,...t.map(({body:e,params:t,headers:n,...r})=>r)]),o=RC([IC.headers,...t.map(e=>e.headers)]),s=RC(t.map(e=>e.params)),c=a.method;if(c!==`GET`&&c!==`HEAD`){let e=RC(t.map(e=>e.body));i=o?.[`Content-Type`]===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}Object.entries(s).length>0&&(r=`?${new URLSearchParams(s).toString()}`);let l={...a,headers:o,body:i,signal:n},u=`${e}${r}`,d=await fetch(u,l);if(!d.ok){let e=await d.json().catch(()=>void 0);throw new FC(JSON.stringify(e?.error)??`An error occurred`,{status:d.status,code:e?.error?.code,data:e?.error})}return await d.json()},zC=(e={},t)=>{let n=t?.editor?.backendURL??m.backendURL,{clientId:r,clientSecret:i}=t?.editor??{};return{getOAuth2AccessToken:async(e={})=>await J(`${n}/oauth2/token`,{},e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:{grant_type:`client_credentials`,client_id:r,client_secret:i}}),createCliSessionToken:async(t={})=>await J(`${n}/api/cli-session`,e,t,{method:`POST`}),getCliSessionMe:async(t={})=>await J(`${n}/api/cli-session/me`,e,t)}};function BC(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function VC(e,t,n=`.`,r){if(!BC(t))return VC(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:BC(a)&&BC(i[t])?VC(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function HC(e){return(...t)=>t.reduce((t,n)=>VC(t,n,``,e),{})}var UC=HC(),WC=(e={},t)=>{let n=`${t?.editor?.backendURL??m.backendURL}/api/ai`;return{customQuery:async(t,r={})=>await J(n,e,r,{method:`POST`,body:t}),translateJSON:async(t,r={})=>await J(`${n}/translate/json`,e,r,{method:`POST`,body:t}),auditContentDeclaration:async(t,r={})=>await J(`${n}/audit/dictionary`,e,r,{method:`POST`,body:t}),auditContentDeclarationField:async(t,r={})=>await J(`${n}/audit/dictionary/field`,e,r,{method:`POST`,body:t}),auditContentDeclarationMetadata:async(t,r={})=>await J(`${n}/audit/dictionary/metadata`,e,r,{method:`POST`,body:t}),auditTag:async(t,r={})=>await J(`${n}/audit/tag`,e,r,{method:`POST`,body:t}),askDocQuestion:async(t,r={})=>{if(!t)return;let{onMessage:i,onDone:a,...o}=t,s=new AbortController;try{let t=await fetch(`${n}/ask`,{method:`POST`,headers:{"Content-Type":`application/json`,...e.headers,...r.headers},body:JSON.stringify({...o,...e.body,...r.body}),signal:s.signal,credentials:`include`});if(!t.ok){let e=`An error occurred`;try{let n=await t.json(),r=n.error??n;e=JSON.stringify(r)??`An error occurred`}catch{try{let n=await t.text();n&&(e=n)}catch{}}throw Error(e)}let c=t.body?.getReader();if(!c)throw Error(`No reader available`);let l=new TextDecoder,u=``;for(;;){let{done:e,value:t}=await c.read();if(e)break;u+=l.decode(t,{stream:!0});let n=u.split(`
|
|
21
|
+
`);u=n.pop()??``;for(let e of n)if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));t.chunk&&i?.(t.chunk),t.done&&t.response&&a?.(t.response)}catch(e){console.error(`Failed to parse SSE data:`,e)}}}catch(e){throw console.error(`Error in askDocQuestion:`,e),e}},chat:async(t,r={})=>{if(!t)return;let{onMessage:i,onDone:a,onAction:o,...s}=t,c=new AbortController;try{let t=await fetch(`${n}/chat`,{method:`POST`,headers:{"Content-Type":`application/json`,...e.headers,...r.headers},body:JSON.stringify({...s,...e.body,...r.body}),signal:c.signal,credentials:`include`});if(!t.ok){let e=`An error occurred`;try{let n=await t.json(),r=n.error??n;e=JSON.stringify(r)??`An error occurred`}catch{try{let n=await t.text();n&&(e=n)}catch{}}throw Error(e)}let l=t.body?.getReader();if(!l)throw Error(`No reader available`);let u=new TextDecoder,d=``;for(;;){let{done:e,value:t}=await l.read();if(e)break;d+=u.decode(t,{stream:!0});let n=d.split(`
|
|
22
|
+
`);d=n.pop()??``;for(let e of n)if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));t.chunk&&i?.(t.chunk),t.action&&o?.(t.action),t.done&&t.response&&a?.(t.response)}catch(e){console.error(`Failed to parse SSE data:`,e)}}}catch(e){throw console.error(`Error in chat:`,e),e}},autocomplete:async(t,r={})=>await J(`${n}/autocomplete`,e,r,{method:`POST`,body:t}),getDiscussions:async(t,r={})=>await J(`${n}/discussions`,e,r,{method:`GET`,params:t}),getAIStats:async(t={})=>await J(`${n}/stats`,e,t,{method:`GET`})}},GC=(e={},t)=>{let n=`${t?.editor?.backendURL??m.backendURL}/api/dictionary`;return{getDictionaries:async(t,r={})=>await J(n,e,r,{cache:`no-store`,params:t}),getDictionariesKeys:async(t={})=>await J(`${n}/keys`,e,t,{cache:`no-store`}),getDictionariesUpdateTimestamp:async(t={})=>await J(`${n}/update`,e,t,{cache:`no-store`}),getDictionary:async(t,r,i={})=>await J(`${n}/${t}`,e,i,{params:r?{version:r.toString()}:void 0}),getDictionariesByKeys:async(t,r,i={})=>await J(`${n}/by-keys`,e,i,{cache:`no-store`,params:{keys:t.join(`,`),version:r?.toString()}}),pushDictionaries:async(t,r={})=>await J(`${n}`,e,r,{method:`PATCH`,body:{dictionaries:t}}),addDictionary:async(t,r={})=>await J(`${n}`,e,r,{method:`POST`,body:t}),updateDictionary:async(t,r={})=>await J(`${n}/${t.id}`,e,r,{method:`PUT`,body:t}),deleteDictionary:async(t,r={})=>await J(`${n}/${t}`,e,r,{method:`DELETE`})}},KC=(e={},t)=>{let n=`${t?.editor?.editorURL??m.editorURL}/api`;return{getDictionaries:async(t={})=>(await J(`${n}/dictionary`,e,t)).data,getConfiguration:async(t={})=>(await J(`${n}/config`,e,t)).data,writeDictionary:async(t,r={})=>await J(`${n}/dictionary`,e,r,{method:`POST`,body:t})}},qC=(e={},t)=>{let n=`${t?.editor?.backendURL??m.backendURL}/api/project`;return{getProjects:async(t,r={})=>await J(n,e,r,{cache:`no-store`,params:t}),getProjectInsights:async(t={})=>await J(`${n}/insights`,e,t,{cache:`no-store`,method:`GET`}),addProject:async(t,r={})=>await J(`${n}`,e,r,{method:`POST`,body:t}),updateProject:async(t,r={})=>await J(`${n}`,e,r,{method:`PUT`,body:t}),updateProjectMembers:async(t,r={})=>await J(`${n}/members`,e,r,{method:`PUT`,body:t}),pushProjectConfiguration:async(t,r={})=>await J(`${n}/configuration`,e,r,{method:`PUT`,body:t}),deleteProject:async(t={})=>await J(`${n}`,e,t,{method:`DELETE`}),deleteProjectByIdAdmin:async(t,r={})=>J(`${n}/${t}/admin`,e,r,{method:`DELETE`}),selectProject:async(t,r={})=>await J(`${n}/${String(t)}`,e,r,{method:`PUT`}),unselectProject:async(t={})=>await J(`${n}/logout`,e,t,{method:`POST`}),addNewAccessKey:async(t,r={})=>await J(`${n}/access_key`,e,r,{method:`POST`,body:t}),deleteAccessKey:async(t,r={})=>await J(`${n}/access_key`,e,r,{method:`DELETE`,body:{clientId:t}}),refreshAccessKey:async(t,r={})=>await J(`${n}/access_key`,e,r,{method:`PATCH`,body:{clientId:t}}),triggerBuild:async(t={})=>await J(`${n}/build`,e,t,{method:`POST`}),triggerWebhook:async(t,r={})=>await J(`${n}/webhook`,e,r,{method:`POST`,body:{webhookIndex:t}}),getCIConfig:async(t={})=>await J(`${n}/ci`,e,t,{method:`GET`}),pushCIConfig:async(t={})=>await J(`${n}/ci`,e,t,{method:`POST`}),updateMemberAccess:async(t,r,i={})=>await J(`${n}/member/${t}/access`,e,i,{method:`PUT`,body:r})}},JC=(e={},t)=>{let n=`${t?.editor?.backendURL??m.backendURL}/api/tag`;return{getTags:async(t,r={})=>await J(n,e,r,{cache:`no-store`,params:t}),addTag:async(t,r={})=>await J(`${n}`,e,r,{method:`POST`,body:t}),updateTag:async(t,r,i={})=>await J(`${n}/${t}`,e,i,{method:`PUT`,body:r}),deleteTag:async(t,r={})=>await J(`${n}/${t}`,e,r,{method:`DELETE`})}},YC=(0,v.createContext)(null),XC=({children:e,manager:t})=>(0,y.jsx)(YC.Provider,{value:t,children:e}),ZC=()=>(0,v.useContext)(YC),QC=(0,v.createContext)(void 0),$C=()=>{let e=(0,V.c)(16),t=ZC(),n=(0,v.useContext)(QC),[r,i]=(0,v.useState)(t?.focusedContent.value??n?.focusedContent??null),a;e[0]!==t||e[1]!==n?.focusedContent?(a=()=>{if(!t){i(n?.focusedContent??null);return}let e=e=>i(e.detail);return t.focusedContent.addEventListener(`change`,e),()=>t.focusedContent.removeEventListener(`change`,e)},e[0]=t,e[1]=n?.focusedContent,e[2]=a):a=e[2];let o=n?.focusedContent,s;e[3]!==t||e[4]!==o?(s=[t,o],e[3]=t,e[4]=o,e[5]=s):s=e[5],(0,v.useEffect)(a,s);let c;e[6]!==t||e[7]!==n?(c=e=>{n?n.setFocusedContent(e):t&&t.focusedContent.set(e)},e[6]=t,e[7]=n,e[8]=c):c=e[8];let l=c,u;e[9]!==t||e[10]!==n?(u=e=>{n?n.setFocusedContentKeyPath(e):t&&t.setFocusedContentKeyPath(e)},e[9]=t,e[10]=n,e[11]=u):u=e[11];let d=u,f;return e[12]!==r||e[13]!==l||e[14]!==d?(f={focusedContent:r,setFocusedContent:l,setFocusedContentKeyPath:d},e[12]=r,e[13]=l,e[14]=d,e[15]=f):f=e[15],f},ew=(e,t)=>{try{let n=new URL(e),r=new URL(t);if(n.protocol!==r.protocol||n.hostname!==r.hostname||n.port!==r.port)return!1;let i=n.pathname.replace(/\/$/,``),a=r.pathname.replace(/\/$/,``);return i===``||a===``||i===a}catch(n){return console.error(`Invalid URL(s)`,n,{url1:e,url2:t}),!1}},tw=function(e){return e.INTLAYER_CLIENT_READY=`INTLAYER_CLIENT_READY`,e.INTLAYER_ARE_YOU_THERE=`INTLAYER_ARE_YOU_THERE`,e.INTLAYER_EDITOR_ACTIVATE=`INTLAYER_EDITOR_ACTIVATE`,e.INTLAYER_EDITOR_ENABLED=`INTLAYER_EDITOR_ENABLED`,e.INTLAYER_CONFIGURATION=`INTLAYER_CONFIGURATION`,e.INTLAYER_CURRENT_LOCALE=`INTLAYER_CURRENT_LOCALE`,e.INTLAYER_URL_CHANGE=`INTLAYER_URL_CHANGE`,e.INTLAYER_LOCALE_DICTIONARIES_CHANGED=`INTLAYER_LOCALE_DICTIONARIES_CHANGED`,e.INTLAYER_DISTANT_DICTIONARIES_CHANGED=`INTLAYER_DISTANT_DICTIONARIES_CHANGED`,e.INTLAYER_HOVERED_CONTENT_CHANGED=`INTLAYER_HOVERED_CONTENT_CHANGED`,e.INTLAYER_FOCUSED_CONTENT_CHANGED=`INTLAYER_FOCUSED_CONTENT_CHANGED`,e.INTLAYER_EDITED_CONTENT_CHANGED=`INTLAYER_EDITED_CONTENT_CHANGED`,e.INTLAYER_IFRAME_CLICKED=`INTLAYER_IFRAME_CLICKED`,e.INTLAYER_DISPLAYED_DICTIONARY_KEYS=`INTLAYER_DISPLAYED_DICTIONARY_KEYS`,e}({}),nw=e=>{let t=new MouseEvent(`mousedown`,{bubbles:!0,cancelable:!0,view:window}),n=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window});Object.assign(n,{iframeData:e}),Object.assign(t,{iframeData:e}),window.dispatchEvent(n),window.dispatchEvent(t)},rw=`__intlayer_editor_manager__`,iw=`__intlayer_editor_manager_events__`,aw=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[iw]||(e[iw]=new EventTarget),e[iw]},ow=()=>typeof window>`u`?null:window[rw]??null,sw=e=>{if(typeof window<`u`){let t=window;t[rw]=e}aw().dispatchEvent(new CustomEvent(`change`,{detail:e}))},cw=e=>{let t=aw(),n=t=>{e(t.detail)};return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}},lw=typeof HTMLElement<`u`?HTMLElement:class{},uw=class extends lw{_keyPathJson=`[]`;_dictionaryKey=``;_editorEnabled=!1;_isInIframe=!1;_isSelected=!1;_editedValue=void 0;_renderState=null;_selector=null;_unsubManager=null;_unsubEnabled=null;_unsubFocused=null;_unsubEditedContent=null;static get observedAttributes(){return[`key-path`,`dictionary-key`]}get keyPathJson(){return this._keyPathJson}set keyPathJson(e){this._keyPathJson=e;let t=ow();t&&this._updateEditedValue(t)}get dictionaryKey(){return this._dictionaryKey}set dictionaryKey(e){this._dictionaryKey=e;let t=ow();t&&this._updateEditedValue(t)}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=`:host { display: contents; }`,e.appendChild(t)}attributeChangedCallback(e,t,n){if(e===`key-path`){this._keyPathJson=n??`[]`;let e=ow();e&&this._updateEditedValue(e)}else if(e===`dictionary-key`){this._dictionaryKey=n??``;let e=ow();e&&this._updateEditedValue(e)}}connectedCallback(){typeof window<`u`&&(this._isInIframe=window.self!==window.top),this._subscribeToManager(),this._render()}disconnectedCallback(){this._teardown()}_teardown(){this._unsubManager?.(),this._unsubEnabled?.(),this._unsubFocused?.(),this._unsubEditedContent?.(),this._unsubManager=null,this._unsubEnabled=null,this._unsubFocused=null,this._unsubEditedContent=null}_getRawKeyPath(){try{return JSON.parse(this._keyPathJson)}catch{return[]}}_getFilteredKeyPath(){return this._getRawKeyPath().filter(e=>e.type!==S)}_updateEditedValue(e){let t=this._getFilteredKeyPath();if(!this._dictionaryKey||t.length===0){this._editedValue=void 0,this._render();return}let n=this._getRawKeyPath(),r=n[n.length-1]?.type;if(r===`markdown`||r===`html`||r===`insertion`||r===`file`){this._editedValue=void 0,this._render();return}let i=e.getContentValue(this._dictionaryKey,t);if(typeof i==`object`&&i&&i.nodeType===`translation`){let t=e.currentLocale.value;i=t?i[S][t]:void 0}this._editedValue=i,this._render()}_updateIsSelected(e){if(!e){this._isSelected=!1,this._updateSelectorAttr();return}let t=this._getFilteredKeyPath(),n=this._isSelected;this._isSelected=e.dictionaryKey===this._dictionaryKey&&(e.keyPath?.length??0)>0&&Pt(e.keyPath??[],t),this._updateSelectorAttr(),this._isSelected&&!n&&this._scrollIntoViewIfNeeded()}_scrollIntoViewIfNeeded(){try{let e;if(this._selector){let t=this._selector.shadowRoot?.querySelector(`.wrapper`);if(t){let n=t.getBoundingClientRect();(n.width>0||n.height>0)&&(e=n)}}if(!e&&this.childNodes.length>0){let t=document.createRange();t.selectNodeContents(this);let n=t.getBoundingClientRect();(n.width>0||n.height>0)&&(e=n)}e||=this.getBoundingClientRect();let t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth;if(!(e.width>0&&e.height>0&&e.bottom>0&&e.right>0&&e.top<t&&e.left<n)){let n=window.scrollY??document.documentElement.scrollTop,r=e.top+n-t*.25;window.scrollTo({top:Math.max(0,r),behavior:`smooth`})}}catch{}}_updateSelectorAttr(){this._selector&&(this._isSelected?this._selector.setAttribute(`is-selecting`,``):this._selector.removeAttribute(`is-selecting`))}_subscribeToManager(){let e=ow();e&&this._setupManagerSubscriptions(e),this._unsubManager=cw(e=>{this._unsubEnabled?.(),this._unsubFocused?.(),this._unsubEditedContent?.(),this._unsubEnabled=null,this._unsubFocused=null,this._unsubEditedContent=null,e?this._setupManagerSubscriptions(e):(this._editorEnabled=!1,this._isSelected=!1,this._editedValue=void 0,this._render())})}_setupManagerSubscriptions(e){this._editorEnabled=e.editorEnabled.value??!1,this._updateIsSelected(e.focusedContent.value),this._updateEditedValue(e);let t=e=>{this._editorEnabled=e.detail,this._render()},n=e=>{this._updateIsSelected(e.detail)},r=()=>{this._updateEditedValue(e)};e.editorEnabled.addEventListener(`change`,t),e.focusedContent.addEventListener(`change`,n),e.editedContent.addEventListener(`change`,r),this._unsubEnabled=()=>e.editorEnabled.removeEventListener(`change`,t),this._unsubFocused=()=>e.focusedContent.removeEventListener(`change`,n),this._unsubEditedContent=()=>e.editedContent.removeEventListener(`change`,r)}_handlePress(e){e.stopPropagation();let t=ow();t&&t.focusedContent.set({dictionaryKey:this._dictionaryKey,keyPath:this._getFilteredKeyPath()})}_handleHover(e){e.stopPropagation(),ow()?.messenger.send(`INTLAYER_HOVERED_CONTENT_CHANGED/post`,{dictionaryKey:this._dictionaryKey,keyPath:this._getFilteredKeyPath()})}_handleUnhover(e){e.stopPropagation(),ow()?.messenger.send(`INTLAYER_HOVERED_CONTENT_CHANGED/post`,null)}_render(){let e=this._isInIframe&&this._editorEnabled,t=this._editedValue,n=e?typeof t==`string`||typeof t==`number`||typeof t==`boolean`?`wrapped-text`:`wrapped-slot`:`simple`;if(this._renderState!==n){this._rebuildContent(n);return}n!==`simple`&&this._selector&&(this._updateSelectorAttr(),n===`wrapped-text`&&this._selector.firstChild?.nodeType===Node.TEXT_NODE&&(this._selector.firstChild.data=String(t)))}_rebuildContent(e){let t=this.shadowRoot;for(;t.childNodes.length>1;)t.removeChild(t.lastChild);if(this._selector=null,e===`simple`)t.appendChild(document.createElement(`slot`));else{let n=document.createElement(`intlayer-content-selector`);this._selector=n,this._isSelected&&n.setAttribute(`is-selecting`,``),n.addEventListener(`intlayer:press`,e=>this._handlePress(e)),n.addEventListener(`intlayer:hover`,e=>this._handleHover(e)),n.addEventListener(`intlayer:unhover`,e=>this._handleUnhover(e)),e===`wrapped-text`?n.appendChild(document.createTextNode(String(this._editedValue))):n.appendChild(document.createElement(`slot`)),t.appendChild(n)}this._renderState=e}},dw=()=>{typeof customElements>`u`||customElements.get(`intlayer-content-selector-wrapper`)||customElements.define(`intlayer-content-selector-wrapper`,uw)},fw=typeof HTMLElement<`u`?HTMLElement:class{},pw=class extends fw{_dictionaryKey=``;_keyPathJson=`[]`;_locale=``;_editedText=null;_unsubManager=null;_unsubEditedContent=null;_selectorWrapper;_slot;static get observedAttributes(){return[`dictionary-key`,`key-path`,`locale`]}get dictionaryKey(){return this._dictionaryKey}set dictionaryKey(e){this._dictionaryKey=e,this._selectorWrapper.setAttribute(`dictionary-key`,e)}get keyPathJson(){return this._keyPathJson}set keyPathJson(e){this._keyPathJson=e,this._selectorWrapper.setAttribute(`key-path`,e)}get locale(){return this._locale}set locale(e){this._locale=e}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=`:host { display: contents; }`,e.appendChild(t),this._selectorWrapper=document.createElement(`intlayer-content-selector-wrapper`),this._slot=document.createElement(`slot`),this._selectorWrapper.appendChild(this._slot),e.appendChild(this._selectorWrapper)}attributeChangedCallback(e,t,n){let r=n??``;e===`dictionary-key`?(this._dictionaryKey=r,this._selectorWrapper.setAttribute(`dictionary-key`,r)):e===`key-path`?(this._keyPathJson=r||`[]`,this._selectorWrapper.setAttribute(`key-path`,this._keyPathJson)):e===`locale`&&(this._locale=r)}connectedCallback(){this._subscribeToManager()}disconnectedCallback(){this._teardown()}_teardown(){this._unsubManager?.(),this._unsubEditedContent?.(),this._unsubManager=null,this._unsubEditedContent=null}_getKeyPath(){try{return JSON.parse(this._keyPathJson)}catch{return[]}}_render(){for(;this._selectorWrapper.firstChild;)this._selectorWrapper.removeChild(this._selectorWrapper.firstChild);this._editedText===null?this._selectorWrapper.appendChild(this._slot):this._selectorWrapper.appendChild(document.createTextNode(this._editedText))}_resolveEditedText(e){let t=this._getKeyPath(),n=e.getContentValue(this._dictionaryKey,t);if(n==null){this._editedText=null,this._render();return}if(typeof n==`string`||typeof n==`number`){this._editedText=String(n),this._render();return}if(typeof n==`object`){let e=this._locale||void 0,r=st(n,{locale:e,dictionaryKey:this._dictionaryKey,keyPath:t},ot(e));typeof r==`string`||typeof r==`number`?this._editedText=String(r):(console.error(`[intlayer-edited-content] Incorrect edited content format. Expected string. Value: ${JSON.stringify(r)}`),this._editedText=null),this._render();return}this._editedText=null,this._render()}_setupManagerSubscriptions(e){this._resolveEditedText(e);let t=()=>this._resolveEditedText(e);e.editedContent.addEventListener(`change`,t),this._unsubEditedContent=()=>e.editedContent.removeEventListener(`change`,t)}_subscribeToManager(){let e=ow();e&&this._setupManagerSubscriptions(e),this._unsubManager=cw(e=>{this._unsubEditedContent?.(),this._unsubEditedContent=null,e?this._setupManagerSubscriptions(e):(this._editedText=null,this._render())})}},mw=()=>{typeof customElements>`u`||customElements.get(`intlayer-edited-content`)||customElements.define(`intlayer-edited-content`,pw)},hw=()=>Math.random().toString(36).slice(2),gw=class{senderId;_config;_subscribers=new Map;_windowHandler=null;_seenMessageIds=new Set;_warnedRejectedOrigins=new Set;constructor(e){this._config=e,this.senderId=hw()}start(){typeof window>`u`||this._windowHandler||(this._windowHandler=e=>{this._handleMessage(e)},window.addEventListener(`message`,this._windowHandler))}stop(){this._windowHandler&&=(window.removeEventListener(`message`,this._windowHandler),null)}send(e,t){let n={type:e,data:t,senderId:this.senderId,messageId:hw()};for(let e of this._config.allowedOrigins)e&&this._config.postMessageFn(n,e)}subscribe(e,t){return this._subscribers.has(e)||this._subscribers.set(e,new Set),this._subscribers.get(e).add(t),()=>{this._subscribers.get(e)?.delete(t)}}_handleMessage(e){let t=e.data;if(!t||typeof t!=`object`)return;let{type:n,data:r,senderId:i,messageId:a}=t;if(!n||typeof n!=`string`||i===this.senderId)return;if(a){if(this._seenMessageIds.has(a))return;this._seenMessageIds.add(a),this._seenMessageIds.size>200&&this._seenMessageIds.clear()}let{allowedOrigins:o}=this._config;if(!(!o||o.length===0||o.includes(`*`)||o.filter(e=>!!e&&e!==``).some(t=>ew(t,e.origin)))){n.startsWith(`INTLAYER`)&&!this._warnedRejectedOrigins.has(e.origin)&&(this._warnedRejectedOrigins.add(e.origin),console.warn(`[intlayer] Ignored editor message "${n}" from origin "${e.origin}" — not in allowed origins [${o.join(`, `)}]. Check the editor.editorURL / editor.cmsURL configuration.`));return}let s=this._subscribers.get(n);if(s)for(let e of s)e(r,i)}},_w=class extends EventTarget{_value;_key;_messenger;_options;_unsubscribers=[];constructor(e,t,n={}){super(),this._key=e,this._messenger=t,this._options={emit:n.emit??!0,receive:n.receive??!0},n.initialValue!==void 0&&(this._value=n.initialValue)}get value(){return this._value}set(e){let t=typeof e==`function`?e(this._value):e;this._value=t,this.dispatchEvent(new CustomEvent(`change`,{detail:t})),this._options.emit&&this._messenger.send(`${this._key}/post`,t)}start(){if(this._options.receive){let e=this._messenger.subscribe(`${this._key}/post`,e=>{this._value=e,this.dispatchEvent(new CustomEvent(`change`,{detail:e}))});this._unsubscribers.push(e)}if(this._options.emit){let e=this._messenger.subscribe(`${this._key}/get`,(e,t)=>{t!==this._messenger.senderId&&this._value!==void 0&&this._messenger.send(`${this._key}/post`,this._value)});this._unsubscribers.push(e)}this._options.receive&&this._value===void 0&&this._messenger.send(`${this._key}/get`)}stop(){for(let e of this._unsubscribers)e();this._unsubscribers.length=0}postCurrentValue(){this._value!==void 0&&this._messenger.send(`${this._key}/post`,this._value)}},vw=`__intlayer_edited_content_bus__`,yw=`__intlayer_edited_content_bus_events__`,bw=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[yw]||(e[yw]=new EventTarget),e[yw]},xw=()=>typeof window>`u`?{}:window[vw]??{},Sw=(e,t)=>{typeof window<`u`&&(window[vw]=e),bw().dispatchEvent(new CustomEvent(`change`,{detail:{content:e,sourceId:t}}))},Cw=e=>{let t=t=>{let{content:n,sourceId:r}=t.detail;e(n,r)},n=bw();return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},ww=`__intlayer_focused_content_bus__`,Tw=`__intlayer_focused_content_bus_events__`,Ew=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[Tw]||(e[Tw]=new EventTarget),e[Tw]},Dw=()=>{if(typeof window>`u`)return;let e=window;if(e.__intlayer_focused_content_bus_set__)return e[ww]??null},Ow=(e,t)=>{if(typeof window<`u`){let t=window;t[ww]=e,t.__intlayer_focused_content_bus_set__=!0}Ew().dispatchEvent(new CustomEvent(`change`,{detail:{content:e,sourceId:t}}))},kw=e=>{let t=t=>{let{content:n,sourceId:r}=t.detail;e(n,r)},n=Ew();return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},Aw=class{_messenger;_mousedownHandler=null;_unsubscribeMerge=null;constructor(e){this._messenger=e}startInterceptor(){typeof window>`u`||(this._mousedownHandler=()=>{this._messenger.send(`INTLAYER_IFRAME_CLICKED`)},window.addEventListener(`mousedown`,this._mousedownHandler))}startMerger(){this._unsubscribeMerge=this._messenger.subscribe(`INTLAYER_IFRAME_CLICKED`,nw)}stopInterceptor(){this._mousedownHandler&&=(window.removeEventListener(`mousedown`,this._mousedownHandler),null)}stopMerger(){this._unsubscribeMerge?.(),this._unsubscribeMerge=null}},jw=class{_messenger;_originalPushState=null;_originalReplaceState=null;_listeners=[];constructor(e){this._messenger=e}start(){if(typeof window>`u`)return;let e=()=>{this._messenger.send(`INTLAYER_URL_CHANGE/post`,window.location.pathname)};this._originalPushState=history.pushState,this._originalReplaceState=history.replaceState;let t=e=>function(...t){e.apply(this,t),window.dispatchEvent(new Event(`locationchange`))};history.pushState=t(this._originalPushState),history.replaceState=t(this._originalReplaceState);for(let t of[`locationchange`,`popstate`,`hashchange`,`load`]){let n=e;window.addEventListener(t,n),this._listeners.push([t,n])}e()}stop(){if(!(typeof window>`u`)){for(let[e,t]of this._listeners)window.removeEventListener(e,t);this._listeners=[],this._originalPushState&&=(history.pushState=this._originalPushState,null),this._originalReplaceState&&=(history.replaceState=this._originalReplaceState,null)}}},Mw=class{messenger;editorEnabled;focusedContent;localeDictionaries;editedContent;configuration;currentLocale;displayedDictionaryKeys;_urlManager;_iframeInterceptor;_mode;_configuration;_unsubAreYouThere=null;_unsubActivate=null;_unsubClientReady=null;_displayedKeysObserver=null;_displayedKeysTimer=null;_displayedKeysListeners=[];_editedContentFromBus=!1;_unsubGlobalEditedContent=null;_editedContentBusHandler=null;_focusedContentFromBus=!1;_unsubGlobalFocusedContent=null;_focusedContentBusHandler=null;constructor(e){this._mode=e.mode,this._configuration=e.configuration,this.messenger=new gw(e.messenger),this.editorEnabled=new _w(`INTLAYER_EDITOR_ENABLED`,this.messenger,{emit:!1,receive:!0,initialValue:!1}),this.focusedContent=new _w(`INTLAYER_FOCUSED_CONTENT_CHANGED`,this.messenger,{emit:!0,receive:!0,initialValue:null}),this.localeDictionaries=new _w(`INTLAYER_LOCALE_DICTIONARIES_CHANGED`,this.messenger),this.editedContent=new _w(`INTLAYER_EDITED_CONTENT_CHANGED`,this.messenger),this.configuration=new _w(`INTLAYER_CONFIGURATION`,this.messenger,{emit:!0,receive:!1,...e.configuration?{initialValue:e.configuration}:{}}),this.currentLocale=new _w(`INTLAYER_CURRENT_LOCALE`,this.messenger,{emit:e.mode===`client`,receive:e.mode===`editor`}),this.displayedDictionaryKeys=new _w(`INTLAYER_DISPLAYED_DICTIONARY_KEYS`,this.messenger,{emit:e.mode===`client`,receive:e.mode===`editor`,initialValue:[]}),this._urlManager=new jw(this.messenger),this._iframeInterceptor=new Aw(this.messenger)}start(){this.messenger.start(),this.editorEnabled.start(),this.focusedContent.start(),this.localeDictionaries.start(),this.editedContent.start(),this.configuration.start(),this.currentLocale.start(),this.displayedDictionaryKeys.start(),this._startEditedContentBusSync(),this._startFocusedContentBusSync(),this._mode===`client`?(this._urlManager.start(),this._iframeInterceptor.startInterceptor(),this._loadDictionaries(),this._startDisplayedDictionariesTracking(),this.messenger.send(`INTLAYER_EDITED_CONTENT_CHANGED/get`),this._configuration?.editor?.enabled!==!1&&this._setupActivationHandshake()):(this._iframeInterceptor.startMerger(),this._setupEditorHandshake())}stop(){this._unsubAreYouThere?.(),this._unsubActivate?.(),this._unsubClientReady?.(),this._unsubAreYouThere=null,this._unsubActivate=null,this._unsubClientReady=null,this.messenger.stop(),this.editorEnabled.stop(),this.focusedContent.stop(),this.localeDictionaries.stop(),this.editedContent.stop(),this.configuration.stop(),this.currentLocale.stop(),this.displayedDictionaryKeys.stop(),this._stopDisplayedDictionariesTracking(),this._stopEditedContentBusSync(),this._stopFocusedContentBusSync(),this._urlManager.stop(),this._iframeInterceptor.stopInterceptor(),this._iframeInterceptor.stopMerger()}pingClient(){this._mode===`editor`&&this.messenger.send(`INTLAYER_ARE_YOU_THERE`)}setFocusedContentKeyPath(e){let t=e.filter(e=>e.type!==S),n=this.focusedContent.value;n&&this.focusedContent.set({...n,keyPath:t})}setLocaleDictionary(e){if(!e.localId)return;let t=this.localeDictionaries.value??{};this.localeDictionaries.set({...t,[e.localId]:e})}setEditedDictionary(e){if(!e.localId){console.error(`setEditedDictionary: missing localId`,e);return}let t=this.editedContent.value??{};this.editedContent.set({...t,[e.localId]:e})}setEditedContent(e,t){let n=this.editedContent.value??{};this.editedContent.set({...n,[e]:{...n[e],content:t}})}addContent(e,t,n=[],r=!0){let i=this.editedContent.value??{},a=(this.localeDictionaries.value??{})[e]?.content,o=structuredClone(i[e]?.content??a),s=n;if(!r){let e=0,t=n.slice(0,-1),r=n[n.length-1],i=r.key;for(;en(o,s)!==void 0;)e++,i=e===0?r.key:`${r.key} (${e})`,s=[...t,{...r,key:i}]}let c=$t(o,s,t);this.editedContent.set({...i,[e]:{...i[e],content:c}})}renameContent(e,t,n=[]){let r=this.editedContent.value??{},i=(this.localeDictionaries.value??{})[e]?.content,a=ln(structuredClone(r[e]?.content??i),t,n);this.editedContent.set({...r,[e]:{...r[e],content:a}})}removeContent(e,t){let n=this.editedContent.value??{},r=(this.localeDictionaries.value??{})[e]?.content,i=$t(structuredClone(n[e]?.content??r),t,en(r,t));this.editedContent.set({...n,[e]:{...n[e],content:i}})}restoreContent(e){let t={...this.editedContent.value??{}};delete t[e],this.editedContent.set(t)}clearContent(e){let t={...this.editedContent.value??{}};delete t[e],this.editedContent.set(t)}clearAllContent(){this.editedContent.set({})}getContentValue(e,t){let n=this.editedContent.value;if(!n)return;let r=t.filter(e=>e.type!==S),i=this.localeDictionaries.value;if(e.includes(`:local:`)||e.includes(`:remote:`))return i&&!(e in i)?void 0:en(n[e]?.content??{},r,this.currentLocale.value);let a=Object.keys(n).filter(t=>t.startsWith(`${e}:`)&&(!i||t in i));for(let e of a){let t=en(n[e]?.content??{},r,this.currentLocale.value);if(t)return t}}_startEditedContentBusSync(){this._editedContentBusHandler=e=>{if(this._editedContentFromBus)return;let t=e.detail;Sw(t,this.messenger.senderId)},this.editedContent.addEventListener(`change`,this._editedContentBusHandler),this._unsubGlobalEditedContent=Cw((e,t)=>{t!==this.messenger.senderId&&(this._editedContentFromBus=!0,this.editedContent.set(e),this._editedContentFromBus=!1)});let e=xw();Object.keys(e).length>0&&(this._editedContentFromBus=!0,this.editedContent.set(e),this._editedContentFromBus=!1)}_stopEditedContentBusSync(){this._editedContentBusHandler&&=(this.editedContent.removeEventListener(`change`,this._editedContentBusHandler),null),this._unsubGlobalEditedContent?.(),this._unsubGlobalEditedContent=null}_startFocusedContentBusSync(){this._focusedContentBusHandler=e=>{if(this._focusedContentFromBus)return;let t=e.detail;Ow(t,this.messenger.senderId)},this.focusedContent.addEventListener(`change`,this._focusedContentBusHandler),this._unsubGlobalFocusedContent=kw((e,t)=>{t!==this.messenger.senderId&&(this._focusedContentFromBus=!0,this.focusedContent.set(e),this._focusedContentFromBus=!1)});let e=Dw();e!==void 0&&(this._focusedContentFromBus=!0,this.focusedContent.set(e),this._focusedContentFromBus=!1)}_stopFocusedContentBusSync(){this._focusedContentBusHandler&&=(this.focusedContent.removeEventListener(`change`,this._focusedContentBusHandler),null),this._unsubGlobalFocusedContent?.(),this._unsubGlobalFocusedContent=null}_scanDisplayedDictionaryKeys(){if(typeof document>`u`)return;let e=document.querySelectorAll(`intlayer-content-selector-wrapper[dictionary-key]`),t=Array.from(new Set(Array.from(e).map(e=>e.getAttribute(`dictionary-key`)??``).filter(Boolean)));this.displayedDictionaryKeys.set(t)}_startDisplayedDictionariesTracking(){if(typeof document>`u`||typeof MutationObserver>`u`)return;let e=()=>{this._displayedKeysTimer&&clearTimeout(this._displayedKeysTimer),this._displayedKeysTimer=setTimeout(()=>this._scanDisplayedDictionaryKeys(),100)};this._displayedKeysObserver=new MutationObserver(e),this._displayedKeysObserver.observe(document.body,{childList:!0,subtree:!0});for(let t of[`locationchange`,`popstate`]){let n=e;window.addEventListener(t,n),this._displayedKeysListeners.push([t,n])}this._scanDisplayedDictionaryKeys()}_stopDisplayedDictionariesTracking(){this._displayedKeysObserver?.disconnect(),this._displayedKeysObserver=null,this._displayedKeysTimer&&=(clearTimeout(this._displayedKeysTimer),null);for(let[e,t]of this._displayedKeysListeners)window.removeEventListener(e,t);this._displayedKeysListeners=[]}_setupEditorHandshake(){this._unsubClientReady=this.messenger.subscribe(`INTLAYER_CLIENT_READY`,()=>{this.editorEnabled.set(!0),this.messenger.send(`INTLAYER_EDITOR_ACTIVATE`)}),this.messenger.send(`INTLAYER_ARE_YOU_THERE`)}_setupActivationHandshake(){this.messenger.send(`INTLAYER_CLIENT_READY`),this._unsubAreYouThere=this.messenger.subscribe(`INTLAYER_ARE_YOU_THERE`,()=>{this.messenger.send(`INTLAYER_CLIENT_READY`)}),this._unsubActivate=this.messenger.subscribe(`INTLAYER_EDITOR_ACTIVATE`,()=>{this.editorEnabled.set(!0),this._broadcastData()})}_broadcastData(){let e=this.configuration.value;e&&this.messenger.send(`INTLAYER_CONFIGURATION/post`,e);let t=this.currentLocale.value;t&&this.messenger.send(`INTLAYER_CURRENT_LOCALE/post`,t);let n=this.localeDictionaries.value;n&&this.messenger.send(`INTLAYER_LOCALE_DICTIONARIES_CHANGED/post`,n)}async _loadDictionaries(){try{let e=(await ht(async()=>{let{getUnmergedDictionaries:e}=await import(`./unmerged_dictionaries-DWe4YFkq.js`);return{getUnmergedDictionaries:e}},[])).getUnmergedDictionaries(),t=Object.fromEntries(Object.values(e).flat().map(e=>[e.localId,e]));this.localeDictionaries.set(t),this.editorEnabled.value&&this._broadcastData()}catch(e){console.warn(`[intlayer] Failed to load unmerged dictionaries:`,e)}}},Nw=typeof HTMLElement<`u`?HTMLElement:class{},Pw=class extends Nw{_configuration=void 0;_locale=void 0;_initialized=!1;_unsubManager=null;static get observedAttributes(){return[`locale`]}get configuration(){return this._configuration}set configuration(e){this._configuration=e,this._initialized||this._init()}get locale(){return this._locale}set locale(e){this._locale=e,e&&this._initialized&&this._syncLocale(e)}attributeChangedCallback(e,t,n){e===`locale`&&n!==null&&(this._locale=n,this._initialized&&this._syncLocale(n))}connectedCallback(){this._init()}disconnectedCallback(){this._unsubManager?.(),this._unsubManager=null,this._initialized&&=(Ww(),!1)}_init(){this._initialized||(Uw(),this._initialized=!0,this._locale&&this._syncLocale(this._locale))}_syncLocale(e){let t=ow();t?t.currentLocale.set(e):(this._unsubManager?.(),this._unsubManager=cw(t=>{t&&(this._unsubManager?.(),this._unsubManager=null,t.currentLocale.set(e))}))}},Fw=()=>{typeof customElements>`u`||customElements.get(`intlayer-editor`)||customElements.define(`intlayer-editor`,Pw)},Iw=250,Lw=`
|
|
23
|
+
:host {
|
|
24
|
+
display: contents;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.wrapper {
|
|
28
|
+
display: inline-block;
|
|
29
|
+
cursor: pointer;
|
|
30
|
+
user-select: none;
|
|
31
|
+
border-radius: 0.375rem;
|
|
32
|
+
outline-width: 2px;
|
|
33
|
+
outline-offset: 4px;
|
|
34
|
+
outline-style: solid;
|
|
35
|
+
outline-color: transparent;
|
|
36
|
+
transition: all 100ms 50ms ease-in-out;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.wrapper[data-active] {
|
|
40
|
+
outline-color: inherit;
|
|
41
|
+
}
|
|
42
|
+
`,Rw=typeof HTMLElement<`u`?HTMLElement:class{},zw=class extends Rw{_isSelecting=!1;_pressDuration=Iw;_isHovered=!1;_isSelectingState=!1;_wrapper;_pressTimer=null;_clickOutsideHandler=null;static get observedAttributes(){return[`is-selecting`,`press-duration`]}get isSelecting(){return this._isSelecting}set isSelecting(e){this._isSelecting=e,this._updateActiveState()}get pressDuration(){return this._pressDuration}set pressDuration(e){this._pressDuration=e}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=Lw,e.appendChild(t);let n=document.createElement(`span`);n.className=`wrapper`,n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.appendChild(document.createElement(`slot`)),e.appendChild(n),this._wrapper=n,n.addEventListener(`mousedown`,()=>this._handleMouseDown()),n.addEventListener(`mouseup`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`mouseleave`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`mouseenter`,()=>this._handleMouseEnter()),n.addEventListener(`click`,e=>this._handleClick(e)),n.addEventListener(`touchstart`,()=>this._handleMouseDown()),n.addEventListener(`touchend`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`touchcancel`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`blur`,()=>this._handleBlur())}attributeChangedCallback(e,t,n){e===`is-selecting`?(this._isSelecting=n!==null,this._updateActiveState()):e===`press-duration`&&(this._pressDuration=n===null?Iw:parseInt(n,10))}connectedCallback(){this._clickOutsideHandler=e=>{e.composedPath().includes(this)||(this._isSelectingState=!1,this._dispatch(`intlayer:click-outside`),this._updateActiveState())},document.addEventListener(`mousedown`,this._clickOutsideHandler)}disconnectedCallback(){this._clickOutsideHandler&&=(document.removeEventListener(`mousedown`,this._clickOutsideHandler),null),this._clearPressTimer()}_updateActiveState(){this._isSelecting||this._isSelectingState||this._isHovered?this._wrapper.setAttribute(`data-active`,``):this._wrapper.removeAttribute(`data-active`)}_clearPressTimer(){this._pressTimer!==null&&(clearTimeout(this._pressTimer),this._pressTimer=null)}_dispatch(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}_handleMouseDown(){this._clearPressTimer(),this._pressTimer=setTimeout(()=>{this._isSelectingState=!0,this._updateActiveState(),this._dispatch(`intlayer:press`)},this._pressDuration)}_handleMouseEnter(){this._isHovered=!0,this._updateActiveState(),this._dispatch(`intlayer:hover`)}_handleMouseUpOrLeave(){this._isHovered&&(this._isHovered=!1,this._dispatch(`intlayer:unhover`)),this._clearPressTimer(),this._updateActiveState()}_handleClick(e){(this._isSelecting||this._isSelectingState)&&(e.preventDefault(),e.stopPropagation())}_handleBlur(){this._isSelectingState=!1,this._updateActiveState()}},Bw=()=>{typeof customElements>`u`||(customElements.get(`intlayer-content-selector`)||customElements.define(`intlayer-content-selector`,zw),dw(),mw(),Fw())},Vw=()=>{let e=typeof window<`u`?window.location.origin:void 0;return{allowedOrigins:[...new Set([m?.editorURL,m?.cmsURL,e].filter(Boolean))],postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&window.parent?.postMessage(e,t)}}},Hw=0,Uw=()=>{Hw++;let e=ow();if(e)return e;let t=new Mw({mode:`client`,messenger:Vw(),configuration:{editor:m}});return sw(t),Bw(),t.start(),t},Ww=()=>{Hw=Math.max(0,Hw-1),!(Hw>0)&&(ow()?.stop(),sw(null))},Gw=(e,t,n)=>{let r=ZC(),i=typeof t==`function`?t():t,[a,o]=(0,v.useState)(i),s=(0,v.useRef)(i),c=(0,v.useRef)(null);return(0,v.useEffect)(()=>{let{emit:t=!0,receive:a=!0}=n??{},l=new _w(e,r?.messenger,{emit:t,receive:a,initialValue:i});c.current=l;let u=e=>{let t=e.detail;s.current=t,o(t)};return l.addEventListener(`change`,u),l.start(),()=>{l.removeEventListener(`change`,u),l.stop(),c.current=null}},[e,r?.messenger,n?.emit,n?.receive]),[a,e=>{o(t=>{let n=typeof e==`function`?e(t):e;return s.current=n,c.current?.set(n),n})},()=>{c.current?.postCurrentValue()}]},Kw=(e,t)=>Gw(tw.INTLAYER_URL_CHANGE,e,t),qw=()=>{let e=(0,V.c)(13),t=ZC(),n;e[0]===t?.localeDictionaries.value?n=e[1]:(n=t?.localeDictionaries.value??{},e[0]=t?.localeDictionaries.value,e[1]=n);let[r,i]=(0,v.useState)(n),a,o;e[2]===t?(a=e[3],o=e[4]):(a=()=>{if(!t)return;let e=e=>i(e.detail??{});return t.localeDictionaries.addEventListener(`change`,e),()=>t.localeDictionaries.removeEventListener(`change`,e)},o=[t],e[2]=t,e[3]=a,e[4]=o),(0,v.useEffect)(a,o);let s;e[5]===t?.localeDictionaries?s=e[6]:(s=e=>t?.localeDictionaries.set(e),e[5]=t?.localeDictionaries,e[6]=s);let c=s,l;e[7]===t?l=e[8]:(l=e=>t?.setLocaleDictionary(e),e[7]=t,e[8]=l);let u=l,d;return e[9]!==r||e[10]!==c||e[11]!==u?(d={localeDictionaries:r,setLocaleDictionaries:c,setLocaleDictionary:u},e[9]=r,e[10]=c,e[11]=u,e[12]=d):d=e[12],d},Jw=()=>{let e=(0,V.c)(3),{setLocaleDictionaries:t,setLocaleDictionary:n}=qw(),r;return e[0]!==t||e[1]!==n?(r={setLocaleDictionaries:t,setLocaleDictionary:n},e[0]=t,e[1]=n,e[2]=r):r=e[2],r},Yw=()=>{let e=(0,V.c)(3),t=ZC(),[n,r]=(0,v.useState)(t?.currentLocale.value),i,a;return e[0]===t?(i=e[1],a=e[2]):(i=()=>{if(!t)return;let e=e=>r(e.detail);return t.currentLocale.addEventListener(`change`,e),()=>t.currentLocale.removeEventListener(`change`,e)},a=[t],e[0]=t,e[1]=i,e[2]=a),(0,v.useEffect)(i,a),n},Xw=(e,t,n)=>{for(let r of t)try{if(en(r.content,e??[],n))return{keyPath:e,dictionaryLocalId:r.localId}}catch{}},Zw=()=>{let e=(0,V.c)(12),{localeDictionaries:t}=qw(),n=Yw(),{setFocusedContent:r,setFocusedContentKeyPath:i,focusedContent:a}=$C(),o;bb0:{if(!a){o=a;break bb0}if(!t){o=a;break bb0}if(a.dictionaryLocalId){o=a;break bb0}let r;if(e[0]!==n||e[1]!==t||e[2]!==a.dictionaryKey||e[3]!==a.keyPath){let i=Object.values(t).filter(e=>e.key===a.dictionaryKey);r=Xw(a.keyPath??[],i,n),e[0]=n,e[1]=t,e[2]=a.dictionaryKey,e[3]=a.keyPath,e[4]=r}else r=e[4];let i=r,s;e[5]!==a||e[6]!==i?(s={...a,...i},e[5]=a,e[6]=i,e[7]=s):s=e[7],o=s}let s;return e[8]!==r||e[9]!==i||e[10]!==o?(s={focusedContent:o,setFocusedContent:r,setFocusedContentKeyPath:i},e[8]=r,e[9]=i,e[10]=o,e[11]=s):s=e[11],s},Qw=({children:e,configuration:t,postMessage:n,allowedOrigins:r})=>{let i=(0,v.useRef)(null);i.current||=new Mw({mode:`editor`,messenger:{allowedOrigins:r,postMessageFn:n},configuration:t});let a=i.current;return(0,v.useEffect)(()=>(Bw(),sw(a),a.start(),()=>{a.stop(),sw(null)}),[a]),(0,v.useEffect)(()=>{!a||!t||Object.keys(t).length===0||a.configuration.set(t)},[a,t]),(0,y.jsx)(XC,{manager:a,children:e})},$w=(0,v.createContext)(void 0),eT=()=>{let e=(0,V.c)(4),t=ZC(),n=(0,v.useContext)($w),[r,i]=(0,v.useState)(t?.configuration.value??n),a,o;return e[0]!==t||e[1]!==n?(a=()=>{if(!t){i(n);return}let e=e=>{let t=e.detail;i(t??n)};return t.configuration.addEventListener(`change`,e),()=>t.configuration.removeEventListener(`change`,e)},o=[t,n],e[0]=t,e[1]=n,e[2]=a,e[3]=o):(a=e[2],o=e[3]),(0,v.useEffect)(a,o),r??n},tT=()=>{let e=(0,V.c)(23),t=ZC(),n;e[0]===t?.editedContent?n=e[1]:(n=e=>t?.editedContent.set(e),e[0]=t?.editedContent,e[1]=n);let r,i,a,o,s,c,l,u,d;e[2]===t?(r=e[3],i=e[4],a=e[5],o=e[6],s=e[7],c=e[8],l=e[9],u=e[10],d=e[11]):(r=e=>t?.setEditedDictionary(e),i=(e,n)=>t?.setEditedContent(e,n),a=(e,n,r,i)=>t?.addContent(e,n,r,i),o=(e,n,r)=>t?.renameContent(e,n,r),s=(e,n)=>t?.removeContent(e,n),c=e=>t?.restoreContent(e),l=e=>t?.clearContent(e),u=()=>t?.clearAllContent(),d=(e,n)=>t?.getContentValue(e,n),e[2]=t,e[3]=r,e[4]=i,e[5]=a,e[6]=o,e[7]=s,e[8]=c,e[9]=l,e[10]=u,e[11]=d);let f;return e[12]!==n||e[13]!==r||e[14]!==i||e[15]!==a||e[16]!==o||e[17]!==s||e[18]!==c||e[19]!==l||e[20]!==u||e[21]!==d?(f={setEditedContentState:n,setEditedDictionary:r,setEditedContent:i,addEditedContent:a,renameEditedContent:o,removeEditedContent:s,restoreEditedContent:c,clearEditedDictionaryContent:l,clearEditedContent:u,getEditedContentValue:d},e[12]=n,e[13]=r,e[14]=i,e[15]=a,e[16]=o,e[17]=s,e[18]=c,e[19]=l,e[20]=u,e[21]=d,e[22]=f):f=e[22],f},nT=()=>{let e=(0,V.c)(6),t=ZC(),[n,r]=(0,v.useState)(t?.editedContent.value),i,a;e[0]===t?(i=e[1],a=e[2]):(i=()=>{if(!t)return;let e=e=>r(e.detail);return t.editedContent.addEventListener(`change`,e),()=>t.editedContent.removeEventListener(`change`,e)},a=[t],e[0]=t,e[1]=i,e[2]=a),(0,v.useEffect)(i,a);let o=tT(),s;return e[3]!==n||e[4]!==o?(s={editedContent:n,...o},e[3]=n,e[4]=o,e[5]=s):s=e[5],s},rT=()=>{let e=(0,V.c)(5),t=ZC(),[n,r]=(0,v.useState)(t?.editorEnabled.value??!1),i,a;e[0]===t?(i=e[1],a=e[2]):(i=()=>{if(!t)return;let e=e=>r(e.detail);return t.editorEnabled.addEventListener(`change`,e),()=>t.editorEnabled.removeEventListener(`change`,e)},a=[t],e[0]=t,e[1]=i,e[2]=a),(0,v.useEffect)(i,a);let o;return e[3]===n?o=e[4]:(o={enabled:n},e[3]=n,e[4]=o),o},iT=()=>{let e=(0,V.c)(2),t=ZC(),n;return e[0]===t?n=e[1]:(n=()=>t?.pingClient(),e[0]=t,e[1]=n),n},aT=(e,t,n)=>{let r=(0,V.c)(11),i=ZC(),a;r[0]!==e||r[1]!==i?.messenger||r[2]!==t?(a=()=>{if(t)return i?.messenger.subscribe(e,t)},r[0]=e,r[1]=i?.messenger,r[2]=t,r[3]=a):a=r[3];let o;r[4]!==e||r[5]!==i||r[6]!==n?(o=[i,e,n],r[4]=e,r[5]=i,r[6]=n,r[7]=o):o=r[7],(0,v.useEffect)(a,o);let s;return r[8]!==e||r[9]!==i?.messenger?(s=t=>{i?.messenger.send(e,t)},r[8]=e,r[9]=i?.messenger,r[10]=s):s=r[10],s},oT=()=>{aT(tw.INTLAYER_IFRAME_CLICKED,nw)},sT=e=>{let t=(0,V.c)(10),n=eT(),r,i;t[0]!==n||t[1]!==e?(r=UC(e,n,{editor:m}),i=zC(void 0,r),t[0]=n,t[1]=e,t[2]=r,t[3]=i):(r=t[2],i=t[3]);let a=i,o=aa(),s;t[4]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`oAuth2AccessToken`],t[4]=s):s=t[4];let c=!!(r.editor.clientId&&r.editor.clientSecret)&&o,l;t[5]!==a.getOAuth2AccessToken||t[6]!==c?(l={queryKey:s,queryFn:a.getOAuth2AccessToken,enabled:c,staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1},t[5]=a.getOAuth2AccessToken,t[6]=c,t[7]=l):l=t[7];let{data:u}=is(l),d=u?.data,f;return t[8]===d?f=t[9]:(f={oAuth2AccessToken:d},t[8]=d,t[9]=f),f};function cT(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}var lT=cT({CHALLENGE_NOT_FOUND:`Challenge not found`,YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:`You are not allowed to register this passkey`,FAILED_TO_VERIFY_REGISTRATION:`Failed to verify registration`,PASSKEY_NOT_FOUND:`Passkey not found`,AUTHENTICATION_FAILED:`Authentication failed`,UNABLE_TO_CREATE_SESSION:`Unable to create session`,FAILED_TO_UPDATE_PASSKEY:`Failed to update passkey`,PREVIOUSLY_REGISTERED:`Previously registered`,REGISTRATION_CANCELLED:`Registration cancelled`,AUTH_CANCELLED:`Auth cancelled`,UNKNOWN_ERROR:`Unknown error`,SESSION_REQUIRED:`Passkey registration requires an authenticated session`,RESOLVE_USER_REQUIRED:`Passkey registration requires either an authenticated session or a resolveUser callback when requireSession is false`,RESOLVED_USER_INVALID:`Resolved user is invalid`}),uT=`1.6.27`;function dT(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function fT(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function pT(){return mT.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var mT={stubThis:e=>e};function hT(e){let{id:t}=e;return{...e,id:fT(t),transports:e.transports}}function gT(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var _T=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function vT({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new _T({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new _T({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new _T({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new _T({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new _T({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new _T({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new _T({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new _T({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!gT(t))return new _T({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new _T({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new _T({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new _T({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var yT=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},bT=[`cross-platform`,`platform`];function xT(e){if(e&&!(bT.indexOf(e)<0))return e}async function ST(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!pT())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:fT(t.challenge),user:{...t.user,id:fT(t.user.id)},excludeCredentials:t.excludeCredentials?.map(hT)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=yT.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw vT({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){CT(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=dT(e))}catch(e){CT(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=dT(c.getAuthenticatorData())}catch(e){CT(`getAuthenticatorData()`,e)}return{id:o,rawId:dT(s),response:{attestationObject:dT(c.attestationObject),clientDataJSON:dT(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:xT(a.authenticatorAttachment)}}function CT(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function wT(){if(!pT())return TT.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?TT.stubThis(new Promise(e=>e(!1))):TT.stubThis(e.isConditionalMediationAvailable())}var TT={stubThis:e=>e};function ET({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new _T({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new _T({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!gT(t))return new _T({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new _T({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new _T({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function DT(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!pT())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(hT));let a={...t,challenge:fT(t.challenge),allowCredentials:i},o={};if(n){if(!await wT())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=yT.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw ET({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=dT(u.userHandle)),{id:c,rawId:dT(l),response:{authenticatorData:dT(u.authenticatorData),clientDataJSON:dT(u.clientDataJSON),signature:dT(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:xT(s.authenticatorAttachment)}}var OT=`1.6.27`,kT=Symbol.for(`better-auth:broadcast-channel`),AT=()=>Math.floor(Date.now()/1e3),jT=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:AT()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event!==`session`||!t?.data||this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function MT(e=`better-auth.message`){return globalThis[kT]||(globalThis[kT]=new jT(e)),globalThis[kT]}var NT=[],PT=0,FT=null,IT=4,LT=globalThis.nanostoresGlobal||={epoch:0},RT=()=>{for(PT=0;PT<NT.length;PT+=IT)NT[PT](NT[PT+1].value,NT[PT+2],NT[PT+3]);NT.length=0},zT=e=>{let t=[],n={get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=PT+IT;t<NT.length;)NT[t]===e?NT.splice(t,IT):t+=IT;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){LT.epoch++;let i=!NT.length&&!0;for(let i of t)FT?.has(i)||(FT?.add(i),NT.push(i,n,e,r));i&&RT()},off(){},set(e){let t=n.value;t!==e&&(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},BT=2,VT=5,HT=6,UT=10,WT=(e,t,n,r)=>(e.events=e.events||{},e.events[n+UT]||(e.events[n+UT]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+UT](),delete e.events[n+UT])}),GT=(e,t)=>WT(e,t,BT,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),KT=1e3,qT=(e,t)=>WT(e,n=>{let r=t(n);r&&e.events[HT].push(r)},VT,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[HT]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[HT])t();e.events[HT]=[]}},KT)},()=>{e.listen=n,e.off=r}});function JT(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function YT(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!YT(e[n],t[n]))return!1;return!0}if(JT(e)&&JT(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!YT(e[r],t[r]))return!1;return!0}return!1}function XT(e,t){return GT(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var ZT=Symbol.for(`better-auth:focus-manager`),QT=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function $T(){return globalThis[ZT]||(globalThis[ZT]=new QT),globalThis[ZT]}var eE=Symbol.for(`better-auth:online-manager`),tE=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function nE(){return globalThis[eE]||(globalThis[eE]=new tE),globalThis[eE]}var rE={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},iE=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,aE={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},oE=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function sE(e){return e instanceof Date&&!isNaN(e.getTime())}function cE(e){let t=oE.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return sE(f)?f:null}function lE(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in aE)return aE[s];if(!iE.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(rE).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=cE(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function uE(e,t={strict:!0}){return lE(e,t)}var dE=()=>typeof window>`u`;function fE(e,t){return YT(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var pE=(e,t,n,r)=>{let i=zT({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)});XT(i,fE);let a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){let t=i.get(),n=t.data!=null&&e.data!=null&&YT(t.data,e.data)?t.data:e.data;i.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1,s=!1,c=!1,l=()=>{if(o){c=!0;return}o=!0,a().finally(()=>{o=!1;let e=c&&s;c=!1,e&&l()})};return qT(i,()=>{if(dE())return;s=!0;let t=!1,n,r=e.map(e=>e.listen(()=>{t?a():(t=!0,clearTimeout(n),l())}));return n=setTimeout(()=>{t=!0,l()},0),()=>{s=!1;for(let e of r)e();clearTimeout(n)}}),i},mE=()=>Math.floor(Date.now()/1e3),hE=5;function gE(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||nE().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=mE(),t();return}if(e?.event===`visibilitychange`){if(mE()-c.lastSessionRequest<hE)return;c.lastSessionRequest=mE(),t();return}t()}},d=e=>{MT().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=MT().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=$T().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=nE().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=MT().setup(),c.cleanupFocusSetup=$T().setup(),c.cleanupOnlineSetup=nE().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var _E=Object.create(null),vE=e=>({}),yE=new Proxy(_E,{get(e,t){return vE()[t]??_E[t]},has(e,t){return t in vE()||t in _E},set(e,t,n){let r=vE(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=vE(!0);return delete n[t],!0},ownKeys(){let e=vE(!0);return Object.keys(e)}});yE.NODE_ENV;function bE(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return bE(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return bE(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return bE(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return bE(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return bE(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return bE(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return bE(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function xE(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function SE(e){let t=e.split(`
|
|
43
|
+
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
44
|
+
at `))}function CE(e,t){class n extends e{#e;constructor(...e){if(xE()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=SE(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var wE={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};CE(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:wE[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var TE=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},EE=47;function DE(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===EE;)t--;return t===e.length?e:e.slice(0,t)}function OE(e){try{return(DE(new URL(e).pathname)||`/`)!==`/`}catch{throw new TE(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function kE(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new TE(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof TE?t:new TE(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function AE(e,t=`/api/auth`){if(kE(e),OE(e))return e;let n=DE(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function jE(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function ME(e,t,n,r,i){if(e)return AE(e,t);if(r!==!1){let e=yE.BETTER_AUTH_URL||yE.NEXT_PUBLIC_BETTER_AUTH_URL||yE.PUBLIC_BETTER_AUTH_URL||yE.NUXT_PUBLIC_BETTER_AUTH_URL||yE.NUXT_PUBLIC_AUTH_URL||(yE.BASE_URL===`/`?void 0:yE.BASE_URL);if(e)return AE(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&jE(o,`proto`)&&jE(a,`host`))try{return AE(`${o}://${a}`,t)}catch{}if(n){let e=NE(n.url);if(!e)throw new TE(`Could not get origin from request. Please provide a valid base URL.`);return AE(e,t)}if(typeof window<`u`&&window.location)return AE(window.location.origin,t)}function NE(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var PE=[`javascript:`,`data:`,`vbscript:`];function FE(e){let t;try{t=new URL(e)}catch{return!0}return!PE.includes(t.protocol)}var IE={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&FE(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},LE=()=>typeof window>`u`;function RE(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function zE(e){return!e||e.session===null&&e.user===null?null:e}function BE(e,t){return YT(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function VE(e,t){let n=zT(!1),r,i=e=>s(e),a=zT({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});XT(a,BE);let o=async(t,n)=>{let r=a.value;if(a.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:i}),!t.aborted)try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return;let{data:o,error:s}=RE(r);if(o?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return;({data:o,error:s}=RE(n))}catch{if(t.aborted)return}if(s){let e=a.value,t=s?.status===401;a.set({data:t?null:e.data,error:s,isPending:!1,isRefetching:!1,refetch:i});return}let c=zE(o),l=a.value,u=l.data!=null&&c!=null&&YT(l.data,c)?l.data:c;a.set({data:u,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(t.aborted)return;let n=a.value;a.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},s=e=>{r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>{if(!t.signal.aborted)return o(t.signal,e)})};r=n;let i=()=>{r===n&&(r=void 0)};return n.promise.then(i,i),n.promise},c=()=>r?.promise??s(),l=()=>{};return qT(a,()=>{let e;LE()||(e=setTimeout(()=>{c()},0));let r=gE({fetchSession:s,shouldPollSession:()=>a.value.data!=null,sessionSignal:n,options:t});return r.init(),l=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>l(e)}}var HE=Object.defineProperty,UE=Object.defineProperties,WE=Object.getOwnPropertyDescriptors,GE=Object.getOwnPropertySymbols,KE=Object.prototype.hasOwnProperty,qE=Object.prototype.propertyIsEnumerable,JE=(e,t,n)=>t in e?HE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,YE=(e,t)=>{for(var n in t||={})KE.call(t,n)&&JE(e,n,t[n]);if(GE)for(var n of GE(t))qE.call(t,n)&&JE(e,n,t[n]);return e},XE=(e,t)=>UE(e,WE(t)),ZE=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},QE=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},$E=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},eD=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function tD(e){if(typeof e==`number`)return new $E({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new $E(e);case`exponential`:return new eD(e);default:throw Error(`Invalid retry strategy`)}}var nD=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},rD=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function iD(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return rD.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function aD(e){try{return JSON.parse(e),!0}catch{return!1}}function oD(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function sD(e){try{return JSON.parse(e)}catch{return e}}function cD(e){return typeof e==`function`}function lD(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&cD(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&cD(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function uD(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function dD(e){let t=new Headers(uD(e?.headers,await nD(e)));if(!t.has(`content-type`)){let n=fD(e?.body);n&&t.set(`content-type`,n)}return t}function fD(e){return oD(e)?`application/json`:null}function pD(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function mD(e,t){let{body:n}=e;return n?!oD(n)||typeof n==`string`?n:pD(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function hD(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return yD.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function gD(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var _D=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function vD(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new _D(n.issues);return n.value}var yD=[`get`,`post`,`put`,`patch`,`delete`],bD=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await vD(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=XE(YE({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=XE(YE({},r),{body:i.input?await vD(i.input,n?.body):n?.body,params:i.params?await vD(i.params,n?.params):n?.params,query:i.query?await vD(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),xD=e=>{async function t(t,n){let r=XE(YE(YE({},e),n),{headers:uD(e?.headers,n?.headers),plugins:[...e?.plugins||[],bD(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await TD(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await TD(t,r)}return t},SD=e=>e===`.`||e===`..`;function CD(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(SD(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function wD(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];yD.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r){if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t))}o=o.split(`/`).map(e=>CD(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var TD=async(e,t)=>{let{hooks:n,url:r,options:i}=await QE(e,t),a=lD(i),o=new AbortController,s=i.signal??o.signal,c=wD(r,i),l=await dD(i),u=mD(i,l),d=hD(r,i),f=XE(YE({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=gD(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(XE(YE({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=iD(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??sD)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await vD(f.output,r.data));for(let e of n.onSuccess)e&&await e(XE(YE({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??sD,_=await m.text(),v=aD(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:XE(YE({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(XE(YE({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=tD(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await TD(e,XE(YE({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new ZE(m.status,m.statusText,v?y:_);return{data:null,error:XE(YE({},y),{status:m.status,statusText:m.statusText})}},ED=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},DD=(e,t)=>{let n=`credentials`in Request.prototype,r=ME(e?.baseURL,e?.basePath,void 0,t)??ED(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=xD({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?uE(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[IE],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=VE(d,e),h=e?.plugins||[],g={},_={$sessionSignal:f,session:p},v={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},y=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of h)e.getAtoms&&Object.assign(_,e.getAtoms?.(d)),e.pathMethods&&Object.assign(v,e.pathMethods),e.atomListeners&&y.push(...e.atomListeners);let b={notify:e=>{_[e].set(!_[e].get())},listen:(e,t)=>{_[e].subscribe(t)},atoms:_};for(let t of h)t.getActions&&(g=UC(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function OD(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function kD(e){return e.charAt(0).toUpperCase()+e.slice(1)}var AD=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,jD=/['\u2019]/g;function MD(e){return e.replace(jD,``).match(AD)??[]}function ND(e){return MD(e).map(e=>e.toLowerCase()).join(`-`)}function PD(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function FD(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||OD(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(ND).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=PD(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function ID(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,$fetch:i,atomListeners:a,$store:o}=DD(e),s={};for(let[e,t]of Object.entries(r))s[`use${kD(e)}`]=t;return FD({...n,...s,$fetch:i,$store:o},i,t,r,a)}var LD=(e,{$listPasskeys:t,$store:n})=>({signIn:{passkey:async(r,i)=>{let a=await e(`/passkey/generate-authenticate-options`,{method:`GET`,throw:!1});if(!a.data)return a;let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s;try{s=await DT({optionsJSON:{...a.data,extensions:o},useBrowserAutofill:r?.autoFill})}catch(e){return{data:null,error:{code:e instanceof _T?e.code:`AUTH_CANCELLED`,message:lT.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}try{let{clientExtensionResults:a,...o}=s,c=await e(`/passkey/verify-authentication`,{body:{response:o},...r?.fetchOptions,...i,method:`POST`,throw:!1});return t.set(Math.random()),n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...c,webauthn:{response:s,clientExtensionResults:a}}:c}catch(e){return console.error(`[Better Auth] Error verifying passkey`,e),{data:null,error:{code:`AUTH_CANCELLED`,message:lT.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}}},passkey:{addPasskey:async(n,r)=>{let i=await e(`/passkey/generate-register-options`,{method:`GET`,query:{...n?.authenticatorAttachment&&{authenticatorAttachment:n.authenticatorAttachment},...n?.name&&{name:n.name},...n?.context&&{context:n.context}},throw:!1});if(!i.data)return i;try{let a=i.data.extensions||n?.extensions?{...i.data.extensions||{},...n?.extensions||{}}:void 0,o=await ST({optionsJSON:{...i.data,extensions:a},useAutoRegister:n?.useAutoRegister}),{clientExtensionResults:s,...c}=o,l=await e(`/passkey/verify-registration`,{...n?.fetchOptions,...r,body:{response:c,name:n?.name},method:`POST`,throw:!1});return l.data?(t.set(Math.random()),n?.returnWebAuthnResponse?{...l,webauthn:{response:o,clientExtensionResults:s}}:l):l}catch(e){return e instanceof _T?e.code===`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`?{data:null,error:{code:e.code,message:lT.PREVIOUSLY_REGISTERED.message,status:400,statusText:`BAD_REQUEST`}}:e.code===`ERROR_CEREMONY_ABORTED`?{data:null,error:{code:e.code,message:lT.REGISTRATION_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:e.code,message:e.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:`UNKNOWN_ERROR`,message:e instanceof Error?e.message:lT.UNKNOWN_ERROR.message,status:500,statusText:`INTERNAL_SERVER_ERROR`}}}}},$Infer:{}}),RD=()=>{let e=zT();return{id:`passkey`,version:uT,$InferServerPlugin:{},getActions:(t,n)=>LD(t,{$listPasskeys:e,$store:n}),getAtoms(t){return{listPasskeys:pE(e,`/passkey/list-user-passkeys`,t,{method:`GET`}),$listPasskeys:e}},pathMethods:{"/passkey/register":`POST`,"/passkey/authenticate":`POST`},atomListeners:[{matcher(e){return e===`/passkey/verify-registration`||e===`/passkey/delete-passkey`||e===`/passkey/update-passkey`||e===`/sign-out`},signal:`$listPasskeys`},{matcher:e=>e===`/passkey/verify-authentication`,signal:`$sessionSignal`}],$ERROR_CODES:lT}},zD=`1.6.27`,BD=e=>({id:`sso-client`,version:zD,$InferServerPlugin:{},pathMethods:{"/sso/providers":`GET`,"/sso/get-provider":`GET`}}),VD=()=>({id:`magic-link`,version:OT,$InferServerPlugin:{}}),HD=cT({OTP_NOT_ENABLED:`OTP not enabled`,OTP_HAS_EXPIRED:`OTP has expired`,TOTP_NOT_ENABLED:`TOTP not enabled`,TWO_FACTOR_NOT_ENABLED:`Two factor isn't enabled`,BACKUP_CODES_NOT_ENABLED:`Backup codes aren't enabled`,INVALID_BACKUP_CODE:`Invalid backup code`,INVALID_CODE:`Invalid code`,TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:`Too many attempts. Please request a new code.`,ACCOUNT_TEMPORARILY_LOCKED:`Too many failed verification attempts. Your account is temporarily locked. Please try again later.`,INVALID_TWO_FACTOR_COOKIE:`Invalid two factor cookie`}),UD=e=>({id:`two-factor`,version:OT,$InferServerPlugin:{},atomListeners:[{matcher:e=>e.startsWith(`/two-factor/`),signal:`$sessionSignal`}],pathMethods:{"/two-factor/disable":`POST`,"/two-factor/enable":`POST`,"/two-factor/send-otp":`POST`,"/two-factor/generate-backup-codes":`POST`,"/two-factor/get-totp-uri":`POST`,"/two-factor/verify-totp":`POST`,"/two-factor/verify-otp":`POST`,"/two-factor/verify-backup-code":`POST`},fetchPlugins:[{id:`two-factor`,name:`two-factor`,hooks:{async onSuccess(t){if(t.data?.twoFactorRedirect){if(e?.onTwoFactorRedirect){await e.onTwoFactorRedirect({twoFactorMethods:t.data.twoFactorMethods});return}e?.twoFactorPage&&typeof window<`u`&&FE(e.twoFactorPage)&&(window.location.href=e.twoFactorPage)}}}}],$ERROR_CODES:HD}),WD=e=>ID({baseURL:e,withCredentials:!0,plugins:[UD({onTwoFactorRedirect:()=>{let e=new URLSearchParams(window.location.search).get(`redirect_url`),t=e?`/auth/2fa?redirect_url=${encodeURIComponent(e)}`:`/auth/2fa`;window.location.href=t}}),RD(),VD(),BD()]}),GD=e=>{let t=e?.editor?.backendURL??m?.backendURL;t||(t=zt,console.error(`Backend URL is not defined in the Intlayer configuration.`));let n=WD(t);return{getAuthClient:()=>n,signInEmail:async(...e)=>n.signIn.email(...e),signUpEmail:async(...e)=>n.signUp.email(...e),signOut:async(...e)=>n.signOut(...e),signInSocial:async(...e)=>n.signIn.social(...e),linkSocial:async(...e)=>n.linkSocial(...e),changePasswordSession:async(...e)=>n.changePassword(...e),requestPasswordResetSession:async(...e)=>n.requestPasswordReset(...e),resetPassword:async(...e)=>n.resetPassword(...e),verifyEmailSession:async(...e)=>n.verifyEmail(...e),getSession:async(...e)=>n.getSession(...e),forgetPassword:async(...e)=>n.requestPasswordReset(...e),sendVerificationEmail:async(...e)=>n.sendVerificationEmail(...e),changeEmail:async(...e)=>n.changeEmail(...e),deleteUser:async(...e)=>n.deleteUser(...e),revokeSession:async(...e)=>n.revokeSession(...e),revokeSessions:async(...e)=>n.revokeSessions(...e),revokeOtherSessions:async(...e)=>n.revokeOtherSessions(...e),listAccounts:async(...e)=>n.listAccounts(...e),unlinkAccount:async(...e)=>n.unlinkAccount(...e),refreshToken:async(...e)=>n.refreshToken(...e),getAccessToken:async(...e)=>n.getAccessToken(...e),accountInfo:async(...e)=>n.accountInfo(...e),updateUser:async(...e)=>n.updateUser(...e),listSessions:async(...e)=>n.listSessions(...e),enableTwoFactor:async(...e)=>n.twoFactor.enable(...e),disableTwoFactor:async(...e)=>n.twoFactor.disable(...e),verifyTotp:async(...e)=>n.twoFactor.verifyTotp(...e),verifyBackupCode:async(...e)=>n.twoFactor.verifyBackupCode(...e),addPasskey:async(...e)=>n.passkey.addPasskey(...e),signInPasskey:async(...e)=>n.signIn.passkey(...e),deletePasskey:async(...e)=>n.passkey.deletePasskey(...e),listPasskeys:async()=>n.$fetch(`/passkey/list-user-passkeys`,{method:`GET`}),signInMagicLink:async(...e)=>n.signIn.magicLink(...e),signInSSO:async(...e)=>n.signIn.sso(...e),registerSSO:async(...e)=>n.sso.register(...e),listSSOProviders:async()=>({data:(await n.sso.providers())?.data?.providers??[]}),deleteSSOProvider:async e=>n.sso.deleteProvider({providerId:e.providerId})}},KD=(e,t)=>{let n=(0,V.c)(17),r=eT(),i;n[0]!==r||n[1]!==t?(i=t??r??{editor:m},n[0]=r,n[1]=t,n[2]=i):i=n[2];let a=i,o=Ho(),s=aa(),c;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(c=[`session`],n[3]=c):c=n[3];let l;n[4]===a?l=n[5]:(l=async()=>(await GD(a).getSession()).data,n[4]=a,n[5]=l);let u=!e&&s,d;n[6]!==l||n[7]!==u?(d={queryKey:c,queryFn:l,staleTime:3e5,gcTime:18e5,refetchInterval:6e5,refetchIntervalInBackground:!1,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:!0,enabled:u},n[6]=l,n[7]=u,n[8]=d):d=n[8];let{data:f,isFetched:p,refetch:h}=is(d),g=f??(p?null:void 0),_;n[9]===o?_=n[10]:(_=e=>{o.setQueryData([`session`],e)},n[9]=o,n[10]=_);let v=_,y;n[11]===h?y=n[12]:(y=async()=>(await h()).data,n[11]=h,n[12]=y);let b=y,x;return n[13]!==b||n[14]!==g||n[15]!==v?(x={session:g,fetchSession:b,revalidateSession:b,setSession:v},n[13]=b,n[14]=g,n[15]=v,n[16]=x):x=n[16],x},qD=e=>{let t=(0,V.c)(9),n;t[0]===e?n=t[1]:(n=e===void 0?{}:e,t[0]=e,t[1]=n);let{session:r,intlayerConfiguration:i}=n,{session:a,fetchSession:o,revalidateSession:s,setSession:c}=KD(r,i),{oAuth2AccessToken:l}=sT(i),u=!!(a?.user||l),d;return t[2]!==o||t[3]!==l||t[4]!==s||t[5]!==a||t[6]!==c||t[7]!==u?(d={session:a,fetchSession:o,setSession:c,revalidateSession:s,oAuth2AccessToken:l,isAuthenticated:u},t[2]=o,t[3]=l,t[4]=s,t[5]=a,t[6]=c,t[7]=u,t[8]=d):d=t[8],d},JD=e=>{let t=(0,V.c)(10),n=eT(),{oAuth2AccessToken:r}=qD(),i;t[0]===r?i=t[1]:(i=r&&{headers:{Authorization:`Bearer ${r.accessToken}`}},t[0]=r,t[1]=i);let a;t[2]===e?.options?a=t[3]:(a=e?.options??{},t[2]=e?.options,t[3]=a);let o;t[4]!==i||t[5]!==a?(o={...i,...a},t[4]=i,t[5]=a,t[6]=o):o=t[6];let s=o,c=e?.intlayerConfiguration??n,l=c?.editor?c:void 0,u;return t[7]!==s||t[8]!==l?(u={options:s,resolvedConfig:l},t[7]=s,t[8]=l,t[9]=u):u=t[9],u},YD=e=>{let t=(0,V.c)(2),n=eT(),r=e?.intlayerConfiguration??n,i;return t[0]===r?i=t[1]:(i=GD(r),t[0]=r,t[1]=i),i},XD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=JD(e),i;return t[0]!==n||t[1]!==r?(i=qC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},ZD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=JD(e),i;return t[0]!==n||t[1]!==r?(i=GC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},QD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=JD(e),i;return t[0]!==n||t[1]!==r?(i=WC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},$D=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=JD(e),i;return t[0]!==n||t[1]!==r?(i=JC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},eO=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=JD(e),i;return t[0]!==n||t[1]!==r?(i=KC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},tO=e=>{let t=(0,V.c)(4),{requireUser:n,requireProject:r,requireOrganization:i}=e,a=eT(),o;t[0]===a?o=t[1]:(o={intlayerConfiguration:a},t[0]=a,t[1]=o);let{oAuth2AccessToken:s,session:c}=qD(o),l=c?c.user:s?.user,u=c?c.organization:s?.organization,d=c?c.project:s?.project,f=(!n||!!l)&&(!r||!!d)&&(!i||!!u),p;return t[2]===f?p=t[3]:(p={enable:f},t[2]=f,t[3]=p),p},nO=e=>{let t=(0,V.c)(12),n,r,i,a;t[0]===e?(n=t[1],r=t[2],i=t[3],a=t[4]):({requireUser:i,requireProject:r,requireOrganization:n,...a}=e,t[0]=e,t[1]=n,t[2]=r,t[3]=i,t[4]=a);let o;t[5]!==n||t[6]!==r||t[7]!==i?(o={requireUser:i,requireProject:r,requireOrganization:n},t[5]=n,t[6]=r,t[7]=i,t[8]=o):o=t[8];let{enable:s}=tO(o),c=a?.enabled!==!1&&s,l;return t[9]!==a||t[10]!==c?(l={enabled:c,...a},t[9]=a,t[10]=c,t[11]=l):l=t[11],is(l)},rO=()=>{let e=(0,V.c)(3),t=QD(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`ai-auditContentDeclarationMetadata`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.auditContentDeclarationMetadata(e)},e[1]=t,e[2]=r),as(r)},iO=()=>{let e=(0,V.c)(3),t=QD(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`ai-auditContentDeclarationField`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.auditContentDeclarationField(e)},e[1]=t,e[2]=r),as(r)},aO=()=>{let e=(0,V.c)(3),t=QD(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`ai-customQuery`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.customQuery(e)},e[1]=t,e[2]=r),as(r)},oO=[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]],sO=()=>{let e=(0,V.c)(8),t=YD(),n=Ho(),r;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`logout`],e[0]=r):r=e[0];let i;e[1]===t?i=e[2]:(i=()=>t.signOut(),e[1]=t,e[2]=i);let a;e[3]===n?a=e[4]:(a=()=>{oO.forEach(e=>{n.removeQueries({queryKey:e})})},e[3]=n,e[4]=a);let o;return e[5]!==i||e[6]!==a?(o={mutationKey:r,mutationFn:i,onSettled:a},e[5]=i,e[6]=a,e[7]=o):o=e[7],as(o)},cO=(e,t)=>{let n=(0,V.c)(9),r=ZD(),i;n[0]===e?i=n[1]:(i=[`dictionaries`,e],n[0]=e,n[1]=i);let a;n[2]!==r||n[3]!==e?(a=t=>{let{signal:n}=t;return r.getDictionaries(e,{signal:n})},n[2]=r,n[3]=e,n[4]=a):a=n[4];let o;return n[5]!==t||n[6]!==i||n[7]!==a?(o={queryKey:i,queryFn:a,requireUser:!0,requireOrganization:!0,requireProject:!0,...t},n[5]=t,n[6]=i,n[7]=a,n[8]=o):o=n[8],nO(o)},lO=()=>{let e=(0,V.c)(6),t=ZD(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`dictionaries`],e[0]=n):n=e[0];let r;e[1]===t?r=e[2]:(r=e=>t.pushDictionaries(e.dictionaries),e[1]=t,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={invalidateQueries:[[`dictionaries`],[`dictionary`],[`dictionariesKeys`]]},e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a={mutationKey:n,mutationFn:r,meta:i},e[4]=r,e[5]=a),as(a)},uO=()=>{let e=(0,V.c)(6),t=ZD(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`dictionaries`],e[0]=n):n=e[0];let r;e[1]===t?r=e[2]:(r=e=>t.deleteDictionary(e.dictionaryId),e[1]=t,e[2]=r);let i;e[3]===Symbol.for(`react.memo_cache_sentinel`)?(i={invalidateQueries:[[`dictionaries`],[`dictionary`],[`dictionariesKeys`]]},e[3]=i):i=e[3];let a;return e[4]===r?a=e[5]:(a={mutationKey:n,mutationFn:r,meta:i},e[4]=r,e[5]=a),as(a)},dO=()=>{let e=(0,V.c)(3),t=eO(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`editor`,`dictionaries`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={queryKey:n,queryFn:()=>t.getDictionaries()},e[1]=t,e[2]=r),is(r)},fO=()=>{let e=(0,V.c)(3),t=eO(),n;e[0]===Symbol.for(`react.memo_cache_sentinel`)?(n=[`editor`,`dictionaries`],e[0]=n):n=e[0];let r;return e[1]===t?r=e[2]:(r={mutationKey:n,mutationFn:e=>t.writeDictionary(e)},e[1]=t,e[2]=r),as(r)},pO=(e,t)=>{let n=(0,V.c)(9),r=XD(),i;n[0]===e?i=n[1]:(i=[`projects`,e],n[0]=e,n[1]=i);let a;n[2]!==e||n[3]!==r?(a=t=>{let{signal:n}=t;return r.getProjects(e,{signal:n})},n[2]=e,n[3]=r,n[4]=a):a=n[4];let o;return n[5]!==t||n[6]!==i||n[7]!==a?(o={queryKey:i,queryFn:a,requireUser:!0,requireOrganization:!0,...t},n[5]=t,n[6]=i,n[7]=a,n[8]=o):o=n[8],nO(o)},mO=(e,t)=>{let n=(0,V.c)(9),r=$D(),i;n[0]===e?i=n[1]:(i=[`tags`,e],n[0]=e,n[1]=i);let a;n[2]!==e||n[3]!==r?(a=t=>{let{signal:n}=t;return r.getTags(e,{signal:n})},n[2]=e,n[3]=r,n[4]=a):a=n[4];let o;return n[5]!==t||n[6]!==i||n[7]!==a?(o={queryKey:i,queryFn:a,requireUser:!0,requireOrganization:!0,...t},n[5]=t,n[6]=i,n[7]=a,n[8]=o):o=n[8],nO(o)},hO=()=>{let e=(0,V.c)(9),{session:t,revalidateSession:n,setSession:r}=qD(),{mutate:i}=sO(),a=t?.user?`authenticated`:`unauthenticated`,o=a===`authenticated`,s=a===`unauthenticated`,c=t?.user,l;e[0]!==i||e[1]!==r?(l=async()=>{r(null),i()},e[0]=i,e[1]=r,e[2]=l):l=e[2];let u=l,d;return e[3]!==o||e[4]!==s||e[5]!==u||e[6]!==n||e[7]!==c?(d={isAuthenticated:o,isUnauthenticated:s,user:c,revalidateSession:n,logout:u},e[3]=o,e[4]=s,e[5]=u,e[6]=n,e[7]=c,e[8]=d):d=e[8],d},gO=({className:e,strokeWidth:t=4})=>(0,y.jsx)(`svg`,{xmlns:`http://www.w3.org/2000/svg`,width:`44`,height:`44`,viewBox:`0 0 44 44`,stroke:`currentColor`,role:`img`,"aria-label":`Spinner`,className:W(`size-full`,e),children:(0,y.jsxs)(`g`,{fill:`none`,fillRule:`evenodd`,strokeWidth:t,children:[(0,y.jsxs)(`circle`,{cx:`22`,cy:`22`,r:`1`,children:[(0,y.jsx)(`animate`,{attributeName:`r`,begin:`0s`,dur:`1.8s`,values:`1; 20`,calcMode:`spline`,keyTimes:`0; 1`,keySplines:`0.165, 0.84, 0.44, 1`,repeatCount:`indefinite`}),(0,y.jsx)(`animate`,{attributeName:`stroke-opacity`,begin:`0s`,dur:`1.8s`,values:`1; 0`,calcMode:`spline`,keyTimes:`0; 1`,keySplines:`0.3, 0.61, 0.355, 1`,repeatCount:`indefinite`})]}),(0,y.jsxs)(`circle`,{cx:`22`,cy:`22`,r:`1`,children:[(0,y.jsx)(`animate`,{attributeName:`r`,begin:`-0.9s`,dur:`1.8s`,values:`1; 20`,calcMode:`spline`,keyTimes:`0; 1`,keySplines:`0.165, 0.84, 0.44, 1`,repeatCount:`indefinite`}),(0,y.jsx)(`animate`,{attributeName:`stroke-opacity`,begin:`-0.9s`,dur:`1.8s`,values:`1; 0`,calcMode:`spline`,keyTimes:`0; 1`,keySplines:`0.3, 0.61, 0.355, 1`,repeatCount:`indefinite`})]})]})}),_O=({children:e,isLoading:t=!0,keepChildren:n=!1,className:r,...i})=>(0,y.jsx)(y.Fragment,{children:t&&n?(0,y.jsxs)(`div`,{className:`relative size-full`,children:[(0,y.jsx)(`div`,{className:W(`absolute top-0 left-0 flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center`,r),role:`status`,"aria-label":`Animated icon, meaning that the website is processing`,...i,children:(0,y.jsx)(gO,{className:`size-10 max-h-full max-w-full`})}),e]}):t?(0,y.jsx)(`div`,{className:W(`flex size-full max-h-screen max-w-[100vw] flex-1 items-center justify-center`,r),role:`status`,"aria-label":`Animated icon, meaning that the website is processing`,...i,children:(0,y.jsx)(gO,{className:`size-10 max-h-full max-w-full`})}):e??(0,y.jsx)(y.Fragment,{})}),vO=Qd(`flex-none shrink-0`,{variants:{size:{xs:`size-2`,sm:`size-3`,md:`size-4`,lg:`size-5`,xl:`size-6`,"icon-sm":`size-3`,"icon-md":`size-4`,"icon-lg":`size-5`,"icon-xl":`size-6`,custom:``}},defaultVariants:{size:`md`}}),yO=Qd(`relative inline-flex cursor-pointer items-center justify-center font-medium ring-0 transition-all duration-300 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50`,{variants:{size:{xs:`min-h-7 px-3 text-xs max-md:py-1`,sm:`min-h-7 px-3 text-xs max-md:py-1`,md:`min-h-8 px-6 text-sm max-md:py-2`,lg:`min-h-10 px-8 text-lg max-md:py-3`,xl:`min-h-11 px-10 text-xl max-md:py-4`,"icon-sm":`p-1.5`,"icon-md":`p-1.5`,"icon-lg":`p-1.5`,"icon-xl":`p-3`,custom:``},color:{primary:`hover-primary-500/20 text-primary ring-primary-500/20 *:text-text-light`,secondary:`hover-secondary-500/20 text-secondary ring-secondary-500/20 *:text-text-light`,neutral:`text-neutral ring-neutral-500/5 *:text-text-light`,card:`hover-card-500/20 text-card ring-card-500/20 *:text-text-light`,light:`hover-white-500/20 text-white ring-white/20 *:text-text-light`,dark:`text-neutral-800 ring-text-light/50 *:text-text-light`,text:`text-text ring-text/20 *:text-text-opposite`,current:`hover-current-500/10 text-current ring-current/10 *:text-text-light`,"text-inverse":`text-text-opposite ring-text-opposite/20 *:text-text`,error:`hover-error-500/20 text-error ring-error/20 *:text-text-light`,success:`hover-success-500/20 text-success ring-success/20 *:text-text-light`,custom:``},roundedSize:{none:`rounded-none`,sm:`rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl`,md:`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,lg:`rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl`,xl:`rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl`,"2xl":`rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]`,"3xl":`rounded-[2.5rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[3rem]`,"4xl":`rounded-[3rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[4rem]`,"5xl":`rounded-[4rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[5rem]`,full:`rounded-full`},variant:{default:[`bg-current`,`hover:bg-current/90`,`hover:ring-5`,`aria-selected:ring-5`],outline:[`rounded-2xl border-[1.3px] border-current bg-current/0 *:text-current!`,`hover:bg-current/20 focus-visible:bg-current/20`,`hover:ring-5 focus-visible:ring-5`,`aria-selected:ring-5`],none:`border-none bg-current/0 text-inherit hover:bg-current/0`,link:`h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent hover:underline`,"invisible-link":`h-auto justify-start border-inherit bg-transparent px-1 underline-offset-4 *:text-current! hover:bg-transparent`,hoverable:`rounded-lg border-none bg-current/0 transition *:text-current! hover:bg-current/10 aria-[current]:bg-current/5`,fade:[`rounded-lg border-none bg-current/10 ring-current/5 transition *:text-current! hover:bg-current/20 aria-[current]:bg-current/5`,`hover:ring-5 focus-visible:ring-5`,`aria-selected:ring-5`],input:[`text-text`,`w-full select-text resize-none rounded-2xl text-base shadow-none outline-none supports-[corner-shape:squircle]:rounded-4xl`,`transition-shadow duration-100 md:text-sm`,`ring-0`,`disabled:opacity-50`,`text-text`,`bg-neutral-50 dark:bg-neutral-950`,`ring-neutral-100 dark:ring-neutral-700`,`hover:ring-3`,`aria-selected:ring-4`,`focus-visible:ring-3`,`disabled:ring-0`,`focus-visible:outline-none`,`[box-shadow:none] focus:[box-shadow:none]`,`aria-invalid:border-error`]},textAlign:{left:`justify-start text-left`,center:`justify-center text-center`,right:`justify-end text-right`},isFullWidth:{true:`w-full`,false:``}},defaultVariants:{variant:`default`,size:`md`,color:`text`,roundedSize:`md`,textAlign:`center`,isFullWidth:!1}}),bO=({variant:e,size:t,color:n,children:r,Icon:i,IconRight:a,iconClassName:o,isLoading:s=!1,isActive:c,isSelected:l,isFullWidth:u,roundedSize:d,textAlign:f,disabled:p,label:m,className:h,type:g=`button`,"aria-describedby":_,"aria-expanded":v,"aria-haspopup":b,"aria-pressed":x,...S})=>{let C=e===`link`||e===`invisible-link`,w=!r&&(i||a),T={"aria-label":w?m??void 0:void 0,"aria-labelledby":void 0,"aria-describedby":_,"aria-expanded":v,"aria-haspopup":b,"aria-pressed":c===void 0?x:c,"aria-busy":s,"aria-current":c?`page`:void 0,"aria-disabled":p||s,"aria-selected":l},E=t===`icon-sm`||t===`icon-md`||t===`icon-lg`||t===`icon-xl`;return(0,y.jsxs)(`button`,{disabled:s||p,role:C?`link`:`button`,type:g,className:yO({variant:e,size:t,color:n,isFullWidth:u,roundedSize:d,textAlign:f??(a?`left`:`center`),className:h}),...T,...S,children:[i&&!s&&(0,y.jsx)(i,{className:vO({size:t,className:W(!E&&`mr-3`,o)}),"aria-hidden":`true`}),(0,y.jsx)(`div`,{className:W(`flex items-center justify-center transition-[width] duration-300`,s&&t===`sm`&&`w-3`,s&&t===`md`&&`w-4`,s&&t===`lg`&&`w-6`,s&&t===`xl`&&`w-8`),children:(0,y.jsx)(_O,{className:vO({size:t,className:W(!E&&`mr-3`,o)}),isLoading:s,"aria-hidden":`true`,"data-testid":`loader`})}),r&&(0,y.jsx)(`span`,{className:`flex-1 truncate whitespace-nowrap`,children:r}),!r&&w&&(0,y.jsx)(`span`,{className:`sr-only`,children:m}),a&&(0,y.jsx)(a,{className:vO({size:t,className:W(!E&&`ml-3`,o)}),"aria-hidden":`true`})]})},xO=({children:e,isHidden:t,className:n=``,isOverable:r=!1,isFocusable:i=!1,minHeight:a=0,...o})=>(0,y.jsx)(`div`,{"aria-hidden":i?t:void 0,tabIndex:i?0:void 0,role:i?`button`:`none`,className:W(`group/height-smoother relative grid w-full grid-rows-[0fr] overflow-hidden transition-all duration-700 ease-in-out`,t!==void 0&&!t&&`grid-rows-[1fr] overflow-x-auto`,r&&`hover:grid-rows-[1fr] hover:overflow-x-auto`,i&&`focus-within:grid-rows-[1fr] focus-within:overflow-x-auto focus:grid-rows-[1fr] focus:overflow-x-auto`,n),...o,children:(0,y.jsx)(`div`,{style:{minHeight:`${a}px`},className:W(r&&`group-hover/height-smoother:visible`,i&&`group-focus/height-smoother:visible`,n),children:e})}),SO=({children:e,header:t,isOpen:n,defaultIsOpen:r=!1,onToggle:i,onClick:a,disabled:o=!1,contentClassName:s,headerClassName:c,contentId:l,"aria-label":u,...d})=>{let f=n!==void 0,[p,m]=(0,v.useState)(r),h=(0,v.useId)(),g=f?n:p,_=!g,b=l??`${h}-accordion-content`,x=e=>{if(o)return;let t=!g;f||m(t),i?.(t),a?.(e)};return(0,y.jsxs)(`div`,{className:`w-full`,children:[(0,y.jsx)(bO,{variant:`hoverable`,color:`text`,onClick:x,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),x(e))},disabled:o,isFullWidth:!0,className:W(`flex items-center justify-between gap-2`,c),IconRight:pf,iconClassName:W(`transform transition-transform duration-500 ease-in-out`,g?`rotate-0`:`-rotate-180`),"aria-expanded":g,"aria-controls":b,"aria-label":u,role:`button`,...d,children:t}),(0,y.jsx)(xO,{id:b,tabIndex:_?-1:void 0,isHidden:_,className:s,role:`region`,"aria-labelledby":b,children:e})]})},CO=({level:e,title:t,description:n,children:r,rightParam:i,isSelected:a,...o})=>(0,y.jsx)(`div`,{className:W(`rounded-md p-2 transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,e===2&&`hover:bg-card/30`,e>=3&&``,a===!0&&`bg-card/40`),...o,children:(0,y.jsx)(SO,{isOpen:a,label:t,header:(0,y.jsxs)(`div`,{className:`flex w-full`,children:[(0,y.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,y.jsx)(`span`,{className:W(e===0&&`text-lg`,e===1&&`text-md`,e===2&&`text-md`,e>=3&&`text-base`),children:t}),i&&(0,y.jsx)(`div`,{className:`flex w-auto items-center justify-between p-3`,children:i})]}),n&&(0,y.jsx)(`p`,{className:`pl-3 text-card text-sm`,children:n})]}),children:(0,y.jsx)(`div`,{className:`size-full px-2`,children:r})})}),wO=e=>{let{keyPath:t,section:n,onFocusKeyPath:r,focusedKeyPath:i=[]}=e;return n.map((n,a)=>{let o={key:a,type:k},s=[...t,o];return(0,y.jsx)(CO,{level:t.length,title:`${a}`,description:``,isSelected:Pt(s,i),onClick:e=>{e.stopPropagation(),r(s)},children:(0,y.jsx)(ak,{...e,keyPath:s,section:n})},JSON.stringify(n))})},TO=e=>e?.getAttribute(`aria-selected`)===`true`,EO=(e,{selector:t=TO,isHoverable:n=!1,orientation:r=`horizontal`}={selector:TO,isHoverable:!1,orientation:`horizontal`})=>{let[i,a]=(0,v.useState)(null),[o,s]=(0,v.useState)(null),c=(0,v.useRef)(null),l=(0,v.useRef)(null),u=e.current.length,d=()=>{let n=null;if(o?(n=o,c.current&&=(clearTimeout(c.current),null)):n=e.current.find(t)??null,!n){if(r===`vertical`){let e=l.current,t={top:e?.top??0,height:e?.height??0,opacity:0};e?.opacity!==0&&(a(t),l.current=t)}else{let e=l.current,t={left:e?.left??0,width:e?.width??0,opacity:0};e?.opacity!==0&&(a(t),l.current=t)}return}if(r===`vertical`){let e=n.offsetTop,t=n.offsetHeight,r={top:e,height:t,opacity:1},i=l.current;(!i||i.top!==e||i.height!==t||i.opacity!==1)&&(a(r),l.current=r)}else{let e=n.offsetLeft,t=n.offsetWidth,r={left:e,width:t,opacity:1},i=l.current;(!i||i.left!==e||i.width!==t||i.opacity!==1)&&(a(r),l.current=r)}};return(0,v.useLayoutEffect)(()=>{d(),window.addEventListener(`resize`,d),window.addEventListener(`DOMContentLoaded`,d);let r=[];e.current.forEach(e=>{if(e){let t=new MutationObserver(e=>{for(let t of e)if(t.type===`attributes`&&(t.attributeName===`aria-selected`||t.attributeName===`data-active`||t.attributeName===`data-indicator`)){d();break}});t.observe(e,{attributes:!0,attributeFilter:[`aria-selected`,`data-active`,`data-indicator`]}),r.push(t)}});let i=[],a=e=>{if(!e)return;let t=new ResizeObserver(()=>{d()});t.observe(e),i.push(t)},l=e.current.find(t)??null;l&&a(l),o&&a(o);let u=e=>{c.current&&=(clearTimeout(c.current),null),s(e.currentTarget)},f=()=>{c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{s(null)},150)};return n&&e.current.forEach(e=>{e?.addEventListener(`mouseenter`,u,{passive:!0}),e?.addEventListener(`mouseleave`,f,{passive:!0})}),()=>{c.current&&clearTimeout(c.current),window.removeEventListener(`resize`,d),window.removeEventListener(`DOMContentLoaded`,d),r.forEach(e=>{e.disconnect()}),i.forEach(e=>{e.disconnect()}),e.current.forEach(e=>{e?.removeEventListener(`mouseenter`,u),e?.removeEventListener(`mouseleave`,f)})}},[e,t,o,u,r,n]),{choiceIndicatorPosition:i,calculatePosition:d,orientation:r}},DO=({choices:e=[],value:t,defaultValue:n,onChange:r,hoverable:i=!0,disabled:a=!1},o)=>{let[s,c]=(0,v.useState)(t??n??e[0]?.value),[l,u]=(0,v.useState)(null),d=(0,v.useRef)([]),f=(0,v.useRef)(null),{choiceIndicatorPosition:p}=EO(d,{selector:e=>e.getAttribute(`data-indicator`)===`true`,isHoverable:!1,orientation:o}),m=e.findIndex(e=>e.value===s),h=i&&l!==null?l:m;return(0,v.useEffect)(()=>{t!==void 0&&c(t)},[t]),{valueState:s,hoveredIndex:l,setHoveredIndex:u,optionsRefs:d,indicatorRef:f,choiceIndicatorPosition:p,selectedIndex:m,indicatorIndex:h,handleChange:e=>{c(e),r?.(e)},disabled:a}},OO=[{content:`Off`,value:!1},{content:`On`,value:!0}],kO=Qd(`flex h-fit w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-0.38`,{variants:{color:{primary:`border-primary text-primary`,secondary:`border-secondary text-secondary`,neutral:`border-neutral text-neutral`,light:`border-white text-white`,dark:`border-neutral-800 text-neutral-800`,text:`border-text text-text`},disabled:{true:`cursor-not-allowed opacity-50`,false:``}},defaultVariants:{color:`text`,disabled:!1}}),AO=Qd(`z-1 flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-text-opposite motion-reduce:transition-none`,{variants:{size:{xs:`px-2 py-0.5 text-xs`,sm:`px-2 py-1 text-xs`,md:`p-2 text-sm`,lg:`p-4 text-base`}},defaultVariants:{size:`md`}}),jO=Qd(`absolute top-0 z-0 h-full w-auto rounded-full transition-all duration-300 ease-in-out motion-reduce:transition-none`,{variants:{color:{primary:`bg-primary data-[indicator=true]:text-text`,secondary:`bg-secondary data-[indicator=true]:text-text`,error:`bg-error data-[indicator=true]:text-text`,neutral:`bg-neutral data-[indicator=true]:text-white`,light:`bg-white data-[indicator=true]:text-black`,dark:`bg-neutral-800 data-[indicator=true]:text-white`,text:`bg-text data-[indicator=true]:text-text-opposite`}}}),MO=e=>{let{choices:t=OO,color:n=`primary`,size:r=`md`,className:i,itemClassName:a}=e,{selectedIndex:o,indicatorIndex:s,handleChange:c,optionsRefs:l,indicatorRef:u,choiceIndicatorPosition:d,setHoveredIndex:f,disabled:p}=DO({choices:t,value:e.value,defaultValue:e.defaultValue,onChange:e.onChange,hoverable:e.hoverable,disabled:e.disabled},`horizontal`);return(0,y.jsx)(`div`,{className:kO({color:n,disabled:p,className:i}),role:`tablist`,"aria-disabled":p?`true`:void 0,children:(0,y.jsxs)(`div`,{className:`relative flex size-full flex-row items-center justify-center`,children:[t.map((e,t)=>{let{content:n,value:i,...u}=e,d=typeof i==`string`||typeof i==`number`,m=t===o,h=t===s;return(0,v.createElement)(`button`,{...u,type:`button`,className:W(AO({size:r}),p&&`cursor-not-allowed`,a),key:d?i:t,role:`tab`,onClick:()=>c(i),"aria-selected":m?`true`:void 0,"data-indicator":h?`true`:void 0,disabled:p,tabIndex:m?0:-1,ref:e=>{l.current[t]=e},onMouseEnter:()=>!p&&f(t),onMouseLeave:()=>!p&&f(null)},n)}),d&&(0,y.jsx)(`div`,{className:W(jO({color:n})),style:d,ref:u})]})})},NO=e=>{let t=(0,V.c)(15),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Yw(),c,l;if(t[0]!==s||t[1]!==i||t[2]!==n||t[3]!==a||t[4]!==o||t[5]!==r){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=en(i,n,s);if(e!==void 0&&typeof e!=`boolean`){let e;t[8]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(y.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`}),t[8]=e):e=t[8],l=e;break bb0}let u=n.length,d=e??r,f;t[9]!==n||t[10]!==o?(f=e=>{e.stopPropagation(),o(n)},t[9]=n,t[10]=o,t[11]=f):f=t[11];let p;t[12]!==n||t[13]!==a?(p=e=>a({keyPath:n,newValue:String(e)}),t[12]=n,t[13]=a,t[14]=p):p=t[14],c=(0,y.jsx)(`button`,{type:`button`,className:W(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,u===2&&`hover:bg-card/30`,u>=3&&``),onClick:f,children:(0,y.jsx)(MO,{value:d,onChange:p})})}t[0]=s,t[1]=i,t[2]=n,t[3]=a,t[4]=o,t[5]=r,t[6]=c,t[7]=l}else c=t[6],l=t[7];return l===Symbol.for(`react.early_return_sentinel`)?c:l},PO=e=>{let{keyPath:t,section:n}=e;return(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[T]).map(r=>{let i={type:T,key:r},a=[...t,i],o=n[T][r];return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,v.createElement)(ak,{...e,key:r,keyPath:a,section:o})]})})})},FO=e=>{let{keyPath:t,section:n}=e;return(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[C]).map(r=>{let i={type:C,key:r},a=[...t,i],o=n[C][r];return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,v.createElement)(ak,{...e,key:r,keyPath:a,section:o})]})})})},IO=(...e)=>e.filter(Boolean).join(` `),LO=Qd([`w-full select-text resize-none text-base shadow-none outline-none`,`transition-all duration-300 md:text-sm`,`ring-0`,`disabled:opacity-50`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`].join(` `),{variants:{variant:{default:[`text-text`,`bg-neutral-50 dark:bg-neutral-950`,`ring-text/20`,`disabled:ring-0`,`hover:ring-3`,`focus-within:ring-4`,`focus-visible:outline-none focus-visible:ring-4`,`[box-shadow:none] focus:[box-shadow:none]`,`aria-invalid:border-error`].join(` `),invisible:`border-none text-inherit outline-none ring-0`},size:{sm:`px-2 py-2 text-sm md:py-1.5 md:text-xs`,md:`px-2 py-3 md:py-2`,lg:`p-4`},validationStyleEnabled:{disabled:``,enabled:`valid:border-success invalid:border-error`}},defaultVariants:{variant:`default`,size:`md`,validationStyleEnabled:`disabled`}}),RO=({validationStyleEnabled:e=!1,variant:t,size:n,className:r,...i})=>(0,y.jsx)(`input`,{className:IO(LO({variant:t,size:n,validationStyleEnabled:e?`enabled`:`disabled`}),r),suppressHydrationWarning:!0,...i}),zO=({className:e,variant:t,validationStyleEnabled:n=!1,...r})=>(0,y.jsx)(`textarea`,{className:W(`resize-none`,LO({variant:t,validationStyleEnabled:n?`enabled`:`disabled`,className:e})),...r}),BO=24,VO=12,HO=({className:e,autoSize:t=!0,onChange:n,maxRows:r=999,ref:i,...a})=>{let o=(0,v.useRef)(null);(0,v.useImperativeHandle)(i,()=>o.current);let s=()=>{let e=o.current;if(!e||!t)return;let n=e.style;n.height=`auto`;let i=e.scrollHeight,a=BO*r+VO;n.height=`${Math.max(Math.min(i,a),36)}px`};return(0,v.useLayoutEffect)(()=>{s()},[a.value,a.defaultValue,s]),(0,y.jsx)(zO,{ref:e=>{o.current=e,e&&s()},onChange:e=>{n?.(e),s()},className:W(`overflow-y-auto`,t&&`resize-none`,e),...a})},UO=({value:e=``,onCancel:t,onSave:n,onClick:r,children:i,isDisabled:a,...o})=>{let[s,c]=(0,v.useState)(!1),l=(0,v.useRef)(null),u=e=>{e.stopPropagation(),c(!1),n()},d=e=>{e.stopPropagation(),c(!1),t()},f=!e||e===``?`-`:e,p=(0,v.useCallback)(e=>{let t=window.getSelection();t&&t.toString().trim()!==``||l.current&&!l.current.contains(e.target)&&(c(!1),n())},[n]);return(0,v.useEffect)(()=>(s?document.addEventListener(`click`,p):document.removeEventListener(`click`,p),()=>document.removeEventListener(`click`,p)),[p,s]),(0,y.jsxs)(`span`,{className:`group/editable-field flex gap-2`,role:`button`,tabIndex:0,onClick:e=>{c(!0),r?.(e)},ref:l,...o,children:[(0,y.jsxs)(`div`,{className:W(`flex flex-1 gap-2`,s?`display`:`hidden`),children:[i,(0,y.jsx)(bO,{label:`Save`,variant:`hoverable`,size:`icon-sm`,color:`text`,Icon:ff,onClick:u,disabled:a,className:`!text-current`,role:`button`,tabIndex:0,"aria-label":`Save changes`,"data-testid":`editable-field-save-button`}),(0,y.jsx)(bO,{label:`Cancel`,color:`text`,variant:`hoverable`,className:`!text-current`,size:`icon-sm`,Icon:Pf,onClick:d,disabled:a,role:`button`,tabIndex:0,"aria-label":`Cancel changes`,"data-testid":`editable-field-cancel-button`})]},String(s)),(0,y.jsxs)(`div`,{className:W(`flex flex-1 gap-2`,s?`hidden`:`display`),children:[(0,y.jsx)(`span`,{className:`ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6`,children:f}),(0,y.jsx)(bO,{label:`Edit`,Icon:Df,color:`text`,variant:`hoverable`,size:`icon-sm`,className:`!text-current invisible group-hover/editable-field:visible`,disabled:a,onClick:e=>{e.stopPropagation(),c(!0)}})]})]})},WO=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,v.useRef)(null);(0,v.useImperativeHandle)(n,()=>i.current);let a=()=>{e?.(i.current?.value??``)},o=()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()},s=r.value??i.current?.value??r.defaultValue??``;return(0,y.jsx)(UO,{value:s,onCancel:o,onSave:a,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,y.jsx)(HO,{className:`leading-6`,ref:i,onClick:e=>{e.preventDefault(),e.stopPropagation()},...r})})},GO=e=>{let t=(0,V.c)(16),{keyPath:n,section:r,editedContent:i,editedContentValue:a,onContentChange:o,onFocusKeyPath:s,renderSection:c}=e,l=Yw(),u;t[0]!==l||t[1]!==i||t[2]!==a||t[3]!==n?(u=a??en(i,n,l),t[0]=l,t[1]=i,t[2]=a,t[3]=n,t[4]=u):u=t[4];let d=u;if(d&&typeof d!=`string`){let e;return t[5]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(y.Fragment,{children:`Error loading section - Edited content Incoherence with the original content format`}),t[5]=e):e=t[5],e}let f=n.length,p=String(d??r),m;if(t[6]!==p||t[7]!==n||t[8]!==f||t[9]!==o||t[10]!==s||t[11]!==c){let e;t[13]!==n||t[14]!==s?(e=e=>{e.stopPropagation(),s(n)},t[13]=n,t[14]=s,t[15]=e):e=t[15],m=(0,y.jsx)(`button`,{type:`button`,className:W(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,f===2&&`hover:bg-card/30`,f>=3&&``),onClick:e,children:typeof c==`function`?c(p):(0,y.jsx)(WO,{"aria-label":`Editable field`,defaultValue:p,onSave:e=>o({keyPath:n,newValue:e}),onCancel:KO})}),t[6]=p,t[7]=n,t[8]=f,t[9]=o,t[10]=s,t[11]=c,t[12]=m}else m=t[12];return m};function KO(){return null}var qO=e=>{let t=(0,V.c)(10),{keyPath:n,section:r}=e,{addEditedContent:i}=nT(),a;if(t[0]!==i||t[1]!==n||t[2]!==e||t[3]!==r){let o=en(e.editedContent,n),s=r[D],{content:c}=r,l=[...n,{type:D}],u;t[5]!==i||t[6]!==n||t[7]!==e.dictionary||t[8]!==r?(u=t=>{i(e.dictionary.localId,{...r,content:t.newValue},n)},t[5]=i,t[6]=n,t[7]=e.dictionary,t[8]=r,t[9]=u):u=t[9],a=(0,y.jsxs)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:[(0,y.jsxs)(`span`,{className:`text-neutral text-sm`,children:[s,` `]}),(0,y.jsx)(GO,{...e,keyPath:l,section:c,editedContentValue:o?.content,onContentChange:u})]}),t[0]=i,t[1]=n,t[2]=e,t[3]=r,t[4]=a}else a=t[4];return a},JO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:F}],i=n[F];return(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,y.jsx)(ak,{...e,keyPath:r,section:i})})},YO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:E}],i=n[E];return(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,y.jsx)(ak,{...e,keyPath:r,section:i})})},XO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:P}],i=n[P];return(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,y.jsx)(ak,{...e,keyPath:r,section:i})})},ZO=(0,v.memo)(e=>{let{keyPath:t,section:n,focusedKeyPath:r=[],onFocusKeyPath:i}=e;return(0,v.useMemo)(()=>Object.keys(n??{}).filter(e=>!ik.includes(e)),[n]).map(a=>{let o={key:a,type:O},s=[...t,o],c=Pt(s,r);return(0,y.jsx)(CO,{level:t.length,title:Rt(a),description:``,isSelected:c,onClick:e=>{e.stopPropagation(),i(c?[]:s)},children:(0,y.jsx)(ak,{...e,keyPath:s,section:n[a]})},a)})}),QO=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,v.useRef)(null),a=()=>{e?.(i.current?.value??``)},o=()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()};(0,v.useImperativeHandle)(n,()=>i.current);let s=(0,v.useMemo)(()=>r.value??i.current?.value??r.defaultValue,[r.value,r.defaultValue,i.current?.value]);return(0,y.jsx)(UO,{value:s,onCancel:o,onSave:a,children:(0,y.jsx)(RO,{ref:i,...r})})},$O=e=>{let t=(0,V.c)(17),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Yw(),c;t[0]!==s||t[1]!==i||t[2]!==n?(c=en(i,n,s),t[0]=s,t[1]=i,t[2]=n,t[3]=c):c=t[3];let l=c;if(l!==void 0&&typeof l!=`number`){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(y.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`}),t[4]=e):e=t[4],e}let u=n.length,d=String(l??r),f;if(t[5]!==d||t[6]!==n||t[7]!==u||t[8]!==a||t[9]!==o){let e;t[11]!==n||t[12]!==o?(e=e=>{e.stopPropagation(),o(n)},t[11]=n,t[12]=o,t[13]=e):e=t[13];let r;t[14]!==n||t[15]!==a?(r=e=>a({keyPath:n,newValue:e}),t[14]=n,t[15]=a,t[16]=r):r=t[16],f=(0,y.jsx)(`button`,{type:`button`,className:W(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,u===2&&`hover:bg-card/30`,u>=3&&``),onClick:e,children:(0,y.jsx)(QO,{"aria-label":`Editable number field`,type:`number`,defaultValue:d,onSave:r,onCancel:ek})}),t[5]=d,t[6]=n,t[7]=u,t[8]=a,t[9]=o,t[10]=f}else f=t[10];return f};function ek(){return null}var tk=e=>{let{keyPath:t,section:n}=e;return(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n).filter(e=>!ik.includes(e)).map(r=>{let i={type:w,key:r},a=[...t,i],o=n[w][r];return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,v.createElement)(ak,{...e,key:r,keyPath:a,section:o})]})})})},nk=e=>{let{keyPath:t,section:n}=e,r=n[ne];return(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(r).map(n=>{let i={type:ne,key:n},a=[...t,i];return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`span`,{className:`flex items-center font-bold`,children:n}),(0,v.createElement)(ak,{...e,key:n,keyPath:a,section:r[n]})]})})})},rk=e=>{let{keyPath:t,section:n,locale:r}=e,i={type:S,key:r},a=[...t,i],o=n[S][r];return(0,y.jsx)(ak,{...e,keyPath:a,section:o})},ik=[`filePath`,`id`,`nodeType`],ak=(0,v.memo)(e=>{let t=Yw(),n=(0,v.useMemo)(()=>en(e.editedContent,e.keyPath,t)??e.section,[e.editedContent,e.keyPath,e.section]),r=(0,v.useMemo)(()=>cn(n),[n]);if(typeof n==`object`)return r===`reactNode`?(0,y.jsx)(`span`,{className:`text-neutral text-xs`,children:`React node not editable`}):r===`nested`?(0,y.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:`[Nested] Dictionary`}):r===`markdown`?(0,y.jsx)(XO,{...e,section:n}):r===`html`?(0,y.jsx)(JO,{...e,section:n}):r===`translation`?(0,y.jsx)(rk,{...e,section:n}):r===`enumeration`?(0,y.jsx)(FO,{...e,section:n}):r===`plural`?(0,y.jsx)(tk,{...e,section:n}):r===`select`?(0,y.jsx)(nk,{...e,section:n}):r===`condition`?(0,y.jsx)(PO,{...e,section:n}):r===`insertion`?(0,y.jsx)(YO,{...e,section:n}):r===`array`?(0,y.jsx)(wO,{...e,section:n}):r===`file`?(0,y.jsx)(qO,{...e,section:n}):(0,y.jsx)(ZO,{...e,section:n});if(typeof n==`string`)return(0,y.jsx)(GO,{...e,section:n});if(typeof n==`number`)return(0,y.jsx)($O,{...e,section:n});if(typeof n==`boolean`)return(0,y.jsx)(NO,{...e,section:n})}),ok=e=>{let t=(0,V.c)(6),{dictionary:n,...r}=e,i=Yw(),{editedContent:a,addEditedContent:o}=nT(),{focusedContent:s,setFocusedContentKeyPath:c}=Zw(),l;t[0]!==n||t[1]!==a?(l=JSON.stringify((a?.[n.localId]??n).content),t[0]=n,t[1]=a,t[2]=l):l=t[2];let u;return t[3]!==o||t[4]!==n.localId?(u=e=>{o(n.localId,e.newValue,e.keyPath)},t[3]=o,t[4]=n.localId,t[5]=u):u=t[5],(0,y.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,v.createElement)(ak,{...r,keyPath:[],locale:i,dictionary:n,key:`${l}${i}`,editedContent:a?.[n.localId]?.content,focusedKeyPath:s?.keyPath,section:n.content,onContentChange:u,onFocusKeyPath:c})})},sk=Qd(`flex flex-col text-text backdrop-blur`,{variants:{roundedSize:{none:`rounded-none`,sm:`rounded-sm [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-md`,md:`rounded-md [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-lg`,lg:`rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl`,xl:`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,"2xl":`rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl`,"3xl":`rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl`,"4xl":`rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]`,full:`rounded-full`},transparency:{none:`bg-card`,xs:`bg-card/95`,sm:`bg-card/90`,md:`bg-card/70`,lg:`bg-card/40`,xl:`bg-card/20`,full:``},padding:{none:`p-0`,sm:`px-3 py-2`,md:`px-4 py-3`,lg:`px-6 py-4`,xl:`px-8 py-6`,"2xl":`px-10 py-8`},separator:{without:``,x:`divide-x divide-dashed divide-text/20`,y:`divide-y divide-dashed divide-text/20`,both:`divide-x divide-y divide-dashed divide-text/20`},border:{none:``,with:`border-[1.3px]`},borderColor:{primary:`border-primary`,secondary:`border-secondary`,neutral:`border-neutral/20`,card:`border-card`,text:`border-text`,error:`border-error`,warning:`border-warning`,success:`border-success`},background:{none:`backdrop-blur-none`,hoverable:`bg-opacity-5! backdrop-blur-0 hover:bg-opacity-10! hover:backdrop-blur focus:bg-opacity-10! focus:backdrop-blur aria-selected:bg-opacity-15! aria-selected:backdrop-blur`,with:``},gap:{none:`gap-0`,sm:`gap-1`,md:`gap-3`,lg:`gap-5`,xl:`gap-8`,"2xl":`gap-10`}},defaultVariants:{roundedSize:`lg`,border:`none`,borderColor:`text`,transparency:`md`,padding:`none`,separator:`without`,gap:`none`},compoundVariants:[{background:`none`,class:`bg-transparent`}]}),ck=({children:e,roundedSize:t,padding:n,transparency:r,separator:i,className:a,border:o,borderColor:s,background:c,gap:l,...u})=>(0,y.jsx)(`div`,{className:W(sk({roundedSize:t,transparency:r,padding:n,separator:i,border:typeof o==`boolean`?o?`with`:`none`:void 0,background:c,borderColor:s,gap:l}),a),...u,children:e}),lk=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:i,validate:a,additionalButtons:o,...s}=e,[c,l]=(0,v.useState)(n),[u,d]=(0,v.useState)(0),f=c!==n,p;t[0]===n?p=t[1]:(p=()=>{l(n),d(uk)},t[0]=n,t[1]=p);let m=p,h;t[2]!==c||t[3]!==r?(h=()=>{r(c)},t[2]=c,t[3]=r,t[4]=h):h=t[4];let g=h,_;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(_=e=>{l(e.currentTarget.value)},t[5]=_):_=t[5];let b=_,x=e=>{e.key===`Enter`&&!i&&w?(e.preventDefault(),g()):e.key===`Escape`&&(e.preventDefault(),m())},S,C;t[6]===n?(S=t[7],C=t[8]):(S=()=>{l(n),d(dk)},C=[n],t[6]=n,t[7]=S,t[8]=C),(0,v.useEffect)(S,C);let w=a?.(c)??!0;return(0,y.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor input`,children:[(0,y.jsx)(RO,{onChange:b,onKeyDown:x,"aria-label":`Editable input value`,"aria-describedby":f||o?`content-editor-input-actions`:void 0,"aria-invalid":!w,variant:`invisible`,className:`size-full`,defaultValue:n,disabled:i,...s},u),(f||o)&&(0,y.jsxs)(`div`,{id:`content-editor-input-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[f&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(bO,{Icon:ff,label:`Save changes${w?``:` (invalid content)`}`,variant:`hoverable`,color:`text`,size:`icon-sm`,className:`cursor-pointer hover:scale-110`,disabled:i||!w,onClick:g,"aria-describedby":w?void 0:`validation-error`}),(0,y.jsx)(bO,{Icon:Pf,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:m,disabled:i})]}),o]})]},String(n))};function uk(e){return e+1}function dk(e){return e+1}var fk=``,pk=e=>{let t=e.querySelectorAll(`[data-line]`);return t.length===0?(e.textContent??``).split(fk).join(``):Array.from(t).map(e=>{let t=e.querySelector(`[data-editable]`)?.textContent??e.textContent??``;return t===fk?``:t.split(fk).join(``)}).join(`
|
|
45
|
+
`)},mk=e=>{let t=e.split(`
|
|
46
|
+
`);return t.length===0?[``]:t},hk=(()=>{if(typeof Intl>`u`||!(`Segmenter`in Intl))return null;let e=Intl.Segmenter;return new e(void 0,{granularity:`grapheme`})})(),gk=(e,t)=>{if(t<=0)return 0;if(hk){let n=[...hk.segment(e.slice(0,t))],r=n[n.length-1];return r?t-r.segment.length:t-1}let n=e.charCodeAt(t-1);return n>=56320&&n<=57343&&t>=2?t-2:t-1},_k=(e,t)=>{if(t>=e.length)return e.length;if(hk){let n=[...hk.segment(e.slice(t))][0];return n?t+n.segment.length:t+1}let n=e.charCodeAt(t);return n>=55296&&n<=56319&&t+1<e.length?t+2:t+1},vk=(e,t)=>{if(t<=0)return 0;let n=t-1;for(;n>0&&/\s/.test(e[n-1]);)n--;for(;n>0&&/\S/.test(e[n-1]);)n--;return n},yk=(e,t)=>{if(t>=e.length)return e.length;let n=t;for(;n<e.length&&/\S/.test(e[n]);)n++;for(;n<e.length&&/\s/.test(e[n]);)n++;return n},bk=(e,t)=>e.slice(0,t).lastIndexOf(`
|
|
47
|
+
`)+1,xk=(e,t)=>{let n=e.indexOf(`
|
|
48
|
+
`,t);return n===-1?e.length:n},Sk=({value:e,defaultValue:t,onChange:n,disabled:r=!1})=>{let i=e??t??``,[a,o]=(0,v.useState)(()=>mk(i)),s=(0,v.useRef)(null),c=(0,v.useRef)(null),l=e!==void 0,u=(0,v.useRef)(a);u.current=a,(0,v.useEffect)(()=>{l&&e!==void 0&&o(mk(e))},[e,l]);let d=()=>u.current.join(`
|
|
49
|
+
`),f=()=>{let e=window.getSelection();if(!e?.rangeCount||!s.current)return null;let t=e.getRangeAt(0),n=s.current.querySelectorAll(`[data-line]`);for(let e=0;e<n.length;e++)if(n[e].contains(t.startContainer))return{line:e,offset:t.startOffset};return null},p=()=>{let e=window.getSelection();if(!e?.rangeCount||!s.current)return null;let t=e.getRangeAt(0),n=s.current.querySelectorAll(`[data-line]`),r=u.current,i=(e,t)=>{for(let i=0;i<n.length;i++)if(n[i].contains(e)){let e=0;for(let t=0;t<i;t++)e+=r[t].length+1;return e+Math.min(t,r[i]?.length??0)}return e===s.current?t===0?0:r.join(`
|
|
50
|
+
`).length:0},a=i(t.startContainer,t.startOffset),o=i(t.endContainer,t.endOffset);return{start:Math.min(a,o),end:Math.max(a,o),hasSelection:!t.collapsed}},m=e=>{if(!s.current)return;let t=s.current.querySelectorAll(`[data-line]`)[e.line];if(!t)return;let n=t.querySelector(`[data-editable]`),r=n?.firstChild??n??t.firstChild??t,i=window.getSelection();if(!i)return;let a=document.createRange(),o=Math.min(e.offset,r.textContent?.length??0);try{a.setStart(r,o),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}catch{a.selectNodeContents(r),a.collapse(!1),i.removeAllRanges(),i.addRange(a)}};(0,v.useLayoutEffect)(()=>{c.current&&s.current&&(m(c.current),c.current=null)});let h=e=>{let t=u.current,n=0;for(let r=0;r<e.line;r++)n+=t[r].length+1;return n+e.offset},g=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){if(n<=t[e].length)return{line:e,offset:n};n-=t[e].length+1}return{line:t.length-1,offset:t[t.length-1]?.length??0}},_=()=>{let e=f();return e?h(e):0},y=(e,t)=>{let r=mk(e);c.current=g(t,r),o(r),n?.(e)};return{lines:a,containerRef:s,getText:d,handleInput:()=>{if(c.current!==null||r||!s.current)return;let e=f(),t=pk(s.current),i=mk(t);c.current=e,o(i),n?.(t)},handleBeforeInput:e=>{if(r)return;let t=e.nativeEvent;if(t.isComposing)return;let n=t.inputType;if(n!==`insertParagraph`&&n!==`insertLineBreak`){if(n===`deleteContentBackward`||n===`deleteContentForward`){e.preventDefault();let t=p();if(!t)return;let r=u.current.join(`
|
|
51
|
+
`);if(t.hasSelection){let e=r.slice(0,t.start)+r.slice(t.end);y(e,t.start)}else if(n===`deleteContentBackward`){if(t.start===0)return;let e=gk(r,t.start),n=r.slice(0,e)+r.slice(t.start);y(n,e)}else{if(t.start>=r.length)return;let e=_k(r,t.start),n=r.slice(0,t.start)+r.slice(e);y(n,t.start)}return}if(n===`insertReplacementText`){e.preventDefault();let n=p();if(!n)return;let r=u.current.join(`
|
|
52
|
+
`),i=t.data??t.dataTransfer?.getData(`text/plain`)??``,a=r.slice(0,n.start)+i+r.slice(n.end);y(a,n.start+i.length);return}if(n===`insertText`&&t.data){e.preventDefault();let n=p();if(!n)return;let r=u.current.join(`
|
|
53
|
+
`),i=t.data,a=r.slice(0,n.start)+i+r.slice(n.end);y(a,n.start+i.length)}}},handleKeyDown:e=>{if(r){e.preventDefault();return}if(e.nativeEvent.isComposing)return;if((e.metaKey||e.ctrlKey)&&e.key===`z`){e.preventDefault();return}let t=p();if(!t)return;let n=u.current.join(`
|
|
54
|
+
`);if(e.key===`Enter`){e.preventDefault();let r=n.slice(0,t.start)+`
|
|
55
|
+
`+n.slice(t.end);y(r,t.start+1);return}if(e.key===`Backspace`){if(e.preventDefault(),t.hasSelection){let e=n.slice(0,t.start)+n.slice(t.end);y(e,t.start)}else{if(t.start===0)return;let r;r=e.metaKey?bk(n,t.start):e.altKey?vk(n,t.start):gk(n,t.start);let i=n.slice(0,r)+n.slice(t.start);y(i,r)}return}if(e.key===`Delete`){if(e.preventDefault(),t.hasSelection){let e=n.slice(0,t.start)+n.slice(t.end);y(e,t.start)}else{if(t.start>=n.length)return;let r;r=e.metaKey?xk(n,t.start):e.altKey?yk(n,t.start):_k(n,t.start);let i=n.slice(0,t.start)+n.slice(r);y(i,t.start)}return}},handleCut:e=>{if(r){e.preventDefault();return}e.preventDefault();let t=p();if(!t?.hasSelection)return;let n=u.current.join(`
|
|
56
|
+
`),i=n.slice(t.start,t.end);e.clipboardData.setData(`text/plain`,i);let a=n.slice(0,t.start)+n.slice(t.end);y(a,t.start)},handlePaste:e=>{if(r){e.preventDefault();return}e.preventDefault();let t=e.clipboardData.getData(`text/plain`);if(!t)return;let n=p();if(!n)return;let i=u.current.join(`
|
|
57
|
+
`),a=i.slice(0,n.start)+t+i.slice(n.end);y(a,n.start+t.length)},handleDrop:e=>{e.preventDefault()},handleDragOver:e=>{e.preventDefault()},getCaretPosition:f,setCaretPosition:m,getCursorOffset:_,caretFromFlatOffset:g}},Ck=({index:e,text:t,isLast:n,ghostText:r})=>(0,y.jsxs)(`span`,{"data-line":e,className:`block min-h-[1.5rem]`,children:[(0,y.jsx)(`span`,{"data-editable":!0,children:t||``}),r&&(0,y.jsx)(`span`,{"data-ghost":!0,className:`pointer-events-none select-none text-neutral`,"aria-hidden":`true`,children:r}),!n&&(0,y.jsx)(`br`,{})]}),wk=24,Tk=12,Ek=({value:e,defaultValue:t,onChange:n,placeholder:r,disabled:i=!1,minRows:a=1,maxRows:o=999,autoSize:s=!0,validationStyleEnabled:c=!1,variant:l,ghostText:u,ghostLine:d,ghostOffset:f,onClick:p,className:m,dir:h=`auto`,ref:g,..._})=>{let{lines:b,containerRef:x,getText:S,handleInput:C,handleBeforeInput:w,handleKeyDown:T,handleCut:E,handlePaste:D,handleDrop:O,handleDragOver:k,getCursorOffset:A,setCaretPosition:j,caretFromFlatOffset:M}=Sk({value:e,defaultValue:t,onChange:n,disabled:i}),N=(0,v.useRef)(null),P=e=>{N.current=e,x.current=e};(0,v.useImperativeHandle)(g,()=>({getContainer:()=>N.current,getText:S,focus:()=>N.current?.focus(),getCursorOffset:A,setCursorAtOffset:e=>{j(M(e,b))}})),(0,v.useLayoutEffect)(()=>{if(!s||!N.current)return;let e=N.current,t=wk*o+Tk,n=wk*a+Tk;e.style.height=`auto`;let r=e.scrollHeight;e.style.height=`${Math.max(Math.min(r,t),n)}px`,e.style.overflowY=r>t?`auto`:`hidden`},[b,s,o,a]);let F=b.length===1&&b[0]===``,I=u&&d!==void 0&&f!==void 0;return(0,y.jsxs)(`div`,{className:`relative w-full`,children:[F&&r&&(0,y.jsx)(`div`,{className:`pointer-events-none absolute inset-0 select-none px-2 py-3 text-base text-neutral-400 leading-[1.5rem] md:py-2 md:text-sm`,"aria-hidden":`true`,children:r}),(0,y.jsx)(`div`,{..._,ref:P,role:`textbox`,"aria-multiline":`true`,"aria-placeholder":r,"aria-disabled":i,"aria-autocomplete":I?`inline`:void 0,tabIndex:i?-1:0,contentEditable:!i,suppressContentEditableWarning:!0,dir:h,onInput:C,onBeforeInput:w,onKeyDown:T,onCut:E,onPaste:D,onDrop:O,onDragOver:k,onClick:p,className:W(`resize-none whitespace-pre-wrap break-words outline-none`,LO({variant:l,validationStyleEnabled:c?`enabled`:`disabled`}),s&&`overflow-y-auto`,m),children:b.map((e,t)=>(0,y.jsx)(Ck,{index:t,text:e,isLast:t===b.length-1,ghostText:I&&d===t?u:void 0},t))})]})},Dk=({isActive:e=!0,suggestion:t,...n})=>{let r=String(n.value??n.defaultValue??``),[i,a]=(0,v.useState)(r),[o,s]=(0,v.useState)(``),c=(0,v.useRef)(null);(0,v.useEffect)(()=>{n.value!==void 0&&a(String(n.value??n.defaultValue??``))},[n.value,n.defaultValue]);let l=()=>{let e=t??o;if(!e)return;let n=c.current?.getCursorOffset()??i.length,r=i.slice(0,n)+e+i.slice(n);a(r),s(``),setTimeout(()=>{c.current?.focus(),c.current?.setCursorAtOffset(n+e.length)},0)},u=e?t??(o||void 0):void 0,d=i.split(`
|
|
58
|
+
`),f=t?d.length-1:void 0,p=t?d[d.length-1]?.length??0:void 0;return(0,y.jsx)(Ek,{ref:c,value:i,onChange:e=>{if(a(e),s(``),n.onChange){let t={target:{value:e},currentTarget:{value:e}};n.onChange(t)}},onKeyDown:e=>{e.key===`Tab`&&(t??o)&&(e.preventDefault(),l()),n.onKeyDown?.(e)},ghostText:u,ghostLine:f,ghostOffset:p,placeholder:n.placeholder,disabled:n.disabled,autoSize:n.autoSize,maxRows:n.maxRows,minRows:n.rows,variant:n.variant,validationStyleEnabled:n.validationStyleEnabled,className:n.className,dir:n.dir,"aria-label":n[`aria-label`],"aria-invalid":n[`aria-invalid`],"aria-describedby":n[`aria-describedby`],"data-testid":n[`data-testid`]})},Ok=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:i,validate:a,additionalButtons:o,...s}=e,{isAuthenticated:c}=hO(),[l,u]=(0,v.useState)(n),[d,f]=(0,v.useState)(0),p=l!==n,m;t[0]===n?m=t[1]:(m=()=>{u(n),f(kk)},t[0]=n,t[1]=m);let h=m,g;t[2]!==l||t[3]!==r?(g=()=>{r(l)},t[2]=l,t[3]=r,t[4]=g):g=t[4];let _=g,b;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(b=e=>u(e.currentTarget.value??``),t[5]=b):b=t[5];let x=b,S=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!i&&T?(e.preventDefault(),_()):e.key===`Escape`&&(e.preventDefault(),h())},C,w;t[6]===n?(C=t[7],w=t[8]):(C=()=>{u(n),f(Ak)},w=[n],t[6]=n,t[7]=C,t[8]=w),(0,v.useEffect)(C,w);let T=a?.(l)??!0;return(0,y.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor textarea`,children:[(0,y.jsx)(Dk,{onChange:x,onKeyDown:S,variant:`invisible`,className:`size-full`,value:n,isActive:c,disabled:i,"aria-label":`Editable textarea content`,"aria-describedby":p||o?`content-editor-textarea-actions`:void 0,"aria-invalid":!T,...s},d),(p||o)&&(0,y.jsxs)(`div`,{id:`content-editor-textarea-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[p&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(bO,{Icon:ff,label:`Save changes${T?``:` (invalid content)`}`,variant:`hoverable`,color:`text`,size:`icon-sm`,className:`cursor-pointer hover:scale-110`,disabled:i||!T,onClick:_,"aria-describedby":T?void 0:`textarea-validation-error`}),(0,y.jsx)(bO,{Icon:Pf,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:h,disabled:i})]}),o]})]},n)};function kk(e){return e+1}function Ak(e){return e+1}var jk=(e,t)=>{let n=(0,V.c)(21),r;n[0]!==t||n[1]!==e?(r=()=>{if(t!==void 0){let n=typeof t==`function`?t():t;if(typeof window>`u`)return n;let r=localStorage?.getItem(e);if(r)try{return JSON.parse(r)}catch(e){console.error(e)}return n}},n[0]=t,n[1]=e,n[2]=r):r=n[2];let[i,a]=(0,v.useState)(r),o;n[3]!==t||n[4]!==e||n[5]!==i?(o=()=>{let n=localStorage?.getItem(e);if(n&&n!==`undefined`&&i===void 0)try{a(JSON.parse(n))}catch(e){console.error(e)}else t!==void 0&&i===void 0&&a(t)},n[3]=t,n[4]=e,n[5]=i,n[6]=o):o=n[6];let s;n[7]!==e||n[8]!==i?(s=[e,i],n[7]=e,n[8]=i,n[9]=s):s=n[9],(0,v.useEffect)(o,s);let c;n[10]===e?c=n[11]:(c=t=>{a(n=>{let r=typeof t==`function`?t(n):t;return r===void 0?n:(localStorage?.setItem(e,JSON.stringify(r)),r)})},n[10]=e,n[11]=c);let l=c,u;n[12]===e?u=n[13]:(u=()=>{let t=localStorage?.getItem(e);t&&a(JSON.parse(t))},n[12]=e,n[13]=u);let d=u,f;n[14]===e?f=n[15]:(f=()=>{localStorage?.removeItem(e),a(void 0)},n[14]=e,n[15]=f);let p=f,m;return n[16]!==p||n[17]!==d||n[18]!==l||n[19]!==i?(m=[i,l,d,p],n[16]=p,n[17]=d,n[18]=l,n[19]=i,n[20]=m):m=n[20],m},Mk=(0,v.createContext)({availableLocales:[],selectedLocales:[],setSelectedLocales:()=>{}}),Nk=()=>(0,v.useContext)(Mk),Pk=e=>{let t=(0,V.c)(16),{availableLocales:n,defaultSelectedLocales:r,children:i}=e,{locale:a}=fn(),o;t[0]!==r||t[1]!==a?(o=r??[a],t[0]=r,t[1]=a,t[2]=o):o=t[2];let[s,c]=jk(`locale-content-selector-selected-locales`,o),l;t[3]!==n||t[4]!==r||t[5]!==a||t[6]!==s||t[7]!==c?(l=()=>{if(n.length&&!s?.some(e=>n.includes(e))){let e=r?.filter(e=>n.includes(e));c(e?.length?e:[a])}},t[3]=n,t[4]=r,t[5]=a,t[6]=s,t[7]=c,t[8]=l):l=t[8];let u;t[9]===n?u=t[10]:(u=[n],t[9]=n,t[10]=u),(0,v.useEffect)(l,u);let d;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==c?(d=(0,y.jsx)(Mk,{value:{availableLocales:n,selectedLocales:s,setSelectedLocales:c},children:i}),t[11]=n,t[12]=i,t[13]=s,t[14]=c,t[15]=d):d=t[15],d},Fk=(e,t,n)=>{let r={...e};for(let i of Object.keys(e))i===t?(r[n]=e[t],delete r[t]):r[i]=e[i];return r},Ik=({htmlFor:e,required:t=!1,disabled:n=!1,className:r,children:i,...a})=>(0,y.jsxs)(`label`,{className:W(`select-none font-medium text-sm leading-none`,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,n&&`cursor-not-allowed text-muted-foreground opacity-70`,r),htmlFor:e,suppressHydrationWarning:!0,...a,children:[i,t&&(0,y.jsx)(`span`,{className:`ml-1 text-error`,"aria-hidden":`true`,title:`This field is required`,children:`*`})]}),Lk=Object.defineProperty,Rk=(e,t)=>Lk(e,`name`,{value:t,configurable:!0});function zk(e,[t,n]){return Math.min(n,Math.max(t,e))}Rk(zk,`clamp`);var Bk=Object.defineProperty,Vk=(e,t)=>Bk(e,`name`,{value:t,configurable:!0}),Hk=v.createContext(void 0);function Uk(e){let t=v.useContext(Hk);return e||t||`ltr`}Vk(Uk,`useDirection`);var Wk=Object.defineProperty,Gk=(e,t)=>Wk(e,`name`,{value:t,configurable:!0}),Kk=0,qk=null;function Jk(e){return Yk(),e.children}Gk(Jk,`FocusGuards`);function Yk(){v.useEffect(()=>{qk||={start:Xk(),end:Xk()};let{start:e,end:t}=qk;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Kk++,()=>{Kk===1&&(qk?.start.remove(),qk?.end.remove(),qk=null),Kk=Math.max(0,Kk-1)}},[])}Gk(Yk,`useFocusGuards`);function Xk(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}Gk(Xk,`createFocusGuard`);var Zk=Object.defineProperty,Qk=(e,t)=>Zk(e,`name`,{value:t,configurable:!0}),$k=`focusScope.autoFocusOnMount`,eA=`focusScope.autoFocusOnUnmount`,tA={bubbles:!1,cancelable:!0},nA=v.forwardRef(Qk(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=iu(i),u=iu(a),d=v.useRef(null),f=_l(t,c),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:lA(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||lA(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&lA(s)};Qk(e,`handleFocusIn`),Qk(t,`handleFocusOut`),Qk(n,`handleMutations`),document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){uA.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent($k,tA);s.addEventListener($k,l),s.dispatchEvent(t),t.defaultPrevented||(rA(pA(aA(s)),{select:!0}),document.activeElement===e&&lA(s))}return()=>{s.removeEventListener($k,l),setTimeout(()=>{let t=new CustomEvent(eA,tA);s.addEventListener(eA,u),s.dispatchEvent(t),t.defaultPrevented||lA(e??document.body,{select:!0}),s.removeEventListener(eA,u),uA.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=iA(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&lA(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&lA(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,y.jsx)(eu.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function rA(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(lA(r,{select:t}),document.activeElement!==n)return}Qk(rA,`focusFirst`);function iA(e){let t=aA(e);return[oA(t,e),oA(t.reverse(),e)]}Qk(iA,`getTabbableEdges`);function aA(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Qk(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}Qk(aA,`getTabbableCandidates`);function oA(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):sA(r,{upTo:t})))return r}Qk(oA,`findVisible`);function sA(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}Qk(sA,`isHidden`);function cA(e){return e instanceof HTMLInputElement&&`select`in e}Qk(cA,`isSelectableInput`);function lA(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&cA(e)&&t&&e.select()}}Qk(lA,`focus`);var uA=dA();function dA(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=fA(e,t),e.unshift(t)},remove(t){e=fA(e,t),e[0]?.resume()}}}Qk(dA,`createFocusScopesStack`);function fA(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Qk(fA,`arrayRemove`);function pA(e){return e.filter(e=>e.tagName!==`A`)}Qk(pA,`removeLinks`);var mA=Object.defineProperty,hA=(e,t)=>mA(e,`name`,{value:t,configurable:!0}),gA=v.useId||(()=>void 0),_A=0;function vA(e){let[t,n]=v.useState(gA());return Su(()=>{e||n(e=>e??String(_A++))},[e]),e||(t?`radix-${t}`:``)}hA(vA,`useId`);var yA=[`top`,`right`,`bottom`,`left`],bA=[`start`,`end`],xA=yA.reduce((e,t)=>e.concat(t,t+`-`+bA[0],t+`-`+bA[1]),[]),SA=Math.min,CA=Math.max,wA=Math.round,TA=Math.floor,EA=e=>({x:e,y:e}),DA={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function OA(e,t,n){return CA(e,SA(t,n))}function kA(e,t){return typeof e==`function`?e(t):e}function AA(e){return e.split(`-`)[0]}function jA(e){return e.split(`-`)[1]}function MA(e){return e===`x`?`y`:`x`}function NA(e){return e===`y`?`height`:`width`}function PA(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function FA(e){return MA(PA(e))}function IA(e,t,n){n===void 0&&(n=!1);let r=jA(e),i=FA(e),a=NA(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=GA(o)),[o,GA(o)]}function LA(e){let t=GA(e);return[RA(e),t,RA(t)]}function RA(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var zA=[`left`,`right`],BA=[`right`,`left`],VA=[`top`,`bottom`],HA=[`bottom`,`top`];function UA(e,t,n){switch(e){case`top`:case`bottom`:return n?t?BA:zA:t?zA:BA;case`left`:case`right`:return t?VA:HA;default:return[]}}function WA(e,t,n,r){let i=jA(e),a=UA(AA(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(RA)))),a}function GA(e){let t=AA(e);return DA[t]+e.slice(t.length)}function KA(e){return{top:0,right:0,bottom:0,left:0,...e}}function qA(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:KA(e)}function JA(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function YA(e,t,n){let{reference:r,floating:i}=e,a=PA(t),o=FA(t),s=NA(o),c=AA(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}switch(jA(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1)}return p}async function XA(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=kA(t,e),p=qA(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=JA(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=JA(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var ZA=50,QA=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:XA},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=YA(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<ZA&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=YA(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},$A=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=kA(e,t)||{};if(l==null)return{};let d=qA(u),f={x:n,y:r},p=FA(i),m=NA(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;(!C||!await(o.isElement==null?void 0:o.isElement(S)))&&(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=SA(d[_],T),D=SA(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=OA(O,A,k),M=!c.arrow&&jA(i)!=null&&A!==j&&a.reference[m]/2-(A<O?E:D)-h[m]/2<0,N=M?A<O?A-O:A-k:0;return{[p]:f[p]+N,data:{[p]:j,centerOffset:A-j-N,...M&&{alignmentOffset:N}},reset:M}}});function ej(e,t,n){return(e?[...n.filter(t=>jA(t)===e),...n.filter(t=>jA(t)!==e)]:n.filter(e=>AA(e)===e)).filter(n=>!e||jA(n)===e||(t?RA(n)!==n:!1))}var tj=function(e){return e===void 0&&(e={}),{name:`autoPlacement`,options:e,async fn(t){let{rects:n,middlewareData:r,placement:i,platform:a,elements:o}=t,{crossAxis:s=!1,alignment:c,allowedPlacements:l=xA,autoAlignment:u=!0,...d}=kA(e,t),f=c!==void 0||l===xA?ej(c||null,u,l):l,p=await a.detectOverflow(t,d),m=r.autoPlacement?.index||0,h=f[m];if(h==null)return{};let g=IA(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[AA(h)],p[g[0]],p[g[1]]],v=[...r.autoPlacement?.overflows||[],{placement:h,overflows:_}],y=f[m+1];if(y)return{data:{index:m+1,overflows:v},reset:{placement:y}};let b=v.map(e=>{let t=jA(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce((e,t)=>e+t,0):e.overflows[0],e.overflows]}).sort((e,t)=>e[1]-t[1]),x=b.filter(e=>e[2].slice(0,jA(e[0])?2:3).every(e=>e<=0))[0]?.[0]||b[0][0];return x===i?{}:{data:{index:m+1,overflows:v},reset:{placement:x}}}}},nj=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=kA(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=AA(r),_=PA(o),v=AA(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[GA(o)]:LA(o)),x=p!==`none`;!d&&x&&b.push(...WA(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=IA(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===PA(t)||T.every(e=>PA(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=PA(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function rj(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ij(e){return yA.some(t=>e[t]>=0)}var aj=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=kA(e,t);switch(i){case`referenceHidden`:{let e=rj(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ij(e)}}}case`escaped`:{let e=rj(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ij(e)}}}default:return{}}}}};function oj(e){let t=SA(...e.map(e=>e.left)),n=SA(...e.map(e=>e.top)),r=CA(...e.map(e=>e.right)),i=CA(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function sj(e){let t=e.slice().sort((e,t)=>e.y-t.y),n=[],r=null;for(let e=0;e<t.length;e++){let i=t[e];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(e=>JA(oj(e)))}var cj=function(e){return e===void 0&&(e={}),{name:`inline`,options:e,async fn(t){let{placement:n,elements:r,rects:i,platform:a,strategy:o}=t,{padding:s=2,x:c,y:l}=kA(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=sj(u),f=JA(oj(u)),p=qA(s);function m(){if(d.length===2&&d[0].left>d[1].right&&c!=null&&l!=null)return d.find(e=>c>e.left-p.left&&c<e.right+p.right&&l>e.top-p.top&&l<e.bottom+p.bottom)||f;if(d.length>=2){if(PA(n)===`y`){let e=d[0],t=d[d.length-1],r=AA(n)===`top`,i=e.top,a=t.bottom,o=r?e.left:t.left,s=r?e.right:t.right;return{top:i,bottom:a,left:o,right:s,width:s-o,height:a-i,x:o,y:i}}let e=AA(n)===`left`,t=CA(...d.map(e=>e.right)),r=SA(...d.map(e=>e.left)),i=d.filter(n=>e?n.left===r:n.right===t),a=i[0].top,o=i[i.length-1].bottom,s=r,c=t;return{top:a,bottom:o,left:s,right:c,width:c-s,height:o-a,x:s,y:a}}return f}let h=await a.getElementRects({reference:{getBoundingClientRect:m},floating:r.floating,strategy:o});return i.reference.x!==h.reference.x||i.reference.y!==h.reference.y||i.reference.width!==h.reference.width||i.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},lj=new Set([`left`,`top`]);async function uj(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=AA(n),s=jA(n),c=PA(n)===`y`,l=lj.has(o)?-1:1,u=a&&c?-1:1,d=kA(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var dj=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await uj(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},fj=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=kA(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=PA(AA(i)),p=MA(f),m=u[p],h=u[f];if(o){let e=p===`y`?`top`:`left`,t=p===`y`?`bottom`:`right`,n=m+d[e],r=m-d[t];m=OA(n,m,r)}if(s){let e=f===`y`?`top`:`left`,t=f===`y`?`bottom`:`right`,n=h+d[e],r=h-d[t];h=OA(n,h,r)}let g=c.fn({...t,[p]:m,[f]:h});return{...g,data:{x:g.x-n,y:g.y-r,enabled:{[p]:o,[f]:s}}}}}},pj=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=kA(e,t),u={x:n,y:r},d=PA(i),f=MA(d),p=u[f],m=u[d],h=kA(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:0,crossAxis:0,...h};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=lj.has(AA(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},mj=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){var n,r;let{placement:i,rects:a,platform:o,elements:s}=t,{apply:c=()=>{},...l}=kA(e,t),u=await o.detectOverflow(t,l),d=AA(i),f=jA(i),p=PA(i)===`y`,{width:m,height:h}=a.floating,g,_;d===`top`||d===`bottom`?(g=d,_=f===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?`start`:`end`)?`left`:`right`):(_=d,g=f===`end`?`top`:`bottom`);let v=h-u.top-u.bottom,y=m-u.left-u.right,b=SA(h-u[g],v),x=SA(m-u[_],y),S=!t.middlewareData.shift,C=b,w=x;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(w=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(C=v),S&&!f){let e=CA(u.left,0),t=CA(u.right,0),n=CA(u.top,0),r=CA(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:CA(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:CA(u.top,u.bottom))}await c({...t,availableWidth:w,availableHeight:C});let T=await o.getDimensions(s.floating);return m!==T.width||h!==T.height?{reset:{rects:!0}}:{}}}};function hj(){return typeof window<`u`}function gj(e){return yj(e)?(e.nodeName||``).toLowerCase():`#document`}function _j(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vj(e){return((yj(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function yj(e){return hj()?e instanceof Node||e instanceof _j(e).Node:!1}function bj(e){return hj()?e instanceof Element||e instanceof _j(e).Element:!1}function xj(e){return hj()?e instanceof HTMLElement||e instanceof _j(e).HTMLElement:!1}function Sj(e){return!hj()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof _j(e).ShadowRoot}function Cj(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=Pj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function wj(e){return/^(table|td|th)$/.test(gj(e))}function Tj(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Ej=/transform|translate|scale|rotate|perspective|filter/,Dj=/paint|layout|strict|content/,Oj=e=>!!e&&e!==`none`,kj;function Aj(e){let t=bj(e)?Pj(e):e;return Oj(t.transform)||Oj(t.translate)||Oj(t.scale)||Oj(t.rotate)||Oj(t.perspective)||!Mj()&&(Oj(t.backdropFilter)||Oj(t.filter))||Ej.test(t.willChange||``)||Dj.test(t.contain||``)}function jj(e){let t=Ij(e);for(;xj(t)&&!Nj(t);){if(Aj(t))return t;if(Tj(t))return null;t=Ij(t)}return null}function Mj(){return kj??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),kj}function Nj(e){return/^(html|body|#document)$/.test(gj(e))}function Pj(e){return _j(e).getComputedStyle(e)}function Fj(e){return bj(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ij(e){if(gj(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Sj(e)&&e.host||vj(e);return Sj(t)?t.host:t}function Lj(e){let t=Ij(e);return Nj(t)?e.ownerDocument?e.ownerDocument.body:e.body:xj(t)&&Cj(t)?t:Lj(t)}function Rj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=Lj(e),i=r===e.ownerDocument?.body,a=_j(r);if(i){let e=zj(a);return t.concat(a,a.visualViewport||[],Cj(r)?r:[],e&&n?Rj(e):[])}return t.concat(r,Rj(r,[],n))}function zj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Bj(e){let t=Pj(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=xj(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=wA(n)!==a||wA(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Vj(e){return bj(e)?e:e.contextElement}function Hj(e){let t=Vj(e);if(!xj(t))return EA(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Bj(t),o=(a?wA(n.width):n.width)/r,s=(a?wA(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var Uj=EA(0);function Wj(e){let t=_j(e);return!Mj()||!t.visualViewport?Uj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Gj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==_j(e)?!1:t}function Kj(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Vj(e),o=EA(1);t&&(r?bj(r)&&(o=Hj(r)):o=Hj(e));let s=Gj(a,n,r)?Wj(a):EA(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a){let e=_j(a),t=r&&bj(r)?_j(r):r,n=e,i=zj(n);for(;i&&r&&t!==n;){let e=Hj(i),t=i.getBoundingClientRect(),r=Pj(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=_j(i),i=zj(n)}}return JA({width:u,height:d,x:c,y:l})}function qj(e,t){let n=Fj(e).scrollLeft;return t?t.left+n:Kj(vj(e)).left+n}function Jj(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-qj(e,n),y:n.top+t.scrollTop}}function Yj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=vj(r),s=t?Tj(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=EA(1),u=EA(0),d=xj(r);if((d||!d&&!a)&&((gj(r)!==`body`||Cj(o))&&(c=Fj(r)),d)){let e=Kj(r);l=Hj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Jj(o,c):EA(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function Xj(e){return Array.from(e.getClientRects())}function Zj(e){let t=vj(e),n=Fj(e),r=e.ownerDocument.body,i=CA(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=CA(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+qj(e),s=-n.scrollTop;return Pj(r).direction===`rtl`&&(o+=CA(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Qj=25;function $j(e,t){let n=_j(e),r=vj(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=Mj();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=qj(r);if(l<=0){let e=r.ownerDocument,t=e.body,n=getComputedStyle(t),i=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,o=Math.abs(r.clientWidth-t.clientWidth-i);o<=Qj&&(a-=o)}else l<=Qj&&(a+=l);return{width:a,height:o,x:s,y:c}}function eM(e,t){let n=Kj(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=xj(e)?Hj(e):EA(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function tM(e,t,n){let r;if(t===`viewport`)r=$j(e,n);else if(t===`document`)r=Zj(vj(e));else if(bj(t))r=eM(t,n);else{let n=Wj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return JA(r)}function nM(e,t){let n=Ij(e);return n===t||!bj(n)||Nj(n)?!1:Pj(n).position===`fixed`||nM(n,t)}function rM(e,t){let n=t.get(e);if(n)return n;let r=Rj(e,[],!1).filter(e=>bj(e)&&gj(e)!==`body`),i=null,a=Pj(e).position===`fixed`,o=a?Ij(e):e;for(;bj(o)&&!Nj(o);){let t=Pj(o),n=Aj(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||Cj(o)&&!n&&nM(e,o))?r=r.filter(e=>e!==o):i=t,o=Ij(o)}return t.set(e,r),r}function iM(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Tj(t)?[]:rM(t,this._c):[].concat(n),r],o=tM(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=tM(t,a[e],i);s=CA(n.top,s),c=SA(n.right,c),l=SA(n.bottom,l),u=CA(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function aM(e){let{width:t,height:n}=Bj(e);return{width:t,height:n}}function oM(e,t,n){let r=xj(t),i=vj(t),a=n===`fixed`,o=Kj(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=EA(0);function l(){c.x=qj(i)}if(r||!r&&!a){if((gj(t)!==`body`||Cj(i))&&(s=Fj(t)),r){let e=Kj(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else i&&l()}a&&!r&&i&&l();let u=i&&!r&&!a?Jj(i,s):EA(0);return{x:o.left+s.scrollLeft-c.x-u.x,y:o.top+s.scrollTop-c.y-u.y,width:o.width,height:o.height}}function sM(e){return Pj(e).position===`static`}function cM(e,t){if(!xj(e)||Pj(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return vj(e)===n&&(n=n.ownerDocument.body),n}function lM(e,t){let n=_j(e);if(Tj(e))return n;if(!xj(e)){let t=Ij(e);for(;t&&!Nj(t);){if(bj(t)&&!sM(t))return t;t=Ij(t)}return n}let r=cM(e,t);for(;r&&wj(r)&&sM(r);)r=cM(r,t);return r&&Nj(r)&&sM(r)&&!Aj(r)?n:r||jj(e)||n}var uM=async function(e){let t=this.getOffsetParent||lM,n=this.getDimensions,r=await n(e.floating);return{reference:oM(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function dM(e){return Pj(e).direction===`rtl`}var fM={convertOffsetParentRelativeRectToViewportRelativeRect:Yj,getDocumentElement:vj,getClippingRect:iM,getOffsetParent:lM,getElementRects:uM,getClientRects:Xj,getDimensions:aM,getScale:Hj,isElement:bj,isRTL:dM};function pM(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function mM(e,t){let n=null,r,i=vj(e);function a(){var e;clearTimeout(r),(e=n)==null||e.disconnect(),n=null}function o(s,c){s===void 0&&(s=!1),c===void 0&&(c=1),a();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(s||t(),!f||!p)return;let m=TA(d),h=TA(i.clientWidth-(u+f)),g=TA(i.clientHeight-(d+p)),_=TA(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:CA(0,SA(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(n!==c){if(!y)return o();n?o(!1,n):r=setTimeout(()=>{o(!1,1e-7)},1e3)}n===1&&!pM(l,e.getBoundingClientRect())&&o(),y=!1}try{n=new IntersectionObserver(b,{...v,root:i.ownerDocument})}catch{n=new IntersectionObserver(b,v)}n.observe(e)}return o(!0),a}function hM(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=Vj(e),u=i||a?[...l?Rj(l):[],...t?Rj(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?mM(l,n):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?Kj(e):null;c&&g();function g(){let t=Kj(e);h&&!pM(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var gM=dj,_M=tj,vM=fj,yM=nj,bM=mj,xM=aj,SM=$A,CM=cj,wM=pj,TM=(e,t,n)=>{let r=new Map,i={platform:fM,...n},a={...i.platform,_c:r};return QA(e,t,{...i,platform:a})},EM=typeof document<`u`?v.useLayoutEffect:function(){};function DM(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!DM(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!DM(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function OM(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function kM(e,t){let n=OM(e);return Math.round(t*n)/n}function AM(e){let t=v.useRef(e);return EM(()=>{t.current=e}),t}function jM(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=v.useState(r);DM(f,r)||p(r);let[m,h]=v.useState(null),[g,_]=v.useState(null),y=v.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=v.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=v.useRef(null),w=v.useRef(null),T=v.useRef(u),E=c!=null,D=AM(c),O=AM(i),k=AM(l),A=v.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),TM(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!DM(T.current,t)&&(T.current=t,Zl.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);EM(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let j=v.useRef(!1);EM(()=>(j.current=!0,()=>{j.current=!1}),[]),EM(()=>{if(x&&(C.current=x),S&&(w.current=S),x&&S){if(D.current)return D.current(x,S,A);A()}},[x,S,A,D,E]);let M=v.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),N=v.useMemo(()=>({reference:x,floating:S}),[x,S]),P=v.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=kM(N.floating,u.x),r=kM(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...OM(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return v.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var MM=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:SM({element:r.current,padding:i}).fn(n):r?SM({element:r,padding:i}).fn(n):{}}}},NM=(e,t)=>{let n=gM(e);return{name:n.name,fn:n.fn,options:[e,t]}},PM=(e,t)=>{let n=vM(e);return{name:n.name,fn:n.fn,options:[e,t]}},FM=(e,t)=>({fn:wM(e).fn,options:[e,t]}),IM=(e,t)=>{let n=yM(e);return{name:n.name,fn:n.fn,options:[e,t]}},LM=(e,t)=>{let n=bM(e);return{name:n.name,fn:n.fn,options:[e,t]}},RM=(e,t)=>{let n=xM(e);return{name:n.name,fn:n.fn,options:[e,t]}},zM=(e,t)=>{let n=MM(e);return{name:n.name,fn:n.fn,options:[e,t]}},BM=Object.defineProperty,VM=(e,t)=>BM(e,`name`,{value:t,configurable:!0});function HM(e){let[t,n]=v.useState(void 0);return Su(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}VM(HM,`useSize`);var UM=Object.defineProperty,WM=(e,t)=>UM(e,`name`,{value:t,configurable:!0}),GM=`Popper`,[KM,qM]=xl(GM),[JM,YM]=KM(GM),XM=WM(e=>{let{__scopePopper:t,children:n}=e,[r,i]=v.useState(null),[a,o]=v.useState(void 0);return(0,y.jsx)(JM,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),ZM=`PopperAnchor`,QM=v.forwardRef(WM(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=YM(ZM,n),o=v.useRef(null),s=a.onAnchorChange,c=_l(t,v.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=v.useRef(null);v.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&aN(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,y.jsx)(eu.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),$M=`PopperContent`,[eN,tN]=KM($M),nN=v.forwardRef(WM(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:d=`partial`,hideWhenDetached:f=!1,updatePositionStrategy:p=`optimized`,onPlaced:m,...h}=e,g=YM($M,n),[_,b]=v.useState(null),x=_l(t,b),[S,C]=v.useState(null),w=HM(S),T=w?.width??0,E=w?.height??0,D=r+(a===`center`?``:`-`+a),O=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},k=Array.isArray(l)?l:[l],A=k.length>0,j={padding:O,boundary:k.filter(rN),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=jM({strategy:`fixed`,placement:D,whileElementsMounted:WM((...e)=>hM(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[NM({mainAxis:i+E,alignmentAxis:o}),c&&PM({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?FM():void 0,...j}),c&&IM({...j}),LM({...j,apply:WM(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),S&&zM({element:S,padding:s}),iN({arrowWidth:T,arrowHeight:E}),f&&RM({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),L=g.setPlacementState;Su(()=>(L(P),()=>{L(void 0)}),[P,L]);let[ee,te]=aN(P),ne=iu(m);Su(()=>{F&&ne?.()},[F,ne]);let R=I.arrow?.x,z=I.arrow?.y,B=I.arrow?.centerOffset!==0,[re,ie]=v.useState();return Su(()=>{_&&ie(window.getComputedStyle(_).zIndex)},[_]),(0,y.jsx)(`div`,{ref:M.setFloating,"data-radix-popper-content-wrapper":``,style:{...N,transform:F?N.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:re,"--radix-popper-transform-origin":[I.transformOrigin?.x,I.transformOrigin?.y].join(` `),...I.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,y.jsx)(eN,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:C,arrowX:R,arrowY:z,shouldHideArrow:B,children:(0,y.jsx)(eu.div,{"data-side":ee,"data-align":te,...h,ref:x,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function rN(e){return e!==null}WM(rN,`isNotNull`);var iN=WM(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=aN(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function aN(e){let[t,n=`center`]=e.split(`-`);return[t,n]}WM(aN,`getSideAndAlignFromPlacement`);var oN=XM,sN=QM,cN=nN,lN=Object.defineProperty,uN=(e,t)=>lN(e,`name`,{value:t,configurable:!0});function dN(e){let t=v.useRef({value:e,previous:e});return v.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}uN(dN,`usePrevious`);var fN=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},pN=new WeakMap,mN=new WeakMap,hN={},gN=0,_N=function(e){return e&&(e.host||_N(e.parentNode))},vN=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=_N(t);return n&&e.contains(n)?n:(console.error(`aria-hidden`,t,`in not contained inside`,e,`. Doing nothing`),null)}).filter(function(e){return!!e})},yN=function(e,t,n,r){var i=vN(t,Array.isArray(e)?e:[e]);hN[n]||(hN[n]=new WeakMap);var a=hN[n],o=[],s=new Set,c=new Set(i),l=function(e){!e||s.has(e)||(s.add(e),l(e.parentNode))};i.forEach(l);var u=function(e){!e||c.has(e)||Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),i=t!==null&&t!==`false`,c=(pN.get(e)||0)+1,l=(a.get(e)||0)+1;pN.set(e,c),a.set(e,l),o.push(e),c===1&&i&&mN.set(e,!0),l===1&&e.setAttribute(n,`true`),i||e.setAttribute(r,`true`)}catch(t){console.error(`aria-hidden: cannot operate on `,e,t)}})};return u(t),s.clear(),gN++,function(){o.forEach(function(e){var t=pN.get(e)-1,i=a.get(e)-1;pN.set(e,t),a.set(e,i),t||(mN.has(e)||e.removeAttribute(r),mN.delete(e)),i||e.removeAttribute(n)}),gN--,gN||(pN=new WeakMap,pN=new WeakMap,mN=new WeakMap,hN={})}},bN=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||fN(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),yN(r,i,n,`aria-hidden`)):function(){return null}},xN=function(){return xN=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},xN.apply(this,arguments)};function SN(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function CN(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}var wN=`right-scroll-bar-position`,TN=`width-before-scroll-bar`,EN=`with-scroll-bars-hidden`,DN=`--removed-body-scroll-bar-size`;function ON(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function kN(e,t){var n=(0,v.useState)(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(e){var t=n.value;t!==e&&(n.value=e,n.callback(e,t))}}}})[0];return n.callback=t,n.facade}var AN=typeof window<`u`?v.useLayoutEffect:v.useEffect,jN=new WeakMap;function MN(e,t){var n=kN(t||null,function(t){return e.forEach(function(e){return ON(e,t)})});return AN(function(){var t=jN.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||ON(e,null)}),i.forEach(function(e){r.has(e)||ON(e,a)})}jN.set(n,e)},[e]),n}function NN(e){return e}function PN(e,t){t===void 0&&(t=NN);var n=[],r=!1;return{read:function(){if(r)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(e){var i=t(e,r);return n.push(i),function(){n=n.filter(function(e){return e!==i})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var i=n;n=[],i.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},o=function(){return Promise.resolve().then(a)};o(),n={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),n}}}}}function FN(e){e===void 0&&(e={});var t=PN(null);return t.options=xN({async:!0,ssr:!1},e),t}var IN=function(e){var t=e.sideCar,n=SN(e,[`sideCar`]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw Error(`Sidecar medium not found`);return v.createElement(r,xN({},n))};IN.isSideCarExport=!0;function LN(e,t){return e.useMedium(t),IN}var RN=FN(),zN=function(){},BN=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:zN,onWheelCapture:zN,onTouchMoveCapture:zN}),i=r[0],a=r[1],o=e.forwardProps,s=e.children,c=e.className,l=e.removeScrollBar,u=e.enabled,d=e.shards,f=e.sideCar,p=e.noRelative,m=e.noIsolation,h=e.inert,g=e.allowPinchZoom,_=e.as,y=_===void 0?`div`:_,b=e.gapMode,x=SN(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=MN([n,t]),w=xN(xN({},x),i);return v.createElement(v.Fragment,null,u&&v.createElement(S,{sideCar:RN,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:b}),o?v.cloneElement(v.Children.only(s),xN(xN({},w),{ref:C})):v.createElement(y,xN({},w,{className:c,ref:C}),s))});BN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},BN.classNames={fullWidth:TN,zeroRight:wN};var VN,HN=function(){if(VN)return VN;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function UN(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=HN();return t&&e.setAttribute(`nonce`,t),e}function WN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function GN(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var KN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=UN())&&(WN(t,n),GN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},qN=function(){var e=KN();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},JN=function(){var e=qN();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},YN={left:0,top:0,right:0,gap:0},XN=function(e){return parseInt(e||``,10)||0},ZN=function(e){var t=window.getComputedStyle(document.body),n=t[e===`padding`?`paddingLeft`:`marginLeft`],r=t[e===`padding`?`paddingTop`:`marginTop`],i=t[e===`padding`?`paddingRight`:`marginRight`];return[XN(n),XN(r),XN(i)]},QN=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return YN;var t=ZN(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},$N=JN(),eP=`data-scroll-locked`,tP=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
59
|
+
.${EN} {
|
|
60
|
+
overflow: hidden ${r};
|
|
61
|
+
padding-right: ${s}px ${r};
|
|
62
|
+
}
|
|
63
|
+
body[${eP}] {
|
|
64
|
+
overflow: hidden ${r};
|
|
65
|
+
overscroll-behavior: contain;
|
|
66
|
+
${[t&&`position: relative ${r};`,n===`margin`&&`
|
|
67
|
+
padding-left: ${i}px;
|
|
68
|
+
padding-top: ${a}px;
|
|
69
|
+
padding-right: ${o}px;
|
|
70
|
+
margin-left:0;
|
|
71
|
+
margin-top:0;
|
|
72
|
+
margin-right: ${s}px ${r};
|
|
73
|
+
`,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)}
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.${wN} {
|
|
77
|
+
right: ${s}px ${r};
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.${TN} {
|
|
81
|
+
margin-right: ${s}px ${r};
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.${wN} .${wN} {
|
|
85
|
+
right: 0 ${r};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.${TN} .${TN} {
|
|
89
|
+
margin-right: 0 ${r};
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
body[${eP}] {
|
|
93
|
+
${DN}: ${s}px;
|
|
94
|
+
}
|
|
95
|
+
`},nP=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},rP=function(){v.useEffect(function(){return document.body.setAttribute(eP,(nP()+1).toString()),function(){var e=nP()-1;e<=0?document.body.removeAttribute(eP):document.body.setAttribute(eP,e.toString())}},[])},iP=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;rP();var a=v.useMemo(function(){return QN(i)},[i]);return v.createElement($N,{styles:tP(a,!t,i,n?``:`!important`)})},aP=!1;if(typeof window<`u`)try{var oP=Object.defineProperty({},"passive",{get:function(){return aP=!0,!0}});window.addEventListener(`test`,oP,oP),window.removeEventListener(`test`,oP,oP)}catch{aP=!1}var sP=aP?{passive:!1}:!1,cP=function(e){return e.tagName===`TEXTAREA`},lP=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!cP(e)&&n[t]===`visible`)},uP=function(e){return lP(e,`overflowY`)},dP=function(e){return lP(e,`overflowX`)},fP=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),hP(e,r)){var i=gP(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},pP=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},mP=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},hP=function(e,t){return e===`v`?uP(t):dP(t)},gP=function(e,t){return e===`v`?pP(t):mP(t)},_P=function(e,t){return e===`h`&&t===`rtl`?-1:1},vP=function(e,t,n,r,i){var a=_P(e,window.getComputedStyle(t).direction),o=a*r,s=n.target,c=t.contains(s),l=!1,u=o>0,d=0,f=0;do{if(!s)break;var p=gP(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&hP(e,s)&&(d+=h,f+=m);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!c&&s!==document.body||c&&(t.contains(s)||t===s));return(u&&(i&&Math.abs(d)<1||!i&&o>d)||!u&&(i&&Math.abs(f)<1||!i&&-o>f))&&(l=!0),l},yP=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},bP=function(e){return[e.deltaX,e.deltaY]},xP=function(e){return e&&`current`in e?e.current:e},SP=function(e,t){return e[0]===t[0]&&e[1]===t[1]},CP=function(e){return`
|
|
96
|
+
.block-interactivity-${e} {pointer-events: none;}
|
|
97
|
+
.allow-interactivity-${e} {pointer-events: all;}
|
|
98
|
+
`},wP=0,TP=[];function EP(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),i=v.useState(wP++)[0],a=v.useState(JN)[0],o=v.useRef(e);v.useEffect(function(){o.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=CN([e.lockRef.current],(e.shards||[]).map(xP),!0).filter(Boolean);return t.forEach(function(e){return e.classList.add(`allow-interactivity-${i}`)}),function(){document.body.classList.remove(`block-interactivity-${i}`),t.forEach(function(e){return e.classList.remove(`allow-interactivity-${i}`)})}}},[e.inert,e.lockRef.current,e.shards]);var s=v.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=yP(e),a=n.current,s=`deltaX`in e?e.deltaX:a[0]-i[0],c=`deltaY`in e?e.deltaY:a[1]-i[1],l,u=e.target,d=Math.abs(s)>Math.abs(c)?`h`:`v`;if(`touches`in e&&d===`h`&&u.type===`range`)return!1;var f=window.getSelection(),p=f&&f.anchorNode;if(p&&(p===u||p.contains(u)))return!1;var m=fP(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=fP(d,u)),!m)return!1;if(!r.current&&`changedTouches`in e&&(s||c)&&(r.current=l),!l)return!0;var h=r.current||l;return vP(h,t,e,h===`h`?s:c,!0)},[]),c=v.useCallback(function(e){var n=e;if(!(!TP.length||TP[TP.length-1]!==a)){var r=`deltaY`in n?bP(n):yP(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&SP(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(xP).filter(Boolean).filter(function(e){return e.contains(n.target)});(c.length>0?s(n,c[0]):!o.current.noIsolation)&&n.cancelable&&n.preventDefault()}}},[]),l=v.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:DP(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=v.useCallback(function(e){n.current=yP(e),r.current=void 0},[]),d=v.useCallback(function(t){l(t.type,bP(t),t.target,s(t,e.lockRef.current))},[]),f=v.useCallback(function(t){l(t.type,yP(t),t.target,s(t,e.lockRef.current))},[]);v.useEffect(function(){return TP.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,sP),document.addEventListener(`touchmove`,c,sP),document.addEventListener(`touchstart`,u,sP),function(){TP=TP.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,sP),document.removeEventListener(`touchmove`,c,sP),document.removeEventListener(`touchstart`,u,sP)}},[]);var p=e.removeScrollBar,m=e.inert;return v.createElement(v.Fragment,null,m?v.createElement(a,{styles:CP(i)}):null,p?v.createElement(iP,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function DP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var OP=LN(RN,EP),kP=v.forwardRef(function(e,t){return v.createElement(BN,xN({},e,{ref:t,sideCar:OP}))});kP.classNames=BN.classNames;var AP=Object.defineProperty,jP=(e,t)=>AP(e,`name`,{value:t,configurable:!0}),MP=[` `,`Enter`,`ArrowUp`,`ArrowDown`],NP=[` `,`Enter`],PP=`Select`,[FP,IP,LP]=Bl(PP),[RP,zP]=xl(PP,[LP,qM]),BP=qM(),[VP,HP]=RP(PP),[UP,WP]=RP(PP);function GP(e){let{__scopeSelect:t,children:n,open:r,defaultOpen:i,onOpenChange:a,value:o,defaultValue:s,onValueChange:c,dir:l,name:u,autoComplete:d,disabled:f,required:p,form:m,internal_do_not_use_render:h}=e,g=BP(t),[_,b]=v.useState(null),[x,S]=v.useState(null),[C,w]=v.useState(!1),T=Uk(l),[E,D]=Hu({prop:r,defaultProp:i??!1,onChange:a,caller:PP}),[O,k]=Hu({prop:o,defaultProp:s,onChange:c,caller:PP}),A=v.useRef(null),j=v.useRef(O);v.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=jP(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,k]);let M=!_||!!m||!!_.closest(`form`),[N,P]=v.useState(new Set),F=vA(),I=Array.from(N).map(e=>e.props.value).join(`;`),L=v.useCallback(e=>{P(t=>new Set(t).add(e))},[]),ee=v.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:p,trigger:_,onTriggerChange:b,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:C,onValueNodeHasChildrenChange:w,contentId:F,value:O,onValueChange:k,open:E,onOpenChange:D,dir:T,triggerPointerDownPosRef:A,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:N,nativeSelectKey:I,isFormControl:M};return(0,y.jsx)(oN,{...g,children:(0,y.jsx)(VP,{scope:t,...te,children:(0,y.jsx)(FP.Provider,{scope:t,children:(0,y.jsx)(UP,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:ee,children:IF(h)?h(te):n})})})})}jP(GP,`SelectProvider`);var KP=jP(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,y.jsx)(GP,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,y.jsxs)(y.Fragment,{children:[n,e?(0,y.jsx)(FF,{__scopeSelect:t}):null]})})},`Select`),qP=`SelectTrigger`,JP=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=BP(n),o=HP(qP,n),s=o.disabled||r,c=_l(t,o.onTriggerChange),l=IP(n),u=v.useRef(`touch`),[d,f,p]=RF(e=>{let t=l().filter(e=>!e.disabled),n=zF(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=jP(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,y.jsx)(sN,{asChild:!0,...a,children:(0,y.jsx)(eu.button,{type:`button`,role:`combobox`,"aria-controls":o.open?o.contentId:void 0,"aria-expanded":o.open,"aria-required":o.required,"aria-autocomplete":`none`,dir:o.dir,"data-state":o.open?`open`:`closed`,disabled:s,"data-disabled":s?``:void 0,"data-placeholder":LF(o.value)?``:void 0,...i,ref:c,onClick:G(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:G(i.onPointerDown,e=>{u.current=e.pointerType;let t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),e.button===0&&e.ctrlKey===!1&&e.pointerType===`mouse`&&(m(e),e.preventDefault())}),onKeyDown:G(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&MP.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),YP=`SelectValue`,XP=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=HP(YP,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=_l(t,c.onValueNodeChange);Su(()=>{l(u)},[l,u]);let f=LF(c.value);return(0,y.jsx)(eu.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,y.jsx)(v.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),ZP=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,y.jsx)(eu.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[QP,$P]=RP(`SelectPortal`,{forceMount:void 0}),eF=jP(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,y.jsx)(QP,{scope:e.__scopeSelect,forceMount:n,children:(0,y.jsx)(wu,{asChild:!0,...r})})},`SelectPortal`),tF=`SelectContent`,nF=v.forwardRef(jP(function(e,t){let n=$P(tF,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=HP(tF,e.__scopeSelect),[o,s]=v.useState();return Su(()=>{s(new DocumentFragment)},[]),(0,y.jsx)(Ou,{present:r||a.open,children:({present:e})=>e?(0,y.jsx)(cF,{...i,ref:t}):(0,y.jsx)(rF,{...i,fragment:o})})},`SelectContent`)),rF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?Zl.createPortal((0,y.jsx)(aF,{scope:n,children:(0,y.jsx)(FP.Slot,{scope:n,children:(0,y.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),iF=10,[aF,oF]=RP(tF),sF=Tl(`SelectContent.RemoveScroll`),cF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n}=e,{position:r=`item-aligned`,onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:o,side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g,..._}=e,b=HP(tF,n),[x,S]=v.useState(null),[C,w]=v.useState(null),T=_l(t,S),[E,D]=v.useState(null),[O,k]=v.useState(null),A=IP(n),[j,M]=v.useState(!1),N=v.useRef(!1);v.useEffect(()=>{if(x)return bN(x)},[x]),Yk();let P=v.useCallback(e=>{let[t,...n]=A().map(e=>e.ref.current),[r]=n.slice(-1),i=document.activeElement;for(let n of e)if(n===i||(n?.scrollIntoView({block:`nearest`}),n===t&&C&&(C.scrollTop=0),n===r&&C&&(C.scrollTop=C.scrollHeight),n?.focus(),document.activeElement!==i))return},[A,C]),F=v.useCallback(()=>P([E,x]),[P,E,x]);v.useEffect(()=>{j&&F()},[j,F]);let{onOpenChange:I,triggerPointerDownPosRef:L}=b;v.useEffect(()=>{if(x){let e={x:0,y:0},t=jP(t=>{e={x:Math.abs(Math.round(t.pageX)-(L.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(L.current?.y??0))}},`handlePointerMove`),n=jP(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(x)||I(!1),document.removeEventListener(`pointermove`,t),L.current=null},`handlePointerUp`);return L.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[x,I,L]),v.useEffect(()=>{let e=jP(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[ee,te]=RF(e=>{let t=A().filter(e=>!e.disabled),n=zF(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=v.useCallback((e,t,n)=>{let r=!N.current&&!n;(b.value!==void 0&&b.value===t||r)&&(D(e),r&&(N.current=!0))},[b.value]),R=v.useCallback(()=>x?.focus(),[x]),z=v.useCallback((e,t,n)=>{let r=!N.current&&!n;(b.value!==void 0&&b.value===t||r)&&k(e)},[b.value]),B=r===`popper`?uF:lF,re=B===uF?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,y.jsx)(aF,{scope:n,content:x,viewport:C,onViewportChange:w,itemRefCallback:ne,selectedItem:E,onItemLeave:R,itemTextRefCallback:z,focusSelectedItem:F,selectedItemText:O,position:r,isPositioned:j,searchRef:ee,children:(0,y.jsx)(kP,{as:sF,allowPinchZoom:!0,children:(0,y.jsx)(nA,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:G(i,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,y.jsx)(fu,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:(0,y.jsx)(B,{role:`listbox`,id:b.contentId,"data-state":b.open?`open`:`closed`,dir:b.dir,onContextMenu:e=>e.preventDefault(),..._,...re,onPlaced:()=>M(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:G(_.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&te(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if([`ArrowUp`,`End`].includes(e.key)&&(t=t.slice().reverse()),[`ArrowUp`,`ArrowDown`].includes(e.key)){let n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>P(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),lF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=HP(tF,n),o=oF(tF,n),[s,c]=v.useState(null),[l,u]=v.useState(null),d=_l(t,u),f=IP(n),p=v.useRef(!1),m=v.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:b}=o,x=v.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&_){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=_.getBoundingClientRect();if(a.dir!==`rtl`){let r=i.left-t.left,a=n.left-r,o=e.left-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-iF,d=zk(a,[iF,Math.max(iF,u-l)]);s.style.minWidth=c+`px`,s.style.left=d+`px`}else{let r=t.right-i.right,a=window.innerWidth-n.right-r,o=window.innerWidth-e.right-a,c=e.width+o,l=Math.max(c,t.width),u=window.innerWidth-iF,d=zk(a,[iF,Math.max(iF,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-iF*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),v=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+v+u+b+y,S=Math.min(g.offsetHeight*5,x),C=window.getComputedStyle(h),w=parseInt(C.paddingTop,10),T=parseInt(C.paddingBottom,10),E=e.top+e.height/2-iF,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+v+k,j=x-A;if(A<=E){let e=o.length>0&&g===o[o.length-1].ref.current;s.style.bottom=`0px`;let t=l.clientHeight-h.offsetTop-h.offsetHeight,n=A+Math.max(D,O+(e?T:0)+t+y);s.style.height=n+`px`}else{let e=o.length>0&&g===o[0].ref.current;s.style.top=`0px`;let t=Math.max(E,m+h.offsetTop+(e?w:0)+O)+j;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${iF}px 0`,s.style.minHeight=S+`px`,s.style.maxHeight=c+`px`,r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,l,h,g,_,a.dir,r]);Su(()=>x(),[x]);let[S,C]=v.useState();Su(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]);let w=v.useCallback(e=>{e&&m.current===!0&&(x(),b?.(),m.current=!1)},[x,b]);return(0,y.jsx)(dF,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:w,children:(0,y.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,y.jsx)(eu.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),uF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=iF,...a}=e,o=BP(n);return(0,y.jsx)(cN,{...o,...a,ref:t,align:r,collisionPadding:i,style:{boxSizing:`border-box`,...a.style,"--radix-select-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-select-content-available-width":`var(--radix-popper-available-width)`,"--radix-select-content-available-height":`var(--radix-popper-available-height)`,"--radix-select-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-select-trigger-height":`var(--radix-popper-anchor-height)`}})},`SelectPopperPosition`)),[dF,fF]=RP(tF,{}),pF=`SelectViewport`,mF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=oF(pF,n),o=fF(pF,n),s=_l(t,a.onViewportChange),c=v.useRef(0);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`style`,{dangerouslySetInnerHTML:{__html:`[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}`},nonce:r}),(0,y.jsx)(FP.Slot,{scope:n,children:(0,y.jsx)(eu.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:G(i.onScroll,e=>{let t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=o;if(r?.current&&n){let e=Math.abs(c.current-t.scrollTop);if(e>0){let r=window.innerHeight-iF*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o<r){let i=o+e,a=Math.min(r,i),s=i-a;n.style.height=a+`px`,n.style.bottom===`0px`&&(t.scrollTop=s>0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[hF,gF]=RP(`SelectGroup`),_F=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,...r}=e,i=vA();return(0,y.jsx)(hF,{scope:n,id:i,children:(0,y.jsx)(eu.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),vF=`SelectLabel`,yF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,...r}=e,i=gF(vF,n);return(0,y.jsx)(eu.div,{id:i.id,...r,ref:t})},`SelectLabel`)),bF=`SelectItem`,[xF,SF]=RP(bF),CF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=HP(bF,n),c=oF(bF,n),l=s.value===r,[u,d]=v.useState(a??``),[f,p]=v.useState(!1),m=_l(t,iu(e=>c.itemRefCallback?.(e,r,i))),h=vA(),g=v.useRef(`touch`),_=jP(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,y.jsx)(xF,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:v.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,y.jsx)(FP.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,y.jsx)(eu.div,{role:`option`,"aria-labelledby":h,"data-highlighted":f?``:void 0,"aria-selected":l&&f,"data-state":l?`checked`:`unchecked`,"aria-disabled":i||void 0,"data-disabled":i?``:void 0,tabIndex:i?void 0:-1,...o,ref:m,onFocus:G(o.onFocus,()=>p(!0)),onBlur:G(o.onBlur,()=>p(!1)),onClick:G(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:G(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:G(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:G(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:G(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:G(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(NP.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),wF=`SelectItemText`,TF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=HP(wF,n),s=oF(wF,n),c=SF(wF,n),l=WP(wF,n),[u,d]=v.useState(null),f=iu(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=_l(t,d,c.onItemTextChange,f),m=u?.textContent,h=v.useMemo(()=>(0,y.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:_}=l;return Su(()=>(g(h),()=>_(h)),[g,_,h]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(eu.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!LF(o.value)?Zl.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),EF=`SelectItemIndicator`,DF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,...r}=e;return SF(EF,n).isSelected?(0,y.jsx)(eu.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),OF=`SelectScrollUpButton`,kF=v.forwardRef(jP(function(e,t){let n=oF(OF,e.__scopeSelect),r=fF(OF,e.__scopeSelect),[i,a]=v.useState(!1),o=_l(t,r.onScrollButtonChange);return Su(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};jP(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,y.jsx)(MF,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),AF=`SelectScrollDownButton`,jF=v.forwardRef(jP(function(e,t){let n=oF(AF,e.__scopeSelect),r=fF(AF,e.__scopeSelect),[i,a]=v.useState(!1),o=_l(t,r.onScrollButtonChange);return Su(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};jP(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,y.jsx)(MF,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),MF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=oF(`SelectScrollButton`,n),o=v.useRef(null),s=IP(n),c=v.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return v.useEffect(()=>()=>c(),[c]),Su(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,y.jsx)(eu.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:G(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:G(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:G(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),NF=v.forwardRef(jP(function(e,t){let{__scopeSelect:n,...r}=e;return(0,y.jsx)(eu.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),PF=`SelectBubbleInput`,FF=v.forwardRef(jP(function({__scopeSelect:e,...t},n){let r=HP(PF,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=v.useRef(null),m=_l(n,p),h=i??``,g=dN(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return v.useEffect(()=>{let e=p.current;if(!e)return;let t=window.HTMLSelectElement.prototype,n=Object.getOwnPropertyDescriptor(t,`value`).set;if(g!==h&&n){let t=new Event(`change`,{bubbles:!0});n.call(e,h),e.dispatchEvent(t)}},[g,h]),(0,y.jsxs)(eu.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Yu,...t.style},ref:m,defaultValue:h,children:[LF(i)&&!_?(0,y.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function IF(e){return typeof e==`function`}jP(IF,`isFunction`);function LF(e){return e===``||e===void 0}jP(LF,`shouldShowPlaceholder`);function RF(e){let t=iu(e),n=v.useRef(``),r=v.useRef(0),i=v.useCallback(e=>{let i=n.current+e;t(i),jP((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=v.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return v.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}jP(RF,`useTypeaheadSearch`);function zF(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=BF(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.textValue.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}jP(zF,`findNextItem`);function BF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}jP(BF,`wrapArray`);var VF=KP,HF=_F,UF=XP,WF=({validationStyleEnabled:e=!1,className:t,children:n,...r})=>(0,y.jsxs)(JP,{suppressHydrationWarning:!0,className:W(`flex w-full cursor-pointer items-center justify-between whitespace-nowrap`,`select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-text`,`ring-0`,`focus-visible:outline-none`,`focus-visible:ring-3`,`focus-visible:ring-neutral-200`,`dark:focus-visible:ring-neutral-500`,`focus-visible:ring-offset-white`,`dark:focus-visible:ring-offset-neutral-500`,`[box-shadow:none] focus:[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,`[&>span]:line-clamp-1`,e&&`valid:border-success invalid:border-error`,t),...r,children:[n,(0,y.jsx)(ZP,{asChild:!0,children:(0,y.jsx)(_f,{className:`size-4 opacity-50`})})]}),GF=({className:e,...t})=>(0,y.jsx)(kF,{className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,y.jsx)(gf,{})}),KF=({className:e,...t})=>(0,y.jsx)(jF,{className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,y.jsx)(pf,{})}),qF=({className:e,children:t,position:n=`popper`,...r})=>(0,y.jsx)(eF,{children:(0,y.jsxs)(nF,{className:W(`relative z-50 max-h-96 min-w-32 overflow-hidden`,`rounded-xl shadow-md`,`bg-white dark:bg-neutral-950`,`text-text`,`border border-neutral-200 dark:border-neutral-800`,`data-[state=closed]:animate-out data-[state=open]:animate-in`,`data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,`data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95`,`data-[side=bottom]:slide-in-from-top-2`,`data-[side=left]:slide-in-from-right-2`,`data-[side=right]:slide-in-from-left-2`,`data-[side=top]:slide-in-from-bottom-2`,n===`popper`&&`data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,y.jsx)(GF,{}),(0,y.jsx)(mF,{className:W(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:t}),(0,y.jsx)(KF,{})]})}),JF=({className:e,...t})=>(0,y.jsx)(yF,{className:W(`px-1 py-0.5 font-semibold text-sm`,e),...t}),YF=({className:e,children:t,...n})=>(0,y.jsxs)(CF,{className:W(`relative flex w-full cursor-pointer select-none items-center rounded-lg py-1.5 pr-8 pl-2 text-sm outline-hidden focus:bg-neutral/10 data-disabled:pointer-events-none data-disabled:opacity-50`,e),...n,children:[(0,y.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,y.jsx)(DF,{children:(0,y.jsx)(ff,{className:`size-4`})})}),(0,y.jsx)(TF,{children:t})]}),XF=({className:e,...t})=>(0,y.jsx)(NF,{className:W(`-mx-1 my-1 h-px`,`bg-neutral-200 dark:bg-neutral-800`,e),...t}),Y=VF;Y.Group=HF,Y.Value=UF,Y.Trigger=WF,Y.ScrollUpButton=GF,Y.ScrollDownButton=KF,Y.Content=qF,Y.Label=JF,Y.Item=YF,Y.Separator=XF;var ZF=e=>{let t,n;if(typeof e==`number`||!Number.isNaN(Number(e)))t=`=`,n=e.toString();else if(typeof e==`string`){let r=[`<=`,`>=`,`<`,`>`,`=`].find(t=>e.startsWith(t));r&&(t=r,n=e.slice(r.length))}return{comparator:t,numberValue:n}},QF=e=>{let t=(0,V.c)(13),{value:n,onChange:r}=e,i;t[0]===n?i=t[1]:(i=ZF(n),t[0]=n,t[1]=i);let{comparator:a,numberValue:o}=i,[s,c]=(0,v.useState)(a??null),[l,u]=(0,v.useState)(o??null),d,f;t[2]!==s||t[3]!==a||t[4]!==o||t[5]!==l||t[6]!==r?(d=()=>{s&&l&&(s!==a||l!==o)&&r(`${s}${l}`)},f=[s,a,o,l,r],t[2]=s,t[3]=a,t[4]=o,t[5]=l,t[6]=r,t[7]=d,t[8]=f):(d=t[7],f=t[8]),(0,v.useEffect)(d,f);let p;if(t[9]!==a||t[10]!==l){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=e=>u(e.target.value),t[12]=e):e=t[12],p=(0,y.jsxs)(`div`,{className:`flex gap-1`,children:[(0,y.jsxs)(Y,{onValueChange:c,defaultValue:a,children:[(0,y.jsx)(Y.Trigger,{className:`w-20`,children:(0,y.jsx)(Y.Value,{placeholder:`Select a comparator`})}),(0,y.jsxs)(Y.Content,{children:[(0,y.jsx)(Y.Item,{value:`<`,children:`<`}),(0,y.jsx)(Y.Item,{value:`<=`,children:`<=`}),(0,y.jsx)(Y.Item,{value:`=`,children:`=`}),(0,y.jsx)(Y.Item,{value:`>=`,children:`>=`}),(0,y.jsx)(Y.Item,{value:`>`,children:`>`})]})]}),(0,y.jsx)(RO,{type:`number`,"aria-label":`Quantity`,defaultValue:l??void 0,onChange:e,className:`min-w-4`})]}),t[9]=a,t[10]=l,t[11]=p}else p=t[11];return p},$F=({rawContent:e})=>{let[t,n]=(0,v.useState)(``);return(0,v.useEffect)(()=>{ht(async()=>{let{default:e}=await import(`./purify.es-JEAr64Sr.js`);return{default:e}},[]).then(({default:t})=>{n(t.sanitize(e))})},[e]),t?(0,y.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):(0,y.jsx)(`div`,{})},eI=(0,v.lazy)(()=>ht(()=>import(`./MarkDownRender-CDk9zs5-.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0,1,2,3]))),tI=(0,v.lazy)(()=>ht(()=>import(`./MarkdownEditor-o0H3vQy2.js`).then(e=>({default:e.MarkdownEditor})),__vite__mapDeps([4,2,3,1,5]))),nI=(0,v.memo)(function(e){let t=(0,V.c)(2),{label:n,...r}=e,[i,a]=(0,v.useState)(!1),o;return t[0]===i?o=t[1]:(o=e=>{e&&!i&&a(!0)},t[0]=i,t[1]=o),(0,y.jsx)(SO,{header:n,label:n,onToggle:o,children:i?(0,y.jsx)(xI,{...r}):null})}),rI=e=>{let t=(0,V.c)(14),{keyPath:n,dictionary:r,...i}=e,{editedContent:a,addEditedContent:o}=nT(),s=eT(),{mutate:c,isPending:l}=iO(),u;t[0]!==o||t[1]!==r||t[2]!==n?(u=e=>o(r.localId,e,n),t[0]=o,t[1]=r,t[2]=n,t[3]=u):u=t[3];let d;return t[4]!==o||t[5]!==c||t[6]!==s?.ai?.apiKey||t[7]!==s?.ai?.model||t[8]!==s?.ai?.temperature||t[9]!==s?.internationalization||t[10]!==r||t[11]!==a||t[12]!==n?(d=()=>{c({fileContent:JSON.stringify({...r,...a?.[r.localId]??{}}),keyPath:n,locales:s?.internationalization.locales??[],aiOptions:{apiKey:s?.ai?.apiKey,model:s?.ai?.model,temperature:s?.ai?.temperature}},{onSuccess:e=>{if(e?.data)try{let t=e.data.fileContent;o(r.localId,t,n)}catch(e){console.error(e)}}})},t[4]=o,t[5]=c,t[6]=s?.ai?.apiKey,t[7]=s?.ai?.model,t[8]=s?.ai?.temperature,t[9]=s?.internationalization,t[10]=r,t[11]=a,t[12]=n,t[13]=d):d=t[13],(0,y.jsx)(Ok,{variant:`default`,onContentChange:u,additionalButtons:(0,y.jsx)(bO,{Icon:Nf,label:`Audit`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,isLoading:l,onClick:d}),...i})},iI=e=>{let t=(0,V.c)(4),{keyPath:n,dictionary:r,...i}=e,{addEditedContent:a}=nT(),o;return t[0]!==a||t[1]!==r||t[2]!==n?(o=e=>a(r.localId,e,n),t[0]=a,t[1]=r,t[2]=n,t[3]=o):o=t[3],(0,y.jsx)(lk,{variant:`default`,onContentChange:o,...i})},aI=[{content:`False`,value:!1},{content:`True`,value:!0}],oI=e=>{let t=(0,V.c)(4),{dictionary:n,keyPath:r,...i}=e,{addEditedContent:a}=nT(),o;return t[0]!==a||t[1]!==n||t[2]!==r?(o=e=>a(n.localId,e,r),t[0]=a,t[1]=n,t[2]=r,t[3]=o):o=t[3],(0,y.jsx)(MO,{choices:aI,value:!0,onChange:o,color:`text`,size:`sm`,...i})},sI=e=>{let t=(0,V.c)(15),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{locale:o,defaultLocale:s}=fn(),{selectedLocales:c}=Nk(),l=n[S],u;if(t[0]!==l||t[1]!==s||t[2]!==i||t[3]!==r||t[4]!==o||t[5]!==a||t[6]!==c){let e;t[8]!==l||t[9]!==s||t[10]!==i||t[11]!==r||t[12]!==o||t[13]!==a?(e=e=>{let t=`${JSON.stringify(r)}-translation-${e}`;return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 w-full p-2 text-xs`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:Yt(e,o)})}),(0,y.jsx)(`tr`,{className:`flex`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(SI,{section:l[e]??nn(l[s]),keyPath:[...r,{type:S,key:e}],dictionary:i,renderSection:a})})})]},t)},t[8]=l,t[9]=s,t[10]=i,t[11]=r,t[12]=o,t[13]=a,t[14]=e):e=t[14],u=(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:c.map(e)})}),t[0]=l,t[1]=s,t[2]=i,t[3]=r,t[4]=o,t[5]=a,t[6]=c,t[7]=u}else u=t[7];return u},cI=e=>{let t=(0,V.c)(19),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=nT(),{addNewEnumeration:s,removeEnumeration:c}=dn(`navigation-view`),l=n[C],u;t[0]===l?u=t[1]:(u=Object.keys(l),t[0]=l,t[1]=u);let d=u[0],f;if(t[2]!==o||t[3]!==s.label.value||t[4]!==s.text||t[5]!==l||t[6]!==i||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==a||t[11]!==n){let e;t[13]!==o||t[14]!==l||t[15]!==i||t[16]!==d||t[17]!==r?(e=()=>o(i.localId,nn(l[d])??``,[...r,{type:C,key:`unknown`}]),t[13]=o,t[14]=l,t[15]=i,t[16]=d,t[17]=r,t[18]=e):e=t[18],f=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(n[C]).map(e=>{let t=[...r,{type:C,key:e}],s=`${JSON.stringify(r)}-enumeration-${e}`;return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(`div`,{className:`flex flex-1`,children:(0,y.jsx)(bO,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,Icon:Mf,onClick:()=>o(i.localId,void 0,t),children:c.text})})})}),(0,y.jsx)(`tr`,{className:`w-full p-2`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(QF,{value:e,onChange:t=>{let a=n[C],s=Fk(a,e,t),c={...n,[C]:s};console.log(`newValue`,c),o(i.localId,c,r)}})})}),(0,y.jsx)(`tr`,{className:`block w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(xI,{section:l[e]??nn(l[d]),keyPath:t,dictionary:i,renderSection:a})})})]},s)})})}),(0,y.jsx)(bO,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:e,Icon:Of,className:`m-2`,children:s.text})]}),t[2]=o,t[3]=s.label.value,t[4]=s.text,t[5]=l,t[6]=i,t[7]=d,t[8]=r,t[9]=c,t[10]=a,t[11]=n,t[12]=f}else f=t[12];return f},lI=e=>{let t=(0,V.c)(19),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=nT(),{addNewSelectCase:s,removeSelectCase:c}=dn(`navigation-view`),l=n[ne],u;t[0]===l?u=t[1]:(u=Object.keys(l),t[0]=l,t[1]=u);let d=u[0],f;if(t[2]!==o||t[3]!==s.label.value||t[4]!==s.text||t[5]!==l||t[6]!==i||t[7]!==d||t[8]!==r||t[9]!==c||t[10]!==a||t[11]!==n){let e;t[13]!==o||t[14]!==l||t[15]!==i||t[16]!==d||t[17]!==r?(e=()=>o(i.localId,nn(l[d])??``,[...r,{type:ne,key:`newCase`}]),t[13]=o,t[14]=l,t[15]=i,t[16]=d,t[17]=r,t[18]=e):e=t[18],f=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(l).map(e=>{let t=[...r,{type:ne,key:e}],s=`${JSON.stringify(r)}-select-${e}`;return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(`div`,{className:`flex flex-1`,children:(0,y.jsx)(bO,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,Icon:Mf,onClick:()=>o(i.localId,void 0,t),children:c.text})})})}),(0,y.jsx)(`tr`,{className:`w-full p-2`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(lk,{"aria-label":`Edit case`,type:`text`,variant:`default`,onContentChange:t=>{let a={...n,[ne]:Fk(l,e,String(t))};o(i.localId,a,r)},children:e})})}),(0,y.jsx)(`tr`,{className:`block w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(xI,{section:l[e]??nn(l[d]),keyPath:t,dictionary:i,renderSection:a})})})]},s)})})}),(0,y.jsx)(bO,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:e,Icon:Of,className:`m-2`,children:s.text})]}),t[2]=o,t[3]=s.label.value,t[4]=s.text,t[5]=l,t[6]=i,t[7]=d,t[8]=r,t[9]=c,t[10]=a,t[11]=n,t[12]=f}else f=t[12];return f},uI=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[T];return(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`true`,`false`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-condition-${e}`;return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,y.jsx)(`tr`,{className:`block w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(SI,{section:i[e]??nn(i.true),keyPath:[...t,{type:T,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},dI=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[te];return(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`male`,`female`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-gender-${e}`;return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,y.jsx)(`tr`,{className:`block w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(SI,{section:i[e]??nn(i.male),keyPath:[...t,{type:te,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},fI=[`zero`,`one`,`two`,`few`,`many`,`other`],pI=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[w];return(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:fI.map(e=>{let a=`${JSON.stringify(t)}-plural-${e}`;return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:e})}),(0,y.jsx)(`tr`,{className:`block w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(SI,{section:i[e]??nn(i.other),keyPath:[...t,{type:w,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},mI=e=>{let t=(0,V.c)(22),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=nT(),{addNewElement:s,removeElement:c}=dn(`navigation-view`),l;if(t[0]!==o||t[1]!==s.label.value||t[2]!==s.text||t[3]!==i||t[4]!==r||t[5]!==c||t[6]!==a||t[7]!==n){let e;t[9]!==o||t[10]!==i||t[11]!==r||t[12]!==c||t[13]!==a||t[14]!==n[0]?(e=(e,t)=>{let s=`${JSON.stringify(r)}-array-${t}`;return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 w-full p-2`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,y.jsx)(`span`,{className:`text-xs`,children:String(t)}),(0,y.jsx)(bO,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,onClick:()=>{let e=[...r,{type:k,key:t}];o(i.localId,void 0,e)},Icon:Mf,children:c.text})]})})}),(0,y.jsx)(`tr`,{className:`block w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(SI,{section:e??nn(n[0]),keyPath:[...r,{type:k,key:t}],dictionary:i,renderSection:a})})})]},s)},t[9]=o,t[10]=i,t[11]=r,t[12]=c,t[13]=a,t[14]=n[0],t[15]=e):e=t[15];let u;t[16]!==o||t[17]!==i||t[18]!==r||t[19]!==n[0]||t[20]!==n.length?(u=()=>{let e=[...r,{type:k,key:n.length}];o(i.localId,nn(n[0])??``,e,!1)},t[16]=o,t[17]=i,t[18]=r,t[19]=n[0],t[20]=n.length,t[21]=u):u=t[21],l=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:n.map(e)})}),(0,y.jsx)(bO,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:u,Icon:Of,children:s.text})]}),t[0]=o,t[1]=s.label.value,t[2]=s.text,t[3]=i,t[4]=r,t[5]=c,t[6]=a,t[7]=n,t[8]=l}else l=t[8];return l},hI=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e,a=Object.keys(i)[0];return(0,y.jsx)(`table`,{className:`w-full`,children:(0,y.jsx)(`tbody`,{className:`flex flex-col gap-2`,children:Object.keys(i).map(e=>{let o=[...t,{type:O,key:e}],s=i[e]??nn(i[a]),c=`${JSON.stringify(t)}-object-${e}`;return typeof s!=`object`||!s?(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`tr`,{className:`mt-2 p-2 text-xs`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,y.jsx)(`tr`,{className:`block w-full`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(xI,{section:s,keyPath:o,dictionary:n,renderSection:r})})})]},c):(0,y.jsx)(`tr`,{className:`block w-full border-neutral/10 border-t py-1`,children:(0,y.jsx)(`td`,{className:`flex w-full`,children:(0,y.jsx)(nI,{label:Rt(e),section:s,keyPath:o,dictionary:n,renderSection:r})})},c)})})})},gI=e=>{let t=(0,V.c)(5),{section:n,keyPath:r,dictionary:i}=e,[a,o]=(0,v.useState)(0),s;if(t[0]!==i||t[1]!==r||t[2]!==a||t[3]!==n){let e=[{content:`Edit`,value:0},{content:`Preview`,value:1}],c=[...r,{type:F}],l=n[F];s=(0,y.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,y.jsx)(MO,{choices:e,value:a,onChange:o,color:`text`,size:`sm`,className:`ml-auto`}),(0,y.jsx)(SI,{section:l,keyPath:c,dictionary:i,renderSection:a===1?CI:void 0})]}),t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=s}else s=t[4];return s},_I=e=>{let t=(0,V.c)(12),{section:n,keyPath:r,dictionary:i,isDarkMode:a}=e,[o,s]=(0,v.useState)(0),{addEditedContent:c}=nT(),l;if(t[0]!==c||t[1]!==i||t[2]!==a||t[3]!==r||t[4]!==o||t[5]!==n){let e=[{content:`Edit`,value:0},{content:`Raw`,value:1},{content:`Preview`,value:2}],u=[...r,{type:P}],d=n.markdown??``,f;t[7]!==c||t[8]!==i?(f=(e,t)=>(0,y.jsx)(v.Suspense,{fallback:(0,y.jsx)(_O,{}),children:(0,y.jsx)(tI,{defaultValue:e,onChange:e=>c(i.localId,e,t)},JSON.stringify(t))}),t[7]=c,t[8]=i,t[9]=f):f=t[9];let p=f,m;t[10]===a?m=t[11]:(m=e=>(0,y.jsx)(v.Suspense,{fallback:(0,y.jsx)(_O,{}),children:(0,y.jsx)(eI,{isDarkMode:a,children:e})}),t[10]=a,t[11]=m);let h=m;l=(0,y.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,y.jsx)(MO,{choices:e,value:o,onChange:s,color:`text`,size:`sm`,className:`ml-auto`}),(0,y.jsx)(SI,{section:d,keyPath:u,dictionary:i,renderSection:o===0?p:o===2?h:void 0})]}),t[0]=c,t[1]=i,t[2]=a,t[3]=r,t[4]=o,t[5]=n,t[6]=l}else l=t[6];return l},vI=({section:e,keyPath:t,...n})=>{let r=[...t,{type:E}],i=e[E];return(0,y.jsx)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:(0,y.jsx)(SI,{section:i,keyPath:r,...n})})},yI=({section:e,keyPath:t,...n})=>{let r=[...t,{type:D}],i=e[D],{content:a}=e;return(0,y.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,y.jsxs)(`span`,{className:`text-neutral text-sm`,children:[i,` `]}),(0,y.jsx)(SI,{section:a,keyPath:r,...n})]})},bI=e=>{let{keyPath:t,dictionary:n,renderSection:r,section:i,...a}=e,{addEditedContent:o}=nT(),s=i[A],c=[...t,{type:A}];return(0,y.jsxs)(`div`,{className:`flex w-full flex-col gap-4 p-2`,children:[(0,y.jsx)(Ik,{children:`Dictionary key`}),(0,y.jsx)(lk,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,dictionaryKey:String(e)},c)},children:s.dictionaryKey??``}),(0,y.jsx)(Ik,{children:`Path (optional)`}),(0,y.jsx)(lk,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,path:e===``?void 0:e},c)},children:s.path??``})]})},xI=(0,v.memo)(function(e){let t=(0,V.c)(87),{section:n,keyPath:r,dictionary:i,renderSection:a,isDarkMode:o}=e,{tsxNotEditable:s}=dn(`navigation-view`),c,l;if(t[0]!==i||t[1]!==o||t[2]!==r||t[3]!==a||t[4]!==n||t[5]!==s){l=Symbol.for(`react.early_return_sentinel`);bb0:{let e=cn(n);if(e===`reactNode`){let e;t[8]===s?e=t[9]:(e=(0,y.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,y.jsx)(`span`,{children:`(React Node)`}),(0,y.jsx)(`span`,{className:`flex text-neutral text-xs`,children:s})]}),t[8]=s,t[9]=e),l=e;break bb0}if(e===`nested`){let e;t[10]!==i||t[11]!==r||t[12]!==a||t[13]!==n?(e=(0,y.jsx)(bI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[10]=i,t[11]=r,t[12]=a,t[13]=n,t[14]=e):e=t[14],l=e;break bb0}if(e===`translation`){let e;t[15]!==i||t[16]!==r||t[17]!==a||t[18]!==n?(e=(0,y.jsx)(sI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[15]=i,t[16]=r,t[17]=a,t[18]=n,t[19]=e):e=t[19],l=e;break bb0}if(e===`enumeration`){let e;t[20]!==i||t[21]!==r||t[22]!==a||t[23]!==n?(e=(0,y.jsx)(cI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[20]=i,t[21]=r,t[22]=a,t[23]=n,t[24]=e):e=t[24],l=e;break bb0}if(e===`condition`){let e;t[25]!==i||t[26]!==r||t[27]!==a||t[28]!==n?(e=(0,y.jsx)(uI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[25]=i,t[26]=r,t[27]=a,t[28]=n,t[29]=e):e=t[29],l=e;break bb0}if(e===`select`){let e;t[30]!==i||t[31]!==r||t[32]!==a||t[33]!==n?(e=(0,y.jsx)(lI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[30]=i,t[31]=r,t[32]=a,t[33]=n,t[34]=e):e=t[34],l=e;break bb0}if(e===`gender`){let e;t[35]!==i||t[36]!==r||t[37]!==a||t[38]!==n?(e=(0,y.jsx)(dI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[35]=i,t[36]=r,t[37]=a,t[38]=n,t[39]=e):e=t[39],l=e;break bb0}if(e===`plural`){let e;t[40]!==i||t[41]!==r||t[42]!==a||t[43]!==n?(e=(0,y.jsx)(pI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[40]=i,t[41]=r,t[42]=a,t[43]=n,t[44]=e):e=t[44],l=e;break bb0}if(e===`insertion`){let e;t[45]!==i||t[46]!==r||t[47]!==a||t[48]!==n?(e=(0,y.jsx)(vI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[45]=i,t[46]=r,t[47]=a,t[48]=n,t[49]=e):e=t[49],l=e;break bb0}if(e===`markdown`){let e;t[50]!==i||t[51]!==o||t[52]!==r||t[53]!==n?(e=(0,y.jsx)(_I,{dictionary:i,keyPath:r,section:n,isDarkMode:o}),t[50]=i,t[51]=o,t[52]=r,t[53]=n,t[54]=e):e=t[54],l=e;break bb0}if(e===`html`){let e;t[55]!==i||t[56]!==r||t[57]!==n?(e=(0,y.jsx)(gI,{dictionary:i,keyPath:r,section:n}),t[55]=i,t[56]=r,t[57]=n,t[58]=e):e=t[58],l=e;break bb0}if(e===`file`){let e;t[59]!==i||t[60]!==r||t[61]!==a||t[62]!==n?(e=(0,y.jsx)(yI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[59]=i,t[60]=r,t[61]=a,t[62]=n,t[63]=e):e=t[63],l=e;break bb0}if(e===`array`){let e;t[64]!==i||t[65]!==r||t[66]!==a||t[67]!==n?(e=(0,y.jsx)(mI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[64]=i,t[65]=r,t[66]=a,t[67]=n,t[68]=e):e=t[68],l=e;break bb0}if(e===`object`){let e;t[69]!==i||t[70]!==r||t[71]!==a||t[72]!==n?(e=(0,y.jsx)(hI,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[69]=i,t[70]=r,t[71]=a,t[72]=n,t[73]=e):e=t[73],l=e;break bb0}if(e===`number`){let e;t[74]!==i||t[75]!==r||t[76]!==n?(e=(0,y.jsx)(`div`,{className:`w-full p-2`,children:(0,y.jsx)(iI,{dictionary:i,keyPath:r,type:`number`,"aria-label":`Edit field`,children:n})}),t[74]=i,t[75]=r,t[76]=n,t[77]=e):e=t[77],l=e;break bb0}if(e===`text`){let e;t[78]!==i||t[79]!==r||t[80]!==a||t[81]!==n?(e=(0,y.jsx)(`div`,{className:`w-full p-2`,children:typeof a==`function`?a(n,r):(0,y.jsx)(rI,{variant:`default`,"aria-label":`Edit field`,keyPath:r,dictionary:i,children:n})}),t[78]=i,t[79]=r,t[80]=a,t[81]=n,t[82]=e):e=t[82],l=e;break bb0}if(e===`boolean`){let e;t[83]!==i||t[84]!==r||t[85]!==n?(e=(0,y.jsx)(`div`,{className:`w-full p-2`,children:(0,y.jsx)(oI,{dictionary:i,keyPath:r,value:n})}),t[83]=i,t[84]=r,t[85]=n,t[86]=e):e=t[86],l=e;break bb0}c=(0,y.jsxs)(`div`,{className:`w-full p-2`,children:[`Error. Format not supported.`,JSON.stringify(n,null,2),JSON.stringify(r,null,2),`NodeType : `,e]})}t[0]=i,t[1]=o,t[2]=r,t[3]=a,t[4]=n,t[5]=s,t[6]=c,t[7]=l}else c=t[6],l=t[7];return l===Symbol.for(`react.early_return_sentinel`)?c:l}),SI=(0,v.memo)(function(e){return(0,y.jsx)(ck,{border:!0,background:`none`,className:`top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky`,roundedSize:`2xl`,children:(0,y.jsx)(xI,{...e})})});function CI(e){return(0,y.jsx)($F,{rawContent:e})}var wI=Qd(`gap-3 transition-all duration-300 focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50`,{variants:{variant:{default:`h-auto justify-start border-inherit bg-current/0 px-1 font-medium decoration-[1.5] underline-offset-5 hover:bg-current/0 hover:text-current/80 hover:underline hover:underline-offset-6`,"invisible-link":`h-auto justify-start border-inherit bg-current/0 px-1`,button:`relative inline-flex min-h-8 cursor-pointer flex-row items-center justify-center gap-2 rounded-full bg-current px-6 text-center font-medium text-sm text-text ring-0 *:text-text-opposite hover:bg-current/90 hover:ring-5 aria-selected:ring-5 aria-[current]:ring-5 max-md:py-2`,"button-outlined":`relative inline-flex min-h-8 cursor-pointer flex-row items-center justify-center gap-2 rounded-full border-[1.3px] border-current px-6 text-center font-medium text-sm text-text ring-0 *:text-text hover:bg-current/20 hover:ring-5 aria-selected:ring-5 aria-[current]:ring-5 max-md:py-2`,hoverable:`rounded-lg border-none bg-current/0 transition *:text-current! hover:bg-current/10 aria-[current]:bg-current/5`},roundedSize:{none:`rounded-none`,sm:`rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl`,md:`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,lg:`rounded-2xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-3xl`,xl:`rounded-3xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-4xl`,"2xl":`rounded-4xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[2.5rem]`,"3xl":`rounded-[2.5rem] [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-[3rem]`,full:`rounded-full`},color:{primary:`text-primary`,secondary:`text-secondary`,neutral:`text-neutral`,light:`text-white`,dark:`text-neutral-800`,text:`text-text`,"text-inverse":`text-text-opposite`,error:`text-error`,success:`text-success`,custom:``},size:{sm:`text-sm`,md:`text-base`,lg:`text-lg`,xl:`text-xl`,custom:``},underlined:{default:``,true:`underline`,false:`no-underline`}},compoundVariants:[{variant:`button`,color:`text-inverse`,class:`*:text-text`},{variant:`button-outlined`,color:`text-inverse`,class:`text-text-opposite *:text-text-opposite`},{variant:[`button`,`button-outlined`],size:`sm`,class:`min-h-7 px-3 text-xs max-md:py-1`},{variant:[`button`,`button-outlined`],size:`md`,class:`min-h-8 px-6 text-sm max-md:py-2`},{variant:[`button`,`button-outlined`],size:`lg`,class:`min-h-10 px-8 text-lg max-md:py-3`},{variant:[`button`,`button-outlined`],size:`xl`,class:`min-h-11 px-10 text-xl max-md:py-4`},{variant:[`button`,`button-outlined`],color:`primary`,class:`ring-primary/20`},{variant:[`button`,`button-outlined`],color:`secondary`,class:`ring-secondary/20`},{variant:[`button`,`button-outlined`],color:`neutral`,class:`ring-neutral/20`},{variant:[`button`,`button-outlined`],color:`light`,class:`ring-white/20`},{variant:[`button`,`button-outlined`],color:`dark`,class:`ring-neutral-800/20`},{variant:[`button`,`button-outlined`],color:`text`,class:`ring-text/20`},{variant:[`button`,`button-outlined`],color:`text-inverse`,class:`ring-text-opposite/20`},{variant:[`button`,`button-outlined`],color:`error`,class:`ring-error/20`},{variant:[`button`,`button-outlined`],color:`success`,class:`ring-success/20`}],defaultVariants:{variant:`default`,roundedSize:`md`,underlined:`default`,size:`custom`}}),TI=({href:e,isExternalLink:t},n)=>{if(typeof t==`boolean`)return t;if(typeof e!=`string`||e.trim()===``||!/^https?:\/\//.test(e))return!1;if(n)try{let t=new URL(e).hostname,r=new URL(n.startsWith(`http`)?n:`https://${n}`).hostname,i=e=>e.split(`.`).slice(-2).join(`.`);return i(t)!==i(r)}catch{return!0}return!0},EI=e=>typeof e==`string`||typeof e==`number`?!0:Array.isArray(e)?e.every(EI):(0,v.isValidElement)(e)?EI(e.props.children):!1,DI=e=>{let{variant:t=`default`,color:n=`custom`,roundedSize:r,children:i,label:a,className:o,isActive:s,underlined:c,locale:l,size:u,isExternalLink:d,isPageSection:f,href:p,...m}=e,h=t===`button`||t===`button-outlined`,g=u??(h?`md`:`custom`),_=d??TI(e),v=f??p?.startsWith(`#`)??!1,b=EI(i),x=_?`noopener noreferrer nofollow`:void 0,S=_?`_blank`:`_self`,C=l&&p&&!_&&!v?Kt(p,l):p;return(0,y.jsxs)(`a`,{href:C===``?void 0:C,"aria-label":a,rel:x,target:S,"aria-current":s?`page`:void 0,suppressHydrationWarning:!0,className:W(wI({variant:t,color:n,roundedSize:r,underlined:c,size:g,className:o})),...m,children:[h&&b?(0,y.jsx)(`span`,{children:i}):i,_&&b&&(0,y.jsx)(Sf,{className:`ml-2 inline-block size-4`}),v&&(0,y.jsx)(wf,{className:`ml-2 inline-block size-4`})]})},OI=e=>e&&{primary:`text-primary`,secondary:`text-secondary`,neutral:`text-neutral`,light:`text-white`,dark:`text-neutral-800`,text:`text-text`,"text-inverse":`text-text-opposite`,error:`text-error`,success:`text-success`,custom:``}[e]||``,kI=Qd(`flex flex-row flex-wrap items-center`,{variants:{size:{xs:`gap-1 text-xs`,sm:`gap-1.5 text-sm`,md:`gap-2 text-base`,lg:`gap-3 text-lg`,xl:`gap-4 text-xl`},spacing:{compact:`gap-1`,normal:`gap-2`,loose:`gap-4`}},defaultVariants:{size:`md`,spacing:`normal`}}),AI=({href:e,lang:t,children:n,onClick:r,color:i,position:a,locale:o,className:s,...c})=>{let l=Pe(`breadcrumb`).linkLabel;return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(DI,{href:e,locale:o,color:i,onClick:r,itemProp:`item`,isExternalLink:!1,itemScope:!0,itemType:`https://schema.org/WebPage`,...c,label:`${l} ${n}`,itemID:e,size:`custom`,children:(0,y.jsx)(`span`,{itemProp:`name`,children:n})}),(0,y.jsx)(`meta`,{itemProp:`position`,content:a.toString()})]})},jI=e=>{let{children:t,onClick:n,color:r,position:i,className:a,...o}=e,{linkLabel:s}=dn(`breadcrumb`);return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(bO,{onClick:n,variant:`link`,label:`${s} ${t}`,color:r,itemProp:`item`,size:`custom`,...o,children:(0,y.jsx)(`span`,{itemProp:`name`,children:t})}),(0,y.jsx)(`meta`,{itemProp:`position`,content:i.toString()})]})},MI=({children:e,position:t,className:n,...r})=>(0,y.jsxs)(`span`,{itemProp:`item`,className:W(`inline-flex items-center`,`font-medium text-neutral-700`,`transition-colors duration-200`,n),children:[(0,y.jsx)(`span`,{itemProp:`name`,...r,children:e}),(0,y.jsx)(`meta`,{itemProp:`position`,content:t.toString()})]}),NI=({links:e,className:t,color:n=`text`,locale:r,elementType:i=`page`,separator:a=(0,y.jsx)(hf,{size:10}),ariaLabel:o=`breadcrumb`,includeStructuredData:s=!0,maxItems:c,size:l,spacing:u,...d})=>{let f=c&&e.length>c?[...e.slice(0,1),`...`,...e.slice(-(c-2))]:e;return(0,y.jsx)(`nav`,{"aria-label":o,children:(0,y.jsx)(`ol`,{className:W(kI({size:l,spacing:u}),t),...s&&{itemScope:!0,itemType:`http://schema.org/BreadcrumbList`},...d,children:f.map((e,t)=>{let o=t===f.length-1,c=typeof e==`object`&&typeof e.href==`string`,l=typeof e==`object`&&typeof e.onClick==`function`,u=t===f.length-1,d=u?i:void 0,p=e===`...`,m=e.text??e,h=OI(n);if(p)return(0,y.jsxs)(v.Fragment,{children:[(0,y.jsx)(`li`,{className:`flex items-center`,"aria-hidden":`true`,children:(0,y.jsx)(`span`,{className:`text-neutral-500`,children:`…`})}),!o&&(0,y.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,y.jsx)(`span`,{className:W(h),children:a})})]},`truncated-${m}`);let g=(0,y.jsx)(MI,{position:t+1,"aria-current":d,className:W(`transition-colors duration-200`,u&&`text-neutral-900`),children:m},m);c?g=(0,y.jsx)(AI,{href:e.href,color:n,position:t+1,locale:r,"aria-current":d,className:W(u&&`cursor-default text-neutral-900`),children:m},m):l&&(g=(0,y.jsx)(jI,{onClick:e.onClick,color:n,position:t+1,"aria-current":d,className:W(u&&`cursor-default text-neutral-900`),children:m},m));let _=(0,v.createElement)(`li`,{...s&&{itemProp:`itemListElement`,itemScope:!0,itemType:`https://schema.org/ListItem`},key:m,className:`flex items-center`},g);return o?_:(0,y.jsxs)(v.Fragment,{children:[_,(0,y.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,y.jsx)(`span`,{className:W(h),children:a})})]},m)})})})},PI=({keyPath:e,dictionaryKey:t,onClickKeyPath:n,locale:r,color:i,showDictionaryKey:a=!0})=>{let o=[...a?[{text:Rt(t),onClick:n?()=>n([]):void 0}]:[],...e.map((t,r)=>({onClick:n?()=>n?.(e.slice(0,r+1)):void 0,text:Rt(t.key?.toString()??``)}))];return(0,y.jsx)(NI,{links:o,locale:r,elementType:`location`,color:i})},FI=({children:e,className:t,identifier:n,...r})=>(0,y.jsx)(`div`,{className:W(`group/dropdown relative flex`,t),"aria-label":`DropDown ${n}`,id:`dropdown-container-${n}`,...r,children:e});FI.Trigger=({children:e,identifier:t,className:n,label:r,...i})=>(0,y.jsx)(bO,{className:W([`w-full cursor-pointer`,`group-focus-within/dropdown:bg-current/20 group-focus-within/dropdown:ring-4`,n]),label:r??`Open panel ${t}`,"aria-haspopup":`true`,"aria-controls":`dropdown-panel-${t}`,id:`dropdown-trigger-${t}`,onClick:e=>{e.currentTarget.focus()},variant:`none`,...i,children:e}),FI.Panel=({children:e,isHidden:t=void 0,isOverable:n=!1,isFocusable:r=!1,align:i=`start`,yAlign:a=`below`,identifier:o,className:s,smootherClassName:c,...l})=>(0,y.jsx)(`div`,{className:W(`absolute z-100 min-w-full`,i===`start`&&`left-0`,i===`end`&&`right-0`,a===`below`&&`top-[calc(100%+0.5rem)]`,a===`above`&&`bottom-[calc(100%+0.5rem)]`,s),"aria-hidden":t,role:`region`,"aria-labelledby":`dropdown-trigger-${o}`,id:`dropdown-panel-${o}`,children:(0,y.jsx)(xO,{isHidden:t,className:W(`overflow-x-visible`,t===!1&&`invisible`,t===!0&&`visible`,n&&`group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]`,r&&`group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]`,c),...l,children:e})});function II(e){return Array.isArray?Array.isArray(e):KI(e)===`[object Array]`}function LI(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function RI(e){return e==null?``:LI(e)}function zI(e){return typeof e==`string`}function BI(e){return typeof e==`number`}function VI(e){return e===!0||e===!1||UI(e)&&KI(e)==`[object Boolean]`}function HI(e){return typeof e==`object`}function UI(e){return HI(e)&&e!==null}function WI(e){return e!=null}function GI(e){return!e.trim().length}function KI(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var qI=`Incorrect 'index' type`,JI=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,YI=e=>`Invalid value for key ${e}`,XI=e=>`Pattern length exceeds max of ${e}.`,ZI=e=>`Missing ${e} property in key`,QI=e=>`Property 'weight' in key '${e}' must be a positive integer`,$I=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,eL=Object.prototype.hasOwnProperty,tL=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=nL(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function nL(e){let t=null,n=null,r=null,i=1,a=null;if(zI(e)||II(e))r=e,t=rL(e),n=iL(e);else{if(!eL.call(e,`name`))throw Error(ZI(`name`));let o=e.name;if(r=o,eL.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(QI(iL(o)));t=rL(o),n=iL(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function rL(e){return II(e)?e:e.split(`.`)}function iL(e){return II(e)?e.join(`.`):e}function aL(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(WI(e)){if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!WI(s))return;if(a===t.length-1&&(zI(s)||BI(s)||VI(s)||typeof s==`bigint`))n.push(o===void 0?RI(s):{v:RI(s),i:o});else if(II(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}}};return i(e,zI(t)?t.split(`.`):t,0),r?n:n[0]}var oL={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},sL={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},cL={location:0,threshold:.6,distance:100},lL={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:aL,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},X=Object.freeze({...sL,...oL,...cL,...lL});function uL(e){return e>=9&&e<=13||e===32||e===160}function dL(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=0,a=!1;for(let e=0;e<t.length;e++)uL(t.charCodeAt(e))?a=!1:a||=(i++,!0);if(i===0&&(i=1),n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}var fL=class{constructor({getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){this.norm=dL(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(zI(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(JI);if(zI(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(JI);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!WI(e)||GI(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(WI(i)){if(II(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(WI(n)){if(zI(n)){if(!GI(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(WI(n.v)){let t=zI(n.v)?n.v:RI(n.v);if(!GI(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(zI(i)&&!GI(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function pL(e,t,{getFn:n=X.getFn,fieldNormWeight:r=X.fieldNormWeight}={}){let i=new fL({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(nL)),i.setSources(t),i.create(),i}function mL(e,{getFn:t=X.getFn,fieldNormWeight:n=X.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new fL({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function hL(e=[],t=X.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function gL(e,t,n,{location:r=X.location,distance:i=X.distance,threshold:a=X.threshold,findAllMatches:o=X.findAllMatches,minMatchCharLength:s=X.minMatchCharLength,includeMatches:c=X.includeMatches,ignoreLocation:l=X.ignoreLocation}={}){if(t.length>32)throw Error(XI(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=hL(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function _L(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function vL(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}var yL={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},bL=RegExp(`[`+Object.keys(yL).join(``)+`]`,`g`),xL=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(bL,e=>yL[e]):e=>e,SL=class{constructor(e,{location:t=X.location,threshold:n=X.threshold,distance:r=X.distance,includeMatches:i=X.includeMatches,findAllMatches:a=X.findAllMatches,minMatchCharLength:o=X.minMatchCharLength,isCaseSensitive:s=X.isCaseSensitive,ignoreDiacritics:c=X.ignoreDiacritics,ignoreLocation:l=X.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?xL(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:_L(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?xL(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=gL(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=vL(u)),p}},CL=new Set([`fuzzy`,`include`]);function wL(e){return e.startsWith(`inverse`)}var TL=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new SL(e,{location:t.location??X.location,threshold:t.threshold??X.threshold,distance:t.distance??X.distance,includeMatches:t.includeMatches??X.includeMatches,findAllMatches:t.findAllMatches??X.findAllMatches,minMatchCharLength:t.minMatchCharLength??X.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??X.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??X.ignoreDiacritics,ignoreLocation:t.ignoreLocation??X.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],EL=TL.length,DL=`\0`,OL=`|`;function kL(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function AL(e,t){let n=e.match(t);return n?n[1]:null}function jL(e,t={}){return e.replace(/\\\|/g,DL).split(OL).map(e=>{let n=kL(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<EL;){let e=TL[o],n=AL(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<EL;){let e=TL[o],n=AL(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var ML=class{constructor(e,{isCaseSensitive:t=X.isCaseSensitive,ignoreDiacritics:n=X.ignoreDiacritics,includeMatches:r=X.includeMatches,minMatchCharLength:i=X.minMatchCharLength,ignoreLocation:a=X.ignoreLocation,findAllMatches:o=X.findAllMatches,location:s=X.location,threshold:c=X.threshold,distance:l=X.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?xL(e):e,this.pattern=e,this.query=jL(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?xL(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,wL(r.type)&&(c=!0),n&&(CL.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=vL(o)),e}}return{isMatch:!1,score:1}}},NL=[];function PL(...e){NL.push(...e)}function FL(e,t){for(let n=0,r=NL.length;n<r;n+=1){let r=NL[n];if(r.condition(e,t))return new r(e,t)}return new SL(e,t)}var IL={AND:`$and`,OR:`$or`},LL={PATH:`$path`,PATTERN:`$val`},RL=e=>!!(e[IL.AND]||e[IL.OR]),zL=e=>!!e[LL.PATH],BL=e=>!II(e)&&HI(e)&&!RL(e),VL=e=>({[IL.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function HL(e,t,{auto:n=!0}={}){let r=e=>{if(zI(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=FL(e,t)),r}let i=Object.keys(e),a=zL(e);if(!a&&i.length>1&&!RL(e))return r(VL(e));if(BL(e)){let r=a?e[LL.PATH]:i[0],o=a?e[LL.PATTERN]:e[r];if(!zI(o))throw Error(YI(r));let s={keyId:iL(r),pattern:o};return n&&(s.searcher=FL(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];II(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return RL(e)||(e=VL(e)),r(e)}function UL(e,{ignoreFieldNorm:t=X.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function WL(e,{ignoreFieldNorm:t=X.ignoreFieldNorm}){e.forEach(e=>{e.score=UL(e.matches,{ignoreFieldNorm:t})})}var GL=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&this.comparator(t[i],t[r])>0&&(r=i),a<n&&this.comparator(t[a],t[r])>0&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}};function KL(e){let t=[];return e.matches.forEach(e=>{if(!WI(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function qL(e,t,{includeMatches:n=X.includeMatches,includeScore:r=X.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=KL(e)),r&&(a.score=e.score),a})}var JL=/[\p{L}\p{M}\p{N}_]+/gu,YL=new WeakSet;function XL(e){YL.has(e)||(YL.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function ZL(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||XL(e),t=>t.match(e)||[]):e=>e.match(JL)||[]}function QL({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=ZL(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=xL(n)),r(n)}}}var $L=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=QL({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new SL(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=vL(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function eR(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function tR(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){eR(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n){if(Array.isArray(n))for(let t of n)eR(e,t.v,i,r);else eR(e,n.v,i,r)}}}function nR(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)tR(r,i,t,n);return r}function rR(e,t,n,r){tR(e,t,n,r)}function iR(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function aR(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)iR(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var oR=class{constructor(e,t,n){this.options={...X,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new tL(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=FL(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof fL))throw Error(qI);if(this._myIndex=t||pL(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=QL({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=nR(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!WI(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=QL({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});rR(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&aR(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(JI);this._invertedIndex&&aR(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(zI(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return BI(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&BI(n)&&n>0&&zI(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new GL(n,u);zI(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=zI(e)?zI(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),WL(d,{ignoreFieldNorm:s}),a&&d.sort(zI(e)?u:l),BI(n)&&n>-1&&(d=d.slice(0,n));return qL(d,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!WI(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=UL(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=HL(e,this.options),n=this._normalizedKeys(),r=(e,t,i)=>{if(!(`children`in e)){let{keyId:r,searcher:a}=e,o;return r===null?(o=[],n.forEach((e,n)=>{o.push(...this._findMatches({key:e,value:t[n],searcher:a}))})):o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:a}),o&&o.length?[{idx:i,item:t,matches:o}]:[]}let{children:a,operator:o}=e,s=[];for(let e=0,n=a.length;e<n;e+=1){let n=a[e],c=r(n,t,i);if(c.length)s.push(...c);else if(o===IL.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(WI(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),o.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=this._normalizedKeys(),s=t?null:[];return a.forEach(({$:e,i:a})=>{if(!WI(e))return;let c=[],l=!1,u=!1;if(o.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:a,item:e,matches:c};t?(r.score=UL(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!WI(t))return[];let r=[];if(II(t))t.forEach(({v:t,i,n:a})=>{if(!WI(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}};oR.version=`7.5.0`,oR.createIndex=pL,oR.parseIndex=mL,oR.config=X,oR.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error($I);return FL(e,{...X,...n}).searchIn(t)},oR.parseQuery=HL,PL(ML),PL($L),oR.use=function(...e){e.forEach(e=>PL(e))};var sR=oR,cR=`locale-switcher-content`,lR=({panelProps:e,isMultilingual:t=!0})=>{let{switchTo:n,searchInput:r,localeSwitcherLabel:i,languageListLabel:a,seeAllLocalesSwitch:o}=dn(`locale-switcher-content`),s=(0,v.useRef)(null),{locale:c}=fn(),{availableLocales:l,selectedLocales:u,setSelectedLocales:d}=Nk(),f=(0,v.useMemo)(()=>l.map(e=>({locale:e,englishName:Yt(e,`en`),currentLocaleName:Yt(e,c),ownLocaleName:Yt(e)})),[l,c]),[p,m]=(0,v.useState)(``),[h,g]=jk(`locale-content-selector-see-all-locales`,!1),_=(0,v.useMemo)(()=>new sR(f,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[f]),b=(0,v.useMemo)(()=>p?_.search(p).map(e=>e.item):f,[p,f,_]),x=e=>{t?u.includes(e)?u.length>1&&d(t=>t.filter(t=>t!==e)):d(t=>[...t,e]):d([e])},S=e=>{g(e),d(e?l:[c])};return(0,y.jsx)(`div`,{className:`rounded-xl border border-text text-text transition-colors`,children:(0,y.jsxs)(FI,{identifier:cR,children:[(0,y.jsx)(FI.Trigger,{identifier:cR,label:i.value,className:`p-0!`,roundedSize:`3xl`,color:`text`,variant:`hoverable`,children:(0,y.jsxs)(`div`,{className:`flex w-full items-center justify-between text-text`,children:[(0,y.jsx)(`div`,{className:`px-2 py-1`,children:(0,y.jsx)(Cf,{size:16})}),(0,y.jsx)(Tf,{className:`self-center`,size:16})]})}),(0,y.jsx)(FI.Panel,{identifier:cR,isOverable:!0,isFocusable:!0,align:`end`,...e,children:(0,y.jsxs)(ck,{className:`max-h-[60vh] min-w-28`,separator:`y`,role:`listbox`,transparency:`xs`,border:!0,roundedSize:`3xl`,borderColor:`text`,"aria-label":a.value,children:[t&&(0,y.jsx)(`div`,{className:`m-auto p-2`,children:(0,y.jsx)(MO,{defaultValue:h,onChange:S,color:`text`,size:`sm`,className:`!w-60`,choices:[{content:o.true.value,value:!0},{content:o.false.value,value:!1}]})}),!(t&&h)&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(`div`,{className:`p-3`,children:(0,y.jsx)(RO,{type:`search`,"aria-label":r.ariaLabel.value,placeholder:r.placeholder.value,onChange:e=>m(e.target.value),ref:s})}),(0,y.jsx)(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:b.map(({locale:e,currentLocaleName:r,ownLocaleName:i})=>(0,y.jsx)(`li`,{className:`px-1.5 py-1`,children:(0,y.jsx)(bO,{onClick:()=>x(e),label:`${n} ${r}`,disabled:!(l??l).includes(e),isActive:u.includes(e),variant:`hoverable`,color:`text`,isFullWidth:!0,textAlign:`left`,size:`sm`,children:(0,y.jsxs)(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[t&&(0,y.jsx)(`div`,{className:`w-4`,children:u.includes(e)&&(0,y.jsx)(ff,{className:`size-full`})}),(0,y.jsxs)(`div`,{className:`flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col text-nowrap`,children:[(0,y.jsx)(`span`,{dir:Jt(e),lang:e,children:i}),(0,y.jsx)(`span`,{className:`text-neutral text-xs`,children:r})]}),(0,y.jsx)(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})]})})},e))})]})]})})]})})},uR=Qd(`flex items-center justify-center gap-1`,{variants:{size:{sm:`gap-1`,md:`gap-2`,lg:`gap-3`},color:{text:`background-text`,primary:`background-primary`,secondary:`background-secondary`,neutral:`background-neutral`},variant:{default:``,bordered:`rounded-lg border border-border p-2`,ghost:`bg-transparent`}},defaultVariants:{size:`md`,variant:`default`}}),dR=(e,t,n)=>{if(t<=n)return Array.from({length:t},(e,t)=>t+1);let r=[],i=Math.floor(n/2);if(r.push(1),e<=i+2){for(let e=2;e<=Math.min(n-1,t-1);e++)r.push(e);t>n&&r.push(`ellipsis`),t>1&&r.push(t)}else if(e>=t-i-1){t>n&&r.push(`ellipsis`);for(let e=Math.max(2,t-n+2);e<=t;e++)r.push(e)}else{r.push(`ellipsis`);let n=e-i,a=e+i;for(let e=n;e<=a;e++)r.push(e);r.push(`ellipsis`),r.push(t)}return r},fR=e=>e?.getAttribute(`aria-current`)===`true`,pR=e=>e===`sm`?`icon-sm`:e===`lg`?`icon-lg`:`icon-md`,mR=e=>(0,y.jsx)(`div`,{className:`absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/10 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none`,...e}),hR=({currentPage:e,totalPages:t,onPageChange:n,showFirstLast:r=!1,showPrevNext:i=!0,maxVisiblePages:a=5,disabled:o=!1,size:s=`md`,variant:c=`default`,color:l=`text`,className:u,...d})=>{let{goToNextPage:f,goToPreviousPage:p}=dn(`pagination`),m=dR(e,t,a),h=pR(s),g=e===1,_=e===t,b=(0,v.useRef)([]),x=(0,v.useRef)(null),{choiceIndicatorPosition:S,calculatePosition:C}=EO(b,{selector:fR,isHoverable:!0});if((0,v.useEffect)(()=>{let e=setTimeout(()=>{C()},300);return()=>clearTimeout(e)},[e,C]),t<=1)return null;let w=r=>{!o&&r>=1&&r<=t&&r!==e&&n(r)};return(0,y.jsx)(`div`,{className:W(uR({size:s,variant:c}),u),...d,children:(0,y.jsxs)(`div`,{className:`relative flex items-center gap-1`,children:[S&&(0,y.jsx)(mR,{style:S,ref:x}),i&&(0,y.jsx)(bO,{variant:`outline`,size:h,color:`text`,onClick:()=>w(e-1),disabled:o||g,label:p.value,Icon:mf,ref:e=>{e&&(b.current[0]=e)},className:`min-w-0 px-2`}),(0,y.jsx)(`div`,{className:`flex items-center gap-1 max-md:gap-0.5`,children:m.map((t,n)=>{if(t===`ellipsis`){let e=n===m.indexOf(`ellipsis`)?`ellipsis-start`:`ellipsis-end`;return(0,y.jsx)(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:(0,y.jsx)(xf,{className:`h-4 w-4 text-muted-foreground`})},e)}let r=t===e,a=+!!i+m.slice(0,n).filter(e=>e!==`ellipsis`).length;return(0,y.jsx)(bO,{variant:r?`default`:`outline`,size:h,color:`text`,onClick:()=>w(t),disabled:o,label:`Go to page ${t}`,"aria-current":r?`true`:`false`,ref:e=>{e&&(b.current[a]=e)},className:W(`flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0 text-sm`,s===`sm`&&`h-6 w-6 text-xs`,s===`lg`&&`size-10 text-base`,r&&`font-semibold`),children:t},t)})}),i&&(0,y.jsx)(bO,{variant:`outline`,size:h,color:`text`,onClick:()=>w(e+1),disabled:o||_,label:f.value,Icon:hf,ref:e=>{let t=+!!i+m.filter(e=>e!==`ellipsis`).length;e&&(b.current[t]=e)},className:`min-w-0 px-2`})]})})},gR=e=>{let t=rn(e),n=cn(e);return t&&(n===`reactNode`||n===`file`)?!0:t&&typeof t.nodeType==`string`?gR(t[t.nodeType]):typeof t==`string`||typeof t==`number`||typeof t==`boolean`||t===void 0},_R=e=>{let t=(0,V.c)(3),{children:n,onToggle:r,...i}=e,[a,o]=(0,v.useState)(!1),s;return t[0]!==a||t[1]!==r?(s=e=>{e&&!a&&o(!0),r?.(e)},t[0]=a,t[1]=r,t[2]=s):s=t[2],(0,y.jsx)(SO,{...i,onToggle:s,children:a?n:null})},vR=e=>{let t=(0,V.c)(16),{section:n,keyPath:r,dictionary:i}=e,{selectedLocales:a}=Nk(),o=en(n,r,Yw()),{addEditedContent:s}=tT(),{setFocusedContentKeyPath:c,focusedContent:l}=Zw(),{addNewElement:u,goToField:d}=dn(`navigation-view`),f=cn(o),p;t[0]===l?.keyPath?p=t[1]:(p=e=>(l?.keyPath?.length??0)>0&&Pt(e,l?.keyPath??[]),t[0]=l?.keyPath,t[1]=p);let m=p,h=gR(o);if(!o)return(0,y.jsx)(y.Fragment,{});if(h){let e;return t[2]!==r||t[3]!==c?(e=()=>c(r),t[2]=r,t[3]=c,t[4]=e):e=t[4],(0,y.jsx)(bO,{label:d.label.value,variant:`hoverable`,color:`text`,className:`w-full`,onClick:e,IconRight:hf,children:Rt(r[r.length-1]?.key)})}if(typeof o==`object`){if(f===`reactNode`)return(0,y.jsx)(y.Fragment,{children:`React Node`});if(f===`translation`){let e;return t[5]!==i||t[6]!==r||t[7]!==n?(e=e=>{let t=[...r,{type:S,key:e}];return(0,y.jsx)(vR,{keyPath:t,section:n,dictionary:i},e)},t[5]=i,t[6]=r,t[7]=n,t[8]=e):e=t[8],(0,y.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:a.map(e)})}if(f===`enumeration`||f===`plural`||f===`condition`)return(0,y.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:Object.keys(o[f]).map(e=>{let t=[...r,{type:f,key:e}];return(0,y.jsx)(vR,{keyPath:t,section:n,dictionary:i},e)})});if(f===`array`){let e;return t[9]!==i||t[10]!==m||t[11]!==d||t[12]!==r||t[13]!==n||t[14]!==c?(e=(e,t)=>{let a=[...r,{type:k,key:t}];return gR(e)?(0,y.jsxs)(bO,{label:`${d.label.value} ${t}`,variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(a),IconRight:hf,isActive:m(a),children:[`Item `,t]},JSON.stringify(a)):(0,y.jsx)(_R,{label:`${d.label.value} ${t}`,header:`Item ${t}`,isActive:m(a),onClick:()=>c(a),children:(0,y.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,y.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,y.jsx)(vR,{keyPath:a,section:n,dictionary:i})})})},JSON.stringify(a))},t[9]=i,t[10]=m,t[11]=d,t[12]=r,t[13]=n,t[14]=c,t[15]=e):e=t[15],(0,y.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[o.map(e),(0,y.jsx)(bO,{label:u.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,onClick:()=>{let e=[...r,{type:k,key:o.length}],t=o,n=nn(t[t.length-1])??``;s(i.localId,n,e,!1),c(e)},Icon:Of,children:u.text})]})}if(typeof o.nodeType==`string`){let e=[...r,{type:o.nodeType}];return(0,y.jsx)(vR,{keyPath:e,section:n,dictionary:i})}let e=Object.keys(o);return(0,y.jsx)(`div`,{className:`flex w-full max-w-full flex-col justify-between gap-2`,children:e.map(e=>{let t=[...r,{type:O,key:e}];return gR(en(n,t))?(0,y.jsx)(bO,{label:`${d.label.value} ${e}`,isActive:m(t),variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(t),IconRight:hf,children:Rt(e)},e):(0,y.jsx)(_R,{label:`${d.label.value} ${e}`,isActive:m(t),onClick:()=>c(t),header:Rt(e),children:(0,y.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,y.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,y.jsx)(vR,{keyPath:t,section:n,dictionary:i})})})},e)})})}return(0,y.jsxs)(y.Fragment,{children:[`Error loading section --`,f,`--`,JSON.stringify(o),`--`,JSON.stringify(r)]})},yR=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,bR=e=>{let t=(0,V.c)(35),{dictionary:n,isDarkMode:r}=e,{itemPagination:i,variantSwitcher:a}=dn(`content-editor`),{editedContent:o}=nT(),{focusedContent:s,setFocusedContentKeyPath:c}=Zw(),[,l]=(0,v.useTransition)(),u;t[0]!==c||t[1]!==l?(u=e=>l(()=>c(e)),t[0]=c,t[1]=l,t[2]=u):u=t[2];let d=u,[f,p]=(0,v.useState)(n),m,h;t[3]===n?(m=t[4],h=t[5]):(m=()=>{p(n)},h=[n],t[3]=n,t[4]=m,t[5]=h),(0,v.useEffect)(m,h);let g=n.item!==void 0||n.variant!==void 0,_;t[6]===n.key?_=t[7]:(_={keys:[n.key]},t[6]=n.key,t[7]=_);let b=g&&!!n.key,x;t[8]===b?x=t[9]:(x={enabled:b},t[8]=b,t[9]=x);let{data:S}=cO(_,x),C;t[10]===S?.data?C=t[11]:(C=S?.data??[],t[10]=S?.data,t[11]=C);let w=C,T;bb0:{if(n.item===void 0){let e;t[12]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[12]=e):e=t[12],T=e;break bb0}let e;t[13]===w?e=t[14]:(e=w.filter(xR).sort(SR),t[13]=w,t[14]=e),T=e}let E=T,D;bb1:{if(n.variant===void 0){let e;t[15]===Symbol.for(`react.memo_cache_sentinel`)?(e=[],t[15]=e):e=t[15],D=e;break bb1}let e;t[16]===w?e=t[17]:(e=w.filter(CR),t[16]=w,t[17]=e),D=e}let O=D,k;t[18]===d?k=t[19]:(k=e=>{p(e),d([])},t[18]=d,t[19]=k);let A=k,{content:j,key:M,localId:N}=f,P=s?.keyPath,F=o?.[N]?.content===void 0?j:o?.[N]?.content,I=Yw(),L;t[20]===P?L=t[21]:(L=P??[],t[20]=P,t[21]=L);let ee;t[22]!==I||t[23]!==F||t[24]!==L?(ee=en(F,L,I),t[22]=I,t[23]=F,t[24]=L,t[25]=ee):ee=t[25];let te=ee,ne=(0,v.useDeferredValue)(P),R=(0,v.useDeferredValue)(te),z=R!==te,B;t[26]===F?B=t[27]:(B=gR(F),t[26]=F,t[27]=B);let re=B,ie=gR(R),ae;t[28]!==s?.keyPath||t[29]!==te||t[30]!==d?(ae=()=>{te===void 0&&d(s?.keyPath?.slice(0,-1)??[])},t[28]=s?.keyPath,t[29]=te,t[30]=d,t[31]=ae):ae=t[31];let oe;t[32]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[],t[32]=oe):oe=t[32],(0,v.useEffect)(ae,oe);let se;t[33]===f.localId?se=t[34]:(se=e=>e.localId===f.localId,t[33]=f.localId,t[34]=se);let ce=E.findIndex(se),le=f.variant;return(0,y.jsxs)(`div`,{children:[g&&(0,y.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-4`,children:[E.length>0&&(0,y.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,y.jsx)(`span`,{className:`font-medium text-muted text-xs`,children:i.label}),(0,y.jsx)(hR,{currentPage:ce>=0?ce+1:1,totalPages:E.length,onPageChange:e=>{let t=E[e-1];t&&A(t)},size:`sm`})]}),O.length>0&&(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,y.jsxs)(`span`,{className:`font-medium text-muted text-xs`,children:[a.label,`:`]}),O.map(e=>{let t=e.localId===f.localId;return(0,y.jsx)(`button`,{type:`button`,onClick:()=>!t&&A(e),className:`rounded-lg px-3 py-1 text-xs transition-colors ${t?`bg-text font-semibold text-text-opposite`:`cursor-pointer border border-border hover:bg-text/10`}`,children:yR(e.variant)},e.localId)}),le!==void 0&&!O.some(e=>e.localId===n.localId)&&(0,y.jsx)(`span`,{className:`rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs`,children:yR(le)})]})]}),(0,y.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-2`,children:[(0,y.jsx)(PI,{dictionaryKey:M,keyPath:P??[],onClickKeyPath:d}),(0,y.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,y.jsx)(lR,{})})]}),(0,y.jsxs)(`div`,{className:`flex flex-1 gap-2 overflow-visible max-md:flex-col`,children:[typeof F==`object`&&F&&!re&&Object.keys(F).length>0&&(0,y.jsx)(ck,{border:!0,background:`none`,className:`top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]`,roundedSize:`2xl`,transparency:`xs`,children:(0,y.jsx)(vR,{keyPath:[],section:F,dictionary:f})}),(ie||(ne??[]).length>0)&&(0,y.jsx)(`div`,{className:z?`pointer-events-none flex-1 opacity-50 transition-opacity`:`flex-1 transition-opacity`,children:(0,y.jsx)(SI,{keyPath:ne??[],section:R,dictionary:f,isDarkMode:r})})]})]})};function xR(e){return e.item!==void 0}function SR(e,t){return(e.item??0)-(t.item??0)}function CR(e){return e.variant!==void 0}var wR=Qd(`inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{color:{primary:`border-primary bg-primary text-primary hover:bg-primary-500`,secondary:`border-secondary bg-secondary text-secondary hover:bg-secondary-300`,success:`border-success bg-success text-success hover:bg-success-500`,error:`border-error bg-error text-error hover:bg-error-500`,neutral:`border-neutral bg-neutral text-neutral hover:bg-neutral-600`,light:`border-white bg-white text-white hover:bg-neutral-500`,dark:`border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900`,text:`border-text bg-text text-text hover:opacity-80`,custom:``},variant:{default:`rounded-lg text-text-opposite`,none:`border-none bg-opacity-0 text-inherit hover:bg-opacity-0`,outline:`rounded-lg border-[1.3px] bg-opacity-0 hover:bg-opacity-30`,hoverable:`rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10`},size:{sm:`px-2 py-0.5 text-xs`,md:`px-2.5 py-0.5 text-xs`,lg:`px-3 py-1 text-sm`}},defaultVariants:{variant:`default`,color:`primary`,size:`md`}}),TR=({className:e,variant:t=`default`,color:n=`primary`,size:r=`md`,children:i,clickable:a=!1,dismissible:o=!1,onClick:s,onDismiss:c,role:l,tabIndex:u,"aria-label":d,...f})=>{let p=a?`button`:`span`,m=e=>{a&&s&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(e))},h=e=>{e.stopPropagation(),c?.()};return(0,y.jsxs)(p,{className:W(wR({variant:t,color:n,size:r}),a&&`cursor-pointer hover:opacity-80 focus-visible:ring-2 focus-visible:ring-offset-2`,o&&`pr-1`,e),onClick:a?s:void 0,onKeyDown:a?m:void 0,role:l||(a?`button`:`status`),tabIndex:a?u??0:u,"aria-label":d||(a?`${i} button`:void 0),...f,children:[i,o&&(0,y.jsx)(`button`,{type:`button`,className:`ml-1 inline-flex h-4 w-4 items-center justify-center rounded-full hover:bg-black/10 focus:outline-none focus:ring-1 focus:ring-offset-1`,onClick:h,"aria-label":`Remove ${i} badge`,children:(0,y.jsxs)(`svg`,{className:`size-3`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-label":`Remove badge`,children:[(0,y.jsx)(`title`,{children:`Remove badge`}),(0,y.jsx)(`path`,{fillRule:`evenodd`,d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,clipRule:`evenodd`})]})})]})},ER=Object.defineProperty,DR=(e,t)=>ER(e,`name`,{value:t,configurable:!0}),OR=`Dialog`,[kR,AR]=xl(OR),[jR,MR]=kR(OR),NR=DR(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=Hu({prop:r,defaultProp:i??!1,onChange:a,caller:OR}),[d,f]=v.useState(0),[p,m]=v.useState(0);return(0,y.jsx)(jR,{scope:t,triggerRef:s,contentRef:c,contentId:vA(),titleId:vA(),descriptionId:vA(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),[PR,FR]=kR(`DialogPortal`,{forceMount:void 0}),IR=`DialogContent`,LR=v.forwardRef(DR(function(e,t){let n=FR(IR,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=MR(IR,e.__scopeDialog);return(0,y.jsx)(Ou,{present:r||a.open,children:a.modal?(0,y.jsx)(RR,{...i,ref:t}):(0,y.jsx)(zR,{...i,ref:t})})},`DialogContent`)),RR=v.forwardRef(DR(function(e,t){let n=MR(IR,e.__scopeDialog),r=v.useRef(null),i=_l(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return bN(e)},[]),(0,y.jsx)(BR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:G(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:G(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:G(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),zR=v.forwardRef(DR(function(e,t){let n=MR(IR,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(BR,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),BR=v.forwardRef(DR(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=MR(IR,n);return Yk(),(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(nA,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(fu,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":VR(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function VR(e){return e?`open`:`closed`}DR(VR,`getState`);var HR=1,UR=.9,WR=.8,GR=.17,KR=.1,qR=.999,JR=.9999,YR=.99,XR=/[\\\/_+.#"@\[\(\{&]/,ZR=/[\\\/_+.#"@\[\(\{&]/g,QR=/[\s-]/,$R=/[\s-]/g;function ez(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?HR:YR;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=ez(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=HR:XR.test(e.charAt(l-1))?(d*=WR,p=e.slice(i,l-1).match(ZR),p&&i>0&&(d*=qR**+p.length)):QR.test(e.charAt(l-1))?(d*=UR,m=e.slice(i,l-1).match($R),m&&i>0&&(d*=qR**+m.length)):(d*=GR,i>0&&(d*=qR**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=JR)),(d<KR&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=ez(e,t,n,r,l+1,a+2,o),f*KR>d&&(d=f*KR)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function tz(e){return e.toLowerCase().replace($R,` `)}function nz(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,ez(e,t,tz(e),tz(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function rz(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function iz(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function az(...e){return t=>{let n=!1,r=e.map(e=>{let r=iz(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():iz(e[t],null)}}}}function oz(...e){return v.useCallback(az(...e),e)}function sz(e,t){let n=v.createContext(t),r=e=>{let{children:t,...r}=e,i=v.useMemo(()=>r,Object.values(r));return(0,y.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=v.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function cz(e,t=[]){let n=[];function r(t,r){let i=v.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=v.useMemo(()=>o,Object.values(o));return(0,y.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=v.useContext(s);if(c)return c;if(r!==void 0)return r;throw Error(`\`${n}\` must be used within \`${t}\``)}return[o,s]}let i=()=>{let t=n.map(e=>v.createContext(e));return function(n){let r=n?.[e]||t;return v.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,lz(i,...t)]}function lz(...e){let t=e[0];if(e.length===1)return t;let n=()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return v.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var uz=globalThis?.document?v.useLayoutEffect:()=>{},dz=v.useId||(()=>void 0),fz=0;function pz(e){let[t,n]=v.useState(dz());return uz(()=>{e||n(e=>e??String(fz++))},[e]),e||(t?`radix-${t}`:``)}var mz=v.useInsertionEffect||uz;function hz({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=gz({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=v.useRef(e!==void 0);v.useEffect(()=>{let e=t.current;e!==s&&console.warn(`${r} is changing from ${e?`controlled`:`uncontrolled`} to ${s?`controlled`:`uncontrolled`}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),t.current=s},[s,r])}return[c,v.useCallback(t=>{if(s){let n=_z(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function gz({defaultProp:e,onChange:t}){let[n,r]=v.useState(e),i=v.useRef(n),a=v.useRef(t);return mz(()=>{a.current=t},[t]),v.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function _z(e){return typeof e==`function`}function vz(e){let t=yz(e),n=v.forwardRef((e,n)=>{let{children:r,...i}=e,a=v.Children.toArray(r),o=a.find(xz);if(o){let e=o.props.children,r=a.map(t=>t===o?v.Children.count(e)>1?v.Children.only(null):v.isValidElement(e)?e.props.children:null:t);return(0,y.jsx)(t,{...i,ref:n,children:v.isValidElement(e)?v.cloneElement(e,void 0,r):null})}return(0,y.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function yz(e){let t=v.forwardRef((e,t)=>{let{children:n,...r}=e;if(v.isValidElement(n)){let e=Cz(n),i=Sz(r,n.props);return n.type!==v.Fragment&&(i.ref=t?az(t,e):e),v.cloneElement(n,i)}return v.Children.count(n)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var bz=Symbol(`radix.slottable`);function xz(e){return v.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===bz}function Sz(e,t){let n={...t};for(let r in t){let i=e[r],a=t[r];/^on[A-Z]/.test(r)?i&&a?n[r]=(...e)=>{let t=a(...e);return i(...e),t}:i&&(n[r]=i):r===`style`?n[r]={...i,...a}:r===`className`&&(n[r]=[i,a].filter(Boolean).join(` `))}return{...e,...n}}function Cz(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var wz=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=vz(`Primitive.${t}`),r=v.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,y.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Tz(e,t){e&&Zl.flushSync(()=>e.dispatchEvent(t))}function Ez(e){let t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>(...e)=>t.current?.(...e),[])}function Dz(e,t=globalThis?.document){let n=Ez(e);v.useEffect(()=>{let e=e=>{e.key===`Escape`&&n(e)};return t.addEventListener(`keydown`,e,{capture:!0}),()=>t.removeEventListener(`keydown`,e,{capture:!0})},[n,t])}var Oz=`DismissableLayer`,kz=`dismissableLayer.update`,Az=`dismissableLayer.pointerDownOutside`,jz=`dismissableLayer.focusOutside`,Mz,Nz=v.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Pz=v.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=v.useContext(Nz),[u,d]=v.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=v.useState({}),m=oz(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),b=u?h.indexOf(u):-1,x=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=_,C=Lz(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!S||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),w=Rz(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return Dz(e=>{b===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),v.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(Mz=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),zz(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=Mz)}},[u,f,n,l]),v.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),zz())},[u,l]),v.useEffect(()=>{let e=()=>p({});return document.addEventListener(kz,e),()=>document.removeEventListener(kz,e)},[]),(0,y.jsx)(wz.div,{...c,ref:m,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:rz(e.onFocusCapture,w.onFocusCapture),onBlurCapture:rz(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:rz(e.onPointerDownCapture,C.onPointerDownCapture)})});Pz.displayName=Oz;var Fz=`DismissableLayerBranch`,Iz=v.forwardRef((e,t)=>{let n=v.useContext(Nz),r=v.useRef(null),i=oz(t,r);return v.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,y.jsx)(wz.div,{...e,ref:i})});Iz.displayName=Fz;function Lz(e,t=globalThis?.document){let n=Ez(e),r=v.useRef(!1),i=v.useRef(()=>{});return v.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){Bz(Az,n,a,{discrete:!0})},a={originalEvent:e};e.pointerType===`touch`?(t.removeEventListener(`click`,i.current),i.current=r,t.addEventListener(`click`,i.current,{once:!0})):r()}else t.removeEventListener(`click`,i.current);r.current=!1},a=window.setTimeout(()=>{t.addEventListener(`pointerdown`,e)},0);return()=>{window.clearTimeout(a),t.removeEventListener(`pointerdown`,e),t.removeEventListener(`click`,i.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Rz(e,t=globalThis?.document){let n=Ez(e),r=v.useRef(!1);return v.useEffect(()=>{let e=e=>{e.target&&!r.current&&Bz(jz,n,{originalEvent:e},{discrete:!1})};return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zz(){let e=new CustomEvent(kz);document.dispatchEvent(e)}function Bz(e,t,n,{discrete:r}){let i=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Tz(i,a):i.dispatchEvent(a)}var Vz=`focusScope.autoFocusOnMount`,Hz=`focusScope.autoFocusOnUnmount`,Uz={bubbles:!1,cancelable:!0},Wz=`FocusScope`,Gz=v.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=v.useState(null),l=Ez(i),u=Ez(a),d=v.useRef(null),f=oz(t,e=>c(e)),p=v.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;v.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:Qz(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||Qz(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&Qz(s)};document.addEventListener(`focusin`,e),document.addEventListener(`focusout`,t);let r=new MutationObserver(n);return s&&r.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener(`focusin`,e),document.removeEventListener(`focusout`,t),r.disconnect()}}},[r,s,p.paused]),v.useEffect(()=>{if(s){$z.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(Vz,Uz);s.addEventListener(Vz,l),s.dispatchEvent(t),t.defaultPrevented||(Kz(nB(Jz(s)),{select:!0}),document.activeElement===e&&Qz(s))}return()=>{s.removeEventListener(Vz,l),setTimeout(()=>{let t=new CustomEvent(Hz,Uz);s.addEventListener(Hz,u),s.dispatchEvent(t),t.defaultPrevented||Qz(e??document.body,{select:!0}),s.removeEventListener(Hz,u),$z.remove(p)},0)}}},[s,l,u,p]);let m=v.useCallback(e=>{if(!n&&!r||p.paused)return;let t=e.key===`Tab`&&!e.altKey&&!e.ctrlKey&&!e.metaKey,i=document.activeElement;if(t&&i){let t=e.currentTarget,[r,a]=qz(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&Qz(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&Qz(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,y.jsx)(wz.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});Gz.displayName=Wz;function Kz(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(Qz(r,{select:t}),document.activeElement!==n)return}function qz(e){let t=Jz(e);return[Yz(t,e),Yz(t.reverse(),e)]}function Jz(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Yz(e,t){for(let n of e)if(!Xz(n,{upTo:t}))return n}function Xz(e,{upTo:t}){if(getComputedStyle(e).visibility===`hidden`)return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display===`none`)return!0;e=e.parentElement}return!1}function Zz(e){return e instanceof HTMLInputElement&&`select`in e}function Qz(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Zz(e)&&t&&e.select()}}var $z=eB();function eB(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=tB(e,t),e.unshift(t)},remove(t){e=tB(e,t),e[0]?.resume()}}}function tB(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function nB(e){return e.filter(e=>e.tagName!==`A`)}var rB=`Portal`,iB=v.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=v.useState(!1);uz(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?Zl.createPortal((0,y.jsx)(wz.div,{...r,ref:t}),o):null});iB.displayName=rB;function aB(e,t){return v.useReducer((e,n)=>t[e][n]??e,e)}var oB=e=>{let{present:t,children:n}=e,r=sB(t),i=typeof n==`function`?n({present:r.isPresent}):v.Children.only(n),a=oz(r.ref,lB(i));return typeof n==`function`||r.isPresent?v.cloneElement(i,{ref:a}):null};oB.displayName=`Presence`;function sB(e){let[t,n]=v.useState(),r=v.useRef(null),i=v.useRef(e),a=v.useRef(`none`),[o,s]=aB(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return v.useEffect(()=>{let e=cB(r.current);a.current=o===`mounted`?e:`none`},[o]),uz(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=cB(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),uz(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=cB(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(s(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},c=e=>{e.target===t&&(a.current=cB(r.current))};return t.addEventListener(`animationstart`,c),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,c),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:v.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function cB(e){return e?.animationName||`none`}function lB(e){let t=Object.getOwnPropertyDescriptor(e.props,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,`ref`)?.get,n=t&&`isReactWarning`in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uB=0;function dB(){v.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??fB()),document.body.insertAdjacentElement(`beforeend`,e[1]??fB()),uB++,()=>{uB===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),uB--}},[])}function fB(){let e=document.createElement(`span`);return e.setAttribute(`data-radix-focus-guard`,``),e.tabIndex=0,e.style.outline=`none`,e.style.opacity=`0`,e.style.position=`fixed`,e.style.pointerEvents=`none`,e}var pB=`Dialog`,[mB,hB]=cz(pB),[gB,_B]=mB(pB),vB=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=v.useRef(null),c=v.useRef(null),[l,u]=hz({prop:r,defaultProp:i??!1,onChange:a,caller:pB});return(0,y.jsx)(gB,{scope:t,triggerRef:s,contentRef:c,contentId:pz(),titleId:pz(),descriptionId:pz(),open:l,onOpenChange:u,onOpenToggle:v.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};vB.displayName=pB;var yB=`DialogTrigger`,bB=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=_B(yB,n),a=oz(t,i.triggerRef);return(0,y.jsx)(wz.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":BB(i.open),...r,ref:a,onClick:rz(e.onClick,i.onOpenToggle)})});bB.displayName=yB;var xB=`DialogPortal`,[SB,CB]=mB(xB,{forceMount:void 0}),wB=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=_B(xB,t);return(0,y.jsx)(SB,{scope:t,forceMount:n,children:v.Children.map(r,e=>(0,y.jsx)(oB,{present:n||a.open,children:(0,y.jsx)(iB,{asChild:!0,container:i,children:e})}))})};wB.displayName=xB;var TB=`DialogOverlay`,EB=v.forwardRef((e,t)=>{let n=CB(TB,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=_B(TB,e.__scopeDialog);return a.modal?(0,y.jsx)(oB,{present:r||a.open,children:(0,y.jsx)(OB,{...i,ref:t})}):null});EB.displayName=TB;var DB=vz(`DialogOverlay.RemoveScroll`),OB=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=_B(TB,n);return(0,y.jsx)(kP,{as:DB,allowPinchZoom:!0,shards:[i.contentRef],children:(0,y.jsx)(wz.div,{"data-state":BB(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),kB=`DialogContent`,AB=v.forwardRef((e,t)=>{let n=CB(kB,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=_B(kB,e.__scopeDialog);return(0,y.jsx)(oB,{present:r||a.open,children:a.modal?(0,y.jsx)(jB,{...i,ref:t}):(0,y.jsx)(MB,{...i,ref:t})})});AB.displayName=kB;var jB=v.forwardRef((e,t)=>{let n=_B(kB,e.__scopeDialog),r=v.useRef(null),i=oz(t,n.contentRef,r);return v.useEffect(()=>{let e=r.current;if(e)return bN(e)},[]),(0,y.jsx)(NB,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:rz(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:rz(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:rz(e.onFocusOutside,e=>e.preventDefault())})}),MB=v.forwardRef((e,t)=>{let n=_B(kB,e.__scopeDialog),r=v.useRef(!1),i=v.useRef(!1);return(0,y.jsx)(NB,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),NB=v.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=_B(kB,n),c=v.useRef(null),l=oz(t,c);return dB(),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(Gz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,y.jsx)(Pz,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":BB(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(WB,{titleId:s.titleId}),(0,y.jsx)(KB,{contentRef:c,descriptionId:s.descriptionId})]})]})}),PB=`DialogTitle`,FB=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=_B(PB,n);return(0,y.jsx)(wz.h2,{id:i.titleId,...r,ref:t})});FB.displayName=PB;var IB=`DialogDescription`,LB=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=_B(IB,n);return(0,y.jsx)(wz.p,{id:i.descriptionId,...r,ref:t})});LB.displayName=IB;var RB=`DialogClose`,zB=v.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=_B(RB,n);return(0,y.jsx)(wz.button,{type:`button`,...r,ref:t,onClick:rz(e.onClick,()=>i.onOpenChange(!1))})});zB.displayName=RB;function BB(e){return e?`open`:`closed`}var VB=`DialogTitleWarning`,[HB,UB]=sz(VB,{contentName:kB,titleName:PB,docsSlug:`dialog`}),WB=({titleId:e})=>{let t=UB(VB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
99
|
+
|
|
100
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
101
|
+
|
|
102
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return v.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},GB=`DialogDescriptionWarning`,KB=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${UB(GB).contentName}}.`;return v.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},qB=vB,JB=wB,YB=EB,XB=AB,ZB=`[cmdk-group=""]`,QB=`[cmdk-group-items=""]`,$B=`[cmdk-group-heading=""]`,eV=`[cmdk-item=""]`,tV=`${eV}:not([aria-disabled="true"])`,nV=`cmdk-item-select`,rV=`data-value`,iV=(e,t,n)=>nz(e,t,n),aV=v.createContext(void 0),oV=()=>v.useContext(aV),sV=v.createContext(void 0),cV=()=>v.useContext(sV),lV=v.createContext(void 0),uV=v.forwardRef((e,t)=>{let n=wV(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=wV(()=>new Set),i=wV(()=>new Map),a=wV(()=>new Map),o=wV(()=>new Set),s=SV(e),{label:c,children:l,value:u,onValueChange:d,filter:f,shouldFilter:p,loop:m,disablePointerSelection:h=!1,vimBindings:g=!0,..._}=e,y=pz(),b=pz(),x=pz(),S=v.useRef(null),C=DV();CV(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),CV(()=>{C(6,A)},[]);let w=v.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=j()?.id,w.emit()}),r||C(5,A),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=v.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=j();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??iV;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;M().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(QB);t?t.appendChild(e.parentElement===t?e:e.closest(`${QB} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${QB} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${ZB}[${rV}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=M().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(rV);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function A(){var e;let t=j();t&&(t.parentElement?.firstChild===t&&((e=t.closest(ZB)?.querySelector($B))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function j(){return S.current?.querySelector(`${eV}[aria-selected="true"]`)}function M(){return Array.from(S.current?.querySelectorAll(tV)||[])}function N(e){let t=M()[e];t&&w.setState(`value`,t.getAttribute(rV))}function P(e){var t;let n=j(),r=M(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(rV))}function F(e){let t=j()?.closest(ZB),n;for(;t&&!n;)t=e>0?bV(t,ZB):xV(t,ZB),n=t?.querySelector(tV);n?w.setState(`value`,n.getAttribute(rV)):P(e)}let I=()=>N(M().length-1),L=e=>{e.preventDefault(),e.metaKey?I():e.altKey?F(1):P(1)},ee=e=>{e.preventDefault(),e.metaKey?N(0):e.altKey?F(-1):P(-1)};return v.createElement(wz.div,{ref:t,tabIndex:-1,..._,"cmdk-root":``,onKeyDown:e=>{var t;(t=_.onKeyDown)==null||t.call(_,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:g&&e.ctrlKey&&L(e);break;case`ArrowDown`:L(e);break;case`p`:case`k`:g&&e.ctrlKey&&ee(e);break;case`ArrowUp`:ee(e);break;case`Home`:e.preventDefault(),N(0);break;case`End`:e.preventDefault(),I();break;case`Enter`:{e.preventDefault();let t=j();if(t){let e=new Event(nV);t.dispatchEvent(e)}}}}},v.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:AV},c),kV(e,e=>v.createElement(sV.Provider,{value:w},v.createElement(aV.Provider,{value:T},e))))}),dV=v.forwardRef((e,t)=>{let n=pz(),r=v.useRef(null),i=v.useContext(lV),a=oV(),o=SV(e),s=o.current?.forceMount??i?.forceMount;CV(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=EV(n,r,[e.value,e.children,r],e.keywords),l=cV(),u=TV(e=>e.value&&e.value===c.current),d=TV(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);v.useEffect(()=>{let t=r.current;if(!(!t||e.disabled))return t.addEventListener(nV,f),()=>t.removeEventListener(nV,f)},[d,e.onSelect,e.disabled]);function f(){var e,t;p(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function p(){l.setState(`value`,c.current,!0)}if(!d)return null;let{disabled:m,value:h,onSelect:g,forceMount:_,keywords:y,...b}=e;return v.createElement(wz.div,{ref:az(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!m,"aria-selected":!!u,"data-disabled":!!m,"data-selected":!!u,onPointerMove:m||a.getDisablePointerSelection()?void 0:p,onClick:m?void 0:f},e.children)}),fV=v.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=pz(),s=v.useRef(null),c=v.useRef(null),l=pz(),u=oV(),d=TV(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));CV(()=>u.group(o),[]),EV(o,s,[e.value,e.heading,c]);let f=v.useMemo(()=>({id:o,forceMount:i}),[i]);return v.createElement(wz.div,{ref:az(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!d||void 0},n&&v.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),kV(e,e=>v.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},v.createElement(lV.Provider,{value:f},e))))}),pV=v.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=v.useRef(null),a=TV(e=>!e.search);return!n&&!a?null:v.createElement(wz.div,{ref:az(i,t),...r,"cmdk-separator":``,role:`separator`})}),mV=v.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=cV(),o=TV(e=>e.search),s=TV(e=>e.selectedItemId),c=oV();return v.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),v.createElement(wz.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),hV=v.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=v.useRef(null),o=v.useRef(null),s=TV(e=>e.selectedItemId),c=oV();return v.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),v.createElement(wz.div,{ref:az(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},kV(e,e=>v.createElement(`div`,{ref:az(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),gV=v.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return v.createElement(qB,{open:n,onOpenChange:r},v.createElement(JB,{container:o},v.createElement(YB,{"cmdk-overlay":``,className:i}),v.createElement(XB,{"aria-label":e.label,"cmdk-dialog":``,className:a},v.createElement(uV,{ref:t,...s}))))}),_V=v.forwardRef((e,t)=>TV(e=>e.filtered.count===0)?v.createElement(wz.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),vV=v.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return v.createElement(wz.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},kV(e,e=>v.createElement(`div`,{"aria-hidden":!0},e)))}),yV=Object.assign(uV,{List:hV,Item:dV,Input:mV,Group:fV,Separator:pV,Dialog:gV,Empty:_V,Loading:vV});function bV(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function xV(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function SV(e){let t=v.useRef(e);return CV(()=>{t.current=e}),t}var CV=typeof window>`u`?v.useEffect:v.useLayoutEffect;function wV(e){let t=v.useRef();return t.current===void 0&&(t.current=e()),t}function TV(e){let t=cV(),n=()=>e(t.snapshot());return v.useSyncExternalStore(t.subscribe,n,n)}function EV(e,t,n,r=[]){let i=v.useRef(),a=oV();return CV(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(rV,s),i.current=s}),i}var DV=()=>{let[e,t]=v.useState(),n=wV(()=>new Map);return CV(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function OV(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function kV({asChild:e,children:t},n){return e&&v.isValidElement(t)?v.cloneElement(OV(t),{ref:t.ref},n(t.props.children)):n(t)}var AV={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},jV=({className:e,...t})=>(0,y.jsx)(yV,{className:W(`flex flex-col overflow-hidden rounded-md px-3 py-2`,e),...t}),MV=({children:e,...t})=>(0,y.jsx)(NR,{...t,children:(0,y.jsx)(LR,{className:`overflow-hidden p-0`,children:(0,y.jsx)(jV,{className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]_svg]:size-5`,children:e})})}),NV=({className:e,...t})=>(0,y.jsxs)(`div`,{className:W(`flex flex-1 items-center gap-2 px-3 py-2`,`rounded-2xl supports-[corner-shape:squircle]:rounded-4xl`,`bg-neutral-50 dark:bg-neutral-950`,`ring-1 ring-neutral-100 dark:ring-neutral-700`,`transition-shadow duration-100 focus-within:ring-3 hover:ring-3`,e),"cmdk-input-wrapper":``,children:[(0,y.jsx)(jf,{className:`size-4 shrink-0 opacity-50`}),(0,y.jsx)(yV.Input,{className:`flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,...t})]}),PV=({className:e,...t})=>(0,y.jsx)(yV.List,{className:W(`max-h-75 overflow-y-auto overflow-x-hidden`,e),...t}),FV=e=>(0,y.jsx)(yV.Empty,{className:`py-6 text-center text-sm`,...e}),IV=({className:e,...t})=>(0,y.jsx)(yV.Group,{className:W(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs`,e),...t}),LV=({className:e,...t})=>(0,y.jsx)(yV.Separator,{className:W(`-mx-1 h-px bg-border`,e),...t}),RV=({className:e,...t})=>(0,y.jsx)(yV.Item,{className:W(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}),zV=({className:e,...t})=>(0,y.jsx)(`span`,{className:W(`ml-auto text-muted-foreground text-xs tracking-widest`,e),...t}),BV={...jV,Dialog:MV,Input:NV,List:PV,Empty:FV,Group:IV,Separator:LV,Item:RV,Shortcut:zV},VV=(0,v.createContext)(null),HV=()=>{let e=(0,v.useContext)(VV);if(!e)throw Error(`useMultiSelect must be used within MultiSelectProvider`);return e},UV=({values:e,defaultValues:t,onValueChange:n,loop:r=!1,className:i,children:a,dir:o,...s})=>{let[c,l]=(0,v.useState)(t??[]),[u,d]=(0,v.useState)(``),[f,p]=(0,v.useState)(!1),[m,h]=(0,v.useState)(-1),g=(0,v.useRef)(null),[_,b]=(0,v.useState)(!1),[x,S]=(0,v.useState)(``);(0,v.useEffect)(()=>{e&&l(e)},[e]);let C=(0,v.useCallback)(e=>{if(c.includes(e)){let t=c.filter(t=>t!==e);l(t),n?.(t)}else{let t=[...c,e];l(t),n?.(t)}},[c]),w=(0,v.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=t.value.substring(t.selectionStart??0,t.selectionEnd??0);S(n),b(n===u)},[u]),T=(0,v.useCallback)(e=>{e.stopPropagation();let t=g.current;if(!t)return;let n=()=>{let e=m+1;h(e>c.length-1?r?0:-1:e)},i=()=>{let e=m-1;h(e<0?c.length-1:e)},a=()=>{let e=m-1<=0?c.length-1==0?-1:0:m-1;h(e)};switch(e.key){case`ArrowLeft`:o===`rtl`?c.length>0&&(m!==-1||r)&&n():c.length>0&&t.selectionStart===0&&i();break;case`ArrowRight`:o===`rtl`?c.length>0&&t.selectionStart===0&&i():c.length>0&&(m!==-1||r)&&n();break;case`Backspace`:case`Delete`:c.length>0&&(m!==-1&&m<c.length?(C(c[m]),a()):(t.selectionStart===0&&x===u||_)&&C(c[c.length-1]));break;case`Enter`:p(!0);break;case`Escape`:m===-1?f&&p(!1):h(-1)}},[c,u,m,r]),E=(0,v.useMemo)(()=>({value:c,onValueChange:C,open:f,setOpen:p,inputValue:u,setInputValue:d,activeIndex:m,setActiveIndex:h,ref:g,handleSelect:w}),[c,C,f,p,u,d,m,h,g,w]);return(0,y.jsx)(VV,{value:E,children:(0,y.jsx)(jV,{onKeyDown:T,className:W(`flex w-full flex-col gap-2 overflow-visible bg-transparent`,i),dir:o,...s,children:a})})},WV=({className:e,getBadgeValue:t=e=>e,validationStyleEnabled:n=!1,children:r,...i})=>{let{value:a,onValueChange:o,activeIndex:s}=HV(),c=(0,v.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]);return(0,y.jsxs)(`div`,{className:W(`flex w-full flex-col gap-3`,`cursor-pointer select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-text`,`ring-0`,`focus-within:outline-none`,`focus-within:ring-3`,`focus-within:ring-neutral-200`,`dark:focus-within:ring-neutral-500`,`focus-within:ring-offset-white`,`dark:focus-within:ring-offset-neutral-500`,`[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,n&&`valid:border-success invalid:border-error`,e),...i,children:[a.length>0&&(0,y.jsx)(`div`,{className:`flex w-full flex-wrap gap-1`,children:a.map((e,n)=>(0,y.jsxs)(TR,{className:W(`flex items-center gap-1 rounded-xl px-1`,s===n&&`ring-2 ring-muted-foreground`),color:`text`,children:[(0,y.jsx)(`span`,{className:`text-xs`,children:t(e)}),(0,y.jsxs)(`button`,{"aria-label":`Remove ${e} option`,"aria-roledescription":`button to remove option`,onMouseDown:c,onClick:()=>o(e),children:[(0,y.jsxs)(`span`,{className:`sr-only`,children:[`Remove `,e,` option`]}),(0,y.jsx)(Pf,{className:`size-4 cursor-pointer`})]})]},e))}),r]})},GV=e=>{let t=(0,V.c)(5),{className:n,...r}=e,{setOpen:i,inputValue:a,setInputValue:o,activeIndex:s,setActiveIndex:c,handleSelect:l,ref:u}=HV(),d,f;t[0]===i?(d=t[1],f=t[2]):(d=()=>i(!1),f=()=>i(!0),t[0]=i,t[1]=d,t[2]=f);let p;return t[3]===c?p=t[4]:(p=()=>c(-1),t[3]=c,t[4]=p),(0,y.jsx)(BV.Input,{...r,tabIndex:0,ref:u,value:a,onValueChange:s===-1?o:void 0,onSelect:l,onBlur:d,onFocus:f,onClick:p,className:W(`ml-2 flex-1 cursor-pointer outline-hidden`,n,s!==-1&&`caret-transparent`)})},KV=e=>{let t=(0,V.c)(2),{children:n}=e,{open:r}=HV(),i=r&&n,a;return t[0]===i?a=t[1]:(a=(0,y.jsx)(`div`,{className:`relative`,children:i}),t[0]=i,t[1]=a),a},qV=({className:e,children:t})=>(0,y.jsxs)(BV.List,{className:W(`absolute top-0 z-10 flex w-full flex-col gap-2`,`rounded-xl p-2 shadow-md`,`bg-white dark:bg-neutral-950`,`text-text`,`border border-neutral-200 dark:border-neutral-800`,`transition-colors`,e),children:[t,(0,y.jsx)(BV.Empty,{children:(0,y.jsx)(`span`,{className:`text-muted-foreground`,children:`No results found`})})]}),JV=e=>{let t=(0,V.c)(4),{className:n,value:r,children:i,...a}=e,{value:o,onValueChange:s,setInputValue:c}=HV(),l=XV,u=o.includes(r),d;return t[0]!==s||t[1]!==c||t[2]!==r?(d=()=>{s(r),c(``)},t[0]=s,t[1]=c,t[2]=r,t[3]=d):d=t[3],(0,y.jsxs)(BV.Item,{...a,onSelect:d,className:W(`flex cursor-pointer justify-between`,`rounded-lg px-2 py-1`,`transition-colors`,`hover:bg-neutral/10`,u&&`opacity-50`,a.disabled&&`cursor-not-allowed opacity-50`,n),onMouseDown:l,children:[i,u&&(0,y.jsx)(ff,{className:`size-4`})]})},YV=UV;YV.Trigger=WV,YV.Input=GV,YV.Content=KV,YV.List=qV,YV.Item=JV;function XV(e){e.preventDefault(),e.stopPropagation()}var ZV=e=>{let{id:t,...n}=e,r=(0,v.useId)(),i=t??r;return(0,y.jsx)(QV,{value:{id:i},children:(0,y.jsx)(`div`,{className:`flex flex-col gap-2 p-2`,id:i,suppressHydrationWarning:!0,...n})})},QV=(0,v.createContext)({}),$V=e=>e.type===`checkbox`,eH=e=>e.type===`file`,tH=e=>e instanceof Date,nH=e=>e==null,rH=e=>typeof e==`object`,iH=e=>!nH(e)&&!Array.isArray(e)&&rH(e)&&!tH(e),aH=e=>iH(e)&&e.target?$V(e.target)?e.target.checked:eH(e.target)?e.target.files:e.target.value:e,oH=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),sH=e=>{let t=e.constructor&&e.constructor.prototype;return iH(t)&&t.hasOwnProperty(`isPrototypeOf`)},cH=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function lH(e){if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(cH&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&!(iH(e)&&sH(e)))return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=lH(e[t]));return r}var uH={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},dH={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},fH={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},pH=`root`,mH=[`__proto__`,`constructor`,`prototype`],hH=/^\w*$/,gH=e=>hH.test(e),_H=e=>e===void 0,vH=/[.[\]'"]/,yH=e=>e.split(vH).filter(Boolean),Z=(e,t,n)=>{if(!t||!iH(e))return n;let r=gH(t)?[t]:yH(t);if(r.some(e=>mH.includes(e)))return n;let i=r.reduce((e,t)=>nH(e)?void 0:e[t],e);return _H(i)||i===e?_H(e[t])?n:e[t]:i},bH=e=>typeof e==`boolean`,xH=e=>typeof e==`function`,SH=(e,t,n)=>{let r=-1,i=gH(t)?[t]:yH(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=iH(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(mH.includes(t))return;e[t]=a,e=e[t]}},CH=v.createContext(null);CH.displayName=`HookFormControlContext`;var wH=()=>v.useContext(CH),TH=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==dH.all&&(t._proxyFormState[i]=!r||dH.all),n&&(n[i]=!0),e[i]}});return i},EH=cH?v.useLayoutEffect:v.useEffect,DH=e=>nH(e)||!rH(e),OH=(e,t)=>t.length===0&&!Array.isArray(e)&&!sH(e);function kH(e,t,n=new WeakMap){if(e===t)return!0;if(DH(e)||DH(t))return Object.is(e,t);if(tH(e)&&tH(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(OH(e,r)||OH(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(tH(r)&&tH(e)||(iH(r)||Array.isArray(r))&&(iH(e)||Array.isArray(e))?!kH(r,e,n):!Object.is(r,e))return!1}}return!0}function AH(){let e=v.useRef(!1),t=v.useRef(void 0);return{resyncIfNeeded:v.useCallback((n,r,i)=>{if(n&&e.current){let e=r();kH(t.current,e)||i(e)}e.current=!0},[]),snapshot:v.useCallback((e,n)=>{e&&(t.current=lH(n()))},[])}}function jH(e){let t=wH(),{control:n=t,disabled:r,name:i,exact:a}=e||{},[o,s]=v.useState(()=>({...n._formState,defaultValues:n._defaultValues})),c=v.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:l,snapshot:u}=AH();return EH(()=>{let e=()=>({...n._formState,defaultValues:n._defaultValues});l(!r,e,s);let t=n._subscribe({name:i,formState:c.current,exact:a,callback:e=>{!r&&s({...n._formState,...e,defaultValues:n._defaultValues})}});return()=>{t(),u(!r,e)}},[i,r,a,l,u]),v.useEffect(()=>{c.current.isValid&&n._setValid(!0)},[n]),v.useMemo(()=>TH(o,n,c.current,!1),[o,n])}var MH=e=>typeof e==`string`,NH=(e,t,n,r,i)=>MH(e)?(r&&t.watch.add(e),Z(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),Z(n,e))):(r&&(t.watchAll=!0),n);function PH(e){let t=wH(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=v.useRef(i),l=v.useRef(s),u=v.useRef(void 0),d=v.useRef(n),f=v.useRef(r);l.current=s;let[p,m]=v.useState(()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e}),h=v.useCallback(e=>{let t=NH(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),g=v.useCallback(e=>{if(!a){let t=NH(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);kH(e,u.current)||(m(e),u.current=e)}else m(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:_,snapshot:y}=AH(),b=v.useRef(g);b.current=g;let x=v.useRef(h);x.current=h,EH(()=>{d.current!==n||!kH(f.current,r)?(d.current=n,f.current=r,b.current()):_(!a,()=>x.current(),e=>{m(e),u.current=e});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{b.current(e.values)}});return()=>{e(),y(!a,()=>x.current())}},[n,o,r,a,_,y]),v.useEffect(()=>n._removeUnmounted());let S=d.current!==n,C=f.current,w=v.useMemo(()=>{if(a)return null;let e=!S&&!kH(C,r);return S||e?h():null},[a,S,r,C,h]);return w===null?p:w}function FH(e){let t=wH(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=oH(i._names.array,n),l=PH({control:i,name:n,defaultValue:v.useMemo(()=>Z(i._formValues,n,Z(i._defaultValues,n,o)),[i,n,o]),exact:s}),u=jH({control:i,name:n,exact:s}),d=v.useRef(e),f=v.useRef(null),p=v.useRef(i.register(n,{...e.rules,value:l,...bH(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let m=v.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Z(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Z(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Z(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Z(u.validatingFields,n)},error:{enumerable:!0,get:()=>Z(u.errors,n)}}),[u,n]),h=v.useCallback(e=>{let t=aH(e);return Z(i._fields,n)||(p.current=i.register(n,{...d.current.rules,value:t})),p.current.onChange({target:{value:aH(e),name:n},type:uH.CHANGE})},[n,i]),g=v.useCallback(()=>p.current.onBlur({target:{value:Z(i._formValues,n),name:n},type:uH.BLUR}),[n,i._formValues]),_=v.useCallback(e=>{e&&(f.current={focus:()=>xH(e.focus)&&e.focus(),select:()=>xH(e.select)&&e.select(),setCustomValidity:t=>xH(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>xH(e.reportValidity)&&e.reportValidity()});let t=Z(i._fields,n);t&&t._f&&e&&(t._f.ref=f.current)},[i._fields,n]),y=v.useMemo(()=>({name:n,value:l,...bH(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h,onBlur:g,ref:_}),[n,r,u.disabled,h,g,_,l]);return v.useEffect(()=>{let e=i._options.shouldUnregister||a;p.current=i.register(n,{...d.current.rules,...bH(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=Z(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=lH(Z(a?i._defaultValues:i._options.values||i._defaultValues,n,Z(i._options.defaultValues,n,d.current.defaultValue)));SH(i._defaultValues,n,e),_H(Z(i._formValues,n))&&SH(i._formValues,n,e)}if(!c&&i.register(n),f.current){let e=Z(i._fields,n);e&&e._f&&(e._f.ref=f.current)}return()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),v.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),v.useMemo(()=>({field:y,formState:u,fieldState:m}),[y,u,m])}var IH=e=>e.render(FH(e)),LH=e=>({isOnSubmit:!e||e===dH.onSubmit,isOnBlur:e===dH.onBlur,isOnChange:e===dH.onChange,isOnAll:e===dH.all,isOnTouch:e===dH.onTouched}),RH=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},zH=(e,t,n,r)=>{for(let i of n||Object.keys(e)){if(i===`_f`)continue;let a=n?Z(e,i):e[i];if(a){let{_f:e}=a;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(zH(a,t))break}else if((iH(a)||Array.isArray(a))&&zH(a,t))break}}},BH=(e,t,n)=>{let r=Z(e,n),i=Array.isArray(r)?r:[];return SH(i,pH,t[n]),SH(e,n,i),e},VH=e=>iH(e)&&!Object.keys(e).length,HH=e=>{if(!cH)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},UH=e=>e.type===`radio`,WH=e=>e instanceof RegExp,GH=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},KH={value:!1,isValid:!1},qH={value:!0,isValid:!0},JH=e=>{if(Array.isArray(e)){if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!_H(e[0].attributes.value)?_H(e[0].value)||e[0].value===``?qH:{value:e[0].value,isValid:!0}:qH:KH}return KH},YH={isValid:!1,value:null},XH=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,YH):YH;function ZH(e,t,n=`validate`){if(MH(e)||Array.isArray(e)&&e.every(MH)||bH(e)&&!e)return{type:n,message:MH(e)?e:``,ref:t}}var QH=e=>iH(e)&&!WH(e)?e:{value:e,message:``},$H=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=Z(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{if(i&&y.reportValidity){let t=bH(e)?``:e||``;s?s.forEach(e=>e.setCustomValidity(t)):y.setCustomValidity(t),y.reportValidity()}},x={},S=UH(o),C=$V(o),w=S||C,T=(g||eH(o))&&_H(o.value)&&_H(v)||HH(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,E=GH.bind(null,h,r,x),D=(e,t,n,r=fH.maxLength,i=fH.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||nH(v))||bH(v)&&!v||C&&!JH(s).isValid||S&&!XH(s).isValid)){let{value:e,message:t}=MH(c)?{value:!!c,message:c}:QH(c);if(e&&(x[h]={type:fH.required,message:t,ref:y,...E(fH.required,t)},!r))return b(t),x}if(!T&&(!nH(d)||!nH(f))){let e,t,n=QH(f),i=QH(d);if(!nH(v)&&!tH(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;nH(n.value)||(e=r>n.value),nH(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;MH(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),MH(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,fH.max,fH.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(MH(v)||a&&Array.isArray(v))){let e=QH(l),t=QH(u),n=!nH(e.value)&&v.length>+e.value,i=!nH(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&MH(v)){let{value:e,message:t}=QH(p);if(WH(e)&&!v.match(e)&&(x[h]={type:fH.pattern,message:t,ref:o,...E(fH.pattern,t)},!r))return b(t),x}if(m){if(xH(m)){let e=ZH(await m(v,n),y);if(e&&(x[h]={...e,...E(fH.validate,e.message)},!r))return b(e.message),x}else if(iH(m)){let e={};for(let t in m){if(!VH(e)&&!r)break;let i=ZH(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!VH(e)&&(x[h]={ref:y,...e},!r))return x}}return b(!0),x},eU=e=>Array.isArray(e)?e:[e],tU=e=>Array.isArray(e)?e.filter(Boolean):[];function nU(e,t){let n=t.length-1,r=0;for(;r<n;){if(nH(e)){e=void 0;break}e=e[t[r]],r++}return e}function rU(e){for(let t in e)if(e.hasOwnProperty(t)&&!_H(e[t]))return!1;return!0}function iU(e,t){if(MH(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:gH(t)?[t]:yH(t);if(n.some(e=>mH.includes(String(e))))return e;let r=n.length===1?e:nU(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(iH(r)&&VH(r)||Array.isArray(r)&&rU(r))&&iU(e,n.slice(0,-1)),e}var aU=e=>{let t={};for(let n of Object.keys(e))if(rH(e[n])&&e[n]!==null&&!tH(e[n])){let r=aU(e[n]);for(let e of Object.keys(r))t[`${n}.${e}`]=r[e]}else t[n]=e[n];return t},oU=v.createContext(null);oU.displayName=`HookFormContext`;var sU=()=>v.useContext(oU),cU=({children:e,watch:t,getValues:n,getFieldState:r,setError:i,clearErrors:a,setValue:o,setValues:s,trigger:c,formState:l,resetField:u,reset:d,resetDefaultValues:f,handleSubmit:p,unregister:m,control:h,register:g,setFocus:_,subscribe:y})=>{let b=v.useMemo(()=>({watch:t,getValues:n,getFieldState:r,setError:i,clearErrors:a,setValue:o,setValues:s,trigger:c,formState:l,resetField:u,reset:d,resetDefaultValues:f,handleSubmit:p,unregister:m,control:h,register:g,setFocus:_,subscribe:y}),[a,h,l,r,n,p,g,d,f,u,i,_,o,s,y,c,m,t]);return v.createElement(oU.Provider,{value:b},v.createElement(CH.Provider,{value:b.control},e))},lU=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function uU(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&iH(i)&&a){let e=uU(i,a);iH(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var dU=e=>e.type===`select-multiple`,fU=e=>UH(e)||$V(e),pU=e=>HH(e)&&e.isConnected;function mU(e){return Array.isArray(e)||iH(e)}function hU(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];mU(o)&&mU(Z(t,a))?hU(o,t,a,r):r.push(a)}return r}var gU=e=>{for(let t in e)if(xH(e[t]))return!0;return!1};function _U(e){return Array.isArray(e)||iH(e)&&!gU(e)}function vU(e){return!!(e&&`_f`in e)}function yU(e){return Array.isArray(e)?!e.some(e=>!_H(e)):!Object.keys(e).length}function bU(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function xU(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];_U(i)&&(!Array.isArray(i)||!vU(a))?(t[r]=Array.isArray(i)?[]:{},xU(i,t[r],a),yU(t[r])&&bU(t,r)):_H(i)||(t[r]=!0)}return t}function SU(e,t,n,r){n||=xU(t,{},r);for(let i in e){let a=e[i],o=r&&r[i];_U(a)&&(!Array.isArray(a)||!vU(o))?(_H(t)||DH(n[i])?n[i]=xU(a,Array.isArray(a)?[]:{},o):SU(a,nH(t)?{}:t[i],n[i],o),yU(n[i])&&bU(n,i)):kH(a,t[i])?bU(n,i):n[i]=!0}return n}var CU=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>_H(e)?e:t?e===``?NaN:e&&+e:n&&MH(e)?new Date(e):r?r(e):e;function wU(e){let t=e.ref;return eH(t)?t.files:UH(t)?XH(e.refs).value:dU(t)?[...t.selectedOptions].map(({value:e})=>e):$V(t)?JH(e.refs).value:CU(t.value,e)}var TU=(e,t,n,r)=>{let i={};for(let n of e){let e=Z(t,n);e&&SH(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},EU=e=>_H(e)?e:WH(e)?e.source:iH(e)?WH(e.value)?e.value.source:e.value:e,DU=`AsyncFunction`,OU=e=>{if(!e||!e.validate)return!1;if(xH(e.validate))return e.validate.constructor.name===DU;if(iH(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===DU)return!0}return!1},kU=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function AU(e,t,n){let r=Z(e,n);if(r||gH(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=Z(t,r),o=Z(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var jU=(e,t,n,r)=>{n(e);let i=Object.keys(e).filter(e=>e!==`name`);return!i.length||r&&i.length>=Object.keys(t).length||i.find(e=>t[e]===(!r||dH.all))},MU=(e,t,n)=>!e||!t||e===t||eU(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),NU=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,PU=(e,t)=>{let n=Z(e,t);!tU(n).length&&!n?.root&&iU(e,t)},FU={mode:dH.onSubmit,reValidateMode:dH.onChange,shouldFocusError:!0},IU=`form`,LU=(e,t)=>{for(let n in e)n in t||delete e[n];Object.assign(e,t)},RU={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function zU(e={}){let t={...FU,...e},n={...lH(RU),isLoading:xH(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(iH(t.defaultValues)||iH(t.values))&&lH(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:lH(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c={},l={},u=0,d=LH(t.mode),f=LH(t.reValidateMode),p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p},h={...m},g={array:lU(),state:lU()},_=0,v=t.criteriaMode===dH.all,y=(e,t)=>n=>{clearTimeout(l[e]),l[e]=setTimeout(t,n)},b=async e=>{if(!o.keepIsValid&&!t.disabled&&(m.isValid||h.isValid||e)){let e=++_,i;t.resolver?(i=VH((await j()).errors),e===_&&x()):i=await P({fields:r,onlyCheckValid:!0,eventType:uH.VALID}),e===_&&i!==n.isValid&&g.state.next({isValid:i})}},x=(e,r)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((e||Array.from(s.mount)).forEach(e=>{e&&(r?SH(n.validatingFields,e,r):iU(n.validatingFields,e))}),g.state.next({validatingFields:n.validatingFields,isValidating:!VH(n.validatingFields)}))},S=()=>{n.dirtyFields=SU(i,a,void 0,r)},C=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){if(o.action=!0,!o.actionArrayLengths.has(e)){let t=Z(r,e);o.actionArrayLengths.set(e,Array.isArray(t)?t.length:0)}if(u&&Array.isArray(Z(r,e))){let t=s(Z(r,e),c.argA,c.argB);l&&SH(r,e,t)}if(u&&Array.isArray(Z(n.errors,e))){let t=Z(n.errors,e),r=t.root,i=s(t,c.argA,c.argB)||t;r&&(i.root=r),l&&SH(n.errors,e,i),PU(n.errors,e)}if((m.touchedFields||h.touchedFields)&&u&&Array.isArray(Z(n.touchedFields,e))){let t=s(Z(n.touchedFields,e),c.argA,c.argB);l&&SH(n.touchedFields,e,t)}(m.dirtyFields||h.dirtyFields)&&S(),g.state.next({name:e,isDirty:I(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else SH(a,e,i)},w=(e,t)=>{SH(n.errors,e,t),n.errors={...n.errors},g.state.next({errors:n.errors})},T=e=>{n.errors=e,g.state.next({errors:n.errors,isValid:!1})},E=e=>{let t=gH(e)?[e]:yH(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=nH(n)?n:n[i],r=nH(r)?r:r[i],n===null&&r!==null)return!0}return!1},D=e=>{if(!o.actionArrayLengths.size)return!1;let t=gH(e)?[e]:yH(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(nH(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a]}return!1},O=(t,c,l,u)=>{let d=Z(r,t);if(d){if(E(t)||D(t))return;let r=_H(Z(a,t)),f=Z(a,t,_H(l)?Z(i,t):l);_H(f)||u&&u.defaultChecked||c?SH(a,t,c?f:wU(d._f)):te(t,f),o.mount&&!o.action&&(b(),r&&n.isDirty&&(m.isDirty||h.isDirty)&&(I()||(n.isDirty=!1,g.state.next({...n}))),e.shouldUnregister&&r&&!_H(Z(a,t))&&RH(t,s)&&(o.watch=!0))}},k=(e,o,s,c,l)=>{let u=!1,d=!1,f={name:e};if(!t.disabled||c===!0){if(!s||c){let t=kH(Z(i,e),o);(m.isDirty||h.isDirty)&&(d=n.isDirty,n.isDirty=f.isDirty=!t||I(),u=d!==f.isDirty),d=!!Z(n.dirtyFields,e),t===n.isDirty?t?iU(n.dirtyFields,e):SH(n.dirtyFields,e,!0):LU(n.dirtyFields,SU(i,a,void 0,r)),f.dirtyFields=n.dirtyFields,u||=(m.dirtyFields||h.dirtyFields)&&d!==!t}if(s){let t=Z(n.touchedFields,e);t||(SH(n.touchedFields,e,s),f.touchedFields=n.touchedFields,u||=(m.touchedFields||h.touchedFields)&&t!==s)}u&&l&&g.state.next(f)}return u?f:{}},A=(e,r,i,a)=>{let o=Z(n.errors,e),s=(m.isValid||h.isValid)&&bH(r)&&n.isValid!==r;if(t.delayError&&i?(c[e]=y(e,()=>w(e,i)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e],i?SH(n.errors,e,i):iU(n.errors,e),n.errors={...n.errors}),(i?!kH(o,i):o)||!VH(a)||s){let t={...a,...s&&bH(r)?{isValid:r}:{},errors:n.errors,name:e};n={...n,...t},g.state.next(t)}},j=async e=>(x(e,!0),await t.resolver(a,t.context,TU(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),M=async e=>{let{errors:t}=await j(e);if(x(e),e){for(let r of e){let e=Z(t,r);e?s.array.has(r)&&iH(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e)))?BH(n.errors,{[r]:e},r):SH(n.errors,r,e):iU(n.errors,r)}n.errors={...n.errors}}else n.errors=t;return t},N=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(iH(i))for(let e in i){let t=i[e];t&&le(`${IU}.${e}`,{message:MH(t.message)?t.message:``,type:t.type||fH.validate})}else MH(i)||!i?le(IU,{message:i||``,type:fH.validate}):ce(IU);return i}return!0},P=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await N({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...d}=u;if(r){let o=s.array.has(r.name),c=u._f&&OU(u._f),d=m.validatingFields||m.isValidating||h.validatingFields||h.isValidating;c&&d&&x([r.name],!0);let f=await $H(u,s.disabled,a,v,t.shouldUseNativeValidation&&!i,o);if(c&&d&&x([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(Z(f,r.name)?o?BH(n.errors,f,r.name):SH(n.errors,r.name,f[r.name]):iU(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!VH(d)&&await P({context:l,onlyCheckValid:i,fields:d,name:o,eventType:c})}}return l.valid},F=()=>{for(let e of s.unMount){let t=Z(r,e);t&&(t._f.refs?t._f.refs.every(e=>!pU(e)):!pU(t._f.ref))&&pe(e)}s.unMount=new Set},I=(e,t)=>(e&&t&&SH(a,e,t),!kH(o.mount?a:i,i)),L=(e,t,n)=>NH(e,s,{...o.mount?a:_H(t)||MH(e)?i:t},n,t),ee=e=>tU(Z(o.mount?a:i,e,t.shouldUnregister?Z(i,e,[]):[])),te=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=Z(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&SH(a,e,CU(t,n)),l=HH(n.ref)&&nH(t)?``:t,dU(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?$V(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(l)?!!l.find(t=>t===e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):eH(n.ref)?n.ref.value=``:(n.ref.value=l,!n.ref.type&&!o&&!s&&g.state.next({name:e,values:i?a:lH(a)})))}(n.shouldDirty||n.shouldTouch)&&k(e,l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&ae(e,{delayError:n.delayError})},ne=(e,t,n,i=!1,o=!1,c=!1)=>{s.array.has(e)&&g.array.next({name:e,values:i?a:lH(a)});for(let a in t){if(!t.hasOwnProperty(a))return;let l=t[a],u=e+`.`+a,d=Z(r,u);(s.array.has(e)||iH(l)||d&&!d._f)&&!tH(l)?ne(u,l,n,i,o,c):te(u,l,n,i,o,c)}},R=(e,t,i,c,l=!1)=>{let u=Z(r,e),d=s.array.has(e),f=c?t:lH(t),p=kH(Z(a,e),f);if(p||SH(a,e,f),d)g.array.next({name:e,values:c?a:lH(a)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&i.shouldDirty&&(S(),l||g.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:I(e,f)}));else{let t=Array.isArray(f)&&!f.length||VH(f),n=!p&&!l;!u||u._f||nH(f)||t?te(e,f,i,c,l,n):ne(e,f,i,c,l,n)}if(!p&&!l){let t=RH(e,s),r=c?a:lH(a);g.state.next({...t&&n,name:o.mount||t?e:void 0,values:r})}},z=(e,t,n={})=>R(e,t,n,!1),B=(e,t={})=>{let r=xH(e)?e(a):e;if(!kH(a,r)){a={...a,...r};let e=aU(r);for(let n of s.mount)n in e&&R(n,e[n],t,!0,!0);g.state.next({...n,name:void 0,type:void 0,...u?{values:a}:{}}),t.shouldValidate&&b()}},re=async i=>{o.mount=!0;let l=i.target,p=l.name,_=!0,y=Z(r,p),S=e=>{_=Number.isNaN(e)||tH(e)&&isNaN(e.getTime())||kH(e,Z(a,p,e))};if(y){let o,C,w=l.type?wU(y._f):aH(i),T=i.type===uH.BLUR||i.type===uH.FOCUS_OUT,E=!kU(y._f)&&!e.validate&&!t.resolver&&!Z(n.errors,p)&&!y._f.deps,D=E||NU(T,Z(n.touchedFields,p),n.isSubmitted,f,d),O=RH(p,s,T);if(SH(a,p,w),T){if(!l||!l.readOnly){y._f.onBlur&&y._f.onBlur(i);let e=c[p];e&&e(0)}}else y._f.onChange&&y._f.onChange(i);let M=k(p,w,T),F=!VH(M)||O;if(!T&&g.state.next({name:p,type:i.type,...u?{values:lH(a)}:{}}),D)return(!E||!n.isValid)&&(m.isValid||h.isValid)&&(t.mode===`onBlur`?T&&b():T||b()),F&&g.state.next({name:p,...O?{}:M});if(!t.resolver&&e.validate&&await N({name:p,eventType:i.type}),!T&&O&&g.state.next({...n}),t.resolver){let{errors:e}=await j([p]);if(x([p]),S(w),!_){!VH(M)&&g.state.next(M);return}let t=AU(n.errors,r,p),i=AU(e,r,t.name||p);o=i.error,p=i.name,C=VH(e)}else x([p],!0),o=(await $H(y,s.disabled,a,v,t.shouldUseNativeValidation))[p],x([p]),S(w),_&&(o?C=!1:(m.isValid||h.isValid)&&(C=await P({fields:r,onlyCheckValid:!0,name:p,eventType:i.type})));_&&(y._f.deps&&(!Array.isArray(y._f.deps)||y._f.deps.length>0)&&ae(y._f.deps),A(p,C,o,M))}},ie=(e,t)=>{if(Z(n.errors,t)&&e.focus)return e.focus(),1},ae=async(e,i={})=>{let a,o,u=eU(e);if(t.resolver){let t=await M(_H(e)?e:u);a=VH(t),o=e?!u.some(e=>Z(t,e)):a}else e?(o=(await Promise.all(u.map(async e=>{let t=Z(r,e);return await P({fields:t&&t._f?{[e]:t}:t,eventType:uH.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&b()):o=a=await P({fields:r,name:e,eventType:uH.TRIGGER});if(i.delayError&&t.delayError&&MH(e)){let r=Z(n.errors,e);r?(iU(n.errors,e),c[e]=y(e,()=>w(e,r)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e])}return g.state.next({...!MH(e)||(m.isValid||h.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&zH(r,ie,e?u:s.mount),o},oe=(e,t)=>{let r={...o.mount?a:i};return t&&(r=uU(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),_H(e)?r:MH(e)?Z(r,e):e.map(e=>Z(r,e))},se=(e,t)=>({invalid:!!Z((t||n).errors,e),isDirty:!!Z((t||n).dirtyFields,e),error:Z((t||n).errors,e),isValidating:!!Z(n.validatingFields,e),isTouched:!!Z((t||n).touchedFields,e)}),ce=e=>{let t=e?eU(e):void 0;t?.forEach(e=>iU(n.errors,e)),t?t.forEach(e=>{g.state.next({name:e,errors:n.errors})}):(n.errors={},g.state.next({errors:n.errors}))},le=(e,t,i)=>{let a=(Z(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=Z(n.errors,e)||{};SH(n.errors,e,{...l,...t,ref:a}),g.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},ue=(e,t)=>{if(xH(e)){u++;let{unsubscribe:n}=g.state.subscribe({next:n=>`values`in n&&e(n.values||L(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,u--,n())}}}return L(e,t,!0)},de=e=>{let t=!!e.formState?.values;t&&u++;let{unsubscribe:r}=g.state.subscribe({next:t=>{if(MU(e.name,t.name,e.exact)&&jU(t,e.formState||m,Ce,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,u--,r())}},fe=e=>(o.mount=!0,h={...h,...e.formState},de({...e,formState:{...p,...e.formState}})),pe=(e,o={})=>{for(let c of e?eU(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(iU(r,c),iU(a,c)),!o.keepError&&iU(n.errors,c),!o.keepDirty&&iU(n.dirtyFields,c),!o.keepTouched&&iU(n.touchedFields,c),!o.keepIsValidating&&iU(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&iU(i,c);g.state.next({values:lH(a)}),g.state.next({...n,...o.keepDirty?{isDirty:I()}:{}}),!o.keepIsValid&&b()},me=({disabled:e,name:t})=>{if(bH(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&b()}},he=(e,n={})=>{let a=Z(r,e),c=bH(n.disabled)||bH(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return SH(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?me({disabled:bH(n.disabled)?n.disabled:t.disabled,name:e}):O(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:EU(n.min),max:EU(n.max),minLength:EU(n.minLength),maxLength:EU(n.maxLength),pattern:EU(n.pattern)}:{},name:e,onChange:re,onBlur:re,ref:c=>{if(c){s.registerName.add(e),he(e,n),s.registerName.delete(e),a=Z(r,e);let t=_H(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=fU(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(pU),t,...Array.isArray(Z(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),SH(r,e,{_f:u}),O(e,!1,void 0,t)}else a=Z(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(oH(s.array,e)&&o.action)&&s.unMount.add(e)}}},ge=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&zH(r,ie,s.mount),_e=e=>{bH(e)&&(g.state.next({disabled:e}),zH(r,(t,n)=>{let i=Z(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},ve=(e,i)=>async o=>{let c,l;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let u=lH(a);if(g.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await j();x(),n.errors=e,u=lH(t)}else await P({fields:r,eventType:uH.SUBMIT});if(s.disabled.size)for(let e of s.disabled)iU(u,e);if(iU(n.errors,pH),VH(n.errors)){g.state.next({errors:{}});try{c=await e(u,o)}catch(e){l=e}}else i&&await i({...n.errors},o),ge(),setTimeout(ge);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:VH(n.errors)&&!l,submitCount:n.submitCount+1,errors:n.errors}),l)throw l;return c},ye=(e,t={})=>{Z(r,e)&&(_H(t.defaultValue)?z(e,lH(Z(i,e))):(z(e,t.defaultValue),SH(i,e,lH(t.defaultValue))),t.keepTouched||iU(n.touchedFields,e),t.keepDirty||(iU(n.dirtyFields,e),n.isDirty=t.defaultValue?I(e,lH(Z(i,e))):I()),t.keepError||(iU(n.errors,e),m.isValid&&b()),g.state.next({...n}))},be=(e,c={})=>{let l=e?lH(e):i,u=lH(l),d=VH(e),f=u,p=r;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...hU(SU(i,a,void 0,p),n.dirtyFields)]);for(let t of Array.from(e)){let e=Z(n.dirtyFields,t),r=Z(a,t),i=Z(f,t);e&&!_H(r)?SH(f,t,r):!e&&!_H(i)&&z(t,i)}}else{if(cH&&_H(e))for(let e of s.mount){let t=Z(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(HH(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)z(e,Z(f,e));else r={}}if(t.shouldUnregister){if(a=c.keepDefaultValues?lH(i):{},c.keepFieldsRef)for(let e of s.mount)SH(a,e,Z(f,e))}else a=lH(f);g.array.next({values:{...f}}),g.state.next({name:void 0,type:void 0,values:{...f}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!m.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!VH(f),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),c.keepErrors||(n.errors={}),g.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:d?!1:c.keepDirty?n.isDirty:c.keepValues?I():!!(c.keepDefaultValues&&!kH(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:d?{}:c.keepDirtyValues?c.keepDefaultValues&&a?SU(i,a,void 0,p):n.dirtyFields:c.keepDefaultValues&&e?SU(i,e,void 0,p):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},xe=(e,n)=>be(xH(e)?e(a):e,{...t.resetOptions,...n}),Se=(e,t={})=>{let n=Z(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&xH(e.select)&&e.select()})}},Ce=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}};g.state.subscribe({next:Ce});let we={control:{register:he,unregister:pe,getFieldState:se,handleSubmit:ve,setError:le,_subscribe:de,_runSchema:j,_updateIsValidating:x,_focusError:ge,_getWatch:L,_getDirty:I,_setValid:b,_setFieldArray:C,_setDisabledField:me,_setErrors:T,_getFieldArray:ee,_reset:be,_resetDefaultValues:()=>xH(t.defaultValues)&&t.defaultValues().then(e=>{xe(e,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:F,_disableForm:_e,_subjects:g,_proxyFormState:m,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},d=LH(t.mode),f=LH(t.reValidateMode)}},subscribe:fe,trigger:ae,register:he,handleSubmit:ve,watch:ue,setValue:z,setValues:B,getValues:oe,reset:xe,resetField:ye,resetDefaultValues:(e,t={})=>{if(i=lH(e),!t.keepDirty){let e=SU(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!VH(e)}t.keepIsValid||b(),g.state.next({...n,defaultValues:i})},clearErrors:ce,unregister:pe,setError:le,setFocus:Se,getFieldState:se};return{...we,formControl:we}}function BU(e={}){let t=v.useRef(void 0),n=v.useRef(void 0),r=v.useRef(e.formControl),[i,a]=v.useState(()=>({...lH(RU),isLoading:xH(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:xH(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!xH(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=zU(e);t.current={...r,formState:i}}}let o=t.current.control;o._options=e;let{resyncIfNeeded:s,snapshot:c}=AH();return EH(()=>{let e=()=>({...o._formState,defaultValues:o._defaultValues});s(!0,e,a);let t=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,()=>{t(),c(!0,e)}},[o,s,c]),v.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),v.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),v.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),v.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),v.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),v.useEffect(()=>{e.values&&!kH(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),v.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=v.useMemo(()=>TH(i,o),[o,i]),t.current}var VU=(0,v.createContext)({}),HU=e=>{let t=(0,V.c)(7),n;t[0]===e?n=t[1]:({...n}=e,t[0]=e,t[1]=n);let r;t[2]===n.name?r=t[3]:(r={name:n.name},t[2]=n.name,t[3]=r);let i=r,a;return t[4]!==i||t[5]!==n?(a=(0,y.jsx)(VU,{value:i,children:(0,y.jsx)(IH,{...n})}),t[4]=i,t[5]=n,t[6]=a):a=t[6],a},UU=()=>{let e=(0,V.c)(11),t=(0,v.useContext)(VU),n=(0,v.useContext)(QV),{getFieldState:r,formState:i}=sU(),a;e[0]!==t.name||e[1]!==i||e[2]!==r?(a=r(t.name,i),e[0]=t.name,e[1]=i,e[2]=r,e[3]=a):a=e[3];let o=a;if(!t)throw Error(`useFormField should be used within <FormField>`);let{id:s}=n,c=`${s}-form-item`,l=`${s}-form-item-description`,u=`${s}-form-item-message`,d;return e[4]!==t.name||e[5]!==o||e[6]!==s||e[7]!==c||e[8]!==l||e[9]!==u?(d={id:s,name:t.name,formItemId:c,formDescriptionId:l,formMessageId:u,...o},e[4]=t.name,e[5]=o,e[6]=s,e[7]=c,e[8]=l,e[9]=u,e[10]=d):d=e[10],d},WU=e=>{let t=(0,V.c)(5),{error:n,formItemId:r,formDescriptionId:i,formMessageId:a}=UU(),o=n?`${i} ${a}`:`${i}`,s=!!n,c;return t[0]!==r||t[1]!==e||t[2]!==o||t[3]!==s?(c=(0,y.jsx)(El,{id:r,"aria-describedby":o,"aria-invalid":s,...e}),t[0]=r,t[1]=e,t[2]=o,t[3]=s,t[4]=c):c=t[4],c},GU=e=>{let t=(0,V.c)(3),{formDescriptionId:n}=UU(),r;return t[0]!==n||t[1]!==e?(r=(0,y.jsx)(`p`,{className:`text-neutral text-sm`,id:n,...e}),t[0]=n,t[1]=e,t[2]=r):r=t[2],r},KU=e=>{let{children:t,...n}=e,{error:r,formMessageId:i}=UU(),a=r?String(r?.message??``):t;return a?(0,y.jsx)(`p`,{className:`font-medium text-error text-xs`,role:`alert`,id:i,...n,children:a}):null},qU=({className:e,children:t,...n})=>(0,y.jsxs)(`i`,{className:W(`text-neutral-400 text-xs`,e),...n,children:[`ⓘ `,t]}),JU=e=>{let{className:t,...n}=e,{error:r,formItemId:i}=UU();return(0,y.jsx)(Ik,{className:W(`mb-2`,r&&`text-error`,t),htmlFor:i,...n})},YU=({isRequired:e})=>e?(0,y.jsx)(`span`,{"aria-label":`Asterisk meaning the field is required`,children:`*`}):(0,y.jsx)(y.Fragment,{}),XU=({children:e,isRequired:t,info:n,htmlFor:r,className:i})=>(0,y.jsxs)(`div`,{className:`ml-1 flex gap-1 align-middle text-base leading-none`,children:[e&&(0,y.jsxs)(JU,{htmlFor:r,id:`${r}-label`,suppressHydrationWarning:!0,className:W(`font-bold`,i),children:[e,(0,y.jsx)(YU,{isRequired:t})]}),n&&(0,y.jsx)(qU,{content:n})]}),ZU=({label:e,description:t,isRequired:n,info:r,children:i,showErrorMessage:a=!0,htmlFor:o,className:s})=>(0,y.jsxs)(ZV,{className:W(`flex w-full flex-col flex-wrap gap-2 px-1 py-2`,s),children:[(t||e)&&(0,y.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1 p-1 leading-none`,children:[e&&(0,y.jsx)(XU,{isRequired:n,info:r,htmlFor:o,children:e}),t&&(0,y.jsx)(GU,{children:t})]}),(0,y.jsx)(WU,{children:i}),a&&(0,y.jsx)(KU,{"data-testid":`error-message`})]}),QU=({field:e,name:t,label:n,Element:r,isRequired:i=!1,info:a,description:o,showErrorMessage:s=!0,layoutClassName:c,...l})=>{let{error:u}=UU(),{value:d,onChange:f,...p}=e??{},m=l,h=m.value===void 0?d??``:m.value,g=(...e)=>{typeof f==`function`&&f(...e),typeof m.onChange==`function`&&m.onChange(...e)};return(0,y.jsx)(ZU,{htmlFor:t,label:n,description:o,isRequired:i,info:a,showErrorMessage:s,"aria-invalid":!!u,className:c,children:(0,y.jsx)(r,{"data-testid":`element`,id:t,...p,...l,value:h,onChange:g,children:l.children})})},$U=e=>{let t=(0,V.c)(6),{control:n}=sU(),r;t[0]===e?r=t[1]:(r=t=>{let{field:n}=t;return(0,y.jsx)(QU,{...e,field:n})},t[0]=e,t[1]=r);let i;return t[2]!==n||t[3]!==e.name||t[4]!==r?(i=(0,y.jsx)(HU,{control:n,name:e.name,render:r}),t[2]=n,t[3]=e.name,t[4]=r,t[5]=i):i=t[5],i},eW=e=>(0,y.jsx)($U,{id:e.name,"data-testid":e.name,Element:RO,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,...e}),tW=e=>{let{field:t,name:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,children:c,...l}=e,{error:u}=UU();return(0,y.jsx)(ZU,{htmlFor:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,"aria-invalid":!!u,children:(0,y.jsx)(YV,{onValueChange:t.onChange,values:t.value,...l,children:c})})},nW=e=>{let{name:t,description:n,label:r,isRequired:i,info:a,showErrorMessage:o,children:s,...c}=e,{control:l}=sU();return(0,y.jsx)(HU,{control:l,name:t,render:e=>{let{field:l}=e;return(0,y.jsx)(tW,{field:l,name:t,label:r,description:n,isRequired:i,info:a,showErrorMessage:o,...c,children:s})}})},rW=e=>{let{field:t,name:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,children:c,...l}=e,{error:u}=UU();return(0,y.jsx)(ZU,{htmlFor:n,label:r,description:i,isRequired:a,info:o,showErrorMessage:s,"aria-invalid":!!u,children:(0,y.jsx)(Y,{onValueChange:t.onChange,defaultValue:t.value,...l,children:c})})},iW=e=>{let{name:t,description:n,label:r,isRequired:i,info:a,showErrorMessage:o,children:s,...c}=e,{control:l}=sU();return(0,y.jsx)(HU,{control:l,name:t,render:e=>{let{field:l}=e;return(0,y.jsx)(rW,{field:l,name:t,label:r,description:n,isRequired:i,info:a,showErrorMessage:o,...c,children:s})}})},aW=(e,t,n)=>{if(e&&`reportValidity`in e){let r=Z(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},oW=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?aW(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>aW(t,n,e))}},sW=(e,t)=>{t.shouldUseNativeValidation&&oW(e,t);let n={};for(let r in e){let i=Z(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.refs?i.refs[0]:i&&i.ref});if(cW(t.names||Object.keys(e),r)){let e=Object.assign({},Z(n,r));SH(e,`root`,a),SH(n,r,e)}else SH(n,r,a)}return n},cW=(e,t)=>{let n=lW(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>lW(e).match(`^${n}\\.\\d+`))};function lW(e){return e.replace(/[\[\]]/g,``)}function uW(){return uW=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uW.apply(null,arguments)}function dW(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function fW(e,t){for(var n=Object.create(null);e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(`unionErrors`in r){var s=r.unionErrors.reduce(function(e,t){return t.errors.length<e.errors.length?t:e}).errors[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=GH(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function pW(e,t){for(var n=Object.create(null),r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors.reduce(function(e,t){return t.length<e.length?t:e})[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(uW({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=GH(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function mW(e,t,n){if(n===void 0&&(n={}),function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(dW(function(){function i(e){return a.shouldUseNativeValidation&&oW({},a),{errors:{},values:n.raw?Object.assign({},r):e}}var o=e;return n.mode===`sync`?i(o.parse(r,t)):Promise.resolve(o.parseAsync(r,t)).then(i)},function(e){if(function(e){var t;return!(e==null||(t=e._zod)==null||(t=t.traits)==null||!t.has(`$ZodError`))}(e))return{values:{},errors:sW(pW(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_def`in e&&typeof e._def==`object`}(e))return function(r,i,a){try{return Promise.resolve(dW(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&oW({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:sW(fW(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var hW=async e=>e&&typeof e.then==`function`?await e:e,gW=({schema:e,onSubmit:t,onSubmitSuccess:n,onSubmitError:r,className:i,children:a,autoComplete:o,method:s,...c})=>{let l=async i=>{let a=e?.safeParse(i)??{success:!0,data:void 0};await hW(t?.(i)),a.success?await hW(n?.(a.data)):await hW(r?.(Error(a.error.issues.map(e=>e.message).join(`, `))))},u=e=>{if(e.key!==`Enter`)return;let t=e.target;if(t.tagName!==`INPUT`)return;e.preventDefault();let n=e.currentTarget,r=Array.from(n.querySelectorAll(`input:not([disabled]):not([type="hidden"]), textarea:not([disabled])`)),i=r.indexOf(t);i>=0&&i<r.length-1&&r[i+1]?.focus()};return(0,y.jsx)(cU,{...c,children:(0,y.jsx)(`form`,{className:W(`flex flex-col gap-y-6`,i),onSubmit:c.handleSubmit(l),onKeyDown:u,autoComplete:o?`on`:`off`,noValidate:!0,method:s,children:a})})},_W=(e,t)=>{let n=(0,V.c)(13),r;n[0]===e?r=n[1]:(r=mW(e),n[0]=e,n[1]=r);let i;n[2]!==t||n[3]!==r?(i={resolver:r,...t},n[2]=t,n[3]=r,n[4]=i):i=n[4];let a=BU(i),o;n[5]===a.control?o=n[6]:(o={control:a.control},n[5]=a.control,n[6]=o);let{isSubmitting:s,isSubmitted:c,isLoading:l,isValid:u}=jH(o),d;return n[7]!==a||n[8]!==l||n[9]!==c||n[10]!==s||n[11]!==u?(d={form:a,isSubmitting:s,isSubmitted:c,isLoading:l,isValid:u},n[7]=a,n[8]=l,n[9]=c,n[10]=s,n[11]=u,n[12]=d):d=n[12],d},vW=gW,yW;function Q(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var bW=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},xW=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(yW=globalThis).__zod_globalConfig??(yW.__zod_globalConfig={});var SW=globalThis.__zod_globalConfig;function CW(e){return e&&Object.assign(SW,e),SW}function wW(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function TW(e,t){return typeof t==`bigint`?t.toString():t}function EW(e){return{get value(){{let t=e();return Object.defineProperty(this,"value",{value:t}),t}}}}function DW(e){return e==null}function OW(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var kW=Symbol(`evaluating`);function AW(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==kW)return r===void 0&&(r=kW,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function jW(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function MW(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function NW(e){return JSON.stringify(e)}function PW(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var FW=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function IW(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var LW=EW(()=>{if(SW.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function RW(e){if(IW(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return IW(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function zW(e){return RW(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var BW=new Set([`string`,`number`,`symbol`]);function VW(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function HW(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function $(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function UW(e){return Object.keys(e).filter(t=>e[t]._zod.optin===`optional`&&e[t]._zod.optout===`optional`)}-Number.MAX_VALUE,Number.MAX_VALUE;function WW(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);return HW(e,MW(e._zod.def,{get shape(){let e={};for(let r in t){if(!(r in n.shape))throw Error(`Unrecognized key: "${r}"`);t[r]&&(e[r]=n.shape[r])}return jW(this,`shape`,e),e},checks:[]}))}function GW(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);return HW(e,MW(e._zod.def,{get shape(){let r={...e._zod.def.shape};for(let e in t){if(!(e in n.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete r[e]}return jW(this,`shape`,r),r},checks:[]}))}function KW(e,t){if(!RW(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=e._zod.def.shape;for(let e in t)if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return HW(e,MW(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return jW(this,`shape`,n),n}}))}function qW(e,t){if(!RW(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return HW(e,MW(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t};return jW(this,`shape`,n),n}}))}function JW(e,t){if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);return HW(e,MW(e._zod.def,{get shape(){let n={...e._zod.def.shape,...t._zod.def.shape};return jW(this,`shape`,n),n},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function YW(e,t,n){let r=t._zod.def.checks;if(r&&r.length>0)throw Error(`.partial() cannot be used on object schemas containing refinements`);return HW(t,MW(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in r))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t])}else for(let t in r)i[t]=e?new e({type:`optional`,innerType:r[t]}):r[t];return jW(this,`shape`,i),i},checks:[]}))}function XW(e,t,n){return HW(t,MW(t._zod.def,{get shape(){let r=t._zod.def.shape,i={...r};if(n)for(let t in n){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);n[t]&&(i[t]=new e({type:`nonoptional`,innerType:r[t]}))}else for(let t in r)i[t]=new e({type:`nonoptional`,innerType:r[t]});return jW(this,`shape`,i),i}}))}function ZW(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function QW(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function $W(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function eG(e){return typeof e==`string`?e:e?.message}function tG(e,t,n){let r=e.message?e.message:eG(e.inst?._zod.def?.error?.(e))??eG(t?.error?.(e))??eG(n.customError?.(e))??eG(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function nG(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function rG(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var iG=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,TW,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},aG=Q(`$ZodError`,iG),oG=Q(`$ZodError`,iG,{Parent:Error});function sG(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function cG(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var lG=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new bW;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>tG(e,a,CW())));throw FW(t,i?.callee),t}return o.value},uG=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>tG(e,a,CW())));throw FW(t,i?.callee),t}return o.value},dG=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new bW;return a.issues.length?{success:!1,error:new(e??aG)(a.issues.map(e=>tG(e,i,CW())))}:{success:!0,data:a.value}},fG=dG(oG),pG=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>tG(e,i,CW())))}:{success:!0,data:a.value}},mG=pG(oG),hG=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return lG(e)(t,n,i)},gG=e=>(t,n,r)=>lG(e)(t,n,r),_G=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return uG(e)(t,n,i)},vG=e=>async(t,n,r)=>uG(e)(t,n,r),yG=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return dG(e)(t,n,i)},bG=e=>(t,n,r)=>dG(e)(t,n,r),xG=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return pG(e)(t,n,i)},SG=e=>async(t,n,r)=>pG(e)(t,n,r),CG=/^[cC][0-9a-z]{6,}$/,wG=/^[0-9a-z]+$/,TG=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,EG=/^[0-9a-vA-V]{20}$/,DG=/^[A-Za-z0-9]{27}$/,OG=/^[a-zA-Z0-9_-]{21}$/,kG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,AG=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,jG=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,MG=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,NG=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function PG(){return new RegExp(NG,`u`)}var FG=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,IG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,LG=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,RG=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,zG=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,BG=/^[A-Za-z0-9_-]*$/,VG=/^https?$/,HG=/^\+[1-9]\d{6,14}$/,UG=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,WG=RegExp(`^${UG}$`);function GG(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function KG(e){return RegExp(`^${GG(e)}$`)}function qG(e){let t=GG({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${UG}T(?:${r})$`)}var JG=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},YG=/^[^A-Z]*$/,XG=/^[^a-z]*$/,ZG=Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),QG=Q(`$ZodCheckMaxLength`,(e,t)=>{var n;ZG.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!DW(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=nG(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),$G=Q(`$ZodCheckMinLength`,(e,t)=>{var n;ZG.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!DW(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=nG(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),eK=Q(`$ZodCheckLengthEquals`,(e,t)=>{var n;ZG.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!DW(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=nG(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),tK=Q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;ZG.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),nK=Q(`$ZodCheckRegex`,(e,t)=>{tK.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),rK=Q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=YG,tK.init(e,t)}),iK=Q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=XG,tK.init(e,t)}),aK=Q(`$ZodCheckIncludes`,(e,t)=>{ZG.init(e,t);let n=VW(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),oK=Q(`$ZodCheckStartsWith`,(e,t)=>{ZG.init(e,t);let n=RegExp(`^${VW(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),sK=Q(`$ZodCheckEndsWith`,(e,t)=>{ZG.init(e,t);let n=RegExp(`.*${VW(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),cK=Q(`$ZodCheckOverwrite`,(e,t)=>{ZG.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),lK=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),--this.indent}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
103
|
+
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.args,n=[...(this?.content??[``]).map(e=>` ${e}`)];return new e(...t,n.join(`
|
|
104
|
+
`))}},uK={major:4,minor:4,patch:3},dK=Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=uK;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=ZW(e),i;for(let a of t){if(a._zod.def.when){if(QW(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new bW;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=ZW(e,t))});else{if(e.issues.length===t)continue;r||=ZW(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(ZW(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new bW;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new bW;return o.then(e=>t(e,r,a))}return t(o,r,a)}}AW(e,`~standard`,()=>({validate:t=>{try{let n=fG(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return mG(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),fK=Q(`$ZodString`,(e,t)=>{dK.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??JG(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),pK=Q(`$ZodStringFormat`,(e,t)=>{tK.init(e,t),fK.init(e,t)}),mK=Q(`$ZodGUID`,(e,t)=>{t.pattern??=AG,pK.init(e,t)}),hK=Q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=jG(e)}else t.pattern??=jG();pK.init(e,t)}),gK=Q(`$ZodEmail`,(e,t)=>{t.pattern??=MG,pK.init(e,t)}),_K=Q(`$ZodURL`,(e,t)=>{pK.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===VG.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),vK=Q(`$ZodEmoji`,(e,t)=>{t.pattern??=PG(),pK.init(e,t)}),yK=Q(`$ZodNanoID`,(e,t)=>{t.pattern??=OG,pK.init(e,t)}),bK=Q(`$ZodCUID`,(e,t)=>{t.pattern??=CG,pK.init(e,t)}),xK=Q(`$ZodCUID2`,(e,t)=>{t.pattern??=wG,pK.init(e,t)}),SK=Q(`$ZodULID`,(e,t)=>{t.pattern??=TG,pK.init(e,t)}),CK=Q(`$ZodXID`,(e,t)=>{t.pattern??=EG,pK.init(e,t)}),wK=Q(`$ZodKSUID`,(e,t)=>{t.pattern??=DG,pK.init(e,t)}),TK=Q(`$ZodISODateTime`,(e,t)=>{t.pattern??=qG(t),pK.init(e,t)}),EK=Q(`$ZodISODate`,(e,t)=>{t.pattern??=WG,pK.init(e,t)}),DK=Q(`$ZodISOTime`,(e,t)=>{t.pattern??=KG(t),pK.init(e,t)}),OK=Q(`$ZodISODuration`,(e,t)=>{t.pattern??=kG,pK.init(e,t)}),kK=Q(`$ZodIPv4`,(e,t)=>{t.pattern??=FG,pK.init(e,t),e._zod.bag.format=`ipv4`}),AK=Q(`$ZodIPv6`,(e,t)=>{t.pattern??=IG,pK.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),jK=Q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=LG,pK.init(e,t)}),MK=Q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=RG,pK.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function NK(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var PK=Q(`$ZodBase64`,(e,t)=>{t.pattern??=zG,pK.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{NK(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function FK(e){if(!BG.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return NK(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var IK=Q(`$ZodBase64URL`,(e,t)=>{t.pattern??=BG,pK.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{FK(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),LK=Q(`$ZodE164`,(e,t)=>{t.pattern??=HG,pK.init(e,t)});function RK(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var zK=Q(`$ZodJWT`,(e,t)=>{pK.init(e,t),e._zod.check=n=>{RK(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),BK=Q(`$ZodUnknown`,(e,t)=>{dK.init(e,t),e._zod.parse=e=>e}),VK=Q(`$ZodNever`,(e,t)=>{dK.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function HK(e,t,n){e.issues.length&&t.issues.push(...$W(n,e.issues)),t.value[n]=e.value}var UK=Q(`$ZodArray`,(e,t)=>{dK.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>HK(t,n,e))):HK(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function WK(e,t,n,r,i,a){let o=n in r;if(e.issues.length){if(i&&a&&!o)return;t.issues.push(...$W(n,e.issues))}if(!o&&!i){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?o&&(t.value[n]=void 0):t.value[n]=e.value}function GK(e){let t=Object.keys(e.shape);for(let n of t)if(!e.shape?.[n]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${n}": expected a Zod schema`);let n=UW(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(n)}}function KK(e,t,n,r,i,a){let o=[],s=i.keySet,c=i.catchall._zod,l=c.def.type,u=c.optin===`optional`,d=c.optout===`optional`;for(let i in t){if(i===`__proto__`||s.has(i))continue;if(l===`never`){o.push(i);continue}let a=c.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>WK(e,n,i,t,u,d))):WK(a,n,i,t,u,d)}return o.length&&n.issues.push({code:`unrecognized_keys`,keys:o,input:t,inst:a}),e.length?Promise.all(e).then(()=>n):n}var qK=Q(`$ZodObject`,(e,t)=>{if(dK.init(e,t),!Object.getOwnPropertyDescriptor(t,`shape`)?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let n={...e};return Object.defineProperty(t,"shape",{value:n}),n}})}let n=EW(()=>GK(t));AW(e._zod,`propValues`,()=>{let e=t.shape,n={};for(let t in e){let r=e[t]._zod;if(r.values){n[t]??(n[t]=new Set);for(let e of r.values)n[t].add(e)}}return n});let r=IW,i=t.catchall,a;e._zod.parse=(t,o)=>{a??=n.value;let s=t.value;if(!r(s))return t.issues.push({expected:`object`,code:`invalid_type`,input:s,inst:e}),t;t.value={};let c=[],l=a.shape;for(let e of a.keys){let n=l[e],r=n._zod.optin===`optional`,i=n._zod.optout===`optional`,a=n._zod.run({value:s[e],issues:[]},o);a instanceof Promise?c.push(a.then(n=>WK(n,t,e,s,r,i))):WK(a,t,e,s,r,i)}return i?KK(c,s,t,o,n.value,e):c.length?Promise.all(c).then(()=>t):t}}),JK=Q(`$ZodObjectJIT`,(e,t)=>{qK.init(e,t);let n=e._zod.parse,r=EW(()=>GK(t)),i=e=>{let t=new lK([`shape`,`payload`,`ctx`]),n=r.value,i=e=>{let t=NW(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write(`const input = payload.value;`);let a=Object.create(null),o=0;for(let e of n.keys)a[e]=`key_${o++}`;t.write(`const newResult = {};`);for(let r of n.keys){let n=a[r],o=NW(r),s=e[r],c=s?._zod?.optin===`optional`,l=s?._zod?.optout===`optional`;t.write(`const ${n} = ${i(r)};`),c&&l?t.write(`
|
|
105
|
+
if (${n}.issues.length) {
|
|
106
|
+
if (${o} in input) {
|
|
107
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
108
|
+
...iss,
|
|
109
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
110
|
+
})));
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
if (${n}.value === undefined) {
|
|
115
|
+
if (${o} in input) {
|
|
116
|
+
newResult[${o}] = undefined;
|
|
117
|
+
}
|
|
118
|
+
} else {
|
|
119
|
+
newResult[${o}] = ${n}.value;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
`):c?t.write(`
|
|
123
|
+
if (${n}.issues.length) {
|
|
124
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
125
|
+
...iss,
|
|
126
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
127
|
+
})));
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (${n}.value === undefined) {
|
|
131
|
+
if (${o} in input) {
|
|
132
|
+
newResult[${o}] = undefined;
|
|
133
|
+
}
|
|
134
|
+
} else {
|
|
135
|
+
newResult[${o}] = ${n}.value;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
`):t.write(`
|
|
139
|
+
const ${n}_present = ${o} in input;
|
|
140
|
+
if (${n}.issues.length) {
|
|
141
|
+
payload.issues = payload.issues.concat(${n}.issues.map(iss => ({
|
|
142
|
+
...iss,
|
|
143
|
+
path: iss.path ? [${o}, ...iss.path] : [${o}]
|
|
144
|
+
})));
|
|
145
|
+
}
|
|
146
|
+
if (!${n}_present && !${n}.issues.length) {
|
|
147
|
+
payload.issues.push({
|
|
148
|
+
code: "invalid_type",
|
|
149
|
+
expected: "nonoptional",
|
|
150
|
+
input: undefined,
|
|
151
|
+
path: [${o}]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (${n}_present) {
|
|
156
|
+
if (${n}.value === undefined) {
|
|
157
|
+
newResult[${o}] = undefined;
|
|
158
|
+
} else {
|
|
159
|
+
newResult[${o}] = ${n}.value;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=IW,s=!SW.jitless,c=s&&LW.value,l=t.catchall,u;e._zod.parse=(d,f)=>{u??=r.value;let p=d.value;return o(p)?s&&c&&f?.async===!1&&f.jitless!==!0?(a||=i(t.shape),d=a(d,f),l?KK([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function YK(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!ZW(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>tG(e,r,CW())))}),t)}var XK=Q(`$ZodUnion`,(e,t)=>{dK.init(e,t),AW(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),AW(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),AW(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),AW(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>OW(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>YK(t,r,e,i)):YK(o,r,e,i)}}),ZK=Q(`$ZodIntersection`,(e,t)=>{dK.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>$K(e,t,n)):$K(e,i,a)}});function QK(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(RW(e)&&RW(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=QK(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=QK(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function $K(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),ZW(e))return e;let o=QK(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var eq=Q(`$ZodEnum`,(e,t)=>{dK.init(e,t);let n=wW(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>BW.has(typeof e)).map(e=>typeof e==`string`?VW(e):e.toString()).join(`|`)})$`),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),tq=Q(`$ZodTransform`,(e,t)=>{dK.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new xW(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new bW;return n.value=i,n.fallback=!0,n}});function nq(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var rq=Q(`$ZodOptional`,(e,t)=>{dK.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,AW(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),AW(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${OW(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>nq(e,r)):nq(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),iq=Q(`$ZodExactOptional`,(e,t)=>{rq.init(e,t),AW(e._zod,`values`,()=>t.innerType._zod.values),AW(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),aq=Q(`$ZodNullable`,(e,t)=>{dK.init(e,t),AW(e._zod,`optin`,()=>t.innerType._zod.optin),AW(e._zod,`optout`,()=>t.innerType._zod.optout),AW(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${OW(e.source)}|null)$`):void 0}),AW(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),oq=Q(`$ZodDefault`,(e,t)=>{dK.init(e,t),e._zod.optin=`optional`,AW(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>sq(e,t)):sq(r,t)}});function sq(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var cq=Q(`$ZodPrefault`,(e,t)=>{dK.init(e,t),e._zod.optin=`optional`,AW(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),lq=Q(`$ZodNonOptional`,(e,t)=>{dK.init(e,t),AW(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>uq(t,e)):uq(i,e)}});function uq(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var dq=Q(`$ZodCatch`,(e,t)=>{dK.init(e,t),e._zod.optin=`optional`,AW(e._zod,`optout`,()=>t.innerType._zod.optout),AW(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>tG(e,n,CW()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>tG(e,n,CW()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),fq=Q(`$ZodPipe`,(e,t)=>{dK.init(e,t),AW(e._zod,`values`,()=>t.in._zod.values),AW(e._zod,`optin`,()=>t.in._zod.optin),AW(e._zod,`optout`,()=>t.out._zod.optout),AW(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>pq(e,t.in,n)):pq(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>pq(e,t.out,n)):pq(r,t.out,n)}});function pq(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var mq=Q(`$ZodReadonly`,(e,t)=>{dK.init(e,t),AW(e._zod,`propValues`,()=>t.innerType._zod.propValues),AW(e._zod,`values`,()=>t.innerType._zod.values),AW(e._zod,`optin`,()=>t.innerType?._zod?.optin),AW(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(hq):hq(r)}});function hq(e){return e.value=Object.freeze(e.value),e}var gq=Q(`$ZodCustom`,(e,t)=>{ZG.init(e,t),dK.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>_q(t,n,r,e));_q(i,n,r,e)}});function _q(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(rG(e))}}var vq,yq=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function bq(){return new yq}(vq=globalThis).__zod_globalRegistry??(vq.__zod_globalRegistry=bq());var xq=globalThis.__zod_globalRegistry;function Sq(e,t){return new e({type:`string`,...$(t)})}function Cq(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...$(t)})}function wq(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...$(t)})}function Tq(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...$(t)})}function Eq(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...$(t)})}function Dq(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...$(t)})}function Oq(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...$(t)})}function kq(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...$(t)})}function Aq(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...$(t)})}function jq(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...$(t)})}function Mq(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...$(t)})}function Nq(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...$(t)})}function Pq(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...$(t)})}function Fq(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...$(t)})}function Iq(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...$(t)})}function Lq(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...$(t)})}function Rq(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...$(t)})}function zq(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...$(t)})}function Bq(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...$(t)})}function Vq(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...$(t)})}function Hq(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...$(t)})}function Uq(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...$(t)})}function Wq(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...$(t)})}function Gq(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...$(t)})}function Kq(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...$(t)})}function qq(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...$(t)})}function Jq(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...$(t)})}function Yq(e){return new e({type:`unknown`})}function Xq(e,t){return new e({type:`never`,...$(t)})}function Zq(e,t){return new QG({check:`max_length`,...$(t),maximum:e})}function Qq(e,t){return new $G({check:`min_length`,...$(t),minimum:e})}function $q(e,t){return new eK({check:`length_equals`,...$(t),length:e})}function eJ(e,t){return new nK({check:`string_format`,format:`regex`,...$(t),pattern:e})}function tJ(e){return new rK({check:`string_format`,format:`lowercase`,...$(e)})}function nJ(e){return new iK({check:`string_format`,format:`uppercase`,...$(e)})}function rJ(e,t){return new aK({check:`string_format`,format:`includes`,...$(t),includes:e})}function iJ(e,t){return new oK({check:`string_format`,format:`starts_with`,...$(t),prefix:e})}function aJ(e,t){return new sK({check:`string_format`,format:`ends_with`,...$(t),suffix:e})}function oJ(e){return new cK({check:`overwrite`,tx:e})}function sJ(e){return oJ(t=>t.normalize(e))}function cJ(){return oJ(e=>e.trim())}function lJ(){return oJ(e=>e.toLowerCase())}function uJ(){return oJ(e=>e.toUpperCase())}function dJ(){return oJ(e=>PW(e))}function fJ(e,t,n){return new e({type:`array`,element:t,...$(n)})}function pJ(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...$(n)})}function mJ(e,t){let n=hJ(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(rG(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(rG(r))}},e(t.value,t)),t);return n}function hJ(e,t){let n=new ZG({check:`custom`,...$(t)});return n._zod.check=e,n}function gJ(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??xq,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function _J(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,_J(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&bJ(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function vJ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
164
|
+
|
|
165
|
+
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function yJ(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:SJ(t,`input`,e.processors),output:SJ(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function bJ(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return bJ(r.element,n);if(r.type===`set`)return bJ(r.valueType,n);if(r.type===`lazy`)return bJ(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return bJ(r.innerType,n);if(r.type===`intersection`)return bJ(r.left,n)||bJ(r.right,n);if(r.type===`record`||r.type===`map`)return bJ(r.keyType,n)||bJ(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:bJ(r.in,n)||bJ(r.out,n);if(r.type===`object`){for(let e in r.shape)if(bJ(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(bJ(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(bJ(e,n))return!0;return!!(r.rest&&bJ(r.rest,n))}return!1}var xJ=(e,t={})=>n=>{let r=gJ({...n,processors:t});return _J(e,r),vJ(r,e),yJ(r,e)},SJ=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=gJ({...i??{},target:a,io:t,processors:n});return _J(e,o),vJ(o,e),yJ(o,e)},CJ={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},wJ=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=CJ[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},TJ=(e,t,n,r)=>{n.not={}},EJ=(e,t,n,r)=>{let i=e._zod.def,a=wW(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},DJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},OJ=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},kJ=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=_J(a.element,t,{...r,path:[...r.path,`items`]})},AJ=(e,t,n,r)=>{let i=n,a=e._zod.def;i.type=`object`,i.properties={};let o=a.shape;for(let e in o)i.properties[e]=_J(o[e],t,{...r,path:[...r.path,`properties`,e]});let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e]._zod;return t.io===`input`?n.optin===void 0:n.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=_J(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},jJ=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>_J(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},MJ=(e,t,n,r)=>{let i=e._zod.def,a=_J(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=_J(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},NJ=(e,t,n,r)=>{let i=e._zod.def,a=_J(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},PJ=(e,t,n,r)=>{let i=e._zod.def;_J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},FJ=(e,t,n,r)=>{let i=e._zod.def;_J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},IJ=(e,t,n,r)=>{let i=e._zod.def;_J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},LJ=(e,t,n,r)=>{let i=e._zod.def;_J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},RJ=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;_J(o,t,r);let s=t.seen.get(e);s.ref=o},zJ=(e,t,n,r)=>{let i=e._zod.def;_J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},BJ=(e,t,n,r)=>{let i=e._zod.def;_J(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},VJ=Q(`ZodISODateTime`,(e,t)=>{TK.init(e,t),mY.init(e,t)});function HJ(e){return Gq(VJ,e)}var UJ=Q(`ZodISODate`,(e,t)=>{EK.init(e,t),mY.init(e,t)});function WJ(e){return Kq(UJ,e)}var GJ=Q(`ZodISOTime`,(e,t)=>{DK.init(e,t),mY.init(e,t)});function KJ(e){return qq(GJ,e)}var qJ=Q(`ZodISODuration`,(e,t)=>{OK.init(e,t),mY.init(e,t)});function JJ(e){return Jq(qJ,e)}var YJ=Q(`ZodError`,(e,t)=>{aG.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>cG(e,t)},flatten:{value:t=>sG(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,TW,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,TW,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),XJ=lG(YJ),ZJ=uG(YJ),QJ=dG(YJ),$J=pG(YJ),eY=hG(YJ),tY=gG(YJ),nY=_G(YJ),rY=vG(YJ),iY=yG(YJ),aY=bG(YJ),oY=xG(YJ),sY=SG(YJ),cY=new WeakMap;function lY(e,t,n){let r=Object.getPrototypeOf(e),i=cY.get(r);if(i||(i=new Set,cY.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var uY=Q(`ZodType`,(e,t)=>(dK.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:SJ(e,`input`),output:SJ(e,`output`)}}),e.toJSONSchema=xJ(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>XJ(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>QJ(e,t,n),e.parseAsync=async(t,n)=>ZJ(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>$J(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>eY(e,t,n),e.decode=(t,n)=>tY(e,t,n),e.encodeAsync=async(t,n)=>nY(e,t,n),e.decodeAsync=async(t,n)=>rY(e,t,n),e.safeEncode=(t,n)=>iY(e,t,n),e.safeDecode=(t,n)=>aY(e,t,n),e.safeEncodeAsync=async(t,n)=>oY(e,t,n),e.safeDecodeAsync=async(t,n)=>sY(e,t,n),lY(e,`ZodType`,{check(...e){let t=this.def;return this.clone(MW(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return HW(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(hX(e,t))},superRefine(e,t){return this.check(gX(e,t))},overwrite(e){return this.check(oJ(e))},optional(){return ZY(this)},exactOptional(){return $Y(this)},nullable(){return tX(this)},nullish(){return ZY(tX(this))},nonoptional(e){return sX(this,e)},array(){return zY(this)},or(e){return UY([this,e])},and(e){return GY(this,e)},transform(e){return dX(this,YY(e))},default(e){return rX(this,e)},prefault(e){return aX(this,e)},catch(e){return lX(this,e)},pipe(e){return dX(this,e)},readonly(){return pX(this)},describe(e){let t=this.clone();return xq.add(t,{description:e}),t},meta(...e){if(e.length===0)return xq.get(this);let t=this.clone();return xq.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return xq.get(e)?.description},configurable:!0}),e)),dY=Q(`_ZodString`,(e,t)=>{fK.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wJ(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,lY(e,`_ZodString`,{regex(...e){return this.check(eJ(...e))},includes(...e){return this.check(rJ(...e))},startsWith(...e){return this.check(iJ(...e))},endsWith(...e){return this.check(aJ(...e))},min(...e){return this.check(Qq(...e))},max(...e){return this.check(Zq(...e))},length(...e){return this.check($q(...e))},nonempty(...e){return this.check(Qq(1,...e))},lowercase(e){return this.check(tJ(e))},uppercase(e){return this.check(nJ(e))},trim(){return this.check(cJ())},normalize(...e){return this.check(sJ(...e))},toLowerCase(){return this.check(lJ())},toUpperCase(){return this.check(uJ())},slugify(){return this.check(dJ())}})}),fY=Q(`ZodString`,(e,t)=>{fK.init(e,t),dY.init(e,t),e.email=t=>e.check(Cq(hY,t)),e.url=t=>e.check(kq(vY,t)),e.jwt=t=>e.check(Wq(NY,t)),e.emoji=t=>e.check(Aq(yY,t)),e.guid=t=>e.check(wq(gY,t)),e.uuid=t=>e.check(Tq(_Y,t)),e.uuidv4=t=>e.check(Eq(_Y,t)),e.uuidv6=t=>e.check(Dq(_Y,t)),e.uuidv7=t=>e.check(Oq(_Y,t)),e.nanoid=t=>e.check(jq(bY,t)),e.guid=t=>e.check(wq(gY,t)),e.cuid=t=>e.check(Mq(xY,t)),e.cuid2=t=>e.check(Nq(SY,t)),e.ulid=t=>e.check(Pq(CY,t)),e.base64=t=>e.check(Vq(AY,t)),e.base64url=t=>e.check(Hq(jY,t)),e.xid=t=>e.check(Fq(wY,t)),e.ksuid=t=>e.check(Iq(TY,t)),e.ipv4=t=>e.check(Lq(EY,t)),e.ipv6=t=>e.check(Rq(DY,t)),e.cidrv4=t=>e.check(zq(OY,t)),e.cidrv6=t=>e.check(Bq(kY,t)),e.e164=t=>e.check(Uq(MY,t)),e.datetime=t=>e.check(HJ(t)),e.date=t=>e.check(WJ(t)),e.time=t=>e.check(KJ(t)),e.duration=t=>e.check(JJ(t))});function pY(e){return Sq(fY,e)}var mY=Q(`ZodStringFormat`,(e,t)=>{pK.init(e,t),dY.init(e,t)}),hY=Q(`ZodEmail`,(e,t)=>{gK.init(e,t),mY.init(e,t)}),gY=Q(`ZodGUID`,(e,t)=>{mK.init(e,t),mY.init(e,t)}),_Y=Q(`ZodUUID`,(e,t)=>{hK.init(e,t),mY.init(e,t)}),vY=Q(`ZodURL`,(e,t)=>{_K.init(e,t),mY.init(e,t)}),yY=Q(`ZodEmoji`,(e,t)=>{vK.init(e,t),mY.init(e,t)}),bY=Q(`ZodNanoID`,(e,t)=>{yK.init(e,t),mY.init(e,t)}),xY=Q(`ZodCUID`,(e,t)=>{bK.init(e,t),mY.init(e,t)}),SY=Q(`ZodCUID2`,(e,t)=>{xK.init(e,t),mY.init(e,t)}),CY=Q(`ZodULID`,(e,t)=>{SK.init(e,t),mY.init(e,t)}),wY=Q(`ZodXID`,(e,t)=>{CK.init(e,t),mY.init(e,t)}),TY=Q(`ZodKSUID`,(e,t)=>{wK.init(e,t),mY.init(e,t)}),EY=Q(`ZodIPv4`,(e,t)=>{kK.init(e,t),mY.init(e,t)}),DY=Q(`ZodIPv6`,(e,t)=>{AK.init(e,t),mY.init(e,t)}),OY=Q(`ZodCIDRv4`,(e,t)=>{jK.init(e,t),mY.init(e,t)}),kY=Q(`ZodCIDRv6`,(e,t)=>{MK.init(e,t),mY.init(e,t)}),AY=Q(`ZodBase64`,(e,t)=>{PK.init(e,t),mY.init(e,t)}),jY=Q(`ZodBase64URL`,(e,t)=>{IK.init(e,t),mY.init(e,t)}),MY=Q(`ZodE164`,(e,t)=>{LK.init(e,t),mY.init(e,t)}),NY=Q(`ZodJWT`,(e,t)=>{zK.init(e,t),mY.init(e,t)}),PY=Q(`ZodUnknown`,(e,t)=>{BK.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function FY(){return Yq(PY)}var IY=Q(`ZodNever`,(e,t)=>{VK.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TJ(e,t,n,r)});function LY(e){return Xq(IY,e)}var RY=Q(`ZodArray`,(e,t)=>{UK.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>kJ(e,t,n,r),e.element=t.element,lY(e,`ZodArray`,{min(e,t){return this.check(Qq(e,t))},nonempty(e){return this.check(Qq(1,e))},max(e,t){return this.check(Zq(e,t))},length(e,t){return this.check($q(e,t))},unwrap(){return this.element}})});function zY(e,t){return fJ(RY,e,t)}var BY=Q(`ZodObject`,(e,t)=>{JK.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AJ(e,t,n,r),AW(e,`shape`,()=>t.shape),lY(e,`ZodObject`,{keyof(){return qY(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:FY()})},loose(){return this.clone({...this._zod.def,catchall:FY()})},strict(){return this.clone({...this._zod.def,catchall:LY()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return KW(this,e)},safeExtend(e){return qW(this,e)},merge(e){return JW(this,e)},pick(e){return WW(this,e)},omit(e){return GW(this,e)},partial(...e){return YW(XY,this,e[0])},required(...e){return XW(oX,this,e[0])}})});function VY(e,t){return new BY({type:`object`,shape:e??{},...$(t)})}var HY=Q(`ZodUnion`,(e,t)=>{XK.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jJ(e,t,n,r),e.options=t.options});function UY(e,t){return new HY({type:`union`,options:e,...$(t)})}var WY=Q(`ZodIntersection`,(e,t)=>{ZK.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MJ(e,t,n,r)});function GY(e,t){return new WY({type:`intersection`,left:e,right:t})}var KY=Q(`ZodEnum`,(e,t)=>{eq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>EJ(e,t,n,r),e.enum=t.entries,e.options=Object.values(t.entries);let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new KY({...t,checks:[],...$(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new KY({...t,checks:[],...$(r),entries:i})}});function qY(e,t){return new KY({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...$(t)})}var JY=Q(`ZodTransform`,(e,t)=>{tq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>OJ(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new xW(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(rG(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(rG(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function YY(e){return new JY({type:`transform`,transform:e})}var XY=Q(`ZodOptional`,(e,t)=>{rq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function ZY(e){return new XY({type:`optional`,innerType:e})}var QY=Q(`ZodExactOptional`,(e,t)=>{iq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>BJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function $Y(e){return new QY({type:`optional`,innerType:e})}var eX=Q(`ZodNullable`,(e,t)=>{aq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function tX(e){return new eX({type:`nullable`,innerType:e})}var nX=Q(`ZodDefault`,(e,t)=>{oq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function rX(e,t){return new nX({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():zW(t)}})}var iX=Q(`ZodPrefault`,(e,t)=>{cq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>IJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function aX(e,t){return new iX({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():zW(t)}})}var oX=Q(`ZodNonOptional`,(e,t)=>{lq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function sX(e,t){return new oX({type:`nonoptional`,innerType:e,...$(t)})}var cX=Q(`ZodCatch`,(e,t)=>{dq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>LJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function lX(e,t){return new cX({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var uX=Q(`ZodPipe`,(e,t)=>{fq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>RJ(e,t,n,r),e.in=t.in,e.out=t.out});function dX(e,t){return new uX({type:`pipe`,in:e,out:t})}var fX=Q(`ZodReadonly`,(e,t)=>{mq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zJ(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function pX(e){return new fX({type:`readonly`,innerType:e})}var mX=Q(`ZodCustom`,(e,t)=>{gq.init(e,t),uY.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DJ(e,t,n,r)});function hX(e,t={}){return pJ(mX,e,t)}function gX(e,t){return mJ(e,t)}var _X=e=>{let t=(0,V.c)(3),[n,r]=(0,v.useState)(e),i,a;return t[0]===e?(i=t[1],a=t[2]):(i=()=>{r(e??window.document.body)},a=[e],t[0]=e,t[1]=i,t[2]=a),(0,v.useEffect)(i,a),n},vX=new class{listeners=new Set;scrollBlockers=[];subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.scrollBlockers;addBlockage=(e,t)=>{let n=this.scrollBlockers.find(e=>e.element===t);if(n){if(n.blockers.includes(e))return;this.scrollBlockers=this.scrollBlockers.map(n=>n.element===t?{...n,blockers:[...n.blockers,e]}:n)}else t.style.overflowY=`hidden`,t.style.overflowX=`hidden`,this.scrollBlockers=[...this.scrollBlockers,{element:t,blockers:[e]}];this.emit()};removeBlockage=(e,t)=>{let n=this.scrollBlockers.find(e=>e.element===t);n&&(n.blockers.length>1?this.scrollBlockers=this.scrollBlockers.map(n=>n.element===t?{...n,blockers:n.blockers.filter(t=>t!==e)}:n):(t.style.overflowY=``,t.style.overflowX=``,this.scrollBlockers=this.scrollBlockers.filter(e=>e.element!==t)),this.emit())};isElementScrollBlocked=e=>this.scrollBlockers.some(t=>t.element===e);emit=()=>{this.listeners.forEach(e=>{e()})}},yX=[],bX=()=>{let e=(0,V.c)(2),t=(0,v.useSyncExternalStore)(vX.subscribe,vX.getSnapshot,xX),n;return e[0]===t?n=e[1]:(n={scrollBlockers:t,addBlockage:vX.addBlockage,removeBlockage:vX.removeBlockage,isElementScrollBlocked:vX.isElementScrollBlocked},e[0]=t,e[1]=n),n};function xX(){return yX}var SX=e=>{let{disableScroll:t=!1,element:n,key:r=`unnamed_blocker`}=e??{},{isElementScrollBlocked:i,addBlockage:a,removeBlockage:o}=bX(),s=_X(n);return(0,v.useEffect)(()=>{let e=n??window.document.body;return t?a(r,e):o(r,e),()=>{o(r,e)}},[a,t,n,r,o]),{isScrollBlocked:s?i(s):!1}},CX=`relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`,wX=`after:content-['#'] after:scale-75 after:px-6 after:text-neutral after:absolute after:top-0 after:h-full after:-left-12 after:absolute after:to-neutral after:md:opacity-0 after:transition-opacity hover:after:opacity-80 after:duration-200 after:delay-100`,TX=({className:e,...t})=>(0,y.jsx)(`h1`,{className:W(`text-3xl`,e),...t}),EX=({className:e,...t})=>(0,y.jsx)(`h2`,{className:W(`mb-2 text-2xl`,CX,e),...t}),DX=({className:e,...t})=>(0,y.jsx)(`h3`,{className:W(`mb-2 text-xl`,CX,e),...t}),OX=({className:e,...t})=>(0,y.jsx)(`h4`,{className:W(`text-lg`,CX,e),...t}),kX=({className:e,...t})=>(0,y.jsx)(`h5`,{className:W(`text-base`,CX,e),...t}),AX=({className:e,...t})=>(0,y.jsx)(`h6`,{className:W(`ml-3 text-base`,CX,e),...t}),jX=e=>String(e).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/\s+/g,`-`).toLowerCase(),MX=e=>{let t=(document.getElementById(e)?.getBoundingClientRect()?.top??0)+window.scrollY-150;window.scrollTo({top:t,behavior:`smooth`})},NX=(e,t)=>{let n=e.getBoundingClientRect().left,r=e.getBoundingClientRect().top,i=window.getComputedStyle(e,`:after`),a=n+parseInt(i.getPropertyValue(`left`),10),o=a+parseInt(i.width,10),s=r+parseInt(i.getPropertyValue(`top`),10),c=s+parseInt(i.height,10),l=t.clientX,u=t.clientY;return l>=a&&l<=o&&u>=s&&u<=c},PX=({H:e,children:t,className:n,isClickable:r,...i})=>{let a=typeof t==`string`?jX(t):void 0;return(0,y.jsx)(e,{id:a,onClick:r?e=>{let{id:t}=e.currentTarget;if(NX(e.currentTarget,e)&&typeof t==`string`){let e=`${window.location.href.split(`#`)[0]}#${t}`;navigator.clipboard.writeText(e),MX(t)}}:void 0,"aria-label":r?`Click to scroll to section ${a} and copy the link to the clipboard`:void 0,className:W(r&&wX,n),...i,children:t})},FX=({isClickable:e,...t})=>(0,y.jsx)(TX,{...t}),IX=({isClickable:e=!1,...t})=>(0,y.jsx)(PX,{H:EX,isClickable:e,...t}),LX=({isClickable:e=!1,...t})=>(0,y.jsx)(PX,{H:DX,isClickable:e,...t}),RX=({isClickable:e=!1,...t})=>(0,y.jsx)(PX,{H:OX,isClickable:e,...t}),zX=({isClickable:e=!1,...t})=>(0,y.jsx)(PX,{H:kX,isClickable:e,...t}),BX=({isClickable:e=!1,...t})=>(0,y.jsx)(PX,{H:AX,isClickable:e,...t}),VX=Qd(`flex cursor-default flex-col overflow-hidden shadow-sm`,{variants:{size:{sm:`h-auto max-h-[30vh] w-[95vw] max-w-xl`,md:`h-auto max-h-[50vh] w-[95vw] max-w-xl`,lg:`h-auto max-h-[70vh] w-[95vw] max-w-4xl`,xl:`h-auto max-h-[95vh] w-[95vw] max-w-6xl`,unset:`h-auto max-h-[95vh] w-[95vw]`}},defaultVariants:{size:`unset`}}),HX={none:`p-0`,sm:`px-2 py-4`,md:`px-4 py-6`,lg:`px-6 py-8`,xl:`px-8 py-10`,"2xl":`px-10 py-12`},UX=kC.create(ck),WX=({children:e,isOpen:t,container:n,onClose:r,hasCloseButton:i=!1,title:a,size:o=`md`,className:s,isScrollable:c=!1,disableScroll:l=!0,padding:u=`none`,...d})=>{let f=_X(n);if(SX({key:`modal`,disableScroll:t&&l}),(0,v.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t&&r&&r()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t,r]),!f)return(0,y.jsx)(y.Fragment,{});let p=!!a,m=HX[u||`none`];return(0,Zl.createPortal)((0,y.jsx)(kC.div,{className:`invisible fixed top-0 left-0 z-50 flex size-full cursor-pointer items-center justify-center overflow-hidden bg-background/40 backdrop-blur`,animate:t?`visible`:`invisible`,variants:{visible:{opacity:1,visibility:`visible`,transition:{duration:.1,when:`beforeChildren`}},invisible:{opacity:0,visibility:`hidden`,transition:{duration:.1,when:`afterChildren`}}},onClick:e=>{e.stopPropagation(),r?.()},"aria-hidden":!t,children:(0,y.jsxs)(UX,{onClick:e=>e.stopPropagation(),initial:{scale:t?.5:1},animate:{scale:t?1:.5},transition:{duration:.3},className:VX({size:o,className:s}),role:`dialog`,"aria-modal":!0,roundedSize:`4xl`,padding:`none`,...d,children:[(0,y.jsxs)(`div`,{className:W(`relative flex-none px-4 pt-4`,i&&p?`flex items-start`:i?`flex justify-end`:p?`items-center`:`hidden`),children:[p&&(0,y.jsx)(LX,{className:`mb-2 ml-1 flex items-center justify-center font-bold text-lg`,children:a}),i&&(0,y.jsx)(bO,{variant:`hoverable`,color:`text`,label:`Close modal`,className:`ml-auto`,onClick:e=>{e.stopPropagation(),r?.()},Icon:Pf,size:`icon-md`})]}),(0,y.jsx)(`div`,{className:W(`flex min-h-0 w-full flex-1 flex-col`,c===!0&&`overflow-auto`,c===`y`&&`overflow-y-auto overflow-x-hidden`,c===`x`&&`overflow-x-auto overflow-y-hidden`,!c&&`overflow-visible`),children:(0,y.jsx)(`div`,{className:W(`flex size-full flex-1 flex-col`,m),children:e})})]})}),f)},GX=e=>{let t=(0,V.c)(25),{dictionary:n,mode:r,className:i,onDelete:a,onSave:o,...s}=e,[c,l]=(0,v.useState)(!1),{setLocaleDictionary:u}=Jw(),{mutate:d,isPending:f}=uO(),{mutate:p,isPending:m}=fO(),{mutate:h,isPending:g}=lO(),_=m||g,{editedContent:b,restoreEditedContent:x}=nT(),{deleteButton:S,resetButton:C,saveButton:w,publishButton:T,downloadButton:E,confirmation:D}=dn(`save-dictionary-details`),{isAuthenticated:O}=qD(),{session:k}=KD(),A;t[0]===k?.permissions?A=t[1]:(A=(k?.permissions?.includes(`dictionary:admin`)||k?.permissions?.includes(`dictionary:write`))??!1,t[0]=k?.permissions,t[1]=A);let j=A,M=j,N=b?.[n.localId],P;t[2]!==n||t[3]!==N?(P=N&&JSON.stringify(N)!==JSON.stringify(n),t[2]=n,t[3]=N,t[4]=P):P=t[4];let F=P,I=n?.id!==void 0,L;t[5]!==n||t[6]!==b||t[7]!==o||t[8]!==x||t[9]!==u||t[10]!==p?(L=async()=>{if(!b?.[n.localId])return;let e={...n,...b?.[n.localId]};p({dictionary:e},{onSuccess:()=>{u(b?.[n.localId]),x(n.localId),l(!1),o?.()}})},t[5]=n,t[6]=b,t[7]=o,t[8]=x,t[9]=u,t[10]=p,t[11]=L):L=t[11];let ee=L,te;t[12]!==n||t[13]!==b||t[14]!==o||t[15]!==h||t[16]!==x||t[17]!==u?(te=()=>{let e={...n,...b?.[n.localId]};h({dictionaries:[e]},{onSuccess:t=>{t&&(u(e),x(n.localId),o?.())}})},t[12]=n,t[13]=b,t[14]=o,t[15]=h,t[16]=x,t[17]=u,t[18]=te):te=t[18];let ne=te,R;t[19]!==d||t[20]!==n||t[21]!==a?(R=()=>{n.id&&d({dictionaryId:n.id},{onSuccess:e=>{e&&a?.()}})},t[19]=d,t[20]=n,t[21]=a,t[22]=R):R=t[22];let z=R,B;t[23]===Symbol.for(`react.memo_cache_sentinel`)?(B=()=>l(!1),t[23]=B):B=t[23];let re;return t[24]===Symbol.for(`react.memo_cache_sentinel`)?(re=()=>l(!1),t[24]=re):re=t[24],(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(WX,{isOpen:c,title:D.title.value,size:`md`,onClose:B,padding:`md`,children:(0,y.jsxs)(`form`,{className:`size-full`,children:[(0,y.jsx)(`p`,{className:`py-4 text-neutral text-sm`,children:D.message}),(0,y.jsxs)(`div`,{className:`mt-12 flex justify-end gap-2 max-md:flex-col`,children:[(0,y.jsx)(bO,{label:D.cancelButton.label.value,disabled:!F||_,color:`text`,className:`max-md:w-full`,variant:`outline`,onClick:re,children:D.cancelButton.text}),(0,y.jsx)(bO,{label:D.confirmButton.label.value,disabled:!F||_||!j,Icon:Af,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ee,children:D.confirmButton.text})]})]})}),(0,y.jsxs)(`form`,{className:W(`flex justify-end gap-2`,i),...s,children:[r.includes(`remote`)&&I&&a&&O&&(0,y.jsx)(bO,{label:S.label.value,Icon:Mf,color:`error`,variant:`outline`,className:`max-md:w-full`,isLoading:f,onClick:z,disabled:!M,children:S.text}),F&&(0,y.jsx)(bO,{label:C.label.value,disabled:!F,Icon:kf,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:()=>x(n.localId),children:C.text}),r.includes(`local`)&&(0,y.jsx)(bO,{label:E.label.value,disabled:!F||_,Icon:bf,color:`text`,variant:O?`outline`:`default`,className:`max-md:w-full`,isLoading:m,onClick:()=>l(!0),children:E.text}),r.includes(`remote`)&&O&&!I&&(0,y.jsx)(bO,{label:T.label.value,disabled:_||!j,Icon:df,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ne,children:T.text}),r.includes(`remote`)&&O&&I&&F&&(0,y.jsx)(bO,{label:w.label.value,disabled:!F||_||!j,Icon:Af,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ne,children:w.text})]})]})},KX=(e,t=2e3,n,r)=>{let[i,a]=(0,v.useState)(!1);return{isCopied:i,copy:async()=>{if(e)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else{r?.(Error(`Clipboard API not supported in this browser`));return}a(!0),setTimeout(()=>a(!1),t),n?.()}catch(e){let t=e instanceof Error?e.message:`Failed to copy to clipboard`;r?.(e instanceof Error?e:Error(t))}}}},qX=({text:e,children:t,className:n,"aria-label":r=`Copy to clipboard`,"aria-copied-label":i=`Copied to clipboard`,feedbackDuration:a=2e3,onCopySuccess:o,onCopyError:s,disable:c,preventDefault:l=!0,stopPropagation:u=!0,size:d=14})=>{let{isCopied:f,copy:p}=KX(e,a,o,s);if(c)return(0,y.jsx)(`span`,{className:n,children:t});let m=e=>{(e.key===`Enter`||e.key===` `)&&h(e)},h=e=>{l&&e.preventDefault(),u&&e.stopPropagation(),p()},g=f?i:r,_=f?vf:yf;return(0,y.jsxs)(`span`,{className:W(`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-md p-0.5 hover:bg-neutral/10`,n),onClick:h,onKeyDown:m,role:`button`,tabIndex:0,"aria-label":g,"aria-pressed":f,"data-testid":`copy-to-clipboard`,children:[(0,y.jsx)(`span`,{className:`min-w-0 break-all`,children:t}),e&&(0,y.jsx)(_,{className:`ml-1 ml-auto shrink-0`,size:d,"aria-hidden":`true`})]})},JX=Qd(`relative z-0 flex size-full flex-row items-center gap-2`,{variants:{color:{primary:`border-primary text-primary`,secondary:`border-secondary text-secondary`,error:`border-error bg-error text-error`,neutral:`border-neutral text-neutral`,light:`border-white text-white`,dark:`border-neutral-800 text-neutral-800`,text:`border-text text-text`}},defaultVariants:{color:`primary`}}),YX=Qd(`absolute -z-1 rounded-lg duration-300 ease-in-out motion-reduce:transition-none`,{variants:{color:{primary:`bg-primary/10 aria-selected:text-text`,secondary:`bg-secondary/10 aria-selected:text-text`,error:`bg-error/10 aria-selected:text-text`,neutral:`bg-neutral/10 aria-selected:text-white/10`,light:`bg-white/10 aria-selected:text-black`,dark:`bg-neutral-800/10 aria-selected:text-white`,text:`bg-text/10 aria-selected:text-text-opposite`},orientation:{horizontal:`top-0 h-full w-auto transition-[left,width]`,vertical:`left-0 h-auto w-full transition-[top,height]`}},defaultVariants:{orientation:`horizontal`}}),XX=({tabs:e,selectedChoice:t,onTabClick:n,color:r=`primary`,hoverable:i=!1,orientation:a=`horizontal`,className:o})=>{let s=(0,v.useRef)([]),c=(0,v.useRef)(null),{choiceIndicatorPosition:l,calculatePosition:u}=EO(s,{isHoverable:i,orientation:a});return(0,v.useEffect)(()=>{u()},[t]),(0,y.jsxs)(`div`,{className:W(JX({color:r}),o),"aria-orientation":a,"aria-multiselectable":`false`,role:`tablist`,children:[e.map((e,r)=>{let i=e.key,a=t===i;return(0,v.cloneElement)(e,{key:i??r,role:`tab`,onClick:t=>{e.props?.onClick?.(t),n?.(i)},"aria-selected":a,"data-active":a,tabIndex:a?0:-1,ref:e=>{s.current[r]=e}})}),l&&(0,y.jsx)(`div`,{className:W(YX({color:r,orientation:a})),style:l,ref:c},`${t}${JSON.stringify(e.map(e=>e.key))}`)]})},ZX=Qd([`appearance-none`,`relative cursor-pointer border-2`,`focus:outline-0`,`checked:hover:opacity-80`,`ring-offset-background`,`hover:bg-neutral-500/10`,`disabled:opacity-50`,`ring-0 transition-all duration-300 ease-in-out hover:ring-4 focus-visible:ring-6`,`checked:before:absolute checked:before:inset-0 checked:before:content-['✓']`,`checked:before:flex checked:before:items-center checked:before:justify-center`,`checked:before:text-text-opposite/80`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`after:absolute after:-inset-2 after:content-['']`].join(` `),{variants:{variant:{default:``},size:{xs:`size-3 rounded-sm`,sm:`size-4 rounded-md`,md:`size-5 rounded-lg`,lg:`size-6 rounded-xl`},color:{primary:`border-primary/30 text-primary ring-primary/20 checked:border-primary checked:bg-primary`,secondary:`border-secondary/30 text-secondary ring-secondary/20 checked:border-secondary checked:bg-secondary`,neutral:`border-neutral/30 text-neutral ring-neutral/20 checked:border-neutral checked:bg-neutral`,light:`border-white/30 text-white ring-white/20 checked:border-white checked:bg-white`,text:`border-text/30 text-text ring-text/20 checked:border-text checked:bg-text`,"text-inverse":`border-text-inverse/30 text-text-inverse ring-text-inverse/20 checked:border-text-inverse checked:bg-text-inverse`,dark:`border-neutral-800/30 text-neutral-800 ring-neutral-800/20 checked:border-neutral-800 checked:bg-neutral-800`,error:`border-error/30 text-error ring-error/20 checked:border-error checked:bg-error`,success:`border-success/30 text-success ring-success/20 checked:border-success checked:bg-success`,custom:`border-custom/30 text-custom ring-custom/20 checked:border-custom checked:bg-custom`},validationStyleEnabled:{disabled:``,enabled:`valid:border-success invalid:border-error`}},defaultVariants:{variant:`default`,color:`text`,validationStyleEnabled:`disabled`,size:`md`}}),QX=({validationStyleEnabled:e=!1,label:t,size:n,color:r,name:i,variant:a,className:o,labelClassName:s,...c})=>(0,y.jsx)(`input`,{type:`checkbox`,className:W(ZX({variant:a,size:n,color:r,validationStyleEnabled:e?`enabled`:`disabled`}),o),...c}),$X=e=>{let{label:t,name:n,id:r}=e;return t?(0,y.jsxs)(`label`,{htmlFor:r??n,className:W(`flex w-full cursor-pointer items-center gap-x-4 font-medium text-sm`,e.size===`xs`&&`text-xs`,e.labelClassName),children:[(0,y.jsx)(QX,{id:r??n,...e}),t]}):(0,y.jsx)(QX,{id:r??n,...e})},eZ=e=>(0,y.jsx)($U,{id:e.name,"data-testid":e.name,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,Element:QO,...e}),tZ=e=>(0,y.jsx)($U,{id:e.name,"data-testid":e.name,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,Element:WO,...e}),nZ=e=>{let t=(0,V.c)(38),{titleRequiredError:n,titleInvalidTypeError:r,titleMinLengthError:i,keyRequiredError:a,keyInvalidTypeError:o,keySpaceError:s,keyMinLengthError:c,descriptionRequiredError:l,descriptionInvalidTypeError:u,requiredErrorProjectId:d,invalidTypeErrorProjectId:f,invalidTypeErrorTags:p,locationRequiredError:m,locationInvalidTypeError:h,filePathRequiredError:g,filePathInvalidTypeError:_}=dn(`dictionary-detail-schema`),v;if(t[0]!==u||t[1]!==l||t[2]!==_||t[3]!==g||t[4]!==f||t[5]!==p||t[6]!==o||t[7]!==c.value||t[8]!==a||t[9]!==s.value||t[10]!==h||t[11]!==m||t[12]!==e||t[13]!==d||t[14]!==r||t[15]!==i.value||t[16]!==n){let y;t[18]!==r||t[19]!==n?(y=e=>e.input===void 0?n.value:r.value,t[18]=r,t[19]=n,t[20]=y):y=t[20];let b;t[21]!==o||t[22]!==a?(b=e=>e.input===void 0?a.value:o.value,t[21]=o,t[22]=a,t[23]=b):b=t[23];let x;t[24]!==u||t[25]!==l?(x=e=>e.input===void 0?l.value:u.value,t[24]=u,t[25]=l,t[26]=x):x=t[26];let S;t[27]!==f||t[28]!==d?(S=e=>e.input===void 0?d.value:f.value,t[27]=f,t[28]=d,t[29]=S):S=t[29];let C;t[30]===p?C=t[31]:(C=()=>p.value,t[30]=p,t[31]=C);let w;t[32]!==h||t[33]!==m?(w=e=>e.input===void 0?m.value:h.value,t[32]=h,t[33]=m,t[34]=w):w=t[34];let T;t[35]!==_||t[36]!==g?(T=e=>e.input===void 0?g.value:_.value,t[35]=_,t[36]=g,t[37]=T):T=t[37],v=VY({title:pY({error:y}).refine(rZ,{error:i.value}).optional(),key:pY({error:b}).min(4,{error:c.value}).regex(/^[a-zA-Z0-9-_]+$/,{error:s.value}).default(``),description:pY({error:x}).optional(),projectIds:zY(pY({error:S})).default([e]),tags:zY(pY({error:C})).default([]),location:qY([`local`,`remote`,`hybrid`,`plugin`],{error:w}).optional(),importMode:qY([`static`,`dynamic`,`fetch`]).optional(),filePath:pY({error:T}).optional()}),t[0]=u,t[1]=l,t[2]=_,t[3]=g,t[4]=f,t[5]=p,t[6]=o,t[7]=c.value,t[8]=a,t[9]=s.value,t[10]=h,t[11]=m,t[12]=e,t[13]=d,t[14]=r,t[15]=i.value,t[16]=n,t[17]=v}else v=t[17];return v};function rZ(e){return e.length===0||e.length>=4}var iZ=[`collection`,`variant`],aZ=e=>{let t=[];return e.item!==void 0&&t.push(`collection`),e.variant!==void 0&&t.push(`variant`),t},oZ=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,sZ=e=>{if(e.trim().startsWith(`{`))try{return{variant:JSON.parse(e),error:!1}}catch{return{variant:e,error:!0}}return{variant:e,error:!1}},cZ=({dictionary:e,mode:t,onSelectSibling:n})=>{let{session:r}=KD(),{project:i}=r??{},{data:a,isLoading:o}=pO(),{data:s}=mO(),c=a?.data??[],l=s?.data??[],u=nZ(String(i?.id)),{form:d,isSubmitting:f}=_W(u,{defaultValues:{...e,location:e.location??`remote`}}),{editedContent:p,setEditedDictionary:m}=nT(),{titleInput:h,keyInput:g,descriptionInput:_,projectInput:b,tagsSelect:x,locationSelect:S,importModeSelect:C,filePathInput:w,auditButton:T,qualifierSection:E,siblingDictionaries:D,typeSwitch:O}=dn(`dictionary-details`),{mutate:k,isPending:A}=rO(),j=p?.[e.localId],{data:M,isLoading:N}=cO({keys:[e.key]},{enabled:!!e.key}),P=(0,v.useMemo)(()=>(M?.data??[]).filter(t=>t.localId!==e.localId),[M,e.localId]),F=(0,v.useMemo)(()=>P.filter(e=>e.item!==void 0).sort((e,t)=>(e.item??0)-(t.item??0)),[P]),I=(0,v.useMemo)(()=>P.filter(e=>e.variant!==void 0),[P]),L=(0,v.useMemo)(()=>e.item===void 0?F:[e,...F].sort((e,t)=>(e.item??0)-(t.item??0)),[e,F]),ee=(0,v.useMemo)(()=>e.variant===void 0?I:[e,...I],[e,I]);(0,v.useEffect)(()=>{d.reset({...e,tags:e.tags??[],location:e.location??`remote`}),re(aZ(e)),ae(e.item??1),se(oZ(e.variant)),le(!1),de(!1)},[e,d?.reset]),(0,v.useEffect)(()=>{j===void 0&&d.reset({...e,tags:e.tags??[],location:e.location??`remote`})},[j]);let te=()=>{let t={...e,...j};k({fileContent:JSON.stringify(t)},{onSuccess:e=>{if(!e?.data)return;let n=e.data.fileContent,r={...t,...n,tags:n.tags??t.tags??[]};m(r),d.reset(r)}})},ne=PH({control:d.control,name:`location`}),R=ne===`local`||ne===`hybrid`,z=P.length>0,[B,re]=(0,v.useState)(()=>aZ(e)),[ie,ae]=(0,v.useState)(e.item??1),[oe,se]=(0,v.useState)(oZ(e.variant)),[ce,le]=(0,v.useState)(!1),[ue,de]=(0,v.useState)(!1),fe=(0,v.useMemo)(()=>[...F,...I],[F,I]),pe=t=>{let n=[t].flat(),r=n.filter(e=>!B.includes(e)),i=B.filter(e=>!n.includes(e)),a={...e,...j??{}};for(let e of i)e===`collection`&&(a={...a,item:void 0}),e===`variant`&&(a={...a,variant:void 0});for(let e of r)if(e===`collection`){let e=L.length>0?Math.max(...L.map(e=>e.item??0))+1:1;ae(e),a={...a,item:e}}else if(e===`variant`){let e=oe||`default`;se(e),a={...a,variant:sZ(e).variant}}re(n),m(a),le(!1),n.length===0&&fe.length>0?de(!0):de(!1)};return(0,y.jsxs)(vW,{className:`flex w-full flex-col gap-8`,...d,schema:u,children:[(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,y.jsx)(eZ,{name:`key`,label:g.label,placeholder:g.label.value,description:g.description,disabled:f,isRequired:!0,onSave:t=>{d.setValue(`key`,t,{shouldDirty:!0}),m({...e,...j??{},key:t})}}),(0,y.jsx)(eZ,{name:`title`,label:h.label,placeholder:h.placeholder.value,description:h.description,disabled:f,onSave:t=>{d.setValue(`title`,t,{shouldDirty:!0}),m({...e,...j??{},title:t})}})]}),(0,y.jsx)(tZ,{name:`description`,label:_.label,placeholder:_.placeholder.value,description:_.description,disabled:f,onSave:t=>{d.setValue(`description`,t,{shouldDirty:!0}),m({...e,...j??{},description:t})}}),(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 px-1 max-md:grid-cols-1`,children:[(0,y.jsx)(HU,{control:d.control,name:`location`,render:({field:n})=>{let r=n.value,i=r===`local`||r===`hybrid`,a=r===`remote`||r===`hybrid`,o=t=>{if(!t&&!a)return;let r=t?a?`hybrid`:`local`:`remote`;n.onChange(r);let i=t?d.getValues(`filePath`)??e.filePath:void 0;t||d.setValue(`filePath`,void 0),m({...e,...j??{},location:r,filePath:i})},s=t=>{if(!t&&!i)return;let r=t?i?`hybrid`:`remote`:`local`;n.onChange(r),m({...e,...j??{},location:r})};return(0,y.jsxs)(ZV,{className:`flex flex-col gap-2 px-1`,children:[(0,y.jsx)(XU,{className:`ml-1`,children:S.label}),(0,y.jsxs)(`div`,{className:`ml-2 flex items-center gap-4 py-2`,children:[(0,y.jsx)($X,{id:`location-local`,name:`location-local`,label:S.local.value,color:`text`,checked:i,disabled:!t.includes(`local`)&&!t.includes(`remote`),onChange:e=>o(e.target.checked)}),(0,y.jsx)($X,{id:`location-remote`,name:`location-remote`,label:S.remote.value,color:`text`,checked:a,disabled:!t.includes(`remote`)&&e.location!==`remote`&&e.location!==`hybrid`,onChange:e=>s(e.target.checked)})]}),(0,y.jsx)(GU,{children:S.testDescription}),(0,y.jsx)(KU,{})]})}}),(0,y.jsx)(Fx,{mode:`wait`,children:R&&(0,y.jsx)(kC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.3},children:(0,y.jsx)(eW,{name:`filePath`,label:w.label.value,placeholder:w.placeholder.value,description:w.description.value,disabled:f||!R,onChange:t=>{let n=t.target.value;m({...e,...j??{},filePath:n})}})},`filePath-input`)})]}),(0,y.jsx)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:(0,y.jsxs)(iW,{name:`importMode`,label:C.label.value,description:C.description.value,onValueChange:t=>{d.setValue(`importMode`,t,{shouldDirty:!0}),m({...e,...j??{},importMode:t})},children:[(0,y.jsx)(Y.Trigger,{children:(0,y.jsx)(Y.Value,{placeholder:C.label.value})}),(0,y.jsxs)(Y.Content,{children:[(0,y.jsx)(Y.Item,{value:`static`,children:C.static.value}),(0,y.jsx)(Y.Item,{value:`dynamic`,children:C.dynamic.value}),(0,y.jsx)(Y.Item,{value:`live`,children:C.live.value})]})]})}),(0,y.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,y.jsxs)(nW,{name:`projectIds`,label:b.label.value,description:b.description,onValueChange:t=>{let n=[t].flat();d.setValue(`projectIds`,n,{shouldDirty:!0}),m({...e,...j??{},projectIds:n})},children:[(0,y.jsx)(YV.Trigger,{getBadgeValue:e=>c?.find(t=>String(t.id)===e)?.name??e,children:(0,y.jsx)(YV.Input,{placeholder:b.placeholder.value})}),(0,y.jsx)(YV.Content,{children:(0,y.jsx)(_O,{isLoading:o,children:(0,y.jsx)(YV.List,{children:c?.map(e=>(0,y.jsx)(YV.Item,{value:String(e.id),children:e.name},String(e.id)))})})})]}),(0,y.jsxs)(nW,{name:`tags`,label:x.label.value,description:x.description,onValueChange:t=>{let n=[t].flat();d.setValue(`tags`,n,{shouldDirty:!0}),m({...e,...j??{},tags:n})},children:[(0,y.jsx)(YV.Trigger,{getBadgeValue:e=>l?.find(t=>String(t.key)===e)?.name??e,children:(0,y.jsx)(YV.Input,{placeholder:x.placeholder.value})}),(0,y.jsx)(YV.Content,{children:(0,y.jsx)(_O,{isLoading:o,children:(0,y.jsx)(YV.List,{children:l?.map(e=>(0,y.jsx)(YV.Item,{value:String(e.key),children:e.name??e.key},String(e.key)))})})})]})]}),(0,y.jsxs)(ck,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`card`,children:[(0,y.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,y.jsx)(`p`,{className:`ml-1 font-semibold text-sm`,children:O.label}),(0,y.jsx)(`p`,{className:`ml-1 text-muted text-xs`,children:O.description})]}),(0,y.jsxs)(YV,{values:B,onValueChange:pe,className:`max-w-xs`,children:[(0,y.jsx)(YV.Trigger,{getBadgeValue:e=>e===`collection`?String(O.collection):e===`variant`?String(O.variant):e,children:(0,y.jsx)(YV.Input,{placeholder:O.label.value})}),(0,y.jsx)(YV.Content,{children:(0,y.jsx)(YV.List,{children:iZ.map(e=>(0,y.jsx)(YV.Item,{value:e,children:O[e].value},e))})})]}),(0,y.jsxs)(Fx,{children:[B.includes(`collection`)&&(0,y.jsx)(kC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,y.jsx)(`label`,{htmlFor:`qualifier-item-value`,className:`ml-1 font-medium text-sm`,children:O.itemValueLabel}),(0,y.jsx)(RO,{id:`qualifier-item-value`,type:`number`,min:1,value:ie,placeholder:O.itemValuePlaceholder.value,onChange:t=>{let n=parseInt(t.target.value,10);!Number.isNaN(n)&&n>=1&&(ae(n),m({...e,...j??{},item:n}))}})]})},`item-input`),B.includes(`variant`)&&(0,y.jsx)(kC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,y.jsx)(`label`,{htmlFor:`qualifier-variant-value`,className:`ml-1 font-medium text-sm`,children:O.variantValueLabel}),(0,y.jsx)(RO,{id:`qualifier-variant-value`,type:`text`,value:oe,placeholder:O.variantValuePlaceholder.value,onChange:t=>{let n=t.target.value;se(n);let{variant:r,error:i}=sZ(n);le(i),i||m({...e,...j??{},variant:r})}}),ce&&(0,y.jsx)(`p`,{className:`ml-1 text-destructive text-xs`,children:O.variantJsonError})]})},`variant-input`),B.length===0&&ue&&(0,y.jsx)(kC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,y.jsxs)(ck,{background:`none`,border:!0,borderColor:`neutral`,roundedSize:`xl`,padding:`md`,className:`gap-3`,children:[(0,y.jsx)(`p`,{className:`font-medium text-sm`,children:O.disablePickerTitle}),(0,y.jsx)(`p`,{className:`text-muted text-xs`,children:O.disablePickerDescription}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:fe.map(e=>(0,y.jsxs)(`button`,{type:`button`,onClick:()=>{n?.(e),de(!1)},className:`cursor-pointer rounded-lg border border-border px-3 py-1 text-xs transition-colors hover:bg-text/10`,children:[e.variant!==void 0&&(0,y.jsxs)(`span`,{children:[E.variant,`:`,` `,oZ(e.variant)]}),e.item!==void 0&&(0,y.jsxs)(`span`,{children:[E.item,`: `,e.item]})]},e.localId))})]})},`sibling-picker`)]})]}),(0,y.jsxs)(ck,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`neutral`,children:[(0,y.jsx)(`p`,{className:`font-semibold text-sm`,children:D.title}),(0,y.jsxs)(_O,{isLoading:N,children:[!z&&(0,y.jsx)(`p`,{className:`text-muted text-sm`,children:D.noSiblings}),L.length>0&&(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.collectionItems}),(0,y.jsx)(hR,{currentPage:L.findIndex(t=>t.localId===e.localId)+1||1,totalPages:L.length,onPageChange:e=>{let t=L[e-1];t&&n&&n(t)},showPrevNext:!0}),(0,y.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:L.map(t=>{let r=t.localId===e.localId;return(0,y.jsxs)(`button`,{type:`button`,onClick:()=>!r&&n?.(t),className:W(`rounded-lg px-3 py-1 text-xs transition-colors`,r?`bg-text font-semibold text-text-opposite`:`cursor-pointer border border-border hover:bg-text/10`),children:[D.itemIndex,` `,t.item]},t.localId)})})]}),ee.length>0&&(0,y.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,y.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.variants}),(0,y.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ee.map(t=>{let r=t.localId===e.localId;return(0,y.jsx)(`button`,{type:`button`,onClick:()=>!r&&n?.(t),className:W(`rounded-lg px-3 py-1 text-xs transition-colors`,r?`bg-text font-semibold text-text-opposite`:`cursor-pointer border border-border hover:bg-text/10`),children:oZ(t.variant)},t.localId)})})]})]})]}),(0,y.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 max-md:flex-col`,children:(0,y.jsx)(bO,{type:`button`,size:`icon-md`,label:T.label.value,Icon:Nf,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:te,disabled:f||A,isLoading:A})})]})},lZ=e=>{let t=(0,V.c)(6),{content:n,...r}=e,[i,a]=(0,v.useState)(!1),[o,s]=(0,v.useState)(!1),{label:c}=dn(`copy-button`),l;t[0]===n?l=t[1]:(l=async()=>{try{s(!1),await navigator.clipboard.writeText(n),a(!0)}catch(e){console.error(`Failed to copy text: `,e),s(!0)}},t[0]=n,t[1]=l);let u=l,d,f;t[2]!==i||t[3]!==o?(d=()=>{if(i||o){let e=setTimeout(()=>{a(!1),s(!1)},1e3);return()=>clearTimeout(e)}},f=[i,o],t[2]=i,t[3]=o,t[4]=d,t[5]=f):(d=t[4],f=t[5]),(0,v.useEffect)(d,f);let p=()=>i?`Content copied to clipboard`:o?`Failed to copy content`:r.label??c.value;return(0,y.jsx)(bO,{Icon:i?vf:yf,onClick:u,variant:`hoverable`,color:`text`,size:`icon-sm`,tabIndex:0,title:p(),...r,label:p(),"aria-describedby":i?`copy-success`:o?`copy-error`:void 0})},uZ=(0,v.lazy)(()=>ht(()=>import(`./dist-BMR831Ty.js`).then(e=>({default:e.Editor})),__vite__mapDeps([6,2,3]))),dZ=({children:e,language:t,isDarkMode:n,showLineNumbers:r,showCopyButton:i=!0,isReadOnly:a=!1,onChange:o})=>{let s=(0,v.useRef)(null),c=(0,v.useRef)(null),[l,u]=(0,v.useState)({height:0,width:0}),d=n?`vs-dark-transparent`:`hc-light-theme`,f=(e,t)=>{c.current=e;let n=(e.getContentHeight()??0)+25;t.editor.defineTheme(`vs-dark-transparent`,{base:`vs-dark`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),t.editor.defineTheme(`hc-light-theme`,{base:`vs`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),t.editor.setTheme(d),t.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),t.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),t.languages.typescript.typescriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),t.languages.typescript.javascriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),u({height:n,width:s.current?.clientWidth??0})},p=r??(typeof e==`string`&&e.split(`
|
|
166
|
+
`).length>1);return(0,y.jsxs)(`div`,{className:W(`relative size-full text-sm`,r&&`ml-0`),children:[i&&(0,y.jsx)(`div`,{className:`sticky top-5 z-10`,children:(0,y.jsx)(`div`,{className:W(`absolute right-2 bottom-0 flex h-7 items-center`),children:(0,y.jsx)(lZ,{content:e})})}),(0,y.jsx)(`div`,{className:`z-0 grid size-full grid-cols-[0px] overflow-auto`,ref:s,children:(0,y.jsx)(v.Suspense,{fallback:(0,y.jsx)(_O,{}),children:(0,y.jsx)(uZ,{...l,defaultLanguage:`typescript`,language:t,loading:(0,y.jsx)(_O,{}),defaultValue:String(e).replace(/\n$/,``),onMount:f,onChange:o,options:{contextmenu:!1,readOnly:a,cursorStyle:`line`,minimap:{enabled:!1},scrollbar:{vertical:`hidden`,verticalScrollbarSize:0,alwaysConsumeMouseWheel:!1},folding:!1,renderValidationDecorations:`off`,quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1,mouseWheelScrollSensitivity:0,fastScrollSensitivity:0,scrollBeyondLastLine:!1,lineNumbers:p?`on`:`off`},theme:d,className:`my-2 rounded-md`})})})]})},fZ=e=>{let t=(0,V.c)(7),{dictionary:n,isDarkMode:r}=e,{setEditedContent:i,editedContent:a}=nT(),o=pZ,s=a?.[n.localId]?.content??n?.content,c;t[0]!==n||t[1]!==i?(c=e=>{o(e??`{}`)&&i(n.localId,JSON.parse(e??`{}`))},t[0]=n,t[1]=i,t[2]=c):c=t[2];let l;return t[3]!==s||t[4]!==r||t[5]!==c?(l=(0,y.jsx)(dZ,{language:`json`,onChange:c,isDarkMode:r,children:JSON.stringify(s,null,2)}),t[3]=s,t[4]=r,t[5]=c,t[6]=l):l=t[6],l};function pZ(e){try{return JSON.parse(e),!0}catch{return!1}}var mZ=e=>{let t=(0,V.c)(24),{section:n,onValueChange:r}=e,{multilingual:i,text:a,number:o,boolean:s,node:c,array:l,enumeration:u,plural:d,triggerPlaceHolder:f,nest:p,gender:m,select:h,condition:g,markdown:_,insertion:b,reactNode:x,file:M}=dn(`node-type-selector`),N;t[0]===n?N=t[1]:(N=cn(n),t[0]=n,t[1]=N);let[F,R]=(0,v.useState)(N),z;t[2]===r?z=t[3]:(z=e=>{R(e),r(e)},t[2]=r,t[3]=z);let B=z,re;return t[4]!==l||t[5]!==s||t[6]!==g||t[7]!==u||t[8]!==M||t[9]!==m||t[10]!==b||t[11]!==F||t[12]!==_||t[13]!==i||t[14]!==p||t[15]!==c||t[16]!==o||t[17]!==B||t[18]!==d||t[19]!==x||t[20]!==h||t[21]!==a||t[22]!==f?(re=(0,y.jsxs)(Y,{value:F,onValueChange:B,children:[(0,y.jsx)(Y.Trigger,{children:(0,y.jsx)(Y.Value,{placeholder:f})}),(0,y.jsxs)(Y.Content,{children:[(0,y.jsx)(Y.Item,{value:S,children:i}),(0,y.jsx)(Y.Item,{value:I,children:a}),(0,y.jsx)(Y.Item,{value:L,children:o}),(0,y.jsx)(Y.Item,{value:ee,children:s}),(0,y.jsx)(Y.Item,{value:O,children:c}),(0,y.jsx)(Y.Item,{value:k,children:l}),(0,y.jsx)(Y.Item,{value:C,children:u}),(0,y.jsx)(Y.Item,{value:w,children:d}),(0,y.jsx)(Y.Item,{value:te,children:m}),(0,y.jsx)(Y.Item,{value:ne,children:h}),(0,y.jsx)(Y.Item,{value:E,children:b}),(0,y.jsx)(Y.Item,{value:P,children:_}),(0,y.jsx)(Y.Item,{value:A,children:p}),(0,y.jsx)(Y.Item,{value:T,children:g}),(0,y.jsx)(Y.Item,{value:j,disabled:!0,children:x}),(0,y.jsx)(Y.Item,{value:D,children:M})]})]}),t[4]=l,t[5]=s,t[6]=g,t[7]=u,t[8]=M,t[9]=m,t[10]=b,t[11]=F,t[12]=_,t[13]=i,t[14]=p,t[15]=c,t[16]=o,t[17]=B,t[18]=d,t[19]=x,t[20]=h,t[21]=a,t[22]=f,t[23]=re):re=t[23],re},hZ=e=>{let t=(0,V.c)(15),{section:n,dictionaryLocalId:r,keyPath:i,onNodeTypeChange:a}=e,o=eT()?.internationalization?.locales??[],s=cn(n),c=rn(n),l=e=>{a(tn(s,o,e))};if(s===`translation`||s===`condition`||s===`gender`||s===`select`||s===`enumeration`||s===`plural`){let e=Object.keys(n[s])[0],t=[...i,{type:s,key:e}];return(0,y.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,y.jsx)(mZ,{section:n,onValueChange:e=>a(tn(e,o))}),(0,y.jsx)(hZ,{section:c,keyPath:t,dictionaryLocalId:r,onNodeTypeChange:l})]})}if(s===`array`){let e=[...i,{type:s,key:0}];return(0,y.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,y.jsx)(mZ,{section:n,onValueChange:e=>a(tn(e,o))}),(0,y.jsx)(hZ,{section:c,keyPath:e,dictionaryLocalId:r,onNodeTypeChange:l})]})}if(s===`object`){let e;if(t[0]!==r||t[1]!==i||t[2]!==o||t[3]!==a||t[4]!==n){let s;t[6]!==o||t[7]!==a?(s=e=>a(tn(e,o)),t[6]=o,t[7]=a,t[8]=s):s=t[8],e=(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(mZ,{section:n,onValueChange:s}),(0,y.jsx)(`div`,{className:`mt-6 ml-10`,children:(0,y.jsx)(vZ,{keyPath:i,section:n,dictionaryLocalId:r})})]}),t[0]=r,t[1]=i,t[2]=o,t[3]=a,t[4]=n,t[5]=e}else e=t[5];return e}let u;t[9]!==o||t[10]!==a?(u=e=>a(tn(e,o)),t[9]=o,t[10]=a,t[11]=u):u=t[11];let d;return t[12]!==n||t[13]!==u?(d=(0,y.jsx)(mZ,{section:n,onValueChange:u}),t[12]=n,t[13]=u,t[14]=d):d=t[14],d},gZ=e=>{let t=(0,V.c)(23),{sectionKey:n,section:r,keyPath:i,dictionaryLocalId:a}=e,{focusedContent:o,setFocusedContentKeyPath:s}=Zw(),{renameEditedContent:c,addEditedContent:l}=tT(),{titleInput:u,deleteButton:d}=dn(`structure-view`),f;t[0]!==a||t[1]!==i||t[2]!==c||t[3]!==s?(f=e=>{c(a,e,i);let t=i.slice(0,-1),n=i[i.length-1],r=[...t,{...n,key:e}];s(r)},t[0]=a,t[1]=i,t[2]=c,t[3]=s,t[4]=f):f=t[4];let p=f,m;if(t[5]!==l||t[6]!==d||t[7]!==a||t[8]!==o?.keyPath||t[9]!==p||t[10]!==i||t[11]!==r||t[12]!==n||t[13]!==s||t[14]!==u){let e;t[16]!==i||t[17]!==s?(e=()=>s(i),t[16]=i,t[17]=s,t[18]=e):e=t[18];let c;t[19]!==l||t[20]!==a||t[21]!==i?(c=e=>{l(a,e,i)},t[19]=l,t[20]=a,t[21]=i,t[22]=c):c=t[22],m=(0,y.jsx)(ck,{transparency:`xl`,roundedSize:`2xl`,className:`w-full min-w-80 gap-2 overflow-auto px-5 py-2`,border:!0,borderColor:`text`,background:`none`,"aria-selected":Pt(i,o?.keyPath??[]),onClick:e,children:(0,y.jsxs)(`div`,{className:`flex w-full flex-col items-start justify-between gap-3`,children:[typeof n==`string`&&(0,y.jsxs)(`div`,{className:`w-full`,children:[(0,y.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-10`,children:[(0,y.jsx)(QO,{name:`key`,"aria-label":`Key`,placeholder:u.placeholder.value,defaultValue:n,onSave:e=>p(e),variant:`invisible`}),(0,y.jsx)(bO,{label:d.label.value,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`translate-x-2`,Icon:Mf,onClick:()=>{l(a,void 0,i);let e=i.slice(0,-1);s(e)}})]}),(0,y.jsxs)(`span`,{className:`ml-3 text-neutral text-sm`,children:[`( `,Rt(n),` )`]})]}),(0,y.jsx)(hZ,{keyPath:i,dictionaryLocalId:a,section:r,onNodeTypeChange:c})]})}),t[5]=l,t[6]=d,t[7]=a,t[8]=o?.keyPath,t[9]=p,t[10]=i,t[11]=r,t[12]=n,t[13]=s,t[14]=u,t[15]=m}else m=t[15];return m},_Z=e=>{let t=(0,V.c)(14),{section:n,keyPath:r,dictionaryLocalId:i}=e,{addNodeButton:a}=dn(`structure-view`),{setFocusedContentKeyPath:o}=Zw(),{addEditedContent:s}=tT();if(!n||typeof n!=`object`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(`div`,{children:`Not an object`}),t[0]=e):e=t[0],e}let c;if(t[1]!==s||t[2]!==a.label.value||t[3]!==a.text||t[4]!==i||t[5]!==r||t[6]!==n||t[7]!==o){let e;t[9]!==s||t[10]!==i||t[11]!==r||t[12]!==o?(e=()=>{let e=[...r,{type:O,key:`newKey`}];s(i,``,e),o(e)},t[9]=s,t[10]=i,t[11]=r,t[12]=o,t[13]=e):e=t[13],c=(0,y.jsxs)(`div`,{className:`flex flex-col gap-2 overflow-y-auto`,children:[(0,y.jsx)(`ul`,{className:`mr-auto flex flex-col gap-4`,children:Object.keys(n).map(e=>(0,y.jsx)(`li`,{className:`flex w-full`,children:(0,y.jsx)(gZ,{sectionKey:e,section:n?.[e],keyPath:[...r,{type:O,key:e}],dictionaryLocalId:i})},`${JSON.stringify(r)}-object-${e}`))}),(0,y.jsx)(bO,{label:a.label.value,variant:`hoverable`,size:`md`,color:`text`,Icon:Of,className:`flex-1`,onClick:e,children:a.text})]}),t[1]=s,t[2]=a.label.value,t[3]=a.text,t[4]=i,t[5]=r,t[6]=n,t[7]=o,t[8]=c}else c=t[8];return c},vZ=({section:e,keyPath:t,dictionaryLocalId:n})=>!e||typeof e!=`object`||typeof e.nodeType==`string`?(0,y.jsx)(gZ,{sectionKey:`content`,section:e,keyPath:t,dictionaryLocalId:n}):(0,y.jsx)(_Z,{section:e,keyPath:t,dictionaryLocalId:n}),yZ=e=>{let t=(0,V.c)(3),{dictionary:n}=e,{content:r,localId:i}=n,{editedContent:a}=nT(),o=a?.[i]?.content===void 0?r:a?.[i]?.content,s;return t[0]!==o||t[1]!==i?(s=(0,y.jsx)(gZ,{section:o,keyPath:[],dictionaryLocalId:i}),t[0]=o,t[1]=i,t[2]=s):s=t[2],s},bZ=({dictionary:e,onClickDictionaryList:t,isDarkMode:n,mode:r,onDelete:i,onSave:a,showReturnButton:o=!0,rightContent:s})=>{let c=eT(),{returnToDictionaryList:l}=dn(`dictionary-field-editor`),{focusedContent:u,setFocusedContent:d}=Zw(),{setLocaleDictionary:f}=Jw(),[p,m]=(0,v.useState)(`content`);return(0,v.useEffect)(()=>{d({...u??{},dictionaryKey:e.key,dictionaryLocalId:e.localId}),f(e)},[]),(0,y.jsx)(Pk,{availableLocales:c?.internationalization?.locales??[],children:(0,y.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-1 flex-col md:overflow-hidden`,children:[o&&(0,y.jsx)(bO,{onClick:t,variant:`hoverable`,className:`z-10 mr-auto mb-6 ml-5 shrink-0`,color:`text`,Icon:uf,label:l.label.value,children:l.text}),(0,y.jsxs)(`div`,{className:`mb-22 flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,y.jsxs)(`div`,{className:`sticky top-0 z-10 flex shrink-0 gap-3 rounded-xl bg-background/20 p-3 pb-4`,children:[(0,y.jsx)(XX,{selectedChoice:p,tabs:[...r.includes(`remote`)?[(0,y.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`details`,onClick:()=>m(`details`),type:`button`,children:`Details`},`details`)]:[],(0,y.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`structure`,onClick:()=>m(`structure`),type:`button`,children:`Structure`},`structure`),(0,y.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`content`,onClick:()=>m(`content`),type:`button`,children:`Content`},`content`),(0,y.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`json`,onClick:()=>m(`json`),type:`button`,children:`JSON`},`json`)],hoverable:!0,color:`text`}),(0,y.jsx)(`div`,{className:`flex w-full items-center justify-end`,children:s})]}),(0,y.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,y.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-6`,children:[r.includes(`remote`)&&p===`details`&&(0,y.jsx)(cZ,{dictionary:e,mode:r,isDarkMode:n}),p===`structure`&&(0,y.jsx)(yZ,{dictionary:e}),p===`content`&&(0,y.jsx)(bR,{dictionary:e,isDarkMode:n}),p===`json`&&(0,y.jsx)(fZ,{dictionary:e,isDarkMode:n})]})})]}),(0,y.jsx)(`div`,{className:`absolute bottom-3 z-20 w-full p-2`,children:(0,y.jsxs)(ck,{color:`card`,roundedSize:`2xl`,padding:`sm`,className:`w-full shrink-0 flex-row flex-wrap items-center justify-end gap-10 bg-background/20 md:bottom-0`,children:[(0,y.jsx)(qX,{text:e.id,className:`text-nowrap text-neutral text-sm`,size:9,children:e.id}),(0,y.jsx)(GX,{dictionary:e,mode:r,onDelete:()=>{d(null),i?.()},onSave:a})]})})]})})},xZ=({children:e,className:t,identifier:n,...r})=>(0,y.jsx)(`div`,{className:W(`group/popover relative flex cursor-pointer`,t),id:`unrollable-panel-button-${n}`,"aria-haspopup":!0,...r,children:e}),SZ=({children:e,isHidden:t=void 0,isOverable:n=!0,isFocusable:r=!1,xAlign:i=`start`,yAlign:a=`below`,identifier:o,className:s,displayArrow:c=!0,...l})=>(0,y.jsx)(ck,{transparency:`xs`,role:`group`,"aria-hidden":t,"aria-labelledby":`unrollable-panel-button-${o}`,id:`unrollable-panel-${o}`,className:W(`absolute z-60 min-w-full rounded-md ring-1 ring-neutral`,i===`start`&&`left-0`,i===`center`&&`left-1/2 -translate-x-1/2`,i===`end`&&`right-0`,a===`below`&&`top-[calc(100%+1rem)]`,a===`above`&&`bottom-[calc(100%+1rem)]`,c&&`before:absolute before:z-[999] before:h-0 before:w-0 before:content-[""]`,c&&i===`start`&&`before:left-2`,c&&i===`center`&&`before:left-1/2 before:-translate-x-1/2`,c&&i===`end`&&`before:right-2`,c&&a===`below`&&`before:-top-2.5 before:border-r-[10px] before:border-r-transparent before:border-b-[10px] before:border-b-neutral before:border-l-[10px] before:border-l-transparent`,c&&a===`above`&&`before:-bottom-2.5 before:border-t-[10px] before:border-t-neutral before:border-r-[10px] before:border-r-transparent before:border-l-[10px] before:border-l-transparent`,`overflow-x-visible opacity-0 transition-all duration-400 ease-in-out`,t===!1?`visible opacity-100 delay-800`:`invisible`,n&&`group-hover/popover:visible group-hover/popover:opacity-100 group-hover/popover:delay-800`,r&&`group-focus-within/popover:visible group-focus-within/popover:opacity-100 group-focus-within/popover:delay-800`,s),...l,children:e});xZ.Detail=SZ;var CZ=e=>(0,y.jsx)(xZ,{...e}),wZ=({xAlign:e=`start`,yAlign:t=`below`,...n})=>{let r=(0,v.useRef)(null),[i,a]=(0,v.useState)(e),[o,s]=(0,v.useState)(t),[c,l]=(0,v.useState)(void 0);return(0,v.useLayoutEffect)(()=>{let i=()=>{if(!r.current)return;let i=r.current,o=document.getElementById(`unrollable-panel-button-${n.identifier}`);if(!o)return;let c=o.getBoundingClientRect(),u=window.innerWidth,d=window.innerHeight,f=u-c.left-16,p=c.right-16;l(Math.max(f,p));let m=i.classList.contains(`invisible`);m&&(i.style.visibility=`hidden`,i.classList.remove(`invisible`)),requestAnimationFrame(()=>{let n=i.getBoundingClientRect();m&&(i.style.visibility=``,i.classList.add(`invisible`));let r=t,o=d-c.bottom-16,l=c.top-16;t===`below`&&o<n.height?l>=n.height&&(r=`above`):t===`above`&&l<n.height&&o>=n.height&&(r=`below`);let f=e,p=u-c.left-16,h=c.right-16;e===`start`&&p<n.width?h>=n.width&&(f=`end`):e===`end`&&h<n.width&&p>=n.width&&(f=`start`),s(r),a(f)})},o=setTimeout(i,0),c=document.getElementById(`unrollable-panel-button-${n.identifier}`);c&&(c.addEventListener(`mouseenter`,i),c.addEventListener(`focusin`,i));let u=new ResizeObserver(()=>{i()});return r.current&&u.observe(r.current),window.addEventListener(`resize`,i),window.addEventListener(`scroll`,i,!0),()=>{clearTimeout(o),c&&(c.removeEventListener(`mouseenter`,i),c.removeEventListener(`focusin`,i)),u.disconnect(),window.removeEventListener(`resize`,i),window.removeEventListener(`scroll`,i,!0)}},[n.identifier,e,t]),(0,y.jsx)(SZ,{...n,xAlign:i,yAlign:o,ref:r,style:{...n.style,maxWidth:c?`${c}px`:void 0}})},TZ=CZ;TZ.Detail=wZ;var EZ=new class{listeners=new Set;drawers={};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.drawers;open=e=>{this.drawers[e]||(this.drawers={...this.drawers,[e]:!0},this.emit())};close=e=>{this.drawers[e]&&(this.drawers={...this.drawers,[e]:!1},this.emit())};set=e=>{let t=!1,n={...this.drawers};for(let[r,i]of Object.entries(e))n[r]!==i&&(n[r]=i,t=!0);t&&(this.drawers=n,this.emit())};emit=()=>{this.listeners.forEach(e=>{e()})}},DZ=()=>{let e=(0,V.c)(2),t=(0,v.useSyncExternalStore)(EZ.subscribe,EZ.getSnapshot,OZ),n;return e[0]===t?n=e[1]:(n={open:EZ.open,close:EZ.close,set:EZ.set,isOpen:e=>!!t[e]},e[0]=t,e[1]=n),n};function OZ(){return{}}var kZ=e=>{switch(e){case`xs`:return 480;case`sm`:return 640;case`md`:return 768;case`lg`:return 1024;case`xl`:return 1280;case`2xl`:return 1536;default:return e}},AZ=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(e)},jZ=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/iP(?:hone|ad|od)/.test(e)},MZ=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/Macintosh|MacIntel|Mac OS X/.test(e)},NZ=e=>{if(!(typeof window>`u`))return(window?.innerWidth??0)<=e},PZ=(e=`md`)=>{let t=kZ(e),n=AZ(),r=NZ(t);return{isMobileScreen:r,isMobileUserAgent:n,isMobile:r??n,isIOS:jZ(),isMac:MZ()}},FZ=e=>{let t=(0,V.c)(4),n=e===void 0?`md`:e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r={isMobileScreen:void 0,isMobileUserAgent:void 0,isMobile:void 0,isIOS:void 0,isMac:void 0},t[0]=r):r=t[0];let[i,a]=(0,v.useState)(r),o,s;return t[1]===n?(o=t[2],s=t[3]):(o=()=>{a(PZ(n));let e=()=>{a(PZ(n))};return window.addEventListener(`resize`,e,{passive:!0}),()=>window.removeEventListener(`resize`,e)},s=[n],t[1]=n,t[2]=o,t[3]=s),(0,v.useEffect)(o,s),i},IZ=e=>e.split(` + `).map(e=>e.trim()),LZ=e=>({"⌘":`Meta`,Ctrl:`Control`,Control:`Control`,Alt:`Alt`,"⌥":`Alt`,Shift:`Shift`,Meta:`Meta`,"↑":`ArrowUp`,"↓":`ArrowDown`,"←":`ArrowLeft`,"→":`ArrowRight`,ArrowUp:`ArrowUp`,ArrowDown:`ArrowDown`,ArrowLeft:`ArrowLeft`,ArrowRight:`ArrowRight`})[e]||e,RZ=(e,t)=>{let n=t.map(LZ),r={Meta:n.includes(`Meta`),Control:n.includes(`Control`),Alt:n.includes(`Alt`),Shift:n.includes(`Shift`)};if(r.Meta!==e.metaKey||r.Control!==e.ctrlKey||r.Alt!==e.altKey||r.Shift!==e.shiftKey)return!1;let i=t.find(e=>![`⌘`,`Ctrl`,`Control`,`Alt`,`⌥`,`Shift`,`Meta`].includes(LZ(e)));if(!i)return!1;let a=LZ(i);return a.startsWith(`Arrow`)?e.key===a:e.key.toLowerCase()===a.toLowerCase()},zZ=e=>({ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`})[e]||e,BZ=(e,t)=>{let n=e;return t?(n=n.replace(/Ctrl/g,`⌘`),n=n.replace(/Alt/g,`⌥`)):(n=n.replace(/⌘/g,`Ctrl`),n=n.replace(/⌥/g,`Alt`)),n=n.replace(/ArrowUp/g,`↑`),n=n.replace(/ArrowDown/g,`↓`),n=n.replace(/ArrowLeft/g,`←`),n=n.replace(/ArrowRight/g,`→`),n},VZ=({shortcut:e,onTriggered:t,display:n=!0,disabled:r=!1,className:i,size:a=`md`})=>{let{isMac:o}=FZ(),s=IZ(BZ(e,o??!1)),[c,l]=(0,v.useState)(new Set);if((0,v.useEffect)(()=>{let e=e=>{let n=e.target,i=n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable,a=e.key,c=new Set;if(e.metaKey&&c.add(`⌘`),e.ctrlKey&&c.add(`Ctrl`),e.altKey&&c.add(o?`⌥`:`Alt`),e.shiftKey&&c.add(`Shift`),a.startsWith(`Arrow`)?(c.add(a),c.add(zZ(a))):c.add(a.toUpperCase()),l(c),!r&&t&&RZ(e,s)){let n=s.includes(`Escape`);if(i&&!n)return;e.preventDefault(),t()}},n=()=>{l(new Set)};return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,n),window.addEventListener(`blur`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,n),window.removeEventListener(`blur`,n)}},[s,t,o,r]),!n)return null;let u=e=>{let t=e.toUpperCase(),n=LZ(e);return c.has(e)||c.has(t)||c.has(n)||e===`⌘`&&c.has(`Meta`)||e===`Ctrl`&&c.has(`Control`)||e===`⌥`&&c.has(`Alt`)||e===`Alt`&&c.has(`Alt`)||e===`←`&&c.has(`ArrowLeft`)||e===`→`&&c.has(`ArrowRight`)||e===`↑`&&c.has(`ArrowUp`)||e===`↓`&&c.has(`ArrowDown`)};return(0,y.jsx)(`kbd`,{className:W(`inline-flex items-center justify-center gap-0.5 p-0.5`,`rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl`,`font-medium font-sans`,`border-1 border-neutral/20 text-neutral`,a===`sm`&&`text-xs`,a===`md`&&`text-sm`,a===`lg`&&`text-base`,i),children:s.map((t,n)=>{let r=`${t}-${n}-${e}`,i=zZ(t);return(0,y.jsxs)(`span`,{className:`inline-flex items-center`,children:[n>0&&(0,y.jsx)(`span`,{className:`text-neutral/50`,children:`+`}),(0,y.jsx)(`span`,{className:W(`min-w-4 px-0.5 text-center`,u(t)&&`scale-120 font-bold text-text`),suppressHydrationWarning:!0,children:i})]},r)})})},HZ=({children:e,isHidden:t,minWidth:n=0,align:r=`left`,isDisabled:i=!1,className:a,...o})=>{let s=t&&!i;return(0,y.jsx)(`div`,{className:W(`relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-all duration-500 ease-in-out`,s?``:`grid-cols-[1fr]`,a),"aria-hidden":s,inert:s?!0:void 0,...o,children:(0,y.jsx)(`div`,{style:{minWidth:`${n}px`},className:W(r===`right`&&`ml-auto`),children:e})})},UZ=e=>{let t=e.getBoundingClientRect(),n=t.top,r=t.bottom-1;if(n>=0&&r<=window.innerHeight){let n=t.left+t.width/2,r=t.top+10,i=document.elementFromPoint(n,r);return e===i||e.contains(i)}return!1},WZ=({title:e,identifier:t,children:n,header:r,footer:i,closeOnOutsideClick:a=!0,backButton:o,isOpen:s,onClose:c,container:l})=>{let u=dn(`right-drawer`),{isMobile:d}=FZ(`md`),f=(0,v.useRef)(null),p=(0,v.useRef)(null),m=_X(l),{open:h,close:g,isOpen:_}=DZ(),b=_(t),x=b;SX({disableScroll:x,key:t?`right_drawer_${t}`:`right_drawer`}),(0,v.useEffect)(()=>{let e=e=>{try{if(!f.current)return;let n=x&&a,r=e.target&&!f.current.contains(e.target),i=UZ(f.current);(n&&r&&i||!e.target)&&(g(t),c?.())}catch{g(t),c?.()}};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[x,g,c,a,t]);let S=(0,v.useRef)(c);return(0,v.useEffect)(()=>{S.current=c},[c]),(0,v.useEffect)(()=>{s!==void 0&&s!==b&&(s?h(t):(g(t),S.current?.()))},[s,b,t,h,g]),m?(0,Zl.createPortal)((0,y.jsx)(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:(0,y.jsx)(HZ,{isHidden:!x,align:`right`,children:(0,y.jsxs)(ck,{className:`relative flex h-screen w-screen flex-col text-text md:w-100`,ref:f,roundedSize:`none`,children:[(0,y.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[(0,y.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,y.jsx)(`div`,{children:o&&(0,y.jsx)(bO,{variant:`hoverable`,color:`text`,label:o.text??u.goBack.value,onClick:o.onBack,Icon:mf,children:o?.text})}),(0,y.jsx)(`div`,{children:(0,y.jsxs)(TZ,{identifier:`close-drawer`,children:[(0,y.jsx)(bO,{variant:`hoverable`,color:`text`,label:`Close`,className:`ml-auto`,onClick:()=>{g(t),c?.()},Icon:Pf,size:`icon-md`}),(0,y.jsx)(TZ.Detail,{identifier:`close-drawer`,children:(0,y.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[(0,y.jsx)(`span`,{className:`whitespace-nowrap text-neutral text-xs`,children:u.closeDrawer}),(0,y.jsx)(VZ,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{g(t),c?.()}})]})})]})})]}),e&&(0,y.jsx)(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:e}),r]}),(0,y.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:(0,y.jsx)(`div`,{className:`flex flex-1 flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&d&&(g(t),c?.())},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d&&(g(t),c?.()))},ref:p,role:`button`,tabIndex:0,children:n})}),i&&(0,y.jsx)(`div`,{className:`shrink-0`,children:i})]})})}),m):(0,y.jsx)(y.Fragment,{})},GZ=Qd(`w-fit backdrop-blur`,{variants:{roundedSize:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`,xxl:`rounded-2xl`,xxxl:`rounded-3xl`,full:`rounded-full`},color:{primary:`border-primary bg-primary/10 text-primary`,success:`border-success bg-success/10 text-success`,error:`border-error bg-error/10 text-error`,warning:`border-warning bg-warning/10 text-warning`,neutral:`/10 border-neutral bg-neutral/10 text-neutral`,text:`border-text bg-text/10 text-text`,black:`border-black bg-black/10 text-black`,white:`border-white bg-white/10 text-white`},size:{xs:`border-[1.2px] px-2 py-0.5 text-xs`,sm:`border-[1.3px] px-2 py-0.5 text-sm`,md:`border-2 px-2 py-1 text-base`,lg:`border-2 px-3 py-2 text-lg`,xl:`border-2 px-3 py-2 text-xl`},border:{none:`border-none`,with:`border-[1.3px] border-text`},background:{none:`bg-none`,with:``}},defaultVariants:{roundedSize:`full`,border:`none`,color:`text`,size:`md`}}),KZ=({children:e,color:t,roundedSize:n,size:r,border:i,background:a,className:o,...s})=>(0,y.jsx)(`div`,{className:GZ({color:t,roundedSize:n,size:r,border:i,background:a,className:o}),...s,children:e}),qZ=`dictionaryList`,JZ=e=>`dictionary_edition_${e}`,YZ=e=>{let t=(0,V.c)(23),n;t[0]===e?n=t[1]:(n=JZ(e),t[0]=e,t[1]=n);let r=n,{isOpen:i,open:a,close:o}=DZ(),{getEditedContentValue:s}=tT(),{focusedContent:c,setFocusedContent:l}=Zw(),u;t[2]!==c?.dictionaryKey||t[3]!==r||t[4]!==a?(u=()=>{c?.dictionaryKey&&a(r)},t[2]=c?.dictionaryKey,t[3]=r,t[4]=a,t[5]=u):u=t[5];let d=c?.dictionaryKey,f;t[6]!==r||t[7]!==a||t[8]!==d?(f=[d,a,r],t[6]=r,t[7]=a,t[8]=d,t[9]=f):f=t[9],(0,v.useEffect)(u,f);let p;t[10]!==i||t[11]!==r?(p=i(r),t[10]=i,t[11]=r,t[12]=p):p=t[12];let m;t[13]!==o||t[14]!==c||t[15]!==r||t[16]!==l?(m=()=>{o(r),c?.dictionaryKey&&l({...c,keyPath:[]})},t[13]=o,t[14]=c,t[15]=r,t[16]=l,t[17]=m):m=t[17];let h;return t[18]!==c||t[19]!==s||t[20]!==p||t[21]!==m?(h={isOpen:p,focusedContent:c,getEditedContentValue:s,close:m},t[18]=c,t[19]=s,t[20]=p,t[21]=m,t[22]=h):h=t[22],h},XZ=e=>{let t=(0,V.c)(77),{dictionaryKey:n,isDarkMode:r}=e,{backButtonText:i,openDictionaryEditor:a,modalTitle:o,noDictionaryFocused:s,focusedDictionaryNotFound:c}=un(PC),l;t[0]===n?l=t[1]:(l=JZ(n),t[0]=n,t[1]=l);let u=l,{focusedContent:d,close:f}=YZ(n),{setFocusedContent:p}=Zw(),{open:m}=DZ(),h;t[2]===m?h=t[3]:(h=()=>m(qZ),t[2]=m,t[3]=h);let g=h,{data:_}=dO(),b;t[4]!==f||t[5]!==g||t[6]!==p?(b=()=>{f(),p(null),g()},t[4]=f,t[5]=g,t[6]=p,t[7]=b):b=t[7];let x=b,[S,C]=(0,v.useState)(!1),w;t[8]===x?w=t[9]:(w=()=>{C(!1),x()},t[8]=x,t[9]=w);let T=w;if(!d?.dictionaryKey){let e;return t[10]===s?e=t[11]:(e=(0,y.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:s}),t[10]=s,t[11]=e),e}let E,D,O,k,A,j,M,N,P,F;if(t[12]!==i||t[13]!==f||t[14]!==d||t[15]!==c||t[16]!==x||t[17]!==u||t[18]!==a||t[19]!==p||t[20]!==_){A=Symbol.for(`react.early_return_sentinel`);bb0:{if(D=_?.[d.dictionaryKey]?.find(e=>e.localId===d?.dictionaryLocalId),!D){let e;t[31]===c?e=t[32]:(e=(0,y.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:c}),t[31]=c,t[32]=e),A=e;break bb0}E=WZ,F=u,t[33]!==i.value||t[34]!==x?(O={onBack:x,text:i.value},t[33]=i.value,t[34]=x,t[35]=O):O=t[35],t[36]!==f||t[37]!==p?(k=()=>{f(),p(null)},t[36]=f,t[37]=p,t[38]=k):k=t[38];let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>C(!0),t[39]=e):e=t[39];let n;t[40]===a.label.value?n=t[41]:(n=(0,y.jsx)(bO,{variant:`hoverable`,color:`text`,size:`icon-md`,IconRight:Ef,label:a.label.value,onClick:e}),t[40]=a.label.value,t[41]=n);let r;t[42]===a.popoverContent?r=t[43]:(r=(0,y.jsx)(TZ.Detail,{identifier:`open-dictionary-editor`,children:(0,y.jsx)(`span`,{className:`whitespace-nowrap p-2 text-neutral text-xs`,children:a.popoverContent})}),t[42]=a.popoverContent,t[43]=r);let o;t[44]!==n||t[45]!==r?(o=(0,y.jsxs)(TZ,{identifier:`open-dictionary-editor`,children:[n,r]}),t[44]=n,t[45]=r,t[46]=o):o=t[46],P=(0,y.jsxs)(`header`,{className:`mb-5 flex w-full px-3`,children:[(0,y.jsx)(`h3`,{className:`w-full text-center text-lg`,children:D.title?D.title:D.key}),o]}),j=`flex flex-wrap items-center justify-center gap-x-4 gap-y-2 border-text/20 border-b border-dotted pb-3`,M=(0,y.jsx)(KZ,{color:`text`,roundedSize:`full`,size:`xs`,children:D.key}),N=D.filePath&&(0,y.jsx)(KZ,{color:`blue`,roundedSize:`full`,size:`xs`,children:D.filePath.split(`/`).pop()})}t[12]=i,t[13]=f,t[14]=d,t[15]=c,t[16]=x,t[17]=u,t[18]=a,t[19]=p,t[20]=_,t[21]=E,t[22]=D,t[23]=O,t[24]=k,t[25]=A,t[26]=j,t[27]=M,t[28]=N,t[29]=P,t[30]=F}else E=t[21],D=t[22],O=t[23],k=t[24],A=t[25],j=t[26],M=t[27],N=t[28],P=t[29],F=t[30];if(A!==Symbol.for(`react.early_return_sentinel`))return A;let I;t[47]===D.id?I=t[48]:(I=D.id&&(0,y.jsx)(KZ,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`}),t[47]=D.id,t[48]=I);let L;t[49]!==I||t[50]!==j||t[51]!==M||t[52]!==N?(L=(0,y.jsxs)(`div`,{className:j,children:[M,N,I]}),t[49]=I,t[50]=j,t[51]=M,t[52]=N,t[53]=L):L=t[53];let ee;t[54]!==L||t[55]!==P?(ee=(0,y.jsxs)(y.Fragment,{children:[P,L]}),t[54]=L,t[55]=P,t[56]=ee):ee=t[56];let te;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(te=[`local`,`remote`],t[57]=te):te=t[57];let ne;t[58]!==D||t[59]!==x?(ne=(0,y.jsx)(GX,{dictionary:D,mode:te,className:`mb-4 flex-col px-3`,onDelete:x}),t[58]=D,t[59]=x,t[60]=ne):ne=t[60];let R;t[61]!==D||t[62]!==S||t[63]!==d||t[64]!==x||t[65]!==r||t[66]!==o||t[67]!==T?(R=d&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)(WX,{isOpen:S,onClose:()=>C(!1),hasCloseButton:!0,title:o,size:`xl`,transparency:`lg`,className:`h-full`,children:(0,y.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-1 flex-col px-3 pt-5`,children:(0,y.jsx)(bZ,{dictionary:D,onClickDictionaryList:T,isDarkMode:r,mode:[`local`,`remote`],onDelete:()=>{C(!1),x()},onSave:()=>{C(!1)}})})}),(0,y.jsx)(ok,{dictionary:D})]}),t[61]=D,t[62]=S,t[63]=d,t[64]=x,t[65]=r,t[66]=o,t[67]=T,t[68]=R):R=t[68];let z;return t[69]!==E||t[70]!==O||t[71]!==k||t[72]!==ee||t[73]!==ne||t[74]!==R||t[75]!==F?(z=(0,y.jsx)(E,{identifier:F,backButton:O,onClose:k,header:ee,footer:ne,children:R}),t[69]=E,t[70]=O,t[71]=k,t[72]=ee,t[73]=ne,t[74]=R,t[75]=F,t[76]=z):z=t[76],z},ZZ=e=>{let t=(0,V.c)(4),{isDarkMode:n}=e,{focusedContent:r}=Zw(),i=r?.dictionaryKey;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(y.Fragment,{}),t[0]=e):e=t[0],e}let a;return t[1]!==i||t[2]!==n?(a=(0,y.jsx)(XZ,{dictionaryKey:i,isDarkMode:n}),t[1]=i,t[2]=n,t[3]=a):a=t[3],a},QZ={key:`dictionary-list-drawer`,content:{nodeType:`translation`,translation:{en:{drawerTitle:{label:`Dictionary list`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Open dictionary editor {{dictionaryLocalId}}`}}},"en-GB":{drawerTitle:{label:`Dictionary list`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Open dictionary editor {{dictionaryLocalId}}`}}},fr:{drawerTitle:{label:`Liste des dictionnaires`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Ouvrir le dictionnaire dans l'éditeur {{dictionaryLocalId}}`}}},es:{drawerTitle:{label:`Lista de diccionarios`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Abrir el diccionario en el editor {{dictionaryLocalId}}`}}},de:{drawerTitle:{label:`Wörterbuchliste`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Wörterbuch-Editor öffnen {{dictionaryLocalId}}`}}},ja:{drawerTitle:{label:`辞書リスト`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`辞書エディタを開く {{dictionaryLocalId}}`}}},ko:{drawerTitle:{label:`사전 목록`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`사전 편집기 열기 {{dictionaryLocalId}}`}}},zh:{drawerTitle:{label:`字典列表`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`打开字典编辑器 {{dictionaryLocalId}}`}}},it:{drawerTitle:{label:`Lista dei dizionari`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Apri editor dizionario {{dictionaryLocalId}}`}}},pt:{drawerTitle:{label:`Lista de dicionários`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Abrir editor de dicionário {{dictionaryLocalId}}`}}},hi:{drawerTitle:{label:`शब्दकोश सूची`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`शब्दकोश संपादक खोलें {{dictionaryLocalId}}`}}},ar:{drawerTitle:{label:`قائمة القواميس`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`فتح محرر القاموس {{dictionaryLocalId}}`}}},ru:{drawerTitle:{label:`Список словарей`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Открыть редактор словаря {{dictionaryLocalId}}`}}}}},location:`local`,localId:`dictionary-list-drawer::local::client/src/components/Editor/DictionaryListDrawer/dictionaryListDrawer.content.ts`,filePath:`client/src/components/Editor/DictionaryListDrawer/dictionaryListDrawer.content.ts`},$Z=e=>{let{minChars:t=3,debounceMs:n=300,trim:r=!0,defaultValue:i,onSearch:a,onClear:o}=e??{},s=(0,v.useRef)(``),c=(0,v.useRef)(null),[l,u]=(0,v.useState)(i??``),d=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,v.useEffect)(()=>()=>{d()},[]),{setSearch:e=>{s.current=e;let i=r?e.trim():e;if(d(),i.length<t){u(``),o?.();return}c.current=setTimeout(()=>{let e=r?s.current.trim():s.current;e.length>=t?(u(e),a?.(e)):(u(``),o?.())},n)},search:l,hasMinChars:l.length>=t}},eQ=({className:e,...t})=>(0,y.jsxs)(`div`,{className:`relative flex w-full items-center gap-1`,children:[(0,y.jsx)(jf,{className:`absolute left-2 size-4`}),(0,y.jsx)(RO,{...t,type:`search`,className:W(`pl-8`,e)})]}),tQ=()=>{let{drawerTitle:e,buttonLabel:t}=un(QZ),{set:n}=DZ(),{localeDictionaries:r}=qw(),{editedContent:i}=nT(),{setFocusedContent:a}=Zw(),{setSearch:o,search:s}=$Z(),c=(0,v.useMemo)(()=>new sR(Object.values(r),{keys:[`key`,`title`,`filePath`,`description`,`tags`],threshold:.3,includeScore:!0}),[r]),l=(0,v.useMemo)(()=>!s||s.trim()===``?Object.values(r):c.search(s).map(e=>e.item),[s,c,r]),u=e=>{a({dictionaryKey:e.key,dictionaryLocalId:e.localId,keyPath:[]}),n({[qZ]:!1,[JZ(e.key)]:!0})},d=e=>Object.keys(i??{}).includes(e);return(0,y.jsxs)(WZ,{title:e.label.value,identifier:qZ,children:[(0,y.jsx)(`div`,{className:`p-3 pb-4`,children:(0,y.jsx)(eQ,{placeholder:`Search dictionaries`,onChange:e=>o(e.target.value),type:`search`})}),(0,y.jsx)(`ul`,{className:`flex flex-col gap-1`,children:l.map(e=>(0,y.jsx)(`li`,{className:`w-full`,children:(0,y.jsx)(bO,{label:t.label({dictionaryLocalId:e.localId}).value,onClick:()=>u(e),variant:`hoverable`,color:`text`,IconRight:hf,size:`md`,isFullWidth:!0,Icon:d(e.localId)?Df:void 0,children:(0,y.jsx)(`div`,{className:`flex items-center gap-2 py-1`,children:(0,y.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1`,children:[(0,y.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-1.5`,children:[(0,y.jsx)(KZ,{color:`text`,roundedSize:`full`,size:`xs`,children:e.key}),e.filePath&&(0,y.jsx)(KZ,{color:`blue`,roundedSize:`full`,size:`xs`,children:e.filePath.split(`/`).pop()}),e.id&&(0,y.jsx)(KZ,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`})]}),(0,y.jsx)(`span`,{children:(e.title??``).length>0?e.title:e.key})]})})})},e.localId))})]})},nQ={key:`long-press-message`,content:{nodeType:`translation`,translation:{en:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press to edit the "{{dictionaryKey}}" dictionary`}},"en-GB":{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press to edit the "{{dictionaryKey}}" dictionary`}},fr:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press pour éditer le dictionnaire "{{dictionaryKey}}"`}},es:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Presiona largo para editar el diccionario "{{dictionaryKey}}"`}},de:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Lang press für Bearbeitung des Wörterbuchs "{{dictionaryKey}}"`}},ja:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`長押しして編集 "{{dictionaryKey}}" 辞書`}},ko:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`길게 눌러 편집 "{{dictionaryKey}}" 사전`}},zh:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`长按编辑 "{{dictionaryKey}}" 字典`}},it:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Premi a lungo per modificare il dizionario "{{dictionaryKey}}"`}},pt:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Pressione longa para editar o dicionário "{{dictionaryKey}}"`}},hi:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`लंग प्रेस करें टू एडिट "{{dictionaryKey}}"`}},ar:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`اضغط طويلاً للتعديل "{{dictionaryKey}}"`}},ru:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Длительное нажатие для редактирования словаря "{{dictionaryKey}}"`}}}},location:`local`,localId:`long-press-message::local::client/src/components/Editor/LongPressMessage/index.content.ts`,filePath:`client/src/components/Editor/LongPressMessage/index.content.ts`},rQ=()=>{let e=(0,V.c)(8),{message:t}=un(nQ),[n]=Gw(tw.INTLAYER_HOVERED_CONTENT_CHANGED,null),r=n?.dictionaryKey?`opacity-100`:`opacity-0`,i;e[0]===r?i=e[1]:(i=W(`rounded-2xl bg-neutral/30 px-3 py-1 font-bold text-sm text-text transition-opacity duration-100`,r),e[0]=r,e[1]=i);let a;e[2]!==n||e[3]!==t?(a=n?.dictionaryKey?t({dictionaryKey:n.dictionaryKey}):``,e[2]=n,e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==i||e[6]!==a?(o=(0,y.jsx)(`div`,{className:i,children:a}),e[5]=i,e[6]=a,e[7]=o):o=e[7],o},iQ=e=>{let t=(0,V.c)(5),{children:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,y.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:(0,y.jsx)(rQ,{})}),i=(0,y.jsx)(ZZ,{}),a=(0,y.jsx)(tQ,{}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,y.jsxs)(`div`,{className:`relative size-full bg-card p-3`,children:[n,r,i,a]}),t[3]=n,t[4]=o),o},aQ=()=>{let e=(0,V.c)(2),[t,n]=(0,v.useState)(),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{fetch(`/api/config`).then(oQ).then(e=>n(e.data))},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,v.useEffect)(r,i),t};function oQ(e){return e.json()}var sQ=e=>{let t=(0,V.c)(11),{children:n,iframeRef:r}=e,i=aQ(),a=i?.editor.applicationURL;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(_O,{}),t[0]=e):e=t[0],e}let o;t[1]!==a||t[2]!==r?(o=e=>{r.current?.contentWindow?.postMessage(e,a)},t[1]=a,t[2]=r,t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=[a],t[4]=a,t[5]=s);let c;return t[6]!==n||t[7]!==i||t[8]!==o||t[9]!==s?(c=(0,y.jsx)(Qw,{postMessage:o,allowedOrigins:s,configuration:i,children:n}),t[6]=n,t[7]=i,t[8]=o,t[9]=s,t[10]=c):c=t[10],c},cQ={key:`iframe-controller`,content:{nodeType:`translation`,translation:{en:{intlayerApplication:`Intlayer Application`,enableEditor:`Enable Editor`},"en-GB":{intlayerApplication:`Intlayer Application`,enableEditor:`Enable Editor`},fr:{intlayerApplication:`Application Intlayer`,enableEditor:`Activer l'éditeur`},es:{intlayerApplication:`Aplicación Intlayer`,enableEditor:`Activar el editor`},de:{intlayerApplication:`Intlayer-Anwendung`,enableEditor:`Editor aktivieren`},ja:{intlayerApplication:`Intlayerアプリケーション`,enableEditor:`エディタを有効にする`},ko:{intlayerApplication:`Intlayer 애플리케이션`,enableEditor:`에디터 활성화`},zh:{intlayerApplication:`Intlayer 应用程序`,enableEditor:`启用编辑器`},it:{intlayerApplication:`Applicazione Intlayer`,enableEditor:`Abilita l'editor`},pt:{intlayerApplication:`Aplicativo Intlayer`,enableEditor:`Ativar editor`},hi:{intlayerApplication:`इंटलेयर एप्लिकेशन`,enableEditor:`संपादक सक्षम करें`},ar:{intlayerApplication:`تطبيق Intlayer`,enableEditor:`تفعيل المحرر`},ru:{intlayerApplication:`Приложение Intlayer`,enableEditor:`Включить редактор`}}},location:`local`,localId:`iframe-controller::local::client/src/components/Editor/iframeController.content.ts`,filePath:`client/src/components/Editor/iframeController.content.ts`},lQ=()=>{let e=(0,V.c)(9),{editedContent:t,setEditedContentState:n}=nT(),r;e[0]===n?r=e[1]:(r=()=>{let e=localStorage?.getItem(`INTLAYER_EDITED_CONTENT_CHANGED`);if(e)try{let t=JSON.parse(e);n(t)}catch(e){console.error(e)}},e[0]=n,e[1]=r);let i=r,a,o;e[2]===t?(a=e[3],o=e[4]):(a=()=>{t!==void 0&&localStorage?.setItem(`INTLAYER_EDITED_CONTENT_CHANGED`,JSON.stringify(t))},o=[t],e[2]=t,e[3]=a,e[4]=o),(0,v.useEffect)(a,o);let s;e[5]!==t||e[6]!==i?(s=()=>{t===void 0&&i()},e[5]=t,e[6]=i,e[7]=s):s=e[7];let c;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],e[8]=c):c=e[8],(0,v.useEffect)(s,c),i},uQ={key:`no-application-url-view`,content:{nodeType:`translation`,translation:{en:{title:`Your project configuration do not includes application URL`,description:`To use the editor, you need to add the URL of the application to access to the configuration file.`,documentationLink:{label:`Click to go to the editor documentation`,text:`See how to configure the editor`}},"en-GB":{title:`Your project configuration do not includes application URL`,description:`To use the editor, you need to add the URL of the application to access to the configuration file.`,documentationLink:{label:`Click to go to the editor documentation`,text:`See how to configure the editor`}},fr:{title:`Votre configuration de projet ne comprend pas l’URL de l’application`,description:`Pour utiliser l’éditeur, vous devez ajouter l’URL de l’application pour accéder au fichier de configuration.`,documentationLink:{label:`Cliquez ici pour accéder à la documentation de l’éditeur`,text:`Voir comment configurer l’éditeur`}},es:{title:`Su configuración de proyecto no incluye la URL de la aplicación`,description:`Para usar el editor, debe agregar la URL de la aplicación para acceder al archivo de configuración.`,documentationLink:{label:`Haga clic aquí para acceder a la documentación del editor`,text:`Vea cómo configurar el editor`}},de:{title:`Ihre Projektkonfiguration enthält keine Anwendungs-URL`,description:`Um den Editor zu verwenden, müssen Sie die URL der Anwendung hinzufügen, um auf die Konfigurationsdatei zuzugreifen.`,documentationLink:{label:`Klicken Sie hier, um die Editor-Dokumentation zu besuchen`,text:`Siehe, wie man den Editor konfiguriert`}},ja:{title:`あなたのプロジェクト構成にはアプリケーション URL が含まれていません`,description:`エディターを使用するには、アプリケーションの URL を設定ファイルに追加する必要があります。`,documentationLink:{label:`エディターのドキュメントに移動するには、ここをクリックしてください`,text:`エディターの設定方法を見る`}},ko:{title:`당신의 프로젝트 구성에 앱 URL이 포함되어 있지 않습니다.`,description:`에디터를 사용하려면 설정 파일에 앱 URL을 추가해야 합니다.`,documentationLink:{label:`에디터 문서로 이동하려면 여기를 클릭하십시오.`,text:`에디터 설정 방법을 보십시오`}},zh:{title:`您的项目配置未包含应用程序 URL`,description:`要使用编辑器,您需要将应用程序 URL 添加到访问配置文件。`,documentationLink:{label:`点击此处访问编辑器文档`,text:`查看如何配置编辑器`}},it:{title:`La configurazione del progetto non include l’URL dell’applicazione`,description:`Per utilizzare l’editor, è necessario aggiungere l’URL dell’applicazione per accedere al file di configurazione.`,documentationLink:{label:`Fai clic qui per accedere alla documentazione dell’editor`,text:`Vedi come configurare l’editor`}},pt:{title:`Sua configuração do projeto não inclui a URL do aplicativo`,description:`Para usar o editor, você precisa adicionar a URL do aplicativo para acessar o arquivo de configuração.`,documentationLink:{label:`Clique aqui para acessar a documentação do editor`,text:`Veja como configurar o editor`}},hi:{title:`आपके प्रोजेक्ट कॉन्फ़िगरेशन में ऐप का URL शामिल नहीं है`,description:`एडिटर का उपयोग करने के लिए, आपको कॉन्फ़िगरेशन फ़ाइल तक ऐप का URL को जोड़ना होगा।`,documentationLink:{label:`एडिटर को डॉक्यूमेंट पर जाए रखना चाहते हैं?`,text:`एडिटर को काने के बारे में देखें`}},ar:{title:`تم إنشاء مشروعك بدون تضمين عنوان URL التطبيق`,description:`لاستخدام المحرر، يجب عليك إضافة عنوان URL التطبيق للوصول إلى ملف التكوين.`,documentationLink:{label:`انقر هنا للوصول إلى وثائق المحرر`,text:`انظر كيفية تكوين المحرر`}},ru:{title:`Ваша конфигурация проекта не включает URL-адрес приложения`,description:`Чтобы использовать редактор, вам необходимо добавить URL-адрес приложения для доступа к файлу конфигурации.`,documentationLink:{label:`Нажмите, чтобы перейти к документации редактора`,text:`Смотрите, как настроить редактор`}}}},location:`local`,localId:`no-application-url-view::local::client/src/components/Editor/NoApplicationURLView/noApplicationURLView.content.ts`,filePath:`client/src/components/Editor/NoApplicationURLView/noApplicationURLView.content.ts`},dQ=()=>{let e=(0,V.c)(11),{title:t,description:n,documentationLink:r}=un(uQ),i;e[0]===t?i=e[1]:(i=(0,y.jsx)(LX,{className:`mb-8`,children:t}),e[0]=t,e[1]=i);let a;e[2]===n?a=e[3]:(a=(0,y.jsx)(`strong`,{className:`block text-neutral`,children:n}),e[2]=n,e[3]=a);let o;e[4]!==r.label.value||e[5]!==r.text?(o=(0,y.jsx)(DI,{label:r.label.value,href:`https://intlayer.org/doc/concept/configuration#editor-configuration`,color:`text`,variant:`button`,className:`ml-auto`,isExternalLink:!0,children:r.text}),e[4]=r.label.value,e[5]=r.text,e[6]=o):o=e[6];let s;return e[7]!==i||e[8]!==a||e[9]!==o?(s=(0,y.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i,a,o]}),e[7]=i,e[8]=a,e[9]=o,e[10]=s):s=e[10],s},fQ=e=>{let t=(0,V.c)(23),{iframeRef:n,applicationPath:r}=e,i=un(cQ),{editor:a}=eT()??{},{enabled:o}=rT(),s=iT();lQ(),oT();let[c,l]=(0,v.useState)(!0),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={receive:!0,emit:!1},t[0]=u):u=t[0];let[d]=Kw(void 0,u),f,p;if(t[1]===d?(f=t[2],p=t[3]):(f=()=>{typeof d==`string`&&window.history.replaceState({},``,d)},p=[d],t[1]=d,t[2]=f,t[3]=p),(0,v.useEffect)(f,p),!a?.applicationURL){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,y.jsx)(ck,{className:`max-w-xl`,padding:`xl`,roundedSize:`2xl`,children:(0,y.jsx)(dQ,{})}),t[4]=e):e=t[4],e}let m;t[5]===c?m=t[6]:(m=(0,y.jsx)(_O,{isLoading:c}),t[5]=c,t[6]=m);let h=`${a.applicationURL}${r}`,g=i.intlayerApplication.value,_=c&&`hidden`,b;t[7]===_?b=t[8]:(b=W(`size-full`,_),t[7]=_,t[8]=b);let x;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(x=()=>{l(!1)},t[9]=x):x=t[9];let S;t[10]!==i.intlayerApplication.value||t[11]!==n||t[12]!==h||t[13]!==b?(S=(0,y.jsx)(`iframe`,{src:h,title:g,sandbox:`allow-scripts allow-same-origin`,className:b,ref:n,onLoad:x}),t[10]=i.intlayerApplication.value,t[11]=n,t[12]=h,t[13]=b,t[14]=S):S=t[14];let C;t[15]!==i.enableEditor||t[16]!==o||t[17]!==s?(C=!o&&(0,y.jsx)(`div`,{className:`fixed right-4 bottom-4`,children:(0,y.jsx)(bO,{label:i.enableEditor.value,onClick:s,color:`text`,children:i.enableEditor})}),t[15]=i.enableEditor,t[16]=o,t[17]=s,t[18]=C):C=t[18];let w;return t[19]!==S||t[20]!==C||t[21]!==m?(w=(0,y.jsxs)(`div`,{className:`relative size-full overflow-hidden rounded-lg`,children:[m,S,C]}),t[19]=S,t[20]=C,t[21]=m,t[22]=w):w=t[22],w},pQ=()=>{let e=(0,V.c)(2),t=(0,v.useRef)(null),n=Pr(),r;return e[0]===n.pathname?r=e[1]:(r=(0,y.jsx)(sQ,{iframeRef:t,children:(0,y.jsx)(Zt,{disableEditor:!0,children:(0,y.jsx)(iQ,{children:(0,y.jsx)(fQ,{iframeRef:t,applicationPath:n.pathname})})})}),e[0]=n.pathname,e[1]=r),r};(0,qd.createRoot)(document.getElementById(`root`)).render((0,y.jsx)(v.StrictMode,{children:(0,y.jsx)(()=>{let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,y.jsx)(NC,{children:(0,y.jsx)(MC,{children:(0,y.jsx)(pQ,{})})}),e[0]=t):t=e[0],t},{})}));export{bO as A,W as B,CM as C,jk as D,bM as E,ff as F,d as G,dn as H,lf as I,s as K,Qd as L,aO as M,Mf as N,ck as O,pf as P,Zd as R,xM as S,vM as T,ht as U,ga as V,_ as W,Y as _,FX as a,TM as b,RX as c,BV as d,jV as f,DI as g,dV as h,WX as i,_O as j,xO as k,zX as l,yV as m,lZ as n,IX as o,_V as p,XX as r,LX as s,TZ as t,BX as u,SM as v,gM as w,yM as x,_M as y,El as z};
|