intlayer-editor 9.0.0 → 9.0.1
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-A-v61zjd.js → CodeBlockShiki-BiBAnw8S.js} +2 -2
- package/client/dist/assets/{MarkDownRender-Ch7Z1Ufx.js → MarkDownRender-ClxfjWUz.js} +3 -3
- package/client/dist/assets/MarkDownRender-qfMfU2ef.js +1 -0
- package/client/dist/assets/{MarkdownEditor-CHph_zfu.js → MarkdownEditor-BYT_gqLS.js} +1 -1
- package/client/dist/assets/{bundle-web-C9o3DdSr.js → bundle-web-ulFAk5Px.js} +1 -1
- package/client/dist/assets/{dist-D-jIFBiN.js → dist-BGX5GlyW.js} +1 -1
- package/client/dist/assets/{index-DpAqxRJ6.js → index-Dw-eOo2e.js} +7 -7
- package/client/dist/index.html +1 -1
- package/package.json +12 -12
- package/client/dist/assets/MarkDownRender-Bih9GMw2.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkDownRender-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkDownRender-qfMfU2ef.js","assets/MarkDownRender-ClxfjWUz.js","assets/rolldown-runtime-CNC7AqOf.js","assets/react-6C37rxNK.js","assets/MarkdownEditor-BYT_gqLS.js","assets/dist-BGX5GlyW.js","assets/dist-oJho0qAp.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
import{a as e,i as t,n,r,t as i}from"./rolldown-runtime-CNC7AqOf.js";import{t as a}from"./react-6C37rxNK.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),e.crossOrigin===`use-credentials`?t.credentials=`include`:e.crossOrigin===`anonymous`?t.credentials=`omit`:t.credentials=`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var o=i((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}i=void 0}}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}}}})),s=i(((e,t)=>{t.exports=o()})),c=i((e=>{var t=a();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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},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=i,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=i.p;try{if(c.T=null,i.p=2,e)return e()}finally{c.T=t,i.p=n,i.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,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.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),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,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);i.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??i.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);i.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);i.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 i.d.m(e)},e.requestFormReset=function(e){i.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`})),l=i(((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=i((e=>{var t=s(),n=a(),r=l();function i(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 o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(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(c(e)!==e)throw Error(i(188))}function p(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var o=a.alternate;if(o===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===o.child){for(o=a.child;o;){if(o===n)return f(a),e;if(o===r)return f(a),t;o=o.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=o;else{for(var s=!1,l=a.child;l;){if(l===n){s=!0,n=a,r=o;break}if(l===r){s=!0,r=a,n=o;break}l=l.sibling}if(!s){for(l=o.child;l;){if(l===n){s=!0,n=o,r=a;break}if(l===r){s=!0,r=o,n=a;break}l=l.sibling}if(!s)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(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=r.__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
3
|
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
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(`
|
|
@@ -39,9 +39,9 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
39
39
|
.wrapper[data-active] {
|
|
40
40
|
outline-color: inherit;
|
|
41
41
|
}
|
|
42
|
-
`,ww=typeof HTMLElement<`u`?HTMLElement:class{},Tw=class extends ww{_isSelecting=!1;_pressDuration=Sw;_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=Cw,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?Sw: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()}},Ew=()=>{typeof customElements>`u`||(customElements.get(`intlayer-content-selector`)||customElements.define(`intlayer-content-selector`,Tw),ZC(),ew(),xw())},Dw=()=>{let e=typeof window<`u`?window.location.origin:void 0;return{allowedOrigins:[...new Set([g?.editorURL,g?.cmsURL,e].filter(Boolean))],postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&window.parent?.postMessage(e,t)}}},Ow=0,kw=()=>{Ow++;let e=KC();if(e)return e;let t=new vw({mode:`client`,messenger:Dw(),configuration:{editor:g}});return qC(t),Ew(),t.start(),t},Aw=()=>{Ow=Math.max(0,Ow-1),!(Ow>0)&&(KC()?.stop(),qC(null))},jw=(e,t,n)=>{let r=LC(),i=typeof t==`function`?t():t,[a,o]=(0,b.useState)(i),s=(0,b.useRef)(i),c=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let{emit:t=!0,receive:a=!0}=n??{},l=new rw(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()}]},Mw=(e,t)=>jw(VC.INTLAYER_URL_CHANGE,e,t),Nw=()=>{let e=(0,V.c)(13),t=LC(),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,b.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,b.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},Pw=()=>{let e=(0,V.c)(3),{setLocaleDictionaries:t,setLocaleDictionary:n}=Nw(),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},Fw=()=>{let e=(0,V.c)(3),t=LC(),[n,r]=(0,b.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,b.useEffect)(i,a),n},Iw=(e,t,n)=>{for(let r of t)try{if(Jt(r.content,e??[],n))return{keyPath:e,dictionaryLocalId:r.localId}}catch{}},Lw=()=>{let e=(0,V.c)(12),{localeDictionaries:t}=Nw(),n=Fw(),{setFocusedContent:r,setFocusedContentKeyPath:i,focusedContent:a}=zC(),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=Iw(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},Rw=({children:e,configuration:t,postMessage:n,allowedOrigins:r})=>{let i=(0,b.useRef)(null);i.current||=new vw({mode:`editor`,messenger:{allowedOrigins:r,postMessageFn:n},configuration:t});let a=i.current;return(0,b.useEffect)(()=>(Ew(),qC(a),a.start(),()=>{a.stop(),qC(null)}),[a]),(0,b.useEffect)(()=>{!a||!t||Object.keys(t).length===0||a.configuration.set(t)},[a,t]),(0,x.jsx)(IC,{manager:a,children:e})},zw=(0,b.createContext)(void 0),Bw=()=>{let e=(0,V.c)(4),t=LC(),n=(0,b.useContext)(zw),[r,i]=(0,b.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,b.useEffect)(a,o),r??n},Vw=()=>{let e=(0,V.c)(23),t=LC(),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},Hw=()=>{let e=(0,V.c)(6),t=LC(),[n,r]=(0,b.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,b.useEffect)(i,a);let o=Vw(),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},Uw=()=>{let e=(0,V.c)(5),t=LC(),[n,r]=(0,b.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,b.useEffect)(i,a);let o;return e[3]===n?o=e[4]:(o={enabled:n},e[3]=n,e[4]=o),o},Ww=()=>{let e=(0,V.c)(2),t=LC(),n;return e[0]===t?n=e[1]:(n=()=>t?.pingClient(),e[0]=t,e[1]=n),n},Gw=(e,t,n)=>{let r=(0,V.c)(11),i=LC(),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,b.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},Kw=()=>{Gw(VC.INTLAYER_IFRAME_CLICKED,HC)},qw=e=>{let t=(0,V.c)(7),n=kC(e,Bw(),{editor:g}),r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`oAuth2AccessToken`],t[0]=r):r=t[0];let i=TC(void 0,n),a=!!(n.editor.clientId&&n.editor.clientSecret),o;t[1]!==r||t[2]!==i.getOAuth2AccessToken||t[3]!==a?(o={queryKey:r,queryFn:i.getOAuth2AccessToken,enabled:a,staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1},t[1]=r,t[2]=i.getOAuth2AccessToken,t[3]=a,t[4]=o):o=t[4];let{data:s}=ls(o),c=s?.data,l;return t[5]===c?l=t[6]:(l={oAuth2AccessToken:c},t[5]=c,t[6]=l),l};function Jw(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}var Yw=Jw({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`}),Xw=`1.6.23`;function Zw(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 Qw(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 $w(){return eT.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var eT={stubThis:e=>e};function tT(e){let{id:t}=e;return{...e,id:Qw(t),transports:e.transports}}function nT(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 rT=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 iT({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 rT({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 rT({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 rT({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 rT({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 rT({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new rT({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 rT({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new rT({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(!nT(t))return new rT({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new rT({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 rT({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 rT({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 aT=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}}},oT=[`cross-platform`,`platform`];function sT(e){if(e&&!(oT.indexOf(e)<0))return e}async function cT(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(!$w())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:Qw(t.challenge),user:{...t.user,id:Qw(t.user.id)},excludeCredentials:t.excludeCredentials?.map(tT)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=aT.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw iT({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){lT(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=Zw(e))}catch(e){lT(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=Zw(c.getAuthenticatorData())}catch(e){lT(`getAuthenticatorData()`,e)}return{id:o,rawId:Zw(s),response:{attestationObject:Zw(c.attestationObject),clientDataJSON:Zw(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:sT(a.authenticatorAttachment)}}function lT(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 uT(){if(!$w())return dT.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?dT.stubThis(new Promise(e=>e(!1))):dT.stubThis(e.isConditionalMediationAvailable())}var dT={stubThis:e=>e};function fT({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 rT({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new rT({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!nT(t))return new rT({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new rT({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 rT({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 pT(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(!$w())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(tT));let a={...t,challenge:Qw(t.challenge),allowCredentials:i},o={};if(n){if(!await uT())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=aT.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw fT({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=Zw(u.userHandle)),{id:c,rawId:Zw(l),response:{authenticatorData:Zw(u.authenticatorData),clientDataJSON:Zw(u.clientDataJSON),signature:Zw(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:sT(s.authenticatorAttachment)}}var mT=`1.6.23`,hT=Symbol.for(`better-auth:broadcast-channel`),gT=()=>Math.floor(Date.now()/1e3),_T=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:gT()}))}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 vT(e=`better-auth.message`){return globalThis[hT]||(globalThis[hT]=new _T(e)),globalThis[hT]}var yT=[],bT=0,xT=4,ST=globalThis.nanostoresGlobal||={epoch:0},CT=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=bT+xT;t<yT.length;)yT[t]===e?yT.splice(t,xT):t+=xT;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){ST.epoch++;let i=!yT.length;for(let i of t)yT.push(i,n.value,e,r);if(i){for(bT=0;bT<yT.length;bT+=xT)yT[bT](yT[bT+1],yT[bT+2],yT[bT+3]);yT.length=0}},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},wT=2,TT=5,ET=6,DT=10,OT=(e,t,n,r)=>(e.events=e.events||{},e.events[n+DT]||(e.events[n+DT]=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+DT](),delete e.events[n+DT])}),kT=(e,t)=>OT(e,t,wT,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}}),AT=1e3,jT=(e,t)=>OT(e,n=>{let r=t(n);r&&e.events[ET].push(r)},TT,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[ET]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[ET])t();e.events[ET]=[]}},AT)},()=>{e.listen=n,e.off=r}});function MT(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function NT(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(!NT(e[n],t[n]))return!1;return!0}if(MT(e)&&MT(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)||!NT(e[r],t[r]))return!1;return!0}return!1}function PT(e,t){return kT(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var FT=Symbol.for(`better-auth:focus-manager`),IT=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 LT(){return globalThis[FT]||(globalThis[FT]=new IT),globalThis[FT]}var RT=Symbol.for(`better-auth:online-manager`),zT=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 BT(){return globalThis[RT]||(globalThis[RT]=new zT),globalThis[RT]}var VT={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*:/},HT=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,UT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},WT=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function GT(e){return e instanceof Date&&!isNaN(e.getTime())}function KT(e){let t=WT.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 GT(f)?f:null}function qT(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 UT)return UT[s];if(!HT.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(VT).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=KT(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function JT(e,t={strict:!0}){return qT(e,t)}var YT=()=>typeof window>`u`;function XT(e,t){return NT(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var ZT=(e,t,n,r)=>{let i=CT({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)});PT(i,XT);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&&NT(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=[];for(let t of e){let e=t.subscribe(async()=>{YT()||(o?await a():jT(i,()=>{let e=setTimeout(async()=>{o||(o=!0,await a())},0);return()=>{for(let e of s)e();clearTimeout(e)}}))});s.push(e)}return i},QT=()=>Math.floor(Date.now()/1e3),$T=5;function eE(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||BT().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=QT(),t();return}if(e?.event===`visibilitychange`){if(QT()-c.lastSessionRequest<$T)return;c.lastSessionRequest=QT(),t();return}t()}},d=e=>{vT().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=vT().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=LT().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=BT().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=vT().setup(),c.cleanupFocusSetup=LT().setup(),c.cleanupOnlineSetup=BT().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 tE=Object.create(null),nE=e=>({}),rE=new Proxy(tE,{get(e,t){return nE()[t]??tE[t]},has(e,t){return t in nE()||t in tE},set(e,t,n){let r=nE(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=nE(!0);return delete n[t],!0},ownKeys(){let e=nE(!0);return Object.keys(e)}});rE.NODE_ENV;function iE(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 iE(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return iE(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return iE(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return iE(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return iE(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return iE(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return iE(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function aE(){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 oE(e){let t=e.split(`
|
|
42
|
+
`,ww=typeof HTMLElement<`u`?HTMLElement:class{},Tw=class extends ww{_isSelecting=!1;_pressDuration=Sw;_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=Cw,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?Sw: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()}},Ew=()=>{typeof customElements>`u`||(customElements.get(`intlayer-content-selector`)||customElements.define(`intlayer-content-selector`,Tw),ZC(),ew(),xw())},Dw=()=>{let e=typeof window<`u`?window.location.origin:void 0;return{allowedOrigins:[...new Set([g?.editorURL,g?.cmsURL,e].filter(Boolean))],postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&window.parent?.postMessage(e,t)}}},Ow=0,kw=()=>{Ow++;let e=KC();if(e)return e;let t=new vw({mode:`client`,messenger:Dw(),configuration:{editor:g}});return qC(t),Ew(),t.start(),t},Aw=()=>{Ow=Math.max(0,Ow-1),!(Ow>0)&&(KC()?.stop(),qC(null))},jw=(e,t,n)=>{let r=LC(),i=typeof t==`function`?t():t,[a,o]=(0,b.useState)(i),s=(0,b.useRef)(i),c=(0,b.useRef)(null);return(0,b.useEffect)(()=>{let{emit:t=!0,receive:a=!0}=n??{},l=new rw(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()}]},Mw=(e,t)=>jw(VC.INTLAYER_URL_CHANGE,e,t),Nw=()=>{let e=(0,V.c)(13),t=LC(),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,b.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,b.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},Pw=()=>{let e=(0,V.c)(3),{setLocaleDictionaries:t,setLocaleDictionary:n}=Nw(),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},Fw=()=>{let e=(0,V.c)(3),t=LC(),[n,r]=(0,b.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,b.useEffect)(i,a),n},Iw=(e,t,n)=>{for(let r of t)try{if(Jt(r.content,e??[],n))return{keyPath:e,dictionaryLocalId:r.localId}}catch{}},Lw=()=>{let e=(0,V.c)(12),{localeDictionaries:t}=Nw(),n=Fw(),{setFocusedContent:r,setFocusedContentKeyPath:i,focusedContent:a}=zC(),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=Iw(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},Rw=({children:e,configuration:t,postMessage:n,allowedOrigins:r})=>{let i=(0,b.useRef)(null);i.current||=new vw({mode:`editor`,messenger:{allowedOrigins:r,postMessageFn:n},configuration:t});let a=i.current;return(0,b.useEffect)(()=>(Ew(),qC(a),a.start(),()=>{a.stop(),qC(null)}),[a]),(0,b.useEffect)(()=>{!a||!t||Object.keys(t).length===0||a.configuration.set(t)},[a,t]),(0,x.jsx)(IC,{manager:a,children:e})},zw=(0,b.createContext)(void 0),Bw=()=>{let e=(0,V.c)(4),t=LC(),n=(0,b.useContext)(zw),[r,i]=(0,b.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,b.useEffect)(a,o),r??n},Vw=()=>{let e=(0,V.c)(23),t=LC(),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},Hw=()=>{let e=(0,V.c)(6),t=LC(),[n,r]=(0,b.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,b.useEffect)(i,a);let o=Vw(),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},Uw=()=>{let e=(0,V.c)(5),t=LC(),[n,r]=(0,b.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,b.useEffect)(i,a);let o;return e[3]===n?o=e[4]:(o={enabled:n},e[3]=n,e[4]=o),o},Ww=()=>{let e=(0,V.c)(2),t=LC(),n;return e[0]===t?n=e[1]:(n=()=>t?.pingClient(),e[0]=t,e[1]=n),n},Gw=(e,t,n)=>{let r=(0,V.c)(11),i=LC(),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,b.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},Kw=()=>{Gw(VC.INTLAYER_IFRAME_CLICKED,HC)},qw=e=>{let t=(0,V.c)(7),n=kC(e,Bw(),{editor:g}),r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=[`oAuth2AccessToken`],t[0]=r):r=t[0];let i=TC(void 0,n),a=!!(n.editor.clientId&&n.editor.clientSecret),o;t[1]!==r||t[2]!==i.getOAuth2AccessToken||t[3]!==a?(o={queryKey:r,queryFn:i.getOAuth2AccessToken,enabled:a,staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1},t[1]=r,t[2]=i.getOAuth2AccessToken,t[3]=a,t[4]=o):o=t[4];let{data:s}=ls(o),c=s?.data,l;return t[5]===c?l=t[6]:(l={oAuth2AccessToken:c},t[5]=c,t[6]=l),l};function Jw(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}var Yw=Jw({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`}),Xw=`1.6.24`;function Zw(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 Qw(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 $w(){return eT.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var eT={stubThis:e=>e};function tT(e){let{id:t}=e;return{...e,id:Qw(t),transports:e.transports}}function nT(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 rT=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 iT({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 rT({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 rT({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 rT({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 rT({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 rT({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new rT({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 rT({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new rT({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(!nT(t))return new rT({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new rT({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 rT({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 rT({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 aT=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}}},oT=[`cross-platform`,`platform`];function sT(e){if(e&&!(oT.indexOf(e)<0))return e}async function cT(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(!$w())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:Qw(t.challenge),user:{...t.user,id:Qw(t.user.id)},excludeCredentials:t.excludeCredentials?.map(tT)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=aT.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw iT({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){lT(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=Zw(e))}catch(e){lT(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=Zw(c.getAuthenticatorData())}catch(e){lT(`getAuthenticatorData()`,e)}return{id:o,rawId:Zw(s),response:{attestationObject:Zw(c.attestationObject),clientDataJSON:Zw(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:sT(a.authenticatorAttachment)}}function lT(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 uT(){if(!$w())return dT.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?dT.stubThis(new Promise(e=>e(!1))):dT.stubThis(e.isConditionalMediationAvailable())}var dT={stubThis:e=>e};function fT({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 rT({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new rT({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!nT(t))return new rT({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new rT({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 rT({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 pT(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(!$w())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(tT));let a={...t,challenge:Qw(t.challenge),allowCredentials:i},o={};if(n){if(!await uT())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=aT.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw fT({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=Zw(u.userHandle)),{id:c,rawId:Zw(l),response:{authenticatorData:Zw(u.authenticatorData),clientDataJSON:Zw(u.clientDataJSON),signature:Zw(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:sT(s.authenticatorAttachment)}}var mT=`1.6.24`,hT=Symbol.for(`better-auth:broadcast-channel`),gT=()=>Math.floor(Date.now()/1e3),_T=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:gT()}))}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 vT(e=`better-auth.message`){return globalThis[hT]||(globalThis[hT]=new _T(e)),globalThis[hT]}var yT=[],bT=0,xT=4,ST=globalThis.nanostoresGlobal||={epoch:0},CT=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=bT+xT;t<yT.length;)yT[t]===e?yT.splice(t,xT):t+=xT;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){ST.epoch++;let i=!yT.length;for(let i of t)yT.push(i,n.value,e,r);if(i){for(bT=0;bT<yT.length;bT+=xT)yT[bT](yT[bT+1],yT[bT+2],yT[bT+3]);yT.length=0}},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},wT=2,TT=5,ET=6,DT=10,OT=(e,t,n,r)=>(e.events=e.events||{},e.events[n+DT]||(e.events[n+DT]=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+DT](),delete e.events[n+DT])}),kT=(e,t)=>OT(e,t,wT,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}}),AT=1e3,jT=(e,t)=>OT(e,n=>{let r=t(n);r&&e.events[ET].push(r)},TT,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[ET]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[ET])t();e.events[ET]=[]}},AT)},()=>{e.listen=n,e.off=r}});function MT(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function NT(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(!NT(e[n],t[n]))return!1;return!0}if(MT(e)&&MT(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)||!NT(e[r],t[r]))return!1;return!0}return!1}function PT(e,t){return kT(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var FT=Symbol.for(`better-auth:focus-manager`),IT=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 LT(){return globalThis[FT]||(globalThis[FT]=new IT),globalThis[FT]}var RT=Symbol.for(`better-auth:online-manager`),zT=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 BT(){return globalThis[RT]||(globalThis[RT]=new zT),globalThis[RT]}var VT={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*:/},HT=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,UT={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},WT=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function GT(e){return e instanceof Date&&!isNaN(e.getTime())}function KT(e){let t=WT.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 GT(f)?f:null}function qT(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 UT)return UT[s];if(!HT.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(VT).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=KT(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function JT(e,t={strict:!0}){return qT(e,t)}var YT=()=>typeof window>`u`;function XT(e,t){return NT(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var ZT=(e,t,n,r)=>{let i=CT({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)});PT(i,XT);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&&NT(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 jT(i,()=>{if(YT())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},QT=()=>Math.floor(Date.now()/1e3),$T=5;function eE(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||BT().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=QT(),t();return}if(e?.event===`visibilitychange`){if(QT()-c.lastSessionRequest<$T)return;c.lastSessionRequest=QT(),t();return}t()}},d=e=>{vT().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=vT().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=LT().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=BT().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=vT().setup(),c.cleanupFocusSetup=LT().setup(),c.cleanupOnlineSetup=BT().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 tE=Object.create(null),nE=e=>({}),rE=new Proxy(tE,{get(e,t){return nE()[t]??tE[t]},has(e,t){return t in nE()||t in tE},set(e,t,n){let r=nE(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=nE(!0);return delete n[t],!0},ownKeys(){let e=nE(!0);return Object.keys(e)}});rE.NODE_ENV;function iE(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 iE(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return iE(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return iE(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return iE(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return iE(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return iE(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return iE(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function aE(){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 oE(e){let t=e.split(`
|
|
43
43
|
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
44
|
-
at `))}function sE(e,t){class n extends e{#e;constructor(...e){if(aE()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=oE(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 cE={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};sE(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:cE[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 lE=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},uE=47;function dE(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===uE;)t--;return t===e.length?e:e.slice(0,t)}function fE(e){try{return(dE(new URL(e).pathname)||`/`)!==`/`}catch{throw new lE(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function pE(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new lE(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof lE?t:new lE(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function mE(e,t=`/api/auth`){if(pE(e),fE(e))return e;let n=dE(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function hE(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 gE(e,t,n,r,i){if(e)return mE(e,t);if(r!==!1){let e=rE.BETTER_AUTH_URL||rE.NEXT_PUBLIC_BETTER_AUTH_URL||rE.PUBLIC_BETTER_AUTH_URL||rE.NUXT_PUBLIC_BETTER_AUTH_URL||rE.NUXT_PUBLIC_AUTH_URL||(rE.BASE_URL===`/`?void 0:rE.BASE_URL);if(e)return mE(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&hE(o,`proto`)&&hE(a,`host`))try{return mE(`${o}://${a}`,t)}catch{}if(n){let e=_E(n.url);if(!e)throw new lE(`Could not get origin from request. Please provide a valid base URL.`);return mE(e,t)}if(typeof window<`u`&&window.location)return mE(window.location.origin,t)}function _E(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var vE=[`javascript:`,`data:`,`vbscript:`];function yE(e){let t;try{t=new URL(e)}catch{return!0}return!vE.includes(t.protocol)}var bE={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&yE(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},xE=()=>typeof window>`u`;function SE(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function CE(e){return!e||e.session===null&&e.user===null?null:e}function wE(e,t){return NT(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function TE(e,t){let n=CT(!1),r,i=e=>s(e),a=CT({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});PT(a,wE);let o=e=>{if(r!==e)return;let t=a.get();r=void 0,!(!t.isPending&&!t.isRefetching)&&a.set({...t,isPending:!1,isRefetching:!1,refetch:i})},s=async t=>{r?.abort();let n=new AbortController;r=n;let s=a.get();a.set({...s,isPending:s.data===null,isRefetching:!0,error:null,refetch:i});try{let r=await e(`/get-session`,{method:`GET`,query:t?.query,signal:n.signal});if(n.signal.aborted){o(n);return}let{data:s,error:c}=SE(r);if(s?.needsRefresh)try{let t=await e(`/get-session`,{method:`POST`,signal:n.signal});if(n.signal.aborted){o(n);return}({data:s,error:c}=SE(t))}catch{if(n.signal.aborted){o(n);return}}if(c){let e=a.get(),t=c?.status===401;a.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:i});return}let l=CE(s),u=a.get(),d=u.data!=null&&l!=null&&NT(u.data,l)?u.data:l;a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(n.signal.aborted){o(n);return}let t=a.get();a.set({data:t.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},c=()=>{};return jT(a,()=>{let e;xE()||(e=setTimeout(()=>{s()},0));let i=eE({fetchSession:s,shouldPollSession:()=>a.get().data!=null,sessionSignal:n,options:t});return i.init(),c=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&o(t),i.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>c(e)}}var EE=Object.defineProperty,DE=Object.defineProperties,OE=Object.getOwnPropertyDescriptors,kE=Object.getOwnPropertySymbols,AE=Object.prototype.hasOwnProperty,jE=Object.prototype.propertyIsEnumerable,ME=(e,t,n)=>t in e?EE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NE=(e,t)=>{for(var n in t||={})AE.call(t,n)&&ME(e,n,t[n]);if(kE)for(var n of kE(t))jE.call(t,n)&&ME(e,n,t[n]);return e},PE=(e,t)=>DE(e,OE(t)),FE=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)}},IE=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}},LE=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}},RE=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 zE(e){if(typeof e==`number`)return new LE({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new LE(e);case`exponential`:return new RE(e);default:throw Error(`Invalid retry strategy`)}}var BE=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},VE=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function HE(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 VE.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function UE(e){try{return JSON.parse(e),!0}catch{return!1}}function WE(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 GE(e){try{return JSON.parse(e)}catch{return e}}function KE(e){return typeof e==`function`}function qE(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&KE(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&KE(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function JE(...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 YE(e){let t=new Headers(JE(e?.headers,await BE(e)));if(!t.has(`content-type`)){let n=XE(e?.body);n&&t.set(`content-type`,n)}return t}function XE(e){return WE(e)?`application/json`:null}function ZE(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function QE(e,t){let{body:n}=e;return n?!WE(n)||typeof n==`string`?n:ZE(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function $E(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return rD.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function eD(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var tD=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function nD(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new tD(n.issues);return n.value}var rD=[`get`,`post`,`put`,`patch`,`delete`],iD=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 nD(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=PE(NE({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=PE(NE({},r),{body:i.input?await nD(i.input,n?.body):n?.body,params:i.params?await nD(i.params,n?.params):n?.params,query:i.query?await nD(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),aD=e=>{async function t(t,n){let r=PE(NE(NE({},e),n),{headers:JE(e?.headers,n?.headers),plugins:[...e?.plugins||[],iD(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await lD(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 lD(t,r)}return t},oD=e=>e===`.`||e===`..`;function sD(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(oD(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function cD(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];rD.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=>sD(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 lD=async(e,t)=>{let{hooks:n,url:r,options:i}=await IE(e,t),a=qE(i),o=new AbortController,s=i.signal??o.signal,c=cD(r,i),l=await YE(i),u=QE(i,l),d=$E(r,i),f=PE(NE({},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}=eD(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(PE(NE({},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=HE(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??GE)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await nD(f.output,r.data));for(let e of n.onSuccess)e&&await e(PE(NE({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??GE,_=await m.text(),v=UE(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:PE(NE({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(PE(NE({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=zE(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 lD(e,PE(NE({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new FE(m.status,m.statusText,v?y:_);return{data:null,error:PE(NE({},y),{status:m.status,statusText:m.statusText})}},uD=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=gE(e?.baseURL,e?.basePath,void 0,t)??uD(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=aD({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?JT(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[bE],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=TE(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=kC(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function fD(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function pD(e){return e.charAt(0).toUpperCase()+e.slice(1)}var mD=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,hD=/['\u2019]/g;function gD(e){return e.replace(hD,``).match(mD)??[]}function _D(e){return gD(e).map(e=>e.toLowerCase()).join(`-`)}function vD(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 yD(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`||fD(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(_D).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=vD(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 bD(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${pD(e)}`]=t;return yD({...n,...s,$fetch:i,$store:o},i,t,r,a)}var xD=(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 pT({optionsJSON:{...a.data,extensions:o},useBrowserAutofill:r?.autoFill})}catch(e){return{data:null,error:{code:e instanceof rT?e.code:`AUTH_CANCELLED`,message:Yw.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:Yw.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 cT({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 rT?e.code===`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`?{data:null,error:{code:e.code,message:Yw.PREVIOUSLY_REGISTERED.message,status:400,statusText:`BAD_REQUEST`}}:e.code===`ERROR_CEREMONY_ABORTED`?{data:null,error:{code:e.code,message:Yw.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:Yw.UNKNOWN_ERROR.message,status:500,statusText:`INTERNAL_SERVER_ERROR`}}}}},$Infer:{}}),SD=()=>{let e=CT();return{id:`passkey`,version:Xw,$InferServerPlugin:{},getActions:(t,n)=>xD(t,{$listPasskeys:e,$store:n}),getAtoms(t){return{listPasskeys:ZT(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:Yw}},CD=`1.6.23`,wD=e=>({id:`sso-client`,version:CD,$InferServerPlugin:{},pathMethods:{"/sso/providers":`GET`,"/sso/get-provider":`GET`}}),TD=()=>({id:`magic-link`,version:mT,$InferServerPlugin:{}}),ED=Jw({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`}),DD=e=>({id:`two-factor`,version:mT,$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`&&yE(e.twoFactorPage)&&(window.location.href=e.twoFactorPage)}}}}],$ERROR_CODES:ED}),OD=e=>bD({baseURL:e,withCredentials:!0,plugins:[DD({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}}),SD(),TD(),wD()]}),kD=e=>{let t=e?.editor?.backendURL??g?.backendURL;t||(t=Nt,console.error(`Backend URL is not defined in the Intlayer configuration.`));let n=OD(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})}},AD=(e,t)=>{let n=(0,V.c)(17),r=Bw(),i;n[0]!==r||n[1]!==t?(i=t??r??{editor:g},n[0]=r,n[1]=t,n[2]=i):i=n[2];let a=i,o=qo(),s;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`session`],n[3]=s):s=n[3];let c;n[4]===a?c=n[5]:(c=async()=>(await kD(a).getSession()).data,n[4]=a,n[5]=c);let l=!e,u;n[6]!==c||n[7]!==l?(u={queryKey:s,queryFn:c,staleTime:3e5,gcTime:18e5,refetchInterval:6e5,refetchIntervalInBackground:!1,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:!0,enabled:l},n[6]=c,n[7]=l,n[8]=u):u=n[8];let{data:d,isFetched:f,refetch:p}=ls(u),m=d??(f?null:void 0),h;n[9]===o?h=n[10]:(h=e=>{o.setQueryData([`session`],e)},n[9]=o,n[10]=h);let _=h,v;n[11]===p?v=n[12]:(v=async()=>(await p()).data,n[11]=p,n[12]=v);let y=v,b;return n[13]!==y||n[14]!==m||n[15]!==_?(b={session:m,fetchSession:y,revalidateSession:y,setSession:_},n[13]=y,n[14]=m,n[15]=_,n[16]=b):b=n[16],b},jD=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}=AD(r,i),{oAuth2AccessToken:l}=qw(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},MD=e=>{let t=(0,V.c)(10),n=Bw(),{oAuth2AccessToken:r}=jD(),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},ND=e=>{let t=(0,V.c)(2),n=Bw(),r=e?.intlayerConfiguration??n,i;return t[0]===r?i=t[1]:(i=kD(r),t[0]=r,t[1]=i),i},PD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=NC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},FD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(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},ID=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=AC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},LD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=PC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},RD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=MC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},zD=e=>{let t=(0,V.c)(4),{requireUser:n,requireProject:r,requireOrganization:i}=e,a=Bw(),o;t[0]===a?o=t[1]:(o={intlayerConfiguration:a},t[0]=a,t[1]=o);let{oAuth2AccessToken:s,session:c}=jD(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},BD=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}=zD(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],ls(l)},VD=()=>{let e=(0,V.c)(3),t=ID(),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),us(r)},HD=()=>{let e=(0,V.c)(3),t=ID(),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),us(r)},UD=()=>{let e=(0,V.c)(3),t=ID(),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),us(r)},WD=[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]],GD=()=>{let e=(0,V.c)(8),t=ND(),n=qo(),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=()=>{WD.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],us(o)},KD=(e,t)=>{let n=(0,V.c)(9),r=FD(),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],BD(o)},qD=()=>{let e=(0,V.c)(6),t=FD(),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),us(a)},JD=()=>{let e=(0,V.c)(6),t=FD(),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),us(a)},YD=()=>{let e=(0,V.c)(3),t=RD(),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),ls(r)},XD=()=>{let e=(0,V.c)(3),t=RD(),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),us(r)},ZD=(e,t)=>{let n=(0,V.c)(9),r=PD(),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],BD(o)},QD=(e,t)=>{let n=(0,V.c)(9),r=LD(),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],BD(o)},$D=()=>{let e=(0,V.c)(9),{session:t,revalidateSession:n,setSession:r}=jD(),{mutate:i}=GD(),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},eO=({className:e,strokeWidth:t=4})=>(0,x.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,x.jsxs)(`g`,{fill:`none`,fillRule:`evenodd`,strokeWidth:t,children:[(0,x.jsxs)(`circle`,{cx:`22`,cy:`22`,r:`1`,children:[(0,x.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,x.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,x.jsxs)(`circle`,{cx:`22`,cy:`22`,r:`1`,children:[(0,x.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,x.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`})]})]})}),tO=({children:e,isLoading:t=!0,keepChildren:n=!1,className:r,...i})=>(0,x.jsx)(x.Fragment,{children:t&&n?(0,x.jsxs)(`div`,{className:`relative size-full`,children:[(0,x.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,x.jsx)(eO,{className:`size-10 max-h-full max-w-full`})}),e]}):t?(0,x.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,x.jsx)(eO,{className:`size-10 max-h-full max-w-full`})}):e??(0,x.jsx)(x.Fragment,{})}),nO=Fd(`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`}}),rO=Fd(`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}}),iO=({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":y,"aria-pressed":b,...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":y,"aria-pressed":c===void 0?b: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,x.jsxs)(`button`,{disabled:s||p,role:C?`link`:`button`,type:g,className:rO({variant:e,size:t,color:n,isFullWidth:u,roundedSize:d,textAlign:f??(a?`left`:`center`),className:h}),...T,...S,children:[i&&!s&&(0,x.jsx)(i,{className:nO({size:t,className:W(!E&&`mr-3`,o)}),"aria-hidden":`true`}),(0,x.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,x.jsx)(tO,{className:nO({size:t,className:W(!E&&`mr-3`,o)}),isLoading:s,"aria-hidden":`true`,"data-testid":`loader`})}),r&&(0,x.jsx)(`span`,{className:`flex-1 truncate whitespace-nowrap`,children:r}),!r&&w&&(0,x.jsx)(`span`,{className:`sr-only`,children:m}),a&&(0,x.jsx)(a,{className:nO({size:t,className:W(!E&&`ml-3`,o)}),"aria-hidden":`true`})]})},aO=({children:e,isHidden:t,className:n=``,isOverable:r=!1,isFocusable:i=!1,minHeight:a=0,...o})=>(0,x.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,x.jsx)(`div`,{style:{minHeight:`${a}px`},className:W(r&&`group-hover/height-smoother:visible`,i&&`group-focus/height-smoother:visible`,n),children:e})}),oO=({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,b.useState)(r),h=(0,b.useId)(),g=f?n:p,_=!g,v=l??`${h}-accordion-content`,y=e=>{if(o)return;let t=!g;f||m(t),i?.(t),a?.(e)};return(0,x.jsxs)(`div`,{className:`w-full`,children:[(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,onClick:y,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y(e))},disabled:o,isFullWidth:!0,className:W(`flex items-center justify-between gap-2`,c),IconRight:Yd,iconClassName:W(`transform transition-transform duration-500 ease-in-out`,g?`rotate-0`:`-rotate-180`),"aria-expanded":g,"aria-controls":v,"aria-label":u,role:`button`,...d,children:t}),(0,x.jsx)(aO,{id:v,tabIndex:_?-1:void 0,isHidden:_,className:s,role:`region`,"aria-labelledby":v,children:e})]})},sO=({level:e,title:t,description:n,children:r,rightParam:i,isSelected:a,...o})=>(0,x.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,x.jsx)(oO,{isOpen:a,label:t,header:(0,x.jsxs)(`div`,{className:`flex w-full`,children:[(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,x.jsx)(`span`,{className:W(e===0&&`text-lg`,e===1&&`text-md`,e===2&&`text-md`,e>=3&&`text-base`),children:t}),i&&(0,x.jsx)(`div`,{className:`flex w-auto items-center justify-between p-3`,children:i})]}),n&&(0,x.jsx)(`p`,{className:`pl-3 text-card text-sm`,children:n})]}),children:(0,x.jsx)(`div`,{className:`size-full px-2`,children:r})})}),cO=e=>{let{keyPath:t,section:n,onFocusKeyPath:r,focusedKeyPath:i=[]}=e;return n.map((n,a)=>{let o={key:a,type:j},s=[...t,o];return(0,x.jsx)(sO,{level:t.length,title:`${a}`,description:``,isSelected:Ot(s,i),onClick:e=>{e.stopPropagation(),r(s)},children:(0,x.jsx)(HO,{...e,keyPath:s,section:n})},JSON.stringify(n))})},lO=e=>e?.getAttribute(`aria-selected`)===`true`,uO=(e,{selector:t=lO,isHoverable:n=!1,orientation:r=`horizontal`}={selector:lO,isHoverable:!1,orientation:`horizontal`})=>{let[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(null),c=(0,b.useRef)(null),l=(0,b.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,b.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,b.useState)(t??n??e[0]?.value),[l,u]=(0,b.useState)(null),d=(0,b.useRef)([]),f=(0,b.useRef)(null),{choiceIndicatorPosition:p}=uO(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,b.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}},fO=[{content:`Off`,value:!1},{content:`On`,value:!0}],pO=Fd(`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}}),mO=Fd(`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`}}),hO=Fd(`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`}}}),gO=e=>{let{choices:t=fO,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,x.jsx)(`div`,{className:pO({color:n,disabled:p,className:i}),role:`tablist`,"aria-disabled":p?`true`:void 0,children:(0,x.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,b.createElement)(`button`,{...u,type:`button`,className:W(mO({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,x.jsx)(`div`,{className:W(hO({color:n})),style:d,ref:u})]})})},_O=e=>{let t=(0,V.c)(7),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Jt(i,n,Fw());if(s!==void 0&&typeof s!=`boolean`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(x.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`}),t[0]=e):e=t[0],e}let c=n.length,l=s??r,u;t[1]!==n||t[2]!==o?(u=e=>{e.stopPropagation(),o(n)},t[1]=n,t[2]=o,t[3]=u):u=t[3];let d;return t[4]!==n||t[5]!==a?(d=e=>a({keyPath:n,newValue:String(e)}),t[4]=n,t[5]=a,t[6]=d):d=t[6],(0,x.jsx)(`button`,{type:`button`,className:W(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,c===2&&`hover:bg-card/30`,c>=3&&``),onClick:u,children:(0,x.jsx)(gO,{value:l,onChange:d})})},vO=e=>{let{keyPath:t,section:n}=e;return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[D]).map(r=>{let i={type:D,key:r},a=[...t,i],o=n[D][r];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,b.createElement)(HO,{...e,key:r,keyPath:a,section:o})]})})})},yO=e=>{let{keyPath:t,section:n}=e;return(0,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,b.createElement)(HO,{...e,key:r,keyPath:a,section:o})]})})})},bO=(...e)=>e.filter(Boolean).join(` `),xO=Fd([`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`}}),SO=({validationStyleEnabled:e=!1,variant:t,size:n,className:r,...i})=>(0,x.jsx)(`input`,{className:bO(xO({variant:t,size:n,validationStyleEnabled:e?`enabled`:`disabled`}),r),suppressHydrationWarning:!0,...i}),CO=({className:e,variant:t,validationStyleEnabled:n=!1,...r})=>(0,x.jsx)(`textarea`,{className:W(`resize-none`,xO({variant:t,validationStyleEnabled:n?`enabled`:`disabled`,className:e})),...r}),wO=24,TO=12,EO=({className:e,autoSize:t=!0,onChange:n,maxRows:r=999,ref:i,...a})=>{let o=(0,b.useRef)(null);(0,b.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=wO*r+TO;n.height=`${Math.max(Math.min(i,a),36)}px`};return(0,b.useLayoutEffect)(()=>{s()},[a.value,a.defaultValue,s]),(0,x.jsx)(CO,{ref:e=>{o.current=e,e&&s()},onChange:e=>{n?.(e),s()},className:W(`overflow-y-auto`,t&&`resize-none`,e),...a})},DO=({value:e=``,onCancel:t,onSave:n,onClick:r,children:i,isDisabled:a,...o})=>{let[s,c]=(0,b.useState)(!1),l=(0,b.useRef)(null),u=e=>{e.stopPropagation(),c(!1),n()},d=e=>{e.stopPropagation(),c(!1),t()},f=!e||e===``?`-`:e,p=(0,b.useCallback)(e=>{let t=window.getSelection();t&&t.toString().trim()!==``||l.current&&!l.current.contains(e.target)&&(c(!1),n())},[n]);return(0,b.useEffect)(()=>(s?document.addEventListener(`click`,p):document.removeEventListener(`click`,p),()=>document.removeEventListener(`click`,p)),[p,s]),(0,x.jsxs)(`span`,{className:`group/editable-field flex gap-2`,role:`button`,tabIndex:0,onClick:e=>{c(!0),r?.(e)},ref:l,...o,children:[(0,x.jsxs)(`div`,{className:W(`flex flex-1 gap-2`,s?`display`:`hidden`),children:[i,(0,x.jsx)(iO,{label:`Save`,variant:`hoverable`,size:`icon-sm`,color:`text`,Icon:Jd,onClick:u,disabled:a,className:`!text-current`,role:`button`,tabIndex:0,"aria-label":`Save changes`,"data-testid":`editable-field-save-button`}),(0,x.jsx)(iO,{label:`Cancel`,color:`text`,variant:`hoverable`,className:`!text-current`,size:`icon-sm`,Icon:_f,onClick:d,disabled:a,role:`button`,tabIndex:0,"aria-label":`Cancel changes`,"data-testid":`editable-field-cancel-button`})]},String(s)),(0,x.jsxs)(`div`,{className:W(`flex flex-1 gap-2`,s?`hidden`:`display`),children:[(0,x.jsx)(`span`,{className:`ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6`,children:f}),(0,x.jsx)(iO,{label:`Edit`,Icon:uf,color:`text`,variant:`hoverable`,size:`icon-sm`,className:`!text-current invisible group-hover/editable-field:visible`,disabled:a,onClick:e=>{e.stopPropagation(),c(!0)}})]})]})},OO=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,b.useRef)(null);return(0,b.useImperativeHandle)(n,()=>i.current),(0,x.jsx)(DO,{value:r.value??i.current?.value??r.defaultValue??``,onCancel:()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()},onSave:()=>{e?.(i.current?.value??``)},onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,x.jsx)(EO,{className:`leading-6`,ref:i,onClick:e=>{e.preventDefault(),e.stopPropagation()},...r})})},kO=e=>{let t=(0,V.c)(16),{keyPath:n,section:r,editedContent:i,editedContentValue:a,onContentChange:o,onFocusKeyPath:s,renderSection:c}=e,l=Fw(),u;t[0]!==l||t[1]!==i||t[2]!==a||t[3]!==n?(u=a??Jt(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,x.jsx)(x.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,x.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,x.jsx)(OO,{"aria-label":`Editable field`,defaultValue:p,onSave:e=>o({keyPath:n,newValue:e}),onCancel:AO})}),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 AO(){return null}var jO=e=>{let t=(0,V.c)(10),{keyPath:n,section:r}=e,{addEditedContent:i}=Hw(),a;if(t[0]!==i||t[1]!==n||t[2]!==e||t[3]!==r){let o=Jt(e.editedContent,n),s=r[k],{content:c}=r,l=[...n,{type:k}],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,x.jsxs)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:[(0,x.jsxs)(`span`,{className:`text-neutral text-sm`,children:[s,` `]}),(0,x.jsx)(kO,{...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},MO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:F}],i=n[F];return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,x.jsx)(HO,{...e,keyPath:r,section:i})})},NO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:O}],i=n[O];return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,x.jsx)(HO,{...e,keyPath:r,section:i})})},PO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:P}],i=n[P];return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,x.jsx)(HO,{...e,keyPath:r,section:i})})},FO=(0,b.memo)(e=>{let{keyPath:t,section:n,focusedKeyPath:r=[],onFocusKeyPath:i}=e;return(0,b.useMemo)(()=>Object.keys(n??{}).filter(e=>!VO.includes(e)),[n]).map(a=>{let o={key:a,type:A},s=[...t,o],c=Ot(s,r);return(0,x.jsx)(sO,{level:t.length,title:Mt(a),description:``,isSelected:c,onClick:e=>{e.stopPropagation(),i(c?[]:s)},children:(0,x.jsx)(HO,{...e,keyPath:s,section:n[a]})},a)})}),IO=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,b.useRef)(null);return(0,b.useImperativeHandle)(n,()=>i.current),(0,x.jsx)(DO,{value:(0,b.useMemo)(()=>r.value??i.current?.value??r.defaultValue,[r.value,r.defaultValue,i.current?.value]),onCancel:()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()},onSave:()=>{e?.(i.current?.value??``)},children:(0,x.jsx)(SO,{ref:i,...r})})},LO=e=>{let t=(0,V.c)(17),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Fw(),c;t[0]!==i||t[1]!==n||t[2]!==s?(c=Jt(i,n,s),t[0]=i,t[1]=n,t[2]=s,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,x.jsx)(x.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,x.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,x.jsx)(IO,{"aria-label":`Editable number field`,type:`number`,defaultValue:d,onSave:r,onCancel:RO})}),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 RO(){return null}var zO=e=>{let{keyPath:t,section:n}=e;return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n).filter(e=>!VO.includes(e)).map(r=>{let i={type:E,key:r},a=[...t,i],o=n[E][r];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,b.createElement)(HO,{...e,key:r,keyPath:a,section:o})]})})})},BO=e=>{let{keyPath:t,section:n,locale:r}=e,i={type:w,key:r},a=[...t,i],o=n[w][r];return(0,x.jsx)(HO,{...e,keyPath:a,section:o})},VO=[`filePath`,`id`,`nodeType`],HO=(0,b.memo)(e=>{let t=Fw(),n=(0,b.useMemo)(()=>Jt(e.editedContent,e.keyPath,t)??e.section,[e.editedContent,e.keyPath,e.section]),r=(0,b.useMemo)(()=>en(n),[n]);if(typeof n==`object`)return r===`reactNode`?(0,x.jsx)(`span`,{className:`text-neutral text-xs`,children:`React node not editable`}):r===`nested`?(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:`[Nested] Dictionary`}):r===`markdown`?(0,x.jsx)(PO,{...e,section:n}):r===`html`?(0,x.jsx)(MO,{...e,section:n}):r===`translation`?(0,x.jsx)(BO,{...e,section:n}):r===`enumeration`?(0,x.jsx)(yO,{...e,section:n}):r===`plural`?(0,x.jsx)(zO,{...e,section:n}):r===`condition`?(0,x.jsx)(vO,{...e,section:n}):r===`insertion`?(0,x.jsx)(NO,{...e,section:n}):r===`array`?(0,x.jsx)(cO,{...e,section:n}):r===`file`?(0,x.jsx)(jO,{...e,section:n}):(0,x.jsx)(FO,{...e,section:n});if(typeof n==`string`)return(0,x.jsx)(kO,{...e,section:n});if(typeof n==`number`)return(0,x.jsx)(LO,{...e,section:n});if(typeof n==`boolean`)return(0,x.jsx)(_O,{...e,section:n})}),UO=e=>{let t=(0,V.c)(6),{dictionary:n,...r}=e,i=Fw(),{editedContent:a,addEditedContent:o}=Hw(),{focusedContent:s,setFocusedContentKeyPath:c}=Lw(),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,x.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,b.createElement)(HO,{...r,keyPath:[],locale:i,dictionary:n,key:`${l}${i}`,editedContent:a?.[n.localId]?.content,focusedKeyPath:s?.keyPath,section:n.content,onContentChange:u,onFocusKeyPath:c})})},WO=Fd(`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`}]}),GO=({children:e,roundedSize:t,padding:n,transparency:r,separator:i,className:a,border:o,borderColor:s,background:c,gap:l,...u})=>(0,x.jsx)(`div`,{className:W(WO({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}),KO=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:i,validate:a,additionalButtons:o,...s}=e,[c,l]=(0,b.useState)(n),[u,d]=(0,b.useState)(0),f=c!==n,p;t[0]===n?p=t[1]:(p=()=>{l(n),d(qO)},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 v=_,y=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(JO)},C=[n],t[6]=n,t[7]=S,t[8]=C),(0,b.useEffect)(S,C);let w=a?.(c)??!0;return(0,x.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor input`,children:[(0,x.jsx)(SO,{onChange:v,onKeyDown:y,"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,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(iO,{Icon:Jd,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,x.jsx)(iO,{Icon:_f,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:m,disabled:i})]}),o]})]},String(n))};function qO(e){return e+1}function JO(e){return e+1}var YO=``,XO=e=>{let t=e.querySelectorAll(`[data-line]`);return t.length===0?(e.textContent??``).split(YO).join(``):Array.from(t).map(e=>{let t=e.querySelector(`[data-editable]`)?.textContent??e.textContent??``;return t===YO?``:t.split(YO).join(``)}).join(`
|
|
44
|
+
at `))}function sE(e,t){class n extends e{#e;constructor(...e){if(aE()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=oE(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 cE={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};sE(class extends Error{constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:cE[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 lE=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},uE=47;function dE(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===uE;)t--;return t===e.length?e:e.slice(0,t)}function fE(e){try{return(dE(new URL(e).pathname)||`/`)!==`/`}catch{throw new lE(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function pE(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new lE(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof lE?t:new lE(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function mE(e,t=`/api/auth`){if(pE(e),fE(e))return e;let n=dE(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function hE(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 gE(e,t,n,r,i){if(e)return mE(e,t);if(r!==!1){let e=rE.BETTER_AUTH_URL||rE.NEXT_PUBLIC_BETTER_AUTH_URL||rE.PUBLIC_BETTER_AUTH_URL||rE.NUXT_PUBLIC_BETTER_AUTH_URL||rE.NUXT_PUBLIC_AUTH_URL||(rE.BASE_URL===`/`?void 0:rE.BASE_URL);if(e)return mE(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&hE(o,`proto`)&&hE(a,`host`))try{return mE(`${o}://${a}`,t)}catch{}if(n){let e=_E(n.url);if(!e)throw new lE(`Could not get origin from request. Please provide a valid base URL.`);return mE(e,t)}if(typeof window<`u`&&window.location)return mE(window.location.origin,t)}function _E(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var vE=[`javascript:`,`data:`,`vbscript:`];function yE(e){let t;try{t=new URL(e)}catch{return!0}return!vE.includes(t.protocol)}var bE={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&yE(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},xE=()=>typeof window>`u`;function SE(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function CE(e){return!e||e.session===null&&e.user===null?null:e}function wE(e,t){return NT(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function TE(e,t){let n=CT(!1),r,i=e=>s(e),a=CT({data:null,error:null,isPending:!0,isRefetching:!1,refetch:i});PT(a,wE);let o=e=>{if(r!==e)return;let t=a.get();r=void 0,!(!t.isPending&&!t.isRefetching)&&a.set({...t,isPending:!1,isRefetching:!1,refetch:i})},s=async t=>{r?.abort();let n=new AbortController;r=n;let s=a.get();a.set({...s,isPending:s.data===null,isRefetching:!0,error:null,refetch:i});try{let r=await e(`/get-session`,{method:`GET`,query:t?.query,signal:n.signal});if(n.signal.aborted){o(n);return}let{data:s,error:c}=SE(r);if(s?.needsRefresh)try{let t=await e(`/get-session`,{method:`POST`,signal:n.signal});if(n.signal.aborted){o(n);return}({data:s,error:c}=SE(t))}catch{if(n.signal.aborted){o(n);return}}if(c){let e=a.get(),t=c?.status===401;a.set({data:t?null:e.data,error:c,isPending:!1,isRefetching:!1,refetch:i});return}let l=CE(s),u=a.get(),d=u.data!=null&&l!=null&&NT(u.data,l)?u.data:l;a.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:i})}catch(e){if(n.signal.aborted){o(n);return}let t=a.get();a.set({data:t.data,error:e,isPending:!1,isRefetching:!1,refetch:i})}},c=()=>{};return jT(a,()=>{let e;xE()||(e=setTimeout(()=>{s()},0));let i=eE({fetchSession:s,shouldPollSession:()=>a.get().data!=null,sessionSignal:n,options:t});return i.init(),c=i.broadcastSessionUpdate,()=>{e&&clearTimeout(e);let t=r;t?.abort(),t&&o(t),i.cleanup()}}),{session:a,$sessionSignal:n,broadcastSessionUpdate:e=>c(e)}}var EE=Object.defineProperty,DE=Object.defineProperties,OE=Object.getOwnPropertyDescriptors,kE=Object.getOwnPropertySymbols,AE=Object.prototype.hasOwnProperty,jE=Object.prototype.propertyIsEnumerable,ME=(e,t,n)=>t in e?EE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,NE=(e,t)=>{for(var n in t||={})AE.call(t,n)&&ME(e,n,t[n]);if(kE)for(var n of kE(t))jE.call(t,n)&&ME(e,n,t[n]);return e},PE=(e,t)=>DE(e,OE(t)),FE=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)}},IE=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}},LE=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}},RE=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 zE(e){if(typeof e==`number`)return new LE({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new LE(e);case`exponential`:return new RE(e);default:throw Error(`Invalid retry strategy`)}}var BE=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},VE=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function HE(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 VE.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function UE(e){try{return JSON.parse(e),!0}catch{return!1}}function WE(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 GE(e){try{return JSON.parse(e)}catch{return e}}function KE(e){return typeof e==`function`}function qE(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&KE(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&KE(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function JE(...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 YE(e){let t=new Headers(JE(e?.headers,await BE(e)));if(!t.has(`content-type`)){let n=XE(e?.body);n&&t.set(`content-type`,n)}return t}function XE(e){return WE(e)?`application/json`:null}function ZE(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function QE(e,t){let{body:n}=e;return n?!WE(n)||typeof n==`string`?n:ZE(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function $E(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return rD.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function eD(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var tD=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function nD(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new tD(n.issues);return n.value}var rD=[`get`,`post`,`put`,`patch`,`delete`],iD=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 nD(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=PE(NE({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=PE(NE({},r),{body:i.input?await nD(i.input,n?.body):n?.body,params:i.params?await nD(i.params,n?.params):n?.params,query:i.query?await nD(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),aD=e=>{async function t(t,n){let r=PE(NE(NE({},e),n),{headers:JE(e?.headers,n?.headers),plugins:[...e?.plugins||[],iD(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await lD(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 lD(t,r)}return t},oD=e=>e===`.`||e===`..`;function sD(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(oD(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function cD(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];rD.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=>sD(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 lD=async(e,t)=>{let{hooks:n,url:r,options:i}=await IE(e,t),a=qE(i),o=new AbortController,s=i.signal??o.signal,c=cD(r,i),l=await YE(i),u=QE(i,l),d=$E(r,i),f=PE(NE({},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}=eD(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(PE(NE({},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=HE(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??GE)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await nD(f.output,r.data));for(let e of n.onSuccess)e&&await e(PE(NE({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??GE,_=await m.text(),v=UE(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:PE(NE({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(PE(NE({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=zE(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 lD(e,PE(NE({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new FE(m.status,m.statusText,v?y:_);return{data:null,error:PE(NE({},y),{status:m.status,statusText:m.statusText})}},uD=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=gE(e?.baseURL,e?.basePath,void 0,t)??uD(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=aD({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?JT(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[bE],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=TE(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=kC(t.getActions?.(d,b,e)??{},g));return{get baseURL(){return r},pluginsActions:g,pluginsAtoms:_,pluginPathMethods:v,atomListeners:y,$fetch:d,$store:b}};function fD(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function pD(e){return e.charAt(0).toUpperCase()+e.slice(1)}var mD=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,hD=/['\u2019]/g;function gD(e){return e.replace(hD,``).match(mD)??[]}function _D(e){return gD(e).map(e=>e.toLowerCase()).join(`-`)}function vD(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 yD(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`||fD(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(_D).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=vD(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 bD(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${pD(e)}`]=t;return yD({...n,...s,$fetch:i,$store:o},i,t,r,a)}var xD=(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 pT({optionsJSON:{...a.data,extensions:o},useBrowserAutofill:r?.autoFill})}catch(e){return{data:null,error:{code:e instanceof rT?e.code:`AUTH_CANCELLED`,message:Yw.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:Yw.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 cT({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 rT?e.code===`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`?{data:null,error:{code:e.code,message:Yw.PREVIOUSLY_REGISTERED.message,status:400,statusText:`BAD_REQUEST`}}:e.code===`ERROR_CEREMONY_ABORTED`?{data:null,error:{code:e.code,message:Yw.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:Yw.UNKNOWN_ERROR.message,status:500,statusText:`INTERNAL_SERVER_ERROR`}}}}},$Infer:{}}),SD=()=>{let e=CT();return{id:`passkey`,version:Xw,$InferServerPlugin:{},getActions:(t,n)=>xD(t,{$listPasskeys:e,$store:n}),getAtoms(t){return{listPasskeys:ZT(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:Yw}},CD=`1.6.24`,wD=e=>({id:`sso-client`,version:CD,$InferServerPlugin:{},pathMethods:{"/sso/providers":`GET`,"/sso/get-provider":`GET`}}),TD=()=>({id:`magic-link`,version:mT,$InferServerPlugin:{}}),ED=Jw({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`}),DD=e=>({id:`two-factor`,version:mT,$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`&&yE(e.twoFactorPage)&&(window.location.href=e.twoFactorPage)}}}}],$ERROR_CODES:ED}),OD=e=>bD({baseURL:e,withCredentials:!0,plugins:[DD({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}}),SD(),TD(),wD()]}),kD=e=>{let t=e?.editor?.backendURL??g?.backendURL;t||(t=Nt,console.error(`Backend URL is not defined in the Intlayer configuration.`));let n=OD(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})}},AD=(e,t)=>{let n=(0,V.c)(17),r=Bw(),i;n[0]!==r||n[1]!==t?(i=t??r??{editor:g},n[0]=r,n[1]=t,n[2]=i):i=n[2];let a=i,o=qo(),s;n[3]===Symbol.for(`react.memo_cache_sentinel`)?(s=[`session`],n[3]=s):s=n[3];let c;n[4]===a?c=n[5]:(c=async()=>(await kD(a).getSession()).data,n[4]=a,n[5]=c);let l=!e,u;n[6]!==c||n[7]!==l?(u={queryKey:s,queryFn:c,staleTime:3e5,gcTime:18e5,refetchInterval:6e5,refetchIntervalInBackground:!1,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:!0,enabled:l},n[6]=c,n[7]=l,n[8]=u):u=n[8];let{data:d,isFetched:f,refetch:p}=ls(u),m=d??(f?null:void 0),h;n[9]===o?h=n[10]:(h=e=>{o.setQueryData([`session`],e)},n[9]=o,n[10]=h);let _=h,v;n[11]===p?v=n[12]:(v=async()=>(await p()).data,n[11]=p,n[12]=v);let y=v,b;return n[13]!==y||n[14]!==m||n[15]!==_?(b={session:m,fetchSession:y,revalidateSession:y,setSession:_},n[13]=y,n[14]=m,n[15]=_,n[16]=b):b=n[16],b},jD=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}=AD(r,i),{oAuth2AccessToken:l}=qw(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},MD=e=>{let t=(0,V.c)(10),n=Bw(),{oAuth2AccessToken:r}=jD(),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},ND=e=>{let t=(0,V.c)(2),n=Bw(),r=e?.intlayerConfiguration??n,i;return t[0]===r?i=t[1]:(i=kD(r),t[0]=r,t[1]=i),i},PD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=NC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},FD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(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},ID=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=AC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},LD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=PC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},RD=e=>{let t=(0,V.c)(3),{options:n,resolvedConfig:r}=MD(e),i;return t[0]!==n||t[1]!==r?(i=MC(n,r),t[0]=n,t[1]=r,t[2]=i):i=t[2],i},zD=[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]],BD=()=>{let e=(0,V.c)(8),t=ND(),n=qo(),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=()=>{zD.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],us(o)},VD=()=>{let e=(0,V.c)(9),{session:t,revalidateSession:n,setSession:r}=jD(),{mutate:i}=BD(),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},HD=e=>{let t=(0,V.c)(4),{requireUser:n,requireProject:r,requireOrganization:i}=e,a=Bw(),o;t[0]===a?o=t[1]:(o={intlayerConfiguration:a},t[0]=a,t[1]=o);let{oAuth2AccessToken:s,session:c}=jD(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},UD=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}=HD(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],ls(l)},WD=()=>{let e=(0,V.c)(3),t=ID(),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),us(r)},GD=()=>{let e=(0,V.c)(3),t=ID(),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),us(r)},KD=()=>{let e=(0,V.c)(3),t=ID(),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),us(r)},qD=(e,t)=>{let n=(0,V.c)(9),r=FD(),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],UD(o)},JD=()=>{let e=(0,V.c)(6),t=FD(),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),us(a)},YD=()=>{let e=(0,V.c)(6),t=FD(),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),us(a)},XD=()=>{let e=(0,V.c)(3),t=RD(),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),ls(r)},ZD=()=>{let e=(0,V.c)(3),t=RD(),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),us(r)},QD=(e,t)=>{let n=(0,V.c)(9),r=PD(),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],UD(o)},$D=(e,t)=>{let n=(0,V.c)(9),r=LD(),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],UD(o)},eO=({className:e,strokeWidth:t=4})=>(0,x.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,x.jsxs)(`g`,{fill:`none`,fillRule:`evenodd`,strokeWidth:t,children:[(0,x.jsxs)(`circle`,{cx:`22`,cy:`22`,r:`1`,children:[(0,x.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,x.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,x.jsxs)(`circle`,{cx:`22`,cy:`22`,r:`1`,children:[(0,x.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,x.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`})]})]})}),tO=({children:e,isLoading:t=!0,keepChildren:n=!1,className:r,...i})=>(0,x.jsx)(x.Fragment,{children:t&&n?(0,x.jsxs)(`div`,{className:`relative size-full`,children:[(0,x.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,x.jsx)(eO,{className:`size-10 max-h-full max-w-full`})}),e]}):t?(0,x.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,x.jsx)(eO,{className:`size-10 max-h-full max-w-full`})}):e??(0,x.jsx)(x.Fragment,{})}),nO=Fd(`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`}}),rO=Fd(`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}}),iO=({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":y,"aria-pressed":b,...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":y,"aria-pressed":c===void 0?b: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,x.jsxs)(`button`,{disabled:s||p,role:C?`link`:`button`,type:g,className:rO({variant:e,size:t,color:n,isFullWidth:u,roundedSize:d,textAlign:f??(a?`left`:`center`),className:h}),...T,...S,children:[i&&!s&&(0,x.jsx)(i,{className:nO({size:t,className:W(!E&&`mr-3`,o)}),"aria-hidden":`true`}),(0,x.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,x.jsx)(tO,{className:nO({size:t,className:W(!E&&`mr-3`,o)}),isLoading:s,"aria-hidden":`true`,"data-testid":`loader`})}),r&&(0,x.jsx)(`span`,{className:`flex-1 truncate whitespace-nowrap`,children:r}),!r&&w&&(0,x.jsx)(`span`,{className:`sr-only`,children:m}),a&&(0,x.jsx)(a,{className:nO({size:t,className:W(!E&&`ml-3`,o)}),"aria-hidden":`true`})]})},aO=({children:e,isHidden:t,className:n=``,isOverable:r=!1,isFocusable:i=!1,minHeight:a=0,...o})=>(0,x.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,x.jsx)(`div`,{style:{minHeight:`${a}px`},className:W(r&&`group-hover/height-smoother:visible`,i&&`group-focus/height-smoother:visible`,n),children:e})}),oO=({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,b.useState)(r),h=(0,b.useId)(),g=f?n:p,_=!g,v=l??`${h}-accordion-content`,y=e=>{if(o)return;let t=!g;f||m(t),i?.(t),a?.(e)};return(0,x.jsxs)(`div`,{className:`w-full`,children:[(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,onClick:y,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),y(e))},disabled:o,isFullWidth:!0,className:W(`flex items-center justify-between gap-2`,c),IconRight:Yd,iconClassName:W(`transform transition-transform duration-500 ease-in-out`,g?`rotate-0`:`-rotate-180`),"aria-expanded":g,"aria-controls":v,"aria-label":u,role:`button`,...d,children:t}),(0,x.jsx)(aO,{id:v,tabIndex:_?-1:void 0,isHidden:_,className:s,role:`region`,"aria-labelledby":v,children:e})]})},sO=({level:e,title:t,description:n,children:r,rightParam:i,isSelected:a,...o})=>(0,x.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,x.jsx)(oO,{isOpen:a,label:t,header:(0,x.jsxs)(`div`,{className:`flex w-full`,children:[(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,x.jsx)(`span`,{className:W(e===0&&`text-lg`,e===1&&`text-md`,e===2&&`text-md`,e>=3&&`text-base`),children:t}),i&&(0,x.jsx)(`div`,{className:`flex w-auto items-center justify-between p-3`,children:i})]}),n&&(0,x.jsx)(`p`,{className:`pl-3 text-card text-sm`,children:n})]}),children:(0,x.jsx)(`div`,{className:`size-full px-2`,children:r})})}),cO=e=>{let{keyPath:t,section:n,onFocusKeyPath:r,focusedKeyPath:i=[]}=e;return n.map((n,a)=>{let o={key:a,type:j},s=[...t,o];return(0,x.jsx)(sO,{level:t.length,title:`${a}`,description:``,isSelected:Ot(s,i),onClick:e=>{e.stopPropagation(),r(s)},children:(0,x.jsx)(HO,{...e,keyPath:s,section:n})},JSON.stringify(n))})},lO=e=>e?.getAttribute(`aria-selected`)===`true`,uO=(e,{selector:t=lO,isHoverable:n=!1,orientation:r=`horizontal`}={selector:lO,isHoverable:!1,orientation:`horizontal`})=>{let[i,a]=(0,b.useState)(null),[o,s]=(0,b.useState)(null),c=(0,b.useRef)(null),l=(0,b.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,b.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,b.useState)(t??n??e[0]?.value),[l,u]=(0,b.useState)(null),d=(0,b.useRef)([]),f=(0,b.useRef)(null),{choiceIndicatorPosition:p}=uO(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,b.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}},fO=[{content:`Off`,value:!1},{content:`On`,value:!0}],pO=Fd(`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}}),mO=Fd(`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`}}),hO=Fd(`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`}}}),gO=e=>{let{choices:t=fO,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,x.jsx)(`div`,{className:pO({color:n,disabled:p,className:i}),role:`tablist`,"aria-disabled":p?`true`:void 0,children:(0,x.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,b.createElement)(`button`,{...u,type:`button`,className:W(mO({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,x.jsx)(`div`,{className:W(hO({color:n})),style:d,ref:u})]})})},_O=e=>{let t=(0,V.c)(7),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Jt(i,n,Fw());if(s!==void 0&&typeof s!=`boolean`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(x.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`}),t[0]=e):e=t[0],e}let c=n.length,l=s??r,u;t[1]!==n||t[2]!==o?(u=e=>{e.stopPropagation(),o(n)},t[1]=n,t[2]=o,t[3]=u):u=t[3];let d;return t[4]!==n||t[5]!==a?(d=e=>a({keyPath:n,newValue:String(e)}),t[4]=n,t[5]=a,t[6]=d):d=t[6],(0,x.jsx)(`button`,{type:`button`,className:W(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,c===2&&`hover:bg-card/30`,c>=3&&``),onClick:u,children:(0,x.jsx)(gO,{value:l,onChange:d})})},vO=e=>{let{keyPath:t,section:n}=e;return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[D]).map(r=>{let i={type:D,key:r},a=[...t,i],o=n[D][r];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,b.createElement)(HO,{...e,key:r,keyPath:a,section:o})]})})})},yO=e=>{let{keyPath:t,section:n}=e;return(0,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,b.createElement)(HO,{...e,key:r,keyPath:a,section:o})]})})})},bO=(...e)=>e.filter(Boolean).join(` `),xO=Fd([`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`}}),SO=({validationStyleEnabled:e=!1,variant:t,size:n,className:r,...i})=>(0,x.jsx)(`input`,{className:bO(xO({variant:t,size:n,validationStyleEnabled:e?`enabled`:`disabled`}),r),suppressHydrationWarning:!0,...i}),CO=({className:e,variant:t,validationStyleEnabled:n=!1,...r})=>(0,x.jsx)(`textarea`,{className:W(`resize-none`,xO({variant:t,validationStyleEnabled:n?`enabled`:`disabled`,className:e})),...r}),wO=24,TO=12,EO=({className:e,autoSize:t=!0,onChange:n,maxRows:r=999,ref:i,...a})=>{let o=(0,b.useRef)(null);(0,b.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=wO*r+TO;n.height=`${Math.max(Math.min(i,a),36)}px`};return(0,b.useLayoutEffect)(()=>{s()},[a.value,a.defaultValue,s]),(0,x.jsx)(CO,{ref:e=>{o.current=e,e&&s()},onChange:e=>{n?.(e),s()},className:W(`overflow-y-auto`,t&&`resize-none`,e),...a})},DO=({value:e=``,onCancel:t,onSave:n,onClick:r,children:i,isDisabled:a,...o})=>{let[s,c]=(0,b.useState)(!1),l=(0,b.useRef)(null),u=e=>{e.stopPropagation(),c(!1),n()},d=e=>{e.stopPropagation(),c(!1),t()},f=!e||e===``?`-`:e,p=(0,b.useCallback)(e=>{let t=window.getSelection();t&&t.toString().trim()!==``||l.current&&!l.current.contains(e.target)&&(c(!1),n())},[n]);return(0,b.useEffect)(()=>(s?document.addEventListener(`click`,p):document.removeEventListener(`click`,p),()=>document.removeEventListener(`click`,p)),[p,s]),(0,x.jsxs)(`span`,{className:`group/editable-field flex gap-2`,role:`button`,tabIndex:0,onClick:e=>{c(!0),r?.(e)},ref:l,...o,children:[(0,x.jsxs)(`div`,{className:W(`flex flex-1 gap-2`,s?`display`:`hidden`),children:[i,(0,x.jsx)(iO,{label:`Save`,variant:`hoverable`,size:`icon-sm`,color:`text`,Icon:Jd,onClick:u,disabled:a,className:`!text-current`,role:`button`,tabIndex:0,"aria-label":`Save changes`,"data-testid":`editable-field-save-button`}),(0,x.jsx)(iO,{label:`Cancel`,color:`text`,variant:`hoverable`,className:`!text-current`,size:`icon-sm`,Icon:_f,onClick:d,disabled:a,role:`button`,tabIndex:0,"aria-label":`Cancel changes`,"data-testid":`editable-field-cancel-button`})]},String(s)),(0,x.jsxs)(`div`,{className:W(`flex flex-1 gap-2`,s?`hidden`:`display`),children:[(0,x.jsx)(`span`,{className:`ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6`,children:f}),(0,x.jsx)(iO,{label:`Edit`,Icon:uf,color:`text`,variant:`hoverable`,size:`icon-sm`,className:`!text-current invisible group-hover/editable-field:visible`,disabled:a,onClick:e=>{e.stopPropagation(),c(!0)}})]})]})},OO=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,b.useRef)(null);return(0,b.useImperativeHandle)(n,()=>i.current),(0,x.jsx)(DO,{value:r.value??i.current?.value??r.defaultValue??``,onCancel:()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()},onSave:()=>{e?.(i.current?.value??``)},onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,x.jsx)(EO,{className:`leading-6`,ref:i,onClick:e=>{e.preventDefault(),e.stopPropagation()},...r})})},kO=e=>{let t=(0,V.c)(16),{keyPath:n,section:r,editedContent:i,editedContentValue:a,onContentChange:o,onFocusKeyPath:s,renderSection:c}=e,l=Fw(),u;t[0]!==l||t[1]!==i||t[2]!==a||t[3]!==n?(u=a??Jt(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,x.jsx)(x.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,x.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,x.jsx)(OO,{"aria-label":`Editable field`,defaultValue:p,onSave:e=>o({keyPath:n,newValue:e}),onCancel:AO})}),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 AO(){return null}var jO=e=>{let t=(0,V.c)(10),{keyPath:n,section:r}=e,{addEditedContent:i}=Hw(),a;if(t[0]!==i||t[1]!==n||t[2]!==e||t[3]!==r){let o=Jt(e.editedContent,n),s=r[k],{content:c}=r,l=[...n,{type:k}],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,x.jsxs)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:[(0,x.jsxs)(`span`,{className:`text-neutral text-sm`,children:[s,` `]}),(0,x.jsx)(kO,{...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},MO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:F}],i=n[F];return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,x.jsx)(HO,{...e,keyPath:r,section:i})})},NO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:O}],i=n[O];return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,x.jsx)(HO,{...e,keyPath:r,section:i})})},PO=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:P}],i=n[P];return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,x.jsx)(HO,{...e,keyPath:r,section:i})})},FO=(0,b.memo)(e=>{let{keyPath:t,section:n,focusedKeyPath:r=[],onFocusKeyPath:i}=e;return(0,b.useMemo)(()=>Object.keys(n??{}).filter(e=>!VO.includes(e)),[n]).map(a=>{let o={key:a,type:A},s=[...t,o],c=Ot(s,r);return(0,x.jsx)(sO,{level:t.length,title:Mt(a),description:``,isSelected:c,onClick:e=>{e.stopPropagation(),i(c?[]:s)},children:(0,x.jsx)(HO,{...e,keyPath:s,section:n[a]})},a)})}),IO=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,b.useRef)(null);return(0,b.useImperativeHandle)(n,()=>i.current),(0,x.jsx)(DO,{value:(0,b.useMemo)(()=>r.value??i.current?.value??r.defaultValue,[r.value,r.defaultValue,i.current?.value]),onCancel:()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()},onSave:()=>{e?.(i.current?.value??``)},children:(0,x.jsx)(SO,{ref:i,...r})})},LO=e=>{let t=(0,V.c)(17),{keyPath:n,section:r,editedContent:i,onContentChange:a,onFocusKeyPath:o}=e,s=Fw(),c;t[0]!==i||t[1]!==n||t[2]!==s?(c=Jt(i,n,s),t[0]=i,t[1]=n,t[2]=s,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,x.jsx)(x.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,x.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,x.jsx)(IO,{"aria-label":`Editable number field`,type:`number`,defaultValue:d,onSave:r,onCancel:RO})}),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 RO(){return null}var zO=e=>{let{keyPath:t,section:n}=e;return(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n).filter(e=>!VO.includes(e)).map(r=>{let i={type:E,key:r},a=[...t,i],o=n[E][r];return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,b.createElement)(HO,{...e,key:r,keyPath:a,section:o})]})})})},BO=e=>{let{keyPath:t,section:n,locale:r}=e,i={type:w,key:r},a=[...t,i],o=n[w][r];return(0,x.jsx)(HO,{...e,keyPath:a,section:o})},VO=[`filePath`,`id`,`nodeType`],HO=(0,b.memo)(e=>{let t=Fw(),n=(0,b.useMemo)(()=>Jt(e.editedContent,e.keyPath,t)??e.section,[e.editedContent,e.keyPath,e.section]),r=(0,b.useMemo)(()=>en(n),[n]);if(typeof n==`object`)return r===`reactNode`?(0,x.jsx)(`span`,{className:`text-neutral text-xs`,children:`React node not editable`}):r===`nested`?(0,x.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:`[Nested] Dictionary`}):r===`markdown`?(0,x.jsx)(PO,{...e,section:n}):r===`html`?(0,x.jsx)(MO,{...e,section:n}):r===`translation`?(0,x.jsx)(BO,{...e,section:n}):r===`enumeration`?(0,x.jsx)(yO,{...e,section:n}):r===`plural`?(0,x.jsx)(zO,{...e,section:n}):r===`condition`?(0,x.jsx)(vO,{...e,section:n}):r===`insertion`?(0,x.jsx)(NO,{...e,section:n}):r===`array`?(0,x.jsx)(cO,{...e,section:n}):r===`file`?(0,x.jsx)(jO,{...e,section:n}):(0,x.jsx)(FO,{...e,section:n});if(typeof n==`string`)return(0,x.jsx)(kO,{...e,section:n});if(typeof n==`number`)return(0,x.jsx)(LO,{...e,section:n});if(typeof n==`boolean`)return(0,x.jsx)(_O,{...e,section:n})}),UO=e=>{let t=(0,V.c)(6),{dictionary:n,...r}=e,i=Fw(),{editedContent:a,addEditedContent:o}=Hw(),{focusedContent:s,setFocusedContentKeyPath:c}=Lw(),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,x.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,b.createElement)(HO,{...r,keyPath:[],locale:i,dictionary:n,key:`${l}${i}`,editedContent:a?.[n.localId]?.content,focusedKeyPath:s?.keyPath,section:n.content,onContentChange:u,onFocusKeyPath:c})})},WO=Fd(`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`}]}),GO=({children:e,roundedSize:t,padding:n,transparency:r,separator:i,className:a,border:o,borderColor:s,background:c,gap:l,...u})=>(0,x.jsx)(`div`,{className:W(WO({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}),KO=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:i,validate:a,additionalButtons:o,...s}=e,[c,l]=(0,b.useState)(n),[u,d]=(0,b.useState)(0),f=c!==n,p;t[0]===n?p=t[1]:(p=()=>{l(n),d(qO)},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 v=_,y=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(JO)},C=[n],t[6]=n,t[7]=S,t[8]=C),(0,b.useEffect)(S,C);let w=a?.(c)??!0;return(0,x.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor input`,children:[(0,x.jsx)(SO,{onChange:v,onKeyDown:y,"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,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(iO,{Icon:Jd,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,x.jsx)(iO,{Icon:_f,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:m,disabled:i})]}),o]})]},String(n))};function qO(e){return e+1}function JO(e){return e+1}var YO=``,XO=e=>{let t=e.querySelectorAll(`[data-line]`);return t.length===0?(e.textContent??``).split(YO).join(``):Array.from(t).map(e=>{let t=e.querySelector(`[data-editable]`)?.textContent??e.textContent??``;return t===YO?``:t.split(YO).join(``)}).join(`
|
|
45
45
|
`)},ZO=e=>{let t=e.split(`
|
|
46
46
|
`);return t.length===0?[``]:t},QO=(()=>{if(typeof Intl>`u`||!(`Segmenter`in Intl))return null;let e=Intl.Segmenter;return new e(void 0,{granularity:`grapheme`})})(),$O=(e,t)=>{if(t<=0)return 0;if(QO){let n=[...QO.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},ek=(e,t)=>{if(t>=e.length)return e.length;if(QO){let n=[...QO.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},tk=(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},nk=(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},rk=(e,t)=>e.slice(0,t).lastIndexOf(`
|
|
47
47
|
`)+1,ik=(e,t)=>{let n=e.indexOf(`
|
|
@@ -55,7 +55,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
55
55
|
`+n.slice(t.end);v(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);v(e,t.start)}else{if(t.start===0)return;let r;r=e.metaKey?rk(n,t.start):e.altKey?tk(n,t.start):$O(n,t.start);let i=n.slice(0,r)+n.slice(t.start);v(i,r)}return}if(e.key===`Delete`){if(e.preventDefault(),t.hasSelection){let e=n.slice(0,t.start)+n.slice(t.end);v(e,t.start)}else{if(t.start>=n.length)return;let r;r=e.metaKey?ik(n,t.start):e.altKey?nk(n,t.start):ek(n,t.start);let i=n.slice(0,t.start)+n.slice(r);v(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
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);v(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
57
|
`),a=i.slice(0,n.start)+t+i.slice(n.end);v(a,n.start+t.length)},handleDrop:e=>{e.preventDefault()},handleDragOver:e=>{e.preventDefault()},getCaretPosition:f,setCaretPosition:m,getCursorOffset:_,caretFromFlatOffset:g}},ok=({index:e,text:t,isLast:n,ghostText:r})=>(0,x.jsxs)(`span`,{"data-line":e,className:`block min-h-[1.5rem]`,children:[(0,x.jsx)(`span`,{"data-editable":!0,children:t||``}),r&&(0,x.jsx)(`span`,{"data-ghost":!0,className:`pointer-events-none select-none text-neutral`,"aria-hidden":`true`,children:r}),!n&&(0,x.jsx)(`br`,{})]}),sk=24,ck=12,lk=({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:v,containerRef:y,getText:S,handleInput:C,handleBeforeInput:w,handleKeyDown:T,handleCut:E,handlePaste:D,handleDrop:O,handleDragOver:k,getCursorOffset:A,setCaretPosition:j,caretFromFlatOffset:M}=ak({value:e,defaultValue:t,onChange:n,disabled:i}),N=(0,b.useRef)(null),P=e=>{N.current=e,y.current=e};(0,b.useImperativeHandle)(g,()=>({getContainer:()=>N.current,getText:S,focus:()=>N.current?.focus(),getCursorOffset:A,setCursorAtOffset:e=>{j(M(e,v))}})),(0,b.useLayoutEffect)(()=>{if(!s||!N.current)return;let e=N.current,t=sk*o+ck,n=sk*a+ck;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`},[v,s,o,a]);let F=v.length===1&&v[0]===``,I=u&&d!==void 0&&f!==void 0;return(0,x.jsxs)(`div`,{className:`relative w-full`,children:[F&&r&&(0,x.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,x.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`,xO({variant:l,validationStyleEnabled:c?`enabled`:`disabled`}),s&&`overflow-y-auto`,m),children:v.map((e,t)=>(0,x.jsx)(ok,{index:t,text:e,isLast:t===v.length-1,ghostText:I&&d===t?u:void 0},t))})]})},uk=({isActive:e=!0,suggestion:t,...n})=>{let[r,i]=(0,b.useState)(String(n.value??n.defaultValue??``)),[a,o]=(0,b.useState)(``),s=(0,b.useRef)(null);(0,b.useEffect)(()=>{n.value!==void 0&&i(String(n.value??n.defaultValue??``))},[n.value,n.defaultValue]);let c=()=>{let e=t??a;if(!e)return;let n=s.current?.getCursorOffset()??r.length,c=r.slice(0,n)+e+r.slice(n);i(c),o(``),setTimeout(()=>{s.current?.focus(),s.current?.setCursorAtOffset(n+e.length)},0)},l=e?t??(a||void 0):void 0,u=r.split(`
|
|
58
|
-
`);return(0,x.jsx)(lk,{ref:s,value:r,onChange:e=>{if(i(e),o(``),n.onChange){let t={target:{value:e},currentTarget:{value:e}};n.onChange(t)}},onKeyDown:e=>{e.key===`Tab`&&(t??a)&&(e.preventDefault(),c()),n.onKeyDown?.(e)},ghostText:l,ghostLine:t?u.length-1:void 0,ghostOffset:t?u[u.length-1]?.length??0:void 0,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`]})},dk=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:i,validate:a,additionalButtons:o,...s}=e,{isAuthenticated:c}=$D(),[l,u]=(0,b.useState)(n),[d,f]=(0,b.useState)(0),p=l!==n,m;t[0]===n?m=t[1]:(m=()=>{u(n),f(fk)},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,v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>u(e.currentTarget.value??``),t[5]=v):v=t[5];let y=v,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(pk)},w=[n],t[6]=n,t[7]=C,t[8]=w),(0,b.useEffect)(C,w);let T=a?.(l)??!0;return(0,x.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor textarea`,children:[(0,x.jsx)(uk,{onChange:y,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,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(iO,{Icon:Jd,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,x.jsx)(iO,{Icon:_f,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:h,disabled:i})]}),o]})]},n)};function fk(e){return e+1}function pk(e){return e+1}var mk=(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,b.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,b.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},hk=(0,b.createContext)({availableLocales:[],selectedLocales:[],setSelectedLocales:()=>{}}),gk=()=>(0,b.useContext)(hk),_k=e=>{let t=(0,V.c)(16),{availableLocales:n,defaultSelectedLocales:r,children:i}=e,{locale:a}=an(),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]=mk(`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,b.useEffect)(l,u);let d;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==c?(d=(0,x.jsx)(hk,{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},vk=(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},yk=({htmlFor:e,required:t=!1,disabled:n=!1,className:r,children:i,...a})=>(0,x.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,x.jsx)(`span`,{className:`ml-1 text-error`,"aria-hidden":`true`,title:`This field is required`,children:`*`})]});function bk(e,[t,n]){return Math.min(n,Math.max(t,e))}var xk=b.createContext(void 0);function Sk(e){let t=b.useContext(xk);return e||t||`ltr`}var Ck=0,wk=null;function Tk(){b.useEffect(()=>{wk||={start:Ek(),end:Ek()};let{start:e,end:t}=wk;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ck++,()=>{Ck===1&&(wk?.start.remove(),wk?.end.remove(),wk=null),Ck=Math.max(0,Ck-1)}},[])}function Ek(){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 Dk=Object.defineProperty,Ok=(e,t)=>Dk(e,`name`,{value:t,configurable:!0}),kk=`focusScope.autoFocusOnMount`,Ak=`focusScope.autoFocusOnUnmount`,jk={bubbles:!1,cancelable:!0},Mk=b.forwardRef(Ok(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=Ul(i),u=Ul(a),d=b.useRef(null),f=Tl(t,c),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:zk(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||zk(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&zk(s)};Ok(e,`handleFocusIn`),Ok(t,`handleFocusOut`),Ok(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]),b.useEffect(()=>{if(s){Bk.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(kk,jk);s.addEventListener(kk,l),s.dispatchEvent(t),t.defaultPrevented||(Nk(Uk(Fk(s)),{select:!0}),document.activeElement===e&&zk(s))}return()=>{s.removeEventListener(kk,l),setTimeout(()=>{let t=new CustomEvent(Ak,jk);s.addEventListener(Ak,u),s.dispatchEvent(t),t.defaultPrevented||zk(e??document.body,{select:!0}),s.removeEventListener(Ak,u),Bk.remove(p)},0)}}},[s,l,u,p]);let m=b.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]=Pk(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&zk(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&zk(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,x.jsx)(K.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Nk(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(zk(r,{select:t}),document.activeElement!==n)return}Ok(Nk,`focusFirst`);function Pk(e){let t=Fk(e);return[Ik(t,e),Ik(t.reverse(),e)]}Ok(Pk,`getTabbableEdges`);function Fk(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ok(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}Ok(Fk,`getTabbableCandidates`);function Ik(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Lk(r,{upTo:t})))return r}Ok(Ik,`findVisible`);function Lk(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}Ok(Lk,`isHidden`);function Rk(e){return e instanceof HTMLInputElement&&`select`in e}Ok(Rk,`isSelectableInput`);function zk(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Rk(e)&&t&&e.select()}}Ok(zk,`focus`);var Bk=Vk();function Vk(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Hk(e,t),e.unshift(t)},remove(t){e=Hk(e,t),e[0]?.resume()}}}Ok(Vk,`createFocusScopesStack`);function Hk(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ok(Hk,`arrayRemove`);function Uk(e){return e.filter(e=>e.tagName!==`A`)}Ok(Uk,`removeLinks`);var Wk=b.useId||(()=>void 0),Gk=0;function Kk(e){let[t,n]=b.useState(Wk());return su(()=>{e||n(e=>e??String(Gk++))},[e]),e||(t?`radix-${t}`:``)}var qk=[`top`,`right`,`bottom`,`left`],Jk=[`start`,`end`],Yk=qk.reduce((e,t)=>e.concat(t,t+`-`+Jk[0],t+`-`+Jk[1]),[]),Xk=Math.min,Zk=Math.max,Qk=Math.round,$k=Math.floor,eA=e=>({x:e,y:e}),tA={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nA(e,t,n){return Zk(e,Xk(t,n))}function rA(e,t){return typeof e==`function`?e(t):e}function iA(e){return e.split(`-`)[0]}function aA(e){return e.split(`-`)[1]}function oA(e){return e===`x`?`y`:`x`}function sA(e){return e===`y`?`height`:`width`}function cA(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function lA(e){return oA(cA(e))}function uA(e,t,n){n===void 0&&(n=!1);let r=aA(e),i=lA(e),a=sA(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yA(o)),[o,yA(o)]}function dA(e){let t=yA(e);return[fA(e),t,fA(t)]}function fA(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pA=[`left`,`right`],mA=[`right`,`left`],hA=[`top`,`bottom`],gA=[`bottom`,`top`];function _A(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mA:pA:t?pA:mA;case`left`:case`right`:return t?hA:gA;default:return[]}}function vA(e,t,n,r){let i=aA(e),a=_A(iA(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fA)))),a}function yA(e){let t=iA(e);return tA[t]+e.slice(t.length)}function bA(e){return{top:0,right:0,bottom:0,left:0,...e}}function xA(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bA(e)}function SA(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 CA(e,t,n){let{reference:r,floating:i}=e,a=cA(t),o=lA(t),s=sA(o),c=iA(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(aA(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function wA(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}=rA(t,e),p=xA(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=SA(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=SA(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 TA=50,EA=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:wA},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=CA(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<TA&&(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}=CA(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},DA=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}=rA(e,t)||{};if(l==null)return{};let d=xA(u),f={x:n,y:r},p=lA(i),m=sA(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=Xk(d[_],T),D=Xk(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=nA(O,A,k),M=!c.arrow&&aA(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 OA(e,t,n){return(e?[...n.filter(t=>aA(t)===e),...n.filter(t=>aA(t)!==e)]:n.filter(e=>iA(e)===e)).filter(n=>!e||aA(n)===e||(t?fA(n)!==n:!1))}var kA=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=Yk,autoAlignment:u=!0,...d}=rA(e,t),f=c!==void 0||l===Yk?OA(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=uA(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[iA(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=aA(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,aA(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}}}}},AA=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}=rA(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=iA(r),_=cA(o),v=iA(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yA(o)]:dA(o)),x=p!==`none`;!d&&x&&b.push(...vA(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=uA(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`&&_!==cA(t))||T.every(e=>cA(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=cA(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function jA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MA(e){return qk.some(t=>e[t]>=0)}var NA=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=rA(e,t);switch(i){case`referenceHidden`:{let e=jA(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:MA(e)}}}case`escaped`:{let e=jA(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:MA(e)}}}default:return{}}}}};function PA(e){let t=Xk(...e.map(e=>e.left)),n=Xk(...e.map(e=>e.top)),r=Zk(...e.map(e=>e.right)),i=Zk(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function FA(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=>SA(PA(e)))}var IA=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}=rA(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=FA(u),f=SA(PA(u)),p=xA(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(cA(n)===`y`){let e=d[0],t=d[d.length-1],r=iA(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=iA(n)===`left`,t=Zk(...d.map(e=>e.right)),r=Xk(...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}}:{}}}},LA=new Set([`left`,`top`]);async function RA(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=iA(n),s=aA(n),c=cA(n)===`y`,l=LA.has(o)?-1:1,u=a&&c?-1:1,d=rA(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 zA=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 RA(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}}}}},BA=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}=rA(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cA(iA(i)),p=oA(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=nA(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=nA(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}}}}}},VA=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}=rA(e,t),u={x:n,y:r},d=cA(i),f=oA(d),p=u[f],m=u[d],h=rA(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=LA.has(iA(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}}}},HA=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}=rA(e,t),u=await o.detectOverflow(t,l),d=iA(i),f=aA(i),p=cA(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=Xk(h-u[g],v),x=Xk(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=Zk(u.left,0),t=Zk(u.right,0),n=Zk(u.top,0),r=Zk(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Zk(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Zk(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 UA(){return typeof window<`u`}function WA(e){return qA(e)?(e.nodeName||``).toLowerCase():`#document`}function GA(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function KA(e){return((qA(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qA(e){return UA()?e instanceof Node||e instanceof GA(e).Node:!1}function JA(e){return UA()?e instanceof Element||e instanceof GA(e).Element:!1}function YA(e){return UA()?e instanceof HTMLElement||e instanceof GA(e).HTMLElement:!1}function XA(e){return!UA()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof GA(e).ShadowRoot}function ZA(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=cj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function QA(e){return/^(table|td|th)$/.test(WA(e))}function $A(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/,tj=/paint|layout|strict|content/,nj=e=>!!e&&e!==`none`,rj;function ij(e){let t=JA(e)?cj(e):e;return nj(t.transform)||nj(t.translate)||nj(t.scale)||nj(t.rotate)||nj(t.perspective)||!oj()&&(nj(t.backdropFilter)||nj(t.filter))||ej.test(t.willChange||``)||tj.test(t.contain||``)}function aj(e){let t=uj(e);for(;YA(t)&&!sj(t);){if(ij(t))return t;if($A(t))return null;t=uj(t)}return null}function oj(){return rj??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),rj}function sj(e){return/^(html|body|#document)$/.test(WA(e))}function cj(e){return GA(e).getComputedStyle(e)}function lj(e){return JA(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uj(e){if(WA(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||XA(e)&&e.host||KA(e);return XA(t)?t.host:t}function dj(e){let t=uj(e);return sj(t)?e.ownerDocument?e.ownerDocument.body:e.body:YA(t)&&ZA(t)?t:dj(t)}function fj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=dj(e),i=r===e.ownerDocument?.body,a=GA(r);if(i){let e=pj(a);return t.concat(a,a.visualViewport||[],ZA(r)?r:[],e&&n?fj(e):[])}else return t.concat(r,fj(r,[],n))}function pj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mj(e){let t=cj(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=YA(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qk(n)!==a||Qk(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function hj(e){return JA(e)?e:e.contextElement}function gj(e){let t=hj(e);if(!YA(t))return eA(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=mj(t),o=(a?Qk(n.width):n.width)/r,s=(a?Qk(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var _j=eA(0);function vj(e){let t=GA(e);return!oj()||!t.visualViewport?_j:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==GA(e)?!1:t}function bj(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=hj(e),o=eA(1);t&&(r?JA(r)&&(o=gj(r)):o=gj(e));let s=yj(a,n,r)?vj(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=GA(a),t=r&&JA(r)?GA(r):r,n=e,i=pj(n);for(;i&&r&&t!==n;){let e=gj(i),t=i.getBoundingClientRect(),r=cj(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=GA(i),i=pj(n)}}return SA({width:u,height:d,x:c,y:l})}function xj(e,t){let n=lj(e).scrollLeft;return t?t.left+n:bj(KA(e)).left+n}function Sj(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xj(e,n),y:n.top+t.scrollTop}}function Cj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=KA(r),s=t?$A(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eA(1),u=eA(0),d=YA(r);if((d||!d&&!a)&&((WA(r)!==`body`||ZA(o))&&(c=lj(r)),d)){let e=bj(r);l=gj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Sj(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 wj(e){return Array.from(e.getClientRects())}function Tj(e){let t=KA(e),n=lj(e),r=e.ownerDocument.body,i=Zk(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Zk(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xj(e),s=-n.scrollTop;return cj(r).direction===`rtl`&&(o+=Zk(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ej=25;function Dj(e,t){let n=GA(e),r=KA(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=oj();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xj(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<=Ej&&(a-=o)}else l<=Ej&&(a+=l);return{width:a,height:o,x:s,y:c}}function Oj(e,t){let n=bj(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=YA(e)?gj(e):eA(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function kj(e,t,n){let r;if(t===`viewport`)r=Dj(e,n);else if(t===`document`)r=Tj(KA(e));else if(JA(t))r=Oj(t,n);else{let n=vj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return SA(r)}function Aj(e,t){let n=uj(e);return n===t||!JA(n)||sj(n)?!1:cj(n).position===`fixed`||Aj(n,t)}function jj(e,t){let n=t.get(e);if(n)return n;let r=fj(e,[],!1).filter(e=>JA(e)&&WA(e)!==`body`),i=null,a=cj(e).position===`fixed`,o=a?uj(e):e;for(;JA(o)&&!sj(o);){let t=cj(o),n=ij(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||ZA(o)&&!n&&Aj(e,o))?r=r.filter(e=>e!==o):i=t,o=uj(o)}return t.set(e,r),r}function Mj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?$A(t)?[]:jj(t,this._c):[].concat(n),r],o=kj(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=kj(t,a[e],i);s=Zk(n.top,s),c=Xk(n.right,c),l=Xk(n.bottom,l),u=Zk(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Nj(e){let{width:t,height:n}=mj(e);return{width:t,height:n}}function Pj(e,t,n){let r=YA(t),i=KA(t),a=n===`fixed`,o=bj(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eA(0);function l(){c.x=xj(i)}if(r||!r&&!a)if((WA(t)!==`body`||ZA(i))&&(s=lj(t)),r){let e=bj(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?Sj(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 Fj(e){return cj(e).position===`static`}function Ij(e,t){if(!YA(e)||cj(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return KA(e)===n&&(n=n.ownerDocument.body),n}function Lj(e,t){let n=GA(e);if($A(e))return n;if(!YA(e)){let t=uj(e);for(;t&&!sj(t);){if(JA(t)&&!Fj(t))return t;t=uj(t)}return n}let r=Ij(e,t);for(;r&&QA(r)&&Fj(r);)r=Ij(r,t);return r&&sj(r)&&Fj(r)&&!ij(r)?n:r||aj(e)||n}var Rj=async function(e){let t=this.getOffsetParent||Lj,n=this.getDimensions,r=await n(e.floating);return{reference:Pj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zj(e){return cj(e).direction===`rtl`}var Bj={convertOffsetParentRelativeRectToViewportRelativeRect:Cj,getDocumentElement:KA,getClippingRect:Mj,getOffsetParent:Lj,getElementRects:Rj,getClientRects:wj,getDimensions:Nj,getScale:gj,isElement:JA,isRTL:zj};function Vj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hj(e,t){let n=null,r,i=KA(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=$k(d),h=$k(i.clientWidth-(u+f)),g=$k(i.clientHeight-(d+p)),_=$k(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zk(0,Xk(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&&!Vj(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 Uj(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=hj(e),u=i||a?[...l?fj(l):[],...t?fj(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Hj(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?bj(e):null;c&&g();function g(){let t=bj(e);h&&!Vj(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 Wj=zA,Gj=kA,Kj=BA,qj=AA,Jj=HA,Yj=NA,Xj=DA,Zj=IA,Qj=VA,$j=(e,t,n)=>{let r=new Map,i={platform:Bj,...n},a={...i.platform,_c:r};return EA(e,t,{...i,platform:a})},eM=typeof document<`u`?b.useLayoutEffect:function(){};function tM(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(!tM(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)&&!tM(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function nM(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rM(e,t){let n=nM(e);return Math.round(t*n)/n}function iM(e){let t=b.useRef(e);return eM(()=>{t.current=e}),t}function aM(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]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);tM(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=iM(c),O=iM(i),k=iM(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),$j(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!tM(T.current,t)&&(T.current=t,G.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=b.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=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=rM(N.floating,u.x),r=rM(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...nM(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var oM=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?{}:Xj({element:r.current,padding:i}).fn(n):r?Xj({element:r,padding:i}).fn(n):{}}}},sM=(e,t)=>{let n=Wj(e);return{name:n.name,fn:n.fn,options:[e,t]}},cM=(e,t)=>{let n=Kj(e);return{name:n.name,fn:n.fn,options:[e,t]}},lM=(e,t)=>({fn:Qj(e).fn,options:[e,t]}),uM=(e,t)=>{let n=qj(e);return{name:n.name,fn:n.fn,options:[e,t]}},dM=(e,t)=>{let n=Jj(e);return{name:n.name,fn:n.fn,options:[e,t]}},fM=(e,t)=>{let n=Yj(e);return{name:n.name,fn:n.fn,options:[e,t]}},pM=(e,t)=>{let n=oM(e);return{name:n.name,fn:n.fn,options:[e,t]}};function mM(e){let[t,n]=b.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)}else n(void 0)},[e]),t}var hM=Object.defineProperty,gM=(e,t)=>hM(e,`name`,{value:t,configurable:!0}),_M=`Popper`,[vM,yM]=El(_M),[bM,xM]=vM(_M),SM=gM(e=>{let{__scopePopper:t,children:n}=e,[r,i]=b.useState(null),[a,o]=b.useState(void 0);return(0,x.jsx)(bM,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),CM=`PopperAnchor`,wM=b.forwardRef(gM(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=xM(CM,n),o=b.useRef(null),s=a.onAnchorChange,c=Tl(t,b.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=b.useRef(null);b.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&jM(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,x.jsx)(K.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),TM=`PopperContent`,[EM,DM]=vM(TM),OM=b.forwardRef(gM(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=xM(TM,n),[_,v]=b.useState(null),y=Tl(t,v),[S,C]=b.useState(null),w=mM(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(kM),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=aM({strategy:`fixed`,placement:D,whileElementsMounted:gM((...e)=>Uj(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[sM({mainAxis:i+E,alignmentAxis:o}),c&&cM({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?lM():void 0,...j}),c&&uM({...j}),dM({...j,apply:gM(({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&&pM({element:S,padding:s}),AM({arrowWidth:T,arrowHeight:E}),f&&fM({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),L=g.setPlacementState;su(()=>(L(P),()=>{L(void 0)}),[P,L]);let[ee,te]=jM(P),ne=Ul(m);su(()=>{F&&ne?.()},[F,ne]);let R=I.arrow?.x,z=I.arrow?.y,B=I.arrow?.centerOffset!==0,[re,ie]=b.useState();return su(()=>{_&&ie(window.getComputedStyle(_).zIndex)},[_]),(0,x.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,x.jsx)(EM,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:C,arrowX:R,arrowY:z,shouldHideArrow:B,children:(0,x.jsx)(K.div,{"data-side":ee,"data-align":te,...h,ref:y,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function kM(e){return e!==null}gM(kM,`isNotNull`);var AM=gM(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]=jM(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 jM(e){let[t,n=`center`]=e.split(`-`);return[t,n]}gM(jM,`getSideAndAlignFromPlacement`);var MM=SM,NM=wM,PM=OM;function FM(e){let t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var IM=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},LM=new WeakMap,RM=new WeakMap,zM={},BM=0,VM=function(e){return e&&(e.host||VM(e.parentNode))},HM=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=VM(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})},UM=function(e,t,n,r){var i=HM(t,Array.isArray(e)?e:[e]);zM[n]||(zM[n]=new WeakMap);var a=zM[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=(LM.get(e)||0)+1,l=(a.get(e)||0)+1;LM.set(e,c),a.set(e,l),o.push(e),c===1&&i&&RM.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(),BM++,function(){o.forEach(function(e){var t=LM.get(e)-1,i=a.get(e)-1;LM.set(e,t),a.set(e,i),t||(RM.has(e)||e.removeAttribute(r),RM.delete(e)),i||e.removeAttribute(n)}),BM--,BM||(LM=new WeakMap,LM=new WeakMap,RM=new WeakMap,zM={})}},WM=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||IM(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),UM(r,i,n,`aria-hidden`)):function(){return null}},GM=function(){return GM=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},GM.apply(this,arguments)};function KM(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 qM(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 JM=`right-scroll-bar-position`,YM=`width-before-scroll-bar`,XM=`with-scroll-bars-hidden`,ZM=`--removed-body-scroll-bar-size`;function QM(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function $M(e,t){var n=(0,b.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 eN=typeof window<`u`?b.useLayoutEffect:b.useEffect,tN=new WeakMap;function nN(e,t){var n=$M(t||null,function(t){return e.forEach(function(e){return QM(e,t)})});return eN(function(){var t=tN.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||QM(e,null)}),i.forEach(function(e){r.has(e)||QM(e,a)})}tN.set(n,e)},[e]),n}function rN(e){return e}function iN(e,t){t===void 0&&(t=rN);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 aN(e){e===void 0&&(e={});var t=iN(null);return t.options=GM({async:!0,ssr:!1},e),t}var oN=function(e){var t=e.sideCar,n=KM(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 b.createElement(r,GM({},n))};oN.isSideCarExport=!0;function sN(e,t){return e.useMedium(t),oN}var cN=aN(),lN=function(){},uN=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:lN,onWheelCapture:lN,onTouchMoveCapture:lN}),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,v=_===void 0?`div`:_,y=e.gapMode,x=KM(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=nN([n,t]),w=GM(GM({},x),i);return b.createElement(b.Fragment,null,u&&b.createElement(S,{sideCar:cN,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),GM(GM({},w),{ref:C})):b.createElement(v,GM({},w,{className:c,ref:C}),s))});uN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},uN.classNames={fullWidth:YM,zeroRight:JM};var dN,fN=function(){if(dN)return dN;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function pN(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=fN();return t&&e.setAttribute(`nonce`,t),e}function mN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hN(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var gN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pN())&&(mN(t,n),hN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_N=function(){var e=gN();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vN=function(){var e=_N();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},yN={left:0,top:0,right:0,gap:0},bN=function(e){return parseInt(e||``,10)||0},xN=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[bN(n),bN(r),bN(i)]},SN=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return yN;var t=xN(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])}},CN=vN(),wN=`data-scroll-locked`,TN=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),`
|
|
58
|
+
`);return(0,x.jsx)(lk,{ref:s,value:r,onChange:e=>{if(i(e),o(``),n.onChange){let t={target:{value:e},currentTarget:{value:e}};n.onChange(t)}},onKeyDown:e=>{e.key===`Tab`&&(t??a)&&(e.preventDefault(),c()),n.onKeyDown?.(e)},ghostText:l,ghostLine:t?u.length-1:void 0,ghostOffset:t?u[u.length-1]?.length??0:void 0,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`]})},dk=e=>{let t=(0,V.c)(9),{children:n,onContentChange:r,disabled:i,validate:a,additionalButtons:o,...s}=e,{isAuthenticated:c}=VD(),[l,u]=(0,b.useState)(n),[d,f]=(0,b.useState)(0),p=l!==n,m;t[0]===n?m=t[1]:(m=()=>{u(n),f(fk)},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,v;t[5]===Symbol.for(`react.memo_cache_sentinel`)?(v=e=>u(e.currentTarget.value??``),t[5]=v):v=t[5];let y=v,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(pk)},w=[n],t[6]=n,t[7]=C,t[8]=w),(0,b.useEffect)(C,w);let T=a?.(l)??!0;return(0,x.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor textarea`,children:[(0,x.jsx)(uk,{onChange:y,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,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(iO,{Icon:Jd,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,x.jsx)(iO,{Icon:_f,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:h,disabled:i})]}),o]})]},n)};function fk(e){return e+1}function pk(e){return e+1}var mk=(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,b.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,b.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},hk=(0,b.createContext)({availableLocales:[],selectedLocales:[],setSelectedLocales:()=>{}}),gk=()=>(0,b.useContext)(hk),_k=e=>{let t=(0,V.c)(16),{availableLocales:n,defaultSelectedLocales:r,children:i}=e,{locale:a}=an(),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]=mk(`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,b.useEffect)(l,u);let d;return t[11]!==n||t[12]!==i||t[13]!==s||t[14]!==c?(d=(0,x.jsx)(hk,{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},vk=(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},yk=({htmlFor:e,required:t=!1,disabled:n=!1,className:r,children:i,...a})=>(0,x.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,x.jsx)(`span`,{className:`ml-1 text-error`,"aria-hidden":`true`,title:`This field is required`,children:`*`})]});function bk(e,[t,n]){return Math.min(n,Math.max(t,e))}var xk=b.createContext(void 0);function Sk(e){let t=b.useContext(xk);return e||t||`ltr`}var Ck=0,wk=null;function Tk(){b.useEffect(()=>{wk||={start:Ek(),end:Ek()};let{start:e,end:t}=wk;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ck++,()=>{Ck===1&&(wk?.start.remove(),wk?.end.remove(),wk=null),Ck=Math.max(0,Ck-1)}},[])}function Ek(){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 Dk=Object.defineProperty,Ok=(e,t)=>Dk(e,`name`,{value:t,configurable:!0}),kk=`focusScope.autoFocusOnMount`,Ak=`focusScope.autoFocusOnUnmount`,jk={bubbles:!1,cancelable:!0},Mk=b.forwardRef(Ok(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=Ul(i),u=Ul(a),d=b.useRef(null),f=Tl(t,c),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:zk(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||zk(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&zk(s)};Ok(e,`handleFocusIn`),Ok(t,`handleFocusOut`),Ok(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]),b.useEffect(()=>{if(s){Bk.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(kk,jk);s.addEventListener(kk,l),s.dispatchEvent(t),t.defaultPrevented||(Nk(Uk(Fk(s)),{select:!0}),document.activeElement===e&&zk(s))}return()=>{s.removeEventListener(kk,l),setTimeout(()=>{let t=new CustomEvent(Ak,jk);s.addEventListener(Ak,u),s.dispatchEvent(t),t.defaultPrevented||zk(e??document.body,{select:!0}),s.removeEventListener(Ak,u),Bk.remove(p)},0)}}},[s,l,u,p]);let m=b.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]=Pk(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&zk(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&zk(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,x.jsx)(K.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function Nk(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(zk(r,{select:t}),document.activeElement!==n)return}Ok(Nk,`focusFirst`);function Pk(e){let t=Fk(e);return[Ik(t,e),Ik(t.reverse(),e)]}Ok(Pk,`getTabbableEdges`);function Fk(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:Ok(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}Ok(Fk,`getTabbableCandidates`);function Ik(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):Lk(r,{upTo:t})))return r}Ok(Ik,`findVisible`);function Lk(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}Ok(Lk,`isHidden`);function Rk(e){return e instanceof HTMLInputElement&&`select`in e}Ok(Rk,`isSelectableInput`);function zk(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Rk(e)&&t&&e.select()}}Ok(zk,`focus`);var Bk=Vk();function Vk(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=Hk(e,t),e.unshift(t)},remove(t){e=Hk(e,t),e[0]?.resume()}}}Ok(Vk,`createFocusScopesStack`);function Hk(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}Ok(Hk,`arrayRemove`);function Uk(e){return e.filter(e=>e.tagName!==`A`)}Ok(Uk,`removeLinks`);var Wk=b.useId||(()=>void 0),Gk=0;function Kk(e){let[t,n]=b.useState(Wk());return su(()=>{e||n(e=>e??String(Gk++))},[e]),e||(t?`radix-${t}`:``)}var qk=[`top`,`right`,`bottom`,`left`],Jk=[`start`,`end`],Yk=qk.reduce((e,t)=>e.concat(t,t+`-`+Jk[0],t+`-`+Jk[1]),[]),Xk=Math.min,Zk=Math.max,Qk=Math.round,$k=Math.floor,eA=e=>({x:e,y:e}),tA={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function nA(e,t,n){return Zk(e,Xk(t,n))}function rA(e,t){return typeof e==`function`?e(t):e}function iA(e){return e.split(`-`)[0]}function aA(e){return e.split(`-`)[1]}function oA(e){return e===`x`?`y`:`x`}function sA(e){return e===`y`?`height`:`width`}function cA(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function lA(e){return oA(cA(e))}function uA(e,t,n){n===void 0&&(n=!1);let r=aA(e),i=lA(e),a=sA(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=yA(o)),[o,yA(o)]}function dA(e){let t=yA(e);return[fA(e),t,fA(t)]}function fA(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var pA=[`left`,`right`],mA=[`right`,`left`],hA=[`top`,`bottom`],gA=[`bottom`,`top`];function _A(e,t,n){switch(e){case`top`:case`bottom`:return n?t?mA:pA:t?pA:mA;case`left`:case`right`:return t?hA:gA;default:return[]}}function vA(e,t,n,r){let i=aA(e),a=_A(iA(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(fA)))),a}function yA(e){let t=iA(e);return tA[t]+e.slice(t.length)}function bA(e){return{top:0,right:0,bottom:0,left:0,...e}}function xA(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:bA(e)}function SA(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 CA(e,t,n){let{reference:r,floating:i}=e,a=cA(t),o=lA(t),s=sA(o),c=iA(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(aA(t)){case`start`:p[o]-=f*(n&&l?-1:1);break;case`end`:p[o]+=f*(n&&l?-1:1);break}return p}async function wA(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}=rA(t,e),p=xA(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=SA(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=SA(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 TA=50,EA=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:wA},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=CA(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<TA&&(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}=CA(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},DA=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}=rA(e,t)||{};if(l==null)return{};let d=xA(u),f={x:n,y:r},p=lA(i),m=sA(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=Xk(d[_],T),D=Xk(d[v],T),O=E,k=C-h[m]-D,A=C/2-h[m]/2+w,j=nA(O,A,k),M=!c.arrow&&aA(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 OA(e,t,n){return(e?[...n.filter(t=>aA(t)===e),...n.filter(t=>aA(t)!==e)]:n.filter(e=>iA(e)===e)).filter(n=>!e||aA(n)===e||(t?fA(n)!==n:!1))}var kA=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=Yk,autoAlignment:u=!0,...d}=rA(e,t),f=c!==void 0||l===Yk?OA(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=uA(h,n,await(a.isRTL==null?void 0:a.isRTL(o.floating)));if(i!==h)return{reset:{placement:f[0]}};let _=[p[iA(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=aA(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,aA(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}}}}},AA=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}=rA(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=iA(r),_=cA(o),v=iA(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[yA(o)]:dA(o)),x=p!==`none`;!d&&x&&b.push(...vA(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=uA(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`&&_!==cA(t))||T.every(e=>cA(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=cA(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function jA(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function MA(e){return qk.some(t=>e[t]>=0)}var NA=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=rA(e,t);switch(i){case`referenceHidden`:{let e=jA(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:MA(e)}}}case`escaped`:{let e=jA(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:MA(e)}}}default:return{}}}}};function PA(e){let t=Xk(...e.map(e=>e.left)),n=Xk(...e.map(e=>e.top)),r=Zk(...e.map(e=>e.right)),i=Zk(...e.map(e=>e.bottom));return{x:t,y:n,width:r-t,height:i-n}}function FA(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=>SA(PA(e)))}var IA=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}=rA(e,t),u=Array.from(await(a.getClientRects==null?void 0:a.getClientRects(r.reference))||[]),d=FA(u),f=SA(PA(u)),p=xA(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(cA(n)===`y`){let e=d[0],t=d[d.length-1],r=iA(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=iA(n)===`left`,t=Zk(...d.map(e=>e.right)),r=Xk(...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}}:{}}}},LA=new Set([`left`,`top`]);async function RA(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=iA(n),s=aA(n),c=cA(n)===`y`,l=LA.has(o)?-1:1,u=a&&c?-1:1,d=rA(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 zA=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 RA(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}}}}},BA=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}=rA(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=cA(iA(i)),p=oA(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=nA(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=nA(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}}}}}},VA=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}=rA(e,t),u={x:n,y:r},d=cA(i),f=oA(d),p=u[f],m=u[d],h=rA(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=LA.has(iA(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}}}},HA=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}=rA(e,t),u=await o.detectOverflow(t,l),d=iA(i),f=aA(i),p=cA(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=Xk(h-u[g],v),x=Xk(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=Zk(u.left,0),t=Zk(u.right,0),n=Zk(u.top,0),r=Zk(u.bottom,0);p?w=m-2*(e!==0||t!==0?e+t:Zk(u.left,u.right)):C=h-2*(n!==0||r!==0?n+r:Zk(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 UA(){return typeof window<`u`}function WA(e){return qA(e)?(e.nodeName||``).toLowerCase():`#document`}function GA(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function KA(e){return((qA(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function qA(e){return UA()?e instanceof Node||e instanceof GA(e).Node:!1}function JA(e){return UA()?e instanceof Element||e instanceof GA(e).Element:!1}function YA(e){return UA()?e instanceof HTMLElement||e instanceof GA(e).HTMLElement:!1}function XA(e){return!UA()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof GA(e).ShadowRoot}function ZA(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=cj(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function QA(e){return/^(table|td|th)$/.test(WA(e))}function $A(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/,tj=/paint|layout|strict|content/,nj=e=>!!e&&e!==`none`,rj;function ij(e){let t=JA(e)?cj(e):e;return nj(t.transform)||nj(t.translate)||nj(t.scale)||nj(t.rotate)||nj(t.perspective)||!oj()&&(nj(t.backdropFilter)||nj(t.filter))||ej.test(t.willChange||``)||tj.test(t.contain||``)}function aj(e){let t=uj(e);for(;YA(t)&&!sj(t);){if(ij(t))return t;if($A(t))return null;t=uj(t)}return null}function oj(){return rj??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),rj}function sj(e){return/^(html|body|#document)$/.test(WA(e))}function cj(e){return GA(e).getComputedStyle(e)}function lj(e){return JA(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function uj(e){if(WA(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||XA(e)&&e.host||KA(e);return XA(t)?t.host:t}function dj(e){let t=uj(e);return sj(t)?e.ownerDocument?e.ownerDocument.body:e.body:YA(t)&&ZA(t)?t:dj(t)}function fj(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=dj(e),i=r===e.ownerDocument?.body,a=GA(r);if(i){let e=pj(a);return t.concat(a,a.visualViewport||[],ZA(r)?r:[],e&&n?fj(e):[])}else return t.concat(r,fj(r,[],n))}function pj(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function mj(e){let t=cj(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=YA(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=Qk(n)!==a||Qk(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function hj(e){return JA(e)?e:e.contextElement}function gj(e){let t=hj(e);if(!YA(t))return eA(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=mj(t),o=(a?Qk(n.width):n.width)/r,s=(a?Qk(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var _j=eA(0);function vj(e){let t=GA(e);return!oj()||!t.visualViewport?_j:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function yj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==GA(e)?!1:t}function bj(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=hj(e),o=eA(1);t&&(r?JA(r)&&(o=gj(r)):o=gj(e));let s=yj(a,n,r)?vj(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=GA(a),t=r&&JA(r)?GA(r):r,n=e,i=pj(n);for(;i&&r&&t!==n;){let e=gj(i),t=i.getBoundingClientRect(),r=cj(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=GA(i),i=pj(n)}}return SA({width:u,height:d,x:c,y:l})}function xj(e,t){let n=lj(e).scrollLeft;return t?t.left+n:bj(KA(e)).left+n}function Sj(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-xj(e,n),y:n.top+t.scrollTop}}function Cj(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=KA(r),s=t?$A(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=eA(1),u=eA(0),d=YA(r);if((d||!d&&!a)&&((WA(r)!==`body`||ZA(o))&&(c=lj(r)),d)){let e=bj(r);l=gj(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?Sj(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 wj(e){return Array.from(e.getClientRects())}function Tj(e){let t=KA(e),n=lj(e),r=e.ownerDocument.body,i=Zk(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Zk(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight),o=-n.scrollLeft+xj(e),s=-n.scrollTop;return cj(r).direction===`rtl`&&(o+=Zk(t.clientWidth,r.clientWidth)-i),{width:i,height:a,x:o,y:s}}var Ej=25;function Dj(e,t){let n=GA(e),r=KA(e),i=n.visualViewport,a=r.clientWidth,o=r.clientHeight,s=0,c=0;if(i){a=i.width,o=i.height;let e=oj();(!e||e&&t===`fixed`)&&(s=i.offsetLeft,c=i.offsetTop)}let l=xj(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<=Ej&&(a-=o)}else l<=Ej&&(a+=l);return{width:a,height:o,x:s,y:c}}function Oj(e,t){let n=bj(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=YA(e)?gj(e):eA(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function kj(e,t,n){let r;if(t===`viewport`)r=Dj(e,n);else if(t===`document`)r=Tj(KA(e));else if(JA(t))r=Oj(t,n);else{let n=vj(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return SA(r)}function Aj(e,t){let n=uj(e);return n===t||!JA(n)||sj(n)?!1:cj(n).position===`fixed`||Aj(n,t)}function jj(e,t){let n=t.get(e);if(n)return n;let r=fj(e,[],!1).filter(e=>JA(e)&&WA(e)!==`body`),i=null,a=cj(e).position===`fixed`,o=a?uj(e):e;for(;JA(o)&&!sj(o);){let t=cj(o),n=ij(o);!n&&t.position===`fixed`&&(i=null),(a?!n&&!i:!n&&t.position===`static`&&i&&(i.position===`absolute`||i.position===`fixed`)||ZA(o)&&!n&&Aj(e,o))?r=r.filter(e=>e!==o):i=t,o=uj(o)}return t.set(e,r),r}function Mj(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?$A(t)?[]:jj(t,this._c):[].concat(n),r],o=kj(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=kj(t,a[e],i);s=Zk(n.top,s),c=Xk(n.right,c),l=Xk(n.bottom,l),u=Zk(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Nj(e){let{width:t,height:n}=mj(e);return{width:t,height:n}}function Pj(e,t,n){let r=YA(t),i=KA(t),a=n===`fixed`,o=bj(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=eA(0);function l(){c.x=xj(i)}if(r||!r&&!a)if((WA(t)!==`body`||ZA(i))&&(s=lj(t)),r){let e=bj(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?Sj(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 Fj(e){return cj(e).position===`static`}function Ij(e,t){if(!YA(e)||cj(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return KA(e)===n&&(n=n.ownerDocument.body),n}function Lj(e,t){let n=GA(e);if($A(e))return n;if(!YA(e)){let t=uj(e);for(;t&&!sj(t);){if(JA(t)&&!Fj(t))return t;t=uj(t)}return n}let r=Ij(e,t);for(;r&&QA(r)&&Fj(r);)r=Ij(r,t);return r&&sj(r)&&Fj(r)&&!ij(r)?n:r||aj(e)||n}var Rj=async function(e){let t=this.getOffsetParent||Lj,n=this.getDimensions,r=await n(e.floating);return{reference:Pj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function zj(e){return cj(e).direction===`rtl`}var Bj={convertOffsetParentRelativeRectToViewportRelativeRect:Cj,getDocumentElement:KA,getClippingRect:Mj,getOffsetParent:Lj,getElementRects:Rj,getClientRects:wj,getDimensions:Nj,getScale:gj,isElement:JA,isRTL:zj};function Vj(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Hj(e,t){let n=null,r,i=KA(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=$k(d),h=$k(i.clientWidth-(u+f)),g=$k(i.clientHeight-(d+p)),_=$k(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:Zk(0,Xk(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&&!Vj(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 Uj(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=hj(e),u=i||a?[...l?fj(l):[],...t?fj(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n,{passive:!0}),a&&e.addEventListener(`resize`,n)});let d=l&&s?Hj(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?bj(e):null;c&&g();function g(){let t=bj(e);h&&!Vj(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 Wj=zA,Gj=kA,Kj=BA,qj=AA,Jj=HA,Yj=NA,Xj=DA,Zj=IA,Qj=VA,$j=(e,t,n)=>{let r=new Map,i={platform:Bj,...n},a={...i.platform,_c:r};return EA(e,t,{...i,platform:a})},eM=typeof document<`u`?b.useLayoutEffect:function(){};function tM(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(!tM(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)&&!tM(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function nM(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rM(e,t){let n=nM(e);return Math.round(t*n)/n}function iM(e){let t=b.useRef(e);return eM(()=>{t.current=e}),t}function aM(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]=b.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);tM(f,r)||p(r);let[m,h]=b.useState(null),[g,_]=b.useState(null),v=b.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),y=b.useCallback(e=>{e!==w.current&&(w.current=e,_(e))},[]),x=a||m,S=o||g,C=b.useRef(null),w=b.useRef(null),T=b.useRef(u),E=c!=null,D=iM(c),O=iM(i),k=iM(l),A=b.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),$j(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};j.current&&!tM(T.current,t)&&(T.current=t,G.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=b.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=b.useMemo(()=>({reference:C,floating:w,setReference:v,setFloating:y}),[v,y]),N=b.useMemo(()=>({reference:x,floating:S}),[x,S]),P=b.useMemo(()=>{let e={position:n,left:0,top:0};if(!N.floating)return e;let t=rM(N.floating,u.x),r=rM(N.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...nM(N.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,N.floating,u.x,u.y]);return b.useMemo(()=>({...u,update:A,refs:M,elements:N,floatingStyles:P}),[u,A,M,N,P])}var oM=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?{}:Xj({element:r.current,padding:i}).fn(n):r?Xj({element:r,padding:i}).fn(n):{}}}},sM=(e,t)=>{let n=Wj(e);return{name:n.name,fn:n.fn,options:[e,t]}},cM=(e,t)=>{let n=Kj(e);return{name:n.name,fn:n.fn,options:[e,t]}},lM=(e,t)=>({fn:Qj(e).fn,options:[e,t]}),uM=(e,t)=>{let n=qj(e);return{name:n.name,fn:n.fn,options:[e,t]}},dM=(e,t)=>{let n=Jj(e);return{name:n.name,fn:n.fn,options:[e,t]}},fM=(e,t)=>{let n=Yj(e);return{name:n.name,fn:n.fn,options:[e,t]}},pM=(e,t)=>{let n=oM(e);return{name:n.name,fn:n.fn,options:[e,t]}};function mM(e){let[t,n]=b.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)}else n(void 0)},[e]),t}var hM=Object.defineProperty,gM=(e,t)=>hM(e,`name`,{value:t,configurable:!0}),_M=`Popper`,[vM,yM]=El(_M),[bM,xM]=vM(_M),SM=gM(e=>{let{__scopePopper:t,children:n}=e,[r,i]=b.useState(null),[a,o]=b.useState(void 0);return(0,x.jsx)(bM,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),CM=`PopperAnchor`,wM=b.forwardRef(gM(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=xM(CM,n),o=b.useRef(null),s=a.onAnchorChange,c=Tl(t,b.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=b.useRef(null);b.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&jM(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,x.jsx)(K.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),TM=`PopperContent`,[EM,DM]=vM(TM),OM=b.forwardRef(gM(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=xM(TM,n),[_,v]=b.useState(null),y=Tl(t,v),[S,C]=b.useState(null),w=mM(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(kM),altBoundary:A},{refs:M,floatingStyles:N,placement:P,isPositioned:F,middlewareData:I}=aM({strategy:`fixed`,placement:D,whileElementsMounted:gM((...e)=>Uj(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[sM({mainAxis:i+E,alignmentAxis:o}),c&&cM({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?lM():void 0,...j}),c&&uM({...j}),dM({...j,apply:gM(({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&&pM({element:S,padding:s}),AM({arrowWidth:T,arrowHeight:E}),f&&fM({strategy:`referenceHidden`,...j,boundary:A?j.boundary:void 0})]}),L=g.setPlacementState;su(()=>(L(P),()=>{L(void 0)}),[P,L]);let[ee,te]=jM(P),ne=Ul(m);su(()=>{F&&ne?.()},[F,ne]);let R=I.arrow?.x,z=I.arrow?.y,B=I.arrow?.centerOffset!==0,[re,ie]=b.useState();return su(()=>{_&&ie(window.getComputedStyle(_).zIndex)},[_]),(0,x.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,x.jsx)(EM,{scope:n,placedSide:ee,placedAlign:te,onArrowChange:C,arrowX:R,arrowY:z,shouldHideArrow:B,children:(0,x.jsx)(K.div,{"data-side":ee,"data-align":te,...h,ref:y,style:{...h.style,animation:F?h.style?.animation:`none`}})})})},`PopperContent`));function kM(e){return e!==null}gM(kM,`isNotNull`);var AM=gM(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]=jM(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 jM(e){let[t,n=`center`]=e.split(`-`);return[t,n]}gM(jM,`getSideAndAlignFromPlacement`);var MM=SM,NM=wM,PM=OM;function FM(e){let t=b.useRef({value:e,previous:e});return b.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var IM=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},LM=new WeakMap,RM=new WeakMap,zM={},BM=0,VM=function(e){return e&&(e.host||VM(e.parentNode))},HM=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=VM(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})},UM=function(e,t,n,r){var i=HM(t,Array.isArray(e)?e:[e]);zM[n]||(zM[n]=new WeakMap);var a=zM[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=(LM.get(e)||0)+1,l=(a.get(e)||0)+1;LM.set(e,c),a.set(e,l),o.push(e),c===1&&i&&RM.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(),BM++,function(){o.forEach(function(e){var t=LM.get(e)-1,i=a.get(e)-1;LM.set(e,t),a.set(e,i),t||(RM.has(e)||e.removeAttribute(r),RM.delete(e)),i||e.removeAttribute(n)}),BM--,BM||(LM=new WeakMap,LM=new WeakMap,RM=new WeakMap,zM={})}},WM=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||IM(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),UM(r,i,n,`aria-hidden`)):function(){return null}},GM=function(){return GM=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},GM.apply(this,arguments)};function KM(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 qM(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 JM=`right-scroll-bar-position`,YM=`width-before-scroll-bar`,XM=`with-scroll-bars-hidden`,ZM=`--removed-body-scroll-bar-size`;function QM(e,t){return typeof e==`function`?e(t):e&&(e.current=t),e}function $M(e,t){var n=(0,b.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 eN=typeof window<`u`?b.useLayoutEffect:b.useEffect,tN=new WeakMap;function nN(e,t){var n=$M(t||null,function(t){return e.forEach(function(e){return QM(e,t)})});return eN(function(){var t=tN.get(n);if(t){var r=new Set(t),i=new Set(e),a=n.current;r.forEach(function(e){i.has(e)||QM(e,null)}),i.forEach(function(e){r.has(e)||QM(e,a)})}tN.set(n,e)},[e]),n}function rN(e){return e}function iN(e,t){t===void 0&&(t=rN);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 aN(e){e===void 0&&(e={});var t=iN(null);return t.options=GM({async:!0,ssr:!1},e),t}var oN=function(e){var t=e.sideCar,n=KM(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 b.createElement(r,GM({},n))};oN.isSideCarExport=!0;function sN(e,t){return e.useMedium(t),oN}var cN=aN(),lN=function(){},uN=b.forwardRef(function(e,t){var n=b.useRef(null),r=b.useState({onScrollCapture:lN,onWheelCapture:lN,onTouchMoveCapture:lN}),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,v=_===void 0?`div`:_,y=e.gapMode,x=KM(e,[`forwardProps`,`children`,`className`,`removeScrollBar`,`enabled`,`shards`,`sideCar`,`noRelative`,`noIsolation`,`inert`,`allowPinchZoom`,`as`,`gapMode`]),S=f,C=nN([n,t]),w=GM(GM({},x),i);return b.createElement(b.Fragment,null,u&&b.createElement(S,{sideCar:cN,removeScrollBar:l,shards:d,noRelative:p,noIsolation:m,inert:h,setCallbacks:a,allowPinchZoom:!!g,lockRef:n,gapMode:y}),o?b.cloneElement(b.Children.only(s),GM(GM({},w),{ref:C})):b.createElement(v,GM({},w,{className:c,ref:C}),s))});uN.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},uN.classNames={fullWidth:YM,zeroRight:JM};var dN,fN=function(){if(dN)return dN;if(typeof __webpack_nonce__<`u`)return __webpack_nonce__};function pN(){if(!document)return null;var e=document.createElement(`style`);e.type=`text/css`;var t=fN();return t&&e.setAttribute(`nonce`,t),e}function mN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function hN(e){(document.head||document.getElementsByTagName(`head`)[0]).appendChild(e)}var gN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=pN())&&(mN(t,n),hN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_N=function(){var e=gN();return function(t,n){b.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},vN=function(){var e=_N();return function(t){var n=t.styles,r=t.dynamic;return e(n,r),null}},yN={left:0,top:0,right:0,gap:0},bN=function(e){return parseInt(e||``,10)||0},xN=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[bN(n),bN(r),bN(i)]},SN=function(e){if(e===void 0&&(e=`margin`),typeof window>`u`)return yN;var t=xN(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])}},CN=vN(),wN=`data-scroll-locked`,TN=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
59
|
.${XM} {
|
|
60
60
|
overflow: hidden ${r};
|
|
61
61
|
padding-right: ${s}px ${r};
|
|
@@ -95,7 +95,7 @@ Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}
|
|
|
95
95
|
`},EN=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},DN=function(){b.useEffect(function(){return document.body.setAttribute(wN,(EN()+1).toString()),function(){var e=EN()-1;e<=0?document.body.removeAttribute(wN):document.body.setAttribute(wN,e.toString())}},[])},ON=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;DN();var a=b.useMemo(function(){return SN(i)},[i]);return b.createElement(CN,{styles:TN(a,!t,i,n?``:`!important`)})},kN=!1;if(typeof window<`u`)try{var AN=Object.defineProperty({},"passive",{get:function(){return kN=!0,!0}});window.addEventListener(`test`,AN,AN),window.removeEventListener(`test`,AN,AN)}catch{kN=!1}var jN=kN?{passive:!1}:!1,MN=function(e){return e.tagName===`TEXTAREA`},NN=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!MN(e)&&n[t]===`visible`)},PN=function(e){return NN(e,`overflowY`)},FN=function(e){return NN(e,`overflowX`)},IN=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),zN(e,r)){var i=BN(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},LN=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},RN=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},zN=function(e,t){return e===`v`?PN(t):FN(t)},BN=function(e,t){return e===`v`?LN(t):RN(t)},VN=function(e,t){return e===`h`&&t===`rtl`?-1:1},HN=function(e,t,n,r,i){var a=VN(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=BN(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&zN(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},UN=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},WN=function(e){return[e.deltaX,e.deltaY]},GN=function(e){return e&&`current`in e?e.current:e},KN=function(e,t){return e[0]===t[0]&&e[1]===t[1]},qN=function(e){return`
|
|
96
96
|
.block-interactivity-${e} {pointer-events: none;}
|
|
97
97
|
.allow-interactivity-${e} {pointer-events: all;}
|
|
98
|
-
`},JN=0,YN=[];function XN(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(JN++)[0],a=b.useState(vN)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=qM([e.lockRef.current],(e.shards||[]).map(GN),!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=b.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=UN(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=IN(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=IN(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 HN(h,t,e,h===`h`?s:c,!0)},[]),c=b.useCallback(function(e){var n=e;if(!(!YN.length||YN[YN.length-1]!==a)){var r=`deltaY`in n?WN(n):UN(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&KN(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(GN).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=b.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ZN(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=b.useCallback(function(e){n.current=UN(e),r.current=void 0},[]),d=b.useCallback(function(t){l(t.type,WN(t),t.target,s(t,e.lockRef.current))},[]),f=b.useCallback(function(t){l(t.type,UN(t),t.target,s(t,e.lockRef.current))},[]);b.useEffect(function(){return YN.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,jN),document.addEventListener(`touchmove`,c,jN),document.addEventListener(`touchstart`,u,jN),function(){YN=YN.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,jN),document.removeEventListener(`touchmove`,c,jN),document.removeEventListener(`touchstart`,u,jN)}},[]);var p=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(a,{styles:qN(i)}):null,p?b.createElement(ON,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var QN=sN(cN,XN),$N=b.forwardRef(function(e,t){return b.createElement(uN,GM({},e,{ref:t,sideCar:QN}))});$N.classNames=uN.classNames;var eP=Object.defineProperty,tP=(e,t)=>eP(e,`name`,{value:t,configurable:!0}),nP=[` `,`Enter`,`ArrowUp`,`ArrowDown`],rP=[` `,`Enter`],iP=`Select`,[aP,oP,sP]=Vl(iP),[cP,lP]=El(iP,[sP,yM]),uP=yM(),[dP,fP]=cP(iP),[pP,mP]=cP(iP);function hP(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=uP(t),[_,v]=b.useState(null),[y,S]=b.useState(null),[C,w]=b.useState(!1),T=Sk(l),[E,D]=Tu({prop:r,defaultProp:i??!1,onChange:a,caller:iP}),[O,k]=Tu({prop:o,defaultProp:s,onChange:c,caller:iP}),A=b.useRef(null),j=b.useRef(O);b.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=tP(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,k]);let M=!_||!!m||!!_.closest(`form`),[N,P]=b.useState(new Set),F=Kk(),I=Array.from(N).map(e=>e.props.value).join(`;`),L=b.useCallback(e=>{P(t=>new Set(t).add(e))},[]),ee=b.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:p,trigger:_,onTriggerChange:v,valueNode:y,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,x.jsx)(MM,{...g,children:(0,x.jsx)(dP,{scope:t,...te,children:(0,x.jsx)(aP.Provider,{scope:t,children:(0,x.jsx)(pP,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:ee,children:oF(h)?h(te):n})})})})}tP(hP,`SelectProvider`);var gP=tP(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,x.jsx)(hP,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[n,e?(0,x.jsx)(aF,{__scopeSelect:t}):null]})})},`Select`),_P=`SelectTrigger`,vP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=uP(n),o=fP(_P,n),s=o.disabled||r,c=Tl(t,o.onTriggerChange),l=oP(n),u=b.useRef(`touch`),[d,f,p]=cF(e=>{let t=l().filter(e=>!e.disabled),n=lF(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=tP(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,x.jsx)(NM,{asChild:!0,...a,children:(0,x.jsx)(K.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":sF(o.value)?``:void 0,...i,ref:c,onClick:vl(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:vl(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:vl(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&nP.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),yP=`SelectValue`,bP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=fP(yP,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Tl(t,c.onValueNodeChange);su(()=>{l(u)},[l,u]);let f=sF(c.value);return(0,x.jsx)(K.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,x.jsx)(b.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),xP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,x.jsx)(K.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[SP,CP]=cP(`SelectPortal`,{forceMount:void 0}),wP=tP(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,x.jsx)(SP,{scope:e.__scopeSelect,forceMount:n,children:(0,x.jsx)(lu,{asChild:!0,...r})})},`SelectPortal`),TP=`SelectContent`,EP=b.forwardRef(tP(function(e,t){let n=CP(TP,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=fP(TP,e.__scopeSelect),[o,s]=b.useState();return su(()=>{s(new DocumentFragment)},[]),(0,x.jsx)(pu,{present:r||a.open,children:({present:e})=>e?(0,x.jsx)(MP,{...i,ref:t}):(0,x.jsx)(DP,{...i,fragment:o})})},`SelectContent`)),DP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?G.createPortal((0,x.jsx)(kP,{scope:n,children:(0,x.jsx)(aP.Slot,{scope:n,children:(0,x.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),OP=10,[kP,AP]=cP(TP),jP=Ol(`SelectContent.RemoveScroll`),MP=b.forwardRef(tP(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,v=fP(TP,n),[y,S]=b.useState(null),[C,w]=b.useState(null),T=Tl(t,S),[E,D]=b.useState(null),[O,k]=b.useState(null),A=oP(n),[j,M]=b.useState(!1),N=b.useRef(!1);b.useEffect(()=>{if(y)return WM(y)},[y]),Tk();let P=b.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=b.useCallback(()=>P([E,y]),[P,E,y]);b.useEffect(()=>{j&&F()},[j,F]);let{onOpenChange:I,triggerPointerDownPosRef:L}=v;b.useEffect(()=>{if(y){let e={x:0,y:0},t=tP(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=tP(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||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})}}},[y,I,L]),b.useEffect(()=>{let e=tP(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[ee,te]=cF(e=>{let t=A().filter(e=>!e.disabled),n=lF(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=b.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&(D(e),r&&(N.current=!0))},[v.value]),R=b.useCallback(()=>y?.focus(),[y]),z=b.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&k(e)},[v.value]),B=r===`popper`?PP:NP,re=B===PP?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,x.jsx)(kP,{scope:n,content:y,viewport:C,onViewportChange:w,itemRefCallback:ne,selectedItem:E,onItemLeave:R,itemTextRefCallback:z,focusSelectedItem:F,selectedItemText:O,position:r,isPositioned:j,searchRef:ee,children:(0,x.jsx)($N,{as:jP,allowPinchZoom:!0,children:(0,x.jsx)(Mk,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:vl(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,x.jsx)(Zl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,x.jsx)(B,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...re,onPlaced:()=>M(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:vl(_.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`)),NP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=fP(TP,n),o=AP(TP,n),[s,c]=b.useState(null),[l,u]=b.useState(null),d=Tl(t,u),f=oP(n),p=b.useRef(!1),m=b.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=b.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-OP,d=bk(a,[OP,Math.max(OP,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-OP,d=bk(a,[OP,Math.max(OP,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-OP*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-OP,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=`${OP}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(()=>y(),[y]);let[S,C]=b.useState();return su(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]),(0,x.jsx)(FP,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:b.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,x.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,x.jsx)(K.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),PP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=OP,...a}=e,o=uP(n);return(0,x.jsx)(PM,{...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`)),[FP,IP]=cP(TP,{}),LP=`SelectViewport`,RP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=AP(LP,n),o=IP(LP,n),s=Tl(t,a.onViewportChange),c=b.useRef(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.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,x.jsx)(aP.Slot,{scope:n,children:(0,x.jsx)(K.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:vl(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-OP*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`)),[zP,BP]=cP(`SelectGroup`),VP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e,i=Kk();return(0,x.jsx)(zP,{scope:n,id:i,children:(0,x.jsx)(K.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),HP=`SelectLabel`,UP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e,i=BP(HP,n);return(0,x.jsx)(K.div,{id:i.id,...r,ref:t})},`SelectLabel`)),WP=`SelectItem`,[GP,KP]=cP(WP),qP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=fP(WP,n),c=AP(WP,n),l=s.value===r,[u,d]=b.useState(a??``),[f,p]=b.useState(!1),m=Tl(t,Ul(e=>c.itemRefCallback?.(e,r,i))),h=Kk(),g=b.useRef(`touch`),_=tP(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,x.jsx)(GP,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:b.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,x.jsx)(aP.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,x.jsx)(K.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:vl(o.onFocus,()=>p(!0)),onBlur:vl(o.onBlur,()=>p(!1)),onClick:vl(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:vl(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:vl(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:vl(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:vl(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:vl(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(rP.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),JP=`SelectItemText`,YP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=fP(JP,n),s=AP(JP,n),c=KP(JP,n),l=mP(JP,n),[u,d]=b.useState(null),f=Ul(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Tl(t,d,c.onItemTextChange,f),m=u?.textContent,h=b.useMemo(()=>(0,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(K.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!sF(o.value)?G.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),XP=`SelectItemIndicator`,ZP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e;return KP(XP,n).isSelected?(0,x.jsx)(K.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),QP=`SelectScrollUpButton`,$P=b.forwardRef(tP(function(e,t){let n=AP(QP,e.__scopeSelect),r=IP(QP,e.__scopeSelect),[i,a]=b.useState(!1),o=Tl(t,r.onScrollButtonChange);return su(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};tP(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,x.jsx)(nF,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),eF=`SelectScrollDownButton`,tF=b.forwardRef(tP(function(e,t){let n=AP(eF,e.__scopeSelect),r=IP(eF,e.__scopeSelect),[i,a]=b.useState(!1),o=Tl(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)};tP(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,x.jsx)(nF,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),nF=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=AP(`SelectScrollButton`,n),o=b.useRef(null),s=oP(n),c=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),su(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,x.jsx)(K.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:vl(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:vl(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:vl(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),rF=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e;return(0,x.jsx)(K.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),iF=`SelectBubbleInput`,aF=b.forwardRef(tP(function({__scopeSelect:e,...t},n){let r=fP(iF,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=b.useRef(null),m=Tl(n,p),h=i??``,g=FM(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return b.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,x.jsxs)(K.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Mu,...t.style},ref:m,defaultValue:h,children:[sF(i)&&!_?(0,x.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function oF(e){return typeof e==`function`}tP(oF,`isFunction`);function sF(e){return e===``||e===void 0}tP(sF,`shouldShowPlaceholder`);function cF(e){let t=Ul(e),n=b.useRef(``),r=b.useRef(0),i=b.useCallback(e=>{let i=n.current+e;t(i),tP((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=b.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}tP(cF,`useTypeaheadSearch`);function lF(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=uF(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}tP(lF,`findNextItem`);function uF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}tP(uF,`wrapArray`);var dF=gP,fF=VP,pF=bP,mF=({validationStyleEnabled:e=!1,className:t,children:n,...r})=>(0,x.jsxs)(vP,{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,x.jsx)(xP,{asChild:!0,children:(0,x.jsx)($d,{className:`size-4 opacity-50`})})]}),hF=({className:e,...t})=>(0,x.jsx)($P,{className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,x.jsx)(Qd,{})}),gF=({className:e,...t})=>(0,x.jsx)(tF,{className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,x.jsx)(Yd,{})}),_F=({className:e,children:t,position:n=`popper`,...r})=>(0,x.jsx)(wP,{children:(0,x.jsxs)(EP,{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,x.jsx)(hF,{}),(0,x.jsx)(RP,{className:W(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:t}),(0,x.jsx)(gF,{})]})}),vF=({className:e,...t})=>(0,x.jsx)(UP,{className:W(`px-1 py-0.5 font-semibold text-sm`,e),...t}),yF=({className:e,children:t,...n})=>(0,x.jsxs)(qP,{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,x.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,x.jsx)(ZP,{children:(0,x.jsx)(Jd,{className:`size-4`})})}),(0,x.jsx)(YP,{children:t})]}),bF=({className:e,...t})=>(0,x.jsx)(rF,{className:W(`-mx-1 my-1 h-px`,`bg-neutral-200 dark:bg-neutral-800`,e),...t}),Y=dF;Y.Group=fF,Y.Value=pF,Y.Trigger=mF,Y.ScrollUpButton=hF,Y.ScrollDownButton=gF,Y.Content=_F,Y.Label=vF,Y.Item=yF,Y.Separator=bF;var xF=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}},SF=e=>{let t=(0,V.c)(13),{value:n,onChange:r}=e,i;t[0]===n?i=t[1]:(i=xF(n),t[0]=n,t[1]=i);let{comparator:a,numberValue:o}=i,[s,c]=(0,b.useState)(a??null),[l,u]=(0,b.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,b.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,x.jsxs)(`div`,{className:`flex gap-1`,children:[(0,x.jsxs)(Y,{onValueChange:c,defaultValue:a,children:[(0,x.jsx)(Y.Trigger,{className:`w-20`,children:(0,x.jsx)(Y.Value,{placeholder:`Select a comparator`})}),(0,x.jsxs)(Y.Content,{children:[(0,x.jsx)(Y.Item,{value:`<`,children:`<`}),(0,x.jsx)(Y.Item,{value:`<=`,children:`<=`}),(0,x.jsx)(Y.Item,{value:`=`,children:`=`}),(0,x.jsx)(Y.Item,{value:`>=`,children:`>=`}),(0,x.jsx)(Y.Item,{value:`>`,children:`>`})]})]}),(0,x.jsx)(SO,{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},CF=({rawContent:e})=>{let[t,n]=(0,b.useState)(``);return(0,b.useEffect)(()=>{lt(async()=>{let{default:e}=await import(`./purify.es-DuRL7t6i.js`);return{default:e}},[]).then(({default:t})=>{n(t.sanitize(e))})},[e]),t?(0,x.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):(0,x.jsx)(`div`,{})},wF=(0,b.lazy)(()=>lt(()=>import(`./MarkDownRender-Bih9GMw2.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0,1,2,3]))),TF=(0,b.lazy)(()=>lt(()=>import(`./MarkdownEditor-CHph_zfu.js`).then(e=>({default:e.MarkdownEditor})),__vite__mapDeps([4,2,3,1,5]))),EF=(0,b.memo)(function(e){let t=(0,V.c)(2),{label:n,...r}=e,[i,a]=(0,b.useState)(!1),o;return t[0]===i?o=t[1]:(o=e=>{e&&!i&&a(!0)},t[0]=i,t[1]=o),(0,x.jsx)(oO,{header:n,label:n,onToggle:o,children:i?(0,x.jsx)(WF,{...r}):null})}),DF=e=>{let t=(0,V.c)(14),{keyPath:n,dictionary:r,...i}=e,{editedContent:a,addEditedContent:o}=Hw(),s=Bw(),{mutate:c,isPending:l}=HD(),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,x.jsx)(dk,{variant:`default`,onContentChange:u,additionalButtons:(0,x.jsx)(iO,{Icon:gf,label:`Audit`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,isLoading:l,onClick:d}),...i})},OF=e=>{let t=(0,V.c)(4),{keyPath:n,dictionary:r,...i}=e,{addEditedContent:a}=Hw(),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,x.jsx)(KO,{variant:`default`,onContentChange:o,...i})},kF=[{content:`False`,value:!1},{content:`True`,value:!0}],AF=e=>{let t=(0,V.c)(4),{dictionary:n,keyPath:r,...i}=e,{addEditedContent:a}=Hw(),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,x.jsx)(gO,{choices:kF,value:!0,onChange:o,color:`text`,size:`sm`,...i})},jF=e=>{let t=(0,V.c)(15),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{locale:o,defaultLocale:s}=an(),{selectedLocales:c}=gk(),l=n[w],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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:Ut(e,o)})}),(0,x.jsx)(`tr`,{className:`flex`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:l[e]??Xt(l[s]),keyPath:[...r,{type:w,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,x.jsx)(`table`,{className:`w-full`,children:(0,x.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},MF=e=>{let t=(0,V.c)(19),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=Hw(),{addNewEnumeration:s,removeEnumeration:c}=rn(`navigation-view`),l=n[T],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,Xt(l[d])??``,[...r,{type:T,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,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(n[T]).map(e=>{let t=[...r,{type:T,key:e}],s=`${JSON.stringify(r)}-enumeration-${e}`;return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(`div`,{className:`flex flex-1`,children:(0,x.jsx)(iO,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,Icon:hf,onClick:()=>o(i.localId,void 0,t),children:c.text})})})}),(0,x.jsx)(`tr`,{className:`w-full p-2`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(SF,{value:e,onChange:t=>{let a=n[T],s=vk(a,e,t),c={...n,[T]:s};console.log(`newValue`,c),o(i.localId,c,r)}})})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(WF,{section:l[e]??Xt(l[d]),keyPath:t,dictionary:i,renderSection:a})})})]},s)})})}),(0,x.jsx)(iO,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:e,Icon:df,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},NF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[D];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:i[e]??Xt(i.true),keyPath:[...t,{type:D,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},PF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[te];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:i[e]??Xt(i.male),keyPath:[...t,{type:te,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},FF=[`zero`,`one`,`two`,`few`,`many`,`other`],IF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[E];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:FF.map(e=>{let a=`${JSON.stringify(t)}-plural-${e}`;return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:e})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:i[e]??Xt(i.other),keyPath:[...t,{type:E,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},LF=e=>{let t=(0,V.c)(22),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=Hw(),{addNewElement:s,removeElement:c}=rn(`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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 w-full p-2`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,x.jsx)(`span`,{className:`text-xs`,children:String(t)}),(0,x.jsx)(iO,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,onClick:()=>{let e=[...r,{type:j,key:t}];o(i.localId,void 0,e)},Icon:hf,children:c.text})]})})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:e??Xt(n[0]),keyPath:[...r,{type:j,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:j,key:n.length}];o(i.localId,Xt(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,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:n.map(e)})}),(0,x.jsx)(iO,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:u,Icon:df,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},RF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e,a=Object.keys(i)[0];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex flex-col gap-2`,children:Object.keys(i).map(e=>{let o=[...t,{type:A,key:e}],s=i[e]??Xt(i[a]),c=`${JSON.stringify(t)}-object-${e}`;return typeof s!=`object`||!s?(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(WF,{section:s,keyPath:o,dictionary:n,renderSection:r})})})]},c):(0,x.jsx)(`tr`,{className:`block w-full border-neutral/10 border-t py-1`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(EF,{label:Mt(e),section:s,keyPath:o,dictionary:n,renderSection:r})})},c)})})})},zF=e=>{let t=(0,V.c)(5),{section:n,keyPath:r,dictionary:i}=e,[a,o]=(0,b.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,x.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,x.jsx)(gO,{choices:e,value:a,onChange:o,color:`text`,size:`sm`,className:`ml-auto`}),(0,x.jsx)(GF,{section:l,keyPath:c,dictionary:i,renderSection:a===1?KF:void 0})]}),t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=s}else s=t[4];return s},BF=e=>{let t=(0,V.c)(12),{section:n,keyPath:r,dictionary:i,isDarkMode:a}=e,[o,s]=(0,b.useState)(0),{addEditedContent:c}=Hw(),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,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(tO,{}),children:(0,x.jsx)(TF,{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,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(tO,{}),children:(0,x.jsx)(wF,{isDarkMode:a,children:e})}),t[10]=a,t[11]=m);let h=m;l=(0,x.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,x.jsx)(gO,{choices:e,value:o,onChange:s,color:`text`,size:`sm`,className:`ml-auto`}),(0,x.jsx)(GF,{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},VF=({section:e,keyPath:t,...n})=>{let r=[...t,{type:O}],i=e[O];return(0,x.jsx)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:(0,x.jsx)(GF,{section:i,keyPath:r,...n})})},HF=({section:e,keyPath:t,...n})=>{let r=[...t,{type:k}],i=e[k],{content:a}=e;return(0,x.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,x.jsxs)(`span`,{className:`text-neutral text-sm`,children:[i,` `]}),(0,x.jsx)(GF,{section:a,keyPath:r,...n})]})},UF=e=>{let{keyPath:t,dictionary:n,renderSection:r,section:i,...a}=e,{addEditedContent:o}=Hw(),s=i[M],c=[...t,{type:M}];return(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-4 p-2`,children:[(0,x.jsx)(yk,{children:`Dictionary key`}),(0,x.jsx)(KO,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,dictionaryKey:String(e)},c)},children:s.dictionaryKey??``}),(0,x.jsx)(yk,{children:`Path (optional)`}),(0,x.jsx)(KO,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,path:e===``?void 0:e},c)},children:s.path??``})]})},WF=(0,b.memo)(function(e){let t=(0,V.c)(82),{section:n,keyPath:r,dictionary:i,renderSection:a,isDarkMode:o}=e,{tsxNotEditable:s}=rn(`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=en(n);if(e===`reactNode`){let e;t[8]===s?e=t[9]:(e=(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,x.jsx)(`span`,{children:`(React Node)`}),(0,x.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,x.jsx)(UF,{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,x.jsx)(jF,{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,x.jsx)(MF,{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,x.jsx)(NF,{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===`gender`){let e;t[30]!==i||t[31]!==r||t[32]!==a||t[33]!==n?(e=(0,x.jsx)(PF,{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===`plural`){let e;t[35]!==i||t[36]!==r||t[37]!==a||t[38]!==n?(e=(0,x.jsx)(IF,{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===`insertion`){let e;t[40]!==i||t[41]!==r||t[42]!==a||t[43]!==n?(e=(0,x.jsx)(VF,{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===`markdown`){let e;t[45]!==i||t[46]!==o||t[47]!==r||t[48]!==n?(e=(0,x.jsx)(BF,{dictionary:i,keyPath:r,section:n,isDarkMode:o}),t[45]=i,t[46]=o,t[47]=r,t[48]=n,t[49]=e):e=t[49],l=e;break bb0}if(e===`html`){let e;t[50]!==i||t[51]!==r||t[52]!==n?(e=(0,x.jsx)(zF,{dictionary:i,keyPath:r,section:n}),t[50]=i,t[51]=r,t[52]=n,t[53]=e):e=t[53],l=e;break bb0}if(e===`file`){let e;t[54]!==i||t[55]!==r||t[56]!==a||t[57]!==n?(e=(0,x.jsx)(HF,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[54]=i,t[55]=r,t[56]=a,t[57]=n,t[58]=e):e=t[58],l=e;break bb0}if(e===`array`){let e;t[59]!==i||t[60]!==r||t[61]!==a||t[62]!==n?(e=(0,x.jsx)(LF,{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===`object`){let e;t[64]!==i||t[65]!==r||t[66]!==a||t[67]!==n?(e=(0,x.jsx)(RF,{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===`number`){let e;t[69]!==i||t[70]!==r||t[71]!==n?(e=(0,x.jsx)(`div`,{className:`w-full p-2`,children:(0,x.jsx)(OF,{dictionary:i,keyPath:r,type:`number`,"aria-label":`Edit field`,children:n})}),t[69]=i,t[70]=r,t[71]=n,t[72]=e):e=t[72],l=e;break bb0}if(e===`text`){let e;t[73]!==i||t[74]!==r||t[75]!==a||t[76]!==n?(e=(0,x.jsx)(`div`,{className:`w-full p-2`,children:typeof a==`function`?a(n,r):(0,x.jsx)(DF,{variant:`default`,"aria-label":`Edit field`,keyPath:r,dictionary:i,children:n})}),t[73]=i,t[74]=r,t[75]=a,t[76]=n,t[77]=e):e=t[77],l=e;break bb0}if(e===`boolean`){let e;t[78]!==i||t[79]!==r||t[80]!==n?(e=(0,x.jsx)(`div`,{className:`w-full p-2`,children:(0,x.jsx)(AF,{dictionary:i,keyPath:r,value:n})}),t[78]=i,t[79]=r,t[80]=n,t[81]=e):e=t[81],l=e;break bb0}c=(0,x.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}),GF=(0,b.memo)(function(e){return(0,x.jsx)(GO,{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,x.jsx)(WF,{...e})})});function KF(e){return(0,x.jsx)(CF,{rawContent:e})}var qF=Fd(`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`}}),JF=({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},YF=e=>typeof e==`string`||typeof e==`number`?!0:Array.isArray(e)?e.every(YF):(0,b.isValidElement)(e)?YF(e.props.children):!1,XF=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??JF(e),v=f??p?.startsWith(`#`)??!1,y=YF(i),b=_?`noopener noreferrer nofollow`:void 0,S=_?`_blank`:`_self`,C=l&&p&&!_&&!v?Bt(p,l):p;return(0,x.jsxs)(`a`,{href:C===``?void 0:C,"aria-label":a,rel:b,target:S,"aria-current":s?`page`:void 0,suppressHydrationWarning:!0,className:W(qF({variant:t,color:n,roundedSize:r,underlined:c,size:g,className:o})),...m,children:[h&&y?(0,x.jsx)(`span`,{children:i}):i,_&&y&&(0,x.jsx)(af,{className:`ml-2 inline-block size-4`}),v&&(0,x.jsx)(sf,{className:`ml-2 inline-block size-4`})]})},ZF=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]||``,QF=Fd(`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`}}),$F=({href:e,lang:t,children:n,onClick:r,color:i,position:a,locale:o,className:s,...c})=>{let l=ke(`breadcrumb`).linkLabel;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(XF,{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,x.jsx)(`span`,{itemProp:`name`,children:n})}),(0,x.jsx)(`meta`,{itemProp:`position`,content:a.toString()})]})},eI=e=>{let{children:t,onClick:n,color:r,position:i,className:a,...o}=e,{linkLabel:s}=rn(`breadcrumb`);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(iO,{onClick:n,variant:`link`,label:`${s} ${t}`,color:r,itemProp:`item`,size:`custom`,...o,children:(0,x.jsx)(`span`,{itemProp:`name`,children:t})}),(0,x.jsx)(`meta`,{itemProp:`position`,content:i.toString()})]})},tI=({children:e,position:t,className:n,...r})=>(0,x.jsxs)(`span`,{itemProp:`item`,className:W(`inline-flex items-center`,`font-medium text-neutral-700`,`transition-colors duration-200`,n),children:[(0,x.jsx)(`span`,{itemProp:`name`,...r,children:e}),(0,x.jsx)(`meta`,{itemProp:`position`,content:t.toString()})]}),nI=({links:e,className:t,color:n=`text`,locale:r,elementType:i=`page`,separator:a=(0,x.jsx)(Zd,{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,x.jsx)(`nav`,{"aria-label":o,children:(0,x.jsx)(`ol`,{className:W(QF({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=ZF(n);if(p)return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`li`,{className:`flex items-center`,"aria-hidden":`true`,children:(0,x.jsx)(`span`,{className:`text-neutral-500`,children:`…`})}),!o&&(0,x.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,x.jsx)(`span`,{className:W(h),children:a})})]},`truncated-${m}`);let g=(0,x.jsx)(tI,{position:t+1,"aria-current":d,className:W(`transition-colors duration-200`,u&&`text-neutral-900`),children:m},m);c?g=(0,x.jsx)($F,{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,x.jsx)(eI,{onClick:e.onClick,color:n,position:t+1,"aria-current":d,className:W(u&&`cursor-default text-neutral-900`),children:m},m));let _=(0,b.createElement)(`li`,{...s&&{itemProp:`itemListElement`,itemScope:!0,itemType:`https://schema.org/ListItem`},key:m,className:`flex items-center`},g);return o?_:(0,x.jsxs)(b.Fragment,{children:[_,(0,x.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,x.jsx)(`span`,{className:W(h),children:a})})]},m)})})})},rI=({keyPath:e,dictionaryKey:t,onClickKeyPath:n,locale:r,color:i,showDictionaryKey:a=!0})=>(0,x.jsx)(nI,{links:[...a?[{text:Mt(t),onClick:n?()=>n([]):void 0}]:[],...e.map((t,r)=>({onClick:n?()=>n?.(e.slice(0,r+1)):void 0,text:Mt(t.key?.toString()??``)}))],locale:r,elementType:`location`,color:i}),iI=({children:e,className:t,identifier:n,...r})=>(0,x.jsx)(`div`,{className:W(`group/dropdown relative flex`,t),"aria-label":`DropDown ${n}`,id:`dropdown-container-${n}`,...r,children:e});iI.Trigger=({children:e,identifier:t,className:n,label:r,...i})=>(0,x.jsx)(iO,{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}),iI.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,x.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,x.jsx)(aO,{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 aI(e){return Array.isArray?Array.isArray(e):hI(e)===`[object Array]`}function oI(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 sI(e){return e==null?``:oI(e)}function cI(e){return typeof e==`string`}function lI(e){return typeof e==`number`}function uI(e){return e===!0||e===!1||fI(e)&&hI(e)==`[object Boolean]`}function dI(e){return typeof e==`object`}function fI(e){return dI(e)&&e!==null}function pI(e){return e!=null}function mI(e){return!e.trim().length}function hI(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var gI=`Incorrect 'index' type`,_I=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,vI=e=>`Invalid value for key ${e}`,yI=e=>`Pattern length exceeds max of ${e}.`,bI=e=>`Missing ${e} property in key`,xI=e=>`Property 'weight' in key '${e}' must be a positive integer`,SI=`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.`,CI=Object.prototype.hasOwnProperty,wI=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=TI(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 TI(e){let t=null,n=null,r=null,i=1,a=null;if(cI(e)||aI(e))r=e,t=EI(e),n=DI(e);else{if(!CI.call(e,`name`))throw Error(bI(`name`));let o=e.name;if(r=o,CI.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(xI(DI(o)));t=EI(o),n=DI(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function EI(e){return aI(e)?e:e.split(`.`)}function DI(e){return aI(e)?e.join(`.`):e}function OI(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(pI(e))if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!pI(s))return;if(a===t.length-1&&(cI(s)||lI(s)||uI(s)||typeof s==`bigint`))n.push(o===void 0?sI(s):{v:sI(s),i:o});else if(aI(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,cI(t)?t.split(`.`):t,0),r?n:n[0]}var kI={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},AI={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},jI={location:0,threshold:.6,distance:100},MI={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:OI,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},X=Object.freeze({...AI,...kI,...jI,...MI});function NI(e){return e>=9&&e<=13||e===32||e===160}function PI(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++)NI(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 FI=class{constructor({getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){this.norm=PI(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(cI(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(_I);if(cI(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(_I);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!pI(e)||mI(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(pI(i)){if(aI(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(pI(n)){if(cI(n)){if(!mI(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(pI(n.v)){let t=cI(n.v)?n.v:sI(n.v);if(!mI(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(cI(i)&&!mI(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 II(e,t,{getFn:n=X.getFn,fieldNormWeight:r=X.fieldNormWeight}={}){let i=new FI({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(TI)),i.setSources(t),i.create(),i}function LI(e,{getFn:t=X.getFn,fieldNormWeight:n=X.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new FI({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function RI(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 zI(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(yI(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=RI(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function BI(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 VI(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 HI={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},UI=RegExp(`[`+Object.keys(HI).join(``)+`]`,`g`),WI=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(UI,e=>HI[e]):e=>e,GI=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?WI(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:BI(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?WI(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}=zI(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=VI(u)),p}},KI=new Set([`fuzzy`,`include`]);function qI(e){return e.startsWith(`inverse`)}var JI=[{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 GI(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)}}}}],YI=JI.length,XI=`\0`,ZI=`|`;function QI(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 $I(e,t){let n=e.match(t);return n?n[1]:null}function eL(e,t={}){return e.replace(/\\\|/g,XI).split(ZI).map(e=>{let n=QI(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<YI;){let e=JI[o],n=$I(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<YI;){let e=JI[o],n=$I(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var tL=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?WI(e):e,this.pattern=e,this.query=eL(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?WI(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,qI(r.type)&&(c=!0),n&&(KI.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=VI(o)),e}}return{isMatch:!1,score:1}}},nL=[];function rL(...e){nL.push(...e)}function iL(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 GI(e,t)}var aL={AND:`$and`,OR:`$or`},oL={PATH:`$path`,PATTERN:`$val`},sL=e=>!!(e[aL.AND]||e[aL.OR]),cL=e=>!!e[oL.PATH],lL=e=>!aI(e)&&dI(e)&&!sL(e),uL=e=>({[aL.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function dL(e,t,{auto:n=!0}={}){let r=e=>{if(cI(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=iL(e,t)),r}let i=Object.keys(e),a=cL(e);if(!a&&i.length>1&&!sL(e))return r(uL(e));if(lL(e)){let r=a?e[oL.PATH]:i[0],o=a?e[oL.PATTERN]:e[r];if(!cI(o))throw Error(vI(r));let s={keyId:DI(r),pattern:o};return n&&(s.searcher=iL(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];aI(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return sL(e)||(e=uL(e)),r(e)}function fL(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 pL(e,{ignoreFieldNorm:t=X.ignoreFieldNorm}){e.forEach(e=>{e.score=fL(e.matches,{ignoreFieldNorm:t})})}var mL=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 hL(e){let t=[];return e.matches.forEach(e=>{if(!pI(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 gL(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=hL(e)),r&&(a.score=e.score),a})}var _L=/[\p{L}\p{M}\p{N}_]+/gu,vL=new WeakSet;function yL(e){vL.has(e)||(vL.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 bL(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||yL(e),t=>t.match(e)||[]):e=>e.match(_L)||[]}function xL({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=bL(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=WI(n)),r(n)}}}var SL=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=xL({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 GI(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=VI(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function CL(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 wL(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){CL(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)CL(e,t.v,i,r);else CL(e,n.v,i,r)}}function TL(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)wL(r,i,t,n);return r}function EL(e,t,n,r){wL(e,t,n,r)}function DL(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 OL(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)DL(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 kL=class{constructor(e,t,n){this.options={...X,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new wI(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=iL(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 FI))throw Error(gI);if(this._myIndex=t||II(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=xL({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=TL(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!pI(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=xL({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});EL(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&&OL(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(_I);this._invertedIndex&&OL(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(cI(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return lI(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&lI(n)&&n>0&&cI(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new mL(n,u);cI(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=cI(e)?cI(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),pL(d,{ignoreFieldNorm:s}),a&&d.sort(cI(e)?u:l),lI(n)&&n>-1&&(d=d.slice(0,n));return gL(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(!pI(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=fL(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=dL(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===aL.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(pI(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(!pI(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=fL(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!pI(t))return[];let r=[];if(aI(t))t.forEach(({v:t,i,n:a})=>{if(!pI(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}};kL.version=`7.5.0`,kL.createIndex=II,kL.parseIndex=LI,kL.config=X,kL.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(SI);return iL(e,{...X,...n}).searchIn(t)},kL.parseQuery=dL,rL(tL),rL(SL),kL.use=function(...e){e.forEach(e=>rL(e))};var AL=kL,jL=`locale-switcher-content`,ML=({panelProps:e,isMultilingual:t=!0})=>{let{switchTo:n,searchInput:r,localeSwitcherLabel:i,languageListLabel:a,seeAllLocalesSwitch:o}=rn(`locale-switcher-content`),s=(0,b.useRef)(null),{locale:c}=an(),{availableLocales:l,selectedLocales:u,setSelectedLocales:d}=gk(),f=(0,b.useMemo)(()=>l.map(e=>({locale:e,englishName:Ut(e,`en`),currentLocaleName:Ut(e,c),ownLocaleName:Ut(e)})),[l,c]),[p,m]=(0,b.useState)(``),[h,g]=mk(`locale-content-selector-see-all-locales`,!1),_=(0,b.useMemo)(()=>new AL(f,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[f]),v=(0,b.useMemo)(()=>p?_.search(p).map(e=>e.item):f,[p,f,_]),y=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,x.jsx)(`div`,{className:`rounded-xl border border-text text-text transition-colors`,children:(0,x.jsxs)(iI,{identifier:jL,children:[(0,x.jsx)(iI.Trigger,{identifier:jL,label:i.value,className:`p-0!`,roundedSize:`3xl`,color:`text`,variant:`hoverable`,children:(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between text-text`,children:[(0,x.jsx)(`div`,{className:`px-2 py-1`,children:(0,x.jsx)(of,{size:16})}),(0,x.jsx)(cf,{className:`self-center`,size:16})]})}),(0,x.jsx)(iI.Panel,{identifier:jL,isOverable:!0,isFocusable:!0,align:`end`,...e,children:(0,x.jsxs)(GO,{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,x.jsx)(`div`,{className:`m-auto p-2`,children:(0,x.jsx)(gO,{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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`p-3`,children:(0,x.jsx)(SO,{type:`search`,"aria-label":r.ariaLabel.value,placeholder:r.placeholder.value,onChange:e=>m(e.target.value),ref:s})}),(0,x.jsx)(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:v.map(({locale:e,currentLocaleName:r,ownLocaleName:i})=>(0,x.jsx)(`li`,{className:`px-1.5 py-1`,children:(0,x.jsx)(iO,{onClick:()=>y(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,x.jsxs)(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[t&&(0,x.jsx)(`div`,{className:`w-4`,children:u.includes(e)&&(0,x.jsx)(Jd,{className:`size-full`})}),(0,x.jsxs)(`div`,{className:`flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col text-nowrap`,children:[(0,x.jsx)(`span`,{dir:Ht(e),lang:e,children:i}),(0,x.jsx)(`span`,{className:`text-neutral text-xs`,children:r})]}),(0,x.jsx)(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})]})})},e))})]})]})})]})})},NL=Fd(`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`}}),PL=(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},FL=e=>e?.getAttribute(`aria-current`)===`true`,IL=e=>e===`sm`?`icon-sm`:e===`lg`?`icon-lg`:`icon-md`,LL=e=>(0,x.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}),RL=({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}=rn(`pagination`),m=PL(e,t,a),h=IL(s),g=e===1,_=e===t,v=(0,b.useRef)([]),y=(0,b.useRef)(null),{choiceIndicatorPosition:S,calculatePosition:C}=uO(v,{selector:FL,isHoverable:!0});if((0,b.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,x.jsx)(`div`,{className:W(NL({size:s,variant:c}),u),...d,children:(0,x.jsxs)(`div`,{className:`relative flex items-center gap-1`,children:[S&&(0,x.jsx)(LL,{style:S,ref:y}),i&&(0,x.jsx)(iO,{variant:`outline`,size:h,color:`text`,onClick:()=>w(e-1),disabled:o||g,label:p.value,Icon:Xd,ref:e=>{e&&(v.current[0]=e)},className:`min-w-0 px-2`}),(0,x.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,x.jsx)(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:(0,x.jsx)(rf,{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,x.jsx)(iO,{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&&(v.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,x.jsx)(iO,{variant:`outline`,size:h,color:`text`,onClick:()=>w(e+1),disabled:o||_,label:f.value,Icon:Zd,ref:e=>{let t=+!!i+m.filter(e=>e!==`ellipsis`).length;e&&(v.current[t]=e)},className:`min-w-0 px-2`})]})})},zL=e=>{let t=Zt(e),n=en(e);return t&&(n===`reactNode`||n===`file`)?!0:t&&typeof t.nodeType==`string`?zL(t[t.nodeType]):typeof t==`string`||typeof t==`number`||typeof t==`boolean`||t===void 0},BL=e=>{let t=(0,V.c)(3),{children:n,onToggle:r,...i}=e,[a,o]=(0,b.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,x.jsx)(oO,{...i,onToggle:s,children:a?n:null})},VL=e=>{let t=(0,V.c)(16),{section:n,keyPath:r,dictionary:i}=e,{selectedLocales:a}=gk(),o=Jt(n,r,Fw()),{addEditedContent:s}=Vw(),{setFocusedContentKeyPath:c,focusedContent:l}=Lw(),{addNewElement:u,goToField:d}=rn(`navigation-view`),f=en(o),p;t[0]===l?.keyPath?p=t[1]:(p=e=>(l?.keyPath?.length??0)>0&&Ot(e,l?.keyPath??[]),t[0]=l?.keyPath,t[1]=p);let m=p,h=zL(o);if(!o)return(0,x.jsx)(x.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,x.jsx)(iO,{label:d.label.value,variant:`hoverable`,color:`text`,className:`w-full`,onClick:e,IconRight:Zd,children:Mt(r[r.length-1]?.key)})}if(typeof o==`object`){if(f===`reactNode`)return(0,x.jsx)(x.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:w,key:e}];return(0,x.jsx)(VL,{keyPath:t,section:n,dictionary:i},e)},t[5]=i,t[6]=r,t[7]=n,t[8]=e):e=t[8],(0,x.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:a.map(e)})}if(f===`enumeration`||f===`plural`||f===`condition`)return(0,x.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,x.jsx)(VL,{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:j,key:t}];return zL(e)?(0,x.jsxs)(iO,{label:`${d.label.value} ${t}`,variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(a),IconRight:Zd,isActive:m(a),children:[`Item `,t]},JSON.stringify(a)):(0,x.jsx)(BL,{label:`${d.label.value} ${t}`,header:`Item ${t}`,isActive:m(a),onClick:()=>c(a),children:(0,x.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,x.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,x.jsx)(VL,{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,x.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[o.map(e),(0,x.jsx)(iO,{label:u.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,onClick:()=>{let e=[...r,{type:j,key:o.length}],t=o,n=Xt(t[t.length-1])??``;s(i.localId,n,e,!1),c(e)},Icon:df,children:u.text})]})}if(typeof o.nodeType==`string`){let e=[...r,{type:o.nodeType}];return(0,x.jsx)(VL,{keyPath:e,section:n,dictionary:i})}return(0,x.jsx)(`div`,{className:`flex w-full max-w-full flex-col justify-between gap-2`,children:Object.keys(o).map(e=>{let t=[...r,{type:A,key:e}];return zL(Jt(n,t))?(0,x.jsx)(iO,{label:`${d.label.value} ${e}`,isActive:m(t),variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(t),IconRight:Zd,children:Mt(e)},e):(0,x.jsx)(BL,{label:`${d.label.value} ${e}`,isActive:m(t),onClick:()=>c(t),header:Mt(e),children:(0,x.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,x.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,x.jsx)(VL,{keyPath:t,section:n,dictionary:i})})})},e)})})}return(0,x.jsxs)(x.Fragment,{children:[`Error loading section --`,f,`--`,JSON.stringify(o),`--`,JSON.stringify(r)]})},HL=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,UL=e=>{let t=(0,V.c)(35),{dictionary:n,isDarkMode:r}=e,{itemPagination:i,variantSwitcher:a}=rn(`content-editor`),{editedContent:o}=Hw(),{focusedContent:s,setFocusedContentKeyPath:c}=Lw(),[,l]=(0,b.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,b.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,b.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 v=g&&!!n.key,y;t[8]===v?y=t[9]:(y={enabled:v},t[8]=v,t[9]=y);let{data:S}=KD(_,y),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(WL).sort(GL),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(KL),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=Fw(),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=Jt(F,L,I),t[22]=I,t[23]=F,t[24]=L,t[25]=ee):ee=t[25];let te=ee,ne=(0,b.useDeferredValue)(P),R=(0,b.useDeferredValue)(te),z=R!==te,B;t[26]===F?B=t[27]:(B=zL(F),t[26]=F,t[27]=B);let re=B,ie=zL(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,b.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,x.jsxs)(`div`,{children:[g&&(0,x.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-4`,children:[E.length>0&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`font-medium text-muted text-xs`,children:i.label}),(0,x.jsx)(RL,{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,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`font-medium text-muted text-xs`,children:[a.label,`:`]}),O.map(e=>{let t=e.localId===f.localId;return(0,x.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:HL(e.variant)},e.localId)}),le!==void 0&&!O.some(e=>e.localId===n.localId)&&(0,x.jsx)(`span`,{className:`rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs`,children:HL(le)})]})]}),(0,x.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-2`,children:[(0,x.jsx)(rI,{dictionaryKey:M,keyPath:P??[],onClickKeyPath:d}),(0,x.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,x.jsx)(ML,{})})]}),(0,x.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,x.jsx)(GO,{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,x.jsx)(VL,{keyPath:[],section:F,dictionary:f})}),(ie||(ne??[]).length>0)&&(0,x.jsx)(`div`,{className:z?`pointer-events-none flex-1 opacity-50 transition-opacity`:`flex-1 transition-opacity`,children:(0,x.jsx)(GF,{keyPath:ne??[],section:R,dictionary:f,isDarkMode:r})})]})]})};function WL(e){return e.item!==void 0}function GL(e,t){return(e.item??0)-(t.item??0)}function KL(e){return e.variant!==void 0}var qL=Fd(`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`}}),JL=({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,x.jsxs)(p,{className:W(qL({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,x.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,x.jsxs)(`svg`,{className:`size-3`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-label":`Remove badge`,children:[(0,x.jsx)(`title`,{children:`Remove badge`}),(0,x.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`})]})})]})},YL=Object.defineProperty,XL=(e,t)=>YL(e,`name`,{value:t,configurable:!0}),ZL=`Dialog`,[QL,$L]=El(ZL),[eR,tR]=QL(ZL),nR=XL(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=b.useRef(null),c=b.useRef(null),[l,u]=Tu({prop:r,defaultProp:i??!1,onChange:a,caller:ZL}),[d,f]=b.useState(0),[p,m]=b.useState(0);return(0,x.jsx)(eR,{scope:t,triggerRef:s,contentRef:c,contentId:Kk(),titleId:Kk(),descriptionId:Kk(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:b.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),[rR,iR]=QL(`DialogPortal`,{forceMount:void 0}),aR=`DialogContent`,oR=b.forwardRef(XL(function(e,t){let n=iR(aR,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=tR(aR,e.__scopeDialog);return(0,x.jsx)(pu,{present:r||a.open,children:a.modal?(0,x.jsx)(sR,{...i,ref:t}):(0,x.jsx)(cR,{...i,ref:t})})},`DialogContent`)),sR=b.forwardRef(XL(function(e,t){let n=tR(aR,e.__scopeDialog),r=b.useRef(null),i=Tl(t,n.contentRef,r);return b.useEffect(()=>{let e=r.current;if(e)return WM(e)},[]),(0,x.jsx)(lR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:vl(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:vl(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:vl(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),cR=b.forwardRef(XL(function(e,t){let n=tR(aR,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return(0,x.jsx)(lR,{...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`)),lR=b.forwardRef(XL(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=tR(aR,n);return Tk(),(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(Mk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,x.jsx)(Zl,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":uR(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function uR(e){return e?`open`:`closed`}XL(uR,`getState`);var dR=1,fR=.9,pR=.8,mR=.17,hR=.1,gR=.999,_R=.9999,vR=.99,yR=/[\\\/_+.#"@\[\(\{&]/,bR=/[\\\/_+.#"@\[\(\{&]/g,xR=/[\s-]/,SR=/[\s-]/g;function CR(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?dR:vR;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=CR(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=dR:yR.test(e.charAt(l-1))?(d*=pR,p=e.slice(i,l-1).match(bR),p&&i>0&&(d*=gR**+p.length)):xR.test(e.charAt(l-1))?(d*=fR,m=e.slice(i,l-1).match(SR),m&&i>0&&(d*=gR**+m.length)):(d*=mR,i>0&&(d*=gR**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=_R)),(d<hR&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=CR(e,t,n,r,l+1,a+2,o),f*hR>d&&(d=f*hR)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function wR(e){return e.toLowerCase().replace(SR,` `)}function TR(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,CR(e,t,wR(e),wR(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function ER(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function DR(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function OR(...e){return t=>{let n=!1,r=e.map(e=>{let r=DR(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():DR(e[t],null)}}}}function kR(...e){return b.useCallback(OR(...e),e)}function AR(e,t){let n=b.createContext(t),r=e=>{let{children:t,...r}=e,i=b.useMemo(()=>r,Object.values(r));return(0,x.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=b.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function jR(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,x.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=b.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=>b.createContext(e));return function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,MR(i,...t)]}function MR(...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 b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var NR=globalThis?.document?b.useLayoutEffect:()=>{},PR=b.useId||(()=>void 0),FR=0;function IR(e){let[t,n]=b.useState(PR());return NR(()=>{e||n(e=>e??String(FR++))},[e]),e||(t?`radix-${t}`:``)}var LR=b.useInsertionEffect||NR;function RR({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=zR({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=b.useRef(e!==void 0);b.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,b.useCallback(t=>{if(s){let n=BR(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function zR({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return LR(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function BR(e){return typeof e==`function`}function VR(e){let t=HR(e),n=b.forwardRef((e,n)=>{let{children:r,...i}=e,a=b.Children.toArray(r),o=a.find(WR);if(o){let e=o.props.children,r=a.map(t=>t===o?b.Children.count(e)>1?b.Children.only(null):b.isValidElement(e)?e.props.children:null:t);return(0,x.jsx)(t,{...i,ref:n,children:b.isValidElement(e)?b.cloneElement(e,void 0,r):null})}return(0,x.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function HR(e){let t=b.forwardRef((e,t)=>{let{children:n,...r}=e;if(b.isValidElement(n)){let e=KR(n),i=GR(r,n.props);return n.type!==b.Fragment&&(i.ref=t?OR(t,e):e),b.cloneElement(n,i)}return b.Children.count(n)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UR=Symbol(`radix.slottable`);function WR(e){return b.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===UR}function GR(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 KR(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 qR=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=VR(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,x.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function JR(e,t){e&&G.flushSync(()=>e.dispatchEvent(t))}function YR(e){let t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...e)=>t.current?.(...e),[])}function XR(e,t=globalThis?.document){let n=YR(e);b.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 ZR=`DismissableLayer`,QR=`dismissableLayer.update`,$R=`dismissableLayer.pointerDownOutside`,ez=`dismissableLayer.focusOutside`,tz,nz=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rz=b.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=b.useContext(nz),[u,d]=b.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=b.useState({}),m=kR(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,S=v>=_,C=oz(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!S||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),w=sz(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return XR(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),b.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(tz=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),cz(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=tz)}},[u,f,n,l]),b.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),cz())},[u,l]),b.useEffect(()=>{let e=()=>p({});return document.addEventListener(QR,e),()=>document.removeEventListener(QR,e)},[]),(0,x.jsx)(qR.div,{...c,ref:m,style:{pointerEvents:y?S?`auto`:`none`:void 0,...e.style},onFocusCapture:ER(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ER(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ER(e.onPointerDownCapture,C.onPointerDownCapture)})});rz.displayName=ZR;var iz=`DismissableLayerBranch`,az=b.forwardRef((e,t)=>{let n=b.useContext(nz),r=b.useRef(null),i=kR(t,r);return b.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,x.jsx)(qR.div,{...e,ref:i})});az.displayName=iz;function oz(e,t=globalThis?.document){let n=YR(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){lz($R,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 sz(e,t=globalThis?.document){let n=YR(e),r=b.useRef(!1);return b.useEffect(()=>{let e=e=>{e.target&&!r.current&&lz(ez,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 cz(){let e=new CustomEvent(QR);document.dispatchEvent(e)}function lz(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?JR(i,a):i.dispatchEvent(a)}var uz=`focusScope.autoFocusOnMount`,dz=`focusScope.autoFocusOnUnmount`,fz={bubbles:!1,cancelable:!0},pz=`FocusScope`,mz=b.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=YR(i),u=YR(a),d=b.useRef(null),f=kR(t,e=>c(e)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xz(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xz(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xz(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]),b.useEffect(()=>{if(s){Sz.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(uz,fz);s.addEventListener(uz,l),s.dispatchEvent(t),t.defaultPrevented||(hz(Tz(_z(s)),{select:!0}),document.activeElement===e&&xz(s))}return()=>{s.removeEventListener(uz,l),setTimeout(()=>{let t=new CustomEvent(dz,fz);s.addEventListener(dz,u),s.dispatchEvent(t),t.defaultPrevented||xz(e??document.body,{select:!0}),s.removeEventListener(dz,u),Sz.remove(p)},0)}}},[s,l,u,p]);let m=b.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]=gz(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xz(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xz(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,x.jsx)(qR.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});mz.displayName=pz;function hz(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xz(r,{select:t}),document.activeElement!==n)return}function gz(e){let t=_z(e);return[vz(t,e),vz(t.reverse(),e)]}function _z(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 vz(e,t){for(let n of e)if(!yz(n,{upTo:t}))return n}function yz(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 bz(e){return e instanceof HTMLInputElement&&`select`in e}function xz(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bz(e)&&t&&e.select()}}var Sz=Cz();function Cz(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wz(e,t),e.unshift(t)},remove(t){e=wz(e,t),e[0]?.resume()}}}function wz(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tz(e){return e.filter(e=>e.tagName!==`A`)}var Ez=`Portal`,Dz=b.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=b.useState(!1);NR(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?G.createPortal((0,x.jsx)(qR.div,{...r,ref:t}),o):null});Dz.displayName=Ez;function Oz(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}var kz=e=>{let{present:t,children:n}=e,r=Az(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=kR(r.ref,Mz(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null};kz.displayName=`Presence`;function Az(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),[o,s]=Oz(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{let e=jz(r.current);a.current=o===`mounted`?e:`none`},[o]),NR(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=jz(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),NR(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=jz(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=jz(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)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:b.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function jz(e){return e?.animationName||`none`}function Mz(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 Nz=0;function Pz(){b.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Fz()),document.body.insertAdjacentElement(`beforeend`,e[1]??Fz()),Nz++,()=>{Nz===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Nz--}},[])}function Fz(){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 Iz=`Dialog`,[Lz,Rz]=jR(Iz),[zz,Bz]=Lz(Iz),Vz=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=b.useRef(null),c=b.useRef(null),[l,u]=RR({prop:r,defaultProp:i??!1,onChange:a,caller:Iz});return(0,x.jsx)(zz,{scope:t,triggerRef:s,contentRef:c,contentId:IR(),titleId:IR(),descriptionId:IR(),open:l,onOpenChange:u,onOpenToggle:b.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Vz.displayName=Iz;var Hz=`DialogTrigger`,Uz=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(Hz,n),a=kR(t,i.triggerRef);return(0,x.jsx)(qR.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":lB(i.open),...r,ref:a,onClick:ER(e.onClick,i.onOpenToggle)})});Uz.displayName=Hz;var Wz=`DialogPortal`,[Gz,Kz]=Lz(Wz,{forceMount:void 0}),qz=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Bz(Wz,t);return(0,x.jsx)(Gz,{scope:t,forceMount:n,children:b.Children.map(r,e=>(0,x.jsx)(kz,{present:n||a.open,children:(0,x.jsx)(Dz,{asChild:!0,container:i,children:e})}))})};qz.displayName=Wz;var Jz=`DialogOverlay`,Yz=b.forwardRef((e,t)=>{let n=Kz(Jz,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Bz(Jz,e.__scopeDialog);return a.modal?(0,x.jsx)(kz,{present:r||a.open,children:(0,x.jsx)(Zz,{...i,ref:t})}):null});Yz.displayName=Jz;var Xz=VR(`DialogOverlay.RemoveScroll`),Zz=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(Jz,n);return(0,x.jsx)($N,{as:Xz,allowPinchZoom:!0,shards:[i.contentRef],children:(0,x.jsx)(qR.div,{"data-state":lB(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Qz=`DialogContent`,$z=b.forwardRef((e,t)=>{let n=Kz(Qz,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Bz(Qz,e.__scopeDialog);return(0,x.jsx)(kz,{present:r||a.open,children:a.modal?(0,x.jsx)(eB,{...i,ref:t}):(0,x.jsx)(tB,{...i,ref:t})})});$z.displayName=Qz;var eB=b.forwardRef((e,t)=>{let n=Bz(Qz,e.__scopeDialog),r=b.useRef(null),i=kR(t,n.contentRef,r);return b.useEffect(()=>{let e=r.current;if(e)return WM(e)},[]),(0,x.jsx)(nB,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ER(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ER(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ER(e.onFocusOutside,e=>e.preventDefault())})}),tB=b.forwardRef((e,t)=>{let n=Bz(Qz,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return(0,x.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=b.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Bz(Qz,n),c=b.useRef(null),l=kR(t,c);return Pz(),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(mz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,x.jsx)(rz,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":lB(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(pB,{titleId:s.titleId}),(0,x.jsx)(hB,{contentRef:c,descriptionId:s.descriptionId})]})]})}),rB=`DialogTitle`,iB=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(rB,n);return(0,x.jsx)(qR.h2,{id:i.titleId,...r,ref:t})});iB.displayName=rB;var aB=`DialogDescription`,oB=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(aB,n);return(0,x.jsx)(qR.p,{id:i.descriptionId,...r,ref:t})});oB.displayName=aB;var sB=`DialogClose`,cB=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(sB,n);return(0,x.jsx)(qR.button,{type:`button`,...r,ref:t,onClick:ER(e.onClick,()=>i.onOpenChange(!1))})});cB.displayName=sB;function lB(e){return e?`open`:`closed`}var uB=`DialogTitleWarning`,[dB,fB]=AR(uB,{contentName:Qz,titleName:rB,docsSlug:`dialog`}),pB=({titleId:e})=>{let t=fB(uB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
98
|
+
`},JN=0,YN=[];function XN(e){var t=b.useRef([]),n=b.useRef([0,0]),r=b.useRef(),i=b.useState(JN++)[0],a=b.useState(vN)[0],o=b.useRef(e);b.useEffect(function(){o.current=e},[e]),b.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=qM([e.lockRef.current],(e.shards||[]).map(GN),!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=b.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=UN(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=IN(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=IN(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 HN(h,t,e,h===`h`?s:c,!0)},[]),c=b.useCallback(function(e){var n=e;if(!(!YN.length||YN[YN.length-1]!==a)){var r=`deltaY`in n?WN(n):UN(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&KN(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(GN).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=b.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:ZN(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=b.useCallback(function(e){n.current=UN(e),r.current=void 0},[]),d=b.useCallback(function(t){l(t.type,WN(t),t.target,s(t,e.lockRef.current))},[]),f=b.useCallback(function(t){l(t.type,UN(t),t.target,s(t,e.lockRef.current))},[]);b.useEffect(function(){return YN.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,jN),document.addEventListener(`touchmove`,c,jN),document.addEventListener(`touchstart`,u,jN),function(){YN=YN.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,jN),document.removeEventListener(`touchmove`,c,jN),document.removeEventListener(`touchstart`,u,jN)}},[]);var p=e.removeScrollBar,m=e.inert;return b.createElement(b.Fragment,null,m?b.createElement(a,{styles:qN(i)}):null,p?b.createElement(ON,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function ZN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var QN=sN(cN,XN),$N=b.forwardRef(function(e,t){return b.createElement(uN,GM({},e,{ref:t,sideCar:QN}))});$N.classNames=uN.classNames;var eP=Object.defineProperty,tP=(e,t)=>eP(e,`name`,{value:t,configurable:!0}),nP=[` `,`Enter`,`ArrowUp`,`ArrowDown`],rP=[` `,`Enter`],iP=`Select`,[aP,oP,sP]=Vl(iP),[cP,lP]=El(iP,[sP,yM]),uP=yM(),[dP,fP]=cP(iP),[pP,mP]=cP(iP);function hP(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=uP(t),[_,v]=b.useState(null),[y,S]=b.useState(null),[C,w]=b.useState(!1),T=Sk(l),[E,D]=Tu({prop:r,defaultProp:i??!1,onChange:a,caller:iP}),[O,k]=Tu({prop:o,defaultProp:s,onChange:c,caller:iP}),A=b.useRef(null),j=b.useRef(O);b.useEffect(()=>{let e=m?_?.ownerDocument.getElementById(m):_?.form;if(e instanceof HTMLFormElement){let t=tP(()=>k(j.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,_,k]);let M=!_||!!m||!!_.closest(`form`),[N,P]=b.useState(new Set),F=Kk(),I=Array.from(N).map(e=>e.props.value).join(`;`),L=b.useCallback(e=>{P(t=>new Set(t).add(e))},[]),ee=b.useCallback(e=>{P(t=>{let n=new Set(t);return n.delete(e),n})},[]),te={required:p,trigger:_,onTriggerChange:v,valueNode:y,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,x.jsx)(MM,{...g,children:(0,x.jsx)(dP,{scope:t,...te,children:(0,x.jsx)(aP.Provider,{scope:t,children:(0,x.jsx)(pP,{scope:t,onNativeOptionAdd:L,onNativeOptionRemove:ee,children:oF(h)?h(te):n})})})})}tP(hP,`SelectProvider`);var gP=tP(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,x.jsx)(hP,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,x.jsxs)(x.Fragment,{children:[n,e?(0,x.jsx)(aF,{__scopeSelect:t}):null]})})},`Select`),_P=`SelectTrigger`,vP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=uP(n),o=fP(_P,n),s=o.disabled||r,c=Tl(t,o.onTriggerChange),l=oP(n),u=b.useRef(`touch`),[d,f,p]=cF(e=>{let t=l().filter(e=>!e.disabled),n=lF(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=tP(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,x.jsx)(NM,{asChild:!0,...a,children:(0,x.jsx)(K.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":sF(o.value)?``:void 0,...i,ref:c,onClick:vl(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:vl(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:vl(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&nP.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),yP=`SelectValue`,bP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=fP(yP,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=Tl(t,c.onValueNodeChange);su(()=>{l(u)},[l,u]);let f=sF(c.value);return(0,x.jsx)(K.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,x.jsx)(b.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),xP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,x.jsx)(K.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[SP,CP]=cP(`SelectPortal`,{forceMount:void 0}),wP=tP(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,x.jsx)(SP,{scope:e.__scopeSelect,forceMount:n,children:(0,x.jsx)(lu,{asChild:!0,...r})})},`SelectPortal`),TP=`SelectContent`,EP=b.forwardRef(tP(function(e,t){let n=CP(TP,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=fP(TP,e.__scopeSelect),[o,s]=b.useState();return su(()=>{s(new DocumentFragment)},[]),(0,x.jsx)(pu,{present:r||a.open,children:({present:e})=>e?(0,x.jsx)(MP,{...i,ref:t}):(0,x.jsx)(DP,{...i,fragment:o})})},`SelectContent`)),DP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?G.createPortal((0,x.jsx)(kP,{scope:n,children:(0,x.jsx)(aP.Slot,{scope:n,children:(0,x.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),OP=10,[kP,AP]=cP(TP),jP=Ol(`SelectContent.RemoveScroll`),MP=b.forwardRef(tP(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,v=fP(TP,n),[y,S]=b.useState(null),[C,w]=b.useState(null),T=Tl(t,S),[E,D]=b.useState(null),[O,k]=b.useState(null),A=oP(n),[j,M]=b.useState(!1),N=b.useRef(!1);b.useEffect(()=>{if(y)return WM(y)},[y]),Tk();let P=b.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=b.useCallback(()=>P([E,y]),[P,E,y]);b.useEffect(()=>{j&&F()},[j,F]);let{onOpenChange:I,triggerPointerDownPosRef:L}=v;b.useEffect(()=>{if(y){let e={x:0,y:0},t=tP(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=tP(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(y)||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})}}},[y,I,L]),b.useEffect(()=>{let e=tP(()=>I(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[I]);let[ee,te]=cF(e=>{let t=A().filter(e=>!e.disabled),n=lF(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ne=b.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&(D(e),r&&(N.current=!0))},[v.value]),R=b.useCallback(()=>y?.focus(),[y]),z=b.useCallback((e,t,n)=>{let r=!N.current&&!n;(v.value!==void 0&&v.value===t||r)&&k(e)},[v.value]),B=r===`popper`?PP:NP,re=B===PP?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,x.jsx)(kP,{scope:n,content:y,viewport:C,onViewportChange:w,itemRefCallback:ne,selectedItem:E,onItemLeave:R,itemTextRefCallback:z,focusSelectedItem:F,selectedItemText:O,position:r,isPositioned:j,searchRef:ee,children:(0,x.jsx)($N,{as:jP,allowPinchZoom:!0,children:(0,x.jsx)(Mk,{asChild:!0,trapped:v.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:vl(i,e=>{v.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,x.jsx)(Zl,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>v.onOpenChange(!1),children:(0,x.jsx)(B,{role:`listbox`,id:v.contentId,"data-state":v.open?`open`:`closed`,dir:v.dir,onContextMenu:e=>e.preventDefault(),..._,...re,onPlaced:()=>M(!0),ref:T,style:{display:`flex`,flexDirection:`column`,outline:`none`,..._.style},onKeyDown:vl(_.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`)),NP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=fP(TP,n),o=AP(TP,n),[s,c]=b.useState(null),[l,u]=b.useState(null),d=Tl(t,u),f=oP(n),p=b.useRef(!1),m=b.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:_,focusSelectedItem:v}=o,y=b.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-OP,d=bk(a,[OP,Math.max(OP,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-OP,d=bk(a,[OP,Math.max(OP,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-OP*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-OP,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=`${OP}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(()=>y(),[y]);let[S,C]=b.useState();return su(()=>{l&&C(window.getComputedStyle(l).zIndex)},[l]),(0,x.jsx)(FP,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:b.useCallback(e=>{e&&m.current===!0&&(y(),v?.(),m.current=!1)},[y,v]),children:(0,x.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:S},children:(0,x.jsx)(K.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),PP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=OP,...a}=e,o=uP(n);return(0,x.jsx)(PM,{...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`)),[FP,IP]=cP(TP,{}),LP=`SelectViewport`,RP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=AP(LP,n),o=IP(LP,n),s=Tl(t,a.onViewportChange),c=b.useRef(0);return(0,x.jsxs)(x.Fragment,{children:[(0,x.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,x.jsx)(aP.Slot,{scope:n,children:(0,x.jsx)(K.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:vl(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-OP*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`)),[zP,BP]=cP(`SelectGroup`),VP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e,i=Kk();return(0,x.jsx)(zP,{scope:n,id:i,children:(0,x.jsx)(K.div,{role:`group`,"aria-labelledby":i,...r,ref:t})})},`SelectGroup`)),HP=`SelectLabel`,UP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e,i=BP(HP,n);return(0,x.jsx)(K.div,{id:i.id,...r,ref:t})},`SelectLabel`)),WP=`SelectItem`,[GP,KP]=cP(WP),qP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=fP(WP,n),c=AP(WP,n),l=s.value===r,[u,d]=b.useState(a??``),[f,p]=b.useState(!1),m=Tl(t,Ul(e=>c.itemRefCallback?.(e,r,i))),h=Kk(),g=b.useRef(`touch`),_=tP(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,x.jsx)(GP,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:b.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,x.jsx)(aP.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,x.jsx)(K.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:vl(o.onFocus,()=>p(!0)),onBlur:vl(o.onBlur,()=>p(!1)),onClick:vl(o.onClick,()=>{g.current!==`mouse`&&_()}),onPointerUp:vl(o.onPointerUp,()=>{g.current===`mouse`&&_()}),onPointerDown:vl(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:vl(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:vl(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:vl(o.onKeyDown,e=>{i||e.target!==e.currentTarget||c.searchRef?.current!==``&&e.key===` `||(rP.includes(e.key)&&_(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),JP=`SelectItemText`,YP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=fP(JP,n),s=AP(JP,n),c=KP(JP,n),l=mP(JP,n),[u,d]=b.useState(null),f=Ul(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=Tl(t,d,c.onItemTextChange,f),m=u?.textContent,h=b.useMemo(()=>(0,x.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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(K.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!sF(o.value)?G.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),XP=`SelectItemIndicator`,ZP=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e;return KP(XP,n).isSelected?(0,x.jsx)(K.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),QP=`SelectScrollUpButton`,$P=b.forwardRef(tP(function(e,t){let n=AP(QP,e.__scopeSelect),r=IP(QP,e.__scopeSelect),[i,a]=b.useState(!1),o=Tl(t,r.onScrollButtonChange);return su(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};tP(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,x.jsx)(nF,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),eF=`SelectScrollDownButton`,tF=b.forwardRef(tP(function(e,t){let n=AP(eF,e.__scopeSelect),r=IP(eF,e.__scopeSelect),[i,a]=b.useState(!1),o=Tl(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)};tP(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,x.jsx)(nF,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),nF=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=AP(`SelectScrollButton`,n),o=b.useRef(null),s=oP(n),c=b.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return b.useEffect(()=>()=>c(),[c]),su(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,x.jsx)(K.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:vl(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:vl(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:vl(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),rF=b.forwardRef(tP(function(e,t){let{__scopeSelect:n,...r}=e;return(0,x.jsx)(K.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),iF=`SelectBubbleInput`,aF=b.forwardRef(tP(function({__scopeSelect:e,...t},n){let r=fP(iF,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=b.useRef(null),m=Tl(n,p),h=i??``,g=FM(h),_=Array.from(d).some(e=>(e.props.value??``)===``);return b.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,x.jsxs)(K.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Mu,...t.style},ref:m,defaultValue:h,children:[sF(i)&&!_?(0,x.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function oF(e){return typeof e==`function`}tP(oF,`isFunction`);function sF(e){return e===``||e===void 0}tP(sF,`shouldShowPlaceholder`);function cF(e){let t=Ul(e),n=b.useRef(``),r=b.useRef(0),i=b.useCallback(e=>{let i=n.current+e;t(i),tP((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=b.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return b.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}tP(cF,`useTypeaheadSearch`);function lF(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=uF(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}tP(lF,`findNextItem`);function uF(e,t){return e.map((n,r)=>e[(t+r)%e.length])}tP(uF,`wrapArray`);var dF=gP,fF=VP,pF=bP,mF=({validationStyleEnabled:e=!1,className:t,children:n,...r})=>(0,x.jsxs)(vP,{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,x.jsx)(xP,{asChild:!0,children:(0,x.jsx)($d,{className:`size-4 opacity-50`})})]}),hF=({className:e,...t})=>(0,x.jsx)($P,{className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,x.jsx)(Qd,{})}),gF=({className:e,...t})=>(0,x.jsx)(tF,{className:W(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,x.jsx)(Yd,{})}),_F=({className:e,children:t,position:n=`popper`,...r})=>(0,x.jsx)(wP,{children:(0,x.jsxs)(EP,{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,x.jsx)(hF,{}),(0,x.jsx)(RP,{className:W(`p-1`,n===`popper`&&`h-(--radix-select-trigger-height) w-full min-w-(--radix-select-trigger-width)`),children:t}),(0,x.jsx)(gF,{})]})}),vF=({className:e,...t})=>(0,x.jsx)(UP,{className:W(`px-1 py-0.5 font-semibold text-sm`,e),...t}),yF=({className:e,children:t,...n})=>(0,x.jsxs)(qP,{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,x.jsx)(`span`,{className:`absolute right-2 flex size-3.5 items-center justify-center`,children:(0,x.jsx)(ZP,{children:(0,x.jsx)(Jd,{className:`size-4`})})}),(0,x.jsx)(YP,{children:t})]}),bF=({className:e,...t})=>(0,x.jsx)(rF,{className:W(`-mx-1 my-1 h-px`,`bg-neutral-200 dark:bg-neutral-800`,e),...t}),Y=dF;Y.Group=fF,Y.Value=pF,Y.Trigger=mF,Y.ScrollUpButton=hF,Y.ScrollDownButton=gF,Y.Content=_F,Y.Label=vF,Y.Item=yF,Y.Separator=bF;var xF=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}},SF=e=>{let t=(0,V.c)(13),{value:n,onChange:r}=e,i;t[0]===n?i=t[1]:(i=xF(n),t[0]=n,t[1]=i);let{comparator:a,numberValue:o}=i,[s,c]=(0,b.useState)(a??null),[l,u]=(0,b.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,b.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,x.jsxs)(`div`,{className:`flex gap-1`,children:[(0,x.jsxs)(Y,{onValueChange:c,defaultValue:a,children:[(0,x.jsx)(Y.Trigger,{className:`w-20`,children:(0,x.jsx)(Y.Value,{placeholder:`Select a comparator`})}),(0,x.jsxs)(Y.Content,{children:[(0,x.jsx)(Y.Item,{value:`<`,children:`<`}),(0,x.jsx)(Y.Item,{value:`<=`,children:`<=`}),(0,x.jsx)(Y.Item,{value:`=`,children:`=`}),(0,x.jsx)(Y.Item,{value:`>=`,children:`>=`}),(0,x.jsx)(Y.Item,{value:`>`,children:`>`})]})]}),(0,x.jsx)(SO,{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},CF=({rawContent:e})=>{let[t,n]=(0,b.useState)(``);return(0,b.useEffect)(()=>{lt(async()=>{let{default:e}=await import(`./purify.es-DuRL7t6i.js`);return{default:e}},[]).then(({default:t})=>{n(t.sanitize(e))})},[e]),t?(0,x.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):(0,x.jsx)(`div`,{})},wF=(0,b.lazy)(()=>lt(()=>import(`./MarkDownRender-qfMfU2ef.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0,1,2,3]))),TF=(0,b.lazy)(()=>lt(()=>import(`./MarkdownEditor-BYT_gqLS.js`).then(e=>({default:e.MarkdownEditor})),__vite__mapDeps([4,2,3,1,5]))),EF=(0,b.memo)(function(e){let t=(0,V.c)(2),{label:n,...r}=e,[i,a]=(0,b.useState)(!1),o;return t[0]===i?o=t[1]:(o=e=>{e&&!i&&a(!0)},t[0]=i,t[1]=o),(0,x.jsx)(oO,{header:n,label:n,onToggle:o,children:i?(0,x.jsx)(WF,{...r}):null})}),DF=e=>{let t=(0,V.c)(14),{keyPath:n,dictionary:r,...i}=e,{editedContent:a,addEditedContent:o}=Hw(),s=Bw(),{mutate:c,isPending:l}=GD(),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,x.jsx)(dk,{variant:`default`,onContentChange:u,additionalButtons:(0,x.jsx)(iO,{Icon:gf,label:`Audit`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,isLoading:l,onClick:d}),...i})},OF=e=>{let t=(0,V.c)(4),{keyPath:n,dictionary:r,...i}=e,{addEditedContent:a}=Hw(),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,x.jsx)(KO,{variant:`default`,onContentChange:o,...i})},kF=[{content:`False`,value:!1},{content:`True`,value:!0}],AF=e=>{let t=(0,V.c)(4),{dictionary:n,keyPath:r,...i}=e,{addEditedContent:a}=Hw(),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,x.jsx)(gO,{choices:kF,value:!0,onChange:o,color:`text`,size:`sm`,...i})},jF=e=>{let t=(0,V.c)(15),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{locale:o,defaultLocale:s}=an(),{selectedLocales:c}=gk(),l=n[w],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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:Ut(e,o)})}),(0,x.jsx)(`tr`,{className:`flex`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:l[e]??Xt(l[s]),keyPath:[...r,{type:w,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,x.jsx)(`table`,{className:`w-full`,children:(0,x.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},MF=e=>{let t=(0,V.c)(19),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=Hw(),{addNewEnumeration:s,removeEnumeration:c}=rn(`navigation-view`),l=n[T],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,Xt(l[d])??``,[...r,{type:T,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,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(n[T]).map(e=>{let t=[...r,{type:T,key:e}],s=`${JSON.stringify(r)}-enumeration-${e}`;return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(`div`,{className:`flex flex-1`,children:(0,x.jsx)(iO,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,Icon:hf,onClick:()=>o(i.localId,void 0,t),children:c.text})})})}),(0,x.jsx)(`tr`,{className:`w-full p-2`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(SF,{value:e,onChange:t=>{let a=n[T],s=vk(a,e,t),c={...n,[T]:s};console.log(`newValue`,c),o(i.localId,c,r)}})})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(WF,{section:l[e]??Xt(l[d]),keyPath:t,dictionary:i,renderSection:a})})})]},s)})})}),(0,x.jsx)(iO,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:e,Icon:df,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},NF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[D];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:i[e]??Xt(i.true),keyPath:[...t,{type:D,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},PF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[te];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:i[e]??Xt(i.male),keyPath:[...t,{type:te,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},FF=[`zero`,`one`,`two`,`few`,`many`,`other`],IF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[E];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:FF.map(e=>{let a=`${JSON.stringify(t)}-plural-${e}`;return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:e})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:i[e]??Xt(i.other),keyPath:[...t,{type:E,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},LF=e=>{let t=(0,V.c)(22),{section:n,keyPath:r,dictionary:i,renderSection:a}=e,{addEditedContent:o}=Hw(),{addNewElement:s,removeElement:c}=rn(`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,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 w-full p-2`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,x.jsx)(`span`,{className:`text-xs`,children:String(t)}),(0,x.jsx)(iO,{label:c.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-neutral hover:text-error`,onClick:()=>{let e=[...r,{type:j,key:t}];o(i.localId,void 0,e)},Icon:hf,children:c.text})]})})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(GF,{section:e??Xt(n[0]),keyPath:[...r,{type:j,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:j,key:n.length}];o(i.localId,Xt(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,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:n.map(e)})}),(0,x.jsx)(iO,{label:s.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:u,Icon:df,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},RF=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e,a=Object.keys(i)[0];return(0,x.jsx)(`table`,{className:`w-full`,children:(0,x.jsx)(`tbody`,{className:`flex flex-col gap-2`,children:Object.keys(i).map(e=>{let o=[...t,{type:A,key:e}],s=i[e]??Xt(i[a]),c=`${JSON.stringify(t)}-object-${e}`;return typeof s!=`object`||!s?(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`tr`,{className:`mt-2 p-2 text-xs`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,x.jsx)(`tr`,{className:`block w-full`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(WF,{section:s,keyPath:o,dictionary:n,renderSection:r})})})]},c):(0,x.jsx)(`tr`,{className:`block w-full border-neutral/10 border-t py-1`,children:(0,x.jsx)(`td`,{className:`flex w-full`,children:(0,x.jsx)(EF,{label:Mt(e),section:s,keyPath:o,dictionary:n,renderSection:r})})},c)})})})},zF=e=>{let t=(0,V.c)(5),{section:n,keyPath:r,dictionary:i}=e,[a,o]=(0,b.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,x.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,x.jsx)(gO,{choices:e,value:a,onChange:o,color:`text`,size:`sm`,className:`ml-auto`}),(0,x.jsx)(GF,{section:l,keyPath:c,dictionary:i,renderSection:a===1?KF:void 0})]}),t[0]=i,t[1]=r,t[2]=a,t[3]=n,t[4]=s}else s=t[4];return s},BF=e=>{let t=(0,V.c)(12),{section:n,keyPath:r,dictionary:i,isDarkMode:a}=e,[o,s]=(0,b.useState)(0),{addEditedContent:c}=Hw(),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,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(tO,{}),children:(0,x.jsx)(TF,{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,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(tO,{}),children:(0,x.jsx)(wF,{isDarkMode:a,children:e})}),t[10]=a,t[11]=m);let h=m;l=(0,x.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,x.jsx)(gO,{choices:e,value:o,onChange:s,color:`text`,size:`sm`,className:`ml-auto`}),(0,x.jsx)(GF,{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},VF=({section:e,keyPath:t,...n})=>{let r=[...t,{type:O}],i=e[O];return(0,x.jsx)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:(0,x.jsx)(GF,{section:i,keyPath:r,...n})})},HF=({section:e,keyPath:t,...n})=>{let r=[...t,{type:k}],i=e[k],{content:a}=e;return(0,x.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,x.jsxs)(`span`,{className:`text-neutral text-sm`,children:[i,` `]}),(0,x.jsx)(GF,{section:a,keyPath:r,...n})]})},UF=e=>{let{keyPath:t,dictionary:n,renderSection:r,section:i,...a}=e,{addEditedContent:o}=Hw(),s=i[M],c=[...t,{type:M}];return(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-4 p-2`,children:[(0,x.jsx)(yk,{children:`Dictionary key`}),(0,x.jsx)(KO,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,dictionaryKey:String(e)},c)},children:s.dictionaryKey??``}),(0,x.jsx)(yk,{children:`Path (optional)`}),(0,x.jsx)(KO,{"aria-label":`Edit field`,type:`text`,variant:`default`,...a,onContentChange:e=>{o(n.localId,{...s,path:e===``?void 0:e},c)},children:s.path??``})]})},WF=(0,b.memo)(function(e){let t=(0,V.c)(82),{section:n,keyPath:r,dictionary:i,renderSection:a,isDarkMode:o}=e,{tsxNotEditable:s}=rn(`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=en(n);if(e===`reactNode`){let e;t[8]===s?e=t[9]:(e=(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,x.jsx)(`span`,{children:`(React Node)`}),(0,x.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,x.jsx)(UF,{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,x.jsx)(jF,{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,x.jsx)(MF,{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,x.jsx)(NF,{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===`gender`){let e;t[30]!==i||t[31]!==r||t[32]!==a||t[33]!==n?(e=(0,x.jsx)(PF,{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===`plural`){let e;t[35]!==i||t[36]!==r||t[37]!==a||t[38]!==n?(e=(0,x.jsx)(IF,{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===`insertion`){let e;t[40]!==i||t[41]!==r||t[42]!==a||t[43]!==n?(e=(0,x.jsx)(VF,{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===`markdown`){let e;t[45]!==i||t[46]!==o||t[47]!==r||t[48]!==n?(e=(0,x.jsx)(BF,{dictionary:i,keyPath:r,section:n,isDarkMode:o}),t[45]=i,t[46]=o,t[47]=r,t[48]=n,t[49]=e):e=t[49],l=e;break bb0}if(e===`html`){let e;t[50]!==i||t[51]!==r||t[52]!==n?(e=(0,x.jsx)(zF,{dictionary:i,keyPath:r,section:n}),t[50]=i,t[51]=r,t[52]=n,t[53]=e):e=t[53],l=e;break bb0}if(e===`file`){let e;t[54]!==i||t[55]!==r||t[56]!==a||t[57]!==n?(e=(0,x.jsx)(HF,{dictionary:i,renderSection:a,keyPath:r,section:n}),t[54]=i,t[55]=r,t[56]=a,t[57]=n,t[58]=e):e=t[58],l=e;break bb0}if(e===`array`){let e;t[59]!==i||t[60]!==r||t[61]!==a||t[62]!==n?(e=(0,x.jsx)(LF,{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===`object`){let e;t[64]!==i||t[65]!==r||t[66]!==a||t[67]!==n?(e=(0,x.jsx)(RF,{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===`number`){let e;t[69]!==i||t[70]!==r||t[71]!==n?(e=(0,x.jsx)(`div`,{className:`w-full p-2`,children:(0,x.jsx)(OF,{dictionary:i,keyPath:r,type:`number`,"aria-label":`Edit field`,children:n})}),t[69]=i,t[70]=r,t[71]=n,t[72]=e):e=t[72],l=e;break bb0}if(e===`text`){let e;t[73]!==i||t[74]!==r||t[75]!==a||t[76]!==n?(e=(0,x.jsx)(`div`,{className:`w-full p-2`,children:typeof a==`function`?a(n,r):(0,x.jsx)(DF,{variant:`default`,"aria-label":`Edit field`,keyPath:r,dictionary:i,children:n})}),t[73]=i,t[74]=r,t[75]=a,t[76]=n,t[77]=e):e=t[77],l=e;break bb0}if(e===`boolean`){let e;t[78]!==i||t[79]!==r||t[80]!==n?(e=(0,x.jsx)(`div`,{className:`w-full p-2`,children:(0,x.jsx)(AF,{dictionary:i,keyPath:r,value:n})}),t[78]=i,t[79]=r,t[80]=n,t[81]=e):e=t[81],l=e;break bb0}c=(0,x.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}),GF=(0,b.memo)(function(e){return(0,x.jsx)(GO,{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,x.jsx)(WF,{...e})})});function KF(e){return(0,x.jsx)(CF,{rawContent:e})}var qF=Fd(`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`}}),JF=({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},YF=e=>typeof e==`string`||typeof e==`number`?!0:Array.isArray(e)?e.every(YF):(0,b.isValidElement)(e)?YF(e.props.children):!1,XF=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??JF(e),v=f??p?.startsWith(`#`)??!1,y=YF(i),b=_?`noopener noreferrer nofollow`:void 0,S=_?`_blank`:`_self`,C=l&&p&&!_&&!v?Bt(p,l):p;return(0,x.jsxs)(`a`,{href:C===``?void 0:C,"aria-label":a,rel:b,target:S,"aria-current":s?`page`:void 0,suppressHydrationWarning:!0,className:W(qF({variant:t,color:n,roundedSize:r,underlined:c,size:g,className:o})),...m,children:[h&&y?(0,x.jsx)(`span`,{children:i}):i,_&&y&&(0,x.jsx)(af,{className:`ml-2 inline-block size-4`}),v&&(0,x.jsx)(sf,{className:`ml-2 inline-block size-4`})]})},ZF=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]||``,QF=Fd(`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`}}),$F=({href:e,lang:t,children:n,onClick:r,color:i,position:a,locale:o,className:s,...c})=>{let l=ke(`breadcrumb`).linkLabel;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(XF,{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,x.jsx)(`span`,{itemProp:`name`,children:n})}),(0,x.jsx)(`meta`,{itemProp:`position`,content:a.toString()})]})},eI=e=>{let{children:t,onClick:n,color:r,position:i,className:a,...o}=e,{linkLabel:s}=rn(`breadcrumb`);return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(iO,{onClick:n,variant:`link`,label:`${s} ${t}`,color:r,itemProp:`item`,size:`custom`,...o,children:(0,x.jsx)(`span`,{itemProp:`name`,children:t})}),(0,x.jsx)(`meta`,{itemProp:`position`,content:i.toString()})]})},tI=({children:e,position:t,className:n,...r})=>(0,x.jsxs)(`span`,{itemProp:`item`,className:W(`inline-flex items-center`,`font-medium text-neutral-700`,`transition-colors duration-200`,n),children:[(0,x.jsx)(`span`,{itemProp:`name`,...r,children:e}),(0,x.jsx)(`meta`,{itemProp:`position`,content:t.toString()})]}),nI=({links:e,className:t,color:n=`text`,locale:r,elementType:i=`page`,separator:a=(0,x.jsx)(Zd,{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,x.jsx)(`nav`,{"aria-label":o,children:(0,x.jsx)(`ol`,{className:W(QF({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=ZF(n);if(p)return(0,x.jsxs)(b.Fragment,{children:[(0,x.jsx)(`li`,{className:`flex items-center`,"aria-hidden":`true`,children:(0,x.jsx)(`span`,{className:`text-neutral-500`,children:`…`})}),!o&&(0,x.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,x.jsx)(`span`,{className:W(h),children:a})})]},`truncated-${m}`);let g=(0,x.jsx)(tI,{position:t+1,"aria-current":d,className:W(`transition-colors duration-200`,u&&`text-neutral-900`),children:m},m);c?g=(0,x.jsx)($F,{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,x.jsx)(eI,{onClick:e.onClick,color:n,position:t+1,"aria-current":d,className:W(u&&`cursor-default text-neutral-900`),children:m},m));let _=(0,b.createElement)(`li`,{...s&&{itemProp:`itemListElement`,itemScope:!0,itemType:`https://schema.org/ListItem`},key:m,className:`flex items-center`},g);return o?_:(0,x.jsxs)(b.Fragment,{children:[_,(0,x.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,x.jsx)(`span`,{className:W(h),children:a})})]},m)})})})},rI=({keyPath:e,dictionaryKey:t,onClickKeyPath:n,locale:r,color:i,showDictionaryKey:a=!0})=>(0,x.jsx)(nI,{links:[...a?[{text:Mt(t),onClick:n?()=>n([]):void 0}]:[],...e.map((t,r)=>({onClick:n?()=>n?.(e.slice(0,r+1)):void 0,text:Mt(t.key?.toString()??``)}))],locale:r,elementType:`location`,color:i}),iI=({children:e,className:t,identifier:n,...r})=>(0,x.jsx)(`div`,{className:W(`group/dropdown relative flex`,t),"aria-label":`DropDown ${n}`,id:`dropdown-container-${n}`,...r,children:e});iI.Trigger=({children:e,identifier:t,className:n,label:r,...i})=>(0,x.jsx)(iO,{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}),iI.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,x.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,x.jsx)(aO,{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 aI(e){return Array.isArray?Array.isArray(e):hI(e)===`[object Array]`}function oI(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 sI(e){return e==null?``:oI(e)}function cI(e){return typeof e==`string`}function lI(e){return typeof e==`number`}function uI(e){return e===!0||e===!1||fI(e)&&hI(e)==`[object Boolean]`}function dI(e){return typeof e==`object`}function fI(e){return dI(e)&&e!==null}function pI(e){return e!=null}function mI(e){return!e.trim().length}function hI(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var gI=`Incorrect 'index' type`,_I=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,vI=e=>`Invalid value for key ${e}`,yI=e=>`Pattern length exceeds max of ${e}.`,bI=e=>`Missing ${e} property in key`,xI=e=>`Property 'weight' in key '${e}' must be a positive integer`,SI=`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.`,CI=Object.prototype.hasOwnProperty,wI=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=TI(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 TI(e){let t=null,n=null,r=null,i=1,a=null;if(cI(e)||aI(e))r=e,t=EI(e),n=DI(e);else{if(!CI.call(e,`name`))throw Error(bI(`name`));let o=e.name;if(r=o,CI.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(xI(DI(o)));t=EI(o),n=DI(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function EI(e){return aI(e)?e:e.split(`.`)}function DI(e){return aI(e)?e.join(`.`):e}function OI(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(pI(e))if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!pI(s))return;if(a===t.length-1&&(cI(s)||lI(s)||uI(s)||typeof s==`bigint`))n.push(o===void 0?sI(s):{v:sI(s),i:o});else if(aI(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,cI(t)?t.split(`.`):t,0),r?n:n[0]}var kI={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},AI={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},jI={location:0,threshold:.6,distance:100},MI={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:OI,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},X=Object.freeze({...AI,...kI,...jI,...MI});function NI(e){return e>=9&&e<=13||e===32||e===160}function PI(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++)NI(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 FI=class{constructor({getFn:e=X.getFn,fieldNormWeight:t=X.fieldNormWeight}={}){this.norm=PI(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(cI(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(_I);if(cI(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(_I);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!pI(e)||mI(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(pI(i)){if(aI(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(pI(n)){if(cI(n)){if(!mI(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(pI(n.v)){let t=cI(n.v)?n.v:sI(n.v);if(!mI(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(cI(i)&&!mI(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 II(e,t,{getFn:n=X.getFn,fieldNormWeight:r=X.fieldNormWeight}={}){let i=new FI({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(TI)),i.setSources(t),i.create(),i}function LI(e,{getFn:t=X.getFn,fieldNormWeight:n=X.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new FI({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function RI(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 zI(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(yI(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=RI(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function BI(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 VI(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 HI={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},UI=RegExp(`[`+Object.keys(HI).join(``)+`]`,`g`),WI=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(UI,e=>HI[e]):e=>e,GI=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?WI(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:BI(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?WI(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}=zI(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=VI(u)),p}},KI=new Set([`fuzzy`,`include`]);function qI(e){return e.startsWith(`inverse`)}var JI=[{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 GI(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)}}}}],YI=JI.length,XI=`\0`,ZI=`|`;function QI(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 $I(e,t){let n=e.match(t);return n?n[1]:null}function eL(e,t={}){return e.replace(/\\\|/g,XI).split(ZI).map(e=>{let n=QI(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<YI;){let e=JI[o],n=$I(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<YI;){let e=JI[o],n=$I(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var tL=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?WI(e):e,this.pattern=e,this.query=eL(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?WI(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,qI(r.type)&&(c=!0),n&&(KI.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=VI(o)),e}}return{isMatch:!1,score:1}}},nL=[];function rL(...e){nL.push(...e)}function iL(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 GI(e,t)}var aL={AND:`$and`,OR:`$or`},oL={PATH:`$path`,PATTERN:`$val`},sL=e=>!!(e[aL.AND]||e[aL.OR]),cL=e=>!!e[oL.PATH],lL=e=>!aI(e)&&dI(e)&&!sL(e),uL=e=>({[aL.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function dL(e,t,{auto:n=!0}={}){let r=e=>{if(cI(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=iL(e,t)),r}let i=Object.keys(e),a=cL(e);if(!a&&i.length>1&&!sL(e))return r(uL(e));if(lL(e)){let r=a?e[oL.PATH]:i[0],o=a?e[oL.PATTERN]:e[r];if(!cI(o))throw Error(vI(r));let s={keyId:DI(r),pattern:o};return n&&(s.searcher=iL(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];aI(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return sL(e)||(e=uL(e)),r(e)}function fL(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 pL(e,{ignoreFieldNorm:t=X.ignoreFieldNorm}){e.forEach(e=>{e.score=fL(e.matches,{ignoreFieldNorm:t})})}var mL=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 hL(e){let t=[];return e.matches.forEach(e=>{if(!pI(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 gL(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=hL(e)),r&&(a.score=e.score),a})}var _L=/[\p{L}\p{M}\p{N}_]+/gu,vL=new WeakSet;function yL(e){vL.has(e)||(vL.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 bL(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||yL(e),t=>t.match(e)||[]):e=>e.match(_L)||[]}function xL({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=bL(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=WI(n)),r(n)}}}var SL=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=xL({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 GI(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=VI(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function CL(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 wL(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){CL(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)CL(e,t.v,i,r);else CL(e,n.v,i,r)}}function TL(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)wL(r,i,t,n);return r}function EL(e,t,n,r){wL(e,t,n,r)}function DL(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 OL(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)DL(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 kL=class{constructor(e,t,n){this.options={...X,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new wI(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=iL(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 FI))throw Error(gI);if(this._myIndex=t||II(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=xL({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=TL(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!pI(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=xL({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});EL(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&&OL(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(_I);this._invertedIndex&&OL(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(cI(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return lI(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&lI(n)&&n>0&&cI(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new mL(n,u);cI(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=cI(e)?cI(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),pL(d,{ignoreFieldNorm:s}),a&&d.sort(cI(e)?u:l),lI(n)&&n>-1&&(d=d.slice(0,n));return gL(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(!pI(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=fL(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=dL(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===aL.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(pI(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(!pI(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=fL(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!pI(t))return[];let r=[];if(aI(t))t.forEach(({v:t,i,n:a})=>{if(!pI(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}};kL.version=`7.5.0`,kL.createIndex=II,kL.parseIndex=LI,kL.config=X,kL.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(SI);return iL(e,{...X,...n}).searchIn(t)},kL.parseQuery=dL,rL(tL),rL(SL),kL.use=function(...e){e.forEach(e=>rL(e))};var AL=kL,jL=`locale-switcher-content`,ML=({panelProps:e,isMultilingual:t=!0})=>{let{switchTo:n,searchInput:r,localeSwitcherLabel:i,languageListLabel:a,seeAllLocalesSwitch:o}=rn(`locale-switcher-content`),s=(0,b.useRef)(null),{locale:c}=an(),{availableLocales:l,selectedLocales:u,setSelectedLocales:d}=gk(),f=(0,b.useMemo)(()=>l.map(e=>({locale:e,englishName:Ut(e,`en`),currentLocaleName:Ut(e,c),ownLocaleName:Ut(e)})),[l,c]),[p,m]=(0,b.useState)(``),[h,g]=mk(`locale-content-selector-see-all-locales`,!1),_=(0,b.useMemo)(()=>new AL(f,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[f]),v=(0,b.useMemo)(()=>p?_.search(p).map(e=>e.item):f,[p,f,_]),y=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,x.jsx)(`div`,{className:`rounded-xl border border-text text-text transition-colors`,children:(0,x.jsxs)(iI,{identifier:jL,children:[(0,x.jsx)(iI.Trigger,{identifier:jL,label:i.value,className:`p-0!`,roundedSize:`3xl`,color:`text`,variant:`hoverable`,children:(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between text-text`,children:[(0,x.jsx)(`div`,{className:`px-2 py-1`,children:(0,x.jsx)(of,{size:16})}),(0,x.jsx)(cf,{className:`self-center`,size:16})]})}),(0,x.jsx)(iI.Panel,{identifier:jL,isOverable:!0,isFocusable:!0,align:`end`,...e,children:(0,x.jsxs)(GO,{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,x.jsx)(`div`,{className:`m-auto p-2`,children:(0,x.jsx)(gO,{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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(`div`,{className:`p-3`,children:(0,x.jsx)(SO,{type:`search`,"aria-label":r.ariaLabel.value,placeholder:r.placeholder.value,onChange:e=>m(e.target.value),ref:s})}),(0,x.jsx)(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:v.map(({locale:e,currentLocaleName:r,ownLocaleName:i})=>(0,x.jsx)(`li`,{className:`px-1.5 py-1`,children:(0,x.jsx)(iO,{onClick:()=>y(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,x.jsxs)(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[t&&(0,x.jsx)(`div`,{className:`w-4`,children:u.includes(e)&&(0,x.jsx)(Jd,{className:`size-full`})}),(0,x.jsxs)(`div`,{className:`flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col text-nowrap`,children:[(0,x.jsx)(`span`,{dir:Ht(e),lang:e,children:i}),(0,x.jsx)(`span`,{className:`text-neutral text-xs`,children:r})]}),(0,x.jsx)(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})]})})},e))})]})]})})]})})},NL=Fd(`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`}}),PL=(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},FL=e=>e?.getAttribute(`aria-current`)===`true`,IL=e=>e===`sm`?`icon-sm`:e===`lg`?`icon-lg`:`icon-md`,LL=e=>(0,x.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}),RL=({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}=rn(`pagination`),m=PL(e,t,a),h=IL(s),g=e===1,_=e===t,v=(0,b.useRef)([]),y=(0,b.useRef)(null),{choiceIndicatorPosition:S,calculatePosition:C}=uO(v,{selector:FL,isHoverable:!0});if((0,b.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,x.jsx)(`div`,{className:W(NL({size:s,variant:c}),u),...d,children:(0,x.jsxs)(`div`,{className:`relative flex items-center gap-1`,children:[S&&(0,x.jsx)(LL,{style:S,ref:y}),i&&(0,x.jsx)(iO,{variant:`outline`,size:h,color:`text`,onClick:()=>w(e-1),disabled:o||g,label:p.value,Icon:Xd,ref:e=>{e&&(v.current[0]=e)},className:`min-w-0 px-2`}),(0,x.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,x.jsx)(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:(0,x.jsx)(rf,{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,x.jsx)(iO,{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&&(v.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,x.jsx)(iO,{variant:`outline`,size:h,color:`text`,onClick:()=>w(e+1),disabled:o||_,label:f.value,Icon:Zd,ref:e=>{let t=+!!i+m.filter(e=>e!==`ellipsis`).length;e&&(v.current[t]=e)},className:`min-w-0 px-2`})]})})},zL=e=>{let t=Zt(e),n=en(e);return t&&(n===`reactNode`||n===`file`)?!0:t&&typeof t.nodeType==`string`?zL(t[t.nodeType]):typeof t==`string`||typeof t==`number`||typeof t==`boolean`||t===void 0},BL=e=>{let t=(0,V.c)(3),{children:n,onToggle:r,...i}=e,[a,o]=(0,b.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,x.jsx)(oO,{...i,onToggle:s,children:a?n:null})},VL=e=>{let t=(0,V.c)(16),{section:n,keyPath:r,dictionary:i}=e,{selectedLocales:a}=gk(),o=Jt(n,r,Fw()),{addEditedContent:s}=Vw(),{setFocusedContentKeyPath:c,focusedContent:l}=Lw(),{addNewElement:u,goToField:d}=rn(`navigation-view`),f=en(o),p;t[0]===l?.keyPath?p=t[1]:(p=e=>(l?.keyPath?.length??0)>0&&Ot(e,l?.keyPath??[]),t[0]=l?.keyPath,t[1]=p);let m=p,h=zL(o);if(!o)return(0,x.jsx)(x.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,x.jsx)(iO,{label:d.label.value,variant:`hoverable`,color:`text`,className:`w-full`,onClick:e,IconRight:Zd,children:Mt(r[r.length-1]?.key)})}if(typeof o==`object`){if(f===`reactNode`)return(0,x.jsx)(x.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:w,key:e}];return(0,x.jsx)(VL,{keyPath:t,section:n,dictionary:i},e)},t[5]=i,t[6]=r,t[7]=n,t[8]=e):e=t[8],(0,x.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:a.map(e)})}if(f===`enumeration`||f===`plural`||f===`condition`)return(0,x.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,x.jsx)(VL,{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:j,key:t}];return zL(e)?(0,x.jsxs)(iO,{label:`${d.label.value} ${t}`,variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(a),IconRight:Zd,isActive:m(a),children:[`Item `,t]},JSON.stringify(a)):(0,x.jsx)(BL,{label:`${d.label.value} ${t}`,header:`Item ${t}`,isActive:m(a),onClick:()=>c(a),children:(0,x.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,x.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,x.jsx)(VL,{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,x.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[o.map(e),(0,x.jsx)(iO,{label:u.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,onClick:()=>{let e=[...r,{type:j,key:o.length}],t=o,n=Xt(t[t.length-1])??``;s(i.localId,n,e,!1),c(e)},Icon:df,children:u.text})]})}if(typeof o.nodeType==`string`){let e=[...r,{type:o.nodeType}];return(0,x.jsx)(VL,{keyPath:e,section:n,dictionary:i})}return(0,x.jsx)(`div`,{className:`flex w-full max-w-full flex-col justify-between gap-2`,children:Object.keys(o).map(e=>{let t=[...r,{type:A,key:e}];return zL(Jt(n,t))?(0,x.jsx)(iO,{label:`${d.label.value} ${e}`,isActive:m(t),variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>c(t),IconRight:Zd,children:Mt(e)},e):(0,x.jsx)(BL,{label:`${d.label.value} ${e}`,isActive:m(t),onClick:()=>c(t),header:Mt(e),children:(0,x.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,x.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,x.jsx)(VL,{keyPath:t,section:n,dictionary:i})})})},e)})})}return(0,x.jsxs)(x.Fragment,{children:[`Error loading section --`,f,`--`,JSON.stringify(o),`--`,JSON.stringify(r)]})},HL=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,UL=e=>{let t=(0,V.c)(35),{dictionary:n,isDarkMode:r}=e,{itemPagination:i,variantSwitcher:a}=rn(`content-editor`),{editedContent:o}=Hw(),{focusedContent:s,setFocusedContentKeyPath:c}=Lw(),[,l]=(0,b.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,b.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,b.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 v=g&&!!n.key,y;t[8]===v?y=t[9]:(y={enabled:v},t[8]=v,t[9]=y);let{data:S}=qD(_,y),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(WL).sort(GL),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(KL),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=Fw(),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=Jt(F,L,I),t[22]=I,t[23]=F,t[24]=L,t[25]=ee):ee=t[25];let te=ee,ne=(0,b.useDeferredValue)(P),R=(0,b.useDeferredValue)(te),z=R!==te,B;t[26]===F?B=t[27]:(B=zL(F),t[26]=F,t[27]=B);let re=B,ie=zL(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,b.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,x.jsxs)(`div`,{children:[g&&(0,x.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-4`,children:[E.length>0&&(0,x.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,x.jsx)(`span`,{className:`font-medium text-muted text-xs`,children:i.label}),(0,x.jsx)(RL,{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,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,x.jsxs)(`span`,{className:`font-medium text-muted text-xs`,children:[a.label,`:`]}),O.map(e=>{let t=e.localId===f.localId;return(0,x.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:HL(e.variant)},e.localId)}),le!==void 0&&!O.some(e=>e.localId===n.localId)&&(0,x.jsx)(`span`,{className:`rounded-lg bg-text px-3 py-1 font-semibold text-text-opposite text-xs`,children:HL(le)})]})]}),(0,x.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-2`,children:[(0,x.jsx)(rI,{dictionaryKey:M,keyPath:P??[],onClickKeyPath:d}),(0,x.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,x.jsx)(ML,{})})]}),(0,x.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,x.jsx)(GO,{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,x.jsx)(VL,{keyPath:[],section:F,dictionary:f})}),(ie||(ne??[]).length>0)&&(0,x.jsx)(`div`,{className:z?`pointer-events-none flex-1 opacity-50 transition-opacity`:`flex-1 transition-opacity`,children:(0,x.jsx)(GF,{keyPath:ne??[],section:R,dictionary:f,isDarkMode:r})})]})]})};function WL(e){return e.item!==void 0}function GL(e,t){return(e.item??0)-(t.item??0)}function KL(e){return e.variant!==void 0}var qL=Fd(`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`}}),JL=({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,x.jsxs)(p,{className:W(qL({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,x.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,x.jsxs)(`svg`,{className:`size-3`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-label":`Remove badge`,children:[(0,x.jsx)(`title`,{children:`Remove badge`}),(0,x.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`})]})})]})},YL=Object.defineProperty,XL=(e,t)=>YL(e,`name`,{value:t,configurable:!0}),ZL=`Dialog`,[QL,$L]=El(ZL),[eR,tR]=QL(ZL),nR=XL(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=b.useRef(null),c=b.useRef(null),[l,u]=Tu({prop:r,defaultProp:i??!1,onChange:a,caller:ZL}),[d,f]=b.useState(0),[p,m]=b.useState(0);return(0,x.jsx)(eR,{scope:t,triggerRef:s,contentRef:c,contentId:Kk(),titleId:Kk(),descriptionId:Kk(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:b.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),[rR,iR]=QL(`DialogPortal`,{forceMount:void 0}),aR=`DialogContent`,oR=b.forwardRef(XL(function(e,t){let n=iR(aR,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=tR(aR,e.__scopeDialog);return(0,x.jsx)(pu,{present:r||a.open,children:a.modal?(0,x.jsx)(sR,{...i,ref:t}):(0,x.jsx)(cR,{...i,ref:t})})},`DialogContent`)),sR=b.forwardRef(XL(function(e,t){let n=tR(aR,e.__scopeDialog),r=b.useRef(null),i=Tl(t,n.contentRef,r);return b.useEffect(()=>{let e=r.current;if(e)return WM(e)},[]),(0,x.jsx)(lR,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:vl(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:vl(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:vl(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),cR=b.forwardRef(XL(function(e,t){let n=tR(aR,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return(0,x.jsx)(lR,{...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`)),lR=b.forwardRef(XL(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=tR(aR,n);return Tk(),(0,x.jsx)(x.Fragment,{children:(0,x.jsx)(Mk,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,x.jsx)(Zl,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":uR(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function uR(e){return e?`open`:`closed`}XL(uR,`getState`);var dR=1,fR=.9,pR=.8,mR=.17,hR=.1,gR=.999,_R=.9999,vR=.99,yR=/[\\\/_+.#"@\[\(\{&]/,bR=/[\\\/_+.#"@\[\(\{&]/g,xR=/[\s-]/,SR=/[\s-]/g;function CR(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?dR:vR;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=CR(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=dR:yR.test(e.charAt(l-1))?(d*=pR,p=e.slice(i,l-1).match(bR),p&&i>0&&(d*=gR**+p.length)):xR.test(e.charAt(l-1))?(d*=fR,m=e.slice(i,l-1).match(SR),m&&i>0&&(d*=gR**+m.length)):(d*=mR,i>0&&(d*=gR**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=_R)),(d<hR&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=CR(e,t,n,r,l+1,a+2,o),f*hR>d&&(d=f*hR)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function wR(e){return e.toLowerCase().replace(SR,` `)}function TR(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,CR(e,t,wR(e),wR(t),0,0,{})}typeof window<`u`&&window.document&&window.document.createElement;function ER(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),n===!1||!r.defaultPrevented)return t?.(r)}}function DR(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function OR(...e){return t=>{let n=!1,r=e.map(e=>{let r=DR(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():DR(e[t],null)}}}}function kR(...e){return b.useCallback(OR(...e),e)}function AR(e,t){let n=b.createContext(t),r=e=>{let{children:t,...r}=e,i=b.useMemo(()=>r,Object.values(r));return(0,x.jsx)(n.Provider,{value:i,children:t})};r.displayName=e+`Provider`;function i(r){let i=b.useContext(n);if(i)return i;if(t!==void 0)return t;throw Error(`\`${r}\` must be used within \`${e}\``)}return[r,i]}function jR(e,t=[]){let n=[];function r(t,r){let i=b.createContext(r),a=n.length;n=[...n,r];let o=t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=b.useMemo(()=>o,Object.values(o));return(0,x.jsx)(s.Provider,{value:c,children:r})};o.displayName=t+`Provider`;function s(n,o){let s=o?.[e]?.[a]||i,c=b.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=>b.createContext(e));return function(n){let r=n?.[e]||t;return b.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])}};return i.scopeName=e,[r,MR(i,...t)]}function MR(...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 b.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])}};return n.scopeName=t.scopeName,n}var NR=globalThis?.document?b.useLayoutEffect:()=>{},PR=b.useId||(()=>void 0),FR=0;function IR(e){let[t,n]=b.useState(PR());return NR(()=>{e||n(e=>e??String(FR++))},[e]),e||(t?`radix-${t}`:``)}var LR=b.useInsertionEffect||NR;function RR({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){let[i,a,o]=zR({defaultProp:t,onChange:n}),s=e!==void 0,c=s?e:i;{let t=b.useRef(e!==void 0);b.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,b.useCallback(t=>{if(s){let n=BR(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}function zR({defaultProp:e,onChange:t}){let[n,r]=b.useState(e),i=b.useRef(n),a=b.useRef(t);return LR(()=>{a.current=t},[t]),b.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}function BR(e){return typeof e==`function`}function VR(e){let t=HR(e),n=b.forwardRef((e,n)=>{let{children:r,...i}=e,a=b.Children.toArray(r),o=a.find(WR);if(o){let e=o.props.children,r=a.map(t=>t===o?b.Children.count(e)>1?b.Children.only(null):b.isValidElement(e)?e.props.children:null:t);return(0,x.jsx)(t,{...i,ref:n,children:b.isValidElement(e)?b.cloneElement(e,void 0,r):null})}return(0,x.jsx)(t,{...i,ref:n,children:r})});return n.displayName=`${e}.Slot`,n}function HR(e){let t=b.forwardRef((e,t)=>{let{children:n,...r}=e;if(b.isValidElement(n)){let e=KR(n),i=GR(r,n.props);return n.type!==b.Fragment&&(i.ref=t?OR(t,e):e),b.cloneElement(n,i)}return b.Children.count(n)>1?b.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var UR=Symbol(`radix.slottable`);function WR(e){return b.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===UR}function GR(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 KR(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 qR=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=VR(`Primitive.${t}`),r=b.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,x.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function JR(e,t){e&&G.flushSync(()=>e.dispatchEvent(t))}function YR(e){let t=b.useRef(e);return b.useEffect(()=>{t.current=e}),b.useMemo(()=>(...e)=>t.current?.(...e),[])}function XR(e,t=globalThis?.document){let n=YR(e);b.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 ZR=`DismissableLayer`,QR=`dismissableLayer.update`,$R=`dismissableLayer.pointerDownOutside`,ez=`dismissableLayer.focusOutside`,tz,nz=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rz=b.forwardRef((e,t)=>{let{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:o,onDismiss:s,...c}=e,l=b.useContext(nz),[u,d]=b.useState(null),f=u?.ownerDocument??globalThis?.document,[,p]=b.useState({}),m=kR(t,e=>d(e)),h=Array.from(l.layers),[g]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),_=h.indexOf(g),v=u?h.indexOf(u):-1,y=l.layersWithOutsidePointerEventsDisabled.size>0,S=v>=_,C=oz(e=>{let t=e.target,n=[...l.branches].some(e=>e.contains(t));!S||n||(i?.(e),o?.(e),e.defaultPrevented||s?.())},f),w=sz(e=>{let t=e.target;[...l.branches].some(e=>e.contains(t))||(a?.(e),o?.(e),e.defaultPrevented||s?.())},f);return XR(e=>{v===l.layers.size-1&&(r?.(e),!e.defaultPrevented&&s&&(e.preventDefault(),s()))},f),b.useEffect(()=>{if(u)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(tz=f.body.style.pointerEvents,f.body.style.pointerEvents=`none`),l.layersWithOutsidePointerEventsDisabled.add(u)),l.layers.add(u),cz(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=tz)}},[u,f,n,l]),b.useEffect(()=>()=>{u&&(l.layers.delete(u),l.layersWithOutsidePointerEventsDisabled.delete(u),cz())},[u,l]),b.useEffect(()=>{let e=()=>p({});return document.addEventListener(QR,e),()=>document.removeEventListener(QR,e)},[]),(0,x.jsx)(qR.div,{...c,ref:m,style:{pointerEvents:y?S?`auto`:`none`:void 0,...e.style},onFocusCapture:ER(e.onFocusCapture,w.onFocusCapture),onBlurCapture:ER(e.onBlurCapture,w.onBlurCapture),onPointerDownCapture:ER(e.onPointerDownCapture,C.onPointerDownCapture)})});rz.displayName=ZR;var iz=`DismissableLayerBranch`,az=b.forwardRef((e,t)=>{let n=b.useContext(nz),r=b.useRef(null),i=kR(t,r);return b.useEffect(()=>{let e=r.current;if(e)return n.branches.add(e),()=>{n.branches.delete(e)}},[n.branches]),(0,x.jsx)(qR.div,{...e,ref:i})});az.displayName=iz;function oz(e,t=globalThis?.document){let n=YR(e),r=b.useRef(!1),i=b.useRef(()=>{});return b.useEffect(()=>{let e=e=>{if(e.target&&!r.current){let r=function(){lz($R,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 sz(e,t=globalThis?.document){let n=YR(e),r=b.useRef(!1);return b.useEffect(()=>{let e=e=>{e.target&&!r.current&&lz(ez,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 cz(){let e=new CustomEvent(QR);document.dispatchEvent(e)}function lz(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?JR(i,a):i.dispatchEvent(a)}var uz=`focusScope.autoFocusOnMount`,dz=`focusScope.autoFocusOnUnmount`,fz={bubbles:!1,cancelable:!0},pz=`FocusScope`,mz=b.forwardRef((e,t)=>{let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=b.useState(null),l=YR(i),u=YR(a),d=b.useRef(null),f=kR(t,e=>c(e)),p=b.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;b.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:xz(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||xz(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&xz(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]),b.useEffect(()=>{if(s){Sz.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(uz,fz);s.addEventListener(uz,l),s.dispatchEvent(t),t.defaultPrevented||(hz(Tz(_z(s)),{select:!0}),document.activeElement===e&&xz(s))}return()=>{s.removeEventListener(uz,l),setTimeout(()=>{let t=new CustomEvent(dz,fz);s.addEventListener(dz,u),s.dispatchEvent(t),t.defaultPrevented||xz(e??document.body,{select:!0}),s.removeEventListener(dz,u),Sz.remove(p)},0)}}},[s,l,u,p]);let m=b.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]=gz(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&xz(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&xz(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,x.jsx)(qR.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})});mz.displayName=pz;function hz(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(xz(r,{select:t}),document.activeElement!==n)return}function gz(e){let t=_z(e);return[vz(t,e),vz(t.reverse(),e)]}function _z(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 vz(e,t){for(let n of e)if(!yz(n,{upTo:t}))return n}function yz(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 bz(e){return e instanceof HTMLInputElement&&`select`in e}function xz(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&bz(e)&&t&&e.select()}}var Sz=Cz();function Cz(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=wz(e,t),e.unshift(t)},remove(t){e=wz(e,t),e[0]?.resume()}}}function wz(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Tz(e){return e.filter(e=>e.tagName!==`A`)}var Ez=`Portal`,Dz=b.forwardRef((e,t)=>{let{container:n,...r}=e,[i,a]=b.useState(!1);NR(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?G.createPortal((0,x.jsx)(qR.div,{...r,ref:t}),o):null});Dz.displayName=Ez;function Oz(e,t){return b.useReducer((e,n)=>t[e][n]??e,e)}var kz=e=>{let{present:t,children:n}=e,r=Az(t),i=typeof n==`function`?n({present:r.isPresent}):b.Children.only(n),a=kR(r.ref,Mz(i));return typeof n==`function`||r.isPresent?b.cloneElement(i,{ref:a}):null};kz.displayName=`Presence`;function Az(e){let[t,n]=b.useState(),r=b.useRef(null),i=b.useRef(e),a=b.useRef(`none`),[o,s]=Oz(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return b.useEffect(()=>{let e=jz(r.current);a.current=o===`mounted`?e:`none`},[o]),NR(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,o=jz(t);e?s(`MOUNT`):o===`none`||t?.display===`none`?s(`UNMOUNT`):s(n&&r!==o?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,s]),NR(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=a=>{let o=jz(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=jz(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)}}else s(`ANIMATION_END`)},[t,s]),{isPresent:[`mounted`,`unmountSuspended`].includes(o),ref:b.useCallback(e=>{r.current=e?getComputedStyle(e):null,n(e)},[])}}function jz(e){return e?.animationName||`none`}function Mz(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 Nz=0;function Pz(){b.useEffect(()=>{let e=document.querySelectorAll(`[data-radix-focus-guard]`);return document.body.insertAdjacentElement(`afterbegin`,e[0]??Fz()),document.body.insertAdjacentElement(`beforeend`,e[1]??Fz()),Nz++,()=>{Nz===1&&document.querySelectorAll(`[data-radix-focus-guard]`).forEach(e=>e.remove()),Nz--}},[])}function Fz(){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 Iz=`Dialog`,[Lz,Rz]=jR(Iz),[zz,Bz]=Lz(Iz),Vz=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=b.useRef(null),c=b.useRef(null),[l,u]=RR({prop:r,defaultProp:i??!1,onChange:a,caller:Iz});return(0,x.jsx)(zz,{scope:t,triggerRef:s,contentRef:c,contentId:IR(),titleId:IR(),descriptionId:IR(),open:l,onOpenChange:u,onOpenToggle:b.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})};Vz.displayName=Iz;var Hz=`DialogTrigger`,Uz=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(Hz,n),a=kR(t,i.triggerRef);return(0,x.jsx)(qR.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.contentId,"data-state":lB(i.open),...r,ref:a,onClick:ER(e.onClick,i.onOpenToggle)})});Uz.displayName=Hz;var Wz=`DialogPortal`,[Gz,Kz]=Lz(Wz,{forceMount:void 0}),qz=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Bz(Wz,t);return(0,x.jsx)(Gz,{scope:t,forceMount:n,children:b.Children.map(r,e=>(0,x.jsx)(kz,{present:n||a.open,children:(0,x.jsx)(Dz,{asChild:!0,container:i,children:e})}))})};qz.displayName=Wz;var Jz=`DialogOverlay`,Yz=b.forwardRef((e,t)=>{let n=Kz(Jz,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Bz(Jz,e.__scopeDialog);return a.modal?(0,x.jsx)(kz,{present:r||a.open,children:(0,x.jsx)(Zz,{...i,ref:t})}):null});Yz.displayName=Jz;var Xz=VR(`DialogOverlay.RemoveScroll`),Zz=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(Jz,n);return(0,x.jsx)($N,{as:Xz,allowPinchZoom:!0,shards:[i.contentRef],children:(0,x.jsx)(qR.div,{"data-state":lB(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),Qz=`DialogContent`,$z=b.forwardRef((e,t)=>{let n=Kz(Qz,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Bz(Qz,e.__scopeDialog);return(0,x.jsx)(kz,{present:r||a.open,children:a.modal?(0,x.jsx)(eB,{...i,ref:t}):(0,x.jsx)(tB,{...i,ref:t})})});$z.displayName=Qz;var eB=b.forwardRef((e,t)=>{let n=Bz(Qz,e.__scopeDialog),r=b.useRef(null),i=kR(t,n.contentRef,r);return b.useEffect(()=>{let e=r.current;if(e)return WM(e)},[]),(0,x.jsx)(nB,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ER(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:ER(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:ER(e.onFocusOutside,e=>e.preventDefault())})}),tB=b.forwardRef((e,t)=>{let n=Bz(Qz,e.__scopeDialog),r=b.useRef(!1),i=b.useRef(!1);return(0,x.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=b.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Bz(Qz,n),c=b.useRef(null),l=kR(t,c);return Pz(),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(mz,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,x.jsx)(rz,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":lB(s.open),...o,ref:l,onDismiss:()=>s.onOpenChange(!1)})}),(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(pB,{titleId:s.titleId}),(0,x.jsx)(hB,{contentRef:c,descriptionId:s.descriptionId})]})]})}),rB=`DialogTitle`,iB=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(rB,n);return(0,x.jsx)(qR.h2,{id:i.titleId,...r,ref:t})});iB.displayName=rB;var aB=`DialogDescription`,oB=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(aB,n);return(0,x.jsx)(qR.p,{id:i.descriptionId,...r,ref:t})});oB.displayName=aB;var sB=`DialogClose`,cB=b.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=Bz(sB,n);return(0,x.jsx)(qR.button,{type:`button`,...r,ref:t,onClick:ER(e.onClick,()=>i.onOpenChange(!1))})});cB.displayName=sB;function lB(e){return e?`open`:`closed`}var uB=`DialogTitleWarning`,[dB,fB]=AR(uB,{contentName:Qz,titleName:rB,docsSlug:`dialog`}),pB=({titleId:e})=>{let t=fB(uB),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
99
99
|
|
|
100
100
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
101
101
|
|
|
@@ -162,5 +162,5 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
|
|
|
162
162
|
|
|
163
163
|
`)}t.write(`payload.value = newResult;`),t.write(`return payload;`);let s=t.compile();return(t,n)=>s(e,t,n)},a,o=KU,s=!MU.jitless,c=s&&qU.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?iK([],p,d,f,u,e):d):n(d,f):(d.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),d)}});function sK(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=>!sW(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=>dW(e,r,NU())))}),t)}var cK=Q(`$ZodUnion`,(e,t)=>{CG.init(e,t),BU(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),BU(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),BU(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),BU(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=>RU(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=>sK(t,r,e,i)):sK(o,r,e,i)}}),lK=Q(`$ZodIntersection`,(e,t)=>{CG.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])=>dK(e,t,n)):dK(e,i,a)}});function uK(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(JU(e)&&JU(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=uK(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=uK(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 dK(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}),sW(e))return e;let o=uK(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var fK=Q(`$ZodEnum`,(e,t)=>{CG.init(e,t);let n=PU(t.entries),r=new Set(n);e._zod.values=r,e._zod.pattern=RegExp(`^(${n.filter(e=>XU.has(typeof e)).map(e=>typeof e==`string`?ZU(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}}),pK=Q(`$ZodTransform`,(e,t)=>{CG.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jU(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 AU;return n.value=i,n.fallback=!0,n}});function mK(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var hK=Q(`$ZodOptional`,(e,t)=>{CG.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,BU(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),BU(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${RU(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=>mK(e,r)):mK(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),gK=Q(`$ZodExactOptional`,(e,t)=>{hK.init(e,t),BU(e._zod,`values`,()=>t.innerType._zod.values),BU(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),_K=Q(`$ZodNullable`,(e,t)=>{CG.init(e,t),BU(e._zod,`optin`,()=>t.innerType._zod.optin),BU(e._zod,`optout`,()=>t.innerType._zod.optout),BU(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${RU(e.source)}|null)$`):void 0}),BU(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)}),vK=Q(`$ZodDefault`,(e,t)=>{CG.init(e,t),e._zod.optin=`optional`,BU(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=>yK(e,t)):yK(r,t)}});function yK(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var bK=Q(`$ZodPrefault`,(e,t)=>{CG.init(e,t),e._zod.optin=`optional`,BU(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))}),xK=Q(`$ZodNonOptional`,(e,t)=>{CG.init(e,t),BU(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=>SK(t,e)):SK(i,e)}});function SK(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 CK=Q(`$ZodCatch`,(e,t)=>{CG.init(e,t),e._zod.optin=`optional`,BU(e._zod,`optout`,()=>t.innerType._zod.optout),BU(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=>dW(e,n,NU()))},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=>dW(e,n,NU()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),wK=Q(`$ZodPipe`,(e,t)=>{CG.init(e,t),BU(e._zod,`values`,()=>t.in._zod.values),BU(e._zod,`optin`,()=>t.in._zod.optin),BU(e._zod,`optout`,()=>t.out._zod.optout),BU(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=>TK(e,t.in,n)):TK(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>TK(e,t.out,n)):TK(r,t.out,n)}});function TK(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 EK=Q(`$ZodReadonly`,(e,t)=>{CG.init(e,t),BU(e._zod,`propValues`,()=>t.innerType._zod.propValues),BU(e._zod,`values`,()=>t.innerType._zod.values),BU(e._zod,`optin`,()=>t.innerType?._zod?.optin),BU(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(DK):DK(r)}});function DK(e){return e.value=Object.freeze(e.value),e}var OK=Q(`$ZodCustom`,(e,t)=>{lG.init(e,t),CG.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=>kK(t,n,r,e));kK(i,n,r,e)}});function kK(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(pW(e))}}var AK,jK=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 MK(){return new jK}(AK=globalThis).__zod_globalRegistry??(AK.__zod_globalRegistry=MK());var NK=globalThis.__zod_globalRegistry;function PK(e,t){return new e({type:`string`,...$(t)})}function FK(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...$(t)})}function IK(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...$(t)})}function LK(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...$(t)})}function RK(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...$(t)})}function zK(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...$(t)})}function BK(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...$(t)})}function VK(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...$(t)})}function HK(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...$(t)})}function UK(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...$(t)})}function WK(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...$(t)})}function GK(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...$(t)})}function KK(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...$(t)})}function qK(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...$(t)})}function JK(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...$(t)})}function YK(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...$(t)})}function XK(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...$(t)})}function ZK(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...$(t)})}function QK(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...$(t)})}function $K(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...$(t)})}function eq(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...$(t)})}function tq(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...$(t)})}function nq(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...$(t)})}function rq(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...$(t)})}function iq(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...$(t)})}function aq(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...$(t)})}function oq(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...$(t)})}function sq(e){return new e({type:`unknown`})}function cq(e,t){return new e({type:`never`,...$(t)})}function lq(e,t){return new uG({check:`max_length`,...$(t),maximum:e})}function uq(e,t){return new dG({check:`min_length`,...$(t),minimum:e})}function dq(e,t){return new fG({check:`length_equals`,...$(t),length:e})}function fq(e,t){return new mG({check:`string_format`,format:`regex`,...$(t),pattern:e})}function pq(e){return new hG({check:`string_format`,format:`lowercase`,...$(e)})}function mq(e){return new gG({check:`string_format`,format:`uppercase`,...$(e)})}function hq(e,t){return new _G({check:`string_format`,format:`includes`,...$(t),includes:e})}function gq(e,t){return new vG({check:`string_format`,format:`starts_with`,...$(t),prefix:e})}function _q(e,t){return new yG({check:`string_format`,format:`ends_with`,...$(t),suffix:e})}function vq(e){return new bG({check:`overwrite`,tx:e})}function yq(e){return vq(t=>t.normalize(e))}function bq(){return vq(e=>e.trim())}function xq(){return vq(e=>e.toLowerCase())}function Sq(){return vq(e=>e.toUpperCase())}function Cq(){return vq(e=>WU(e))}function wq(e,t,n){return new e({type:`array`,element:t,...$(n)})}function Tq(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...$(n)})}function Eq(e,t){let n=Dq(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(pW(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(pW(r))}},e(t.value,t)),t);return n}function Dq(e,t){let n=new lG({check:`custom`,...$(t)});return n._zod.check=e,n}function Oq(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??NK,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 kq(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,kq(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`&&Mq(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 Aq(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
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 jq(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:Pq(t,`input`,e.processors),output:Pq(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Mq(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 Mq(r.element,n);if(r.type===`set`)return Mq(r.valueType,n);if(r.type===`lazy`)return Mq(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 Mq(r.innerType,n);if(r.type===`intersection`)return Mq(r.left,n)||Mq(r.right,n);if(r.type===`record`||r.type===`map`)return Mq(r.keyType,n)||Mq(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Mq(r.in,n)||Mq(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Mq(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Mq(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Mq(e,n))return!0;return!!(r.rest&&Mq(r.rest,n))}return!1}var Nq=(e,t={})=>n=>{let r=Oq({...n,processors:t});return kq(e,r),Aq(r,e),jq(r,e)},Pq=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Oq({...i??{},target:a,io:t,processors:n});return kq(e,o),Aq(o,e),jq(o,e)},Fq={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Iq=(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=Fq[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}))])}},Lq=(e,t,n,r)=>{n.not={}},Rq=(e,t,n,r)=>{let i=e._zod.def,a=PU(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},zq=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Bq=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Vq=(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=kq(a.element,t,{...r,path:[...r.path,`items`]})},Hq=(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]=kq(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=kq(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Uq=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>kq(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Wq=(e,t,n,r)=>{let i=e._zod.def,a=kq(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=kq(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]]},Gq=(e,t,n,r)=>{let i=e._zod.def,a=kq(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`}]},Kq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Jq=(e,t,n,r)=>{let i=e._zod.def;kq(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)))},Yq=(e,t,n,r)=>{let i=e._zod.def;kq(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},Xq=(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;kq(o,t,r);let s=t.seen.get(e);s.ref=o},Zq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Qq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType};function $q(){return $q=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},$q.apply(null,arguments)}function eJ(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function tJ(e,t){for(var n={};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[0].errors[0];n[o]={message:s.message,type:s.code}}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]=pH(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function nJ(e,t){for(var n={},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[0][0];n[o]={message:s.message,type:s.code}}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($q({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=pH(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function rJ(e,t,n){if(n===void 0&&(n={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(e))return function(r,i,a){try{return Promise.resolve(eJ(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&TU({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:EU(tJ(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(eJ(function(){return Promise.resolve((n.mode===`sync`?bW:SW)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&TU({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof hW}(e))return{values:{},errors:EU(nJ(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var iJ=async e=>e&&typeof e.then==`function`?await e:e,aJ=({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 iJ(t?.(i)),a.success?await iJ(n?.(a.data)):await iJ(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,x.jsx)(AH,{...c,children:(0,x.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})})},oJ=(e,t)=>{let n=(0,V.c)(13),r;n[0]===e?r=n[1]:(r=rJ(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=aU(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}=YV(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},sJ=aJ,cJ=Q(`ZodISODateTime`,(e,t)=>{LG.init(e,t),FJ.init(e,t)});function lJ(e){return rq(cJ,e)}var uJ=Q(`ZodISODate`,(e,t)=>{RG.init(e,t),FJ.init(e,t)});function dJ(e){return iq(uJ,e)}var fJ=Q(`ZodISOTime`,(e,t)=>{zG.init(e,t),FJ.init(e,t)});function pJ(e){return aq(fJ,e)}var mJ=Q(`ZodISODuration`,(e,t)=>{BG.init(e,t),FJ.init(e,t)});function hJ(e){return oq(mJ,e)}var gJ=Q(`ZodError`,(e,t)=>{hW.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>vW(e,t)},flatten:{value:t=>_W(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,FU,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,FU,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),_J=yW(gJ),vJ=xW(gJ),yJ=CW(gJ),bJ=TW(gJ),xJ=DW(gJ),SJ=OW(gJ),CJ=kW(gJ),wJ=AW(gJ),TJ=jW(gJ),EJ=MW(gJ),DJ=NW(gJ),OJ=PW(gJ),kJ=new WeakMap;function AJ(e,t,n){let r=Object.getPrototypeOf(e),i=kJ.get(r);if(i||(i=new Set,kJ.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 jJ=Q(`ZodType`,(e,t)=>(CG.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Pq(e,`input`),output:Pq(e,`output`)}}),e.toJSONSchema=Nq(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>_J(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>yJ(e,t,n),e.parseAsync=async(t,n)=>vJ(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>bJ(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>xJ(e,t,n),e.decode=(t,n)=>SJ(e,t,n),e.encodeAsync=async(t,n)=>CJ(e,t,n),e.decodeAsync=async(t,n)=>wJ(e,t,n),e.safeEncode=(t,n)=>TJ(e,t,n),e.safeDecode=(t,n)=>EJ(e,t,n),e.safeEncodeAsync=async(t,n)=>DJ(e,t,n),e.safeDecodeAsync=async(t,n)=>OJ(e,t,n),AJ(e,`ZodType`,{check(...e){let t=this.def;return this.clone(HU(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 QU(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(IY(e,t))},superRefine(e,t){return this.check(LY(e,t))},overwrite(e){return this.check(vq(e))},optional(){return vY(this)},exactOptional(){return bY(this)},nullable(){return SY(this)},nullish(){return vY(SY(this))},nonoptional(e){return OY(this,e)},array(){return oY(this)},or(e){return uY([this,e])},and(e){return fY(this,e)},transform(e){return MY(this,gY(e))},default(e){return wY(this,e)},prefault(e){return EY(this,e)},catch(e){return AY(this,e)},pipe(e){return MY(this,e)},readonly(){return PY(this)},describe(e){let t=this.clone();return NK.add(t,{description:e}),t},meta(...e){if(e.length===0)return NK.get(this);let t=this.clone();return NK.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 NK.get(e)?.description},configurable:!0}),e)),MJ=Q(`_ZodString`,(e,t)=>{wG.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iq(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,AJ(e,`_ZodString`,{regex(...e){return this.check(fq(...e))},includes(...e){return this.check(hq(...e))},startsWith(...e){return this.check(gq(...e))},endsWith(...e){return this.check(_q(...e))},min(...e){return this.check(uq(...e))},max(...e){return this.check(lq(...e))},length(...e){return this.check(dq(...e))},nonempty(...e){return this.check(uq(1,...e))},lowercase(e){return this.check(pq(e))},uppercase(e){return this.check(mq(e))},trim(){return this.check(bq())},normalize(...e){return this.check(yq(...e))},toLowerCase(){return this.check(xq())},toUpperCase(){return this.check(Sq())},slugify(){return this.check(Cq())}})}),NJ=Q(`ZodString`,(e,t)=>{wG.init(e,t),MJ.init(e,t),e.email=t=>e.check(FK(IJ,t)),e.url=t=>e.check(VK(zJ,t)),e.jwt=t=>e.check(nq(eY,t)),e.emoji=t=>e.check(HK(BJ,t)),e.guid=t=>e.check(IK(LJ,t)),e.uuid=t=>e.check(LK(RJ,t)),e.uuidv4=t=>e.check(RK(RJ,t)),e.uuidv6=t=>e.check(zK(RJ,t)),e.uuidv7=t=>e.check(BK(RJ,t)),e.nanoid=t=>e.check(UK(VJ,t)),e.guid=t=>e.check(IK(LJ,t)),e.cuid=t=>e.check(WK(HJ,t)),e.cuid2=t=>e.check(GK(UJ,t)),e.ulid=t=>e.check(KK(WJ,t)),e.base64=t=>e.check($K(ZJ,t)),e.base64url=t=>e.check(eq(QJ,t)),e.xid=t=>e.check(qK(GJ,t)),e.ksuid=t=>e.check(JK(KJ,t)),e.ipv4=t=>e.check(YK(qJ,t)),e.ipv6=t=>e.check(XK(JJ,t)),e.cidrv4=t=>e.check(ZK(YJ,t)),e.cidrv6=t=>e.check(QK(XJ,t)),e.e164=t=>e.check(tq($J,t)),e.datetime=t=>e.check(lJ(t)),e.date=t=>e.check(dJ(t)),e.time=t=>e.check(pJ(t)),e.duration=t=>e.check(hJ(t))});function PJ(e){return PK(NJ,e)}var FJ=Q(`ZodStringFormat`,(e,t)=>{TG.init(e,t),MJ.init(e,t)}),IJ=Q(`ZodEmail`,(e,t)=>{OG.init(e,t),FJ.init(e,t)}),LJ=Q(`ZodGUID`,(e,t)=>{EG.init(e,t),FJ.init(e,t)}),RJ=Q(`ZodUUID`,(e,t)=>{DG.init(e,t),FJ.init(e,t)}),zJ=Q(`ZodURL`,(e,t)=>{kG.init(e,t),FJ.init(e,t)}),BJ=Q(`ZodEmoji`,(e,t)=>{AG.init(e,t),FJ.init(e,t)}),VJ=Q(`ZodNanoID`,(e,t)=>{jG.init(e,t),FJ.init(e,t)}),HJ=Q(`ZodCUID`,(e,t)=>{MG.init(e,t),FJ.init(e,t)}),UJ=Q(`ZodCUID2`,(e,t)=>{NG.init(e,t),FJ.init(e,t)}),WJ=Q(`ZodULID`,(e,t)=>{PG.init(e,t),FJ.init(e,t)}),GJ=Q(`ZodXID`,(e,t)=>{FG.init(e,t),FJ.init(e,t)}),KJ=Q(`ZodKSUID`,(e,t)=>{IG.init(e,t),FJ.init(e,t)}),qJ=Q(`ZodIPv4`,(e,t)=>{VG.init(e,t),FJ.init(e,t)}),JJ=Q(`ZodIPv6`,(e,t)=>{HG.init(e,t),FJ.init(e,t)}),YJ=Q(`ZodCIDRv4`,(e,t)=>{UG.init(e,t),FJ.init(e,t)}),XJ=Q(`ZodCIDRv6`,(e,t)=>{WG.init(e,t),FJ.init(e,t)}),ZJ=Q(`ZodBase64`,(e,t)=>{KG.init(e,t),FJ.init(e,t)}),QJ=Q(`ZodBase64URL`,(e,t)=>{JG.init(e,t),FJ.init(e,t)}),$J=Q(`ZodE164`,(e,t)=>{YG.init(e,t),FJ.init(e,t)}),eY=Q(`ZodJWT`,(e,t)=>{ZG.init(e,t),FJ.init(e,t)}),tY=Q(`ZodUnknown`,(e,t)=>{QG.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function nY(){return sq(tY)}var rY=Q(`ZodNever`,(e,t)=>{$G.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lq(e,t,n,r)});function iY(e){return cq(rY,e)}var aY=Q(`ZodArray`,(e,t)=>{tK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vq(e,t,n,r),e.element=t.element,AJ(e,`ZodArray`,{min(e,t){return this.check(uq(e,t))},nonempty(e){return this.check(uq(1,e))},max(e,t){return this.check(lq(e,t))},length(e,t){return this.check(dq(e,t))},unwrap(){return this.element}})});function oY(e,t){return wq(aY,e,t)}var sY=Q(`ZodObject`,(e,t)=>{oK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hq(e,t,n,r),BU(e,`shape`,()=>t.shape),AJ(e,`ZodObject`,{keyof(){return mY(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:nY()})},loose(){return this.clone({...this._zod.def,catchall:nY()})},strict(){return this.clone({...this._zod.def,catchall:iY()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return nW(this,e)},safeExtend(e){return rW(this,e)},merge(e){return iW(this,e)},pick(e){return eW(this,e)},omit(e){return tW(this,e)},partial(...e){return aW(_Y,this,e[0])},required(...e){return oW(DY,this,e[0])}})});function cY(e,t){return new sY({type:`object`,shape:e??{},...$(t)})}var lY=Q(`ZodUnion`,(e,t)=>{cK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uq(e,t,n,r),e.options=t.options});function uY(e,t){return new lY({type:`union`,options:e,...$(t)})}var dY=Q(`ZodIntersection`,(e,t)=>{lK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wq(e,t,n,r)});function fY(e,t){return new dY({type:`intersection`,left:e,right:t})}var pY=Q(`ZodEnum`,(e,t)=>{fK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rq(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 pY({...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 pY({...t,checks:[],...$(r),entries:i})}});function mY(e,t){return new pY({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...$(t)})}var hY=Q(`ZodTransform`,(e,t)=>{pK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bq(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jU(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(pW(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(pW(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 gY(e){return new hY({type:`transform`,transform:e})}var _Y=Q(`ZodOptional`,(e,t)=>{hK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vY(e){return new _Y({type:`optional`,innerType:e})}var yY=Q(`ZodExactOptional`,(e,t)=>{gK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bY(e){return new yY({type:`optional`,innerType:e})}var xY=Q(`ZodNullable`,(e,t)=>{_K.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function SY(e){return new xY({type:`nullable`,innerType:e})}var CY=Q(`ZodDefault`,(e,t)=>{vK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function wY(e,t){return new CY({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():YU(t)}})}var TY=Q(`ZodPrefault`,(e,t)=>{bK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function EY(e,t){return new TY({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():YU(t)}})}var DY=Q(`ZodNonOptional`,(e,t)=>{xK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function OY(e,t){return new DY({type:`nonoptional`,innerType:e,...$(t)})}var kY=Q(`ZodCatch`,(e,t)=>{CK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function AY(e,t){return new kY({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var jY=Q(`ZodPipe`,(e,t)=>{wK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xq(e,t,n,r),e.in=t.in,e.out=t.out});function MY(e,t){return new jY({type:`pipe`,in:e,out:t})}var NY=Q(`ZodReadonly`,(e,t)=>{EK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function PY(e){return new NY({type:`readonly`,innerType:e})}var FY=Q(`ZodCustom`,(e,t)=>{OK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zq(e,t,n,r)});function IY(e,t={}){return Tq(FY,e,t)}function LY(e,t){return Eq(e,t)}var RY=e=>{let t=(0,V.c)(3),[n,r]=(0,b.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,b.useEffect)(i,a),n},zY=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()})}},BY=[],VY=()=>{let e=(0,V.c)(2),t=(0,b.useSyncExternalStore)(zY.subscribe,zY.getSnapshot,HY),n;return e[0]===t?n=e[1]:(n={scrollBlockers:t,addBlockage:zY.addBlockage,removeBlockage:zY.removeBlockage,isElementScrollBlocked:zY.isElementScrollBlocked},e[0]=t,e[1]=n),n};function HY(){return BY}var UY=e=>{let{disableScroll:t=!1,element:n,key:r=`unnamed_blocker`}=e??{},{isElementScrollBlocked:i,addBlockage:a,removeBlockage:o}=VY(),s=RY(n);return(0,b.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}},WY=`relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`,GY=`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`,KY=({className:e,...t})=>(0,x.jsx)(`h1`,{className:W(`text-3xl`,e),...t}),qY=({className:e,...t})=>(0,x.jsx)(`h2`,{className:W(`mb-2 text-2xl`,WY,e),...t}),JY=({className:e,...t})=>(0,x.jsx)(`h3`,{className:W(`mb-2 text-xl`,WY,e),...t}),YY=({className:e,...t})=>(0,x.jsx)(`h4`,{className:W(`text-lg`,WY,e),...t}),XY=({className:e,...t})=>(0,x.jsx)(`h5`,{className:W(`text-base`,WY,e),...t}),ZY=({className:e,...t})=>(0,x.jsx)(`h6`,{className:W(`ml-3 text-base`,WY,e),...t}),QY=e=>String(e).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/\s+/g,`-`).toLowerCase(),$Y=e=>{let t=(document.getElementById(e)?.getBoundingClientRect()?.top??0)+window.scrollY-150;window.scrollTo({top:t,behavior:`smooth`})},eX=(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},tX=({H:e,children:t,className:n,isClickable:r,...i})=>{let a=typeof t==`string`?QY(t):void 0;return(0,x.jsx)(e,{id:a,onClick:r?e=>{let{id:t}=e.currentTarget;if(eX(e.currentTarget,e)&&typeof t==`string`){let e=`${window.location.href.split(`#`)[0]}#${t}`;navigator.clipboard.writeText(e),$Y(t)}}:void 0,"aria-label":r?`Click to scroll to section ${a} and copy the link to the clipboard`:void 0,className:W(r&&GY,n),...i,children:t})},nX=({isClickable:e,...t})=>(0,x.jsx)(KY,{...t}),rX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:qY,isClickable:e,...t}),iX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:JY,isClickable:e,...t}),aX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:YY,isClickable:e,...t}),oX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:XY,isClickable:e,...t}),sX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:ZY,isClickable:e,...t}),cX=Fd(`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`}}),lX={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=gC.create(GO),dX=({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=RY(n);if(UY({key:`modal`,disableScroll:t&&l}),(0,b.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t&&r&&r()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t,r]),!f)return(0,x.jsx)(x.Fragment,{});let p=!!a,m=lX[u||`none`];return(0,G.createPortal)((0,x.jsx)(gC.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,x.jsxs)(uX,{onClick:e=>e.stopPropagation(),initial:{scale:t?.5:1},animate:{scale:t?1:.5},transition:{duration:.3},className:cX({size:o,className:s}),role:`dialog`,"aria-modal":!0,roundedSize:`4xl`,padding:`none`,...d,children:[(0,x.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,x.jsx)(iX,{className:`mb-2 ml-1 flex items-center justify-center font-bold text-lg`,children:a}),i&&(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,label:`Close modal`,className:`ml-auto`,onClick:e=>{e.stopPropagation(),r?.()},Icon:_f,size:`icon-md`})]}),(0,x.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,x.jsx)(`div`,{className:W(`flex size-full flex-1 flex-col`,m),children:e})})]})}),f)},fX=e=>{let t=(0,V.c)(25),{dictionary:n,mode:r,className:i,onDelete:a,onSave:o,...s}=e,[c,l]=(0,b.useState)(!1),{setLocaleDictionary:u}=Pw(),{mutate:d,isPending:f}=JD(),{mutate:p,isPending:m}=XD(),{mutate:h,isPending:g}=qD(),_=m||g,{editedContent:v,restoreEditedContent:y}=Hw(),{deleteButton:S,resetButton:C,saveButton:w,publishButton:T,downloadButton:E,confirmation:D}=rn(`save-dictionary-details`),{isAuthenticated:O}=jD(),{session:k}=AD(),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=v?.[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]!==v||t[7]!==o||t[8]!==y||t[9]!==u||t[10]!==p?(L=async()=>{if(!v?.[n.localId])return;let e={...n,...v?.[n.localId]};p({dictionary:e},{onSuccess:()=>{u(v?.[n.localId]),y(n.localId),l(!1),o?.()}})},t[5]=n,t[6]=v,t[7]=o,t[8]=y,t[9]=u,t[10]=p,t[11]=L):L=t[11];let ee=L,te;t[12]!==n||t[13]!==v||t[14]!==o||t[15]!==h||t[16]!==y||t[17]!==u?(te=()=>{let e={...n,...v?.[n.localId]};h({dictionaries:[e]},{onSuccess:t=>{t&&(u(e),y(n.localId),o?.())}})},t[12]=n,t[13]=v,t[14]=o,t[15]=h,t[16]=y,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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(dX,{isOpen:c,title:D.title.value,size:`md`,onClose:B,padding:`md`,children:(0,x.jsxs)(`form`,{className:`size-full`,children:[(0,x.jsx)(`p`,{className:`py-4 text-neutral text-sm`,children:D.message}),(0,x.jsxs)(`div`,{className:`mt-12 flex justify-end gap-2 max-md:flex-col`,children:[(0,x.jsx)(iO,{label:D.cancelButton.label.value,disabled:!F||_,color:`text`,className:`max-md:w-full`,variant:`outline`,onClick:re,children:D.cancelButton.text}),(0,x.jsx)(iO,{label:D.confirmButton.label.value,disabled:!F||_||!j,Icon:pf,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ee,children:D.confirmButton.text})]})]})}),(0,x.jsxs)(`form`,{className:W(`flex justify-end gap-2`,i),...s,children:[r.includes(`remote`)&&I&&a&&O&&(0,x.jsx)(iO,{label:S.label.value,Icon:hf,color:`error`,variant:`outline`,className:`max-md:w-full`,isLoading:f,onClick:z,disabled:!M,children:S.text}),F&&(0,x.jsx)(iO,{label:C.label.value,disabled:!F,Icon:ff,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:()=>y(n.localId),children:C.text}),r.includes(`local`)&&(0,x.jsx)(iO,{label:E.label.value,disabled:!F||_,Icon:nf,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,x.jsx)(iO,{label:T.label.value,disabled:_||!j,Icon:qd,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ne,children:T.text}),r.includes(`remote`)&&O&&I&&F&&(0,x.jsx)(iO,{label:w.label.value,disabled:!F||_||!j,Icon:pf,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ne,children:w.text})]})]})},pX=(e,t=2e3,n,r)=>{let[i,a]=(0,b.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))}}}},mX=({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}=pX(e,a,o,s);if(c)return(0,x.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?ef:tf;return(0,x.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,x.jsx)(`span`,{className:`min-w-0 break-all`,children:t}),e&&(0,x.jsx)(_,{className:`ml-1 ml-auto shrink-0`,size:d,"aria-hidden":`true`})]})},hX=Fd(`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`}}),gX=Fd(`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`}}),_X=({tabs:e,selectedChoice:t,onTabClick:n,color:r=`primary`,hoverable:i=!1,orientation:a=`horizontal`,className:o})=>{let s=(0,b.useRef)([]),c=(0,b.useRef)(null),{choiceIndicatorPosition:l,calculatePosition:u}=uO(s,{isHoverable:i,orientation:a});return(0,b.useEffect)(()=>{u()},[t]),(0,x.jsxs)(`div`,{className:W(hX({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,b.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,x.jsx)(`div`,{className:W(gX({color:r,orientation:a})),style:l,ref:c},`${t}${JSON.stringify(e.map(e=>e.key))}`)]})},vX=Fd([`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`}}),yX=({validationStyleEnabled:e=!1,label:t,size:n,color:r,name:i,variant:a,className:o,labelClassName:s,...c})=>(0,x.jsx)(`input`,{type:`checkbox`,className:W(vX({variant:a,size:n,color:r,validationStyleEnabled:e?`enabled`:`disabled`}),o),...c}),bX=e=>{let{label:t,name:n,id:r}=e;return t?(0,x.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,x.jsx)(yX,{id:r??n,...e}),t]}):(0,x.jsx)(yX,{id:r??n,...e})},xX=e=>(0,x.jsx)(vU,{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:IO,...e}),SX=e=>(0,x.jsx)(vU,{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:OO,...e}),CX=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:_}=rn(`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=cY({title:PJ({error:y}).refine(wX,{error:i.value}).optional(),key:PJ({error:b}).min(4,{error:c.value}).regex(/^[a-zA-Z0-9-_]+$/,{error:s.value}).default(``),description:PJ({error:x}).optional(),projectIds:oY(PJ({error:S})).default([e]),tags:oY(PJ({error:C})).default([]),location:mY([`local`,`remote`,`hybrid`,`plugin`],{error:w}).optional(),importMode:mY([`static`,`dynamic`,`fetch`]).optional(),filePath:PJ({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 wX(e){return e.length===0||e.length>=4}var TX=[`collection`,`variant`],EX=e=>{let t=[];return e.item!==void 0&&t.push(`collection`),e.variant!==void 0&&t.push(`variant`),t},DX=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,OX=e=>{if(e.trim().startsWith(`{`))try{return{variant:JSON.parse(e),error:!1}}catch{return{variant:e,error:!0}}return{variant:e,error:!1}},kX=({dictionary:e,mode:t,onSelectSibling:n})=>{let{session:r}=AD(),{project:i}=r??{},{data:a,isLoading:o}=ZD(),{data:s}=QD(),c=a?.data??[],l=s?.data??[],u=CX(String(i?.id)),{form:d,isSubmitting:f}=oJ(u,{defaultValues:{...e,location:e.location??`remote`}}),{editedContent:p,setEditedDictionary:m}=Hw(),{titleInput:h,keyInput:g,descriptionInput:_,projectInput:v,tagsSelect:y,locationSelect:S,importModeSelect:C,filePathInput:w,auditButton:T,qualifierSection:E,siblingDictionaries:D,typeSwitch:O}=rn(`dictionary-details`),{mutate:k,isPending:A}=VD(),j=p?.[e.localId],{data:M,isLoading:N}=KD({keys:[e.key]},{enabled:!!e.key}),P=(0,b.useMemo)(()=>(M?.data??[]).filter(t=>t.localId!==e.localId),[M,e.localId]),F=(0,b.useMemo)(()=>P.filter(e=>e.item!==void 0).sort((e,t)=>(e.item??0)-(t.item??0)),[P]),I=(0,b.useMemo)(()=>P.filter(e=>e.variant!==void 0),[P]),L=(0,b.useMemo)(()=>e.item===void 0?F:[e,...F].sort((e,t)=>(e.item??0)-(t.item??0)),[e,F]),ee=(0,b.useMemo)(()=>e.variant===void 0?I:[e,...I],[e,I]);(0,b.useEffect)(()=>{d.reset({...e,tags:e.tags??[],location:e.location??`remote`}),re(EX(e)),ae(e.item??1),se(DX(e.variant)),le(!1),de(!1)},[e,d?.reset]),(0,b.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=tH({control:d.control,name:`location`}),R=ne===`local`||ne===`hybrid`,z=P.length>0,[B,re]=(0,b.useState)(()=>EX(e)),[ie,ae]=(0,b.useState)(e.item??1),[oe,se]=(0,b.useState)(DX(e.variant)),[ce,le]=(0,b.useState)(!1),[ue,de]=(0,b.useState)(!1),fe=(0,b.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:OX(e).variant}}re(n),m(a),le(!1),n.length===0&&fe.length>0?de(!0):de(!1)};return(0,x.jsxs)(sJ,{className:`flex w-full flex-col gap-8`,...d,schema:u,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,x.jsx)(xX,{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,x.jsx)(xX,{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,x.jsx)(SX,{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,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 px-1 max-md:grid-cols-1`,children:[(0,x.jsx)(sU,{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,x.jsxs)(bV,{className:`flex flex-col gap-2 px-1`,children:[(0,x.jsx)(hU,{className:`ml-1`,children:S.label}),(0,x.jsxs)(`div`,{className:`ml-2 flex items-center gap-4 py-2`,children:[(0,x.jsx)(bX,{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,x.jsx)(bX,{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,x.jsx)(uU,{children:S.testDescription}),(0,x.jsx)(dU,{})]})}}),(0,x.jsx)(vx,{mode:`wait`,children:R&&(0,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.3},children:(0,x.jsx)(yU,{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,x.jsx)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:(0,x.jsxs)(CU,{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,x.jsx)(Y.Trigger,{children:(0,x.jsx)(Y.Value,{placeholder:C.label.value})}),(0,x.jsxs)(Y.Content,{children:[(0,x.jsx)(Y.Item,{value:`static`,children:C.static.value}),(0,x.jsx)(Y.Item,{value:`dynamic`,children:C.dynamic.value}),(0,x.jsx)(Y.Item,{value:`live`,children:C.live.value})]})]})}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,x.jsxs)(xU,{name:`projectIds`,label:v.label.value,description:v.description,onValueChange:t=>{let n=[t].flat();d.setValue(`projectIds`,n,{shouldDirty:!0}),m({...e,...j??{},projectIds:n})},children:[(0,x.jsx)(vV.Trigger,{getBadgeValue:e=>c?.find(t=>String(t.id)===e)?.name??e,children:(0,x.jsx)(vV.Input,{placeholder:v.placeholder.value})}),(0,x.jsx)(vV.Content,{children:(0,x.jsx)(tO,{isLoading:o,children:(0,x.jsx)(vV.List,{children:c?.map(e=>(0,x.jsx)(vV.Item,{value:String(e.id),children:e.name},String(e.id)))})})})]}),(0,x.jsxs)(xU,{name:`tags`,label:y.label.value,description:y.description,onValueChange:t=>{let n=[t].flat();d.setValue(`tags`,n,{shouldDirty:!0}),m({...e,...j??{},tags:n})},children:[(0,x.jsx)(vV.Trigger,{getBadgeValue:e=>l?.find(t=>String(t.key)===e)?.name??e,children:(0,x.jsx)(vV.Input,{placeholder:y.placeholder.value})}),(0,x.jsx)(vV.Content,{children:(0,x.jsx)(tO,{isLoading:o,children:(0,x.jsx)(vV.List,{children:l?.map(e=>(0,x.jsx)(vV.Item,{value:String(e.key),children:e.name??e.key},String(e.key)))})})})]})]}),(0,x.jsxs)(GO,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`card`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsx)(`p`,{className:`ml-1 font-semibold text-sm`,children:O.label}),(0,x.jsx)(`p`,{className:`ml-1 text-muted text-xs`,children:O.description})]}),(0,x.jsxs)(vV,{values:B,onValueChange:pe,className:`max-w-xs`,children:[(0,x.jsx)(vV.Trigger,{getBadgeValue:e=>e===`collection`?String(O.collection):e===`variant`?String(O.variant):e,children:(0,x.jsx)(vV.Input,{placeholder:O.label.value})}),(0,x.jsx)(vV.Content,{children:(0,x.jsx)(vV.List,{children:TX.map(e=>(0,x.jsx)(vV.Item,{value:e,children:O[e].value},e))})})]}),(0,x.jsxs)(vx,{children:[B.includes(`collection`)&&(0,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,x.jsx)(`label`,{htmlFor:`qualifier-item-value`,className:`ml-1 font-medium text-sm`,children:O.itemValueLabel}),(0,x.jsx)(SO,{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,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,x.jsx)(`label`,{htmlFor:`qualifier-variant-value`,className:`ml-1 font-medium text-sm`,children:O.variantValueLabel}),(0,x.jsx)(SO,{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}=OX(n);le(i),i||m({...e,...j??{},variant:r})}}),ce&&(0,x.jsx)(`p`,{className:`ml-1 text-destructive text-xs`,children:O.variantJsonError})]})},`variant-input`),B.length===0&&ue&&(0,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,x.jsxs)(GO,{background:`none`,border:!0,borderColor:`neutral`,roundedSize:`xl`,padding:`md`,className:`gap-3`,children:[(0,x.jsx)(`p`,{className:`font-medium text-sm`,children:O.disablePickerTitle}),(0,x.jsx)(`p`,{className:`text-muted text-xs`,children:O.disablePickerDescription}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:fe.map(e=>(0,x.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,x.jsxs)(`span`,{children:[E.variant,`:`,` `,DX(e.variant)]}),e.item!==void 0&&(0,x.jsxs)(`span`,{children:[E.item,`: `,e.item]})]},e.localId))})]})},`sibling-picker`)]})]}),(0,x.jsxs)(GO,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`neutral`,children:[(0,x.jsx)(`p`,{className:`font-semibold text-sm`,children:D.title}),(0,x.jsxs)(tO,{isLoading:N,children:[!z&&(0,x.jsx)(`p`,{className:`text-muted text-sm`,children:D.noSiblings}),L.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.collectionItems}),(0,x.jsx)(RL,{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,x.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:L.map(t=>{let r=t.localId===e.localId;return(0,x.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,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.variants}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ee.map(t=>{let r=t.localId===e.localId;return(0,x.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:DX(t.variant)},t.localId)})})]})]})]}),(0,x.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 max-md:flex-col`,children:(0,x.jsx)(iO,{type:`button`,size:`icon-md`,label:T.label.value,Icon:gf,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:te,disabled:f||A,isLoading:A})})]})},AX=e=>{let t=(0,V.c)(6),{content:n,...r}=e,[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(!1),{label:c}=rn(`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,b.useEffect)(d,f);let p=()=>i?`Content copied to clipboard`:o?`Failed to copy content`:r.label??c.value;return(0,x.jsx)(iO,{Icon:i?ef:tf,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})},jX=(0,b.lazy)(()=>lt(()=>import(`./dist-oJho0qAp.js`).then(e=>({default:e.Editor})),__vite__mapDeps([6,2,3]))),MX=({children:e,language:t,isDarkMode:n,showLineNumbers:r,showCopyButton:i=!0,isReadOnly:a=!1,onChange:o})=>{let s=(0,b.useRef)(null),c=(0,b.useRef)(null),[l,u]=(0,b.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,x.jsxs)(`div`,{className:W(`relative size-full text-sm`,r&&`ml-0`),children:[i&&(0,x.jsx)(`div`,{className:`sticky top-5 z-10`,children:(0,x.jsx)(`div`,{className:W(`absolute right-2 bottom-0 flex h-7 items-center`),children:(0,x.jsx)(AX,{content:e})})}),(0,x.jsx)(`div`,{className:`z-0 grid size-full grid-cols-[0px] overflow-auto`,ref:s,children:(0,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(tO,{}),children:(0,x.jsx)(jX,{...l,defaultLanguage:`typescript`,language:t,loading:(0,x.jsx)(tO,{}),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`})})})]})},NX=e=>{let t=(0,V.c)(7),{dictionary:n,isDarkMode:r}=e,{setEditedContent:i,editedContent:a}=Hw(),o=PX,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,x.jsx)(MX,{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 PX(e){try{return JSON.parse(e),!0}catch{return!1}}var FX=e=>{let t=(0,V.c)(23),{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,condition:h,markdown:g,insertion:_,reactNode:v,file:y}=rn(`node-type-selector`),S;t[0]===n?S=t[1]:(S=en(n),t[0]=n,t[1]=S);let[C,F]=(0,b.useState)(S),ne;t[2]===r?ne=t[3]:(ne=e=>{F(e),r(e)},t[2]=r,t[3]=ne);let R=ne,z;return t[4]!==l||t[5]!==s||t[6]!==h||t[7]!==u||t[8]!==y||t[9]!==m||t[10]!==_||t[11]!==C||t[12]!==g||t[13]!==i||t[14]!==p||t[15]!==c||t[16]!==o||t[17]!==R||t[18]!==d||t[19]!==v||t[20]!==a||t[21]!==f?(z=(0,x.jsxs)(Y,{value:C,onValueChange:R,children:[(0,x.jsx)(Y.Trigger,{children:(0,x.jsx)(Y.Value,{placeholder:f})}),(0,x.jsxs)(Y.Content,{children:[(0,x.jsx)(Y.Item,{value:w,children:i}),(0,x.jsx)(Y.Item,{value:I,children:a}),(0,x.jsx)(Y.Item,{value:L,children:o}),(0,x.jsx)(Y.Item,{value:ee,children:s}),(0,x.jsx)(Y.Item,{value:A,children:c}),(0,x.jsx)(Y.Item,{value:j,children:l}),(0,x.jsx)(Y.Item,{value:T,children:u}),(0,x.jsx)(Y.Item,{value:E,children:d}),(0,x.jsx)(Y.Item,{value:te,children:m}),(0,x.jsx)(Y.Item,{value:O,children:_}),(0,x.jsx)(Y.Item,{value:P,children:g}),(0,x.jsx)(Y.Item,{value:M,children:p}),(0,x.jsx)(Y.Item,{value:D,children:h}),(0,x.jsx)(Y.Item,{value:N,disabled:!0,children:v}),(0,x.jsx)(Y.Item,{value:k,children:y})]})]}),t[4]=l,t[5]=s,t[6]=h,t[7]=u,t[8]=y,t[9]=m,t[10]=_,t[11]=C,t[12]=g,t[13]=i,t[14]=p,t[15]=c,t[16]=o,t[17]=R,t[18]=d,t[19]=v,t[20]=a,t[21]=f,t[22]=z):z=t[22],z},IX=e=>{let t=(0,V.c)(15),{section:n,dictionaryLocalId:r,keyPath:i,onNodeTypeChange:a}=e,o=Bw()?.internationalization?.locales??[],s=en(n),c=Zt(n),l=e=>{a(Yt(s,o,e))};if(s===`translation`||s===`condition`||s===`gender`||s===`enumeration`||s===`plural`){let e=Object.keys(n[s])[0],t=[...i,{type:s,key:e}];return(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,x.jsx)(FX,{section:n,onValueChange:e=>a(Yt(e,o))}),(0,x.jsx)(IX,{section:c,keyPath:t,dictionaryLocalId:r,onNodeTypeChange:l})]})}if(s===`array`){let e=[...i,{type:s,key:0}];return(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,x.jsx)(FX,{section:n,onValueChange:e=>a(Yt(e,o))}),(0,x.jsx)(IX,{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(Yt(e,o)),t[6]=o,t[7]=a,t[8]=s):s=t[8],e=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(FX,{section:n,onValueChange:s}),(0,x.jsx)(`div`,{className:`mt-6 ml-10`,children:(0,x.jsx)(zX,{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(Yt(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,x.jsx)(FX,{section:n,onValueChange:u}),t[12]=n,t[13]=u,t[14]=d):d=t[14],d},LX=e=>{let t=(0,V.c)(23),{sectionKey:n,section:r,keyPath:i,dictionaryLocalId:a}=e,{focusedContent:o,setFocusedContentKeyPath:s}=Lw(),{renameEditedContent:c,addEditedContent:l}=Vw(),{titleInput:u,deleteButton:d}=rn(`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,x.jsx)(GO,{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":Ot(i,o?.keyPath??[]),onClick:e,children:(0,x.jsxs)(`div`,{className:`flex w-full flex-col items-start justify-between gap-3`,children:[typeof n==`string`&&(0,x.jsxs)(`div`,{className:`w-full`,children:[(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-10`,children:[(0,x.jsx)(IO,{name:`key`,"aria-label":`Key`,placeholder:u.placeholder.value,defaultValue:n,onSave:e=>p(e),variant:`invisible`}),(0,x.jsx)(iO,{label:d.label.value,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`translate-x-2`,Icon:hf,onClick:()=>{l(a,void 0,i);let e=i.slice(0,-1);s(e)}})]}),(0,x.jsxs)(`span`,{className:`ml-3 text-neutral text-sm`,children:[`( `,Mt(n),` )`]})]}),(0,x.jsx)(IX,{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},RX=e=>{let t=(0,V.c)(14),{section:n,keyPath:r,dictionaryLocalId:i}=e,{addNodeButton:a}=rn(`structure-view`),{setFocusedContentKeyPath:o}=Lw(),{addEditedContent:s}=Vw();if(!n||typeof n!=`object`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.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:A,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,x.jsxs)(`div`,{className:`flex flex-col gap-2 overflow-y-auto`,children:[(0,x.jsx)(`ul`,{className:`mr-auto flex flex-col gap-4`,children:Object.keys(n).map(e=>(0,x.jsx)(`li`,{className:`flex w-full`,children:(0,x.jsx)(LX,{sectionKey:e,section:n?.[e],keyPath:[...r,{type:A,key:e}],dictionaryLocalId:i})},`${JSON.stringify(r)}-object-${e}`))}),(0,x.jsx)(iO,{label:a.label.value,variant:`hoverable`,size:`md`,color:`text`,Icon:df,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},zX=({section:e,keyPath:t,dictionaryLocalId:n})=>!e||typeof e!=`object`||typeof e.nodeType==`string`?(0,x.jsx)(LX,{sectionKey:`content`,section:e,keyPath:t,dictionaryLocalId:n}):(0,x.jsx)(RX,{section:e,keyPath:t,dictionaryLocalId:n}),BX=e=>{let t=(0,V.c)(3),{dictionary:n}=e,{content:r,localId:i}=n,{editedContent:a}=Hw(),o=a?.[i]?.content===void 0?r:a?.[i]?.content,s;return t[0]!==i||t[1]!==o?(s=(0,x.jsx)(LX,{section:o,keyPath:[],dictionaryLocalId:i}),t[0]=i,t[1]=o,t[2]=s):s=t[2],s},VX=({dictionary:e,onClickDictionaryList:t,isDarkMode:n,mode:r,onDelete:i,onSave:a,showReturnButton:o=!0,rightContent:s})=>{let c=Bw(),{returnToDictionaryList:l}=rn(`dictionary-field-editor`),{focusedContent:u,setFocusedContent:d}=Lw(),{setLocaleDictionary:f}=Pw(),[p,m]=(0,b.useState)(`content`);return(0,b.useEffect)(()=>{d({...u??{},dictionaryKey:e.key,dictionaryLocalId:e.localId}),f(e)},[]),(0,x.jsx)(_k,{availableLocales:c?.internationalization?.locales??[],children:(0,x.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-1 flex-col md:overflow-hidden`,children:[o&&(0,x.jsx)(iO,{onClick:t,variant:`hoverable`,className:`z-10 mr-auto mb-6 ml-5 shrink-0`,color:`text`,Icon:Kd,label:l.label.value,children:l.text}),(0,x.jsxs)(`div`,{className:`mb-22 flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`sticky top-0 z-10 flex shrink-0 gap-3 rounded-xl bg-background/20 p-3 pb-4`,children:[(0,x.jsx)(_X,{selectedChoice:p,tabs:[...r.includes(`remote`)?[(0,x.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,x.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,x.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,x.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,x.jsx)(`div`,{className:`flex w-full items-center justify-end`,children:s})]}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,x.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-6`,children:[r.includes(`remote`)&&p===`details`&&(0,x.jsx)(kX,{dictionary:e,mode:r,isDarkMode:n}),p===`structure`&&(0,x.jsx)(BX,{dictionary:e}),p===`content`&&(0,x.jsx)(UL,{dictionary:e,isDarkMode:n}),p===`json`&&(0,x.jsx)(NX,{dictionary:e,isDarkMode:n})]})})]}),(0,x.jsx)(`div`,{className:`absolute bottom-3 z-20 w-full p-2`,children:(0,x.jsxs)(GO,{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,x.jsx)(mX,{text:e.id,className:`text-nowrap text-neutral text-sm`,size:9,children:e.id}),(0,x.jsx)(fX,{dictionary:e,mode:r,onDelete:()=>{d(null),i?.()},onSave:a})]})})]})})},HX=({children:e,className:t,identifier:n,...r})=>(0,x.jsx)(`div`,{className:W(`group/popover relative flex cursor-pointer`,t),id:`unrollable-panel-button-${n}`,"aria-haspopup":!0,...r,children:e}),UX=({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,x.jsx)(GO,{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});HX.Detail=UX;var WX=e=>(0,x.jsx)(HX,{...e}),GX=({xAlign:e=`start`,yAlign:t=`below`,...n})=>{let r=(0,b.useRef)(null),[i,a]=(0,b.useState)(e),[o,s]=(0,b.useState)(t),[c,l]=(0,b.useState)(void 0);return(0,b.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,x.jsx)(UX,{...n,xAlign:i,yAlign:o,ref:r,style:{...n.style,maxWidth:c?`${c}px`:void 0}})},KX=WX;KX.Detail=GX;var qX=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()})}},JX=()=>{let e=(0,V.c)(2),t=(0,b.useSyncExternalStore)(qX.subscribe,qX.getSnapshot,YX),n;return e[0]===t?n=e[1]:(n={open:qX.open,close:qX.close,set:qX.set,isOpen:e=>!!t[e]},e[0]=t,e[1]=n),n};function YX(){return{}}var XX=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}},ZX=()=>{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)},QX=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/iP(?:hone|ad|od)/.test(e)},$X=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/Macintosh|MacIntel|Mac OS X/.test(e)},eZ=e=>{if(!(typeof window>`u`))return(window?.innerWidth??0)<=e},tZ=(e=`md`)=>{let t=XX(e),n=ZX(),r=eZ(t);return{isMobileScreen:r,isMobileUserAgent:n,isMobile:r??n,isIOS:QX(),isMac:$X()}},nZ=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,b.useState)(r),o,s;return t[1]===n?(o=t[2],s=t[3]):(o=()=>{a(tZ(n));let e=()=>{a(tZ(n))};return window.addEventListener(`resize`,e,{passive:!0}),()=>window.removeEventListener(`resize`,e)},s=[n],t[1]=n,t[2]=o,t[3]=s),(0,b.useEffect)(o,s),i},rZ=e=>e.split(` + `).map(e=>e.trim()),iZ=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,aZ=(e,t)=>{let n=t.map(iZ),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(iZ(e)));if(!i)return!1;let a=iZ(i);return a.startsWith(`Arrow`)?e.key===a:e.key.toLowerCase()===a.toLowerCase()},oZ=e=>({ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`})[e]||e,sZ=(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},cZ=({shortcut:e,onTriggered:t,display:n=!0,disabled:r=!1,className:i,size:a=`md`})=>{let{isMac:o}=nZ(),s=rZ(sZ(e,o??!1)),[c,l]=(0,b.useState)(new Set);if((0,b.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(oZ(a))):c.add(a.toUpperCase()),l(c),!r&&t&&aZ(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=iZ(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,x.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=oZ(t);return(0,x.jsxs)(`span`,{className:`inline-flex items-center`,children:[n>0&&(0,x.jsx)(`span`,{className:`text-neutral/50`,children:`+`}),(0,x.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)})})},lZ=({children:e,isHidden:t,minWidth:n=0,align:r=`left`,isDisabled:i=!1,className:a,...o})=>{let s=t&&!i;return(0,x.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,x.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},dZ=({title:e,identifier:t,children:n,header:r,footer:i,closeOnOutsideClick:a=!0,backButton:o,isOpen:s,onClose:c,container:l})=>{let u=rn(`right-drawer`),{isMobile:d}=nZ(`md`),f=(0,b.useRef)(null),p=(0,b.useRef)(null),m=RY(l),{open:h,close:g,isOpen:_}=JX(),v=_(t),y=v;UY({disableScroll:y,key:t?`right_drawer_${t}`:`right_drawer`}),(0,b.useEffect)(()=>{let e=e=>{try{if(!f.current)return;let n=y&&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)},[y,g,c,a,t]);let S=(0,b.useRef)(c);return(0,b.useEffect)(()=>{S.current=c},[c]),(0,b.useEffect)(()=>{s!==void 0&&s!==v&&(s?h(t):(g(t),S.current?.()))},[s,v,t,h,g]),m?(0,G.createPortal)((0,x.jsx)(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:(0,x.jsx)(lZ,{isHidden:!y,align:`right`,children:(0,x.jsxs)(GO,{className:`relative flex h-screen w-screen flex-col text-text md:w-100`,ref:f,roundedSize:`none`,children:[(0,x.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[(0,x.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,x.jsx)(`div`,{children:o&&(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,label:o.text??u.goBack.value,onClick:o.onBack,Icon:Xd,children:o?.text})}),(0,x.jsx)(`div`,{children:(0,x.jsxs)(KX,{identifier:`close-drawer`,children:[(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,label:`Close`,className:`ml-auto`,onClick:()=>{g(t),c?.()},Icon:_f,size:`icon-md`}),(0,x.jsx)(KX.Detail,{identifier:`close-drawer`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[(0,x.jsx)(`span`,{className:`whitespace-nowrap text-neutral text-xs`,children:u.closeDrawer}),(0,x.jsx)(cZ,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{g(t),c?.()}})]})})]})})]}),e&&(0,x.jsx)(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:e}),r]}),(0,x.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:(0,x.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,x.jsx)(`div`,{className:`shrink-0`,children:i})]})})}),m):(0,x.jsx)(x.Fragment,{})},fZ=Fd(`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`}}),pZ=({children:e,color:t,roundedSize:n,size:r,border:i,background:a,className:o,...s})=>(0,x.jsx)(`div`,{className:fZ({color:t,roundedSize:n,size:r,border:i,background:a,className:o}),...s,children:e}),mZ=`dictionaryList`,hZ=e=>`dictionary_edition_${e}`,gZ=e=>{let t=(0,V.c)(23),n;t[0]===e?n=t[1]:(n=hZ(e),t[0]=e,t[1]=n);let r=n,{isOpen:i,open:a,close:o}=JX(),{getEditedContentValue:s}=Vw(),{focusedContent:c,setFocusedContent:l}=Lw(),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,b.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},_Z=e=>{let t=(0,V.c)(77),{dictionaryKey:n,isDarkMode:r}=e,{backButtonText:i,openDictionaryEditor:a,modalTitle:o,noDictionaryFocused:s,focusedDictionaryNotFound:c}=nn(xC),l;t[0]===n?l=t[1]:(l=hZ(n),t[0]=n,t[1]=l);let u=l,{focusedContent:d,close:f}=gZ(n),{setFocusedContent:p}=Lw(),{open:m}=JX(),h;t[2]===m?h=t[3]:(h=()=>m(mZ),t[2]=m,t[3]=h);let g=h,{data:_}=YD(),v;t[4]!==f||t[5]!==g||t[6]!==p?(v=()=>{f(),p(null),g()},t[4]=f,t[5]=g,t[6]=p,t[7]=v):v=t[7];let y=v,[S,C]=(0,b.useState)(!1),w;t[8]===y?w=t[9]:(w=()=>{C(!1),y()},t[8]=y,t[9]=w);let T=w;if(!d?.dictionaryKey){let e;return t[10]===s?e=t[11]:(e=(0,x.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]!==y||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,x.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:c}),t[31]=c,t[32]=e),A=e;break bb0}E=dZ,F=u,t[33]!==i.value||t[34]!==y?(O={onBack:y,text:i.value},t[33]=i.value,t[34]=y,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,x.jsx)(iO,{variant:`hoverable`,color:`text`,size:`icon-md`,IconRight:lf,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,x.jsx)(KX.Detail,{identifier:`open-dictionary-editor`,children:(0,x.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,x.jsxs)(KX,{identifier:`open-dictionary-editor`,children:[n,r]}),t[44]=n,t[45]=r,t[46]=o):o=t[46],P=(0,x.jsxs)(`header`,{className:`mb-5 flex w-full px-3`,children:[(0,x.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,x.jsx)(pZ,{color:`text`,roundedSize:`full`,size:`xs`,children:D.key}),N=D.filePath&&(0,x.jsx)(pZ,{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]=y,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,x.jsx)(pZ,{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,x.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,x.jsxs)(x.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]!==y?(ne=(0,x.jsx)(fX,{dictionary:D,mode:te,className:`mb-4 flex-col px-3`,onDelete:y}),t[58]=D,t[59]=y,t[60]=ne):ne=t[60];let R;t[61]!==D||t[62]!==S||t[63]!==d||t[64]!==y||t[65]!==r||t[66]!==o||t[67]!==T?(R=d&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(dX,{isOpen:S,onClose:()=>C(!1),hasCloseButton:!0,title:o,size:`xl`,transparency:`lg`,className:`h-full`,children:(0,x.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-1 flex-col px-3 pt-5`,children:(0,x.jsx)(VX,{dictionary:D,onClickDictionaryList:T,isDarkMode:r,mode:[`local`,`remote`],onDelete:()=>{C(!1),y()},onSave:()=>{C(!1)}})})}),(0,x.jsx)(UO,{dictionary:D})]}),t[61]=D,t[62]=S,t[63]=d,t[64]=y,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,x.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},vZ=e=>{let t=(0,V.c)(4),{isDarkMode:n}=e,{focusedContent:r}=Lw(),i=r?.dictionaryKey;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(x.Fragment,{}),t[0]=e):e=t[0],e}let a;return t[1]!==i||t[2]!==n?(a=(0,x.jsx)(_Z,{dictionaryKey:i,isDarkMode:n}),t[1]=i,t[2]=n,t[3]=a):a=t[3],a},yZ={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`},bZ=e=>{let{minChars:t=3,debounceMs:n=300,trim:r=!0,defaultValue:i,onSearch:a,onClear:o}=e??{},s=(0,b.useRef)(``),c=(0,b.useRef)(null),[l,u]=(0,b.useState)(i??``),d=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,b.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}},xZ=({className:e,...t})=>(0,x.jsxs)(`div`,{className:`relative flex w-full items-center gap-1`,children:[(0,x.jsx)(mf,{className:`absolute left-2 size-4`}),(0,x.jsx)(SO,{...t,type:`search`,className:W(`pl-8`,e)})]}),SZ=()=>{let{drawerTitle:e,buttonLabel:t}=nn(yZ),{set:n}=JX(),{localeDictionaries:r}=Nw(),{editedContent:i}=Hw(),{setFocusedContent:a}=Lw(),{setSearch:o,search:s}=bZ(),c=(0,b.useMemo)(()=>new AL(Object.values(r),{keys:[`key`,`title`,`filePath`,`description`,`tags`],threshold:.3,includeScore:!0}),[r]),l=(0,b.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({[mZ]:!1,[hZ(e.key)]:!0})},d=e=>Object.keys(i??{}).includes(e);return(0,x.jsxs)(dZ,{title:e.label.value,identifier:mZ,children:[(0,x.jsx)(`div`,{className:`p-3 pb-4`,children:(0,x.jsx)(xZ,{placeholder:`Search dictionaries`,onChange:e=>o(e.target.value),type:`search`})}),(0,x.jsx)(`ul`,{className:`flex flex-col gap-1`,children:l.map(e=>(0,x.jsx)(`li`,{className:`w-full`,children:(0,x.jsx)(iO,{label:t.label({dictionaryLocalId:e.localId}).value,onClick:()=>u(e),variant:`hoverable`,color:`text`,IconRight:Zd,size:`md`,isFullWidth:!0,Icon:d(e.localId)?uf:void 0,children:(0,x.jsx)(`div`,{className:`flex items-center gap-2 py-1`,children:(0,x.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-1.5`,children:[(0,x.jsx)(pZ,{color:`text`,roundedSize:`full`,size:`xs`,children:e.key}),e.filePath&&(0,x.jsx)(pZ,{color:`blue`,roundedSize:`full`,size:`xs`,children:e.filePath.split(`/`).pop()}),e.id&&(0,x.jsx)(pZ,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`})]}),(0,x.jsx)(`span`,{children:(e.title??``).length>0?e.title:e.key})]})})})},e.localId))})]})},CZ={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`},wZ=()=>{let e=(0,V.c)(8),{message:t}=nn(CZ),[n]=jw(VC.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,x.jsx)(`div`,{className:i,children:a}),e[5]=i,e[6]=a,e[7]=o):o=e[7],o},TZ=e=>{let t=(0,V.c)(5),{children:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:(0,x.jsx)(wZ,{})}),i=(0,x.jsx)(vZ,{}),a=(0,x.jsx)(SZ,{}),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,x.jsxs)(`div`,{className:`relative size-full bg-card p-3`,children:[n,r,i,a]}),t[3]=n,t[4]=o),o},EZ=()=>{let e=(0,V.c)(2),[t,n]=(0,b.useState)(),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{fetch(`/api/config`).then(DZ).then(e=>n(e.data))},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t};function DZ(e){return e.json()}var OZ=e=>{let t=(0,V.c)(11),{children:n,iframeRef:r}=e,i=EZ(),a=i?.editor.applicationURL;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(tO,{}),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,x.jsx)(Rw,{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},kZ={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`},AZ=()=>{let e=(0,V.c)(9),{editedContent:t,setEditedContentState:n}=Hw(),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,b.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,b.useEffect)(s,c),i},jZ={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`},MZ=()=>{let e=(0,V.c)(11),{title:t,description:n,documentationLink:r}=nn(jZ),i;e[0]===t?i=e[1]:(i=(0,x.jsx)(iX,{className:`mb-8`,children:t}),e[0]=t,e[1]=i);let a;e[2]===n?a=e[3]:(a=(0,x.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,x.jsx)(XF,{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,x.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},NZ=e=>{let t=(0,V.c)(23),{iframeRef:n,applicationPath:r}=e,i=nn(kZ),{editor:a}=Bw()??{},{enabled:o}=Uw(),s=Ww();AZ(),Kw();let[c,l]=(0,b.useState)(!0),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={receive:!0,emit:!1},t[0]=u):u=t[0];let[d]=Mw(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,b.useEffect)(f,p),!a?.applicationURL){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(GO,{className:`max-w-xl`,padding:`xl`,roundedSize:`2xl`,children:(0,x.jsx)(MZ,{})}),t[4]=e):e=t[4],e}let m;t[5]===c?m=t[6]:(m=(0,x.jsx)(tO,{isLoading:c}),t[5]=c,t[6]=m);let h=`${a.applicationURL}${r}`,g=i.intlayerApplication.value,_=c&&`hidden`,v;t[7]===_?v=t[8]:(v=W(`size-full`,_),t[7]=_,t[8]=v);let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{l(!1)},t[9]=y):y=t[9];let S;t[10]!==i.intlayerApplication.value||t[11]!==n||t[12]!==h||t[13]!==v?(S=(0,x.jsx)(`iframe`,{src:h,title:g,sandbox:`allow-scripts allow-same-origin`,className:v,ref:n,onLoad:y}),t[10]=i.intlayerApplication.value,t[11]=n,t[12]=h,t[13]=v,t[14]=S):S=t[14];let C;t[15]!==i.enableEditor||t[16]!==o||t[17]!==s?(C=!o&&(0,x.jsx)(`div`,{className:`fixed right-4 bottom-4`,children:(0,x.jsx)(iO,{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,x.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},PZ=()=>{let e=(0,V.c)(2),t=(0,b.useRef)(null),n=Or(),r;return e[0]===n.pathname?r=e[1]:(r=(0,x.jsx)(OZ,{iframeRef:t,children:(0,x.jsx)(Gt,{disableEditor:!0,children:(0,x.jsx)(TZ,{children:(0,x.jsx)(NZ,{iframeRef:t,applicationPath:n.pathname})})})}),e[0]=n.pathname,e[1]=r),r};(0,Ad.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(()=>{let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(bC,{children:(0,x.jsx)(yC,{children:(0,x.jsx)(PZ,{})})}),e[0]=t):t=e[0],t},{})}));export{aO as A,kl as B,Yj as C,Jj as D,Kj as E,Yd as F,y as G,xa as H,Jd as I,p as K,Gd as L,tO as M,UD as N,mk as O,hf as P,Fd as R,qj as S,Wj as T,rn as U,W as V,lt as W,Y as _,nX as a,Uj as b,aX as c,lV as d,eV as f,XF as g,PB as h,dX as i,iO as j,GO as k,oX as l,HB as m,AX as n,rX as o,BB as p,l as q,_X as r,iX as s,KX as t,sX as u,Xj as v,Zj as w,$j as x,Gj as y,Pd as z};
|
|
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 jq(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:Pq(t,`input`,e.processors),output:Pq(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Mq(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 Mq(r.element,n);if(r.type===`set`)return Mq(r.valueType,n);if(r.type===`lazy`)return Mq(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 Mq(r.innerType,n);if(r.type===`intersection`)return Mq(r.left,n)||Mq(r.right,n);if(r.type===`record`||r.type===`map`)return Mq(r.keyType,n)||Mq(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Mq(r.in,n)||Mq(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Mq(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Mq(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Mq(e,n))return!0;return!!(r.rest&&Mq(r.rest,n))}return!1}var Nq=(e,t={})=>n=>{let r=Oq({...n,processors:t});return kq(e,r),Aq(r,e),jq(r,e)},Pq=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Oq({...i??{},target:a,io:t,processors:n});return kq(e,o),Aq(o,e),jq(o,e)},Fq={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},Iq=(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=Fq[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}))])}},Lq=(e,t,n,r)=>{n.not={}},Rq=(e,t,n,r)=>{let i=e._zod.def,a=PU(i.entries);a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},zq=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},Bq=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},Vq=(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=kq(a.element,t,{...r,path:[...r.path,`items`]})},Hq=(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]=kq(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=kq(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},Uq=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>kq(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Wq=(e,t,n,r)=>{let i=e._zod.def,a=kq(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=kq(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]]},Gq=(e,t,n,r)=>{let i=e._zod.def,a=kq(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`}]},Kq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},qq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Jq=(e,t,n,r)=>{let i=e._zod.def;kq(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)))},Yq=(e,t,n,r)=>{let i=e._zod.def;kq(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},Xq=(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;kq(o,t,r);let s=t.seen.get(e);s.ref=o},Zq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},Qq=(e,t,n,r)=>{let i=e._zod.def;kq(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType};function $q(){return $q=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},$q.apply(null,arguments)}function eJ(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function tJ(e,t){for(var n={};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[0].errors[0];n[o]={message:s.message,type:s.code}}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]=pH(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function nJ(e,t){for(var n={},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[0][0];n[o]={message:s.message,type:s.code}}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($q({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=pH(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function rJ(e,t,n){if(n===void 0&&(n={}),function(e){return`_def`in e&&typeof e._def==`object`&&`typeName`in e._def}(e))return function(r,i,a){try{return Promise.resolve(eJ(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&TU({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:EU(tJ(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(eJ(function(){return Promise.resolve((n.mode===`sync`?bW:SW)(e,r,t)).then(function(e){return a.shouldUseNativeValidation&&TU({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return e instanceof hW}(e))return{values:{},errors:EU(nJ(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var iJ=async e=>e&&typeof e.then==`function`?await e:e,aJ=({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 iJ(t?.(i)),a.success?await iJ(n?.(a.data)):await iJ(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,x.jsx)(AH,{...c,children:(0,x.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})})},oJ=(e,t)=>{let n=(0,V.c)(13),r;n[0]===e?r=n[1]:(r=rJ(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=aU(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}=YV(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},sJ=aJ,cJ=Q(`ZodISODateTime`,(e,t)=>{LG.init(e,t),FJ.init(e,t)});function lJ(e){return rq(cJ,e)}var uJ=Q(`ZodISODate`,(e,t)=>{RG.init(e,t),FJ.init(e,t)});function dJ(e){return iq(uJ,e)}var fJ=Q(`ZodISOTime`,(e,t)=>{zG.init(e,t),FJ.init(e,t)});function pJ(e){return aq(fJ,e)}var mJ=Q(`ZodISODuration`,(e,t)=>{BG.init(e,t),FJ.init(e,t)});function hJ(e){return oq(mJ,e)}var gJ=Q(`ZodError`,(e,t)=>{hW.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>vW(e,t)},flatten:{value:t=>_W(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,FU,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,FU,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),_J=yW(gJ),vJ=xW(gJ),yJ=CW(gJ),bJ=TW(gJ),xJ=DW(gJ),SJ=OW(gJ),CJ=kW(gJ),wJ=AW(gJ),TJ=jW(gJ),EJ=MW(gJ),DJ=NW(gJ),OJ=PW(gJ),kJ=new WeakMap;function AJ(e,t,n){let r=Object.getPrototypeOf(e),i=kJ.get(r);if(i||(i=new Set,kJ.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 jJ=Q(`ZodType`,(e,t)=>(CG.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:Pq(e,`input`),output:Pq(e,`output`)}}),e.toJSONSchema=Nq(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>_J(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>yJ(e,t,n),e.parseAsync=async(t,n)=>vJ(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>bJ(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>xJ(e,t,n),e.decode=(t,n)=>SJ(e,t,n),e.encodeAsync=async(t,n)=>CJ(e,t,n),e.decodeAsync=async(t,n)=>wJ(e,t,n),e.safeEncode=(t,n)=>TJ(e,t,n),e.safeDecode=(t,n)=>EJ(e,t,n),e.safeEncodeAsync=async(t,n)=>DJ(e,t,n),e.safeDecodeAsync=async(t,n)=>OJ(e,t,n),AJ(e,`ZodType`,{check(...e){let t=this.def;return this.clone(HU(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 QU(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(IY(e,t))},superRefine(e,t){return this.check(LY(e,t))},overwrite(e){return this.check(vq(e))},optional(){return vY(this)},exactOptional(){return bY(this)},nullable(){return SY(this)},nullish(){return vY(SY(this))},nonoptional(e){return OY(this,e)},array(){return oY(this)},or(e){return uY([this,e])},and(e){return fY(this,e)},transform(e){return MY(this,gY(e))},default(e){return wY(this,e)},prefault(e){return EY(this,e)},catch(e){return AY(this,e)},pipe(e){return MY(this,e)},readonly(){return PY(this)},describe(e){let t=this.clone();return NK.add(t,{description:e}),t},meta(...e){if(e.length===0)return NK.get(this);let t=this.clone();return NK.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 NK.get(e)?.description},configurable:!0}),e)),MJ=Q(`_ZodString`,(e,t)=>{wG.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Iq(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,AJ(e,`_ZodString`,{regex(...e){return this.check(fq(...e))},includes(...e){return this.check(hq(...e))},startsWith(...e){return this.check(gq(...e))},endsWith(...e){return this.check(_q(...e))},min(...e){return this.check(uq(...e))},max(...e){return this.check(lq(...e))},length(...e){return this.check(dq(...e))},nonempty(...e){return this.check(uq(1,...e))},lowercase(e){return this.check(pq(e))},uppercase(e){return this.check(mq(e))},trim(){return this.check(bq())},normalize(...e){return this.check(yq(...e))},toLowerCase(){return this.check(xq())},toUpperCase(){return this.check(Sq())},slugify(){return this.check(Cq())}})}),NJ=Q(`ZodString`,(e,t)=>{wG.init(e,t),MJ.init(e,t),e.email=t=>e.check(FK(IJ,t)),e.url=t=>e.check(VK(zJ,t)),e.jwt=t=>e.check(nq(eY,t)),e.emoji=t=>e.check(HK(BJ,t)),e.guid=t=>e.check(IK(LJ,t)),e.uuid=t=>e.check(LK(RJ,t)),e.uuidv4=t=>e.check(RK(RJ,t)),e.uuidv6=t=>e.check(zK(RJ,t)),e.uuidv7=t=>e.check(BK(RJ,t)),e.nanoid=t=>e.check(UK(VJ,t)),e.guid=t=>e.check(IK(LJ,t)),e.cuid=t=>e.check(WK(HJ,t)),e.cuid2=t=>e.check(GK(UJ,t)),e.ulid=t=>e.check(KK(WJ,t)),e.base64=t=>e.check($K(ZJ,t)),e.base64url=t=>e.check(eq(QJ,t)),e.xid=t=>e.check(qK(GJ,t)),e.ksuid=t=>e.check(JK(KJ,t)),e.ipv4=t=>e.check(YK(qJ,t)),e.ipv6=t=>e.check(XK(JJ,t)),e.cidrv4=t=>e.check(ZK(YJ,t)),e.cidrv6=t=>e.check(QK(XJ,t)),e.e164=t=>e.check(tq($J,t)),e.datetime=t=>e.check(lJ(t)),e.date=t=>e.check(dJ(t)),e.time=t=>e.check(pJ(t)),e.duration=t=>e.check(hJ(t))});function PJ(e){return PK(NJ,e)}var FJ=Q(`ZodStringFormat`,(e,t)=>{TG.init(e,t),MJ.init(e,t)}),IJ=Q(`ZodEmail`,(e,t)=>{OG.init(e,t),FJ.init(e,t)}),LJ=Q(`ZodGUID`,(e,t)=>{EG.init(e,t),FJ.init(e,t)}),RJ=Q(`ZodUUID`,(e,t)=>{DG.init(e,t),FJ.init(e,t)}),zJ=Q(`ZodURL`,(e,t)=>{kG.init(e,t),FJ.init(e,t)}),BJ=Q(`ZodEmoji`,(e,t)=>{AG.init(e,t),FJ.init(e,t)}),VJ=Q(`ZodNanoID`,(e,t)=>{jG.init(e,t),FJ.init(e,t)}),HJ=Q(`ZodCUID`,(e,t)=>{MG.init(e,t),FJ.init(e,t)}),UJ=Q(`ZodCUID2`,(e,t)=>{NG.init(e,t),FJ.init(e,t)}),WJ=Q(`ZodULID`,(e,t)=>{PG.init(e,t),FJ.init(e,t)}),GJ=Q(`ZodXID`,(e,t)=>{FG.init(e,t),FJ.init(e,t)}),KJ=Q(`ZodKSUID`,(e,t)=>{IG.init(e,t),FJ.init(e,t)}),qJ=Q(`ZodIPv4`,(e,t)=>{VG.init(e,t),FJ.init(e,t)}),JJ=Q(`ZodIPv6`,(e,t)=>{HG.init(e,t),FJ.init(e,t)}),YJ=Q(`ZodCIDRv4`,(e,t)=>{UG.init(e,t),FJ.init(e,t)}),XJ=Q(`ZodCIDRv6`,(e,t)=>{WG.init(e,t),FJ.init(e,t)}),ZJ=Q(`ZodBase64`,(e,t)=>{KG.init(e,t),FJ.init(e,t)}),QJ=Q(`ZodBase64URL`,(e,t)=>{JG.init(e,t),FJ.init(e,t)}),$J=Q(`ZodE164`,(e,t)=>{YG.init(e,t),FJ.init(e,t)}),eY=Q(`ZodJWT`,(e,t)=>{ZG.init(e,t),FJ.init(e,t)}),tY=Q(`ZodUnknown`,(e,t)=>{QG.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function nY(){return sq(tY)}var rY=Q(`ZodNever`,(e,t)=>{$G.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Lq(e,t,n,r)});function iY(e){return cq(rY,e)}var aY=Q(`ZodArray`,(e,t)=>{tK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Vq(e,t,n,r),e.element=t.element,AJ(e,`ZodArray`,{min(e,t){return this.check(uq(e,t))},nonempty(e){return this.check(uq(1,e))},max(e,t){return this.check(lq(e,t))},length(e,t){return this.check(dq(e,t))},unwrap(){return this.element}})});function oY(e,t){return wq(aY,e,t)}var sY=Q(`ZodObject`,(e,t)=>{oK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Hq(e,t,n,r),BU(e,`shape`,()=>t.shape),AJ(e,`ZodObject`,{keyof(){return mY(Object.keys(this._zod.def.shape))},catchall(e){return this.clone({...this._zod.def,catchall:e})},passthrough(){return this.clone({...this._zod.def,catchall:nY()})},loose(){return this.clone({...this._zod.def,catchall:nY()})},strict(){return this.clone({...this._zod.def,catchall:iY()})},strip(){return this.clone({...this._zod.def,catchall:void 0})},extend(e){return nW(this,e)},safeExtend(e){return rW(this,e)},merge(e){return iW(this,e)},pick(e){return eW(this,e)},omit(e){return tW(this,e)},partial(...e){return aW(_Y,this,e[0])},required(...e){return oW(DY,this,e[0])}})});function cY(e,t){return new sY({type:`object`,shape:e??{},...$(t)})}var lY=Q(`ZodUnion`,(e,t)=>{cK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Uq(e,t,n,r),e.options=t.options});function uY(e,t){return new lY({type:`union`,options:e,...$(t)})}var dY=Q(`ZodIntersection`,(e,t)=>{lK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Wq(e,t,n,r)});function fY(e,t){return new dY({type:`intersection`,left:e,right:t})}var pY=Q(`ZodEnum`,(e,t)=>{fK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Rq(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 pY({...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 pY({...t,checks:[],...$(r),entries:i})}});function mY(e,t){return new pY({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...$(t)})}var hY=Q(`ZodTransform`,(e,t)=>{pK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Bq(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jU(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(pW(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(pW(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 gY(e){return new hY({type:`transform`,transform:e})}var _Y=Q(`ZodOptional`,(e,t)=>{hK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function vY(e){return new _Y({type:`optional`,innerType:e})}var yY=Q(`ZodExactOptional`,(e,t)=>{gK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Qq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function bY(e){return new yY({type:`optional`,innerType:e})}var xY=Q(`ZodNullable`,(e,t)=>{_K.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Gq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function SY(e){return new xY({type:`nullable`,innerType:e})}var CY=Q(`ZodDefault`,(e,t)=>{vK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>qq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function wY(e,t){return new CY({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():YU(t)}})}var TY=Q(`ZodPrefault`,(e,t)=>{bK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Jq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function EY(e,t){return new TY({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():YU(t)}})}var DY=Q(`ZodNonOptional`,(e,t)=>{xK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Kq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function OY(e,t){return new DY({type:`nonoptional`,innerType:e,...$(t)})}var kY=Q(`ZodCatch`,(e,t)=>{CK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Yq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function AY(e,t){return new kY({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var jY=Q(`ZodPipe`,(e,t)=>{wK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Xq(e,t,n,r),e.in=t.in,e.out=t.out});function MY(e,t){return new jY({type:`pipe`,in:e,out:t})}var NY=Q(`ZodReadonly`,(e,t)=>{EK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Zq(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function PY(e){return new NY({type:`readonly`,innerType:e})}var FY=Q(`ZodCustom`,(e,t)=>{OK.init(e,t),jJ.init(e,t),e._zod.processJSONSchema=(t,n,r)=>zq(e,t,n,r)});function IY(e,t={}){return Tq(FY,e,t)}function LY(e,t){return Eq(e,t)}var RY=e=>{let t=(0,V.c)(3),[n,r]=(0,b.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,b.useEffect)(i,a),n},zY=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()})}},BY=[],VY=()=>{let e=(0,V.c)(2),t=(0,b.useSyncExternalStore)(zY.subscribe,zY.getSnapshot,HY),n;return e[0]===t?n=e[1]:(n={scrollBlockers:t,addBlockage:zY.addBlockage,removeBlockage:zY.removeBlockage,isElementScrollBlocked:zY.isElementScrollBlocked},e[0]=t,e[1]=n),n};function HY(){return BY}var UY=e=>{let{disableScroll:t=!1,element:n,key:r=`unnamed_blocker`}=e??{},{isElementScrollBlocked:i,addBlockage:a,removeBlockage:o}=VY(),s=RY(n);return(0,b.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}},WY=`relative scroll-mb-8 scroll-mt-[30vh] scroll-p-8`,GY=`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`,KY=({className:e,...t})=>(0,x.jsx)(`h1`,{className:W(`text-3xl`,e),...t}),qY=({className:e,...t})=>(0,x.jsx)(`h2`,{className:W(`mb-2 text-2xl`,WY,e),...t}),JY=({className:e,...t})=>(0,x.jsx)(`h3`,{className:W(`mb-2 text-xl`,WY,e),...t}),YY=({className:e,...t})=>(0,x.jsx)(`h4`,{className:W(`text-lg`,WY,e),...t}),XY=({className:e,...t})=>(0,x.jsx)(`h5`,{className:W(`text-base`,WY,e),...t}),ZY=({className:e,...t})=>(0,x.jsx)(`h6`,{className:W(`ml-3 text-base`,WY,e),...t}),QY=e=>String(e).normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/\s+/g,`-`).toLowerCase(),$Y=e=>{let t=(document.getElementById(e)?.getBoundingClientRect()?.top??0)+window.scrollY-150;window.scrollTo({top:t,behavior:`smooth`})},eX=(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},tX=({H:e,children:t,className:n,isClickable:r,...i})=>{let a=typeof t==`string`?QY(t):void 0;return(0,x.jsx)(e,{id:a,onClick:r?e=>{let{id:t}=e.currentTarget;if(eX(e.currentTarget,e)&&typeof t==`string`){let e=`${window.location.href.split(`#`)[0]}#${t}`;navigator.clipboard.writeText(e),$Y(t)}}:void 0,"aria-label":r?`Click to scroll to section ${a} and copy the link to the clipboard`:void 0,className:W(r&&GY,n),...i,children:t})},nX=({isClickable:e,...t})=>(0,x.jsx)(KY,{...t}),rX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:qY,isClickable:e,...t}),iX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:JY,isClickable:e,...t}),aX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:YY,isClickable:e,...t}),oX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:XY,isClickable:e,...t}),sX=({isClickable:e=!1,...t})=>(0,x.jsx)(tX,{H:ZY,isClickable:e,...t}),cX=Fd(`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`}}),lX={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=gC.create(GO),dX=({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=RY(n);if(UY({key:`modal`,disableScroll:t&&l}),(0,b.useEffect)(()=>{let e=e=>{e.key===`Escape`&&t&&r&&r()};return document.addEventListener(`keydown`,e),()=>{document.removeEventListener(`keydown`,e)}},[t,r]),!f)return(0,x.jsx)(x.Fragment,{});let p=!!a,m=lX[u||`none`];return(0,G.createPortal)((0,x.jsx)(gC.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,x.jsxs)(uX,{onClick:e=>e.stopPropagation(),initial:{scale:t?.5:1},animate:{scale:t?1:.5},transition:{duration:.3},className:cX({size:o,className:s}),role:`dialog`,"aria-modal":!0,roundedSize:`4xl`,padding:`none`,...d,children:[(0,x.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,x.jsx)(iX,{className:`mb-2 ml-1 flex items-center justify-center font-bold text-lg`,children:a}),i&&(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,label:`Close modal`,className:`ml-auto`,onClick:e=>{e.stopPropagation(),r?.()},Icon:_f,size:`icon-md`})]}),(0,x.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,x.jsx)(`div`,{className:W(`flex size-full flex-1 flex-col`,m),children:e})})]})}),f)},fX=e=>{let t=(0,V.c)(25),{dictionary:n,mode:r,className:i,onDelete:a,onSave:o,...s}=e,[c,l]=(0,b.useState)(!1),{setLocaleDictionary:u}=Pw(),{mutate:d,isPending:f}=YD(),{mutate:p,isPending:m}=ZD(),{mutate:h,isPending:g}=JD(),_=m||g,{editedContent:v,restoreEditedContent:y}=Hw(),{deleteButton:S,resetButton:C,saveButton:w,publishButton:T,downloadButton:E,confirmation:D}=rn(`save-dictionary-details`),{isAuthenticated:O}=jD(),{session:k}=AD(),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=v?.[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]!==v||t[7]!==o||t[8]!==y||t[9]!==u||t[10]!==p?(L=async()=>{if(!v?.[n.localId])return;let e={...n,...v?.[n.localId]};p({dictionary:e},{onSuccess:()=>{u(v?.[n.localId]),y(n.localId),l(!1),o?.()}})},t[5]=n,t[6]=v,t[7]=o,t[8]=y,t[9]=u,t[10]=p,t[11]=L):L=t[11];let ee=L,te;t[12]!==n||t[13]!==v||t[14]!==o||t[15]!==h||t[16]!==y||t[17]!==u?(te=()=>{let e={...n,...v?.[n.localId]};h({dictionaries:[e]},{onSuccess:t=>{t&&(u(e),y(n.localId),o?.())}})},t[12]=n,t[13]=v,t[14]=o,t[15]=h,t[16]=y,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,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(dX,{isOpen:c,title:D.title.value,size:`md`,onClose:B,padding:`md`,children:(0,x.jsxs)(`form`,{className:`size-full`,children:[(0,x.jsx)(`p`,{className:`py-4 text-neutral text-sm`,children:D.message}),(0,x.jsxs)(`div`,{className:`mt-12 flex justify-end gap-2 max-md:flex-col`,children:[(0,x.jsx)(iO,{label:D.cancelButton.label.value,disabled:!F||_,color:`text`,className:`max-md:w-full`,variant:`outline`,onClick:re,children:D.cancelButton.text}),(0,x.jsx)(iO,{label:D.confirmButton.label.value,disabled:!F||_||!j,Icon:pf,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ee,children:D.confirmButton.text})]})]})}),(0,x.jsxs)(`form`,{className:W(`flex justify-end gap-2`,i),...s,children:[r.includes(`remote`)&&I&&a&&O&&(0,x.jsx)(iO,{label:S.label.value,Icon:hf,color:`error`,variant:`outline`,className:`max-md:w-full`,isLoading:f,onClick:z,disabled:!M,children:S.text}),F&&(0,x.jsx)(iO,{label:C.label.value,disabled:!F,Icon:ff,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:()=>y(n.localId),children:C.text}),r.includes(`local`)&&(0,x.jsx)(iO,{label:E.label.value,disabled:!F||_,Icon:nf,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,x.jsx)(iO,{label:T.label.value,disabled:_||!j,Icon:qd,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ne,children:T.text}),r.includes(`remote`)&&O&&I&&F&&(0,x.jsx)(iO,{label:w.label.value,disabled:!F||_||!j,Icon:pf,color:`text`,className:`max-md:w-full`,isLoading:g,onClick:ne,children:w.text})]})]})},pX=(e,t=2e3,n,r)=>{let[i,a]=(0,b.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))}}}},mX=({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}=pX(e,a,o,s);if(c)return(0,x.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?ef:tf;return(0,x.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,x.jsx)(`span`,{className:`min-w-0 break-all`,children:t}),e&&(0,x.jsx)(_,{className:`ml-1 ml-auto shrink-0`,size:d,"aria-hidden":`true`})]})},hX=Fd(`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`}}),gX=Fd(`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`}}),_X=({tabs:e,selectedChoice:t,onTabClick:n,color:r=`primary`,hoverable:i=!1,orientation:a=`horizontal`,className:o})=>{let s=(0,b.useRef)([]),c=(0,b.useRef)(null),{choiceIndicatorPosition:l,calculatePosition:u}=uO(s,{isHoverable:i,orientation:a});return(0,b.useEffect)(()=>{u()},[t]),(0,x.jsxs)(`div`,{className:W(hX({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,b.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,x.jsx)(`div`,{className:W(gX({color:r,orientation:a})),style:l,ref:c},`${t}${JSON.stringify(e.map(e=>e.key))}`)]})},vX=Fd([`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`}}),yX=({validationStyleEnabled:e=!1,label:t,size:n,color:r,name:i,variant:a,className:o,labelClassName:s,...c})=>(0,x.jsx)(`input`,{type:`checkbox`,className:W(vX({variant:a,size:n,color:r,validationStyleEnabled:e?`enabled`:`disabled`}),o),...c}),bX=e=>{let{label:t,name:n,id:r}=e;return t?(0,x.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,x.jsx)(yX,{id:r??n,...e}),t]}):(0,x.jsx)(yX,{id:r??n,...e})},xX=e=>(0,x.jsx)(vU,{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:IO,...e}),SX=e=>(0,x.jsx)(vU,{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:OO,...e}),CX=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:_}=rn(`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=cY({title:PJ({error:y}).refine(wX,{error:i.value}).optional(),key:PJ({error:b}).min(4,{error:c.value}).regex(/^[a-zA-Z0-9-_]+$/,{error:s.value}).default(``),description:PJ({error:x}).optional(),projectIds:oY(PJ({error:S})).default([e]),tags:oY(PJ({error:C})).default([]),location:mY([`local`,`remote`,`hybrid`,`plugin`],{error:w}).optional(),importMode:mY([`static`,`dynamic`,`fetch`]).optional(),filePath:PJ({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 wX(e){return e.length===0||e.length>=4}var TX=[`collection`,`variant`],EX=e=>{let t=[];return e.item!==void 0&&t.push(`collection`),e.variant!==void 0&&t.push(`variant`),t},DX=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,OX=e=>{if(e.trim().startsWith(`{`))try{return{variant:JSON.parse(e),error:!1}}catch{return{variant:e,error:!0}}return{variant:e,error:!1}},kX=({dictionary:e,mode:t,onSelectSibling:n})=>{let{session:r}=AD(),{project:i}=r??{},{data:a,isLoading:o}=QD(),{data:s}=$D(),c=a?.data??[],l=s?.data??[],u=CX(String(i?.id)),{form:d,isSubmitting:f}=oJ(u,{defaultValues:{...e,location:e.location??`remote`}}),{editedContent:p,setEditedDictionary:m}=Hw(),{titleInput:h,keyInput:g,descriptionInput:_,projectInput:v,tagsSelect:y,locationSelect:S,importModeSelect:C,filePathInput:w,auditButton:T,qualifierSection:E,siblingDictionaries:D,typeSwitch:O}=rn(`dictionary-details`),{mutate:k,isPending:A}=WD(),j=p?.[e.localId],{data:M,isLoading:N}=qD({keys:[e.key]},{enabled:!!e.key}),P=(0,b.useMemo)(()=>(M?.data??[]).filter(t=>t.localId!==e.localId),[M,e.localId]),F=(0,b.useMemo)(()=>P.filter(e=>e.item!==void 0).sort((e,t)=>(e.item??0)-(t.item??0)),[P]),I=(0,b.useMemo)(()=>P.filter(e=>e.variant!==void 0),[P]),L=(0,b.useMemo)(()=>e.item===void 0?F:[e,...F].sort((e,t)=>(e.item??0)-(t.item??0)),[e,F]),ee=(0,b.useMemo)(()=>e.variant===void 0?I:[e,...I],[e,I]);(0,b.useEffect)(()=>{d.reset({...e,tags:e.tags??[],location:e.location??`remote`}),re(EX(e)),ae(e.item??1),se(DX(e.variant)),le(!1),de(!1)},[e,d?.reset]),(0,b.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=tH({control:d.control,name:`location`}),R=ne===`local`||ne===`hybrid`,z=P.length>0,[B,re]=(0,b.useState)(()=>EX(e)),[ie,ae]=(0,b.useState)(e.item??1),[oe,se]=(0,b.useState)(DX(e.variant)),[ce,le]=(0,b.useState)(!1),[ue,de]=(0,b.useState)(!1),fe=(0,b.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:OX(e).variant}}re(n),m(a),le(!1),n.length===0&&fe.length>0?de(!0):de(!1)};return(0,x.jsxs)(sJ,{className:`flex w-full flex-col gap-8`,...d,schema:u,children:[(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,x.jsx)(xX,{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,x.jsx)(xX,{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,x.jsx)(SX,{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,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 px-1 max-md:grid-cols-1`,children:[(0,x.jsx)(sU,{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,x.jsxs)(bV,{className:`flex flex-col gap-2 px-1`,children:[(0,x.jsx)(hU,{className:`ml-1`,children:S.label}),(0,x.jsxs)(`div`,{className:`ml-2 flex items-center gap-4 py-2`,children:[(0,x.jsx)(bX,{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,x.jsx)(bX,{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,x.jsx)(uU,{children:S.testDescription}),(0,x.jsx)(dU,{})]})}}),(0,x.jsx)(vx,{mode:`wait`,children:R&&(0,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.3},children:(0,x.jsx)(yU,{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,x.jsx)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:(0,x.jsxs)(CU,{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,x.jsx)(Y.Trigger,{children:(0,x.jsx)(Y.Value,{placeholder:C.label.value})}),(0,x.jsxs)(Y.Content,{children:[(0,x.jsx)(Y.Item,{value:`static`,children:C.static.value}),(0,x.jsx)(Y.Item,{value:`dynamic`,children:C.dynamic.value}),(0,x.jsx)(Y.Item,{value:`live`,children:C.live.value})]})]})}),(0,x.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,x.jsxs)(xU,{name:`projectIds`,label:v.label.value,description:v.description,onValueChange:t=>{let n=[t].flat();d.setValue(`projectIds`,n,{shouldDirty:!0}),m({...e,...j??{},projectIds:n})},children:[(0,x.jsx)(vV.Trigger,{getBadgeValue:e=>c?.find(t=>String(t.id)===e)?.name??e,children:(0,x.jsx)(vV.Input,{placeholder:v.placeholder.value})}),(0,x.jsx)(vV.Content,{children:(0,x.jsx)(tO,{isLoading:o,children:(0,x.jsx)(vV.List,{children:c?.map(e=>(0,x.jsx)(vV.Item,{value:String(e.id),children:e.name},String(e.id)))})})})]}),(0,x.jsxs)(xU,{name:`tags`,label:y.label.value,description:y.description,onValueChange:t=>{let n=[t].flat();d.setValue(`tags`,n,{shouldDirty:!0}),m({...e,...j??{},tags:n})},children:[(0,x.jsx)(vV.Trigger,{getBadgeValue:e=>l?.find(t=>String(t.key)===e)?.name??e,children:(0,x.jsx)(vV.Input,{placeholder:y.placeholder.value})}),(0,x.jsx)(vV.Content,{children:(0,x.jsx)(tO,{isLoading:o,children:(0,x.jsx)(vV.List,{children:l?.map(e=>(0,x.jsx)(vV.Item,{value:String(e.key),children:e.name??e.key},String(e.key)))})})})]})]}),(0,x.jsxs)(GO,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`card`,children:[(0,x.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,x.jsx)(`p`,{className:`ml-1 font-semibold text-sm`,children:O.label}),(0,x.jsx)(`p`,{className:`ml-1 text-muted text-xs`,children:O.description})]}),(0,x.jsxs)(vV,{values:B,onValueChange:pe,className:`max-w-xs`,children:[(0,x.jsx)(vV.Trigger,{getBadgeValue:e=>e===`collection`?String(O.collection):e===`variant`?String(O.variant):e,children:(0,x.jsx)(vV.Input,{placeholder:O.label.value})}),(0,x.jsx)(vV.Content,{children:(0,x.jsx)(vV.List,{children:TX.map(e=>(0,x.jsx)(vV.Item,{value:e,children:O[e].value},e))})})]}),(0,x.jsxs)(vx,{children:[B.includes(`collection`)&&(0,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,x.jsx)(`label`,{htmlFor:`qualifier-item-value`,className:`ml-1 font-medium text-sm`,children:O.itemValueLabel}),(0,x.jsx)(SO,{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,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,x.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,x.jsx)(`label`,{htmlFor:`qualifier-variant-value`,className:`ml-1 font-medium text-sm`,children:O.variantValueLabel}),(0,x.jsx)(SO,{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}=OX(n);le(i),i||m({...e,...j??{},variant:r})}}),ce&&(0,x.jsx)(`p`,{className:`ml-1 text-destructive text-xs`,children:O.variantJsonError})]})},`variant-input`),B.length===0&&ue&&(0,x.jsx)(gC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,x.jsxs)(GO,{background:`none`,border:!0,borderColor:`neutral`,roundedSize:`xl`,padding:`md`,className:`gap-3`,children:[(0,x.jsx)(`p`,{className:`font-medium text-sm`,children:O.disablePickerTitle}),(0,x.jsx)(`p`,{className:`text-muted text-xs`,children:O.disablePickerDescription}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:fe.map(e=>(0,x.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,x.jsxs)(`span`,{children:[E.variant,`:`,` `,DX(e.variant)]}),e.item!==void 0&&(0,x.jsxs)(`span`,{children:[E.item,`: `,e.item]})]},e.localId))})]})},`sibling-picker`)]})]}),(0,x.jsxs)(GO,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`neutral`,children:[(0,x.jsx)(`p`,{className:`font-semibold text-sm`,children:D.title}),(0,x.jsxs)(tO,{isLoading:N,children:[!z&&(0,x.jsx)(`p`,{className:`text-muted text-sm`,children:D.noSiblings}),L.length>0&&(0,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.collectionItems}),(0,x.jsx)(RL,{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,x.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:L.map(t=>{let r=t.localId===e.localId;return(0,x.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,x.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,x.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.variants}),(0,x.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:ee.map(t=>{let r=t.localId===e.localId;return(0,x.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:DX(t.variant)},t.localId)})})]})]})]}),(0,x.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 max-md:flex-col`,children:(0,x.jsx)(iO,{type:`button`,size:`icon-md`,label:T.label.value,Icon:gf,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:te,disabled:f||A,isLoading:A})})]})},AX=e=>{let t=(0,V.c)(6),{content:n,...r}=e,[i,a]=(0,b.useState)(!1),[o,s]=(0,b.useState)(!1),{label:c}=rn(`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,b.useEffect)(d,f);let p=()=>i?`Content copied to clipboard`:o?`Failed to copy content`:r.label??c.value;return(0,x.jsx)(iO,{Icon:i?ef:tf,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})},jX=(0,b.lazy)(()=>lt(()=>import(`./dist-oJho0qAp.js`).then(e=>({default:e.Editor})),__vite__mapDeps([6,2,3]))),MX=({children:e,language:t,isDarkMode:n,showLineNumbers:r,showCopyButton:i=!0,isReadOnly:a=!1,onChange:o})=>{let s=(0,b.useRef)(null),c=(0,b.useRef)(null),[l,u]=(0,b.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,x.jsxs)(`div`,{className:W(`relative size-full text-sm`,r&&`ml-0`),children:[i&&(0,x.jsx)(`div`,{className:`sticky top-5 z-10`,children:(0,x.jsx)(`div`,{className:W(`absolute right-2 bottom-0 flex h-7 items-center`),children:(0,x.jsx)(AX,{content:e})})}),(0,x.jsx)(`div`,{className:`z-0 grid size-full grid-cols-[0px] overflow-auto`,ref:s,children:(0,x.jsx)(b.Suspense,{fallback:(0,x.jsx)(tO,{}),children:(0,x.jsx)(jX,{...l,defaultLanguage:`typescript`,language:t,loading:(0,x.jsx)(tO,{}),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`})})})]})},NX=e=>{let t=(0,V.c)(7),{dictionary:n,isDarkMode:r}=e,{setEditedContent:i,editedContent:a}=Hw(),o=PX,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,x.jsx)(MX,{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 PX(e){try{return JSON.parse(e),!0}catch{return!1}}var FX=e=>{let t=(0,V.c)(23),{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,condition:h,markdown:g,insertion:_,reactNode:v,file:y}=rn(`node-type-selector`),S;t[0]===n?S=t[1]:(S=en(n),t[0]=n,t[1]=S);let[C,F]=(0,b.useState)(S),ne;t[2]===r?ne=t[3]:(ne=e=>{F(e),r(e)},t[2]=r,t[3]=ne);let R=ne,z;return t[4]!==l||t[5]!==s||t[6]!==h||t[7]!==u||t[8]!==y||t[9]!==m||t[10]!==_||t[11]!==C||t[12]!==g||t[13]!==i||t[14]!==p||t[15]!==c||t[16]!==o||t[17]!==R||t[18]!==d||t[19]!==v||t[20]!==a||t[21]!==f?(z=(0,x.jsxs)(Y,{value:C,onValueChange:R,children:[(0,x.jsx)(Y.Trigger,{children:(0,x.jsx)(Y.Value,{placeholder:f})}),(0,x.jsxs)(Y.Content,{children:[(0,x.jsx)(Y.Item,{value:w,children:i}),(0,x.jsx)(Y.Item,{value:I,children:a}),(0,x.jsx)(Y.Item,{value:L,children:o}),(0,x.jsx)(Y.Item,{value:ee,children:s}),(0,x.jsx)(Y.Item,{value:A,children:c}),(0,x.jsx)(Y.Item,{value:j,children:l}),(0,x.jsx)(Y.Item,{value:T,children:u}),(0,x.jsx)(Y.Item,{value:E,children:d}),(0,x.jsx)(Y.Item,{value:te,children:m}),(0,x.jsx)(Y.Item,{value:O,children:_}),(0,x.jsx)(Y.Item,{value:P,children:g}),(0,x.jsx)(Y.Item,{value:M,children:p}),(0,x.jsx)(Y.Item,{value:D,children:h}),(0,x.jsx)(Y.Item,{value:N,disabled:!0,children:v}),(0,x.jsx)(Y.Item,{value:k,children:y})]})]}),t[4]=l,t[5]=s,t[6]=h,t[7]=u,t[8]=y,t[9]=m,t[10]=_,t[11]=C,t[12]=g,t[13]=i,t[14]=p,t[15]=c,t[16]=o,t[17]=R,t[18]=d,t[19]=v,t[20]=a,t[21]=f,t[22]=z):z=t[22],z},IX=e=>{let t=(0,V.c)(15),{section:n,dictionaryLocalId:r,keyPath:i,onNodeTypeChange:a}=e,o=Bw()?.internationalization?.locales??[],s=en(n),c=Zt(n),l=e=>{a(Yt(s,o,e))};if(s===`translation`||s===`condition`||s===`gender`||s===`enumeration`||s===`plural`){let e=Object.keys(n[s])[0],t=[...i,{type:s,key:e}];return(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,x.jsx)(FX,{section:n,onValueChange:e=>a(Yt(e,o))}),(0,x.jsx)(IX,{section:c,keyPath:t,dictionaryLocalId:r,onNodeTypeChange:l})]})}if(s===`array`){let e=[...i,{type:s,key:0}];return(0,x.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,x.jsx)(FX,{section:n,onValueChange:e=>a(Yt(e,o))}),(0,x.jsx)(IX,{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(Yt(e,o)),t[6]=o,t[7]=a,t[8]=s):s=t[8],e=(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(FX,{section:n,onValueChange:s}),(0,x.jsx)(`div`,{className:`mt-6 ml-10`,children:(0,x.jsx)(zX,{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(Yt(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,x.jsx)(FX,{section:n,onValueChange:u}),t[12]=n,t[13]=u,t[14]=d):d=t[14],d},LX=e=>{let t=(0,V.c)(23),{sectionKey:n,section:r,keyPath:i,dictionaryLocalId:a}=e,{focusedContent:o,setFocusedContentKeyPath:s}=Lw(),{renameEditedContent:c,addEditedContent:l}=Vw(),{titleInput:u,deleteButton:d}=rn(`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,x.jsx)(GO,{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":Ot(i,o?.keyPath??[]),onClick:e,children:(0,x.jsxs)(`div`,{className:`flex w-full flex-col items-start justify-between gap-3`,children:[typeof n==`string`&&(0,x.jsxs)(`div`,{className:`w-full`,children:[(0,x.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-10`,children:[(0,x.jsx)(IO,{name:`key`,"aria-label":`Key`,placeholder:u.placeholder.value,defaultValue:n,onSave:e=>p(e),variant:`invisible`}),(0,x.jsx)(iO,{label:d.label.value,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`translate-x-2`,Icon:hf,onClick:()=>{l(a,void 0,i);let e=i.slice(0,-1);s(e)}})]}),(0,x.jsxs)(`span`,{className:`ml-3 text-neutral text-sm`,children:[`( `,Mt(n),` )`]})]}),(0,x.jsx)(IX,{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},RX=e=>{let t=(0,V.c)(14),{section:n,keyPath:r,dictionaryLocalId:i}=e,{addNodeButton:a}=rn(`structure-view`),{setFocusedContentKeyPath:o}=Lw(),{addEditedContent:s}=Vw();if(!n||typeof n!=`object`){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.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:A,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,x.jsxs)(`div`,{className:`flex flex-col gap-2 overflow-y-auto`,children:[(0,x.jsx)(`ul`,{className:`mr-auto flex flex-col gap-4`,children:Object.keys(n).map(e=>(0,x.jsx)(`li`,{className:`flex w-full`,children:(0,x.jsx)(LX,{sectionKey:e,section:n?.[e],keyPath:[...r,{type:A,key:e}],dictionaryLocalId:i})},`${JSON.stringify(r)}-object-${e}`))}),(0,x.jsx)(iO,{label:a.label.value,variant:`hoverable`,size:`md`,color:`text`,Icon:df,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},zX=({section:e,keyPath:t,dictionaryLocalId:n})=>!e||typeof e!=`object`||typeof e.nodeType==`string`?(0,x.jsx)(LX,{sectionKey:`content`,section:e,keyPath:t,dictionaryLocalId:n}):(0,x.jsx)(RX,{section:e,keyPath:t,dictionaryLocalId:n}),BX=e=>{let t=(0,V.c)(3),{dictionary:n}=e,{content:r,localId:i}=n,{editedContent:a}=Hw(),o=a?.[i]?.content===void 0?r:a?.[i]?.content,s;return t[0]!==i||t[1]!==o?(s=(0,x.jsx)(LX,{section:o,keyPath:[],dictionaryLocalId:i}),t[0]=i,t[1]=o,t[2]=s):s=t[2],s},VX=({dictionary:e,onClickDictionaryList:t,isDarkMode:n,mode:r,onDelete:i,onSave:a,showReturnButton:o=!0,rightContent:s})=>{let c=Bw(),{returnToDictionaryList:l}=rn(`dictionary-field-editor`),{focusedContent:u,setFocusedContent:d}=Lw(),{setLocaleDictionary:f}=Pw(),[p,m]=(0,b.useState)(`content`);return(0,b.useEffect)(()=>{d({...u??{},dictionaryKey:e.key,dictionaryLocalId:e.localId}),f(e)},[]),(0,x.jsx)(_k,{availableLocales:c?.internationalization?.locales??[],children:(0,x.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-1 flex-col md:overflow-hidden`,children:[o&&(0,x.jsx)(iO,{onClick:t,variant:`hoverable`,className:`z-10 mr-auto mb-6 ml-5 shrink-0`,color:`text`,Icon:Kd,label:l.label.value,children:l.text}),(0,x.jsxs)(`div`,{className:`mb-22 flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,x.jsxs)(`div`,{className:`sticky top-0 z-10 flex shrink-0 gap-3 rounded-xl bg-background/20 p-3 pb-4`,children:[(0,x.jsx)(_X,{selectedChoice:p,tabs:[...r.includes(`remote`)?[(0,x.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,x.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,x.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,x.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,x.jsx)(`div`,{className:`flex w-full items-center justify-end`,children:s})]}),(0,x.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,x.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-6`,children:[r.includes(`remote`)&&p===`details`&&(0,x.jsx)(kX,{dictionary:e,mode:r,isDarkMode:n}),p===`structure`&&(0,x.jsx)(BX,{dictionary:e}),p===`content`&&(0,x.jsx)(UL,{dictionary:e,isDarkMode:n}),p===`json`&&(0,x.jsx)(NX,{dictionary:e,isDarkMode:n})]})})]}),(0,x.jsx)(`div`,{className:`absolute bottom-3 z-20 w-full p-2`,children:(0,x.jsxs)(GO,{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,x.jsx)(mX,{text:e.id,className:`text-nowrap text-neutral text-sm`,size:9,children:e.id}),(0,x.jsx)(fX,{dictionary:e,mode:r,onDelete:()=>{d(null),i?.()},onSave:a})]})})]})})},HX=({children:e,className:t,identifier:n,...r})=>(0,x.jsx)(`div`,{className:W(`group/popover relative flex cursor-pointer`,t),id:`unrollable-panel-button-${n}`,"aria-haspopup":!0,...r,children:e}),UX=({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,x.jsx)(GO,{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});HX.Detail=UX;var WX=e=>(0,x.jsx)(HX,{...e}),GX=({xAlign:e=`start`,yAlign:t=`below`,...n})=>{let r=(0,b.useRef)(null),[i,a]=(0,b.useState)(e),[o,s]=(0,b.useState)(t),[c,l]=(0,b.useState)(void 0);return(0,b.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,x.jsx)(UX,{...n,xAlign:i,yAlign:o,ref:r,style:{...n.style,maxWidth:c?`${c}px`:void 0}})},KX=WX;KX.Detail=GX;var qX=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()})}},JX=()=>{let e=(0,V.c)(2),t=(0,b.useSyncExternalStore)(qX.subscribe,qX.getSnapshot,YX),n;return e[0]===t?n=e[1]:(n={open:qX.open,close:qX.close,set:qX.set,isOpen:e=>!!t[e]},e[0]=t,e[1]=n),n};function YX(){return{}}var XX=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}},ZX=()=>{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)},QX=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/iP(?:hone|ad|od)/.test(e)},$X=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/Macintosh|MacIntel|Mac OS X/.test(e)},eZ=e=>{if(!(typeof window>`u`))return(window?.innerWidth??0)<=e},tZ=(e=`md`)=>{let t=XX(e),n=ZX(),r=eZ(t);return{isMobileScreen:r,isMobileUserAgent:n,isMobile:r??n,isIOS:QX(),isMac:$X()}},nZ=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,b.useState)(r),o,s;return t[1]===n?(o=t[2],s=t[3]):(o=()=>{a(tZ(n));let e=()=>{a(tZ(n))};return window.addEventListener(`resize`,e,{passive:!0}),()=>window.removeEventListener(`resize`,e)},s=[n],t[1]=n,t[2]=o,t[3]=s),(0,b.useEffect)(o,s),i},rZ=e=>e.split(` + `).map(e=>e.trim()),iZ=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,aZ=(e,t)=>{let n=t.map(iZ),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(iZ(e)));if(!i)return!1;let a=iZ(i);return a.startsWith(`Arrow`)?e.key===a:e.key.toLowerCase()===a.toLowerCase()},oZ=e=>({ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`})[e]||e,sZ=(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},cZ=({shortcut:e,onTriggered:t,display:n=!0,disabled:r=!1,className:i,size:a=`md`})=>{let{isMac:o}=nZ(),s=rZ(sZ(e,o??!1)),[c,l]=(0,b.useState)(new Set);if((0,b.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(oZ(a))):c.add(a.toUpperCase()),l(c),!r&&t&&aZ(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=iZ(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,x.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=oZ(t);return(0,x.jsxs)(`span`,{className:`inline-flex items-center`,children:[n>0&&(0,x.jsx)(`span`,{className:`text-neutral/50`,children:`+`}),(0,x.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)})})},lZ=({children:e,isHidden:t,minWidth:n=0,align:r=`left`,isDisabled:i=!1,className:a,...o})=>{let s=t&&!i;return(0,x.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,x.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},dZ=({title:e,identifier:t,children:n,header:r,footer:i,closeOnOutsideClick:a=!0,backButton:o,isOpen:s,onClose:c,container:l})=>{let u=rn(`right-drawer`),{isMobile:d}=nZ(`md`),f=(0,b.useRef)(null),p=(0,b.useRef)(null),m=RY(l),{open:h,close:g,isOpen:_}=JX(),v=_(t),y=v;UY({disableScroll:y,key:t?`right_drawer_${t}`:`right_drawer`}),(0,b.useEffect)(()=>{let e=e=>{try{if(!f.current)return;let n=y&&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)},[y,g,c,a,t]);let S=(0,b.useRef)(c);return(0,b.useEffect)(()=>{S.current=c},[c]),(0,b.useEffect)(()=>{s!==void 0&&s!==v&&(s?h(t):(g(t),S.current?.()))},[s,v,t,h,g]),m?(0,G.createPortal)((0,x.jsx)(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:(0,x.jsx)(lZ,{isHidden:!y,align:`right`,children:(0,x.jsxs)(GO,{className:`relative flex h-screen w-screen flex-col text-text md:w-100`,ref:f,roundedSize:`none`,children:[(0,x.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[(0,x.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,x.jsx)(`div`,{children:o&&(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,label:o.text??u.goBack.value,onClick:o.onBack,Icon:Xd,children:o?.text})}),(0,x.jsx)(`div`,{children:(0,x.jsxs)(KX,{identifier:`close-drawer`,children:[(0,x.jsx)(iO,{variant:`hoverable`,color:`text`,label:`Close`,className:`ml-auto`,onClick:()=>{g(t),c?.()},Icon:_f,size:`icon-md`}),(0,x.jsx)(KX.Detail,{identifier:`close-drawer`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[(0,x.jsx)(`span`,{className:`whitespace-nowrap text-neutral text-xs`,children:u.closeDrawer}),(0,x.jsx)(cZ,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{g(t),c?.()}})]})})]})})]}),e&&(0,x.jsx)(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:e}),r]}),(0,x.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:(0,x.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,x.jsx)(`div`,{className:`shrink-0`,children:i})]})})}),m):(0,x.jsx)(x.Fragment,{})},fZ=Fd(`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`}}),pZ=({children:e,color:t,roundedSize:n,size:r,border:i,background:a,className:o,...s})=>(0,x.jsx)(`div`,{className:fZ({color:t,roundedSize:n,size:r,border:i,background:a,className:o}),...s,children:e}),mZ=`dictionaryList`,hZ=e=>`dictionary_edition_${e}`,gZ=e=>{let t=(0,V.c)(23),n;t[0]===e?n=t[1]:(n=hZ(e),t[0]=e,t[1]=n);let r=n,{isOpen:i,open:a,close:o}=JX(),{getEditedContentValue:s}=Vw(),{focusedContent:c,setFocusedContent:l}=Lw(),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,b.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},_Z=e=>{let t=(0,V.c)(77),{dictionaryKey:n,isDarkMode:r}=e,{backButtonText:i,openDictionaryEditor:a,modalTitle:o,noDictionaryFocused:s,focusedDictionaryNotFound:c}=nn(xC),l;t[0]===n?l=t[1]:(l=hZ(n),t[0]=n,t[1]=l);let u=l,{focusedContent:d,close:f}=gZ(n),{setFocusedContent:p}=Lw(),{open:m}=JX(),h;t[2]===m?h=t[3]:(h=()=>m(mZ),t[2]=m,t[3]=h);let g=h,{data:_}=XD(),v;t[4]!==f||t[5]!==g||t[6]!==p?(v=()=>{f(),p(null),g()},t[4]=f,t[5]=g,t[6]=p,t[7]=v):v=t[7];let y=v,[S,C]=(0,b.useState)(!1),w;t[8]===y?w=t[9]:(w=()=>{C(!1),y()},t[8]=y,t[9]=w);let T=w;if(!d?.dictionaryKey){let e;return t[10]===s?e=t[11]:(e=(0,x.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]!==y||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,x.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:c}),t[31]=c,t[32]=e),A=e;break bb0}E=dZ,F=u,t[33]!==i.value||t[34]!==y?(O={onBack:y,text:i.value},t[33]=i.value,t[34]=y,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,x.jsx)(iO,{variant:`hoverable`,color:`text`,size:`icon-md`,IconRight:lf,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,x.jsx)(KX.Detail,{identifier:`open-dictionary-editor`,children:(0,x.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,x.jsxs)(KX,{identifier:`open-dictionary-editor`,children:[n,r]}),t[44]=n,t[45]=r,t[46]=o):o=t[46],P=(0,x.jsxs)(`header`,{className:`mb-5 flex w-full px-3`,children:[(0,x.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,x.jsx)(pZ,{color:`text`,roundedSize:`full`,size:`xs`,children:D.key}),N=D.filePath&&(0,x.jsx)(pZ,{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]=y,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,x.jsx)(pZ,{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,x.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,x.jsxs)(x.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]!==y?(ne=(0,x.jsx)(fX,{dictionary:D,mode:te,className:`mb-4 flex-col px-3`,onDelete:y}),t[58]=D,t[59]=y,t[60]=ne):ne=t[60];let R;t[61]!==D||t[62]!==S||t[63]!==d||t[64]!==y||t[65]!==r||t[66]!==o||t[67]!==T?(R=d&&(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)(dX,{isOpen:S,onClose:()=>C(!1),hasCloseButton:!0,title:o,size:`xl`,transparency:`lg`,className:`h-full`,children:(0,x.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-1 flex-col px-3 pt-5`,children:(0,x.jsx)(VX,{dictionary:D,onClickDictionaryList:T,isDarkMode:r,mode:[`local`,`remote`],onDelete:()=>{C(!1),y()},onSave:()=>{C(!1)}})})}),(0,x.jsx)(UO,{dictionary:D})]}),t[61]=D,t[62]=S,t[63]=d,t[64]=y,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,x.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},vZ=e=>{let t=(0,V.c)(4),{isDarkMode:n}=e,{focusedContent:r}=Lw(),i=r?.dictionaryKey;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(x.Fragment,{}),t[0]=e):e=t[0],e}let a;return t[1]!==i||t[2]!==n?(a=(0,x.jsx)(_Z,{dictionaryKey:i,isDarkMode:n}),t[1]=i,t[2]=n,t[3]=a):a=t[3],a},yZ={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`},bZ=e=>{let{minChars:t=3,debounceMs:n=300,trim:r=!0,defaultValue:i,onSearch:a,onClear:o}=e??{},s=(0,b.useRef)(``),c=(0,b.useRef)(null),[l,u]=(0,b.useState)(i??``),d=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,b.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}},xZ=({className:e,...t})=>(0,x.jsxs)(`div`,{className:`relative flex w-full items-center gap-1`,children:[(0,x.jsx)(mf,{className:`absolute left-2 size-4`}),(0,x.jsx)(SO,{...t,type:`search`,className:W(`pl-8`,e)})]}),SZ=()=>{let{drawerTitle:e,buttonLabel:t}=nn(yZ),{set:n}=JX(),{localeDictionaries:r}=Nw(),{editedContent:i}=Hw(),{setFocusedContent:a}=Lw(),{setSearch:o,search:s}=bZ(),c=(0,b.useMemo)(()=>new AL(Object.values(r),{keys:[`key`,`title`,`filePath`,`description`,`tags`],threshold:.3,includeScore:!0}),[r]),l=(0,b.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({[mZ]:!1,[hZ(e.key)]:!0})},d=e=>Object.keys(i??{}).includes(e);return(0,x.jsxs)(dZ,{title:e.label.value,identifier:mZ,children:[(0,x.jsx)(`div`,{className:`p-3 pb-4`,children:(0,x.jsx)(xZ,{placeholder:`Search dictionaries`,onChange:e=>o(e.target.value),type:`search`})}),(0,x.jsx)(`ul`,{className:`flex flex-col gap-1`,children:l.map(e=>(0,x.jsx)(`li`,{className:`w-full`,children:(0,x.jsx)(iO,{label:t.label({dictionaryLocalId:e.localId}).value,onClick:()=>u(e),variant:`hoverable`,color:`text`,IconRight:Zd,size:`md`,isFullWidth:!0,Icon:d(e.localId)?uf:void 0,children:(0,x.jsx)(`div`,{className:`flex items-center gap-2 py-1`,children:(0,x.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1`,children:[(0,x.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-1.5`,children:[(0,x.jsx)(pZ,{color:`text`,roundedSize:`full`,size:`xs`,children:e.key}),e.filePath&&(0,x.jsx)(pZ,{color:`blue`,roundedSize:`full`,size:`xs`,children:e.filePath.split(`/`).pop()}),e.id&&(0,x.jsx)(pZ,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`})]}),(0,x.jsx)(`span`,{children:(e.title??``).length>0?e.title:e.key})]})})})},e.localId))})]})},CZ={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`},wZ=()=>{let e=(0,V.c)(8),{message:t}=nn(CZ),[n]=jw(VC.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,x.jsx)(`div`,{className:i,children:a}),e[5]=i,e[6]=a,e[7]=o):o=e[7],o},TZ=e=>{let t=(0,V.c)(5),{children:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,x.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:(0,x.jsx)(wZ,{})}),i=(0,x.jsx)(vZ,{}),a=(0,x.jsx)(SZ,{}),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,x.jsxs)(`div`,{className:`relative size-full bg-card p-3`,children:[n,r,i,a]}),t[3]=n,t[4]=o),o},EZ=()=>{let e=(0,V.c)(2),[t,n]=(0,b.useState)(),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{fetch(`/api/config`).then(DZ).then(e=>n(e.data))},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,b.useEffect)(r,i),t};function DZ(e){return e.json()}var OZ=e=>{let t=(0,V.c)(11),{children:n,iframeRef:r}=e,i=EZ(),a=i?.editor.applicationURL;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(tO,{}),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,x.jsx)(Rw,{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},kZ={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`},AZ=()=>{let e=(0,V.c)(9),{editedContent:t,setEditedContentState:n}=Hw(),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,b.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,b.useEffect)(s,c),i},jZ={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`},MZ=()=>{let e=(0,V.c)(11),{title:t,description:n,documentationLink:r}=nn(jZ),i;e[0]===t?i=e[1]:(i=(0,x.jsx)(iX,{className:`mb-8`,children:t}),e[0]=t,e[1]=i);let a;e[2]===n?a=e[3]:(a=(0,x.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,x.jsx)(XF,{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,x.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},NZ=e=>{let t=(0,V.c)(23),{iframeRef:n,applicationPath:r}=e,i=nn(kZ),{editor:a}=Bw()??{},{enabled:o}=Uw(),s=Ww();AZ(),Kw();let[c,l]=(0,b.useState)(!0),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={receive:!0,emit:!1},t[0]=u):u=t[0];let[d]=Mw(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,b.useEffect)(f,p),!a?.applicationURL){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,x.jsx)(GO,{className:`max-w-xl`,padding:`xl`,roundedSize:`2xl`,children:(0,x.jsx)(MZ,{})}),t[4]=e):e=t[4],e}let m;t[5]===c?m=t[6]:(m=(0,x.jsx)(tO,{isLoading:c}),t[5]=c,t[6]=m);let h=`${a.applicationURL}${r}`,g=i.intlayerApplication.value,_=c&&`hidden`,v;t[7]===_?v=t[8]:(v=W(`size-full`,_),t[7]=_,t[8]=v);let y;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(y=()=>{l(!1)},t[9]=y):y=t[9];let S;t[10]!==i.intlayerApplication.value||t[11]!==n||t[12]!==h||t[13]!==v?(S=(0,x.jsx)(`iframe`,{src:h,title:g,sandbox:`allow-scripts allow-same-origin`,className:v,ref:n,onLoad:y}),t[10]=i.intlayerApplication.value,t[11]=n,t[12]=h,t[13]=v,t[14]=S):S=t[14];let C;t[15]!==i.enableEditor||t[16]!==o||t[17]!==s?(C=!o&&(0,x.jsx)(`div`,{className:`fixed right-4 bottom-4`,children:(0,x.jsx)(iO,{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,x.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},PZ=()=>{let e=(0,V.c)(2),t=(0,b.useRef)(null),n=Or(),r;return e[0]===n.pathname?r=e[1]:(r=(0,x.jsx)(OZ,{iframeRef:t,children:(0,x.jsx)(Gt,{disableEditor:!0,children:(0,x.jsx)(TZ,{children:(0,x.jsx)(NZ,{iframeRef:t,applicationPath:n.pathname})})})}),e[0]=n.pathname,e[1]=r),r};(0,Ad.createRoot)(document.getElementById(`root`)).render((0,x.jsx)(b.StrictMode,{children:(0,x.jsx)(()=>{let e=(0,V.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,x.jsx)(bC,{children:(0,x.jsx)(yC,{children:(0,x.jsx)(PZ,{})})}),e[0]=t):t=e[0],t},{})}));export{aO as A,kl as B,Yj as C,Jj as D,Kj as E,Yd as F,y as G,xa as H,Jd as I,p as K,Gd as L,tO as M,KD as N,mk as O,hf as P,Fd as R,qj as S,Wj as T,rn as U,W as V,lt as W,Y as _,nX as a,Uj as b,aX as c,lV as d,eV as f,XF as g,PB as h,dX as i,iO as j,GO as k,oX as l,HB as m,AX as n,rX as o,BB as p,l as q,_X as r,iX as s,KX as t,sX as u,Xj as v,Zj as w,$j as x,Gj as y,Pd as z};
|