diff --git a/README.md b/README.md index 8e1759f..1ab24a6 100644 --- a/README.md +++ b/README.md @@ -12,8 +12,7 @@ A collection of examples on top of Aidbox FHIR platform - [Aidbox Forms Renderer with Angular.js in controlled mode](aidbox-forms-renderer-angular-controlled/) - [Aidbox Forms Renderer with React.js](aidbox-forms-renderer-react/) - [Aidbox Forms Renderer with React.js in controlled mode](aidbox-forms-renderer-react-controlled/) -- [Aidbox Forms Smart App Launch](aidbox-forms-smart-launch/) -- [Aidbox Forms Smart App Launch (with backend)](aidbox-forms-smart-launch-2/) +- [Aidbox Forms Smart App Launch](aidbox-forms-smart-launch-2/) - [Aidbox Notify via Custom Resources](aidbox-notify-via-custom-resources/) - [Topic-Based Subscription to Kafka](aidbox-subscriptions-to-kafka/) - [SMART App Launch with Aidbox and Keycloak](smart-app-launch/) diff --git a/aidbox-forms-smart-launch-2/.env.example b/aidbox-forms-smart-launch-2/.env.example index f87b2e0..c4c16ac 100644 --- a/aidbox-forms-smart-launch-2/.env.example +++ b/aidbox-forms-smart-launch-2/.env.example @@ -5,7 +5,7 @@ PGPASSWORD=postgres PGDATABASE=aidbox AIDBOX_IMAGE=healthsamurai/aidboxone:edge -AIDBOX_LICENSE=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJvZmZsaW5lIjpmYWxzZSwia2V5Ijoib25saW5lLTIwMjIwNTI0LTE0MzY0NyIsIm5hbWUiOiJzYW5zYXJhLWRldi11c2VyIiwiZXhwaXJhdGlvbiI6IjIwMjMtMDYtMTZUMTA6Mzg6NDAuNDA5WiIsInR5cGUiOiJkZXZlbG9wbWVudCIsImNyZWF0ZWQiOiIyMDIyLTA2LTE2VDEwOjM4OjQwLjQxMFoiLCJwcm9kdWN0IjoiYWlkYm94IiwicHJvamVjdCI6eyJpZCI6IjdmMDM3ZTQ4LWJjZTQtNDZkOC1iNTQ3LTU2OTNmYzk1NmUxZCIsInJlc291cmNlVHlwZSI6IlByb2plY3QifSwic3RhdHVzIjoiYWN0aXZlIiwiaWQiOiJiZThlYTBjZC1jYzVhLTRlZmQtYTU1Zi00MzMyM2U4NTdhOTQiLCJpbmZvIjp7ImdvYWwiOiJkZXZlbG9wbWVudCIsImhvc3RpbmciOiJvbi1wcmVtaXNlcyIsImNvbW1lbnRzIjoiTGljZW5zZSB1c2VkIGZvciBsb2NhbCBkZXZlbG9wbWVudCBvZiBTYW5zYXJhKGFpZGJveCkgcHJvamVjdC4ifSwiaXNzdWVyIjoiaHR0cHM6Ly9haWRib3guYXBwIn0.ZTZ0csC6yK4FhLZ50W-k1og8YczJrnjeTni3lgyCvCEPg9yNngrENOkIknBd5aP490nJzytyP3Xj7bkPmS4-XLD2n37bD8TQNjcchA3AoKJEA3FdLWth4jsQ3NWw5nKdphqYgG-pkNC24nRuhQ64IN8rAAMPCfl1x6-pnYz5v40 +AIDBOX_LICENSE= AIDBOX_PORT=8888 AIDBOX_FHIR_VERSION=4.0.1 AIDBOX_STDOUT_PRETTY=all diff --git a/aidbox-forms-smart-launch-2/README.md b/aidbox-forms-smart-launch-2/README.md index e96b3e4..e6b7868 100644 --- a/aidbox-forms-smart-launch-2/README.md +++ b/aidbox-forms-smart-launch-2/README.md @@ -37,6 +37,8 @@ First, copy `.env.example` to `.env` and set the correct values: cp .env.example .env ``` +Obtain license key from [Aidbox](https://aidbox.app) and set it in `AIDBOX_LICENSE` variable. + Then, start aidbox server: ```bash diff --git a/aidbox-forms-smart-launch/assets/index-JIiDehxf.js b/aidbox-forms-smart-launch/assets/index-JIiDehxf.js deleted file mode 100644 index 66fba88..0000000 --- a/aidbox-forms-smart-launch/assets/index-JIiDehxf.js +++ /dev/null @@ -1,294 +0,0 @@ -var ym=e=>{throw TypeError(e)};var OE=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports);var Kc=(e,t,n)=>t.has(e)||ym("Cannot "+n);var _=(e,t,n)=>(Kc(e,t,"read from private field"),n?n.call(e):t.get(e)),ne=(e,t,n)=>t.has(e)?ym("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),q=(e,t,n,r)=>(Kc(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),se=(e,t,n)=>(Kc(e,t,"access private method"),n);var ol=(e,t,n,r)=>({set _(o){q(e,t,o,n)},get _(){return _(e,t,r)}});var u$=OE((S$,ou)=>{function d0(e,t){for(var n=0;nr[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const s of i.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var Xn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Kp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function DE(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var f0={exports:{}},Yu={},p0={exports:{}},ve={};/** - * @license React - * react.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var Oa=Symbol.for("react.element"),IE=Symbol.for("react.portal"),FE=Symbol.for("react.fragment"),LE=Symbol.for("react.strict_mode"),$E=Symbol.for("react.profiler"),UE=Symbol.for("react.provider"),zE=Symbol.for("react.context"),BE=Symbol.for("react.forward_ref"),VE=Symbol.for("react.suspense"),HE=Symbol.for("react.memo"),KE=Symbol.for("react.lazy"),wm=Symbol.iterator;function GE(e){return e===null||typeof e!="object"?null:(e=wm&&e[wm]||e["@@iterator"],typeof e=="function"?e:null)}var h0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g0=Object.assign,m0={};function ns(e,t,n){this.props=e,this.context=t,this.refs=m0,this.updater=n||h0}ns.prototype.isReactComponent={};ns.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): 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")};ns.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function v0(){}v0.prototype=ns.prototype;function Gp(e,t,n){this.props=e,this.context=t,this.refs=m0,this.updater=n||h0}var Wp=Gp.prototype=new v0;Wp.constructor=Gp;g0(Wp,ns.prototype);Wp.isPureReactComponent=!0;var xm=Array.isArray,y0=Object.prototype.hasOwnProperty,qp={current:null},w0={key:!0,ref:!0,__self:!0,__source:!0};function x0(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)y0.call(t,r)&&!w0.hasOwnProperty(r)&&(o[r]=t[r]);var a=arguments.length-2;if(a===1)o.children=n;else if(1>>1,te=D[Q];if(0>>1;Qo(z,V))Wo(he,z)?(D[Q]=he,D[W]=V,Q=W):(D[Q]=z,D[ge]=V,Q=ge);else if(Wo(he,V))D[Q]=he,D[W]=V,Q=W;else break e}}return N}function o(D,N){var V=D.sortIndex-N.sortIndex;return V!==0?V:D.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,a=s.now();e.unstable_now=function(){return s.now()-a}}var l=[],u=[],d=1,c=null,f=3,m=!1,y=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,w=typeof clearTimeout=="function"?clearTimeout:null,g=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function x(D){for(var N=n(u);N!==null;){if(N.callback===null)r(u);else if(N.startTime<=D)r(u),N.sortIndex=N.expirationTime,t(l,N);else break;N=n(u)}}function C(D){if(v=!1,x(D),!y)if(n(l)!==null)y=!0,j(P);else{var N=n(u);N!==null&&B(C,N.startTime-D)}}function P(D,N){y=!1,v&&(v=!1,w(T),T=-1),m=!0;var V=f;try{for(x(N),c=n(l);c!==null&&(!(c.expirationTime>N)||D&&!O());){var Q=c.callback;if(typeof Q=="function"){c.callback=null,f=c.priorityLevel;var te=Q(c.expirationTime<=N);N=e.unstable_now(),typeof te=="function"?c.callback=te:c===n(l)&&r(l),x(N)}else r(l);c=n(l)}if(c!==null)var pe=!0;else{var ge=n(u);ge!==null&&B(C,ge.startTime-N),pe=!1}return pe}finally{c=null,f=V,m=!1}}var b=!1,A=null,T=-1,$=5,E=-1;function O(){return!(e.unstable_now()-E<$)}function F(){if(A!==null){var D=e.unstable_now();E=D;var N=!0;try{N=A(!0,D)}finally{N?L():(b=!1,A=null)}}else b=!1}var L;if(typeof g=="function")L=function(){g(F)};else if(typeof MessageChannel<"u"){var R=new MessageChannel,M=R.port2;R.port1.onmessage=F,L=function(){M.postMessage(null)}}else L=function(){S(F,0)};function j(D){A=D,b||(b=!0,L())}function B(D,N){T=S(function(){D(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(D){D.callback=null},e.unstable_continueExecution=function(){y||m||(y=!0,j(P))},e.unstable_forceFrameRate=function(D){0>D||125Q?(D.sortIndex=V,t(u,D),n(l)===null&&D===n(u)&&(v?(w(T),T=-1):v=!0,B(C,V-Q))):(D.sortIndex=te,t(l,D),y||m||(y=!0,j(P))),D},e.unstable_shouldYield=O,e.unstable_wrapCallback=function(D){var N=f;return function(){var V=f;f=N;try{return D.apply(this,arguments)}finally{f=V}}}})(P0);E0.exports=P0;var rP=E0.exports;/** - * @license React - * react-dom.production.min.js - * - * Copyright (c) Facebook, Inc. and its affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var oP=h,Kt=rP;function K(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jd=Object.prototype.hasOwnProperty,iP=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Cm={},bm={};function sP(e){return Jd.call(bm,e)?!0:Jd.call(Cm,e)?!1:iP.test(e)?bm[e]=!0:(Cm[e]=!0,!1)}function aP(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function lP(e,t,n,r){if(t===null||typeof t>"u"||aP(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Ct(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ut={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ut[e]=new Ct(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ut[t]=new Ct(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ut[e]=new Ct(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ut[e]=new Ct(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ut[e]=new Ct(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ut[e]=new Ct(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ut[e]=new Ct(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ut[e]=new Ct(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ut[e]=new Ct(e,5,!1,e.toLowerCase(),null,!1,!1)});var Yp=/[\-:]([a-z])/g;function Xp(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Yp,Xp);ut[t]=new Ct(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Yp,Xp);ut[t]=new Ct(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Yp,Xp);ut[t]=new Ct(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ut[e]=new Ct(e,1,!1,e.toLowerCase(),null,!1,!1)});ut.xlinkHref=new Ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ut[e]=new Ct(e,1,!1,e.toLowerCase(),null,!0,!0)});function Jp(e,t,n,r){var o=ut.hasOwnProperty(t)?ut[t]:null;(o!==null?o.type!==0:r||!(2a||o[s]!==i[a]){var l=` -`+o[s].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=s&&0<=a);break}}}finally{qc=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Os(e):""}function uP(e){switch(e.tag){case 5:return Os(e.type);case 16:return Os("Lazy");case 13:return Os("Suspense");case 19:return Os("SuspenseList");case 0:case 2:case 15:return e=Qc(e.type,!1),e;case 11:return e=Qc(e.type.render,!1),e;case 1:return e=Qc(e.type,!0),e;default:return""}}function nf(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ai:return"Fragment";case si:return"Portal";case Zd:return"Profiler";case Zp:return"StrictMode";case ef:return"Suspense";case tf:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case M0:return(e.displayName||"Context")+".Consumer";case T0:return(e._context.displayName||"Context")+".Provider";case eh:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case th:return t=e.displayName||null,t!==null?t:nf(e.type)||"Memo";case Rr:t=e._payload,e=e._init;try{return nf(e(t))}catch{}}return null}function cP(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return nf(t);case 8:return t===Zp?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Xr(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function k0(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function dP(e){var t=k0(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function al(e){e._valueTracker||(e._valueTracker=dP(e))}function N0(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=k0(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function iu(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function rf(e,t){var n=t.checked;return Be({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Em(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Xr(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function j0(e,t){t=t.checked,t!=null&&Jp(e,"checked",t,!1)}function of(e,t){j0(e,t);var n=Xr(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?sf(e,t.type,n):t.hasOwnProperty("defaultValue")&&sf(e,t.type,Xr(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Pm(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function sf(e,t,n){(t!=="number"||iu(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Ds=Array.isArray;function yi(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=ll.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function ra(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Bs={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},fP=["Webkit","ms","Moz","O"];Object.keys(Bs).forEach(function(e){fP.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Bs[t]=Bs[e]})});function F0(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Bs.hasOwnProperty(e)&&Bs[e]?(""+t).trim():t+"px"}function L0(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=F0(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var pP=Be({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function uf(e,t){if(t){if(pP[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(K(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(K(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(K(61))}if(t.style!=null&&typeof t.style!="object")throw Error(K(62))}}function cf(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var df=null;function nh(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ff=null,wi=null,xi=null;function Mm(e){if(e=Fa(e)){if(typeof ff!="function")throw Error(K(280));var t=e.stateNode;t&&(t=tc(t),ff(e.stateNode,e.type,t))}}function $0(e){wi?xi?xi.push(e):xi=[e]:wi=e}function U0(){if(wi){var e=wi,t=xi;if(xi=wi=null,Mm(e),t)for(e=0;e>>=0,e===0?32:31-(RP(e)/EP|0)|0}var ul=64,cl=4194304;function Is(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function uu(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var a=s&~o;a!==0?r=Is(a):(i&=s,i!==0&&(r=Is(i)))}else s=n&~o,s!==0?r=Is(s):i!==0&&(r=Is(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0n;n++)t.push(e);return t}function Da(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-yn(t),e[t]=n}function MP(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0=Hs),Lm=" ",$m=!1;function sw(e,t){switch(e){case"keyup":return r_.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function aw(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var li=!1;function i_(e,t){switch(e){case"compositionend":return aw(t);case"keypress":return t.which!==32?null:($m=!0,Lm);case"textInput":return e=t.data,e===Lm&&$m?null:e;default:return null}}function s_(e,t){if(li)return e==="compositionend"||!ch&&sw(e,t)?(e=ow(),Ul=ah=$r=null,li=!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}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Vm(n)}}function dw(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?dw(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function fw(){for(var e=window,t=iu();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=iu(e.document)}return t}function dh(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")}function g_(e){var t=fw(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&dw(n.ownerDocument.documentElement,n)){if(r!==null&&dh(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=Hm(n,i);var s=Hm(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,ui=null,yf=null,Gs=null,wf=!1;function Km(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;wf||ui==null||ui!==iu(r)||(r=ui,"selectionStart"in r&&dh(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}),Gs&&ua(Gs,r)||(Gs=r,r=fu(yf,"onSelect"),0fi||(e.current=Ef[fi],Ef[fi]=null,fi--)}function Ne(e,t){fi++,Ef[fi]=e.current,e.current=t}var Jr={},gt=io(Jr),At=io(!1),Ao=Jr;function Gi(e,t){var n=e.type.contextTypes;if(!n)return Jr;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function kt(e){return e=e.childContextTypes,e!=null}function hu(){De(At),De(gt)}function Jm(e,t,n){if(gt.current!==Jr)throw Error(K(168));Ne(gt,t),Ne(At,n)}function Sw(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(K(108,cP(e)||"Unknown",o));return Be({},n,r)}function gu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Jr,Ao=gt.current,Ne(gt,e),Ne(At,At.current),!0}function Zm(e,t,n){var r=e.stateNode;if(!r)throw Error(K(169));n?(e=Sw(e,t,Ao),r.__reactInternalMemoizedMergedChildContext=e,De(At),De(gt),Ne(gt,e)):De(At),Ne(At,n)}var Qn=null,nc=!1,ud=!1;function Cw(e){Qn===null?Qn=[e]:Qn.push(e)}function __(e){nc=!0,Cw(e)}function so(){if(!ud&&Qn!==null){ud=!0;var e=0,t=Me;try{var n=Qn;for(Me=1;e>=s,o-=s,Jn=1<<32-yn(t)+o|n<T?($=A,A=null):$=A.sibling;var E=f(w,A,x[T],C);if(E===null){A===null&&(A=$);break}e&&A&&E.alternate===null&&t(w,A),g=i(E,g,T),b===null?P=E:b.sibling=E,b=E,A=$}if(T===x.length)return n(w,A),Fe&&co(w,T),P;if(A===null){for(;TT?($=A,A=null):$=A.sibling;var O=f(w,A,E.value,C);if(O===null){A===null&&(A=$);break}e&&A&&O.alternate===null&&t(w,A),g=i(O,g,T),b===null?P=O:b.sibling=O,b=O,A=$}if(E.done)return n(w,A),Fe&&co(w,T),P;if(A===null){for(;!E.done;T++,E=x.next())E=c(w,E.value,C),E!==null&&(g=i(E,g,T),b===null?P=E:b.sibling=E,b=E);return Fe&&co(w,T),P}for(A=r(w,A);!E.done;T++,E=x.next())E=m(A,w,T,E.value,C),E!==null&&(e&&E.alternate!==null&&A.delete(E.key===null?T:E.key),g=i(E,g,T),b===null?P=E:b.sibling=E,b=E);return e&&A.forEach(function(F){return t(w,F)}),Fe&&co(w,T),P}function S(w,g,x,C){if(typeof x=="object"&&x!==null&&x.type===ai&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case sl:e:{for(var P=x.key,b=g;b!==null;){if(b.key===P){if(P=x.type,P===ai){if(b.tag===7){n(w,b.sibling),g=o(b,x.props.children),g.return=w,w=g;break e}}else if(b.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Rr&&nv(P)===b.type){n(w,b.sibling),g=o(b,x.props),g.ref=Rs(w,b,x),g.return=w,w=g;break e}n(w,b);break}else t(w,b);b=b.sibling}x.type===ai?(g=Mo(x.props.children,w.mode,C,x.key),g.return=w,w=g):(C=ql(x.type,x.key,x.props,null,w.mode,C),C.ref=Rs(w,g,x),C.return=w,w=C)}return s(w);case si:e:{for(b=x.key;g!==null;){if(g.key===b)if(g.tag===4&&g.stateNode.containerInfo===x.containerInfo&&g.stateNode.implementation===x.implementation){n(w,g.sibling),g=o(g,x.children||[]),g.return=w,w=g;break e}else{n(w,g);break}else t(w,g);g=g.sibling}g=vd(x,w.mode,C),g.return=w,w=g}return s(w);case Rr:return b=x._init,S(w,g,b(x._payload),C)}if(Ds(x))return y(w,g,x,C);if(ws(x))return v(w,g,x,C);vl(w,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,g!==null&&g.tag===6?(n(w,g.sibling),g=o(g,x),g.return=w,w=g):(n(w,g),g=md(x,w.mode,C),g.return=w,w=g),s(w)):n(w,g)}return S}var qi=Pw(!0),_w=Pw(!1),yu=io(null),wu=null,gi=null,gh=null;function mh(){gh=gi=wu=null}function vh(e){var t=yu.current;De(yu),e._currentValue=t}function Tf(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Ci(e,t){wu=e,gh=gi=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Mt=!0),e.firstContext=null)}function an(e){var t=e._currentValue;if(gh!==e)if(e={context:e,memoizedValue:t,next:null},gi===null){if(wu===null)throw Error(K(308));gi=e,wu.dependencies={lanes:0,firstContext:e}}else gi=gi.next=e;return t}var yo=null;function yh(e){yo===null?yo=[e]:yo.push(e)}function Tw(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,yh(t)):(n.next=o.next,o.next=n),t.interleaved=n,ar(e,r)}function ar(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Er=!1;function wh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mw(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function tr(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Wr(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Re&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,ar(e,n)}return o=r.interleaved,o===null?(t.next=t,yh(r)):(t.next=o.next,o.next=t),r.interleaved=t,ar(e,n)}function Bl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,oh(e,n)}}function rv(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function xu(e,t,n,r){var o=e.updateQueue;Er=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,a=o.shared.pending;if(a!==null){o.shared.pending=null;var l=a,u=l.next;l.next=null,s===null?i=u:s.next=u,s=l;var d=e.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==s&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var c=o.baseState;s=0,d=u=l=null,a=i;do{var f=a.lane,m=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:m,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var y=e,v=a;switch(f=t,m=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){c=y.call(m,c,f);break e}c=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(m,c,f):y,f==null)break e;c=Be({},c,f);break e;case 2:Er=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[a]:f.push(a))}else m={eventTime:m,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=m,l=c):d=d.next=m,s|=f;if(a=a.next,a===null){if(a=o.shared.pending,a===null)break;f=a,a=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(d===null&&(l=c),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);jo|=s,e.lanes=s,e.memoizedState=c}}function ov(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;tn?n:4,e(!0);var r=dd.transition;dd.transition={};try{e(!1),t()}finally{Me=n,dd.transition=r}}function Gw(){return ln().memoizedState}function k_(e,t,n){var r=Qr(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Ww(e))qw(t,n);else if(n=Tw(e,t,n,r),n!==null){var o=xt();wn(n,e,r,o),Qw(n,t,r)}}function N_(e,t,n){var r=Qr(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Ww(e))qw(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,a=i(s,n);if(o.hasEagerState=!0,o.eagerState=a,Sn(a,s)){var l=t.interleaved;l===null?(o.next=o,yh(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}n=Tw(e,t,o,r),n!==null&&(o=xt(),wn(n,e,r,o),Qw(n,t,r))}}function Ww(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function qw(e,t){Ws=Cu=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Qw(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,oh(e,n)}}var bu={readContext:an,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useInsertionEffect:ct,useLayoutEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useMutableSource:ct,useSyncExternalStore:ct,useId:ct,unstable_isNewReconciler:!1},j_={readContext:an,useCallback:function(e,t){return kn().memoizedState=[e,t===void 0?null:t],e},useContext:an,useEffect:sv,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Hl(4194308,4,zw.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Hl(4194308,4,e,t)},useInsertionEffect:function(e,t){return Hl(4,2,e,t)},useMemo:function(e,t){var n=kn();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=kn();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=k_.bind(null,ze,e),[r.memoizedState,e]},useRef:function(e){var t=kn();return e={current:e},t.memoizedState=e},useState:iv,useDebugValue:_h,useDeferredValue:function(e){return kn().memoizedState=e},useTransition:function(){var e=iv(!1),t=e[0];return e=A_.bind(null,e[1]),kn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=ze,o=kn();if(Fe){if(n===void 0)throw Error(K(407));n=n()}else{if(n=t(),ot===null)throw Error(K(349));No&30||jw(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,sv(Dw.bind(null,r,i,e),[e]),r.flags|=2048,va(9,Ow.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=kn(),t=ot.identifierPrefix;if(Fe){var n=Zn,r=Jn;n=(r&~(1<<32-yn(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ga++,0<\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[In]=t,e[fa]=r,ix(e,t,!1,!1),t.stateNode=e;e:{switch(s=cf(n,r),n){case"dialog":Oe("cancel",e),Oe("close",e),o=r;break;case"iframe":case"object":case"embed":Oe("load",e),o=r;break;case"video":case"audio":for(o=0;oXi&&(t.flags|=128,r=!0,Es(i,!1),t.lanes=4194304)}else{if(!r)if(e=Su(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),Es(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!Fe)return dt(t),null}else 2*Qe()-i.renderingStartTime>Xi&&n!==1073741824&&(t.flags|=128,r=!0,Es(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Qe(),t.sibling=null,n=Ue.current,Ne(Ue,r?n&1|2:n&1),t):(dt(t),null);case 22:case 23:return jh(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Lt&1073741824&&(dt(t),t.subtreeFlags&6&&(t.flags|=8192)):dt(t),null;case 24:return null;case 25:return null}throw Error(K(156,t.tag))}function z_(e,t){switch(ph(t),t.tag){case 1:return kt(t.type)&&hu(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Qi(),De(At),De(gt),Ch(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Sh(t),null;case 13:if(De(Ue),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(K(340));Wi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return De(Ue),null;case 4:return Qi(),null;case 10:return vh(t.type._context),null;case 22:case 23:return jh(),null;case 24:return null;default:return null}}var wl=!1,ht=!1,B_=typeof WeakSet=="function"?WeakSet:Set,Y=null;function mi(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){We(e,t,r)}else n.current=null}function Ff(e,t,n){try{n()}catch(r){We(e,t,r)}}var vv=!1;function V_(e,t){if(xf=cu,e=fw(),dh(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,a=-1,l=-1,u=0,d=0,c=e,f=null;t:for(;;){for(var m;c!==n||o!==0&&c.nodeType!==3||(a=s+o),c!==i||r!==0&&c.nodeType!==3||(l=s+r),c.nodeType===3&&(s+=c.nodeValue.length),(m=c.firstChild)!==null;)f=c,c=m;for(;;){if(c===e)break t;if(f===n&&++u===o&&(a=s),f===i&&++d===r&&(l=s),(m=c.nextSibling)!==null)break;c=f,f=c.parentNode}c=m}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(Sf={focusedElem:e,selectionRange:n},cu=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,S=y.memoizedState,w=t.stateNode,g=w.getSnapshotBeforeUpdate(t.elementType===t.type?v:fn(t.type,v),S);w.__reactInternalSnapshotBeforeUpdate=g}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(K(163))}}catch(C){We(t,t.return,C)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return y=vv,vv=!1,y}function qs(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Ff(t,n,i)}o=o.next}while(o!==r)}}function ic(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Lf(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function lx(e){var t=e.alternate;t!==null&&(e.alternate=null,lx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[In],delete t[fa],delete t[Rf],delete t[E_],delete t[P_])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function ux(e){return e.tag===5||e.tag===3||e.tag===4}function yv(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||ux(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.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function $f(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=pu));else if(r!==4&&(e=e.child,e!==null))for($f(e,t,n),e=e.sibling;e!==null;)$f(e,t,n),e=e.sibling}function Uf(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&&(e=e.child,e!==null))for(Uf(e,t,n),e=e.sibling;e!==null;)Uf(e,t,n),e=e.sibling}var at=null,hn=!1;function vr(e,t,n){for(n=n.child;n!==null;)cx(e,t,n),n=n.sibling}function cx(e,t,n){if(Ln&&typeof Ln.onCommitFiberUnmount=="function")try{Ln.onCommitFiberUnmount(Xu,n)}catch{}switch(n.tag){case 5:ht||mi(n,t);case 6:var r=at,o=hn;at=null,vr(e,t,n),at=r,hn=o,at!==null&&(hn?(e=at,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):at.removeChild(n.stateNode));break;case 18:at!==null&&(hn?(e=at,n=n.stateNode,e.nodeType===8?ld(e.parentNode,n):e.nodeType===1&&ld(e,n),aa(e)):ld(at,n.stateNode));break;case 4:r=at,o=hn,at=n.stateNode.containerInfo,hn=!0,vr(e,t,n),at=r,hn=o;break;case 0:case 11:case 14:case 15:if(!ht&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ff(n,t,s),o=o.next}while(o!==r)}vr(e,t,n);break;case 1:if(!ht&&(mi(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){We(n,t,a)}vr(e,t,n);break;case 21:vr(e,t,n);break;case 22:n.mode&1?(ht=(r=ht)||n.memoizedState!==null,vr(e,t,n),ht=r):vr(e,t,n);break;default:vr(e,t,n)}}function wv(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new B_),t.forEach(function(r){var o=J_.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function dn(e,t){var n=t.deletions;if(n!==null)for(var r=0;ro&&(o=s),r&=~i}if(r=o,r=Qe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*K_(r/1960))-r,10e?16:e,Ur===null)var r=!1;else{if(e=Ur,Ur=null,Pu=0,Re&6)throw Error(K(331));var o=Re;for(Re|=4,Y=e.current;Y!==null;){var i=Y,s=i.child;if(Y.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lQe()-kh?To(e,0):Ah|=n),Nt(e,t)}function yx(e,t){t===0&&(e.mode&1?(t=cl,cl<<=1,!(cl&130023424)&&(cl=4194304)):t=1);var n=xt();e=ar(e,t),e!==null&&(Da(e,t,n),Nt(e,n))}function X_(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),yx(e,n)}function J_(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(K(314))}r!==null&&r.delete(t),yx(e,n)}var wx;wx=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||At.current)Mt=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Mt=!1,$_(e,t,n);Mt=!!(e.flags&131072)}else Mt=!1,Fe&&t.flags&1048576&&bw(t,vu,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Kl(e,t),e=t.pendingProps;var o=Gi(t,gt.current);Ci(t,n),o=Rh(null,t,r,e,o,n);var i=Eh();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,kt(r)?(i=!0,gu(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,wh(t),o.updater=oc,t.stateNode=o,o._reactInternals=t,Af(t,r,e,n),t=jf(null,t,r,!0,i,n)):(t.tag=0,Fe&&i&&fh(t),wt(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Kl(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=eT(r),e=fn(r,e),o){case 0:t=Nf(null,t,r,e,n);break e;case 1:t=hv(null,t,r,e,n);break e;case 11:t=fv(null,t,r,e,n);break e;case 14:t=pv(null,t,r,fn(r.type,e),n);break e}throw Error(K(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),Nf(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),hv(e,t,r,o,n);case 3:e:{if(nx(t),e===null)throw Error(K(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Mw(e,t),xu(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Yi(Error(K(423)),t),t=gv(e,t,r,n,o);break e}else if(r!==o){o=Yi(Error(K(424)),t),t=gv(e,t,r,n,o);break e}else for(Bt=Gr(t.stateNode.containerInfo.firstChild),Vt=t,Fe=!0,mn=null,n=_w(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Wi(),r===o){t=lr(e,t,n);break e}wt(e,t,r,n)}t=t.child}return t;case 5:return Aw(t),e===null&&_f(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,Cf(r,o)?s=null:i!==null&&Cf(r,i)&&(t.flags|=32),tx(e,t),wt(e,t,s,n),t.child;case 6:return e===null&&_f(t),null;case 13:return rx(e,t,n);case 4:return xh(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=qi(t,null,r,n):wt(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),fv(e,t,r,o,n);case 7:return wt(e,t,t.pendingProps,n),t.child;case 8:return wt(e,t,t.pendingProps.children,n),t.child;case 12:return wt(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,Ne(yu,r._currentValue),r._currentValue=s,i!==null)if(Sn(i.value,s)){if(i.children===o.children&&!At.current){t=lr(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var a=i.dependencies;if(a!==null){s=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=tr(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),Tf(i.return,n,t),a.lanes|=n;break}l=l.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(K(341));s.lanes|=n,a=s.alternate,a!==null&&(a.lanes|=n),Tf(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}wt(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Ci(t,n),o=an(o),r=r(o),t.flags|=1,wt(e,t,r,n),t.child;case 14:return r=t.type,o=fn(r,t.pendingProps),o=fn(r.type,o),pv(e,t,r,o,n);case 15:return Zw(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:fn(r,o),Kl(e,t),t.tag=1,kt(r)?(e=!0,gu(t)):e=!1,Ci(t,n),Yw(t,r,o),Af(t,r,o,n),jf(null,t,r,!0,e,n);case 19:return ox(e,t,n);case 22:return ex(e,t,n)}throw Error(K(156,t.tag))};function xx(e,t){return W0(e,t)}function Z_(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(e,t,n,r){return new Z_(e,t,n,r)}function Dh(e){return e=e.prototype,!(!e||!e.isReactComponent)}function eT(e){if(typeof e=="function")return Dh(e)?1:0;if(e!=null){if(e=e.$$typeof,e===eh)return 11;if(e===th)return 14}return 2}function Yr(e,t){var n=e.alternate;return n===null?(n=nn(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ql(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Dh(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case ai:return Mo(n.children,o,i,t);case Zp:s=8,o|=8;break;case Zd:return e=nn(12,n,t,o|2),e.elementType=Zd,e.lanes=i,e;case ef:return e=nn(13,n,t,o),e.elementType=ef,e.lanes=i,e;case tf:return e=nn(19,n,t,o),e.elementType=tf,e.lanes=i,e;case A0:return ac(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case T0:s=10;break e;case M0:s=9;break e;case eh:s=11;break e;case th:s=14;break e;case Rr:s=16,r=null;break e}throw Error(K(130,e==null?e:typeof e,""))}return t=nn(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function Mo(e,t,n,r){return e=nn(7,e,r,t),e.lanes=n,e}function ac(e,t,n,r){return e=nn(22,e,r,t),e.elementType=A0,e.lanes=n,e.stateNode={isHidden:!1},e}function md(e,t,n){return e=nn(6,e,null,t),e.lanes=n,e}function vd(e,t,n){return t=nn(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function tT(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xc(0),this.expirationTimes=Xc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xc(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Ih(e,t,n,r,o,i,s,a,l){return e=new tT(e,t,n,a,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=nn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},wh(i),e}function nT(e,t,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Rx)}catch(e){console.error(e)}}Rx(),R0.exports=Wt;var is=R0.exports;const Ex=Kp(is),aT=d0({__proto__:null,default:Ex},[is]);var Px,_v=is;Px=_v.createRoot,_v.hydrateRoot;/** - * @remix-run/router v1.20.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Ie(){return Ie=Object.assign?Object.assign.bind():function(e){for(var t=1;t"u")throw new Error(t)}function Do(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function uT(){return Math.random().toString(36).substr(2,8)}function Mv(e,t){return{usr:e.state,key:e.key,idx:t}}function wa(e,t,n,r){return n===void 0&&(n=null),Ie({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?fr(t):t,{state:n,key:t&&t.key||r||uT()})}function Io(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function fr(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function cT(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,s=o.history,a=Xe.Pop,l=null,u=d();u==null&&(u=0,s.replaceState(Ie({},s.state,{idx:u}),""));function d(){return(s.state||{idx:null}).idx}function c(){a=Xe.Pop;let S=d(),w=S==null?null:S-u;u=S,l&&l({action:a,location:v.location,delta:w})}function f(S,w){a=Xe.Push;let g=wa(v.location,S,w);n&&n(g,S),u=d()+1;let x=Mv(g,u),C=v.createHref(g);try{s.pushState(x,"",C)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;o.location.assign(C)}i&&l&&l({action:a,location:v.location,delta:1})}function m(S,w){a=Xe.Replace;let g=wa(v.location,S,w);n&&n(g,S),u=d();let x=Mv(g,u),C=v.createHref(g);s.replaceState(x,"",C),i&&l&&l({action:a,location:v.location,delta:0})}function y(S){let w=o.location.origin!=="null"?o.location.origin:o.location.href,g=typeof S=="string"?S:Io(S);return g=g.replace(/ $/,"%20"),me(w,"No window.location.(origin|href) available to create URL for href: "+g),new URL(g,w)}let v={get action(){return a},get location(){return e(o,s)},listen(S){if(l)throw new Error("A history only accepts one active listener");return o.addEventListener(Tv,c),l=S,()=>{o.removeEventListener(Tv,c),l=null}},createHref(S){return t(o,S)},createURL:y,encodeLocation(S){let w=y(S);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:f,replace:m,go(S){return s.go(S)}};return v}var Ae;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Ae||(Ae={}));const dT=new Set(["lazy","caseSensitive","path","id","index","children"]);function fT(e){return e.index===!0}function Mu(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let s=[...n,String(i)],a=typeof o.id=="string"?o.id:s.join("-");if(me(o.index!==!0||!o.children,"Cannot specify children on an index route"),me(!r[a],'Found a route id collision on id "'+a+`". Route id's must be globally unique within Data Router usages`),fT(o)){let l=Ie({},o,t(o),{id:a});return r[a]=l,l}else{let l=Ie({},o,t(o),{id:a,children:void 0});return r[a]=l,o.children&&(l.children=Mu(o.children,t,s,r)),l}})}function go(e,t,n){return n===void 0&&(n="/"),Ql(e,t,n,!1)}function Ql(e,t,n,r){let o=typeof t=="string"?fr(t):t,i=ss(o.pathname||"/",n);if(i==null)return null;let s=_x(e);hT(s);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:s,route:i};l.relativePath.startsWith("/")&&(me(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=nr([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(me(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),_x(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:ST(u,i.index),routesMeta:d})};return e.forEach((i,s)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))o(i,s);else for(let l of Tx(i.path))o(i,s,l)}),t}function Tx(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let s=Tx(r.join("/")),a=[];return a.push(...s.map(l=>l===""?i:[i,l].join("/"))),o&&a.push(...s),a.map(l=>e.startsWith("/")&&l===""?"/":l)}function hT(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:CT(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const gT=/^:[\w-]+$/,mT=3,vT=2,yT=1,wT=10,xT=-2,Av=e=>e==="*";function ST(e,t){let n=e.split("/"),r=n.length;return n.some(Av)&&(r+=xT),t&&(r+=vT),n.filter(o=>!Av(o)).reduce((o,i)=>o+(gT.test(i)?mT:i===""?yT:wT),r)}function CT(e,t){return e.length===t.length&&e.slice(0,-1).every((r,o)=>r===t[o])?e[e.length-1]-t[t.length-1]:0}function bT(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",s=[];for(let a=0;a{let{paramName:f,isOptional:m}=d;if(f==="*"){let v=a[c]||"";s=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const y=a[c];return m&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:s,pattern:e}}function RT(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Do(e==="*"||!e.endsWith("*")||e.endsWith("/*"),'Route path "'+e+'" will be treated as if it were '+('"'+e.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+e.replace(/\*$/,"/*")+'".'));let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(s,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function ET(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Do(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function ss(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function PT(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?fr(e):e;return{pathname:n?n.startsWith("/")?n:_T(n,t):t,search:MT(r),hash:AT(o)}}function _T(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(o=>{o===".."?n.length>1&&n.pop():o!=="."&&n.push(o)}),n.length>1?n.join("/"):"/"}function yd(e,t,n,r){return"Cannot include a '"+e+"' character in a manually specified "+("`to."+t+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function Mx(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function fc(e,t){let n=Mx(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function pc(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=fr(e):(o=Ie({},e),me(!o.pathname||!o.pathname.includes("?"),yd("?","pathname","search",o)),me(!o.pathname||!o.pathname.includes("#"),yd("#","pathname","hash",o)),me(!o.search||!o.search.includes("#"),yd("#","search","hash",o)));let i=e===""||o.pathname==="",s=i?"/":o.pathname,a;if(s==null)a=n;else{let c=t.length-1;if(!r&&s.startsWith("..")){let f=s.split("/");for(;f[0]==="..";)f.shift(),c-=1;o.pathname=f.join("/")}a=c>=0?t[c]:"/"}let l=PT(o,a),u=s&&s!=="/"&&s.endsWith("/"),d=(i||s===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const nr=e=>e.join("/").replace(/\/\/+/g,"/"),TT=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),MT=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,AT=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Au{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function hc(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const Ax=["post","put","patch","delete"],kT=new Set(Ax),NT=["get",...Ax],jT=new Set(NT),OT=new Set([301,302,303,307,308]),DT=new Set([307,308]),wd={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},IT={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},_s={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Uh=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,FT=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),kx="remix-router-transitions";function LT(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;me(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let k=e.detectErrorBoundary;o=I=>({hasErrorBoundary:k(I)})}else o=FT;let i={},s=Mu(e.routes,o,void 0,i),a,l=e.basename||"/",u=e.dataStrategy||BT,d=e.patchRoutesOnNavigation,c=Ie({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),f=null,m=new Set,y=null,v=null,S=null,w=e.hydrationData!=null,g=go(s,e.history.location,l),x=null;if(g==null&&!d){let k=Pt(404,{pathname:e.history.location.pathname}),{matches:I,route:U}=Bv(s);g=I,x={[U.id]:k}}g&&!e.hydrationData&&el(g,s,e.history.location.pathname).active&&(g=null);let C;if(g)if(g.some(k=>k.route.lazy))C=!1;else if(!g.some(k=>k.route.loader))C=!0;else if(c.v7_partialHydration){let k=e.hydrationData?e.hydrationData.loaderData:null,I=e.hydrationData?e.hydrationData.errors:null;if(I){let U=g.findIndex(H=>I[H.route.id]!==void 0);C=g.slice(0,U+1).every(H=>!Gf(H.route,k,I))}else C=g.every(U=>!Gf(U.route,k,I))}else C=e.hydrationData!=null;else if(C=!1,g=[],c.v7_partialHydration){let k=el(null,s,e.history.location.pathname);k.active&&k.matches&&(g=k.matches)}let P,b={historyAction:e.history.action,location:e.history.location,matches:g,initialized:C,navigation:wd,restoreScrollPosition:e.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:e.hydrationData&&e.hydrationData.loaderData||{},actionData:e.hydrationData&&e.hydrationData.actionData||null,errors:e.hydrationData&&e.hydrationData.errors||x,fetchers:new Map,blockers:new Map},A=Xe.Pop,T=!1,$,E=!1,O=new Map,F=null,L=!1,R=!1,M=[],j=new Set,B=new Map,D=0,N=-1,V=new Map,Q=new Set,te=new Map,pe=new Map,ge=new Set,z=new Map,W=new Map,he;function Te(){if(f=e.history.listen(k=>{let{action:I,location:U,delta:H}=k;if(he){he(),he=void 0;return}Do(W.size===0||H!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let X=hm({currentLocation:b.location,nextLocation:U,historyAction:I});if(X&&H!=null){let oe=new Promise(ce=>{he=ce});e.history.go(H*-1),Za(X,{state:"blocked",location:U,proceed(){Za(X,{state:"proceeding",proceed:void 0,reset:void 0,location:U}),oe.then(()=>e.history.go(H))},reset(){let ce=new Map(b.blockers);ce.set(X,_s),Ce({blockers:ce})}});return}return nt(I,U)}),n){n2(t,O);let k=()=>r2(t,O);t.addEventListener("pagehide",k),F=()=>t.removeEventListener("pagehide",k)}return b.initialized||nt(Xe.Pop,b.location,{initialHydration:!0}),P}function we(){f&&f(),F&&F(),m.clear(),$&&$.abort(),b.fetchers.forEach((k,I)=>Ja(I)),b.blockers.forEach((k,I)=>pm(I))}function tt(k){return m.add(k),()=>m.delete(k)}function Ce(k,I){I===void 0&&(I={}),b=Ie({},b,k);let U=[],H=[];c.v7_fetcherPersist&&b.fetchers.forEach((X,oe)=>{X.state==="idle"&&(ge.has(oe)?H.push(oe):U.push(oe))}),[...m].forEach(X=>X(b,{deletedFetchers:H,viewTransitionOpts:I.viewTransitionOpts,flushSync:I.flushSync===!0})),c.v7_fetcherPersist&&(U.forEach(X=>b.fetchers.delete(X)),H.forEach(X=>Ja(X)))}function it(k,I,U){var H,X;let{flushSync:oe}=U===void 0?{}:U,ce=b.actionData!=null&&b.navigation.formMethod!=null&&gn(b.navigation.formMethod)&&b.navigation.state==="loading"&&((H=k.state)==null?void 0:H._isRedirect)!==!0,Z;I.actionData?Object.keys(I.actionData).length>0?Z=I.actionData:Z=null:ce?Z=b.actionData:Z=null;let ee=I.loaderData?Uv(b.loaderData,I.loaderData,I.matches||[],I.errors):b.loaderData,J=b.blockers;J.size>0&&(J=new Map(J),J.forEach((be,st)=>J.set(st,_s)));let ie=T===!0||b.navigation.formMethod!=null&&gn(b.navigation.formMethod)&&((X=k.state)==null?void 0:X._isRedirect)!==!0;a&&(s=a,a=void 0),L||A===Xe.Pop||(A===Xe.Push?e.history.push(k,k.state):A===Xe.Replace&&e.history.replace(k,k.state));let ye;if(A===Xe.Pop){let be=O.get(b.location.pathname);be&&be.has(k.pathname)?ye={currentLocation:b.location,nextLocation:k}:O.has(k.pathname)&&(ye={currentLocation:k,nextLocation:b.location})}else if(E){let be=O.get(b.location.pathname);be?be.add(k.pathname):(be=new Set([k.pathname]),O.set(b.location.pathname,be)),ye={currentLocation:b.location,nextLocation:k}}Ce(Ie({},I,{actionData:Z,loaderData:ee,historyAction:A,location:k,initialized:!0,navigation:wd,revalidation:"idle",restoreScrollPosition:mm(k,I.matches||b.matches),preventScrollReset:ie,blockers:J}),{viewTransitionOpts:ye,flushSync:oe===!0}),A=Xe.Pop,T=!1,E=!1,L=!1,R=!1,M=[]}async function Ot(k,I){if(typeof k=="number"){e.history.go(k);return}let U=Kf(b.location,b.matches,l,c.v7_prependBasename,k,c.v7_relativeSplatPath,I==null?void 0:I.fromRouteId,I==null?void 0:I.relative),{path:H,submission:X,error:oe}=Nv(c.v7_normalizeFormMethod,!1,U,I),ce=b.location,Z=wa(b.location,H,I&&I.state);Z=Ie({},Z,e.history.encodeLocation(Z));let ee=I&&I.replace!=null?I.replace:void 0,J=Xe.Push;ee===!0?J=Xe.Replace:ee===!1||X!=null&&gn(X.formMethod)&&X.formAction===b.location.pathname+b.location.search&&(J=Xe.Replace);let ie=I&&"preventScrollReset"in I?I.preventScrollReset===!0:void 0,ye=(I&&I.flushSync)===!0,be=hm({currentLocation:ce,nextLocation:Z,historyAction:J});if(be){Za(be,{state:"blocked",location:Z,proceed(){Za(be,{state:"proceeding",proceed:void 0,reset:void 0,location:Z}),Ot(k,I)},reset(){let st=new Map(b.blockers);st.set(be,_s),Ce({blockers:st})}});return}return await nt(J,Z,{submission:X,pendingError:oe,preventScrollReset:ie,replace:I&&I.replace,enableViewTransition:I&&I.viewTransition,flushSync:ye})}function $e(){if(zc(),Ce({revalidation:"loading"}),b.navigation.state!=="submitting"){if(b.navigation.state==="idle"){nt(b.historyAction,b.location,{startUninterruptedRevalidation:!0});return}nt(A||b.historyAction,b.navigation.location,{overrideNavigation:b.navigation,enableViewTransition:E===!0})}}async function nt(k,I,U){$&&$.abort(),$=null,A=k,L=(U&&U.startUninterruptedRevalidation)===!0,AE(b.location,b.matches),T=(U&&U.preventScrollReset)===!0,E=(U&&U.enableViewTransition)===!0;let H=a||s,X=U&&U.overrideNavigation,oe=go(H,I,l),ce=(U&&U.flushSync)===!0,Z=el(oe,H,I.pathname);if(Z.active&&Z.matches&&(oe=Z.matches),!oe){let{error:ke,notFoundMatches:Pe,route:He}=Bc(I.pathname);it(I,{matches:Pe,loaderData:{},errors:{[He.id]:ke}},{flushSync:ce});return}if(b.initialized&&!R&&qT(b.location,I)&&!(U&&U.submission&&gn(U.submission.formMethod))){it(I,{matches:oe},{flushSync:ce});return}$=new AbortController;let ee=ti(e.history,I,$.signal,U&&U.submission),J;if(U&&U.pendingError)J=[mo(oe).route.id,{type:Ae.error,error:U.pendingError}];else if(U&&U.submission&&gn(U.submission.formMethod)){let ke=await cn(ee,I,U.submission,oe,Z.active,{replace:U.replace,flushSync:ce});if(ke.shortCircuited)return;if(ke.pendingActionResult){let[Pe,He]=ke.pendingActionResult;if($t(He)&&hc(He.error)&&He.error.status===404){$=null,it(I,{matches:ke.matches,loaderData:{},errors:{[Pe]:He.error}});return}}oe=ke.matches||oe,J=ke.pendingActionResult,X=xd(I,U.submission),ce=!1,Z.active=!1,ee=ti(e.history,ee.url,ee.signal)}let{shortCircuited:ie,matches:ye,loaderData:be,errors:st}=await Uc(ee,I,oe,Z.active,X,U&&U.submission,U&&U.fetcherSubmission,U&&U.replace,U&&U.initialHydration===!0,ce,J);ie||($=null,it(I,Ie({matches:ye||oe},zv(J),{loaderData:be,errors:st})))}async function cn(k,I,U,H,X,oe){oe===void 0&&(oe={}),zc();let ce=e2(I,U);if(Ce({navigation:ce},{flushSync:oe.flushSync===!0}),X){let J=await tl(H,I.pathname,k.signal);if(J.type==="aborted")return{shortCircuited:!0};if(J.type==="error"){let ie=mo(J.partialMatches).route.id;return{matches:J.partialMatches,pendingActionResult:[ie,{type:Ae.error,error:J.error}]}}else if(J.matches)H=J.matches;else{let{notFoundMatches:ie,error:ye,route:be}=Bc(I.pathname);return{matches:ie,pendingActionResult:[be.id,{type:Ae.error,error:ye}]}}}let Z,ee=Ls(H,I);if(!ee.route.action&&!ee.route.lazy)Z={type:Ae.error,error:Pt(405,{method:k.method,pathname:I.pathname,routeId:ee.route.id})};else if(Z=(await gs("action",b,k,[ee],H,null))[ee.route.id],k.signal.aborted)return{shortCircuited:!0};if(xo(Z)){let J;return oe&&oe.replace!=null?J=oe.replace:J=Fv(Z.response.headers.get("Location"),new URL(k.url),l)===b.location.pathname+b.location.search,await lo(k,Z,!0,{submission:U,replace:J}),{shortCircuited:!0}}if(zr(Z))throw Pt(400,{type:"defer-action"});if($t(Z)){let J=mo(H,ee.route.id);return(oe&&oe.replace)!==!0&&(A=Xe.Push),{matches:H,pendingActionResult:[J.route.id,Z]}}return{matches:H,pendingActionResult:[ee.route.id,Z]}}async function Uc(k,I,U,H,X,oe,ce,Z,ee,J,ie){let ye=X||xd(I,oe),be=oe||ce||Hv(ye),st=!L&&(!c.v7_partialHydration||!ee);if(H){if(st){let Ke=Xa(ie);Ce(Ie({navigation:ye},Ke!==void 0?{actionData:Ke}:{}),{flushSync:J})}let Ee=await tl(U,I.pathname,k.signal);if(Ee.type==="aborted")return{shortCircuited:!0};if(Ee.type==="error"){let Ke=mo(Ee.partialMatches).route.id;return{matches:Ee.partialMatches,loaderData:{},errors:{[Ke]:Ee.error}}}else if(Ee.matches)U=Ee.matches;else{let{error:Ke,notFoundMatches:Jo,route:ys}=Bc(I.pathname);return{matches:Jo,loaderData:{},errors:{[ys.id]:Ke}}}}let ke=a||s,[Pe,He]=Ov(e.history,b,U,be,I,c.v7_partialHydration&&ee===!0,c.v7_skipActionErrorRevalidation,R,M,j,ge,te,Q,ke,l,ie);if(Vc(Ee=>!(U&&U.some(Ke=>Ke.route.id===Ee))||Pe&&Pe.some(Ke=>Ke.route.id===Ee)),N=++D,Pe.length===0&&He.length===0){let Ee=dm();return it(I,Ie({matches:U,loaderData:{},errors:ie&&$t(ie[1])?{[ie[0]]:ie[1].error}:null},zv(ie),Ee?{fetchers:new Map(b.fetchers)}:{}),{flushSync:J}),{shortCircuited:!0}}if(st){let Ee={};if(!H){Ee.navigation=ye;let Ke=Xa(ie);Ke!==void 0&&(Ee.actionData=Ke)}He.length>0&&(Ee.fetchers=Yo(He)),Ce(Ee,{flushSync:J})}He.forEach(Ee=>{mr(Ee.key),Ee.controller&&B.set(Ee.key,Ee.controller)});let Xo=()=>He.forEach(Ee=>mr(Ee.key));$&&$.signal.addEventListener("abort",Xo);let{loaderResults:ms,fetcherResults:Hn}=await lm(b,U,Pe,He,k);if(k.signal.aborted)return{shortCircuited:!0};$&&$.signal.removeEventListener("abort",Xo),He.forEach(Ee=>B.delete(Ee.key));let Pn=Cl(ms);if(Pn)return await lo(k,Pn.result,!0,{replace:Z}),{shortCircuited:!0};if(Pn=Cl(Hn),Pn)return Q.add(Pn.key),await lo(k,Pn.result,!0,{replace:Z}),{shortCircuited:!0};let{loaderData:Hc,errors:vs}=$v(b,U,ms,ie,He,Hn,z);z.forEach((Ee,Ke)=>{Ee.subscribe(Jo=>{(Jo||Ee.done)&&z.delete(Ke)})}),c.v7_partialHydration&&ee&&b.errors&&(vs=Ie({},b.errors,vs));let uo=dm(),nl=fm(N),rl=uo||nl||He.length>0;return Ie({matches:U,loaderData:Hc,errors:vs},rl?{fetchers:new Map(b.fetchers)}:{})}function Xa(k){if(k&&!$t(k[1]))return{[k[0]]:k[1].data};if(b.actionData)return Object.keys(b.actionData).length===0?null:b.actionData}function Yo(k){return k.forEach(I=>{let U=b.fetchers.get(I.key),H=Ts(void 0,U?U.data:void 0);b.fetchers.set(I.key,H)}),new Map(b.fetchers)}function RE(k,I,U,H){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");mr(k);let X=(H&&H.flushSync)===!0,oe=a||s,ce=Kf(b.location,b.matches,l,c.v7_prependBasename,U,c.v7_relativeSplatPath,I,H==null?void 0:H.relative),Z=go(oe,ce,l),ee=el(Z,oe,ce);if(ee.active&&ee.matches&&(Z=ee.matches),!Z){Vn(k,I,Pt(404,{pathname:ce}),{flushSync:X});return}let{path:J,submission:ie,error:ye}=Nv(c.v7_normalizeFormMethod,!0,ce,H);if(ye){Vn(k,I,ye,{flushSync:X});return}let be=Ls(Z,J),st=(H&&H.preventScrollReset)===!0;if(ie&&gn(ie.formMethod)){EE(k,I,J,be,Z,ee.active,X,st,ie);return}te.set(k,{routeId:I,path:J}),PE(k,I,J,be,Z,ee.active,X,st,ie)}async function EE(k,I,U,H,X,oe,ce,Z,ee){zc(),te.delete(k);function J(Ye){if(!Ye.route.action&&!Ye.route.lazy){let Zo=Pt(405,{method:ee.formMethod,pathname:U,routeId:I});return Vn(k,I,Zo,{flushSync:ce}),!0}return!1}if(!oe&&J(H))return;let ie=b.fetchers.get(k);gr(k,t2(ee,ie),{flushSync:ce});let ye=new AbortController,be=ti(e.history,U,ye.signal,ee);if(oe){let Ye=await tl(X,U,be.signal);if(Ye.type==="aborted")return;if(Ye.type==="error"){Vn(k,I,Ye.error,{flushSync:ce});return}else if(Ye.matches){if(X=Ye.matches,H=Ls(X,U),J(H))return}else{Vn(k,I,Pt(404,{pathname:U}),{flushSync:ce});return}}B.set(k,ye);let st=D,Pe=(await gs("action",b,be,[H],X,k))[H.route.id];if(be.signal.aborted){B.get(k)===ye&&B.delete(k);return}if(c.v7_fetcherPersist&&ge.has(k)){if(xo(Pe)||$t(Pe)){gr(k,Sr(void 0));return}}else{if(xo(Pe))if(B.delete(k),N>st){gr(k,Sr(void 0));return}else return Q.add(k),gr(k,Ts(ee)),lo(be,Pe,!1,{fetcherSubmission:ee,preventScrollReset:Z});if($t(Pe)){Vn(k,I,Pe.error);return}}if(zr(Pe))throw Pt(400,{type:"defer-action"});let He=b.navigation.location||b.location,Xo=ti(e.history,He,ye.signal),ms=a||s,Hn=b.navigation.state!=="idle"?go(ms,b.navigation.location,l):b.matches;me(Hn,"Didn't find any matches after fetcher action");let Pn=++D;V.set(k,Pn);let Hc=Ts(ee,Pe.data);b.fetchers.set(k,Hc);let[vs,uo]=Ov(e.history,b,Hn,ee,He,!1,c.v7_skipActionErrorRevalidation,R,M,j,ge,te,Q,ms,l,[H.route.id,Pe]);uo.filter(Ye=>Ye.key!==k).forEach(Ye=>{let Zo=Ye.key,vm=b.fetchers.get(Zo),jE=Ts(void 0,vm?vm.data:void 0);b.fetchers.set(Zo,jE),mr(Zo),Ye.controller&&B.set(Zo,Ye.controller)}),Ce({fetchers:new Map(b.fetchers)});let nl=()=>uo.forEach(Ye=>mr(Ye.key));ye.signal.addEventListener("abort",nl);let{loaderResults:rl,fetcherResults:Ee}=await lm(b,Hn,vs,uo,Xo);if(ye.signal.aborted)return;ye.signal.removeEventListener("abort",nl),V.delete(k),B.delete(k),uo.forEach(Ye=>B.delete(Ye.key));let Ke=Cl(rl);if(Ke)return lo(Xo,Ke.result,!1,{preventScrollReset:Z});if(Ke=Cl(Ee),Ke)return Q.add(Ke.key),lo(Xo,Ke.result,!1,{preventScrollReset:Z});let{loaderData:Jo,errors:ys}=$v(b,Hn,rl,void 0,uo,Ee,z);if(b.fetchers.has(k)){let Ye=Sr(Pe.data);b.fetchers.set(k,Ye)}fm(Pn),b.navigation.state==="loading"&&Pn>N?(me(A,"Expected pending action"),$&&$.abort(),it(b.navigation.location,{matches:Hn,loaderData:Jo,errors:ys,fetchers:new Map(b.fetchers)})):(Ce({errors:ys,loaderData:Uv(b.loaderData,Jo,Hn,ys),fetchers:new Map(b.fetchers)}),R=!1)}async function PE(k,I,U,H,X,oe,ce,Z,ee){let J=b.fetchers.get(k);gr(k,Ts(ee,J?J.data:void 0),{flushSync:ce});let ie=new AbortController,ye=ti(e.history,U,ie.signal);if(oe){let Pe=await tl(X,U,ye.signal);if(Pe.type==="aborted")return;if(Pe.type==="error"){Vn(k,I,Pe.error,{flushSync:ce});return}else if(Pe.matches)X=Pe.matches,H=Ls(X,U);else{Vn(k,I,Pt(404,{pathname:U}),{flushSync:ce});return}}B.set(k,ie);let be=D,ke=(await gs("loader",b,ye,[H],X,k))[H.route.id];if(zr(ke)&&(ke=await zh(ke,ye.signal,!0)||ke),B.get(k)===ie&&B.delete(k),!ye.signal.aborted){if(ge.has(k)){gr(k,Sr(void 0));return}if(xo(ke))if(N>be){gr(k,Sr(void 0));return}else{Q.add(k),await lo(ye,ke,!1,{preventScrollReset:Z});return}if($t(ke)){Vn(k,I,ke.error);return}me(!zr(ke),"Unhandled fetcher deferred data"),gr(k,Sr(ke.data))}}async function lo(k,I,U,H){let{submission:X,fetcherSubmission:oe,preventScrollReset:ce,replace:Z}=H===void 0?{}:H;I.response.headers.has("X-Remix-Revalidate")&&(R=!0);let ee=I.response.headers.get("Location");me(ee,"Expected a Location header on the redirect Response"),ee=Fv(ee,new URL(k.url),l);let J=wa(b.location,ee,{_isRedirect:!0});if(n){let Pe=!1;if(I.response.headers.has("X-Remix-Reload-Document"))Pe=!0;else if(Uh.test(ee)){const He=e.history.createURL(ee);Pe=He.origin!==t.location.origin||ss(He.pathname,l)==null}if(Pe){Z?t.location.replace(ee):t.location.assign(ee);return}}$=null;let ie=Z===!0||I.response.headers.has("X-Remix-Replace")?Xe.Replace:Xe.Push,{formMethod:ye,formAction:be,formEncType:st}=b.navigation;!X&&!oe&&ye&&be&&st&&(X=Hv(b.navigation));let ke=X||oe;if(DT.has(I.response.status)&&ke&&gn(ke.formMethod))await nt(ie,J,{submission:Ie({},ke,{formAction:ee}),preventScrollReset:ce||T,enableViewTransition:U?E:void 0});else{let Pe=xd(J,X);await nt(ie,J,{overrideNavigation:Pe,fetcherSubmission:oe,preventScrollReset:ce||T,enableViewTransition:U?E:void 0})}}async function gs(k,I,U,H,X,oe){let ce,Z={};try{ce=await VT(u,k,I,U,H,X,oe,i,o)}catch(ee){return H.forEach(J=>{Z[J.route.id]={type:Ae.error,error:ee}}),Z}for(let[ee,J]of Object.entries(ce))if(QT(J)){let ie=J.result;Z[ee]={type:Ae.redirect,response:GT(ie,U,ee,X,l,c.v7_relativeSplatPath)}}else Z[ee]=await KT(J);return Z}async function lm(k,I,U,H,X){let oe=k.matches,ce=gs("loader",k,X,U,I,null),Z=Promise.all(H.map(async ie=>{if(ie.matches&&ie.match&&ie.controller){let be=(await gs("loader",k,ti(e.history,ie.path,ie.controller.signal),[ie.match],ie.matches,ie.key))[ie.match.route.id];return{[ie.key]:be}}else return Promise.resolve({[ie.key]:{type:Ae.error,error:Pt(404,{pathname:ie.path})}})})),ee=await ce,J=(await Z).reduce((ie,ye)=>Object.assign(ie,ye),{});return await Promise.all([JT(I,ee,X.signal,oe,k.loaderData),ZT(I,J,H)]),{loaderResults:ee,fetcherResults:J}}function zc(){R=!0,M.push(...Vc()),te.forEach((k,I)=>{B.has(I)&&j.add(I),mr(I)})}function gr(k,I,U){U===void 0&&(U={}),b.fetchers.set(k,I),Ce({fetchers:new Map(b.fetchers)},{flushSync:(U&&U.flushSync)===!0})}function Vn(k,I,U,H){H===void 0&&(H={});let X=mo(b.matches,I);Ja(k),Ce({errors:{[X.route.id]:U},fetchers:new Map(b.fetchers)},{flushSync:(H&&H.flushSync)===!0})}function um(k){return c.v7_fetcherPersist&&(pe.set(k,(pe.get(k)||0)+1),ge.has(k)&&ge.delete(k)),b.fetchers.get(k)||IT}function Ja(k){let I=b.fetchers.get(k);B.has(k)&&!(I&&I.state==="loading"&&V.has(k))&&mr(k),te.delete(k),V.delete(k),Q.delete(k),ge.delete(k),j.delete(k),b.fetchers.delete(k)}function _E(k){if(c.v7_fetcherPersist){let I=(pe.get(k)||0)-1;I<=0?(pe.delete(k),ge.add(k)):pe.set(k,I)}else Ja(k);Ce({fetchers:new Map(b.fetchers)})}function mr(k){let I=B.get(k);I&&(I.abort(),B.delete(k))}function cm(k){for(let I of k){let U=um(I),H=Sr(U.data);b.fetchers.set(I,H)}}function dm(){let k=[],I=!1;for(let U of Q){let H=b.fetchers.get(U);me(H,"Expected fetcher: "+U),H.state==="loading"&&(Q.delete(U),k.push(U),I=!0)}return cm(k),I}function fm(k){let I=[];for(let[U,H]of V)if(H0}function TE(k,I){let U=b.blockers.get(k)||_s;return W.get(k)!==I&&W.set(k,I),U}function pm(k){b.blockers.delete(k),W.delete(k)}function Za(k,I){let U=b.blockers.get(k)||_s;me(U.state==="unblocked"&&I.state==="blocked"||U.state==="blocked"&&I.state==="blocked"||U.state==="blocked"&&I.state==="proceeding"||U.state==="blocked"&&I.state==="unblocked"||U.state==="proceeding"&&I.state==="unblocked","Invalid blocker state transition: "+U.state+" -> "+I.state);let H=new Map(b.blockers);H.set(k,I),Ce({blockers:H})}function hm(k){let{currentLocation:I,nextLocation:U,historyAction:H}=k;if(W.size===0)return;W.size>1&&Do(!1,"A router only supports one blocker at a time");let X=Array.from(W.entries()),[oe,ce]=X[X.length-1],Z=b.blockers.get(oe);if(!(Z&&Z.state==="proceeding")&&ce({currentLocation:I,nextLocation:U,historyAction:H}))return oe}function Bc(k){let I=Pt(404,{pathname:k}),U=a||s,{matches:H,route:X}=Bv(U);return Vc(),{notFoundMatches:H,route:X,error:I}}function Vc(k){let I=[];return z.forEach((U,H)=>{(!k||k(H))&&(U.cancel(),I.push(H),z.delete(H))}),I}function ME(k,I,U){if(y=k,S=I,v=U||null,!w&&b.navigation===wd){w=!0;let H=mm(b.location,b.matches);H!=null&&Ce({restoreScrollPosition:H})}return()=>{y=null,S=null,v=null}}function gm(k,I){return v&&v(k,I.map(H=>pT(H,b.loaderData)))||k.key}function AE(k,I){if(y&&S){let U=gm(k,I);y[U]=S()}}function mm(k,I){if(y){let U=gm(k,I),H=y[U];if(typeof H=="number")return H}return null}function el(k,I,U){if(d)if(k){if(Object.keys(k[0].params).length>0)return{active:!0,matches:Ql(I,U,l,!0)}}else return{active:!0,matches:Ql(I,U,l,!0)||[]};return{active:!1,matches:null}}async function tl(k,I,U){if(!d)return{type:"success",matches:k};let H=k;for(;;){let X=a==null,oe=a||s,ce=i;try{await d({path:I,matches:H,patch:(J,ie)=>{U.aborted||Iv(J,ie,oe,ce,o)}})}catch(J){return{type:"error",error:J,partialMatches:H}}finally{X&&!U.aborted&&(s=[...s])}if(U.aborted)return{type:"aborted"};let Z=go(oe,I,l);if(Z)return{type:"success",matches:Z};let ee=Ql(oe,I,l,!0);if(!ee||H.length===ee.length&&H.every((J,ie)=>J.route.id===ee[ie].route.id))return{type:"success",matches:null};H=ee}}function kE(k){i={},a=Mu(k,o,void 0,i)}function NE(k,I){let U=a==null;Iv(k,I,a||s,i,o),U&&(s=[...s],Ce({}))}return P={get basename(){return l},get future(){return c},get state(){return b},get routes(){return s},get window(){return t},initialize:Te,subscribe:tt,enableScrollRestoration:ME,navigate:Ot,fetch:RE,revalidate:$e,createHref:k=>e.history.createHref(k),encodeLocation:k=>e.history.encodeLocation(k),getFetcher:um,deleteFetcher:_E,dispose:we,getBlocker:TE,deleteBlocker:pm,patchRoutes:NE,_internalFetchControllers:B,_internalActiveDeferreds:z,_internalSetRoutes:kE},P}function $T(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Kf(e,t,n,r,o,i,s,a){let l,u;if(s){l=[];for(let c of t)if(l.push(c),c.route.id===s){u=c;break}}else l=t,u=t[t.length-1];let d=pc(o||".",fc(l,i),ss(e.pathname,n)||e.pathname,a==="path");if(o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u){let c=Bh(d.search);if(u.route.index&&!c)d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index";else if(!u.route.index&&c){let f=new URLSearchParams(d.search),m=f.getAll("index");f.delete("index"),m.filter(v=>v).forEach(v=>f.append("index",v));let y=f.toString();d.search=y?"?"+y:""}}return r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:nr([n,d.pathname])),Io(d)}function Nv(e,t,n,r){if(!r||!$T(r))return{path:n};if(r.formMethod&&!XT(r.formMethod))return{path:n,error:Pt(405,{method:r.formMethod})};let o=()=>({path:n,error:Pt(400,{type:"invalid-body"})}),i=r.formMethod||"get",s=e?i.toUpperCase():i.toLowerCase(),a=Ox(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!gn(s))return o();let f=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,y)=>{let[v,S]=y;return""+m+v+"="+S+` -`},""):String(r.body);return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:void 0,text:f}}}else if(r.formEncType==="application/json"){if(!gn(s))return o();try{let f=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:s,formAction:a,formEncType:r.formEncType,formData:void 0,json:f,text:void 0}}}catch{return o()}}}me(typeof FormData=="function","FormData is not available in this environment");let l,u;if(r.formData)l=Wf(r.formData),u=r.formData;else if(r.body instanceof FormData)l=Wf(r.body),u=r.body;else if(r.body instanceof URLSearchParams)l=r.body,u=Lv(l);else if(r.body==null)l=new URLSearchParams,u=new FormData;else try{l=new URLSearchParams(r.body),u=Lv(l)}catch{return o()}let d={formMethod:s,formAction:a,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(gn(d.formMethod))return{path:n,submission:d};let c=fr(n);return t&&c.search&&Bh(c.search)&&l.append("index",""),c.search="?"+l,{path:Io(c),submission:d}}function jv(e,t,n){n===void 0&&(n=!1);let r=e.findIndex(o=>o.route.id===t);return r>=0?e.slice(0,n?r+1:r):e}function Ov(e,t,n,r,o,i,s,a,l,u,d,c,f,m,y,v){let S=v?$t(v[1])?v[1].error:v[1].data:void 0,w=e.createURL(t.location),g=e.createURL(o),x=n;i&&t.errors?x=jv(n,Object.keys(t.errors)[0],!0):v&&$t(v[1])&&(x=jv(n,v[0]));let C=v?v[1].statusCode:void 0,P=s&&C&&C>=400,b=x.filter((T,$)=>{let{route:E}=T;if(E.lazy)return!0;if(E.loader==null)return!1;if(i)return Gf(E,t.loaderData,t.errors);if(UT(t.loaderData,t.matches[$],T)||l.some(L=>L===T.route.id))return!0;let O=t.matches[$],F=T;return Dv(T,Ie({currentUrl:w,currentParams:O.params,nextUrl:g,nextParams:F.params},r,{actionResult:S,actionStatus:C,defaultShouldRevalidate:P?!1:a||w.pathname+w.search===g.pathname+g.search||w.search!==g.search||Nx(O,F)}))}),A=[];return c.forEach((T,$)=>{if(i||!n.some(R=>R.route.id===T.routeId)||d.has($))return;let E=go(m,T.path,y);if(!E){A.push({key:$,routeId:T.routeId,path:T.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get($),F=Ls(E,T.path),L=!1;f.has($)?L=!1:u.has($)?(u.delete($),L=!0):O&&O.state!=="idle"&&O.data===void 0?L=a:L=Dv(F,Ie({currentUrl:w,currentParams:t.matches[t.matches.length-1].params,nextUrl:g,nextParams:n[n.length-1].params},r,{actionResult:S,actionStatus:C,defaultShouldRevalidate:P?!1:a})),L&&A.push({key:$,routeId:T.routeId,path:T.path,matches:E,match:F,controller:new AbortController})}),[b,A]}function Gf(e,t,n){if(e.lazy)return!0;if(!e.loader)return!1;let r=t!=null&&t[e.id]!==void 0,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function UT(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function Nx(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dv(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function Iv(e,t,n,r,o){var i;let s;if(e){let u=r[e];me(u,"No route found to patch children into: routeId = "+e),u.children||(u.children=[]),s=u.children}else s=n;let a=t.filter(u=>!s.some(d=>jx(u,d))),l=Mu(a,o,[e||"_","patch",String(((i=s)==null?void 0:i.length)||"0")],r);s.push(...l)}function jx(e,t){return"id"in e&&"id"in t&&e.id===t.id?!0:e.index===t.index&&e.path===t.path&&e.caseSensitive===t.caseSensitive?(!e.children||e.children.length===0)&&(!t.children||t.children.length===0)?!0:e.children.every((n,r)=>{var o;return(o=t.children)==null?void 0:o.some(i=>jx(n,i))}):!1}async function zT(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];me(o,"No route found in manifest");let i={};for(let s in r){let l=o[s]!==void 0&&s!=="hasErrorBoundary";Do(!l,'Route "'+o.id+'" has a static property "'+s+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+s+'" will be ignored.')),!l&&!dT.has(s)&&(i[s]=r[s])}Object.assign(o,i),Object.assign(o,Ie({},t(o),{lazy:void 0}))}async function BT(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,s)=>Object.assign(o,{[n[s].route.id]:i}),{})}async function VT(e,t,n,r,o,i,s,a,l,u){let d=i.map(m=>m.route.lazy?zT(m.route,l,a):void 0),c=i.map((m,y)=>{let v=d[y],S=o.some(g=>g.route.id===m.route.id);return Ie({},m,{shouldLoad:S,resolve:async g=>(g&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(S=!0),S?HT(t,r,m,v,g,u):Promise.resolve({type:Ae.data,result:void 0}))})}),f=await e({matches:c,request:r,params:i[0].params,fetcherKey:s,context:u});try{await Promise.all(d)}catch{}return f}async function HT(e,t,n,r,o,i){let s,a,l=u=>{let d,c=new Promise((y,v)=>d=v);a=()=>d(),t.signal.addEventListener("abort",a);let f=y=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:i},...y!==void 0?[y]:[]),m=(async()=>{try{return{type:"data",result:await(o?o(v=>f(v)):f())}}catch(y){return{type:"error",result:y}}})();return Promise.race([m,c])};try{let u=n.route[e];if(r)if(u){let d,[c]=await Promise.all([l(u).catch(f=>{d=f}),r]);if(d!==void 0)throw d;s=c}else if(await r,u=n.route[e],u)s=await l(u);else if(e==="action"){let d=new URL(t.url),c=d.pathname+d.search;throw Pt(405,{method:t.method,pathname:c,routeId:n.route.id})}else return{type:Ae.data,result:void 0};else if(u)s=await l(u);else{let d=new URL(t.url),c=d.pathname+d.search;throw Pt(404,{pathname:c})}me(s.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:Ae.error,result:u}}finally{a&&t.signal.removeEventListener("abort",a)}return s}async function KT(e){let{result:t,type:n}=e;if(Dx(t)){let u;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(d){return{type:Ae.error,error:d}}return n===Ae.error?{type:Ae.error,error:new Au(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:Ae.data,data:u,statusCode:t.status,headers:t.headers}}if(n===Ae.error){if(Vv(t)){var r;if(t.data instanceof Error){var o;return{type:Ae.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new Au(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:Ae.error,error:t,statusCode:hc(t)?t.status:void 0}}if(YT(t)){var i,s;return{type:Ae.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((s=t.init)==null?void 0:s.headers)&&new Headers(t.init.headers)}}if(Vv(t)){var a,l;return{type:Ae.data,data:t.data,statusCode:(a=t.init)==null?void 0:a.status,headers:(l=t.init)!=null&&l.headers?new Headers(t.init.headers):void 0}}return{type:Ae.data,data:t}}function GT(e,t,n,r,o,i){let s=e.headers.get("Location");if(me(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!Uh.test(s)){let a=r.slice(0,r.findIndex(l=>l.route.id===n)+1);s=Kf(new URL(t.url),a,o,!0,s,i),e.headers.set("Location",s)}return e}function Fv(e,t,n){if(Uh.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=ss(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function ti(e,t,n,r){let o=e.createURL(Ox(t)).toString(),i={signal:n};if(r&&gn(r.formMethod)){let{formMethod:s,formEncType:a}=r;i.method=s.toUpperCase(),a==="application/json"?(i.headers=new Headers({"Content-Type":a}),i.body=JSON.stringify(r.json)):a==="text/plain"?i.body=r.text:a==="application/x-www-form-urlencoded"&&r.formData?i.body=Wf(r.formData):i.body=r.formData}return new Request(o,i)}function Wf(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function Lv(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function WT(e,t,n,r,o){let i={},s=null,a,l=!1,u={},d=n&&$t(n[1])?n[1].error:void 0;return e.forEach(c=>{if(!(c.route.id in t))return;let f=c.route.id,m=t[f];if(me(!xo(m),"Cannot handle redirect results in processLoaderData"),$t(m)){let y=m.error;d!==void 0&&(y=d,d=void 0),s=s||{};{let v=mo(e,f);s[v.route.id]==null&&(s[v.route.id]=y)}i[f]=void 0,l||(l=!0,a=hc(m.error)?m.error.status:500),m.headers&&(u[f]=m.headers)}else zr(m)?(r.set(f,m.deferredData),i[f]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!l&&(a=m.statusCode),m.headers&&(u[f]=m.headers)):(i[f]=m.data,m.statusCode&&m.statusCode!==200&&!l&&(a=m.statusCode),m.headers&&(u[f]=m.headers))}),d!==void 0&&n&&(s={[n[0]]:d},i[n[0]]=void 0),{loaderData:i,errors:s,statusCode:a||200,loaderHeaders:u}}function $v(e,t,n,r,o,i,s){let{loaderData:a,errors:l}=WT(t,n,r,s);return o.forEach(u=>{let{key:d,match:c,controller:f}=u,m=i[d];if(me(m,"Did not find corresponding fetcher result"),!(f&&f.signal.aborted))if($t(m)){let y=mo(e.matches,c==null?void 0:c.route.id);l&&l[y.route.id]||(l=Ie({},l,{[y.route.id]:m.error})),e.fetchers.delete(d)}else if(xo(m))me(!1,"Unhandled fetcher revalidation redirect");else if(zr(m))me(!1,"Unhandled fetcher deferred data");else{let y=Sr(m.data);e.fetchers.set(d,y)}}),{loaderData:a,errors:l}}function Uv(e,t,n,r){let o=Ie({},t);for(let i of n){let s=i.route.id;if(t.hasOwnProperty(s)?t[s]!==void 0&&(o[s]=t[s]):e[s]!==void 0&&i.route.loader&&(o[s]=e[s]),r&&r.hasOwnProperty(s))break}return o}function zv(e){return e?$t(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function mo(e,t){return(t?e.slice(0,e.findIndex(r=>r.route.id===t)+1):[...e]).reverse().find(r=>r.route.hasErrorBoundary===!0)||e[0]}function Bv(e){let t=e.length===1?e[0]:e.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:t}],route:t}}function Pt(e,t){let{pathname:n,routeId:r,method:o,type:i,message:s}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Au(e||500,a,new Error(l),!0)}function Cl(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(xo(o))return{key:r,result:o}}}function Ox(e){let t=typeof e=="string"?fr(e):e;return Io(Ie({},t,{hash:""}))}function qT(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function QT(e){return Dx(e.result)&&OT.has(e.result.status)}function zr(e){return e.type===Ae.deferred}function $t(e){return e.type===Ae.error}function xo(e){return(e&&e.type)===Ae.redirect}function Vv(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function YT(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function Dx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function XT(e){return jT.has(e.toLowerCase())}function gn(e){return kT.has(e.toLowerCase())}async function JT(e,t,n,r,o){let i=Object.entries(t);for(let s=0;s(f==null?void 0:f.route.id)===a);if(!u)continue;let d=r.find(f=>f.route.id===u.route.id),c=d!=null&&!Nx(d,u)&&(o&&o[u.route.id])!==void 0;zr(l)&&c&&await zh(l,n,!1).then(f=>{f&&(t[a]=f)})}}async function ZT(e,t,n){for(let r=0;r(u==null?void 0:u.route.id)===i)&&zr(a)&&(me(s,"Expected an AbortController for revalidating fetcher deferred result"),await zh(a,s.signal,!0).then(u=>{u&&(t[o]=u)}))}}async function zh(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Ae.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Ae.error,error:o}}return{type:Ae.data,data:e.deferredData.data}}}function Bh(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Ls(e,t){let n=typeof t=="string"?fr(t).search:t.search;if(e[e.length-1].route.index&&Bh(n||""))return e[e.length-1];let r=Mx(e);return r[r.length-1]}function Hv(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:s}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(s!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:s,text:void 0}}}function xd(e,t){return t?{state:"loading",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}:{state:"loading",location:e,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function e2(e,t){return{state:"submitting",location:e,formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text}}function Ts(e,t){return e?{state:"loading",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function t2(e,t){return{state:"submitting",formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text,data:t?t.data:void 0}}function Sr(e){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function n2(e,t){try{let n=e.sessionStorage.getItem(kx);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function r2(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(kx,JSON.stringify(n))}catch(r){Do(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/** - * React Router v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function ku(){return ku=Object.assign?Object.assign.bind():function(e){for(var t=1;t{a.current=!0}),h.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let c=pc(u,JSON.parse(s),i,d.relative==="path");e==null&&t!=="/"&&(c.pathname=c.pathname==="/"?t:nr([t,c.pathname])),(d.replace?r.replace:r.push)(c,d.state,d)},[t,r,s,i,e])}const s2=h.createContext(null);function a2(e){let t=h.useContext(zn).outlet;return t&&h.createElement(s2.Provider,{value:e},t)}function $x(){let{matches:e}=h.useContext(zn),t=e[e.length-1];return t?t.params:{}}function Ux(e,t){let{relative:n}=t===void 0?{}:t,{future:r}=h.useContext(ao),{matches:o}=h.useContext(zn),{pathname:i}=Vo(),s=JSON.stringify(fc(o,r.v7_relativeSplatPath));return h.useMemo(()=>pc(e,JSON.parse(s),i,n==="path"),[e,s,i,n])}function l2(e,t,n,r){as()||me(!1);let{navigator:o}=h.useContext(ao),{matches:i}=h.useContext(zn),s=i[i.length-1],a=s?s.params:{};s&&s.pathname;let l=s?s.pathnameBase:"/";s&&s.route;let u=Vo(),d;d=u;let c=d.pathname||"/",f=c;if(l!=="/"){let v=l.replace(/^\//,"").split("/");f="/"+c.replace(/^\//,"").split("/").slice(v.length).join("/")}let m=go(e,{pathname:f});return p2(m&&m.map(v=>Object.assign({},v,{params:Object.assign({},a,v.params),pathname:nr([l,o.encodeLocation?o.encodeLocation(v.pathname).pathname:v.pathname]),pathnameBase:v.pathnameBase==="/"?l:nr([l,o.encodeLocation?o.encodeLocation(v.pathnameBase).pathname:v.pathnameBase])})),i,n,r)}function u2(){let e=Vx(),t=hc(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return h.createElement(h.Fragment,null,h.createElement("h2",null,"Unexpected Application Error!"),h.createElement("h3",{style:{fontStyle:"italic"}},t),n?h.createElement("pre",{style:o},n):null,null)}const c2=h.createElement(u2,null);class d2 extends h.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?h.createElement(zn.Provider,{value:this.props.routeContext},h.createElement(Fx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function f2(e){let{routeContext:t,match:n,children:r}=e,o=h.useContext(gc);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),h.createElement(zn.Provider,{value:t},r)}function p2(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=(o=n)==null?void 0:o.errors;if(a!=null){let d=s.findIndex(c=>c.route.id&&(a==null?void 0:a[c.route.id])!==void 0);d>=0||me(!1),s=s.slice(0,Math.min(s.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((d,c,f)=>{let m,y=!1,v=null,S=null;n&&(m=a&&c.route.id?a[c.route.id]:void 0,v=c.route.errorElement||c2,l&&(u<0&&f===0?(y2("route-fallback"),y=!0,S=null):u===f&&(y=!0,S=c.route.hydrateFallbackElement||null)));let w=t.concat(s.slice(0,f+1)),g=()=>{let x;return m?x=v:y?x=S:c.route.Component?x=h.createElement(c.route.Component,null):c.route.element?x=c.route.element:x=d,h.createElement(f2,{match:c,routeContext:{outlet:d,matches:w,isDataRoute:n!=null},children:x})};return n&&(c.route.ErrorBoundary||c.route.errorElement||f===0)?h.createElement(d2,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:g(),routeContext:{outlet:null,matches:w,isDataRoute:!0}}):g()},null)}var zx=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(zx||{}),Nu=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Nu||{});function h2(e){let t=h.useContext(gc);return t||me(!1),t}function g2(e){let t=h.useContext(Ix);return t||me(!1),t}function m2(e){let t=h.useContext(zn);return t||me(!1),t}function Bx(e){let t=m2(),n=t.matches[t.matches.length-1];return n.route.id||me(!1),n.route.id}function Vx(){var e;let t=h.useContext(Fx),n=g2(Nu.UseRouteError),r=Bx(Nu.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function v2(){let{router:e}=h2(zx.UseNavigateStable),t=Bx(Nu.UseNavigateStable),n=h.useRef(!1);return Lx(()=>{n.current=!0}),h.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,ku({fromRouteId:t},i)))},[e,t])}const Kv={};function y2(e,t,n){Kv[e]||(Kv[e]=!0)}function w2(e){let{to:t,replace:n,state:r,relative:o}=e;as()||me(!1);let{future:i,static:s}=h.useContext(ao),{matches:a}=h.useContext(zn),{pathname:l}=Vo(),u=ls(),d=pc(t,fc(a,i.v7_relativeSplatPath),l,o==="path"),c=JSON.stringify(d);return h.useEffect(()=>u(JSON.parse(c),{replace:n,state:r,relative:o}),[u,c,o,n,r]),null}function Hx(e){return a2(e.context)}function x2(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Xe.Pop,navigator:i,static:s=!1,future:a}=e;as()&&me(!1);let l=t.replace(/^\/*/,"/"),u=h.useMemo(()=>({basename:l,navigator:i,static:s,future:ku({v7_relativeSplatPath:!1},a)}),[l,a,i,s]);typeof r=="string"&&(r=fr(r));let{pathname:d="/",search:c="",hash:f="",state:m=null,key:y="default"}=r,v=h.useMemo(()=>{let S=ss(d,l);return S==null?null:{location:{pathname:S,search:c,hash:f,state:m,key:y},navigationType:o}},[l,d,c,f,m,y,o]);return v==null?null:h.createElement(ao.Provider,{value:u},h.createElement(Vh.Provider,{children:n,value:v}))}new Promise(()=>{});function S2(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:h.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:h.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:h.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/** - * React Router DOM v6.27.0 - * - * Copyright (c) Remix Software Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function xa(){return xa=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&(n[o]=e[o]);return n}function b2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function R2(e,t){return e.button===0&&(!t||t==="_self")&&!b2(e)}function qf(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function E2(e,t){let n=qf(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const P2=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],_2="6";try{window.__reactRouterVersion=_2}catch{}function T2(e,t){return LT({basename:void 0,future:xa({},void 0,{v7_prependBasename:!0}),history:lT({window:void 0}),hydrationData:M2(),routes:e,mapRouteProperties:S2,dataStrategy:void 0,patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function M2(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=xa({},t,{errors:A2(t.errors)})),t}function A2(e){if(!e)return null;let t=Object.entries(e),n={};for(let[r,o]of t)if(o&&o.__type==="RouteErrorResponse")n[r]=new Au(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let s=new i(o.message);s.stack="",n[r]=s}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const k2=h.createContext({isTransitioning:!1}),N2=h.createContext(new Map),j2="startTransition",Gv=C0[j2],O2="flushSync",Wv=aT[O2];function D2(e){Gv?Gv(e):e()}function Ms(e){Wv?Wv(e):e()}class I2{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function F2(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=h.useState(n.state),[s,a]=h.useState(),[l,u]=h.useState({isTransitioning:!1}),[d,c]=h.useState(),[f,m]=h.useState(),[y,v]=h.useState(),S=h.useRef(new Map),{v7_startTransition:w}=r||{},g=h.useCallback(T=>{w?D2(T):T()},[w]),x=h.useCallback((T,$)=>{let{deletedFetchers:E,flushSync:O,viewTransitionOpts:F}=$;E.forEach(R=>S.current.delete(R)),T.fetchers.forEach((R,M)=>{R.data!==void 0&&S.current.set(M,R.data)});let L=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!F||L){O?Ms(()=>i(T)):g(()=>i(T));return}if(O){Ms(()=>{f&&(d&&d.resolve(),f.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:F.currentLocation,nextLocation:F.nextLocation})});let R=n.window.document.startViewTransition(()=>{Ms(()=>i(T))});R.finished.finally(()=>{Ms(()=>{c(void 0),m(void 0),a(void 0),u({isTransitioning:!1})})}),Ms(()=>m(R));return}f?(d&&d.resolve(),f.skipTransition(),v({state:T,currentLocation:F.currentLocation,nextLocation:F.nextLocation})):(a(T),u({isTransitioning:!0,flushSync:!1,currentLocation:F.currentLocation,nextLocation:F.nextLocation}))},[n.window,f,d,S,g]);h.useLayoutEffect(()=>n.subscribe(x),[n,x]),h.useEffect(()=>{l.isTransitioning&&!l.flushSync&&c(new I2)},[l]),h.useEffect(()=>{if(d&&s&&n.window){let T=s,$=d.promise,E=n.window.document.startViewTransition(async()=>{g(()=>i(T)),await $});E.finished.finally(()=>{c(void 0),m(void 0),a(void 0),u({isTransitioning:!1})}),m(E)}},[g,s,d,n.window]),h.useEffect(()=>{d&&s&&o.location.key===s.location.key&&d.resolve()},[d,f,o.location,s]),h.useEffect(()=>{!l.isTransitioning&&y&&(a(y.state),u({isTransitioning:!0,flushSync:!1,currentLocation:y.currentLocation,nextLocation:y.nextLocation}),v(void 0))},[l.isTransitioning,y]),h.useEffect(()=>{},[]);let C=h.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:T=>n.navigate(T),push:(T,$,E)=>n.navigate(T,{state:$,preventScrollReset:E==null?void 0:E.preventScrollReset}),replace:(T,$,E)=>n.navigate(T,{replace:!0,state:$,preventScrollReset:E==null?void 0:E.preventScrollReset})}),[n]),P=n.basename||"/",b=h.useMemo(()=>({router:n,navigator:C,static:!1,basename:P}),[n,C,P]),A=h.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return h.createElement(h.Fragment,null,h.createElement(gc.Provider,{value:b},h.createElement(Ix.Provider,{value:o},h.createElement(N2.Provider,{value:S.current},h.createElement(k2.Provider,{value:l},h.createElement(x2,{basename:P,location:o.location,navigationType:o.historyAction,navigator:C,future:A},o.initialized||n.future.v7_partialHydration?h.createElement(L2,{routes:n.routes,future:n.future,state:o}):t))))),null)}const L2=h.memo($2);function $2(e){let{routes:t,future:n,state:r}=e;return l2(t,void 0,r,n)}const U2=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",z2=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Xs=h.forwardRef(function(t,n){let{onClick:r,relative:o,reloadDocument:i,replace:s,state:a,target:l,to:u,preventScrollReset:d,viewTransition:c}=t,f=C2(t,P2),{basename:m}=h.useContext(ao),y,v=!1;if(typeof u=="string"&&z2.test(u)&&(y=u,U2))try{let x=new URL(window.location.href),C=u.startsWith("//")?new URL(x.protocol+u):new URL(u),P=ss(C.pathname,m);C.origin===x.origin&&P!=null?u=P+C.search+C.hash:v=!0}catch{}let S=o2(u,{relative:o}),w=B2(u,{replace:s,state:a,target:l,preventScrollReset:d,relative:o,viewTransition:c});function g(x){r&&r(x),x.defaultPrevented||w(x)}return h.createElement("a",xa({},f,{href:y||S,onClick:v||i?r:g,ref:n,target:l}))});var qv;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(qv||(qv={}));var Qv;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(Qv||(Qv={}));function B2(e,t){let{target:n,replace:r,state:o,preventScrollReset:i,relative:s,viewTransition:a}=t===void 0?{}:t,l=ls(),u=Vo(),d=Ux(e,{relative:s});return h.useCallback(c=>{if(R2(c,n)){c.preventDefault();let f=r!==void 0?r:Io(u)===Io(d);l(e,{replace:f,state:o,preventScrollReset:i,relative:s,viewTransition:a})}},[u,l,d,r,o,n,e,i,s,a])}function Hh(e){let t=h.useRef(qf(e)),n=h.useRef(!1),r=Vo(),o=h.useMemo(()=>E2(r.search,n.current?null:t.current),[r.search]),i=ls(),s=h.useCallback((a,l)=>{const u=qf(typeof a=="function"?a(o):a);n.current=!0,i("?"+u,l)},[i,o]);return[o,s]}var Kh={},Kx={},ae={},Gh={};Object.defineProperty(Gh,"__esModule",{value:!0});class V2 extends Error{constructor(t){super(`${t.status} ${t.statusText} -URL: ${t.url}`),this.name="HttpError",this.response=t,this.statusCode=t.status,this.status=t.status,this.statusText=t.statusText}async parse(){if(!this.response.bodyUsed)try{const t=this.response.headers.get("content-type")||"text/plain";if(t.match(/\bjson\b/i)){let n=await this.response.json();n.error?(this.message+=` -`+n.error,n.error_description&&(this.message+=": "+n.error_description)):this.message+=` - -`+JSON.stringify(n,null,4)}else if(t.match(/^text\//i)){let n=await this.response.text();n&&(this.message+=` - -`+n)}}catch{}return this}toJSON(){return{name:this.name,statusCode:this.statusCode,status:this.status,statusText:this.statusText,message:this.message}}}Gh.default=V2;var rn={};Object.defineProperty(rn,"__esModule",{value:!0});rn.SMART_KEY=rn.patientParams=rn.fhirVersions=rn.patientCompartment=void 0;rn.patientCompartment=["Account","AdverseEvent","AllergyIntolerance","Appointment","AppointmentResponse","AuditEvent","Basic","BodySite","BodyStructure","CarePlan","CareTeam","ChargeItem","Claim","ClaimResponse","ClinicalImpression","Communication","CommunicationRequest","Composition","Condition","Consent","Coverage","CoverageEligibilityRequest","CoverageEligibilityResponse","DetectedIssue","DeviceRequest","DeviceUseRequest","DeviceUseStatement","DiagnosticOrder","DiagnosticReport","DocumentManifest","DocumentReference","EligibilityRequest","Encounter","EnrollmentRequest","EpisodeOfCare","ExplanationOfBenefit","FamilyMemberHistory","Flag","Goal","Group","ImagingManifest","ImagingObjectSelection","ImagingStudy","Immunization","ImmunizationEvaluation","ImmunizationRecommendation","Invoice","List","MeasureReport","Media","MedicationAdministration","MedicationDispense","MedicationOrder","MedicationRequest","MedicationStatement","MolecularSequence","NutritionOrder","Observation","Order","Patient","Person","Procedure","ProcedureRequest","Provenance","QuestionnaireResponse","ReferralRequest","RelatedPerson","RequestGroup","ResearchSubject","RiskAssessment","Schedule","ServiceRequest","Specimen","SupplyDelivery","SupplyRequest","VisionPrescription"];rn.fhirVersions={"0.4.0":2,"0.5.0":2,"1.0.0":2,"1.0.1":2,"1.0.2":2,"1.1.0":3,"1.4.0":3,"1.6.0":3,"1.8.0":3,"3.0.0":3,"3.0.1":3,"3.3.0":4,"3.5.0":4,"4.0.0":4,"4.0.1":4};rn.patientParams=["patient","subject","requester","member","actor","beneficiary"];rn.SMART_KEY="SMART_KEY";var Qf={exports:{}},Sd,Yv;function H2(){if(Yv)return Sd;Yv=1;var e=1e3,t=e*60,n=t*60,r=n*24,o=r*7,i=r*365.25;Sd=function(d,c){c=c||{};var f=typeof d;if(f==="string"&&d.length>0)return s(d);if(f==="number"&&isFinite(d))return c.long?l(d):a(d);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(d))};function s(d){if(d=String(d),!(d.length>100)){var c=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(d);if(c){var f=parseFloat(c[1]),m=(c[2]||"ms").toLowerCase();switch(m){case"years":case"year":case"yrs":case"yr":case"y":return f*i;case"weeks":case"week":case"w":return f*o;case"days":case"day":case"d":return f*r;case"hours":case"hour":case"hrs":case"hr":case"h":return f*n;case"minutes":case"minute":case"mins":case"min":case"m":return f*t;case"seconds":case"second":case"secs":case"sec":case"s":return f*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return f;default:return}}}}function a(d){var c=Math.abs(d);return c>=r?Math.round(d/r)+"d":c>=n?Math.round(d/n)+"h":c>=t?Math.round(d/t)+"m":c>=e?Math.round(d/e)+"s":d+"ms"}function l(d){var c=Math.abs(d);return c>=r?u(d,c,r,"day"):c>=n?u(d,c,n,"hour"):c>=t?u(d,c,t,"minute"):c>=e?u(d,c,e,"second"):d+" ms"}function u(d,c,f,m){var y=c>=f*1.5;return Math.round(d/f)+" "+m+(y?"s":"")}return Sd}function K2(e){n.debug=n,n.default=n,n.coerce=l,n.disable=i,n.enable=o,n.enabled=s,n.humanize=H2(),n.destroy=u,Object.keys(e).forEach(d=>{n[d]=e[d]}),n.names=[],n.skips=[],n.formatters={};function t(d){let c=0;for(let f=0;f{if(b==="%%")return"%";C++;const T=n.formatters[A];if(typeof T=="function"){const $=S[C];b=T.call(w,$),S.splice(C,1),C--}return b}),n.formatArgs.call(w,S),(w.log||n.log).apply(w,S)}return v.namespace=d,v.useColors=n.useColors(),v.color=n.selectColor(d),v.extend=r,v.destroy=n.destroy,Object.defineProperty(v,"enabled",{enumerable:!0,configurable:!1,get:()=>f!==null?f:(m!==n.namespaces&&(m=n.namespaces,y=n.enabled(d)),y),set:S=>{f=S}}),typeof n.init=="function"&&n.init(v),v}function r(d,c){const f=n(this.namespace+(typeof c>"u"?":":c)+d);return f.log=this.log,f}function o(d){n.save(d),n.namespaces=d,n.names=[],n.skips=[];let c;const f=(typeof d=="string"?d:"").split(/[\s,]+/),m=f.length;for(c=0;c"-"+c)].join(",");return n.enable(""),d}function s(d){if(d[d.length-1]==="*")return!0;let c,f;for(c=0,f=n.skips.length;c{let u=!1;return()=>{u||(u=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let u;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(u=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(u[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function o(u){if(u[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+u[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const d="color: "+this.color;u.splice(1,0,d,"color: inherit");let c=0,f=0;u[0].replace(/%[a-zA-Z%]/g,m=>{m!=="%%"&&(c++,m==="%c"&&(f=c))}),u.splice(f,0,d)}t.log=console.debug||console.log||(()=>{});function i(u){try{u?t.storage.setItem("debug",u):t.storage.removeItem("debug")}catch{}}function s(){let u;try{u=t.storage.getItem("debug")}catch{}return!u&&typeof process<"u"&&"env"in process&&(u=n.DEBUG),u}function a(){try{return localStorage}catch{}}e.exports=G2(t);const{formatters:l}=e.exports;l.j=function(u){try{return JSON.stringify(u)}catch(d){return"[UnexpectedJSONParseError]: "+d.message}}})(Qf,Qf.exports);var W2=Qf.exports,bl={exports:{}},Xv;function Wh(){return Xv||(Xv=1,function(e,t){var n=typeof self<"u"?self:Xn,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(s){var a={searchParams:"URLSearchParams"in i,iterable:"Symbol"in i&&"iterator"in Symbol,blob:"FileReader"in i&&"Blob"in i&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in i,arrayBuffer:"ArrayBuffer"in i};function l(R){return R&&DataView.prototype.isPrototypeOf(R)}if(a.arrayBuffer)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],d=ArrayBuffer.isView||function(R){return R&&u.indexOf(Object.prototype.toString.call(R))>-1};function c(R){if(typeof R!="string"&&(R=String(R)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(R))throw new TypeError("Invalid character in header field name");return R.toLowerCase()}function f(R){return typeof R!="string"&&(R=String(R)),R}function m(R){var M={next:function(){var j=R.shift();return{done:j===void 0,value:j}}};return a.iterable&&(M[Symbol.iterator]=function(){return M}),M}function y(R){this.map={},R instanceof y?R.forEach(function(M,j){this.append(j,M)},this):Array.isArray(R)?R.forEach(function(M){this.append(M[0],M[1])},this):R&&Object.getOwnPropertyNames(R).forEach(function(M){this.append(M,R[M])},this)}y.prototype.append=function(R,M){R=c(R),M=f(M);var j=this.map[R];this.map[R]=j?j+", "+M:M},y.prototype.delete=function(R){delete this.map[c(R)]},y.prototype.get=function(R){return R=c(R),this.has(R)?this.map[R]:null},y.prototype.has=function(R){return this.map.hasOwnProperty(c(R))},y.prototype.set=function(R,M){this.map[c(R)]=f(M)},y.prototype.forEach=function(R,M){for(var j in this.map)this.map.hasOwnProperty(j)&&R.call(M,this.map[j],j,this)},y.prototype.keys=function(){var R=[];return this.forEach(function(M,j){R.push(j)}),m(R)},y.prototype.values=function(){var R=[];return this.forEach(function(M){R.push(M)}),m(R)},y.prototype.entries=function(){var R=[];return this.forEach(function(M,j){R.push([j,M])}),m(R)},a.iterable&&(y.prototype[Symbol.iterator]=y.prototype.entries);function v(R){if(R.bodyUsed)return Promise.reject(new TypeError("Already read"));R.bodyUsed=!0}function S(R){return new Promise(function(M,j){R.onload=function(){M(R.result)},R.onerror=function(){j(R.error)}})}function w(R){var M=new FileReader,j=S(M);return M.readAsArrayBuffer(R),j}function g(R){var M=new FileReader,j=S(M);return M.readAsText(R),j}function x(R){for(var M=new Uint8Array(R),j=new Array(M.length),B=0;B-1?M:R}function T(R,M){M=M||{};var j=M.body;if(R instanceof T){if(R.bodyUsed)throw new TypeError("Already read");this.url=R.url,this.credentials=R.credentials,M.headers||(this.headers=new y(R.headers)),this.method=R.method,this.mode=R.mode,this.signal=R.signal,!j&&R._bodyInit!=null&&(j=R._bodyInit,R.bodyUsed=!0)}else this.url=String(R);if(this.credentials=M.credentials||this.credentials||"same-origin",(M.headers||!this.headers)&&(this.headers=new y(M.headers)),this.method=A(M.method||this.method||"GET"),this.mode=M.mode||this.mode||null,this.signal=M.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&j)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(j)}T.prototype.clone=function(){return new T(this,{body:this._bodyInit})};function $(R){var M=new FormData;return R.trim().split("&").forEach(function(j){if(j){var B=j.split("="),D=B.shift().replace(/\+/g," "),N=B.join("=").replace(/\+/g," ");M.append(decodeURIComponent(D),decodeURIComponent(N))}}),M}function E(R){var M=new y,j=R.replace(/\r?\n[\t ]+/g," ");return j.split(/\r?\n/).forEach(function(B){var D=B.split(":"),N=D.shift().trim();if(N){var V=D.join(":").trim();M.append(N,V)}}),M}P.call(T.prototype);function O(R,M){M||(M={}),this.type="default",this.status=M.status===void 0?200:M.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in M?M.statusText:"OK",this.headers=new y(M.headers),this.url=M.url||"",this._initBody(R)}P.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new y(this.headers),url:this.url})},O.error=function(){var R=new O(null,{status:0,statusText:""});return R.type="error",R};var F=[301,302,303,307,308];O.redirect=function(R,M){if(F.indexOf(M)===-1)throw new RangeError("Invalid status code");return new O(null,{status:M,headers:{location:R}})},s.DOMException=i.DOMException;try{new s.DOMException}catch{s.DOMException=function(M,j){this.message=M,this.name=j;var B=Error(M);this.stack=B.stack},s.DOMException.prototype=Object.create(Error.prototype),s.DOMException.prototype.constructor=s.DOMException}function L(R,M){return new Promise(function(j,B){var D=new T(R,M);if(D.signal&&D.signal.aborted)return B(new s.DOMException("Aborted","AbortError"));var N=new XMLHttpRequest;function V(){N.abort()}N.onload=function(){var Q={status:N.status,statusText:N.statusText,headers:E(N.getAllResponseHeaders()||"")};Q.url="responseURL"in N?N.responseURL:Q.headers.get("X-Request-URL");var te="response"in N?N.response:N.responseText;j(new O(te,Q))},N.onerror=function(){B(new TypeError("Network request failed"))},N.ontimeout=function(){B(new TypeError("Network request failed"))},N.onabort=function(){B(new s.DOMException("Aborted","AbortError"))},N.open(D.method,D.url,!0),D.credentials==="include"?N.withCredentials=!0:D.credentials==="omit"&&(N.withCredentials=!1),"responseType"in N&&a.blob&&(N.responseType="blob"),D.headers.forEach(function(Q,te){N.setRequestHeader(te,Q)}),D.signal&&(D.signal.addEventListener("abort",V),N.onreadystatechange=function(){N.readyState===4&&D.signal.removeEventListener("abort",V)}),N.send(typeof D._bodyInit>"u"?null:D._bodyInit)})}return L.polyfill=!0,i.fetch||(i.fetch=L,i.Headers=y,i.Request=T,i.Response=O),s.Headers=y,s.Request=T,s.Response=O,s.fetch=L,Object.defineProperty(s,"__esModule",{value:!0}),s})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=r;t=o.fetch,t.default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t}(bl,bl.exports)),bl.exports}var q2=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);ot.length?JSON.parse(t):"")}ae.responseToJSON=Wx;function ju(e){if(!e)return e;if(Array.isArray(e))return e.map(n=>n&&typeof n=="object"?ju(n):n);let t={};return Object.keys(e).forEach(n=>{const r=n.toLowerCase(),o=e[n];t[r]=o&&typeof o=="object"?ju(o):o}),t}ae.loweCaseKeys=ju;function qh(e,t={}){const{includeResponse:n}=t,r=q2(t,["includeResponse"]);return J2(e,Object.assign(Object.assign({mode:"cors"},r),{headers:Object.assign({accept:"application/json"},ju(r.headers))})).then(Gx).then(o=>{const i=o.headers.get("content-type")+"";return i.match(/\bjson\b/i)?Wx(o).then(s=>({res:o,body:s})):i.match(/^text\//i)?o.text().then(s=>({res:o,body:s})):{res:o}}).then(({res:o,body:i})=>{if(!i&&o.status==201){const s=o.headers.get("location");if(s)return qh(s,Object.assign(Object.assign({},r),{method:"GET",body:null,includeResponse:n}))}return n?{body:i,response:o}:i===void 0?o:i})}ae.request=qh;function qx(e,t,n=!1){return n||!Rl[e]?(Rl[e]=qh(e,t),Rl[e]):Promise.resolve(Rl[e])}ae.getAndCache=qx;function Z2(e="/",t){const n=String(e).replace(/\/*$/,"/")+"metadata";return qx(n,t).catch(r=>{throw new Error(`Failed to fetch the conformance statement from "${n}". ${r}`)})}ae.fetchConformanceStatement=Z2;function Qh(e,t=""){if(t=t.trim(),!t)return e;let n=t.split("."),r=e;for(;r&&n.length;){const o=n.shift();if(!o&&Array.isArray(r))return r.map(i=>Qh(i,n.join(".")));r=r[o]}return r}ae.getPath=Qh;function eM(e,t,n,r=!1){return t.trim().split(".").reduce((o,i,s,a)=>{if(o&&s===a.length-1)o[i]=n;else return o&&o[i]===void 0&&r&&(o[i]=a[s+1].match(/^[0-9]+$/)?[]:{}),o?o[i]:void 0},e),e}ae.setPath=eM;function Qx(e){return Array.isArray(e)?e:[e]}ae.makeArray=Qx;function tM(e,t){return e.match(/^http/)||e.match(/^urn/)?e:String(t||"").replace(/\/+$/,"")+"/"+e.replace(/^\/+/,"")}ae.absolute=tM;function nM(e=8,t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"){const n=[],r=t.length;for(;e--;)n.push(t.charAt(Math.floor(Math.random()*r)));return n.join("")}ae.randomString=nM;function Yx(e,t){const n=e.split(".")[1];return n?JSON.parse(t.atob(n)):null}ae.jwtDecode=Yx;function rM(e=120,t){return Math.floor(+(t||new Date)/1e3+e)}ae.getTimeInFuture=rM;function oM(e,t){const n=Math.floor(Date.now()/1e3);if(e.expires_in)return n+e.expires_in;if(e.access_token){let r=Yx(e.access_token,t);if(r&&r.exp)return r.exp}return n+300}ae.getAccessTokenExpiration=oM;function Xx(e,t){const n={};function r(o,i){o&&Array.isArray(o.coding)&&o.coding.forEach(({code:s})=>{s&&(n[s]=n[s]||[],n[s].push(i))})}return Qx(e).forEach(o=>{o.resourceType==="Observation"&&o[t]&&(Array.isArray(o[t])?o[t].forEach(i=>r(i,o)):r(o[t],o))}),n}ae.byCode=Xx;function iM(e,t){const n=Xx(e,t);return(...r)=>r.filter(o=>o+""in n).reduce((o,i)=>o.concat(n[i+""]),[])}ae.byCodes=iM;function sM(e,t){const r=(Qh(e,"rest.0.resource")||[]).find(i=>i.type===t);if(!r)throw new Error(`Resource "${t}" is not supported by this FHIR server`);if(!Array.isArray(r.searchParam))throw new Error(`No search parameters supported for "${t}" on this FHIR server`);if(t=="Patient"&&r.searchParam.find(i=>i.name=="_id"))return"_id";const o=Y2.patientParams.find(i=>r.searchParam.find(s=>s.name==i));if(!o)throw new Error("I don't know what param to use for "+t);return o}ae.getPatientParam=sM;async function aM(e,t=800,n=720){if(typeof e=="function"&&(e=await e()),e&&typeof e=="object")return e;if(typeof e!="string")return $s("Invalid target type '%s'. Failing back to '_self'.",typeof e),self;if(e=="_self")return self;if(e=="_parent")return parent;if(e=="_top")return top||self;if(e=="_blank"){let o,i=null;try{if(i=window.open("","SMARTAuthPopup"),!i)throw new Error("Perhaps window.open was blocked")}catch(s){o=s}return i||($s("Cannot open window. Failing back to '_self'. %s",o),self)}if(e=="popup"){let o,i=null;try{if(i=window.open("","SMARTAuthPopup",["height="+n,"width="+t,"menubar=0","resizable=1","status=0","top="+(screen.height-n)/2,"left="+(screen.width-t)/2].join(",")),!i)throw new Error("Perhaps the popup window was blocked")}catch(s){o=s}return i||($s("Cannot open window. Failing back to '_self'. %s",o),self)}const r=frames[e];return r||($s("Unknown target '%s'. Failing back to '_self'.",e),self)}ae.getTargetWindow=aM;function Mn(e,t){if(!e)throw new Error(t)}ae.assert=Mn;function lM(e){Mn(Array.isArray(e),"The JSON patch must be an array"),Mn(e.length>0,"The JSON patch array should not be empty"),e.forEach(t=>{Mn(["add","replace","test","move","copy","remove"].indexOf(t.op)>-1,'Each patch operation must have an "op" property which must be one of: "add", "replace", "test", "move", "copy", "remove"'),Mn(t.path&&typeof t.path,`Invalid "${t.op}" operation. Missing "path" property`),t.op=="add"||t.op=="replace"||t.op=="test"?(Mn("value"in t,`Invalid "${t.op}" operation. Missing "value" property`),Mn(Object.keys(t).length==3,`Invalid "${t.op}" operation. Contains unknown properties`)):t.op=="move"||t.op=="copy"?(Mn(typeof t.from=="string",`Invalid "${t.op}" operation. Requires a string "from" property`),Mn(Object.keys(t).length==3,`Invalid "${t.op}" operation. Contains unknown properties`)):Mn(Object.keys(t).length==2,`Invalid "${t.op}" operation. Contains unknown properties`)})}ae.assertJsonPatch=lM;var mc={},Yh={};Object.defineProperty(Yh,"__esModule",{value:!0});Yh.default={expired:"Session expired! Please re-launch the app",noScopeForId:"Trying to get the ID of the selected %s. Please add 'launch' or 'launch/%s' to the requested scopes and try again.",noIfNoAuth:"You are trying to get %s but the app is not authorized yet.",noFreeContext:"Please don't use open fhir servers if you need to access launch context items like the %S."};Object.defineProperty(mc,"__esModule",{value:!0});const Se=ae,Tn=Yh,Yl=rn,{Response:uM}=typeof FHIRCLIENT_PURE<"u"?window:Wh(),Dt=Se.debug.extend("client");async function cM(e,t){const n=(0,Se.absolute)("/",t.state.serverUrl);async function r(o){const i=o.pathname.split("/").pop();(0,Se.assert)(i,`Invalid url "${o}"`),(0,Se.assert)(Yl.patientCompartment.indexOf(i)>-1,`Cannot filter "${i}" resources by patient`);const s=await(0,Se.fetchConformanceStatement)(t.state.serverUrl),a=(0,Se.getPatientParam)(s,i);return o.searchParams.set(a,t.patient.id),o.href}return typeof e=="string"||e instanceof URL?{url:await r(new URL(e+"",n))}:(e.url=await r(new URL(e.url+"",n)),e)}function dM(e,t,n,r){if(!t[e]){const{signal:o,headers:i}=r;t[e]=n.request({url:e,headers:i,signal:o}).then(s=>(t[e]=s,s),s=>{throw delete t[e],s})}return Promise.resolve(t[e])}function fM(e,t,n,r,o,i){const s=(0,Se.getPath)(e,t);if(s){const a=Array.isArray(s);return Promise.all((0,Se.makeArray)(s).filter(Boolean).map((l,u)=>{const d=l.reference;if(d)return dM(d,r,o,i).then(c=>{n&&(a?t.indexOf("..")>-1?(0,Se.setPath)(e,`${t.replace("..",`.${u}.`)}`,c):(0,Se.setPath)(e,`${t}.${u}`,c):(0,Se.setPath)(e,t,c))}).catch(c=>{if(c.status!==404)throw c})}))}}function Jv(e,t,n,r,o){let i=(0,Se.makeArray)(t.resolveReferences).filter(Boolean).map(l=>String(l).trim()).filter(Boolean);if(i=i.filter((l,u)=>i.indexOf(l,u+1)>-1?(Dt('Duplicated reference path "%s"',l),!1):!0),!i.length)return Promise.resolve();const s={};i.forEach(l=>{const u=l.split(".").length;s[u]||(s[u]=[]),s[u].push(l)});let a=Promise.resolve();return Object.keys(s).sort().forEach(l=>{const u=s[l];a=a.then(()=>Promise.all(u.map(d=>fM(e,d,!!t.graph,n,r,o))))}),a}class pM{constructor(t,n){this.units=Se.units;const r=typeof n=="string"?{serverUrl:n}:n;(0,Se.assert)(r.serverUrl&&r.serverUrl.match(/https?:\/\/.+/),'A "serverUrl" option is required and must begin with "http(s)"'),this.state=r,this.environment=t,this._refreshTask=null;const o=this;this.patient={get id(){return o.getPatientId()},read:i=>{const s=this.patient.id;return s?this.request(Object.assign(Object.assign({},i),{url:`Patient/${s}`})):Promise.reject(new Error("Patient is not available"))},request:(i,s={})=>this.patient.id?(async()=>{const a=await cM(i,this);return this.request(a,s)})():Promise.reject(new Error("Patient is not available"))},this.encounter={get id(){return o.getEncounterId()},read:i=>{const s=this.encounter.id;return s?this.request(Object.assign(Object.assign({},i),{url:`Encounter/${s}`})):Promise.reject(new Error("Encounter is not available"))}},this.user={get fhirUser(){return o.getFhirUser()},get id(){return o.getUserId()},get resourceType(){return o.getUserType()},read:i=>{const s=this.user.fhirUser;return s?this.request(Object.assign(Object.assign({},i),{url:s})):Promise.reject(new Error("User is not available"))}},this.connect(t.fhir)}connect(t){if(typeof t=="function"){const n={baseUrl:this.state.serverUrl.replace(/\/$/,"")},r=this.getState("tokenResponse.access_token");if(r)n.auth={token:r};else{const{username:i,password:s}=this.state;i&&s&&(n.auth={user:i,pass:s})}this.api=t(n);const o=this.getState("tokenResponse.patient");o&&(this.patient.api=t(Object.assign(Object.assign({},n),{patient:o})))}return this}getPatientId(){const t=this.state.tokenResponse;return t?t.patient?t.patient:((this.state.scope||"").match(/\blaunch(\/patient)?\b/)?Dt("The ID of the selected patient is not available. Please check if your server supports that."):Dt(Tn.default.noScopeForId,"patient","patient"),null):(this.state.authorizeUri?Dt(Tn.default.noIfNoAuth,"the ID of the selected patient"):Dt(Tn.default.noFreeContext,"selected patient"),null)}getEncounterId(){const t=this.state.tokenResponse;return t?t.encounter?t.encounter:((this.state.scope||"").match(/\blaunch(\/encounter)?\b/)?Dt("The ID of the selected encounter is not available. Please check if your server supports that, and that the selected patient has any recorded encounters."):Dt(Tn.default.noScopeForId,"encounter","encounter"),null):(this.state.authorizeUri?Dt(Tn.default.noIfNoAuth,"the ID of the selected encounter"):Dt(Tn.default.noFreeContext,"selected encounter"),null)}getIdToken(){const t=this.state.tokenResponse;if(t){const n=t.id_token,r=this.state.scope||"";if(!n){const o=r.match(/\bopenid\b/),i=r.match(/\bprofile\b/),s=r.match(/\bfhirUser\b/);return Dt(!o||!(s||i)?"You are trying to get the id_token but you are not using the right scopes. Please add 'openid' and 'fhirUser' or 'profile' to the scopes you are requesting.":"The id_token is not available. Please check if your server supports that."),null}return(0,Se.jwtDecode)(n,this.environment)}return this.state.authorizeUri?Dt(Tn.default.noIfNoAuth,"the id_token"):Dt(Tn.default.noFreeContext,"id_token"),null}getFhirUser(){const t=this.getIdToken();return t?t.fhirUser?t.fhirUser.split("/").slice(-2).join("/"):t.profile:null}getUserId(){const t=this.getFhirUser();return t?t.split("/")[1]:null}getUserType(){const t=this.getFhirUser();return t?t.split("/")[0]:null}getAuthorizationHeader(){const t=this.getState("tokenResponse.access_token");if(t)return"Bearer "+t;const{username:n,password:r}=this.state;return n&&r?"Basic "+this.environment.btoa(n+":"+r):null}async _clearState(){const t=this.environment.getStorage(),n=await t.get(Yl.SMART_KEY);n&&await t.unset(n),await t.unset(Yl.SMART_KEY),this.state.tokenResponse={}}create(t,n){return this.request(Object.assign(Object.assign({},n),{url:`${t.resourceType}`,method:"POST",body:JSON.stringify(t),headers:Object.assign({"content-type":"application/json"},(n||{}).headers)}))}update(t,n){return this.request(Object.assign(Object.assign({},n),{url:`${t.resourceType}/${t.id}`,method:"PUT",body:JSON.stringify(t),headers:Object.assign({"content-type":"application/json"},(n||{}).headers)}))}delete(t,n={}){return this.request(Object.assign(Object.assign({},n),{url:t,method:"DELETE"}))}async patch(t,n,r={}){return(0,Se.assertJsonPatch)(n),this.request(Object.assign(Object.assign({},r),{url:t,method:"PATCH",body:JSON.stringify(n),headers:Object.assign({prefer:"return=presentation","content-type":"application/json-patch+json; charset=UTF-8"},r.headers)}))}async request(t,n={},r={}){var o;const i=Se.debug.extend("client:request");(0,Se.assert)(t,"request requires an url or request options as argument");let s;typeof t=="string"||t instanceof URL?(s=String(t),t={}):s=String(t.url),s=(0,Se.absolute)(s,this.state.serverUrl);const a={graph:n.graph!==!1,flat:!!n.flat,pageLimit:(o=n.pageLimit)!==null&&o!==void 0?o:1,resolveReferences:n.resolveReferences||[],useRefreshToken:n.useRefreshToken!==!1,onPage:typeof n.onPage=="function"?n.onPage:void 0},l=t.signal||void 0,u=a.useRefreshToken?this.refreshIfNeeded({signal:l}).then(()=>t):Promise.resolve(t);let d;return u.then(c=>{const f=this.getAuthorizationHeader();return f&&(c.headers=Object.assign(Object.assign({},c.headers),{authorization:f})),c}).then(c=>(i("%s, options: %O, fhirOptions: %O",s,c,a),(0,Se.request)(s,c).then(f=>c.includeResponse?(d=f.response,f.body):f))).catch(async c=>{throw c.status==401?this.getState("tokenResponse.access_token")?a.useRefreshToken?(i("Auto-refresh failed! Please re-launch the app."),await this._clearState(),c.message+=` -`+Tn.default.expired,c):(i("Your session has expired and the useRefreshToken option is set to false. Please re-launch the app."),await this._clearState(),c.message+=` -`+Tn.default.expired,c):(c.message+=` -This app cannot be accessed directly. Please launch it as SMART app!`,c):c}).catch(c=>{throw c.status==403&&i("Permission denied! Please make sure that you have requested the proper scopes."),c}).then(c=>!c||typeof c=="string"||c instanceof uM?t.includeResponse?{body:c,response:d}:c:(async f=>(f.resourceType=="Bundle"?await Promise.all((f.entry||[]).map(m=>Jv(m.resource,a,r,this,t))):await Jv(f,a,r,this,t),f))(c).then(async f=>{if(f&&f.resourceType=="Bundle"){const m=f.link||[];if(a.flat&&(f=(f.entry||[]).map(y=>y.resource)),a.onPage&&await a.onPage(f,Object.assign({},r)),--a.pageLimit){const y=m.find(v=>v.relation=="next");if(f=(0,Se.makeArray)(f),y&&y.url){const v=await this.request({url:y.url,signal:l},a,r);return a.onPage?null:a.resolveReferences.length?(Object.assign(r,v.references),f.concat((0,Se.makeArray)(v.data||v))):f.concat((0,Se.makeArray)(v))}}}return f}).then(f=>{if(a.graph)r={};else if(!a.onPage&&a.resolveReferences.length)return{data:f,references:r};return f}).then(f=>t.includeResponse?{body:f,response:d}:f))}refreshIfNeeded(t={}){const n=this.getState("tokenResponse.access_token"),r=this.getState("tokenResponse.refresh_token"),o=this.state.expiresAt||0;return n&&r&&o-10-1,u=a.search(/\bonline_access\b/)>-1;if((0,Se.assert)(l||u,"Unable to refresh. No offline_access or online_access scope found."),!this._refreshTask){const d=Object.assign(Object.assign({credentials:this.environment.options.refreshTokenWithCredentials||"same-origin"},t),{method:"POST",mode:"cors",headers:Object.assign(Object.assign({},t.headers||{}),{"content-type":"application/x-www-form-urlencoded"}),body:`grant_type=refresh_token&refresh_token=${encodeURIComponent(i)}`});if(!("authorization"in d.headers)){const{clientSecret:c,clientId:f}=this.state;c&&(d.headers.authorization="Basic "+this.environment.btoa(f+":"+c))}this._refreshTask=(0,Se.request)(s,d).then(c=>((0,Se.assert)(c.access_token,"No access token received"),o("Received new access token response %O",c),this.state.tokenResponse=Object.assign(Object.assign({},this.state.tokenResponse),c),this.state.expiresAt=(0,Se.getAccessTokenExpiration)(c,this.environment),this.state)).catch(c=>{var f,m;throw!((m=(f=this.state)===null||f===void 0?void 0:f.tokenResponse)===null||m===void 0)&&m.refresh_token&&(o("Deleting the expired or invalid refresh token."),delete this.state.tokenResponse.refresh_token),c}).finally(()=>{this._refreshTask=null;const c=this.state.key;c?this.environment.getStorage().set(c,this.state):o("No 'key' found in Clint.state. Cannot persist the instance.")})}return this._refreshTask}byCode(t,n){return(0,Se.byCode)(t,n)}byCodes(t,n){return(0,Se.byCodes)(t,n)}getPath(t,n=""){return(0,Se.getPath)(t,n)}getState(t=""){return(0,Se.getPath)(Object.assign({},this.state),t)}getFhirVersion(){return(0,Se.fetchConformanceStatement)(this.state.serverUrl).then(t=>t.fhirVersion)}getFhirRelease(){return this.getFhirVersion().then(t=>{var n;return(n=Yl.fhirVersions[t])!==null&&n!==void 0?n:0})}}mc.default=pM;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.init=e.buildTokenRequest=e.ready=e.onMessage=e.isInPopUp=e.isInFrame=e.authorize=e.getSecurityExtensions=e.fetchWellKnownJson=e.KEY=void 0;const t=ae,n=mc,r=rn;Object.defineProperty(e,"KEY",{enumerable:!0,get:function(){return r.SMART_KEY}});const o=t.debug.extend("oauth2");function i(){return typeof window=="object"}function s(g="/",x){const C=String(g).replace(/\/*$/,"/")+".well-known/smart-configuration";return(0,t.getAndCache)(C,x).catch(P=>{throw new Error(`Failed to fetch the well-known json "${C}". ${P.message}`)})}e.fetchWellKnownJson=s;function a(g="/",x){return s(g,x).then(C=>{if(!C.authorization_endpoint||!C.token_endpoint)throw new Error("Invalid wellKnownJson");return{registrationUri:C.registration_endpoint||"",authorizeUri:C.authorization_endpoint,tokenUri:C.token_endpoint,codeChallengeMethods:C.code_challenge_methods_supported||[]}})}function l(g="/",x){return(0,t.fetchConformanceStatement)(g,x).then(C=>{const P="http://fhir-registry.smarthealthit.org/StructureDefinition/oauth-uris",b=((0,t.getPath)(C||{},"rest.0.security.extension")||[]).filter(T=>T.url===P).map(T=>T.extension)[0],A={registrationUri:"",authorizeUri:"",tokenUri:"",codeChallengeMethods:[]};return b&&b.forEach(T=>{T.url==="register"&&(A.registrationUri=T.valueUri),T.url==="authorize"&&(A.authorizeUri=T.valueUri),T.url==="token"&&(A.tokenUri=T.valueUri)}),A})}function u(g="/"){return a(g).catch(()=>l(g))}e.getSecurityExtensions=u;async function d(g,x={}){const C=g.getUrl();if(Array.isArray(x)){const $e=C.searchParams.get("iss")||C.searchParams.get("fhirServiceUrl");if(!$e)throw new Error('Passing in an "iss" url parameter is required if authorize uses multiple configurations');const nt=x.find(cn=>{if(cn.issMatch){if(typeof cn.issMatch=="function")return!!cn.issMatch($e);if(typeof cn.issMatch=="string")return cn.issMatch===$e;if(cn.issMatch instanceof RegExp)return cn.issMatch.test($e)}return!1});return(0,t.assert)(nt,`No configuration found matching the current "iss" parameter "${$e}"`),await d(g,nt)}const{clientSecret:P,fakeTokenResponse:b,encounterId:A,target:T,width:$,height:E,pkceMode:O,clientPublicKeySetUrl:F,redirect_uri:L,client_id:R}=x;let{iss:M,launch:j,patientId:B,fhirServiceUrl:D,redirectUri:N,noRedirect:V,scope:Q="",clientId:te,completeInTarget:pe,clientPrivateJwk:ge}=x;const z=g.getStorage();M=C.searchParams.get("iss")||M,D=C.searchParams.get("fhirServiceUrl")||D,j=C.searchParams.get("launch")||j,B=C.searchParams.get("patientId")||B,te=C.searchParams.get("clientId")||te,te||(te=R),N||(N=L),N?N.match(/^https?\:\/\//)||(N=g.relative(N)):N=g.relative(".");const W=String(M||D||"");if(!W)throw new Error("No server url found. It must be specified as `iss` or as `fhirServiceUrl` parameter");if(M&&o("Making %s launch...",j?"EHR":"standalone"),j&&!Q.match(/launch/)&&(Q+=" launch"),i()){const $e=f(),nt=m();($e||nt)&&pe!==!0&&pe!==!1&&(pe=$e,console.warn('Your app is being authorized from within an iframe or popup window. Please be explicit and provide a "completeInTarget" option. Use "true" to complete the authorization in the same window, or "false" to try to complete it in the parent or the opener window. See http://docs.smarthealthit.org/client-js/api.html'))}const he=await z.get(r.SMART_KEY);await z.unset(he);const Te=(0,t.randomString)(16),we={clientId:te,scope:Q,redirectUri:N,serverUrl:W,clientSecret:P,clientPrivateJwk:ge,tokenResponse:{},key:Te,completeInTarget:pe,clientPublicKeySetUrl:F};(i()?(0,t.getPath)(g,"options.fullSessionStorageSupport"):!0)&&await z.set(r.SMART_KEY,Te),b&&Object.assign(we.tokenResponse,b),B&&Object.assign(we.tokenResponse,{patient:B}),A&&Object.assign(we.tokenResponse,{encounter:A});let Ce=N+"?state="+encodeURIComponent(Te);if(D&&!M)return o("Making fake launch..."),await z.set(Te,we),V?Ce:await g.redirect(Ce);const it=await u(W);if(Object.assign(we,it),await z.set(Te,we),!we.authorizeUri)return V?Ce:await g.redirect(Ce);const Ot=["response_type=code","client_id="+encodeURIComponent(te||""),"scope="+encodeURIComponent(Q),"redirect_uri="+encodeURIComponent(N),"aud="+encodeURIComponent(W),"state="+encodeURIComponent(Te)];if(j&&Ot.push("launch="+encodeURIComponent(j)),c(it.codeChallengeMethods.includes("S256"),O)){let $e=await g.security.generatePKCEChallenge();Object.assign(we,$e),await z.set(Te,we),Ot.push("code_challenge="+we.codeChallenge),Ot.push("code_challenge_method=S256")}if(Ce=we.authorizeUri+"?"+Ot.join("&"),V)return Ce;if(T&&i()){let $e;if($e=await(0,t.getTargetWindow)(T,$,E),$e!==self)try{$e.sessionStorage.removeItem(he),$e.sessionStorage.setItem(Te,JSON.stringify(we))}catch(nt){(0,t.debug)('Failed to modify window.sessionStorage. Perhaps it is from different origin?. Failing back to "_self". %s',nt),$e=self}if($e!==self)try{$e.location.href=Ce,self.addEventListener("message",y)}catch(nt){(0,t.debug)('Failed to modify window.location. Perhaps it is from different origin?. Failing back to "_self". %s',nt),self.location.href=Ce}else self.location.href=Ce;return}else return await g.redirect(Ce)}e.authorize=d;function c(g,x){if(x==="disabled")return!1;if(x==="unsafeV1")return!0;if(x==="required"){if(!g)throw new Error("Required PKCE code challenge method (`S256`) was not found in the server's codeChallengeMethods declaration.");return!0}return g}function f(){try{return self!==top&&parent!==self}catch{return!0}}e.isInFrame=f;function m(){try{return self===top&&!!opener&&opener!==self&&!!window.name}catch{return!1}}e.isInPopUp=m;function y(g){g.data.type=="completeAuth"&&g.origin===new URL(self.location.href).origin&&(window.removeEventListener("message",y),window.location.href=g.data.url)}e.onMessage=y;async function v(g,x={}){var C,P;const b=g.getUrl(),A=g.getStorage(),T=b.searchParams;let $=T.get("state");const E=T.get("code"),O=T.get("error"),F=T.get("error_description");if($||($=await A.get(r.SMART_KEY)),O||F)throw new Error([O,F].filter(Boolean).join(": "));o("key: %s, code: %s",$,E),(0,t.assert)($,"No 'state' parameter found. Please (re)launch the app.");let L=await A.get($);const R=i()?(0,t.getPath)(g,"options.fullSessionStorageSupport"):!0;if(i()&&L&&!L.completeInTarget){const D=f(),N=m();if((D||N)&&!b.searchParams.get("complete")){b.searchParams.set("complete","1");const{href:V,origin:Q}=b;return D&&parent.postMessage({type:"completeAuth",url:V},Q),N&&(opener.postMessage({type:"completeAuth",url:V},Q),window.close()),new Promise(()=>{})}}b.searchParams.delete("complete");const M=T.has("state");if(i()&&(0,t.getPath)(g,"options.replaceBrowserHistory")&&(E||M)&&(E&&(T.delete("code"),o("Removed code parameter from the url.")),M&&R&&(T.delete("state"),o("Removed state parameter from the url.")),window.history.replaceState&&window.history.replaceState({},"",b.href)),(0,t.assert)(L,"No state found! Please (re)launch the app."),!(!E||((C=L.tokenResponse)===null||C===void 0?void 0:C.access_token))&&L.tokenUri){(0,t.assert)(E,"'code' url parameter is required"),o("Preparing to exchange the code for access token...");const D=await S(g,{code:E,state:L,clientPublicKeySetUrl:x.clientPublicKeySetUrl,privateKey:x.privateKey||L.clientPrivateJwk});o("Token request options: %O",D);const N=await(0,t.request)(L.tokenUri,D);o("Token response: %O",N),(0,t.assert)(N.access_token,"Failed to obtain access token."),L.expiresAt=(0,t.getAccessTokenExpiration)(N,g),L=Object.assign(Object.assign({},L),{tokenResponse:N}),await A.set($,L),o("Authorization successful!")}else o(!((P=L.tokenResponse)===null||P===void 0)&&P.access_token?"Already authorized":"No authorization needed");R&&await A.set(r.SMART_KEY,$);const B=new n.default(g,L);return o("Created client instance: %O",B),B}e.ready=v;async function S(g,{code:x,state:C,clientPublicKeySetUrl:P,privateKey:b}){const{redirectUri:A,clientSecret:T,tokenUri:$,clientId:E,codeVerifier:O}=C;(0,t.assert)(A,"Missing state.redirectUri"),(0,t.assert)($,"Missing state.tokenUri"),(0,t.assert)(E,"Missing state.clientId");const F={method:"POST",headers:{"content-type":"application/x-www-form-urlencoded"},body:`code=${x}&grant_type=authorization_code&redirect_uri=${encodeURIComponent(A)}`};if(T)F.headers.authorization="Basic "+g.btoa(E+":"+T),o("Using state.clientSecret to construct the authorization header: %s",F.headers.authorization);else if(b){const L="key"in b?b.key:await g.security.importJWK(b),R={typ:"JWT",kid:b.kid,jku:P||C.clientPublicKeySetUrl},M={iss:E,sub:E,aud:$,jti:g.base64urlencode(g.security.randomBytes(32)),exp:(0,t.getTimeInFuture)(120)},j=await g.security.signCompactJws(b.alg,L,R,M);F.body+=`&client_assertion_type=${encodeURIComponent("urn:ietf:params:oauth:client-assertion-type:jwt-bearer")}`,F.body+=`&client_assertion=${encodeURIComponent(j)}`,o("Using state.clientPrivateJwk to add a client_assertion to the POST body")}else o("Public client detected; adding state.clientId to the POST body"),F.body+=`&client_id=${encodeURIComponent(E)}`;return O&&(o("Found state.codeVerifier, adding to the POST body"),F.body+="&code_verifier="+O),F}e.buildTokenRequest=S;async function w(g,x,C){const P=g.getUrl(),b=P.searchParams.get("code"),A=P.searchParams.get("state");if(b&&A)return v(g,C);const T=g.getStorage(),$=A||await T.get(r.SMART_KEY),E=await T.get($);return E?new n.default(g,E):d(g,x).then(()=>new Promise(()=>{}))}e.init=w})(Kx);var Xh={};Object.defineProperty(Xh,"__esModule",{value:!0});class hM{async get(t){const n=sessionStorage[t];return n?JSON.parse(n):null}async set(t,n){return sessionStorage[t]=JSON.stringify(n),n}async unset(t){return t in sessionStorage?(delete sessionStorage[t],!0):!1}}Xh.default=hM;var tn={},Jx={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(typeof self<"u"?self:typeof window<"u"?window:Xn,function(){var n="3.7.7",r=n,o=typeof Buffer=="function",i=typeof TextDecoder=="function"?new TextDecoder:void 0,s=typeof TextEncoder=="function"?new TextEncoder:void 0,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",l=Array.prototype.slice.call(a),u=function(z){var W={};return z.forEach(function(he,Te){return W[he]=Te}),W}(l),d=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,c=String.fromCharCode.bind(String),f=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function(z){return new Uint8Array(Array.prototype.slice.call(z,0))},m=function(z){return z.replace(/=/g,"").replace(/[+\/]/g,function(W){return W=="+"?"-":"_"})},y=function(z){return z.replace(/[^A-Za-z0-9\+\/]/g,"")},v=function(z){for(var W,he,Te,we,tt="",Ce=z.length%3,it=0;it255||(Te=z.charCodeAt(it++))>255||(we=z.charCodeAt(it++))>255)throw new TypeError("invalid character found");W=he<<16|Te<<8|we,tt+=l[W>>18&63]+l[W>>12&63]+l[W>>6&63]+l[W&63]}return Ce?tt.slice(0,Ce-3)+"===".substring(Ce):tt},S=typeof btoa=="function"?function(z){return btoa(z)}:o?function(z){return Buffer.from(z,"binary").toString("base64")}:v,w=o?function(z){return Buffer.from(z).toString("base64")}:function(z){for(var W=4096,he=[],Te=0,we=z.length;Te>>6)+c(128|W&63):c(224|W>>>12&15)+c(128|W>>>6&63)+c(128|W&63)}else{var W=65536+(z.charCodeAt(0)-55296)*1024+(z.charCodeAt(1)-56320);return c(240|W>>>18&7)+c(128|W>>>12&63)+c(128|W>>>6&63)+c(128|W&63)}},C=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,P=function(z){return z.replace(C,x)},b=o?function(z){return Buffer.from(z,"utf8").toString("base64")}:s?function(z){return w(s.encode(z))}:function(z){return S(P(z))},A=function(z,W){return W===void 0&&(W=!1),W?m(b(z)):b(z)},T=function(z){return A(z,!0)},$=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,E=function(z){switch(z.length){case 4:var W=(7&z.charCodeAt(0))<<18|(63&z.charCodeAt(1))<<12|(63&z.charCodeAt(2))<<6|63&z.charCodeAt(3),he=W-65536;return c((he>>>10)+55296)+c((he&1023)+56320);case 3:return c((15&z.charCodeAt(0))<<12|(63&z.charCodeAt(1))<<6|63&z.charCodeAt(2));default:return c((31&z.charCodeAt(0))<<6|63&z.charCodeAt(1))}},O=function(z){return z.replace($,E)},F=function(z){if(z=z.replace(/\s+/g,""),!d.test(z))throw new TypeError("malformed base64.");z+="==".slice(2-(z.length&3));for(var W,he="",Te,we,tt=0;tt>16&255):we===64?c(W>>16&255,W>>8&255):c(W>>16&255,W>>8&255,W&255);return he},L=typeof atob=="function"?function(z){return atob(y(z))}:o?function(z){return Buffer.from(z,"base64").toString("binary")}:F,R=o?function(z){return f(Buffer.from(z,"base64"))}:function(z){return f(L(z).split("").map(function(W){return W.charCodeAt(0)}))},M=function(z){return R(B(z))},j=o?function(z){return Buffer.from(z,"base64").toString("utf8")}:i?function(z){return i.decode(R(z))}:function(z){return O(L(z))},B=function(z){return y(z.replace(/[-_]/g,function(W){return W=="-"?"+":"/"}))},D=function(z){return j(B(z))},N=function(z){if(typeof z!="string")return!1;var W=z.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(W)||!/[^\s0-9a-zA-Z\-_]/.test(W)},V=function(z){return{value:z,enumerable:!1,writable:!0,configurable:!0}},Q=function(){var z=function(W,he){return Object.defineProperty(String.prototype,W,V(he))};z("fromBase64",function(){return D(this)}),z("toBase64",function(W){return A(this,W)}),z("toBase64URI",function(){return A(this,!0)}),z("toBase64URL",function(){return A(this,!0)}),z("toUint8Array",function(){return M(this)})},te=function(){var z=function(W,he){return Object.defineProperty(Uint8Array.prototype,W,V(he))};z("toBase64",function(W){return g(this,W)}),z("toBase64URI",function(){return g(this,!0)}),z("toBase64URL",function(){return g(this,!0)})},pe=function(){Q(),te()},ge={version:n,VERSION:r,atob:L,atobPolyfill:F,btoa:S,btoaPolyfill:v,fromBase64:D,toBase64:A,encode:A,encodeURI:T,encodeURL:T,utob:P,btou:O,decode:D,isValid:N,fromUint8Array:g,toUint8Array:M,extendString:Q,extendUint8Array:te,extendBuiltins:pe};return ge.Base64={},Object.keys(ge).forEach(function(z){return ge.Base64[z]=ge[z]}),ge})})(Jx);var Zx=Jx.exports;/** - * @file Web Cryptography API shim - * @author Artem S Vybornov - * @license MIT - */(function(e,t){typeof define=="function"&&define.amd?define([],function(){return t(e)}):typeof ou=="object"&&ou.exports?ou.exports=t(e):t(e)})(typeof self<"u"?self:void 0,function(e){if(typeof Promise!="function")throw"Promise support required";var t=e.crypto||e.msCrypto;if(!t)return;var n=t.subtle||t.webkitSubtle;if(!n)return;var r=e.Crypto||t.constructor||Object,o=e.SubtleCrypto||n.constructor||Object;e.CryptoKey||e.Key;var i=e.navigator.userAgent.indexOf("Edge/")>-1,s=!!e.msCrypto&&!i,a=!t.subtle&&!!t.webkitSubtle;if(!s&&!a)return;function l(E){return btoa(E).replace(/\=+$/,"").replace(/\+/g,"-").replace(/\//g,"_")}function u(E){return E+="===",E=E.slice(0,-E.length%4),atob(E.replace(/-/g,"+").replace(/_/g,"/"))}function d(E){for(var O=new Uint8Array(E.length),F=0;F2&&(F=!0,O.shift());var L={ext:!0};switch(O[0][0]){case"1.2.840.113549.1.1.1":var R=["n","e","d","p","q","dp","dq","qi"],M=C(O[1]);F&&M.shift();for(var j=0;j2&&(L=!0,M.unshift(new Uint8Array([0]))),F[0][0]="1.2.840.113549.1.1.1",O=M;break;default:throw new TypeError("Unsupported key type")}return F.push(new Uint8Array(P(O)).buffer),L?F.unshift(new Uint8Array([0])):F[1]={tag:3,value:F[1]},new Uint8Array(P(F)).buffer}var g={KoZIhvcNAQEB:"1.2.840.113549.1.1.1"},x={"1.2.840.113549.1.1.1":"KoZIhvcNAQEB"};function C(E,O){if(E instanceof ArrayBuffer&&(E=new Uint8Array(E)),O||(O={pos:0,end:E.length}),O.end-O.pos<2||O.end>E.length)throw new RangeError("Malformed DER");var F=E[O.pos++],L=E[O.pos++];if(L>=128){if(L&=127,O.end-O.pos=128){var B=L,L=4;for(O.splice(R,0,B>>24&255,B>>16&255,B>>8&255,B&255);L>1&&!(B>>24);)B<<=8,L--;L<4&&O.splice(R,4-L),L|=128}return O.splice(R-2,2,F,L),O}function b(E,O,F,L){Object.defineProperties(this,{_key:{value:E},type:{value:E.type,enumerable:!0},extractable:{value:F===void 0?E.extractable:F,enumerable:!0},algorithm:{value:O===void 0?E.algorithm:O,enumerable:!0},usages:{value:L===void 0?E.usages:L,enumerable:!0}})}function A(E){return E==="verify"||E==="encrypt"||E==="wrapKey"}function T(E){return E==="sign"||E==="decrypt"||E==="unwrapKey"}if(["generateKey","importKey","unwrapKey"].forEach(function(E){var O=n[E];n[E]=function(F,L,R){var M=[].slice.call(arguments),j,B,D;switch(E){case"generateKey":j=f(F),B=L,D=R;break;case"importKey":j=f(R),B=M[3],D=M[4],F==="jwk"&&(L=y(L),L.alg||(L.alg=m(j)),L.key_ops||(L.key_ops=L.kty!=="oct"?"d"in L?D.filter(T):D.filter(A):D.slice()),M[1]=v(L));break;case"unwrapKey":j=M[4],B=M[5],D=M[6],M[2]=R._key;break}if(E==="generateKey"&&j.name==="HMAC"&&j.hash)return j.length=j.length||{"SHA-1":512,"SHA-256":512,"SHA-384":1024,"SHA-512":1024}[j.hash.name],n.importKey("raw",t.getRandomValues(new Uint8Array(j.length+7>>3)),j,B,D);if(a&&E==="generateKey"&&j.name==="RSASSA-PKCS1-v1_5"&&(!j.modulusLength||j.modulusLength>=2048))return F=f(F),F.name="RSAES-PKCS1-v1_5",delete F.hash,n.generateKey(F,!0,["encrypt","decrypt"]).then(function(V){return Promise.all([n.exportKey("jwk",V.publicKey),n.exportKey("jwk",V.privateKey)])}).then(function(V){return V[0].alg=V[1].alg=m(j),V[0].key_ops=D.filter(A),V[1].key_ops=D.filter(T),Promise.all([n.importKey("jwk",V[0],j,!0,V[0].key_ops),n.importKey("jwk",V[1],j,B,V[1].key_ops)])}).then(function(V){return{publicKey:V[0],privateKey:V[1]}});if((a||s&&(j.hash||{}).name==="SHA-1")&&E==="importKey"&&F==="jwk"&&j.name==="HMAC"&&L.kty==="oct")return n.importKey("raw",d(u(L.k)),R,M[3],M[4]);if(a&&E==="importKey"&&(F==="spki"||F==="pkcs8"))return n.importKey("jwk",S(L),R,M[3],M[4]);if(s&&E==="unwrapKey")return n.decrypt(M[3],R,L).then(function(V){return n.importKey(F,V,M[4],M[5],M[6])});var N;try{N=O.apply(n,M)}catch(V){return Promise.reject(V)}return s&&(N=new Promise(function(V,Q){N.onabort=N.onerror=function(te){Q(te)},N.oncomplete=function(te){V(te.target.result)}})),N=N.then(function(V){return j.name==="HMAC"&&(j.length||(j.length=8*V.algorithm.length)),j.name.search("RSA")==0&&(j.modulusLength||(j.modulusLength=(V.publicKey||V).algorithm.modulusLength),j.publicExponent||(j.publicExponent=(V.publicKey||V).algorithm.publicExponent)),V.publicKey&&V.privateKey?V={publicKey:new b(V.publicKey,j,B,D.filter(A)),privateKey:new b(V.privateKey,j,B,D.filter(T))}:V=new b(V,j,B,D),V}),N}}),["exportKey","wrapKey"].forEach(function(E){var O=n[E];n[E]=function(F,L,R){var M=[].slice.call(arguments);switch(E){case"exportKey":M[1]=L._key;break;case"wrapKey":M[1]=L._key,M[2]=R._key;break}if((a||s&&(L.algorithm.hash||{}).name==="SHA-1")&&E==="exportKey"&&F==="jwk"&&L.algorithm.name==="HMAC"&&(M[0]="raw"),a&&E==="exportKey"&&(F==="spki"||F==="pkcs8")&&(M[0]="jwk"),s&&E==="wrapKey")return n.exportKey(F,L).then(function(B){return F==="jwk"&&(B=d(unescape(encodeURIComponent(JSON.stringify(y(B)))))),n.encrypt(M[3],R,B)});var j;try{j=O.apply(n,M)}catch(B){return Promise.reject(B)}return s&&(j=new Promise(function(B,D){j.onabort=j.onerror=function(N){D(N)},j.oncomplete=function(N){B(N.target.result)}})),E==="exportKey"&&F==="jwk"&&(j=j.then(function(B){return(a||s&&(L.algorithm.hash||{}).name==="SHA-1")&&L.algorithm.name==="HMAC"?{kty:"oct",alg:m(L.algorithm),key_ops:L.usages.slice(),ext:!0,k:l(c(B))}:(B=y(B),B.alg||(B.alg=m(L.algorithm)),B.key_ops||(B.key_ops=L.type==="public"?L.usages.filter(A):L.type==="private"?L.usages.filter(T):L.usages.slice()),B)})),a&&E==="exportKey"&&(F==="spki"||F==="pkcs8")&&(j=j.then(function(B){return B=w(y(B)),B})),j}}),["encrypt","decrypt","sign","verify"].forEach(function(E){var O=n[E];n[E]=function(F,L,R,M){if(s&&(!R.byteLength||M&&!M.byteLength))throw new Error("Empy input is not allowed");var j=[].slice.call(arguments),B=f(F);if(s&&E==="decrypt"&&B.name==="AES-GCM"){var D=F.tagLength>>3;j[2]=(R.buffer||R).slice(0,R.byteLength-D),F.tag=(R.buffer||R).slice(R.byteLength-D)}j[1]=L._key;var N;try{N=O.apply(n,j)}catch(V){return Promise.reject(V)}return s&&(N=new Promise(function(V,Q){N.onabort=N.onerror=function(te){Q(te)},N.oncomplete=function(pe){var pe=pe.target.result;if(E==="encrypt"&&pe instanceof AesGcmEncryptResult){var ge=pe.ciphertext,z=pe.tag;pe=new Uint8Array(ge.byteLength+z.byteLength),pe.set(new Uint8Array(ge),0),pe.set(new Uint8Array(z),ge.byteLength),pe=pe.buffer}V(pe)}})),N}}),s){var $=n.digest;n.digest=function(E,O){if(!O.byteLength)throw new Error("Empy input is not allowed");var F;try{F=$.call(n,E,O)}catch(L){return Promise.reject(L)}return F=new Promise(function(L,R){F.onabort=F.onerror=function(M){R(M)},F.oncomplete=function(M){L(M.target.result)}}),F},e.crypto=Object.create(t,{getRandomValues:{value:function(E){return t.getRandomValues(E)}},subtle:{value:n}}),e.CryptoKey=b}a&&(t.subtle=n,e.Crypto=r,e.SubtleCrypto=o,e.CryptoKey=b)});const gM=window.crypto,mM=Object.freeze(Object.defineProperty({__proto__:null,default:gM},Symbol.toStringTag,{value:"Module"})),vM=DE(mM);Object.defineProperty(tn,"__esModule",{value:!0});tn.signCompactJws=tn.importJWK=tn.generatePKCEChallenge=tn.digestSha256=tn.randomBytes=void 0;const Js=Zx,Yf=typeof globalThis=="object"&&globalThis.crypto?globalThis.crypto:vM.default,Jh=()=>{if(!Yf.subtle)throw globalThis.isSecureContext?new Error("Some of the required subtle crypto functionality is not available in the current environment (no crypto.subtle)"):new Error("Some of the required subtle crypto functionality is not available unless you run this app in secure context (using HTTPS or running locally). See https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts");return Yf.subtle},yM={ES384:{name:"ECDSA",namedCurve:"P-384"},RS384:{name:"RSASSA-PKCS1-v1_5",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-384"}}};function e1(e){return Yf.getRandomValues(new Uint8Array(e))}tn.randomBytes=e1;async function t1(e){const t=new TextEncoder().encode(e),n=await Jh().digest("SHA-256",t);return new Uint8Array(n)}tn.digestSha256=t1;const wM=async(e=96)=>{const t=e1(e),n=(0,Js.fromUint8Array)(t,!0);return{codeChallenge:(0,Js.fromUint8Array)(await t1(n),!0),codeVerifier:n}};tn.generatePKCEChallenge=wM;async function xM(e){if(!e.alg)throw new Error('The "alg" property of the JWK must be set to "ES384" or "RS384"');if(Array.isArray(e.key_ops)||(e.key_ops=["sign"]),!e.key_ops.includes("sign"))throw new Error('The "key_ops" property of the JWK does not contain "sign"');try{return await Jh().importKey("jwk",e,yM[e.alg],e.ext===!0,e.key_ops)}catch(t){throw new Error(`The ${e.alg} is not supported by this browser: ${t}`)}}tn.importJWK=xM;async function SM(e,t,n,r){const o=JSON.stringify(Object.assign(Object.assign({},n),{alg:e})),i=JSON.stringify(r),s=`${(0,Js.encodeURL)(o)}.${(0,Js.encodeURL)(i)}`,a=await Jh().sign(Object.assign(Object.assign({},t.algorithm),{hash:"SHA-384"}),t,new TextEncoder().encode(s));return`${s}.${(0,Js.fromUint8Array)(new Uint8Array(a),!0)}`}tn.signCompactJws=SM;Object.defineProperty(Kh,"__esModule",{value:!0});const bd=Kx,CM=mc,bM=Xh,Zv=tn,Rd=Zx;class RM{constructor(t={}){this._url=null,this._storage=null,this.security=Zv,this.options=Object.assign({replaceBrowserHistory:!0,fullSessionStorageSupport:!0,refreshTokenWithCredentials:"same-origin"},t)}relative(t){return new URL(t,this.getUrl().href).href}get fhir(){return typeof fhir=="function"?fhir:null}getUrl(){return this._url||(this._url=new URL(location+"")),this._url}redirect(t){location.href=t}getStorage(){return this._storage||(this._storage=new bM.default),this._storage}getAbortController(){return AbortController}atob(t){return window.atob(t)}btoa(t){return window.btoa(t)}base64urlencode(t){return typeof t=="string"?(0,Rd.encodeURL)(t):(0,Rd.fromUint8Array)(t,!0)}base64urldecode(t){return(0,Rd.decode)(t)}getSmartApi(){return{ready:(...t)=>(0,bd.ready)(this,...t),authorize:t=>(0,bd.authorize)(this,t),init:t=>(0,bd.init)(this,t),client:t=>new CM.default(this,t),options:this.options,utils:{security:Zv}}}}Kh.default=RM;var ey={},ty;function EM(){return ty||(ty=1,function(e){e()}(function(){function e(S,w){if(!(S instanceof w))throw new TypeError("Cannot call a class as a function")}function t(S,w){for(var g=0;g"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function a(S){if(S===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return S}function l(S,w){if(w&&(typeof w=="object"||typeof w=="function"))return w;if(w!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return a(S)}function u(S){var w=s();return function(){var x=o(S),C;if(w){var P=o(this).constructor;C=Reflect.construct(x,arguments,P)}else C=x.apply(this,arguments);return l(this,C)}}function d(S,w){for(;!Object.prototype.hasOwnProperty.call(S,w)&&(S=o(S),S!==null););return S}function c(){return typeof Reflect<"u"&&Reflect.get?c=Reflect.get.bind():c=function(w,g,x){var C=d(w,g);if(C){var P=Object.getOwnPropertyDescriptor(C,g);return P.get?P.get.call(arguments.length<3?w:x):P.value}},c.apply(this,arguments)}var f=function(){function S(){e(this,S),Object.defineProperty(this,"listeners",{value:{},writable:!0,configurable:!0})}return n(S,[{key:"addEventListener",value:function(g,x,C){g in this.listeners||(this.listeners[g]=[]),this.listeners[g].push({callback:x,options:C})}},{key:"removeEventListener",value:function(g,x){if(g in this.listeners){for(var C=this.listeners[g],P=0,b=C.length;P"u")C=new Error("This operation was aborted"),C.name="AbortError";else try{C=new DOMException("signal is aborted without reason")}catch{C=new Error("This operation was aborted"),C.name="AbortError"}this.signal.reason=C,this.signal.dispatchEvent(x)}},{key:"toString",value:function(){return"[object AbortController]"}}]),S}();typeof Symbol<"u"&&Symbol.toStringTag&&(y.prototype[Symbol.toStringTag]="AbortController",m.prototype[Symbol.toStringTag]="AbortSignal");function v(S){return S.__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL?(console.log("__FORCE_INSTALL_ABORTCONTROLLER_POLYFILL=true is set, will force install polyfill"),!0):typeof S.Request=="function"&&!S.Request.prototype.hasOwnProperty("signal")||!S.AbortController}(function(S){v(S)&&(S.AbortController=y,S.AbortSignal=m)})(typeof self<"u"?self:Xn)})),ey}const PM=Kh,_M=new PM.default,{ready:TM,authorize:MM,init:AM,client:kM,options:NM,utils:jM}=_M.getSmartApi();if(typeof FHIRCLIENT_PURE>"u"){const e=Wh();EM(),window.fetch||(window.fetch=e.default,window.Headers=e.Headers,window.Request=e.Request,window.Response=e.Response)}const OM={AbortController:window.AbortController,client:kM,utils:jM,oauth2:{settings:NM,ready:TM,authorize:MM,init:AM}};var Ou=OM,Ho=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(){}},Fo=typeof window>"u"||"Deno"in globalThis;function Jt(){}function DM(e,t){return typeof e=="function"?e(t):e}function Xf(e){return typeof e=="number"&&e>=0&&e!==1/0}function n1(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Ri(e,t){return typeof e=="function"?e(t):e}function vn(e,t){return typeof e=="function"?e(t):e}function ny(e,t){const{type:n="all",exact:r,fetchStatus:o,predicate:i,queryKey:s,stale:a}=e;if(s){if(r){if(t.queryHash!==Zh(s,t.options))return!1}else if(!Sa(t.queryKey,s))return!1}if(n!=="all"){const l=t.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&t.isStale()!==a||o&&o!==t.state.fetchStatus||i&&!i(t))}function ry(e,t){const{exact:n,status:r,predicate:o,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(n){if(Lo(t.options.mutationKey)!==Lo(i))return!1}else if(!Sa(t.options.mutationKey,i))return!1}return!(r&&t.state.status!==r||o&&!o(t))}function Zh(e,t){return((t==null?void 0:t.queryKeyHashFn)||Lo)(e)}function Lo(e){return JSON.stringify(e,(t,n)=>Jf(n)?Object.keys(n).sort().reduce((r,o)=>(r[o]=n[o],r),{}):n)}function Sa(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?!Object.keys(t).some(n=>!Sa(e[n],t[n])):!1}function eg(e,t){if(e===t)return e;const n=oy(e)&&oy(t);if(n||Jf(e)&&Jf(t)){const r=n?e:Object.keys(e),o=r.length,i=n?t:Object.keys(t),s=i.length,a=n?[]:{};let l=0;for(let u=0;u{setTimeout(t,e)})}function Zf(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?eg(e,t):t}function FM(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function LM(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var tg=Symbol();function r1(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===tg?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}var So,Mr,Mi,e0,$M=(e0=class extends Ho{constructor(){super();ne(this,So);ne(this,Mr);ne(this,Mi);q(this,Mi,t=>{if(!Fo&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){_(this,Mr)||this.setEventListener(_(this,Mi))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Mr))==null||t.call(this),q(this,Mr,void 0))}setEventListener(t){var n;q(this,Mi,t),(n=_(this,Mr))==null||n.call(this),q(this,Mr,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){_(this,So)!==t&&(q(this,So,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof _(this,So)=="boolean"?_(this,So):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},So=new WeakMap,Mr=new WeakMap,Mi=new WeakMap,e0),ng=new $M,Ai,Ar,ki,t0,UM=(t0=class extends Ho{constructor(){super();ne(this,Ai,!0);ne(this,Ar);ne(this,ki);q(this,ki,t=>{if(!Fo&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){_(this,Ar)||this.setEventListener(_(this,ki))}onUnsubscribe(){var t;this.hasListeners()||((t=_(this,Ar))==null||t.call(this),q(this,Ar,void 0))}setEventListener(t){var n;q(this,ki,t),(n=_(this,Ar))==null||n.call(this),q(this,Ar,t(this.setOnline.bind(this)))}setOnline(t){_(this,Ai)!==t&&(q(this,Ai,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return _(this,Ai)}},Ai=new WeakMap,Ar=new WeakMap,ki=new WeakMap,t0),Iu=new UM;function ep(){let e,t;const n=new Promise((o,i)=>{e=o,t=i});n.status="pending",n.catch(()=>{});function r(o){Object.assign(n,o),delete n.resolve,delete n.reject}return n.resolve=o=>{r({status:"fulfilled",value:o}),e(o)},n.reject=o=>{r({status:"rejected",reason:o}),t(o)},n}function zM(e){return Math.min(1e3*2**e,3e4)}function o1(e){return(e??"online")==="online"?Iu.isOnline():!0}var i1=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function Ed(e){return e instanceof i1}function s1(e){let t=!1,n=0,r=!1,o;const i=ep(),s=v=>{var S;r||(f(new i1(v)),(S=e.abort)==null||S.call(e))},a=()=>{t=!0},l=()=>{t=!1},u=()=>ng.isFocused()&&(e.networkMode==="always"||Iu.isOnline())&&e.canRun(),d=()=>o1(e.networkMode)&&e.canRun(),c=v=>{var S;r||(r=!0,(S=e.onSuccess)==null||S.call(e,v),o==null||o(),i.resolve(v))},f=v=>{var S;r||(r=!0,(S=e.onError)==null||S.call(e,v),o==null||o(),i.reject(v))},m=()=>new Promise(v=>{var S;o=w=>{(r||u())&&v(w)},(S=e.onPause)==null||S.call(e)}).then(()=>{var v;o=void 0,r||(v=e.onContinue)==null||v.call(e)}),y=()=>{if(r)return;let v;const S=n===0?e.initialPromise:void 0;try{v=S??e.fn()}catch(w){v=Promise.reject(w)}Promise.resolve(v).then(c).catch(w=>{var b;if(r)return;const g=e.retry??(Fo?0:3),x=e.retryDelay??zM,C=typeof x=="function"?x(n,w):x,P=g===!0||typeof g=="number"&&nu()?void 0:m()).then(()=>{t?f(w):y()})})};return{promise:i,cancel:s,continue:()=>(o==null||o(),i),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?y():m().then(y),i)}}function BM(){let e=[],t=0,n=a=>{a()},r=a=>{a()},o=a=>setTimeout(a,0);const i=a=>{t?e.push(a):o(()=>{n(a)})},s=()=>{const a=e;e=[],a.length&&o(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;t++;try{l=a()}finally{t--,t||s()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{o=a}}}var qe=BM(),Co,n0,a1=(n0=class{constructor(){ne(this,Co)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Xf(this.gcTime)&&q(this,Co,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Fo?1/0:5*60*1e3))}clearGcTimeout(){_(this,Co)&&(clearTimeout(_(this,Co)),q(this,Co,void 0))}},Co=new WeakMap,n0),Ni,ji,Yt,pt,Ta,bo,pn,Gn,r0,VM=(r0=class extends a1{constructor(t){super();ne(this,pn);ne(this,Ni);ne(this,ji);ne(this,Yt);ne(this,pt);ne(this,Ta);ne(this,bo);q(this,bo,!1),q(this,Ta,t.defaultOptions),this.setOptions(t.options),this.observers=[],q(this,Yt,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,q(this,Ni,HM(this.options)),this.state=t.state??_(this,Ni),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=_(this,pt))==null?void 0:t.promise}setOptions(t){this.options={..._(this,Ta),...t},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&_(this,Yt).remove(this)}setData(t,n){const r=Zf(this.state.data,t,this.options);return se(this,pn,Gn).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){se(this,pn,Gn).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,o;const n=(r=_(this,pt))==null?void 0:r.promise;return(o=_(this,pt))==null||o.cancel(t),n?n.then(Jt).catch(Jt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(_(this,Ni))}isActive(){return this.observers.some(t=>vn(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===tg||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(t=0){return this.state.isInvalidated||this.state.data===void 0||!n1(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,pt))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=_(this,pt))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),_(this,Yt).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(_(this,pt)&&(_(this,bo)?_(this,pt).cancel({revert:!0}):_(this,pt).cancelRetry()),this.scheduleGc()),_(this,Yt).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||se(this,pn,Gn).call(this,{type:"invalidate"})}fetch(t,n){var l,u,d;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(_(this,pt))return _(this,pt).continueRetry(),_(this,pt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const c=this.observers.find(f=>f.options.queryFn);c&&this.setOptions(c.options)}const r=new AbortController,o=c=>{Object.defineProperty(c,"signal",{enumerable:!0,get:()=>(q(this,bo,!0),r.signal)})},i=()=>{const c=r1(this.options,n),f={queryKey:this.queryKey,meta:this.meta};return o(f),q(this,bo,!1),this.options.persister?this.options.persister(c,f,this):c(f)},s={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:i};o(s),(l=this.options.behavior)==null||l.onFetch(s,this),q(this,ji,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&se(this,pn,Gn).call(this,{type:"fetch",meta:(d=s.fetchOptions)==null?void 0:d.meta});const a=c=>{var f,m,y,v;Ed(c)&&c.silent||se(this,pn,Gn).call(this,{type:"error",error:c}),Ed(c)||((m=(f=_(this,Yt).config).onError)==null||m.call(f,c,this),(v=(y=_(this,Yt).config).onSettled)==null||v.call(y,this.state.data,c,this)),this.scheduleGc()};return q(this,pt,s1({initialPromise:n==null?void 0:n.initialPromise,fn:s.fetchFn,abort:r.abort.bind(r),onSuccess:c=>{var f,m,y,v;if(c===void 0){a(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(c)}catch(S){a(S);return}(m=(f=_(this,Yt).config).onSuccess)==null||m.call(f,c,this),(v=(y=_(this,Yt).config).onSettled)==null||v.call(y,c,this.state.error,this),this.scheduleGc()},onError:a,onFail:(c,f)=>{se(this,pn,Gn).call(this,{type:"failed",failureCount:c,error:f})},onPause:()=>{se(this,pn,Gn).call(this,{type:"pause"})},onContinue:()=>{se(this,pn,Gn).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0})),_(this,pt).start()}},Ni=new WeakMap,ji=new WeakMap,Yt=new WeakMap,pt=new WeakMap,Ta=new WeakMap,bo=new WeakMap,pn=new WeakSet,Gn=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...l1(r.data,this.options),fetchMeta:t.meta??null};case"success":return{...r,data:t.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const o=t.error;return Ed(o)&&o.revert&&_(this,ji)?{..._(this,ji),fetchStatus:"idle"}:{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),qe.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),_(this,Yt).notify({query:this,type:"updated",action:t})})},r0);function l1(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:o1(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function HM(e){const 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 Nn,o0,KM=(o0=class extends Ho{constructor(t={}){super();ne(this,Nn);this.config=t,q(this,Nn,new Map)}build(t,n,r){const o=n.queryKey,i=n.queryHash??Zh(o,n);let s=this.get(i);return s||(s=new VM({cache:this,queryKey:o,queryHash:i,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(o)}),this.add(s)),s}add(t){_(this,Nn).has(t.queryHash)||(_(this,Nn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=_(this,Nn).get(t.queryHash);n&&(t.destroy(),n===t&&_(this,Nn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){qe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return _(this,Nn).get(t)}getAll(){return[..._(this,Nn).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ny(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>ny(t,r)):n}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){qe.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){qe.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Nn=new WeakMap,o0),jn,vt,Ro,On,Cr,i0,GM=(i0=class extends a1{constructor(t){super();ne(this,On);ne(this,jn);ne(this,vt);ne(this,Ro);this.mutationId=t.mutationId,q(this,vt,t.mutationCache),q(this,jn,[]),this.state=t.state||u1(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){_(this,jn).includes(t)||(_(this,jn).push(t),this.clearGcTimeout(),_(this,vt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){q(this,jn,_(this,jn).filter(n=>n!==t)),this.scheduleGc(),_(this,vt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){_(this,jn).length||(this.state.status==="pending"?this.scheduleGc():_(this,vt).remove(this))}continue(){var t;return((t=_(this,Ro))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,i,s,a,l,u,d,c,f,m,y,v,S,w,g,x,C,P,b,A;q(this,Ro,s1({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(T,$)=>{se(this,On,Cr).call(this,{type:"failed",failureCount:T,error:$})},onPause:()=>{se(this,On,Cr).call(this,{type:"pause"})},onContinue:()=>{se(this,On,Cr).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>_(this,vt).canRun(this)}));const n=this.state.status==="pending",r=!_(this,Ro).canStart();try{if(!n){se(this,On,Cr).call(this,{type:"pending",variables:t,isPaused:r}),await((i=(o=_(this,vt).config).onMutate)==null?void 0:i.call(o,t,this));const $=await((a=(s=this.options).onMutate)==null?void 0:a.call(s,t));$!==this.state.context&&se(this,On,Cr).call(this,{type:"pending",context:$,variables:t,isPaused:r})}const T=await _(this,Ro).start();return await((u=(l=_(this,vt).config).onSuccess)==null?void 0:u.call(l,T,t,this.state.context,this)),await((c=(d=this.options).onSuccess)==null?void 0:c.call(d,T,t,this.state.context)),await((m=(f=_(this,vt).config).onSettled)==null?void 0:m.call(f,T,null,this.state.variables,this.state.context,this)),await((v=(y=this.options).onSettled)==null?void 0:v.call(y,T,null,t,this.state.context)),se(this,On,Cr).call(this,{type:"success",data:T}),T}catch(T){try{throw await((w=(S=_(this,vt).config).onError)==null?void 0:w.call(S,T,t,this.state.context,this)),await((x=(g=this.options).onError)==null?void 0:x.call(g,T,t,this.state.context)),await((P=(C=_(this,vt).config).onSettled)==null?void 0:P.call(C,void 0,T,this.state.variables,this.state.context,this)),await((A=(b=this.options).onSettled)==null?void 0:A.call(b,void 0,T,t,this.state.context)),T}finally{se(this,On,Cr).call(this,{type:"error",error:T})}}finally{_(this,vt).runNext(this)}}},jn=new WeakMap,vt=new WeakMap,Ro=new WeakMap,On=new WeakSet,Cr=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),qe.batch(()=>{_(this,jn).forEach(r=>{r.onMutationUpdate(t)}),_(this,vt).notify({mutation:this,type:"updated",action:t})})},i0);function u1(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var It,Ma,s0,WM=(s0=class extends Ho{constructor(t={}){super();ne(this,It);ne(this,Ma);this.config=t,q(this,It,new Map),q(this,Ma,Date.now())}build(t,n,r){const o=new GM({mutationCache:this,mutationId:++ol(this,Ma)._,options:t.defaultMutationOptions(n),state:r});return this.add(o),o}add(t){const n=El(t),r=_(this,It).get(n)??[];r.push(t),_(this,It).set(n,r),this.notify({type:"added",mutation:t})}remove(t){var r;const n=El(t);if(_(this,It).has(n)){const o=(r=_(this,It).get(n))==null?void 0:r.filter(i=>i!==t);o&&(o.length===0?_(this,It).delete(n):_(this,It).set(n,o))}this.notify({type:"removed",mutation:t})}canRun(t){var r;const n=(r=_(this,It).get(El(t)))==null?void 0:r.find(o=>o.state.status==="pending");return!n||n===t}runNext(t){var r;const n=(r=_(this,It).get(El(t)))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(n==null?void 0:n.continue())??Promise.resolve()}clear(){qe.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}getAll(){return[..._(this,It).values()].flat()}find(t){const n={exact:!0,...t};return this.getAll().find(r=>ry(n,r))}findAll(t={}){return this.getAll().filter(n=>ry(t,n))}notify(t){qe.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return qe.batch(()=>Promise.all(t.map(n=>n.continue().catch(Jt))))}},It=new WeakMap,Ma=new WeakMap,s0);function El(e){var t;return((t=e.options.scope)==null?void 0:t.id)??String(e.mutationId)}function sy(e){return{onFetch:(t,n)=>{var d,c,f,m,y;const r=t.options,o=(f=(c=(d=t.fetchOptions)==null?void 0:d.meta)==null?void 0:c.fetchMore)==null?void 0:f.direction,i=((m=t.state.data)==null?void 0:m.pages)||[],s=((y=t.state.data)==null?void 0:y.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let v=!1;const S=x=>{Object.defineProperty(x,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},w=r1(t.options,t.fetchOptions),g=async(x,C,P)=>{if(v)return Promise.reject();if(C==null&&x.pages.length)return Promise.resolve(x);const b={queryKey:t.queryKey,pageParam:C,direction:P?"backward":"forward",meta:t.options.meta};S(b);const A=await w(b),{maxPages:T}=t.options,$=P?LM:FM;return{pages:$(x.pages,A,T),pageParams:$(x.pageParams,C,T)}};if(o&&i.length){const x=o==="backward",C=x?qM:ay,P={pages:i,pageParams:s},b=C(r,P);a=await g(P,b,x)}else{const x=e??i.length;do{const C=l===0?s[0]??r.initialPageParam:ay(r,a);if(l>0&&C==null)break;a=await g(a,C),l++}while(l{var v,S;return(S=(v=t.options).persister)==null?void 0:S.call(v,u,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=u}}}function ay(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function qM(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Ge,kr,Nr,Oi,Di,jr,Ii,Fi,a0,QM=(a0=class{constructor(e={}){ne(this,Ge);ne(this,kr);ne(this,Nr);ne(this,Oi);ne(this,Di);ne(this,jr);ne(this,Ii);ne(this,Fi);q(this,Ge,e.queryCache||new KM),q(this,kr,e.mutationCache||new WM),q(this,Nr,e.defaultOptions||{}),q(this,Oi,new Map),q(this,Di,new Map),q(this,jr,0)}mount(){ol(this,jr)._++,_(this,jr)===1&&(q(this,Ii,ng.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ge).onFocus())})),q(this,Fi,Iu.subscribe(async e=>{e&&(await this.resumePausedMutations(),_(this,Ge).onOnline())})))}unmount(){var e,t;ol(this,jr)._--,_(this,jr)===0&&((e=_(this,Ii))==null||e.call(this),q(this,Ii,void 0),(t=_(this,Fi))==null||t.call(this),q(this,Fi,void 0))}isFetching(e){return _(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return _(this,kr).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ge).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.getQueryData(e.queryKey);if(t===void 0)return this.fetchQuery(e);{const n=this.defaultQueryOptions(e),r=_(this,Ge).build(this,n);return e.revalidateIfStale&&r.isStaleByTime(Ri(n.staleTime,r))&&this.prefetchQuery(n),Promise.resolve(t)}}getQueriesData(e){return _(this,Ge).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),o=_(this,Ge).get(r.queryHash),i=o==null?void 0:o.state.data,s=DM(t,i);if(s!==void 0)return _(this,Ge).build(this,r).setData(s,{...n,manual:!0})}setQueriesData(e,t,n){return qe.batch(()=>_(this,Ge).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=_(this,Ge).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=_(this,Ge);qe.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=_(this,Ge),r={type:"active",...e};return qe.batch(()=>(n.findAll(e).forEach(o=>{o.reset()}),this.refetchQueries(r,t)))}cancelQueries(e={},t={}){const n={revert:!0,...t},r=qe.batch(()=>_(this,Ge).findAll(e).map(o=>o.cancel(n)));return Promise.all(r).then(Jt).catch(Jt)}invalidateQueries(e={},t={}){return qe.batch(()=>{if(_(this,Ge).findAll(e).forEach(r=>{r.invalidate()}),e.refetchType==="none")return Promise.resolve();const n={...e,type:e.refetchType??e.type??"active"};return this.refetchQueries(n,t)})}refetchQueries(e={},t){const n={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},r=qe.batch(()=>_(this,Ge).findAll(e).filter(o=>!o.isDisabled()).map(o=>{let i=o.fetch(void 0,n);return n.throwOnError||(i=i.catch(Jt)),o.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(Jt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=_(this,Ge).build(this,t);return n.isStaleByTime(Ri(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Jt).catch(Jt)}fetchInfiniteQuery(e){return e.behavior=sy(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Jt).catch(Jt)}ensureInfiniteQueryData(e){return e.behavior=sy(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Iu.isOnline()?_(this,kr).resumePausedMutations():Promise.resolve()}getQueryCache(){return _(this,Ge)}getMutationCache(){return _(this,kr)}getDefaultOptions(){return _(this,Nr)}setDefaultOptions(e){q(this,Nr,e)}setQueryDefaults(e,t){_(this,Oi).set(Lo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[..._(this,Oi).values()];let n={};return t.forEach(r=>{Sa(e,r.queryKey)&&(n={...n,...r.defaultOptions})}),n}setMutationDefaults(e,t){_(this,Di).set(Lo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[..._(this,Di).values()];let n={};return t.forEach(r=>{Sa(e,r.mutationKey)&&(n={...n,...r.defaultOptions})}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={..._(this,Nr).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Zh(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.enabled!==!0&&t.queryFn===tg&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{..._(this,Nr).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){_(this,Ge).clear(),_(this,kr).clear()}},Ge=new WeakMap,kr=new WeakMap,Nr=new WeakMap,Oi=new WeakMap,Di=new WeakMap,jr=new WeakMap,Ii=new WeakMap,Fi=new WeakMap,a0),Rt,xe,Aa,yt,Eo,Li,Or,Dn,ka,$i,Ui,Po,_o,Dr,zi,_e,Us,tp,np,rp,op,ip,sp,ap,c1,l0,vc=(l0=class extends Ho{constructor(t,n){super();ne(this,_e);ne(this,Rt);ne(this,xe);ne(this,Aa);ne(this,yt);ne(this,Eo);ne(this,Li);ne(this,Or);ne(this,Dn);ne(this,ka);ne(this,$i);ne(this,Ui);ne(this,Po);ne(this,_o);ne(this,Dr);ne(this,zi,new Set);this.options=n,q(this,Rt,t),q(this,Dn,null),q(this,Or,ep()),this.options.experimental_prefetchInRender||_(this,Or).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(_(this,xe).addObserver(this),ly(_(this,xe),this.options)?se(this,_e,Us).call(this):this.updateResult(),se(this,_e,op).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lp(_(this,xe),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lp(_(this,xe),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,se(this,_e,ip).call(this),se(this,_e,sp).call(this),_(this,xe).removeObserver(this)}setOptions(t,n){const r=this.options,o=_(this,xe);if(this.options=_(this,Rt).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof vn(this.options.enabled,_(this,xe))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");se(this,_e,ap).call(this),_(this,xe).setOptions(this.options),r._defaulted&&!Du(this.options,r)&&_(this,Rt).getQueryCache().notify({type:"observerOptionsUpdated",query:_(this,xe),observer:this});const i=this.hasListeners();i&&uy(_(this,xe),o,this.options,r)&&se(this,_e,Us).call(this),this.updateResult(n),i&&(_(this,xe)!==o||vn(this.options.enabled,_(this,xe))!==vn(r.enabled,_(this,xe))||Ri(this.options.staleTime,_(this,xe))!==Ri(r.staleTime,_(this,xe)))&&se(this,_e,tp).call(this);const s=se(this,_e,np).call(this);i&&(_(this,xe)!==o||vn(this.options.enabled,_(this,xe))!==vn(r.enabled,_(this,xe))||s!==_(this,Dr))&&se(this,_e,rp).call(this,s)}getOptimisticResult(t){const n=_(this,Rt).getQueryCache().build(_(this,Rt),t),r=this.createResult(n,t);return XM(this,r)&&(q(this,yt,r),q(this,Li,this.options),q(this,Eo,_(this,xe).state)),r}getCurrentResult(){return _(this,yt)}trackResult(t,n){const r={};return Object.keys(t).forEach(o=>{Object.defineProperty(r,o,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(o),n==null||n(o),t[o])})}),r}trackProp(t){_(this,zi).add(t)}getCurrentQuery(){return _(this,xe)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=_(this,Rt).defaultQueryOptions(t),r=_(this,Rt).getQueryCache().build(_(this,Rt),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return se(this,_e,Us).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),_(this,yt)))}createResult(t,n){var T;const r=_(this,xe),o=this.options,i=_(this,yt),s=_(this,Eo),a=_(this,Li),u=t!==r?t.state:_(this,Aa),{state:d}=t;let c={...d},f=!1,m;if(n._optimisticResults){const $=this.hasListeners(),E=!$&&ly(t,n),O=$&&uy(t,r,n,o);(E||O)&&(c={...c,...l1(d.data,t.options)}),n._optimisticResults==="isRestoring"&&(c.fetchStatus="idle")}let{error:y,errorUpdatedAt:v,status:S}=c;if(n.select&&c.data!==void 0)if(i&&c.data===(s==null?void 0:s.data)&&n.select===_(this,ka))m=_(this,$i);else try{q(this,ka,n.select),m=n.select(c.data),m=Zf(i==null?void 0:i.data,m,n),q(this,$i,m),q(this,Dn,null)}catch($){q(this,Dn,$)}else m=c.data;if(n.placeholderData!==void 0&&m===void 0&&S==="pending"){let $;if(i!=null&&i.isPlaceholderData&&n.placeholderData===(a==null?void 0:a.placeholderData))$=i.data;else if($=typeof n.placeholderData=="function"?n.placeholderData((T=_(this,Ui))==null?void 0:T.state.data,_(this,Ui)):n.placeholderData,n.select&&$!==void 0)try{$=n.select($),q(this,Dn,null)}catch(E){q(this,Dn,E)}$!==void 0&&(S="success",m=Zf(i==null?void 0:i.data,$,n),f=!0)}_(this,Dn)&&(y=_(this,Dn),m=_(this,$i),v=Date.now(),S="error");const w=c.fetchStatus==="fetching",g=S==="pending",x=S==="error",C=g&&w,P=m!==void 0,A={status:S,fetchStatus:c.fetchStatus,isPending:g,isSuccess:S==="success",isError:x,isInitialLoading:C,isLoading:C,data:m,dataUpdatedAt:c.dataUpdatedAt,error:y,errorUpdatedAt:v,failureCount:c.fetchFailureCount,failureReason:c.fetchFailureReason,errorUpdateCount:c.errorUpdateCount,isFetched:c.dataUpdateCount>0||c.errorUpdateCount>0,isFetchedAfterMount:c.dataUpdateCount>u.dataUpdateCount||c.errorUpdateCount>u.errorUpdateCount,isFetching:w,isRefetching:w&&!g,isLoadingError:x&&!P,isPaused:c.fetchStatus==="paused",isPlaceholderData:f,isRefetchError:x&&P,isStale:rg(t,n),refetch:this.refetch,promise:_(this,Or)};if(this.options.experimental_prefetchInRender){const $=F=>{A.status==="error"?F.reject(A.error):A.data!==void 0&&F.resolve(A.data)},E=()=>{const F=q(this,Or,A.promise=ep());$(F)},O=_(this,Or);switch(O.status){case"pending":t.queryHash===r.queryHash&&$(O);break;case"fulfilled":(A.status==="error"||A.data!==O.value)&&E();break;case"rejected":(A.status!=="error"||A.error!==O.reason)&&E();break}}return A}updateResult(t){const n=_(this,yt),r=this.createResult(_(this,xe),this.options);if(q(this,Eo,_(this,xe).state),q(this,Li,this.options),_(this,Eo).data!==void 0&&q(this,Ui,_(this,xe)),Du(r,n))return;q(this,yt,r);const o={},i=()=>{if(!n)return!0;const{notifyOnChangeProps:s}=this.options,a=typeof s=="function"?s():s;if(a==="all"||!a&&!_(this,zi).size)return!0;const l=new Set(a??_(this,zi));return this.options.throwOnError&&l.add("error"),Object.keys(_(this,yt)).some(u=>{const d=u;return _(this,yt)[d]!==n[d]&&l.has(d)})};(t==null?void 0:t.listeners)!==!1&&i()&&(o.listeners=!0),se(this,_e,c1).call(this,{...o,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&se(this,_e,op).call(this)}},Rt=new WeakMap,xe=new WeakMap,Aa=new WeakMap,yt=new WeakMap,Eo=new WeakMap,Li=new WeakMap,Or=new WeakMap,Dn=new WeakMap,ka=new WeakMap,$i=new WeakMap,Ui=new WeakMap,Po=new WeakMap,_o=new WeakMap,Dr=new WeakMap,zi=new WeakMap,_e=new WeakSet,Us=function(t){se(this,_e,ap).call(this);let n=_(this,xe).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(Jt)),n},tp=function(){se(this,_e,ip).call(this);const t=Ri(this.options.staleTime,_(this,xe));if(Fo||_(this,yt).isStale||!Xf(t))return;const r=n1(_(this,yt).dataUpdatedAt,t)+1;q(this,Po,setTimeout(()=>{_(this,yt).isStale||this.updateResult()},r))},np=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(_(this,xe)):this.options.refetchInterval)??!1},rp=function(t){se(this,_e,sp).call(this),q(this,Dr,t),!(Fo||vn(this.options.enabled,_(this,xe))===!1||!Xf(_(this,Dr))||_(this,Dr)===0)&&q(this,_o,setInterval(()=>{(this.options.refetchIntervalInBackground||ng.isFocused())&&se(this,_e,Us).call(this)},_(this,Dr)))},op=function(){se(this,_e,tp).call(this),se(this,_e,rp).call(this,se(this,_e,np).call(this))},ip=function(){_(this,Po)&&(clearTimeout(_(this,Po)),q(this,Po,void 0))},sp=function(){_(this,_o)&&(clearInterval(_(this,_o)),q(this,_o,void 0))},ap=function(){const t=_(this,Rt).getQueryCache().build(_(this,Rt),this.options);if(t===_(this,xe))return;const n=_(this,xe);q(this,xe,t),q(this,Aa,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},c1=function(t){qe.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(_(this,yt))}),_(this,Rt).getQueryCache().notify({query:_(this,xe),type:"observerResultsUpdated"})})},l0);function YM(e,t){return vn(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function ly(e,t){return YM(e,t)||e.state.data!==void 0&&lp(e,t,t.refetchOnMount)}function lp(e,t,n){if(vn(t.enabled,e)!==!1){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&rg(e,t)}return!1}function uy(e,t,n,r){return(e!==t||vn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&rg(e,n)}function rg(e,t){return vn(t.enabled,e)!==!1&&e.isStaleByTime(Ri(t.staleTime,e))}function XM(e,t){return!Du(e.getCurrentResult(),t)}function cy(e,t){return e.filter(n=>!t.includes(n))}function JM(e,t,n){const r=e.slice(0);return r[t]=n,r}var Bi,Xt,Vi,Hi,Ft,Ir,Na,ja,jt,up,cp,dp,fp,u0,ZM=(u0=class extends Ho{constructor(t,n,r){super();ne(this,jt);ne(this,Bi);ne(this,Xt);ne(this,Vi);ne(this,Hi);ne(this,Ft);ne(this,Ir);ne(this,Na);ne(this,ja);q(this,Bi,t),q(this,Hi,r),q(this,Vi,[]),q(this,Ft,[]),q(this,Xt,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&_(this,Ft).forEach(t=>{t.subscribe(n=>{se(this,jt,dp).call(this,t,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,_(this,Ft).forEach(t=>{t.destroy()})}setQueries(t,n,r){q(this,Vi,t),q(this,Hi,n),qe.batch(()=>{const o=_(this,Ft),i=se(this,jt,cp).call(this,_(this,Vi));i.forEach(u=>u.observer.setOptions(u.defaultedQueryOptions,r));const s=i.map(u=>u.observer),a=s.map(u=>u.getCurrentResult()),l=s.some((u,d)=>u!==o[d]);o.length===s.length&&!l||(q(this,Ft,s),q(this,Xt,a),this.hasListeners()&&(cy(o,s).forEach(u=>{u.destroy()}),cy(s,o).forEach(u=>{u.subscribe(d=>{se(this,jt,dp).call(this,u,d)})}),se(this,jt,fp).call(this)))})}getCurrentResult(){return _(this,Xt)}getQueries(){return _(this,Ft).map(t=>t.getCurrentQuery())}getObservers(){return _(this,Ft)}getOptimisticResult(t,n){const r=se(this,jt,cp).call(this,t),o=r.map(i=>i.observer.getOptimisticResult(i.defaultedQueryOptions));return[o,i=>se(this,jt,up).call(this,i??o,n),()=>r.map((i,s)=>{const a=o[s];return i.defaultedQueryOptions.notifyOnChangeProps?a:i.observer.trackResult(a,l=>{r.forEach(u=>{u.observer.trackProp(l)})})})]}},Bi=new WeakMap,Xt=new WeakMap,Vi=new WeakMap,Hi=new WeakMap,Ft=new WeakMap,Ir=new WeakMap,Na=new WeakMap,ja=new WeakMap,jt=new WeakSet,up=function(t,n){return n?((!_(this,Ir)||_(this,Xt)!==_(this,ja)||n!==_(this,Na))&&(q(this,Na,n),q(this,ja,_(this,Xt)),q(this,Ir,eg(_(this,Ir),n(t)))),_(this,Ir)):t},cp=function(t){const n=new Map(_(this,Ft).map(o=>[o.options.queryHash,o])),r=[];return t.forEach(o=>{const i=_(this,Bi).defaultQueryOptions(o),s=n.get(i.queryHash);if(s)r.push({defaultedQueryOptions:i,observer:s});else{const a=_(this,Ft).find(l=>l.options.queryHash===i.queryHash);r.push({defaultedQueryOptions:i,observer:a??new vc(_(this,Bi),i)})}}),r.sort((o,i)=>t.findIndex(s=>s.queryHash===o.defaultedQueryOptions.queryHash)-t.findIndex(s=>s.queryHash===i.defaultedQueryOptions.queryHash))},dp=function(t,n){const r=_(this,Ft).indexOf(t);r!==-1&&(q(this,Xt,JM(_(this,Xt),r,n)),se(this,jt,fp).call(this))},fp=function(){var t;if(this.hasListeners()){const n=_(this,Ir),r=se(this,jt,up).call(this,_(this,Xt),(t=_(this,Hi))==null?void 0:t.combine);n!==r&&qe.batch(()=>{this.listeners.forEach(o=>{o(_(this,Xt))})})}},u0),Fr,Lr,Et,Yn,or,Xl,pp,c0,eA=(c0=class extends Ho{constructor(n,r){super();ne(this,or);ne(this,Fr);ne(this,Lr);ne(this,Et);ne(this,Yn);q(this,Fr,n),this.setOptions(r),this.bindMethods(),se(this,or,Xl).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var o;const r=this.options;this.options=_(this,Fr).defaultMutationOptions(n),Du(this.options,r)||_(this,Fr).getMutationCache().notify({type:"observerOptionsUpdated",mutation:_(this,Et),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&Lo(r.mutationKey)!==Lo(this.options.mutationKey)?this.reset():((o=_(this,Et))==null?void 0:o.state.status)==="pending"&&_(this,Et).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=_(this,Et))==null||n.removeObserver(this)}onMutationUpdate(n){se(this,or,Xl).call(this),se(this,or,pp).call(this,n)}getCurrentResult(){return _(this,Lr)}reset(){var n;(n=_(this,Et))==null||n.removeObserver(this),q(this,Et,void 0),se(this,or,Xl).call(this),se(this,or,pp).call(this)}mutate(n,r){var o;return q(this,Yn,r),(o=_(this,Et))==null||o.removeObserver(this),q(this,Et,_(this,Fr).getMutationCache().build(_(this,Fr),this.options)),_(this,Et).addObserver(this),_(this,Et).execute(n)}},Fr=new WeakMap,Lr=new WeakMap,Et=new WeakMap,Yn=new WeakMap,or=new WeakSet,Xl=function(){var r;const n=((r=_(this,Et))==null?void 0:r.state)??u1();q(this,Lr,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},pp=function(n){qe.batch(()=>{var r,o,i,s,a,l,u,d;if(_(this,Yn)&&this.hasListeners()){const c=_(this,Lr).variables,f=_(this,Lr).context;(n==null?void 0:n.type)==="success"?((o=(r=_(this,Yn)).onSuccess)==null||o.call(r,n.data,c,f),(s=(i=_(this,Yn)).onSettled)==null||s.call(i,n.data,null,c,f)):(n==null?void 0:n.type)==="error"&&((l=(a=_(this,Yn)).onError)==null||l.call(a,n.error,c,f),(d=(u=_(this,Yn)).onSettled)==null||d.call(u,void 0,n.error,c,f))}this.listeners.forEach(c=>{c(_(this,Lr))})})},c0),d1=h.createContext(void 0),$a=e=>{const t=h.useContext(d1);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},tA=({client:e,children:t})=>(h.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),p.jsx(d1.Provider,{value:e,children:t})),f1=h.createContext(!1),p1=()=>h.useContext(f1);f1.Provider;function nA(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var rA=h.createContext(nA()),h1=()=>h.useContext(rA);function g1(e,t){return typeof e=="function"?e(...t):!!e}function m1(){}var v1=(e,t)=>{(e.suspense||e.throwOnError)&&(t.isReset()||(e.retryOnMount=!1))},y1=e=>{h.useEffect(()=>{e.clearReset()},[e])},w1=({result:e,errorResetBoundary:t,throwOnError:n,query:r})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&g1(n,[e.error,r]),oA=(e,t)=>t.state.data===void 0,x1=e=>{e.suspense&&(e.staleTime===void 0&&(e.staleTime=1e3),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3)))},S1=(e,t)=>e.isLoading&&e.isFetching&&!t,hp=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,Fu=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function dy({queries:e,...t},n){const r=$a(),o=p1(),i=h1(),s=h.useMemo(()=>e.map(y=>{const v=r.defaultQueryOptions(y);return v._optimisticResults=o?"isRestoring":"optimistic",v}),[e,r,o]);s.forEach(y=>{x1(y),v1(y,i)}),y1(i);const[a]=h.useState(()=>new ZM(r,s,t)),[l,u,d]=a.getOptimisticResult(s,t.combine);h.useSyncExternalStore(h.useCallback(y=>o?()=>{}:a.subscribe(qe.batchCalls(y)),[a,o]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),h.useEffect(()=>{a.setQueries(s,t,{listeners:!1})},[s,t,a]);const f=l.some((y,v)=>hp(s[v],y))?l.flatMap((y,v)=>{const S=s[v];if(S){const w=new vc(r,S);if(hp(S,y))return Fu(S,w,i);S1(y,o)&&Fu(S,w,i)}return[]}):[];if(f.length>0)throw Promise.all(f);const m=l.find((y,v)=>{const S=s[v];return S&&w1({result:y,errorResetBoundary:i,throwOnError:S.throwOnError,query:r.getQueryCache().get(S.queryHash)})});if(m!=null&&m.error)throw m.error;return u(d())}function C1(e,t,n){var d,c,f,m,y;const r=$a(),o=p1(),i=h1(),s=r.defaultQueryOptions(e);(c=(d=r.getDefaultOptions().queries)==null?void 0:d._experimental_beforeQuery)==null||c.call(d,s),s._optimisticResults=o?"isRestoring":"optimistic",x1(s),v1(s,i),y1(i);const a=!r.getQueryCache().get(s.queryHash),[l]=h.useState(()=>new t(r,s)),u=l.getOptimisticResult(s);if(h.useSyncExternalStore(h.useCallback(v=>{const S=o?()=>{}:l.subscribe(qe.batchCalls(v));return l.updateResult(),S},[l,o]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),h.useEffect(()=>{l.setOptions(s,{listeners:!1})},[s,l]),hp(s,u))throw Fu(s,l,i);if(w1({result:u,errorResetBoundary:i,throwOnError:s.throwOnError,query:r.getQueryCache().get(s.queryHash)}))throw u.error;if((m=(f=r.getDefaultOptions().queries)==null?void 0:f._experimental_afterQuery)==null||m.call(f,s,u),s.experimental_prefetchInRender&&!Fo&&S1(u,o)){const v=a?Fu(s,l,i):(y=r.getQueryCache().get(s.queryHash))==null?void 0:y.promise;v==null||v.catch(m1).finally(()=>{l.updateResult()})}return s.notifyOnChangeProps?u:l.trackResult(u)}function b1(e,t){return C1(e,vc)}function Ji(e,t){return C1({...e,enabled:!0,suspense:!0,throwOnError:oA,placeholderData:void 0},vc)}function Zs(e,t){const n=$a(),[r]=h.useState(()=>new eA(n,e));h.useEffect(()=>{r.setOptions(e)},[r,e]);const o=h.useSyncExternalStore(h.useCallback(s=>r.subscribe(qe.batchCalls(s)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),i=h.useCallback((s,a)=>{r.mutate(s,a).catch(m1)},[r]);if(o.error&&g1(r.options.throwOnError,[o.error]))throw o.error;return{...o,mutate:i,mutateAsync:o.mutate}}const Lu="aidbox-forms",R1=["openid fhirUser","profile","online_access","launch/patient","launch/questionnaire","launch/questionnaireresponse","user/Questionnaire.crus","patient/Patient.r","patient/QuestionnaireResponse.crus"],iA="https://form-builder.aidbox.app/fhir",er=Ou.client(iA),E1=h.createContext(null),sA=e=>{const t=window.location.pathname+window.location.hash;return Ou.oauth2.authorize({clientId:Lu,redirectUri:t,...e})},Ko=()=>{const e=h.useContext(E1);if(!e)throw new Error("No client found in the context");return e},aA=({children:e})=>{const{searchParams:t}=new URL(window.location),{data:n}=Ji({queryKey:["client"],queryFn:()=>{const r=window.location.pathname+window.location.hash;return t.has("error")||t.has("error_description")?Ou.oauth2.ready({clientId:Lu,redirectUri:r}).catch(o=>{throw sessionStorage.clear(),o}):Ou.oauth2.init({clientId:Lu,scope:R1.join(" "),redirectUri:r})},retry:!1});return p.jsx(E1.Provider,{value:n,children:e})},fy=async(e,t)=>{var o;const{fhirContext:n}=(o=e==null?void 0:e.state)==null?void 0:o.tokenResponse,[r]=n==null?void 0:n.filter(({reference:i})=>{if(i.startsWith(`${t}/`))return i.split("/")[1]});if(r)return(t==="Questionnaire"?er:e).request(`${t}/${r}`);throw new Error(`No ${t} in the launch context`)},lA=async e=>{const[t,n,r,o,i]=await Promise.allSettled([e.patient.read(),e.encounter.read(),e.user.read(),fy(e,"Questionnaire"),fy(e,"QuestionnaireResponse")]);if(r.status==="rejected")throw r.reason;return{patient:t.status==="fulfilled"?t.value:null,encounter:n.status==="fulfilled"?n.value:null,user:r.value,questionnaire:o.status==="fulfilled"?o.value:null,questionnaireResponse:i.status==="fulfilled"?i.value:null}},P1=h.createContext(null),Go=()=>{const e=h.useContext(P1);if(!e)throw new Error("No launch context found in the context");return e},uA=({children:e})=>{const t=Ko(),{data:n}=Ji({queryKey:["launch-context"],queryFn:()=>lA(t)});return p.jsx(P1.Provider,{value:n,children:e})};function _1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;t{const t=pA(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:s=>{const a=s.split(og);return a[0]===""&&a.length!==1&&a.shift(),T1(a,t)||fA(s)},getConflictingClassGroupIds:(s,a)=>{const l=n[s]||[];return a&&r[s]?[...l,...r[s]]:l}}},T1=(e,t)=>{var s;if(e.length===0)return t.classGroupId;const n=e[0],r=t.nextPart.get(n),o=r?T1(e.slice(1),r):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(og);return(s=t.validators.find(({validator:a})=>a(i)))==null?void 0:s.classGroupId},py=/^\[(.+)\]$/,fA=e=>{if(py.test(e)){const t=py.exec(e)[1],n=t==null?void 0:t.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},pA=e=>{const{theme:t,prefix:n}=e,r={nextPart:new Map,validators:[]};return gA(Object.entries(e.classGroups),n).forEach(([i,s])=>{gp(s,r,i,t)}),r},gp=(e,t,n,r)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:hy(t,o);i.classGroupId=n;return}if(typeof o=="function"){if(hA(o)){gp(o(r),t,n,r);return}t.validators.push({validator:o,classGroupId:n});return}Object.entries(o).forEach(([i,s])=>{gp(s,hy(t,i),n,r)})})},hy=(e,t)=>{let n=e;return t.split(og).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},hA=e=>e.isThemeGetter,gA=(e,t)=>t?e.map(([n,r])=>{const o=r.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([s,a])=>[t+s,a])):i);return[n,o]}):e,mA=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,r=new Map;const o=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,r=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=r.get(i))!==void 0)return o(i,s),s},set(i,s){n.has(i)?n.set(i,s):o(i,s)}}},M1="!",vA=e=>{const{separator:t,experimentalParseClassName:n}=e,r=t.length===1,o=t[0],i=t.length,s=a=>{const l=[];let u=0,d=0,c;for(let S=0;Sd?c-d:void 0;return{modifiers:l,hasImportantModifier:m,baseClassName:y,maybePostfixModifierPosition:v}};return n?a=>n({className:a,parseClassName:s}):s},yA=e=>{if(e.length<=1)return e;const t=[];let n=[];return e.forEach(r=>{r[0]==="["?(t.push(...n.sort(),r),n=[]):n.push(r)}),t.push(...n.sort()),t},wA=e=>({cache:mA(e.cacheSize),parseClassName:vA(e),...dA(e)}),xA=/\s+/,SA=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:o}=t,i=[],s=e.trim().split(xA);let a="";for(let l=s.length-1;l>=0;l-=1){const u=s[l],{modifiers:d,hasImportantModifier:c,baseClassName:f,maybePostfixModifierPosition:m}=n(u);let y=!!m,v=r(y?f.substring(0,m):f);if(!v){if(!y){a=u+(a.length>0?" "+a:a);continue}if(v=r(f),!v){a=u+(a.length>0?" "+a:a);continue}y=!1}const S=yA(d).join(":"),w=c?S+M1:S,g=w+v;if(i.includes(g))continue;i.push(g);const x=o(v,y);for(let C=0;C0?" "+a:a)}return a};function CA(){let e=0,t,n,r="";for(;e{if(typeof e=="string")return e;let t,n="";for(let r=0;rc(d),e());return n=wA(u),r=n.cache.get,o=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=SA(l,n);return o(l,d),d}return function(){return i(CA.apply(null,arguments))}}const je=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},k1=/^\[(?:([a-z-]+):)?(.+)\]$/i,RA=/^\d+\/\d+$/,EA=new Set(["px","full","screen"]),PA=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_A=/\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$/,TA=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,MA=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,AA=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Kn=e=>Ei(e)||EA.has(e)||RA.test(e),yr=e=>us(e,"length",LA),Ei=e=>!!e&&!Number.isNaN(Number(e)),Pd=e=>us(e,"number",Ei),As=e=>!!e&&Number.isInteger(Number(e)),kA=e=>e.endsWith("%")&&Ei(e.slice(0,-1)),fe=e=>k1.test(e),wr=e=>PA.test(e),NA=new Set(["length","size","percentage"]),jA=e=>us(e,NA,N1),OA=e=>us(e,"position",N1),DA=new Set(["image","url"]),IA=e=>us(e,DA,UA),FA=e=>us(e,"",$A),ks=()=>!0,us=(e,t,n)=>{const r=k1.exec(e);return r?r[1]?typeof t=="string"?r[1]===t:t.has(r[1]):n(r[2]):!1},LA=e=>_A.test(e)&&!TA.test(e),N1=()=>!1,$A=e=>MA.test(e),UA=e=>AA.test(e),zA=()=>{const e=je("colors"),t=je("spacing"),n=je("blur"),r=je("brightness"),o=je("borderColor"),i=je("borderRadius"),s=je("borderSpacing"),a=je("borderWidth"),l=je("contrast"),u=je("grayscale"),d=je("hueRotate"),c=je("invert"),f=je("gap"),m=je("gradientColorStops"),y=je("gradientColorStopPositions"),v=je("inset"),S=je("margin"),w=je("opacity"),g=je("padding"),x=je("saturate"),C=je("scale"),P=je("sepia"),b=je("skew"),A=je("space"),T=je("translate"),$=()=>["auto","contain","none"],E=()=>["auto","hidden","clip","visible","scroll"],O=()=>["auto",fe,t],F=()=>[fe,t],L=()=>["",Kn,yr],R=()=>["auto",Ei,fe],M=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],j=()=>["solid","dashed","dotted","double","none"],B=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],N=()=>["","0",fe],V=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Q=()=>[Ei,fe];return{cacheSize:500,separator:":",theme:{colors:[ks],spacing:[Kn,yr],blur:["none","",wr,fe],brightness:Q(),borderColor:[e],borderRadius:["none","","full",wr,fe],borderSpacing:F(),borderWidth:L(),contrast:Q(),grayscale:N(),hueRotate:Q(),invert:N(),gap:F(),gradientColorStops:[e],gradientColorStopPositions:[kA,yr],inset:O(),margin:O(),opacity:Q(),padding:F(),saturate:Q(),scale:Q(),sepia:N(),skew:Q(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",fe]}],container:["container"],columns:[{columns:[wr]}],"break-after":[{"break-after":V()}],"break-before":[{"break-before":V()}],"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"],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:[...M(),fe]}],overflow:[{overflow:E()}],"overflow-x":[{"overflow-x":E()}],"overflow-y":[{"overflow-y":E()}],overscroll:[{overscroll:$()}],"overscroll-x":[{"overscroll-x":$()}],"overscroll-y":[{"overscroll-y":$()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[v]}],"inset-x":[{"inset-x":[v]}],"inset-y":[{"inset-y":[v]}],start:[{start:[v]}],end:[{end:[v]}],top:[{top:[v]}],right:[{right:[v]}],bottom:[{bottom:[v]}],left:[{left:[v]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",As,fe]}],basis:[{basis:O()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",fe]}],grow:[{grow:N()}],shrink:[{shrink:N()}],order:[{order:["first","last","none",As,fe]}],"grid-cols":[{"grid-cols":[ks]}],"col-start-end":[{col:["auto",{span:["full",As,fe]},fe]}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":[ks]}],"row-start-end":[{row:["auto",{span:[As,fe]},fe]}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[g]}],px:[{px:[g]}],py:[{py:[g]}],ps:[{ps:[g]}],pe:[{pe:[g]}],pt:[{pt:[g]}],pr:[{pr:[g]}],pb:[{pb:[g]}],pl:[{pl:[g]}],m:[{m:[S]}],mx:[{mx:[S]}],my:[{my:[S]}],ms:[{ms:[S]}],me:[{me:[S]}],mt:[{mt:[S]}],mr:[{mr:[S]}],mb:[{mb:[S]}],ml:[{ml:[S]}],"space-x":[{"space-x":[A]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[A]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fe,t]}],"min-w":[{"min-w":[fe,t,"min","max","fit"]}],"max-w":[{"max-w":[fe,t,"none","full","min","max","fit","prose",{screen:[wr]},wr]}],h:[{h:[fe,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fe,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fe,t,"auto","min","max","fit"]}],"font-size":[{text:["base",wr,yr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",Pd]}],"font-family":[{font:[ks]}],"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-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",fe]}],"line-clamp":[{"line-clamp":["none",Ei,Pd]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Kn,fe]}],"list-image":[{"list-image":["none",fe]}],"list-style-type":[{list:["none","disc","decimal",fe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[w]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[w]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...j(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Kn,yr]}],"underline-offset":[{"underline-offset":["auto",Kn,fe]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[w]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...M(),OA]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",jA]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},IA]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[y]}],"gradient-via-pos":[{via:[y]}],"gradient-to-pos":[{to:[y]}],"gradient-from":[{from:[m]}],"gradient-via":[{via:[m]}],"gradient-to":[{to:[m]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[w]}],"border-style":[{border:[...j(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[w]}],"divide-style":[{divide:j()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...j()]}],"outline-offset":[{"outline-offset":[Kn,fe]}],"outline-w":[{outline:[Kn,yr]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:L()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[w]}],"ring-offset-w":[{"ring-offset":[Kn,yr]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",wr,FA]}],"shadow-color":[{shadow:[ks]}],opacity:[{opacity:[w]}],"mix-blend":[{"mix-blend":[...B(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":B()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",wr,fe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[c]}],saturate:[{saturate:[x]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[c]}],"backdrop-opacity":[{"backdrop-opacity":[w]}],"backdrop-saturate":[{"backdrop-saturate":[x]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[s]}],"border-spacing-x":[{"border-spacing-x":[s]}],"border-spacing-y":[{"border-spacing-y":[s]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",fe]}],duration:[{duration:Q()}],ease:[{ease:["linear","in","out","in-out",fe]}],delay:[{delay:Q()}],animate:[{animate:["none","spin","ping","pulse","bounce",fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[C]}],"scale-x":[{"scale-x":[C]}],"scale-y":[{"scale-y":[C]}],rotate:[{rotate:[As,fe]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[b]}],"skew-y":[{"skew-y":[b]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",fe]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],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",fe]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"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",fe]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Kn,yr,Pd]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","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","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","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-s","border-w-e","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-s","border-color-e","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"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","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-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"]}}},BA=bA(zA);function G(...e){return BA(cA(e))}function cs(e){var t,n;if(e){if(e!=null&&e[0].text)return`${e==null?void 0:e[0].text}`;{const r=((t=e==null?void 0:e[0].prefix)==null?void 0:t[0])??"",o=((n=e==null?void 0:e[0].given)==null?void 0:n[0])??"",i=(e==null?void 0:e[0].family)??"";return`${r} ${o} ${i}`.replace(/\s+/g," ").trim()}}else return"Unknown"}const VA=e=>{var s;const t=((s=e[0].line)==null?void 0:s[0])??"",n=e[0].city??"",r=e[0].state??"",o=e[0].postalCode??"",i=e[0].country??"";return`${t}, ${n}, ${r} ${o}, ${i}`};function HA(e){return e?e.charAt(0).toUpperCase()+e.slice(1):"unknown"}function KA(e){const[t,n]=cs(e).split(" ");return n?`${t.charAt(0)}${n.charAt(0)}`.toUpperCase():t.substring(0,2).toUpperCase()}function GA(e,t){e=Math.max(1,Math.min(e,t));const i=e>1,s=e1||l1&&a--,l1,c=l2,m=lyy>e),showLastEllipsis:m,showLastPageButton:c,nextButtonEnabled:s}}async function WA({questionnaire:e,subject:t,encounter:n,author:r}){const{parameter:[{resource:o}]}=await er.request({url:"Questionnaire/$populate",method:"POST",headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify({resourceType:"Parameters",parameter:[{name:"questionnaire",resource:e},{name:"subject",resource:t},{name:"context",part:[...n?[{name:"name",valueString:"encounter"},{name:"content",resource:n}]:[],...r?[{name:"name",valueString:"author"},{name:"content",resource:r}]:[]]}]})});return o}function j1(e,t,n){let r="QuestionnaireResponse",o="POST";return n.id&&(r+=`/${n.id}`,o="PUT"),e.request({url:r,method:o,headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify({...n,questionnaire:n.questionnaire||(t.url?t.url:`Questionnaire/${t.id}`),meta:{...n.meta,source:"https://aidbox.github.io/examples/aidbox-forms-smart-launch"}})})}function O1(e,t){let n="Questionnaire",r="POST";return t.id&&(n+=`/${t.id}`,r="PUT"),e.request({url:n,method:r,headers:{"Content-Type":"application/fhir+json"},body:JSON.stringify(t)})}function qA(e,t){return e.request({url:`Questionnaire/${t.id}`,method:"DELETE"})}async function QA({client:e,questionnaire:t,subject:n,encounter:r,author:o}){const i=await WA({questionnaire:t,subject:n,encounter:r,author:o});return j1(e,t,i)}function gy({launchUrl:e,launchType:t,fhirVersion:n}){const r=["provider-ehr","patient-portal","provider-standalone","patient-standalone","backend-service"],o=new URLSearchParams;return o.set("fhir_version",n||"r4"),o.set("launch_url",e.toString()),o.set("launch",btoa(JSON.stringify([r.indexOf(t)]))),`https://launch.smarthealthit.org/?${o.toString()}`}function _d(e){var n,r;const t=e.resourceType==="Bundle"?(r=(n=e.entry)==null?void 0:n[0])==null?void 0:r.resource:e;if(!t)throw new Error("Resource not found");return t}async function D1(e,t){const n=t.startsWith("http")?`Questionnaire?url=${t.replace(/\|.*$/,"")}`:`Questionnaire/${t.replace(/^Questionnaire\//,"")}`;return Promise.any([er.request(n).then(r=>[er,_d(r)]),e.request(n).then(r=>[e,_d(r)]),er.request(t).then(r=>[er,_d(r)])])}async function ig(e,t){return D1(e,t).then(([,n])=>n)}function YA(){const{user:e}=Go();return p.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[p.jsxs("h1",{className:"mb-4 text-2xl font-bold",children:["Welcome, ",cs(e.name)]}),p.jsx("div",{className:"text-muted-foreground",children:e.resourceType==="Patient"?p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{children:"This is a demo patient portal dashboard. Currently, only the questionnaire and questionnaire response functionalities are available."}),p.jsx("p",{children:"In a fully functional version, you could:"}),p.jsxs("ul",{className:"list-disc ml-6",children:[p.jsx("li",{children:"View and manage your upcoming appointments."}),p.jsx("li",{children:"Access your medical records, including lab results, diagnoses, and treatment history."}),p.jsx("li",{children:"Communicate securely with your healthcare providers."}),p.jsx("li",{children:"Maintain and update your personal health information."}),p.jsx("li",{children:"Explore educational resources related to your health conditions and treatments."})]}),p.jsx("p",{children:"For now, you can explore and submit/amend your responses."})]}):p.jsxs("div",{className:"space-y-2",children:[p.jsx("p",{children:"This is a demo practitioner EHR dashboard. Currently, only the questionnaire and questionnaire response functionalities are available."}),p.jsx("p",{children:"In a fully functional version, you could:"}),p.jsxs("ul",{className:"list-disc ml-6",children:[p.jsx("li",{children:"Access and manage patient records."}),p.jsx("li",{children:"Schedule and manage patient appointments."}),p.jsx("li",{children:"Review lab results and other diagnostic information."}),p.jsx("li",{children:"Prescribe medications and generate referrals."}),p.jsx("li",{children:"Communicate with patients and other healthcare professionals."}),p.jsx("li",{children:"Generate reports and analyze data."})]}),p.jsx("p",{children:"For now, you can create and manage questionnaires, and review patient responses."})]})})]})}function XA(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function yc(...e){return t=>e.forEach(n=>XA(n,t))}function Le(...e){return h.useCallback(yc(...e),e)}var un=h.forwardRef((e,t)=>{const{children:n,...r}=e,o=h.Children.toArray(n),i=o.find(JA);if(i){const s=i.props.children,a=o.map(l=>l===i?h.Children.count(s)>1?h.Children.only(null):h.isValidElement(s)?s.props.children:null:l);return p.jsx(mp,{...r,ref:t,children:h.isValidElement(s)?h.cloneElement(s,void 0,a):null})}return p.jsx(mp,{...r,ref:t,children:n})});un.displayName="Slot";var mp=h.forwardRef((e,t)=>{const{children:n,...r}=e;if(h.isValidElement(n)){const o=ek(n);return h.cloneElement(n,{...ZA(r,n.props),ref:t?yc(t,o):o})}return h.Children.count(n)>1?h.Children.only(null):null});mp.displayName="SlotClone";var sg=({children:e})=>p.jsx(p.Fragment,{children:e});function JA(e){return h.isValidElement(e)&&e.type===sg}function ZA(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...a)=>{i(...a),o(...a)}:o&&(n[r]=o):r==="style"?n[r]={...o,...i}:r==="className"&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}function ek(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function I1(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;ttypeof e=="boolean"?"".concat(e):e===0?"0":e,vy=tk,Ua=(e,t)=>n=>{var r;if((t==null?void 0:t.variants)==null)return vy(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:o,defaultVariants:i}=t,s=Object.keys(o).map(u=>{const d=n==null?void 0:n[u],c=i==null?void 0:i[u];if(d===null)return null;const f=my(d)||my(c);return o[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[c,f]=d;return f===void 0||(u[c]=f),u},{}),l=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:c,className:f,...m}=d;return Object.entries(m).every(y=>{let[v,S]=y;return Array.isArray(S)?S.includes({...i,...a}[v]):{...i,...a}[v]===S})?[...u,c,f]:u},[]);return vy(e,s,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const nk=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),F1=(...e)=>e.filter((t,n,r)=>!!t&&r.indexOf(t)===n).join(" ");/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */var rk={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"};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ok=h.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:s,...a},l)=>h.createElement("svg",{ref:l,...rk,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:F1("lucide",o),...a},[...s.map(([u,d])=>h.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ve=(e,t)=>{const n=h.forwardRef(({className:r,...o},i)=>h.createElement(ok,{ref:i,iconNode:t,className:F1(`lucide-${nk(e)}`,r),...o}));return n.displayName=`${e}`,n};/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ik=Ve("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const L1=Ve("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const sk=Ve("ChevronsUpDown",[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ak=Ve("ClipboardList",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ag=Ve("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lg=Ve("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const lk=Ve("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const uk=Ve("FileQuestion",[["path",{d:"M12 17h.01",key:"p32p05"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}],["path",{d:"M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3",key:"mhlwft"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const ck=Ve("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const dk=Ve("Import",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m8 11 4 4 4-4",key:"1dohi6"}],["path",{d:"M8 5H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V7a2 2 0 0 0-2-2h-4",key:"1ywtjm"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const fk=Ve("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const pk=Ve("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const hk=Ve("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const gk=Ve("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const mk=Ve("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const vk=Ve("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const yk=Ve("SquareMenu",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 8h10",key:"1jw688"}],["path",{d:"M7 12h10",key:"b7w52i"}],["path",{d:"M7 16h10",key:"wp8him"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const $1=Ve("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const wk=Ve("Stethoscope",[["path",{d:"M11 2v2",key:"1539x4"}],["path",{d:"M5 2v2",key:"1yf1q8"}],["path",{d:"M5 3H4a2 2 0 0 0-2 2v4a6 6 0 0 0 12 0V5a2 2 0 0 0-2-2h-1",key:"rb5t3r"}],["path",{d:"M8 15a6 6 0 0 0 12 0v-3",key:"x18d4x"}],["circle",{cx:"20",cy:"10",r:"2",key:"ts1r5v"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const xk=Ve("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Sk=Ve("UserPen",[["path",{d:"M11.5 15H7a4 4 0 0 0-4 4v2",key:"15lzij"}],["path",{d:"M21.378 16.626a1 1 0 0 0-3.004-3.004l-4.01 4.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"1817ys"}],["circle",{cx:"10",cy:"7",r:"4",key:"e45bow"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const Ck=Ve("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/** - * @license lucide-react v0.453.0 - ISC - * - * This source code is licensed under the ISC license. - * See the LICENSE file in the root directory of this source tree. - */const bk=Ve("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]),Td=768;function Rk(){const[e,t]=h.useState(void 0);return h.useEffect(()=>{const n=window.matchMedia(`(max-width: ${Td-1}px)`),r=()=>{t(window.innerWidthn.removeEventListener("change",r)},[]),!!e}const wc=Ua("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_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"}}),Tt=h.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...o},i)=>{const s=r?un:"button";return p.jsx(s,{className:G(wc({variant:t,size:n,className:e})),ref:i,...o})});Tt.displayName="Button";const xc=h.forwardRef(({className:e,type:t,...n},r)=>p.jsx("input",{type:t,className:G("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm 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",e),ref:r,...n}));xc.displayName="Input";var Ek=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],de=Ek.reduce((e,t)=>{const n=h.forwardRef((r,o)=>{const{asChild:i,...s}=r,a=i?un:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),p.jsx(a,{...s,ref:o})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function ug(e,t){e&&is.flushSync(()=>e.dispatchEvent(t))}var Pk="Separator",yy="horizontal",_k=["horizontal","vertical"],U1=h.forwardRef((e,t)=>{const{decorative:n,orientation:r=yy,...o}=e,i=Tk(r)?r:yy,a=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return p.jsx(de.div,{"data-orientation":i,...a,...o,ref:t})});U1.displayName=Pk;function Tk(e){return _k.includes(e)}var z1=U1;const B1=h.forwardRef(({className:e,orientation:t="horizontal",decorative:n=!0,...r},o)=>p.jsx(z1,{ref:o,decorative:n,orientation:t,className:G("shrink-0 bg-border",t==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",e),...r}));B1.displayName=z1.displayName;function re(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e==null||e(o),n===!1||!o.defaultPrevented)return t==null?void 0:t(o)}}function Mk(e,t){const n=h.createContext(t),r=i=>{const{children:s,...a}=i,l=h.useMemo(()=>a,Object.values(a));return p.jsx(n.Provider,{value:l,children:s})};r.displayName=e+"Provider";function o(i){const s=h.useContext(n);if(s)return s;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function pr(e,t=[]){let n=[];function r(i,s){const a=h.createContext(s),l=n.length;n=[...n,s];const u=c=>{var w;const{scope:f,children:m,...y}=c,v=((w=f==null?void 0:f[e])==null?void 0:w[l])||a,S=h.useMemo(()=>y,Object.values(y));return p.jsx(v.Provider,{value:S,children:m})};u.displayName=i+"Provider";function d(c,f){var v;const m=((v=f==null?void 0:f[e])==null?void 0:v[l])||a,y=h.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return[u,d]}const o=()=>{const i=n.map(s=>h.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,Ak(o,...t)]}function Ak(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Cn=globalThis!=null&&globalThis.document?h.useLayoutEffect:()=>{},kk=C0.useId||(()=>{}),Nk=0;function rr(e){const[t,n]=h.useState(kk());return Cn(()=>{e||n(r=>r??String(Nk++))},[e]),e||(t?`radix-${t}`:"")}function mt(e){const t=h.useRef(e);return h.useEffect(()=>{t.current=e}),h.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function Wo({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=jk({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=mt(n),l=h.useCallback(u=>{if(i){const c=typeof u=="function"?u(e):u;c!==e&&a(c)}else o(u)},[i,e,o,a]);return[s,l]}function jk({defaultProp:e,onChange:t}){const n=h.useState(e),[r]=n,o=h.useRef(r),i=mt(t);return h.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Ok(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e);h.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Dk="DismissableLayer",vp="dismissableLayer.update",Ik="dismissableLayer.pointerDownOutside",Fk="dismissableLayer.focusOutside",wy,V1=h.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),za=h.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:s,onDismiss:a,...l}=e,u=h.useContext(V1),[d,c]=h.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,m]=h.useState({}),y=Le(t,A=>c(A)),v=Array.from(u.layers),[S]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),w=v.indexOf(S),g=d?v.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,C=g>=w,P=$k(A=>{const T=A.target,$=[...u.branches].some(E=>E.contains(T));!C||$||(o==null||o(A),s==null||s(A),A.defaultPrevented||a==null||a())},f),b=Uk(A=>{const T=A.target;[...u.branches].some(E=>E.contains(T))||(i==null||i(A),s==null||s(A),A.defaultPrevented||a==null||a())},f);return Ok(A=>{g===u.layers.size-1&&(r==null||r(A),!A.defaultPrevented&&a&&(A.preventDefault(),a()))},f),h.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(wy=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),xy(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=wy)}},[d,f,n,u]),h.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),xy())},[d,u]),h.useEffect(()=>{const A=()=>m({});return document.addEventListener(vp,A),()=>document.removeEventListener(vp,A)},[]),p.jsx(de.div,{...l,ref:y,style:{pointerEvents:x?C?"auto":"none":void 0,...e.style},onFocusCapture:re(e.onFocusCapture,b.onFocusCapture),onBlurCapture:re(e.onBlurCapture,b.onBlurCapture),onPointerDownCapture:re(e.onPointerDownCapture,P.onPointerDownCapture)})});za.displayName=Dk;var Lk="DismissableLayerBranch",H1=h.forwardRef((e,t)=>{const n=h.useContext(V1),r=h.useRef(null),o=Le(t,r);return h.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),p.jsx(de.div,{...e,ref:o})});H1.displayName=Lk;function $k(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=h.useRef(!1),o=h.useRef(()=>{});return h.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){K1(Ik,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=l,t.addEventListener("click",o.current,{once:!0})):l()}else t.removeEventListener("click",o.current);r.current=!1},s=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(s),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Uk(e,t=globalThis==null?void 0:globalThis.document){const n=mt(e),r=h.useRef(!1);return h.useEffect(()=>{const o=i=>{i.target&&!r.current&&K1(Fk,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function xy(){const e=new CustomEvent(vp);document.dispatchEvent(e)}function K1(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ug(o,i):o.dispatchEvent(i)}var zk=za,Bk=H1,Md="focusScope.autoFocusOnMount",Ad="focusScope.autoFocusOnUnmount",Sy={bubbles:!1,cancelable:!0},Vk="FocusScope",cg=h.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...s}=e,[a,l]=h.useState(null),u=mt(o),d=mt(i),c=h.useRef(null),f=Le(t,v=>l(v)),m=h.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;h.useEffect(()=>{if(r){let v=function(x){if(m.paused||!a)return;const C=x.target;a.contains(C)?c.current=C:br(c.current,{select:!0})},S=function(x){if(m.paused||!a)return;const C=x.relatedTarget;C!==null&&(a.contains(C)||br(c.current,{select:!0}))},w=function(x){if(document.activeElement===document.body)for(const P of x)P.removedNodes.length>0&&br(a)};document.addEventListener("focusin",v),document.addEventListener("focusout",S);const g=new MutationObserver(w);return a&&g.observe(a,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",S),g.disconnect()}}},[r,a,m.paused]),h.useEffect(()=>{if(a){by.add(m);const v=document.activeElement;if(!a.contains(v)){const w=new CustomEvent(Md,Sy);a.addEventListener(Md,u),a.dispatchEvent(w),w.defaultPrevented||(Hk(Qk(G1(a)),{select:!0}),document.activeElement===v&&br(a))}return()=>{a.removeEventListener(Md,u),setTimeout(()=>{const w=new CustomEvent(Ad,Sy);a.addEventListener(Ad,d),a.dispatchEvent(w),w.defaultPrevented||br(v??document.body,{select:!0}),a.removeEventListener(Ad,d),by.remove(m)},0)}}},[a,u,d,m]);const y=h.useCallback(v=>{if(!n&&!r||m.paused)return;const S=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,w=document.activeElement;if(S&&w){const g=v.currentTarget,[x,C]=Kk(g);x&&C?!v.shiftKey&&w===C?(v.preventDefault(),n&&br(x,{select:!0})):v.shiftKey&&w===x&&(v.preventDefault(),n&&br(C,{select:!0})):w===g&&v.preventDefault()}},[n,r,m.paused]);return p.jsx(de.div,{tabIndex:-1,...s,ref:f,onKeyDown:y})});cg.displayName=Vk;function Hk(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(br(r,{select:t}),document.activeElement!==n)return}function Kk(e){const t=G1(e),n=Cy(t,e),r=Cy(t.reverse(),e);return[n,r]}function G1(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Cy(e,t){for(const n of e)if(!Gk(n,{upTo:t}))return n}function Gk(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Wk(e){return e instanceof HTMLInputElement&&"select"in e}function br(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Wk(e)&&t&&e.select()}}var by=qk();function qk(){let e=[];return{add(t){const n=e[0];t!==n&&(n==null||n.pause()),e=Ry(e,t),e.unshift(t)},remove(t){var n;e=Ry(e,t),(n=e[0])==null||n.resume()}}}function Ry(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Qk(e){return e.filter(t=>t.tagName!=="A")}var Yk="Portal",Ba=h.forwardRef((e,t)=>{var a;const{container:n,...r}=e,[o,i]=h.useState(!1);Cn(()=>i(!0),[]);const s=n||o&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return s?Ex.createPortal(p.jsx(de.div,{...r,ref:t}),s):null});Ba.displayName=Yk;function Xk(e,t){return h.useReducer((n,r)=>t[n][r]??n,e)}var Qt=e=>{const{present:t,children:n}=e,r=Jk(t),o=typeof n=="function"?n({present:r.isPresent}):h.Children.only(n),i=Le(r.ref,Zk(o));return typeof n=="function"||r.isPresent?h.cloneElement(o,{ref:i}):null};Qt.displayName="Presence";function Jk(e){const[t,n]=h.useState(),r=h.useRef({}),o=h.useRef(e),i=h.useRef("none"),s=e?"mounted":"unmounted",[a,l]=Xk(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return h.useEffect(()=>{const u=Pl(r.current);i.current=a==="mounted"?u:"none"},[a]),Cn(()=>{const u=r.current,d=o.current;if(d!==e){const f=i.current,m=Pl(u);e?l("MOUNT"):m==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&f!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,l]),Cn(()=>{if(t){let u;const d=t.ownerDocument.defaultView??window,c=m=>{const v=Pl(r.current).includes(m.animationName);if(m.target===t&&v&&(l("ANIMATION_END"),!o.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",u=d.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},f=m=>{m.target===t&&(i.current=Pl(r.current))};return t.addEventListener("animationstart",f),t.addEventListener("animationcancel",c),t.addEventListener("animationend",c),()=>{d.clearTimeout(u),t.removeEventListener("animationstart",f),t.removeEventListener("animationcancel",c),t.removeEventListener("animationend",c)}}else l("ANIMATION_END")},[t,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:h.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function Pl(e){return(e==null?void 0:e.animationName)||"none"}function Zk(e){var r,o;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var kd=0;function W1(){h.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Ey()),document.body.insertAdjacentElement("beforeend",e[1]??Ey()),kd++,()=>{kd===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),kd--}},[])}function Ey(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Fn=function(){return Fn=Object.assign||function(t){for(var n,r=1,o=arguments.length;r0)&&!(o=r.next()).done;)i.push(o.value)}catch(a){s={error:a}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(s)throw s.error}}return i}function Y1(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r"u")return gN;var t=mN(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])}},yN=Z1(),Pi="data-scroll-locked",wN=function(e,t,n,r){var o=e.left,i=e.top,s=e.right,a=e.gap;return n===void 0&&(n="margin"),` - .`.concat(eN,` { - overflow: hidden `).concat(r,`; - padding-right: `).concat(a,"px ").concat(r,`; - } - body[`).concat(Pi,`] { - overflow: hidden `).concat(r,`; - overscroll-behavior: contain; - `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` - padding-left: `.concat(o,`px; - padding-top: `).concat(i,`px; - padding-right: `).concat(s,`px; - margin-left:0; - margin-top:0; - margin-right: `).concat(a,"px ").concat(r,`; - `),n==="padding"&&"padding-right: ".concat(a,"px ").concat(r,";")].filter(Boolean).join(""),` - } - - .`).concat(Jl,` { - right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Zl,` { - margin-right: `).concat(a,"px ").concat(r,`; - } - - .`).concat(Jl," .").concat(Jl,` { - right: 0 `).concat(r,`; - } - - .`).concat(Zl," .").concat(Zl,` { - margin-right: 0 `).concat(r,`; - } - - body[`).concat(Pi,`] { - `).concat(tN,": ").concat(a,`px; - } -`)},_y=function(){var e=parseInt(document.body.getAttribute(Pi)||"0",10);return isFinite(e)?e:0},xN=function(){h.useEffect(function(){return document.body.setAttribute(Pi,(_y()+1).toString()),function(){var e=_y()-1;e<=0?document.body.removeAttribute(Pi):document.body.setAttribute(Pi,e.toString())}},[])},SN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;xN();var i=h.useMemo(function(){return vN(o)},[o]);return h.createElement(yN,{styles:wN(i,!t,o,n?"":"!important")})},yp=!1;if(typeof window<"u")try{var _l=Object.defineProperty({},"passive",{get:function(){return yp=!0,!0}});window.addEventListener("test",_l,_l),window.removeEventListener("test",_l,_l)}catch{yp=!1}var ni=yp?{passive:!1}:!1,CN=function(e){return e.tagName==="TEXTAREA"},eS=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!CN(e)&&n[t]==="visible")},bN=function(e){return eS(e,"overflowY")},RN=function(e){return eS(e,"overflowX")},Ty=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=tS(e,r);if(o){var i=nS(e,r),s=i[1],a=i[2];if(s>a)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},EN=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},PN=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tS=function(e,t){return e==="v"?bN(t):RN(t)},nS=function(e,t){return e==="v"?EN(t):PN(t)},_N=function(e,t){return e==="h"&&t==="rtl"?-1:1},TN=function(e,t,n,r,o){var i=_N(e,window.getComputedStyle(t).direction),s=i*r,a=n.target,l=t.contains(a),u=!1,d=s>0,c=0,f=0;do{var m=nS(e,a),y=m[0],v=m[1],S=m[2],w=v-S-i*y;(y||w)&&tS(e,a)&&(c+=w,f+=y),a instanceof ShadowRoot?a=a.host:a=a.parentNode}while(!l&&a!==document.body||l&&(t.contains(a)||t===a));return(d&&(Math.abs(c)<1||!o)||!d&&(Math.abs(f)<1||!o))&&(u=!0),u},Tl=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},My=function(e){return[e.deltaX,e.deltaY]},Ay=function(e){return e&&"current"in e?e.current:e},MN=function(e,t){return e[0]===t[0]&&e[1]===t[1]},AN=function(e){return` - .block-interactivity-`.concat(e,` {pointer-events: none;} - .allow-interactivity-`).concat(e,` {pointer-events: all;} -`)},kN=0,ri=[];function NN(e){var t=h.useRef([]),n=h.useRef([0,0]),r=h.useRef(),o=h.useState(kN++)[0],i=h.useState(Z1)[0],s=h.useRef(e);h.useEffect(function(){s.current=e},[e]),h.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=Y1([e.lockRef.current],(e.shards||[]).map(Ay),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var a=h.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!s.current.allowPinchZoom;var w=Tl(v),g=n.current,x="deltaX"in v?v.deltaX:g[0]-w[0],C="deltaY"in v?v.deltaY:g[1]-w[1],P,b=v.target,A=Math.abs(x)>Math.abs(C)?"h":"v";if("touches"in v&&A==="h"&&b.type==="range")return!1;var T=Ty(A,b);if(!T)return!0;if(T?P=A:(P=A==="v"?"h":"v",T=Ty(A,b)),!T)return!1;if(!r.current&&"changedTouches"in v&&(x||C)&&(r.current=P),!P)return!0;var $=r.current||P;return TN($,S,v,$==="h"?x:C,!0)},[]),l=h.useCallback(function(v){var S=v;if(!(!ri.length||ri[ri.length-1]!==i)){var w="deltaY"in S?My(S):Tl(S),g=t.current.filter(function(P){return P.name===S.type&&(P.target===S.target||S.target===P.shadowParent)&&MN(P.delta,w)})[0];if(g&&g.should){S.cancelable&&S.preventDefault();return}if(!g){var x=(s.current.shards||[]).map(Ay).filter(Boolean).filter(function(P){return P.contains(S.target)}),C=x.length>0?a(S,x[0]):!s.current.noIsolation;C&&S.cancelable&&S.preventDefault()}}},[]),u=h.useCallback(function(v,S,w,g){var x={name:v,delta:S,target:w,should:g,shadowParent:jN(w)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(C){return C!==x})},1)},[]),d=h.useCallback(function(v){n.current=Tl(v),r.current=void 0},[]),c=h.useCallback(function(v){u(v.type,My(v),v.target,a(v,e.lockRef.current))},[]),f=h.useCallback(function(v){u(v.type,Tl(v),v.target,a(v,e.lockRef.current))},[]);h.useEffect(function(){return ri.push(i),e.setCallbacks({onScrollCapture:c,onWheelCapture:c,onTouchMoveCapture:f}),document.addEventListener("wheel",l,ni),document.addEventListener("touchmove",l,ni),document.addEventListener("touchstart",d,ni),function(){ri=ri.filter(function(v){return v!==i}),document.removeEventListener("wheel",l,ni),document.removeEventListener("touchmove",l,ni),document.removeEventListener("touchstart",d,ni)}},[]);var m=e.removeScrollBar,y=e.inert;return h.createElement(h.Fragment,null,y?h.createElement(i,{styles:AN(o)}):null,m?h.createElement(SN,{gapMode:e.gapMode}):null)}function jN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const ON=lN(J1,NN);var dg=h.forwardRef(function(e,t){return h.createElement(Sc,Fn({},e,{ref:t,sideCar:ON}))});dg.classNames=Sc.classNames;var DN=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},oi=new WeakMap,Ml=new WeakMap,Al={},Dd=0,rS=function(e){return e&&(e.host||rS(e.parentNode))},IN=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=rS(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},FN=function(e,t,n,r){var o=IN(t,Array.isArray(e)?e:[e]);Al[n]||(Al[n]=new WeakMap);var i=Al[n],s=[],a=new Set,l=new Set(o),u=function(c){!c||a.has(c)||(a.add(c),u(c.parentNode))};o.forEach(u);var d=function(c){!c||l.has(c)||Array.prototype.forEach.call(c.children,function(f){if(a.has(f))d(f);else try{var m=f.getAttribute(r),y=m!==null&&m!=="false",v=(oi.get(f)||0)+1,S=(i.get(f)||0)+1;oi.set(f,v),i.set(f,S),s.push(f),v===1&&y&&Ml.set(f,!0),S===1&&f.setAttribute(n,"true"),y||f.setAttribute(r,"true")}catch(w){console.error("aria-hidden: cannot operate on ",f,w)}})};return d(t),a.clear(),Dd++,function(){s.forEach(function(c){var f=oi.get(c)-1,m=i.get(c)-1;oi.set(c,f),i.set(c,m),f||(Ml.has(c)||c.removeAttribute(r),Ml.delete(c)),m||c.removeAttribute(n)}),Dd--,Dd||(oi=new WeakMap,oi=new WeakMap,Ml=new WeakMap,Al={})}},oS=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=DN(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live]"))),FN(r,o,n,"aria-hidden")):function(){return null}},fg="Dialog",[iS,sS]=pr(fg),[LN,En]=iS(fg),aS=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:o,onOpenChange:i,modal:s=!0}=e,a=h.useRef(null),l=h.useRef(null),[u=!1,d]=Wo({prop:r,defaultProp:o,onChange:i});return p.jsx(LN,{scope:t,triggerRef:a,contentRef:l,contentId:rr(),titleId:rr(),descriptionId:rr(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(c=>!c),[d]),modal:s,children:n})};aS.displayName=fg;var lS="DialogTrigger",uS=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(lS,n),i=Le(t,o.triggerRef);return p.jsx(de.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":gg(o.open),...r,ref:i,onClick:re(e.onClick,o.onOpenToggle)})});uS.displayName=lS;var pg="DialogPortal",[$N,cS]=iS(pg,{forceMount:void 0}),dS=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:o}=e,i=En(pg,t);return p.jsx($N,{scope:t,forceMount:n,children:h.Children.map(r,s=>p.jsx(Qt,{present:n||i.open,children:p.jsx(Ba,{asChild:!0,container:o,children:s})}))})};dS.displayName=pg;var $u="DialogOverlay",fS=h.forwardRef((e,t)=>{const n=cS($u,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=En($u,e.__scopeDialog);return i.modal?p.jsx(Qt,{present:r||i.open,children:p.jsx(UN,{...o,ref:t})}):null});fS.displayName=$u;var UN=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En($u,n);return p.jsx(dg,{as:un,allowPinchZoom:!0,shards:[o.contentRef],children:p.jsx(de.div,{"data-state":gg(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),$o="DialogContent",pS=h.forwardRef((e,t)=>{const n=cS($o,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=En($o,e.__scopeDialog);return p.jsx(Qt,{present:r||i.open,children:i.modal?p.jsx(zN,{...o,ref:t}):p.jsx(BN,{...o,ref:t})})});pS.displayName=$o;var zN=h.forwardRef((e,t)=>{const n=En($o,e.__scopeDialog),r=h.useRef(null),o=Le(t,n.contentRef,r);return h.useEffect(()=>{const i=r.current;if(i)return oS(i)},[]),p.jsx(hS,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:re(e.onCloseAutoFocus,i=>{var s;i.preventDefault(),(s=n.triggerRef.current)==null||s.focus()}),onPointerDownOutside:re(e.onPointerDownOutside,i=>{const s=i.detail.originalEvent,a=s.button===0&&s.ctrlKey===!0;(s.button===2||a)&&i.preventDefault()}),onFocusOutside:re(e.onFocusOutside,i=>i.preventDefault())})}),BN=h.forwardRef((e,t)=>{const n=En($o,e.__scopeDialog),r=h.useRef(!1),o=h.useRef(!1);return p.jsx(hS,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var s,a;(s=e.onCloseAutoFocus)==null||s.call(e,i),i.defaultPrevented||(r.current||(a=n.triggerRef.current)==null||a.focus(),i.preventDefault()),r.current=!1,o.current=!1},onInteractOutside:i=>{var l,u;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(r.current=!0,i.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=i.target;((u=n.triggerRef.current)==null?void 0:u.contains(s))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&o.current&&i.preventDefault()}})}),hS=h.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:o,onCloseAutoFocus:i,...s}=e,a=En($o,n),l=h.useRef(null),u=Le(t,l);return W1(),p.jsxs(p.Fragment,{children:[p.jsx(cg,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:o,onUnmountAutoFocus:i,children:p.jsx(za,{role:"dialog",id:a.contentId,"aria-describedby":a.descriptionId,"aria-labelledby":a.titleId,"data-state":gg(a.open),...s,ref:u,onDismiss:()=>a.onOpenChange(!1)})}),p.jsxs(p.Fragment,{children:[p.jsx(HN,{titleId:a.titleId}),p.jsx(GN,{contentRef:l,descriptionId:a.descriptionId})]})]})}),hg="DialogTitle",gS=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(hg,n);return p.jsx(de.h2,{id:o.titleId,...r,ref:t})});gS.displayName=hg;var mS="DialogDescription",vS=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(mS,n);return p.jsx(de.p,{id:o.descriptionId,...r,ref:t})});vS.displayName=mS;var yS="DialogClose",wS=h.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=En(yS,n);return p.jsx(de.button,{type:"button",...r,ref:t,onClick:re(e.onClick,()=>o.onOpenChange(!1))})});wS.displayName=yS;function gg(e){return e?"open":"closed"}var xS="DialogTitleWarning",[VN,SS]=Mk(xS,{contentName:$o,titleName:hg,docsSlug:"dialog"}),HN=({titleId:e})=>{const t=SS(xS),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. - -If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. - -For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},KN="DialogDescriptionWarning",GN=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${SS(KN).contentName}}.`;return h.useEffect(()=>{var i;const o=(i=e.current)==null?void 0:i.getAttribute("aria-describedby");t&&o&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},mg=aS,WN=uS,vg=dS,Va=fS,Ha=pS,Ka=gS,Ga=vS,Cc=wS;function ds(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,i;for(i=0;i=0)&&(n[o]=e[o]);return n}var qN=["color"],QN=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ds(e,qN);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M11.4669 3.72684C11.7558 3.91574 11.8369 4.30308 11.648 4.59198L7.39799 11.092C7.29783 11.2452 7.13556 11.3467 6.95402 11.3699C6.77247 11.3931 6.58989 11.3355 6.45446 11.2124L3.70446 8.71241C3.44905 8.48022 3.43023 8.08494 3.66242 7.82953C3.89461 7.57412 4.28989 7.55529 4.5453 7.78749L6.75292 9.79441L10.6018 3.90792C10.7907 3.61902 11.178 3.53795 11.4669 3.72684Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),YN=["color"],XN=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ds(e,YN);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M8.84182 3.13514C9.04327 3.32401 9.05348 3.64042 8.86462 3.84188L5.43521 7.49991L8.86462 11.1579C9.05348 11.3594 9.04327 11.6758 8.84182 11.8647C8.64036 12.0535 8.32394 12.0433 8.13508 11.8419L4.38508 7.84188C4.20477 7.64955 4.20477 7.35027 4.38508 7.15794L8.13508 3.15794C8.32394 2.95648 8.64036 2.94628 8.84182 3.13514Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),JN=["color"],CS=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ds(e,JN);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M6.1584 3.13508C6.35985 2.94621 6.67627 2.95642 6.86514 3.15788L10.6151 7.15788C10.7954 7.3502 10.7954 7.64949 10.6151 7.84182L6.86514 11.8418C6.67627 12.0433 6.35985 12.0535 6.1584 11.8646C5.95694 11.6757 5.94673 11.3593 6.1356 11.1579L9.565 7.49985L6.1356 3.84182C5.94673 3.64036 5.95694 3.32394 6.1584 3.13508Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),ZN=["color"],yg=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ds(e,ZN);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))}),ej=["color"],tj=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ds(e,ej);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M9.875 7.5C9.875 8.81168 8.81168 9.875 7.5 9.875C6.18832 9.875 5.125 8.81168 5.125 7.5C5.125 6.18832 6.18832 5.125 7.5 5.125C8.81168 5.125 9.875 6.18832 9.875 7.5Z",fill:r}))}),nj=["color"],rj=h.forwardRef(function(e,t){var n=e.color,r=n===void 0?"currentColor":n,o=ds(e,nj);return h.createElement("svg",Object.assign({width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg"},o,{ref:t}),h.createElement("path",{d:"M3.625 7.5C3.625 8.12132 3.12132 8.625 2.5 8.625C1.87868 8.625 1.375 8.12132 1.375 7.5C1.375 6.87868 1.87868 6.375 2.5 6.375C3.12132 6.375 3.625 6.87868 3.625 7.5ZM8.625 7.5C8.625 8.12132 8.12132 8.625 7.5 8.625C6.87868 8.625 6.375 8.12132 6.375 7.5C6.375 6.87868 6.87868 6.375 7.5 6.375C8.12132 6.375 8.625 6.87868 8.625 7.5ZM12.5 8.625C13.1213 8.625 13.625 8.12132 13.625 7.5C13.625 6.87868 13.1213 6.375 12.5 6.375C11.8787 6.375 11.375 6.87868 11.375 7.5C11.375 8.12132 11.8787 8.625 12.5 8.625Z",fill:r,fillRule:"evenodd",clipRule:"evenodd"}))});const oj=mg,ij=vg,bS=h.forwardRef(({className:e,...t},n)=>p.jsx(Va,{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}));bS.displayName=Va.displayName;const sj=Ua("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm"}},defaultVariants:{side:"right"}}),RS=h.forwardRef(({side:e="right",className:t,children:n,...r},o)=>p.jsxs(ij,{children:[p.jsx(bS,{}),p.jsxs(Ha,{ref:o,className:G(sj({side:e}),t),...r,children:[p.jsxs(Cc,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background 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-secondary",children:[p.jsx(yg,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]}),n]})]}));RS.displayName=Ha.displayName;const aj=h.forwardRef(({className:e,...t},n)=>p.jsx(Ka,{ref:n,className:G("text-lg font-semibold text-foreground",e),...t}));aj.displayName=Ka.displayName;const lj=h.forwardRef(({className:e,...t},n)=>p.jsx(Ga,{ref:n,className:G("text-sm text-muted-foreground",e),...t}));lj.displayName=Ga.displayName;function ky({className:e,...t}){return p.jsx("div",{className:G("animate-pulse rounded-md bg-primary/10",e),...t})}const uj=["top","right","bottom","left"],Zr=Math.min,Ut=Math.max,Uu=Math.round,kl=Math.floor,eo=e=>({x:e,y:e}),cj={left:"right",right:"left",bottom:"top",top:"bottom"},dj={start:"end",end:"start"};function wp(e,t,n){return Ut(e,Zr(t,n))}function ur(e,t){return typeof e=="function"?e(t):e}function cr(e){return e.split("-")[0]}function fs(e){return e.split("-")[1]}function wg(e){return e==="x"?"y":"x"}function xg(e){return e==="y"?"height":"width"}function to(e){return["top","bottom"].includes(cr(e))?"y":"x"}function Sg(e){return wg(to(e))}function fj(e,t,n){n===void 0&&(n=!1);const r=fs(e),o=Sg(e),i=xg(o);let s=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=zu(s)),[s,zu(s)]}function pj(e){const t=zu(e);return[xp(e),t,xp(t)]}function xp(e){return e.replace(/start|end/g,t=>dj[t])}function hj(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}function gj(e,t,n,r){const o=fs(e);let i=hj(cr(e),n==="start",r);return o&&(i=i.map(s=>s+"-"+o),t&&(i=i.concat(i.map(xp)))),i}function zu(e){return e.replace(/left|right|bottom|top/g,t=>cj[t])}function mj(e){return{top:0,right:0,bottom:0,left:0,...e}}function ES(e){return typeof e!="number"?mj(e):{top:e,right:e,bottom:e,left:e}}function Bu(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Ny(e,t,n){let{reference:r,floating:o}=e;const i=to(t),s=Sg(t),a=xg(s),l=cr(t),u=i==="y",d=r.x+r.width/2-o.width/2,c=r.y+r.height/2-o.height/2,f=r[a]/2-o[a]/2;let m;switch(l){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:c};break;case"left":m={x:r.x-o.width,y:c};break;default:m={x:r.x,y:r.y}}switch(fs(t)){case"start":m[s]-=f*(n&&u?-1:1);break;case"end":m[s]+=f*(n&&u?-1:1);break}return m}const vj=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(s.isRTL==null?void 0:s.isRTL(t));let u=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:c}=Ny(u,r,l),f=r,m={},y=0;for(let v=0;v({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:d=0}=ur(e,t)||{};if(u==null)return{};const c=ES(d),f={x:n,y:r},m=Sg(o),y=xg(m),v=await s.getDimensions(u),S=m==="y",w=S?"top":"left",g=S?"bottom":"right",x=S?"clientHeight":"clientWidth",C=i.reference[y]+i.reference[m]-f[m]-i.floating[y],P=f[m]-i.reference[m],b=await(s.getOffsetParent==null?void 0:s.getOffsetParent(u));let A=b?b[x]:0;(!A||!await(s.isElement==null?void 0:s.isElement(b)))&&(A=a.floating[x]||i.floating[y]);const T=C/2-P/2,$=A/2-v[y]/2-1,E=Zr(c[w],$),O=Zr(c[g],$),F=E,L=A-v[y]-O,R=A/2-v[y]/2+T,M=wp(F,R,L),j=!l.arrow&&fs(o)!=null&&R!==M&&i.reference[y]/2-(RR<=0)){var O,F;const R=(((O=i.flip)==null?void 0:O.index)||0)+1,M=A[R];if(M)return{data:{index:R,overflows:E},reset:{placement:M}};let j=(F=E.filter(B=>B.overflows[0]<=0).sort((B,D)=>B.overflows[1]-D.overflows[1])[0])==null?void 0:F.placement;if(!j)switch(m){case"bestFit":{var L;const B=(L=E.filter(D=>{if(b){const N=to(D.placement);return N===g||N==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(N=>N>0).reduce((N,V)=>N+V,0)]).sort((D,N)=>D[1]-N[1])[0])==null?void 0:L[0];B&&(j=B);break}case"initialPlacement":j=a;break}if(o!==j)return{reset:{placement:j}}}return{}}}};function jy(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Oy(e){return uj.some(t=>e[t]>=0)}const xj=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=ur(e,t);switch(r){case"referenceHidden":{const i=await Ca(t,{...o,elementContext:"reference"}),s=jy(i,n.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:Oy(s)}}}case"escaped":{const i=await Ca(t,{...o,altBoundary:!0}),s=jy(i,n.floating);return{data:{escapedOffsets:s,escaped:Oy(s)}}}default:return{}}}}};async function Sj(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),s=cr(n),a=fs(n),l=to(n)==="y",u=["left","top"].includes(s)?-1:1,d=i&&l?-1:1,c=ur(t,e);let{mainAxis:f,crossAxis:m,alignmentAxis:y}=typeof c=="number"?{mainAxis:c,crossAxis:0,alignmentAxis:null}:{mainAxis:c.mainAxis||0,crossAxis:c.crossAxis||0,alignmentAxis:c.alignmentAxis};return a&&typeof y=="number"&&(m=a==="end"?y*-1:y),l?{x:m*d,y:f*u}:{x:f*u,y:m*d}}const Cj=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await Sj(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},bj=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:S=>{let{x:w,y:g}=S;return{x:w,y:g}}},...l}=ur(e,t),u={x:n,y:r},d=await Ca(t,l),c=to(cr(o)),f=wg(c);let m=u[f],y=u[c];if(i){const S=f==="y"?"top":"left",w=f==="y"?"bottom":"right",g=m+d[S],x=m-d[w];m=wp(g,m,x)}if(s){const S=c==="y"?"top":"left",w=c==="y"?"bottom":"right",g=y+d[S],x=y-d[w];y=wp(g,y,x)}const v=a.fn({...t,[f]:m,[c]:y});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[f]:i,[c]:s}}}}}},Rj=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:s}=t,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ur(e,t),d={x:n,y:r},c=to(o),f=wg(c);let m=d[f],y=d[c];const v=ur(a,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(l){const x=f==="y"?"height":"width",C=i.reference[f]-i.floating[x]+S.mainAxis,P=i.reference[f]+i.reference[x]-S.mainAxis;mP&&(m=P)}if(u){var w,g;const x=f==="y"?"width":"height",C=["top","left"].includes(cr(o)),P=i.reference[c]-i.floating[x]+(C&&((w=s.offset)==null?void 0:w[c])||0)+(C?0:S.crossAxis),b=i.reference[c]+i.reference[x]+(C?0:((g=s.offset)==null?void 0:g[c])||0)-(C?S.crossAxis:0);yb&&(y=b)}return{[f]:m,[c]:y}}}},Ej=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:s,elements:a}=t,{apply:l=()=>{},...u}=ur(e,t),d=await Ca(t,u),c=cr(o),f=fs(o),m=to(o)==="y",{width:y,height:v}=i.floating;let S,w;c==="top"||c==="bottom"?(S=c,w=f===(await(s.isRTL==null?void 0:s.isRTL(a.floating))?"start":"end")?"left":"right"):(w=c,S=f==="end"?"top":"bottom");const g=v-d.top-d.bottom,x=y-d.left-d.right,C=Zr(v-d[S],g),P=Zr(y-d[w],x),b=!t.middlewareData.shift;let A=C,T=P;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(T=x),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=g),b&&!f){const E=Ut(d.left,0),O=Ut(d.right,0),F=Ut(d.top,0),L=Ut(d.bottom,0);m?T=y-2*(E!==0||O!==0?E+O:Ut(d.left,d.right)):A=v-2*(F!==0||L!==0?F+L:Ut(d.top,d.bottom))}await l({...t,availableWidth:T,availableHeight:A});const $=await s.getDimensions(a.floating);return y!==$.width||v!==$.height?{reset:{rects:!0}}:{}}}};function bc(){return typeof window<"u"}function ps(e){return PS(e)?(e.nodeName||"").toLowerCase():"#document"}function Ht(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Bn(e){var t;return(t=(PS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function PS(e){return bc()?e instanceof Node||e instanceof Ht(e).Node:!1}function bn(e){return bc()?e instanceof Element||e instanceof Ht(e).Element:!1}function Un(e){return bc()?e instanceof HTMLElement||e instanceof Ht(e).HTMLElement:!1}function Dy(e){return!bc()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ht(e).ShadowRoot}function Wa(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Rn(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function Pj(e){return["table","td","th"].includes(ps(e))}function Rc(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Cg(e){const t=bg(),n=bn(e)?Rn(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function _j(e){let t=no(e);for(;Un(t)&&!Zi(t);){if(Cg(t))return t;if(Rc(t))return null;t=no(t)}return null}function bg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Zi(e){return["html","body","#document"].includes(ps(e))}function Rn(e){return Ht(e).getComputedStyle(e)}function Ec(e){return bn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function no(e){if(ps(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Dy(e)&&e.host||Bn(e);return Dy(t)?t.host:t}function _S(e){const t=no(e);return Zi(t)?e.ownerDocument?e.ownerDocument.body:e.body:Un(t)&&Wa(t)?t:_S(t)}function ba(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=_S(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),s=Ht(o);if(i){const a=Sp(s);return t.concat(s,s.visualViewport||[],Wa(o)?o:[],a&&n?ba(a):[])}return t.concat(o,ba(o,[],n))}function Sp(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function TS(e){const t=Rn(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=Un(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=Uu(n)!==i||Uu(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function Rg(e){return bn(e)?e:e.contextElement}function _i(e){const t=Rg(e);if(!Un(t))return eo(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=TS(t);let s=(i?Uu(n.width):n.width)/r,a=(i?Uu(n.height):n.height)/o;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Tj=eo(0);function MS(e){const t=Ht(e);return!bg()||!t.visualViewport?Tj:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Mj(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ht(e)?!1:t}function Uo(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=Rg(e);let s=eo(1);t&&(r?bn(r)&&(s=_i(r)):s=_i(e));const a=Mj(i,n,r)?MS(i):eo(0);let l=(o.left+a.x)/s.x,u=(o.top+a.y)/s.y,d=o.width/s.x,c=o.height/s.y;if(i){const f=Ht(i),m=r&&bn(r)?Ht(r):r;let y=f,v=Sp(y);for(;v&&r&&m!==y;){const S=_i(v),w=v.getBoundingClientRect(),g=Rn(v),x=w.left+(v.clientLeft+parseFloat(g.paddingLeft))*S.x,C=w.top+(v.clientTop+parseFloat(g.paddingTop))*S.y;l*=S.x,u*=S.y,d*=S.x,c*=S.y,l+=x,u+=C,y=Ht(v),v=Sp(y)}}return Bu({width:d,height:c,x:l,y:u})}function Aj(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",s=Bn(r),a=t?Rc(t.floating):!1;if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=eo(1);const d=eo(0),c=Un(r);if((c||!c&&!i)&&((ps(r)!=="body"||Wa(s))&&(l=Ec(r)),Un(r))){const f=Uo(r);u=_i(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function kj(e){return Array.from(e.getClientRects())}function Cp(e,t){const n=Ec(e).scrollLeft;return t?t.left+n:Uo(Bn(e)).left+n}function Nj(e){const t=Bn(e),n=Ec(e),r=e.ownerDocument.body,o=Ut(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=Ut(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+Cp(e);const a=-n.scrollTop;return Rn(r).direction==="rtl"&&(s+=Ut(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}function jj(e,t){const n=Ht(e),r=Bn(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const u=bg();(!u||u&&t==="fixed")&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}function Oj(e,t){const n=Uo(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=Un(e)?_i(e):eo(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,l=o*i.x,u=r*i.y;return{width:s,height:a,x:l,y:u}}function Iy(e,t,n){let r;if(t==="viewport")r=jj(e,n);else if(t==="document")r=Nj(Bn(e));else if(bn(t))r=Oj(t,n);else{const o=MS(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Bu(r)}function AS(e,t){const n=no(e);return n===t||!bn(n)||Zi(n)?!1:Rn(n).position==="fixed"||AS(n,t)}function Dj(e,t){const n=t.get(e);if(n)return n;let r=ba(e,[],!1).filter(a=>bn(a)&&ps(a)!=="body"),o=null;const i=Rn(e).position==="fixed";let s=i?no(e):e;for(;bn(s)&&!Zi(s);){const a=Rn(s),l=Cg(s);!l&&a.position==="fixed"&&(o=null),(i?!l&&!o:!l&&a.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Wa(s)&&!l&&AS(e,s))?r=r.filter(d=>d!==s):o=a,s=no(s)}return t.set(e,r),r}function Ij(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const s=[...n==="clippingAncestors"?Rc(t)?[]:Dj(t,this._c):[].concat(n),r],a=s[0],l=s.reduce((u,d)=>{const c=Iy(t,d,o);return u.top=Ut(c.top,u.top),u.right=Zr(c.right,u.right),u.bottom=Zr(c.bottom,u.bottom),u.left=Ut(c.left,u.left),u},Iy(t,a,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function Fj(e){const{width:t,height:n}=TS(e);return{width:t,height:n}}function Lj(e,t,n){const r=Un(t),o=Bn(t),i=n==="fixed",s=Uo(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=eo(0);if(r||!r&&!i)if((ps(t)!=="body"||Wa(o))&&(a=Ec(t)),r){const m=Uo(t,!0,i,t);l.x=m.x+t.clientLeft,l.y=m.y+t.clientTop}else o&&(l.x=Cp(o));let u=0,d=0;if(o&&!r&&!i){const m=o.getBoundingClientRect();d=m.top+a.scrollTop,u=m.left+a.scrollLeft-Cp(o,m)}const c=s.left+a.scrollLeft-l.x-u,f=s.top+a.scrollTop-l.y-d;return{x:c,y:f,width:s.width,height:s.height}}function Id(e){return Rn(e).position==="static"}function Fy(e,t){if(!Un(e)||Rn(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Bn(e)===n&&(n=n.ownerDocument.body),n}function kS(e,t){const n=Ht(e);if(Rc(e))return n;if(!Un(e)){let o=no(e);for(;o&&!Zi(o);){if(bn(o)&&!Id(o))return o;o=no(o)}return n}let r=Fy(e,t);for(;r&&Pj(r)&&Id(r);)r=Fy(r,t);return r&&Zi(r)&&Id(r)&&!Cg(r)?n:r||_j(e)||n}const $j=async function(e){const t=this.getOffsetParent||kS,n=this.getDimensions,r=await n(e.floating);return{reference:Lj(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Uj(e){return Rn(e).direction==="rtl"}const zj={convertOffsetParentRelativeRectToViewportRelativeRect:Aj,getDocumentElement:Bn,getClippingRect:Ij,getOffsetParent:kS,getElementRects:$j,getClientRects:kj,getDimensions:Fj,getScale:_i,isElement:bn,isRTL:Uj};function Bj(e,t){let n=null,r;const o=Bn(e);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function s(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:c,height:f}=e.getBoundingClientRect();if(a||t(),!c||!f)return;const m=kl(d),y=kl(o.clientWidth-(u+c)),v=kl(o.clientHeight-(d+f)),S=kl(u),g={rootMargin:-m+"px "+-y+"px "+-v+"px "+-S+"px",threshold:Ut(0,Zr(1,l))||1};let x=!0;function C(P){const b=P[0].intersectionRatio;if(b!==l){if(!x)return s();b?s(!1,b):r=setTimeout(()=>{s(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(C,{...g,root:o.ownerDocument})}catch{n=new IntersectionObserver(C,g)}n.observe(e)}return s(!0),i}function Vj(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=Rg(e),d=o||i?[...u?ba(u):[],...ba(t)]:[];d.forEach(w=>{o&&w.addEventListener("scroll",n,{passive:!0}),i&&w.addEventListener("resize",n)});const c=u&&a?Bj(u,n):null;let f=-1,m=null;s&&(m=new ResizeObserver(w=>{let[g]=w;g&&g.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!l&&m.observe(u),m.observe(t));let y,v=l?Uo(e):null;l&&S();function S(){const w=Uo(e);v&&(w.x!==v.x||w.y!==v.y||w.width!==v.width||w.height!==v.height)&&n(),v=w,y=requestAnimationFrame(S)}return n(),()=>{var w;d.forEach(g=>{o&&g.removeEventListener("scroll",n),i&&g.removeEventListener("resize",n)}),c==null||c(),(w=m)==null||w.disconnect(),m=null,l&&cancelAnimationFrame(y)}}const Hj=Cj,Kj=bj,Gj=wj,Wj=Ej,qj=xj,Ly=yj,Qj=Rj,Yj=(e,t,n)=>{const r=new Map,o={platform:zj,...n},i={...o.platform,_c:r};return vj(e,t,{...o,platform:i})};var eu=typeof document<"u"?h.useLayoutEffect:h.useEffect;function Vu(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,o;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(!Vu(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!Vu(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function NS(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function $y(e,t){const n=NS(e);return Math.round(t*n)/n}function Fd(e){const t=h.useRef(e);return eu(()=>{t.current=e}),t}function Xj(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:l,open:u}=e,[d,c]=h.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,m]=h.useState(r);Vu(f,r)||m(r);const[y,v]=h.useState(null),[S,w]=h.useState(null),g=h.useCallback(D=>{D!==b.current&&(b.current=D,v(D))},[]),x=h.useCallback(D=>{D!==A.current&&(A.current=D,w(D))},[]),C=i||y,P=s||S,b=h.useRef(null),A=h.useRef(null),T=h.useRef(d),$=l!=null,E=Fd(l),O=Fd(o),F=Fd(u),L=h.useCallback(()=>{if(!b.current||!A.current)return;const D={placement:t,strategy:n,middleware:f};O.current&&(D.platform=O.current),Yj(b.current,A.current,D).then(N=>{const V={...N,isPositioned:F.current!==!1};R.current&&!Vu(T.current,V)&&(T.current=V,is.flushSync(()=>{c(V)}))})},[f,t,n,O,F]);eu(()=>{u===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,c(D=>({...D,isPositioned:!1})))},[u]);const R=h.useRef(!1);eu(()=>(R.current=!0,()=>{R.current=!1}),[]),eu(()=>{if(C&&(b.current=C),P&&(A.current=P),C&&P){if(E.current)return E.current(C,P,L);L()}},[C,P,L,E,$]);const M=h.useMemo(()=>({reference:b,floating:A,setReference:g,setFloating:x}),[g,x]),j=h.useMemo(()=>({reference:C,floating:P}),[C,P]),B=h.useMemo(()=>{const D={position:n,left:0,top:0};if(!j.floating)return D;const N=$y(j.floating,d.x),V=$y(j.floating,d.y);return a?{...D,transform:"translate("+N+"px, "+V+"px)",...NS(j.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:V}},[n,a,j.floating,d.x,d.y]);return h.useMemo(()=>({...d,update:L,refs:M,elements:j,floatingStyles:B}),[d,L,M,j,B])}const Jj=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:o}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?Ly({element:r.current,padding:o}).fn(n):{}:r?Ly({element:r,padding:o}).fn(n):{}}}},Zj=(e,t)=>({...Hj(e),options:[e,t]}),eO=(e,t)=>({...Kj(e),options:[e,t]}),tO=(e,t)=>({...Qj(e),options:[e,t]}),nO=(e,t)=>({...Gj(e),options:[e,t]}),rO=(e,t)=>({...Wj(e),options:[e,t]}),oO=(e,t)=>({...qj(e),options:[e,t]}),iO=(e,t)=>({...Jj(e),options:[e,t]});var sO="Arrow",jS=h.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return p.jsx(de.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:p.jsx("polygon",{points:"0,0 30,0 15,10"})})});jS.displayName=sO;var aO=jS;function lO(e,t=[]){let n=[];function r(i,s){const a=h.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:m,...y}=c,v=(f==null?void 0:f[e][l])||a,S=h.useMemo(()=>y,Object.values(y));return p.jsx(v.Provider,{value:S,children:m})}function d(c,f){const m=(f==null?void 0:f[e][l])||a,y=h.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>h.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,uO(o,...t)]}function uO(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function cO(e){const[t,n]=h.useState(void 0);return Cn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let s,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;s=u.inlineSize,a=u.blockSize}else s=e.offsetWidth,a=e.offsetHeight;n({width:s,height:a})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var Eg="Popper",[OS,Pc]=lO(Eg),[dO,DS]=OS(Eg),IS=e=>{const{__scopePopper:t,children:n}=e,[r,o]=h.useState(null);return p.jsx(dO,{scope:t,anchor:r,onAnchorChange:o,children:n})};IS.displayName=Eg;var FS="PopperAnchor",LS=h.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...o}=e,i=DS(FS,n),s=h.useRef(null),a=Le(t,s);return h.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||s.current)}),r?null:p.jsx(de.div,{...o,ref:a})});LS.displayName=FS;var Pg="PopperContent",[fO,pO]=OS(Pg),$S=h.forwardRef((e,t)=>{var he,Te,we,tt,Ce,it;const{__scopePopper:n,side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:c="partial",hideWhenDetached:f=!1,updatePositionStrategy:m="optimized",onPlaced:y,...v}=e,S=DS(Pg,n),[w,g]=h.useState(null),x=Le(t,Ot=>g(Ot)),[C,P]=h.useState(null),b=cO(C),A=(b==null?void 0:b.width)??0,T=(b==null?void 0:b.height)??0,$=r+(i!=="center"?"-"+i:""),E=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],F=O.length>0,L={padding:E,boundary:O.filter(gO),altBoundary:F},{refs:R,floatingStyles:M,placement:j,isPositioned:B,middlewareData:D}=Xj({strategy:"fixed",placement:$,whileElementsMounted:(...Ot)=>Vj(...Ot,{animationFrame:m==="always"}),elements:{reference:S.anchor},middleware:[Zj({mainAxis:o+T,alignmentAxis:s}),l&&eO({mainAxis:!0,crossAxis:!1,limiter:c==="partial"?tO():void 0,...L}),l&&nO({...L}),rO({...L,apply:({elements:Ot,rects:$e,availableWidth:nt,availableHeight:cn})=>{const{width:Uc,height:Xa}=$e.reference,Yo=Ot.floating.style;Yo.setProperty("--radix-popper-available-width",`${nt}px`),Yo.setProperty("--radix-popper-available-height",`${cn}px`),Yo.setProperty("--radix-popper-anchor-width",`${Uc}px`),Yo.setProperty("--radix-popper-anchor-height",`${Xa}px`)}}),C&&iO({element:C,padding:a}),mO({arrowWidth:A,arrowHeight:T}),f&&oO({strategy:"referenceHidden",...L})]}),[N,V]=BS(j),Q=mt(y);Cn(()=>{B&&(Q==null||Q())},[B,Q]);const te=(he=D.arrow)==null?void 0:he.x,pe=(Te=D.arrow)==null?void 0:Te.y,ge=((we=D.arrow)==null?void 0:we.centerOffset)!==0,[z,W]=h.useState();return Cn(()=>{w&&W(window.getComputedStyle(w).zIndex)},[w]),p.jsx("div",{ref:R.setFloating,"data-radix-popper-content-wrapper":"",style:{...M,transform:B?M.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:z,"--radix-popper-transform-origin":[(tt=D.transformOrigin)==null?void 0:tt.x,(Ce=D.transformOrigin)==null?void 0:Ce.y].join(" "),...((it=D.hide)==null?void 0:it.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:p.jsx(fO,{scope:n,placedSide:N,onArrowChange:P,arrowX:te,arrowY:pe,shouldHideArrow:ge,children:p.jsx(de.div,{"data-side":N,"data-align":V,...v,ref:x,style:{...v.style,animation:B?void 0:"none"}})})})});$S.displayName=Pg;var US="PopperArrow",hO={top:"bottom",right:"left",bottom:"top",left:"right"},zS=h.forwardRef(function(t,n){const{__scopePopper:r,...o}=t,i=pO(US,r),s=hO[i.placedSide];return p.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:p.jsx(aO,{...o,ref:n,style:{...o.style,display:"block"}})})});zS.displayName=US;function gO(e){return e!==null}var mO=e=>({name:"transformOrigin",options:e,fn(t){var S,w,g;const{placement:n,rects:r,middlewareData:o}=t,s=((S=o.arrow)==null?void 0:S.centerOffset)!==0,a=s?0:e.arrowWidth,l=s?0:e.arrowHeight,[u,d]=BS(n),c={start:"0%",center:"50%",end:"100%"}[d],f=(((w=o.arrow)==null?void 0:w.x)??0)+a/2,m=(((g=o.arrow)==null?void 0:g.y)??0)+l/2;let y="",v="";return u==="bottom"?(y=s?c:`${f}px`,v=`${-l}px`):u==="top"?(y=s?c:`${f}px`,v=`${r.floating.height+l}px`):u==="right"?(y=`${-l}px`,v=s?c:`${m}px`):u==="left"&&(y=`${r.floating.width+l}px`,v=s?c:`${m}px`),{data:{x:y,y:v}}}});function BS(e){const[t,n="center"]=e.split("-");return[t,n]}var VS=IS,HS=LS,KS=$S,GS=zS,vO="VisuallyHidden",_c=h.forwardRef((e,t)=>p.jsx(de.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));_c.displayName=vO;var yO=_c,[Tc,f$]=pr("Tooltip",[Pc]),Mc=Pc(),WS="TooltipProvider",wO=700,bp="tooltip.open",[xO,_g]=Tc(WS),qS=e=>{const{__scopeTooltip:t,delayDuration:n=wO,skipDelayDuration:r=300,disableHoverableContent:o=!1,children:i}=e,[s,a]=h.useState(!0),l=h.useRef(!1),u=h.useRef(0);return h.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),p.jsx(xO,{scope:t,isOpenDelayed:s,delayDuration:n,onOpen:h.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:h.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:h.useCallback(d=>{l.current=d},[]),disableHoverableContent:o,children:i})};qS.displayName=WS;var Ac="Tooltip",[SO,qa]=Tc(Ac),QS=e=>{const{__scopeTooltip:t,children:n,open:r,defaultOpen:o=!1,onOpenChange:i,disableHoverableContent:s,delayDuration:a}=e,l=_g(Ac,e.__scopeTooltip),u=Mc(t),[d,c]=h.useState(null),f=rr(),m=h.useRef(0),y=s??l.disableHoverableContent,v=a??l.delayDuration,S=h.useRef(!1),[w=!1,g]=Wo({prop:r,defaultProp:o,onChange:A=>{A?(l.onOpen(),document.dispatchEvent(new CustomEvent(bp))):l.onClose(),i==null||i(A)}}),x=h.useMemo(()=>w?S.current?"delayed-open":"instant-open":"closed",[w]),C=h.useCallback(()=>{window.clearTimeout(m.current),S.current=!1,g(!0)},[g]),P=h.useCallback(()=>{window.clearTimeout(m.current),g(!1)},[g]),b=h.useCallback(()=>{window.clearTimeout(m.current),m.current=window.setTimeout(()=>{S.current=!0,g(!0)},v)},[v,g]);return h.useEffect(()=>()=>window.clearTimeout(m.current),[]),p.jsx(VS,{...u,children:p.jsx(SO,{scope:t,contentId:f,open:w,stateAttribute:x,trigger:d,onTriggerChange:c,onTriggerEnter:h.useCallback(()=>{l.isOpenDelayed?b():C()},[l.isOpenDelayed,b,C]),onTriggerLeave:h.useCallback(()=>{y?P():window.clearTimeout(m.current)},[P,y]),onOpen:C,onClose:P,disableHoverableContent:y,children:n})})};QS.displayName=Ac;var Rp="TooltipTrigger",YS=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=qa(Rp,n),i=_g(Rp,n),s=Mc(n),a=h.useRef(null),l=Le(t,a,o.onTriggerChange),u=h.useRef(!1),d=h.useRef(!1),c=h.useCallback(()=>u.current=!1,[]);return h.useEffect(()=>()=>document.removeEventListener("pointerup",c),[c]),p.jsx(HS,{asChild:!0,...s,children:p.jsx(de.button,{"aria-describedby":o.open?o.contentId:void 0,"data-state":o.stateAttribute,...r,ref:l,onPointerMove:re(e.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(o.onTriggerEnter(),d.current=!0)}),onPointerLeave:re(e.onPointerLeave,()=>{o.onTriggerLeave(),d.current=!1}),onPointerDown:re(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",c,{once:!0})}),onFocus:re(e.onFocus,()=>{u.current||o.onOpen()}),onBlur:re(e.onBlur,o.onClose),onClick:re(e.onClick,o.onClose)})})});YS.displayName=Rp;var Tg="TooltipPortal",[CO,bO]=Tc(Tg,{forceMount:void 0}),XS=e=>{const{__scopeTooltip:t,forceMount:n,children:r,container:o}=e,i=qa(Tg,t);return p.jsx(CO,{scope:t,forceMount:n,children:p.jsx(Qt,{present:n||i.open,children:p.jsx(Ba,{asChild:!0,container:o,children:r})})})};XS.displayName=Tg;var es="TooltipContent",JS=h.forwardRef((e,t)=>{const n=bO(es,e.__scopeTooltip),{forceMount:r=n.forceMount,side:o="top",...i}=e,s=qa(es,e.__scopeTooltip);return p.jsx(Qt,{present:r||s.open,children:s.disableHoverableContent?p.jsx(ZS,{side:o,...i,ref:t}):p.jsx(RO,{side:o,...i,ref:t})})}),RO=h.forwardRef((e,t)=>{const n=qa(es,e.__scopeTooltip),r=_g(es,e.__scopeTooltip),o=h.useRef(null),i=Le(t,o),[s,a]=h.useState(null),{trigger:l,onClose:u}=n,d=o.current,{onPointerInTransitChange:c}=r,f=h.useCallback(()=>{a(null),c(!1)},[c]),m=h.useCallback((y,v)=>{const S=y.currentTarget,w={x:y.clientX,y:y.clientY},g=TO(w,S.getBoundingClientRect()),x=MO(w,g),C=AO(v.getBoundingClientRect()),P=NO([...x,...C]);a(P),c(!0)},[c]);return h.useEffect(()=>()=>f(),[f]),h.useEffect(()=>{if(l&&d){const y=S=>m(S,d),v=S=>m(S,l);return l.addEventListener("pointerleave",y),d.addEventListener("pointerleave",v),()=>{l.removeEventListener("pointerleave",y),d.removeEventListener("pointerleave",v)}}},[l,d,m,f]),h.useEffect(()=>{if(s){const y=v=>{const S=v.target,w={x:v.clientX,y:v.clientY},g=(l==null?void 0:l.contains(S))||(d==null?void 0:d.contains(S)),x=!kO(w,s);g?f():x&&(f(),u())};return document.addEventListener("pointermove",y),()=>document.removeEventListener("pointermove",y)}},[l,d,s,u,f]),p.jsx(ZS,{...e,ref:i})}),[EO,PO]=Tc(Ac,{isInside:!1}),ZS=h.forwardRef((e,t)=>{const{__scopeTooltip:n,children:r,"aria-label":o,onEscapeKeyDown:i,onPointerDownOutside:s,...a}=e,l=qa(es,n),u=Mc(n),{onClose:d}=l;return h.useEffect(()=>(document.addEventListener(bp,d),()=>document.removeEventListener(bp,d)),[d]),h.useEffect(()=>{if(l.trigger){const c=f=>{const m=f.target;m!=null&&m.contains(l.trigger)&&d()};return window.addEventListener("scroll",c,{capture:!0}),()=>window.removeEventListener("scroll",c,{capture:!0})}},[l.trigger,d]),p.jsx(za,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:c=>c.preventDefault(),onDismiss:d,children:p.jsxs(KS,{"data-state":l.stateAttribute,...u,...a,ref:t,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(sg,{children:r}),p.jsx(EO,{scope:n,isInside:!0,children:p.jsx(yO,{id:l.contentId,role:"tooltip",children:o||r})})]})})});JS.displayName=es;var eC="TooltipArrow",_O=h.forwardRef((e,t)=>{const{__scopeTooltip:n,...r}=e,o=Mc(n);return PO(eC,n).isInside?null:p.jsx(GS,{...o,...r,ref:t})});_O.displayName=eC;function TO(e,t){const n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),o=Math.abs(t.right-e.x),i=Math.abs(t.left-e.x);switch(Math.min(n,r,o,i)){case i:return"left";case o:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function MO(e,t,n=5){const r=[];switch(t){case"top":r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return r}function AO(e){const{top:t,right:n,bottom:r,left:o}=e;return[{x:o,y:t},{x:n,y:t},{x:n,y:r},{x:o,y:r}]}function kO(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function NO(e){const t=e.slice();return t.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),jO(t)}function jO(e){if(e.length<=1)return e.slice();const t=[];for(let r=0;r=2;){const i=t[t.length-1],s=t[t.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))t.pop();else break}t.push(o)}t.pop();const n=[];for(let r=e.length-1;r>=0;r--){const o=e[r];for(;n.length>=2;){const i=n[n.length-1],s=n[n.length-2];if((i.x-s.x)*(o.y-s.y)>=(i.y-s.y)*(o.x-s.x))n.pop();else break}n.push(o)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var OO=qS,DO=QS,IO=YS,FO=XS,tC=JS;const LO=OO,$O=DO,UO=IO,nC=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(FO,{children:p.jsx(tC,{ref:r,sideOffset:t,className:G("z-50 overflow-hidden rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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",e),...n})}));nC.displayName=tC.displayName;const zO="sidebar:state",BO=60*60*24*7,VO="16rem",HO="18rem",KO="3rem",GO="b",rC=h.createContext(null);function kc(){const e=h.useContext(rC);if(!e)throw new Error("useSidebar must be used within a SidebarProvider.");return e}const oC=h.forwardRef(({defaultOpen:e=!0,open:t,onOpenChange:n,className:r,style:o,children:i,...s},a)=>{const l=Rk(),[u,d]=h.useState(!1),[c,f]=h.useState(e),m=t??c,y=h.useCallback(g=>{if(n)return n==null?void 0:n(typeof g=="function"?g(m):g);f(g),document.cookie=`${zO}=${m}; path=/; max-age=${BO}`},[n,m]),v=h.useCallback(()=>l?d(g=>!g):y(g=>!g),[l,y,d]);h.useEffect(()=>{const g=x=>{x.key===GO&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),v())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[v]);const S=m?"expanded":"collapsed",w=h.useMemo(()=>({state:S,open:m,setOpen:y,isMobile:l,openMobile:u,setOpenMobile:d,toggleSidebar:v}),[S,m,y,l,u,d,v]);return p.jsx(rC.Provider,{value:w,children:p.jsx(LO,{delayDuration:0,children:p.jsx("div",{style:{"--sidebar-width":VO,"--sidebar-width-icon":KO,...o},className:G("group/sidebar-wrapper flex min-h-svh w-full has-[[data-variant=inset]]:bg-sidebar",r),ref:a,...s,children:i})})})});oC.displayName="SidebarProvider";const iC=h.forwardRef(({side:e="left",variant:t="sidebar",collapsible:n="offcanvas",className:r,children:o,...i},s)=>{const{isMobile:a,state:l,openMobile:u,setOpenMobile:d}=kc();return n==="none"?p.jsx("div",{className:G("flex h-full w-[--sidebar-width] flex-col bg-sidebar text-sidebar-foreground",r),ref:s,...i,children:o}):a?p.jsx(oj,{open:u,onOpenChange:d,...i,children:p.jsx(RS,{"data-sidebar":"sidebar","data-mobile":"true",className:"w-[--sidebar-width] bg-sidebar p-0 text-sidebar-foreground [&>button]:hidden",style:{"--sidebar-width":HO},side:e,children:p.jsx("div",{className:"flex h-full w-full flex-col",children:o})})}):p.jsxs("div",{ref:s,className:"group peer hidden md:block text-sidebar-foreground","data-state":l,"data-collapsible":l==="collapsed"?n:"","data-variant":t,"data-side":e,children:[p.jsx("div",{className:G("duration-200 relative h-svh w-[--sidebar-width] bg-transparent transition-[width] ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",t==="floating"||t==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4))]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon]")}),p.jsx("div",{className:G("duration-200 fixed inset-y-0 z-10 hidden h-svh w-[--sidebar-width] transition-[left,right,width] ease-linear md:flex",e==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",t==="floating"||t==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)_+_theme(spacing.4)_+2px)]":"group-data-[collapsible=icon]:w-[--sidebar-width-icon] group-data-[side=left]:border-r group-data-[side=right]:border-l",r),...i,children:p.jsx("div",{"data-sidebar":"sidebar",className:"flex h-full w-full flex-col bg-sidebar group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:border-sidebar-border group-data-[variant=floating]:shadow",children:o})})]})});iC.displayName="Sidebar";const sC=h.forwardRef(({className:e,onClick:t,...n},r)=>{const{toggleSidebar:o}=kc();return p.jsxs(Tt,{ref:r,"data-sidebar":"trigger",variant:"ghost",size:"icon",className:G("h-7 w-7",e),onClick:i=>{t==null||t(i),o()},...n,children:[p.jsx(pk,{}),p.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})});sC.displayName="SidebarTrigger";const aC=h.forwardRef(({className:e,...t},n)=>{const{toggleSidebar:r}=kc();return p.jsx("button",{ref:n,"data-sidebar":"rail","aria-label":"Toggle Sidebar",tabIndex:-1,onClick:r,title:"Toggle Sidebar",className:G("absolute inset-y-0 z-20 hidden w-4 -translate-x-1/2 transition-all ease-linear after:absolute after:inset-y-0 after:left-1/2 after:w-[2px] hover:after:bg-sidebar-border group-data-[side=left]:-right-4 group-data-[side=right]:left-0 sm:flex","[[data-side=left]_&]:cursor-w-resize [[data-side=right]_&]:cursor-e-resize","[[data-side=left][data-state=collapsed]_&]:cursor-e-resize [[data-side=right][data-state=collapsed]_&]:cursor-w-resize","group-data-[collapsible=offcanvas]:translate-x-0 group-data-[collapsible=offcanvas]:after:left-full group-data-[collapsible=offcanvas]:hover:bg-sidebar","[[data-side=left][data-collapsible=offcanvas]_&]:-right-2","[[data-side=right][data-collapsible=offcanvas]_&]:-left-2",e),...t})});aC.displayName="SidebarRail";const lC=h.forwardRef(({className:e,...t},n)=>p.jsx("main",{ref:n,className:G("relative flex min-h-[calc(100svh_-_4rem)] flex-1 flex-col bg-background","peer-data-[variant=inset]:min-h-[calc(100svh-theme(spacing.4))] md:peer-data-[variant=inset]:m-2 md:peer-data-[state=collapsed]:peer-data-[variant=inset]:ml-2 md:peer-data-[variant=inset]:ml-0 md:peer-data-[variant=inset]:rounded-xl md:peer-data-[variant=inset]:shadow",e),...t}));lC.displayName="SidebarInset";const WO=h.forwardRef(({className:e,...t},n)=>p.jsx(xc,{ref:n,"data-sidebar":"input",className:G("h-8 w-full bg-background shadow-none focus-visible:ring-2 focus-visible:ring-sidebar-ring",e),...t}));WO.displayName="SidebarInput";const uC=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-sidebar":"header",className:G("flex flex-col gap-2 p-2",e),...t}));uC.displayName="SidebarHeader";const cC=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-sidebar":"footer",className:G("flex flex-col gap-2 p-2",e),...t}));cC.displayName="SidebarFooter";const Ep=h.forwardRef(({className:e,...t},n)=>p.jsx(B1,{ref:n,"data-sidebar":"separator",className:G("mx-2 w-auto bg-sidebar-border",e),...t}));Ep.displayName="SidebarSeparator";const dC=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-sidebar":"content",className:G("flex min-h-0 flex-1 flex-col gap-2 p-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",e),...t}));dC.displayName="SidebarContent";const qO=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-sidebar":"group",className:G("relative flex w-full min-w-0 flex-col p-2",e),...t}));qO.displayName="SidebarGroup";const QO=h.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?un:"div";return p.jsx(o,{ref:r,"data-sidebar":"group-label",className:G("duration-200 flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opa] ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",e),...n})});QO.displayName="SidebarGroupLabel";const YO=h.forwardRef(({className:e,asChild:t=!1,...n},r)=>{const o=t?un:"button";return p.jsx(o,{ref:r,"data-sidebar":"group-action",className:G("absolute right-3 top-3.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","group-data-[collapsible=icon]:hidden",e),...n})});YO.displayName="SidebarGroupAction";const XO=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-sidebar":"group-content",className:G("w-full text-sm",e),...t}));XO.displayName="SidebarGroupContent";const fC=h.forwardRef(({className:e,...t},n)=>p.jsx("ul",{ref:n,"data-sidebar":"menu",className:G("flex w-full min-w-0 flex-col gap-1",e),...t}));fC.displayName="SidebarMenu";const po=h.forwardRef(({className:e,...t},n)=>p.jsx("li",{ref:n,"data-sidebar":"menu-item",className:G("group/menu-item relative",e),...t}));po.displayName="SidebarMenuItem";const JO=Ua("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-8 group-data-[collapsible=icon]:!p-2 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:!p-0"}},defaultVariants:{variant:"default",size:"default"}}),ho=h.forwardRef(({asChild:e=!1,isActive:t=!1,variant:n="default",size:r="default",tooltip:o,className:i,...s},a)=>{const l=e?un:"button",{isMobile:u,state:d}=kc(),c=p.jsx(l,{ref:a,"data-sidebar":"menu-button","data-size":r,"data-active":t,className:G(JO({variant:n,size:r}),i),...s});return o?(typeof o=="string"&&(o={children:o}),p.jsxs($O,{children:[p.jsx(UO,{asChild:!0,children:c}),p.jsx(nC,{side:"right",align:"center",hidden:d!=="collapsed"||u,...o})]})):c});ho.displayName="SidebarMenuButton";const ZO=h.forwardRef(({className:e,asChild:t=!1,showOnHover:n=!1,...r},o)=>{const i=t?un:"button";return p.jsx(i,{ref:o,"data-sidebar":"menu-action",className:G("absolute right-1 top-1.5 flex aspect-square w-5 items-center justify-center rounded-md p-0 text-sidebar-foreground outline-none ring-sidebar-ring transition-transform hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 peer-hover/menu-button:text-sidebar-accent-foreground [&>svg]:size-4 [&>svg]:shrink-0","after:absolute after:-inset-2 after:md:hidden","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",n&&"group-focus-within/menu-item:opacity-100 group-hover/menu-item:opacity-100 data-[state=open]:opacity-100 peer-data-[active=true]/menu-button:text-sidebar-accent-foreground md:opacity-0",e),...r})});ZO.displayName="SidebarMenuAction";const eD=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,"data-sidebar":"menu-badge",className:G("absolute right-1 flex h-5 min-w-5 items-center justify-center rounded-md px-1 text-xs font-medium tabular-nums text-sidebar-foreground select-none pointer-events-none","peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground","peer-data-[size=sm]/menu-button:top-1","peer-data-[size=default]/menu-button:top-1.5","peer-data-[size=lg]/menu-button:top-2.5","group-data-[collapsible=icon]:hidden",e),...t}));eD.displayName="SidebarMenuBadge";const tD=h.forwardRef(({className:e,showIcon:t=!1,...n},r)=>{const o=h.useMemo(()=>`${Math.floor(Math.random()*40)+50}%`,[]);return p.jsxs("div",{ref:r,"data-sidebar":"menu-skeleton",className:G("rounded-md h-8 flex gap-2 px-2 items-center",e),...n,children:[t&&p.jsx(ky,{className:"size-4 rounded-md","data-sidebar":"menu-skeleton-icon"}),p.jsx(ky,{className:"h-4 flex-1 max-w-[--skeleton-width]","data-sidebar":"menu-skeleton-text",style:{"--skeleton-width":o}})]})});tD.displayName="SidebarMenuSkeleton";const nD=h.forwardRef(({className:e,...t},n)=>p.jsx("ul",{ref:n,"data-sidebar":"menu-sub",className:G("mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l border-sidebar-border px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",e),...t}));nD.displayName="SidebarMenuSub";const rD=h.forwardRef(({...e},t)=>p.jsx("li",{ref:t,...e}));rD.displayName="SidebarMenuSubItem";const oD=h.forwardRef(({asChild:e=!1,size:t="md",isActive:n,className:r,...o},i)=>{const s=e?un:"a";return p.jsx(s,{ref:i,"data-sidebar":"menu-sub-button","data-size":t,"data-active":n,className:G("flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",t==="sm"&&"text-xs",t==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",r),...o})});oD.displayName="SidebarMenuSubButton";function iD(e,t=[]){let n=[];function r(i,s){const a=h.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:m,...y}=c,v=(f==null?void 0:f[e][l])||a,S=h.useMemo(()=>y,Object.values(y));return p.jsx(v.Provider,{value:S,children:m})}function d(c,f){const m=(f==null?void 0:f[e][l])||a,y=h.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>h.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,sD(o,...t)]}function sD(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}function Mg(e){const t=e+"CollectionProvider",[n,r]=iD(t),[o,i]=n(t,{collectionRef:{current:null},itemMap:new Map}),s=m=>{const{scope:y,children:v}=m,S=xr.useRef(null),w=xr.useRef(new Map).current;return p.jsx(o,{scope:y,itemMap:w,collectionRef:S,children:v})};s.displayName=t;const a=e+"CollectionSlot",l=xr.forwardRef((m,y)=>{const{scope:v,children:S}=m,w=i(a,v),g=Le(y,w.collectionRef);return p.jsx(un,{ref:g,children:S})});l.displayName=a;const u=e+"CollectionItemSlot",d="data-radix-collection-item",c=xr.forwardRef((m,y)=>{const{scope:v,children:S,...w}=m,g=xr.useRef(null),x=Le(y,g),C=i(u,v);return xr.useEffect(()=>(C.itemMap.set(g,{ref:g,...w}),()=>void C.itemMap.delete(g))),p.jsx(un,{[d]:"",ref:x,children:S})});c.displayName=u;function f(m){const y=i(e+"CollectionConsumer",m);return xr.useCallback(()=>{const S=y.collectionRef.current;if(!S)return[];const w=Array.from(S.querySelectorAll(`[${d}]`));return Array.from(y.itemMap.values()).sort((C,P)=>w.indexOf(C.ref.current)-w.indexOf(P.ref.current))},[y.collectionRef,y.itemMap])}return[{Provider:s,Slot:l,ItemSlot:c},f,r]}var aD=h.createContext(void 0);function Ag(e){const t=h.useContext(aD);return e||t||"ltr"}function lD(e,t=[]){let n=[];function r(i,s){const a=h.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:m,...y}=c,v=(f==null?void 0:f[e][l])||a,S=h.useMemo(()=>y,Object.values(y));return p.jsx(v.Provider,{value:S,children:m})}function d(c,f){const m=(f==null?void 0:f[e][l])||a,y=h.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>h.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,uD(o,...t)]}function uD(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Ld="rovingFocusGroup.onEntryFocus",cD={bubbles:!1,cancelable:!0},Nc="RovingFocusGroup",[Pp,pC,dD]=Mg(Nc),[fD,jc]=lD(Nc,[dD]),[pD,hD]=fD(Nc),hC=h.forwardRef((e,t)=>p.jsx(Pp.Provider,{scope:e.__scopeRovingFocusGroup,children:p.jsx(Pp.Slot,{scope:e.__scopeRovingFocusGroup,children:p.jsx(gD,{...e,ref:t})})}));hC.displayName=Nc;var gD=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:o=!1,dir:i,currentTabStopId:s,defaultCurrentTabStopId:a,onCurrentTabStopIdChange:l,onEntryFocus:u,preventScrollOnEntryFocus:d=!1,...c}=e,f=h.useRef(null),m=Le(t,f),y=Ag(i),[v=null,S]=Wo({prop:s,defaultProp:a,onChange:l}),[w,g]=h.useState(!1),x=mt(u),C=pC(n),P=h.useRef(!1),[b,A]=h.useState(0);return h.useEffect(()=>{const T=f.current;if(T)return T.addEventListener(Ld,x),()=>T.removeEventListener(Ld,x)},[x]),p.jsx(pD,{scope:n,orientation:r,dir:y,loop:o,currentTabStopId:v,onItemFocus:h.useCallback(T=>S(T),[S]),onItemShiftTab:h.useCallback(()=>g(!0),[]),onFocusableItemAdd:h.useCallback(()=>A(T=>T+1),[]),onFocusableItemRemove:h.useCallback(()=>A(T=>T-1),[]),children:p.jsx(de.div,{tabIndex:w||b===0?-1:0,"data-orientation":r,...c,ref:m,style:{outline:"none",...e.style},onMouseDown:re(e.onMouseDown,()=>{P.current=!0}),onFocus:re(e.onFocus,T=>{const $=!P.current;if(T.target===T.currentTarget&&$&&!w){const E=new CustomEvent(Ld,cD);if(T.currentTarget.dispatchEvent(E),!E.defaultPrevented){const O=C().filter(j=>j.focusable),F=O.find(j=>j.active),L=O.find(j=>j.id===v),M=[F,L,...O].filter(Boolean).map(j=>j.ref.current);vC(M,d)}}P.current=!1}),onBlur:re(e.onBlur,()=>g(!1))})})}),gC="RovingFocusGroupItem",mC=h.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:o=!1,tabStopId:i,...s}=e,a=rr(),l=i||a,u=hD(gC,n),d=u.currentTabStopId===l,c=pC(n),{onFocusableItemAdd:f,onFocusableItemRemove:m}=u;return h.useEffect(()=>{if(r)return f(),()=>m()},[r,f,m]),p.jsx(Pp.ItemSlot,{scope:n,id:l,focusable:r,active:o,children:p.jsx(de.span,{tabIndex:d?0:-1,"data-orientation":u.orientation,...s,ref:t,onMouseDown:re(e.onMouseDown,y=>{r?u.onItemFocus(l):y.preventDefault()}),onFocus:re(e.onFocus,()=>u.onItemFocus(l)),onKeyDown:re(e.onKeyDown,y=>{if(y.key==="Tab"&&y.shiftKey){u.onItemShiftTab();return}if(y.target!==y.currentTarget)return;const v=yD(y,u.orientation,u.dir);if(v!==void 0){if(y.metaKey||y.ctrlKey||y.altKey||y.shiftKey)return;y.preventDefault();let w=c().filter(g=>g.focusable).map(g=>g.ref.current);if(v==="last")w.reverse();else if(v==="prev"||v==="next"){v==="prev"&&w.reverse();const g=w.indexOf(y.currentTarget);w=u.loop?wD(w,g+1):w.slice(g+1)}setTimeout(()=>vC(w))}})})})});mC.displayName=gC;var mD={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function vD(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function yD(e,t,n){const r=vD(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return mD[r]}function vC(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function wD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var yC=hC,wC=mC,_p=["Enter"," "],xD=["ArrowDown","PageUp","Home"],xC=["ArrowUp","PageDown","End"],SD=[...xD,...xC],CD={ltr:[..._p,"ArrowRight"],rtl:[..._p,"ArrowLeft"]},bD={ltr:["ArrowLeft"],rtl:["ArrowRight"]},Qa="Menu",[Ra,RD,ED]=Mg(Qa),[qo,SC]=pr(Qa,[ED,Pc,jc]),Oc=Pc(),CC=jc(),[PD,Qo]=qo(Qa),[_D,Ya]=qo(Qa),bC=e=>{const{__scopeMenu:t,open:n=!1,children:r,dir:o,onOpenChange:i,modal:s=!0}=e,a=Oc(t),[l,u]=h.useState(null),d=h.useRef(!1),c=mt(i),f=Ag(o);return h.useEffect(()=>{const m=()=>{d.current=!0,document.addEventListener("pointerdown",y,{capture:!0,once:!0}),document.addEventListener("pointermove",y,{capture:!0,once:!0})},y=()=>d.current=!1;return document.addEventListener("keydown",m,{capture:!0}),()=>{document.removeEventListener("keydown",m,{capture:!0}),document.removeEventListener("pointerdown",y,{capture:!0}),document.removeEventListener("pointermove",y,{capture:!0})}},[]),p.jsx(VS,{...a,children:p.jsx(PD,{scope:t,open:n,onOpenChange:c,content:l,onContentChange:u,children:p.jsx(_D,{scope:t,onClose:h.useCallback(()=>c(!1),[c]),isUsingKeyboardRef:d,dir:f,modal:s,children:r})})})};bC.displayName=Qa;var TD="MenuAnchor",kg=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Oc(n);return p.jsx(HS,{...o,...r,ref:t})});kg.displayName=TD;var Ng="MenuPortal",[MD,RC]=qo(Ng,{forceMount:void 0}),EC=e=>{const{__scopeMenu:t,forceMount:n,children:r,container:o}=e,i=Qo(Ng,t);return p.jsx(MD,{scope:t,forceMount:n,children:p.jsx(Qt,{present:n||i.open,children:p.jsx(Ba,{asChild:!0,container:o,children:r})})})};EC.displayName=Ng;var sn="MenuContent",[AD,jg]=qo(sn),PC=h.forwardRef((e,t)=>{const n=RC(sn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Qo(sn,e.__scopeMenu),s=Ya(sn,e.__scopeMenu);return p.jsx(Ra.Provider,{scope:e.__scopeMenu,children:p.jsx(Qt,{present:r||i.open,children:p.jsx(Ra.Slot,{scope:e.__scopeMenu,children:s.modal?p.jsx(kD,{...o,ref:t}):p.jsx(ND,{...o,ref:t})})})})}),kD=h.forwardRef((e,t)=>{const n=Qo(sn,e.__scopeMenu),r=h.useRef(null),o=Le(t,r);return h.useEffect(()=>{const i=r.current;if(i)return oS(i)},[]),p.jsx(Og,{...e,ref:o,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:re(e.onFocusOutside,i=>i.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),ND=h.forwardRef((e,t)=>{const n=Qo(sn,e.__scopeMenu);return p.jsx(Og,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Og=h.forwardRef((e,t)=>{const{__scopeMenu:n,loop:r=!1,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEntryFocus:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:m,disableOutsideScroll:y,...v}=e,S=Qo(sn,n),w=Ya(sn,n),g=Oc(n),x=CC(n),C=RD(n),[P,b]=h.useState(null),A=h.useRef(null),T=Le(t,A,S.onContentChange),$=h.useRef(0),E=h.useRef(""),O=h.useRef(0),F=h.useRef(null),L=h.useRef("right"),R=h.useRef(0),M=y?dg:h.Fragment,j=y?{as:un,allowPinchZoom:!0}:void 0,B=N=>{var he,Te;const V=E.current+N,Q=C().filter(we=>!we.disabled),te=document.activeElement,pe=(he=Q.find(we=>we.ref.current===te))==null?void 0:he.textValue,ge=Q.map(we=>we.textValue),z=HD(ge,V,pe),W=(Te=Q.find(we=>we.textValue===z))==null?void 0:Te.ref.current;(function we(tt){E.current=tt,window.clearTimeout($.current),tt!==""&&($.current=window.setTimeout(()=>we(""),1e3))})(V),W&&setTimeout(()=>W.focus())};h.useEffect(()=>()=>window.clearTimeout($.current),[]),W1();const D=h.useCallback(N=>{var Q,te;return L.current===((Q=F.current)==null?void 0:Q.side)&&GD(N,(te=F.current)==null?void 0:te.area)},[]);return p.jsx(AD,{scope:n,searchRef:E,onItemEnter:h.useCallback(N=>{D(N)&&N.preventDefault()},[D]),onItemLeave:h.useCallback(N=>{var V;D(N)||((V=A.current)==null||V.focus(),b(null))},[D]),onTriggerLeave:h.useCallback(N=>{D(N)&&N.preventDefault()},[D]),pointerGraceTimerRef:O,onPointerGraceIntentChange:h.useCallback(N=>{F.current=N},[]),children:p.jsx(M,{...j,children:p.jsx(cg,{asChild:!0,trapped:o,onMountAutoFocus:re(i,N=>{var V;N.preventDefault(),(V=A.current)==null||V.focus({preventScroll:!0})}),onUnmountAutoFocus:s,children:p.jsx(za,{asChild:!0,disableOutsidePointerEvents:a,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:c,onInteractOutside:f,onDismiss:m,children:p.jsx(yC,{asChild:!0,...x,dir:w.dir,orientation:"vertical",loop:r,currentTabStopId:P,onCurrentTabStopIdChange:b,onEntryFocus:re(l,N=>{w.isUsingKeyboardRef.current||N.preventDefault()}),preventScrollOnEntryFocus:!0,children:p.jsx(KS,{role:"menu","aria-orientation":"vertical","data-state":BC(S.open),"data-radix-menu-content":"",dir:w.dir,...g,...v,ref:T,style:{outline:"none",...v.style},onKeyDown:re(v.onKeyDown,N=>{const Q=N.target.closest("[data-radix-menu-content]")===N.currentTarget,te=N.ctrlKey||N.altKey||N.metaKey,pe=N.key.length===1;Q&&(N.key==="Tab"&&N.preventDefault(),!te&&pe&&B(N.key));const ge=A.current;if(N.target!==ge||!SD.includes(N.key))return;N.preventDefault();const W=C().filter(he=>!he.disabled).map(he=>he.ref.current);xC.includes(N.key)&&W.reverse(),BD(W)}),onBlur:re(e.onBlur,N=>{N.currentTarget.contains(N.target)||(window.clearTimeout($.current),E.current="")}),onPointerMove:re(e.onPointerMove,Ea(N=>{const V=N.target,Q=R.current!==N.clientX;if(N.currentTarget.contains(V)&&Q){const te=N.clientX>R.current?"right":"left";L.current=te,R.current=N.clientX}}))})})})})})})});PC.displayName=sn;var jD="MenuGroup",Dg=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(de.div,{role:"group",...r,ref:t})});Dg.displayName=jD;var OD="MenuLabel",_C=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(de.div,{...r,ref:t})});_C.displayName=OD;var Hu="MenuItem",Uy="menu.itemSelect",Dc=h.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:r,...o}=e,i=h.useRef(null),s=Ya(Hu,e.__scopeMenu),a=jg(Hu,e.__scopeMenu),l=Le(t,i),u=h.useRef(!1),d=()=>{const c=i.current;if(!n&&c){const f=new CustomEvent(Uy,{bubbles:!0,cancelable:!0});c.addEventListener(Uy,m=>r==null?void 0:r(m),{once:!0}),ug(c,f),f.defaultPrevented?u.current=!1:s.onClose()}};return p.jsx(TC,{...o,ref:l,disabled:n,onClick:re(e.onClick,d),onPointerDown:c=>{var f;(f=e.onPointerDown)==null||f.call(e,c),u.current=!0},onPointerUp:re(e.onPointerUp,c=>{var f;u.current||(f=c.currentTarget)==null||f.click()}),onKeyDown:re(e.onKeyDown,c=>{const f=a.searchRef.current!=="";n||f&&c.key===" "||_p.includes(c.key)&&(c.currentTarget.click(),c.preventDefault())})})});Dc.displayName=Hu;var TC=h.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:r=!1,textValue:o,...i}=e,s=jg(Hu,n),a=CC(n),l=h.useRef(null),u=Le(t,l),[d,c]=h.useState(!1),[f,m]=h.useState("");return h.useEffect(()=>{const y=l.current;y&&m((y.textContent??"").trim())},[i.children]),p.jsx(Ra.ItemSlot,{scope:n,disabled:r,textValue:o??f,children:p.jsx(wC,{asChild:!0,...a,focusable:!r,children:p.jsx(de.div,{role:"menuitem","data-highlighted":d?"":void 0,"aria-disabled":r||void 0,"data-disabled":r?"":void 0,...i,ref:u,onPointerMove:re(e.onPointerMove,Ea(y=>{r?s.onItemLeave(y):(s.onItemEnter(y),y.defaultPrevented||y.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:re(e.onPointerLeave,Ea(y=>s.onItemLeave(y))),onFocus:re(e.onFocus,()=>c(!0)),onBlur:re(e.onBlur,()=>c(!1))})})})}),DD="MenuCheckboxItem",MC=h.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:r,...o}=e;return p.jsx(OC,{scope:e.__scopeMenu,checked:n,children:p.jsx(Dc,{role:"menuitemcheckbox","aria-checked":Ku(n)?"mixed":n,...o,ref:t,"data-state":Fg(n),onSelect:re(o.onSelect,()=>r==null?void 0:r(Ku(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MC.displayName=DD;var AC="MenuRadioGroup",[ID,FD]=qo(AC,{value:void 0,onValueChange:()=>{}}),kC=h.forwardRef((e,t)=>{const{value:n,onValueChange:r,...o}=e,i=mt(r);return p.jsx(ID,{scope:e.__scopeMenu,value:n,onValueChange:i,children:p.jsx(Dg,{...o,ref:t})})});kC.displayName=AC;var NC="MenuRadioItem",jC=h.forwardRef((e,t)=>{const{value:n,...r}=e,o=FD(NC,e.__scopeMenu),i=n===o.value;return p.jsx(OC,{scope:e.__scopeMenu,checked:i,children:p.jsx(Dc,{role:"menuitemradio","aria-checked":i,...r,ref:t,"data-state":Fg(i),onSelect:re(r.onSelect,()=>{var s;return(s=o.onValueChange)==null?void 0:s.call(o,n)},{checkForDefaultPrevented:!1})})})});jC.displayName=NC;var Ig="MenuItemIndicator",[OC,LD]=qo(Ig,{checked:!1}),DC=h.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:r,...o}=e,i=LD(Ig,n);return p.jsx(Qt,{present:r||Ku(i.checked)||i.checked===!0,children:p.jsx(de.span,{...o,ref:t,"data-state":Fg(i.checked)})})});DC.displayName=Ig;var $D="MenuSeparator",IC=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e;return p.jsx(de.div,{role:"separator","aria-orientation":"horizontal",...r,ref:t})});IC.displayName=$D;var UD="MenuArrow",FC=h.forwardRef((e,t)=>{const{__scopeMenu:n,...r}=e,o=Oc(n);return p.jsx(GS,{...o,...r,ref:t})});FC.displayName=UD;var zD="MenuSub",[p$,LC]=qo(zD),zs="MenuSubTrigger",$C=h.forwardRef((e,t)=>{const n=Qo(zs,e.__scopeMenu),r=Ya(zs,e.__scopeMenu),o=LC(zs,e.__scopeMenu),i=jg(zs,e.__scopeMenu),s=h.useRef(null),{pointerGraceTimerRef:a,onPointerGraceIntentChange:l}=i,u={__scopeMenu:e.__scopeMenu},d=h.useCallback(()=>{s.current&&window.clearTimeout(s.current),s.current=null},[]);return h.useEffect(()=>d,[d]),h.useEffect(()=>{const c=a.current;return()=>{window.clearTimeout(c),l(null)}},[a,l]),p.jsx(kg,{asChild:!0,...u,children:p.jsx(TC,{id:o.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":o.contentId,"data-state":BC(n.open),...e,ref:yc(t,o.onTriggerChange),onClick:c=>{var f;(f=e.onClick)==null||f.call(e,c),!(e.disabled||c.defaultPrevented)&&(c.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:re(e.onPointerMove,Ea(c=>{i.onItemEnter(c),!c.defaultPrevented&&!e.disabled&&!n.open&&!s.current&&(i.onPointerGraceIntentChange(null),s.current=window.setTimeout(()=>{n.onOpenChange(!0),d()},100))})),onPointerLeave:re(e.onPointerLeave,Ea(c=>{var m,y;d();const f=(m=n.content)==null?void 0:m.getBoundingClientRect();if(f){const v=(y=n.content)==null?void 0:y.dataset.side,S=v==="right",w=S?-5:5,g=f[S?"left":"right"],x=f[S?"right":"left"];i.onPointerGraceIntentChange({area:[{x:c.clientX+w,y:c.clientY},{x:g,y:f.top},{x,y:f.top},{x,y:f.bottom},{x:g,y:f.bottom}],side:v}),window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.onPointerGraceIntentChange(null),300)}else{if(i.onTriggerLeave(c),c.defaultPrevented)return;i.onPointerGraceIntentChange(null)}})),onKeyDown:re(e.onKeyDown,c=>{var m;const f=i.searchRef.current!=="";e.disabled||f&&c.key===" "||CD[r.dir].includes(c.key)&&(n.onOpenChange(!0),(m=n.content)==null||m.focus(),c.preventDefault())})})})});$C.displayName=zs;var UC="MenuSubContent",zC=h.forwardRef((e,t)=>{const n=RC(sn,e.__scopeMenu),{forceMount:r=n.forceMount,...o}=e,i=Qo(sn,e.__scopeMenu),s=Ya(sn,e.__scopeMenu),a=LC(UC,e.__scopeMenu),l=h.useRef(null),u=Le(t,l);return p.jsx(Ra.Provider,{scope:e.__scopeMenu,children:p.jsx(Qt,{present:r||i.open,children:p.jsx(Ra.Slot,{scope:e.__scopeMenu,children:p.jsx(Og,{id:a.contentId,"aria-labelledby":a.triggerId,...o,ref:u,align:"start",side:s.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:d=>{var c;s.isUsingKeyboardRef.current&&((c=l.current)==null||c.focus()),d.preventDefault()},onCloseAutoFocus:d=>d.preventDefault(),onFocusOutside:re(e.onFocusOutside,d=>{d.target!==a.trigger&&i.onOpenChange(!1)}),onEscapeKeyDown:re(e.onEscapeKeyDown,d=>{s.onClose(),d.preventDefault()}),onKeyDown:re(e.onKeyDown,d=>{var m;const c=d.currentTarget.contains(d.target),f=bD[s.dir].includes(d.key);c&&f&&(i.onOpenChange(!1),(m=a.trigger)==null||m.focus(),d.preventDefault())})})})})})});zC.displayName=UC;function BC(e){return e?"open":"closed"}function Ku(e){return e==="indeterminate"}function Fg(e){return Ku(e)?"indeterminate":e?"checked":"unchecked"}function BD(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function VD(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function HD(e,t,n){const o=t.length>1&&Array.from(t).every(u=>u===t[0])?t[0]:t,i=n?e.indexOf(n):-1;let s=VD(e,Math.max(i,0));o.length===1&&(s=s.filter(u=>u!==n));const l=s.find(u=>u.toLowerCase().startsWith(o.toLowerCase()));return l!==n?l:void 0}function KD(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;ir!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(o=!o)}return o}function GD(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return KD(n,t)}function Ea(e){return t=>t.pointerType==="mouse"?e(t):void 0}var WD=bC,qD=kg,QD=EC,YD=PC,XD=Dg,JD=_C,ZD=Dc,eI=MC,tI=kC,nI=jC,rI=DC,oI=IC,iI=FC,sI=$C,aI=zC,Lg="DropdownMenu",[lI,h$]=pr(Lg,[SC]),bt=SC(),[uI,VC]=lI(Lg),HC=e=>{const{__scopeDropdownMenu:t,children:n,dir:r,open:o,defaultOpen:i,onOpenChange:s,modal:a=!0}=e,l=bt(t),u=h.useRef(null),[d=!1,c]=Wo({prop:o,defaultProp:i,onChange:s});return p.jsx(uI,{scope:t,triggerId:rr(),triggerRef:u,contentId:rr(),open:d,onOpenChange:c,onOpenToggle:h.useCallback(()=>c(f=>!f),[c]),modal:a,children:p.jsx(WD,{...l,open:d,onOpenChange:c,dir:r,modal:a,children:n})})};HC.displayName=Lg;var KC="DropdownMenuTrigger",GC=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:r=!1,...o}=e,i=VC(KC,n),s=bt(n);return p.jsx(qD,{asChild:!0,...s,children:p.jsx(de.button,{type:"button",id:i.triggerId,"aria-haspopup":"menu","aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":i.open?"open":"closed","data-disabled":r?"":void 0,disabled:r,...o,ref:yc(t,i.triggerRef),onPointerDown:re(e.onPointerDown,a=>{!r&&a.button===0&&a.ctrlKey===!1&&(i.onOpenToggle(),i.open||a.preventDefault())}),onKeyDown:re(e.onKeyDown,a=>{r||(["Enter"," "].includes(a.key)&&i.onOpenToggle(),a.key==="ArrowDown"&&i.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(a.key)&&a.preventDefault())})})})});GC.displayName=KC;var cI="DropdownMenuPortal",WC=e=>{const{__scopeDropdownMenu:t,...n}=e,r=bt(t);return p.jsx(QD,{...r,...n})};WC.displayName=cI;var qC="DropdownMenuContent",QC=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=VC(qC,n),i=bt(n),s=h.useRef(!1);return p.jsx(YD,{id:o.contentId,"aria-labelledby":o.triggerId,...i,...r,ref:t,onCloseAutoFocus:re(e.onCloseAutoFocus,a=>{var l;s.current||(l=o.triggerRef.current)==null||l.focus(),s.current=!1,a.preventDefault()}),onInteractOutside:re(e.onInteractOutside,a=>{const l=a.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0,d=l.button===2||u;(!o.modal||d)&&(s.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});QC.displayName=qC;var dI="DropdownMenuGroup",fI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(XD,{...o,...r,ref:t})});fI.displayName=dI;var pI="DropdownMenuLabel",YC=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(JD,{...o,...r,ref:t})});YC.displayName=pI;var hI="DropdownMenuItem",XC=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(ZD,{...o,...r,ref:t})});XC.displayName=hI;var gI="DropdownMenuCheckboxItem",JC=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(eI,{...o,...r,ref:t})});JC.displayName=gI;var mI="DropdownMenuRadioGroup",ZC=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(tI,{...o,...r,ref:t})});ZC.displayName=mI;var vI="DropdownMenuRadioItem",eb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(nI,{...o,...r,ref:t})});eb.displayName=vI;var yI="DropdownMenuItemIndicator",tb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(rI,{...o,...r,ref:t})});tb.displayName=yI;var wI="DropdownMenuSeparator",nb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(oI,{...o,...r,ref:t})});nb.displayName=wI;var xI="DropdownMenuArrow",SI=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(iI,{...o,...r,ref:t})});SI.displayName=xI;var CI="DropdownMenuSubTrigger",rb=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(sI,{...o,...r,ref:t})});rb.displayName=CI;var bI="DropdownMenuSubContent",ob=h.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...r}=e,o=bt(n);return p.jsx(aI,{...o,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})});ob.displayName=bI;var RI=HC,EI=GC,PI=WC,ib=QC,sb=YC,ab=XC,lb=JC,_I=ZC,ub=eb,cb=tb,db=nb,fb=rb,pb=ob;const Pa=RI,_a=EI,TI=_I,MI=h.forwardRef(({className:e,inset:t,children:n,...r},o)=>p.jsxs(fb,{ref:o,className:G("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",t&&"pl-8",e),...r,children:[n,p.jsx(CS,{className:"ml-auto h-4 w-4"})]}));MI.displayName=fb.displayName;const AI=h.forwardRef(({className:e,...t},n)=>p.jsx(pb,{ref:n,className:G("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...t}));AI.displayName=pb.displayName;const ts=h.forwardRef(({className:e,sideOffset:t=4,...n},r)=>p.jsx(PI,{children:p.jsx(ib,{ref:r,sideOffset:t,className:G("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 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",e),...n})}));ts.displayName=ib.displayName;const zt=h.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(ab,{ref:r,className:G("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",t&&"pl-8",e),...n}));zt.displayName=ab.displayName;const kI=h.forwardRef(({className:e,children:t,checked:n,...r},o)=>p.jsxs(lb,{ref:o,className:G("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:n,...r,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(cb,{children:p.jsx(QN,{className:"h-4 w-4"})})}),t]}));kI.displayName=lb.displayName;const Tp=h.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(ub,{ref:r,className:G("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[p.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:p.jsx(cb,{children:p.jsx(tj,{className:"h-4 w-4 fill-current"})})}),t]}));Tp.displayName=ub.displayName;const $g=h.forwardRef(({className:e,inset:t,...n},r)=>p.jsx(sb,{ref:r,className:G("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));$g.displayName=sb.displayName;const Ic=h.forwardRef(({className:e,...t},n)=>p.jsx(db,{ref:n,className:G("-mx-1 my-1 h-px bg-muted",e),...t}));Ic.displayName=db.displayName;var Ug="Avatar",[NI,g$]=pr(Ug),[jI,hb]=NI(Ug),gb=h.forwardRef((e,t)=>{const{__scopeAvatar:n,...r}=e,[o,i]=h.useState("idle");return p.jsx(jI,{scope:n,imageLoadingStatus:o,onImageLoadingStatusChange:i,children:p.jsx(de.span,{...r,ref:t})})});gb.displayName=Ug;var mb="AvatarImage",vb=h.forwardRef((e,t)=>{const{__scopeAvatar:n,src:r,onLoadingStatusChange:o=()=>{},...i}=e,s=hb(mb,n),a=OI(r,i.referrerPolicy),l=mt(u=>{o(u),s.onImageLoadingStatusChange(u)});return Cn(()=>{a!=="idle"&&l(a)},[a,l]),a==="loaded"?p.jsx(de.img,{...i,ref:t,src:r}):null});vb.displayName=mb;var yb="AvatarFallback",wb=h.forwardRef((e,t)=>{const{__scopeAvatar:n,delayMs:r,...o}=e,i=hb(yb,n),[s,a]=h.useState(r===void 0);return h.useEffect(()=>{if(r!==void 0){const l=window.setTimeout(()=>a(!0),r);return()=>window.clearTimeout(l)}},[r]),s&&i.imageLoadingStatus!=="loaded"?p.jsx(de.span,{...o,ref:t}):null});wb.displayName=yb;function OI(e,t){const[n,r]=h.useState("idle");return Cn(()=>{if(!e){r("error");return}let o=!0;const i=new window.Image,s=a=>()=>{o&&r(a)};return r("loading"),i.onload=s("loaded"),i.onerror=s("error"),i.src=e,t&&(i.referrerPolicy=t),()=>{o=!1}},[e,t]),n}var xb=gb,Sb=vb,Cb=wb;const bb=h.forwardRef(({className:e,...t},n)=>p.jsx(xb,{ref:n,className:G("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",e),...t}));bb.displayName=xb.displayName;const Rb=h.forwardRef(({className:e,...t},n)=>p.jsx(Sb,{ref:n,className:G("aspect-square h-full w-full",e),...t}));Rb.displayName=Sb.displayName;const Eb=h.forwardRef(({className:e,...t},n)=>p.jsx(Cb,{ref:n,className:G("flex h-full w-full items-center justify-center rounded-full bg-muted",e),...t}));Eb.displayName=Cb.displayName;const Pb=({user:e})=>{var n,r,o,i,s,a,l,u;const t=KA(e.name);return p.jsx(bb,{className:"h-8 w-8",children:(r=(n=e.photo)==null?void 0:n[0])!=null&&r.url||(i=(o=e.photo)==null?void 0:o[0])!=null&&i.data?p.jsx(Rb,{src:((a=(s=e.photo)==null?void 0:s[0])==null?void 0:a.url)||((u=(l=e.photo)==null?void 0:l[0])==null?void 0:u.data),alt:name}):p.jsx(Eb,{className:e.resourceType==="Patient"?"bg-pink-400 text-pink-50":"bg-teal-400 text-teal-50",children:t})})},DI=()=>{const{user:e}=Go(),t=Ko(),n=ls(),r=()=>{var o;(o=t._clearState)==null||o.call(t),n("/"),window.location.reload()};return p.jsxs(Pa,{children:[p.jsx(_a,{asChild:!0,children:p.jsxs(Tt,{variant:"ghost",className:"flex items-center h-11",children:[p.jsx(Pb,{user:e}),p.jsx("span",{className:"hidden md:block",children:cs(e.name)}),p.jsx(L1,{className:"h-4 w-4 opacity-50"})]})}),p.jsxs(ts,{align:"end",className:"w-56",children:[p.jsxs(zt,{children:[p.jsx(Sk,{}),e.resourceType," profile"]}),p.jsxs(zt,{children:[p.jsx(mk,{}),"Settings"]}),p.jsx(Ic,{}),p.jsxs(zt,{onClick:r,children:[p.jsx(fk,{className:"h-4 w-4"}),p.jsx("span",{children:"Log out"})]})]})]})};function II({title:e}){return p.jsxs("header",{className:"flex h-16 items-center border-b px-4 flex-shrink-0 gap-4",children:[p.jsx(sC,{}),e,p.jsxs("div",{className:"flex items-center gap-2 ml-auto",children:[p.jsxs(Tt,{variant:"ghost",size:"icon",children:[p.jsx(ik,{className:"h-5 w-5"}),p.jsx("span",{className:"sr-only",children:"Notifications"})]}),p.jsx(DI,{})]})]})}const Gu=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:G("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Gu.displayName="Card";const Wu=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:G("flex flex-col space-y-1.5 p-6",e),...t}));Wu.displayName="CardHeader";const qu=h.forwardRef(({className:e,...t},n)=>p.jsx("h3",{ref:n,className:G("font-semibold leading-none tracking-tight",e),...t}));qu.displayName="CardTitle";const Mp=h.forwardRef(({className:e,...t},n)=>p.jsx("p",{ref:n,className:G("text-sm text-muted-foreground",e),...t}));Mp.displayName="CardDescription";const zg=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:G("p-6 pt-0",e),...t}));zg.displayName="CardContent";const Ap=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{ref:n,className:G("flex items-center p-6 pt-0",e),...t}));Ap.displayName="CardFooter";const FI=()=>{const{patient:e,user:t}=Go();if(!e||t.resourceType==="Patient")return;const n=cs(e.name),r=e.birthDate?new Date().getFullYear()-new Date(e.birthDate).getFullYear():"unknown",o=e.address?VA(e.address):"unknown",i=HA(e.gender);return p.jsxs(Gu,{className:"mx-4 mb-4 shadow-none",children:[p.jsxs(Wu,{className:"px-4 space-y-0 py-2 border-b flex-row items-center",children:[p.jsx(qu,{children:"Current Patient"}),p.jsxs(Pa,{children:[p.jsx(_a,{asChild:!0,children:p.jsxs(Tt,{variant:"ghost",className:"h-8 w-8 ml-auto",children:[p.jsx("span",{className:"sr-only",children:"Open menu"}),p.jsx(lg,{className:"h-4 w-4"})]})}),p.jsx(ts,{align:"start",children:p.jsxs(zt,{onClick:()=>navigator.clipboard.writeText(e.id),children:[p.jsx(ag,{}),"Copy ID"]})})]})]}),p.jsxs(zg,{className:"px-4 py-3",children:[p.jsxs("div",{className:"flex items-start gap-3 mb-2",children:[p.jsx(Pb,{user:e}),p.jsxs("div",{className:"flex flex-col text-sm",children:[p.jsx("div",{className:" font-medium",children:n}),p.jsxs("div",{className:"text-xs text-muted-foreground",children:[i,", ",r," years old"]})]})]}),p.jsx("div",{className:"text-xs text-muted-foreground",children:o})]})]})},LI=()=>{const{user:e}=Go(),t=Vo();return p.jsxs(iC,{className:"border-r",children:[p.jsx(uC,{className:"h-16 items-center flex-row px-4",children:p.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:e.resourceType==="Patient"?"Patient Portal":"Provider EHR"})}),p.jsx(dC,{children:p.jsxs(fC,{children:[p.jsx(po,{children:p.jsx(ho,{asChild:!0,isActive:t.pathname==="/",children:p.jsxs(Xs,{to:"/",children:[p.jsx(ck,{className:"mr-2 h-5 w-5"}),"Dashboard"]})})}),e.resourceType==="Practitioner"&&p.jsxs(p.Fragment,{children:[p.jsx(po,{children:p.jsxs(ho,{children:[p.jsx(bk,{className:"mr-2 h-5 w-5"}),"Patients"]})}),p.jsx(po,{children:p.jsxs(ho,{children:[p.jsx(ak,{className:"mr-2 h-5 w-5"}),"Appointments"]})}),p.jsx(Ep,{}),p.jsx(po,{children:p.jsx(ho,{asChild:!0,isActive:t.pathname==="/questionnaires",children:p.jsxs(Xs,{to:"/questionnaires",children:[p.jsx(uk,{className:"mr-2 h-5 w-5"}),"Questionnaires"]})})})]}),p.jsx(po,{children:p.jsx(ho,{asChild:!0,isActive:t.pathname==="/questionnaire-responses",children:p.jsxs(Xs,{to:"/questionnaire-responses",children:[p.jsx(yk,{className:"mr-2 h-5 w-5"}),"Questionnaire Responses"]})})}),p.jsx(Ep,{}),p.jsx(po,{children:p.jsxs(ho,{children:[p.jsx(vk,{className:"mr-2 h-5 w-5"}),"Settings"]})})]})}),p.jsx(cC,{children:p.jsx(FI,{})}),p.jsx(aC,{})]})},_b=e=>p.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 300 150",...e,children:p.jsx("path",{fill:"none",stroke:"#EA4A35",strokeWidth:"15",strokeLinecap:"round",strokeDasharray:"300 385",strokeDashoffset:"0",d:"M275 75c0 31-27 50-50 50-58 0-92-100-150-100-28 0-50 22-50 50s23 50 50 50c58 0 92-100 150-100 24 0 50 19 50 50Z",children:p.jsx("animate",{attributeName:"stroke-dashoffset",calcMode:"spline",dur:"2",values:"685;-685",keySplines:"0 0 1 1",repeatCount:"indefinite"})})}),Bg=()=>p.jsx("div",{className:"flex-1 grid place-items-center",children:p.jsx(_b,{width:"80"})}),$I=()=>p.jsx(aA,{children:p.jsx(uA,{children:p.jsx(oC,{style:{"--sidebar-width":"18rem"},children:p.jsx("div",{className:"flex h-screen flex-col w-full",children:p.jsxs("div",{className:"flex flex-1 overflow-hidden",children:[p.jsx(LI,{}),p.jsxs(lC,{className:"flex-1",children:[p.jsx(II,{}),p.jsx(h.Suspense,{fallback:p.jsx(Bg,{}),children:p.jsx(Hx,{})})]})]})})})})});function UI(e,t=[]){let n=[];function r(i,s){const a=h.createContext(s),l=n.length;n=[...n,s];function u(c){const{scope:f,children:m,...y}=c,v=(f==null?void 0:f[e][l])||a,S=h.useMemo(()=>y,Object.values(y));return p.jsx(v.Provider,{value:S,children:m})}function d(c,f){const m=(f==null?void 0:f[e][l])||a,y=h.useContext(m);if(y)return y;if(s!==void 0)return s;throw new Error(`\`${c}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const o=()=>{const i=n.map(s=>h.createContext(s));return function(a){const l=(a==null?void 0:a[e])||i;return h.useMemo(()=>({[`__scope${e}`]:{...a,[e]:l}}),[a,l])}};return o.scopeName=e,[r,zI(o,...t)]}function zI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const s=r.reduce((a,{useScope:l,scopeName:u})=>{const c=l(i)[`__scope${u}`];return{...a,...c}},{});return h.useMemo(()=>({[`__scope${t.scopeName}`]:s}),[s])}};return n.scopeName=t.scopeName,n}var Vg="Progress",Hg=100,[BI,m$]=UI(Vg),[VI,HI]=BI(Vg),Tb=h.forwardRef((e,t)=>{const{__scopeProgress:n,value:r=null,max:o,getValueLabel:i=KI,...s}=e;(o||o===0)&&!zy(o)&&console.error(GI(`${o}`,"Progress"));const a=zy(o)?o:Hg;r!==null&&!By(r,a)&&console.error(WI(`${r}`,"Progress"));const l=By(r,a)?r:null,u=Qu(l)?i(l,a):void 0;return p.jsx(VI,{scope:n,value:l,max:a,children:p.jsx(de.div,{"aria-valuemax":a,"aria-valuemin":0,"aria-valuenow":Qu(l)?l:void 0,"aria-valuetext":u,role:"progressbar","data-state":kb(l,a),"data-value":l??void 0,"data-max":a,...s,ref:t})})});Tb.displayName=Vg;var Mb="ProgressIndicator",Ab=h.forwardRef((e,t)=>{const{__scopeProgress:n,...r}=e,o=HI(Mb,n);return p.jsx(de.div,{"data-state":kb(o.value,o.max),"data-value":o.value??void 0,"data-max":o.max,...r,ref:t})});Ab.displayName=Mb;function KI(e,t){return`${Math.round(e/t*100)}%`}function kb(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function Qu(e){return typeof e=="number"}function zy(e){return Qu(e)&&!isNaN(e)&&e>0}function By(e,t){return Qu(e)&&!isNaN(e)&&e<=t&&e>=0}function GI(e,t){return`Invalid prop \`max\` of value \`${e}\` supplied to \`${t}\`. Only numbers greater than 0 are valid max values. Defaulting to \`${Hg}\`.`}function WI(e,t){return`Invalid prop \`value\` of value \`${e}\` supplied to \`${t}\`. The \`value\` prop must be: - - a positive number - - less than the value passed to \`max\` (or ${Hg} if no \`max\` prop is set) - - \`null\` or \`undefined\` if the progress is indeterminate. - -Defaulting to \`null\`.`}var Nb=Tb,qI=Ab;const jb=h.forwardRef(({className:e,value:t,...n},r)=>p.jsx(Nb,{ref:r,className:G("relative h-2 w-full overflow-hidden rounded-full bg-primary/20",e),...n,children:p.jsx(qI,{className:"h-full w-full flex-1 bg-primary transition-all",style:{transform:`translateX(-${100-(t||0)}%)`}})}));jb.displayName=Nb.displayName;const Ob=({active:e})=>{const[t,n]=h.useState(0),[r,o]=h.useState(!1),i=h.useRef(null);return h.useEffect(()=>{if(e)o(!0),n(0),i.current=setInterval(()=>{n(s=>{if(s>=99.8)return s;const a=(100-s)/30;return s+a})},100);else{clearInterval(i.current),n(100);const s=setTimeout(()=>{o(!1)},500);return()=>clearTimeout(s)}return()=>{clearInterval(i.current)}},[e]),r?p.jsx(jb,{value:t,className:"rounded-none h-[3px]"}):p.jsx("div",{className:"h-[3px] w-full"})};function Db(e){var t=h.useRef(e);return t.current=e,t}var QI=function(e){var t=Db(e);h.useEffect(function(){return function(){t.current()}},[])};function YI(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Kg=YI,XI=typeof Xn=="object"&&Xn&&Xn.Object===Object&&Xn,JI=XI,ZI=JI,eF=typeof self=="object"&&self&&self.Object===Object&&self,tF=ZI||eF||Function("return this")(),Ib=tF,nF=Ib,rF=function(){return nF.Date.now()},oF=rF,iF=/\s/;function sF(e){for(var t=e.length;t--&&iF.test(e.charAt(t)););return t}var aF=sF,lF=aF,uF=/^\s+/;function cF(e){return e&&e.slice(0,lF(e)+1).replace(uF,"")}var dF=cF,fF=Ib,pF=fF.Symbol,Fb=pF,Vy=Fb,Lb=Object.prototype,hF=Lb.hasOwnProperty,gF=Lb.toString,Ns=Vy?Vy.toStringTag:void 0;function mF(e){var t=hF.call(e,Ns),n=e[Ns];try{e[Ns]=void 0;var r=!0}catch{}var o=gF.call(e);return r&&(t?e[Ns]=n:delete e[Ns]),o}var vF=mF,yF=Object.prototype,wF=yF.toString;function xF(e){return wF.call(e)}var SF=xF,Hy=Fb,CF=vF,bF=SF,RF="[object Null]",EF="[object Undefined]",Ky=Hy?Hy.toStringTag:void 0;function PF(e){return e==null?e===void 0?EF:RF:Ky&&Ky in Object(e)?CF(e):bF(e)}var _F=PF;function TF(e){return e!=null&&typeof e=="object"}var MF=TF,AF=_F,kF=MF,NF="[object Symbol]";function jF(e){return typeof e=="symbol"||kF(e)&&AF(e)==NF}var OF=jF,DF=dF,Gy=Kg,IF=OF,Wy=NaN,FF=/^[-+]0x[0-9a-f]+$/i,LF=/^0b[01]+$/i,$F=/^0o[0-7]+$/i,UF=parseInt;function zF(e){if(typeof e=="number")return e;if(IF(e))return Wy;if(Gy(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Gy(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=DF(e);var n=LF.test(e);return n||$F.test(e)?UF(e.slice(2),n?2:8):FF.test(e)?Wy:+e}var BF=zF,VF=Kg,$d=oF,qy=BF,HF="Expected a function",KF=Math.max,GF=Math.min;function WF(e,t,n){var r,o,i,s,a,l,u=0,d=!1,c=!1,f=!0;if(typeof e!="function")throw new TypeError(HF);t=qy(t)||0,VF(n)&&(d=!!n.leading,c="maxWait"in n,i=c?KF(qy(n.maxWait)||0,t):i,f="trailing"in n?!!n.trailing:f);function m(b){var A=r,T=o;return r=o=void 0,u=b,s=e.apply(T,A),s}function y(b){return u=b,a=setTimeout(w,t),d?m(b):s}function v(b){var A=b-l,T=b-u,$=t-A;return c?GF($,i-T):$}function S(b){var A=b-l,T=b-u;return l===void 0||A>=t||A<0||c&&T>=i}function w(){var b=$d();if(S(b))return g(b);a=setTimeout(w,v(b))}function g(b){return a=void 0,f&&r?m(b):(r=o=void 0,s)}function x(){a!==void 0&&clearTimeout(a),u=0,r=l=o=a=void 0}function C(){return a===void 0?s:g($d())}function P(){var b=$d(),A=S(b);if(r=arguments,o=this,l=b,A){if(a===void 0)return y(l);if(c)return clearTimeout(a),a=setTimeout(w,t),m(l)}return a===void 0&&(a=setTimeout(w,t)),s}return P.cancel=x,P.flush=C,P}var qF=WF,QF=qF,YF=Kg,XF="Expected a function";function JF(e,t,n){var r=!0,o=!0;if(typeof e!="function")throw new TypeError(XF);return YF(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),QF(e,t,{leading:r,maxWait:t,trailing:o})}var ZF=JF;const eL=Kp(ZF);function tL(e,t){var n,r=Db(e),o=(n=t==null?void 0:t.wait)!==null&&n!==void 0?n:1e3,i=h.useMemo(function(){return eL(function(){for(var s=[],a=0;a{if(zd.has(e))return;const t=setTimeout(()=>{zd.delete(e),ea({type:"REMOVE_TOAST",toastId:e})},oL);zd.set(e,t)},sL=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,rL)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?Qy(n):e.toasts.forEach(r=>{Qy(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},tu=[];let nu={toasts:[]};function ea(e){nu=sL(nu,e),tu.forEach(t=>{t(nu)})}function aL({...e}){const t=iL(),n=o=>ea({type:"UPDATE_TOAST",toast:{...o,id:t}}),r=()=>ea({type:"DISMISS_TOAST",toastId:t});return ea({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:o=>{o||r()}}}),{id:t,dismiss:r,update:n}}function hs(){const[e,t]=h.useState(nu);return h.useEffect(()=>(tu.push(t),()=>{const n=tu.indexOf(t);n>-1&&tu.splice(n,1)}),[e]),{...e,toast:aL,dismiss:n=>ea({type:"DISMISS_TOAST",toastId:n})}}var Gg="ToastProvider",[Wg,lL,uL]=Mg("Toast"),[$b,v$]=pr("Toast",[uL]),[cL,Fc]=$b(Gg),Ub=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:o="right",swipeThreshold:i=50,children:s}=e,[a,l]=h.useState(null),[u,d]=h.useState(0),c=h.useRef(!1),f=h.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${Gg}\`. Expected non-empty \`string\`.`),p.jsx(Wg.Provider,{scope:t,children:p.jsx(cL,{scope:t,label:n,duration:r,swipeDirection:o,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:h.useCallback(()=>d(m=>m+1),[]),onToastRemove:h.useCallback(()=>d(m=>m-1),[]),isFocusedToastEscapeKeyDownRef:c,isClosePausedRef:f,children:s})})};Ub.displayName=Gg;var zb="ToastViewport",dL=["F8"],kp="toast.viewportPause",Np="toast.viewportResume",Bb=h.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=dL,label:o="Notifications ({hotkey})",...i}=e,s=Fc(zb,n),a=lL(n),l=h.useRef(null),u=h.useRef(null),d=h.useRef(null),c=h.useRef(null),f=Le(t,c,s.onViewportChange),m=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),y=s.toastCount>0;h.useEffect(()=>{const S=w=>{var x;r.length!==0&&r.every(C=>w[C]||w.code===C)&&((x=c.current)==null||x.focus())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[r]),h.useEffect(()=>{const S=l.current,w=c.current;if(y&&S&&w){const g=()=>{if(!s.isClosePausedRef.current){const b=new CustomEvent(kp);w.dispatchEvent(b),s.isClosePausedRef.current=!0}},x=()=>{if(s.isClosePausedRef.current){const b=new CustomEvent(Np);w.dispatchEvent(b),s.isClosePausedRef.current=!1}},C=b=>{!S.contains(b.relatedTarget)&&x()},P=()=>{S.contains(document.activeElement)||x()};return S.addEventListener("focusin",g),S.addEventListener("focusout",C),S.addEventListener("pointermove",g),S.addEventListener("pointerleave",P),window.addEventListener("blur",g),window.addEventListener("focus",x),()=>{S.removeEventListener("focusin",g),S.removeEventListener("focusout",C),S.removeEventListener("pointermove",g),S.removeEventListener("pointerleave",P),window.removeEventListener("blur",g),window.removeEventListener("focus",x)}}},[y,s.isClosePausedRef]);const v=h.useCallback(({tabbingDirection:S})=>{const g=a().map(x=>{const C=x.ref.current,P=[C,...RL(C)];return S==="forwards"?P:P.reverse()});return(S==="forwards"?g.reverse():g).flat()},[a]);return h.useEffect(()=>{const S=c.current;if(S){const w=g=>{var P,b,A;const x=g.altKey||g.ctrlKey||g.metaKey;if(g.key==="Tab"&&!x){const T=document.activeElement,$=g.shiftKey;if(g.target===S&&$){(P=u.current)==null||P.focus();return}const F=v({tabbingDirection:$?"backwards":"forwards"}),L=F.findIndex(R=>R===T);Bd(F.slice(L+1))?g.preventDefault():$?(b=u.current)==null||b.focus():(A=d.current)==null||A.focus()}};return S.addEventListener("keydown",w),()=>S.removeEventListener("keydown",w)}},[a,v]),p.jsxs(Bk,{ref:l,role:"region","aria-label":o.replace("{hotkey}",m),tabIndex:-1,style:{pointerEvents:y?void 0:"none"},children:[y&&p.jsx(jp,{ref:u,onFocusFromOutsideViewport:()=>{const S=v({tabbingDirection:"forwards"});Bd(S)}}),p.jsx(Wg.Slot,{scope:n,children:p.jsx(de.ol,{tabIndex:-1,...i,ref:f})}),y&&p.jsx(jp,{ref:d,onFocusFromOutsideViewport:()=>{const S=v({tabbingDirection:"backwards"});Bd(S)}})]})});Bb.displayName=zb;var Vb="ToastFocusProxy",jp=h.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...o}=e,i=Fc(Vb,n);return p.jsx(_c,{"aria-hidden":!0,tabIndex:0,...o,ref:t,style:{position:"fixed"},onFocus:s=>{var u;const a=s.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});jp.displayName=Vb;var Lc="Toast",fL="toast.swipeStart",pL="toast.swipeMove",hL="toast.swipeCancel",gL="toast.swipeEnd",Hb=h.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:o,onOpenChange:i,...s}=e,[a=!0,l]=Wo({prop:r,defaultProp:o,onChange:i});return p.jsx(Qt,{present:n||a,children:p.jsx(yL,{open:a,...s,ref:t,onClose:()=>l(!1),onPause:mt(e.onPause),onResume:mt(e.onResume),onSwipeStart:re(e.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:re(e.onSwipeMove,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${c}px`)}),onSwipeCancel:re(e.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:re(e.onSwipeEnd,u=>{const{x:d,y:c}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${c}px`),l(!1)})})})});Hb.displayName=Lc;var[mL,vL]=$b(Lc,{onClose(){}}),yL=h.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:o,open:i,onClose:s,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:c,onSwipeCancel:f,onSwipeEnd:m,...y}=e,v=Fc(Lc,n),[S,w]=h.useState(null),g=Le(t,R=>w(R)),x=h.useRef(null),C=h.useRef(null),P=o||v.duration,b=h.useRef(0),A=h.useRef(P),T=h.useRef(0),{onToastAdd:$,onToastRemove:E}=v,O=mt(()=>{var M;(S==null?void 0:S.contains(document.activeElement))&&((M=v.viewport)==null||M.focus()),s()}),F=h.useCallback(R=>{!R||R===1/0||(window.clearTimeout(T.current),b.current=new Date().getTime(),T.current=window.setTimeout(O,R))},[O]);h.useEffect(()=>{const R=v.viewport;if(R){const M=()=>{F(A.current),u==null||u()},j=()=>{const B=new Date().getTime()-b.current;A.current=A.current-B,window.clearTimeout(T.current),l==null||l()};return R.addEventListener(kp,j),R.addEventListener(Np,M),()=>{R.removeEventListener(kp,j),R.removeEventListener(Np,M)}}},[v.viewport,P,l,u,F]),h.useEffect(()=>{i&&!v.isClosePausedRef.current&&F(P)},[i,P,v.isClosePausedRef,F]),h.useEffect(()=>($(),()=>E()),[$,E]);const L=h.useMemo(()=>S?Xb(S):null,[S]);return v.viewport?p.jsxs(p.Fragment,{children:[L&&p.jsx(wL,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:L}),p.jsx(mL,{scope:n,onClose:O,children:is.createPortal(p.jsx(Wg.ItemSlot,{scope:n,children:p.jsx(zk,{asChild:!0,onEscapeKeyDown:re(a,()=>{v.isFocusedToastEscapeKeyDownRef.current||O(),v.isFocusedToastEscapeKeyDownRef.current=!1}),children:p.jsx(de.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":v.swipeDirection,...y,ref:g,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:re(e.onKeyDown,R=>{R.key==="Escape"&&(a==null||a(R.nativeEvent),R.nativeEvent.defaultPrevented||(v.isFocusedToastEscapeKeyDownRef.current=!0,O()))}),onPointerDown:re(e.onPointerDown,R=>{R.button===0&&(x.current={x:R.clientX,y:R.clientY})}),onPointerMove:re(e.onPointerMove,R=>{if(!x.current)return;const M=R.clientX-x.current.x,j=R.clientY-x.current.y,B=!!C.current,D=["left","right"].includes(v.swipeDirection),N=["left","up"].includes(v.swipeDirection)?Math.min:Math.max,V=D?N(0,M):0,Q=D?0:N(0,j),te=R.pointerType==="touch"?10:2,pe={x:V,y:Q},ge={originalEvent:R,delta:pe};B?(C.current=pe,Nl(pL,c,ge,{discrete:!1})):Yy(pe,v.swipeDirection,te)?(C.current=pe,Nl(fL,d,ge,{discrete:!1}),R.target.setPointerCapture(R.pointerId)):(Math.abs(M)>te||Math.abs(j)>te)&&(x.current=null)}),onPointerUp:re(e.onPointerUp,R=>{const M=C.current,j=R.target;if(j.hasPointerCapture(R.pointerId)&&j.releasePointerCapture(R.pointerId),C.current=null,x.current=null,M){const B=R.currentTarget,D={originalEvent:R,delta:M};Yy(M,v.swipeDirection,v.swipeThreshold)?Nl(gL,m,D,{discrete:!0}):Nl(hL,f,D,{discrete:!0}),B.addEventListener("click",N=>N.preventDefault(),{once:!0})}})})})}),v.viewport)})]}):null}),wL=e=>{const{__scopeToast:t,children:n,...r}=e,o=Fc(Lc,t),[i,s]=h.useState(!1),[a,l]=h.useState(!1);return CL(()=>s(!0)),h.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:p.jsx(Ba,{asChild:!0,children:p.jsx(_c,{...r,children:i&&p.jsxs(p.Fragment,{children:[o.label," ",n]})})})},xL="ToastTitle",Kb=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return p.jsx(de.div,{...r,ref:t})});Kb.displayName=xL;var SL="ToastDescription",Gb=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return p.jsx(de.div,{...r,ref:t})});Gb.displayName=SL;var Wb="ToastAction",qb=h.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?p.jsx(Yb,{altText:n,asChild:!0,children:p.jsx(qg,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Wb}\`. Expected non-empty \`string\`.`),null)});qb.displayName=Wb;var Qb="ToastClose",qg=h.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,o=vL(Qb,n);return p.jsx(Yb,{asChild:!0,children:p.jsx(de.button,{type:"button",...r,ref:t,onClick:re(e.onClick,o.onClose)})})});qg.displayName=Qb;var Yb=h.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...o}=e;return p.jsx(de.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...o,ref:t})});function Xb(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),bL(r)){const o=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!o)if(i){const s=r.dataset.radixToastAnnounceAlt;s&&t.push(s)}else t.push(...Xb(r))}}),t}function Nl(e,t,n,{discrete:r}){const o=n.originalEvent.currentTarget,i=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?ug(o,i):o.dispatchEvent(i)}var Yy=(e,t,n=0)=>{const r=Math.abs(e.x),o=Math.abs(e.y),i=r>o;return t==="left"||t==="right"?i&&r>n:!i&&o>n};function CL(e=()=>{}){const t=mt(e);Cn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function bL(e){return e.nodeType===e.ELEMENT_NODE}function RL(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function Bd(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var EL=Ub,Jb=Bb,Zb=Hb,eR=Kb,tR=Gb,nR=qb,rR=qg;const PL=EL,oR=h.forwardRef(({className:e,...t},n)=>p.jsx(Jb,{ref:n,className:G("fixed top-0 left-1/2 -translate-x-1/2 z-[100] gap-2 flex max-h-screen w-full flex-col-reverse p-4 md:max-w-[420px]",e),...t}));oR.displayName=Jb.displayName;const _L=Ua("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-top-full data-[state=open]:slide-in-from-top-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),iR=h.forwardRef(({className:e,variant:t,...n},r)=>p.jsx(Zb,{ref:r,className:G(_L({variant:t}),e),...n}));iR.displayName=Zb.displayName;const sR=h.forwardRef(({className:e,...t},n)=>p.jsx(nR,{ref:n,className:G("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));sR.displayName=nR.displayName;const aR=h.forwardRef(({className:e,...t},n)=>p.jsx(rR,{ref:n,className:G("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:p.jsx(yg,{className:"h-4 w-4"})}));aR.displayName=rR.displayName;const lR=h.forwardRef(({className:e,...t},n)=>p.jsx(eR,{ref:n,className:G("text-sm font-semibold [&+div]:text-xs",e),...t}));lR.displayName=eR.displayName;const uR=h.forwardRef(({className:e,...t},n)=>p.jsx(tR,{ref:n,className:G("text-sm opacity-90",e),...t}));uR.displayName=tR.displayName;/** - * table-core - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Br(e,t){return typeof e=="function"?e(t):e}function Gt(e,t){return n=>{t.setState(r=>({...r,[e]:Br(n,r[e])}))}}function $c(e){return e instanceof Function}function TL(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function ML(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function le(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((d,c)=>r[c]!==d)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const d=Math.round((Date.now()-s)*100)/100,c=Math.round((Date.now()-u)*100)/100,f=c/16,m=(y,v)=>{for(y=String(y);y.length{var o;return(o=e==null?void 0:e.debugAll)!=null?o:e[t]},key:!1,onChange:r}}function AL(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:le(()=>[e,n,t,i],(s,a,l,u)=>({table:s,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ue(e.options,"debugCells"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function kL(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,d;if(a.accessorFn?d=a.accessorFn:l&&(l.includes(".")?d=f=>{let m=f;for(const v of l.split(".")){var y;m=(y=m)==null?void 0:y[v]}return m}:d=f=>f[a.accessorKey]),!u)throw new Error;let c={id:`${String(u)}`,accessorFn:d,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:le(()=>[!0],()=>{var f;return[c,...(f=c.columns)==null?void 0:f.flatMap(m=>m.getFlatColumns())]},ue(e.options,"debugColumns")),getLeafColumns:le(()=>[e._getOrderColumnsFn()],f=>{var m;if((m=c.columns)!=null&&m.length){let y=c.columns.flatMap(v=>v.getLeafColumns());return f(y)}return[c]},ue(e.options,"debugColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(c,e);return c}const ft="debugHeaders";function Xy(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const NL={createTable:e=>{e.getHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r==null?void 0:r.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?i:[],l=(s=o==null?void 0:o.map(c=>n.find(f=>f.id===c)).filter(Boolean))!=null?s:[],u=n.filter(c=>!(r!=null&&r.includes(c.id))&&!(o!=null&&o.includes(c.id)));return jl(t,[...a,...u,...l],e)},ue(e.options,ft)),e.getCenterHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),jl(t,n,e,"center")),ue(e.options,ft)),e.getLeftHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return jl(t,i,e,"left")},ue(e.options,ft)),e.getRightHeaderGroups=le(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r==null?void 0:r.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return jl(t,i,e,"right")},ue(e.options,ft)),e.getFooterGroups=le(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getLeftFooterGroups=le(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getCenterFooterGroups=le(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getRightFooterGroups=le(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ue(e.options,ft)),e.getFlatHeaders=le(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getLeftFlatHeaders=le(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getCenterFlatHeaders=le(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getRightFlatHeaders=le(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ue(e.options,ft)),e.getCenterLeafHeaders=le(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getLeftLeafHeaders=le(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getRightLeafHeaders=le(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ue(e.options,ft)),e.getLeafHeaders=le(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,u;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(d=>d.getLeafHeaders()).flat()},ue(e.options,ft))}};function jl(e,t,n,r){var o,i;let s=0;const a=function(f,m){m===void 0&&(m=1),s=Math.max(s,m),f.filter(y=>y.getIsVisible()).forEach(y=>{var v;(v=y.columns)!=null&&v.length&&a(y.columns,m+1)},0)};a(e);let l=[];const u=(f,m)=>{const y={depth:m,id:[r,`${m}`].filter(Boolean).join("_"),headers:[]},v=[];f.forEach(S=>{const w=[...v].reverse()[0],g=S.column.depth===y.depth;let x,C=!1;if(g&&S.column.parent?x=S.column.parent:(x=S.column,C=!0),w&&(w==null?void 0:w.column)===x)w.subHeaders.push(S);else{const P=Xy(n,x,{id:[r,m,x.id,S==null?void 0:S.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${v.filter(b=>b.column===x).length}`:void 0,depth:m,index:v.length});P.subHeaders.push(S),v.push(P)}y.headers.push(S),S.headerGroup=y}),l.push(y),m>0&&u(v,m-1)},d=t.map((f,m)=>Xy(n,f,{depth:s,index:m}));u(d,s-1),l.reverse();const c=f=>f.filter(y=>y.column.getIsVisible()).map(y=>{let v=0,S=0,w=[0];y.subHeaders&&y.subHeaders.length?(w=[],c(y.subHeaders).forEach(x=>{let{colSpan:C,rowSpan:P}=x;v+=C,w.push(P)})):v=1;const g=Math.min(...w);return S=S+g,y.colSpan=v,y.rowSpan=S,{colSpan:v,rowSpan:S}});return c((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const jL=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>ML(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const d=u.getParentRow();if(!d)break;l.push(d),u=d}return l.reverse()},getAllCells:le(()=>[e.getAllLeafColumns()],l=>l.map(u=>AL(e,a,u,u.id)),ue(e.options,"debugRows")),_getAllCellsByColumnId:le(()=>[a.getAllCells()],l=>l.reduce((u,d)=>(u[d.column.id]=d,u),{}),ue(e.options,"debugRows"))};for(let l=0;l{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},cR=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};cR.autoRemove=e=>xn(e);const dR=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};dR.autoRemove=e=>xn(e);const fR=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===(n==null?void 0:n.toLowerCase())};fR.autoRemove=e=>xn(e);const pR=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};pR.autoRemove=e=>xn(e)||!(e!=null&&e.length);const hR=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});hR.autoRemove=e=>xn(e)||!(e!=null&&e.length);const gR=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});gR.autoRemove=e=>xn(e)||!(e!=null&&e.length);const mR=(e,t,n)=>e.getValue(t)===n;mR.autoRemove=e=>xn(e);const vR=(e,t,n)=>e.getValue(t)==n;vR.autoRemove=e=>xn(e);const Qg=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};Qg.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};Qg.autoRemove=e=>xn(e)||xn(e[0])&&xn(e[1]);const qn={includesString:cR,includesStringSensitive:dR,equalsString:fR,arrIncludes:pR,arrIncludesAll:hR,arrIncludesSome:gR,equals:mR,weakEquals:vR,inNumberRange:Qg};function xn(e){return e==null||e===""}const DL={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:Gt("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);return typeof r=="string"?qn.includesString:typeof r=="number"?qn.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?qn.equals:Array.isArray(r)?qn.arrIncludes:qn.weakEquals},e.getFilterFn=()=>{var n,r;return $c(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:qn[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r==null?void 0:r.find(d=>d.id===e.id),s=Br(n,i?i.value:void 0);if(Jy(o,s,e)){var a;return(a=r==null?void 0:r.filter(d=>d.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var u;return(u=r==null?void 0:r.map(d=>d.id===e.id?l:d))!=null?u:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=Br(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(Jy(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function Jy(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const IL=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),FL=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},LL=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r=i)&&(r=i)}),r},$L=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},zL=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!TL(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},BL=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),VL=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,HL=(e,t)=>t.length,Vd={sum:IL,min:FL,max:LL,extent:$L,mean:UL,median:zL,unique:BL,uniqueCount:VL,count:HL},KL={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:Gt("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n==null?void 0:n.getValue(e.id);if(typeof r=="number")return Vd.sum;if(Object.prototype.toString.call(r)==="[object Date]")return Vd.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return $c(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:Vd[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function GL(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const WL={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:Gt("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=le(n=>[ta(t,n)],n=>n.findIndex(r=>r.id===e.id),ue(t.options,"debugColumns")),e.getIsFirstColumn=n=>{var r;return((r=ta(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=ta(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=le(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),u=a.findIndex(d=>d.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return GL(i,n,r)},ue(e.options,"debugTable"))}},Hd=()=>({left:[],right:[]}),qL={getInitialState:e=>({columnPinning:Hd(),...e}),getDefaultOptions:e=>({onColumnPinningChange:Gt("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o==null?void 0:o.left)!=null?a:[]).filter(c=>!(r!=null&&r.includes(c))),right:[...((l=o==null?void 0:o.right)!=null?l:[]).filter(c=>!(r!=null&&r.includes(c))),...r]}}if(n==="left"){var u,d;return{left:[...((u=o==null?void 0:o.left)!=null?u:[]).filter(c=>!(r!=null&&r.includes(c))),...r],right:((d=o==null?void 0:o.right)!=null?d:[]).filter(c=>!(r!=null&&r.includes(c)))}}return{left:((i=o==null?void 0:o.left)!=null?i:[]).filter(c=>!(r!=null&&r.includes(c))),right:((s=o==null?void 0:o.right)!=null?s:[]).filter(c=>!(r!=null&&r.includes(c)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ue(t.options,"debugRows")),e.getLeftVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ue(t.options,"debugRows")),e.getRightVisibleCells=le(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ue(t.options,"debugRows"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?Hd():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:Hd())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns")),e.getRightLeafColumns=le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ue(e.options,"debugColumns")),e.getCenterLeafColumns=le(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ue(e.options,"debugColumns"))}},Ol={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},Kd=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),QL={getDefaultColumnDef:()=>Ol,getInitialState:e=>({columnSizing:{},columnSizingInfo:Kd(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:Gt("columnSizing",e),onColumnSizingInfoChange:Gt("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Ol.minSize,(r=i??e.columnDef.size)!=null?r:Ol.size),(o=e.columnDef.maxSize)!=null?o:Ol.maxSize)},e.getStart=le(n=>[n,ta(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns")),e.getAfter=le(n=>[n,ta(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ue(t.options,"debugColumns")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r==null?void 0:r.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),Gd(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(w=>[w.column.id,w.column.getSize()]):[[r.id,r.getSize()]],l=Gd(i)?Math.round(i.touches[0].clientX):i.clientX,u={},d=(w,g)=>{typeof g=="number"&&(t.setColumnSizingInfo(x=>{var C,P;const b=t.options.columnResizeDirection==="rtl"?-1:1,A=(g-((C=x==null?void 0:x.startOffset)!=null?C:0))*b,T=Math.max(A/((P=x==null?void 0:x.startSize)!=null?P:0),-.999999);return x.columnSizingStart.forEach($=>{let[E,O]=$;u[E]=Math.round(Math.max(O+O*T,0)*100)/100}),{...x,deltaOffset:A,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||w==="end")&&t.setColumnSizing(x=>({...x,...u})))},c=w=>d("move",w),f=w=>{d("end",w),t.setColumnSizingInfo(g=>({...g,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},m=n||typeof document<"u"?document:null,y={moveHandler:w=>c(w.clientX),upHandler:w=>{m==null||m.removeEventListener("mousemove",y.moveHandler),m==null||m.removeEventListener("mouseup",y.upHandler),f(w.clientX)}},v={moveHandler:w=>(w.cancelable&&(w.preventDefault(),w.stopPropagation()),c(w.touches[0].clientX),!1),upHandler:w=>{var g;m==null||m.removeEventListener("touchmove",v.moveHandler),m==null||m.removeEventListener("touchend",v.upHandler),w.cancelable&&(w.preventDefault(),w.stopPropagation()),f((g=w.touches[0])==null?void 0:g.clientX)}},S=YL()?{passive:!1}:!1;Gd(i)?(m==null||m.addEventListener("touchmove",v.moveHandler,S),m==null||m.addEventListener("touchend",v.upHandler,S)):(m==null||m.addEventListener("mousemove",y.moveHandler,S),m==null||m.addEventListener("mouseup",y.upHandler,S)),t.setColumnSizingInfo(w=>({...w,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?Kd():(n=e.initialState.columnSizingInfo)!=null?n:Kd())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Dl=null;function YL(){if(typeof Dl=="boolean")return Dl;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Dl=e,Dl}function Gd(e){return e.type==="touchstart"}const XL={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:Gt("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=le(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ue(t.options,"debugRows")),e.getVisibleCells=le(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ue(t.options,"debugRows"))},createTable:e=>{const t=(n,r)=>le(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ue(e.options,"debugColumns"));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function ta(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const JL={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},ZL={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:Gt("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>qn.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return $c(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:qn[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},e3={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:Gt("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r!=null&&r[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Op=0,Dp=10,Wd=()=>({pageIndex:Op,pageSize:Dp}),t3={getInitialState:e=>({...e,pagination:{...Wd(),...e==null?void 0:e.pagination}}),getDefaultOptions:e=>({onPaginationChange:Gt("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>Br(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?Wd():(o=e.initialState.pagination)!=null?o:Wd())},e.setPageIndex=r=>{e.setPagination(o=>{let i=Br(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Op:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Op)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?Dp:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:Dp)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,Br(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=Br(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=le(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ue(e.options,"debugTable")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:re.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},qd=()=>({top:[],bottom:[]}),n3={getInitialState:e=>({rowPinning:qd(),...e}),getDefaultOptions:e=>({onRowPinningChange:Gt("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],s=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var u,d;if(n==="bottom"){var c,f;return{top:((c=l==null?void 0:l.top)!=null?c:[]).filter(v=>!(a!=null&&a.has(v))),bottom:[...((f=l==null?void 0:l.bottom)!=null?f:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)]}}if(n==="top"){var m,y;return{top:[...((m=l==null?void 0:l.top)!=null?m:[]).filter(v=>!(a!=null&&a.has(v))),...Array.from(a)],bottom:((y=l==null?void 0:l.bottom)!=null?y:[]).filter(v=>!(a!=null&&a.has(v)))}}return{top:((u=l==null?void 0:l.top)!=null?u:[]).filter(v=>!(a!=null&&a.has(v))),bottom:((d=l==null?void 0:l.bottom)!=null?d:[]).filter(v=>!(a!=null&&a.has(v)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r==null?void 0:r.includes(a)),s=n.some(a=>o==null?void 0:o.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i==null?void 0:i.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?qd():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:qd())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ue(e.options,"debugRows")),e.getBottomRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ue(e.options,"debugRows")),e.getCenterRows=le(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ue(e.options,"debugRows"))}},r3={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:Gt("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{Ip(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=le(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Qd(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable")),e.getFilteredSelectedRowModel=le(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Qd(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable")),e.getGroupedSelectedRowModel=le(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Qd(e,n):{rows:[],flatRows:[],rowsById:{}},ue(e.options,"debugTable")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return Ip(a,e.id,n,(s=r==null?void 0:r.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Yg(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Fp(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Fp(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},Ip=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>Ip(e,a.id,n,r,o))};function Qd(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const d=Yg(l,n);if(d&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),d)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Yg(e,t){var n;return(n=t[e.id])!=null?n:!1}function Fp(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(Yg(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Fp(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Lp=/([0-9]+)/gm,o3=(e,t,n)=>yR(ro(e.getValue(n)).toLowerCase(),ro(t.getValue(n)).toLowerCase()),i3=(e,t,n)=>yR(ro(e.getValue(n)),ro(t.getValue(n))),s3=(e,t,n)=>Xg(ro(e.getValue(n)).toLowerCase(),ro(t.getValue(n)).toLowerCase()),a3=(e,t,n)=>Xg(ro(e.getValue(n)),ro(t.getValue(n))),l3=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:rXg(e.getValue(n),t.getValue(n));function Xg(e,t){return e===t?0:e>t?1:-1}function ro(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function yR(e,t){const n=e.split(Lp).filter(Boolean),r=t.split(Lp).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const js={alphanumeric:o3,alphanumericCaseSensitive:i3,text:s3,textCaseSensitive:a3,datetime:l3,basic:u3},c3={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:Gt("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o==null?void 0:o.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return js.datetime;if(typeof i=="string"&&(r=!0,i.split(Lp).length>1))return js.alphanumeric}return r?js.text:js.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof(n==null?void 0:n.getValue(e.id))=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return $c(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:js[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s==null?void 0:s.find(m=>m.id===e.id),l=s==null?void 0:s.findIndex(m=>m.id===e.id);let u=[],d,c=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?d="toggle":d="add":s!=null&&s.length&&l!==s.length-1?d="replace":a?d="toggle":d="replace",d==="toggle"&&(i||o||(d="remove")),d==="add"){var f;u=[...s,{id:e.id,desc:c}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else d==="toggle"?u=s.map(m=>m.id===e.id?{...m,desc:c}:m):d==="remove"?u=s.filter(m=>m.id!==e.id):u=[{id:e.id,desc:c}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},d3=[NL,XL,WL,qL,OL,DL,JL,ZL,c3,KL,e3,t3,n3,r3,QL];function f3(e){var t,n;const r=[...d3,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,m)=>Object.assign(f,m.getDefaultOptions==null?void 0:m.getDefaultOptions(o)),{}),s=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var m;l=(m=f.getInitialState==null?void 0:f.getInitialState(l))!=null?m:l});const u=[];let d=!1;const c={_features:r,options:{...i,...e},initialState:l,_queue:f=>{u.push(f),d||(d=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();d=!1}).catch(m=>setTimeout(()=>{throw m})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const m=Br(f,o.options);o.options=s(m)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,m,y)=>{var v;return(v=o.options.getRowId==null?void 0:o.options.getRowId(f,m,y))!=null?v:`${y?[y.id,m].join("."):m}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,m)=>{let y=(m?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!y&&(y=o.getCoreRowModel().rowsById[f],!y))throw new Error;return y},_getDefaultColumnDef:le(()=>[o.options.defaultColumn],f=>{var m;return f=(m=f)!=null?m:{},{header:y=>{const v=y.header.column.columnDef;return v.accessorKey?v.accessorKey:v.accessorFn?v.id:null},cell:y=>{var v,S;return(v=(S=y.renderValue())==null||S.toString==null?void 0:S.toString())!=null?v:null},...o._features.reduce((y,v)=>Object.assign(y,v.getDefaultColumnDef==null?void 0:v.getDefaultColumnDef()),{}),...f}},ue(e,"debugColumns")),_getColumnDefs:()=>o.options.columns,getAllColumns:le(()=>[o._getColumnDefs()],f=>{const m=function(y,v,S){return S===void 0&&(S=0),y.map(w=>{const g=kL(o,w,S,v),x=w;return g.columns=x.columns?m(x.columns,g,S+1):[],g})};return m(f)},ue(e,"debugColumns")),getAllFlatColumns:le(()=>[o.getAllColumns()],f=>f.flatMap(m=>m.getFlatColumns()),ue(e,"debugColumns")),_getAllFlatColumnsById:le(()=>[o.getAllFlatColumns()],f=>f.reduce((m,y)=>(m[y.id]=y,m),{}),ue(e,"debugColumns")),getAllLeafColumns:le(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,m)=>{let y=f.flatMap(v=>v.getLeafColumns());return m(y)},ue(e,"debugColumns")),getColumn:f=>o._getAllFlatColumnsById()[f]};Object.assign(o,c);for(let f=0;fle(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let u=0;ue._autoResetPageIndex()))}/** - * react-table - * - * Copyright (c) TanStack - * - * This source code is licensed under the MIT license found in the - * LICENSE.md file in the root directory of this source tree. - * - * @license MIT - */function Zy(e,t){return e?h3(e)?h.createElement(e,t):e:null}function h3(e){return g3(e)||typeof e=="function"||m3(e)}function g3(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function m3(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function v3(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=h.useState(()=>({current:f3(t)})),[r,o]=h.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}const wR=h.forwardRef(({className:e,...t},n)=>p.jsx("div",{className:"relative w-full overflow-auto",children:p.jsx("table",{ref:n,className:G("w-full caption-bottom text-sm",e),...t})}));wR.displayName="Table";const xR=h.forwardRef(({className:e,...t},n)=>p.jsx("thead",{ref:n,className:G("[&_tr]:border-b",e),...t}));xR.displayName="TableHeader";const SR=h.forwardRef(({className:e,...t},n)=>p.jsx("tbody",{ref:n,className:G("[&_tr:last-child]:border-0",e),...t}));SR.displayName="TableBody";const y3=h.forwardRef(({className:e,...t},n)=>p.jsx("tfoot",{ref:n,className:G("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));y3.displayName="TableFooter";const ru=h.forwardRef(({className:e,...t},n)=>p.jsx("tr",{ref:n,className:G("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));ru.displayName="TableRow";const CR=h.forwardRef(({className:e,...t},n)=>p.jsx("th",{ref:n,className:G("h-10 px-2 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] first:pl-4",e),...t}));CR.displayName="TableHead";const $p=h.forwardRef(({className:e,...t},n)=>p.jsx("td",{ref:n,className:G("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px] first:pl-4",e),...t}));$p.displayName="TableCell";const w3=h.forwardRef(({className:e,...t},n)=>p.jsx("caption",{ref:n,className:G("mt-4 text-sm text-muted-foreground",e),...t}));w3.displayName="TableCaption";const bR=({columns:e,data:t})=>{var r;const n=v3({data:t,columns:e,getCoreRowModel:p3()});return p.jsx("div",{className:"rounded-md border",children:p.jsxs(wR,{children:[p.jsx(xR,{children:n.getHeaderGroups().map(o=>p.jsx(ru,{children:o.headers.map(i=>p.jsx(CR,{children:i.isPlaceholder?null:Zy(i.column.columnDef.header,i.getContext())},i.id))},o.id))}),p.jsx(SR,{children:(r=n.getRowModel().rows)!=null&&r.length?n.getRowModel().rows.map(o=>p.jsx(ru,{"data-state":o.getIsSelected()&&"selected",children:o.getVisibleCells().map(i=>p.jsx($p,{children:Zy(i.column.columnDef.cell,i.getContext())},i.id))},o.id)):p.jsx(ru,{children:p.jsx($p,{colSpan:e.length,className:"h-24 text-center",children:"No results."})})})]})})},RR=({className:e,...t})=>p.jsx("nav",{role:"navigation","aria-label":"pagination",className:G("mx-auto flex w-full justify-center",e),...t});RR.displayName="Pagination";const ER=h.forwardRef(({className:e,...t},n)=>p.jsx("ul",{ref:n,className:G("flex flex-row items-center gap-1",e),...t}));ER.displayName="PaginationContent";const An=h.forwardRef(({className:e,...t},n)=>p.jsx("li",{ref:n,className:G("",e),...t}));An.displayName="PaginationItem";const Tr=({className:e,isActive:t,size:n="icon",...r})=>p.jsx(Xs,{"aria-current":t?"page":void 0,className:G(wc({variant:t?"outline":"ghost",size:n}),e),...r});Tr.displayName="PaginationLink";const PR=({className:e,...t})=>p.jsxs(Tr,{"aria-label":"Go to previous page",size:"default",className:G("gap-1 pl-2.5",e),...t,children:[p.jsx(XN,{className:"h-4 w-4"}),p.jsx("span",{children:"Previous"})]});PR.displayName="PaginationPrevious";const _R=({className:e,...t})=>p.jsxs(Tr,{"aria-label":"Go to next page",size:"default",className:G("gap-1 pr-2.5",e),...t,children:[p.jsx("span",{children:"Next"}),p.jsx(CS,{className:"h-4 w-4"})]});_R.displayName="PaginationNext";const Up=({className:e,...t})=>p.jsxs("span",{"aria-hidden":!0,className:G("flex h-9 w-9 items-center justify-center",e),...t,children:[p.jsx(rj,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"More pages"})]});Up.displayName="PaginationEllipsis";const TR=({currentPage:e,totalPages:t})=>{const[n]=Hh(),r=i=>(n.set("page",i),`?${n}`);if(t<=1)return null;const o=GA(e,t);return p.jsx(RR,{className:"mt-4",children:p.jsxs(ER,{children:[o.prevButtonEnabled&&p.jsx(An,{children:p.jsx(PR,{to:r(e-1)})}),o.showFirstPageButton&&p.jsx(An,{children:p.jsx(Tr,{to:r(1),children:1})}),o.showFirstEllipsis&&p.jsx(An,{children:p.jsx(Up,{})}),o.pagesBeforeCurrent.map(i=>p.jsx(An,{children:p.jsx(Tr,{to:r(i),children:i})},i)),p.jsx(An,{children:p.jsx(Tr,{isActive:!0,children:e})}),o.pagesAfterCurrent.map(i=>p.jsx(An,{children:p.jsx(Tr,{to:r(i),children:i})},i)),o.showLastEllipsis&&p.jsx(An,{children:p.jsx(Up,{})}),o.showLastPageButton&&p.jsx(An,{children:p.jsx(Tr,{to:r(t),children:t})}),o.nextButtonEnabled&&p.jsx(An,{children:p.jsx(_R,{to:r(e+1)})})]})})};var MR="AlertDialog",[x3,y$]=pr(MR,[sS]),hr=sS(),AR=e=>{const{__scopeAlertDialog:t,...n}=e,r=hr(t);return p.jsx(mg,{...r,...n,modal:!0})};AR.displayName=MR;var S3="AlertDialogTrigger",C3=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=hr(n);return p.jsx(WN,{...o,...r,ref:t})});C3.displayName=S3;var b3="AlertDialogPortal",kR=e=>{const{__scopeAlertDialog:t,...n}=e,r=hr(t);return p.jsx(vg,{...r,...n})};kR.displayName=b3;var R3="AlertDialogOverlay",NR=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=hr(n);return p.jsx(Va,{...o,...r,ref:t})});NR.displayName=R3;var Ti="AlertDialogContent",[E3,P3]=x3(Ti),jR=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...o}=e,i=hr(n),s=h.useRef(null),a=Le(t,s),l=h.useRef(null);return p.jsx(VN,{contentName:Ti,titleName:OR,docsSlug:"alert-dialog",children:p.jsx(E3,{scope:n,cancelRef:l,children:p.jsxs(Ha,{role:"alertdialog",...i,...o,ref:a,onOpenAutoFocus:re(o.onOpenAutoFocus,u=>{var d;u.preventDefault(),(d=l.current)==null||d.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[p.jsx(sg,{children:r}),p.jsx(T3,{contentRef:s})]})})})});jR.displayName=Ti;var OR="AlertDialogTitle",DR=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=hr(n);return p.jsx(Ka,{...o,...r,ref:t})});DR.displayName=OR;var IR="AlertDialogDescription",FR=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=hr(n);return p.jsx(Ga,{...o,...r,ref:t})});FR.displayName=IR;var _3="AlertDialogAction",LR=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,o=hr(n);return p.jsx(Cc,{...o,...r,ref:t})});LR.displayName=_3;var $R="AlertDialogCancel",UR=h.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=P3($R,n),i=hr(n),s=Le(t,o);return p.jsx(Cc,{...i,...r,ref:s})});UR.displayName=$R;var T3=({contentRef:e})=>{const t=`\`${Ti}\` requires a description for the component to be accessible for screen reader users. - -You can add a description to the \`${Ti}\` by passing a \`${IR}\` component as a child, which also benefits sighted users by adding visible context to the dialog. - -Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Ti}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. - -For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return h.useEffect(()=>{var r;document.getElementById((r=e.current)==null?void 0:r.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},M3=AR,A3=kR,zR=NR,BR=jR,VR=LR,HR=UR,KR=DR,GR=FR;const k3=M3,N3=A3,WR=h.forwardRef(({className:e,...t},n)=>p.jsx(zR,{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}));WR.displayName=zR.displayName;const qR=h.forwardRef(({className:e,...t},n)=>p.jsxs(N3,{children:[p.jsx(WR,{}),p.jsx(BR,{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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));qR.displayName=BR.displayName;const QR=({className:e,...t})=>p.jsx("div",{className:G("flex flex-col space-y-2 text-center sm:text-left",e),...t});QR.displayName="AlertDialogHeader";const YR=({className:e,...t})=>p.jsx("div",{className:G("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});YR.displayName="AlertDialogFooter";const XR=h.forwardRef(({className:e,...t},n)=>p.jsx(KR,{ref:n,className:G("text-lg font-semibold",e),...t}));XR.displayName=KR.displayName;const JR=h.forwardRef(({className:e,...t},n)=>p.jsx(GR,{ref:n,className:G("text-sm text-muted-foreground",e),...t}));JR.displayName=GR.displayName;const ZR=h.forwardRef(({className:e,...t},n)=>p.jsx(VR,{ref:n,className:G(wc(),e),...t}));ZR.displayName=VR.displayName;const eE=h.forwardRef(({className:e,...t},n)=>p.jsx(HR,{ref:n,className:G(wc({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));eE.displayName=HR.displayName;const tE=mg,j3=vg,nE=h.forwardRef(({className:e,...t},n)=>p.jsx(Va,{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}));nE.displayName=Va.displayName;const Jg=h.forwardRef(({className:e,children:t,...n},r)=>p.jsxs(j3,{children:[p.jsx(nE,{}),p.jsxs(Ha,{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 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,p.jsxs(Cc,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background 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:[p.jsx(yg,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));Jg.displayName=Ha.displayName;const Zg=({className:e,...t})=>p.jsx("div",{className:G("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});Zg.displayName="DialogHeader";const em=h.forwardRef(({className:e,...t},n)=>p.jsx(Ka,{ref:n,className:G("text-lg font-semibold leading-none tracking-tight",e),...t}));em.displayName=Ka.displayName;const O3=h.forwardRef(({className:e,...t},n)=>p.jsx(Ga,{ref:n,className:G("text-sm text-muted-foreground",e),...t}));O3.displayName=Ga.displayName;const tm=e=>{var r;const[,t]=h.useState(!1),n=h.useRef(null);if((r=n.current)!=null&&r.promise)throw n.current.promise;h.useLayoutEffect(()=>{n.current===null&&(n.current={},n.current.promise=new Promise(o=>{n.current.resolve=o}),t(!0))},[]),h.useEffect(()=>{const o=e.current;if(o){const i=()=>{setTimeout(()=>{var s;(s=n.current)==null||s.resolve(),n.current.promise=null},300)};return o.addEventListener("ready",i),()=>{o.removeEventListener("ready",i)}}},[])},D3=({id:e})=>{const t=h.useRef(),n=Ko(),{data:r}=Ji({queryKey:["questionnaire",e],queryFn:()=>ig(n,e)}),{toast:o}=hs();return h.useEffect(()=>{const i=t.current,s=a=>{(a.detail.status==="completed"||a.detail.status==="amended")&&o({title:"Not saved",description:"This is a preview, changes will not be saved"})};return i.addEventListener("change",s),()=>{i.removeEventListener("change",s)}},[]),tm(t),p.jsx("aidbox-form-renderer",{ref:t,questionnaire:JSON.stringify(r),style:{width:"100%",height:"100%",border:"none",flex:1}})},I3=()=>{var O,F,L;const[e,t]=Hh(),n=R=>{for(const[M,j]of Object.entries(R))j===void 0||j===""?e.delete(M):e.set(M,j);t(e,{replace:!0})},r=e.get("search")||"",o=nL(r,{wait:500}),i=Number(e.get("page"))||1,s=e.get("source")||"library",a=$a(),{user:l,patient:u,encounter:d}=Go(),c=Ko(),{toast:f}=hs(),m=ls(),y=15,v=["questionnaires",s,i,o],S=b1({queryKey:v,queryFn:()=>s==="library"?er.request(`Questionnaire?_count=${y}&page=${i}${o?`&title:contains=${decodeURIComponent(o)}`:""}`):c.request(`Questionnaire?_count=${y}&_getpagesoffset=${y*(i-1)}${o?`&title:contains=${decodeURIComponent(o)}`:""}`)}),w=Zs({mutationFn:QA,onSuccess:R=>{f({title:"Response created",description:`New response created for ${cs(u.name)}`}),m(`/questionnaire-responses/${R.id}`)}}),g=Zs({mutationFn:R=>O1(c,{...R,id:void 0}),onSuccess:async R=>{f({title:"Questionnaire imported",description:"Questionnaire imported successfully",action:p.jsx(sR,{altText:"Edit",onClick:()=>{m(`/questionnaires/${R.id}`)},children:"Edit"})})},onError:R=>{f({variant:"destructive",title:"Import questionnaire",description:`Unable to import questionnaire: ${R.message}`})}}),x=Zs({mutationFn:R=>qA(c,R),onSuccess:async(R,M)=>{await a.cancelQueries({queryKey:v}),a.setQueryData(v,j=>{var B;return{...j,entry:(B=j.entry)==null?void 0:B.filter(D=>D.resource.id!==M.id)}}),f({title:"Questionnaire deleted",description:"Questionnaire deleted successfully"})},onError:R=>{f({variant:"destructive",title:"Delete questionnaire",description:`Unable to delete questionnaire: ${R.message}`})},onSettled:()=>{a.invalidateQueries({queryKey:v})}}),C=Math.ceil((((O=S.data)==null?void 0:O.total)||0)/y),P=((L=(F=S.data)==null?void 0:F.entry)==null?void 0:L.map(R=>({publisher:s==="library"?"Health Samurai":void 0,...R.resource})))||[],[b,A]=h.useState(null),[T,$]=h.useState(null),E=[{accessorKey:"title",header:"Title"},{accessorKey:"status",header:"Status"},{accessorKey:"version",header:"Version"},{accessorKey:"publisher",header:"Publisher"},{id:"actions",cell:({row:{original:R}})=>{var j,B;const M=w.isPending&&w.variables.questionnaire.id===R.id||g.isPending&&((j=g.variables)==null?void 0:j.id)===R.id||((B=x.variables)==null?void 0:B.id)===R.id||R.id===void 0;return M?p.jsx(_b,{className:"h-4 my-2"}):p.jsxs(Pa,{children:[p.jsx(_a,{asChild:!0,children:p.jsxs(Tt,{variant:"ghost",className:"h-8 w-8 p-0",disabled:M,children:[p.jsx("span",{className:"sr-only",children:"Open menu"}),p.jsx(lg,{className:"h-4 w-4"})]})}),p.jsxs(ts,{align:"end",children:[p.jsx($g,{children:"Actions"}),p.jsxs(zt,{onClick:()=>navigator.clipboard.writeText(R.id),children:[p.jsx(ag,{}),"Copy ID"]}),p.jsx(Ic,{}),p.jsxs(zt,{onClick:()=>A(R.id),children:[p.jsx(lk,{}),"Preview"]}),s!=="library"&&p.jsx(zt,{asChild:!0,children:p.jsxs(Xs,{to:`/questionnaires/${R.id}`,children:[p.jsx($1,{}),"Edit"]})}),s==="library"&&p.jsxs(zt,{onClick:()=>{g.mutate(R)},children:[p.jsx(dk,{}),"Import"]}),s!=="library"&&p.jsxs(zt,{className:"text-destructive focus:text-destructive",onClick:()=>$(R),children:[p.jsx(xk,{}),"Delete"]}),s!=="library"&&p.jsxs(zt,{onClick:()=>{w.mutate({client:c,questionnaire:{...R,url:s==="library"?`${er.state.serverUrl}/Questionnaire/${R.id}`:void 0},subject:u,encounter:d,author:l})},children:[p.jsx(gk,{}),"Create response"]})]})]})}}];return p.jsxs(p.Fragment,{children:[p.jsx(Ob,{active:S.isFetching}),p.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[p.jsxs("div",{className:"mb-4 gap-4 flex justify-between",children:[p.jsx(xc,{placeholder:"Search",className:"max-w-[20rem]",value:r,onChange:R=>{n({search:R.target.value,page:void 0})}}),p.jsxs(Pa,{children:[p.jsx(_a,{asChild:!0,children:p.jsxs(Tt,{variant:"outline",className:"ml-auto",children:["Source: ",s==="library"?"Forms Library":"EHR",p.jsx(L1,{className:"ml-2 h-4 w-4"})]})}),p.jsx(ts,{align:"end",children:p.jsxs(TI,{value:s,onValueChange:R=>{n({source:R})},children:[p.jsx(Tp,{value:"library",children:"Forms Library"}),p.jsx(Tp,{value:"ehr",children:"EHR"})]})})]})]}),p.jsx(bR,{columns:E,data:P}),p.jsx(TR,{currentPage:i,totalPages:C}),p.jsx(k3,{onOpenChange:R=>{R||$(null)},open:!!T,children:p.jsxs(qR,{children:[p.jsxs(QR,{children:[p.jsx(XR,{children:"Are you absolutely sure?"}),p.jsx(JR,{children:"This action cannot be undone. Proceeding will permanently delete this questionnaire from the system."})]}),p.jsxs(YR,{children:[p.jsx(eE,{children:"Cancel"}),p.jsx(ZR,{onClick:()=>{x.mutate(T),$(null)},children:"Continue"})]})]})}),p.jsx(tE,{onOpenChange:R=>{R||A(null)},open:!!b,children:p.jsxs(Jg,{className:"flex flex-col max-w-[calc(100vw_-_4rem)] h-[calc(100vh_-_4rem)]",children:[p.jsx(Zg,{children:p.jsx(em,{children:"Preview"})}),b&&p.jsx(h.Suspense,{fallback:p.jsx(Bg,{}),children:p.jsx(D3,{id:b})})]})})]})]})},F3=({id:e})=>{const t=h.useRef(),n=Ko(),{toast:r}=hs(),o=h.useRef(!1),{data:[i,s]}=Ji({queryKey:["questionnaire",e],queryFn:()=>D1(n,e)}),a=Zs({mutationFn:l=>O1(i,l),onSuccess:()=>{o.current||(o.current=!0,r({title:"Questionnaire is autosaved",description:"All changes are saved automatically"}))}});return tm(t),h.useEffect(()=>{if(i!==er){const l=t.current,u=d=>a.mutate(d.detail);return l.addEventListener("change",u),()=>{l.removeEventListener("change",u)}}else r({title:"This questionnaire is read-only",description:"You can't save changes to questionnaires from the library. Please import it first to your EHR to make changes."})},[]),p.jsx("aidbox-form-builder",{"hide-back":!0,"show-share":!1,"hide-population":!0,"hide-extraction":!0,"hide-publish":!0,"hide-add-theme":!0,"hide-edit-theme":!0,"hide-save-theme":!0,"hide-convert":!0,"hide-save":!0,"disable-save":!0,ref:t,value:JSON.stringify(s),style:{width:"100%",height:"100%",border:"none",flex:1}})},L3=()=>{const{id:e}=$x();return p.jsx(F3,{id:e})};function $3(){const{toasts:e}=hs();return p.jsxs(PL,{children:[e.map(function({id:t,title:n,description:r,action:o,...i}){return p.jsxs(iR,{...i,children:[p.jsxs("div",{className:"grid gap-1",children:[n&&p.jsx(lR,{children:n}),r&&p.jsx(uR,{children:r})]}),o,p.jsx(aR,{})]},t)}),p.jsx(oR,{})]})}var nm="Tabs",[U3,w$]=pr(nm,[jc]),rE=jc(),[z3,rm]=U3(nm),oE=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:o,defaultValue:i,orientation:s="horizontal",dir:a,activationMode:l="automatic",...u}=e,d=Ag(a),[c,f]=Wo({prop:r,onChange:o,defaultProp:i});return p.jsx(z3,{scope:n,baseId:rr(),value:c,onValueChange:f,orientation:s,dir:d,activationMode:l,children:p.jsx(de.div,{dir:d,"data-orientation":s,...u,ref:t})})});oE.displayName=nm;var iE="TabsList",sE=h.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...o}=e,i=rm(iE,n),s=rE(n);return p.jsx(yC,{asChild:!0,...s,orientation:i.orientation,dir:i.dir,loop:r,children:p.jsx(de.div,{role:"tablist","aria-orientation":i.orientation,...o,ref:t})})});sE.displayName=iE;var aE="TabsTrigger",lE=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:o=!1,...i}=e,s=rm(aE,n),a=rE(n),l=dE(s.baseId,r),u=fE(s.baseId,r),d=r===s.value;return p.jsx(wC,{asChild:!0,...a,focusable:!o,active:d,children:p.jsx(de.button,{type:"button",role:"tab","aria-selected":d,"aria-controls":u,"data-state":d?"active":"inactive","data-disabled":o?"":void 0,disabled:o,id:l,...i,ref:t,onMouseDown:re(e.onMouseDown,c=>{!o&&c.button===0&&c.ctrlKey===!1?s.onValueChange(r):c.preventDefault()}),onKeyDown:re(e.onKeyDown,c=>{[" ","Enter"].includes(c.key)&&s.onValueChange(r)}),onFocus:re(e.onFocus,()=>{const c=s.activationMode!=="manual";!d&&!o&&c&&s.onValueChange(r)})})})});lE.displayName=aE;var uE="TabsContent",cE=h.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:o,children:i,...s}=e,a=rm(uE,n),l=dE(a.baseId,r),u=fE(a.baseId,r),d=r===a.value,c=h.useRef(d);return h.useEffect(()=>{const f=requestAnimationFrame(()=>c.current=!1);return()=>cancelAnimationFrame(f)},[]),p.jsx(Qt,{present:o||d,children:({present:f})=>p.jsx(de.div,{"data-state":d?"active":"inactive","data-orientation":a.orientation,role:"tabpanel","aria-labelledby":l,hidden:!f,id:u,tabIndex:0,...s,ref:t,style:{...e.style,animationDuration:c.current?"0s":void 0},children:f&&i})})});cE.displayName=uE;function dE(e,t){return`${e}-trigger-${t}`}function fE(e,t){return`${e}-content-${t}`}var B3=oE,pE=sE,hE=lE,gE=cE;const V3=B3,mE=h.forwardRef(({className:e,...t},n)=>p.jsx(pE,{ref:n,className:G("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));mE.displayName=pE.displayName;const zp=h.forwardRef(({className:e,...t},n)=>p.jsx(hE,{ref:n,className:G("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));zp.displayName=hE.displayName;const Bp=h.forwardRef(({className:e,...t},n)=>p.jsx(gE,{ref:n,className:G("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",e),...t}));Bp.displayName=gE.displayName;var H3="Label",vE=h.forwardRef((e,t)=>p.jsx(de.label,{...e,ref:t,onMouseDown:n=>{var o;n.target.closest("button, input, select, textarea")||((o=e.onMouseDown)==null||o.call(e,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));vE.displayName=H3;var yE=vE;const K3=Ua("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),Vp=h.forwardRef(({className:e,...t},n)=>p.jsx(yE,{ref:n,className:G(K3(),e),...t}));Vp.displayName=yE.displayName;var om="Collapsible",[G3,x$]=pr(om),[W3,im]=G3(om),wE=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:r,defaultOpen:o,disabled:i,onOpenChange:s,...a}=e,[l=!1,u]=Wo({prop:r,defaultProp:o,onChange:s});return p.jsx(W3,{scope:n,disabled:i,contentId:rr(),open:l,onOpenToggle:h.useCallback(()=>u(d=>!d),[u]),children:p.jsx(de.div,{"data-state":am(l),"data-disabled":i?"":void 0,...a,ref:t})})});wE.displayName=om;var xE="CollapsibleTrigger",SE=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,...r}=e,o=im(xE,n);return p.jsx(de.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":am(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...r,ref:t,onClick:re(e.onClick,o.onOpenToggle)})});SE.displayName=xE;var sm="CollapsibleContent",CE=h.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=im(sm,e.__scopeCollapsible);return p.jsx(Qt,{present:n||o.open,children:({present:i})=>p.jsx(q3,{...r,ref:t,present:i})})});CE.displayName=sm;var q3=h.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:r,children:o,...i}=e,s=im(sm,n),[a,l]=h.useState(r),u=h.useRef(null),d=Le(t,u),c=h.useRef(0),f=c.current,m=h.useRef(0),y=m.current,v=s.open||a,S=h.useRef(v),w=h.useRef();return h.useEffect(()=>{const g=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(g)},[]),Cn(()=>{const g=u.current;if(g){w.current=w.current||{transitionDuration:g.style.transitionDuration,animationName:g.style.animationName},g.style.transitionDuration="0s",g.style.animationName="none";const x=g.getBoundingClientRect();c.current=x.height,m.current=x.width,S.current||(g.style.transitionDuration=w.current.transitionDuration,g.style.animationName=w.current.animationName),l(r)}},[s.open,r]),p.jsx(de.div,{"data-state":am(s.open),"data-disabled":s.disabled?"":void 0,id:s.contentId,hidden:!v,...i,ref:d,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":y?`${y}px`:void 0,...e.style},children:v&&o})});function am(e){return e?"open":"closed"}var Q3=wE;const Y3=Q3,X3=SE,J3=CE,bE=h.forwardRef(({className:e,...t},n)=>p.jsx("textarea",{className:G("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm 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",e),ref:n,...t}));bE.displayName="Textarea";const ii=new Map;function Yd(e,t){const n=t==null?void 0:t.serializer,[r]=h.useState(t==null?void 0:t.defaultValue);return Z3(e,r,t==null?void 0:t.storageSync,n==null?void 0:n.parse,n==null?void 0:n.stringify)}function Z3(e,t,n=!0,r=e$,o=JSON.stringify){const i=h.useRef({string:null,parsed:void 0}),s=h.useSyncExternalStore(h.useCallback(u=>{const d=c=>{e===c&&u()};return Hp.add(d),()=>{Hp.delete(d)}},[e]),()=>{const u=Il(()=>localStorage.getItem(e))??null;if(ii.has(e))i.current.parsed=ii.get(e);else if(u!==i.current.string){let d;try{d=u===null?t:r(u)}catch{d=t}i.current.parsed=d}return i.current.string=u,t!==void 0&&u===null&&Il(()=>{const d=o(t);localStorage.setItem(e,d),i.current={string:d,parsed:t}}),i.current.parsed},()=>t),a=h.useCallback(u=>{const d=u instanceof Function?u(i.current.parsed):u;try{localStorage.setItem(e,o(d)),ii.delete(e)}catch{ii.set(e,d)}Xd(e)},[e,o]),l=h.useCallback(()=>{Il(()=>localStorage.removeItem(e)),ii.delete(e),Xd(e)},[e]);return h.useEffect(()=>{if(!n)return;const u=d=>{d.key===e&&d.storageArea===Il(()=>localStorage)&&Xd(e)};return window.addEventListener("storage",u),()=>window.removeEventListener("storage",u)},[e,n]),h.useMemo(()=>[s,a,{isPersistent:s===t||!ii.has(e),removeItem:l}],[e,a,s,t,l])}const Hp=new Set;function Xd(e){for(const t of[...Hp])t(e)}function e$(e){return e==="undefined"?void 0:JSON.parse(e)}function Il(e){try{return e()}catch{}}const t$="/examples/aidbox-forms-smart-launch/health-samurai.svg",n$=()=>{const{toast:e}=hs(),[t,n]=h.useState(!1),[r,o]=Yd("welcome-tab",{defaultValue:"ehr"}),[i,s,{removeItem:a}]=Yd("issuer"),[l,u,{removeItem:d}]=Yd("scope",{defaultValue:R1.join(` -`)}),c=new URL(window.location);return c.search="",p.jsxs(p.Fragment,{children:[p.jsx(tE,{open:t,onOpenChange:n,children:p.jsxs(Jg,{children:[p.jsx(Zg,{children:p.jsx(em,{children:"Instructions"})}),p.jsxs("div",{className:"mb-4 text-sm",children:["To run this app from within your own EHR system, you can register it as a SMART App with the following parameters:",p.jsxs("ul",{className:"list-disc ml-6 mt-2",children:[p.jsxs("li",{children:[p.jsx("span",{className:"font-semibold",children:"Launch URL:"})," ",p.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:c.toString()})]}),p.jsxs("li",{children:[p.jsx("span",{className:"font-semibold",children:"Redirect URL:"})," ",p.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:c.toString()})]}),p.jsxs("li",{children:[p.jsx("span",{className:"font-semibold",children:"Client ID:"})," ",p.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:Lu})]}),p.jsxs("li",{children:[p.jsx("span",{className:"font-semibold",children:"PKCE:"})," ",p.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:"true"})]})]})]}),p.jsxs("div",{className:"mb-4",children:["All pages in this app can serve as entry points. For example, you can directly access a form filling page for a patient using a Launch/Redirect URL like this:",p.jsx("br",{}),p.jsx("code",{className:"bg-black text-white px-1 py-0.5 rounded text-xs",children:"/questionnaire-response/[your-id]"})]})]})}),p.jsx("div",{className:"mb-4"}),p.jsxs("div",{className:"flex flex-col items-center gap-8 max-w-[24rem] mx-auto",children:[p.jsx("img",{alt:"Health Samurai",src:t$,width:"64"}),p.jsx("h1",{className:"text-2xl font-bold text-center text-pretty",children:"Welcome to Aidbox Forms Smart App"}),p.jsx("div",{className:"text-sm",children:"This is a demo smart app for launching Aidbox Forms"}),p.jsxs(V3,{defaultValue:"account",className:"w-full",value:r,onValueChange:o,children:[p.jsxs(mE,{className:"grid w-full grid-cols-2",children:[p.jsx(zp,{value:"ehr",children:"EHR Launch"}),p.jsx(zp,{value:"standalone",children:"Standalone Launch"})]}),p.jsx(Bp,{value:"ehr",children:p.jsxs(Gu,{children:[p.jsxs(Wu,{children:[p.jsx(qu,{children:"Heads up!"}),p.jsxs(Mp,{className:"space-y-2",children:[p.jsx("p",{children:"If you’re seeing this page, it means the app wasn’t launched with the correct context."}),p.jsxs("p",{children:["Please refer to the"," ",p.jsx(Tt,{variant:"link",className:"underline p-0 h-auto",onClick:()=>n(!0),children:"instructions"})," ","for registering the app in your EHR."]}),p.jsx("p",{children:"Alternatively, use one of the following links to simulate launching the app from:"})]})]}),p.jsxs(Ap,{className:"gap-2",children:[p.jsx(Tt,{variant:"outline",className:"flex-1",asChild:!0,children:p.jsxs("a",{href:gy({launchUrl:c,launchType:"provider-ehr"}),children:[p.jsx(wk,{className:"text-primary my-4"}),"Provider EHR"]})}),p.jsx(Tt,{variant:"outline",className:"flex-1",asChild:!0,children:p.jsxs("a",{href:gy({launchUrl:c,launchType:"patient-portal"}),children:[p.jsx(Ck,{className:"text-primary my-4"}),"Patient Portal"]})})]})]})}),p.jsx(Bp,{value:"standalone",children:p.jsx(Y3,{children:p.jsxs(Gu,{children:[p.jsxs(Wu,{children:[p.jsxs(qu,{className:"flex items-center justify-between",children:["Launch Parameters",p.jsx(X3,{asChild:!0,children:p.jsxs(Tt,{variant:"ghost",size:"sm",className:"w-9 p-0",children:[p.jsx(sk,{className:"h-4 w-4"}),p.jsx("span",{className:"sr-only",children:"Toggle"})]})})]}),p.jsx(Mp,{children:"Use the following parameters to launch the app standalone:"})]}),p.jsxs(zg,{className:"space-y-2",children:[p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vp,{htmlFor:"name",children:"Issuer"}),p.jsx(xc,{value:i,onChange:f=>s(f.target.value)})]}),p.jsx(J3,{className:"space-y-2",children:p.jsxs("div",{className:"space-y-1",children:[p.jsx(Vp,{htmlFor:"name",children:"Scope"}),p.jsx(bE,{value:l,onChange:f=>u(f.target.value),rows:10})]})})]}),p.jsxs(Ap,{className:"justify-between",children:[p.jsx(Tt,{variant:"ghost",onClick:()=>{a(),d()},children:"Reset"}),p.jsxs(Tt,{disabled:!i||!l,variant:"outline",onClick:()=>{var m,y,v;const f=(v=(y=(m=l==null?void 0:l.split(` -`))==null?void 0:m.map(S=>S.trim()))==null?void 0:y.filter(Boolean))==null?void 0:v.join(" ");!i||!f?e({variant:"destructive",title:"Error",description:"Issuer and Scope are required"}):sA({iss:i,scope:f})},children:[p.jsx(hk,{className:"text-primary my-4"}),"Launch"]})]})]})})})]})]})]})};function r$(){var t;let e=Vx();return p.jsx("div",{className:"p-10",children:(t=e==null?void 0:e.message)!=null&&t.includes("fhirServiceUrl")?p.jsx(n$,{}):p.jsxs(p.Fragment,{children:[p.jsx("h1",{className:"text-4xl font-bold mb-4",children:e.status?`${e.status} - ${e.statusText}`:"Error"}),p.jsx("div",{className:"mb-2",children:"An error occurred while rendering this page."}),p.jsx("pre",{className:"text-xs bg-gray-50 px-1 py-0.5 rounded border overflow-auto empty:hidden",children:e.message})]})})}const o$=()=>{const e=h.useRef(),{id:t}=$x(),n=Ko(),r=$a(),{data:o}=Ji({queryKey:["questionnaire-response",t],queryFn:()=>n.request(`QuestionnaireResponse/${t}`)}),i=o.questionnaire,{data:s}=Ji({queryKey:["questionnaire",i],queryFn:()=>ig(n,i)}),a=Zs({mutationFn:j1.bind(null,n,s),onSuccess:l=>{r.setQueryData(["questionnaire-response",t],l)}});return h.useEffect(()=>{const l=e.current,u=d=>a.mutate(d.detail);return l.addEventListener("change",u),()=>{l.removeEventListener("change",u)}},[]),tm(e),p.jsx("aidbox-form-renderer",{ref:e,questionnaire:JSON.stringify(s),"questionnaire-response":JSON.stringify(o),style:{width:"100%",height:"100%",border:"none",flex:1}})},i$=()=>{var v,S,w;const[e]=Hh(),{patient:t}=Go(),n=Ko(),r=ls(),o=Number(e.get("page"))||1,i=15,s=b1({queryKey:["questionnaire-responses",o],queryFn:()=>n.request(`QuestionnaireResponse?_subject=${t.id}&_count=${i}&_page=${o}`)}),a=Math.ceil((((v=s.data)==null?void 0:v.total)||0)/i),l=((w=(S=s.data)==null?void 0:S.entry)==null?void 0:w.map(g=>g.resource))||[],u=dy({queries:l.filter(({author:g})=>g==null?void 0:g.id).map(({author:g})=>({queryKey:["author",g.id],queryFn:()=>n.request(`Practitioner/${g.id}`)}))}),d=u.reduce((g,{data:x})=>(x&&(g[x.id]=x),g),{}),c=dy({queries:l.filter(({questionnaire:g})=>g).map(({questionnaire:g})=>({queryKey:["questionnaire",g],queryFn:()=>ig(n,g).then(x=>({key:g,result:x}))}))}),f=c.reduce((g,{data:x})=>(x&&(g[x.key]=x.result),g),{}),m=[{header:"Author",accessorFn:g=>{var x,C,P;return(x=g.author)!=null&&x.id&&((C=d[g.author.id])!=null&&C.name)?cs((P=d[g.author.id])==null?void 0:P.name):"Unknown"}},{header:"Questionnaire",accessorFn:g=>{var x,C;return(x=f[g.questionnaire])!=null&&x.title?(C=f[g.questionnaire])==null?void 0:C.title:g.questionnaire}},{header:"Last Updated",accessorFn:g=>new Date(g.meta.lastUpdated).toLocaleString()},{header:"Status",accessorKey:"status"},{id:"actions",cell:({row:{original:g}})=>p.jsxs(Pa,{modal:!0,children:[p.jsx(_a,{asChild:!0,children:p.jsxs(Tt,{variant:"ghost",className:"h-8 w-8 p-0",children:[p.jsx("span",{className:"sr-only",children:"Open menu"}),p.jsx(lg,{className:"h-4 w-4"})]})}),p.jsxs(ts,{align:"end",children:[p.jsx($g,{children:"Actions"}),p.jsxs(zt,{onClick:()=>navigator.clipboard.writeText(g.id),children:[p.jsx(ag,{}),"Copy ID"]}),p.jsx(Ic,{}),p.jsxs(zt,{onClick:()=>r(`/questionnaire-responses/${g.id}`),children:[p.jsx($1,{}),"Edit response"]})]})]})}],y=s.isFetching||c.some(g=>g.isFetching)||u.some(g=>g.isFetching);return p.jsxs(p.Fragment,{children:[p.jsx(Ob,{active:y}),p.jsxs("div",{className:"p-6 overflow-auto flex-1",children:[p.jsx(bR,{columns:m,data:l}),p.jsx(TR,{currentPage:o,totalPages:a})]})]})},s$=()=>{const{user:e}=Go(),{toast:t}=hs(),n=e.resourceType==="Practitioner";return h.useEffect(()=>{n||t({variant:"destructive",title:"Unauthorized",description:"Only practitioners can access this page."})},[]),n?p.jsx(Hx,{}):p.jsx(w2,{to:"/"})},a$=new QM({defaultOptions:{mutations:{throwOnError:!0}}}),l$=T2([{path:"/",Component:$I,ErrorBoundary:r$,children:[{index:!0,Component:YA},{path:"/questionnaire-responses",Component:i$},{path:"/questionnaire-responses/:id",Component:o$},{Component:s$,children:[{path:"/questionnaires",Component:I3},{path:"/questionnaires/:id",Component:L3}]}]}]);Px(document.getElementById("root")).render(p.jsx(h.StrictMode,{children:p.jsxs(tA,{client:a$,children:[p.jsx(h.Suspense,{fallback:p.jsx(Bg,{}),children:p.jsx(F2,{router:l$})}),p.jsx($3,{})]})}))});export default u$(); diff --git a/aidbox-forms-smart-launch/assets/index-hRnCg-dw.css b/aidbox-forms-smart-launch/assets/index-hRnCg-dw.css deleted file mode 100644 index 8887146..0000000 --- a/aidbox-forms-smart-launch/assets/index-hRnCg-dw.css +++ /dev/null @@ -1 +0,0 @@ -*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--background: 0 0% 100%;--foreground: 0 0% 3.9%;--card: 0 0% 100%;--card-foreground: 0 0% 3.9%;--popover: 0 0% 100%;--popover-foreground: 0 0% 3.9%;--primary: 6.96deg 81.17% 56.27%;--primary-foreground: 0 0% 98%;--secondary: 0 0% 96.1%;--secondary-foreground: 0 0% 9%;--muted: 0 0% 96.1%;--muted-foreground: 0 0% 45.1%;--accent: 0 0% 96.1%;--accent-foreground: 0 0% 9%;--destructive: 0 84.2% 60.2%;--destructive-foreground: 0 0% 98%;--border: 0 0% 89.8%;--input: 0 0% 89.8%;--ring: 0 0% 3.9%;--chart-1: 12 76% 61%;--chart-2: 173 58% 39%;--chart-3: 197 37% 24%;--chart-4: 43 74% 66%;--chart-5: 27 87% 67%;--radius: .5rem;--sidebar-background: 0 0% 98%;--sidebar-foreground: 240 5.3% 26.1%;--sidebar-primary: 240 5.9% 10%;--sidebar-primary-foreground: 0 0% 98%;--sidebar-accent: 240 4.8% 95.9%;--sidebar-accent-foreground: 240 5.9% 10%;--sidebar-border: 220 13% 91%;--sidebar-ring: 217.2 91.2% 59.8% }*{border-color:hsl(var(--border))}body{background-color:hsl(var(--background));color:hsl(var(--foreground))}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.pointer-events-auto{pointer-events:auto}.visible{visibility:visible}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.left-0{left:0}.left-1\/2{left:50%}.left-2{left:.5rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1{top:.25rem}.top-1\.5{top:.375rem}.top-3\.5{top:.875rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-50{z-index:50}.z-\[100\]{z-index:100}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-2{margin-left:.5rem;margin-right:.5rem}.mx-3\.5{margin-left:.875rem;margin-right:.875rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.my-2{margin-top:.5rem;margin-bottom:.5rem}.my-4{margin-top:1rem;margin-bottom:1rem}.mb-2{margin-bottom:.5rem}.mb-4{margin-bottom:1rem}.ml-2{margin-left:.5rem}.ml-6{margin-left:1.5rem}.ml-auto{margin-left:auto}.mr-2{margin-right:.5rem}.mt-2{margin-top:.5rem}.mt-4{margin-top:1rem}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.size-4{width:1rem;height:1rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-16{height:4rem}.h-2{height:.5rem}.h-24{height:6rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[1px\]{height:1px}.h-\[3px\]{height:3px}.h-\[calc\(100vh_-_4rem\)\]{height:calc(100vh - 4rem)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.h-svh{height:100svh}.max-h-screen{max-height:100vh}.min-h-0{min-height:0px}.min-h-\[60px\]{min-height:60px}.min-h-\[calc\(100svh_-_4rem\)\]{min-height:calc(100svh - 4rem)}.min-h-screen{min-height:100vh}.min-h-svh{min-height:100svh}.w-10{width:2.5rem}.w-3\.5{width:.875rem}.w-3\/4{width:75%}.w-4{width:1rem}.w-5{width:1.25rem}.w-56{width:14rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-9{width:2.25rem}.w-\[--sidebar-width\]{width:var(--sidebar-width)}.w-\[1px\]{width:1px}.w-auto{width:auto}.w-full{width:100%}.min-w-0{min-width:0px}.min-w-5{min-width:1.25rem}.min-w-\[8rem\]{min-width:8rem}.max-w-\[--skeleton-width\]{max-width:var(--skeleton-width)}.max-w-\[20rem\]{max-width:20rem}.max-w-\[24rem\]{max-width:24rem}.max-w-\[calc\(100vw_-_4rem\)\]{max-width:calc(100vw - 4rem)}.max-w-lg{max-width:32rem}.flex-1{flex:1 1 0%}.flex-shrink-0,.shrink-0{flex-shrink:0}.caption-bottom{caption-side:bottom}.-translate-x-1\/2{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-translate-x-px{--tw-translate-x: -1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-px{--tw-translate-x: 1px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}.cursor-default{cursor:default}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.list-disc{list-style-type:disc}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.flex-row{flex-direction:row}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.place-items-center{place-items:center}.items-start{align-items:flex-start}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.gap-4{gap:1rem}.gap-8{gap:2rem}.space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.space-y-0>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(0px * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(0px * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.whitespace-nowrap{white-space:nowrap}.text-pretty{text-wrap:pretty}.rounded{border-radius:.25rem}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-none{border-radius:0}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:.75rem}.border{border-width:1px}.border-b{border-bottom-width:1px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-destructive{border-color:hsl(var(--destructive))}.border-input{border-color:hsl(var(--input))}.border-sidebar-border{border-color:hsl(var(--sidebar-border))}.bg-background{background-color:hsl(var(--background))}.bg-black{--tw-bg-opacity: 1;background-color:rgb(0 0 0 / var(--tw-bg-opacity))}.bg-black\/80{background-color:#000c}.bg-border{background-color:hsl(var(--border))}.bg-card{background-color:hsl(var(--card))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-gray-50{--tw-bg-opacity: 1;background-color:rgb(249 250 251 / var(--tw-bg-opacity))}.bg-muted{background-color:hsl(var(--muted))}.bg-muted\/50{background-color:hsl(var(--muted) / .5)}.bg-pink-400{--tw-bg-opacity: 1;background-color:rgb(244 114 182 / var(--tw-bg-opacity))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-secondary{background-color:hsl(var(--secondary))}.bg-sidebar{background-color:hsl(var(--sidebar-background))}.bg-sidebar-border{background-color:hsl(var(--sidebar-border))}.bg-teal-400{--tw-bg-opacity: 1;background-color:rgb(45 212 191 / var(--tw-bg-opacity))}.bg-transparent{background-color:transparent}.fill-current{fill:currentColor}.p-0{padding:0}.p-1{padding:.25rem}.p-10{padding:2.5rem}.p-2{padding:.5rem}.p-4{padding:1rem}.p-6{padding:1.5rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.pl-2\.5{padding-left:.625rem}.pl-8{padding-left:2rem}.pr-2{padding-right:.5rem}.pr-2\.5{padding-right:.625rem}.pr-6{padding-right:1.5rem}.pt-0{padding-top:0}.text-left{text-align:left}.text-center{text-align:center}.align-middle{vertical-align:middle}.text-2xl{font-size:1.5rem;line-height:2rem}.text-4xl{font-size:2.25rem;line-height:2.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.tabular-nums{--tw-numeric-spacing: tabular-nums;font-variant-numeric:var(--tw-ordinal) var(--tw-slashed-zero) var(--tw-numeric-figure) var(--tw-numeric-spacing) var(--tw-numeric-fraction)}.leading-none{line-height:1}.tracking-tight{letter-spacing:-.025em}.tracking-widest{letter-spacing:.1em}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive{color:hsl(var(--destructive))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-foreground{color:hsl(var(--foreground))}.text-foreground\/50{color:hsl(var(--foreground) / .5)}.text-muted-foreground{color:hsl(var(--muted-foreground))}.text-pink-50{--tw-text-opacity: 1;color:rgb(253 242 248 / var(--tw-text-opacity))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-secondary-foreground{color:hsl(var(--secondary-foreground))}.text-sidebar-foreground{color:hsl(var(--sidebar-foreground))}.text-sidebar-foreground\/70{color:hsl(var(--sidebar-foreground) / .7)}.text-teal-50{--tw-text-opacity: 1;color:rgb(240 253 250 / var(--tw-text-opacity))}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity))}.underline{text-decoration-line:underline}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-50{opacity:.5}.opacity-60{opacity:.6}.opacity-70{opacity:.7}.opacity-90{opacity:.9}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_1px_hsl\(var\(--sidebar-border\)\)\]{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-border));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-sidebar-ring{--tw-ring-color: hsl(var(--sidebar-ring))}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,-webkit-backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter,-webkit-backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[left\,right\,width\]{transition-property:left,right,width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[margin\,opa\]{transition-property:margin,opa;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\,height\,padding\]{transition-property:width,height,padding;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[width\]{transition-property:width;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{transition-timing-function:linear}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-200{animation-duration:.2s}.ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.ease-linear{animation-timing-function:linear}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.file\:text-foreground::file-selector-button{color:hsl(var(--foreground))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.after\:absolute:after{content:var(--tw-content);position:absolute}.after\:-inset-2:after{content:var(--tw-content);top:-.5rem;right:-.5rem;bottom:-.5rem;left:-.5rem}.after\:inset-y-0:after{content:var(--tw-content);top:0;bottom:0}.after\:left-1\/2:after{content:var(--tw-content);left:50%}.after\:w-\[2px\]:after{content:var(--tw-content);width:2px}.first\:pl-4:first-child{padding-left:1rem}.empty\:hidden:empty{display:none}.hover\:bg-accent:hover{background-color:hsl(var(--accent))}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-muted\/50:hover{background-color:hsl(var(--muted) / .5)}.hover\:bg-primary\/90:hover{background-color:hsl(var(--primary) / .9)}.hover\:bg-secondary:hover{background-color:hsl(var(--secondary))}.hover\:bg-secondary\/80:hover{background-color:hsl(var(--secondary) / .8)}.hover\:bg-sidebar-accent:hover{background-color:hsl(var(--sidebar-accent))}.hover\:text-accent-foreground:hover{color:hsl(var(--accent-foreground))}.hover\:text-foreground:hover{color:hsl(var(--foreground))}.hover\:text-sidebar-accent-foreground:hover{color:hsl(var(--sidebar-accent-foreground))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-\[0_0_0_1px_hsl\(var\(--sidebar-accent\)\)\]:hover{--tw-shadow: 0 0 0 1px hsl(var(--sidebar-accent));--tw-shadow-colored: 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:after\:bg-sidebar-border:hover:after{content:var(--tw-content);background-color:hsl(var(--sidebar-border))}.focus\:bg-accent:focus{background-color:hsl(var(--accent))}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:text-destructive:focus{color:hsl(var(--destructive))}.focus\:opacity-100:focus{opacity:1}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-ring:focus{--tw-ring-color: hsl(var(--ring))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-1:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-sidebar-ring:focus-visible{--tw-ring-color: hsl(var(--sidebar-ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.active\:bg-sidebar-accent:active{background-color:hsl(var(--sidebar-accent))}.active\:text-sidebar-accent-foreground:active{color:hsl(var(--sidebar-accent-foreground))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:opacity-50:disabled{opacity:.5}.group\/menu-item:focus-within .group-focus-within\/menu-item\:opacity-100{opacity:1}.group\/menu-item:hover .group-hover\/menu-item\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.group.destructive .group-\[\.destructive\]\:border-muted\/40{border-color:hsl(var(--muted) / .4)}.group.destructive .group-\[\.destructive\]\:text-red-300{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:hover\:border-destructive\/30:hover{border-color:hsl(var(--destructive) / .3)}.group.destructive .group-\[\.destructive\]\:hover\:bg-destructive:hover{background-color:hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:hover\:text-destructive-foreground:hover{color:hsl(var(--destructive-foreground))}.group.destructive .group-\[\.destructive\]\:hover\:text-red-50:hover{--tw-text-opacity: 1;color:rgb(254 242 242 / var(--tw-text-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-destructive:focus{--tw-ring-color: hsl(var(--destructive))}.group.destructive .group-\[\.destructive\]\:focus\:ring-red-400:focus{--tw-ring-opacity: 1;--tw-ring-color: rgb(248 113 113 / var(--tw-ring-opacity))}.group.destructive .group-\[\.destructive\]\:focus\:ring-offset-red-600:focus{--tw-ring-offset-color: #dc2626}.peer\/menu-button:hover~.peer-hover\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.has-\[\[data-variant\=inset\]\]\:bg-sidebar:has([data-variant=inset]){background-color:hsl(var(--sidebar-background))}.group\/menu-item:has([data-sidebar=menu-action]) .group-has-\[\[data-sidebar\=menu-action\]\]\/menu-item\:pr-8{padding-right:2rem}.aria-disabled\:pointer-events-none[aria-disabled=true]{pointer-events:none}.aria-disabled\:opacity-50[aria-disabled=true]{opacity:.5}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[swipe\=cancel\]\:translate-x-0[data-swipe=cancel]{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=end\]\:translate-x-\[var\(--radix-toast-swipe-end-x\)\][data-swipe=end]{--tw-translate-x: var(--radix-toast-swipe-end-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[swipe\=move\]\:translate-x-\[var\(--radix-toast-swipe-move-x\)\][data-swipe=move]{--tw-translate-x: var(--radix-toast-swipe-move-x);transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[active\=true\]\:bg-sidebar-accent[data-active=true]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=active\]\:bg-background[data-state=active]{background-color:hsl(var(--background))}.data-\[state\=open\]\:bg-accent[data-state=open]{background-color:hsl(var(--accent))}.data-\[state\=open\]\:bg-secondary[data-state=open]{background-color:hsl(var(--secondary))}.data-\[state\=selected\]\:bg-muted[data-state=selected]{background-color:hsl(var(--muted))}.data-\[active\=true\]\:font-medium[data-active=true]{font-weight:500}.data-\[active\=true\]\:text-sidebar-accent-foreground[data-active=true]{color:hsl(var(--sidebar-accent-foreground))}.data-\[state\=active\]\:text-foreground[data-state=active]{color:hsl(var(--foreground))}.data-\[state\=open\]\:text-muted-foreground[data-state=open]{color:hsl(var(--muted-foreground))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:opacity-100[data-state=open]{opacity:1}.data-\[state\=active\]\:shadow[data-state=active]{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.data-\[swipe\=move\]\:transition-none[data-swipe=move]{transition-property:none}.data-\[state\=closed\]\:duration-300[data-state=closed]{transition-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{transition-duration:.5s}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed],.data-\[swipe\=end\]\:animate-out[data-swipe=end]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=closed\]\:fade-out-80[data-state=closed]{--tw-exit-opacity: .8}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-bottom[data-state=closed]{--tw-exit-translate-y: 100%}.data-\[state\=closed\]\:slide-out-to-left[data-state=closed]{--tw-exit-translate-x: -100%}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-right[data-state=closed]{--tw-exit-translate-x: 100%}.data-\[state\=closed\]\:slide-out-to-top[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=closed\]\:slide-out-to-top-full[data-state=closed]{--tw-exit-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-bottom[data-state=open]{--tw-enter-translate-y: 100%}.data-\[state\=open\]\:slide-in-from-left[data-state=open]{--tw-enter-translate-x: -100%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-right[data-state=open]{--tw-enter-translate-x: 100%}.data-\[state\=open\]\:slide-in-from-top[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-top-full[data-state=open]{--tw-enter-translate-y: -100%}.data-\[state\=closed\]\:duration-300[data-state=closed]{animation-duration:.3s}.data-\[state\=open\]\:duration-500[data-state=open]{animation-duration:.5s}.data-\[state\=open\]\:hover\:bg-sidebar-accent:hover[data-state=open]{background-color:hsl(var(--sidebar-accent))}.data-\[state\=open\]\:hover\:text-sidebar-accent-foreground:hover[data-state=open]{color:hsl(var(--sidebar-accent-foreground))}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:left-\[calc\(var\(--sidebar-width\)\*-1\)\]{left:calc(var(--sidebar-width) * -1)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:right-\[calc\(var\(--sidebar-width\)\*-1\)\]{right:calc(var(--sidebar-width) * -1)}.group[data-side=left] .group-data-\[side\=left\]\:-right-4{right:-1rem}.group[data-side=right] .group-data-\[side\=right\]\:left-0{left:0}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:-mt-8{margin-top:-2rem}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:hidden{display:none}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!size-8{width:2rem!important;height:2rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[--sidebar-width-icon\]{width:var(--sidebar-width-icon)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)\)\]{width:calc(var(--sidebar-width-icon) + 1rem)}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:w-\[calc\(var\(--sidebar-width-icon\)_\+_theme\(spacing\.4\)_\+2px\)\]{width:calc(var(--sidebar-width-icon) + 1rem + 2px)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:w-0{width:0px}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-side=right] .group-data-\[side\=right\]\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:overflow-hidden{overflow:hidden}.group[data-variant=floating] .group-data-\[variant\=floating\]\:rounded-lg{border-radius:var(--radius)}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border{border-width:1px}.group[data-side=left] .group-data-\[side\=left\]\:border-r{border-right-width:1px}.group[data-side=right] .group-data-\[side\=right\]\:border-l{border-left-width:1px}.group[data-variant=floating] .group-data-\[variant\=floating\]\:border-sidebar-border{border-color:hsl(var(--sidebar-border))}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-0{padding:0!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:\!p-2{padding:.5rem!important}.group[data-collapsible=icon] .group-data-\[collapsible\=icon\]\:opacity-0{opacity:0}.group[data-variant=floating] .group-data-\[variant\=floating\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:after\:left-full:after{content:var(--tw-content);left:100%}.group[data-collapsible=offcanvas] .group-data-\[collapsible\=offcanvas\]\:hover\:bg-sidebar:hover{background-color:hsl(var(--sidebar-background))}.peer\/menu-button[data-size=default]~.peer-data-\[size\=default\]\/menu-button\:top-1\.5{top:.375rem}.peer\/menu-button[data-size=lg]~.peer-data-\[size\=lg\]\/menu-button\:top-2\.5{top:.625rem}.peer\/menu-button[data-size=sm]~.peer-data-\[size\=sm\]\/menu-button\:top-1{top:.25rem}.peer[data-variant=inset]~.peer-data-\[variant\=inset\]\:min-h-\[calc\(100svh-theme\(spacing\.4\)\)\]{min-height:calc(100svh - 1rem)}.peer\/menu-button[data-active=true]~.peer-data-\[active\=true\]\/menu-button\:text-sidebar-accent-foreground{color:hsl(var(--sidebar-accent-foreground))}@media (min-width: 640px){.sm\:mt-0{margin-top:0}.sm\:flex{display:flex}.sm\:max-w-sm{max-width:24rem}.sm\:flex-row{flex-direction:row}.sm\:justify-end{justify-content:flex-end}.sm\:space-x-2>:not([hidden])~:not([hidden]){--tw-space-x-reverse: 0;margin-right:calc(.5rem * var(--tw-space-x-reverse));margin-left:calc(.5rem * calc(1 - var(--tw-space-x-reverse)))}.sm\:rounded-lg{border-radius:var(--radius)}.sm\:text-left{text-align:left}}@media (min-width: 768px){.md\:block{display:block}.md\:flex{display:flex}.md\:max-w-\[420px\]{max-width:420px}.md\:opacity-0{opacity:0}.after\:md\:hidden:after{content:var(--tw-content);display:none}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:m-2{margin:.5rem}.peer[data-state=collapsed][data-variant=inset]~.md\:peer-data-\[state\=collapsed\]\:peer-data-\[variant\=inset\]\:ml-2{margin-left:.5rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:ml-0{margin-left:0}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:rounded-xl{border-radius:.75rem}.peer[data-variant=inset]~.md\:peer-data-\[variant\=inset\]\:shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}}.\[\&\+div\]\:text-xs+div{font-size:.75rem;line-height:1rem}.\[\&\:has\(\[role\=checkbox\]\)\]\:pr-0:has([role=checkbox]){padding-right:0}.\[\&\>\[role\=checkbox\]\]\:translate-y-\[2px\]>[role=checkbox]{--tw-translate-y: 2px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.\[\&\>button\]\:hidden>button{display:none}.\[\&\>span\:last-child\]\:truncate>span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.\[\&\>svg\]\:size-4>svg{width:1rem;height:1rem}.\[\&\>svg\]\:shrink-0>svg{flex-shrink:0}.\[\&\>svg\]\:text-sidebar-accent-foreground>svg{color:hsl(var(--sidebar-accent-foreground))}.\[\&\>tr\]\:last\:border-b-0:last-child>tr{border-bottom-width:0px}.\[\&_svg\]\:pointer-events-none svg{pointer-events:none}.\[\&_svg\]\:size-4 svg{width:1rem;height:1rem}.\[\&_svg\]\:shrink-0 svg{flex-shrink:0}.\[\&_tr\:last-child\]\:border-0 tr:last-child{border-width:0px}.\[\&_tr\]\:border-b tr{border-bottom-width:1px}[data-side=left][data-collapsible=offcanvas] .\[\[data-side\=left\]\[data-collapsible\=offcanvas\]_\&\]\:-right-2{right:-.5rem}[data-side=left][data-state=collapsed] .\[\[data-side\=left\]\[data-state\=collapsed\]_\&\]\:cursor-e-resize{cursor:e-resize}[data-side=left] .\[\[data-side\=left\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right][data-collapsible=offcanvas] .\[\[data-side\=right\]\[data-collapsible\=offcanvas\]_\&\]\:-left-2{left:-.5rem}[data-side=right][data-state=collapsed] .\[\[data-side\=right\]\[data-state\=collapsed\]_\&\]\:cursor-w-resize{cursor:w-resize}[data-side=right] .\[\[data-side\=right\]_\&\]\:cursor-e-resize{cursor:e-resize} diff --git a/aidbox-forms-smart-launch/health-samurai.svg b/aidbox-forms-smart-launch/health-samurai.svg deleted file mode 100644 index 7c221c5..0000000 --- a/aidbox-forms-smart-launch/health-samurai.svg +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/aidbox-forms-smart-launch/index.html b/aidbox-forms-smart-launch/index.html deleted file mode 100644 index f325645..0000000 --- a/aidbox-forms-smart-launch/index.html +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - Aidbox Forms Smart App Launch - - - - - - -
- -