var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;li[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=null)throw Error(`takes an object of state variables to update or a function which returns an object of state variables.`);this.updater.enqueueSetState(this,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function E(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function D(e,t){return E(e.type,t,e.props)}function O(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function k(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var A=/\/+/g;function ee(e,t){return typeof e==`object`&&e&&e.key!=null?k(``+e.key):t.toString(36)}function j(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function M(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,M(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+ee(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(A,`$&/`)+`/`),M(o,r,i,``,function(e){return e})):o!=null&&(O(o)&&(o=D(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(A,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0>>1,a=e[r];if(0>>1;ri(c,n))li(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(li(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&&ee(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-Tt&&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&&ee(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 ee(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||125o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,ee(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}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(e){var t=`https://react.dev/errors/`+e;if(1{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=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(e){var t=`https://react.dev/errors/`+e;if(1ae||(e.current=ie[ae],ie[ae]=null,ae--)}function I(e,t){ae++,ie[ae]=e.current,e.current=t}var se=oe(null),ce=oe(null),le=oe(null),ue=oe(null);function de(e,t){switch(I(le,t),I(ce,e),I(se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}F(se),I(se,e)}function fe(){F(se),F(ce),F(le)}function pe(e){e.memoizedState!==null&&I(ue,e);var t=se.current,n=Ud(t,e.type);t!==n&&(I(ce,e),I(se,n))}function me(e){ce.current===e&&(F(se),F(ce)),ue.current===e&&(F(ue),$f._currentValue=re)}var he,ge;function _e(e){if(he===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);he=t&&t[1]||``,ge=-1)`:-1i||c[r]!==l[i]){var u=` `+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(``)&&(u=u.replace(``,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{ve=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?_e(n):``}function be(e,t){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e(`Lazy`);case 13:return e.child!==t&&t!==null?_e(`Suspense Fallback`):_e(`Suspense`);case 19:return _e(`SuspenseList`);case 0:case 15:return ye(e.type,!1);case 11:return ye(e.type.render,!1);case 1:return ye(e.type,!0);case 31:return _e(`Activity`);default:return``}}function xe(e){try{var t=``,n=null;do t+=be(e,n),n=e,e=e.return;while(e);return t}catch(e){return` Error generating stack: `+e.message+` `+e.stack}}var Se=Object.prototype.hasOwnProperty,Ce=t.unstable_scheduleCallback,we=t.unstable_cancelCallback,Te=t.unstable_shouldYield,Ee=t.unstable_requestPaint,De=t.unstable_now,Oe=t.unstable_getCurrentPriorityLevel,ke=t.unstable_ImmediatePriority,Ae=t.unstable_UserBlockingPriority,je=t.unstable_NormalPriority,Me=t.unstable_LowPriority,Ne=t.unstable_IdlePriority,Pe=t.log,Fe=t.unstable_setDisableYieldValue,Ie=null,Le=null;function Re(e){if(typeof Pe==`function`&&Fe(e),Le&&typeof Le.setStrictMode==`function`)try{Le.setStrictMode(Ie,e)}catch{}}var ze=Math.clz32?Math.clz32:He,Be=Math.log,Ve=Math.LN2;function He(e){return e>>>=0,e===0?32:31-(Be(e)/Ve|0)|0}var Ue=256,We=262144,Ge=4194304;function Ke(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function qe(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Ke(n))):i=Ke(o):i=Ke(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Ke(n))):i=Ke(o)):i=Ke(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Je(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ye(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Xe(){var e=Ge;return Ge<<=1,!(Ge&62914560)&&(Ge=4194304),e}function Ze(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Qe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function $e(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0`u`||window.document===void 0||window.document.createElement===void 0),fn=!1;if(dn)try{var pn={};Object.defineProperty(pn,"passive",{get:function(){fn=!0}}),window.addEventListener(`test`,pn,pn),window.removeEventListener(`test`,pn,pn)}catch{fn=!1}var mn=null,hn=null,gn=null;function _n(){if(gn)return gn;var e,t=hn,n=t.length,r,i=`value`in mn?mn.value:mn.textContent,a=i.length;for(e=0;e=Jn),Zn=` `,Qn=!1;function $n(e,t){switch(e){case`keyup`:return Kn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function er(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var tr=!1;function nr(e,t){switch(e){case`compositionend`:return er(t);case`keypress`:return t.which===32?(Qn=!0,Zn):null;case`textInput`:return e=t.data,e===Zn&&Qn?null:e;default:return null}}function rr(e,t){if(tr)return e===`compositionend`||!qn&&$n(e,t)?(e=_n(),gn=hn=mn=null,tr=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Tr(n)}}function Dr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Dr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Or(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Rt(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Rt(e.document)}return t}function kr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Ar=dn&&`documentMode`in document&&11>=document.documentMode,jr=null,Mr=null,Nr=null,Pr=!1;function Fr(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Pr||jr==null||jr!==Rt(r)||(r=jr,`selectionStart`in r&&kr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Nr&&wr(Nr,r)||(Nr=r,r=Ed(Mr,`onSelect`),0>=o,i-=o,Di=1<<32-ze(t)+i|n<h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),R&&ki(i,h),l;if(d===null){for(;hg?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),R&&ki(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return R&&ki(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),R&&ki(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===O&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=mi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=pi(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=_i(o,e.mode,c),c.return=e,e=c}return s(e);case O:return o=Oa(o),b(e,r,o,c)}if(ne(o))return h(e,r,o,c);if(j(o)){if(l=j(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=hi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=li(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,J&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=oi(e),ai(e,null,n),t}return ni(e,r,t,n),oi(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(X&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),Wl|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;ea?a:8;var o=N.T,s={};N.T=s,W(e,!1,t,n);try{var c=i(),l=N.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Ns(e,t,ga(c,r),fu(e)):Ns(e,t,r,fu(e))}catch(n){Ns(e,t,{then:function(){},status:`rejected`,reason:n},fu())}finally{P.p=a,o!==null&&s.types!==null&&(o.types=s.types),N.T=o}}function ws(){}function Ts(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Es(e).queue;Cs(e,a,t,re,n===null?ws:function(){return U(e),n(r)})}function Es(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:re,baseState:re,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:re},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Lo,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function U(e){var t=Es(e);t.next===null&&(t=e.alternate.memoizedState),Ns(e,t.next.queue,{},fu())}function Ds(){return ta($f)}function Os(){return Mo().memoizedState}function ks(){return Mo().memoizedState}function As(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=fu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(mu(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function js(e,t,n){var r=fu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Ps(e)?Fs(t,n):(n=ri(e,t,n,r),n!==null&&(mu(n,e,r),Is(n,t,r)))}function Ms(e,t,n){Ns(e,t,n,fu())}function Ns(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ps(e))Fs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Cr(s,o))return ni(e,t,i,0),Ll===null&&ti(),!1}catch{}if(n=ri(e,t,i,r),n!==null)return mu(n,e,r),Is(n,t,r),!0}return!1}function W(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Ps(e)){if(t)throw Error(i(479))}else t=ri(e,n,r,2),t!==null&&mu(t,e,2)}function Ps(e){var t=e.alternate;return e===V||t!==null&&t===V}function Fs(e,t){go=ho=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Is(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,tt(e,n)}}var Ls={readContext:ta,use:Fo,useCallback:So,useContext:So,useEffect:So,useImperativeHandle:So,useLayoutEffect:So,useInsertionEffect:So,useMemo:So,useReducer:So,useRef:So,useState:So,useDebugValue:So,useDeferredValue:So,useTransition:So,useSyncExternalStore:So,useId:So,useHostTransitionStatus:So,useFormState:So,useActionState:So,useOptimistic:So,useMemoCache:So,useCacheRefresh:So};Ls.useEffectEvent=So;var Rs={readContext:ta,use:Fo,useCallback:function(e,t){return jo().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:ds,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),ls(4194308,4,gs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return ls(4194308,4,e,t)},useInsertionEffect:function(e,t){ls(4,2,e,t)},useMemo:function(e,t){var n=jo();t=t===void 0?null:t;var r=e();if(_o){Re(!0);try{e()}finally{Re(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=jo();if(n!==void 0){var i=n(t);if(_o){Re(!0);try{n(t)}finally{Re(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=js.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=jo();return e={current:e},t.memoizedState=e},useState:function(e){e=qo(e);var t=e.queue,n=Ms.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:vs,useDeferredValue:function(e,t){return xs(jo(),e,t)},useTransition:function(){var e=qo(!1);return e=Cs.bind(null,V,e.queue,!0,!1),jo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,a=jo();if(R){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),Ll===null)throw Error(i(349));X&127||Ho(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,ds(Wo.bind(null,r,o,e),[e]),r.flags|=2048,ss(9,{destroy:void 0},Uo.bind(null,r,o,n,t),null),n},useId:function(){var e=jo(),t=Ll.identifierPrefix;if(R){var n=Oi,r=Di;n=(r&~(1<<32-ze(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=vo++,0<\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[ct]=t,o[lt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ac(t)}}return Pc(t),jc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ac(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=le.current,Hi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Pi,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[ct]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||zi(t,!0)}else e=Vd(e).createTextNode(r),e[ct]=t,t.stateNode=e}return Pc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Hi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[ct]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),e=!1}else n=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(co(t),t):(co(t),null);if(t.flags&128)throw Error(i(558))}return Pc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Hi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[ct]=t}else Ui(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pc(t),a=!1}else a=Wi(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(co(t),t):(co(t),null)}return co(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Nc(t,t.updateQueue),Pc(t),null);case 4:return fe(),e===null&&Sd(t.stateNode.containerInfo),Pc(t),null;case 10:return Xi(t.type),Pc(t),null;case 19:if(F(lo),r=t.memoizedState,r===null)return Pc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)q(r,!1);else{if(Ul!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=uo(e),o!==null){for(t.flags|=128,q(r,!1),e=o.updateQueue,t.updateQueue=e,Nc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)fi(n,e),n=n.sibling;return I(lo,lo.current&1|2),R&&ki(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&De()>eu&&(t.flags|=128,a=!0,q(r,!1),t.lanes=4194304)}}else{if(!a){if(e=uo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,Nc(t,e),q(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!R)return Pc(t),null}else 2*De()-r.renderingStartTime>eu&&n!==536870912&&(t.flags|=128,a=!0,q(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Pc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=De(),e.sibling=null,n=lo.current,I(lo,a?n&1|2:n&1),R&&ki(t,r.treeForkCount),e);case 22:case 23:return co(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Pc(t),t.subtreeFlags&6&&(t.flags|=8192)):Pc(t),n=t.updateQueue,n!==null&&Nc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&F(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Xi(sa),Pc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Ic(e,t){switch(Mi(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Xi(sa),fe(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return me(t),null;case 31:if(t.memoizedState!==null){if(co(t),t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(co(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return F(lo),null;case 4:return fe(),null;case 10:return Xi(t.type),null;case 22:case 23:return co(t),no(),e!==null&&F(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Xi(sa),null;case 25:return null;default:return null}}function Lc(e,t){switch(Mi(t),t.tag){case 3:Xi(sa),fe();break;case 26:case 27:case 5:me(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&co(t);break;case 13:co(t);break;case 19:F(lo);break;case 10:Xi(t.type);break;case 22:case 23:co(t),no(),e!==null&&F(va);break;case 24:Xi(sa)}}function Rc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){Wu(t,t.return,e)}}function zc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){Wu(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){Wu(t,t.return,e)}}function Bc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){Wu(e,e.return,t)}}}function Vc(e,t,n){n.props=Gs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){Wu(e,t,n)}}function Hc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){Wu(e,t,n)}}function Uc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){Wu(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){Wu(e,t,n)}else n.current=null}}function Wc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){Wu(e,e.return,t)}}function Gc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[lt]=t}catch(t){Wu(e,e.return,t)}}function Kc(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function qc(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Kc(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Jc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=tn));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Jc(e,t,n),e=e.sibling;e!==null;)Jc(e,t,n),e=e.sibling}function Yc(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Yc(e,t,n),e=e.sibling;e!==null;)Yc(e,t,n),e=e.sibling}function Xc(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[ct]=e,t[lt]=n}catch(t){Wu(e,e.return,t)}}var Zc=!1,Qc=!1,$c=!1,el=typeof WeakSet==`function`?WeakSet:Set,tl=null;function nl(e,t){if(e=e.containerInfo,zd=cp,e=Or(e),kr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},cp=!1,tl=t;tl!==null;)if(t=tl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,tl=e;else for(;tl!==null;){switch(t=tl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n title`))),Fd(o,r,n),o[ct]=e,xt(o),r=o;break a;case`link`:var s=Hf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;cg&&(o=g,g=h,h=o);var _=Er(s,h),v=Er(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;sn?32:n,N.T=null,n=cu,cu=null;var o=iu,s=ou;if(ru=0,au=iu=null,ou=0,J&6)throw Error(i(331));var c=J;if(J|=4,Ml(o.current),wl(o,o.current,s,n),J=c,id(0,!1),Le&&typeof Le.onPostCommitFiberRoot==`function`)try{Le.onPostCommitFiberRoot(Ie,o)}catch{}return!0}finally{P.p=a,N.T=r,Bu(e,t)}}function Uu(e,t,n){t=yi(n,t),t=Zs(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(Qe(e,2),rd(e))}function Wu(e,t,n){if(e.tag===3)Uu(e,e,n);else for(;t!==null;){if(t.tag===3){Uu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(nu===null||!nu.has(r))){e=yi(n,e),n=G(2),r=Wa(t,n,2),r!==null&&(Qs(n,r,t,e),Qe(r,2),rd(r));break}}t=t.return}}function Gu(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Il;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Vl=!0,i.add(n),e=Ku.bind(null,e,t,n),t.then(e,e))}function Ku(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,Ll===e&&(X&n)===n&&(Ul===4||Ul===3&&(X&62914560)===X&&300>De()-Ql?!(J&2)&&xu(e,0):Kl|=n,Jl===X&&(Jl=0)),rd(e)}function qu(e,t){t===0&&(t=Xe()),e=ii(e,t),e!==null&&(Qe(e,t),rd(e))}function Ju(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qu(e,n)}function Yu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),qu(e,n)}function Xu(e,t){return Ce(e,t)}var Zu=null,Qu=null,$u=!1,ed=!1,td=!1,nd=0;function rd(e){e!==Qu&&e.next===null&&(Qu===null?Zu=Qu=e:Qu=Qu.next=e),ed=!0,$u||($u=!0,ud())}function id(e,t){if(!td&&ed){td=!0;do for(var n=!1,r=Zu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-ze(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=X,a=qe(r,r===Ll?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Je(r,a)||(n=!0,ld(r,a))}r=r.next}while(n);td=!1}}function ad(){od()}function od(){ed=$u=!1;var e=0;nd!==0&&Kd()&&(e=nd);for(var t=De(),n=null,r=Zu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Zu=i:n.next=i,i===null&&(Qu=n)):(n=r,(e!==0||a&3)&&(ed=!0)),r=i}ru!==0&&ru!==5||id(e,!1),nd!==0&&(nd=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c`u`?null:document;function Sf(e,t,n){var r=xf;if(r&&typeof t==`string`&&t){var i=Bt(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Cf(e){vf.D(e),Sf(`dns-prefetch`,e,null)}function wf(e,t){vf.C(e,t),Sf(`preconnect`,e,t)}function Tf(e,t,n){vf.L(e,t,n);var r=xf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Bt(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Bt(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Bt(n.imageSizes)+`"]`)):i+=`[href="`+Bt(e)+`"]`;var a=i;switch(t){case`style`:a=jf(e);break;case`script`:a=Ff(e)}hf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Mf(a))||t===`script`&&r.querySelector(If(a))||(t=r.createElement(`link`),Fd(t,`link`,e),xt(t),r.head.appendChild(t)))}}function Ef(e,t){vf.m(e,t);var n=xf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Bt(r)+`"][href="`+Bt(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Ff(e)}if(!hf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(If(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),xt(r),n.head.appendChild(r)}}}function Df(e,t,n){vf.S(e,t,n);var r=xf;if(r&&e){var i=bt(r).hoistableStyles,a=jf(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Mf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&zf(e,n);var c=o=r.createElement(`link`);xt(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Rf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Of(e,t){vf.X(e,t);var n=xf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=h({src:e,async:!0},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t){vf.M(e,t);var n=xf;if(n&&e){var r=bt(n).hoistableScripts,i=Ff(e),a=r.get(i);a||(a=n.querySelector(If(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&Bf(e,t),a=n.createElement(`script`),xt(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Af(e,t,n,r){var a=(a=le.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=jf(n.href),n=bt(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=jf(n.href);var o=bt(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(Mf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Pf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Ff(n),n=bt(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function jf(e){return`href="`+Bt(e)+`"`}function Mf(e){return`link[rel="stylesheet"][`+e+`]`}function Nf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Pf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),xt(t),e.head.appendChild(t))}function Ff(e){return`[src="`+Bt(e)+`"]`}function If(e){return`script[async]`+e}function Lf(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Bt(n.href)+`"]`);if(r)return t.instance=r,xt(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),xt(r),Fd(r,`style`,a),Rf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=jf(n.href);var o=e.querySelector(Mf(a));if(o)return t.state.loading|=4,t.instance=o,xt(o),o;r=Nf(n),(a=hf.get(a))&&zf(r,a),o=(e.ownerDocument||e).createElement(`link`),xt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Rf(o,n.precedence,e),t.instance=o;case`script`:return o=Ff(n.src),(a=e.querySelector(If(o)))?(t.instance=a,xt(a),a):(r=n,(a=hf.get(o))&&(r=h({},n),Bf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),xt(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Rf(r,n.precedence,e));return t.instance}function Rf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o title`):null)}function Wf(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function Gf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Kf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=jf(r.href),a=t.querySelector(Mf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Yf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,xt(a);return}a=t.ownerDocument||t,r=Nf(r),(i=hf.get(i))&&zf(r,i),a=a.createElement(`link`),xt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Yf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var qf=0;function Jf(e,t){return e.stylesheets&&e.count===0&&Zf(e,e.stylesheets),0qf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Yf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xf=null;function Zf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xf=new Map,t.forEach(Qf,e),Xf=null,Yf.call(e))}function Qf(e,t){if(!(t.state.loading&4)){var n=Xf.get(e);if(n)var r=n.get(null);else{n=new Map,Xf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a{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=h()})),_=c(u(),1),v=typeof window<`u`?_.useLayoutEffect:_.useEffect;function y(e){let t=_.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function b(e,t,n={},r={}){_.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!=`function`)return;let i=new IntersectionObserver(([e])=>{t(e)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,r.disabled,e])}function x(e){let t=_.useRef(null);return _.useImperativeHandle(e,()=>t.current,[]),t}function S(e){return e[e.length-1]}function C(e){return typeof e==`function`}function w(e,t){return C(e)?e(t):e}var T=Object.prototype.hasOwnProperty,E=Object.prototype.propertyIsEnumerable;function D(e){for(let t in e)if(T.call(e,t))return!0;return!1}var O=()=>Object.create(null),k=(e,t)=>A(e,t,O);function A(e,t,n=()=>({}),r=0){if(e===t)return e;if(r>500)return t;let i=t,a=te(e)&&te(i);if(!a&&!(j(e)&&j(i)))return i;let o=a?e:ee(e);if(!o)return i;let s=a?i:ee(i);if(!s)return i;let c=o.length,l=s.length,u=a?Array(l):n(),d=0;for(let t=0;ti||!ne(e[o],t[o],n)))return!1;return i===a}return!1}function N(e){let t,n,r=new Promise((e,r)=>{t=e,n=r});return r.status=`pending`,r.resolve=n=>{r.status=`resolved`,r.value=n,t(n),e?.(n)},r.reject=e=>{r.status=`rejected`,n(e)},r}function P(e){return!!(e&&typeof e==`object`&&typeof e.then==`function`)}var re=/[\x00-\x1f\x7f"<>`{}]/g;function ie(e){return e.replace(re,e=>`%`+e.charCodeAt(0).toString(16).toUpperCase().padStart(2,`0`))}function ae(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,e=>{try{return decodeURI(e)}catch{return e}})}return ie(t)}var oe=[`http:`,`https:`,`mailto:`,`tel:`];function F(e,t){if(!e)return!1;try{let n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function I(e){if(!e||!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith(`//`))return{path:e,handledProtocolRelativeURL:!1};let t=/%25|%5C/gi,n=0,r=``,i;for(;(i=t.exec(e))!==null;)r+=ae(e.slice(n,i.index))+i[0],n=t.lastIndex;r+=ae(n?e.slice(n):e);let a=!1;return r.startsWith(`//`)&&(a=!0,r=`/`+r.replace(/^\/+/,``)),{path:r,handledProtocolRelativeURL:a}}function se(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function ce(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n{e.next&&(e.prev?(e.prev.next=e.next,e.next.prev=e.prev,e.next=void 0,r&&(r.next=e,e.prev=r)):(e.next.prev=void 0,n=e.next,e.next=void 0,r&&(e.prev=r,r.next=e)),r=e)};return{get(e){let n=t.get(e);if(n)return i(n),n.value},set(a,o){if(t.size>=e&&n){let e=n;t.delete(e.key),e.next&&(n=e.next,e.next.prev=void 0),e===r&&(r=void 0)}let s=t.get(a);if(s)s.value=o,i(s);else{let e={key:a,value:o,prev:r};r&&(r.next=e),r=e,n||=e,t.set(a,e)}},clear(){t.clear(),n=void 0,r=void 0}}}var de=4,fe=5;function pe(e){let t=e.indexOf(`{`);if(t===-1)return null;let n=e.indexOf(`}`,t);return n===-1||t+1>=e.length?null:[t,n]}function me(e,t,n=new Uint16Array(6)){let r=e.indexOf(`/`,t),i=r===-1?e.length:r,a=e.substring(t,i);if(!a||!a.includes(`$`))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(a===`$`){let r=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=r,n[4]=r,n[5]=r,n}if(a.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;let o=pe(a);if(o){let[r,s]=o,c=a.charCodeAt(r+1);if(c===45){if(r+2!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ye(1,n.fullPath??n.from,f,p,m);o=e,e.depth=a,e.parent=i,i.dynamic??=[],i.dynamic.push(e)}break}case 3:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),f=c&&!!(t||s),p=t?f?t:t.toLowerCase():void 0,m=s?f?s:s.toLowerCase():void 0,h=!l&&i.optional?.find(e=>!e.parse&&e.caseSensitive===f&&e.prefix===p&&e.suffix===m);if(h)o=h;else{let e=ye(3,n.fullPath??n.from,f,p,m);o=e,e.parent=i,e.depth=a,i.optional??=[],i.optional.push(e)}break}case 2:{let t=r.substring(u,e[1]),s=r.substring(e[4],d),l=c&&!!(t||s),f=t?l?t:t.toLowerCase():void 0,p=s?l?s:s.toLowerCase():void 0,m=ye(2,n.fullPath??n.from,l,f,p);o=m,m.parent=i,m.depth=a,i.wildcard??=[],i.wildcard.push(m)}}i=o}if(l&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf(`/`)+1)===95){let e=ve(n.fullPath??n.from);e.kind=fe,e.parent=i,a++,e.depth=a,i.pathless??=[],i.pathless.push(e),i=e}let u=(n.path||!n.children)&&!n.isRoot;if(u&&r.endsWith(`/`)){let e=ve(n.fullPath??n.from);e.kind=de,e.parent=i,a++,e.depth=a,i.index=e,i=e}i.parse=l??null,i.priority=n.options?.params?.priority??0,u&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(let r of n.children)he(e,t,r,s,i,a,o)}function ge(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function _e(e){if(e.pathless)for(let t of e.pathless)_e(t);if(e.static)for(let t of e.static.values())_e(t);if(e.staticInsensitive)for(let t of e.staticInsensitive.values())_e(t);if(e.dynamic?.length){e.dynamic.sort(ge);for(let t of e.dynamic)_e(t)}if(e.optional?.length){e.optional.sort(ge);for(let t of e.optional)_e(t)}if(e.wildcard?.length){e.wildcard.sort(ge);for(let t of e.wildcard)_e(t)}}function ve(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function ye(e,t,n,r,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:r,suffix:i}}function be(e,t){let n=ve(`/`),r=new Uint16Array(6);for(let t of e)he(!1,r,t,1,n,0);_e(n),t.masksTree=n,t.flatCache=ue(1e3)}function xe(e,t){e||=`/`;let n=t.flatCache.get(e);if(n)return n;let r=Ee(e,t.masksTree);return t.flatCache.set(e,r),r}function Se(e,t,n,r,i){e||=`/`,r||=`/`;let a=t?`case\0${e}`:e,o=i.singleCache.get(a);return o||(o=ve(`/`),he(t,new Uint16Array(6),{from:e},1,o,0),i.singleCache.set(a,o)),Ee(r,o,n)}function Ce(e,t,n=!1){let r=n?e:`nofuzz\0${e}`,i=t.matchCache.get(r);if(i!==void 0)return i;e||=`/`;let a;try{a=Ee(e,t.segmentTree,n)}catch(e){if(e instanceof URIError)a=null;else throw e}return a&&(a.branch=Oe(a.route)),t.matchCache.set(r,a),a}function we(e){return e===`/`?e:e.replace(/\/{1,}$/,``)}function Te(e,t=!1,n){let r=ve(e.fullPath),i=new Uint16Array(6),a={},o={},s=0;return he(t,i,e,1,r,0,e=>{if(n?.(e,s),e.id in a&&le(),a[e.id]=e,s!==0&&e.path){let t=we(e.fullPath);(!o[t]||e.fullPath.endsWith(`/`))&&(o[t]=e)}s++}),_e(r),{processedTree:{segmentTree:r,singleCache:ue(1e3),matchCache:ue(1e3),flatCache:null,masksTree:null},routesById:a,routesByPath:o}}function Ee(e,t,n=!1){let r=e.split(`/`),i=Ae(e,r,t,n);if(!i)return null;let[a]=De(e,r,i);return{route:i.node.route,rawParams:a}}function De(e,t,n){let r=ke(n.node),i=null,a=Object.create(null),o=n.extract?.part??0,s=n.extract?.node??0,c=n.extract?.path??0,l=n.extract?.segment??0;for(;s=0;e--){let n=i.wildcard[e],{prefix:r,suffix:a}=n;if(!(r&&(v||!(n.caseSensitive?y:b??=y.toLowerCase()).startsWith(r)))){if(a){if(v)continue;let e=t.slice(u).join(`/`).slice(-a.length);if((n.caseSensitive?e:e.toLowerCase())!==a)continue}s.push({node:n,index:o,skipped:d,depth:f+1,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}if(i.optional){let e=d|1<=0;n--){let r=i.optional[n];s.push({node:r,index:u,skipped:e,depth:t,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v)for(let e=i.optional.length-1;e>=0;e--){let n=i.optional[e],{prefix:r,suffix:a}=n;if(r||a){let e=n.caseSensitive?y:b??=y.toLowerCase();if(r&&!e.startsWith(r)||a&&!e.endsWith(a))continue}s.push({node:n,index:u+1,skipped:d,depth:t,statics:p,dynamics:m,optionals:h+je(o,u),extract:g,rawParams:_})}}if(!v&&i.dynamic&&y)for(let e=i.dynamic.length-1;e>=0;e--){let t=i.dynamic[e],{prefix:n,suffix:r}=t;if(n||r){let e=t.caseSensitive?y:b??=y.toLowerCase();if(n&&!e.startsWith(n)||r&&!e.endsWith(r))continue}s.push({node:t,index:u+1,skipped:d,depth:f+1,statics:p,dynamics:m+je(o,u),optionals:h,extract:g,rawParams:_})}if(!v&&i.staticInsensitive){let e=i.staticInsensitive.get(b??=y.toLowerCase());e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+je(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(!v&&i.static){let e=i.static.get(y);e&&s.push({node:e,index:u+1,skipped:d,depth:f+1,statics:p+je(o,u),dynamics:m,optionals:h,extract:g,rawParams:_})}if(i.pathless){let e=f+1;for(let t=i.pathless.length-1;t>=0;t--){let n=i.pathless[t];s.push({node:n,index:u,skipped:d,depth:e,statics:p,dynamics:m,optionals:h,extract:g,rawParams:_})}}}if(l)return l;if(r&&c){let n=c.index;for(let e=0;ee.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===de)>(e.node.kind===de)||t.node.kind===de==(e.node.kind===de)&&t.depth>e.depth)))}function Fe(e){return Ie(e.filter(e=>e!==void 0).join(`/`))}function Ie(e){return e.replace(/\/{2,}/g,`/`)}function Le(e){return e===`/`?e:e.replace(/^\/{1,}/,``)}function Re(e){let t=e.length;return t>1&&e[t-1]===`/`?e.replace(/\/{1,}$/,``):e}function ze(e){return Re(Le(e))}function Be(e,t){return e?.endsWith(`/`)&&e!==`/`&&e!==`${t}/`?e.slice(0,-1):e}function Ve(e,t,n){return Be(e,n)===Be(t,n)}function He({base:e,to:t,trailingSlash:n=`never`,cache:r}){let i=t.startsWith(`/`),a=!i&&t===`.`,o;if(r){o=i?t:a?e:e+`\0`+t;let n=r.get(o);if(n)return n}let s;if(a)s=e.split(`/`);else if(i)s=t.split(`/`);else{for(s=e.split(`/`);s.length>1&&S(s)===``;)s.pop();let n=t.split(`/`);for(let e=0,t=n.length;e1&&(S(s)===``?n===`never`&&s.pop():n===`always`&&s.push(``));let c=Ie(s.join(`/`))||`/`;return o&&r&&r.set(o,c),c}function Ue(e){let t=new Map(e.map(e=>[encodeURIComponent(e),e])),n=Array.from(t.keys()).map(e=>e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)).join(`|`),r=new RegExp(n,`g`);return e=>e.replace(r,e=>t.get(e)??e)}function We(e,t,n){let r=t[e];return typeof r==`string`?e===`_splat`?/^[a-zA-Z0-9\-._~!/]*$/.test(r)?r:r.split(`/`).map(e=>Ke(e,n)).join(`/`):Ke(r,n):r}function Ge({path:e,params:t,decoder:n,...r}){let i=!1,a=Object.create(null);if(!e||e===`/`)return{interpolatedPath:`/`,usedParams:a,isMissingParams:i};if(!e.includes(`$`))return{interpolatedPath:e,usedParams:a,isMissingParams:i};let o=e.length,s=0,c,l=``;for(;se.state.__TSR_key||e.href;function nt(e){let t=e.getAttribute(et);if(t)return`[${et}="${t}"]`;let n=``,r=e,i;for(;i=r.parentNode;){let e=1,t=r;for(;t=t.previousElementSibling;)e++;let a=`${r.localName}:nth-child(${e})`;n=n?`${a} > ${n}`:a,r=i}return n}var rt=!1,it=`window`;function at(e){try{return typeof e==`function`?e():document.querySelector(e)}catch{}}function ot(e){let t=new Set;for(let n of e){if(n===it)continue;let e=at(n);e&&t.add(e)}return t}function st(e,t){let n=t??e.options.scrollRestoration,r=e._scroll;n&&(r.restoring=!0);let i=e.options.getScrollRestorationKey||tt,a=new Set,o=e=>{let t=$e[e]||={};for(let e of a)e===document?t[it]={scrollX,scrollY}:e.isConnected&&(t[nt(e)]={scrollX:e.scrollLeft,scrollY:e.scrollTop})};n&&!r.restoration&&(r.restoration=!0,rt=!1,history.scrollRestoration=`manual`,document.addEventListener(`scroll`,e=>{rt||a.add(e.target)},!0),e.subscribe(`onBeforeLoad`,e=>{e.fromLocation&&o(i(e.fromLocation)),a.clear()}),addEventListener(`pagehide`,()=>{o(i(e.stores.resolvedLocation.get()??e.stores.location.get())),Qe()})),!r.reset&&(r.reset=!0,e.subscribe(`onRendered`,t=>{let n=e.options.scrollRestorationBehavior,o=e.options.scrollToTopSelectors,s=r.next,c=r.hash,l;if(a.clear(),r.next=!0,r.hash=!1,typeof e.options.scrollRestoration==`function`&&!e.options.scrollRestoration({location:e.latestLocation}))return;let u=i(t.toLocation),d=t.fromLocation&&i(t.fromLocation);if(r.restoring&&d&&d!==u){let e=$e[d];if(e){let t=$e[u];for(let n in e){if(n===it){if(s)continue}else{let e=at(n);if(!e||s&&o&&(l??=ot(o),l.has(e)))continue}t||=$e[u]={},t[n]??=e[n]}}}rt=!0;try{let e=t.toLocation.hash,i=t.toLocation.state.__hashScrollIntoViewOptions??!0,a=!1;if(s){!e&&o&&(l??=ot(o));let t=e&&i&&c,s=r.restoring?$e[u]:void 0;if(s)for(let e in s){let{scrollX:r,scrollY:i}=s[e];if(e===it){if(t)continue;scrollTo({top:i,left:r,behavior:n}),a=!0}else{let t=at(e);t&&(t.scrollLeft=r,t.scrollTop=i,l?.delete(t))}}if(!e){let e={top:0,left:0,behavior:n};if(a||scrollTo(e),l)for(let t of l)t.scrollTo(e)}}!a&&e&&i&&document.getElementById(e)?.scrollIntoView(i)}finally{rt=!1}}))}function ct(e,t=String){let n=new URLSearchParams;for(let r in e){let i=e[r];i!==void 0&&n.set(r,t(i))}return n.toString()}function lt(e){return e?e===`false`?!1:e===`true`?!0:e*0==0&&+e+``===e?+e:e:``}function ut(e){let t=new URLSearchParams(e),n=Object.create(null);for(let[e,r]of t.entries()){let t=n[e];t==null?n[e]=lt(r):Array.isArray(t)?t.push(lt(r)):n[e]=[t,lt(r)]}return n}var dt=pt(JSON.parse),ft=mt(JSON.stringify,JSON.parse);function pt(e){return t=>{t[0]===`?`&&(t=t.substring(1));let n=ut(t);for(let t in n){let r=n[t];if(typeof r==`string`)try{n[t]=e(r)}catch{}}return n}}function mt(e,t){let n=typeof t==`function`;function r(r){if(typeof r==`object`&&r)try{return e(r)}catch{}else if(n&&typeof r==`string`)try{return t(r),e(r)}catch{}return r}return e=>{let t=ct(e,r);return t?`?${t}`:``}}var ht=`__root__`;function gt(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href==`string`)try{new URL(e.href),e.reloadDocument=!0}catch{}let t=new Headers(e.headers);e.href&&t.get(`Location`)===null&&t.set(`Location`,e.href);let n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function _t(e){return e instanceof Response&&!!e.options}function vt(e){return{input:({url:t})=>{for(let n of e)t=bt(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=xt(e[n],t);return t}}}function yt(e){let t=ze(e.basepath),n=`/${t}`,r=e.caseSensitive?n:n.toLowerCase(),i=`${r}/`;return{input:({url:t})=>{let a=e.caseSensitive?t.pathname:t.pathname.toLowerCase();return a===r?t.pathname=`/`:a.startsWith(i)&&(t.pathname=t.pathname.slice(n.length)),t},output:({url:e})=>(e.pathname=Fe([`/`,t,e.pathname]),e)}}function bt(e,t){let n=e?.input?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function xt(e,t){let n=e?.output?.({url:t});if(n){if(typeof n==`string`)return new URL(n);if(n instanceof URL)return n}return t}function St(e,t){let{createMutableStore:n,createReadonlyStore:r,batch:i,init:a}=t,o=new Map,s=new Map,c=new Map,l=n(e.status),u=n(e.loadedAt),d=n(e.isLoading),f=n(e.isTransitioning),p=n(e.location),m=n(e.resolvedLocation),h=n(e.statusCode),g=n(e.redirect),_=n([]),v=n([]),y=n([]),b=r(()=>Ct(o,_.get())),x=r(()=>Ct(s,v.get())),S=r(()=>Ct(c,y.get())),C=r(()=>_.get()[0]),w=r(()=>_.get().some(e=>o.get(e)?.get().status===`pending`)),T=r(()=>({locationHref:p.get().href,resolvedLocationHref:m.get()?.href,status:l.get()})),E=r(()=>({status:l.get(),loadedAt:u.get(),isLoading:d.get(),isTransitioning:f.get(),matches:b.get(),location:p.get(),resolvedLocation:m.get(),statusCode:h.get(),redirect:g.get()})),D=ue(64);function O(e){let t=D.get(e);return t||(t=r(()=>{let t=_.get();for(let n of t){let t=o.get(n);if(t&&t.routeId===e)return t.get()}}),D.set(e,t)),t}let k={status:l,loadedAt:u,isLoading:d,isTransitioning:f,location:p,resolvedLocation:m,statusCode:h,redirect:g,matchesId:_,pendingIds:v,cachedIds:y,matches:b,pendingMatches:x,cachedMatches:S,firstId:C,hasPending:w,matchRouteDeps:T,matchStores:o,pendingMatchStores:s,cachedMatchStores:c,__store:E,getRouteMatchStore:O,setMatches:A,setPending:ee,setCached:j};A(e.matches),a?.(k);function A(e){wt(e,o,_,n,i)}function ee(e){wt(e,s,v,n,i)}function j(e){wt(e,c,y,n,i)}return k}function Ct(e,t){let n=[];for(let r of t){let t=e.get(r);t&&n.push(t.get())}return n}function wt(e,t,n,r,i){let a=e.map(e=>e.id),o=new Set(a);i(()=>{for(let e of t.keys())o.has(e)||t.delete(e);for(let n of e){let e=t.get(n.id);if(!e){let e=r(n);e.routeId=n.routeId,t.set(n.id,e);continue}e.routeId=n.routeId,e.get()!==n&&e.set(n)}ce(n.get(),a)||n.set(a)})}var Tt=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},Et=e=>e.stores.matchesId.get().some(t=>e.stores.matchStores.get(t)?.get()._forcePending),Dt=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),Ot=(e,t,n=!0)=>{let r={...e.router.options.context??{}},i=n?t:t-1;for(let t=0;t<=i;t++){let n=e.matches[t];if(!n)continue;let i=e.router.getMatch(n.id);i&&Object.assign(r,i.__routeContext,i.__beforeLoadContext)}return r},kt=(e,t)=>{if(!e.matches.length)return;let n=t.routeId,r=e.matches.findIndex(t=>t.routeId===e.router.routeTree.id),i=r>=0?r:0,a=n?e.matches.findIndex(e=>e.routeId===n):e.firstBadMatchIndex??e.matches.length-1;a<0&&(a=i);for(let t=a;t>=0;t--){let n=e.matches[t];if(e.router.looseRoutesById[n.routeId].options.notFoundComponent)return t}return n?a:i},At=(e,t,n)=>{if(!(!_t(n)&&!qe(n)))throw _t(n)&&n.redirectHandled&&!n.options.reloadDocument?n:(t&&(t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,r=>({...r,status:_t(n)?`redirected`:qe(n)?`notFound`:r.status===`pending`?`success`:r.status,context:Ot(e,t.index),isFetching:!1,error:n})),qe(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()),_t(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n)),n)},jt=(e,t)=>{let n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Mt=(e,t,n)=>{let r=Ot(e,n);e.updateMatch(t,e=>({...e,context:r}))},Nt=(e,t,n)=>{let{id:r,routeId:i}=e.matches[t],a=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??=t,At(e,e.router.getMatch(r),n);try{a.options.onError?.(n)}catch(t){n=t,At(e,e.router.getMatch(r),n)}e.updateMatch(r,e=>(e._nonReactive.beforeLoadPromise?.resolve(),e._nonReactive.beforeLoadPromise=void 0,e._nonReactive.loadPromise?.resolve(),{...e,error:n,status:`error`,isFetching:!1,updatedAt:Date.now(),abortController:new AbortController})),!e.preload&&!_t(n)&&!qe(n)&&(e.serialError??=n)},Pt=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;let i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Dt(e,t)&&(n.options.loader||n.options.beforeLoad||Gt(n))&&typeof i==`number`&&i!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent)){let t=setTimeout(()=>{Tt(e)},i);r._nonReactive.pendingTimeout=t}},Ft=(e,t,n)=>{let r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;Pt(e,t,n,r);let i=()=>{let n=e.router.getMatch(t);n.preload&&(n.status===`redirected`||n.status===`notFound`)&&At(e,n,n.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(i):i()},It=(e,t,n,r)=>{let i=e.router.getMatch(t),a=i._nonReactive.loadPromise;i._nonReactive.loadPromise=N(()=>{a?.resolve(),a=void 0});let{paramsError:o,searchError:s}=i;o&&Nt(e,n,o),s&&Nt(e,n,s),Pt(e,t,r,i);let c=new AbortController,l=!1,u=()=>{l||(l=!0,e.updateMatch(t,e=>({...e,isFetching:`beforeLoad`,fetchCount:e.fetchCount+1,abortController:c})))},d=()=>{i._nonReactive.beforeLoadPromise?.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,e=>({...e,isFetching:!1}))};if(!r.options.beforeLoad){e.router.batch(()=>{u(),d()});return}i._nonReactive.beforeLoadPromise=N();let f={...Ot(e,n,!1),...i.__routeContext},{search:p,params:m,cause:h}=i,g=Dt(e,t),_={search:p,abortController:c,params:m,preload:g,context:f,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:g?`preload`:h,matches:e.matches,routeId:r.id,...e.router.options.additionalContext},v=r=>{if(r===void 0){e.router.batch(()=>{u(),d()});return}(_t(r)||qe(r))&&(u(),Nt(e,n,r)),e.router.batch(()=>{u(),e.updateMatch(t,e=>({...e,__beforeLoadContext:r})),d()})},y;try{if(y=r.options.beforeLoad(_),P(y))return u(),y.catch(t=>{Nt(e,n,t)}).then(v)}catch(t){u(),Nt(e,n,t)}v(y)},Lt=(e,t)=>{let{id:n,routeId:r}=e.matches[t],i=e.router.looseRoutesById[r],a=()=>s(),o=()=>It(e,n,t,i),s=()=>{if(jt(e,n))return;let t=Ft(e,n,i);return P(t)?t.then(o):o()};return a()},Rt=(e,t,n)=>{let r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;let i={ssr:e.router.options.ssr,matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(i),n.options.scripts?.(i),n.options.headers?.(i)]).then(([e,t,n])=>({meta:e?.meta,links:e?.links,headScripts:e?.scripts,headers:n,scripts:t,styles:e?.styles}))},zt=(e,t,n,r,i)=>{let a=t[r-1],{params:o,loaderDeps:s,abortController:c,cause:l}=e.router.getMatch(n),u=Ot(e,r),d=Dt(e,n);return{params:o,deps:s,preload:!!d,parentMatchPromise:a,abortController:c,context:u,location:e.location,navigate:t=>e.router.navigate({...t,_fromLocation:e.location}),cause:d?`preload`:l,route:i,...e.router.options.additionalContext}},Bt=async(e,t,n,r,i)=>{try{let a=e.router.getMatch(n);try{Wt(i);let o=i.options.loader,s=typeof o==`function`?o:o?.handler,c=s?.(zt(e,t,n,r,i)),l=!!s&&P(c);if((l||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(n,e=>({...e,isFetching:`loader`})),s){let t=l?await c:c;At(e,e.router.getMatch(n),t),t!==void 0&&e.updateMatch(n,e=>({...e,loaderData:t}))}i._lazyPromise&&await i._lazyPromise;let u=a._nonReactive.minPendingPromise;u&&await u,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,t=>({...t,error:void 0,context:Ot(e,r),status:`success`,isFetching:!1,updatedAt:Date.now()}))}catch(t){let o=t;if(o?.name===`AbortError`){if(a.abortController.signal.aborted){a._nonReactive.loaderPromise?.resolve(),a._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,t=>({...t,status:t.status===`pending`?`success`:t.status,isFetching:!1,context:Ot(e,r)}));return}let s=a._nonReactive.minPendingPromise;s&&await s,qe(t)&&await i.options.notFoundComponent?.preload?.(),At(e,e.router.getMatch(n),t);try{i.options.onError?.(t)}catch(t){o=t,At(e,e.router.getMatch(n),t)}!_t(o)&&!qe(o)&&await Wt(i,[`errorComponent`]),e.updateMatch(n,t=>({...t,error:o,context:Ot(e,r),status:`error`,isFetching:!1}))}}catch(t){let r=e.router.getMatch(n);r&&(r._nonReactive.loaderPromise=void 0),At(e,r,t)}},Vt=async(e,t,n)=>{async function r(r,a,c,l,d){let f=Date.now()-a.updatedAt,p=r?d.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:d.options.staleTime??e.router.options.defaultStaleTime??0,m=d.options.shouldReload,h=typeof m==`function`?m(zt(e,t,i,n,d)):m,{status:g,invalid:_}=l,v=f>=p&&(!!e.forceStaleReload||l.cause===`enter`||c!==void 0&&c!==l.id);o=g===`success`&&(_||(h??v)),r&&d.options.preload===!1||(o&&!e.sync&&u?(s=!0,(async()=>{try{await Bt(e,t,i,n,d);let r=e.router.getMatch(i);r._nonReactive.loaderPromise?.resolve(),r._nonReactive.loadPromise?.resolve(),r._nonReactive.loaderPromise=void 0,r._nonReactive.loadPromise=void 0}catch(t){_t(t)&&await e.router.navigate(t.options)}})()):g!==`success`||o?await Bt(e,t,i,n,d):Mt(e,i,n))}let{id:i,routeId:a}=e.matches[n],o=!1,s=!1,c=e.router.looseRoutesById[a],l=c.options.loader,u=((typeof l==`function`?void 0:l?.staleReloadMode)??e.router.options.defaultStaleReloadMode)!==`blocking`;if(jt(e,i)){if(!e.router.getMatch(i))return e.matches[n];Mt(e,i,n)}else{let t=e.router.getMatch(i),o=e.router.stores.matchesId.get()[n],s=(o&&e.router.stores.matchStores.get(o)||null)?.routeId===a?o:e.router.stores.matches.get().find(e=>e.routeId===a)?.id,l=Dt(e,i);if(t._nonReactive.loaderPromise){if(t.status===`success`&&!e.sync&&!t.preload&&u)return t;await t._nonReactive.loaderPromise;let n=e.router.getMatch(i),a=n._nonReactive.error||n.error;a&&At(e,n,a),n.status===`pending`&&await r(l,t,s,n,c)}else{let n=l&&!e.router.stores.matchStores.has(i),a=e.router.getMatch(i);a._nonReactive.loaderPromise=N(),n!==a.preload&&e.updateMatch(i,e=>({...e,preload:n})),await r(l,t,s,a,c)}}let d=e.router.getMatch(i);s||(d._nonReactive.loaderPromise?.resolve(),d._nonReactive.loadPromise?.resolve(),d._nonReactive.loadPromise=void 0),clearTimeout(d._nonReactive.pendingTimeout),d._nonReactive.pendingTimeout=void 0,s||(d._nonReactive.loaderPromise=void 0),d._nonReactive.dehydrated=void 0;let f=s?d.isFetching:!1;return f!==d.isFetching||d.invalid!==!1?(e.updateMatch(i,e=>({...e,isFetching:f,invalid:!1})),e.router.getMatch(i)):d};async function Ht(e){let t=e,n=[];Et(t.router)&&Tt(t);let r;for(let e=0;e({...e,...a?{status:`success`,globalNotFound:!0,error:void 0}:{status:`notFound`,error:l},isFetching:!1})),u=e,await Wt(r,[`notFoundComponent`])}else if(!t.preload){let e=t.matches[0];e.globalNotFound||t.router.getMatch(e.id)?.globalNotFound&&t.updateMatch(e.id,e=>({...e,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){let e=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await Wt(e,[`errorComponent`])}for(let e=0;e<=u;e++){let{id:n,routeId:r}=t.matches[e],i=t.router.looseRoutesById[r];try{let e=Rt(t,n,i);if(e){let r=await e;t.updateMatch(n,e=>({...e,...r}))}}catch(e){console.error(`Error executing head for route ${r}:`,e)}}let d=Tt(t);if(P(d)&&await d,l)throw l;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function Ut(e,t){let n=t.map(t=>e.options[t]?.preload?.()).filter(Boolean);if(n.length!==0)return Promise.all(n)}function Wt(e,t=Kt){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(t=>{let{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);let n=()=>e._componentsLoaded?void 0:t===Kt?(()=>{if(e._componentsPromise===void 0){let t=Ut(e,Kt);t?e._componentsPromise=t.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():Ut(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function Gt(e){for(let t of Kt)if(e.options[t]?.preload)return!0;return!1}var Kt=[`component`,`errorComponent`,`pendingComponent`,`notFoundComponent`],qt=`__TSR_index`,Jt=`popstate`,Yt=`beforeunload`;function Xt(e){let t=e.getLocation(),n=new Set,r=r=>{t=e.getLocation(),n.forEach(e=>e({location:t,action:r}))},i=n=>{e.notifyOnIndexChange??!0?r(n):t=e.getLocation()},a=async({task:n,navigateOpts:r,...i})=>{if(r?.ignoreBlocker??!1){n();return}let a=e.getBlockers?.()??[],o=i.type===`PUSH`||i.type===`REPLACE`;if(typeof document<`u`&&a.length&&o)for(let n of a){let r=en(i.path,i.state);if(await n.blockerFn({currentLocation:t,nextLocation:r,action:i.type})){e.onBlocked?.();return}}n()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:e=>(n.add(e),()=>{n.delete(e)}),push:(n,i,o)=>{let s=t.state[qt];i=Zt(s+1,i),a({task:()=>{e.pushState(n,i),r({type:`PUSH`})},navigateOpts:o,type:`PUSH`,path:n,state:i})},replace:(n,i,o)=>{let s=t.state[qt];i=Zt(s,i),a({task:()=>{e.replaceState(n,i),r({type:`REPLACE`})},navigateOpts:o,type:`REPLACE`,path:n,state:i})},go:(t,n)=>{a({task:()=>{e.go(t),i({type:`GO`,index:t})},navigateOpts:n,type:`GO`})},back:t=>{a({task:()=>{e.back(t?.ignoreBlocker??!1),i({type:`BACK`})},navigateOpts:t,type:`BACK`})},forward:t=>{a({task:()=>{e.forward(t?.ignoreBlocker??!1),i({type:`FORWARD`})},navigateOpts:t,type:`FORWARD`})},canGoBack:()=>t.state[qt]!==0,createHref:t=>e.createHref(t),block:t=>{if(!e.setBlockers)return()=>{};let n=e.getBlockers?.()??[];return e.setBlockers([...n,t]),()=>{let n=e.getBlockers?.()??[];e.setBlockers?.(n.filter(e=>e!==t))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function Zt(e,t){t||={};let n=tn();return{...t,key:n,__TSR_key:n,[qt]:e}}function Qt(e){let t=e?.window??(typeof document<`u`?window:void 0),n=t.history.pushState,r=t.history.replaceState,i=[],a=()=>i,o=e=>i=e,s=e?.createHref??(e=>e),c=e?.parseLocation??(()=>en(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){let e=tn();t.history.replaceState({[qt]:0,key:e,__TSR_key:e},``)}let l=c(),u,d=!1,f=!1,p=!1,m=!1,h=()=>l,g,_,v=()=>{g&&(C._ignoreSubscribers=!0,(g.isPush?t.history.pushState:t.history.replaceState)(g.state,``,g.href),C._ignoreSubscribers=!1,g=void 0,_=void 0,u=void 0)},y=(e,t,n)=>{let r=s(t);_||(u=l),l=en(t,n),g={href:r,state:n,isPush:g?.isPush||e===`push`},_||=Promise.resolve().then(()=>v())},b=e=>{l=c(),C.notify({type:e})},x=async()=>{if(f){f=!1;return}let e=c(),n=e.state[qt]-l.state[qt],r=n===1,i=n===-1,o=!r&&!i||d;d=!1;let s=o?`GO`:i?`BACK`:`FORWARD`,u=o?{type:`GO`,index:n}:{type:i?`BACK`:`FORWARD`};if(p)p=!1;else{let n=a();if(typeof document<`u`&&n.length){for(let r of n)if(await r.blockerFn({currentLocation:l,nextLocation:e,action:s})){f=!0,t.history.go(1),C.notify(u);return}}}l=c(),C.notify(u)},S=e=>{if(m){m=!1;return}let t=!1,n=a();if(typeof document<`u`&&n.length)for(let e of n){let n=e.enableBeforeUnload??!0;if(n===!0){t=!0;break}if(typeof n==`function`&&n()===!0){t=!0;break}}if(t)return e.preventDefault(),e.returnValue=``},C=Xt({getLocation:h,getLength:()=>t.history.length,pushState:(e,t)=>y(`push`,e,t),replaceState:(e,t)=>y(`replace`,e,t),back:e=>(e&&(p=!0),m=!0,t.history.back()),forward:e=>{e&&(p=!0),m=!0,t.history.forward()},go:e=>{d=!0,t.history.go(e)},createHref:e=>s(e),flush:v,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(Yt,S,{capture:!0}),t.removeEventListener(Jt,x)},onBlocked:()=>{u&&l!==u&&(l=u)},getBlockers:a,setBlockers:o,notifyOnIndexChange:!1});return t.addEventListener(Yt,S,{capture:!0}),t.addEventListener(Jt,x),t.history.pushState=function(...e){let r=n.apply(t.history,e);return C._ignoreSubscribers||b(`PUSH`),r},t.history.replaceState=function(...e){let n=r.apply(t.history,e);return C._ignoreSubscribers||b(`REPLACE`),n},C}function $t(e){let t=e.replace(/[\x00-\x1f\x7f]/g,``);return t.startsWith(`//`)&&(t=`/`+t.replace(/^\/+/,``)),t}function en(e,t){let n=$t(e),r=n.indexOf(`#`),i=n.indexOf(`?`),a=tn();return{href:n,pathname:n.substring(0,r>0?i>0?Math.min(r,i):r:i>0?i:n.length),hash:r>-1?n.substring(r):``,search:i>-1?n.slice(i,r===-1?void 0:r):``,state:t||{[qt]:0,key:a,__TSR_key:a}}}function tn(){return(Math.random()+1).toString(36).substring(7)}function nn(e,t){let n=t,r=e;return{fromLocation:n,toLocation:r,pathChanged:n?.pathname!==r.pathname,hrefChanged:n?.href!==r.href,hashChanged:n?.hash!==r.hash}}var rn=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.lightweightCache=new WeakMap,this.startTransition=e=>e(),this.update=e=>{let t=this.options,n=this.basepath??t?.basepath??`/`,r=this.basepath===void 0,i=t?.rewrite;if(this.options={...t,...e},this.isServer=this.options.isServer??typeof document>`u`,this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=Ue(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.history=this.options.history?this.options.history:Qt()),this.origin=this.options.origin,this.origin||=window?.origin&&window.origin!==`null`?window.origin:`http://localhost`,this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let e;this.resolvePathCache=ue(1e3),e=this.buildRouteTree(),this.setRoutes(e)}if(!this.stores&&this.latestLocation){let e=this.getStoreConfig(this);this.batch=e.batch,this.stores=St(sn(this.latestLocation),e),st(this)}let a=!1,o=this.options.basepath??`/`,s=this.options.rewrite;if(r||n!==o||i!==s){this.basepath=o;let e=[],t=ze(o);t&&t!==`/`&&e.push(yt({basepath:o})),s&&e.push(s),this.rewrite=e.length===0?void 0:e.length===1?e[0]:vt(e),this.history&&this.updateLatestLocation(),a=!0}a&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<`u`&&`CSS`in window&&typeof window.CSS?.supports==`function`&&(this.isViewTransitionTypesSupported=window.CSS.supports(`selector(:active-view-transition-type(a))`))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{let e=Te(this.routeTree,this.options.caseSensitive,(e,t)=>{e.init({originalIndex:t})});return this.options.routeMasks&&be(this.options.routeMasks,e.processedTree),e},this.subscribe=(e,t)=>{let n={eventType:e,fn:t};return this.subscribers.add(n),()=>{this.subscribers.delete(n)}},this.emit=e=>{this.subscribers.forEach(t=>{t.eventType===e.type&&t.fn(e)})},this.parseLocation=(e,t)=>{let n=({pathname:e,search:n,hash:r,href:i,state:a})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(e)){let i=this.options.parseSearch(n),o=this.options.stringifySearch(i);return{href:e+o+r,publicHref:e+o+r,pathname:I(e).path,external:!1,searchStr:o,search:k(t?.search,i),hash:I(r.slice(1)).path,state:A(t?.state,a)}}let o=new URL(i,this.origin),s=bt(this.rewrite,o),c=this.options.parseSearch(s.search),l=this.options.stringifySearch(c);return s.search=l,{href:s.href.replace(s.origin,``),publicHref:i,pathname:I(s.pathname).path,external:!!this.rewrite&&s.origin!==this.origin,searchStr:l,search:k(t?.search,c),hash:I(s.hash.slice(1)).path,state:A(t?.state,a)}},r=n(e),{__tempLocation:i,__tempKey:a}=r.state;if(i&&(!a||a===this.tempLocationKey)){let e=n(i);return e.state.key=r.state.key,e.state.__TSR_key=r.state.__TSR_key,delete e.state.__tempLocation,{...e,maskedLocation:r}}return r},this.resolvePathWithBase=(e,t)=>He({base:e,to:t.includes(`//`)?Ie(t):t,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(e,t,n)=>typeof e==`string`?this.matchRoutesInternal({pathname:e,search:t},n):this.matchRoutesInternal(e,t),this.getMatchedRoutes=e=>ln({pathname:e,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=e=>{let t=this.getMatch(e);t&&(t.abortController.abort(),clearTimeout(t._nonReactive.pendingTimeout),t._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(e=>{this.cancelMatch(e)}),this.stores.matchesId.get().forEach(e=>{if(this.stores.pendingMatchStores.has(e))return;let t=this.stores.matchStores.get(e)?.get();t&&(t.status===`pending`||t.isFetching===`loader`)&&this.cancelMatch(e)})},this.buildLocation=e=>{let t=(t={})=>{let n=t._fromLocation||this.pendingBuiltLocation||this.latestLocation,r=this.matchRoutesLightweight(n);t.from;let i=t.unsafeRelative===`path`?n.pathname:t.from??r.fullPath,a=t.to?`${t.to}`:void 0,o=r.search,s=Object.assign(Object.create(null),r.params),c=a?.charCodeAt(0)===47?`/`:this.resolvePathWithBase(i,`.`),l=a?this.resolvePathWithBase(c,a):c,u=t.params===!1||t.params===null?Object.create(null):(t.params??!0)===!0?s:Object.assign(s,w(t.params,s)),d=this.routesByPath[Re(l)],f;if(d)f=this.getRouteBranch(d);else if(l.includes(`$`))f=[];else{let e=this.getMatchedRoutes(l);f=e.matchedRoutes,this.options.notFoundRoute&&(!e.foundRoute||e.foundRoute.path!==`/`&&e.routeParams[`**`])&&(f=[...f,this.options.notFoundRoute])}if(f.length&&D(u))for(let e of f){let t=e.options.params?.stringify??e.options.stringifyParams;if(t)try{Object.assign(u,t(u))}catch{}}let p=e.leaveParams?l:I(Ge({path:l,params:u,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path,m=o;if(e._includeValidateSearch&&this.options.search?.strict){let e={};f.forEach(t=>{if(t.options.validateSearch)try{Object.assign(e,cn(t.options.validateSearch,{...e,...m}))}catch{}}),m=e}m=un({search:m,dest:t,destRoutes:f,_includeValidateSearch:e._includeValidateSearch}),m=k(o,m);let h=this.options.stringifySearch(m),g=t.hash===!0?n.hash:t.hash?w(t.hash,n.hash):void 0,_=g?`#${g}`:``,v=t.state===!0?n.state:t.state?w(t.state,n.state):{};v=A(n.state,v);let y=`${p}${h}${_}`,b,x,S=!1;if(this.rewrite){let e=new URL(y,this.origin),t=xt(this.rewrite,e);b=e.href.replace(e.origin,``),t.origin===this.origin?x=t.pathname+t.search+t.hash:(x=t.href,S=!0)}else b=se(y),x=b;return{publicHref:x,href:b,pathname:p,search:m,searchStr:h,state:v,hash:g??``,external:S,unmaskOnReload:t.unmaskOnReload}},n=(n={},r)=>{let i=t(n),a=r?t(r):void 0;if(!a){let n=Object.create(null);if(this.options.routeMasks){let o=xe(i.pathname,this.processedTree);if(o){Object.assign(n,o.rawParams);let{from:i,params:s,...c}=o.route,l=s===!1||s===null?Object.create(null):(s??!0)===!0?n:Object.assign(n,w(s,n));r={from:e.from,...c,params:l},a=t(r)}}}return a&&(i.maskedLocation=a),i};return e.mask?n(e,{from:e.from,...e.mask}):n(e)},this.commitLocation=async({viewTransition:e,ignoreBlocker:t,...n})=>{let r,i=()=>{let e=[`key`,`__TSR_key`,`__TSR_index`,`__hashScrollIntoViewOptions`];e.forEach(e=>{n.state[e]=this.latestLocation.state[e]});let t=ne(n.state,this.latestLocation.state);return e.forEach(e=>{delete n.state[e]}),t},a=Re(this.latestLocation.href)===Re(n.href),o=this.commitLocationPromise;if(this.commitLocationPromise=N(()=>{o?.resolve(),o=void 0}),a&&i())this.load();else{let{maskedLocation:i,hashScrollIntoView:a,...o}=n;i&&(o={...i,state:{...i.state,__tempKey:void 0,__tempLocation:{...o,search:o.searchStr,state:{...o.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(o.unmaskOnReload??this.options.unmaskOnReload??!1)&&(o.state.__tempKey=this.tempLocationKey)),o.state.__hashScrollIntoViewOptions=a??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=e,r=n.replace?`REPLACE`:`PUSH`,this.history[r===`REPLACE`?`replace`:`push`](o.publicHref,o.state,{ignoreBlocker:t})}return this._scroll.next=n.resetScroll??!0,this.history.subscribers.size||this.load(r?{action:{type:r}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:e,resetScroll:t,hashScrollIntoView:n,viewTransition:r,ignoreBlocker:i,href:a,...o}={})=>{if(a){let t=this.history.location.state.__TSR_index,n=en(a,{__TSR_index:e?t:t+1}),r=new URL(n.pathname,this.origin);o.to=bt(this.rewrite,r).pathname,o.search=this.options.parseSearch(n.search),o.hash=n.hash.slice(1)}let s=this.buildLocation({...o,_includeValidateSearch:!0});this.pendingBuiltLocation=s;let c=this.commitLocation({...s,viewTransition:r,replace:e,resetScroll:t,hashScrollIntoView:n,ignoreBlocker:i});return queueMicrotask(()=>{this.pendingBuiltLocation===s&&(this.pendingBuiltLocation=void 0)}),c},this.navigate=async({to:e,reloadDocument:t,href:n,publicHref:r,...i})=>{let a=!1;if(n)try{new URL(`${n}`),a=!0}catch{}if(a&&!t&&(t=!0),t){if(e!==void 0||!n){let t=this.buildLocation({to:e,...i});n??=t.publicHref,r??=t.publicHref}let t=!a&&r?r:n;if(F(t,this.protocolAllowlist))return;if(!i.ignoreBlocker){let e=this.history.getBlockers?.()??[];for(let t of e)if(t?.blockerFn&&await t.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:`PUSH`}))return}i.replace?window.location.replace(t):window.location.href=t;return}return this.buildAndCommitLocation({...i,href:n,to:e,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();let e=this.matchRoutes(this.latestLocation),t=this.stores.cachedMatches.get().filter(t=>!e.some(e=>e.id===t.id));this.batch(()=>{this.stores.status.set(`pending`),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(e),this.stores.setCached(t)})},this.load=async e=>{let t=e?.action?.type,n,r,i,a=this.stores.resolvedLocation.get()??this.stores.location.get();for(i=new Promise(o=>{this.startTransition(async()=>{try{this.beforeLoad(),t&&(this._scroll.hash=t===`PUSH`||t===`REPLACE`);let n=this.latestLocation,r=nn(n,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:`onBeforeNavigate`,...r}),this.emit({type:`onBeforeLoad`,...r}),await Ht({router:this,sync:e?.sync,forceStaleReload:a.href===n.href,matches:this.stores.pendingMatches.get(),location:n,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let e=null,t=null,n=null,r=null;this.batch(()=>{let i=this.stores.pendingMatches.get(),a=i.length,o=this.stores.matches.get();e=a?o.filter(e=>!this.stores.pendingMatchStores.has(e.id)):null;let s=new Set;for(let e of this.stores.pendingMatchStores.values())e.routeId&&s.add(e.routeId);let c=new Set;for(let e of this.stores.matchStores.values())e.routeId&&c.add(e.routeId);t=a?o.filter(e=>!s.has(e.routeId)):null,n=a?i.filter(e=>!c.has(e.routeId)):null,r=a?i.filter(e=>c.has(e.routeId)):o,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),a&&(this.stores.setMatches(i),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...e.filter(e=>e.status!==`error`&&e.status!==`notFound`&&e.status!==`redirected`)]),this.clearExpiredCache())});for(let[e,i]of[[t,`onLeave`],[n,`onEnter`],[r,`onStay`]])if(e)for(let t of e)this.looseRoutesById[t.routeId].options[i]?.(t)})})}})}catch(e){_t(e)?(n=e,this.navigate({...n.options,replace:!0,ignoreBlocker:!0})):qe(e)&&(r=e);let t=n?n.status:r?404:this.stores.matches.get().some(e=>e.status===`error`)?500:200;this.batch(()=>{this.stores.statusCode.set(t),this.stores.redirect.set(n)})}this.latestLoadPromise===i&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),o()})}),this.latestLoadPromise=i,await i;this.latestLoadPromise&&i!==this.latestLoadPromise;)await this.latestLoadPromise;let o;this.hasNotFoundMatch()?o=404:this.stores.matches.get().some(e=>e.status===`error`)&&(o=500),o!==void 0&&this.stores.statusCode.set(o)},this.startViewTransition=e=>{let t=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,t&&typeof document<`u`&&`startViewTransition`in document&&typeof document.startViewTransition==`function`){let n;if(typeof t==`object`&&this.isViewTransitionTypesSupported){let r=this.latestLocation,i=this.stores.resolvedLocation.get(),a=typeof t.types==`function`?t.types(nn(r,i)):t.types;if(a===!1){e();return}n={update:e,types:a}}else n=e;document.startViewTransition(n)}else e()},this.updateMatch=(e,t)=>{this.startTransition(()=>{let n=this.stores.pendingMatchStores.get(e);if(n){n.set(t);return}let r=this.stores.matchStores.get(e);if(r){r.set(t);return}let i=this.stores.cachedMatchStores.get(e);if(i){let n=t(i.get());n.status===`redirected`?this.stores.cachedMatchStores.delete(e)&&this.stores.cachedIds.set(t=>t.filter(t=>t!==e)):i.set(n)}})},this.getMatch=e=>this.stores.cachedMatchStores.get(e)?.get()??this.stores.pendingMatchStores.get(e)?.get()??this.stores.matchStores.get(e)?.get(),this.invalidate=e=>{let t=t=>e?.filter?.(t)??!0?{...t,invalid:!0,...e?.forcePending||t.status===`error`||t.status===`notFound`?{status:`pending`,error:void 0}:void 0}:t;return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(t)),this.stores.setCached(this.stores.cachedMatches.get().map(t)),this.stores.setPending(this.stores.pendingMatches.get().map(t))}),this.shouldViewTransition=!1,this.load({sync:e?.sync})},this.getParsedLocationHref=e=>e.publicHref||`/`,this.resolveRedirect=e=>{let t=e.headers.get(`Location`);if(!e.options.href||e.options._builtLocation){let t=e.options._builtLocation??this.buildLocation(e.options),n=this.getParsedLocationHref(t);e.options.href=n,e.headers.set(`Location`,n)}else if(t)try{let n=new URL(t);if(this.origin&&n.origin===this.origin){let t=n.pathname+n.search+n.hash;e.options.href=t,e.headers.set(`Location`,t)}}catch{}if(e.options.href&&!e.options._builtLocation&&F(e.options.href,this.protocolAllowlist))throw Error(`Redirect blocked: unsafe protocol`);return e.headers.get(`Location`)||e.headers.set(`Location`,e.options.href),e},this.clearCache=e=>{let t=e?.filter;t===void 0?this.stores.setCached([]):this.stores.setCached(this.stores.cachedMatches.get().filter(e=>!t(e)))},this.clearExpiredCache=()=>{let e=Date.now();this.clearCache({filter:t=>{let n=this.looseRoutesById[t.routeId];if(!n.options.loader)return!0;let r=(t.preload?n.options.preloadGcTime??this.options.defaultPreloadGcTime:n.options.gcTime??this.options.defaultGcTime)??3e5;return t.status===`error`||e-t.updatedAt>=r}})},this.loadRouteChunk=Wt,this.preloadRoute=async e=>{let t=e._builtLocation??this.buildLocation(e),n=this.matchRoutes(t,{throwOnError:!0,preload:!0,dest:e}),r=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),i=new Set([...r,...this.stores.cachedIds.get()]),a=n.filter(e=>!i.has(e.id));if(a.length){let e=this.stores.cachedMatches.get();this.stores.setCached([...e,...a])}try{return n=await Ht({router:this,matches:n,location:t,preload:!0,updateMatch:(e,t)=>{r.has(e)?n=n.map(n=>n.id===e?t(n):n):this.updateMatch(e,t)}}),n}catch(e){if(_t(e))return e.options.reloadDocument?void 0:await this.preloadRoute({...e.options,_fromLocation:t});qe(e)||console.error(e);return}},this.matchRoute=(e,t)=>{let n={...e,to:e.to?this.resolvePathWithBase(e.from||``,e.to):void 0,params:e.params||{},leaveParams:!0},r=this.buildLocation(n);if(t?.pending&&this.stores.status.get()!==`pending`)return!1;let i=(t?.pending===void 0?!this.stores.isLoading.get():t.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),a=Se(r.pathname,t?.caseSensitive??!1,t?.fuzzy??!1,i.pathname,this.processedTree);return!a||e.params&&!ne(a.rawParams,e.params,{partial:!0})?!1:t?.includeSearch??!0?ne(i.search,r.search,{partial:!0})?a.rawParams:!1:a.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(e=>e.status===`notFound`||e.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??`fuzzy`,stringifySearch:e.stringifySearch??ft,parseSearch:e.parseSearch??dt,protocolAllowlist:e.protocolAllowlist??oe}),typeof document<`u`&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;let r=this.options.notFoundRoute;r&&(r.init({originalIndex:99999999999}),this.routesById[r.id]=r)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Oe(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e?.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){let n=this.getMatchedRoutes(e.pathname),{foundRoute:r,routeParams:i}=n,{matchedRoutes:a}=n,o=!1;(r?r.path!==`/`&&i[`**`]:Re(e.pathname))&&(this.options.notFoundRoute?a=[...a,this.options.notFoundRoute]:o=!0);let s=o?fn(this.options.notFoundMode,a):void 0,c=Array(a.length),l=new Map;for(let e of this.stores.matchStores.values())e.routeId&&l.set(e.routeId,e.get());for(let n=0;nthis.navigate({...t,_fromLocation:e}),buildLocation:this.buildLocation,cause:n.cause,abortController:n.abortController,preload:!!n.preload,matches:c,routeId:r.id};n.__routeContext=r.options.context(t)??void 0}n.context={...a,...n.__routeContext,...n.__beforeLoadContext}}}return c}matchRoutesLightweight(e){let t=S(this.stores.matchesId.get()),n=this.lightweightCache.get(e);if(n&&n[0]===t)return n[1];let{matchedRoutes:r,routeParams:i}=this.getMatchedRoutes(e.pathname),a=S(r),o={...e.search};for(let e of r)try{Object.assign(o,cn(e.options.validateSearch,o))}catch{}let s=t&&this.stores.matchStores.get(t)?.get(),c=s&&s.routeId===a.id&&s.pathname===e.pathname,l;if(c)l=s.params;else{let e=Object.assign(Object.create(null),i);for(let t of r)try{pn(t,e)}catch{}l=e}let u={matchedRoutes:r,fullPath:a.fullPath,search:o,params:l};return this.lightweightCache.set(e,[t,u]),u}},an=class extends Error{},on=class extends Error{};function sn(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:`idle`,resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function cn(e,t){if(e==null)return{};if(`~standard`in e){let n=e[`~standard`].validate(t);if(n instanceof Promise)throw new an(`Async validation not supported`);if(n.issues)throw new an(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return`parse`in e?e.parse(t):typeof e==`function`?e(t):{}}function ln({pathname:e,routesById:t,processedTree:n}){let r=Object.create(null),i=Re(e),a,o=Ce(i,n,!0);return o&&(a=o.route,Object.assign(r,o.rawParams)),{matchedRoutes:o?.branch||[t.__root__],routeParams:r,foundRoute:a}}function un({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){return dn(n)(e,t,r??!1)}function dn(e){let t,n,r=[];for(let t of e){let e=t.options;`search`in e?e.search?.middlewares&&r.push(...e.search.middlewares):(e.preSearchFilters||e.postSearchFilters)&&r.push(({search:t,next:n})=>{let r=n(e.preSearchFilters?e.preSearchFilters.reduce((e,t)=>t(e),t):t);return e.postSearchFilters?e.postSearchFilters.reduce((e,t)=>t(e),r):r});let i=e.validateSearch;i&&r.push(({search:e,next:t,meta:r})=>{let a=t(e);if(n)try{let e=cn(i,a);if(r&&e)for(let t in e)t in a||(r.defaulted||=new Map).set(t,e[t]);return{...a,...e}}catch{}return a})}let i=(e,n,a)=>{if(e>=r.length){if(!t.search)return{};if(t.search===!0)return n;let e=w(t.search,n);return a&&(a.explicit=e),e}return r[e]({search:n,next:(t,n)=>{if(n){let n=a||{};return{search:i(e+1,t,n),meta:n}}return i(e+1,t,a)},meta:a})};return function(e,r,a){return t=r,n=a,i(0,e)}}function fn(e,t){if(e!==`root`)for(let e=t.length-1;e>=0;e--){let n=t[e];if(n.children)return n.id}return ht}function pn(e,t){let n=e.options.params?.parse??e.options.parseParams;if(n){let e=n(t);if(e===!1)throw Error(`Route params.parse returned false for a matched route`);Object.assign(t,e)}}var mn=`Error preloading route! ☝️`,hn=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e.originalIndex;let t=this.options,n=!t?.path&&!t?.id;this.parentRoute=this.options.getParentRoute?.(),n?this._path=ht:this.parentRoute||le();let r=n?ht:t?.path;r&&r!==`/`&&(r=Le(r));let i=t?.id||r,a=n?ht:Fe([this.parentRoute.id===`__root__`?``:this.parentRoute.id,i]);r===`__root__`&&(r=`/`),a!==`__root__`&&(a=Fe([`/`,a]));let o=a===`__root__`?`/`:Fe([this.parentRoute.fullPath,r]);this._path=r,this._id=a,this._fullPath=o,this._to=Re(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>gt({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},gn=class extends hn{constructor(e){super(e)}},_n=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),L=o(((e,t)=>{t.exports=_n()}))();function vn(e){let t=e.errorComponent??bn;return(0,L.jsx)(yn,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?_.createElement(t,{error:n,reset:r}):e.children})}var yn=class extends _.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function bn({error:e}){let[t,n]=_.useState(!1);return(0,L.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,L.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,L.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,L.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,L.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,L.jsx)(`div`,{children:(0,L.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e.message?(0,L.jsx)(`code`,{children:e.message}):null})}):null]})}function xn({children:e,fallback:t=null}){return Sn()?(0,L.jsx)(_.Fragment,{children:e}):(0,L.jsx)(_.Fragment,{children:t})}function Sn(){return _.useSyncExternalStore(Cn,()=>!0,()=>!1)}function Cn(){return()=>{}}var wn=_.createContext(null);function Tn(e){return _.useContext(wn)}var En=_.createContext(void 0),Dn=_.createContext(void 0),On=(e=>(e[e.None=0]=`None`,e[e.Mutable=1]=`Mutable`,e[e.Watching=2]=`Watching`,e[e.RecursedCheck=4]=`RecursedCheck`,e[e.Recursed=8]=`Recursed`,e[e.Dirty=16]=`Dirty`,e[e.Pending=32]=`Pending`,e))(On||{});function kn({update:e,notify:t,unwatched:n}){return{link:r,unlink:i,propagate:a,checkDirty:o,shallowPropagate:s};function r(e,t,n){let r=t.depsTail;if(r!==void 0&&r.dep===e)return;let i=r===void 0?t.deps:r.nextDep;if(i!==void 0&&i.dep===e){i.version=n,t.depsTail=i;return}let a=e.subsTail;if(a!==void 0&&a.version===n&&a.sub===t)return;let o=t.depsTail=e.subsTail={version:n,dep:e,sub:t,prevDep:r,nextDep:i,prevSub:a,nextSub:void 0};i!==void 0&&(i.prevDep=o),r===void 0?t.deps=o:r.nextDep=o,a===void 0?e.subs=o:a.nextSub=o}function i(e,t=e.sub){let r=e.dep,i=e.prevDep,a=e.nextDep,o=e.nextSub,s=e.prevSub;return a===void 0?t.depsTail=i:a.prevDep=i,i===void 0?t.deps=a:i.nextDep=a,o===void 0?r.subsTail=s:o.prevSub=s,s===void 0?(r.subs=o)===void 0&&n(r):s.nextSub=o,a}function a(e){let n=e.nextSub,r;top:do{let i=e.sub,a=i.flags;if(a&60?a&12?a&4?!(a&48)&&c(e,i)?(i.flags=a|40,a&=1):a=0:i.flags=a&-9|32:a=0:i.flags=a|32,a&2&&t(i),a&1){let t=i.subs;if(t!==void 0){let i=(e=t).nextSub;i!==void 0&&(r={value:n,prev:r},n=i);continue}}if((e=n)!==void 0){n=e.nextSub;continue}for(;r!==void 0;)if(e=r.value,r=r.prev,e!==void 0){n=e.nextSub;continue top}break}while(!0)}function o(t,n){let r,i=0,a=!1;top:do{let o=t.dep,c=o.flags;if(n.flags&16)a=!0;else if((c&17)==17){if(e(o)){let e=o.subs;e.nextSub!==void 0&&s(e),a=!0}}else if((c&33)==33){(t.nextSub!==void 0||t.prevSub!==void 0)&&(r={value:t,prev:r}),t=o.deps,n=o,++i;continue}if(!a){let e=t.nextDep;if(e!==void 0){t=e;continue}}for(;i--;){let i=n.subs,o=i.nextSub!==void 0;if(o?(t=r.value,r=r.prev):t=i,a){if(e(n)){o&&s(i),n=t.sub;continue}a=!1}else n.flags&=-33;n=t.sub;let c=t.nextDep;if(c!==void 0){t=c;continue top}}return a}while(!0)}function s(e){do{let n=e.sub,r=n.flags;(r&48)==32&&(n.flags=r|16,(r&6)==2&&t(n))}while((e=e.nextSub)!==void 0)}function c(e,t){let n=t.depsTail;for(;n!==void 0;){if(n===e)return!0;n=n.prevDep}return!1}}function An(e,t,n){let r=typeof e==`object`,i=r?e:void 0;return{next:(r?e.next:e)?.bind(i),error:(r?e.error:t)?.bind(i),complete:(r?e.complete:n)?.bind(i)}}var jn=[],Mn=0,{link:Nn,unlink:Pn,propagate:Fn,checkDirty:In,shallowPropagate:Ln}=kn({update(e){return e._update()},notify(e){jn[zn++]=e,e.flags&=~On.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=On.Mutable|On.Dirty,Un(e))}}),Rn=0,zn=0,Bn,Vn=0;function Hn(e){try{++Vn,e()}finally{--Vn||Wn()}}function Un(e){let t=e.depsTail,n=t===void 0?e.deps:t.nextDep;for(;n!==void 0;)n=Pn(n,e)}function Wn(){if(!(Vn>0)){for(;Rn{i.get(),n.current?t.next?.(i._snapshot):n.current=!0});return{unsubscribe:()=>{r.stop()}}},_update(e){let a=Bn,o=t?.compare??Object.is;if(n)Bn=i,++Mn,i.depsTail=void 0;else if(e===void 0)return!1;n&&(i.flags=On.Mutable|On.RecursedCheck);try{let t=i._snapshot,a=typeof e==`function`?e(t):e===void 0&&n?r(t):e;return t===void 0||!o(t,a)?(i._snapshot=a,!0):!1}finally{Bn=a,n&&(i.flags&=~On.RecursedCheck),Un(i)}}};return n?(i.flags=On.Mutable|On.Dirty,i.get=function(){let e=i.flags;if(e&On.Dirty||e&On.Pending&&In(i.deps,i)){if(i._update()){let e=i.subs;e!==void 0&&Ln(e)}}else e&On.Pending&&(i.flags=e&~On.Pending);return Bn!==void 0&&Nn(i,Bn,Mn),i._snapshot}):i.set=function(e){if(i._update(e)){let e=i.subs;e!==void 0&&(Fn(e),Ln(e),Wn())}},i}function Kn(e){let t=()=>{let t=Bn;Bn=n,++Mn,n.depsTail=void 0,n.flags=On.Watching|On.RecursedCheck;try{return e()}finally{Bn=t,n.flags&=~On.RecursedCheck,Un(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:On.Watching|On.RecursedCheck,notify(){let e=this.flags;e&On.Dirty||e&On.Pending&&In(this.deps,this)?t():this.flags=On.Watching},stop(){this.flags=On.None,this.depsTail=void 0,Un(this)}};return t(),n}var qn=o((e=>{var t=u();function n(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var r=typeof Object.is==`function`?Object.is:n,i=t.useState,a=t.useEffect,o=t.useLayoutEffect,s=t.useDebugValue;function c(e,t){var n=t(),r=i({inst:{value:n,getSnapshot:t}}),c=r[0].inst,u=r[1];return o(function(){c.value=n,c.getSnapshot=t,l(c)&&u({inst:c})},[e,n,t]),a(function(){return l(c)&&u({inst:c}),e(function(){l(c)&&u({inst:c})})},[e]),s(n),n}function l(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch{return!0}}function d(e,t){return t()}var f=typeof window>`u`||window.document===void 0||window.document.createElement===void 0?d:c;e.useSyncExternalStore=t.useSyncExternalStore===void 0?f:t.useSyncExternalStore})),Jn=o(((e,t)=>{t.exports=qn()})),Yn=o((e=>{var t=u(),n=Jn();function r(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var i=typeof Object.is==`function`?Object.is:r,a=n.useSyncExternalStore,o=t.useRef,s=t.useEffect,c=t.useMemo,l=t.useDebugValue;e.useSyncExternalStoreWithSelector=function(e,t,n,r,u){var d=o(null);if(d.current===null){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=c(function(){function e(e){if(!a){if(a=!0,o=e,e=r(e),u!==void 0&&f.hasValue){var t=f.value;if(u(t,e))return s=t}return s=e}if(t=s,i(o,e))return t;var n=r(e);return u!==void 0&&u(t,n)?(o=e,t):(o=e,s=n)}var a=!1,o,s,c=n===void 0?null:n;return[function(){return e(t())},c===null?void 0:function(){return e(c())}]},[t,n,r,u]);var p=a(e,d[0],d[1]);return s(function(){f.hasValue=!0,f.value=p},[p]),l(p),p}})),Xn=o(((e,t)=>{t.exports=Yn()}))();function Zn(e,t){return e===t}function Qn(e,t,n=Zn){let r=(0,_.useCallback)(t=>{if(!e)return()=>{};let{unsubscribe:n}=e.subscribe(t);return n},[e]),i=(0,_.useCallback)(()=>e?.get(),[e]);return(0,Xn.useSyncExternalStoreWithSelector)(r,i,i,t,n)}var $n={get(){},subscribe(){return{unsubscribe(){}}}};function er(e,t){let n=_.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=A(n.current,i):i}}function tr(e){let t=Tn(),n=_.useContext(e.from?Dn:En),r=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=er(e,t),a=Qn(r??$n,e=>e?i(e):$n);if(a!==$n)return a;(e.shouldThrow??!0)&&le()}function nr(e){return tr({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function rr(e){let{select:t,...n}=e;return tr({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function ir(e){return tr({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function ar(e){return tr({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function or(e){let t=Tn();return _.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function sr(e){return tr({...e,select:t=>e.select?e.select(t.context):t.context})}var cr=c(m(),1);function lr(e,t){let n=Tn(),r=x(t),{activeProps:i,inactiveProps:a,activeOptions:o,to:s,preload:c,preloadDelay:l,preloadIntentProximity:u,hashScrollIntoView:d,replace:f,startTransition:p,resetScroll:m,viewTransition:h,children:g,target:v,disabled:y,style:S,className:C,onClick:T,onBlur:E,onFocus:D,onMouseEnter:O,onMouseLeave:k,onTouchStart:A,ignoreBlocker:ee,params:j,search:M,hash:te,state:N,mask:P,reloadDocument:re,unsafeRelative:ie,from:ae,_fromLocation:oe,...I}=e,se=Sn(),ce=_.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),le=Qn(n.stores.location,e=>e,(e,t)=>e.href===t.href),ue=_.useMemo(()=>{let e={_fromLocation:le,...ce};return n.buildLocation(e)},[n,le,ce]),de=ue.maskedLocation?ue.maskedLocation.publicHref:ue.publicHref,fe=ue.maskedLocation?ue.maskedLocation.external:ue.external,pe=_.useMemo(()=>vr(de,fe,n.history,y),[y,fe,de,n.history]),me=_.useMemo(()=>{if(pe?.external)return F(pe.href,n.protocolAllowlist)?void 0:pe.href;if(!yr(s)&&typeof s==`string`&&s.indexOf(`:`)!==-1)try{return new URL(s),F(s,n.protocolAllowlist)?void 0:s}catch{}},[s,pe,n.protocolAllowlist]),he=_.useMemo(()=>{if(me)return!1;if(o?.exact){if(!Ve(le.pathname,ue.pathname,n.basepath))return!1}else{let e=Be(le.pathname,n.basepath),t=Be(ue.pathname,n.basepath);if(!(e.startsWith(t)&&(e.length===t.length||e[t.length]===`/`)))return!1}return(o?.includeSearch??!0)&&!ne(le.search,ue.search,{partial:!o?.exact,ignoreUndefined:!o?.explicitUndefined})?!1:!o?.includeHash||se&&le.hash===ue.hash},[o?.exact,o?.explicitUndefined,o?.includeHash,o?.includeSearch,le,me,se,ue.hash,ue.pathname,ue.search,n.basepath]),ge=he?w(i,{})??dr:ur,_e=he?ur:w(a,{})??ur,ve=[C,ge.className,_e.className].filter(Boolean).join(` `),ye=(S||ge.style||_e.style)&&{...S,...ge.style,..._e.style},[be,xe]=_.useState(!1),Se=_.useRef(!1),Ce=e.reloadDocument||me?!1:c??n.options.defaultPreload,we=l??n.options.defaultPreloadDelay??0,Te=_.useCallback(()=>{n.preloadRoute({...ce,_builtLocation:ue}).catch(e=>{console.warn(e),console.warn(mn)})},[n,ce,ue]);b(r,_.useCallback(e=>{e?.isIntersecting&&Te()},[Te]),gr,{disabled:!!y||Ce!==`viewport`}),_.useEffect(()=>{Se.current||!y&&Ce===`render`&&(Te(),Se.current=!0)},[y,Te,Ce]);let Ee=e=>{let t=e.currentTarget.getAttribute(`target`),r=v===void 0?t:v;if(!y&&!xr(e)&&!e.defaultPrevented&&(!r||r===`_self`)&&e.button===0){e.preventDefault(),(0,cr.flushSync)(()=>{xe(!0)});let t=n.subscribe(`onResolved`,()=>{t(),xe(!1)});n.navigate({...ce,replace:f,resetScroll:m,hashScrollIntoView:d,startTransition:p,viewTransition:h,ignoreBlocker:ee})}};if(me)return{...I,ref:r,href:me,...g&&{children:g},...v&&{target:v},...y&&{disabled:y},...S&&{style:S},...C&&{className:C},...T&&{onClick:T},...E&&{onBlur:E},...D&&{onFocus:D},...O&&{onMouseEnter:O},...k&&{onMouseLeave:k},...A&&{onTouchStart:A}};let De=e=>{if(y||Ce!==`intent`)return;if(!we){Te();return}let t=e.currentTarget;if(hr.has(t))return;let n=setTimeout(()=>{hr.delete(t),Te()},we);hr.set(t,n)},Oe=e=>{y||Ce!==`intent`||Te()},ke=e=>{if(y||!Ce||!we)return;let t=e.currentTarget,n=hr.get(t);n&&(clearTimeout(n),hr.delete(t))};return{...I,...ge,..._e,href:pe?.href,ref:r,onClick:_r([T,Ee]),onBlur:_r([E,ke]),onFocus:_r([D,De]),onMouseEnter:_r([O,De]),onMouseLeave:_r([k,ke]),onTouchStart:_r([A,Oe]),disabled:!!y,target:v,...ye&&{style:ye},...ve&&{className:ve},...y&&fr,...he&&pr,...se&&be&&mr}}var ur={},dr={className:`active`},fr={role:`link`,"aria-disabled":!0},pr={"data-status":`active`,"aria-current":`page`},mr={"data-transitioning":`transitioning`},hr=new WeakMap,gr={rootMargin:`100px`},_r=e=>t=>{for(let n of e)if(n){if(t.defaultPrevented)return;n(t)}};function vr(e,t,n,r){if(!r)return t?{href:e,external:!0}:{href:n.createHref(e)||`/`,external:!1}}function yr(e){if(typeof e!=`string`)return!1;let t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var br=_.forwardRef((e,t)=>{let{_asChild:n,...r}=e,{type:i,...a}=lr(r,t),o=typeof r.children==`function`?r.children({isActive:a[`data-status`]===`active`}):r.children;if(!n){let{disabled:e,...t}=a;return _.createElement(`a`,t,o)}return _.createElement(n,a,o)});function xr(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var Sr=class extends hn{constructor(e){super(e),this.useMatch=e=>tr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>sr({...e,from:this.id}),this.useSearch=e=>ar({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ir({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>rr({...e,from:this.id}),this.useLoaderData=e=>nr({...e,from:this.id}),this.useNavigate=()=>or({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,L.jsx)(br,{ref:t,from:this.fullPath,...e}))}};function Cr(e){return new Sr(e)}function wr(){return e=>Er(e)}var Tr=class extends gn{constructor(e){super(e),this.useMatch=e=>tr({select:e?.select,from:this.id,structuralSharing:e?.structuralSharing}),this.useRouteContext=e=>sr({...e,from:this.id}),this.useSearch=e=>ar({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useParams=e=>ir({select:e?.select,structuralSharing:e?.structuralSharing,from:this.id}),this.useLoaderDeps=e=>rr({...e,from:this.id}),this.useLoaderData=e=>nr({...e,from:this.id}),this.useNavigate=()=>or({from:this.fullPath}),this.Link=_.forwardRef((e,t)=>(0,L.jsx)(br,{ref:t,from:this.fullPath,...e}))}};function Er(e){return new Tr(e)}function Dr(e){return new Or(e,{silent:!0}).createRoute}var Or=class{constructor(e,t){this.path=e,this.createRoute=e=>{let t=Cr(e);return t.isRoot=!1,t},this.silent=t?.silent}};function kr(e){let t=Tn(),n=`not-found-${Qn(t.stores.location,e=>e.pathname)}-${Qn(t.stores.status,e=>e)}`;return(0,L.jsx)(vn,{getResetKey:()=>n,onCatch:(t,n)=>{if(qe(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(qe(t))return e.fallback?.(t);throw t},children:e.children})}function Ar(){return(0,L.jsx)(`p`,{children:`Not Found`})}function jr(e){return(0,L.jsx)(L.Fragment,{children:e.children})}function Mr(e,t,n){return t.options.notFoundComponent?(0,L.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,L.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,L.jsx)(Ar,{})}var Nr=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,Pr=(e,t)=>e[0]===t[0]&&e[1]===t[1],Fr=_.memo(function({matchId:e}){let t=Tn(),n=t.stores.matchStores.get(e);n||le();let r=Qn(t.stores.loadedAt,e=>e),i=Qn(n,e=>e,Nr);return(0,L.jsx)(Ir,{router:t,matchId:e,resetKey:r,matchState:_.useMemo(()=>{let e=i.routeId,n=t.routesById[e].parentRoute?.id;return{routeId:e,ssr:i.ssr,_displayPending:i._displayPending,parentRouteId:n}},[i._displayPending,i.routeId,i.ssr,t.routesById])})});function Ir({router:e,matchId:t,resetKey:n,matchState:r}){let i=e.routesById[r.routeId],a=i.options.pendingComponent??e.options.defaultPendingComponent,o=a?(0,L.jsx)(a,{}):null,s=i.options.errorComponent??e.options.defaultErrorComponent,c=i.options.onCatch??e.options.defaultOnCatch,l=i.isRoot?i.options.notFoundComponent??e.options.notFoundRoute?.options.component:i.options.notFoundComponent,u=r.ssr===!1||r.ssr===`data-only`,d=(!i.isRoot||i.options.wrapInSuspense||u)&&(i.options.wrapInSuspense??a??(i.options.errorComponent?.preload||u))?_.Suspense:jr,f=s?vn:jr,p=l?kr:jr;return(0,L.jsxs)(i.isRoot?i.options.shellComponent??jr:jr,{children:[(0,L.jsx)(En.Provider,{value:t,children:(0,L.jsx)(d,{fallback:o,children:(0,L.jsx)(f,{getResetKey:()=>n,errorComponent:s||bn,onCatch:(e,t)=>{if(qe(e))throw e.routeId??=r.routeId,e;c?.(e,t)},children:(0,L.jsx)(p,{fallback:e=>{if(e.routeId??=r.routeId,!l||e.routeId&&e.routeId!==r.routeId||!e.routeId&&!i.isRoot)throw e;return _.createElement(l,e)},children:u||r._displayPending?(0,L.jsx)(xn,{fallback:o,children:(0,L.jsx)(Rr,{matchId:t})}):(0,L.jsx)(Rr,{matchId:t})})})})}),r.parentRouteId===`__root__`?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(Lr,{}),(e.options.scrollRestoration,null)]}):null]})}function Lr(){let e=Tn(),t=_.useRef();return v(()=>{let n=e.stores.resolvedLocation.get(),r=t.current;n&&(!r||r.href!==n.href)&&e.emit({type:`onRendered`,...nn(e.stores.location.get(),r??n)}),t.current=n},[Qn(e.stores.resolvedLocation,e=>e?.state.__TSR_key),e]),null}var Rr=_.memo(function({matchId:e}){let t=Tn(),n=(e,n)=>t.getMatch(e.id)?._nonReactive[n]??e._nonReactive[n],r=t.stores.matchStores.get(e);r||le();let i=Qn(r,e=>e),a=i.routeId,o=t.routesById[a],s=_.useMemo(()=>{let e=(t.routesById[a].options.remountDeps??t.options.defaultRemountDeps)?.({routeId:a,loaderDeps:i.loaderDeps,params:i._strictParams,search:i._strictSearch});return e?JSON.stringify(e):void 0},[a,i.loaderDeps,i._strictParams,i._strictSearch,t.options.defaultRemountDeps,t.routesById]),c=_.useMemo(()=>{let e=o.options.component??t.options.defaultComponent;return e?(0,L.jsx)(e,{},s):(0,L.jsx)(zr,{})},[s,o.options.component,t.options.defaultComponent]);if(i._displayPending)throw n(i,`displayPendingPromise`);if(i._forcePending)throw n(i,`minPendingPromise`);if(i.status===`pending`){let e=o.options.pendingMinMs??t.options.defaultPendingMinMs;if(e){let n=t.getMatch(i.id);if(n&&!n._nonReactive.minPendingPromise){let t=N();n._nonReactive.minPendingPromise=t,setTimeout(()=>{t.resolve(),n._nonReactive.minPendingPromise=void 0},e)}}throw n(i,`loadPromise`)}if(i.status===`notFound`)return qe(i.error)||le(),Mr(t,o,i.error);if(i.status===`redirected`)throw _t(i.error)||le(),n(i,`loadPromise`);if(i.status===`error`)throw i.error;return c}),zr=_.memo(function(){let e=Tn(),t=_.useContext(En),n,r=!1,i;{let a=t?e.stores.matchStores.get(t):void 0;[n,r]=Qn(a,e=>[e?.routeId,e?.globalNotFound??!1],Pr),i=Qn(e.stores.matchesId,e=>e[e.findIndex(e=>e===t)+1])}let a=n?e.routesById[n]:void 0,o=e.options.defaultPendingComponent?(0,L.jsx)(e.options.defaultPendingComponent,{}):null;if(r)return a||le(),Mr(e,a,void 0);if(!i)return null;let s=(0,L.jsx)(Fr,{matchId:i});return n===`__root__`?(0,L.jsx)(_.Suspense,{fallback:o,children:s}):s});function Br(){let e=Tn(),t=_.useRef({router:e,mounted:!1}),[n,r]=_.useState(!1),i=Qn(e.stores.isLoading,e=>e),a=Qn(e.stores.hasPending,e=>e),o=y(i),s=i||n||a,c=y(s),l=i||a,u=y(l);return e.startTransition=e=>{r(!0),_.startTransition(()=>{e(),r(!1)})},_.useEffect(()=>{let t=e.history.subscribe(e.load),n=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Re(e.latestLocation.publicHref)!==Re(n.publicHref)&&e.commitLocation({...n,replace:!0}),()=>{t()}},[e,e.history]),v(()=>{typeof window<`u`&&e.ssr||t.current.router===e&&t.current.mounted||(t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(e){console.error(e)}})())},[e]),v(()=>{o&&!i&&e.emit({type:`onLoad`,...nn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[o,e,i]),v(()=>{u&&!l&&e.emit({type:`onBeforeRouteMount`,...nn(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,u,e]),v(()=>{if(c&&!s){let t=nn(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:`onResolved`,...t}),Hn(()=>{e.stores.status.set(`idle`),e.stores.resolvedLocation.set(e.stores.location.get())})}},[s,c,e]),null}function Vr(){let e=Tn(),t=e.routesById.__root__.options.pendingComponent??e.options.defaultPendingComponent,n=t?(0,L.jsx)(t,{}):null,r=(0,L.jsxs)(typeof document<`u`&&e.ssr?jr:_.Suspense,{fallback:n,children:[(0,L.jsx)(Br,{}),(0,L.jsx)(Hr,{})]});return e.options.InnerWrap?(0,L.jsx)(e.options.InnerWrap,{children:r}):r}function Hr(){let e=Tn(),t=Qn(e.stores.firstId,e=>e),n=Qn(e.stores.loadedAt,e=>e),r=t?(0,L.jsx)(Fr,{matchId:t}):null;return(0,L.jsx)(En.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:(0,L.jsx)(vn,{getResetKey:()=>n,errorComponent:bn,onCatch:void 0,children:r})})}var Ur=e=>({createMutableStore:Gn,createReadonlyStore:Gn,batch:Hn}),Wr=e=>new Gr(e),Gr=class extends rn{constructor(e){super(e,Ur)}};function Kr({router:e,children:t,...n}){D(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});let r=(0,L.jsx)(wn.Provider,{value:e,children:t});return e.options.Wrap?(0,L.jsx)(e.options.Wrap,{children:r}):r}function qr({router:e,...t}){return(0,L.jsx)(Kr,{router:e,...t,children:(0,L.jsx)(Vr,{})})}var Jr=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Yr=new class extends Jr{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Xr={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Zr=new class{#e=Xr;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Qr(e){setTimeout(e,0)}var $r=typeof window>`u`||`Deno`in globalThis;function ei(){}function ti(e,t){return typeof e==`function`?e(t):e}function ni(e){return typeof e==`number`&&e>=0&&e!==1/0}function ri(e,t){return Math.max(e+(t||0)-Date.now(),0)}function ii(e,t){return typeof e==`function`?e(t):e}function ai(e,t){return typeof e==`function`?e(t):e}function oi(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ci(o,t.options))return!1}else if(!ui(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function si(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(li(t.options.mutationKey)!==li(a))return!1}else if(!ui(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ci(e,t){return(t?.queryKeyHashFn||li)(e)}function li(e){return JSON.stringify(e,(e,t)=>mi(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function ui(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n500)return t;let r=pi(e)&&pi(t);if(!r&&!(mi(e)&&mi(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l{Zr.setTimeout(t,e)})}function _i(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:fi(e,t)}function vi(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function yi(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var bi=Symbol();function xi(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===bi?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Si(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ci=(()=>{let e=()=>$r;return{isServer(){return e()},setIsServer(t){e=t}}})();function wi(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var Ti=Qr;function Ei(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Ti,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Di=Ei(),Oi=new class extends Jr{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function ki(e){return Math.min(1e3*2**e,3e4)}function Ai(e){return(e??`online`)!==`online`||Oi.isOnline()}var ji=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Mi(e){let t=!1,n=0,r,i=wi(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new ji(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Yr.isFocused()&&(e.networkMode===`always`||Oi.isOnline())&&e.canRun(),u=()=>Ai(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(Ci.isServer()?0:3),o=e.retryDelay??ki,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&nl()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Ni=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ni(this.gcTime)&&(this.#e=Zr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Ci.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Zr.clearTimeout(this.#e),this.#e=void 0)}};function Pi(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{Si(e,()=>t.signal,()=>n=!0)},u=xi(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?yi:vi;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?R:Fi,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Fi(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(ct.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Fi(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function R(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Ii=class extends Ni{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=zi(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=zi(this.options);e.data!==void 0&&(this.setState(Ri(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=_i(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ei).catch(ei):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ai(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===bi||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>ii(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!ri(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=xi(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?Pi(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Mi({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof ji&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof ji){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Li(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Ri(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Di.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Li(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ai(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Ri(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function zi(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Bi=class extends Ni{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Vi(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Mi({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Di.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Vi(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Hi=class extends Jr{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Bi({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Ui(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Ui(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Ui(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Ui(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Di.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>si(t,e))}findAll(e={}){return this.getAll().filter(t=>si(e,t))}notify(e){Di.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Di.batch(()=>Promise.all(e.map(e=>e.continue().catch(ei))))}};function Ui(e){return e.options.scope?.id}var Wi=class extends Jr{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??ci(r,t),a=this.get(i);return a||(a=new Ii({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Di.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>oi(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>oi(e,t)):t}notify(e){Di.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Di.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Di.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Gi=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new Wi,this.#t=e.mutationCache||new Hi,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Yr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Oi.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(ii(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=ti(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Di.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Di.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Di.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Di.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ei).catch(ei)}invalidateQueries(e,t={}){return Di.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Di.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ei)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ei)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(ii(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ei).catch(ei)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ei).catch(ei)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Oi.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(li(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{ui(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(li(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{ui(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ci(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===bi&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Ki=_.createContext(void 0),qi=({client:e,children:t})=>(_.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,L.jsx)(Ki.Provider,{value:e,children:t})),Ji=(...e)=>e.filter((e,t,n)=>!!e&&e.trim()!==``&&n.indexOf(e)===t).join(` `).trim(),Yi=e=>e.replace(/([a-z0-9])([A-Z])/g,`$1-$2`).toLowerCase(),Xi=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()),Zi=e=>{let t=Xi(e);return t.charAt(0).toUpperCase()+t.slice(1)},Qi={xmlns:`http://www.w3.org/2000/svg`,width:24,height:24,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,strokeWidth:2,strokeLinecap:`round`,strokeLinejoin:`round`},$i=e=>{for(let t in e)if(t.startsWith(`aria-`)||t===`role`||t===`title`)return!0;return!1},ea=(0,_.forwardRef)(({color:e=`currentColor`,size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:i=``,children:a,iconNode:o,...s},c)=>(0,_.createElement)(`svg`,{ref:c,...Qi,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:Ji(`lucide`,i),...!a&&!$i(s)&&{"aria-hidden":`true`},...s},[...o.map(([e,t])=>(0,_.createElement)(e,t)),...Array.isArray(a)?a:[a]])),z=(e,t)=>{let n=(0,_.forwardRef)(({className:n,...r},i)=>(0,_.createElement)(ea,{ref:i,iconNode:t,className:Ji(`lucide-${Yi(Zi(e))}`,`lucide-${e}`,n),...r}));return n.displayName=Zi(e),n},ta=z(`arrow-left`,[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]),na=z(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),ra=z(`check`,[[`path`,{d:`M20 6 9 17l-5-5`,key:`1gmf2c`}]]),ia=z(`chevron-down`,[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]),aa=z(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),oa=z(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),sa=z(`chevron-up`,[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]),ca=z(`circle-check`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]),la=z(`external-link`,[[`path`,{d:`M15 3h6v6`,key:`1q9fwt`}],[`path`,{d:`M10 14 21 3`,key:`gplh6r`}],[`path`,{d:`M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6`,key:`a6xqqp`}]]),ua=z(`link-2`,[[`path`,{d:`M9 17H7A5 5 0 0 1 7 7h2`,key:`8i5ue5`}],[`path`,{d:`M15 7h2a5 5 0 1 1 0 10h-2`,key:`1b9ql8`}],[`line`,{x1:`8`,x2:`16`,y1:`12`,y2:`12`,key:`1jonct`}]]),da=z(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),fa=z(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),pa=z(`message-square-warning`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}],[`path`,{d:`M12 15h.01`,key:`q59x07`}],[`path`,{d:`M12 7v4`,key:`xawao1`}]]),ma=z(`moon`,[[`path`,{d:`M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401`,key:`kfwtm`}]]),ha=z(`pencil`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),ga=z(`plus`,[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]),_a=z(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),va=z(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]),ya=z(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]),ba=z(`star`,[[`path`,{d:`M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z`,key:`r04s7s`}]]),xa=z(`sun`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M12 2v2`,key:`tus03m`}],[`path`,{d:`M12 20v2`,key:`1lh1kg`}],[`path`,{d:`m4.93 4.93 1.41 1.41`,key:`149t6j`}],[`path`,{d:`m17.66 17.66 1.41 1.41`,key:`ptbguv`}],[`path`,{d:`M2 12h2`,key:`1t8f8n`}],[`path`,{d:`M20 12h2`,key:`1q8mjw`}],[`path`,{d:`m6.34 17.66-1.41 1.41`,key:`1m8zz5`}],[`path`,{d:`m19.07 4.93-1.41 1.41`,key:`1shlcs`}]]),Sa=z(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]),Ca=z(`x`,[[`path`,{d:`M18 6 6 18`,key:`1bl5f8`}],[`path`,{d:`m6 6 12 12`,key:`d8bk6v`}]]),wa=g(),Ta=`https://dbit.digitalcompass.agency/storage/v1/object/public/public-assets/GLM.png`,Ea=({BASE_URL:`/cruces-glm/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_DEMO_AUTH:`false`,VITE_REPORT_WEBHOOK_URL:`https://agenteit.digitalcompass.agency/webhook/cruces-glm-reportar`,VITE_SUPABASE_ANON_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE`,VITE_SUPABASE_URL:`https://dbit.digitalcompass.agency`}.VITE_DEMO_AUTH??`false`).trim().toLowerCase()===`true`,Da=`cruces-glm-supabase-session-v1`,Oa=({BASE_URL:`/cruces-glm/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_DEMO_AUTH:`false`,VITE_REPORT_WEBHOOK_URL:`https://agenteit.digitalcompass.agency/webhook/cruces-glm-reportar`,VITE_SUPABASE_ANON_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE`,VITE_SUPABASE_URL:`https://dbit.digitalcompass.agency`}.VITE_SUPABASE_URL??``).replace(/\/+$/,``),ka={BASE_URL:`/cruces-glm/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_DEMO_AUTH:`false`,VITE_REPORT_WEBHOOK_URL:`https://agenteit.digitalcompass.agency/webhook/cruces-glm-reportar`,VITE_SUPABASE_ANON_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE`,VITE_SUPABASE_URL:`https://dbit.digitalcompass.agency`}.VITE_SUPABASE_ANON_KEY??``,Aa={id:`demo-iaracena`,email:`iaracena@gomezleemarketing.com`,user_metadata:{full_name:`Isaac Aracena`,given_name:`Isaac`,family_name:`Aracena`}};function ja(){if(!Oa||!ka)throw Error(`Faltan VITE_SUPABASE_URL o VITE_SUPABASE_ANON_KEY en las variables de entorno.`)}function Ma(e){return(e??``).trim().toLowerCase()}function Na(){return typeof window>`u`?``:new URL(`/cruces-glm/`,window.location.origin).toString()}function Pa(e){window.localStorage.setItem(Da,JSON.stringify(e))}function Fa(){if(typeof window>`u`)return null;try{let e=window.localStorage.getItem(Da);if(!e)return null;let t=JSON.parse(e);return typeof t.accessToken!=`string`||typeof t.refreshToken!=`string`||typeof t.expiresAt!=`number`?null:t}catch{return null}}function Ia(){return Fa()?.accessToken??null}function La(){typeof window<`u`&&window.localStorage.removeItem(Da)}function Ra(){if(typeof window>`u`||!window.location.hash)return{freshLogin:!1};let e=new URLSearchParams(window.location.hash.slice(1)),t=e.get(`access_token`),n=e.get(`refresh_token`),r=e.get(`error_description`)??e.get(`error`);if(t&&n){let r=Number(e.get(`expires_at`)),i=Number(e.get(`expires_in`));Pa({accessToken:t,refreshToken:n,expiresAt:Number.isFinite(r)&&r>0?r:Math.floor(Date.now()/1e3)+(Number.isFinite(i)&&i>0?i:3600)})}return(t||r)&&window.history.replaceState({},document.title,`${window.location.pathname}${window.location.search}`),r?{message:decodeURIComponent(r),freshLogin:!1}:{freshLogin:!!(t&&n)}}async function za(e){ja();let t=await fetch(`${Oa}/auth/v1/token?grant_type=refresh_token`,{method:`POST`,headers:{apikey:ka,"content-type":`application/json`},body:JSON.stringify({refresh_token:e.refreshToken})});if(!t.ok)return La(),null;let n=await t.json();if(!n.access_token||!n.refresh_token)return La(),null;let r={accessToken:n.access_token,refreshToken:n.refresh_token,expiresAt:typeof n.expires_at==`number`?n.expires_at:Math.floor(Date.now()/1e3)+(n.expires_in??3600)};return Pa(r),r}async function Ba(e){if(!(!Oa||!ka))try{await fetch(`${Oa}/rest/v1/rpc/cruces_glm_record_login`,{method:`POST`,headers:{apikey:ka,Authorization:`Bearer ${e}`,"Content-Type":`application/json`},body:`{}`,keepalive:!0})}catch{}}async function Va(e){ja();let t=await fetch(`${Oa}/auth/v1/user`,{headers:{apikey:ka,Authorization:`Bearer ${e}`}});if(!t.ok)return null;let n=await t.json(),r=Ma(n.email);return!n.id||!r?null:{id:n.id,email:r,user_metadata:n.user_metadata}}async function Ha(e){ja();let t=await fetch(`${Oa}/rest/v1/rpc/cruces_glm_get_my_access`,{method:`POST`,headers:{apikey:ka,Authorization:`Bearer ${e}`,"Content-Type":`application/json`,Accept:`application/json`},body:`{}`});if(!t.ok)return{allowed:!1,canManageForms:!1};let n=(await t.json())[0],r=typeof n?.display_name==`string`&&n.display_name.trim()?n.display_name.trim():null;return{allowed:n?.allowed===!0,canManageForms:n?.allowed===!0&&n?.can_manage_forms===!0,...r?{displayName:r}:{}}}async function Ua(){try{ja();let e=Ra();if(e.message)return{status:`unauthenticated`,message:e.message};let t=Fa();if(!t)return{status:`unauthenticated`};let n=Math.floor(Date.now()/1e3);if(t.expiresAt<=n+30&&(t=await za(t),!t))return{status:`unauthenticated`};let r=await Va(t.accessToken);if(!r){let e=await za(t);if(!e)return{status:`unauthenticated`};t=e,r=await Va(e.accessToken)}if(!r)return La(),{status:`unauthenticated`};let i=await Ha(t.accessToken);return i.allowed?(i.displayName&&!r.user_metadata?.full_name&&(r={...r,user_metadata:{...r.user_metadata??{},full_name:i.displayName}}),e.freshLogin&&await Ba(t.accessToken),{status:`authenticated`,user:r,canManageForms:i.canManageForms}):(await Ga(),{status:`unauthenticated`,message:`La cuenta ${r.email} no tiene acceso a Cruces GLM.`})}catch(e){return La(),{status:`unauthenticated`,message:e instanceof Error?e.message:`No se pudo validar la sesión.`}}}function Wa(){if(ja(),typeof window>`u`)return;let e=Na(),t=new URLSearchParams({provider:`google`,redirect_to:e});window.location.assign(`${Oa}/auth/v1/authorize?${t.toString()}`)}async function Ga(){let e=Fa();if(La(),!(!e||!Oa||!ka))try{await fetch(`${Oa}/auth/v1/logout`,{method:`POST`,headers:{apikey:ka,Authorization:`Bearer ${e.accessToken}`}})}catch{}}var Ka=(0,_.createContext)(null);function qa(){let e=(0,_.useContext)(Ka);if(!e)throw Error(`useAuth debe usarse dentro de AuthGate.`);return e}function Ja(){return(0,L.jsxs)(`svg`,{viewBox:`0 0 24 24`,"aria-hidden":`true`,className:`size-5 shrink-0`,children:[(0,L.jsx)(`path`,{fill:`#4285F4`,d:`M21.6 12.23c0-.71-.06-1.4-.18-2.07H12v3.92h5.38a4.6 4.6 0 0 1-2 3.02v2.54h3.24c1.9-1.75 2.98-4.33 2.98-7.41Z`}),(0,L.jsx)(`path`,{fill:`#34A853`,d:`M12 22c2.7 0 4.98-.9 6.64-2.36l-3.24-2.54c-.9.6-2.05.96-3.4.96-2.61 0-4.82-1.76-5.61-4.13H3.04v2.62A10 10 0 0 0 12 22Z`}),(0,L.jsx)(`path`,{fill:`#FBBC05`,d:`M6.39 13.93A6.02 6.02 0 0 1 6.08 12c0-.67.12-1.32.31-1.93V7.45H3.04A10 10 0 0 0 2 12c0 1.61.39 3.13 1.04 4.55l3.35-2.62Z`}),(0,L.jsx)(`path`,{fill:`#EA4335`,d:`M12 5.94c1.47 0 2.79.5 3.83 1.5l2.88-2.88A9.64 9.64 0 0 0 12 2a10 10 0 0 0-8.96 5.45l3.35 2.62C7.18 7.7 9.39 5.94 12 5.94Z`})]})}function Ya({message:e,onDemoLogin:t}){let[n,r]=(0,_.useState)(!1),[i,a]=(0,_.useState)(),o=()=>{if(Ea){t();return}try{a(void 0),r(!0),Wa()}catch(e){r(!1),a(e instanceof Error?e.message:`No se pudo iniciar sesión.`)}},s=i??e;return(0,L.jsx)(`main`,{className:`glm-login-background min-h-screen px-5 py-10`,children:(0,L.jsxs)(`section`,{className:`glm-login-card`,"aria-label":`Inicio de sesión de Cruces GLM`,children:[(0,L.jsx)(`div`,{className:`glm-login-topline`}),(0,L.jsxs)(`div`,{className:`px-10 pt-11 pb-12 sm:px-12`,children:[(0,L.jsx)(`div`,{className:`mx-auto flex size-[92px] items-center justify-center rounded-[24px] border border-white/80 bg-white shadow-[0_14px_34px_rgba(79,117,139,0.12)]`,children:(0,L.jsx)(`img`,{src:Ta,alt:`GomezLee Marketing`,className:`w-[66px] max-w-full object-contain`})}),(0,L.jsxs)(`div`,{className:`mt-8 text-center`,children:[(0,L.jsx)(`h1`,{className:`text-[34px] leading-none font-semibold tracking-[-0.045em] text-[#45697D]`,children:`Cruces GLM`}),(0,L.jsx)(`p`,{className:`mt-3 text-[11px] font-bold tracking-[0.27em] text-[#7F95AE] uppercase`,children:`GomezLee Marketing`})]}),(0,L.jsxs)(`button`,{type:`button`,onClick:o,disabled:n,className:`mt-11 flex h-[52px] w-full items-center justify-center gap-3 rounded-[14px] bg-gradient-to-r from-[#466F87] to-[#628CA4] px-5 text-[14px] font-bold text-white shadow-[0_12px_24px_rgba(69,105,125,0.18)] transition hover:-translate-y-0.5 hover:shadow-[0_15px_30px_rgba(69,105,125,0.24)] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-glm-green focus-visible:ring-offset-2 disabled:cursor-wait disabled:opacity-75 disabled:hover:translate-y-0`,children:[n?(0,L.jsx)(da,{className:`size-5 animate-spin`,"aria-hidden":`true`}):(0,L.jsx)(Ja,{}),n?`Abriendo Google…`:`Continuar con Google`]}),s&&(0,L.jsx)(`p`,{role:`alert`,className:`mt-5 rounded-xl border border-red-100 bg-red-50 px-4 py-3 text-center text-xs leading-relaxed text-red-700`,children:s})]})]})})}function Xa(){return(0,L.jsx)(`main`,{className:`glm-login-background flex min-h-screen items-center justify-center px-5`,children:(0,L.jsxs)(`div`,{className:`flex items-center gap-3 rounded-2xl border border-white/80 bg-white/85 px-5 py-4 text-sm text-glm-blue shadow-lg backdrop-blur`,children:[(0,L.jsx)(da,{className:`size-5 animate-spin`}),`Validando sesión…`]})})}function Za({children:e}){let[t,n]=(0,_.useState)(Ea?{status:`unauthenticated`}:{status:`loading`});(0,_.useEffect)(()=>{if(Ea)return;let e=!0;return Ua().then(t=>{e&&n(t)}),()=>{e=!1}},[]);let r=(0,_.useMemo)(()=>t.status===`authenticated`?{user:t.user,canManageForms:t.canManageForms,logout:async()=>{Ea||await Ga(),n({status:`unauthenticated`})}}:null,[t]);return t.status===`loading`?(0,L.jsx)(Xa,{}):t.status===`unauthenticated`?(0,L.jsx)(Ya,{message:t.message,onDemoLogin:()=>n({status:`authenticated`,user:Aa,canManageForms:!0})}):(0,L.jsx)(Ka.Provider,{value:r,children:e})}function Qa(){return(0,L.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,L.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,L.jsx)(`h1`,{className:`text-7xl font-bold text-foreground`,children:`404`}),(0,L.jsx)(`h2`,{className:`mt-4 text-xl font-semibold text-foreground`,children:`Página no encontrada`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`La página que buscas no existe o fue movida.`}),(0,L.jsx)(`div`,{className:`mt-6`,children:(0,L.jsx)(br,{to:`/`,className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Ir al inicio`})})]})})}function $a({error:e,reset:t}){console.error(e);let n=Tn();return(0,L.jsx)(`div`,{className:`flex min-h-screen items-center justify-center bg-background px-4`,children:(0,L.jsxs)(`div`,{className:`max-w-md text-center`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-semibold tracking-tight text-foreground`,children:`Esta página no pudo cargar`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-muted-foreground`,children:`Ocurrió un error. Puedes intentar nuevamente o volver al inicio.`}),(0,L.jsxs)(`div`,{className:`mt-6 flex flex-wrap justify-center gap-2`,children:[(0,L.jsx)(`button`,{onClick:()=>{n.invalidate(),t()},className:`inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-medium text-primary-foreground transition-colors hover:bg-primary/90`,children:`Intentar nuevamente`}),(0,L.jsx)(br,{to:`/`,className:`inline-flex items-center justify-center rounded-md border border-input bg-background px-4 py-2 text-sm font-medium text-foreground transition-colors hover:bg-accent`,children:`Ir al inicio`})]})]})})}var eo=wr()({component:to,notFoundComponent:Qa,errorComponent:$a});function to(){let{queryClient:e}=eo.useRouteContext();return(0,L.jsx)(qi,{client:e,children:(0,L.jsx)(Za,{children:(0,L.jsx)(zr,{})})})}var no=Object.defineProperty,ro=(e,t)=>no(e,`name`,{value:t,configurable:!0});function io(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}ro(io,`setRef`);function ao(...e){return t=>{let n=!1,r=e.map(e=>{let r=io(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;too(e,`name`,{value:t,configurable:!0});function co(e){let t=_.forwardRef((t,n)=>{let{children:r,...i}=t,a=null,o=!1,s=[];_o(r)&&typeof xo==`function`&&(r=xo(r._payload)),_.Children.forEach(r,e=>{if(ho(e)){o=!0;let t=e,n=`child`in t.props?t.props.child:t.props.children;_o(n)&&typeof xo==`function`&&(n=xo(n._payload)),a=V(t,n),s.push(a?.props?.children)}else s.push(e)}),a?a=_.cloneElement(a,void 0,s):!o&&_.Children.count(r)===1&&_.isValidElement(r)&&(a=r);let c=a?mo(a):void 0,l=B(n,c);if(!a){if(r||r===0)throw Error(o?bo(e):yo(e));return r}let u=po(i,a.props??{});return a.type!==_.Fragment&&(u.ref=n?l:c),_.cloneElement(a,u)});return t.displayName=`${e}.Slot`,t}so(co,`createSlot`);var lo=co(`Slot`),uo=Symbol.for(`radix.slottable`);function fo(e){let t=so(e=>`child`in e?e.children(e.child):e.children,`Slottable`);return t.displayName=`${e}.Slottable`,t.__radixId=uo,t}so(fo,`createSlottable`);var V=so((e,t)=>{if(`child`in e.props){let t=e.props.child;return _.isValidElement(t)?_.cloneElement(t,void 0,e.props.children(t.props.children)):null}return _.isValidElement(t)?t:null},`getSlottableElementFromSlottable`);function po(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}}so(po,`mergeProps`);function mo(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)}so(mo,`getElementRef`);function ho(e){return _.isValidElement(e)&&typeof e.type==`function`&&`__radixId`in e.type&&e.type.__radixId===uo}so(ho,`isSlottable`);var go=Symbol.for(`react.lazy`);function _o(e){return typeof e==`object`&&!!e&&`$$typeof`in e&&e.$$typeof===go&&`_payload`in e&&vo(e._payload)}so(_o,`isLazyComponent`);function vo(e){return typeof e==`object`&&!!e&&`then`in e}so(vo,`isPromiseLike`);var yo=so(e=>`${e} failed to slot onto its children. Expected a single React element child or \`Slottable\`.`,`createSlotError`),bo=so(e=>`${e} failed to slot onto its \`Slottable\`. Expected \`Slottable\` to receive a single React element child.`,`createSlottableError`),xo=_.use;function So(e){var t,n,r=``;if(typeof e==`string`||typeof e==`number`)r+=e;else if(typeof e==`object`){if(Array.isArray(e)){var i=e.length;for(t=0;ttypeof e==`boolean`?`${e}`:e===0?`0`:e,To=Co,Eo=(e,t)=>n=>{if(t?.variants==null)return To(e,n?.class,n?.className);let{variants:r,defaultVariants:i}=t,a=Object.keys(r).map(e=>{let t=n?.[e],a=i?.[e];if(t===null)return null;let o=wo(t)||wo(a);return r[e][o]}),o=n&&Object.entries(n).reduce((e,t)=>{let[n,r]=t;return r===void 0||(e[n]=r),e},{});return To(e,a,t?.compoundVariants?.reduce((e,t)=>{let{class:n,className:r,...a}=t;return Object.entries(a).every(e=>{let[t,n]=e;return Array.isArray(n)?n.includes({...i,...o}[t]):{...i,...o}[t]===n})?[...e,n,r]:e},[]),n?.class,n?.className)},Do=(e,t)=>{let n=Array(e.length+t.length);for(let t=0;t({classGroupId:e,validator:t}),ko=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Ao=`-`,jo=[],Mo=`arbitrary..`,No=e=>{let t=Io(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:e=>{if(e.startsWith(`[`)&&e.endsWith(`]`))return Fo(e);let n=e.split(Ao);return Po(n,+(n[0]===``&&n.length>1),t)},getConflictingClassGroupIds:(e,t)=>{if(t){let t=r[e],i=n[e];return t?i?Do(i,t):t:i||jo}return n[e]||jo}}},Po=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;let r=e[t],i=n.nextPart.get(r);if(i){let n=Po(e,t+1,i);if(n)return n}let a=n.validators;if(a===null)return;let o=t===0?e.join(Ao):e.slice(t).join(Ao),s=a.length;for(let e=0;ee.slice(1,-1).indexOf(`:`)===-1?void 0:(()=>{let t=e.slice(1,-1),n=t.indexOf(`:`),r=t.slice(0,n);return r?Mo+r:void 0})(),Io=e=>{let{theme:t,classGroups:n}=e;return Lo(n,t)},Lo=(e,t)=>{let n=ko();for(let r in e){let i=e[r];Ro(i,n,r,t)}return n},Ro=(e,t,n,r)=>{let i=e.length;for(let a=0;a{if(typeof e==`string`){Bo(e,t,n);return}if(typeof e==`function`){Vo(e,t,n,r);return}Ho(e,t,n,r)},Bo=(e,t,n)=>{let r=e===``?t:Uo(t,e);r.classGroupId=n},Vo=(e,t,n,r)=>{if(Wo(e)){Ro(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(Oo(n,e))},Ho=(e,t,n,r)=>{let i=Object.entries(e),a=i.length;for(let e=0;e{let n=e,r=t.split(Ao),i=r.length;for(let e=0;e`isThemeGetter`in e&&e.isThemeGetter===!0,Go=e=>{if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null),i=(i,a)=>{n[i]=a,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(e){let t=n[e];if(t!==void 0)return t;if((t=r[e])!==void 0)return i(e,t),t},set(e,t){e in n?n[e]=t:i(e,t)}}},Ko=`!`,qo=`:`,Jo=[],Yo=(e,t,n,r,i)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:i}),Xo=e=>{let{prefix:t,experimentalParseClassName:n}=e,r=e=>{let t=[],n=0,r=0,i=0,a,o=e.length;for(let s=0;si?a-i:void 0;return Yo(t,l,c,u)};if(t){let e=t+qo,n=r;r=t=>t.startsWith(e)?n(t.slice(e.length)):Yo(Jo,!1,t,void 0,!0)}if(n){let e=r;r=t=>n({className:t,parseClassName:e})}return r},Zo=e=>{let t=new Map;return e.orderSensitiveModifiers.forEach((e,n)=>{t.set(e,1e6+n)}),e=>{let n=[],r=[];for(let i=0;i0&&(r.sort(),n.push(...r),r=[]),n.push(a)):r.push(a)}return r.length>0&&(r.sort(),n.push(...r)),n}},Qo=e=>({cache:Go(e.cacheSize),parseClassName:Xo(e),sortModifiers:Zo(e),postfixLookupClassGroupIds:$o(e),...No(e)}),$o=e=>{let t=Object.create(null),n=e.postfixLookupClassGroups;if(n)for(let e=0;e{let{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:i,sortModifiers:a,postfixLookupClassGroupIds:o}=t,s=[],c=e.trim().split(es),l=``;for(let e=c.length-1;e>=0;--e){let t=c[e],{isExternal:u,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:m}=n(t);if(u){l=t+(l.length>0?` `+l:l);continue}let h=!!m,g;if(h){g=r(p.substring(0,m));let e=g&&o[g]?r(p):void 0;e&&e!==g&&(g=e,h=!1)}else g=r(p);if(!g){if(!h){l=t+(l.length>0?` `+l:l);continue}if(g=r(p),!g){l=t+(l.length>0?` `+l:l);continue}h=!1}let _=d.length===0?``:d.length===1?d[0]:a(d).join(`:`),v=f?_+Ko:_,y=v+g;if(s.indexOf(y)>-1)continue;s.push(y);let b=i(g,h);for(let e=0;e0?` `+l:l)}return l},ns=(...e)=>{let t=0,n,r,i=``;for(;t{if(typeof e==`string`)return e;let t,n=``;for(let r=0;r{let n,r,i,a,o=o=>(n=Qo(t.reduce((e,t)=>t(e),e())),r=n.cache.get,i=n.cache.set,a=s,s(o)),s=e=>{let t=r(e);if(t)return t;let a=ts(e,n);return i(e,a),a};return a=o,(...e)=>a(ns(...e))},as=[],os=e=>{let t=t=>t[e]||as;return t.isThemeGetter=!0,t},ss=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,cs=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ls=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,us=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,ds=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,fs=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ps=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,ms=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,hs=e=>ls.test(e),H=e=>!!e&&!Number.isNaN(Number(e)),gs=e=>!!e&&Number.isInteger(Number(e)),_s=e=>e.endsWith(`%`)&&H(e.slice(0,-1)),vs=e=>us.test(e),ys=()=>!0,bs=e=>ds.test(e)&&!fs.test(e),xs=()=>!1,Ss=e=>ps.test(e),Cs=e=>ms.test(e),ws=e=>!U(e)&&!W(e),Ts=e=>e.startsWith(`@container`)&&(e[10]===`/`&&e[11]!==void 0||e[11]===`s`&&e[16]!==void 0&&e.startsWith(`-size/`,10)||e[11]===`n`&&e[18]!==void 0&&e.startsWith(`-normal/`,10)),Es=e=>Vs(e,Gs,xs),U=e=>ss.test(e),Ds=e=>Vs(e,Ks,bs),Os=e=>Vs(e,qs,H),ks=e=>Vs(e,Ys,ys),As=e=>Vs(e,Js,xs),js=e=>Vs(e,Us,xs),Ms=e=>Vs(e,Ws,Cs),Ns=e=>Vs(e,Xs,Ss),W=e=>cs.test(e),Ps=e=>Hs(e,Ks),Fs=e=>Hs(e,Js),Is=e=>Hs(e,Us),Ls=e=>Hs(e,Gs),Rs=e=>Hs(e,Ws),zs=e=>Hs(e,Xs,!0),Bs=e=>Hs(e,Ys,!0),Vs=(e,t,n)=>{let r=ss.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Hs=(e,t,n=!1)=>{let r=cs.exec(e);return r?r[1]?t(r[1]):n:!1},Us=e=>e===`position`||e===`percentage`,Ws=e=>e===`image`||e===`url`,Gs=e=>e===`length`||e===`size`||e===`bg-size`,Ks=e=>e===`length`,qs=e=>e===`number`,Js=e=>e===`family-name`,Ys=e=>e===`number`||e===`weight`,Xs=e=>e===`shadow`,Zs=is(()=>{let e=os(`color`),t=os(`font`),n=os(`text`),r=os(`font-weight`),i=os(`tracking`),a=os(`leading`),o=os(`breakpoint`),s=os(`container`),c=os(`spacing`),l=os(`radius`),u=os(`shadow`),d=os(`inset-shadow`),f=os(`text-shadow`),p=os(`drop-shadow`),m=os(`blur`),h=os(`perspective`),g=os(`aspect`),_=os(`ease`),v=os(`animate`),y=()=>[`auto`,`avoid`,`all`,`avoid-page`,`page`,`left`,`right`,`column`],b=()=>[`center`,`top`,`bottom`,`left`,`right`,`top-left`,`left-top`,`top-right`,`right-top`,`bottom-right`,`right-bottom`,`bottom-left`,`left-bottom`],x=()=>[...b(),W,U],S=()=>[`auto`,`hidden`,`clip`,`visible`,`scroll`],C=()=>[`auto`,`contain`,`none`],w=()=>[W,U,c],T=()=>[hs,`full`,`auto`,...w()],E=()=>[gs,`none`,`subgrid`,W,U],D=()=>[`auto`,{span:[`full`,gs,W,U]},gs,W,U],O=()=>[gs,`auto`,W,U],k=()=>[`auto`,`min`,`max`,`fr`,W,U],A=()=>[`start`,`end`,`center`,`between`,`around`,`evenly`,`stretch`,`baseline`,`center-safe`,`end-safe`],ee=()=>[`start`,`end`,`center`,`stretch`,`center-safe`,`end-safe`],j=()=>[`auto`,...w()],M=()=>[hs,`auto`,`full`,`dvw`,`dvh`,`lvw`,`lvh`,`svw`,`svh`,`min`,`max`,`fit`,...w()],te=()=>[hs,`screen`,`full`,`dvw`,`lvw`,`svw`,`min`,`max`,`fit`,...w()],ne=()=>[hs,`screen`,`full`,`lh`,`dvh`,`lvh`,`svh`,`min`,`max`,`fit`,...w()],N=()=>[e,W,U],P=()=>[...b(),Is,js,{position:[W,U]}],re=()=>[`no-repeat`,{repeat:[``,`x`,`y`,`space`,`round`]}],ie=()=>[`auto`,`cover`,`contain`,Ls,Es,{size:[W,U]}],ae=()=>[_s,Ps,Ds],oe=()=>[``,`none`,`full`,l,W,U],F=()=>[``,H,Ps,Ds],I=()=>[`solid`,`dashed`,`dotted`,`double`],se=()=>[`normal`,`multiply`,`screen`,`overlay`,`darken`,`lighten`,`color-dodge`,`color-burn`,`hard-light`,`soft-light`,`difference`,`exclusion`,`hue`,`saturation`,`color`,`luminosity`],ce=()=>[H,_s,Is,js],le=()=>[``,`none`,m,W,U],ue=()=>[`none`,H,W,U],de=()=>[`none`,H,W,U],fe=()=>[H,W,U],pe=()=>[hs,`full`,...w()];return{cacheSize:500,theme:{animate:[`spin`,`ping`,`pulse`,`bounce`],aspect:[`video`],blur:[vs],breakpoint:[vs],color:[ys],container:[vs],"drop-shadow":[vs],ease:[`in`,`out`,`in-out`],font:[ws],"font-weight":[`thin`,`extralight`,`light`,`normal`,`medium`,`semibold`,`bold`,`extrabold`,`black`],"inset-shadow":[vs],leading:[`none`,`tight`,`snug`,`normal`,`relaxed`,`loose`],perspective:[`dramatic`,`near`,`normal`,`midrange`,`distant`,`none`],radius:[vs],shadow:[vs],spacing:[`px`,H],text:[vs],"text-shadow":[vs],tracking:[`tighter`,`tight`,`normal`,`wide`,`wider`,`widest`]},classGroups:{aspect:[{aspect:[`auto`,`square`,hs,U,W,g]}],container:[`container`],"container-type":[{"@container":[``,`normal`,`size`,W,U]}],"container-named":[Ts],columns:[{columns:[H,U,W,s]}],"break-after":[{"break-after":y()}],"break-before":[{"break-before":y()}],"break-inside":[{"break-inside":[`auto`,`avoid`,`avoid-page`,`avoid-column`]}],"box-decoration":[{"box-decoration":[`slice`,`clone`]}],box:[{box:[`border`,`content`]}],display:[`block`,`inline-block`,`inline`,`flex`,`inline-flex`,`table`,`inline-table`,`table-caption`,`table-cell`,`table-column`,`table-column-group`,`table-footer-group`,`table-header-group`,`table-row-group`,`table-row`,`flow-root`,`grid`,`inline-grid`,`contents`,`list-item`,`hidden`],sr:[`sr-only`,`not-sr-only`],float:[{float:[`right`,`left`,`none`,`start`,`end`]}],clear:[{clear:[`left`,`right`,`both`,`none`,`start`,`end`]}],isolation:[`isolate`,`isolation-auto`],"object-fit":[{object:[`contain`,`cover`,`fill`,`none`,`scale-down`]}],"object-position":[{object:x()}],overflow:[{overflow:S()}],"overflow-x":[{"overflow-x":S()}],"overflow-y":[{"overflow-y":S()}],overscroll:[{overscroll:C()}],"overscroll-x":[{"overscroll-x":C()}],"overscroll-y":[{"overscroll-y":C()}],position:[`static`,`fixed`,`absolute`,`relative`,`sticky`],inset:[{inset:T()}],"inset-x":[{"inset-x":T()}],"inset-y":[{"inset-y":T()}],start:[{"inset-s":T(),start:T()}],end:[{"inset-e":T(),end:T()}],"inset-bs":[{"inset-bs":T()}],"inset-be":[{"inset-be":T()}],top:[{top:T()}],right:[{right:T()}],bottom:[{bottom:T()}],left:[{left:T()}],visibility:[`visible`,`invisible`,`collapse`],z:[{z:[gs,`auto`,W,U]}],basis:[{basis:[hs,`full`,`auto`,s,...w()]}],"flex-direction":[{flex:[`row`,`row-reverse`,`col`,`col-reverse`]}],"flex-wrap":[{flex:[`nowrap`,`wrap`,`wrap-reverse`]}],flex:[{flex:[H,hs,`auto`,`initial`,`none`,U]}],grow:[{grow:[``,H,W,U]}],shrink:[{shrink:[``,H,W,U]}],order:[{order:[gs,`first`,`last`,`none`,W,U]}],"grid-cols":[{"grid-cols":E()}],"col-start-end":[{col:D()}],"col-start":[{"col-start":O()}],"col-end":[{"col-end":O()}],"grid-rows":[{"grid-rows":E()}],"row-start-end":[{row:D()}],"row-start":[{"row-start":O()}],"row-end":[{"row-end":O()}],"grid-flow":[{"grid-flow":[`row`,`col`,`dense`,`row-dense`,`col-dense`]}],"auto-cols":[{"auto-cols":k()}],"auto-rows":[{"auto-rows":k()}],gap:[{gap:w()}],"gap-x":[{"gap-x":w()}],"gap-y":[{"gap-y":w()}],"justify-content":[{justify:[...A(),`normal`]}],"justify-items":[{"justify-items":[...ee(),`normal`]}],"justify-self":[{"justify-self":[`auto`,...ee()]}],"align-content":[{content:[`normal`,...A()]}],"align-items":[{items:[...ee(),{baseline:[``,`last`]}]}],"align-self":[{self:[`auto`,...ee(),{baseline:[``,`last`]}]}],"place-content":[{"place-content":A()}],"place-items":[{"place-items":[...ee(),`baseline`]}],"place-self":[{"place-self":[`auto`,...ee()]}],p:[{p:w()}],px:[{px:w()}],py:[{py:w()}],ps:[{ps:w()}],pe:[{pe:w()}],pbs:[{pbs:w()}],pbe:[{pbe:w()}],pt:[{pt:w()}],pr:[{pr:w()}],pb:[{pb:w()}],pl:[{pl:w()}],m:[{m:j()}],mx:[{mx:j()}],my:[{my:j()}],ms:[{ms:j()}],me:[{me:j()}],mbs:[{mbs:j()}],mbe:[{mbe:j()}],mt:[{mt:j()}],mr:[{mr:j()}],mb:[{mb:j()}],ml:[{ml:j()}],"space-x":[{"space-x":w()}],"space-x-reverse":[`space-x-reverse`],"space-y":[{"space-y":w()}],"space-y-reverse":[`space-y-reverse`],size:[{size:M()}],"inline-size":[{inline:[`auto`,...te()]}],"min-inline-size":[{"min-inline":[`auto`,...te()]}],"max-inline-size":[{"max-inline":[`none`,...te()]}],"block-size":[{block:[`auto`,...ne()]}],"min-block-size":[{"min-block":[`auto`,...ne()]}],"max-block-size":[{"max-block":[`none`,...ne()]}],w:[{w:[s,`screen`,...M()]}],"min-w":[{"min-w":[s,`screen`,`none`,...M()]}],"max-w":[{"max-w":[s,`screen`,`none`,`prose`,{screen:[o]},...M()]}],h:[{h:[`screen`,`lh`,...M()]}],"min-h":[{"min-h":[`screen`,`lh`,`none`,...M()]}],"max-h":[{"max-h":[`screen`,`lh`,...M()]}],"font-size":[{text:[`base`,n,Ps,Ds]}],"font-smoothing":[`antialiased`,`subpixel-antialiased`],"font-style":[`italic`,`not-italic`],"font-weight":[{font:[r,Bs,ks]}],"font-stretch":[{"font-stretch":[`ultra-condensed`,`extra-condensed`,`condensed`,`semi-condensed`,`normal`,`semi-expanded`,`expanded`,`extra-expanded`,`ultra-expanded`,_s,U]}],"font-family":[{font:[Fs,As,t]}],"font-features":[{"font-features":[U]}],"fvn-normal":[`normal-nums`],"fvn-ordinal":[`ordinal`],"fvn-slashed-zero":[`slashed-zero`],"fvn-figure":[`lining-nums`,`oldstyle-nums`],"fvn-spacing":[`proportional-nums`,`tabular-nums`],"fvn-fraction":[`diagonal-fractions`,`stacked-fractions`],tracking:[{tracking:[i,W,U]}],"line-clamp":[{"line-clamp":[H,`none`,W,Os]}],leading:[{leading:[a,...w()]}],"list-image":[{"list-image":[`none`,W,U]}],"list-style-position":[{list:[`inside`,`outside`]}],"list-style-type":[{list:[`disc`,`decimal`,`none`,W,U]}],"text-alignment":[{text:[`left`,`center`,`right`,`justify`,`start`,`end`]}],"placeholder-color":[{placeholder:N()}],"text-color":[{text:N()}],"text-decoration":[`underline`,`overline`,`line-through`,`no-underline`],"text-decoration-style":[{decoration:[...I(),`wavy`]}],"text-decoration-thickness":[{decoration:[H,`from-font`,`auto`,W,Ds]}],"text-decoration-color":[{decoration:N()}],"underline-offset":[{"underline-offset":[H,`auto`,W,U]}],"text-transform":[`uppercase`,`lowercase`,`capitalize`,`normal-case`],"text-overflow":[`truncate`,`text-ellipsis`,`text-clip`],"text-wrap":[{text:[`wrap`,`nowrap`,`balance`,`pretty`]}],indent:[{indent:w()}],"tab-size":[{tab:[gs,W,U]}],"vertical-align":[{align:[`baseline`,`top`,`middle`,`bottom`,`text-top`,`text-bottom`,`sub`,`super`,W,U]}],whitespace:[{whitespace:[`normal`,`nowrap`,`pre`,`pre-line`,`pre-wrap`,`break-spaces`]}],break:[{break:[`normal`,`words`,`all`,`keep`]}],wrap:[{wrap:[`break-word`,`anywhere`,`normal`]}],hyphens:[{hyphens:[`none`,`manual`,`auto`]}],content:[{content:[`none`,W,U]}],"bg-attachment":[{bg:[`fixed`,`local`,`scroll`]}],"bg-clip":[{"bg-clip":[`border`,`padding`,`content`,`text`]}],"bg-origin":[{"bg-origin":[`border`,`padding`,`content`]}],"bg-position":[{bg:P()}],"bg-repeat":[{bg:re()}],"bg-size":[{bg:ie()}],"bg-image":[{bg:[`none`,{linear:[{to:[`t`,`tr`,`r`,`br`,`b`,`bl`,`l`,`tl`]},gs,W,U],radial:[``,W,U],conic:[gs,W,U]},Rs,Ms]}],"bg-color":[{bg:N()}],"gradient-from-pos":[{from:ae()}],"gradient-via-pos":[{via:ae()}],"gradient-to-pos":[{to:ae()}],"gradient-from":[{from:N()}],"gradient-via":[{via:N()}],"gradient-to":[{to:N()}],rounded:[{rounded:oe()}],"rounded-s":[{"rounded-s":oe()}],"rounded-e":[{"rounded-e":oe()}],"rounded-t":[{"rounded-t":oe()}],"rounded-r":[{"rounded-r":oe()}],"rounded-b":[{"rounded-b":oe()}],"rounded-l":[{"rounded-l":oe()}],"rounded-ss":[{"rounded-ss":oe()}],"rounded-se":[{"rounded-se":oe()}],"rounded-ee":[{"rounded-ee":oe()}],"rounded-es":[{"rounded-es":oe()}],"rounded-tl":[{"rounded-tl":oe()}],"rounded-tr":[{"rounded-tr":oe()}],"rounded-br":[{"rounded-br":oe()}],"rounded-bl":[{"rounded-bl":oe()}],"border-w":[{border:F()}],"border-w-x":[{"border-x":F()}],"border-w-y":[{"border-y":F()}],"border-w-s":[{"border-s":F()}],"border-w-e":[{"border-e":F()}],"border-w-bs":[{"border-bs":F()}],"border-w-be":[{"border-be":F()}],"border-w-t":[{"border-t":F()}],"border-w-r":[{"border-r":F()}],"border-w-b":[{"border-b":F()}],"border-w-l":[{"border-l":F()}],"divide-x":[{"divide-x":F()}],"divide-x-reverse":[`divide-x-reverse`],"divide-y":[{"divide-y":F()}],"divide-y-reverse":[`divide-y-reverse`],"border-style":[{border:[...I(),`hidden`,`none`]}],"divide-style":[{divide:[...I(),`hidden`,`none`]}],"border-color":[{border:N()}],"border-color-x":[{"border-x":N()}],"border-color-y":[{"border-y":N()}],"border-color-s":[{"border-s":N()}],"border-color-e":[{"border-e":N()}],"border-color-bs":[{"border-bs":N()}],"border-color-be":[{"border-be":N()}],"border-color-t":[{"border-t":N()}],"border-color-r":[{"border-r":N()}],"border-color-b":[{"border-b":N()}],"border-color-l":[{"border-l":N()}],"divide-color":[{divide:N()}],"outline-style":[{outline:[...I(),`none`,`hidden`]}],"outline-offset":[{"outline-offset":[H,W,U]}],"outline-w":[{outline:[``,H,Ps,Ds]}],"outline-color":[{outline:N()}],shadow:[{shadow:[``,`none`,u,zs,Ns]}],"shadow-color":[{shadow:N()}],"inset-shadow":[{"inset-shadow":[`none`,d,zs,Ns]}],"inset-shadow-color":[{"inset-shadow":N()}],"ring-w":[{ring:F()}],"ring-w-inset":[`ring-inset`],"ring-color":[{ring:N()}],"ring-offset-w":[{"ring-offset":[H,Ds]}],"ring-offset-color":[{"ring-offset":N()}],"inset-ring-w":[{"inset-ring":F()}],"inset-ring-color":[{"inset-ring":N()}],"text-shadow":[{"text-shadow":[`none`,f,zs,Ns]}],"text-shadow-color":[{"text-shadow":N()}],opacity:[{opacity:[H,W,U]}],"mix-blend":[{"mix-blend":[...se(),`plus-darker`,`plus-lighter`]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]},`mask-no-clip`],"mask-composite":[{mask:[`add`,`subtract`,`intersect`,`exclude`]}],"mask-image-linear-pos":[{"mask-linear":[H]}],"mask-image-linear-from-pos":[{"mask-linear-from":ce()}],"mask-image-linear-to-pos":[{"mask-linear-to":ce()}],"mask-image-linear-from-color":[{"mask-linear-from":N()}],"mask-image-linear-to-color":[{"mask-linear-to":N()}],"mask-image-t-from-pos":[{"mask-t-from":ce()}],"mask-image-t-to-pos":[{"mask-t-to":ce()}],"mask-image-t-from-color":[{"mask-t-from":N()}],"mask-image-t-to-color":[{"mask-t-to":N()}],"mask-image-r-from-pos":[{"mask-r-from":ce()}],"mask-image-r-to-pos":[{"mask-r-to":ce()}],"mask-image-r-from-color":[{"mask-r-from":N()}],"mask-image-r-to-color":[{"mask-r-to":N()}],"mask-image-b-from-pos":[{"mask-b-from":ce()}],"mask-image-b-to-pos":[{"mask-b-to":ce()}],"mask-image-b-from-color":[{"mask-b-from":N()}],"mask-image-b-to-color":[{"mask-b-to":N()}],"mask-image-l-from-pos":[{"mask-l-from":ce()}],"mask-image-l-to-pos":[{"mask-l-to":ce()}],"mask-image-l-from-color":[{"mask-l-from":N()}],"mask-image-l-to-color":[{"mask-l-to":N()}],"mask-image-x-from-pos":[{"mask-x-from":ce()}],"mask-image-x-to-pos":[{"mask-x-to":ce()}],"mask-image-x-from-color":[{"mask-x-from":N()}],"mask-image-x-to-color":[{"mask-x-to":N()}],"mask-image-y-from-pos":[{"mask-y-from":ce()}],"mask-image-y-to-pos":[{"mask-y-to":ce()}],"mask-image-y-from-color":[{"mask-y-from":N()}],"mask-image-y-to-color":[{"mask-y-to":N()}],"mask-image-radial":[{"mask-radial":[W,U]}],"mask-image-radial-from-pos":[{"mask-radial-from":ce()}],"mask-image-radial-to-pos":[{"mask-radial-to":ce()}],"mask-image-radial-from-color":[{"mask-radial-from":N()}],"mask-image-radial-to-color":[{"mask-radial-to":N()}],"mask-image-radial-shape":[{"mask-radial":[`circle`,`ellipse`]}],"mask-image-radial-size":[{"mask-radial":[{closest:[`side`,`corner`],farthest:[`side`,`corner`]}]}],"mask-image-radial-pos":[{"mask-radial-at":b()}],"mask-image-conic-pos":[{"mask-conic":[H]}],"mask-image-conic-from-pos":[{"mask-conic-from":ce()}],"mask-image-conic-to-pos":[{"mask-conic-to":ce()}],"mask-image-conic-from-color":[{"mask-conic-from":N()}],"mask-image-conic-to-color":[{"mask-conic-to":N()}],"mask-mode":[{mask:[`alpha`,`luminance`,`match`]}],"mask-origin":[{"mask-origin":[`border`,`padding`,`content`,`fill`,`stroke`,`view`]}],"mask-position":[{mask:P()}],"mask-repeat":[{mask:re()}],"mask-size":[{mask:ie()}],"mask-type":[{"mask-type":[`alpha`,`luminance`]}],"mask-image":[{mask:[`none`,W,U]}],filter:[{filter:[``,`none`,W,U]}],blur:[{blur:le()}],brightness:[{brightness:[H,W,U]}],contrast:[{contrast:[H,W,U]}],"drop-shadow":[{"drop-shadow":[``,`none`,p,zs,Ns]}],"drop-shadow-color":[{"drop-shadow":N()}],grayscale:[{grayscale:[``,H,W,U]}],"hue-rotate":[{"hue-rotate":[H,W,U]}],invert:[{invert:[``,H,W,U]}],saturate:[{saturate:[H,W,U]}],sepia:[{sepia:[``,H,W,U]}],"backdrop-filter":[{"backdrop-filter":[``,`none`,W,U]}],"backdrop-blur":[{"backdrop-blur":le()}],"backdrop-brightness":[{"backdrop-brightness":[H,W,U]}],"backdrop-contrast":[{"backdrop-contrast":[H,W,U]}],"backdrop-grayscale":[{"backdrop-grayscale":[``,H,W,U]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[H,W,U]}],"backdrop-invert":[{"backdrop-invert":[``,H,W,U]}],"backdrop-opacity":[{"backdrop-opacity":[H,W,U]}],"backdrop-saturate":[{"backdrop-saturate":[H,W,U]}],"backdrop-sepia":[{"backdrop-sepia":[``,H,W,U]}],"border-collapse":[{border:[`collapse`,`separate`]}],"border-spacing":[{"border-spacing":w()}],"border-spacing-x":[{"border-spacing-x":w()}],"border-spacing-y":[{"border-spacing-y":w()}],"table-layout":[{table:[`auto`,`fixed`]}],caption:[{caption:[`top`,`bottom`]}],transition:[{transition:[``,`all`,`colors`,`opacity`,`shadow`,`transform`,`none`,W,U]}],"transition-behavior":[{transition:[`normal`,`discrete`]}],duration:[{duration:[H,`initial`,W,U]}],ease:[{ease:[`linear`,`initial`,_,W,U]}],delay:[{delay:[H,W,U]}],animate:[{animate:[`none`,v,W,U]}],backface:[{backface:[`hidden`,`visible`]}],perspective:[{perspective:[h,W,U]}],"perspective-origin":[{"perspective-origin":x()}],rotate:[{rotate:ue()}],"rotate-x":[{"rotate-x":ue()}],"rotate-y":[{"rotate-y":ue()}],"rotate-z":[{"rotate-z":ue()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":[`scale-3d`],skew:[{skew:fe()}],"skew-x":[{"skew-x":fe()}],"skew-y":[{"skew-y":fe()}],transform:[{transform:[W,U,``,`none`,`gpu`,`cpu`]}],"transform-origin":[{origin:x()}],"transform-style":[{transform:[`3d`,`flat`]}],translate:[{translate:pe()}],"translate-x":[{"translate-x":pe()}],"translate-y":[{"translate-y":pe()}],"translate-z":[{"translate-z":pe()}],"translate-none":[`translate-none`],zoom:[{zoom:[gs,W,U]}],accent:[{accent:N()}],appearance:[{appearance:[`none`,`auto`]}],"caret-color":[{caret:N()}],"color-scheme":[{scheme:[`normal`,`dark`,`light`,`light-dark`,`only-dark`,`only-light`]}],cursor:[{cursor:[`auto`,`default`,`pointer`,`wait`,`text`,`move`,`help`,`not-allowed`,`none`,`context-menu`,`progress`,`cell`,`crosshair`,`vertical-text`,`alias`,`copy`,`no-drop`,`grab`,`grabbing`,`all-scroll`,`col-resize`,`row-resize`,`n-resize`,`e-resize`,`s-resize`,`w-resize`,`ne-resize`,`nw-resize`,`se-resize`,`sw-resize`,`ew-resize`,`ns-resize`,`nesw-resize`,`nwse-resize`,`zoom-in`,`zoom-out`,W,U]}],"field-sizing":[{"field-sizing":[`fixed`,`content`]}],"pointer-events":[{"pointer-events":[`auto`,`none`]}],resize:[{resize:[`none`,``,`y`,`x`]}],"scroll-behavior":[{scroll:[`auto`,`smooth`]}],"scrollbar-thumb-color":[{"scrollbar-thumb":N()}],"scrollbar-track-color":[{"scrollbar-track":N()}],"scrollbar-gutter":[{"scrollbar-gutter":[`auto`,`stable`,`both`]}],"scrollbar-w":[{scrollbar:[`auto`,`thin`,`none`]}],"scroll-m":[{"scroll-m":w()}],"scroll-mx":[{"scroll-mx":w()}],"scroll-my":[{"scroll-my":w()}],"scroll-ms":[{"scroll-ms":w()}],"scroll-me":[{"scroll-me":w()}],"scroll-mbs":[{"scroll-mbs":w()}],"scroll-mbe":[{"scroll-mbe":w()}],"scroll-mt":[{"scroll-mt":w()}],"scroll-mr":[{"scroll-mr":w()}],"scroll-mb":[{"scroll-mb":w()}],"scroll-ml":[{"scroll-ml":w()}],"scroll-p":[{"scroll-p":w()}],"scroll-px":[{"scroll-px":w()}],"scroll-py":[{"scroll-py":w()}],"scroll-ps":[{"scroll-ps":w()}],"scroll-pe":[{"scroll-pe":w()}],"scroll-pbs":[{"scroll-pbs":w()}],"scroll-pbe":[{"scroll-pbe":w()}],"scroll-pt":[{"scroll-pt":w()}],"scroll-pr":[{"scroll-pr":w()}],"scroll-pb":[{"scroll-pb":w()}],"scroll-pl":[{"scroll-pl":w()}],"snap-align":[{snap:[`start`,`end`,`center`,`align-none`]}],"snap-stop":[{snap:[`normal`,`always`]}],"snap-type":[{snap:[`none`,`x`,`y`,`both`]}],"snap-strictness":[{snap:[`mandatory`,`proximity`]}],touch:[{touch:[`auto`,`none`,`manipulation`]}],"touch-x":[{"touch-pan":[`x`,`left`,`right`]}],"touch-y":[{"touch-pan":[`y`,`up`,`down`]}],"touch-pz":[`touch-pinch-zoom`],select:[{select:[`none`,`text`,`all`,`auto`]}],"will-change":[{"will-change":[`auto`,`scroll`,`contents`,`transform`,W,U]}],fill:[{fill:[`none`,...N()]}],"stroke-w":[{stroke:[H,Ps,Ds,Os]}],stroke:[{stroke:[`none`,...N()]}],"forced-color-adjust":[{"forced-color-adjust":[`auto`,`none`]}]},conflictingClassGroups:{"container-named":[`container-type`],overflow:[`overflow-x`,`overflow-y`],overscroll:[`overscroll-x`,`overscroll-y`],inset:[`inset-x`,`inset-y`,`inset-bs`,`inset-be`,`start`,`end`,`top`,`right`,`bottom`,`left`],"inset-x":[`right`,`left`],"inset-y":[`top`,`bottom`],flex:[`basis`,`grow`,`shrink`],gap:[`gap-x`,`gap-y`],p:[`px`,`py`,`ps`,`pe`,`pbs`,`pbe`,`pt`,`pr`,`pb`,`pl`],px:[`pr`,`pl`],py:[`pt`,`pb`],m:[`mx`,`my`,`ms`,`me`,`mbs`,`mbe`,`mt`,`mr`,`mb`,`ml`],mx:[`mr`,`ml`],my:[`mt`,`mb`],size:[`w`,`h`],"font-size":[`leading`],"fvn-normal":[`fvn-ordinal`,`fvn-slashed-zero`,`fvn-figure`,`fvn-spacing`,`fvn-fraction`],"fvn-ordinal":[`fvn-normal`],"fvn-slashed-zero":[`fvn-normal`],"fvn-figure":[`fvn-normal`],"fvn-spacing":[`fvn-normal`],"fvn-fraction":[`fvn-normal`],"line-clamp":[`display`,`overflow`],rounded:[`rounded-s`,`rounded-e`,`rounded-t`,`rounded-r`,`rounded-b`,`rounded-l`,`rounded-ss`,`rounded-se`,`rounded-ee`,`rounded-es`,`rounded-tl`,`rounded-tr`,`rounded-br`,`rounded-bl`],"rounded-s":[`rounded-ss`,`rounded-es`],"rounded-e":[`rounded-se`,`rounded-ee`],"rounded-t":[`rounded-tl`,`rounded-tr`],"rounded-r":[`rounded-tr`,`rounded-br`],"rounded-b":[`rounded-br`,`rounded-bl`],"rounded-l":[`rounded-tl`,`rounded-bl`],"border-spacing":[`border-spacing-x`,`border-spacing-y`],"border-w":[`border-w-x`,`border-w-y`,`border-w-s`,`border-w-e`,`border-w-bs`,`border-w-be`,`border-w-t`,`border-w-r`,`border-w-b`,`border-w-l`],"border-w-x":[`border-w-r`,`border-w-l`],"border-w-y":[`border-w-t`,`border-w-b`],"border-color":[`border-color-x`,`border-color-y`,`border-color-s`,`border-color-e`,`border-color-bs`,`border-color-be`,`border-color-t`,`border-color-r`,`border-color-b`,`border-color-l`],"border-color-x":[`border-color-r`,`border-color-l`],"border-color-y":[`border-color-t`,`border-color-b`],translate:[`translate-x`,`translate-y`,`translate-none`],"translate-none":[`translate`,`translate-x`,`translate-y`,`translate-z`],"scroll-m":[`scroll-mx`,`scroll-my`,`scroll-ms`,`scroll-me`,`scroll-mbs`,`scroll-mbe`,`scroll-mt`,`scroll-mr`,`scroll-mb`,`scroll-ml`],"scroll-mx":[`scroll-mr`,`scroll-ml`],"scroll-my":[`scroll-mt`,`scroll-mb`],"scroll-p":[`scroll-px`,`scroll-py`,`scroll-ps`,`scroll-pe`,`scroll-pbs`,`scroll-pbe`,`scroll-pt`,`scroll-pr`,`scroll-pb`,`scroll-pl`],"scroll-px":[`scroll-pr`,`scroll-pl`],"scroll-py":[`scroll-pt`,`scroll-pb`],touch:[`touch-x`,`touch-y`,`touch-pz`],"touch-x":[`touch`],"touch-y":[`touch`],"touch-pz":[`touch`]},conflictingClassGroupModifiers:{"font-size":[`leading`]},postfixLookupClassGroups:[`container-type`],orderSensitiveModifiers:[`*`,`**`,`after`,`backdrop`,`before`,`details-content`,`file`,`first-letter`,`first-line`,`marker`,`placeholder`,`selection`]}});function G(...e){return Zs(Co(e))}var Qs=Eo(`inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium cursor-pointer transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 disabled:cursor-not-allowed [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0`,{variants:{variant:{default:`bg-primary text-primary-foreground shadow hover:bg-primary/90`,destructive:`bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90`,outline:`border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground`,secondary:`bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80`,ghost:`hover:bg-accent hover:text-accent-foreground`,link:`text-primary underline-offset-4 hover:underline`},size:{default:`h-9 px-4 py-2`,sm:`h-8 rounded-md px-3 text-xs`,lg:`h-10 rounded-md px-8`,icon:`h-9 w-9`}},defaultVariants:{variant:`default`,size:`default`}}),$s=_.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...i},a)=>(0,L.jsx)(r?lo:`button`,{className:G(Qs({variant:t,size:n,className:e})),ref:a,...i}));$s.displayName=`Button`;var ec=_.forwardRef(({className:e,type:t,...n},r)=>(0,L.jsx)(`input`,{type:t,className:G(`flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:r,...n}));ec.displayName=`Input`;var tc=Object.defineProperty,nc=(e,t)=>tc(e,`name`,{value:t,configurable:!0});function rc(e,t){let n=_.createContext(t);n.displayName=e+`Context`;let r=nc(e=>{let{children:t,...r}=e,i=_.useMemo(()=>r,Object.values(r));return(0,L.jsx)(n.Provider,{value:i,children:t})},`Provider`);r.displayName=e+`Provider`;function i(r,i={}){let{optional:a=!1}=i,o=_.useContext(n);if(o)return o;if(t!==void 0)return t;if(!a)throw Error(`\`${r}\` must be used within \`${e}\``)}return nc(i,`useContext`),[r,i]}nc(rc,`createContext`);function ic(e,t=[]){let n=[];function r(t,r){let i=_.createContext(r);i.displayName=t+`Context`;let a=n.length;n=[...n,r];let o=nc(t=>{let{scope:n,children:r,...o}=t,s=n?.[e]?.[a]||i,c=_.useMemo(()=>o,Object.values(o));return(0,L.jsx)(s.Provider,{value:c,children:r})},`Provider`);o.displayName=t+`Provider`;function s(n,o,s={}){let{optional:c=!1}=s,l=o?.[e]?.[a]||i,u=_.useContext(l);if(u)return u;if(r!==void 0)return r;if(!c)throw Error(`\`${n}\` must be used within \`${t}\``)}return nc(s,`useContext`),[o,s]}nc(r,`createContext`);let i=nc(()=>{let t=n.map(e=>_.createContext(e));return nc(function(n){let r=n?.[e]||t;return _.useMemo(()=>({[`__scope${e}`]:{...n,[e]:r}}),[n,r])},`useScope`)},`createScope`);return i.scopeName=e,[r,ac(i,...t)]}nc(ic,`createContextScope`);function ac(...e){let t=e[0];if(e.length===1)return t;let n=nc(()=>{let n=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return nc(function(e){let r=n.reduce((t,{useScope:n,scopeName:r})=>{let i=n(e)[`__scope${r}`];return{...t,...i}},{});return _.useMemo(()=>({[`__scope${t.scopeName}`]:r}),[r])},`useComposedScopes`)},`createScope`);return n.scopeName=t.scopeName,n}nc(ac,`composeContextScopes`);var oc=Object.defineProperty,sc=(e,t)=>oc(e,`name`,{value:t,configurable:!0}),cc=!!(typeof window<`u`&&window.document&&window.document.createElement);function K(e,t,{checkForDefaultPrevented:n=!0}={}){return sc(function(r){if(e?.(r),n===!1||!r||!r.defaultPrevented)return t?.(r)},`handleEvent`)}sc(K,`composeEventHandlers`);function lc(e){if(!cc)throw Error(`Cannot access window outside of the DOM`);return e?.ownerDocument?.defaultView??window}sc(lc,`getOwnerWindow`);function uc(e){if(!cc)throw Error(`Cannot access document outside of the DOM`);return e?.ownerDocument??document}sc(uc,`getOwnerDocument`);function dc(e,t=!1){let{activeElement:n}=uc(e);if(!n?.nodeName)return null;if(fc(n)&&n.contentDocument)return dc(n.contentDocument.body,t);if(t){let e=n.getAttribute(`aria-activedescendant`);if(e){let t=uc(n).getElementById(e);if(t)return t}}return n}sc(dc,`getActiveElement`);function fc(e){return e.tagName===`IFRAME`}sc(fc,`isFrame`);var pc=globalThis?.document?_.useLayoutEffect:()=>{},mc=Object.defineProperty,hc=(e,t)=>mc(e,`name`,{value:t,configurable:!0}),gc=_.useId||(()=>void 0),_c=0;function vc(e){let[t,n]=_.useState(gc());return pc(()=>{e||n(e=>e??String(_c++))},[e]),e||(t?`radix-${t}`:``)}hc(vc,`useId`);var yc=Object.defineProperty,bc=(e,t)=>yc(e,`name`,{value:t,configurable:!0}),xc=_.useEffectEvent,Sc=_.useInsertionEffect;function Cc(e){if(typeof xc==`function`)return xc(e);let t=_.useRef(()=>{throw Error(`Cannot call an event handler while rendering.`)});return typeof Sc==`function`?Sc(()=>{t.current=e}):pc(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}bc(Cc,`useEffectEvent`);var wc=Object.defineProperty,Tc=(e,t)=>wc(e,`name`,{value:t,configurable:!0}),Ec=_.useInsertionEffect||pc;function Dc({prop:e,defaultProp:t,onChange:n=Tc(()=>{},`onChange`),caller:r}){let[i,a,o]=Oc({defaultProp:t,onChange:n}),s=e!==void 0;return[s?e:i,_.useCallback(t=>{if(s){let n=kc(t)?t(e):t;n!==e&&o.current?.(n)}else a(t)},[s,e,a,o])]}Tc(Dc,`useControllableState`);function Oc({defaultProp:e,onChange:t}){let[n,r]=_.useState(e),i=_.useRef(n),a=_.useRef(t);return Ec(()=>{a.current=t},[t]),_.useEffect(()=>{i.current!==n&&(a.current?.(n),i.current=n)},[n,i]),[n,r,a]}Tc(Oc,`useUncontrolledState`);function kc(e){return typeof e==`function`}Tc(kc,`isFunction`);var Ac=Symbol(`RADIX:SYNC_STATE`);function jc(e,t,n,r){let{prop:i,defaultProp:a,onChange:o,caller:s}=t,c=i!==void 0,l=Cc(o),u=[{...n,state:a}];r&&u.push(r);let[d,f]=_.useReducer((t,n)=>{if(n.type===Ac)return{...t,state:n.state};let r=e(t,n);return c&&!Object.is(r.state,t.state)&&l(r.state),r},...u),p=d.state,m=_.useRef(p);_.useEffect(()=>{m.current!==p&&(m.current=p,c||l(p))},[p,m,c]);let h=_.useMemo(()=>i===void 0?d:{...d,state:i},[d,i]);return _.useEffect(()=>{c&&!Object.is(i,d.state)&&f({type:Ac,state:i})},[i,d.state,c]),[h,f]}Tc(jc,`useControllableStateReducer`);var Mc=Object.defineProperty,Nc=(e,t)=>Mc(e,`name`,{value:t,configurable:!0}),q=[`a`,`button`,`div`,`form`,`h2`,`h3`,`img`,`input`,`label`,`li`,`nav`,`ol`,`p`,`select`,`span`,`svg`,`ul`].reduce((e,t)=>{let n=co(`Primitive.${t}`),r=_.forwardRef((e,r)=>{let{asChild:i,...a}=e,o=i?n:t;return typeof window<`u`&&(window[Symbol.for(`radix-ui`)]=!0),(0,L.jsx)(o,{...a,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function Pc(e,t){e&&cr.flushSync(()=>e.dispatchEvent(t))}Nc(Pc,`dispatchDiscreteCustomEvent`);var Fc=Object.defineProperty,Ic=(e,t)=>Fc(e,`name`,{value:t,configurable:!0});function Lc(e){let t=_.useRef(e);return _.useEffect(()=>{t.current=e}),_.useMemo(()=>((...e)=>t.current?.(...e)),[])}Ic(Lc,`useCallbackRef`);var Rc=Object.defineProperty,zc=(e,t)=>Rc(e,`name`,{value:t,configurable:!0}),Bc=`dismissableLayer.update`,Vc=`dismissableLayer.pointerDownOutside`,Hc=`dismissableLayer.focusOutside`,Uc,Wc=_.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set,dismissableSurfaces:new Set}),Gc=_.forwardRef(zc(function(e,t){let{disableOutsidePointerEvents:n=!1,deferPointerDownOutside:r=!1,onEscapeKeyDown:i,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:s,onDismiss:c,...l}=e,u=_.useContext(Wc),[d,f]=_.useState(null),p=d?.ownerDocument??globalThis?.document,[,m]=_.useState({}),h=B(t,f),g=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=v?g.indexOf(v):-1,b=d?g.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=b>=y,C=_.useRef(!1),w=Jc(e=>{a?.(e),s?.(e),e.defaultPrevented||c?.()},{ownerDocument:p,deferPointerDownOutside:r,isDeferredPointerDownOutsideRef:C,dismissableSurfaces:u.dismissableSurfaces,shouldHandlePointerDownOutside:_.useCallback(e=>{if(!(e instanceof Node))return!1;let t=[...u.branches].some(t=>t.contains(e));return S&&!t},[u.branches,S])}),T=Yc(e=>{if(r&&C.current)return;let t=e.target;[...u.branches].some(e=>e.contains(t))||(o?.(e),s?.(e),e.defaultPrevented||c?.())},p),E=d?b===g.length-1:!1,D=Lc(e=>{e.key===`Escape`&&(i?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))});return _.useEffect(()=>{if(E)return p.addEventListener(`keydown`,D,{capture:!0}),()=>p.removeEventListener(`keydown`,D,{capture:!0})},[p,E,D]),_.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Uc=p.body.style.pointerEvents,p.body.style.pointerEvents=`none`),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),Xc(),()=>{n&&(u.layersWithOutsidePointerEventsDisabled.delete(d),u.layersWithOutsidePointerEventsDisabled.size===0&&(p.body.style.pointerEvents=Uc))}},[d,p,n,u]),_.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),Xc())},[d,u]),_.useEffect(()=>{let e=zc(()=>m({}),`handleUpdate`);return document.addEventListener(Bc,e),()=>document.removeEventListener(Bc,e)},[]),(0,L.jsx)(q.div,{...l,ref:h,style:{pointerEvents:x?S?`auto`:`none`:void 0,...e.style},onFocusCapture:K(e.onFocusCapture,T.onFocusCapture),onBlurCapture:K(e.onBlurCapture,T.onBlurCapture),onPointerDownCapture:K(e.onPointerDownCapture,w.onPointerDownCapture)})},`DismissableLayer`));function Kc(){let e=_.useContext(Wc),[t,n]=_.useState(null);return _.useEffect(()=>{if(t)return e.dismissableSurfaces.add(t),()=>{e.dismissableSurfaces.delete(t)}},[t,e.dismissableSurfaces]),n}zc(Kc,`useDismissableLayerSurface`);var qc=zc(()=>!0,`IS_TRUE`);function Jc(e,t){let{ownerDocument:n=globalThis?.document,deferPointerDownOutside:r=!1,isDeferredPointerDownOutsideRef:i,dismissableSurfaces:a,shouldHandlePointerDownOutside:o=qc}=t,s=Lc(e),c=_.useRef(!1),l=_.useRef(!1),u=_.useRef(new Map),d=_.useRef(()=>{});return _.useEffect(()=>{function e(){l.current=!1,i.current=!1,u.current.clear()}zc(e,`resetOutsideInteraction`);function t(){return Array.from(u.current.values()).some(Boolean)}zc(t,`isOutsideInteractionIntercepted`);function f(e){if(!l.current)return;let t=e.target;t instanceof Node&&[...a].some(e=>e.contains(t))||u.current.set(e.type,!0),e.type===`click`&&window.setTimeout(()=>{l.current&&d.current()},0)}zc(f,`handleInteractionCapture`);function p(e){l.current&&u.current.set(e.type,!1)}zc(p,`handleInteractionBubble`);let m=zc(a=>{if(a.target&&!c.current){let f=function(){n.removeEventListener(`click`,d.current);let r=t();e(),r||Zc(Vc,s,p,{discrete:!0})};if(zc(f,`handleAndDispatchPointerDownOutsideEvent`),!o(a.target)){n.removeEventListener(`click`,d.current),e(),c.current=!1;return}let p={originalEvent:a};l.current=!0,i.current=r&&a.button===0,u.current.clear(),!r||a.button!==0?f():(n.removeEventListener(`click`,d.current),d.current=f,n.addEventListener(`click`,d.current,{once:!0}))}else n.removeEventListener(`click`,d.current),e();c.current=!1},`handlePointerDown`),h=[`pointerup`,`mousedown`,`mouseup`,`touchstart`,`touchend`,`click`];for(let e of h)n.addEventListener(e,f,!0),n.addEventListener(e,p);let g=window.setTimeout(()=>{n.addEventListener(`pointerdown`,m)},0);return()=>{window.clearTimeout(g),n.removeEventListener(`pointerdown`,m),n.removeEventListener(`click`,d.current);for(let e of h)n.removeEventListener(e,f,!0),n.removeEventListener(e,p)}},[n,s,r,i,a,o]),{onPointerDownCapture:zc(()=>c.current=!0,`onPointerDownCapture`)}}zc(Jc,`usePointerDownOutside`);function Yc(e,t=globalThis?.document){let n=Lc(e),r=_.useRef(!1);return _.useEffect(()=>{let e=zc(e=>{e.target&&!r.current&&Zc(Hc,n,{originalEvent:e},{discrete:!1})},`handleFocus`);return t.addEventListener(`focusin`,e),()=>t.removeEventListener(`focusin`,e)},[t,n]),{onFocusCapture:zc(()=>r.current=!0,`onFocusCapture`),onBlurCapture:zc(()=>r.current=!1,`onBlurCapture`)}}zc(Yc,`useFocusOutside`);function Xc(){let e=new CustomEvent(Bc);document.dispatchEvent(e)}zc(Xc,`dispatchUpdate`);function Zc(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?Pc(i,a):i.dispatchEvent(a)}zc(Zc,`handleAndDispatchCustomEvent`);var Qc=Object.defineProperty,$c=(e,t)=>Qc(e,`name`,{value:t,configurable:!0}),el=`focusScope.autoFocusOnMount`,tl=`focusScope.autoFocusOnUnmount`,nl={bubbles:!1,cancelable:!0},rl=_.forwardRef($c(function(e,t){let{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...o}=e,[s,c]=_.useState(null),l=Lc(i),u=Lc(a),d=_.useRef(null),f=B(t,c),p=_.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;_.useEffect(()=>{if(r){let e=function(e){if(p.paused||!s)return;let t=e.target;s.contains(t)?d.current=t:ul(d.current,{select:!0})},t=function(e){if(p.paused||!s)return;let t=e.relatedTarget;t!==null&&(s.contains(t)||ul(d.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&ul(s)};$c(e,`handleFocusIn`),$c(t,`handleFocusOut`),$c(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]),_.useEffect(()=>{if(s){dl.add(p);let e=document.activeElement;if(!s.contains(e)){let t=new CustomEvent(el,nl);s.addEventListener(el,l),s.dispatchEvent(t),t.defaultPrevented||(il(ml(ol(s)),{select:!0}),document.activeElement===e&&ul(s))}return()=>{s.removeEventListener(el,l),setTimeout(()=>{let t=new CustomEvent(tl,nl);s.addEventListener(tl,u),s.dispatchEvent(t),t.defaultPrevented||ul(e??document.body,{select:!0}),s.removeEventListener(tl,u),dl.remove(p)},0)}}},[s,l,u,p]);let m=_.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]=al(t);r&&a?!e.shiftKey&&i===a?(e.preventDefault(),n&&ul(r,{select:!0})):e.shiftKey&&i===r&&(e.preventDefault(),n&&ul(a,{select:!0})):i===t&&e.preventDefault()}},[n,r,p.paused]);return(0,L.jsx)(q.div,{tabIndex:-1,...o,ref:f,onKeyDown:m})},`FocusScope`));function il(e,{select:t=!1}={}){let n=document.activeElement;for(let r of e)if(ul(r,{select:t}),document.activeElement!==n)return}$c(il,`focusFirst`);function al(e){let t=ol(e);return[sl(t,e),sl(t.reverse(),e)]}$c(al,`getTabbableEdges`);function ol(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:$c(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}$c(ol,`getTabbableCandidates`);function sl(e,t){let n=typeof t.checkVisibility==`function`&&t.checkVisibility({checkVisibilityCSS:!0});for(let r of e)if(!(n?!r.checkVisibility({checkVisibilityCSS:!0}):cl(r,{upTo:t})))return r}$c(sl,`findVisible`);function cl(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}$c(cl,`isHidden`);function ll(e){return e instanceof HTMLInputElement&&`select`in e}$c(ll,`isSelectableInput`);function ul(e,{select:t=!1}={}){if(e&&e.focus){let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&ll(e)&&t&&e.select()}}$c(ul,`focus`);var dl=fl();function fl(){let e=[];return{add(t){let n=e[0];t!==n&&n?.pause(),e=pl(e,t),e.unshift(t)},remove(t){e=pl(e,t),e[0]?.resume()}}}$c(fl,`createFocusScopesStack`);function pl(e,t){let n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}$c(pl,`arrayRemove`);function ml(e){return e.filter(e=>e.tagName!==`A`)}$c(ml,`removeLinks`);var hl=Object.defineProperty,gl=_.forwardRef(((e,t)=>hl(e,`name`,{value:t,configurable:!0}))(function(e,t){let{container:n,...r}=e,[i,a]=_.useState(!1);pc(()=>a(!0),[]);let o=n||i&&globalThis?.document?.body;return o?cr.createPortal((0,L.jsx)(q.div,{...r,ref:t}),o):null},`Portal`)),_l=Object.defineProperty,vl=(e,t)=>_l(e,`name`,{value:t,configurable:!0});function yl(e,t){return _.useReducer((e,n)=>t[e][n]??e,e)}vl(yl,`useStateMachine`);var bl=vl(e=>{let{present:t,children:n}=e,r=xl(t),i=typeof n==`function`?n({present:r.isPresent}):_.Children.only(n),a=Cl(r.ref,Tl(i));return typeof n==`function`||r.isPresent?_.cloneElement(i,{ref:a}):null},`Presence`);function xl(e){let[t,n]=_.useState(),r=_.useRef(null),i=_.useRef(e),a=_.useRef(`none`),o=_.useRef(void 0),[s,c]=yl(e?`mounted`:`unmounted`,{mounted:{UNMOUNT:`unmounted`,ANIMATION_OUT:`unmountSuspended`},unmountSuspended:{MOUNT:`mounted`,ANIMATION_END:`unmounted`},unmounted:{MOUNT:`mounted`}});return _.useEffect(()=>{s===`mounted`?(a.current=o.current??wl(r.current),o.current=void 0):a.current=`none`},[s]),pc(()=>{let t=r.current,n=i.current;if(n!==e){let r=a.current,s=wl(t);e?(o.current=s,c(`MOUNT`)):s===`none`||t?.display===`none`?c(`UNMOUNT`):c(n&&r!==s?`ANIMATION_OUT`:`UNMOUNT`),i.current=e}},[e,c]),pc(()=>{if(t){let e,n=t.ownerDocument.defaultView??window,o=vl(a=>{let o=wl(r.current).includes(CSS.escape(a.animationName));if(a.target===t&&o&&(c(`ANIMATION_END`),!i.current)){let r=t.style.animationFillMode;t.style.animationFillMode=`forwards`,e=n.setTimeout(()=>{t.style.animationFillMode===`forwards`&&(t.style.animationFillMode=r)})}},`handleAnimationEnd`),s=vl(e=>{e.target===t&&(a.current=wl(r.current))},`handleAnimationStart`);return t.addEventListener(`animationstart`,s),t.addEventListener(`animationcancel`,o),t.addEventListener(`animationend`,o),()=>{n.clearTimeout(e),t.removeEventListener(`animationstart`,s),t.removeEventListener(`animationcancel`,o),t.removeEventListener(`animationend`,o)}}c(`ANIMATION_END`)},[t,c]),{isPresent:[`mounted`,`unmountSuspended`].includes(s),ref:_.useCallback(e=>{if(e){let t=getComputedStyle(e);r.current=t,o.current=wl(t)}else r.current=null;n(e)},[])}}vl(xl,`usePresence`);function Sl(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}vl(Sl,`setRef`);function Cl(...e){let t=_.useRef(e);return t.current=e,_.useCallback(e=>{let n=t.current,r=!1,i=n.map(t=>{let n=Sl(t,e);return!r&&typeof n==`function`&&(r=!0),n});if(r)return()=>{for(let e=0;eEl(e,`name`,{value:t,configurable:!0}),Ol=0,kl=null;function Al(e){return jl(),e.children}Dl(Al,`FocusGuards`);function jl(){_.useEffect(()=>{kl||={start:Ml(),end:Ml()};let{start:e,end:t}=kl;return document.body.firstElementChild!==e&&document.body.insertAdjacentElement(`afterbegin`,e),document.body.lastElementChild!==t&&document.body.insertAdjacentElement(`beforeend`,t),Ol++,()=>{Ol===1&&(kl?.start.remove(),kl?.end.remove(),kl=null),Ol=Math.max(0,Ol-1)}},[])}Dl(jl,`useFocusGuards`);function Ml(){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}Dl(Ml,`createFocusGuard`);var Nl=function(){return Nl=Object.assign||function(e){for(var t,n=1,r=arguments.length;n`u`)return nu;var t=iu(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])}},ou=tu(),su=`data-scroll-locked`,cu=function(e,t,n,r){var i=e.left,a=e.top,o=e.right,s=e.gap;return n===void 0&&(n=`margin`),` .${Ll} { overflow: hidden ${r}; padding-right: ${s}px ${r}; } body[${su}] { overflow: hidden ${r}; overscroll-behavior: contain; ${[t&&`position: relative ${r};`,n===`margin`&&` padding-left: ${i}px; padding-top: ${a}px; padding-right: ${o}px; margin-left:0; margin-top:0; margin-right: ${s}px ${r}; `,n===`padding`&&`padding-right: ${s}px ${r};`].filter(Boolean).join(``)} } .${Il} { right: ${s}px ${r}; } .${J} { margin-right: ${s}px ${r}; } .${Il} .${Il} { right: 0 ${r}; } .${J} .${J} { margin-right: 0 ${r}; } body[${su}] { ${Y}: ${s}px; } `},lu=function(){var e=parseInt(document.body.getAttribute(`data-scroll-locked`)||`0`,10);return isFinite(e)?e:0},uu=function(){_.useEffect(function(){return document.body.setAttribute(su,(lu()+1).toString()),function(){var e=lu()-1;e<=0?document.body.removeAttribute(su):document.body.setAttribute(su,e.toString())}},[])},du=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,i=r===void 0?`margin`:r;uu();var a=_.useMemo(function(){return au(i)},[i]);return _.createElement(ou,{styles:cu(a,!t,i,n?``:`!important`)})},fu=!1;if(typeof window<`u`)try{var pu=Object.defineProperty({},"passive",{get:function(){return fu=!0,!0}});window.addEventListener(`test`,pu,pu),window.removeEventListener(`test`,pu,pu)}catch{fu=!1}var mu=fu?{passive:!1}:!1,hu=function(e){return e.tagName===`TEXTAREA`},gu=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!==`hidden`&&!(n.overflowY===n.overflowX&&!hu(e)&&n[t]===`visible`)},_u=function(e){return gu(e,`overflowY`)},vu=function(e){return gu(e,`overflowX`)},yu=function(e,t){var n=t.ownerDocument,r=t;do{if(typeof ShadowRoot<`u`&&r instanceof ShadowRoot&&(r=r.host),Su(e,r)){var i=Cu(e,r);if(i[1]>i[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},bu=function(e){return[e.scrollTop,e.scrollHeight,e.clientHeight]},xu=function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]},Su=function(e,t){return e===`v`?_u(t):vu(t)},Cu=function(e,t){return e===`v`?bu(t):xu(t)},wu=function(e,t){return e===`h`&&t===`rtl`?-1:1},Tu=function(e,t,n,r,i){var a=wu(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=Cu(e,s),m=p[0],h=p[1]-p[2]-a*m;(m||h)&&Su(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},Eu=function(e){return`changedTouches`in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Du=function(e){return[e.deltaX,e.deltaY]},Ou=function(e){return e&&`current`in e?e.current:e},ku=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Au=function(e){return` .block-interactivity-${e} {pointer-events: none;} .allow-interactivity-${e} {pointer-events: all;} `},ju=0,Mu=[];function Nu(e){var t=_.useRef([]),n=_.useRef([0,0]),r=_.useRef(),i=_.useState(ju++)[0],a=_.useState(tu)[0],o=_.useRef(e);_.useEffect(function(){o.current=e},[e]),_.useEffect(function(){if(e.inert){document.body.classList.add(`block-interactivity-${i}`);var t=Fl([e.lockRef.current],(e.shards||[]).map(Ou),!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=_.useCallback(function(e,t){if(`touches`in e&&e.touches.length===2||e.type===`wheel`&&e.ctrlKey)return!o.current.allowPinchZoom;var i=Eu(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=yu(d,u);if(!m)return!0;if(m?l=d:(l=d===`v`?`h`:`v`,m=yu(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 Tu(h,t,e,h===`h`?s:c,!0)},[]),c=_.useCallback(function(e){var n=e;if(!(!Mu.length||Mu[Mu.length-1]!==a)){var r=`deltaY`in n?Du(n):Eu(n),i=t.current.filter(function(e){return e.name===n.type&&(e.target===n.target||n.target===e.shadowParent)&&ku(e.delta,r)})[0];if(i&&i.should){n.cancelable&&n.preventDefault();return}if(!i){var c=(o.current.shards||[]).map(Ou).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=_.useCallback(function(e,n,r,i){var a={name:e,delta:n,target:r,should:i,shadowParent:Pu(r)};t.current.push(a),setTimeout(function(){t.current=t.current.filter(function(e){return e!==a})},1)},[]),u=_.useCallback(function(e){n.current=Eu(e),r.current=void 0},[]),d=_.useCallback(function(t){l(t.type,Du(t),t.target,s(t,e.lockRef.current))},[]),f=_.useCallback(function(t){l(t.type,Eu(t),t.target,s(t,e.lockRef.current))},[]);_.useEffect(function(){return Mu.push(a),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:f}),document.addEventListener(`wheel`,c,mu),document.addEventListener(`touchmove`,c,mu),document.addEventListener(`touchstart`,u,mu),function(){Mu=Mu.filter(function(e){return e!==a}),document.removeEventListener(`wheel`,c,mu),document.removeEventListener(`touchmove`,c,mu),document.removeEventListener(`touchstart`,u,mu)}},[]);var p=e.removeScrollBar,m=e.inert;return _.createElement(_.Fragment,null,m?_.createElement(a,{styles:Au(i)}):null,p?_.createElement(du,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Pu(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Fu=Gl(Kl,Nu),Iu=_.forwardRef(function(e,t){return _.createElement(Jl,Nl({},e,{ref:t,sideCar:Fu}))});Iu.classNames=Jl.classNames;var Lu=function(e){return typeof document>`u`?null:(Array.isArray(e)?e[0]:e).ownerDocument.body},Ru=new WeakMap,zu=new WeakMap,Bu={},Vu=0,Hu=function(e){return e&&(e.host||Hu(e.parentNode))},Uu=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Hu(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})},Wu=function(e,t,n,r){var i=Uu(t,Array.isArray(e)?e:[e]);Bu[n]||(Bu[n]=new WeakMap);var a=Bu[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=(Ru.get(e)||0)+1,l=(a.get(e)||0)+1;Ru.set(e,c),a.set(e,l),o.push(e),c===1&&i&&zu.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(),Vu++,function(){o.forEach(function(e){var t=Ru.get(e)-1,i=a.get(e)-1;Ru.set(e,t),a.set(e,i),t||(zu.has(e)||e.removeAttribute(r),zu.delete(e)),i||e.removeAttribute(n)}),Vu--,Vu||(Ru=new WeakMap,Ru=new WeakMap,zu=new WeakMap,Bu={})}},Gu=function(e,t,n){n===void 0&&(n=`data-aria-hidden`);var r=Array.from(Array.isArray(e)?e:[e]),i=t||Lu(e);return i?(r.push.apply(r,Array.from(i.querySelectorAll(`[aria-live], script`))),Wu(r,i,n,`aria-hidden`)):function(){return null}},Ku=Object.defineProperty,qu=(e,t)=>Ku(e,`name`,{value:t,configurable:!0}),Ju=`Dialog`,[Yu,Xu]=ic(Ju),[Zu,Qu]=Yu(Ju),$u=qu(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=_.useRef(null),c=_.useRef(null),[l,u]=Dc({prop:r,defaultProp:i??!1,onChange:a,caller:Ju}),[d,f]=_.useState(0),[p,m]=_.useState(0);return(0,L.jsx)(Zu,{scope:t,triggerRef:s,contentRef:c,contentId:vc(),titleId:vc(),descriptionId:vc(),titlePresent:d>0,descriptionPresent:p>0,setTitleCount:f,setDescriptionCount:m,open:l,onOpenChange:u,onOpenToggle:_.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),ed=`DialogTrigger`,td=_.forwardRef(qu(function(e,t){let{__scopeDialog:n,...r}=e,i=Qu(ed,n),a=B(t,i.triggerRef);return(0,L.jsx)(q.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":bd(i.open),...r,ref:a,onClick:K(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),nd=`DialogPortal`,[rd,id]=Yu(nd,{forceMount:void 0}),ad=qu(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=Qu(nd,t);return(0,L.jsx)(rd,{scope:t,forceMount:n,children:_.Children.map(r,e=>(0,L.jsx)(bl,{present:n||a.open,children:(0,L.jsx)(gl,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),od=`DialogOverlay`,sd=_.forwardRef(qu(function(e,t){let n=id(od,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Qu(od,e.__scopeDialog);return a.modal?(0,L.jsx)(bl,{present:r||a.open,children:(0,L.jsx)(ld,{...i,ref:t})}):null},`DialogOverlay`)),cd=co(`DialogOverlay.RemoveScroll`),ld=_.forwardRef(qu(function(e,t){let{__scopeDialog:n,...r}=e,i=Qu(od,n),a=B(t,Kc());return(0,L.jsx)(Iu,{as:cd,allowPinchZoom:!0,shards:[i.contentRef],children:(0,L.jsx)(q.div,{"data-state":bd(i.open),...r,ref:a,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),ud=`DialogContent`,dd=_.forwardRef(qu(function(e,t){let n=id(ud,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=Qu(ud,e.__scopeDialog);return(0,L.jsx)(bl,{present:r||a.open,children:a.modal?(0,L.jsx)(fd,{...i,ref:t}):(0,L.jsx)(pd,{...i,ref:t})})},`DialogContent`)),fd=_.forwardRef(qu(function(e,t){let n=Qu(ud,e.__scopeDialog),r=_.useRef(null),i=B(t,n.contentRef,r);return _.useEffect(()=>{let e=r.current;if(e)return Gu(e)},[]),(0,L.jsx)(md,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:K(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:K(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:K(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),pd=_.forwardRef(qu(function(e,t){let n=Qu(ud,e.__scopeDialog),r=_.useRef(!1),i=_.useRef(!1);return(0,L.jsx)(md,{...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`)),md=_.forwardRef(qu(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=Qu(ud,n);return jl(),(0,L.jsx)(L.Fragment,{children:(0,L.jsx)(rl,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,L.jsx)(Gc,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":bd(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`)),hd=`DialogTitle`,gd=_.forwardRef(qu(function(e,t){let{__scopeDialog:n,...r}=e,i=Qu(hd,n),{setTitleCount:a}=i;return pc(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(q.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),_d=`DialogDescription`,vd=_.forwardRef(qu(function(e,t){let{__scopeDialog:n,...r}=e,i=Qu(_d,n),{setDescriptionCount:a}=i;return pc(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),(0,L.jsx)(q.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),yd=`DialogClose`,Q=_.forwardRef(qu(function(e,t){let{__scopeDialog:n,...r}=e,i=Qu(yd,n);return(0,L.jsx)(q.button,{type:`button`,...r,ref:t,onClick:K(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function bd(e){return e?`open`:`closed`}qu(bd,`getState`);var xd=Object.defineProperty,Sd=(e,t)=>xd(e,`name`,{value:t,configurable:!0}),[Cd,wd]=ic(`AlertDialog`,[Xu]),Td=Xu(),Ed=Sd(e=>{let{__scopeAlertDialog:t,...n}=e,r=Td(t);return(0,L.jsx)($u,{...r,...n,modal:!0})},`AlertDialog`);_.forwardRef(Sd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Td(n);return(0,L.jsx)(td,{...i,...r,ref:t})},`AlertDialogTrigger`));var Dd=Sd(e=>{let{__scopeAlertDialog:t,...n}=e,r=Td(t);return(0,L.jsx)(ad,{...r,...n})},`AlertDialogPortal`),Od=_.forwardRef(Sd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Td(n);return(0,L.jsx)(sd,{...i,...r,ref:t})},`AlertDialogOverlay`)),[kd,Ad]=Cd(`AlertDialogContent`),jd=_.forwardRef(Sd(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Td(n),o=B(t,_.useRef(null)),s=_.useRef(null);return(0,L.jsx)(kd,{scope:n,cancelRef:s,children:(0,L.jsx)(dd,{role:`alertdialog`,...a,...i,ref:o,onOpenAutoFocus:K(i.onOpenAutoFocus,e=>{e.preventDefault(),s.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Md=_.forwardRef(Sd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Td(n);return(0,L.jsx)(gd,{...i,...r,ref:t})},`AlertDialogTitle`)),Nd=_.forwardRef(Sd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Td(n);return(0,L.jsx)(vd,{...i,...r,ref:t})},`AlertDialogDescription`)),Pd=_.forwardRef(Sd(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Td(n);return(0,L.jsx)(Q,{...i,...r,ref:t})},`AlertDialogAction`)),Fd=`AlertDialogCancel`,Id=_.forwardRef(Sd(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Ad(Fd,n),a=Td(n),o=B(t,i);return(0,L.jsx)(Q,{...a,...r,ref:o})},`AlertDialogCancel`)),Ld=Ed,Rd=Dd,zd=Od,Bd=jd,Vd=Pd,Hd=Id,Ud=Md,Wd=Nd,Gd=Ld,Kd=Rd,qd=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(zd,{className:G(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t,ref:n}));qd.displayName=zd.displayName;var Jd=_.forwardRef(({className:e,...t},n)=>(0,L.jsxs)(Kd,{children:[(0,L.jsx)(qd,{}),(0,L.jsx)(Bd,{ref:n,className:G(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg`,e),...t})]}));Jd.displayName=Bd.displayName;var Yd=({className:e,...t})=>(0,L.jsx)(`div`,{className:G(`flex flex-col space-y-2 text-center sm:text-left`,e),...t});Yd.displayName=`AlertDialogHeader`;var Xd=({className:e,...t})=>(0,L.jsx)(`div`,{className:G(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});Xd.displayName=`AlertDialogFooter`;var Zd=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Ud,{ref:n,className:G(`text-lg font-semibold`,e),...t}));Zd.displayName=Ud.displayName;var Qd=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Wd,{ref:n,className:G(`text-sm text-muted-foreground`,e),...t}));Qd.displayName=Wd.displayName;var $d=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Vd,{ref:n,className:G(Qs(),e),...t}));$d.displayName=Vd.displayName;var ef=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Hd,{ref:n,className:G(Qs({variant:`outline`}),`mt-2 sm:mt-0`,e),...t}));ef.displayName=Hd.displayName;var tf=`cruces-glm-theme`;function nf(){return typeof window>`u`?`light`:window.localStorage.getItem(tf)===`dark`?`dark`:`light`}function rf(e){typeof document>`u`||(document.documentElement.classList.toggle(`dark`,e===`dark`),document.documentElement.style.colorScheme=e)}function af(e){typeof window<`u`&&window.localStorage.setItem(tf,e),rf(e)}function of(){rf(nf())}var sf=`/cruces-glm/glm-logo-header.png`;function cf(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}function lf(e){return cf(e,`avatar_url`)??cf(e,`picture`)??cf(e,`photo_url`)}function uf(e,t){let n=cf(t,`given_name`),r=cf(t,`family_name`);if(n&&r)return`${n.charAt(0)}${r.charAt(0)}`.toUpperCase();let i=cf(t,`full_name`)??cf(t,`name`);if(i){let e=i.split(/\s+/).filter(Boolean);if(e.length>=2)return`${e[0]?.charAt(0)??``}${e.at(-1)?.charAt(0)??``}`.toUpperCase();if(e[0])return e[0].slice(0,2).toUpperCase()}let a=e.split(`@`)[0]??``,o=a.split(/[._-]+/).filter(Boolean);return o.length>=2?`${o[0]?.charAt(0)??``}${o.at(-1)?.charAt(0)??``}`.toUpperCase():a.slice(0,2).toUpperCase()||`GL`}function df({email:e,metadata:t}){let n=lf(t),[r,i]=(0,_.useState)(!1),a=uf(e,t);return(0,L.jsx)(`div`,{className:`flex size-10 shrink-0 items-center justify-center overflow-hidden rounded-full border border-border bg-glm-leaf-bg text-sm font-bold text-glm-blue shadow-sm`,children:n&&!r?(0,L.jsx)(`img`,{src:n,alt:`Foto de perfil`,className:`size-full object-cover`,referrerPolicy:`no-referrer`,onError:()=>i(!0)}):(0,L.jsx)(`span`,{"aria-label":`Iniciales ${a}`,children:a})})}function ff(){let{user:e,logout:t}=qa(),[n,r]=(0,_.useState)(()=>nf());return(0,L.jsx)(`header`,{className:`sticky top-0 z-30 border-b border-border/80 bg-background/95 backdrop-blur`,children:(0,L.jsxs)(`div`,{className:`mx-auto flex max-w-6xl items-center justify-between gap-4 px-6 py-4`,children:[(0,L.jsx)(br,{to:`/`,className:`flex shrink-0 items-center`,"aria-label":`Ir a Cruces GLM`,children:(0,L.jsx)(`img`,{src:sf,alt:`GomezLee Marketing`,className:`h-11 w-auto sm:h-12`})}),(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-3 sm:gap-4`,children:[(0,L.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2.5`,children:[(0,L.jsx)(df,{email:e.email,metadata:e.user_metadata}),(0,L.jsx)(`span`,{className:`hidden max-w-64 truncate text-sm text-muted-foreground sm:block`,children:e.email})]}),(0,L.jsx)(`button`,{type:`button`,onClick:()=>{let e=n===`dark`?`light`:`dark`;r(e),af(e)},className:`inline-flex size-10 shrink-0 items-center justify-center rounded-md border border-glm-blue/25 bg-card text-glm-blue shadow-sm transition-all hover:border-glm-green hover:bg-glm-leaf-bg hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-glm-green focus-visible:ring-offset-2`,title:n===`dark`?`Cambiar a modo claro`:`Cambiar a modo oscuro`,"aria-label":n===`dark`?`Cambiar a modo claro`:`Cambiar a modo oscuro`,children:n===`dark`?(0,L.jsx)(xa,{className:`size-4`}):(0,L.jsx)(ma,{className:`size-4`})}),(0,L.jsxs)(`button`,{type:`button`,onClick:()=>void t(),className:`inline-flex h-10 shrink-0 items-center gap-2 rounded-md border border-glm-blue/25 bg-card px-4 text-sm font-semibold text-glm-blue shadow-sm transition-all hover:border-glm-green hover:bg-glm-leaf-bg hover:shadow-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-glm-green focus-visible:ring-offset-2`,title:`Cerrar sesión`,children:[(0,L.jsx)(fa,{className:`size-4`}),(0,L.jsx)(`span`,{className:`hidden sm:inline`,children:`Cerrar sesión`})]})]})]})})}var pf=({BASE_URL:`/cruces-glm/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_DEMO_AUTH:`false`,VITE_REPORT_WEBHOOK_URL:`https://agenteit.digitalcompass.agency/webhook/cruces-glm-reportar`,VITE_SUPABASE_ANON_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE`,VITE_SUPABASE_URL:`https://dbit.digitalcompass.agency`}.VITE_SUPABASE_URL??``).replace(/\/+$/,``),mf={BASE_URL:`/cruces-glm/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_DEMO_AUTH:`false`,VITE_REPORT_WEBHOOK_URL:`https://agenteit.digitalcompass.agency/webhook/cruces-glm-reportar`,VITE_SUPABASE_ANON_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE`,VITE_SUPABASE_URL:`https://dbit.digitalcompass.agency`}.VITE_SUPABASE_ANON_KEY??``;function hf(e,t){if(!e||typeof e!=`object`)return t;let n=e,r=n.message,i=n.error,a=n.details;return typeof r==`string`&&r.trim()?r:typeof i==`string`&&i.trim()?i:typeof a==`string`&&a.trim()?a:t}async function gf(e,t={}){if(Ea)throw Error(`Esta operación de Supabase no está disponible en modo demostrativo.`);if(!pf||!mf)throw Error(`Faltan las variables VITE_SUPABASE_URL o VITE_SUPABASE_ANON_KEY.`);let n=Ia();if(!n)throw Error(`No hay una sesión autenticada activa.`);let r=await fetch(`${pf}/rest/v1/rpc/${e}`,{method:`POST`,headers:{apikey:mf,Authorization:`Bearer ${n}`,"Content-Type":`application/json`,Accept:`application/json`},body:JSON.stringify(t)}),i=await r.text(),a=null;if(i)try{a=JSON.parse(i)}catch{a=i}if(!r.ok)throw Error(hf(a,`Supabase rechazó la operación ${e} (${r.status}).`));return a}async function _f(e){if(!(Ea||!e.activo))try{await gf(`cruces_glm_record_form_open`,{p_form_id:e.id})}catch{}}function vf({form:e,favorito:t,canManageForms:n,onFavorito:r,onEditar:i,onEliminar:a,onAbrir:o}){let s=e.activo;return(0,L.jsxs)(`article`,{className:`glm-card group relative flex flex-col overflow-hidden ${s?``:`glm-card-disabled`}`,"aria-disabled":!s,children:[(0,L.jsx)(`div`,{className:s?`glm-strip`:`h-1 w-full bg-muted-foreground/45`}),(0,L.jsxs)(`div`,{className:`flex flex-1 flex-col gap-3 p-5`,children:[(0,L.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsx)(`span`,{className:`rounded-sm bg-glm-leaf-bg px-2 py-0.5 text-[10px] font-bold tracking-[0.12em] text-glm-blue uppercase`,children:e.categoria}),!s&&(0,L.jsx)(`span`,{className:`rounded-sm bg-muted px-2 py-0.5 text-[10px] font-bold tracking-[0.12em] text-muted-foreground uppercase`,children:`No disponible`})]}),(0,L.jsx)(`button`,{type:`button`,"aria-label":t?`Quitar de favoritos`:`Marcar como favorito`,onClick:()=>r(e.id),className:`text-muted-foreground transition-colors hover:text-glm-green`,children:(0,L.jsx)(ba,{className:`size-4`,strokeWidth:1.8,fill:t?`currentColor`:`none`,color:t?`var(--glm-green)`:void 0})})]}),s?(0,L.jsx)(br,{to:`/formularios/$formId`,params:{formId:e.id},onClick:()=>o(e),className:`text-base leading-snug font-bold text-glm-blue transition-colors hover:text-glm-teal`,children:e.nombre}):(0,L.jsx)(`h3`,{className:`cursor-not-allowed text-base leading-snug font-bold text-muted-foreground`,children:e.nombre}),(0,L.jsx)(`p`,{className:`line-clamp-3 text-sm leading-relaxed text-glm-body`,children:e.descripcion}),(0,L.jsxs)(`div`,{className:`mt-auto pt-3`,children:[(0,L.jsx)(`div`,{className:`glm-rule`}),(0,L.jsxs)(`div`,{className:`mt-3 flex items-center justify-between`,children:[s?(0,L.jsxs)(br,{to:`/formularios/$formId`,params:{formId:e.id},onClick:()=>o(e),className:`inline-flex items-center gap-1.5 text-xs font-bold tracking-[0.08em] text-glm-blue uppercase transition-colors hover:text-glm-green`,children:[`Abrir `,(0,L.jsx)(na,{className:`size-3.5`})]}):(0,L.jsx)(`span`,{className:`inline-flex cursor-not-allowed items-center gap-1.5 text-xs font-bold tracking-[0.08em] text-muted-foreground uppercase`,children:`No disponible`}),(0,L.jsxs)(`div`,{className:`flex items-center gap-1 opacity-0 transition-opacity group-hover:opacity-100 focus-within:opacity-100`,children:[s&&(0,L.jsx)($s,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Abrir en n8n`,asChild:!0,children:(0,L.jsx)(`a`,{href:e.url,target:`_blank`,rel:`noreferrer`,onClick:()=>{o(e),_f(e)},children:(0,L.jsx)(la,{className:`size-3.5`})})}),n&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)($s,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Editar`,onClick:()=>i(e),children:(0,L.jsx)(ha,{className:`size-3.5`})}),(0,L.jsx)($s,{variant:`ghost`,size:`icon`,className:`size-7`,"aria-label":`Eliminar`,onClick:()=>a(e),children:(0,L.jsx)(Sa,{className:`size-3.5`})})]})]})]})]})]})]})}var yf=$u,bf=ad,xf=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(sd,{ref:n,className:G(`fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0`,e),...t}));xf.displayName=sd.displayName;var Sf=_.forwardRef(({className:e,children:t,...n},r)=>(0,L.jsxs)(bf,{children:[(0,L.jsx)(xf,{}),(0,L.jsxs)(dd,{ref:r,className:G(`fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg`,e),...n,children:[t,(0,L.jsxs)(Q,{className:`absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background cursor-pointer transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground`,children:[(0,L.jsx)(Ca,{className:`h-4 w-4`}),(0,L.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})]}));Sf.displayName=dd.displayName;var Cf=({className:e,...t})=>(0,L.jsx)(`div`,{className:G(`flex flex-col space-y-1.5 text-center sm:text-left`,e),...t});Cf.displayName=`DialogHeader`;var wf=({className:e,...t})=>(0,L.jsx)(`div`,{className:G(`flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2`,e),...t});wf.displayName=`DialogFooter`;var Tf=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(gd,{ref:n,className:G(`text-lg font-semibold leading-none tracking-tight`,e),...t}));Tf.displayName=gd.displayName;var Ef=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(vd,{ref:n,className:G(`text-sm text-muted-foreground`,e),...t}));Ef.displayName=vd.displayName;var Df=Object.defineProperty,Of=_.forwardRef(((e,t)=>Df(e,`name`,{value:t,configurable:!0}))(function(e,t){return(0,L.jsx)(q.label,{...e,ref:t,onMouseDown:t=>{t.target.closest(`button, input, select, textarea`)||(e.onMouseDown?.(t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}})},`Label`)),kf=Eo(`text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70`),Af=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Of,{ref:n,className:G(kf(),e),...t}));Af.displayName=Of.displayName;var jf=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(`textarea`,{className:G(`flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm`,e),ref:n,...t}));jf.displayName=`Textarea`;var Mf=Object.defineProperty,Nf=(e,t)=>Mf(e,`name`,{value:t,configurable:!0});function Pf(e,[t,n]){return Math.min(n,Math.max(t,e))}Nf(Pf,`clamp`);var Ff=Object.defineProperty,If=(e,t)=>Ff(e,`name`,{value:t,configurable:!0});function Lf(e){let t=e+`CollectionProvider`,[n,r]=ic(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=If(e=>{let{scope:t,children:n}=e,r=_.useRef(null),a=_.useRef(new Map).current;return(0,L.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})},`CollectionProvider`);o.displayName=t;let s=e+`CollectionSlot`,c=co(s),l=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=B(t,a(s,n).collectionRef);return(0,L.jsx)(c,{ref:i,children:r})});l.displayName=s;let u=e+`CollectionItemSlot`,d=`data-radix-collection-item`,f=co(u),p=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),s=B(t,o),c=a(u,n);return _.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,L.jsx)(f,{[d]:``,ref:s,children:r})});p.displayName=u;function m(t){let n=a(e+`CollectionConsumer`,t);return _.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${d}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return If(m,`useCollection`),[{Provider:o,Slot:l,ItemSlot:p},m,r]}If(Lf,`createCollection`);var Rf=new WeakMap,zf=class e extends Map{static{If(this,`OrderedDict`)}#e;constructor(e){super(e),this.#e=[...super.keys()],Rf.set(this,!0)}set(e,t){return Rf.get(this)&&(this.has(e)?this.#e[this.#e.indexOf(e)]=e:this.#e.push(e)),super.set(e,t),this}insert(e,t,n){let r=this.has(t),i=this.#e.length,a=Hf(e),o=a>=0?a:i+a,s=o<0||o>=i?-1:o;if(s===this.size||r&&s===this.size-1||s===-1)return this.set(t,n),this;let c=this.size+ +!r;a<0&&o++;let l=[...this.#e],u,d=!1;for(let e=o;e=this.size&&(r=this.size-1),this.at(r)}keyFrom(e,t){let n=this.indexOf(e);if(n===-1)return;let r=n+t;return r<0&&(r=0),r>=this.size&&(r=this.size-1),this.keyAt(r)}find(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return r;n++}}findIndex(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return n;n++}return-1}filter(t,n){let r=[],i=0;for(let e of this)Reflect.apply(t,n,[e,i,this])&&r.push(e),i++;return new e(r)}map(t,n){let r=[],i=0;for(let e of this)r.push([e[0],Reflect.apply(t,n,[e,i,this])]),i++;return new e(r)}reduce(...e){let[t,n]=e,r=0,i=n??this.at(0);for(let n of this)i=r===0&&e.length===1?n:Reflect.apply(t,this,[i,n,r,this]),r++;return i}reduceRight(...e){let[t,n]=e,r=n??this.at(-1);for(let n=this.size-1;n>=0;n--){let i=this.at(n);r=n===this.size-1&&e.length===1?i:Reflect.apply(t,this,[r,i,n,this])}return r}toSorted(t){let n=[...this.entries()].sort(t);return new e(n)}toReversed(){let t=new e;for(let e=this.size-1;e>=0;e--){let n=this.keyAt(e),r=this.get(n);t.set(n,r)}return t}toSpliced(...t){let n=[...this.entries()];return n.splice(...t),new e(n)}slice(t,n){let r=new e,i=this.size-1;if(t===void 0)return r;t<0&&(t+=this.size),n!==void 0&&n>0&&(i=n-1);for(let e=t;e<=i;e++){let t=this.keyAt(e),n=this.get(t);r.set(t,n)}return r}every(e,t){let n=0;for(let r of this){if(!Reflect.apply(e,t,[r,n,this]))return!1;n++}return!0}some(e,t){let n=0;for(let r of this){if(Reflect.apply(e,t,[r,n,this]))return!0;n++}return!1}};function Bf(e,t){if(`at`in Array.prototype)return Array.prototype.at.call(e,t);let n=Vf(e,t);return n===-1?void 0:e[n]}If(Bf,`at`);function Vf(e,t){let n=e.length,r=Hf(t),i=r>=0?r:n+r;return i<0||i>=n?-1:i}If(Vf,`toSafeIndex`);function Hf(e){return e!==e||e===0?0:Math.trunc(e)}If(Hf,`toSafeInteger`);function Uf(e){let t=e+`CollectionProvider`,[n,r]=ic(t),[i,a]=n(t,{collectionElement:null,collectionRef:{current:null},collectionRefObject:{current:null},itemMap:new zf,setItemMap:If(()=>void 0,`setItemMap`)}),o=If(({state:e,...t})=>e?(0,L.jsx)(c,{...t,state:e}):(0,L.jsx)(s,{...t}),`CollectionProvider`);o.displayName=t;let s=If(e=>{let t=h();return(0,L.jsx)(c,{...e,state:t})},`CollectionInit`);s.displayName=t+`Init`;let c=If(e=>{let{scope:t,children:n,state:r}=e,a=_.useRef(null),[o,s]=_.useState(null),c=B(a,s),[l,u]=r;return _.useEffect(()=>{if(!o)return;let e=qf(()=>{});return e.observe(o,{childList:!0,subtree:!0}),()=>{e.disconnect()}},[o]),(0,L.jsx)(i,{scope:t,itemMap:l,setItemMap:u,collectionRef:c,collectionRefObject:a,collectionElement:o,children:n})},`CollectionProviderImpl`);c.displayName=t+`Impl`;let l=e+`CollectionSlot`,u=co(l),d=_.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=B(t,a(l,n).collectionRef);return(0,L.jsx)(u,{ref:i,children:r})});d.displayName=l;let f=e+`CollectionItemSlot`,p=co(f),m=_.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=_.useRef(null),[s,c]=_.useState(null),l=B(t,o,c),{setItemMap:u}=a(f,n),d=_.useRef(i);Wf(d.current,i)||(d.current=i);let m=d.current;return _.useEffect(()=>{let e=m;return u(t=>s?t.has(s)?t.set(s,{...e,element:s}).toSorted(Kf):(t.set(s,{...e,element:s}),t.toSorted(Kf)):t),()=>{u(e=>!s||!e.has(s)?e:(e.delete(s),new zf(e)))}},[s,m,u]),(0,L.jsx)(p,{"data-radix-collection-item":``,ref:l,children:r})});m.displayName=f;function h(){return _.useState(new zf)}If(h,`useInitCollection`);function g(t){let{itemMap:n}=a(e+`CollectionConsumer`,t);return n}return If(g,`useCollection`),[{Provider:o,Slot:d,ItemSlot:m},{createCollectionScope:r,useCollection:g,useInitCollection:h}]}If(Uf,`createCollection`);function Wf(e,t){if(e===t)return!0;if(typeof e!=`object`||typeof t!=`object`||e==null||t==null)return!1;let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||e[r]!==t[r])return!1;return!0}If(Wf,`shallowEqual`);function Gf(e,t){return!!(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}If(Gf,`isElementPreceding`);function Kf(e,t){return!e[1].element||!t[1].element?0:Gf(e[1].element,t[1].element)?-1:1}If(Kf,`sortByDocumentPosition`);function qf(e){return new MutationObserver(t=>{for(let n of t)if(n.type===`childList`){e();return}})}If(qf,`getChildListObserver`);var Jf=Object.defineProperty,Yf=(e,t)=>Jf(e,`name`,{value:t,configurable:!0}),Xf=_.createContext(void 0);function Zf(e){let t=_.useContext(Xf);return e||t||`ltr`}Yf(Zf,`useDirection`);var Qf=[`top`,`right`,`bottom`,`left`],$f=Math.min,ep=Math.max,tp=Math.round,np=Math.floor,rp=e=>({x:e,y:e}),ip={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ap(e,t,n){return ep(e,$f(t,n))}function op(e,t){return typeof e==`function`?e(t):e}function sp(e){return e.split(`-`)[0]}function cp(e){return e.split(`-`)[1]}function lp(e){return e===`x`?`y`:`x`}function up(e){return e===`y`?`height`:`width`}function dp(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function fp(e){return lp(dp(e))}function pp(e,t,n){n===void 0&&(n=!1);let r=cp(e),i=fp(e),a=up(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=Sp(o)),[o,Sp(o)]}function mp(e){let t=Sp(e);return[hp(e),t,hp(t)]}function hp(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var gp=[`left`,`right`],_p=[`right`,`left`],vp=[`top`,`bottom`],yp=[`bottom`,`top`];function bp(e,t,n){switch(e){case`top`:case`bottom`:return n?t?_p:gp:t?gp:_p;case`left`:case`right`:return t?vp:yp;default:return[]}}function xp(e,t,n,r){let i=cp(e),a=bp(sp(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(hp)))),a}function Sp(e){let t=sp(e);return ip[t]+e.slice(t.length)}function Cp(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function wp(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Cp(e)}function Tp(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 Ep(e,t,n){let{reference:r,floating:i}=e,a=dp(t),o=fp(t),s=up(o),c=sp(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}}let m=cp(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Dp(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}=op(t,e),p=wp(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Tp(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=Tp(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 Op=50,kp=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Dp},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=Ep(l,r,c),f=r,p=0,m={};for(let n=0;n({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}=op(e,t)||{};if(l==null)return{};let d=wp(u),f={x:n,y:r},p=fp(i),m=up(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=$f(d[_],T),D=$f(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=ap(E,k,O),ee=!c.arrow&&cp(i)!=null&&k!==A&&a.reference[m]/2-(ke<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===dp(t)||T.every(e=>dp(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=dp(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}};function Mp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Np(e){return Qf.some(t=>e[t]>=0)}var Pp=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=op(e,t);switch(i){case`referenceHidden`:{let e=Mp(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Np(e)}}}case`escaped`:{let e=Mp(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Np(e)}}}default:return{}}}}},Fp=new Set([`left`,`top`]);async function Ip(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=sp(n),s=cp(n),c=dp(n)===`y`,l=Fp.has(o)?-1:1,u=a&&c?-1:1,d=op(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 Lp=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 Ip(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}}}}},Rp=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}=op(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=dp(i),p=lp(f),m=u[p],h=u[f],g=(e,t)=>ap(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},zp=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}=op(e,t),u={x:n,y:r},d=dp(i),f=lp(d),p=u[f],m=u[d],h=op(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};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;pn&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=Fp.has(sp(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);mr&&(m=r)}return{[f]:p,[d]:m}}}},Bp=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=op(e,t),c=await i.detectOverflow(t,s),l=sp(n),u=cp(n),d=dp(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=$f(p-c[m],g),y=$f(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*ep(c.left,c.right):S=p-2*ep(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function Vp(){return typeof window<`u`}function Hp(e){return Gp(e)?(e.nodeName||``).toLowerCase():`#document`}function Up(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Wp(e){return((Gp(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Gp(e){return Vp()?e instanceof Node||e instanceof Up(e).Node:!1}function Kp(e){return Vp()?e instanceof Element||e instanceof Up(e).Element:!1}function qp(e){return Vp()?e instanceof HTMLElement||e instanceof Up(e).HTMLElement:!1}function Jp(e){return!Vp()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof Up(e).ShadowRoot}function Yp(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=om(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Xp(e){return/^(table|td|th)$/.test(Hp(e))}function Zp(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var Qp=/transform|translate|scale|rotate|perspective|filter/,$p=/paint|layout|strict|content/,em=e=>!!e&&e!==`none`,tm;function nm(e){let t=Kp(e)?om(e):e;return em(t.transform)||em(t.translate)||em(t.scale)||em(t.rotate)||em(t.perspective)||!im()&&(em(t.backdropFilter)||em(t.filter))||Qp.test(t.willChange||``)||$p.test(t.contain||``)}function rm(e){let t=cm(e);for(;qp(t)&&!am(t);){if(nm(t))return t;if(Zp(t))return null;t=cm(t)}return null}function im(){return tm??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),tm}function am(e){return/^(html|body|#document)$/.test(Hp(e))}function om(e){return Up(e).getComputedStyle(e)}function sm(e){return Kp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function cm(e){if(Hp(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Jp(e)&&e.host||Wp(e);return Jp(t)?t.host:t}function lm(e){let t=cm(e);return am(t)?(e.ownerDocument||e).body:qp(t)&&Yp(t)?t:lm(t)}function um(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=lm(e),i=r===e.ownerDocument?.body,a=Up(r);if(i){let e=dm(a);return t.concat(a,a.visualViewport||[],Yp(r)?r:[],e&&n?um(e):[])}return t.concat(r,um(r,[],n))}function dm(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fm(e){let t=om(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=qp(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=tp(n)!==a||tp(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function pm(e){return Kp(e)?e:e.contextElement}function mm(e){let t=pm(e);if(!qp(t))return rp(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=fm(t),o=(a?tp(n.width):n.width)/r,s=(a?tp(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var hm=rp(0);function gm(e){let t=Up(e);return!im()||!t.visualViewport?hm:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _m(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===Up(e)}function vm(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=pm(e),o=rp(1);t&&(r?Kp(r)&&(o=mm(r)):o=mm(e));let s=_m(a,n,r)?gm(a):rp(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&&r){let e=Up(a),t=Kp(r)?Up(r):r,n=e,i=dm(n);for(;i&&t!==n;){let e=mm(i),t=i.getBoundingClientRect(),r=om(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=Up(i),i=dm(n)}}return Tp({width:u,height:d,x:c,y:l})}function ym(e,t){let n=sm(e).scrollLeft;return t?t.left+n:vm(Wp(e)).left+n}function bm(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-ym(e,n),y:n.top+t.scrollTop}}function xm(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=Wp(r),s=t?Zp(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=rp(1),u=rp(0),d=qp(r);if((d||!a)&&((Hp(r)!==`body`||Yp(o))&&(c=sm(r)),d)){let e=vm(r);l=mm(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?bm(o,c):rp(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 Sm(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Cm(e){let t=sm(e),n=e.ownerDocument.body,r=ep(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=ep(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+ym(e),o=-t.scrollTop;return om(n).direction===`rtl`&&(a+=ep(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var wm=25;function Tm(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=Up(e),a=Wp(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!im()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(ym(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=wm&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Em(e,t){let n=vm(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mm(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Dm(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Tm(e,n,t);else if(t===`document`)r=Cm(Wp(e));else if(Kp(t))r=Em(t,n);else{let n=gm(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Tp(r)}function Om(e,t){let n=t.get(e);if(n)return n;let r=um(e,[],!1).filter(e=>Kp(e)&&Hp(e)!==`body`),i=null,a=om(e).position===`fixed`,o=a?cm(e):e;for(;Kp(o)&&!am(o);){let e=om(o),t=nm(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=cm(o)}return t.set(e,r),r}function km(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Zp(t)?[]:Om(t,this._c):[].concat(n),r],o=Dm(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=Up(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Bm(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=pm(e),u=i||a?[...l?um(l):[],...t?um(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?zm(l,n,a):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?vm(e):null;c&&g();function g(){let t=vm(e);h&&!Rm(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 Vm=Lp,Hm=Rp,Um=jp,Wm=Bp,Gm=Pp,Km=Ap,qm=zp,Jm=(e,t,n)=>{let r=new Map,i=n??{},a={...Lm,...i.platform,_c:r};return kp(e,t,{...i,platform:a})},Ym=typeof document<`u`?_.useLayoutEffect:function(){};function Xm(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(!Xm(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)&&!Xm(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Zm(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Qm(e,t){let n=Zm(e);return Math.round(t*n)/n}function $m(e){let t=_.useRef(e);return Ym(()=>{t.current=e}),t}function eh(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]=_.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=_.useState(r);Xm(f,r)||p(r);let[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useCallback(e=>{e!==C.current&&(C.current=e,h(e))},[]),b=_.useCallback(e=>{e!==w.current&&(w.current=e,v(e))},[]),x=a||m,S=o||g,C=_.useRef(null),w=_.useRef(null),T=_.useRef(u),E=c!=null,D=$m(c),O=$m(i),k=$m(l),A=_.useCallback(()=>{if(!C.current||!w.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),Jm(C.current,w.current,e).then(e=>{let t={...e,isPositioned:k.current!==!1};ee.current&&!Xm(T.current,t)&&(T.current=t,cr.flushSync(()=>{d(t)}))})},[f,t,n,O,k]);Ym(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let ee=_.useRef(!1);Ym(()=>(ee.current=!0,()=>{ee.current=!1}),[]),Ym(()=>{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 j=_.useMemo(()=>({reference:C,floating:w,setReference:y,setFloating:b}),[y,b]),M=_.useMemo(()=>({reference:x,floating:S}),[x,S]),te=_.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Qm(M.floating,u.x),r=Qm(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Zm(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return _.useMemo(()=>({...u,update:A,refs:j,elements:M,floatingStyles:te}),[u,A,j,M,te])}var th=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?{}:Km({element:r.current,padding:i}).fn(n):r?Km({element:r,padding:i}).fn(n):{}}}},nh=(e,t)=>{let n=Vm(e);return{name:n.name,fn:n.fn,options:[e,t]}},rh=(e,t)=>{let n=Hm(e);return{name:n.name,fn:n.fn,options:[e,t]}},ih=(e,t)=>({fn:qm(e).fn,options:[e,t]}),ah=(e,t)=>{let n=Um(e);return{name:n.name,fn:n.fn,options:[e,t]}},oh=(e,t)=>{let n=Wm(e);return{name:n.name,fn:n.fn,options:[e,t]}},sh=(e,t)=>{let n=Gm(e);return{name:n.name,fn:n.fn,options:[e,t]}},ch=(e,t)=>{let n=th(e);return{name:n.name,fn:n.fn,options:[e,t]}},lh=Object.defineProperty,uh=(e,t)=>lh(e,`name`,{value:t,configurable:!0});function dh(e){let[t,n]=_.useState(void 0);return pc(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}n(void 0)},[e]),t}uh(dh,`useSize`);var fh=Object.defineProperty,ph=(e,t)=>fh(e,`name`,{value:t,configurable:!0}),mh=`Popper`,[hh,gh]=ic(mh),[_h,vh]=hh(mh),yh=ph(e=>{let{__scopePopper:t,children:n}=e,[r,i]=_.useState(null),[a,o]=_.useState(void 0);return(0,L.jsx)(_h,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),bh=`PopperAnchor`,xh=_.forwardRef(ph(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=vh(bh,n),o=_.useRef(null),s=a.onAnchorChange,c=B(t,_.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=_.useRef(null);_.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let u=a.placementState&&Oh(a.placementState),d=u?.[0],f=u?.[1];return r?null:(0,L.jsx)(q.div,{"data-radix-popper-side":d,"data-radix-popper-align":f,...i,ref:c})},`PopperAnchor`)),Sh=`PopperContent`,[Ch,wh]=hh(Sh),Th=_.forwardRef(ph(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=vh(Sh,n),[v,y]=_.useState(null),b=B(t,y),[x,S]=_.useState(null),C=dh(x),w=C?.width??0,T=C?.height??0,E=r+(a===`center`?``:`-`+a),D=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},O=Array.isArray(l)?l:[l],k=O.length>0,A={padding:D,boundary:O.filter(Eh),altBoundary:k},{refs:ee,floatingStyles:j,placement:M,isPositioned:te,middlewareData:ne}=eh({strategy:`fixed`,placement:E,whileElementsMounted:ph((...e)=>Bm(...e,{animationFrame:p===`always`}),`whileElementsMounted`),elements:{reference:g.anchor},middleware:[nh({mainAxis:i+T,alignmentAxis:o}),c&&rh({mainAxis:!0,crossAxis:!1,limiter:d===`partial`?ih():void 0,...A}),c&&ah({...A}),oh({...A,apply:ph(({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`)}),x&&ch({element:x,padding:s}),Dh({arrowWidth:w,arrowHeight:T}),f&&sh({strategy:`referenceHidden`,...A,boundary:k?A.boundary:void 0})]}),N=g.setPlacementState;pc(()=>(N(M),()=>{N(void 0)}),[M,N]);let[P,re]=Oh(M),ie=Lc(m);pc(()=>{te&&ie?.()},[te,ie]);let ae=ne.arrow?.x,oe=ne.arrow?.y,F=ne.arrow?.centerOffset!==0,[I,se]=_.useState();return pc(()=>{v&&se(window.getComputedStyle(v).zIndex)},[v]),(0,L.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...j,transform:te?j.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:I,"--radix-popper-transform-origin":[ne.transformOrigin?.x,ne.transformOrigin?.y].join(` `),...ne.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,L.jsx)(Ch,{scope:n,placedSide:P,placedAlign:re,onArrowChange:S,arrowX:ae,arrowY:oe,shouldHideArrow:F,children:(0,L.jsx)(q.div,{"data-side":P,"data-align":re,...h,ref:b,style:{...h.style,animation:te?h.style?.animation:`none`}})})})},`PopperContent`));function Eh(e){return e!==null}ph(Eh,`isNotNull`);var Dh=ph(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]=Oh(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 Oh(e){let[t,n=`center`]=e.split(`-`);return[t,n]}ph(Oh,`getSideAndAlignFromPlacement`);var kh=yh,Ah=xh,jh=Th,Mh=Object.defineProperty,Nh=(e,t)=>Mh(e,`name`,{value:t,configurable:!0});function Ph(e){let t=_.useRef({value:e,previous:e});return _.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}Nh(Ph,`usePrevious`);var Fh=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),Ih=Object.defineProperty,$=(e,t)=>Ih(e,`name`,{value:t,configurable:!0}),Lh=[` `,`Enter`,`ArrowUp`,`ArrowDown`],Rh=[` `,`Enter`],zh=`Select`,[Bh,Vh,Hh]=Lf(zh),[Uh,Wh]=ic(zh,[Hh,gh]),Gh=gh(),[Kh,qh]=Uh(zh),[Jh,Yh]=Uh(zh);function Xh(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=Gh(t),[v,y]=_.useState(null),[b,x]=_.useState(null),[S,C]=_.useState(!1),w=Zf(l),[T,E]=Dc({prop:r,defaultProp:i??!1,onChange:a,caller:zh}),[D,O]=Dc({prop:o,defaultProp:s,onChange:c,caller:zh}),k=_.useRef(null),A=_.useRef(D);_.useEffect(()=>{let e=m?v?.ownerDocument.getElementById(m):v?.form;if(e instanceof HTMLFormElement){let t=$(()=>O(A.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[m,v,O]);let ee=!v||!!m||!!v.closest(`form`),[j,M]=_.useState(new Set),te=vc(),ne=Array.from(j).map(e=>e.props.value).join(`;`),N=_.useCallback(e=>{M(t=>new Set(t).add(e))},[]),P=_.useCallback(e=>{M(t=>{let n=new Set(t);return n.delete(e),n})},[]),re={required:p,trigger:v,onTriggerChange:y,valueNode:b,onValueNodeChange:x,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:te,value:D,onValueChange:O,open:T,onOpenChange:E,dir:w,triggerPointerDownPosRef:k,disabled:f,name:u,autoComplete:d,form:m,nativeOptions:j,nativeSelectKey:ne,isFormControl:ee};return(0,L.jsx)(kh,{...g,children:(0,L.jsx)(Kh,{scope:t,...re,children:(0,L.jsx)(Bh.Provider,{scope:t,children:(0,L.jsx)(Jh,{scope:t,onNativeOptionAdd:N,onNativeOptionRemove:P,children:Bg(h)?h(re):n})})})})}$(Xh,`SelectProvider`);var Zh=$(e=>{let{__scopeSelect:t,children:n,...r}=e;return(0,L.jsx)(Xh,{__scopeSelect:t,...r,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[n,e?(0,L.jsx)(zg,{__scopeSelect:t}):null]})})},`Select`),Qh=`SelectTrigger`,$h=_.forwardRef($(function(e,t){let{__scopeSelect:n,disabled:r=!1,...i}=e,a=Gh(n),o=qh(Qh,n),s=o.disabled||r,c=B(t,o.onTriggerChange),l=Vh(n),u=_.useRef(`touch`),[d,f,p]=Hg(e=>{let t=l().filter(e=>!e.disabled),n=Ug(t,e,t.find(e=>e.value===o.value));n!==void 0&&o.onValueChange(n.value)}),m=$(e=>{s||(o.onOpenChange(!0),p()),e&&(o.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})},`handleOpen`);return(0,L.jsx)(Ah,{asChild:!0,...a,children:(0,L.jsx)(q.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":Vg(o.value)?``:void 0,...i,ref:c,onClick:K(i.onClick,e=>{e.currentTarget.focus(),u.current!==`mouse`&&m(e)}),onPointerDown:K(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:K(i.onKeyDown,e=>{let t=d.current!==``;!(e.ctrlKey||e.altKey||e.metaKey)&&e.key.length===1&&f(e.key),!(t&&e.key===` `)&&Lh.includes(e.key)&&(m(),e.preventDefault())})})})},`SelectTrigger`)),eg=`SelectValue`,tg=_.forwardRef($(function(e,t){let{__scopeSelect:n,className:r,style:i,children:a,placeholder:o=``,...s}=e,c=qh(eg,n),{onValueNodeHasChildrenChange:l}=c,u=a!==void 0,d=B(t,c.onValueNodeChange);pc(()=>{l(u)},[l,u]);let f=Vg(c.value);return(0,L.jsx)(q.span,{...s,asChild:!f&&s.asChild,ref:d,style:{pointerEvents:`none`},children:(0,L.jsx)(_.Fragment,{children:f?o:a},f?`placeholder`:`value`)})},`SelectValue`)),ng=_.forwardRef($(function(e,t){let{__scopeSelect:n,children:r,...i}=e;return(0,L.jsx)(q.span,{"aria-hidden":!0,...i,ref:t,children:r||`▼`})},`SelectIcon`)),[rg,ig]=Uh(`SelectPortal`,{forceMount:void 0}),ag=$(e=>{let{__scopeSelect:t,forceMount:n,...r}=e;return(0,L.jsx)(rg,{scope:e.__scopeSelect,forceMount:n,children:(0,L.jsx)(gl,{asChild:!0,...r})})},`SelectPortal`),og=`SelectContent`,sg=_.forwardRef($(function(e,t){let n=ig(og,e.__scopeSelect),{forceMount:r=n.forceMount,...i}=e,a=qh(og,e.__scopeSelect),[o,s]=_.useState();return pc(()=>{s(new DocumentFragment)},[]),(0,L.jsx)(bl,{present:r||a.open,children:({present:e})=>e?(0,L.jsx)(pg,{...i,ref:t}):(0,L.jsx)(cg,{...i,fragment:o})})},`SelectContent`)),cg=_.forwardRef($(function(e,t){let{__scopeSelect:n,children:r,fragment:i}=e;return i?cr.createPortal((0,L.jsx)(ug,{scope:n,children:(0,L.jsx)(Bh.Slot,{scope:n,children:(0,L.jsx)(`div`,{ref:t,children:r})})}),i):null},`SelectContentFragment`)),lg=10,[ug,dg]=Uh(og),fg=co(`SelectContent.RemoveScroll`),pg=_.forwardRef($(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,...v}=e,y=qh(og,n),[b,x]=_.useState(null),[S,C]=_.useState(null),w=B(t,x),[T,E]=_.useState(null),[D,O]=_.useState(null),k=Vh(n),[A,ee]=_.useState(!1),j=_.useRef(!1);_.useEffect(()=>{if(b)return Gu(b)},[b]),jl();let M=_.useCallback(e=>{let[t,...n]=k().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&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==i))return},[k,S]),te=_.useCallback(()=>M([T,b]),[M,T,b]);_.useEffect(()=>{A&&te()},[A,te]);let{onOpenChange:ne,triggerPointerDownPosRef:N}=y;_.useEffect(()=>{if(b){let e={x:0,y:0},t=$(t=>{e={x:Math.abs(Math.round(t.pageX)-(N.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(N.current?.y??0))}},`handlePointerMove`),n=$(n=>{e.x<=10&&e.y<=10?n.preventDefault():n.composedPath().includes(b)||ne(!1),document.removeEventListener(`pointermove`,t),N.current=null},`handlePointerUp`);return N.current!==null&&(document.addEventListener(`pointermove`,t),document.addEventListener(`pointerup`,n,{capture:!0,once:!0})),()=>{document.removeEventListener(`pointermove`,t),document.removeEventListener(`pointerup`,n,{capture:!0})}}},[b,ne,N]),_.useEffect(()=>{let e=$(()=>ne(!1),`close`);return window.addEventListener(`blur`,e),window.addEventListener(`resize`,e),()=>{window.removeEventListener(`blur`,e),window.removeEventListener(`resize`,e)}},[ne]);let[P,re]=Hg(e=>{let t=k().filter(e=>!e.disabled),n=Ug(t,e,t.find(e=>e.ref.current===document.activeElement));n&&setTimeout(()=>n.ref.current?.focus())}),ie=_.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&(E(e),r&&(j.current=!0))},[y.value]),ae=_.useCallback(()=>b?.focus(),[b]),oe=_.useCallback((e,t,n)=>{let r=!j.current&&!n;(y.value!==void 0&&y.value===t||r)&&O(e)},[y.value]),F=r===`popper`?hg:mg,I=F===hg?{side:s,sideOffset:c,align:l,alignOffset:u,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:m,hideWhenDetached:h,avoidCollisions:g}:{};return(0,L.jsx)(ug,{scope:n,content:b,viewport:S,onViewportChange:C,itemRefCallback:ie,selectedItem:T,onItemLeave:ae,itemTextRefCallback:oe,focusSelectedItem:te,selectedItemText:D,position:r,isPositioned:A,searchRef:P,children:(0,L.jsx)(Iu,{as:fg,allowPinchZoom:!0,children:(0,L.jsx)(rl,{asChild:!0,trapped:y.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:K(i,e=>{y.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:(0,L.jsx)(Gc,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:o,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>y.onOpenChange(!1),children:(0,L.jsx)(F,{role:`listbox`,id:y.contentId,"data-state":y.open?`open`:`closed`,dir:y.dir,onContextMenu:e=>e.preventDefault(),...v,...I,onPlaced:()=>ee(!0),ref:w,style:{display:`flex`,flexDirection:`column`,outline:`none`,...v.style},onKeyDown:K(v.onKeyDown,e=>{let t=e.ctrlKey||e.altKey||e.metaKey;if(e.key===`Tab`&&e.preventDefault(),!t&&e.key.length===1&&re(e.key),[`ArrowUp`,`ArrowDown`,`Home`,`End`].includes(e.key)){let t=k().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(()=>M(t)),e.preventDefault()}})})})})})})},`SelectContentImpl`)),mg=_.forwardRef($(function(e,t){let{__scopeSelect:n,onPlaced:r,...i}=e,a=qh(og,n),o=dg(og,n),[s,c]=_.useState(null),[l,u]=_.useState(null),d=B(t,u),f=Vh(n),p=_.useRef(!1),m=_.useRef(!0),{viewport:h,selectedItem:g,selectedItemText:v,focusSelectedItem:y}=o,b=_.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&l&&h&&g&&v){let e=a.trigger.getBoundingClientRect(),t=l.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),i=v.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-lg,d=Pf(a,[lg,Math.max(lg,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-lg,d=Pf(a,[lg,Math.max(lg,u-l)]);s.style.minWidth=c+`px`,s.style.right=d+`px`}let o=f(),c=window.innerHeight-lg*2,u=h.scrollHeight,d=window.getComputedStyle(l),m=parseInt(d.borderTopWidth,10),_=parseInt(d.paddingTop,10),y=parseInt(d.borderBottomWidth,10),b=parseInt(d.paddingBottom,10),x=m+_+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-lg,D=c-E,O=g.offsetHeight/2,k=g.offsetTop+O,A=m+_+k,ee=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)+ee;s.style.height=t+`px`,h.scrollTop=A-E+h.offsetTop}s.style.margin=`${lg}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,v,a.dir,r]);pc(()=>b(),[b]);let[x,S]=_.useState();pc(()=>{l&&S(window.getComputedStyle(l).zIndex)},[l]);let C=_.useCallback(e=>{e&&m.current===!0&&(b(),y?.(),m.current=!1)},[b,y]);return(0,L.jsx)(gg,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:(0,L.jsx)(`div`,{ref:c,style:{display:`flex`,flexDirection:`column`,position:`fixed`,zIndex:x},children:(0,L.jsx)(q.div,{...i,ref:d,style:{boxSizing:`border-box`,maxHeight:`100%`,...i.style}})})})},`SelectItemAlignedPosition`)),hg=_.forwardRef($(function(e,t){let{__scopeSelect:n,align:r=`start`,collisionPadding:i=lg,...a}=e,o=Gh(n);return(0,L.jsx)(jh,{...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`)),[gg,_g]=Uh(og,{}),vg=`SelectViewport`,yg=_.forwardRef($(function(e,t){let{__scopeSelect:n,nonce:r,...i}=e,a=dg(vg,n),o=_g(vg,n),s=B(t,a.onViewportChange),c=_.useRef(0);return(0,L.jsxs)(L.Fragment,{children:[(0,L.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,L.jsx)(Bh.Slot,{scope:n,children:(0,L.jsx)(q.div,{"data-radix-select-viewport":``,role:`presentation`,...i,ref:s,style:{position:`relative`,flex:1,overflow:`hidden auto`,...i.style},onScroll:K(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-lg*2,i=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),o=Math.max(i,a);if(o0?s:0,n.style.justifyContent=`flex-end`)}}}c.current=t.scrollTop})})})]})},`SelectViewport`)),[bg,xg]=Uh(`SelectGroup`),Sg=`SelectLabel`,Cg=_.forwardRef($(function(e,t){let{__scopeSelect:n,...r}=e,i=xg(Sg,n);return(0,L.jsx)(q.div,{id:i.id,...r,ref:t})},`SelectLabel`)),wg=`SelectItem`,[Tg,Eg]=Uh(wg),Dg=_.forwardRef($(function(e,t){let{__scopeSelect:n,value:r,disabled:i=!1,textValue:a,...o}=e,s=qh(wg,n),c=dg(wg,n),l=s.value===r,[u,d]=_.useState(a??``),[f,p]=_.useState(!1),m=B(t,Lc(e=>c.itemRefCallback?.(e,r,i))),h=vc(),g=_.useRef(`touch`),v=$(()=>{i||(s.onValueChange(r),s.onOpenChange(!1))},`handleSelect`);return(0,L.jsx)(Tg,{scope:n,value:r,disabled:i,textId:h,isSelected:l,onItemTextChange:_.useCallback(e=>{d(t=>t||(e?.textContent??``).trim())},[]),children:(0,L.jsx)(Bh.ItemSlot,{scope:n,value:r,disabled:i,textValue:u,children:(0,L.jsx)(q.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:K(o.onFocus,()=>p(!0)),onBlur:K(o.onBlur,()=>p(!1)),onClick:K(o.onClick,()=>{g.current!==`mouse`&&v()}),onPointerUp:K(o.onPointerUp,()=>{g.current===`mouse`&&v()}),onPointerDown:K(o.onPointerDown,e=>{g.current=e.pointerType}),onPointerMove:K(o.onPointerMove,e=>{g.current=e.pointerType,i?c.onItemLeave?.():g.current===`mouse`&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:K(o.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:K(o.onKeyDown,e=>{i||e.target!==e.currentTarget||(c.searchRef?.current===``||e.key!==` `)&&(Rh.includes(e.key)&&v(),e.key===` `&&e.preventDefault())})})})})},`SelectItem`)),Og=`SelectItemText`,kg=_.forwardRef($(function(e,t){let{__scopeSelect:n,className:r,style:i,...a}=e,o=qh(Og,n),s=dg(Og,n),c=Eg(Og,n),l=Yh(Og,n),[u,d]=_.useState(null),f=Lc(e=>s.itemTextRefCallback?.(e,c.value,c.disabled)),p=B(t,d,c.onItemTextChange,f),m=u?.textContent,h=_.useMemo(()=>(0,L.jsx)(`option`,{value:c.value,disabled:c.disabled,children:m},c.value),[c.disabled,c.value,m]),{onNativeOptionAdd:g,onNativeOptionRemove:v}=l;return pc(()=>(g(h),()=>v(h)),[g,v,h]),(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(q.span,{id:c.textId,...a,ref:p}),c.isSelected&&o.valueNode&&!o.valueNodeHasChildren&&!Vg(o.value)?cr.createPortal(a.children,o.valueNode):null]})},`SelectItemText`)),Ag=`SelectItemIndicator`,jg=_.forwardRef($(function(e,t){let{__scopeSelect:n,...r}=e;return Eg(Ag,n).isSelected?(0,L.jsx)(q.span,{"aria-hidden":!0,...r,ref:t}):null},`SelectItemIndicator`)),Mg=`SelectScrollUpButton`,Ng=_.forwardRef($(function(e,t){let n=dg(Mg,e.__scopeSelect),r=_g(Mg,e.__scopeSelect),[i,a]=_.useState(!1),o=B(t,r.onScrollButtonChange);return pc(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollTop>0;a(e)};$(e,`handleScroll`);let t=n.viewport;return e(),t.addEventListener(`scroll`,e),()=>t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,L.jsx)(Ig,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop-=t.offsetHeight)}}):null},`SelectScrollUpButton`)),Pg=`SelectScrollDownButton`,Fg=_.forwardRef($(function(e,t){let n=dg(Pg,e.__scopeSelect),r=_g(Pg,e.__scopeSelect),[i,a]=_.useState(!1),o=B(t,r.onScrollButtonChange);return pc(()=>{if(n.viewport&&n.isPositioned){let e=function(){let e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)t.removeEventListener(`scroll`,e)}},[n.viewport,n.isPositioned]),i?(0,L.jsx)(Ig,{...e,ref:o,onAutoScroll:()=>{let{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop+=t.offsetHeight)}}):null},`SelectScrollDownButton`)),Ig=_.forwardRef($(function(e,t){let{__scopeSelect:n,onAutoScroll:r,...i}=e,a=dg(`SelectScrollButton`,n),o=_.useRef(null),s=Vh(n),c=_.useCallback(()=>{o.current!==null&&(window.clearInterval(o.current),o.current=null)},[]);return _.useEffect(()=>()=>c(),[c]),pc(()=>{s().find(e=>e.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:`nearest`})},[s]),(0,L.jsx)(q.div,{"aria-hidden":!0,...i,ref:t,style:{flexShrink:0,...i.style},onPointerDown:K(i.onPointerDown,()=>{o.current===null&&(o.current=window.setInterval(r,50))}),onPointerMove:K(i.onPointerMove,()=>{a.onItemLeave?.(),o.current===null&&(o.current=window.setInterval(r,50))}),onPointerLeave:K(i.onPointerLeave,()=>{c()})})},`SelectScrollButtonImpl`)),Lg=_.forwardRef($(function(e,t){let{__scopeSelect:n,...r}=e;return(0,L.jsx)(q.div,{"aria-hidden":!0,...r,ref:t})},`SelectSeparator`)),Rg=`SelectBubbleInput`,zg=_.forwardRef($(function({__scopeSelect:e,...t},n){let r=qh(Rg,e),{value:i,onValueChange:a,required:o,disabled:s,name:c,autoComplete:l,form:u}=r,{nativeOptions:d,nativeSelectKey:f}=r,p=_.useRef(null),m=B(n,p),h=i??``,g=Ph(h),v=Array.from(d).some(e=>(e.props.value??``)===``);return _.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,L.jsxs)(q.select,{"aria-hidden":!0,required:o,tabIndex:-1,name:c,autoComplete:l,disabled:s,form:u,onChange:e=>a(e.target.value),...t,style:{...Fh,...t.style},ref:m,defaultValue:h,children:[Vg(i)&&!v?(0,L.jsx)(`option`,{value:``}):null,Array.from(d)]},f)},`SelectBubbleInput`));function Bg(e){return typeof e==`function`}$(Bg,`isFunction`);function Vg(e){return e===``||e===void 0}$(Vg,`shouldShowPlaceholder`);function Hg(e){let t=Lc(e),n=_.useRef(``),r=_.useRef(0),i=_.useCallback(e=>{let i=n.current+e;t(i),$((function e(t){n.current=t,window.clearTimeout(r.current),t!==``&&(r.current=window.setTimeout(()=>e(``),1e3))}),`updateSearch`)(i)},[t]),a=_.useCallback(()=>{n.current=``,window.clearTimeout(r.current)},[]);return _.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,i,a]}$(Hg,`useTypeaheadSearch`);function Ug(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=Wg(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}$(Ug,`findNextItem`);function Wg(e,t){return e.map((n,r)=>e[(t+r)%e.length])}$(Wg,`wrapArray`);var Gg=Zh,Kg=tg,qg=_.forwardRef(({className:e,children:t,...n},r)=>(0,L.jsxs)($h,{ref:r,className:G(`flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background cursor-pointer data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1`,e),...n,children:[t,(0,L.jsx)(ng,{asChild:!0,children:(0,L.jsx)(ia,{className:`h-4 w-4 opacity-50`})})]}));qg.displayName=$h.displayName;var Jg=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Ng,{ref:n,className:G(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(sa,{className:`h-4 w-4`})}));Jg.displayName=Ng.displayName;var Yg=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Fg,{ref:n,className:G(`flex cursor-default items-center justify-center py-1`,e),...t,children:(0,L.jsx)(ia,{className:`h-4 w-4`})}));Yg.displayName=Fg.displayName;var Xg=_.forwardRef(({className:e,children:t,position:n=`popper`,...r},i)=>(0,L.jsx)(ag,{children:(0,L.jsxs)(sg,{ref:i,className:G(`relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-(--radix-select-content-transform-origin)`,n===`popper`&&`data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1`,e),position:n,...r,children:[(0,L.jsx)(Jg,{}),(0,L.jsx)(yg,{className:G(`p-1`,n===`popper`&&`h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]`),children:t}),(0,L.jsx)(Yg,{})]})}));Xg.displayName=sg.displayName;var Zg=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Cg,{ref:n,className:G(`px-2 py-1.5 text-sm font-semibold`,e),...t}));Zg.displayName=Cg.displayName;var Qg=_.forwardRef(({className:e,children:t,...n},r)=>(0,L.jsxs)(Dg,{ref:r,className:G(`relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50`,e),...n,children:[(0,L.jsx)(`span`,{className:`absolute right-2 flex h-3.5 w-3.5 items-center justify-center`,children:(0,L.jsx)(jg,{children:(0,L.jsx)(ra,{className:`h-4 w-4`})})}),(0,L.jsx)(kg,{children:t})]}));Qg.displayName=Dg.displayName;var $g=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(Lg,{ref:n,className:G(`-mx-1 my-1 h-px bg-muted`,e),...t}));$g.displayName=Lg.displayName;var e_=Object.defineProperty,t_=(e,t)=>e_(e,`name`,{value:t,configurable:!0}),n_=`Switch`,[r_,i_]=ic(n_),[a_,o_]=r_(n_);function s_(e){let{__scopeSwitch:t,checked:n,children:r,defaultChecked:i,disabled:a,form:o,name:s,onCheckedChange:c,required:l,value:u=`on`,internal_do_not_use_render:d}=e,[f,p]=Dc({prop:n,defaultProp:i??!1,onChange:c,caller:n_}),[m,h]=_.useState(null),[g,v]=_.useState(null),y=_.useRef(!1),[b,x]=_.useReducer(e=>e+1,0),S={checked:f,setChecked:p,disabled:a,control:m,setControl:h,name:s,form:o,value:u,hasConsumerStoppedPropagationRef:y,userInteractionCount:b,onUserInteraction:x,required:l,defaultChecked:i,isFormControl:!m||!!o||!!m.closest(`form`),bubbleInput:g,setBubbleInput:v};return(0,L.jsx)(a_,{scope:t,...S,children:h_(d)?d(S):r})}t_(s_,`SwitchProvider`);var c_=`SwitchTrigger`,l_=_.forwardRef(t_(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,form:a,value:o,disabled:s,checked:c,required:l,setControl:u,setChecked:d,hasConsumerStoppedPropagationRef:f,onUserInteraction:p,isFormControl:m,bubbleInput:h}=o_(c_,e),g=B(r,u),v=_.useRef(c);return _.useEffect(()=>{let e=a?i?.ownerDocument.getElementById(a):i?.form;if(e instanceof HTMLFormElement){let t=t_(()=>d(v.current),`reset`);return e.addEventListener(`reset`,t),()=>e.removeEventListener(`reset`,t)}},[i,a,d]),(0,L.jsx)(q.button,{type:`button`,role:`switch`,"aria-checked":c,"aria-required":l,"data-state":g_(c),"data-disabled":s?``:void 0,disabled:s,value:o,...n,ref:g,onClick:K(t,e=>{p(),d(e=>!e),h&&m&&(f.current=e.isPropagationStopped(),f.current||e.stopPropagation())})})},`SwitchTrigger`)),u_=_.forwardRef(t_(function(e,t){let{__scopeSwitch:n,name:r,checked:i,defaultChecked:a,required:o,disabled:s,value:c,onCheckedChange:l,form:u,...d}=e;return(0,L.jsx)(s_,{__scopeSwitch:n,checked:i,defaultChecked:a,disabled:s,required:o,onCheckedChange:l,name:r,form:u,value:c,internal_do_not_use_render:({isFormControl:e})=>(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(l_,{...d,ref:t,__scopeSwitch:n}),e&&(0,L.jsx)(m_,{__scopeSwitch:n})]})})},`Switch`)),d_=`SwitchThumb`,f_=_.forwardRef(t_(function(e,t){let{__scopeSwitch:n,...r}=e,i=o_(d_,n);return(0,L.jsx)(q.span,{"data-state":g_(i.checked),"data-disabled":i.disabled?``:void 0,...r,ref:t})},`SwitchThumb`)),p_=`SwitchBubbleInput`,m_=_.forwardRef(t_(function({__scopeSwitch:e,onClick:t,...n},r){let{control:i,hasConsumerStoppedPropagationRef:a,userInteractionCount:o,checked:s,defaultChecked:c,required:l,disabled:u,name:d,value:f,form:p,bubbleInput:m,setBubbleInput:h}=o_(p_,e),g=B(r,h),v=dh(i),y=_.useRef(!1),b=_.useRef(s),x=_.useRef(o);_.useEffect(()=>{let e=m;if(!e)return;let t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,`checked`).set,r=o!==x.current;x.current=o;let i=b.current!==s;b.current=s;let c=!(r&&a.current);if(i&&n){y.current=!r;let t=new Event(`click`,{bubbles:c});n.call(e,s),e.dispatchEvent(t),y.current=!1}},[m,s,a,o]);let S=_.useRef(s);return(0,L.jsx)(q.input,{type:`checkbox`,"aria-hidden":!0,defaultChecked:c??S.current,required:l,disabled:u,name:d,value:f,form:p,...n,tabIndex:-1,ref:g,onClick:K(t,e=>{y.current&&e.stopPropagation()}),style:{...n.style,...v,position:`absolute`,pointerEvents:`none`,opacity:0,margin:0,transform:`translateX(-100%)`}})},`SwitchBubbleInput`));function h_(e){return typeof e==`function`}t_(h_,`isFunction`);function g_(e){return e?`checked`:`unchecked`}t_(g_,`getState`);var __=_.forwardRef(({className:e,...t},n)=>(0,L.jsx)(u_,{className:G(`peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input`,e),...t,ref:n,children:(0,L.jsx)(f_,{className:G(`pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0`)})}));__.displayName=u_.displayName;var v_=[`Seguridad Social`,`IR`,`Reportes`],y_=[{id:`cruce-facturacion-clientes`,nombre:`Cruce de facturación vs. órdenes de cliente`,descripcion:`Compara las facturas emitidas contra las órdenes de compra registradas y devuelve las diferencias por cuenta.`,categoria:`Reportes`,url:`https://n8n.example.com/form/cruce-facturacion-clientes`,activo:!0},{id:`cruce-proveedores-pagos`,nombre:`Cruce de proveedores vs. pagos ejecutados`,descripcion:`Valida que cada factura de proveedor cargada tenga su pago conciliado en el período seleccionado.`,categoria:`Reportes`,url:`https://n8n.example.com/form/cruce-proveedores-pagos`,activo:!0},{id:`conciliacion-bancaria`,nombre:`Conciliación bancaria automática`,descripcion:`Sube el extracto bancario y el libro mayor para obtener partidas conciliadas y pendientes.`,categoria:`Reportes`,url:`https://n8n.example.com/form/conciliacion-bancaria`,activo:!0},{id:`solicitud-orden-compra`,nombre:`Solicitud de orden de compra`,descripcion:`Registra una nueva solicitud de compra y dispara el flujo de aprobación con el área responsable.`,categoria:`Reportes`,url:`https://n8n.example.com/form/solicitud-orden-compra`,activo:!0},{id:`carga-facturas-proveedor`,nombre:`Carga de facturas de proveedor`,descripcion:`Envía la factura en PDF y sus datos fiscales para que el flujo la extraiga y la registre.`,categoria:`Reportes`,url:`https://n8n.example.com/form/carga-facturas-proveedor`,activo:!0},{id:`reporte-cuentas-por-cobrar`,nombre:`Reporte de cuentas por cobrar`,descripcion:`Genera el aging de cartera por cliente y lo envía por correo al cierre del período elegido.`,categoria:`Reportes`,url:`https://n8n.example.com/form/reporte-cuentas-por-cobrar`,activo:!0}],b_=`glm-hub-formularios-v1`,x_=`cruces-glm-supabase-forms-migrated-v1`,S_=`glm-hub-favoritos-v1`,C_=`glm-hub-recientes-v1`,w_=new Set(v_);function T_(e){return w_.has(e)?e:`Reportes`}function E_(e){return{...e,categoria:T_(e.categoria)}}function D_(e){return e.map(E_)}function O_(e){return typeof e.id!=`string`||typeof e.nombre!=`string`||typeof e.descripcion!=`string`||typeof e.categoria!=`string`||typeof e.url!=`string`||typeof e.activo!=`boolean`?null:E_({id:e.id,nombre:e.nombre,descripcion:e.descripcion,categoria:e.categoria,url:e.url,activo:e.activo})}function k_(e,t){if(typeof window>`u`)return t;try{let n=window.localStorage.getItem(e);return n?JSON.parse(n):t}catch{return t}}function A_(e,t){if(!(typeof window>`u`))try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}}function j_(){return typeof window>`u`||window.localStorage.getItem(x_)===`1`}function M_(){typeof window>`u`||window.localStorage.setItem(x_,`1`)}function N_(){if(typeof window>`u`)return null;let e=window.localStorage.getItem(b_);if(!e)return null;try{let t=JSON.parse(e);return Array.isArray(t)?t.filter(e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.id==`string`&&typeof t.nombre==`string`&&typeof t.descripcion==`string`&&typeof t.categoria==`string`&&typeof t.url==`string`&&typeof t.activo==`boolean`}).map(E_):null}catch{return null}}async function P_(){return(await gf(`cruces_glm_get_forms`)).map(O_).filter(e=>e!==null)}async function F_(e){return O_((await gf(`cruces_glm_get_form`,{p_form_id:e}))[0]??{})}async function I_(e){let t=E_(e),n=O_((await gf(`cruces_glm_save_form`,{p_form_id:t.id,p_nombre:t.nombre,p_descripcion:t.descripcion,p_categoria:t.categoria,p_url:t.url,p_activo:t.activo}))[0]??{});if(!n)throw Error(`Supabase no devolvió el formulario guardado.`);return n}async function L_(e){await gf(`cruces_glm_delete_form`,{p_form_id:e})}async function R_(e,t){if(Ea||j_())return t;if(t.length>0)return M_(),t;if(!e)return t;let n=N_();if(!n||n.length===0)return M_(),t;for(let e of n)await I_(e);return M_(),P_()}function z_(e){return e.toLowerCase().normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``).slice(0,48)||`formulario-${Date.now()}`}function B_(e=!1){let[t,n]=(0,_.useState)(Ea?y_:[]),[r,i]=(0,_.useState)([]),[a,o]=(0,_.useState)([]),[s,c]=(0,_.useState)(!1),[l,u]=(0,_.useState)(null),d=(0,_.useCallback)(async()=>{u(null);try{if(Ea){let e=D_(k_(b_,y_));n(e),A_(b_,e)}else{let t=await P_();t=await R_(e,t),n(t)}}catch(e){n([]),u(e instanceof Error?e.message:`No se pudieron cargar los formularios desde Supabase.`)}finally{c(!0)}},[e]);return(0,_.useEffect)(()=>{i(k_(S_,[])),o(k_(C_,[])),d()},[d]),(0,_.useEffect)(()=>{if(Ea||typeof window>`u`)return;let e=()=>{document.visibilityState===`visible`&&d()};return window.addEventListener(`focus`,e),document.addEventListener(`visibilitychange`,e),()=>{window.removeEventListener(`focus`,e),document.removeEventListener(`visibilitychange`,e)}},[d]),{formularios:t,favoritos:r,recientes:a,listo:s,errorCarga:l,guardar:(0,_.useCallback)(async e=>{let t=E_(e);if(Ea)return n(e=>{let n=e.some(e=>e.id===t.id)?e.map(e=>e.id===t.id?t:e):[t,...e];return A_(b_,n),n}),t;let r=await I_(t);return n(e=>e.some(e=>e.id===r.id)?e.map(e=>e.id===r.id?r:e):[r,...e]),r},[]),eliminar:(0,_.useCallback)(async e=>{if(Ea){n(t=>{let n=t.filter(t=>t.id!==e);return A_(b_,n),n});return}await L_(e),n(t=>t.filter(t=>t.id!==e)),i(t=>{let n=t.filter(t=>t!==e);return A_(S_,n),n}),o(t=>{let n=t.filter(t=>t!==e);return A_(C_,n),n})},[]),alternarFavorito:(0,_.useCallback)(e=>{i(t=>{let n=t.includes(e)?t.filter(t=>t!==e):[...t,e];return A_(S_,n),n})},[]),registrarUso:(0,_.useCallback)(e=>{o(t=>{let n=[e,...t.filter(t=>t!==e)].slice(0,6);return A_(C_,n),n})},[]),recargar:d}}async function V_(e){return Ea?D_(k_(b_,y_)).find(t=>t.id===e)??null:F_(e)}var H_={id:``,nombre:``,descripcion:``,categoria:`Seguridad Social`,url:``,activo:!0};function U_(){return(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(`span`,{className:`ml-0.5 text-glm-orange`,"aria-hidden":`true`,children:`*`}),(0,L.jsx)(`span`,{className:`sr-only`,children:` obligatorio`})]})}function W_({open:e,onOpenChange:t,inicial:n,onGuardar:r}){let[i,a]=(0,_.useState)(n??H_),[o,s]=(0,_.useState)(null),[c,l]=(0,_.useState)(!1);(0,_.useEffect)(()=>{e&&(a(n??H_),s(null),l(!1))},[e,n]);let u=(e,t)=>a(n=>({...n,[e]:t})),d=(0,_.useMemo)(()=>!!(i.nombre.trim()&&i.url.trim()&&i.descripcion.trim()&&i.categoria.trim()),[i]),f=async()=>{if(!d){s(`Completa todos los campos marcados con * antes de guardar.`);return}if(!/^https?:\/\//i.test(i.url.trim())){s(`La URL del formulario n8n debe empezar con http:// o https://`);return}l(!0),s(null);try{await r({...i,nombre:i.nombre.trim(),descripcion:i.descripcion.trim(),categoria:i.categoria.trim(),url:i.url.trim(),id:i.id||z_(i.nombre)}),t(!1)}catch(e){s(e instanceof Error?e.message:`No se pudo guardar el formulario. Intenta nuevamente.`)}finally{l(!1)}};return(0,L.jsx)(yf,{open:e,onOpenChange:t,children:(0,L.jsxs)(Sf,{className:`max-h-[88vh] overflow-y-auto sm:max-w-lg`,children:[(0,L.jsxs)(Cf,{children:[(0,L.jsx)(Tf,{className:`text-glm-blue`,children:n?`Editar formulario`:`Nuevo formulario`}),(0,L.jsx)(Ef,{children:`Registra el enlace del formulario n8n para que el equipo lo encuentre en el hub.`})]}),(0,L.jsxs)(`div`,{className:`space-y-5 py-2`,children:[(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(Af,{htmlFor:`nombre`,children:[`Nombre`,(0,L.jsx)(U_,{})]}),(0,L.jsx)(ec,{id:`nombre`,value:i.nombre,onChange:e=>{u(`nombre`,e.target.value),o&&s(null)},placeholder:`Cruce de Seguridad Social - Honduras`,required:!0})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(Af,{htmlFor:`url`,children:[`URL del formulario n8n`,(0,L.jsx)(U_,{})]}),(0,L.jsx)(ec,{id:`url`,value:i.url,onChange:e=>{u(`url`,e.target.value),o&&s(null)},placeholder:`https://n8n.tuempresa.com/form/...`,required:!0})]}),(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(Af,{htmlFor:`descripcion`,children:[`Descripción`,(0,L.jsx)(U_,{})]}),(0,L.jsx)(jf,{id:`descripcion`,rows:4,value:i.descripcion,onChange:e=>{u(`descripcion`,e.target.value),o&&s(null)},placeholder:`Describe brevemente qué hace este cruce.`,required:!0})]}),(0,L.jsxs)(`div`,{className:`grid gap-5 sm:grid-cols-2 sm:items-end`,children:[(0,L.jsxs)(`div`,{className:`space-y-2`,children:[(0,L.jsxs)(Af,{children:[`Categoría`,(0,L.jsx)(U_,{})]}),(0,L.jsxs)(Gg,{value:i.categoria,onValueChange:e=>{u(`categoria`,e),o&&s(null)},children:[(0,L.jsx)(qg,{"aria-required":`true`,children:(0,L.jsx)(Kg,{})}),(0,L.jsx)(Xg,{children:v_.map(e=>(0,L.jsx)(Qg,{value:e,children:e},e))})]})]}),(0,L.jsxs)(`div`,{className:`flex h-10 items-center gap-3 sm:justify-start`,children:[(0,L.jsx)(__,{id:`activo`,checked:i.activo,onCheckedChange:e=>u(`activo`,e)}),(0,L.jsxs)(Af,{htmlFor:`activo`,className:`cursor-pointer`,children:[`Disponible`,(0,L.jsx)(U_,{})]})]})]}),(0,L.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Los campos marcados con `,(0,L.jsx)(`span`,{className:`font-bold text-glm-orange`,children:`*`}),` son obligatorios.`]}),o?(0,L.jsx)(`p`,{role:`alert`,className:`rounded-md border border-border bg-glm-section-bg px-3 py-2 text-xs font-bold text-glm-blue`,children:o}):null]}),(0,L.jsxs)(wf,{children:[(0,L.jsx)($s,{variant:`outline`,onClick:()=>t(!1),disabled:c,children:`Cancelar`}),(0,L.jsx)($s,{onClick:()=>void f(),disabled:!d||c,children:c?`Guardando…`:`Guardar`})]})]})})}var G_=({BASE_URL:`/cruces-glm/`,DEV:!1,MODE:`production`,PROD:!0,SSR:!1,VITE_DEMO_AUTH:`false`,VITE_REPORT_WEBHOOK_URL:`https://agenteit.digitalcompass.agency/webhook/cruces-glm-reportar`,VITE_SUPABASE_ANON_KEY:`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyAgCiAgICAicm9sZSI6ICJhbm9uIiwKICAgICJpc3MiOiAic3VwYWJhc2UtZGVtbyIsCiAgICAiaWF0IjogMTY0MTc2OTIwMCwKICAgICJleHAiOiAxNzk5NTM1NjAwCn0.dc_X5iR_VP_qT0zsiyj_I_OZ2T9FtRU2BBNWN8Bu4GE`,VITE_SUPABASE_URL:`https://dbit.digitalcompass.agency`}.VITE_REPORT_WEBHOOK_URL??``).trim();function K_(e,t){let n=e?.[t];return typeof n==`string`&&n.trim()?n.trim():void 0}function q_(e,t){return(K_(t,`full_name`)??K_(t,`name`))||[K_(t,`given_name`),K_(t,`family_name`)].filter(Boolean).join(` `)||e}function J_(){let{user:e}=qa(),[t,n]=(0,_.useState)(!1),[r,i]=(0,_.useState)(``),[a,o]=(0,_.useState)(!1),[s,c]=(0,_.useState)(null),[l,u]=(0,_.useState)(!1),d=()=>{i(``),c(null),u(!1),o(!1)},f=e=>{n(e),e||d()},p=async()=>{let t=r.trim();if(!t){c(`Debes escribir una descripción antes de enviar el reporte.`);return}if(!G_){c(`El webhook de reportes todavía no está configurado. Agrega VITE_REPORT_WEBHOOK_URL y vuelve a compilar la aplicación.`);return}o(!0),c(null);try{let n=await fetch(G_,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({app:`Cruces GLM`,userEmail:e.email,userName:q_(e.email,e.user_metadata),message:t,submittedAt:new Date().toISOString()})});if(!n.ok)throw Error(`El servidor respondió con estado ${n.status}.`);u(!0),i(``)}catch(e){c(e instanceof Error?`No se pudo enviar el reporte. ${e.message}`:`No se pudo enviar el reporte. Intenta nuevamente.`)}finally{o(!1)}};return(0,L.jsxs)(`section`,{className:`border-t border-border py-8 text-center`,children:[(0,L.jsx)(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:`¿Encontraste un problema o necesitas reportar algo?`}),(0,L.jsxs)($s,{variant:`outline`,onClick:()=>n(!0),className:`gap-2`,children:[(0,L.jsx)(pa,{className:`size-4`}),`Reportar`]}),(0,L.jsx)(yf,{open:t,onOpenChange:f,children:(0,L.jsxs)(Sf,{className:`sm:max-w-lg`,children:[(0,L.jsxs)(Cf,{children:[(0,L.jsx)(Tf,{className:`text-glm-blue`,children:`Reportar`}),(0,L.jsx)(Ef,{className:`sr-only`,children:`Formulario para enviar un reporte de Cruces GLM.`})]}),l?(0,L.jsxs)(`div`,{className:`flex items-start gap-3 rounded-md border border-glm-green/40 bg-glm-leaf-bg p-4 text-left`,children:[(0,L.jsx)(ca,{className:`mt-0.5 size-5 shrink-0 text-glm-green`}),(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`p`,{className:`text-sm font-bold text-glm-blue`,children:`Reporte enviado`}),(0,L.jsx)(`p`,{className:`mt-1 text-sm text-glm-body`,children:`Tu mensaje fue enviado correctamente.`})]})]}):(0,L.jsxs)(`div`,{className:`space-y-2 py-1 text-left`,children:[(0,L.jsx)(Af,{htmlFor:`reporte-mensaje`,children:`Descripción del reporte`}),(0,L.jsx)(jf,{id:`reporte-mensaje`,value:r,onChange:e=>{i(e.target.value),s&&c(null)},rows:6,required:!0,placeholder:`Explica qué ocurrió, qué esperabas que pasara y cualquier detalle que pueda ayudar a revisarlo.`,className:`resize-y`}),(0,L.jsxs)(`p`,{className:`text-[11px] text-muted-foreground`,children:[`Se enviará como: `,e.email]})]}),s?(0,L.jsx)(`p`,{role:`alert`,className:`rounded-md border border-red-200 bg-red-50 px-3 py-2 text-left text-xs text-red-700 dark:border-red-900/60 dark:bg-red-950/35 dark:text-red-300`,children:s}):null,(0,L.jsx)(wf,{children:l?(0,L.jsx)($s,{onClick:()=>f(!1),children:`Cerrar`}):(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)($s,{variant:`outline`,onClick:()=>f(!1),disabled:a,children:`Cancelar`}),(0,L.jsxs)($s,{onClick:()=>void p(),disabled:!r.trim()||a,children:[a?(0,L.jsx)(da,{className:`size-4 animate-spin`}):(0,L.jsx)(ya,{className:`size-4`}),a?`Enviando…`:`Enviar reporte`]})]})})]})})]})}var Y_=Dr(`/`)({component:$_}),X_=15,Z_=[`Todos`,...v_];function Q_(e,t){return t<=7?Array.from({length:t},(e,t)=>t+1):e<=4?[1,2,3,4,5,`end-ellipsis`,t]:e>=t-3?[1,`start-ellipsis`,t-4,t-3,t-2,t-1,t]:[1,`start-ellipsis`,e-1,e,e+1,`end-ellipsis`,t]}function $_(){let{canManageForms:e}=qa(),{formularios:t,favoritos:n,recientes:r,listo:i,errorCarga:a,guardar:o,eliminar:s,alternarFavorito:c,registrarUso:l}=B_(e),[u,d]=(0,_.useState)(``),[f,p]=(0,_.useState)(`Todos`),[m,h]=(0,_.useState)({Todos:1}),[g,v]=(0,_.useState)(!1),[y,b]=(0,_.useState)(null),[x,S]=(0,_.useState)(null),C=(0,_.useMemo)(()=>{let e=u.trim().toLowerCase();return t.filter(e=>f===`Todos`||e.categoria===f).filter(t=>!e||`${t.nombre} ${t.descripcion} ${t.categoria}`.toLowerCase().includes(e)).sort((e,t)=>!n.includes(e.id)-+!n.includes(t.id)||e.nombre.localeCompare(t.nombre))},[t,f,u,n]),w=Math.max(1,Math.ceil(C.length/X_)),T=m[f]??1,E=Math.min(T,w),D=(E-1)*X_,O=C.slice(D,D+X_),k=Q_(E,w),A=e=>{let t=Math.min(Math.max(e,1),w);h(e=>({...e,[f]:t}))},ee=e=>{p(e),h(t=>({...t,[e]:t[e]??1}))},j=r.map(e=>t.find(t=>t.id===e)).filter(e=>e!=null&&e.activo).slice(0,4),M=e=>{e.activo&&l(e.id)};return(0,L.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,L.jsx)(ff,{}),(0,L.jsxs)(`main`,{className:`mx-auto w-full max-w-6xl flex-1 px-6`,children:[(0,L.jsxs)(`section`,{className:`pt-14 pb-10`,children:[(0,L.jsx)(`h1`,{className:`max-w-3xl text-4xl leading-[1.1] font-bold text-glm-blue sm:text-5xl`,children:`Cruces GLM`}),(0,L.jsx)(`p`,{className:`mt-5 max-w-2xl text-[15px] leading-relaxed text-glm-body`,children:`Un solo lugar para acceder a los cruces desarrollados para el área de administración. Busca el formulario, ábrelo y ejecuta el cruce sin tener que buscar enlaces sueltos.`}),(0,L.jsx)(`dl`,{className:`mt-8 flex flex-wrap gap-x-12 gap-y-4`,children:[{k:`Formularios`,v:t.length},{k:`Disponibles`,v:t.filter(e=>e.activo).length},{k:`Categorías`,v:v_.length},{k:`Favoritos`,v:n.length}].map(e=>(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`dd`,{className:`text-3xl font-bold text-glm-blue`,children:e.v}),(0,L.jsx)(`dt`,{className:`mt-1 text-[11px] tracking-[0.14em] text-muted-foreground uppercase`,children:e.k})]},e.k))})]}),(0,L.jsx)(`div`,{className:`glm-rule`}),i&&j.length>0&&(0,L.jsxs)(`section`,{className:`py-8`,children:[(0,L.jsx)(`h2`,{className:`glm-section-title inline-block text-xs`,children:`Usados recientemente`}),(0,L.jsx)(`div`,{className:`mt-4 flex flex-wrap gap-2`,children:j.map(e=>(0,L.jsx)(br,{to:`/formularios/$formId`,params:{formId:e.id},onClick:()=>M(e),className:`rounded-full border border-border px-3.5 py-1.5 text-xs text-glm-blue transition-colors hover:border-glm-green hover:bg-glm-leaf-bg`,children:e.nombre},e.id))})]}),(0,L.jsxs)(`section`,{className:`py-8`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between`,children:[(0,L.jsxs)(`div`,{className:`relative w-full sm:max-w-sm`,children:[(0,L.jsx)(va,{className:`absolute top-1/2 left-3 size-4 -translate-y-1/2 text-muted-foreground`}),(0,L.jsx)(ec,{value:u,onChange:e=>{d(e.target.value),h(e=>({...e,[f]:1}))},placeholder:`Buscar formulario o proceso…`,className:`pl-9`})]}),e&&(0,L.jsxs)($s,{size:`sm`,onClick:()=>{b(null),v(!0)},children:[(0,L.jsx)(ga,{className:`size-4`}),` Agregar formulario`]})]}),(0,L.jsx)(`div`,{className:`mt-6 overflow-x-auto pb-1`,children:(0,L.jsx)(`div`,{role:`tablist`,"aria-label":`Secciones de Cruces GLM`,className:`grid w-full min-w-[640px] max-w-3xl grid-cols-4 gap-1 rounded-xl border border-border bg-muted/55 p-1 shadow-sm`,children:Z_.map(e=>{let t=e===f;return(0,L.jsx)(`button`,{type:`button`,role:`tab`,"aria-selected":t,onClick:()=>ee(e),className:t?`relative w-full rounded-lg border border-glm-green/35 bg-card px-3 py-2.5 text-center text-xs font-bold tracking-[0.08em] text-glm-blue uppercase shadow-sm outline-none transition-all after:absolute after:right-5 after:bottom-0 after:left-5 after:h-0.5 after:rounded-full after:bg-glm-green focus:outline-none focus-visible:ring-2 focus-visible:ring-glm-green focus-visible:ring-offset-2 focus-visible:ring-offset-background`:`w-full rounded-lg border border-transparent px-3 py-2.5 text-center text-xs font-semibold tracking-[0.08em] text-muted-foreground uppercase outline-none transition-all hover:bg-card/75 hover:text-glm-blue focus:outline-none focus-visible:ring-2 focus-visible:ring-glm-green focus-visible:ring-offset-2 focus-visible:ring-offset-background`,children:e},e)})})})]}),(0,L.jsxs)(`section`,{className:`pb-24 sm:pb-28`,children:[a&&(0,L.jsxs)(`div`,{className:`mb-5 rounded-md border border-border bg-glm-section-bg px-4 py-3 text-sm text-glm-blue`,children:[`No se pudieron cargar los formularios: `,a]}),C.length===0?(0,L.jsx)(`div`,{className:`glm-card flex flex-col items-center p-12 text-center`,children:(0,L.jsx)(`p`,{className:`text-sm text-glm-body`,children:`No hay formularios que coincidan con esta sección o búsqueda.`})}):(0,L.jsx)(`div`,{className:`grid gap-5 sm:grid-cols-2 lg:grid-cols-3`,children:O.map(t=>(0,L.jsx)(vf,{form:t,favorito:n.includes(t.id),onFavorito:c,canManageForms:e,onEditar:t=>{e&&(b(t),v(!0))},onEliminar:t=>{e&&S(t)},onAbrir:M},t.id))}),w>1&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`nav`,{className:`mt-10 flex flex-wrap items-center justify-center gap-2`,"aria-label":`Paginación de ${f}`,children:[(0,L.jsx)(`button`,{type:`button`,onClick:()=>A(E-1),disabled:E===1,className:`inline-flex size-9 items-center justify-center rounded-md border border-border bg-card text-glm-blue transition-colors hover:border-glm-green hover:bg-glm-leaf-bg disabled:cursor-not-allowed disabled:opacity-40`,"aria-label":`Página anterior`,children:(0,L.jsx)(aa,{className:`size-4`})}),k.map(e=>typeof e==`number`?(0,L.jsx)(`button`,{type:`button`,onClick:()=>A(e),"aria-current":e===E?`page`:void 0,className:e===E?`inline-flex size-9 items-center justify-center rounded-md border border-glm-blue bg-glm-blue text-sm font-bold text-white shadow-sm`:`inline-flex size-9 items-center justify-center rounded-md border border-border bg-card text-sm font-semibold text-glm-blue transition-colors hover:border-glm-green hover:bg-glm-leaf-bg`,children:e},e):(0,L.jsx)(`span`,{className:`inline-flex size-9 items-center justify-center text-sm text-muted-foreground`,"aria-hidden":`true`,children:`…`},e)),(0,L.jsx)(`button`,{type:`button`,onClick:()=>A(E+1),disabled:E===w,className:`inline-flex size-9 items-center justify-center rounded-md border border-border bg-card text-glm-blue transition-colors hover:border-glm-green hover:bg-glm-leaf-bg disabled:cursor-not-allowed disabled:opacity-40`,"aria-label":`Página siguiente`,children:(0,L.jsx)(oa,{className:`size-4`})})]}),(0,L.jsxs)(`p`,{className:`mt-3 text-center text-[11px] text-muted-foreground`,children:[`Página `,E,` de `,w,` · `,C.length,` formulario`,C.length===1?``:`s`]})]})]}),(0,L.jsx)(J_,{})]}),e&&(0,L.jsxs)(L.Fragment,{children:[(0,L.jsx)(W_,{open:g,onOpenChange:v,inicial:y,onGuardar:async e=>{await o(e)}}),(0,L.jsx)(Gd,{open:!!x,onOpenChange:e=>!e&&S(null),children:(0,L.jsxs)(Jd,{children:[(0,L.jsxs)(Yd,{children:[(0,L.jsxs)(Zd,{className:`text-glm-blue`,children:[`¿Eliminar “`,x?.nombre,`”?`]}),(0,L.jsx)(Qd,{children:`Se quitará este formulario del hub. Si lo necesitas nuevamente, podrás volver a agregarlo desde “Agregar formulario”.`})]}),(0,L.jsxs)(Xd,{children:[(0,L.jsx)(ef,{children:`Cancelar`}),(0,L.jsx)($d,{onClick:()=>{let e=x;S(null),e&&s(e.id)},children:`Eliminar`})]})]})})]})]})}var ev=Dr(`/formularios/$formId`)({component:tv});function tv(){let{formId:e}=ev.useParams(),[t,n]=(0,_.useState)(null),[r,i]=(0,_.useState)(!1),[a,o]=(0,_.useState)(null),[s,c]=(0,_.useState)(0),[l,u]=(0,_.useState)(!1);return(0,_.useEffect)(()=>{let t=!0;return i(!1),o(null),n(null),V_(e).then(e=>{t&&(n(e),i(!0),e?.activo&&_f(e))}).catch(e=>{t&&(o(e instanceof Error?e.message:`No se pudo consultar este formulario en Supabase.`),i(!0))}),()=>{t=!1}},[e]),(0,L.jsxs)(`div`,{className:`flex min-h-screen flex-col`,children:[(0,L.jsx)(ff,{}),(0,L.jsxs)(`main`,{className:`mx-auto w-full max-w-6xl flex-1 px-6 py-8`,children:[(0,L.jsxs)(br,{to:`/`,className:`inline-flex items-center gap-1.5 text-xs font-bold tracking-[0.08em] text-muted-foreground uppercase transition-colors hover:text-glm-green`,children:[(0,L.jsx)(ta,{className:`size-3.5`}),` Volver al hub`]}),r?a?(0,L.jsxs)(`div`,{className:`mt-10 rounded-md border border-border bg-glm-section-bg p-8`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-bold text-glm-blue`,children:`No se pudo cargar el formulario`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-glm-body`,children:a})]}):t?t.activo?(0,L.jsxs)(L.Fragment,{children:[(0,L.jsxs)(`div`,{className:`mt-6 flex flex-wrap items-end justify-between gap-4`,children:[(0,L.jsxs)(`div`,{children:[(0,L.jsx)(`span`,{className:`text-[11px] font-bold tracking-[0.16em] text-glm-green uppercase`,children:t.categoria}),(0,L.jsx)(`h1`,{className:`mt-1 max-w-3xl text-3xl leading-tight font-bold text-glm-blue`,children:t.nombre}),(0,L.jsx)(`p`,{className:`mt-2 max-w-2xl text-sm text-glm-body`,children:t.descripcion})]}),(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,L.jsxs)($s,{variant:`outline`,size:`sm`,onClick:async()=>{if(t)try{await navigator.clipboard.writeText(t.url),u(!0),setTimeout(()=>u(!1),1800)}catch{}},children:[(0,L.jsx)(ua,{className:`size-4`}),` `,l?`Copiado`:`Copiar enlace`]}),(0,L.jsxs)($s,{variant:`outline`,size:`sm`,onClick:()=>c(e=>e+1),children:[(0,L.jsx)(_a,{className:`size-4`}),` Reiniciar`]}),(0,L.jsx)($s,{size:`sm`,asChild:!0,children:(0,L.jsxs)(`a`,{href:t.url,target:`_blank`,rel:`noreferrer`,children:[(0,L.jsx)(la,{className:`size-4`}),` Abrir en pestaña nueva`]})})]})]}),(0,L.jsxs)(`div`,{className:`mt-6 overflow-hidden rounded-md border border-border`,children:[(0,L.jsx)(`div`,{className:`glm-strip`}),(0,L.jsx)(`iframe`,{src:t.url,title:t.nombre,className:`h-[72vh] min-h-[520px] w-full bg-background`},s)]}),(0,L.jsx)(`p`,{className:`mt-3 text-[11px] italic text-muted-foreground`,children:`Si el formulario no carga aquí, presiona el botón “Abrir en pestaña nueva”.`})]}):(0,L.jsxs)(`div`,{className:`mt-10 rounded-md border border-border bg-muted/45 p-8`,children:[(0,L.jsx)(`span`,{className:`text-[11px] font-bold tracking-[0.16em] text-muted-foreground uppercase`,children:t.categoria}),(0,L.jsx)(`h1`,{className:`mt-2 text-2xl font-bold text-muted-foreground`,children:t.nombre}),(0,L.jsx)(`p`,{className:`mt-3 max-w-2xl text-sm text-muted-foreground`,children:`Este formulario no está disponible actualmente. Cuando vuelva a habilitarse podrás abrirlo desde Cruces GLM.`})]}):(0,L.jsxs)(`div`,{className:`mt-10 glm-card p-8`,children:[(0,L.jsx)(`h1`,{className:`text-xl font-bold text-glm-blue`,children:`Formulario no encontrado`}),(0,L.jsx)(`p`,{className:`mt-2 text-sm text-glm-body`,children:`Este formulario ya no existe en el hub o fue eliminado.`})]}):(0,L.jsxs)(`div`,{className:`mt-10 flex items-center gap-3 text-sm text-muted-foreground`,children:[(0,L.jsx)(da,{className:`size-4 animate-spin`}),` Cargando formulario…`]}),(0,L.jsx)(J_,{})]})]})}var nv={IndexRoute:Y_.update({id:`/`,path:`/`,getParentRoute:()=>eo}),FormulariosFormIdRoute:ev.update({id:`/formularios/$formId`,path:`/formularios/$formId`,getParentRoute:()=>eo})},rv=eo._addFileChildren(nv)._addFileTypes(),iv=new Gi,av=`/cruces-glm/`.replace(/\/$/,``)||`/`,ov=Wr({routeTree:rv,context:{queryClient:iv},basepath:av,scrollRestoration:!0,defaultPreloadStaleTime:0});of();var sv=document.getElementById(`root`);if(!sv)throw Error(`No se encontró el elemento raíz de Cruces GLM.`);(0,wa.createRoot)(sv).render((0,L.jsx)(_.StrictMode,{children:(0,L.jsx)(qr,{router:ov})}));