@medplum/app 4.5.2 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-CYbLYU78.css +1 -0
- package/dist/assets/index-OECDiSt3.js +615 -0
- package/dist/assets/index-OECDiSt3.js.map +1 -0
- package/dist/index.html +3 -3
- package/package.json +12 -12
- package/dist/assets/index-4gCOiXb_.css +0 -1
- package/dist/assets/index-CqVoJmTZ.js +0 -607
- package/dist/assets/index-CqVoJmTZ.js.map +0 -1
|
@@ -0,0 +1,615 @@
|
|
|
1
|
+
function cN(e,t){for(var n=0;n<t.length;n++){const r=t[n];if(typeof r!="string"&&!Array.isArray(r)){for(const o in r)if(o!=="default"&&!(o in e)){const l=Object.getOwnPropertyDescriptor(r,o);l&&Object.defineProperty(e,o,l.get?l:{enumerable:!0,get:()=>r[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 l of o)if(l.type==="childList")for(const c of l.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(o){const l={};return o.integrity&&(l.integrity=o.integrity),o.referrerPolicy&&(l.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?l.credentials="include":o.crossOrigin==="anonymous"?l.credentials="omit":l.credentials="same-origin",l}function r(o){if(o.ep)return;o.ep=!0;const l=n(o);fetch(o.href,l)}})();function Op(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ey={exports:{}},Yu={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var RC;function uN(){if(RC)return Yu;RC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,o,l){var c=null;if(l!==void 0&&(c=""+l),o.key!==void 0&&(c=""+o.key),"key"in o){l={};for(var d in o)d!=="key"&&(l[d]=o[d])}else l=o;return o=l.ref,{$$typeof:e,type:r,key:c,ref:o!==void 0?o:null,props:l}}return Yu.Fragment=t,Yu.jsx=n,Yu.jsxs=n,Yu}var _C;function dN(){return _C||(_C=1,ey.exports=uN()),ey.exports}var a=dN(),yo=function(){return yo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var l in n)Object.prototype.hasOwnProperty.call(n,l)&&(t[l]=n[l])}return t},yo.apply(this,arguments)};function YR(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);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}function vl(e,t,n,r){function o(l){return l instanceof n?l:new n(function(c){c(l)})}return new(n||(n=Promise))(function(l,c){function d(m){try{p(r.next(m))}catch(g){c(g)}}function f(m){try{p(r.throw(m))}catch(g){c(g)}}function p(m){m.done?l(m.value):o(m.value).then(d,f)}p((r=r.apply(e,t||[])).next())})}function fN(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,l;r<o;r++)(l||!(r in t))&&(l||(l=Array.prototype.slice.call(t,0,r)),l[r]=t[r]);return e.concat(l||Array.prototype.slice.call(t))}var ty={exports:{}},mt={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var DC;function hN(){if(DC)return mt;DC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),l=Symbol.for("react.consumer"),c=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function b(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},j=Object.assign,C={};function T(M,F,oe){this.props=M,this.context=F,this.refs=C,this.updater=oe||w}T.prototype.isReactComponent={},T.prototype.setState=function(M,F){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,F,"setState")},T.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function E(){}E.prototype=T.prototype;function R(M,F,oe){this.props=M,this.context=F,this.refs=C,this.updater=oe||w}var _=R.prototype=new E;_.constructor=R,j(_,T.prototype),_.isPureReactComponent=!0;var k=Array.isArray;function N(){}var A={H:null,A:null,T:null,S:null},P=Object.prototype.hasOwnProperty;function U(M,F,oe){var ce=oe.ref;return{$$typeof:e,type:M,key:F,ref:ce!==void 0?ce:null,props:oe}}function B(M,F){return U(M.type,F,M.props)}function Y(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function X(M){var F={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(oe){return F[oe]})}var te=/\/+/g;function $(M,F){return typeof M=="object"&&M!==null&&M.key!=null?X(""+M.key):F.toString(36)}function W(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(N,N):(M.status="pending",M.then(function(F){M.status==="pending"&&(M.status="fulfilled",M.value=F)},function(F){M.status==="pending"&&(M.status="rejected",M.reason=F)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function L(M,F,oe,ce,Se){var ge=typeof M;(ge==="undefined"||ge==="boolean")&&(M=null);var Oe=!1;if(M===null)Oe=!0;else switch(ge){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(M.$$typeof){case e:case t:Oe=!0;break;case m:return Oe=M._init,L(Oe(M._payload),F,oe,ce,Se)}}if(Oe)return Se=Se(M),Oe=ce===""?"."+$(M,0):ce,k(Se)?(oe="",Oe!=null&&(oe=Oe.replace(te,"$&/")+"/"),L(Se,F,oe,"",function(ht){return ht})):Se!=null&&(Y(Se)&&(Se=B(Se,oe+(Se.key==null||M&&M.key===Se.key?"":(""+Se.key).replace(te,"$&/")+"/")+Oe)),F.push(Se)),1;Oe=0;var nt=ce===""?".":ce+":";if(k(M))for(var Ce=0;Ce<M.length;Ce++)ce=M[Ce],ge=nt+$(ce,Ce),Oe+=L(ce,F,oe,ge,Se);else if(Ce=b(M),typeof Ce=="function")for(M=Ce.call(M),Ce=0;!(ce=M.next()).done;)ce=ce.value,ge=nt+$(ce,Ce++),Oe+=L(ce,F,oe,ge,Se);else if(ge==="object"){if(typeof M.then=="function")return L(W(M),F,oe,ce,Se);throw F=String(M),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function I(M,F,oe){if(M==null)return M;var ce=[],Se=0;return L(M,ce,"","",function(ge){return F.call(oe,ge,Se++)}),ce}function z(M){if(M._status===-1){var F=M._result;F=F(),F.then(function(oe){(M._status===0||M._status===-1)&&(M._status=1,M._result=oe)},function(oe){(M._status===0||M._status===-1)&&(M._status=2,M._result=oe)}),M._status===-1&&(M._status=0,M._result=F)}if(M._status===1)return M._result.default;throw M._result}var V=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},J={map:I,forEach:function(M,F,oe){I(M,function(){F.apply(this,arguments)},oe)},count:function(M){var F=0;return I(M,function(){F++}),F},toArray:function(M){return I(M,function(F){return F})||[]},only:function(M){if(!Y(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return mt.Activity=g,mt.Children=J,mt.Component=T,mt.Fragment=n,mt.Profiler=o,mt.PureComponent=R,mt.StrictMode=r,mt.Suspense=f,mt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=A,mt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return A.H.useMemoCache(M)}},mt.cache=function(M){return function(){return M.apply(null,arguments)}},mt.cacheSignal=function(){return null},mt.cloneElement=function(M,F,oe){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ce=j({},M.props),Se=M.key;if(F!=null)for(ge in F.key!==void 0&&(Se=""+F.key),F)!P.call(F,ge)||ge==="key"||ge==="__self"||ge==="__source"||ge==="ref"&&F.ref===void 0||(ce[ge]=F[ge]);var ge=arguments.length-2;if(ge===1)ce.children=oe;else if(1<ge){for(var Oe=Array(ge),nt=0;nt<ge;nt++)Oe[nt]=arguments[nt+2];ce.children=Oe}return U(M.type,Se,ce)},mt.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:l,_context:M},M},mt.createElement=function(M,F,oe){var ce,Se={},ge=null;if(F!=null)for(ce in F.key!==void 0&&(ge=""+F.key),F)P.call(F,ce)&&ce!=="key"&&ce!=="__self"&&ce!=="__source"&&(Se[ce]=F[ce]);var Oe=arguments.length-2;if(Oe===1)Se.children=oe;else if(1<Oe){for(var nt=Array(Oe),Ce=0;Ce<Oe;Ce++)nt[Ce]=arguments[Ce+2];Se.children=nt}if(M&&M.defaultProps)for(ce in Oe=M.defaultProps,Oe)Se[ce]===void 0&&(Se[ce]=Oe[ce]);return U(M,ge,Se)},mt.createRef=function(){return{current:null}},mt.forwardRef=function(M){return{$$typeof:d,render:M}},mt.isValidElement=Y,mt.lazy=function(M){return{$$typeof:m,_payload:{_status:-1,_result:M},_init:z}},mt.memo=function(M,F){return{$$typeof:p,type:M,compare:F===void 0?null:F}},mt.startTransition=function(M){var F=A.T,oe={};A.T=oe;try{var ce=M(),Se=A.S;Se!==null&&Se(oe,ce),typeof ce=="object"&&ce!==null&&typeof ce.then=="function"&&ce.then(N,V)}catch(ge){V(ge)}finally{F!==null&&oe.types!==null&&(F.types=oe.types),A.T=F}},mt.unstable_useCacheRefresh=function(){return A.H.useCacheRefresh()},mt.use=function(M){return A.H.use(M)},mt.useActionState=function(M,F,oe){return A.H.useActionState(M,F,oe)},mt.useCallback=function(M,F){return A.H.useCallback(M,F)},mt.useContext=function(M){return A.H.useContext(M)},mt.useDebugValue=function(){},mt.useDeferredValue=function(M,F){return A.H.useDeferredValue(M,F)},mt.useEffect=function(M,F){return A.H.useEffect(M,F)},mt.useEffectEvent=function(M){return A.H.useEffectEvent(M)},mt.useId=function(){return A.H.useId()},mt.useImperativeHandle=function(M,F,oe){return A.H.useImperativeHandle(M,F,oe)},mt.useInsertionEffect=function(M,F){return A.H.useInsertionEffect(M,F)},mt.useLayoutEffect=function(M,F){return A.H.useLayoutEffect(M,F)},mt.useMemo=function(M,F){return A.H.useMemo(M,F)},mt.useOptimistic=function(M,F){return A.H.useOptimistic(M,F)},mt.useReducer=function(M,F,oe){return A.H.useReducer(M,F,oe)},mt.useRef=function(M){return A.H.useRef(M)},mt.useState=function(M){return A.H.useState(M)},mt.useSyncExternalStore=function(M,F,oe){return A.H.useSyncExternalStore(M,F,oe)},mt.useTransition=function(){return A.H.useTransition()},mt.version="19.2.0",mt}var AC;function Yx(){return AC||(AC=1,ty.exports=hN()),ty.exports}var v=Yx();const Dn=Op(v),KR=cN({__proto__:null,default:Dn},[v]);var zh="right-scroll-bar-position",$h="width-before-scroll-bar",pN="with-scroll-bars-hidden",mN="--removed-body-scroll-bar-size";function ny(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function gN(e,t){var n=v.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var vN=typeof window<"u"?v.useLayoutEffect:v.useEffect,kC=new WeakMap;function yN(e,t){var n=gN(null,function(r){return e.forEach(function(o){return ny(o,r)})});return vN(function(){var r=kC.get(n);if(r){var o=new Set(r),l=new Set(e),c=n.current;o.forEach(function(d){l.has(d)||ny(d,null)}),l.forEach(function(d){o.has(d)||ny(d,c)})}kC.set(n,e)},[e]),n}function xN(e){return e}function bN(e,t){t===void 0&&(t=xN);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(l){var c=t(l,r);return n.push(c),function(){n=n.filter(function(d){return d!==c})}},assignSyncMedium:function(l){for(r=!0;n.length;){var c=n;n=[],c.forEach(l)}n={push:function(d){return l(d)},filter:function(){return n}}},assignMedium:function(l){r=!0;var c=[];if(n.length){var d=n;n=[],d.forEach(l),c=n}var f=function(){var m=c;c=[],m.forEach(l)},p=function(){return Promise.resolve().then(f)};p(),n={push:function(m){c.push(m),p()},filter:function(m){return c=c.filter(m),n}}}};return o}function SN(e){e===void 0&&(e={});var t=bN(null);return t.options=yo({async:!0,ssr:!1},e),t}var XR=function(e){var t=e.sideCar,n=YR(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return v.createElement(r,yo({},n))};XR.isSideCarExport=!0;function wN(e,t){return e.useMedium(t),XR}var JR=SN(),ry=function(){},Np=v.forwardRef(function(e,t){var n=v.useRef(null),r=v.useState({onScrollCapture:ry,onWheelCapture:ry,onTouchMoveCapture:ry}),o=r[0],l=r[1],c=e.forwardProps,d=e.children,f=e.className,p=e.removeScrollBar,m=e.enabled,g=e.shards,y=e.sideCar,b=e.noRelative,w=e.noIsolation,j=e.inert,C=e.allowPinchZoom,T=e.as,E=T===void 0?"div":T,R=e.gapMode,_=YR(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),k=y,N=yN([n,t]),A=yo(yo({},_),o);return v.createElement(v.Fragment,null,m&&v.createElement(k,{sideCar:JR,removeScrollBar:p,shards:g,noRelative:b,noIsolation:w,inert:j,setCallbacks:l,allowPinchZoom:!!C,lockRef:n,gapMode:R}),c?v.cloneElement(v.Children.only(d),yo(yo({},A),{ref:N})):v.createElement(E,yo({},A,{className:f,ref:N}),d))});Np.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Np.classNames={fullWidth:$h,zeroRight:zh};var jN=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function CN(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=jN();return t&&e.setAttribute("nonce",t),e}function EN(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function TN(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var RN=function(){var e=0,t=null;return{add:function(n){e==0&&(t=CN())&&(EN(t,n),TN(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},_N=function(){var e=RN();return function(t,n){v.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ZR=function(){var e=_N(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},DN={left:0,top:0,right:0,gap:0},iy=function(e){return parseInt(e||"",10)||0},AN=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[iy(n),iy(r),iy(o)]},kN=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return DN;var t=AN(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])}},PN=ZR(),Tc="data-scroll-locked",ON=function(e,t,n,r){var o=e.left,l=e.top,c=e.right,d=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
+
.`.concat(pN,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(d,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(Tc,`] {
|
|
23
|
+
overflow: hidden `).concat(r,`;
|
|
24
|
+
overscroll-behavior: contain;
|
|
25
|
+
`).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
26
|
+
padding-left: `.concat(o,`px;
|
|
27
|
+
padding-top: `).concat(l,`px;
|
|
28
|
+
padding-right: `).concat(c,`px;
|
|
29
|
+
margin-left:0;
|
|
30
|
+
margin-top:0;
|
|
31
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
32
|
+
`),n==="padding"&&"padding-right: ".concat(d,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(zh,` {
|
|
36
|
+
right: `).concat(d,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat($h,` {
|
|
40
|
+
margin-right: `).concat(d,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(zh," .").concat(zh,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat($h," .").concat($h,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(Tc,`] {
|
|
52
|
+
`).concat(mN,": ").concat(d,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},PC=function(){var e=parseInt(document.body.getAttribute(Tc)||"0",10);return isFinite(e)?e:0},NN=function(){v.useEffect(function(){return document.body.setAttribute(Tc,(PC()+1).toString()),function(){var e=PC()-1;e<=0?document.body.removeAttribute(Tc):document.body.setAttribute(Tc,e.toString())}},[])},MN=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;NN();var l=v.useMemo(function(){return kN(o)},[o]);return v.createElement(PN,{styles:ON(l,!t,o,n?"":"!important")})},Zy=!1;if(typeof window<"u")try{var vh=Object.defineProperty({},"passive",{get:function(){return Zy=!0,!0}});window.addEventListener("test",vh,vh),window.removeEventListener("test",vh,vh)}catch{Zy=!1}var dc=Zy?{passive:!1}:!1,LN=function(e){return e.tagName==="TEXTAREA"},e2=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!LN(e)&&n[t]==="visible")},IN=function(e){return e2(e,"overflowY")},zN=function(e){return e2(e,"overflowX")},OC=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=t2(e,r);if(o){var l=n2(e,r),c=l[1],d=l[2];if(c>d)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},$N=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},UN=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},t2=function(e,t){return e==="v"?IN(t):zN(t)},n2=function(e,t){return e==="v"?$N(t):UN(t)},BN=function(e,t){return e==="h"&&t==="rtl"?-1:1},VN=function(e,t,n,r,o){var l=BN(e,window.getComputedStyle(t).direction),c=l*r,d=n.target,f=t.contains(d),p=!1,m=c>0,g=0,y=0;do{if(!d)break;var b=n2(e,d),w=b[0],j=b[1],C=b[2],T=j-C-l*w;(w||T)&&t2(e,d)&&(g+=T,y+=w);var E=d.parentNode;d=E&&E.nodeType===Node.DOCUMENT_FRAGMENT_NODE?E.host:E}while(!f&&d!==document.body||f&&(t.contains(d)||t===d));return(m&&Math.abs(g)<1||!m&&Math.abs(y)<1)&&(p=!0),p},yh=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},NC=function(e){return[e.deltaX,e.deltaY]},MC=function(e){return e&&"current"in e?e.current:e},FN=function(e,t){return e[0]===t[0]&&e[1]===t[1]},HN=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},qN=0,fc=[];function GN(e){var t=v.useRef([]),n=v.useRef([0,0]),r=v.useRef(),o=v.useState(qN++)[0],l=v.useState(ZR)[0],c=v.useRef(e);v.useEffect(function(){c.current=e},[e]),v.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var j=fN([e.lockRef.current],(e.shards||[]).map(MC),!0).filter(Boolean);return j.forEach(function(C){return C.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),j.forEach(function(C){return C.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var d=v.useCallback(function(j,C){if("touches"in j&&j.touches.length===2||j.type==="wheel"&&j.ctrlKey)return!c.current.allowPinchZoom;var T=yh(j),E=n.current,R="deltaX"in j?j.deltaX:E[0]-T[0],_="deltaY"in j?j.deltaY:E[1]-T[1],k,N=j.target,A=Math.abs(R)>Math.abs(_)?"h":"v";if("touches"in j&&A==="h"&&N.type==="range")return!1;var P=OC(A,N);if(!P)return!0;if(P?k=A:(k=A==="v"?"h":"v",P=OC(A,N)),!P)return!1;if(!r.current&&"changedTouches"in j&&(R||_)&&(r.current=k),!k)return!0;var U=r.current||k;return VN(U,C,j,U==="h"?R:_)},[]),f=v.useCallback(function(j){var C=j;if(!(!fc.length||fc[fc.length-1]!==l)){var T="deltaY"in C?NC(C):yh(C),E=t.current.filter(function(k){return k.name===C.type&&(k.target===C.target||C.target===k.shadowParent)&&FN(k.delta,T)})[0];if(E&&E.should){C.cancelable&&C.preventDefault();return}if(!E){var R=(c.current.shards||[]).map(MC).filter(Boolean).filter(function(k){return k.contains(C.target)}),_=R.length>0?d(C,R[0]):!c.current.noIsolation;_&&C.cancelable&&C.preventDefault()}}},[]),p=v.useCallback(function(j,C,T,E){var R={name:j,delta:C,target:T,should:E,shadowParent:WN(T)};t.current.push(R),setTimeout(function(){t.current=t.current.filter(function(_){return _!==R})},1)},[]),m=v.useCallback(function(j){n.current=yh(j),r.current=void 0},[]),g=v.useCallback(function(j){p(j.type,NC(j),j.target,d(j,e.lockRef.current))},[]),y=v.useCallback(function(j){p(j.type,yh(j),j.target,d(j,e.lockRef.current))},[]);v.useEffect(function(){return fc.push(l),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:y}),document.addEventListener("wheel",f,dc),document.addEventListener("touchmove",f,dc),document.addEventListener("touchstart",m,dc),function(){fc=fc.filter(function(j){return j!==l}),document.removeEventListener("wheel",f,dc),document.removeEventListener("touchmove",f,dc),document.removeEventListener("touchstart",m,dc)}},[]);var b=e.removeScrollBar,w=e.inert;return v.createElement(v.Fragment,null,w?v.createElement(l,{styles:HN(o)}):null,b?v.createElement(MN,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function WN(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const QN=wN(JR,GN);var Pc=v.forwardRef(function(e,t){return v.createElement(Np,yo({},e,{ref:t,sideCar:QN}))});Pc.classNames=Np.classNames;function ln(e){return Object.keys(e)}function oy(e){return e&&typeof e=="object"&&!Array.isArray(e)}function Kx(e,t){const n={...e},r=t;return oy(e)&&oy(t)&&Object.keys(t).forEach(o=>{oy(r[o])&&o in e?n[o]=Kx(n[o],r[o]):n[o]=r[o]}),n}function YN(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function KN(e){return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:e.match(/^calc\((.*?)\)$/)?.[1].split("*")[0].trim()}function ud(e){const t=KN(e);return typeof t=="number"?t:typeof t=="string"?t.includes("calc")||t.includes("var")?t:t.includes("px")?Number(t.replace("px","")):t.includes("rem")?Number(t.replace("rem",""))*16:t.includes("em")?Number(t.replace("em",""))*16:Number(t):NaN}function LC(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function r2(e,{shouldScale:t=!1}={}){function n(r){if(r===0||r==="0")return`0${e}`;if(typeof r=="number"){const o=`${r/16}${e}`;return t?LC(o):o}if(typeof r=="string"){if(r===""||r.startsWith("calc(")||r.startsWith("clamp(")||r.includes("rgba("))return r;if(r.includes(","))return r.split(",").map(l=>n(l)).join(",");if(r.includes(" "))return r.split(" ").map(l=>n(l)).join(" ");const o=r.replace("px","");if(!Number.isNaN(Number(o))){const l=`${Number(o)/16}${e}`;return t?LC(l):l}}return r}return n}const le=r2("rem",{shouldScale:!0}),Jh=r2("em");function gs(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function i2(e){if(typeof e=="number")return!0;if(typeof e=="string"){if(e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!=="")return!0;const t=/^[+-]?[0-9]+(\.[0-9]+)?(px|em|rem|ex|ch|lh|rlh|vw|vh|vmin|vmax|vb|vi|svw|svh|lvw|lvh|dvw|dvh|cm|mm|in|pt|pc|q|cqw|cqh|cqi|cqb|cqmin|cqmax|%)?$/;return e.trim().split(/\s+/).every(r=>t.test(r))}return!1}function Oo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==v.Fragment:!1}function kr(e){const t=v.createContext(null);return[({children:o,value:l})=>a.jsx(t.Provider,{value:l,children:o}),()=>{const o=v.useContext(t);if(o===null)throw new Error(e);return o}]}function No(e=null){const t=v.createContext(e);return[({children:o,value:l})=>a.jsx(t.Provider,{value:l,children:o}),()=>v.useContext(t)]}function IC(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Zh(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function XN(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].disabled)return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].disabled)return r}return e}function JN(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].disabled)return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].disabled)return r}return e}function ZN(e,t,n){return Zh(e,n)===Zh(t,n)}function Xx({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:l="rtl",orientation:c}){return d=>{n?.(d);const f=Array.from(Zh(d.currentTarget,e)?.querySelectorAll(t)||[]).filter(w=>ZN(d.currentTarget,w,e)),p=f.findIndex(w=>d.currentTarget===w),m=JN(p,f,r),g=XN(p,f,r),y=l==="rtl"?g:m,b=l==="rtl"?m:g;switch(d.key){case"ArrowRight":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[y].focus(),o&&f[y].click());break}case"ArrowLeft":{c==="horizontal"&&(d.stopPropagation(),d.preventDefault(),f[b].focus(),o&&f[b].click());break}case"ArrowUp":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[g].focus(),o&&f[g].click());break}case"ArrowDown":{c==="vertical"&&(d.stopPropagation(),d.preventDefault(),f[m].focus(),o&&f[m].click());break}case"Home":{d.stopPropagation(),d.preventDefault(),!f[0].disabled&&f[0].focus();break}case"End":{d.stopPropagation(),d.preventDefault();const w=f.length-1;!f[w].disabled&&f[w].focus();break}}}}const eM={app:100,modal:200,popover:300,overlay:400,max:9999};function di(e){return eM[e]}const ep=()=>{};function tM(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||ep:n=>{n.key==="Escape"&&(e(n),t.onTrigger?.())}}function at(e,t="size",n=!0){if(e!==void 0)return i2(e)?n?le(e):e:`var(--${t}-${e})`}function Vn(e){return at(e,"mantine-spacing")}function Vt(e){return e===void 0?"var(--mantine-radius-default)":at(e,"mantine-radius")}function Fn(e){return at(e,"mantine-font-size")}function o2(e){return at(e,"mantine-line-height",!1)}function Jx(e){if(e)return at(e,"mantine-shadow",!1)}function ir(e,t){return n=>{e?.(n),t?.(n)}}function Zx(e,t){return e in t?ud(t[e]):ud(e)}function dd(e,t){const n=e.map(r=>({value:r,px:Zx(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Qi(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function nM(e,t,n){return n?Array.from(Zh(n,t)?.querySelectorAll(e)||[]).findIndex(r=>r===n):null}function Uh(e,t,n){return t===void 0&&n===void 0?e:t!==void 0&&n===void 0?Math.max(e,t):Math.min(t===void 0&&n!==void 0?e:Math.max(e,t),n)}function tp(e="mantine-"){return`${e}${Math.random().toString(36).slice(2,11)}`}function rM(e,t){if(e===t||Number.isNaN(e)&&Number.isNaN(t))return!0;if(!(e instanceof Object)||!(t instanceof Object))return!1;const n=Object.keys(e),{length:r}=n;if(r!==Object.keys(t).length)return!1;for(let o=0;o<r;o+=1){const l=n[o];if(!(l in t)||e[l]!==t[l]&&!(Number.isNaN(e[l])&&Number.isNaN(t[l])))return!1}return!0}function zC(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Ws(e){const t=v.useRef(e);return v.useEffect(()=>{t.current=e}),v.useMemo(()=>((...n)=>t.current?.(...n)),[])}function Mp(e,t){const{delay:n,flushOnUnmount:r,leading:o}=typeof t=="number"?{delay:t,flushOnUnmount:!1,leading:!1}:t,l=Ws(e),c=v.useRef(0),d=v.useMemo(()=>{const f=Object.assign((...p)=>{window.clearTimeout(c.current);const m=f._isFirstCall;f._isFirstCall=!1;function g(){window.clearTimeout(c.current),c.current=0,f._isFirstCall=!0}if(o&&m){l(...p);const w=()=>{g()},j=()=>{c.current!==0&&(g(),l(...p))},C=()=>{g()};f.flush=j,f.cancel=C,c.current=window.setTimeout(w,n);return}if(o&&!m){const w=()=>{c.current!==0&&(g(),l(...p))},j=()=>{g()};f.flush=w,f.cancel=j;const C=()=>{g()};c.current=window.setTimeout(C,n);return}const y=()=>{c.current!==0&&(g(),l(...p))},b=()=>{g()};f.flush=y,f.cancel=b,c.current=window.setTimeout(y,n)},{flush:()=>{},cancel:()=>{},_isFirstCall:!0});return f},[l,n,o]);return v.useEffect(()=>()=>{r?d.flush():d.cancel()},[d,r]),d}const iM=["mousedown","touchstart"];function oM(e,t,n){const r=v.useRef(null),o=t||iM;return v.useEffect(()=>{const l=c=>{const{target:d}=c??{};if(Array.isArray(n)){const f=!document.body.contains(d)&&d?.tagName!=="HTML";n.every(m=>!!m&&!c.composedPath().includes(m))&&!f&&e(c)}else r.current&&!r.current.contains(d)&&e(c)};return o.forEach(c=>document.addEventListener(c,l)),()=>{o.forEach(c=>document.removeEventListener(c,l))}},[r,e,n]),r}function a2(e={timeout:2e3}){const[t,n]=v.useState(null),[r,o]=v.useState(!1),[l,c]=v.useState(null),d=m=>{window.clearTimeout(l),c(window.setTimeout(()=>o(!1),e.timeout)),o(m)};return{copy:m=>{"clipboard"in navigator?navigator.clipboard.writeText(m).then(()=>d(!0)).catch(g=>n(g)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(l)},error:t,copied:r}}function aM(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function sM(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function s2(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=v.useState(n?t:sM(e));return v.useEffect(()=>{try{const l=window.matchMedia(e);return o(l.matches),aM(l,c=>o(c.matches))}catch{return}},[e]),r||!1}function lM(e,t){return s2("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const qc=typeof document<"u"?v.useLayoutEffect:v.useEffect;function rl(e,t){const n=v.useRef(!1);v.useEffect(()=>()=>{n.current=!1},[]),v.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function l2({opened:e,shouldReturnFocus:t=!0}){const n=v.useRef(null),r=()=>{n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&n.current?.focus({preventScroll:!0})};return rl(()=>{let o=-1;const l=c=>{c.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",l),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",l)}},[e,t]),r}const cM=/input|select|textarea|button|object/,c2="a, input, select, textarea, button, object, [tabindex]";function uM(e){return e.style.display==="none"}function dM(e){if(e.getAttribute("aria-hidden")||e.getAttribute("hidden")||e.getAttribute("type")==="hidden")return!1;let n=e;for(;n&&!(n===document.body||n.nodeType===11);){if(uM(n))return!1;n=n.parentNode}return!0}function u2(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function ex(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(u2(e));return(cM.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&dM(e)}function d2(e){const t=u2(e);return(Number.isNaN(t)||t>=0)&&ex(e)}function fM(e){return Array.from(e.querySelectorAll(c2)).filter(d2)}function hM(e,t){const n=fM(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let l=r===o.activeElement||e===o.activeElement;const c=o.activeElement;if(c.tagName==="INPUT"&&c.getAttribute("type")==="radio"&&(l=n.filter(m=>m.getAttribute("type")==="radio"&&m.getAttribute("name")===c.getAttribute("name")).includes(r)),!l)return;t.preventDefault();const f=n[t.shiftKey?n.length-1:0];f&&f.focus()}function pM(e=!0){const t=v.useRef(null),n=o=>{let l=o.querySelector("[data-autofocus]");if(!l){const c=Array.from(o.querySelectorAll(c2));l=c.find(d2)||c.find(ex)||null,!l&&ex(o)&&(l=o)}l&&l.focus({preventScroll:!0})},r=v.useCallback(o=>{e&&o!==null&&t.current!==o&&(o?(setTimeout(()=>{o.getRootNode()&&n(o)}),t.current=o):t.current=null)},[e]);return v.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>n(t.current));const o=l=>{l.key==="Tab"&&t.current&&hM(t.current,l)};return document.addEventListener("keydown",o),()=>document.removeEventListener("keydown",o)},[e]),r}const mM=e=>(e+1)%1e6;function gM(){const[,e]=v.useReducer(mM,0);return e}const vM=Dn.useId||(()=>{});function yM(){const e=vM();return e?`mantine-${e.replace(/:/g,"")}`:""}function hr(e){const t=yM(),[n,r]=v.useState(t);return qc(()=>{r(tp())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function f2(e,t,n){v.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function fd(e,t){if(typeof e=="function")return e(t);typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function xM(...e){const t=new Map;return n=>{if(e.forEach(r=>{const o=fd(r,n);o&&t.set(r,o)}),t.size>0)return()=>{e.forEach(r=>{const o=t.get(r);o&&typeof o=="function"?o():fd(r,null)}),t.clear()}}}function In(...e){return v.useCallback(xM(...e),e)}function or({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,l]=v.useState(t!==void 0?t:n),c=(d,...f)=>{l(d),r?.(d,...f)};return e!==void 0?[e,r,!0]:[o,c,!1]}function ns(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const xh="dots";function bM({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:l}){const c=Math.max(Math.trunc(e),0),[d,f]=or({value:r,onChange:l,defaultValue:o,finalValue:o}),p=j=>{j<=0?f(1):j>c?f(c):f(j)},m=()=>p(d+1),g=()=>p(d-1),y=()=>p(1),b=()=>p(c);return{range:v.useMemo(()=>{if(t*2+3+n*2>=c)return ns(1,c);const C=Math.max(d-t,n),T=Math.min(d+t,c-n),E=C>n+2,R=T<c-(n+1);if(!E&&R){const _=t*2+n+2;return[...ns(1,_),xh,...ns(c-(n-1),c)]}if(E&&!R){const _=n+1+2*t;return[...ns(1,n),xh,...ns(c-_,c)]}return[...ns(1,n),xh,...ns(C,T),xh,...ns(c-n+1,c)]},[c,t,d]),active:d,setPage:p,next:m,previous:g,first:y,last:b}}function eb(e,t){return s2("(prefers-reduced-motion: reduce)",e,t)}function SM(e,t){if(!e||!t)return!1;if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n+=1)if(!rM(e[n],t[n]))return!1;return!0}function wM(e){const t=v.useRef([]),n=v.useRef(0);return SM(t.current,e)||(t.current=e,n.current+=1),[n.current]}function jM(e,t){v.useEffect(e,wM(t))}function Gc(e=!1,t={}){const[n,r]=v.useState(e),o=v.useCallback(()=>{r(d=>d||(t.onOpen?.(),!0))},[t.onOpen]),l=v.useCallback(()=>{r(d=>d&&(t.onClose?.(),!1))},[t.onClose]),c=v.useCallback(()=>{n?l():o()},[l,o,n]);return[n,{open:o,close:l,toggle:c}]}function CM(e,t,n={autoInvoke:!1}){const r=v.useRef(null),o=v.useCallback((...c)=>{r.current||(r.current=window.setTimeout(()=>{e(c),r.current=null},t))},[t]),l=v.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return v.useEffect(()=>(n.autoInvoke&&o(),l),[l,o]),{start:o,clear:l}}function EM(e,t,n){const r=v.useRef(null),o=v.useRef(null);return v.useEffect(()=>{const l=typeof n=="function"?n():n;return(l||o.current)&&(r.current=new MutationObserver(e),r.current.observe(l||o.current,t)),()=>{r.current?.disconnect()}},[e,t]),o}function TM(){const[e,t]=v.useState(!1);return v.useEffect(()=>t(!0),[]),e}var RM={};function h2(){return typeof process<"u"&&RM?"production":"development"}function Lp(e){const t=Dn.version;return typeof Dn.version!="string"||t.startsWith("18.")?e?.ref:e?.props?.ref}function p2(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<o;t++)e[t]&&(n=p2(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function $t(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=p2(e))&&(r&&(r+=" "),r+=t);return r}const _M={};function DM(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=$t(t[r],o):t[r]=o})}),t}function Ip({theme:e,classNames:t,props:n,stylesCtx:r}){const l=(Array.isArray(t)?t:[t]).map(c=>typeof c=="function"?c(e,n,r):c||_M);return DM(l)}function np({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((l,c)=>typeof c=="function"?{...l,...c(e,n,r)}:{...l,...c},{})}const tb=v.createContext(null);function wa(){const e=v.useContext(tb);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function AM(){return wa().cssVariablesResolver}function kM(){return wa().classNamesPrefix}function zp(){return wa().getStyleNonce}function PM(){return wa().withStaticClasses}function OM(){return wa().headless}function NM(){return wa().stylesTransform?.sx}function MM(){return wa().stylesTransform?.styles}function $p(){return wa().env||"default"}function LM(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function IM(e){let t=e.replace("#","");if(t.length===3){const c=t.split("");t=[c[0],c[0],c[1],c[1],c[2],c[2]].join("")}if(t.length===8){const c=parseInt(t.slice(6,8),16)/255;return{r:parseInt(t.slice(0,2),16),g:parseInt(t.slice(2,4),16),b:parseInt(t.slice(4,6),16),a:c}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,l=n&255;return{r,g:o,b:l,a:1}}function zM(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o===void 0?1:o}}function $M(e){const t=/^hsla?\(\s*(\d+)\s*,\s*(\d+%)\s*,\s*(\d+%)\s*(,\s*(0?\.\d+|\d+(\.\d+)?))?\s*\)$/i,n=e.match(t);if(!n)return{r:0,g:0,b:0,a:1};const r=parseInt(n[1],10),o=parseInt(n[2],10)/100,l=parseInt(n[3],10)/100,c=n[5]?parseFloat(n[5]):void 0,d=(1-Math.abs(2*l-1))*o,f=r/60,p=d*(1-Math.abs(f%2-1)),m=l-d/2;let g,y,b;return f>=0&&f<1?(g=d,y=p,b=0):f>=1&&f<2?(g=p,y=d,b=0):f>=2&&f<3?(g=0,y=d,b=p):f>=3&&f<4?(g=0,y=p,b=d):f>=4&&f<5?(g=p,y=0,b=d):(g=d,y=0,b=p),{r:Math.round((g+m)*255),g:Math.round((y+m)*255),b:Math.round((b+m)*255),a:c||1}}function nb(e){return LM(e)?IM(e):e.startsWith("rgb")?zM(e):e.startsWith("hsl")?$M(e):{r:0,g:0,b:0,a:1}}function bh(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:l}=nb(e),c=1-t,d=f=>Math.round(f*c);return`rgba(${d(n)}, ${d(r)}, ${d(o)}, ${l})`}function hd(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function ay(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function UM(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function BM(e){if(e.startsWith("oklch("))return(UM(e)||0)/100;const{r:t,g:n,b:r}=nb(e),o=t/255,l=n/255,c=r/255,d=ay(o),f=ay(l),p=ay(c);return .2126*d+.7152*f+.0722*p}function Ku(e,t=.179){return e.startsWith("var(")?!1:BM(e)>t}function si({color:e,theme:t,colorScheme:n}){if(typeof e!="string")throw new Error(`[@mantine/core] Failed to parse color. Expected color to be a string, instead got ${typeof e}`);if(e==="bright")return{color:e,value:n==="dark"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Ku(n==="dark"?t.white:t.black,t.luminanceThreshold),variable:"--mantine-color-bright"};if(e==="dimmed")return{color:e,value:n==="dark"?t.colors.dark[2]:t.colors.gray[7],shade:void 0,isThemeColor:!1,isLight:Ku(n==="dark"?t.colors.dark[2]:t.colors.gray[6],t.luminanceThreshold),variable:"--mantine-color-dimmed"};if(e==="white"||e==="black")return{color:e,value:e==="white"?t.white:t.black,shade:void 0,isThemeColor:!1,isLight:Ku(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),l=o?Number(o):void 0,c=r in t.colors;if(c){const d=l!==void 0?t.colors[r][l]:t.colors[r][hd(t,n||"light")];return{color:r,value:d,shade:l,isThemeColor:c,isLight:Ku(d,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${l}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:c,isLight:Ku(e,t.luminanceThreshold),shade:l,variable:void 0}}function Qt(e,t){const n=si({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function tx(e,t){const n={from:e?.from||t.defaultGradient.from,to:e?.to||t.defaultGradient.to,deg:e?.deg??t.defaultGradient.deg??0},r=Qt(n.from,t),o=Qt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function Ri(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const l=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${l}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=nb(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const hc=Ri,VM=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const l=si({color:e,theme:t}),c=typeof o=="boolean"?o:t.autoContrast;if(n==="none")return{background:"transparent",hover:"transparent",color:"inherit",border:"none"};if(n==="filled"){const d=c&&l.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return l.isThemeColor?l.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:d,border:`${le(1)} solid transparent`}:{background:`var(--mantine-color-${l.color}-${l.shade})`,hover:`var(--mantine-color-${l.color}-${l.shade===9?8:l.shade+1})`,color:d,border:`${le(1)} solid transparent`}:{background:e,hover:bh(e,.1),color:d,border:`${le(1)} solid transparent`}}if(n==="light"){if(l.isThemeColor){if(l.shade===void 0)return{background:`var(--mantine-color-${e}-light)`,hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const d=t.colors[l.color][l.shade];return{background:Ri(d,.1),hover:Ri(d,.12),color:`var(--mantine-color-${l.color}-${Math.min(l.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:Ri(e,.1),hover:Ri(e,.12),color:e,border:`${le(1)} solid transparent`}}if(n==="outline")return l.isThemeColor?l.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${le(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:Ri(t.colors[l.color][l.shade],.05),color:`var(--mantine-color-${l.color}-${l.shade})`,border:`${le(1)} solid var(--mantine-color-${l.color}-${l.shade})`}:{background:"transparent",hover:Ri(e,.05),color:e,border:`${le(1)} solid ${e}`};if(n==="subtle"){if(l.isThemeColor){if(l.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`};const d=t.colors[l.color][l.shade];return{background:"transparent",hover:Ri(d,.12),color:`var(--mantine-color-${l.color}-${Math.min(l.shade,6)})`,border:`${le(1)} solid transparent`}}return{background:"transparent",hover:Ri(e,.12),color:e,border:`${le(1)} solid transparent`}}return n==="transparent"?l.isThemeColor?l.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${l.color}-${Math.min(l.shade,6)})`,border:`${le(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${le(1)} solid transparent`}:n==="white"?l.isThemeColor?l.shade===void 0?{background:"var(--mantine-color-white)",hover:bh(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:bh(t.white,.01),color:`var(--mantine-color-${l.color}-${l.shade})`,border:`${le(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:bh(t.white,.01),color:e,border:`${le(1)} solid transparent`}:n==="gradient"?{background:tx(r,t),hover:tx(r,t),color:"var(--mantine-color-white)",border:"none"}:n==="default"?{background:"var(--mantine-color-default)",hover:"var(--mantine-color-default-hover)",color:"var(--mantine-color-default-color)",border:`${le(1)} solid var(--mantine-color-default-border)`}:{}},FM={dark:["#C9C9C9","#b8b8b8","#828282","#696969","#424242","#3b3b3b","#2e2e2e","#242424","#1f1f1f","#141414"],gray:["#f8f9fa","#f1f3f5","#e9ecef","#dee2e6","#ced4da","#adb5bd","#868e96","#495057","#343a40","#212529"],red:["#fff5f5","#ffe3e3","#ffc9c9","#ffa8a8","#ff8787","#ff6b6b","#fa5252","#f03e3e","#e03131","#c92a2a"],pink:["#fff0f6","#ffdeeb","#fcc2d7","#faa2c1","#f783ac","#f06595","#e64980","#d6336c","#c2255c","#a61e4d"],grape:["#f8f0fc","#f3d9fa","#eebefa","#e599f7","#da77f2","#cc5de8","#be4bdb","#ae3ec9","#9c36b5","#862e9c"],violet:["#f3f0ff","#e5dbff","#d0bfff","#b197fc","#9775fa","#845ef7","#7950f2","#7048e8","#6741d9","#5f3dc4"],indigo:["#edf2ff","#dbe4ff","#bac8ff","#91a7ff","#748ffc","#5c7cfa","#4c6ef5","#4263eb","#3b5bdb","#364fc7"],blue:["#e7f5ff","#d0ebff","#a5d8ff","#74c0fc","#4dabf7","#339af0","#228be6","#1c7ed6","#1971c2","#1864ab"],cyan:["#e3fafc","#c5f6fa","#99e9f2","#66d9e8","#3bc9db","#22b8cf","#15aabf","#1098ad","#0c8599","#0b7285"],teal:["#e6fcf5","#c3fae8","#96f2d7","#63e6be","#38d9a9","#20c997","#12b886","#0ca678","#099268","#087f5b"],green:["#ebfbee","#d3f9d8","#b2f2bb","#8ce99a","#69db7c","#51cf66","#40c057","#37b24d","#2f9e44","#2b8a3e"],lime:["#f4fce3","#e9fac8","#d8f5a2","#c0eb75","#a9e34b","#94d82d","#82c91e","#74b816","#66a80f","#5c940d"],yellow:["#fff9db","#fff3bf","#ffec99","#ffe066","#ffd43b","#fcc419","#fab005","#f59f00","#f08c00","#e67700"],orange:["#fff4e6","#ffe8cc","#ffd8a8","#ffc078","#ffa94d","#ff922b","#fd7e14","#f76707","#e8590c","#d9480f"]},$C="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",rb={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:FM,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:VM,autoContrast:!1,luminanceThreshold:.3,fontFamily:$C,fontFamilyMonospace:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",respectReducedMotion:!1,cursorType:"default",defaultGradient:{from:"blue",to:"cyan",deg:45},defaultRadius:"sm",activeClassName:"mantine-active",focusClassName:"",headings:{fontFamily:$C,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:le(34),lineHeight:"1.3"},h2:{fontSize:le(26),lineHeight:"1.35"},h3:{fontSize:le(22),lineHeight:"1.4"},h4:{fontSize:le(18),lineHeight:"1.45"},h5:{fontSize:le(16),lineHeight:"1.5"},h6:{fontSize:le(14),lineHeight:"1.5"}}},fontSizes:{xs:le(12),sm:le(14),md:le(16),lg:le(18),xl:le(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:le(2),sm:le(4),md:le(8),lg:le(16),xl:le(32)},spacing:{xs:le(10),sm:le(12),md:le(16),lg:le(20),xl:le(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), 0 ${le(1)} ${le(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(10)} ${le(15)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(7)} ${le(7)} ${le(-5)}`,md:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(20)} ${le(25)} ${le(-5)}, rgba(0, 0, 0, 0.04) 0 ${le(10)} ${le(10)} ${le(-5)}`,lg:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(28)} ${le(23)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(12)} ${le(12)} ${le(-7)}`,xl:`0 ${le(1)} ${le(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${le(36)} ${le(28)} ${le(-7)}, rgba(0, 0, 0, 0.04) 0 ${le(17)} ${le(17)} ${le(-7)}`},other:{},components:{}};function UC(e){return e==="auto"||e==="dark"||e==="light"}function HM({key:e="mantine-color-scheme-value"}={}){let t;return{get:n=>{if(typeof window>"u")return n;try{const r=window.localStorage.getItem(e);return UC(r)?r:n}catch{return n}},set:n=>{try{window.localStorage.setItem(e,n)}catch(r){console.warn("[@mantine/core] Local storage color scheme manager was unable to save color scheme.",r)}},subscribe:n=>{t=r=>{r.storageArea===window.localStorage&&r.key===e&&UC(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const qM="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",BC="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function sy(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function VC(e){if(!(e.primaryColor in e.colors))throw new Error(qM);if(typeof e.primaryShade=="object"&&(!sy(e.primaryShade.dark)||!sy(e.primaryShade.light)))throw new Error(BC);if(typeof e.primaryShade=="number"&&!sy(e.primaryShade))throw new Error(BC)}function GM(e,t){if(!t)return VC(e),e;const n=Kx(e,t);return t.fontFamily&&!t.headings?.fontFamily&&(n.headings.fontFamily=t.fontFamily),VC(n),n}const ib=v.createContext(null),WM=()=>v.useContext(ib)||rb;function Sn(){const e=v.useContext(ib);if(!e)throw new Error("@mantine/core: MantineProvider was not found in component tree, make sure you have it in your app");return e}function m2({theme:e,children:t,inherit:n=!0}){const r=WM(),o=v.useMemo(()=>GM(n?r:rb,e),[e,r,n]);return a.jsx(ib.Provider,{value:o,children:t})}m2.displayName="@mantine/core/MantineThemeProvider";function QM(){const e=Sn(),t=zp(),n=ln(e.breakpoints).reduce((r,o)=>{const l=e.breakpoints[o].includes("px"),c=ud(e.breakpoints[o]),d=l?`${c-.1}px`:Jh(c-.1),f=l?`${c}px`:Jh(c);return`${r}@media (max-width: ${d}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${f}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return a.jsx("style",{"data-mantine-styles":"classes",nonce:t?.(),dangerouslySetInnerHTML:{__html:n}})}function ly(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Xu(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function YM(e,t){const n=ly(e.variables),r=n?Xu(t,n):"",o=ly(e.dark),l=ly(e.light),c=o?Xu(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",d=l?Xu(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,l):"";return`${r}
|
|
58
|
+
|
|
59
|
+
${c}
|
|
60
|
+
|
|
61
|
+
${d}`}function ja({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&si({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function FC(e,t){return ja({color:e.colors[e.primaryColor][hd(e,t)],theme:e,autoContrast:null})}function Sh({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const d=hd(e,"light"),f={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${d===9?8:d+1})`,[`--mantine-color-${r}-light`]:hc(e.colors[t][d],.1),[`--mantine-color-${r}-light-hover`]:hc(e.colors[t][d],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${d})`,[`--mantine-color-${r}-outline-hover`]:hc(e.colors[t][d],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...f}:f}const l=hd(e,"dark"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${l===9?8:l+1})`,[`--mantine-color-${r}-light`]:hc(e.colors[t][Math.max(0,l-2)],.15),[`--mantine-color-${r}-light-hover`]:hc(e.colors[t][Math.max(0,l-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(l-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(l-4,0)})`,[`--mantine-color-${r}-outline-hover`]:hc(e.colors[t][Math.max(l-4,0)],.05)};return o?{[`--mantine-color-${r}-0`]:e.colors[t][0],[`--mantine-color-${r}-1`]:e.colors[t][1],[`--mantine-color-${r}-2`]:e.colors[t][2],[`--mantine-color-${r}-3`]:e.colors[t][3],[`--mantine-color-${r}-4`]:e.colors[t][4],[`--mantine-color-${r}-5`]:e.colors[t][5],[`--mantine-color-${r}-6`]:e.colors[t][6],[`--mantine-color-${r}-7`]:e.colors[t][7],[`--mantine-color-${r}-8`]:e.colors[t][8],[`--mantine-color-${r}-9`]:e.colors[t][9],...c}:c}function KM(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function pc(e,t,n){ln(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const g2=e=>{const t=hd(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:le(e.defaultRadius),r={variables:{"--mantine-z-index-app":"100","--mantine-z-index-modal":"200","--mantine-z-index-popover":"300","--mantine-z-index-overlay":"400","--mantine-z-index-max":"9999","--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-webkit-font-smoothing":e.fontSmoothing?"antialiased":"unset","--mantine-moz-font-smoothing":e.fontSmoothing?"grayscale":"unset","--mantine-color-white":e.white,"--mantine-color-black":e.black,"--mantine-line-height":e.lineHeights.md,"--mantine-font-family":e.fontFamily,"--mantine-font-family-monospace":e.fontFamilyMonospace,"--mantine-font-family-headings":e.headings.fontFamily,"--mantine-heading-font-weight":e.headings.fontWeight,"--mantine-heading-text-wrap":e.headings.textWrap,"--mantine-radius-default":n,"--mantine-primary-color-filled":`var(--mantine-color-${e.primaryColor}-filled)`,"--mantine-primary-color-filled-hover":`var(--mantine-color-${e.primaryColor}-filled-hover)`,"--mantine-primary-color-light":`var(--mantine-color-${e.primaryColor}-light)`,"--mantine-primary-color-light-hover":`var(--mantine-color-${e.primaryColor}-light-hover)`,"--mantine-primary-color-light-color":`var(--mantine-color-${e.primaryColor}-light-color)`},light:{"--mantine-color-scheme":"light","--mantine-primary-color-contrast":FC(e,"light"),"--mantine-color-bright":"var(--mantine-color-black)","--mantine-color-text":e.black,"--mantine-color-body":e.white,"--mantine-color-error":"var(--mantine-color-red-6)","--mantine-color-placeholder":"var(--mantine-color-gray-5)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-${t})`,"--mantine-color-default":"var(--mantine-color-white)","--mantine-color-default-hover":"var(--mantine-color-gray-0)","--mantine-color-default-color":"var(--mantine-color-black)","--mantine-color-default-border":"var(--mantine-color-gray-4)","--mantine-color-dimmed":"var(--mantine-color-gray-6)","--mantine-color-disabled":"var(--mantine-color-gray-2)","--mantine-color-disabled-color":"var(--mantine-color-gray-5)","--mantine-color-disabled-border":"var(--mantine-color-gray-3)"},dark:{"--mantine-color-scheme":"dark","--mantine-primary-color-contrast":FC(e,"dark"),"--mantine-color-bright":"var(--mantine-color-white)","--mantine-color-text":"var(--mantine-color-dark-0)","--mantine-color-body":"var(--mantine-color-dark-7)","--mantine-color-error":"var(--mantine-color-red-8)","--mantine-color-placeholder":"var(--mantine-color-dark-3)","--mantine-color-anchor":`var(--mantine-color-${e.primaryColor}-4)`,"--mantine-color-default":"var(--mantine-color-dark-6)","--mantine-color-default-hover":"var(--mantine-color-dark-5)","--mantine-color-default-color":"var(--mantine-color-white)","--mantine-color-default-border":"var(--mantine-color-dark-4)","--mantine-color-dimmed":"var(--mantine-color-dark-2)","--mantine-color-disabled":"var(--mantine-color-dark-6)","--mantine-color-disabled-color":"var(--mantine-color-dark-3)","--mantine-color-disabled-border":"var(--mantine-color-dark-4)"}};pc(r.variables,e.breakpoints,"breakpoint"),pc(r.variables,e.spacing,"spacing"),pc(r.variables,e.fontSizes,"font-size"),pc(r.variables,e.lineHeights,"line-height"),pc(r.variables,e.shadows,"shadow"),pc(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((l,c)=>{r.variables[`--mantine-primary-color-${c}`]=`var(--mantine-color-${e.primaryColor}-${c})`}),ln(e.colors).forEach(l=>{const c=e.colors[l];if(KM(c)){Object.assign(r.light,Sh({theme:e,name:c.name,color:c.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Sh({theme:e,name:c.name,color:c.dark,colorScheme:"dark",withColorValues:!0}));return}c.forEach((d,f)=>{r.variables[`--mantine-color-${l}-${f}`]=d}),Object.assign(r.light,Sh({theme:e,color:l,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Sh({theme:e,color:l,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return ln(o).forEach(l=>{r.variables[`--mantine-${l}-font-size`]=o[l].fontSize,r.variables[`--mantine-${l}-line-height`]=o[l].lineHeight,r.variables[`--mantine-${l}-font-weight`]=o[l].fontWeight||e.headings.fontWeight}),r};function XM({theme:e,generator:t}){const n=g2(e),r=t?.(e);return r?Kx(n,r):n}const cy=g2(rb);function JM(e){const t={variables:{},light:{},dark:{}};return ln(e.variables).forEach(n=>{cy.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),ln(e.light).forEach(n=>{cy.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),ln(e.dark).forEach(n=>{cy.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function ZM(e){return`
|
|
62
|
+
${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
|
|
63
|
+
${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
|
|
64
|
+
`}function v2({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Sn(),r=zp(),o=AM(),l=XM({theme:n,generator:o}),c=e===":root"&&t,d=c?JM(l):l,f=YM(d,e);return f?a.jsx("style",{"data-mantine-styles":!0,nonce:r?.(),dangerouslySetInnerHTML:{__html:`${f}${c?"":ZM(e)}`}}):null}v2.displayName="@mantine/CssVariables";function mc(e,t){const n=typeof window<"u"&&"matchMedia"in window&&window.matchMedia("(prefers-color-scheme: dark)")?.matches,r=e!=="auto"?e:n?"dark":"light";t()?.setAttribute("data-mantine-color-scheme",r)}function e4({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=v.useRef(null),[l,c]=v.useState(()=>e.get(t)),d=r||l,f=v.useCallback(m=>{r||(mc(m,n),c(m),e.set(m))},[e.set,d,r]),p=v.useCallback(()=>{c(t),mc(t,n),e.clear()},[e.clear,t]);return v.useEffect(()=>(e.subscribe(f),e.unsubscribe),[e.subscribe,e.unsubscribe]),qc(()=>{mc(e.get(t),n)},[]),v.useEffect(()=>{if(r)return mc(r,n),()=>{};r===void 0&&mc(l,n),typeof window<"u"&&"matchMedia"in window&&(o.current=window.matchMedia("(prefers-color-scheme: dark)"));const m=g=>{l==="auto"&&mc(g.matches?"dark":"light",n)};return o.current?.addEventListener("change",m),()=>o.current?.removeEventListener("change",m)},[l,r]),{colorScheme:d,setColorScheme:f,clearColorScheme:p}}function t4({respectReducedMotion:e,getRootElement:t}){qc(()=>{e&&t()?.setAttribute("data-respect-reduced-motion","true")},[e])}function y2({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:l=!0,withCssVariables:c=!0,cssVariablesSelector:d=":root",classNamesPrefix:f="mantine",colorSchemeManager:p=HM(),defaultColorScheme:m="light",getRootElement:g=()=>document.documentElement,cssVariablesResolver:y,forceColorScheme:b,stylesTransform:w,env:j}){const{colorScheme:C,setColorScheme:T,clearColorScheme:E}=e4({defaultColorScheme:m,forceColorScheme:b,manager:p,getRootElement:g});return t4({respectReducedMotion:e?.respectReducedMotion||!1,getRootElement:g}),a.jsx(tb.Provider,{value:{colorScheme:C,setColorScheme:T,clearColorScheme:E,getRootElement:g,classNamesPrefix:f,getStyleNonce:n,cssVariablesResolver:y,cssVariablesSelector:d,withStaticClasses:r,stylesTransform:w,env:j},children:a.jsxs(m2,{theme:e,children:[c&&a.jsx(v2,{cssVariablesSelector:d,deduplicateCssVariables:l}),o&&a.jsx(QM,{}),t]})})}y2.displayName="@mantine/core/MantineProvider";function yl({classNames:e,styles:t,props:n,stylesCtx:r}){const o=Sn();return{resolvedClassNames:Ip({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:np({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const n4={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function r4({theme:e,options:t,unstyled:n}){return $t(t?.focusable&&!n&&(e.focusClassName||n4[e.focusRing]),t?.active&&!n&&e.activeClassName)}function i4({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Ip({theme:o,classNames:n?.classNames,props:n?.props||r,stylesCtx:t})[e]}function HC({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Ip({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function o4({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function a4({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function s4({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function l4({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(l=>Ip({theme:t,classNames:t.components[l]?.classNames,props:r,stylesCtx:o})?.[n])}function c4({options:e,classes:t,selector:n,unstyled:r}){return e?.variant&&!r?t[`${n}--${e.variant}`]:void 0}function u4({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:l,classes:c,unstyled:d,className:f,rootSelector:p,props:m,stylesCtx:g,withStaticClasses:y,headless:b,transformedStyles:w}){return $t(r4({theme:e,options:t,unstyled:d||b}),l4({theme:e,themeName:n,selector:r,props:m,stylesCtx:g}),c4({options:t,classes:c,selector:r,unstyled:d}),HC({selector:r,stylesCtx:g,theme:e,classNames:l,props:m}),HC({selector:r,stylesCtx:g,theme:e,classNames:w,props:m}),i4({selector:r,stylesCtx:g,options:t,props:m,theme:e}),o4({rootSelector:p,selector:r,className:f}),a4({selector:r,classes:c,unstyled:d||b}),y&&!b&&s4({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t?.withStaticClass}),t?.className)}function d4({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(l=>np({theme:e,styles:e.components[l]?.styles,props:n,stylesCtx:r})[o]).reduce((l,c)=>({...l,...c}),{})}function nx({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...nx({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function f4(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...gs(n[r])}}),t),{})}function h4({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:l,themeName:c,headless:d}){return f4([d?{}:t?.(n,r,o),...c.map(f=>n.components?.[f]?.vars?.(n,r,o)),e?.(n,r,o)])?.[l]}function p4({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:l,rootSelector:c,styles:d,style:f,vars:p,varsResolver:m,headless:g,withStylesTransform:y}){return{...!y&&d4({theme:e,themeName:t,props:o,stylesCtx:l,selector:n}),...!y&&np({theme:e,styles:d,props:o,stylesCtx:l})[n],...!y&&np({theme:e,styles:r?.styles,props:r?.props||o,stylesCtx:l})[n],...h4({theme:e,props:o,stylesCtx:l,vars:p,varsResolver:m,selector:n,themeName:t,headless:g}),...c===n?nx({style:f,theme:e}):null,...nx({style:r?.style,theme:e})}}function m4({props:e,stylesCtx:t,themeName:n}){const r=Sn(),o=MM()?.();return{getTransformedStyles:c=>o?[...c.map(f=>o(f,{props:e,theme:r,ctx:t})),...n.map(f=>o(r.components[f]?.styles,{props:e,theme:r,ctx:t}))].filter(Boolean):[],withStylesTransform:!!o}}function Ie({name:e,classes:t,props:n,stylesCtx:r,className:o,style:l,rootSelector:c="root",unstyled:d,classNames:f,styles:p,vars:m,varsResolver:g,attributes:y}){const b=Sn(),w=kM(),j=PM(),C=OM(),T=(Array.isArray(e)?e:[e]).filter(_=>_),{withStylesTransform:E,getTransformedStyles:R}=m4({props:n,stylesCtx:r,themeName:T});return(_,k)=>({className:u4({theme:b,options:k,themeName:T,selector:_,classNamesPrefix:w,classNames:f,classes:t,unstyled:d,className:o,rootSelector:c,props:n,stylesCtx:r,withStaticClasses:j,headless:C,transformedStyles:R([k?.styles,p])}),style:p4({theme:b,themeName:T,selector:_,options:k,props:n,stylesCtx:r,rootSelector:c,styles:p,style:l,vars:m,varsResolver:g,headless:C,withStylesTransform:E}),...y?.[_]})}function xl(e,t){return typeof e=="boolean"?e:t.autoContrast}function qC(e){const t=document.createElement("style");return t.setAttribute("data-mantine-styles","inline"),t.innerHTML="*, *::before, *::after {transition: none !important;}",t.setAttribute("data-mantine-disable-transition","true"),e&&t.setAttribute("nonce",e),document.head.appendChild(t),()=>document.querySelectorAll("[data-mantine-disable-transition]").forEach(r=>r.remove())}function g4({keepTransitions:e}={}){const t=v.useRef(ep),n=v.useRef(-1),r=v.useContext(tb),o=zp(),l=v.useRef(o?.());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const c=g=>{r.setColorScheme(g),t.current=e?()=>{}:qC(l.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},d=()=>{r.clearColorScheme(),t.current=e?()=>{}:qC(l.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{t.current?.()},10)},f=lM("light",{getInitialValueInEffect:!1}),p=r.colorScheme==="auto"?f:r.colorScheme,m=v.useCallback(()=>c(p==="light"?"dark":"light"),[c,p]);return v.useEffect(()=>()=>{t.current?.(),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:c,clearColorScheme:d,toggleColorScheme:m}}function ae(e,t,n){const r=Sn(),o=r.components[e]?.defaultProps,l=typeof o=="function"?o(r):o;return{...t,...l,...gs(n)}}function uy(e){return ln(e).reduce((t,n)=>e[n]!==void 0?`${t}${YN(n)}:${e[n]};`:t,"").trim()}function v4({selector:e,styles:t,media:n,container:r}){const o=t?uy(t):"",l=Array.isArray(n)?n.map(d=>`@media${d.query}{${e}{${uy(d.styles)}}}`):[],c=Array.isArray(r)?r.map(d=>`@container ${d.query}{${e}{${uy(d.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${l.join("")}${c.join("")}`.trim()}function bl(e){const t=zp();return a.jsx("style",{"data-mantine-styles":"inline",nonce:t?.(),dangerouslySetInnerHTML:{__html:v4(e)}})}function Ca(e){const{m:t,mx:n,my:r,mt:o,mb:l,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:y,pt:b,pb:w,pl:j,pr:C,pe:T,ps:E,bd:R,bdrs:_,bg:k,c:N,opacity:A,ff:P,fz:U,fw:B,lts:Y,ta:X,lh:te,fs:$,tt:W,td:L,w:I,miw:z,maw:V,h:J,mih:M,mah:F,bgsz:oe,bgp:ce,bgr:Se,bga:ge,pos:Oe,top:nt,left:Ce,bottom:ht,right:st,inset:vt,display:rt,flex:wt,hiddenFrom:pt,visibleFrom:It,lightHidden:Te,darkHidden:Ee,sx:Me,...Pe}=e;return{styleProps:gs({m:t,mx:n,my:r,mt:o,mb:l,ml:c,mr:d,me:f,ms:p,p:m,px:g,py:y,pt:b,pb:w,pl:j,pr:C,pe:T,ps:E,bd:R,bg:k,c:N,opacity:A,ff:P,fz:U,fw:B,lts:Y,ta:X,lh:te,fs:$,tt:W,td:L,w:I,miw:z,maw:V,h:J,mih:M,mah:F,bgsz:oe,bgp:ce,bgr:Se,bga:ge,pos:Oe,top:nt,left:Ce,bottom:ht,right:st,inset:vt,display:rt,flex:wt,bdrs:_,hiddenFrom:pt,visibleFrom:It,lightHidden:Te,darkHidden:Ee,sx:Me}),rest:Pe}}const y4={m:{type:"spacing",property:"margin"},mt:{type:"spacing",property:"marginTop"},mb:{type:"spacing",property:"marginBottom"},ml:{type:"spacing",property:"marginLeft"},mr:{type:"spacing",property:"marginRight"},ms:{type:"spacing",property:"marginInlineStart"},me:{type:"spacing",property:"marginInlineEnd"},mx:{type:"spacing",property:"marginInline"},my:{type:"spacing",property:"marginBlock"},p:{type:"spacing",property:"padding"},pt:{type:"spacing",property:"paddingTop"},pb:{type:"spacing",property:"paddingBottom"},pl:{type:"spacing",property:"paddingLeft"},pr:{type:"spacing",property:"paddingRight"},ps:{type:"spacing",property:"paddingInlineStart"},pe:{type:"spacing",property:"paddingInlineEnd"},px:{type:"spacing",property:"paddingInline"},py:{type:"spacing",property:"paddingBlock"},bd:{type:"border",property:"border"},bdrs:{type:"radius",property:"borderRadius"},bg:{type:"color",property:"background"},c:{type:"textColor",property:"color"},opacity:{type:"identity",property:"opacity"},ff:{type:"fontFamily",property:"fontFamily"},fz:{type:"fontSize",property:"fontSize"},fw:{type:"identity",property:"fontWeight"},lts:{type:"size",property:"letterSpacing"},ta:{type:"identity",property:"textAlign"},lh:{type:"lineHeight",property:"lineHeight"},fs:{type:"identity",property:"fontStyle"},tt:{type:"identity",property:"textTransform"},td:{type:"identity",property:"textDecoration"},w:{type:"spacing",property:"width"},miw:{type:"spacing",property:"minWidth"},maw:{type:"spacing",property:"maxWidth"},h:{type:"spacing",property:"height"},mih:{type:"spacing",property:"minHeight"},mah:{type:"spacing",property:"maxHeight"},bgsz:{type:"size",property:"backgroundSize"},bgp:{type:"identity",property:"backgroundPosition"},bgr:{type:"identity",property:"backgroundRepeat"},bga:{type:"identity",property:"backgroundAttachment"},pos:{type:"identity",property:"position"},top:{type:"size",property:"top"},left:{type:"size",property:"left"},bottom:{type:"size",property:"bottom"},right:{type:"size",property:"right"},inset:{type:"size",property:"inset"},display:{type:"identity",property:"display"},flex:{type:"identity",property:"flex"}};function ob(e,t){const n=si({color:e,theme:t});return n.color==="dimmed"?"var(--mantine-color-dimmed)":n.color==="bright"?"var(--mantine-color-bright)":n.variable?`var(${n.variable})`:n.color}function x4(e,t){const n=si({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:ob(e,t)}function b4(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(c=>c.trim()!=="");let l=`${le(n)}`;return r&&(l+=` ${r}`),o.length>0&&(l+=` ${ob(o.join(" "),t)}`),l.trim()}return e}const GC={text:"var(--mantine-font-family)",mono:"var(--mantine-font-family-monospace)",monospace:"var(--mantine-font-family-monospace)",heading:"var(--mantine-font-family-headings)",headings:"var(--mantine-font-family-headings)"};function S4(e){return typeof e=="string"&&e in GC?GC[e]:e}const w4=["h1","h2","h3","h4","h5","h6"];function j4(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&w4.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?le(e):e}function C4(e){return e}const E4=["h1","h2","h3","h4","h5","h6"];function T4(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&E4.includes(e)?`var(--mantine-${e}-line-height)`:e}function R4(e,t){return typeof e=="string"&&e in t.radius?`var(--mantine-radius-${e})`:typeof e=="number"||typeof e=="string"?le(e):e}function _4(e){return typeof e=="number"?le(e):e}function D4(e,t){if(typeof e=="number")return le(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return le(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const dy={color:ob,textColor:x4,fontSize:j4,spacing:D4,radius:R4,identity:C4,size:_4,lineHeight:T4,fontFamily:S4,border:b4};function WC(e){return e.replace("(min-width: ","").replace("em)","")}function A4({media:e,...t}){const r=Object.keys(e).sort((o,l)=>Number(WC(o))-Number(WC(l))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function k4(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function P4(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function O4(e){return typeof e=="object"&&e!==null?ln(e).filter(t=>t!=="base"):[]}function N4(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function x2({styleProps:e,data:t,theme:n}){return A4(ln(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const l=t[o],c=Array.isArray(l.property)?l.property:[l.property],d=P4(e[o]);if(!k4(e[o]))return c.forEach(p=>{r.inlineStyles[p]=dy[l.type](d,n)}),r;r.hasResponsiveStyles=!0;const f=O4(e[o]);return c.forEach(p=>{d!=null&&(r.styles[p]=dy[l.type](d,n)),f.forEach(m=>{const g=`(min-width: ${n.breakpoints[m]})`;r.media[g]={...r.media[g],[p]:dy[l.type](N4(e[o],m),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Dd(){return`__m__-${v.useId().replace(/[:«»]/g,"")}`}function b2(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...b2(r,t)}),{}):typeof e=="function"?e(t):e??{}}function S2(e){return e.startsWith("data-")?e:`data-${e}`}function M4(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[S2(n)]=e[n]),t},{})}function w2(e){return e?typeof e=="string"?{[S2(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...w2(n)}),{}):M4(e):null}function rx(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...rx(r,t)}),{}):typeof e=="function"?e(t):e??{}}function L4({theme:e,style:t,vars:n,styleProps:r}){const o=rx(t,e),l=rx(n,e);return{...o,...l,...r}}const j2=v.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:l,size:c,hiddenFrom:d,visibleFrom:f,lightHidden:p,darkHidden:m,renderRoot:g,__size:y,...b},w)=>{const j=Sn(),C=e||"div",{styleProps:T,rest:E}=Ca(b),_=NM()?.()?.(T.sx),k=Dd(),N=x2({styleProps:T,theme:j,data:y4}),A={ref:w,style:L4({theme:j,style:t,vars:n,styleProps:N.inlineStyles}),className:$t(r,_,{[k]:N.hasResponsiveStyles,"mantine-light-hidden":p,"mantine-dark-hidden":m,[`mantine-hidden-from-${d}`]:d,[`mantine-visible-from-${f}`]:f}),"data-variant":o,"data-size":i2(c)?void 0:c||void 0,size:y,...w2(l),...E};return a.jsxs(a.Fragment,{children:[N.hasResponsiveStyles&&a.jsx(bl,{selector:`.${k}`,styles:N.styles,media:N.media}),typeof g=="function"?g(A):a.jsx(C,{...A})]})});j2.displayName="@mantine/core/Box";const ue=j2;function C2(e){return e}function I4(e){const t=e;return n=>{const r=v.forwardRef((o,l)=>a.jsx(t,{...n,...o,ref:l}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r}}function be(e){const t=v.forwardRef(e);return t.extend=C2,t.withProps=n=>{const r=v.forwardRef((o,l)=>a.jsx(t,{...n,...o,ref:l}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function pr(e){const t=v.forwardRef(e);return t.withProps=n=>{const r=v.forwardRef((o,l)=>a.jsx(t,{...n,...o,ref:l}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=C2,t}const z4=v.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function vs(){return v.useContext(z4)}var fy={exports:{}},gr={};/**
|
|
65
|
+
* @license React
|
|
66
|
+
* react-dom.production.js
|
|
67
|
+
*
|
|
68
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
69
|
+
*
|
|
70
|
+
* This source code is licensed under the MIT license found in the
|
|
71
|
+
* LICENSE file in the root directory of this source tree.
|
|
72
|
+
*/var QC;function $4(){if(QC)return gr;QC=1;var e=Yx();function t(f){var p="https://react.dev/errors/"+f;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+f+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var r={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},o=Symbol.for("react.portal");function l(f,p,m){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:f,containerInfo:p,implementation:m}}var c=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,p){if(f==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return gr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,gr.createPortal=function(f,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return l(f,p,null,m)},gr.flushSync=function(f){var p=c.T,m=r.p;try{if(c.T=null,r.p=2,f)return f()}finally{c.T=p,r.p=m,r.d.f()}},gr.preconnect=function(f,p){typeof f=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,r.d.C(f,p))},gr.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},gr.preinit=function(f,p){if(typeof f=="string"&&p&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?r.d.S(f,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:b}):m==="script"&&r.d.X(f,{crossOrigin:g,integrity:y,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},gr.preinitModule=function(f,p){if(typeof f=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=d(p.as,p.crossOrigin);r.d.M(f,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&r.d.M(f)},gr.preload=function(f,p){if(typeof f=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,g=d(m,p.crossOrigin);r.d.L(f,m,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},gr.preloadModule=function(f,p){if(typeof f=="string")if(p){var m=d(p.as,p.crossOrigin);r.d.m(f,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else r.d.m(f)},gr.requestFormReset=function(f){r.d.r(f)},gr.unstable_batchedUpdates=function(f,p){return f(p)},gr.useFormState=function(f,p,m){return c.H.useFormState(f,p,m)},gr.useFormStatus=function(){return c.H.useHostTransitionStatus()},gr.version="19.2.0",gr}var YC;function E2(){if(YC)return fy.exports;YC=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),fy.exports=$4(),fy.exports}var ab=E2();const od=Op(ab);function Up(){return typeof window<"u"}function Wc(e){return T2(e)?(e.nodeName||"").toLowerCase():"#document"}function Hr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Mo(e){var t;return(t=(T2(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function T2(e){return Up()?e instanceof Node||e instanceof Hr(e).Node:!1}function yn(e){return Up()?e instanceof Element||e instanceof Hr(e).Element:!1}function li(e){return Up()?e instanceof HTMLElement||e instanceof Hr(e).HTMLElement:!1}function ix(e){return!Up()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Hr(e).ShadowRoot}const U4=new Set(["inline","contents"]);function Ad(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Pi(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!U4.has(o)}const B4=new Set(["table","td","th"]);function V4(e){return B4.has(Wc(e))}const F4=[":popover-open",":modal"];function Bp(e){return F4.some(t=>{try{return e.matches(t)}catch{return!1}})}const H4=["transform","translate","scale","rotate","perspective"],q4=["transform","translate","scale","rotate","perspective","filter"],G4=["paint","layout","strict","content"];function sb(e){const t=Vp(),n=yn(e)?Pi(e):e;return H4.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||q4.some(r=>(n.willChange||"").includes(r))||G4.some(r=>(n.contain||"").includes(r))}function W4(e){let t=ga(e);for(;li(t)&&!pa(t);){if(sb(t))return t;if(Bp(t))return null;t=ga(t)}return null}function Vp(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const Q4=new Set(["html","body","#document"]);function pa(e){return Q4.has(Wc(e))}function Pi(e){return Hr(e).getComputedStyle(e)}function Fp(e){return yn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ga(e){if(Wc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||ix(e)&&e.host||Mo(e);return ix(t)?t.host:t}function R2(e){const t=ga(e);return pa(t)?e.ownerDocument?e.ownerDocument.body:e.body:li(t)&&Ad(t)?t:R2(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=R2(e),l=o===((r=e.ownerDocument)==null?void 0:r.body),c=Hr(o);if(l){const d=ox(c);return t.concat(c,c.visualViewport||[],Ad(o)?o:[],d&&n?ma(d):[])}return t.concat(o,ma(o,[],n))}function ox(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Y4=["top","right","bottom","left"],Ji=Math.min,xr=Math.max,rp=Math.round,wh=Math.floor,So=e=>({x:e,y:e}),K4={left:"right",right:"left",bottom:"top",top:"bottom"},X4={start:"end",end:"start"};function ax(e,t,n){return xr(e,Ji(t,n))}function Ro(e,t){return typeof e=="function"?e(t):e}function Zi(e){return e.split("-")[0]}function Qc(e){return e.split("-")[1]}function lb(e){return e==="x"?"y":"x"}function cb(e){return e==="y"?"height":"width"}const J4=new Set(["top","bottom"]);function Yi(e){return J4.has(Zi(e))?"y":"x"}function ub(e){return lb(Yi(e))}function Z4(e,t,n){n===void 0&&(n=!1);const r=Qc(e),o=ub(e),l=cb(o);let c=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(c=ip(c)),[c,ip(c)]}function e5(e){const t=ip(e);return[sx(e),t,sx(t)]}function sx(e){return e.replace(/start|end/g,t=>X4[t])}const KC=["left","right"],XC=["right","left"],t5=["top","bottom"],n5=["bottom","top"];function r5(e,t,n){switch(e){case"top":case"bottom":return n?t?XC:KC:t?KC:XC;case"left":case"right":return t?t5:n5;default:return[]}}function i5(e,t,n,r){const o=Qc(e);let l=r5(Zi(e),n==="start",r);return o&&(l=l.map(c=>c+"-"+o),t&&(l=l.concat(l.map(sx)))),l}function ip(e){return e.replace(/left|right|bottom|top/g,t=>K4[t])}function o5(e){return{top:0,right:0,bottom:0,left:0,...e}}function db(e){return typeof e!="number"?o5(e):{top:e,right:e,bottom:e,left:e}}function Oc(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 a5(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function s5(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(t=>{let{brand:n,version:r}=t;return n+"/"+r}).join(" "):navigator.userAgent}function l5(){return/apple/i.test(navigator.vendor)}function c5(){return a5().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function u5(){return s5().includes("jsdom/")}const JC="data-floating-ui-focusable",d5="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function ZC(e){let t=e.activeElement;for(;((n=t)==null||(n=n.shadowRoot)==null?void 0:n.activeElement)!=null;){var n;t=t.shadowRoot.activeElement}return t}function pd(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&ix(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function wc(e){return"composedPath"in e?e.composedPath()[0]:e.target}function hy(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function f5(e){return e.matches("html,body")}function Ks(e){return e?.ownerDocument||document}function h5(e){return li(e)&&e.matches(d5)}function p5(e){if(!e||u5())return!0;try{return e.matches(":focus-visible")}catch{return!0}}function m5(e){return e?e.hasAttribute(JC)?e:e.querySelector("["+JC+"]")||e:null}function Bh(e,t,n){return n===void 0&&(n=!0),e.filter(o=>{var l;return o.parentId===t&&(!n||((l=o.context)==null?void 0:l.open))}).flatMap(o=>[o,...Bh(e,o.id,n)])}function g5(e){return"nativeEvent"in e}function lx(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var v5=typeof document<"u",y5=function(){},wo=v5?v.useLayoutEffect:y5;const x5={...KR};function jh(e){const t=v.useRef(e);return wo(()=>{t.current=e}),t}const b5=x5.useInsertionEffect,S5=b5||(e=>e());function xo(e){const t=v.useRef(()=>{});return S5(()=>{t.current=e}),v.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function eE(e,t,n){let{reference:r,floating:o}=e;const l=Yi(t),c=ub(t),d=cb(c),f=Zi(t),p=l==="y",m=r.x+r.width/2-o.width/2,g=r.y+r.height/2-o.height/2,y=r[d]/2-o[d]/2;let b;switch(f){case"top":b={x:m,y:r.y-o.height};break;case"bottom":b={x:m,y:r.y+r.height};break;case"right":b={x:r.x+r.width,y:g};break;case"left":b={x:r.x-o.width,y:g};break;default:b={x:r.x,y:r.y}}switch(Qc(t)){case"start":b[c]-=y*(n&&p?-1:1);break;case"end":b[c]+=y*(n&&p?-1:1);break}return b}const w5=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:l=[],platform:c}=n,d=l.filter(Boolean),f=await(c.isRTL==null?void 0:c.isRTL(t));let p=await c.getElementRects({reference:e,floating:t,strategy:o}),{x:m,y:g}=eE(p,r,f),y=r,b={},w=0;for(let j=0;j<d.length;j++){const{name:C,fn:T}=d[j],{x:E,y:R,data:_,reset:k}=await T({x:m,y:g,initialPlacement:r,placement:y,strategy:o,middlewareData:b,rects:p,platform:c,elements:{reference:e,floating:t}});m=E??m,g=R??g,b={...b,[C]:{...b[C],..._}},k&&w<=50&&(w++,typeof k=="object"&&(k.placement&&(y=k.placement),k.rects&&(p=k.rects===!0?await c.getElementRects({reference:e,floating:t,strategy:o}):k.rects),{x:m,y:g}=eE(p,y,f)),j=-1)}return{x:m,y:g,placement:y,strategy:o,middlewareData:b}};async function md(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:l,rects:c,elements:d,strategy:f}=e,{boundary:p="clippingAncestors",rootBoundary:m="viewport",elementContext:g="floating",altBoundary:y=!1,padding:b=0}=Ro(t,e),w=db(b),C=d[y?g==="floating"?"reference":"floating":g],T=Oc(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(C)))==null||n?C:C.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(d.floating)),boundary:p,rootBoundary:m,strategy:f})),E=g==="floating"?{x:r,y:o,width:c.floating.width,height:c.floating.height}:c.reference,R=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d.floating)),_=await(l.isElement==null?void 0:l.isElement(R))?await(l.getScale==null?void 0:l.getScale(R))||{x:1,y:1}:{x:1,y:1},k=Oc(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:d,rect:E,offsetParent:R,strategy:f}):E);return{top:(T.top-k.top+w.top)/_.y,bottom:(k.bottom-T.bottom+w.bottom)/_.y,left:(T.left-k.left+w.left)/_.x,right:(k.right-T.right+w.right)/_.x}}const j5=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:l,platform:c,elements:d,middlewareData:f}=t,{element:p,padding:m=0}=Ro(e,t)||{};if(p==null)return{};const g=db(m),y={x:n,y:r},b=ub(o),w=cb(b),j=await c.getDimensions(p),C=b==="y",T=C?"top":"left",E=C?"bottom":"right",R=C?"clientHeight":"clientWidth",_=l.reference[w]+l.reference[b]-y[b]-l.floating[w],k=y[b]-l.reference[b],N=await(c.getOffsetParent==null?void 0:c.getOffsetParent(p));let A=N?N[R]:0;(!A||!await(c.isElement==null?void 0:c.isElement(N)))&&(A=d.floating[R]||l.floating[w]);const P=_/2-k/2,U=A/2-j[w]/2-1,B=Ji(g[T],U),Y=Ji(g[E],U),X=B,te=A-j[w]-Y,$=A/2-j[w]/2+P,W=ax(X,$,te),L=!f.arrow&&Qc(o)!=null&&$!==W&&l.reference[w]/2-($<X?B:Y)-j[w]/2<0,I=L?$<X?$-X:$-te:0;return{[b]:y[b]+I,data:{[b]:W,centerOffset:$-W-I,...L&&{alignmentOffset:I}},reset:L}}}),C5=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:l,rects:c,initialPlacement:d,platform:f,elements:p}=t,{mainAxis:m=!0,crossAxis:g=!0,fallbackPlacements:y,fallbackStrategy:b="bestFit",fallbackAxisSideDirection:w="none",flipAlignment:j=!0,...C}=Ro(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};const T=Zi(o),E=Yi(d),R=Zi(d)===d,_=await(f.isRTL==null?void 0:f.isRTL(p.floating)),k=y||(R||!j?[ip(d)]:e5(d)),N=w!=="none";!y&&N&&k.push(...i5(d,j,w,_));const A=[d,...k],P=await md(t,C),U=[];let B=((r=l.flip)==null?void 0:r.overflows)||[];if(m&&U.push(P[T]),g){const $=Z4(o,c,_);U.push(P[$[0]],P[$[1]])}if(B=[...B,{placement:o,overflows:U}],!U.every($=>$<=0)){var Y,X;const $=(((Y=l.flip)==null?void 0:Y.index)||0)+1,W=A[$];if(W&&(!(g==="alignment"?E!==Yi(W):!1)||B.every(z=>Yi(z.placement)===E?z.overflows[0]>0:!0)))return{data:{index:$,overflows:B},reset:{placement:W}};let L=(X=B.filter(I=>I.overflows[0]<=0).sort((I,z)=>I.overflows[1]-z.overflows[1])[0])==null?void 0:X.placement;if(!L)switch(b){case"bestFit":{var te;const I=(te=B.filter(z=>{if(N){const V=Yi(z.placement);return V===E||V==="y"}return!0}).map(z=>[z.placement,z.overflows.filter(V=>V>0).reduce((V,J)=>V+J,0)]).sort((z,V)=>z[1]-V[1])[0])==null?void 0:te[0];I&&(L=I);break}case"initialPlacement":L=d;break}if(o!==L)return{reset:{placement:L}}}return{}}}};function tE(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function nE(e){return Y4.some(t=>e[t]>=0)}const E5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Ro(e,t);switch(r){case"referenceHidden":{const l=await md(t,{...o,elementContext:"reference"}),c=tE(l,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:nE(c)}}}case"escaped":{const l=await md(t,{...o,altBoundary:!0}),c=tE(l,n.floating);return{data:{escapedOffsets:c,escaped:nE(c)}}}default:return{}}}}};function _2(e){const t=Ji(...e.map(l=>l.left)),n=Ji(...e.map(l=>l.top)),r=xr(...e.map(l=>l.right)),o=xr(...e.map(l=>l.bottom));return{x:t,y:n,width:r-t,height:o-n}}function T5(e){const t=e.slice().sort((o,l)=>o.y-l.y),n=[];let r=null;for(let o=0;o<t.length;o++){const l=t[o];!r||l.y-r.y>r.height/2?n.push([l]):n[n.length-1].push(l),r=l}return n.map(o=>Oc(_2(o)))}const R5=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:l,strategy:c}=t,{padding:d=2,x:f,y:p}=Ro(e,t),m=Array.from(await(l.getClientRects==null?void 0:l.getClientRects(r.reference))||[]),g=T5(m),y=Oc(_2(m)),b=db(d);function w(){if(g.length===2&&g[0].left>g[1].right&&f!=null&&p!=null)return g.find(C=>f>C.left-b.left&&f<C.right+b.right&&p>C.top-b.top&&p<C.bottom+b.bottom)||y;if(g.length>=2){if(Yi(n)==="y"){const B=g[0],Y=g[g.length-1],X=Zi(n)==="top",te=B.top,$=Y.bottom,W=X?B.left:Y.left,L=X?B.right:Y.right,I=L-W,z=$-te;return{top:te,bottom:$,left:W,right:L,width:I,height:z,x:W,y:te}}const C=Zi(n)==="left",T=xr(...g.map(B=>B.right)),E=Ji(...g.map(B=>B.left)),R=g.filter(B=>C?B.left===E:B.right===T),_=R[0].top,k=R[R.length-1].bottom,N=E,A=T,P=A-N,U=k-_;return{top:_,bottom:k,left:N,right:A,width:P,height:U,x:N,y:_}}return y}const j=await l.getElementRects({reference:{getBoundingClientRect:w},floating:r.floating,strategy:c});return o.reference.x!==j.reference.x||o.reference.y!==j.reference.y||o.reference.width!==j.reference.width||o.reference.height!==j.reference.height?{reset:{rects:j}}:{}}}},D2=new Set(["left","top"]);async function _5(e,t){const{placement:n,platform:r,elements:o}=e,l=await(r.isRTL==null?void 0:r.isRTL(o.floating)),c=Zi(n),d=Qc(n),f=Yi(n)==="y",p=D2.has(c)?-1:1,m=l&&f?-1:1,g=Ro(t,e);let{mainAxis:y,crossAxis:b,alignmentAxis:w}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return d&&typeof w=="number"&&(b=d==="end"?w*-1:w),f?{x:b*m,y:y*p}:{x:y*p,y:b*m}}const D5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:l,placement:c,middlewareData:d}=t,f=await _5(t,e);return c===((n=d.offset)==null?void 0:n.placement)&&(r=d.arrow)!=null&&r.alignmentOffset?{}:{x:o+f.x,y:l+f.y,data:{...f,placement:c}}}}},A5=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:l=!0,crossAxis:c=!1,limiter:d={fn:C=>{let{x:T,y:E}=C;return{x:T,y:E}}},...f}=Ro(e,t),p={x:n,y:r},m=await md(t,f),g=Yi(Zi(o)),y=lb(g);let b=p[y],w=p[g];if(l){const C=y==="y"?"top":"left",T=y==="y"?"bottom":"right",E=b+m[C],R=b-m[T];b=ax(E,b,R)}if(c){const C=g==="y"?"top":"left",T=g==="y"?"bottom":"right",E=w+m[C],R=w-m[T];w=ax(E,w,R)}const j=d.fn({...t,[y]:b,[g]:w});return{...j,data:{x:j.x-n,y:j.y-r,enabled:{[y]:l,[g]:c}}}}}},k5=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:l,middlewareData:c}=t,{offset:d=0,mainAxis:f=!0,crossAxis:p=!0}=Ro(e,t),m={x:n,y:r},g=Yi(o),y=lb(g);let b=m[y],w=m[g];const j=Ro(d,t),C=typeof j=="number"?{mainAxis:j,crossAxis:0}:{mainAxis:0,crossAxis:0,...j};if(f){const R=y==="y"?"height":"width",_=l.reference[y]-l.floating[R]+C.mainAxis,k=l.reference[y]+l.reference[R]-C.mainAxis;b<_?b=_:b>k&&(b=k)}if(p){var T,E;const R=y==="y"?"width":"height",_=D2.has(Zi(o)),k=l.reference[g]-l.floating[R]+(_&&((T=c.offset)==null?void 0:T[g])||0)+(_?0:C.crossAxis),N=l.reference[g]+l.reference[R]+(_?0:((E=c.offset)==null?void 0:E[g])||0)-(_?C.crossAxis:0);w<k?w=k:w>N&&(w=N)}return{[y]:b,[g]:w}}}},P5=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:l,platform:c,elements:d}=t,{apply:f=()=>{},...p}=Ro(e,t),m=await md(t,p),g=Zi(o),y=Qc(o),b=Yi(o)==="y",{width:w,height:j}=l.floating;let C,T;g==="top"||g==="bottom"?(C=g,T=y===(await(c.isRTL==null?void 0:c.isRTL(d.floating))?"start":"end")?"left":"right"):(T=g,C=y==="end"?"top":"bottom");const E=j-m.top-m.bottom,R=w-m.left-m.right,_=Ji(j-m[C],E),k=Ji(w-m[T],R),N=!t.middlewareData.shift;let A=_,P=k;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(P=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(A=E),N&&!y){const B=xr(m.left,0),Y=xr(m.right,0),X=xr(m.top,0),te=xr(m.bottom,0);b?P=w-2*(B!==0||Y!==0?B+Y:xr(m.left,m.right)):A=j-2*(X!==0||te!==0?X+te:xr(m.top,m.bottom))}await f({...t,availableWidth:P,availableHeight:A});const U=await c.getDimensions(d.floating);return w!==U.width||j!==U.height?{reset:{rects:!0}}:{}}}};function A2(e){const t=Pi(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=li(e),l=o?e.offsetWidth:n,c=o?e.offsetHeight:r,d=rp(n)!==l||rp(r)!==c;return d&&(n=l,r=c),{width:n,height:r,$:d}}function fb(e){return yn(e)?e:e.contextElement}function Rc(e){const t=fb(e);if(!li(t))return So(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:l}=A2(t);let c=(l?rp(n.width):n.width)/r,d=(l?rp(n.height):n.height)/o;return(!c||!Number.isFinite(c))&&(c=1),(!d||!Number.isFinite(d))&&(d=1),{x:c,y:d}}const O5=So(0);function k2(e){const t=Hr(e);return!Vp()||!t.visualViewport?O5:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function N5(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Hr(e)?!1:t}function al(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),l=fb(e);let c=So(1);t&&(r?yn(r)&&(c=Rc(r)):c=Rc(e));const d=N5(l,n,r)?k2(l):So(0);let f=(o.left+d.x)/c.x,p=(o.top+d.y)/c.y,m=o.width/c.x,g=o.height/c.y;if(l){const y=Hr(l),b=r&&yn(r)?Hr(r):r;let w=y,j=ox(w);for(;j&&r&&b!==w;){const C=Rc(j),T=j.getBoundingClientRect(),E=Pi(j),R=T.left+(j.clientLeft+parseFloat(E.paddingLeft))*C.x,_=T.top+(j.clientTop+parseFloat(E.paddingTop))*C.y;f*=C.x,p*=C.y,m*=C.x,g*=C.y,f+=R,p+=_,w=Hr(j),j=ox(w)}}return Oc({width:m,height:g,x:f,y:p})}function Hp(e,t){const n=Fp(e).scrollLeft;return t?t.left+n:al(Mo(e)).left+n}function P2(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-Hp(e,n),o=n.top+t.scrollTop;return{x:r,y:o}}function M5(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const l=o==="fixed",c=Mo(r),d=t?Bp(t.floating):!1;if(r===c||d&&l)return n;let f={scrollLeft:0,scrollTop:0},p=So(1);const m=So(0),g=li(r);if((g||!g&&!l)&&((Wc(r)!=="body"||Ad(c))&&(f=Fp(r)),li(r))){const b=al(r);p=Rc(r),m.x=b.x+r.clientLeft,m.y=b.y+r.clientTop}const y=c&&!g&&!l?P2(c,f):So(0);return{width:n.width*p.x,height:n.height*p.y,x:n.x*p.x-f.scrollLeft*p.x+m.x+y.x,y:n.y*p.y-f.scrollTop*p.y+m.y+y.y}}function L5(e){return Array.from(e.getClientRects())}function I5(e){const t=Mo(e),n=Fp(e),r=e.ownerDocument.body,o=xr(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),l=xr(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+Hp(e);const d=-n.scrollTop;return Pi(r).direction==="rtl"&&(c+=xr(t.clientWidth,r.clientWidth)-o),{width:o,height:l,x:c,y:d}}const rE=25;function z5(e,t){const n=Hr(e),r=Mo(e),o=n.visualViewport;let l=r.clientWidth,c=r.clientHeight,d=0,f=0;if(o){l=o.width,c=o.height;const m=Vp();(!m||m&&t==="fixed")&&(d=o.offsetLeft,f=o.offsetTop)}const p=Hp(r);if(p<=0){const m=r.ownerDocument,g=m.body,y=getComputedStyle(g),b=m.compatMode==="CSS1Compat"&&parseFloat(y.marginLeft)+parseFloat(y.marginRight)||0,w=Math.abs(r.clientWidth-g.clientWidth-b);w<=rE&&(l-=w)}else p<=rE&&(l+=p);return{width:l,height:c,x:d,y:f}}const $5=new Set(["absolute","fixed"]);function U5(e,t){const n=al(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,l=li(e)?Rc(e):So(1),c=e.clientWidth*l.x,d=e.clientHeight*l.y,f=o*l.x,p=r*l.y;return{width:c,height:d,x:f,y:p}}function iE(e,t,n){let r;if(t==="viewport")r=z5(e,n);else if(t==="document")r=I5(Mo(e));else if(yn(t))r=U5(t,n);else{const o=k2(e);r={x:t.x-o.x,y:t.y-o.y,width:t.width,height:t.height}}return Oc(r)}function O2(e,t){const n=ga(e);return n===t||!yn(n)||pa(n)?!1:Pi(n).position==="fixed"||O2(n,t)}function B5(e,t){const n=t.get(e);if(n)return n;let r=ma(e,[],!1).filter(d=>yn(d)&&Wc(d)!=="body"),o=null;const l=Pi(e).position==="fixed";let c=l?ga(e):e;for(;yn(c)&&!pa(c);){const d=Pi(c),f=sb(c);!f&&d.position==="fixed"&&(o=null),(l?!f&&!o:!f&&d.position==="static"&&!!o&&$5.has(o.position)||Ad(c)&&!f&&O2(e,c))?r=r.filter(m=>m!==c):o=d,c=ga(c)}return t.set(e,r),r}function V5(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const c=[...n==="clippingAncestors"?Bp(t)?[]:B5(t,this._c):[].concat(n),r],d=c[0],f=c.reduce((p,m)=>{const g=iE(t,m,o);return p.top=xr(g.top,p.top),p.right=Ji(g.right,p.right),p.bottom=Ji(g.bottom,p.bottom),p.left=xr(g.left,p.left),p},iE(t,d,o));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function F5(e){const{width:t,height:n}=A2(e);return{width:t,height:n}}function H5(e,t,n){const r=li(t),o=Mo(t),l=n==="fixed",c=al(e,!0,l,t);let d={scrollLeft:0,scrollTop:0};const f=So(0);function p(){f.x=Hp(o)}if(r||!r&&!l)if((Wc(t)!=="body"||Ad(o))&&(d=Fp(t)),r){const b=al(t,!0,l,t);f.x=b.x+t.clientLeft,f.y=b.y+t.clientTop}else o&&p();l&&!r&&o&&p();const m=o&&!r&&!l?P2(o,d):So(0),g=c.left+d.scrollLeft-f.x-m.x,y=c.top+d.scrollTop-f.y-m.y;return{x:g,y,width:c.width,height:c.height}}function py(e){return Pi(e).position==="static"}function oE(e,t){if(!li(e)||Pi(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Mo(e)===n&&(n=n.ownerDocument.body),n}function N2(e,t){const n=Hr(e);if(Bp(e))return n;if(!li(e)){let o=ga(e);for(;o&&!pa(o);){if(yn(o)&&!py(o))return o;o=ga(o)}return n}let r=oE(e,t);for(;r&&V4(r)&&py(r);)r=oE(r,t);return r&&pa(r)&&py(r)&&!sb(r)?n:r||W4(e)||n}const q5=async function(e){const t=this.getOffsetParent||N2,n=this.getDimensions,r=await n(e.floating);return{reference:H5(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function G5(e){return Pi(e).direction==="rtl"}const W5={convertOffsetParentRelativeRectToViewportRelativeRect:M5,getDocumentElement:Mo,getClippingRect:V5,getOffsetParent:N2,getElementRects:q5,getClientRects:L5,getDimensions:F5,getScale:Rc,isElement:yn,isRTL:G5};function M2(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Q5(e,t){let n=null,r;const o=Mo(e);function l(){var d;clearTimeout(r),(d=n)==null||d.disconnect(),n=null}function c(d,f){d===void 0&&(d=!1),f===void 0&&(f=1),l();const p=e.getBoundingClientRect(),{left:m,top:g,width:y,height:b}=p;if(d||t(),!y||!b)return;const w=wh(g),j=wh(o.clientWidth-(m+y)),C=wh(o.clientHeight-(g+b)),T=wh(m),R={rootMargin:-w+"px "+-j+"px "+-C+"px "+-T+"px",threshold:xr(0,Ji(1,f))||1};let _=!0;function k(N){const A=N[0].intersectionRatio;if(A!==f){if(!_)return c();A?c(!1,A):r=setTimeout(()=>{c(!1,1e-7)},1e3)}A===1&&!M2(p,e.getBoundingClientRect())&&c(),_=!1}try{n=new IntersectionObserver(k,{...R,root:o.ownerDocument})}catch{n=new IntersectionObserver(k,R)}n.observe(e)}return c(!0),l}function cx(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:l=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:d=typeof IntersectionObserver=="function",animationFrame:f=!1}=r,p=fb(e),m=o||l?[...p?ma(p):[],...ma(t)]:[];m.forEach(T=>{o&&T.addEventListener("scroll",n,{passive:!0}),l&&T.addEventListener("resize",n)});const g=p&&d?Q5(p,n):null;let y=-1,b=null;c&&(b=new ResizeObserver(T=>{let[E]=T;E&&E.target===p&&b&&(b.unobserve(t),cancelAnimationFrame(y),y=requestAnimationFrame(()=>{var R;(R=b)==null||R.observe(t)})),n()}),p&&!f&&b.observe(p),b.observe(t));let w,j=f?al(e):null;f&&C();function C(){const T=al(e);j&&!M2(j,T)&&n(),j=T,w=requestAnimationFrame(C)}return n(),()=>{var T;m.forEach(E=>{o&&E.removeEventListener("scroll",n),l&&E.removeEventListener("resize",n)}),g?.(),(T=b)==null||T.disconnect(),b=null,f&&cancelAnimationFrame(w)}}const Y5=D5,K5=A5,X5=C5,J5=P5,Z5=E5,aE=j5,e9=R5,t9=k5,n9=(e,t,n)=>{const r=new Map,o={platform:W5,...n},l={...o.platform,_c:r};return w5(e,t,{...o,platform:l})};var r9=typeof document<"u",i9=function(){},Vh=r9?v.useLayoutEffect:i9;function op(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(!op(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 l=o[r];if(!(l==="_owner"&&e.$$typeof)&&!op(e[l],t[l]))return!1}return!0}return e!==e&&t!==t}function L2(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function sE(e,t){const n=L2(e);return Math.round(t*n)/n}function my(e){const t=v.useRef(e);return Vh(()=>{t.current=e}),t}function o9(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:l,floating:c}={},transform:d=!0,whileElementsMounted:f,open:p}=e,[m,g]=v.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[y,b]=v.useState(r);op(y,r)||b(r);const[w,j]=v.useState(null),[C,T]=v.useState(null),E=v.useCallback(z=>{z!==N.current&&(N.current=z,j(z))},[]),R=v.useCallback(z=>{z!==A.current&&(A.current=z,T(z))},[]),_=l||w,k=c||C,N=v.useRef(null),A=v.useRef(null),P=v.useRef(m),U=f!=null,B=my(f),Y=my(o),X=my(p),te=v.useCallback(()=>{if(!N.current||!A.current)return;const z={placement:t,strategy:n,middleware:y};Y.current&&(z.platform=Y.current),n9(N.current,A.current,z).then(V=>{const J={...V,isPositioned:X.current!==!1};$.current&&!op(P.current,J)&&(P.current=J,ab.flushSync(()=>{g(J)}))})},[y,t,n,Y,X]);Vh(()=>{p===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,g(z=>({...z,isPositioned:!1})))},[p]);const $=v.useRef(!1);Vh(()=>($.current=!0,()=>{$.current=!1}),[]),Vh(()=>{if(_&&(N.current=_),k&&(A.current=k),_&&k){if(B.current)return B.current(_,k,te);te()}},[_,k,te,B,U]);const W=v.useMemo(()=>({reference:N,floating:A,setReference:E,setFloating:R}),[E,R]),L=v.useMemo(()=>({reference:_,floating:k}),[_,k]),I=v.useMemo(()=>{const z={position:n,left:0,top:0};if(!L.floating)return z;const V=sE(L.floating,m.x),J=sE(L.floating,m.y);return d?{...z,transform:"translate("+V+"px, "+J+"px)",...L2(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:V,top:J}},[n,d,L.floating,m.x,m.y]);return v.useMemo(()=>({...m,update:te,refs:W,elements:L,floatingStyles:I}),[m,te,W,L,I])}const a9=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?aE({element:r.current,padding:o}).fn(n):{}:r?aE({element:r,padding:o}).fn(n):{}}}},I2=(e,t)=>({...Y5(e),options:[e,t]}),hb=(e,t)=>({...K5(e),options:[e,t]}),lE=(e,t)=>({...t9(e),options:[e,t]}),ap=(e,t)=>({...X5(e),options:[e,t]}),s9=(e,t)=>({...J5(e),options:[e,t]}),l9=(e,t)=>({...Z5(e),options:[e,t]}),ld=(e,t)=>({...e9(e),options:[e,t]}),z2=(e,t)=>({...a9(e),options:[e,t]});function $2(e){const t=v.useRef(void 0),n=v.useCallback(r=>{const o=e.map(l=>{if(l!=null){if(typeof l=="function"){const c=l,d=c(r);return typeof d=="function"?d:()=>{c(null)}}return l.current=r,()=>{l.current=null}}});return()=>{o.forEach(l=>l?.())}},e);return v.useMemo(()=>e.every(r=>r==null)?null:r=>{t.current&&(t.current(),t.current=void 0),r!=null&&(t.current=n(r))},e)}const c9="data-floating-ui-focusable",cE="active",uE="selected",u9={...KR};let dE=!1,d9=0;const fE=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+d9++;function f9(){const[e,t]=v.useState(()=>dE?fE():void 0);return wo(()=>{e==null&&t(fE())},[]),v.useEffect(()=>{dE=!0},[]),e}const h9=u9.useId,U2=h9||f9;function p9(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var r;(r=e.get(t))==null||r.delete(n)}}}const m9=v.createContext(null),g9=v.createContext(null),pb=()=>{var e;return((e=v.useContext(m9))==null?void 0:e.id)||null},mb=()=>v.useContext(g9);function gb(e){return"data-floating-ui-"+e}function Ti(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const hE=gb("safe-polygon");function Fh(e,t,n){if(n&&!lx(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const r=e();return typeof r=="number"?r:r?.[t]}return e?.[t]}function gy(e){return typeof e=="function"?e():e}function v9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:l,elements:c}=e,{enabled:d=!0,delay:f=0,handleClose:p=null,mouseOnly:m=!1,restMs:g=0,move:y=!0}=t,b=mb(),w=pb(),j=jh(p),C=jh(f),T=jh(n),E=jh(g),R=v.useRef(),_=v.useRef(-1),k=v.useRef(),N=v.useRef(-1),A=v.useRef(!0),P=v.useRef(!1),U=v.useRef(()=>{}),B=v.useRef(!1),Y=xo(()=>{var I;const z=(I=o.current.openEvent)==null?void 0:I.type;return z?.includes("mouse")&&z!=="mousedown"});v.useEffect(()=>{if(!d)return;function I(z){let{open:V}=z;V||(Ti(_),Ti(N),A.current=!0,B.current=!1)}return l.on("openchange",I),()=>{l.off("openchange",I)}},[d,l]),v.useEffect(()=>{if(!d||!j.current||!n)return;function I(V){Y()&&r(!1,V,"hover")}const z=Ks(c.floating).documentElement;return z.addEventListener("mouseleave",I),()=>{z.removeEventListener("mouseleave",I)}},[c.floating,n,r,d,j,Y]);const X=v.useCallback(function(I,z,V){z===void 0&&(z=!0),V===void 0&&(V="hover");const J=Fh(C.current,"close",R.current);J&&!k.current?(Ti(_),_.current=window.setTimeout(()=>r(!1,I,V),J)):z&&(Ti(_),r(!1,I,V))},[C,r]),te=xo(()=>{U.current(),k.current=void 0}),$=xo(()=>{if(P.current){const I=Ks(c.floating).body;I.style.pointerEvents="",I.removeAttribute(hE),P.current=!1}}),W=xo(()=>o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1);v.useEffect(()=>{if(!d)return;function I(F){if(Ti(_),A.current=!1,m&&!lx(R.current)||gy(E.current)>0&&!Fh(C.current,"open"))return;const oe=Fh(C.current,"open",R.current);oe?_.current=window.setTimeout(()=>{T.current||r(!0,F,"hover")},oe):n||r(!0,F,"hover")}function z(F){if(W()){$();return}U.current();const oe=Ks(c.floating);if(Ti(N),B.current=!1,j.current&&o.current.floatingContext){n||Ti(_),k.current=j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){$(),te(),W()||X(F,!0,"safe-polygon")}});const Se=k.current;oe.addEventListener("mousemove",Se),U.current=()=>{oe.removeEventListener("mousemove",Se)};return}(R.current==="touch"?!pd(c.floating,F.relatedTarget):!0)&&X(F)}function V(F){W()||o.current.floatingContext&&(j.current==null||j.current({...o.current.floatingContext,tree:b,x:F.clientX,y:F.clientY,onClose(){$(),te(),W()||X(F)}})(F))}function J(){Ti(_)}function M(F){W()||X(F,!1)}if(yn(c.domReference)){const F=c.domReference,oe=c.floating;return n&&F.addEventListener("mouseleave",V),y&&F.addEventListener("mousemove",I,{once:!0}),F.addEventListener("mouseenter",I),F.addEventListener("mouseleave",z),oe&&(oe.addEventListener("mouseleave",V),oe.addEventListener("mouseenter",J),oe.addEventListener("mouseleave",M)),()=>{n&&F.removeEventListener("mouseleave",V),y&&F.removeEventListener("mousemove",I),F.removeEventListener("mouseenter",I),F.removeEventListener("mouseleave",z),oe&&(oe.removeEventListener("mouseleave",V),oe.removeEventListener("mouseenter",J),oe.removeEventListener("mouseleave",M))}}},[c,d,e,m,y,X,te,$,r,n,T,b,C,j,o,W,E]),wo(()=>{var I;if(d&&n&&(I=j.current)!=null&&(I=I.__options)!=null&&I.blockPointerEvents&&Y()){P.current=!0;const V=c.floating;if(yn(c.domReference)&&V){var z;const J=Ks(c.floating).body;J.setAttribute(hE,"");const M=c.domReference,F=b==null||(z=b.nodesRef.current.find(oe=>oe.id===w))==null||(z=z.context)==null?void 0:z.elements.floating;return F&&(F.style.pointerEvents=""),J.style.pointerEvents="none",M.style.pointerEvents="auto",V.style.pointerEvents="auto",()=>{J.style.pointerEvents="",M.style.pointerEvents="",V.style.pointerEvents=""}}}},[d,n,w,c,b,j,Y]),wo(()=>{n||(R.current=void 0,B.current=!1,te(),$())},[n,te,$]),v.useEffect(()=>()=>{te(),Ti(_),Ti(N),$()},[d,c.domReference,te,$]);const L=v.useMemo(()=>{function I(z){R.current=z.pointerType}return{onPointerDown:I,onPointerEnter:I,onMouseMove(z){const{nativeEvent:V}=z;function J(){!A.current&&!T.current&&r(!0,V,"hover")}m&&!lx(R.current)||n||gy(E.current)===0||B.current&&z.movementX**2+z.movementY**2<2||(Ti(N),R.current==="touch"?J():(B.current=!0,N.current=window.setTimeout(J,gy(E.current))))}}},[m,r,n,T,E]);return v.useMemo(()=>d?{reference:L}:{},[d,L])}const ux=()=>{},B2=v.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:ux,setState:ux,isInstantPhase:!1}),y9=()=>v.useContext(B2);function x9(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,l]=v.useReducer((f,p)=>({...f,...p}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),c=v.useRef(null),d=v.useCallback(f=>{l({currentId:f})},[]);return wo(()=>{o.currentId?c.current===null?c.current=o.currentId:o.isInstantPhase||l({isInstantPhase:!0}):(o.isInstantPhase&&l({isInstantPhase:!1}),c.current=null)},[o.currentId,o.isInstantPhase]),a.jsx(B2.Provider,{value:v.useMemo(()=>({...o,setState:l,setCurrentId:d}),[o,d]),children:t})}function b9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:l,enabled:c=!0}=t,d=l??o,f=y9(),{currentId:p,setCurrentId:m,initialDelay:g,setState:y,timeoutMs:b}=f;return wo(()=>{c&&p&&(y({delay:{open:1,close:Fh(g,"close")}}),p!==d&&r(!1))},[c,d,r,y,p,g]),wo(()=>{function w(){r(!1),y({delay:g,currentId:null})}if(c&&p&&!n&&p===d){if(b){const j=window.setTimeout(w,b);return()=>{clearTimeout(j)}}w()}},[c,n,y,p,d,r,g,b]),wo(()=>{c&&(m===ux||!n||m(d))},[c,n,m,d]),f}const S9={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},w9={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},pE=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function j9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:l}=e,{enabled:c=!0,escapeKey:d=!0,outsidePress:f=!0,outsidePressEvent:p="pointerdown",referencePress:m=!1,referencePressEvent:g="pointerdown",ancestorScroll:y=!1,bubbles:b,capture:w}=t,j=mb(),C=xo(typeof f=="function"?f:()=>!1),T=typeof f=="function"?C:f,E=v.useRef(!1),{escapeKey:R,outsidePress:_}=pE(b),{escapeKey:k,outsidePress:N}=pE(w),A=v.useRef(!1),P=xo($=>{var W;if(!n||!c||!d||$.key!=="Escape"||A.current)return;const L=(W=l.current.floatingContext)==null?void 0:W.nodeId,I=j?Bh(j.nodesRef.current,L):[];if(!R&&($.stopPropagation(),I.length>0)){let z=!0;if(I.forEach(V=>{var J;if((J=V.context)!=null&&J.open&&!V.context.dataRef.current.__escapeKeyBubbles){z=!1;return}}),!z)return}r(!1,g5($)?$.nativeEvent:$,"escape-key")}),U=xo($=>{var W;const L=()=>{var I;P($),(I=wc($))==null||I.removeEventListener("keydown",L)};(W=wc($))==null||W.addEventListener("keydown",L)}),B=xo($=>{var W;const L=l.current.insideReactTree;l.current.insideReactTree=!1;const I=E.current;if(E.current=!1,p==="click"&&I||L||typeof T=="function"&&!T($))return;const z=wc($),V="["+gb("inert")+"]",J=Ks(o.floating).querySelectorAll(V);let M=yn(z)?z:null;for(;M&&!pa(M);){const Se=ga(M);if(pa(Se)||!yn(Se))break;M=Se}if(J.length&&yn(z)&&!f5(z)&&!pd(z,o.floating)&&Array.from(J).every(Se=>!pd(M,Se)))return;if(li(z)&&te){const Se=pa(z),ge=Pi(z),Oe=/auto|scroll/,nt=Se||Oe.test(ge.overflowX),Ce=Se||Oe.test(ge.overflowY),ht=nt&&z.clientWidth>0&&z.scrollWidth>z.clientWidth,st=Ce&&z.clientHeight>0&&z.scrollHeight>z.clientHeight,vt=ge.direction==="rtl",rt=st&&(vt?$.offsetX<=z.offsetWidth-z.clientWidth:$.offsetX>z.clientWidth),wt=ht&&$.offsetY>z.clientHeight;if(rt||wt)return}const F=(W=l.current.floatingContext)==null?void 0:W.nodeId,oe=j&&Bh(j.nodesRef.current,F).some(Se=>{var ge;return hy($,(ge=Se.context)==null?void 0:ge.elements.floating)});if(hy($,o.floating)||hy($,o.domReference)||oe)return;const ce=j?Bh(j.nodesRef.current,F):[];if(ce.length>0){let Se=!0;if(ce.forEach(ge=>{var Oe;if((Oe=ge.context)!=null&&Oe.open&&!ge.context.dataRef.current.__outsidePressBubbles){Se=!1;return}}),!Se)return}r(!1,$,"outside-press")}),Y=xo($=>{var W;const L=()=>{var I;B($),(I=wc($))==null||I.removeEventListener(p,L)};(W=wc($))==null||W.addEventListener(p,L)});v.useEffect(()=>{if(!n||!c)return;l.current.__escapeKeyBubbles=R,l.current.__outsidePressBubbles=_;let $=-1;function W(J){r(!1,J,"ancestor-scroll")}function L(){window.clearTimeout($),A.current=!0}function I(){$=window.setTimeout(()=>{A.current=!1},Vp()?5:0)}const z=Ks(o.floating);d&&(z.addEventListener("keydown",k?U:P,k),z.addEventListener("compositionstart",L),z.addEventListener("compositionend",I)),T&&z.addEventListener(p,N?Y:B,N);let V=[];return y&&(yn(o.domReference)&&(V=ma(o.domReference)),yn(o.floating)&&(V=V.concat(ma(o.floating))),!yn(o.reference)&&o.reference&&o.reference.contextElement&&(V=V.concat(ma(o.reference.contextElement)))),V=V.filter(J=>{var M;return J!==((M=z.defaultView)==null?void 0:M.visualViewport)}),V.forEach(J=>{J.addEventListener("scroll",W,{passive:!0})}),()=>{d&&(z.removeEventListener("keydown",k?U:P,k),z.removeEventListener("compositionstart",L),z.removeEventListener("compositionend",I)),T&&z.removeEventListener(p,N?Y:B,N),V.forEach(J=>{J.removeEventListener("scroll",W)}),window.clearTimeout($)}},[l,o,d,T,p,n,r,y,c,R,_,P,k,U,B,N,Y]),v.useEffect(()=>{l.current.insideReactTree=!1},[l,T,p]);const X=v.useMemo(()=>({onKeyDown:P,...m&&{[S9[g]]:$=>{r(!1,$.nativeEvent,"reference-press")},...g!=="click"&&{onClick($){r(!1,$.nativeEvent,"reference-press")}}}}),[P,r,m,g]),te=v.useMemo(()=>({onKeyDown:P,onMouseDown(){E.current=!0},onMouseUp(){E.current=!0},[w9[p]]:()=>{l.current.insideReactTree=!0}}),[P,p,l]);return v.useMemo(()=>c?{reference:X,floating:te}:{},[c,X,te])}function C9(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=U2(),l=v.useRef({}),[c]=v.useState(()=>p9()),d=pb()!=null,[f,p]=v.useState(r.reference),m=xo((b,w,j)=>{l.current.openEvent=b?w:void 0,c.emit("openchange",{open:b,event:w,reason:j,nested:d}),n?.(b,w,j)}),g=v.useMemo(()=>({setPositionReference:p}),[]),y=v.useMemo(()=>({reference:f||r.reference||null,floating:r.floating||null,domReference:r.reference}),[f,r.reference,r.floating]);return v.useMemo(()=>({dataRef:l,open:t,onOpenChange:m,elements:y,events:c,floatingId:o,refs:g}),[t,m,y,c,o,g])}function vb(e){e===void 0&&(e={});const{nodeId:t}=e,n=C9({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[l,c]=v.useState(null),[d,f]=v.useState(null),m=o?.domReference||l,g=v.useRef(null),y=mb();wo(()=>{m&&(g.current=m)},[m]);const b=o9({...e,elements:{...o,...d&&{reference:d}}}),w=v.useCallback(R=>{const _=yn(R)?{getBoundingClientRect:()=>R.getBoundingClientRect(),getClientRects:()=>R.getClientRects(),contextElement:R}:R;f(_),b.refs.setReference(_)},[b.refs]),j=v.useCallback(R=>{(yn(R)||R===null)&&(g.current=R,c(R)),(yn(b.refs.reference.current)||b.refs.reference.current===null||R!==null&&!yn(R))&&b.refs.setReference(R)},[b.refs]),C=v.useMemo(()=>({...b.refs,setReference:j,setPositionReference:w,domReference:g}),[b.refs,j,w]),T=v.useMemo(()=>({...b.elements,domReference:m}),[b.elements,m]),E=v.useMemo(()=>({...b,...r,refs:C,elements:T,nodeId:t}),[b,C,T,t,r]);return wo(()=>{r.dataRef.current.floatingContext=E;const R=y?.nodesRef.current.find(_=>_.id===t);R&&(R.context=E)}),v.useMemo(()=>({...b,context:E,refs:C,elements:T}),[b,C,T,E])}function vy(){return c5()&&l5()}function E9(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:l,elements:c}=e,{enabled:d=!0,visibleOnly:f=!0}=t,p=v.useRef(!1),m=v.useRef(-1),g=v.useRef(!0);v.useEffect(()=>{if(!d)return;const b=Hr(c.domReference);function w(){!n&&li(c.domReference)&&c.domReference===ZC(Ks(c.domReference))&&(p.current=!0)}function j(){g.current=!0}function C(){g.current=!1}return b.addEventListener("blur",w),vy()&&(b.addEventListener("keydown",j,!0),b.addEventListener("pointerdown",C,!0)),()=>{b.removeEventListener("blur",w),vy()&&(b.removeEventListener("keydown",j,!0),b.removeEventListener("pointerdown",C,!0))}},[c.domReference,n,d]),v.useEffect(()=>{if(!d)return;function b(w){let{reason:j}=w;(j==="reference-press"||j==="escape-key")&&(p.current=!0)}return o.on("openchange",b),()=>{o.off("openchange",b)}},[o,d]),v.useEffect(()=>()=>{Ti(m)},[]);const y=v.useMemo(()=>({onMouseLeave(){p.current=!1},onFocus(b){if(p.current)return;const w=wc(b.nativeEvent);if(f&&yn(w)){if(vy()&&!b.relatedTarget){if(!g.current&&!h5(w))return}else if(!p5(w))return}r(!0,b.nativeEvent,"focus")},onBlur(b){p.current=!1;const w=b.relatedTarget,j=b.nativeEvent,C=yn(w)&&w.hasAttribute(gb("focus-guard"))&&w.getAttribute("data-type")==="outside";m.current=window.setTimeout(()=>{var T;const E=ZC(c.domReference?c.domReference.ownerDocument:document);!w&&E===c.domReference||pd((T=l.current.floatingContext)==null?void 0:T.refs.floating.current,E)||pd(c.domReference,E)||C||r(!1,j,"focus")})}}),[l,c.domReference,r,f]);return v.useMemo(()=>d?{reference:y}:{},[d,y])}function yy(e,t,n){const r=new Map,o=n==="item";let l=e;if(o&&e){const{[cE]:c,[uE]:d,...f}=e;l=f}return{...n==="floating"&&{tabIndex:-1,[c9]:""},...l,...t.map(c=>{const d=c?c[n]:null;return typeof d=="function"?e?d(e):null:d}).concat(e).reduce((c,d)=>(d&&Object.entries(d).forEach(f=>{let[p,m]=f;if(!(o&&[cE,uE].includes(p)))if(p.indexOf("on")===0){if(r.has(p)||r.set(p,[]),typeof m=="function"){var g;(g=r.get(p))==null||g.push(m),c[p]=function(){for(var y,b=arguments.length,w=new Array(b),j=0;j<b;j++)w[j]=arguments[j];return(y=r.get(p))==null?void 0:y.map(C=>C(...w)).find(C=>C!==void 0)}}}else c[p]=m}),c),{})}}function T9(e){e===void 0&&(e=[]);const t=e.map(d=>d?.reference),n=e.map(d=>d?.floating),r=e.map(d=>d?.item),o=v.useCallback(d=>yy(d,e,"reference"),t),l=v.useCallback(d=>yy(d,e,"floating"),n),c=v.useCallback(d=>yy(d,e,"item"),r);return v.useMemo(()=>({getReferenceProps:o,getFloatingProps:l,getItemProps:c}),[o,l,c])}const R9=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function _9(e,t){var n,r;t===void 0&&(t={});const{open:o,elements:l,floatingId:c}=e,{enabled:d=!0,role:f="dialog"}=t,p=U2(),m=((n=l.domReference)==null?void 0:n.id)||p,g=v.useMemo(()=>{var E;return((E=m5(l.floating))==null?void 0:E.id)||c},[l.floating,c]),y=(r=R9.get(f))!=null?r:f,w=pb()!=null,j=v.useMemo(()=>y==="tooltip"||f==="label"?{["aria-"+(f==="label"?"labelledby":"describedby")]:o?g:void 0}:{"aria-expanded":o?"true":"false","aria-haspopup":y==="alertdialog"?"dialog":y,"aria-controls":o?g:void 0,...y==="listbox"&&{role:"combobox"},...y==="menu"&&{id:m},...y==="menu"&&w&&{role:"menuitem"},...f==="select"&&{"aria-autocomplete":"none"},...f==="combobox"&&{"aria-autocomplete":"list"}},[y,g,w,o,m,f]),C=v.useMemo(()=>{const E={id:g,...y&&{role:y}};return y==="tooltip"||f==="label"?E:{...E,...y==="menu"&&{"aria-labelledby":m}}},[y,g,m,f]),T=v.useCallback(E=>{let{active:R,selected:_}=E;const k={role:"option",...R&&{id:g+"-fui-option"}};switch(f){case"select":case"combobox":return{...k,"aria-selected":_}}return{}},[g,f]);return v.useMemo(()=>d?{reference:j,floating:C,item:T}:{},[d,j,C,T])}const[D9,Mi]=kr("ScrollArea.Root component was not found in tree");function Nc(e,t){const n=Ws(t);qc(()=>{let r=0;if(e){const o=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return o.observe(e),()=>{window.cancelAnimationFrame(r),o.unobserve(e)}}},[e,n])}const A9=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Mi(),[l,c]=v.useState(0),[d,f]=v.useState(0),p=!!(l&&d);return Nc(o.scrollbarX,()=>{const m=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(m),f(m)}),Nc(o.scrollbarY,()=>{const m=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(m),c(m)}),p?a.jsx("div",{...r,ref:t,style:{...n,width:l,height:d}}):null}),k9=v.forwardRef((e,t)=>{const n=Mi(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?a.jsx(A9,{...e,ref:t}):null}),P9={scrollHideDelay:1e3,type:"hover"},V2=v.forwardRef((e,t)=>{const{type:n,scrollHideDelay:r,scrollbars:o,getStyles:l,...c}=ae("ScrollAreaRoot",P9,e),[d,f]=v.useState(null),[p,m]=v.useState(null),[g,y]=v.useState(null),[b,w]=v.useState(null),[j,C]=v.useState(null),[T,E]=v.useState(0),[R,_]=v.useState(0),[k,N]=v.useState(!1),[A,P]=v.useState(!1),U=In(t,B=>f(B));return a.jsx(D9,{value:{type:n,scrollHideDelay:r,scrollArea:d,viewport:p,onViewportChange:m,content:g,onContentChange:y,scrollbarX:b,onScrollbarXChange:w,scrollbarXEnabled:k,onScrollbarXEnabledChange:N,scrollbarY:j,onScrollbarYChange:C,scrollbarYEnabled:A,onScrollbarYEnabledChange:P,onCornerWidthChange:E,onCornerHeightChange:_,getStyles:l},children:a.jsx(ue,{...c,ref:U,__vars:{"--sa-corner-width":o!=="xy"?"0px":`${T}px`,"--sa-corner-height":o!=="xy"?"0px":`${R}px`}})})});V2.displayName="@mantine/core/ScrollAreaRoot";function F2(e,t){const n=e/t;return Number.isNaN(n)?0:n}function qp(e){const t=F2(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function H2(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function O9(e,[t,n]){return Math.min(n,Math.max(t,e))}function mE(e,t,n="ltr"){const r=qp(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,l=t.scrollbar.size-o,c=t.content-t.viewport,d=l-r,f=n==="ltr"?[0,c]:[c*-1,0],p=O9(e,f);return H2([0,c],[0,d])(p)}function N9(e,t,n,r="ltr"){const o=qp(n),l=o/2,c=t||l,d=o-c,f=n.scrollbar.paddingStart+c,p=n.scrollbar.size-n.scrollbar.paddingEnd-d,m=n.content-n.viewport,g=r==="ltr"?[0,m]:[m*-1,0];return H2([f,p],g)(e)}function q2(e,t){return e>0&&e<t}function cs(e){return e?parseInt(e,10):0}function il(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e?.(r),(n===!1||!r.defaultPrevented)&&t?.(r)}}const[M9,G2]=kr("ScrollAreaScrollbar was not found in tree"),W2=v.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:c,onThumbPositionChange:d,onDragScroll:f,onWheelScroll:p,onResize:m,...g}=e,y=Mi(),[b,w]=v.useState(null),j=In(t,P=>w(P)),C=v.useRef(null),T=v.useRef(""),{viewport:E}=y,R=n.content-n.viewport,_=Ws(p),k=Ws(d),N=Mp(m,10),A=P=>{if(C.current){const U=P.clientX-C.current.left,B=P.clientY-C.current.top;f({x:U,y:B})}};return v.useEffect(()=>{const P=U=>{const B=U.target;b?.contains(B)&&_(U,R)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[E,b,R,_]),v.useEffect(k,[n,k]),Nc(b,N),Nc(y.content,N),a.jsx(M9,{value:{scrollbar:b,hasThumb:r,onThumbChange:Ws(o),onThumbPointerUp:Ws(l),onThumbPositionChange:k,onThumbPointerDown:Ws(c)},children:a.jsx("div",{...g,ref:j,"data-mantine-scrollbar":!0,style:{position:"absolute",...g.style},onPointerDown:il(e.onPointerDown,P=>{P.preventDefault(),P.button===0&&(P.target.setPointerCapture(P.pointerId),C.current=b.getBoundingClientRect(),T.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",A(P))}),onPointerMove:il(e.onPointerMove,A),onPointerUp:il(e.onPointerUp,P=>{const U=P.target;U.hasPointerCapture(P.pointerId)&&(P.preventDefault(),U.releasePointerCapture(P.pointerId))}),onLostPointerCapture:()=>{document.body.style.webkitUserSelect=T.current,C.current=null}})})}),Q2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...l}=e,c=Mi(),[d,f]=v.useState(),p=v.useRef(null),m=In(t,p,c.onScrollbarXChange);return v.useEffect(()=>{p.current&&f(getComputedStyle(p.current))},[p]),a.jsx(W2,{"data-orientation":"horizontal",...l,ref:m,sizes:n,style:{...o,"--sa-thumb-width":`${qp(n)}px`},onThumbPointerDown:g=>e.onThumbPointerDown(g.x),onDragScroll:g=>e.onDragScroll(g.x),onWheelScroll:(g,y)=>{if(c.viewport){const b=c.viewport.scrollLeft+g.deltaX;e.onWheelScroll(b),q2(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollWidth,viewport:c.viewport.offsetWidth,scrollbar:{size:p.current.clientWidth,paddingStart:cs(d.paddingLeft),paddingEnd:cs(d.paddingRight)}})}})});Q2.displayName="@mantine/core/ScrollAreaScrollbarX";const Y2=v.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...l}=e,c=Mi(),[d,f]=v.useState(),p=v.useRef(null),m=In(t,p,c.onScrollbarYChange);return v.useEffect(()=>{p.current&&f(window.getComputedStyle(p.current))},[]),a.jsx(W2,{...l,"data-orientation":"vertical",ref:m,sizes:n,style:{"--sa-thumb-height":`${qp(n)}px`,...o},onThumbPointerDown:g=>e.onThumbPointerDown(g.y),onDragScroll:g=>e.onDragScroll(g.y),onWheelScroll:(g,y)=>{if(c.viewport){const b=c.viewport.scrollTop+g.deltaY;e.onWheelScroll(b),q2(b,y)&&g.preventDefault()}},onResize:()=>{p.current&&c.viewport&&d&&r({content:c.viewport.scrollHeight,viewport:c.viewport.offsetHeight,scrollbar:{size:p.current.clientHeight,paddingStart:cs(d.paddingTop),paddingEnd:cs(d.paddingBottom)}})}})});Y2.displayName="@mantine/core/ScrollAreaScrollbarY";const Gp=v.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=vs(),l=Mi(),c=v.useRef(null),d=v.useRef(0),[f,p]=v.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),m=F2(f.viewport,f.content),g={...r,sizes:f,onSizesChange:p,hasThumb:m>0&&m<1,onThumbChange:b=>{c.current=b},onThumbPointerUp:()=>{d.current=0},onThumbPointerDown:b=>{d.current=b}},y=(b,w)=>N9(b,d.current,f,w);return n==="horizontal"?a.jsx(Q2,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&c.current){const b=l.viewport.scrollLeft,w=mE(b,f,o);c.current.style.transform=`translate3d(${w}px, 0, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollLeft=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollLeft=y(b,o))}}):n==="vertical"?a.jsx(Y2,{...g,ref:t,onThumbPositionChange:()=>{if(l.viewport&&c.current){const b=l.viewport.scrollTop,w=mE(b,f);f.scrollbar.size===0?c.current.style.setProperty("--thumb-opacity","0"):c.current.style.setProperty("--thumb-opacity","1"),c.current.style.transform=`translate3d(0, ${w}px, 0)`}},onWheelScroll:b=>{l.viewport&&(l.viewport.scrollTop=b)},onDragScroll:b=>{l.viewport&&(l.viewport.scrollTop=y(b))}}):null});Gp.displayName="@mantine/core/ScrollAreaScrollbarVisible";const yb=v.forwardRef((e,t)=>{const n=Mi(),{forceMount:r,...o}=e,[l,c]=v.useState(!1),d=e.orientation==="horizontal",f=Mp(()=>{if(n.viewport){const p=n.viewport.offsetWidth<n.viewport.scrollWidth,m=n.viewport.offsetHeight<n.viewport.scrollHeight;c(d?p:m)}},10);return Nc(n.viewport,f),Nc(n.content,f),r||l?a.jsx(Gp,{"data-state":l?"visible":"hidden",...o,ref:t}):null});yb.displayName="@mantine/core/ScrollAreaScrollbarAuto";const K2=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Mi(),[l,c]=v.useState(!1);return v.useEffect(()=>{const{scrollArea:d}=o;let f=0;if(d){const p=()=>{window.clearTimeout(f),c(!0)},m=()=>{f=window.setTimeout(()=>c(!1),o.scrollHideDelay)};return d.addEventListener("pointerenter",p),d.addEventListener("pointerleave",m),()=>{window.clearTimeout(f),d.removeEventListener("pointerenter",p),d.removeEventListener("pointerleave",m)}}},[o.scrollArea,o.scrollHideDelay]),n||l?a.jsx(yb,{"data-state":l?"visible":"hidden",...r,ref:t}):null});K2.displayName="@mantine/core/ScrollAreaScrollbarHover";const L9=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Mi(),l=e.orientation==="horizontal",[c,d]=v.useState("hidden"),f=Mp(()=>d("idle"),100);return v.useEffect(()=>{if(c==="idle"){const p=window.setTimeout(()=>d("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(p)}},[c,o.scrollHideDelay]),v.useEffect(()=>{const{viewport:p}=o,m=l?"scrollLeft":"scrollTop";if(p){let g=p[m];const y=()=>{const b=p[m];g!==b&&(d("scrolling"),f()),g=b};return p.addEventListener("scroll",y),()=>p.removeEventListener("scroll",y)}},[o.viewport,l,f]),n||c!=="hidden"?a.jsx(Gp,{"data-state":c==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:il(e.onPointerEnter,()=>d("interacting")),onPointerLeave:il(e.onPointerLeave,()=>d("idle"))}):null}),dx=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Mi(),{onScrollbarXEnabledChange:l,onScrollbarYEnabledChange:c}=o,d=e.orientation==="horizontal";return v.useEffect(()=>(d?l(!0):c(!0),()=>{d?l(!1):c(!1)}),[d,l,c]),o.type==="hover"?a.jsx(K2,{...r,ref:t,forceMount:n}):o.type==="scroll"?a.jsx(L9,{...r,ref:t,forceMount:n}):o.type==="auto"?a.jsx(yb,{...r,ref:t,forceMount:n}):o.type==="always"?a.jsx(Gp,{...r,ref:t}):null});dx.displayName="@mantine/core/ScrollAreaScrollbar";function I9(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function o(){const l={left:e.scrollLeft,top:e.scrollTop},c=n.left!==l.left,d=n.top!==l.top;(c||d)&&t(),n=l,r=window.requestAnimationFrame(o)})(),()=>window.cancelAnimationFrame(r)}const X2=v.forwardRef((e,t)=>{const{style:n,...r}=e,o=Mi(),l=G2(),{onThumbPositionChange:c}=l,d=In(t,m=>l.onThumbChange(m)),f=v.useRef(void 0),p=Mp(()=>{f.current&&(f.current(),f.current=void 0)},100);return v.useEffect(()=>{const{viewport:m}=o;if(m){const g=()=>{if(p(),!f.current){const y=I9(m,c);f.current=y,c()}};return c(),m.addEventListener("scroll",g),()=>m.removeEventListener("scroll",g)}},[o.viewport,p,c]),a.jsx("div",{"data-state":l.hasThumb?"visible":"hidden",...r,ref:d,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:il(e.onPointerDownCapture,m=>{const y=m.target.getBoundingClientRect(),b=m.clientX-y.left,w=m.clientY-y.top;l.onThumbPointerDown({x:b,y:w})}),onPointerUp:il(e.onPointerUp,l.onThumbPointerUp)})});X2.displayName="@mantine/core/ScrollAreaThumb";const fx=v.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=G2();return n||o.hasThumb?a.jsx(X2,{ref:t,...r}):null});fx.displayName="@mantine/core/ScrollAreaThumb";const J2=v.forwardRef(({children:e,style:t,...n},r)=>{const o=Mi(),l=In(r,o.onViewportChange);return a.jsx(ue,{...n,ref:l,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:a.jsx("div",{...o.getStyles("content"),ref:o.onContentChange,children:e})})});J2.displayName="@mantine/core/ScrollAreaViewport";var xb={root:"m_d57069b5",content:"m_b1336c6",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const Z2={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},z9=(e,{scrollbarSize:t,overscrollBehavior:n})=>({root:{"--scrollarea-scrollbar-size":le(t),"--scrollarea-over-scroll-behavior":n}}),fi=be((e,t)=>{const n=ae("ScrollArea",Z2,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,scrollbarSize:f,vars:p,type:m,scrollHideDelay:g,viewportProps:y,viewportRef:b,onScrollPositionChange:w,children:j,offsetScrollbars:C,scrollbars:T,onBottomReached:E,onTopReached:R,overscrollBehavior:_,attributes:k,...N}=n,[A,P]=v.useState(!1),[U,B]=v.useState(!1),[Y,X]=v.useState(!1),te=Ie({name:"ScrollArea",props:n,classes:xb,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:k,vars:p,varsResolver:z9}),$=v.useRef(null),W=$2([b,$]);return v.useEffect(()=>{if(!$.current||C!=="present")return;const L=$.current,I=new ResizeObserver(()=>{const{scrollHeight:z,clientHeight:V,scrollWidth:J,clientWidth:M}=L;B(z>V),X(J>M)});return I.observe(L),()=>I.disconnect()},[$,C]),a.jsxs(V2,{getStyles:te,type:m==="never"?"always":m,scrollHideDelay:g,ref:t,scrollbars:T,...te("root"),...N,children:[a.jsx(J2,{...y,...te("viewport",{style:y?.style}),ref:W,"data-offset-scrollbars":C===!0?"xy":C||void 0,"data-scrollbars":T||void 0,"data-horizontal-hidden":C==="present"&&!Y?"true":void 0,"data-vertical-hidden":C==="present"&&!U?"true":void 0,onScroll:L=>{y?.onScroll?.(L),w?.({x:L.currentTarget.scrollLeft,y:L.currentTarget.scrollTop});const{scrollTop:I,scrollHeight:z,clientHeight:V}=L.currentTarget;I-(z-V)>=-.6&&E?.(),I===0&&R?.()},children:j}),(T==="xy"||T==="x")&&a.jsx(dx,{...te("scrollbar"),orientation:"horizontal","data-hidden":m==="never"||C==="present"&&!Y?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(fx,{...te("thumb")})}),(T==="xy"||T==="y")&&a.jsx(dx,{...te("scrollbar"),orientation:"vertical","data-hidden":m==="never"||C==="present"&&!U?!0:void 0,forceMount:!0,onMouseEnter:()=>P(!0),onMouseLeave:()=>P(!1),children:a.jsx(fx,{...te("thumb")})}),a.jsx(k9,{...te("corner"),"data-hovered":A||void 0,"data-hidden":m==="never"||void 0})]})});fi.displayName="@mantine/core/ScrollArea";const Wp=be((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:l,scrollHideDelay:c,type:d,dir:f,offsetScrollbars:p,viewportRef:m,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:w,scrollbars:j,style:C,vars:T,onBottomReached:E,onTopReached:R,onOverflowChange:_,...k}=ae("ScrollAreaAutosize",Z2,e),N=v.useRef(null),A=$2([m,N]),[P,U]=v.useState(!1),B=v.useRef(!1);return v.useEffect(()=>{if(!_)return;const Y=N.current;if(!Y)return;const X=()=>{const $=Y.scrollHeight>Y.clientHeight;$!==P&&(B.current?_?.($):(B.current=!0,$&&_?.(!0)),U($))};X();const te=new ResizeObserver(X);return te.observe(Y),()=>te.disconnect()},[_,P]),a.jsx(ue,{...k,ref:t,style:[{display:"flex",overflow:"hidden"},C],children:a.jsx(ue,{style:{display:"flex",flexDirection:"column",flex:1,overflow:"hidden",...j==="y"&&{minWidth:0},...j==="x"&&{minHeight:0},...j==="xy"&&{minWidth:0,minHeight:0},...j===!1&&{minWidth:0,minHeight:0}},children:a.jsx(fi,{classNames:r,styles:o,scrollHideDelay:c,scrollbarSize:l,type:d,dir:f,offsetScrollbars:p,viewportRef:A,onScrollPositionChange:g,unstyled:y,variant:b,viewportProps:w,vars:T,scrollbars:j,onBottomReached:E,onTopReached:R,"data-autosize":"true",children:n})})})});fi.classes=xb;Wp.displayName="@mantine/core/ScrollAreaAutosize";Wp.classes=xb;fi.Autosize=Wp;var e_={root:"m_87cf2631"};const $9={__staticSelector:"UnstyledButton"},ar=pr((e,t)=>{const n=ae("UnstyledButton",$9,e),{className:r,component:o="button",__staticSelector:l,unstyled:c,classNames:d,styles:f,style:p,attributes:m,...g}=n,y=Ie({name:l,props:n,classes:e_,className:r,style:p,classNames:d,styles:f,unstyled:c,attributes:m});return a.jsx(ue,{...y("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...g})});ar.classes=e_;ar.displayName="@mantine/core/UnstyledButton";var t_={root:"m_515a97f8"};const bb=be((e,t)=>{const n=ae("VisuallyHidden",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,attributes:p,...m}=n,g=Ie({name:"VisuallyHidden",classes:t_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:p});return a.jsx(ue,{component:"span",ref:t,...g("root"),...m})});bb.classes=t_;bb.displayName="@mantine/core/VisuallyHidden";var n_={root:"m_1b7284a3"};const U9=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:Vt(t),"--paper-shadow":Jx(n)}}),Ar=pr((e,t)=>{const n=ae("Paper",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,withBorder:f,vars:p,radius:m,shadow:g,variant:y,mod:b,attributes:w,...j}=n,C=Ie({name:"Paper",props:n,classes:n_,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:w,vars:p,varsResolver:U9});return a.jsx(ue,{ref:t,mod:[{"data-with-border":f},b],...C("root"),variant:y,...j})});Ar.classes=n_;Ar.displayName="@mantine/core/Paper";function gE(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function vE(e,t,n,r,o){return e==="center"||r==="center"?{left:t}:e==="end"?{[o==="ltr"?"right":"left"]:n}:e==="start"?{[o==="ltr"?"left":"right"]:n}:{}}const B9={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function V9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:l,arrowY:c,dir:d}){const[f,p="center"]=e.split("-"),m={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[B9[f]]:r},g=-t/2;return f==="left"?{...m,...gE(p,c,n,o),right:g,borderLeftColor:"transparent",borderBottomColor:"transparent",clipPath:"polygon(100% 0, 0 0, 100% 100%)"}:f==="right"?{...m,...gE(p,c,n,o),left:g,borderRightColor:"transparent",borderTopColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 100%)"}:f==="top"?{...m,...vE(p,l,n,o,d),bottom:g,borderTopColor:"transparent",borderLeftColor:"transparent",clipPath:"polygon(0 100%, 100% 100%, 100% 0)"}:f==="bottom"?{...m,...vE(p,l,n,o,d),top:g,borderBottomColor:"transparent",borderRightColor:"transparent",clipPath:"polygon(0 100%, 0 0, 100% 0)"}:{}}const sp=v.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:l,arrowX:c,arrowY:d,style:f,...p},m)=>{const{dir:g}=vs();return l?a.jsx("div",{...p,ref:m,style:{...f,...V9({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:g,arrowX:c,arrowY:d})}}):null});sp.displayName="@mantine/core/FloatingArrow";function r_(e,t){if(e==="rtl"&&(t.includes("right")||t.includes("left"))){const[n,r]=t.split("-"),o=n==="right"?"left":"right";return r===void 0?o:`${o}-${r}`}return t}var i_={root:"m_9814e45f"};const F9={zIndex:di("modal")},H9=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:l,zIndex:c})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&Ri(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${le(o)})`:void 0,"--overlay-radius":l===void 0?void 0:Vt(l),"--overlay-z-index":c?.toString()}}),Mc=pr((e,t)=>{const n=ae("Overlay",F9,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,fixed:p,center:m,children:g,radius:y,zIndex:b,gradient:w,blur:j,color:C,backgroundOpacity:T,mod:E,attributes:R,..._}=n,k=Ie({name:"Overlay",props:n,classes:i_,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:H9});return a.jsx(ue,{ref:t,...k("root"),mod:[{center:m,fixed:p},E],..._,children:g})});Mc.classes=i_;Mc.displayName="@mantine/core/Overlay";function xy(e){const t=document.createElement("div");return t.setAttribute("data-portal","true"),typeof e.className=="string"&&t.classList.add(...e.className.split(" ").filter(Boolean)),typeof e.style=="object"&&Object.assign(t.style,e.style),typeof e.id=="string"&&t.setAttribute("id",e.id),t}function q9({target:e,reuseTargetNode:t,...n}){if(e)return typeof e=="string"?document.querySelector(e)||xy(n):e;if(t){const r=document.querySelector("[data-mantine-shared-portal-node]");if(r)return r;const o=xy(n);return o.setAttribute("data-mantine-shared-portal-node","true"),document.body.appendChild(o),o}return xy(n)}const G9={reuseTargetNode:!0},o_=be((e,t)=>{const{children:n,target:r,reuseTargetNode:o,...l}=ae("Portal",G9,e),[c,d]=v.useState(!1),f=v.useRef(null);return qc(()=>(d(!0),f.current=q9({target:r,reuseTargetNode:o,...l}),fd(t,f.current),!r&&!o&&f.current&&document.body.appendChild(f.current),()=>{!r&&!o&&f.current&&document.body.removeChild(f.current)}),[r]),!c||!f.current?null:ab.createPortal(a.jsx(a.Fragment,{children:n}),f.current)});o_.displayName="@mantine/core/Portal";const va=be(({withinPortal:e=!0,children:t,...n},r)=>$p()==="test"||!e?a.jsx(a.Fragment,{children:t}):a.jsx(o_,{ref:r,...n,children:t}));va.displayName="@mantine/core/OptionalPortal";const Ju=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${e==="bottom"?10:-10}px)`},transitionProperty:"transform, opacity"}),Ch={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(30px)"},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-30px)"},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(30px)"},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-30px)"},transitionProperty:"opacity, transform"},scale:{in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:"scale(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-y":{in:{opacity:1,transform:"scaleY(1)"},out:{opacity:0,transform:"scaleY(0)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"scale-x":{in:{opacity:1,transform:"scaleX(1)"},out:{opacity:0,transform:"scaleX(0)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"skew-up":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(-20px) skew(-10deg, -5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"skew-down":{in:{opacity:1,transform:"translateY(0) skew(0deg, 0deg)"},out:{opacity:0,transform:"translateY(20px) skew(-10deg, -5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(-5deg)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:"translateY(20px) rotate(5deg)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(-100%)"},common:{transformOrigin:"top"},transitionProperty:"transform, opacity"},"slide-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:"translateY(100%)"},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"slide-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(100%)"},common:{transformOrigin:"left"},transitionProperty:"transform, opacity"},"slide-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:"translateX(-100%)"},common:{transformOrigin:"right"},transitionProperty:"transform, opacity"},pop:{...Ju("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...Ju("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...Ju("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...Ju("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...Ju("top"),common:{transformOrigin:"top right"}}},yE={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function W9({transition:e,state:t,duration:n,timingFunction:r}){const o={WebkitBackfaceVisibility:"hidden",transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Ch?{transitionProperty:Ch[e].transitionProperty,...o,...Ch[e].common,...Ch[e][yE[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[yE[t]]}}function Q9({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:l,onEntered:c,onExited:d,enterDelay:f,exitDelay:p}){const m=Sn(),g=eb(),y=m.respectReducedMotion?g:!1,[b,w]=v.useState(y?0:e),[j,C]=v.useState(r?"entered":"exited"),T=v.useRef(-1),E=v.useRef(-1),R=v.useRef(-1);function _(){window.clearTimeout(T.current),window.clearTimeout(E.current),cancelAnimationFrame(R.current)}const k=A=>{_();const P=A?o:l,U=A?c:d,B=y?0:A?e:t;w(B),B===0?(typeof P=="function"&&P(),typeof U=="function"&&U(),C(A?"entered":"exited")):R.current=requestAnimationFrame(()=>{od.flushSync(()=>{C(A?"pre-entering":"pre-exiting")}),R.current=requestAnimationFrame(()=>{typeof P=="function"&&P(),C(A?"entering":"exiting"),T.current=window.setTimeout(()=>{typeof U=="function"&&U(),C(A?"entered":"exited")},B)})})},N=A=>{if(_(),typeof(A?f:p)!="number"){k(A);return}E.current=window.setTimeout(()=>{k(A)},A?f:p)};return rl(()=>{N(r)},[r]),v.useEffect(()=>()=>{_()},[]),{transitionDuration:b,transitionStatus:j,transitionTimingFunction:n||"ease"}}function eo({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:l,timingFunction:c="ease",onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y}){const b=$p(),{transitionDuration:w,transitionStatus:j,transitionTimingFunction:C}=Q9({mounted:o,exitDuration:r,duration:n,timingFunction:c,onExit:d,onEntered:f,onEnter:p,onExited:m,enterDelay:g,exitDelay:y});return w===0||b==="test"?o?a.jsx(a.Fragment,{children:l({})}):e?l({display:"none"}):null:j==="exited"?e?l({display:"none"}):null:a.jsx(a.Fragment,{children:l(W9({transition:t,duration:w,state:j,timingFunction:C}))})}eo.displayName="@mantine/core/Transition";const[Y9,a_]=kr("Popover component was not found in the tree");function Qp({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=pM(t),l=In(o,r);return Oo(e)?v.cloneElement(e,{[n]:l}):e}function s_(e){return a.jsx(bb,{tabIndex:-1,"data-autofocus":!0,...e})}Qp.displayName="@mantine/core/FocusTrap";s_.displayName="@mantine/core/FocusTrapInitialFocus";Qp.InitialFocus=s_;var l_={dropdown:"m_38a85659",arrow:"m_a31dc6c1",overlay:"m_3d7bc908"};const Sb=be((e,t)=>{const n=ae("PopoverDropdown",null,e),{className:r,style:o,vars:l,children:c,onKeyDownCapture:d,variant:f,classNames:p,styles:m,...g}=n,y=a_(),b=l2({opened:y.opened,shouldReturnFocus:y.returnFocus}),w=y.withRoles?{"aria-labelledby":y.getTargetId(),id:y.getDropdownId(),role:"dialog",tabIndex:-1}:{},j=In(t,y.floating);return y.disabled?null:a.jsx(va,{...y.portalProps,withinPortal:y.withinPortal,children:a.jsx(eo,{mounted:y.opened,...y.transitionProps,transition:y.transitionProps?.transition||"fade",duration:y.transitionProps?.duration??150,keepMounted:y.keepMounted,exitDuration:typeof y.transitionProps?.exitDuration=="number"?y.transitionProps.exitDuration:y.transitionProps?.duration,children:C=>a.jsx(Qp,{active:y.trapFocus&&y.opened,innerRef:j,children:a.jsxs(ue,{...w,...g,variant:f,onKeyDownCapture:tM(()=>{y.onClose?.(),y.onDismiss?.()},{active:y.closeOnEscape,onTrigger:b,onKeyDown:d}),"data-position":y.placement,"data-fixed":y.floatingStrategy==="fixed"||void 0,...y.getStyles("dropdown",{className:r,props:n,classNames:p,styles:m,style:[{...C,zIndex:y.zIndex,top:y.y??0,left:y.x??0,width:y.width==="target"?void 0:le(y.width),...y.referenceHidden?{display:"none"}:null},y.resolvedStyles.dropdown,m?.dropdown,o]}),children:[c,a.jsx(sp,{ref:y.arrowRef,arrowX:y.arrowX,arrowY:y.arrowY,visible:y.withArrow,position:y.placement,arrowSize:y.arrowSize,arrowRadius:y.arrowRadius,arrowOffset:y.arrowOffset,arrowPosition:y.arrowPosition,...y.getStyles("arrow",{props:n,classNames:p,styles:m})})]})})})})});Sb.classes=l_;Sb.displayName="@mantine/core/PopoverDropdown";const K9={refProp:"ref",popupType:"dialog"},c_=be((e,t)=>{const{children:n,refProp:r,popupType:o,...l}=ae("PopoverTarget",K9,e);if(!Oo(n))throw new Error("Popover.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const c=l,d=a_(),f=In(d.reference,Lp(n),t),p=d.withRoles?{"aria-haspopup":o,"aria-expanded":d.opened,"aria-controls":d.getDropdownId(),id:d.getTargetId()}:{};return v.cloneElement(n,{...c,...p,...d.targetProps,className:$t(d.targetProps.className,c.className,n.props.className),[r]:f,...d.controlled?null:{onClick:()=>{d.onToggle(),n.props.onClick?.()}}})});c_.displayName="@mantine/core/PopoverTarget";function X9(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function J9(e,t,n){const r=X9(e.middlewares),o=[I2(e.offset),l9()];return e.dropdownVisible&&n!=="test"&&e.preventPositionChangeWhenVisible&&(r.flip=!1),r.shift&&o.push(hb(typeof r.shift=="boolean"?{limiter:lE(),padding:5}:{limiter:lE(),padding:5,...r.shift})),r.flip&&o.push(typeof r.flip=="boolean"?ap():ap(r.flip)),r.inline&&o.push(typeof r.inline=="boolean"?ld():ld(r.inline)),o.push(z2({element:e.arrowRef,padding:e.arrowOffset})),(r.size||e.width==="target")&&o.push(s9({...typeof r.size=="boolean"?{}:r.size,apply({rects:l,availableWidth:c,availableHeight:d,...f}){const m=t().refs.floating.current?.style??{};r.size&&(typeof r.size=="object"&&r.size.apply?r.size.apply({rects:l,availableWidth:c,availableHeight:d,...f}):Object.assign(m,{maxWidth:`${c}px`,maxHeight:`${d}px`})),e.width==="target"&&Object.assign(m,{width:`${l.reference.width}px`})}})),o}function Z9(e){const t=$p(),[n,r]=or({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),o=v.useRef(n),l=()=>{n&&!e.disabled&&r(!1)},c=()=>{e.disabled||r(!n)},d=vb({strategy:e.strategy,placement:e.preventPositionChangeWhenVisible?e.positionRef.current:e.position,middleware:J9(e,()=>d,t),whileElementsMounted:e.keepMounted?void 0:cx});return v.useEffect(()=>{if(!(!d.refs.reference.current||!d.refs.floating.current)&&n)return cx(d.refs.reference.current,d.refs.floating.current,d.update)},[n,d.update]),rl(()=>{e.onPositionChange?.(d.placement),e.positionRef.current=d.placement},[d.placement,e.preventPositionChangeWhenVisible]),rl(()=>{n!==o.current&&(n?e.onOpen?.():e.onClose?.()),o.current=n},[n,e.onClose,e.onOpen]),rl(()=>{let f=-1;return n&&(f=window.setTimeout(()=>e.setDropdownVisible(!0),4)),()=>{window.clearTimeout(f)}},[n,e.position]),{floating:d,controlled:typeof e.opened=="boolean",opened:n,onClose:l,onToggle:c}}const eL={position:"bottom",offset:8,positionDependencies:[],transitionProps:{transition:"fade",duration:150},middlewares:{flip:!0,shift:!0,inline:!1},arrowSize:7,arrowOffset:5,arrowRadius:0,arrowPosition:"side",closeOnClickOutside:!0,withinPortal:!0,closeOnEscape:!0,trapFocus:!1,withRoles:!0,returnFocus:!1,withOverlay:!1,hideDetached:!0,clickOutsideEvents:["mousedown","touchstart"],zIndex:di("popover"),__staticSelector:"Popover",width:"max-content"},tL=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:Vt(t),"--popover-shadow":Jx(n)}});function Qr(e){const t=ae("Popover",eL,e),{children:n,position:r,offset:o,onPositionChange:l,positionDependencies:c,opened:d,transitionProps:f,onExitTransitionEnd:p,onEnterTransitionEnd:m,width:g,middlewares:y,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:T,unstyled:E,classNames:R,styles:_,closeOnClickOutside:k,withinPortal:N,portalProps:A,closeOnEscape:P,clickOutsideEvents:U,trapFocus:B,onClose:Y,onDismiss:X,onOpen:te,onChange:$,zIndex:W,radius:L,shadow:I,id:z,defaultOpened:V,__staticSelector:J,withRoles:M,disabled:F,returnFocus:oe,variant:ce,keepMounted:Se,vars:ge,floatingStrategy:Oe,withOverlay:nt,overlayProps:Ce,hideDetached:ht,attributes:st,preventPositionChangeWhenVisible:vt,...rt}=t,wt=Ie({name:J,props:t,classes:l_,classNames:R,styles:_,unstyled:E,attributes:st,rootSelector:"dropdown",vars:ge,varsResolver:tL}),{resolvedStyles:pt}=yl({classNames:R,styles:_,props:t}),[It,Te]=v.useState(d??V??!1),Ee=v.useRef(r),Me=v.useRef(null),[Pe,lt]=v.useState(null),[et,ot]=v.useState(null),{dir:ve}=vs(),pe=$p(),Ne=hr(z),tt=Z9({middlewares:y,width:g,position:r_(ve,r),offset:typeof o=="number"?o+(b?w/2:0):o,arrowRef:Me,arrowOffset:j,onPositionChange:l,positionDependencies:c,opened:d,defaultOpened:V,onChange:$,onOpen:te,onClose:Y,onDismiss:X,strategy:Oe,dropdownVisible:It,setDropdownVisible:Te,positionRef:Ee,disabled:F,preventPositionChangeWhenVisible:vt,keepMounted:Se});oM(()=>{k&&(tt.onClose(),X?.())},U,[Pe,et]);const Tt=v.useCallback(Wn=>{lt(Wn),tt.floating.refs.setReference(Wn)},[tt.floating.refs.setReference]),wn=v.useCallback(Wn=>{ot(Wn),tt.floating.refs.setFloating(Wn)},[tt.floating.refs.setFloating]),hn=v.useCallback(()=>{f?.onExited?.(),p?.(),Te(!1),vt||(Ee.current=r)},[f?.onExited,p,vt,r]),zn=v.useCallback(()=>{f?.onEntered?.(),m?.()},[f?.onEntered,m]);return a.jsxs(Y9,{value:{returnFocus:oe,disabled:F,controlled:tt.controlled,reference:Tt,floating:wn,x:tt.floating.x,y:tt.floating.y,arrowX:tt.floating?.middlewareData?.arrow?.x,arrowY:tt.floating?.middlewareData?.arrow?.y,opened:tt.opened,arrowRef:Me,transitionProps:{...f,onExited:hn,onEntered:zn},width:g,withArrow:b,arrowSize:w,arrowOffset:j,arrowRadius:C,arrowPosition:T,placement:tt.floating.placement,trapFocus:B,withinPortal:N,portalProps:A,zIndex:W,radius:L,shadow:I,closeOnEscape:P,onDismiss:X,onClose:tt.onClose,onToggle:tt.onToggle,getTargetId:()=>`${Ne}-target`,getDropdownId:()=>`${Ne}-dropdown`,withRoles:M,targetProps:rt,__staticSelector:J,classNames:R,styles:_,unstyled:E,variant:ce,keepMounted:Se,getStyles:wt,resolvedStyles:pt,floatingStrategy:Oe,referenceHidden:ht&&pe!=="test"?tt.floating.middlewareData.hide?.referenceHidden:!1},children:[n,nt&&a.jsx(eo,{transition:"fade",mounted:tt.opened,duration:f?.duration||250,exitDuration:f?.exitDuration||250,children:Wn=>a.jsx(va,{withinPortal:N,children:a.jsx(Mc,{...Ce,...wt("overlay",{className:Ce?.className,style:[Wn,Ce?.style]})})})})]})}Qr.Target=c_;Qr.Dropdown=Sb;Qr.displayName="@mantine/core/Popover";Qr.extend=e=>e;var Ki={root:"m_5ae2e3c",barsLoader:"m_7a2bd4cd",bar:"m_870bb79","bars-loader-animation":"m_5d2b3b9d",dotsLoader:"m_4e3f22d7",dot:"m_870c4af","loader-dots-animation":"m_aac34a1",ovalLoader:"m_b34414df","oval-loader-animation":"m_f8e89c4b"};const u_=v.forwardRef(({className:e,...t},n)=>a.jsxs(ue,{component:"span",className:$t(Ki.barsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Ki.bar}),a.jsx("span",{className:Ki.bar}),a.jsx("span",{className:Ki.bar})]}));u_.displayName="@mantine/core/Bars";const d_=v.forwardRef(({className:e,...t},n)=>a.jsxs(ue,{component:"span",className:$t(Ki.dotsLoader,e),...t,ref:n,children:[a.jsx("span",{className:Ki.dot}),a.jsx("span",{className:Ki.dot}),a.jsx("span",{className:Ki.dot})]}));d_.displayName="@mantine/core/Dots";const f_=v.forwardRef(({className:e,...t},n)=>a.jsx(ue,{component:"span",className:$t(Ki.ovalLoader,e),...t,ref:n}));f_.displayName="@mantine/core/Oval";const h_={bars:u_,oval:f_,dots:d_},nL={loaders:h_,type:"oval"},rL=(e,{size:t,color:n})=>({root:{"--loader-size":at(t,"loader-size"),"--loader-color":n?Qt(n,e):void 0}}),Gr=be((e,t)=>{const n=ae("Loader",nL,e),{size:r,color:o,type:l,vars:c,className:d,style:f,classNames:p,styles:m,unstyled:g,loaders:y,variant:b,children:w,attributes:j,...C}=n,T=Ie({name:"Loader",props:n,classes:Ki,className:d,style:f,classNames:p,styles:m,unstyled:g,attributes:j,vars:c,varsResolver:rL});return w?a.jsx(ue,{...T("root"),ref:t,...C,children:w}):a.jsx(ue,{...T("root"),ref:t,component:y[l],variant:b,size:r,...C})});Gr.defaultLoaders=h_;Gr.classes=Ki;Gr.displayName="@mantine/core/Loader";var Yc={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21",groupSection:"m_437b6484"};const xE={orientation:"horizontal"},iL=(e,{borderWidth:t})=>({group:{"--ai-border-width":le(t)}}),wb=be((e,t)=>{const n=ae("ActionIconGroup",xE,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:b,...w}=ae("ActionIconGroup",xE,e),j=Ie({name:"ActionIconGroup",props:n,classes:Yc,className:r,style:o,classNames:l,styles:c,unstyled:d,attributes:b,vars:p,varsResolver:iL,rootSelector:"group"});return a.jsx(ue,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...w})});wb.classes=Yc;wb.displayName="@mantine/core/ActionIconGroup";const oL=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:l,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{groupSection:{"--section-height":at(c,"section-height"),"--section-padding-x":at(c,"section-padding-x"),"--section-fz":Fn(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},jb=be((e,t)=>{const n=ae("ActionIconGroupSection",null,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:b,...w}=n,j=Ie({name:"ActionIconGroupSection",props:n,classes:Yc,className:r,style:o,classNames:l,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:oL,rootSelector:"groupSection"});return a.jsx(ue,{...j("groupSection"),ref:t,variant:p,...w})});jb.classes=Yc;jb.displayName="@mantine/core/ActionIconGroupSection";const aL=(e,{size:t,radius:n,variant:r,gradient:o,color:l,autoContrast:c})=>{const d=e.variantColorResolver({color:l||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ai-size":at(t,"ai-size"),"--ai-radius":n===void 0?void 0:Vt(n),"--ai-bg":l||r?d.background:void 0,"--ai-hover":l||r?d.hover:void 0,"--ai-hover-color":l||r?d.hoverColor:void 0,"--ai-color":d.color,"--ai-bd":l||r?d.border:void 0}}},En=pr((e,t)=>{const n=ae("ActionIcon",null,e),{className:r,unstyled:o,variant:l,classNames:c,styles:d,style:f,loading:p,loaderProps:m,size:g,color:y,radius:b,__staticSelector:w,gradient:j,vars:C,children:T,disabled:E,"data-disabled":R,autoContrast:_,mod:k,attributes:N,...A}=n,P=Ie({name:["ActionIcon",w],props:n,className:r,style:f,classes:Yc,classNames:c,styles:d,unstyled:o,attributes:N,vars:C,varsResolver:aL});return a.jsxs(ar,{...P("root",{active:!E&&!p&&!R}),...A,unstyled:o,variant:l,size:g,disabled:E||p,ref:t,mod:[{loading:p,disabled:E||R},k],children:[typeof p=="boolean"&&a.jsx(eo,{mounted:p,transition:"slide-down",duration:150,children:U=>a.jsx(ue,{component:"span",...P("loader",{style:U}),"aria-hidden":!0,children:a.jsx(Gr,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...m})})}),a.jsx(ue,{component:"span",mod:{loading:p},...P("icon"),children:T})]})});En.classes=Yc;En.displayName="@mantine/core/ActionIcon";En.Group=wb;En.GroupSection=jb;const p_=v.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...t,width:e,height:e},ref:r,...n,children:a.jsx("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:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})}));p_.displayName="@mantine/core/CloseIcon";var m_={root:"m_86a44da5","root--subtle":"m_220c80f2"};const sL={variant:"subtle"},lL=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":at(t,"cb-size"),"--cb-radius":n===void 0?void 0:Vt(n),"--cb-icon-size":le(r)}}),ys=pr((e,t)=>{const n=ae("CloseButton",sL,e),{iconSize:r,children:o,vars:l,radius:c,className:d,classNames:f,style:p,styles:m,unstyled:g,"data-disabled":y,disabled:b,variant:w,icon:j,mod:C,attributes:T,__staticSelector:E,...R}=n,_=Ie({name:E||"CloseButton",props:n,className:d,style:p,classes:m_,classNames:f,styles:m,unstyled:g,attributes:T,vars:l,varsResolver:lL});return a.jsxs(ar,{ref:t,...R,unstyled:g,variant:w,disabled:b,mod:[{disabled:b||y},C],..._("root",{variant:w,active:!b&&!y}),children:[j||a.jsx(p_,{}),o]})});ys.classes=m_;ys.displayName="@mantine/core/CloseButton";function cL(e){return v.Children.toArray(e).filter(Boolean)}var g_={root:"m_4081bf90"};const uL={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},dL=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:l,wrap:c},{childWidth:d})=>({root:{"--group-child-width":t&&n?d:void 0,"--group-gap":Vn(r),"--group-align":o,"--group-justify":l,"--group-wrap":c}}),xe=be((e,t)=>{const n=ae("Group",uL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,children:f,gap:p,align:m,justify:g,wrap:y,grow:b,preventGrowOverflow:w,vars:j,variant:C,__size:T,mod:E,attributes:R,..._}=n,k=cL(f),N=k.length,A=Vn(p??"md"),U={childWidth:`calc(${100/N}% - (${A} - ${A} / ${N}))`},B=Ie({name:"Group",props:n,stylesCtx:U,className:o,style:l,classes:g_,classNames:r,styles:c,unstyled:d,attributes:R,vars:j,varsResolver:dL});return a.jsx(ue,{...B("root"),ref:t,variant:C,mod:[{grow:b},E],size:T,..._,children:k})});xe.classes=g_;xe.displayName="@mantine/core/Group";const[fL,Ea]=kr("ModalBase component was not found in tree");function hL({opened:e,transitionDuration:t}){const[n,r]=v.useState(e),o=v.useRef(-1),c=eb()?0:t;return v.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):c===0?r(!1):o.current=window.setTimeout(()=>r(!1),c),()=>window.clearTimeout(o.current)),[e,c]),n}function pL({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:l,returnFocus:c}){const d=hr(e),[f,p]=v.useState(!1),[m,g]=v.useState(!1),y=typeof t?.duration=="number"?t?.duration:200,b=hL({opened:n,transitionDuration:y});return f2("keydown",w=>{w.key==="Escape"&&o&&!w.isComposing&&n&&w.target?.getAttribute("data-mantine-stop-propagation")!=="true"&&l()},{capture:!0}),l2({opened:n,shouldReturnFocus:r&&c}),{_id:d,titleMounted:f,bodyMounted:m,shouldLockScroll:b,setTitleMounted:p,setBodyMounted:g}}const v_=v.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,onExitTransitionEnd:l,onEnterTransitionEnd:c,trapFocus:d,closeOnEscape:f,returnFocus:p,closeOnClickOutside:m,withinPortal:g,portalProps:y,lockScroll:b,children:w,zIndex:j,shadow:C,padding:T,__vars:E,unstyled:R,removeScrollProps:_,...k},N)=>{const{_id:A,titleMounted:P,bodyMounted:U,shouldLockScroll:B,setTitleMounted:Y,setBodyMounted:X}=pL({id:r,transitionProps:o,opened:t,trapFocus:d,closeOnEscape:f,onClose:n,returnFocus:p}),{key:te,...$}=_||{};return a.jsx(va,{...y,withinPortal:g,children:a.jsx(fL,{value:{opened:t,onClose:n,closeOnClickOutside:m,onExitTransitionEnd:l,onEnterTransitionEnd:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${A}-title`,getBodyId:()=>`${A}-body`,titleMounted:P,bodyMounted:U,setTitleMounted:Y,setBodyMounted:X,trapFocus:d,closeOnEscape:f,zIndex:j,unstyled:R},children:a.jsx(Pc,{enabled:B&&b,...$,children:a.jsx(ue,{ref:N,...k,__vars:{...E,"--mb-z-index":(j||di("modal")).toString(),"--mb-shadow":Jx(C),"--mb-padding":Vn(T)},children:w})},te)})})});v_.displayName="@mantine/core/ModalBase";function mL(){const e=Ea();return v.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Lc={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const y_=v.forwardRef(({className:e,...t},n)=>{const r=mL(),o=Ea();return a.jsx(ue,{ref:n,...t,id:r,className:$t({[Lc.body]:!o.unstyled},e)})});y_.displayName="@mantine/core/ModalBaseBody";const x_=v.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Ea();return a.jsx(ys,{ref:r,...n,onClick:l=>{o.onClose(),t?.(l)},className:$t({[Lc.close]:!o.unstyled},e),unstyled:o.unstyled})});x_.displayName="@mantine/core/ModalBaseCloseButton";const b_=v.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...l},c)=>{const d=Ea();return a.jsx(eo,{mounted:d.opened,transition:"pop",...d.transitionProps,onExited:()=>{d.onExitTransitionEnd?.(),d.transitionProps?.onExited?.()},onEntered:()=>{d.onEnterTransitionEnd?.(),d.transitionProps?.onEntered?.()},...e,children:f=>a.jsx("div",{...n,className:$t({[Lc.inner]:!d.unstyled},n.className),children:a.jsx(Qp,{active:d.opened&&d.trapFocus,innerRef:c,children:a.jsx(Ar,{...l,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":d.bodyMounted?d.getBodyId():void 0,"aria-labelledby":d.titleMounted?d.getTitleId():void 0,style:[o,f],className:$t({[Lc.content]:!d.unstyled},t),unstyled:d.unstyled,children:l.children})})})})});b_.displayName="@mantine/core/ModalBaseContent";const S_=v.forwardRef(({className:e,...t},n)=>{const r=Ea();return a.jsx(ue,{component:"header",ref:n,className:$t({[Lc.header]:!r.unstyled},e),...t})});S_.displayName="@mantine/core/ModalBaseHeader";const gL={duration:200,timingFunction:"ease",transition:"fade"};function vL(e){const t=Ea();return{...gL,...t.transitionProps,...e}}const w_=v.forwardRef(({onClick:e,transitionProps:t,style:n,visible:r,...o},l)=>{const c=Ea(),d=vL(t);return a.jsx(eo,{mounted:r!==void 0?r:c.opened,...d,transition:"fade",children:f=>a.jsx(Mc,{ref:l,fixed:!0,style:[n,f],zIndex:c.zIndex,unstyled:c.unstyled,onClick:p=>{e?.(p),c.closeOnClickOutside&&c.onClose()},...o})})});w_.displayName="@mantine/core/ModalBaseOverlay";function yL(){const e=Ea();return v.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const j_=v.forwardRef(({className:e,...t},n)=>{const r=yL(),o=Ea();return a.jsx(ue,{component:"h2",ref:n,className:$t({[Lc.title]:!o.unstyled},e),...t,id:r})});j_.displayName="@mantine/core/ModalBaseTitle";function xL({children:e}){return a.jsx(a.Fragment,{children:e})}const[bL,SL]=No({size:"sm"}),C_=be((e,t)=>{const n=ae("InputClearButton",null,e),{size:r,variant:o,vars:l,classNames:c,styles:d,...f}=n,p=SL(),{resolvedClassNames:m,resolvedStyles:g}=yl({classNames:c,styles:d,props:n});return a.jsx(ys,{variant:o||"transparent",ref:t,size:r||p?.size||"sm",classNames:m,styles:g,__staticSelector:"InputClearButton",style:{pointerEvents:"all",background:"var(--input-bg)",...f.style},...f})});C_.displayName="@mantine/core/InputClearButton";const wL={xs:7,sm:8,md:10,lg:12,xl:15};function jL({__clearable:e,__clearSection:t,rightSection:n,__defaultRightSection:r,size:o="sm"}){const l=e&&t;return l&&(n||r)?a.jsxs("div",{"data-combined-clear-section":!0,style:{display:"flex",gap:2,alignItems:"center",paddingInlineEnd:wL[o]},children:[l,n||r]}):n===null?null:n||l||r}const[CL,Kc]=No({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Li={wrapper:"m_6c018570",input:"m_8fb7ebe7",section:"m_82577fc2",placeholder:"m_88bacfd0",root:"m_46b77525",label:"m_8fdc1311",required:"m_78a94662",error:"m_8f816625",description:"m_fe47ce59"};const EL=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${Fn(t)} - ${le(2)})`}}),Yp=be((e,t)=>{const n=ae("InputDescription",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,__staticSelector:m,__inheritStyles:g=!0,attributes:y,variant:b,...w}=ae("InputDescription",null,n),j=Kc(),C=Ie({name:["InputWrapper",m],props:n,classes:Li,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:y,rootSelector:"description",vars:f,varsResolver:EL}),T=g&&j?.getStyles||C;return a.jsx(ue,{component:"p",ref:t,variant:b,size:p,...T("description",j?.getStyles?{className:o,style:l}:void 0),...w})});Yp.classes=Li;Yp.displayName="@mantine/core/InputDescription";const TL=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${Fn(t)} - ${le(2)})`}}),Kp=be((e,t)=>{const n=ae("InputError",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,attributes:m,__staticSelector:g,__inheritStyles:y=!0,variant:b,...w}=n,j=Ie({name:["InputWrapper",g],props:n,classes:Li,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:m,rootSelector:"error",vars:f,varsResolver:TL}),C=Kc(),T=y&&C?.getStyles||j;return a.jsx(ue,{component:"p",ref:t,variant:b,size:p,...T("error",C?.getStyles?{className:o,style:l}:void 0),...w})});Kp.classes=Li;Kp.displayName="@mantine/core/InputError";const bE={labelElement:"label"},RL=(e,{size:t})=>({label:{"--input-label-size":Fn(t),"--input-asterisk-color":void 0}}),kd=be((e,t)=>{const n=ae("InputLabel",bE,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,labelElement:p,size:m,required:g,htmlFor:y,onMouseDown:b,children:w,__staticSelector:j,variant:C,mod:T,attributes:E,...R}=ae("InputLabel",bE,n),_=Ie({name:["InputWrapper",j],props:n,classes:Li,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:E,rootSelector:"label",vars:f,varsResolver:RL}),k=Kc(),N=k?.getStyles||_;return a.jsxs(ue,{...N("label",k?.getStyles?{className:o,style:l}:void 0),component:p,variant:C,size:m,ref:t,htmlFor:p==="label"?y:void 0,mod:[{required:g},T],onMouseDown:A=>{b?.(A),!A.defaultPrevented&&A.detail>1&&A.preventDefault()},...R,children:[w,g&&a.jsx("span",{...N("required"),"aria-hidden":!0,children:" *"})]})});kd.classes=Li;kd.displayName="@mantine/core/InputLabel";const Cb=be((e,t)=>{const n=ae("InputPlaceholder",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,__staticSelector:p,variant:m,error:g,mod:y,attributes:b,...w}=n,j=Ie({name:["InputPlaceholder",p],props:n,classes:Li,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:b,rootSelector:"placeholder"});return a.jsx(ue,{...j("placeholder"),mod:[{error:!!g},y],component:"span",variant:m,ref:t,...w})});Cb.classes=Li;Cb.displayName="@mantine/core/InputPlaceholder";function _L(e,{hasDescription:t,hasError:n}){const r=e.findIndex(f=>f==="input"),o=e.slice(0,r),l=e.slice(r+1),c=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&l.includes("description")||n&&l.includes("error"),offsetTop:c}}const DL={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},AL=(e,{size:t})=>({label:{"--input-label-size":Fn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${Fn(t)} - ${le(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${Fn(t)} - ${le(2)})`}}),Pd=be((e,t)=>{const n=ae("InputWrapper",DL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,variant:m,__staticSelector:g,inputContainer:y,inputWrapperOrder:b,label:w,error:j,description:C,labelProps:T,descriptionProps:E,errorProps:R,labelElement:_,children:k,withAsterisk:N,id:A,required:P,__stylesApiProps:U,mod:B,attributes:Y,...X}=n,te=Ie({name:["InputWrapper",g],props:U||n,classes:Li,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:Y,vars:f,varsResolver:AL}),$={size:p,variant:m,__staticSelector:g},W=hr(A),L=typeof N=="boolean"?N:P,I=R?.id||`${W}-error`,z=E?.id||`${W}-description`,V=W,J=!!j&&typeof j!="boolean",M=!!C,F=`${J?I:""} ${M?z:""}`,oe=F.trim().length>0?F.trim():void 0,ce=T?.id||`${W}-label`,Se=w&&a.jsx(kd,{labelElement:_,id:ce,htmlFor:V,required:L,...$,...T,children:w},"label"),ge=M&&a.jsx(Yp,{...E,...$,size:E?.size||$.size,id:E?.id||z,children:C},"description"),Oe=a.jsx(v.Fragment,{children:y(k)},"input"),nt=J&&v.createElement(Kp,{...R,...$,size:R?.size||$.size,key:"error",id:R?.id||I},j),Ce=b.map(ht=>{switch(ht){case"label":return Se;case"input":return Oe;case"description":return ge;case"error":return nt;default:return null}});return a.jsx(CL,{value:{getStyles:te,describedBy:oe,inputId:V,labelId:ce,..._L(b,{hasDescription:M,hasError:J})},children:a.jsx(ue,{ref:t,variant:m,size:p,mod:[{error:!!j},B],...te("root"),...X,children:Ce})})});Pd.classes=Li;Pd.displayName="@mantine/core/InputWrapper";const kL={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0,size:"sm"},PL=(e,t,n)=>({wrapper:{"--input-margin-top":n.offsetTop?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-margin-bottom":n.offsetBottom?"calc(var(--mantine-spacing-xs) / 2)":void 0,"--input-height":at(t.size,"input-height"),"--input-fz":Fn(t.size),"--input-radius":t.radius===void 0?void 0:Vt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?le(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?le(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?at(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),fn=pr((e,t)=>{const n=ae("Input",kL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,required:f,__staticSelector:p,__stylesApiProps:m,size:g,wrapperProps:y,error:b,disabled:w,leftSection:j,leftSectionProps:C,leftSectionWidth:T,rightSection:E,rightSectionProps:R,rightSectionWidth:_,rightSectionPointerEvents:k,leftSectionPointerEvents:N,variant:A,vars:P,pointer:U,multiline:B,radius:Y,id:X,withAria:te,withErrorStyles:$,mod:W,inputSize:L,attributes:I,__clearSection:z,__clearable:V,__defaultRightSection:J,...M}=n,{styleProps:F,rest:oe}=Ca(M),ce=Kc(),Se={offsetBottom:ce?.offsetBottom,offsetTop:ce?.offsetTop},ge=Ie({name:["Input",p],props:m||n,classes:Li,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:I,stylesCtx:Se,rootSelector:"wrapper",vars:P,varsResolver:PL}),Oe=te?{required:f,disabled:w,"aria-invalid":!!b,"aria-describedby":ce?.describedBy,id:ce?.inputId||X}:{},nt=jL({__clearable:V,__clearSection:z,rightSection:E,__defaultRightSection:J,size:g});return a.jsx(bL,{value:{size:g||"sm"},children:a.jsxs(ue,{...ge("wrapper"),...F,...y,mod:[{error:!!b&&$,pointer:U,disabled:w,multiline:B,"data-with-right-section":!!nt,"data-with-left-section":!!j},W],variant:A,size:g,children:[j&&a.jsx("div",{...C,"data-position":"left",...ge("section",{className:C?.className,style:C?.style}),children:j}),a.jsx(ue,{component:"input",...oe,...Oe,ref:t,required:f,mod:{disabled:w,error:!!b&&$},variant:A,__size:L,...ge("input")}),nt&&a.jsx("div",{...R,"data-position":"right",...ge("section",{className:R?.className,style:R?.style}),children:nt})]})})});fn.classes=Li;fn.Wrapper=Pd;fn.Label=kd;fn.Error=Kp;fn.Description=Yp;fn.Placeholder=Cb;fn.ClearButton=C_;fn.displayName="@mantine/core/Input";function OL(e,t,n){const r=ae(e,t,n),{label:o,description:l,error:c,required:d,classNames:f,styles:p,className:m,unstyled:g,__staticSelector:y,__stylesApiProps:b,errorProps:w,labelProps:j,descriptionProps:C,wrapperProps:T,id:E,size:R,style:_,inputContainer:k,inputWrapperOrder:N,withAsterisk:A,variant:P,vars:U,mod:B,attributes:Y,...X}=r,{styleProps:te,rest:$}=Ca(X),W={label:o,description:l,error:c,required:d,classNames:f,className:m,__staticSelector:y,__stylesApiProps:b||r,errorProps:w,labelProps:j,descriptionProps:C,unstyled:g,styles:p,size:R,style:_,inputContainer:k,inputWrapperOrder:N,withAsterisk:A,variant:P,id:E,mod:B,attributes:Y,...T};return{...$,classNames:f,styles:p,unstyled:g,wrapperProps:{...W,...te},inputProps:{required:d,classNames:f,styles:p,unstyled:g,size:R,__staticSelector:y,__stylesApiProps:b||r,error:c,variant:P,id:E,attributes:Y}}}const NL={__staticSelector:"InputBase",withAria:!0,size:"sm"},Pr=pr((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=OL("InputBase",NL,e);return a.jsx(fn.Wrapper,{...r,children:a.jsx(fn,{...n,...o,ref:t})})});Pr.classes={...fn.classes,...fn.Wrapper.classes};Pr.displayName="@mantine/core/InputBase";const ML={gap:{type:"spacing",property:"gap"},rowGap:{type:"spacing",property:"rowGap"},columnGap:{type:"spacing",property:"columnGap"},align:{type:"identity",property:"alignItems"},justify:{type:"identity",property:"justifyContent"},wrap:{type:"identity",property:"flexWrap"},direction:{type:"identity",property:"flexDirection"}};var E_={root:"m_8bffd616"};const _o=pr((e,t)=>{const n=ae("Flex",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:w,direction:j,attributes:C,...T}=n,E=Ie({name:"Flex",classes:E_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:C,vars:f}),R=Sn(),_=Dd(),k=x2({styleProps:{gap:p,rowGap:m,columnGap:g,align:y,justify:b,wrap:w,direction:j},theme:R,data:ML});return a.jsxs(a.Fragment,{children:[k.hasResponsiveStyles&&a.jsx(bl,{selector:`.${_}`,styles:k.styles,media:k.media}),a.jsx(ue,{ref:t,...E("root",{className:_,style:gs(k.inlineStyles)}),...T})]})});_o.classes=E_;_o.displayName="@mantine/core/Flex";function LL(e,t){if(!t||!e)return!1;let n=t.parentNode;for(;n!=null;){if(n===e)return!0;n=n.parentNode}return!1}function IL({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=v.useRef(-1),[l,c]=v.useState(!1),[d,f]=v.useState(typeof r=="boolean"?r:!1),p=()=>{if(!e||!t||!n.current)return;const b=e.getBoundingClientRect(),w=t.getBoundingClientRect(),j=window.getComputedStyle(e),C=window.getComputedStyle(t),T=cs(j.borderTopWidth)+cs(C.borderTopWidth),E=cs(j.borderLeftWidth)+cs(C.borderLeftWidth),R={top:b.top-w.top-T,left:b.left-w.left-E,width:b.width,height:b.height};n.current.style.transform=`translateY(${R.top}px) translateX(${R.left}px)`,n.current.style.width=`${R.width}px`,n.current.style.height=`${R.height}px`},m=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),p(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},g=v.useRef(null),y=v.useRef(null);return v.useEffect(()=>{if(p(),e)return g.current=new ResizeObserver(m),g.current.observe(e),t&&(y.current=new ResizeObserver(m),y.current.observe(t)),()=>{g.current?.disconnect(),y.current?.disconnect()}},[t,e]),v.useEffect(()=>{if(t){const b=w=>{LL(w.target,t)&&(m(),f(!1))};return t.addEventListener("transitionend",b),()=>{t.removeEventListener("transitionend",b)}}},[t]),CM(()=>{h2()!=="test"&&c(!0)},20,{autoInvoke:!0}),EM(b=>{b.forEach(w=>{w.type==="attributes"&&w.attributeName==="dir"&&m()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:l,hidden:d}}var T_={root:"m_96b553a6"};const zL=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Eb=be((e,t)=>{const n=ae("FloatingIndicator",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,target:p,parent:m,transitionDuration:g,mod:y,displayAfterTransitionEnd:b,attributes:w,...j}=n,C=Ie({name:"FloatingIndicator",classes:T_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:w,vars:f,varsResolver:zL}),T=v.useRef(null),{initialized:E,hidden:R}=IL({target:p,parent:m,ref:T,displayAfterTransitionEnd:b}),_=In(t,T);return!p||!m?null:a.jsx(ue,{ref:_,mod:[{initialized:E,hidden:R},y],...C("root"),...j})});Eb.displayName="@mantine/core/FloatingIndicator";Eb.classes=T_;function R_({open:e,close:t,openDelay:n,closeDelay:r}){const o=v.useRef(-1),l=v.useRef(-1),c=()=>{window.clearTimeout(o.current),window.clearTimeout(l.current)},d=()=>{c(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},f=()=>{c(),r===0||r===void 0?t():l.current=window.setTimeout(t,r)};return v.useEffect(()=>c,[]),{openDropdown:d,closeDropdown:f}}function __({style:e,size:t=16,...n}){return a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{...e,width:le(t),height:le(t),display:"block"},...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}__.displayName="@mantine/core/AccordionChevron";var D_={root:"m_66836ed3",wrapper:"m_a5d60502",body:"m_667c2793",title:"m_6a03f287",label:"m_698f4f23",icon:"m_667f2a6a",message:"m_7fa78076",closeButton:"m_87f54839"};const $L=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:Vt(t),"--alert-bg":n||r?l.background:void 0,"--alert-color":l.color,"--alert-bd":n||r?l.border:void 0}}},Ta=be((e,t)=>{const n=ae("Alert",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,radius:p,color:m,title:g,children:y,id:b,icon:w,withCloseButton:j,onClose:C,closeButtonLabel:T,variant:E,autoContrast:R,attributes:_,...k}=n,N=Ie({name:"Alert",classes:D_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:$L}),A=hr(b),P=g&&`${A}-title`||void 0,U=`${A}-body`;return a.jsx(ue,{id:A,...N("root",{variant:E}),variant:E,ref:t,...k,role:"alert","aria-describedby":y?U:void 0,"aria-labelledby":g?P:void 0,children:a.jsxs("div",{...N("wrapper"),children:[w&&a.jsx("div",{...N("icon"),children:w}),a.jsxs("div",{...N("body"),children:[g&&a.jsx("div",{...N("title"),"data-with-close-button":j||void 0,children:a.jsx("span",{id:P,...N("label"),children:g})}),y&&a.jsx("div",{id:U,...N("message"),"data-variant":E,children:y})]}),j&&a.jsx(ys,{...N("closeButton"),onClick:C,variant:"transparent",size:16,iconSize:16,"aria-label":T,unstyled:d})]})})});Ta.classes=D_;Ta.displayName="@mantine/core/Alert";var A_={root:"m_b6d8b162"};function UL(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const BL={inherit:!1},VL=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:l})=>({root:{"--text-fz":Fn(o),"--text-lh":o2(o),"--text-gradient":t==="gradient"?tx(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":l?Qt(l,e):void 0}}),Re=pr((e,t)=>{const n=ae("Text",BL,e),{lineClamp:r,truncate:o,inline:l,inherit:c,gradient:d,span:f,__staticSelector:p,vars:m,className:g,style:y,classNames:b,styles:w,unstyled:j,variant:C,mod:T,size:E,attributes:R,..._}=n,k=Ie({name:["Text",p],props:n,classes:A_,className:g,style:y,classNames:b,styles:w,unstyled:j,attributes:R,vars:m,varsResolver:VL});return a.jsx(ue,{...k("root",{focusable:!0}),ref:t,component:f?"span":"p",variant:C,mod:[{"data-truncate":UL(o),"data-line-clamp":typeof r=="number","data-inline":l,"data-inherit":c},T],size:E,..._})});Re.classes=A_;Re.displayName="@mantine/core/Text";var k_={root:"m_849cf0da"};const FL={underline:"hover"},Mt=pr((e,t)=>{const{underline:n,className:r,unstyled:o,mod:l,...c}=ae("Anchor",FL,e);return a.jsx(Re,{component:"a",ref:t,className:$t({[k_.root]:!o},r),...c,mod:[{underline:n},l],__staticSelector:"Anchor",unstyled:o})});Mt.classes=k_;Mt.displayName="@mantine/core/Anchor";const[HL,Xc]=kr("AppShell was not found in tree");var xs={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const Tb=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ae("AppShellAside",null,e),y=Xc();return y.disabled?null:a.jsx(ue,{component:"aside",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("aside",{className:r,classNames:n,styles:l,style:o}),...g,__vars:{"--app-shell-aside-z-index":`calc(${p??y.zIndex} + 1)`}})});Tb.classes=xs;Tb.displayName="@mantine/core/AppShellAside";const Rb=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ae("AppShellFooter",null,e),y=Xc();return y.disabled?null:a.jsx(ue,{component:"footer",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("footer",{className:$t({[Pc.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:l,style:o}),...g,__vars:{"--app-shell-footer-z-index":(p??y.zIndex)?.toString()}})});Rb.classes=xs;Rb.displayName="@mantine/core/AppShellFooter";const _b=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ae("AppShellHeader",null,e),y=Xc();return y.disabled?null:a.jsx(ue,{component:"header",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("header",{className:$t({[Pc.classNames.zeroRight]:y.offsetScrollbars},r),classNames:n,styles:l,style:o}),...g,__vars:{"--app-shell-header-z-index":(p??y.zIndex)?.toString()}})});_b.classes=xs;_b.displayName="@mantine/core/AppShellHeader";const Db=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("AppShellMain",null,e),f=Xc();return a.jsx(ue,{component:"main",ref:t,...f.getStyles("main",{className:r,style:o,classNames:n,styles:l}),...d})});Db.classes=xs;Db.displayName="@mantine/core/AppShellMain";function Od(e){return typeof e=="object"?e.base:e}function Nd(e){const t=typeof e=="object"&&e!==null&&typeof e.base<"u"&&Object.keys(e).length===1;return typeof e=="number"||typeof e=="string"||t}function Md(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function qL({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){const l=r?.width,c="translateX(var(--app-shell-aside-width))",d="translateX(calc(var(--app-shell-aside-width) * -1))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-aside-width"]="100%",n[r?.breakpoint]["--app-shell-aside-offset"]="0px"),Nd(l)){const f=le(Od(l));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Md(l)&&(typeof l.base<"u"&&(e["--app-shell-aside-width"]=le(l.base),e["--app-shell-aside-offset"]=le(l.base)),ln(l).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=le(l[f]),t[f]["--app-shell-aside-offset"]=le(l[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=c,t[f]["--app-shell-aside-transform-rtl"]=d,t[f]["--app-shell-aside-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=Zx(r.breakpoint,o.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-aside-width"]="100%",n[f]["--app-shell-aside-offset"]="0px",n[f]["--app-shell-aside-transform"]=c,n[f]["--app-shell-aside-transform-rtl"]=d}}function GL({baseStyles:e,minMediaStyles:t,footer:n}){const r=n?.height,o="translateY(var(--app-shell-footer-height))",l=n?.offset??!0;if(Nd(r)){const c=le(Od(r));e["--app-shell-footer-height"]=c,l&&(e["--app-shell-footer-offset"]=c)}Md(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=le(r.base),l&&(e["--app-shell-footer-offset"]=le(r.base))),ln(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-footer-height"]=le(r[c]),l&&(t[c]["--app-shell-footer-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function WL({baseStyles:e,minMediaStyles:t,header:n}){const r=n?.height,o="translateY(calc(var(--app-shell-header-height) * -1))",l=n?.offset??!0;if(Nd(r)){const c=le(Od(r));e["--app-shell-header-height"]=c,l&&(e["--app-shell-header-offset"]=c)}Md(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=le(r.base),l&&(e["--app-shell-header-offset"]=le(r.base))),ln(r).forEach(c=>{c!=="base"&&(t[c]=t[c]||{},t[c]["--app-shell-header-height"]=le(r[c]),l&&(t[c]["--app-shell-header-offset"]=le(r[c])))})),n?.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function QL({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){const l=r?.width,c="translateX(calc(var(--app-shell-navbar-width) * -1))",d="translateX(var(--app-shell-navbar-width))";if(r?.breakpoint&&!r?.collapsed?.mobile&&(n[r?.breakpoint]=n[r?.breakpoint]||{},n[r?.breakpoint]["--app-shell-navbar-width"]="100%",n[r?.breakpoint]["--app-shell-navbar-offset"]="0px"),Nd(l)){const f=le(Od(l));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Md(l)&&(typeof l.base<"u"&&(e["--app-shell-navbar-width"]=le(l.base),e["--app-shell-navbar-offset"]=le(l.base)),ln(l).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=le(l[f]),t[f]["--app-shell-navbar-offset"]=le(l[f]))})),r?.collapsed?.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=c,t[f]["--app-shell-navbar-transform-rtl"]=d,t[f]["--app-shell-navbar-offset"]="0px !important"}if(r?.collapsed?.mobile){const f=Zx(r.breakpoint,o.breakpoints)-.1;n[f]=n[f]||{},n[f]["--app-shell-navbar-width"]="100%",n[f]["--app-shell-navbar-offset"]="0px",n[f]["--app-shell-navbar-transform"]=c,n[f]["--app-shell-navbar-transform-rtl"]=d}}function by(e){return Number(e)===0?"0px":Vn(e)}function YL({padding:e,baseStyles:t,minMediaStyles:n}){Nd(e)&&(t["--app-shell-padding"]=by(Od(e))),Md(e)&&(e.base&&(t["--app-shell-padding"]=by(e.base)),ln(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=by(e[r]))}))}function KL({navbar:e,header:t,footer:n,aside:r,padding:o,theme:l}){const c={},d={},f={};QL({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,navbar:e,theme:l}),qL({baseStyles:f,minMediaStyles:c,maxMediaStyles:d,aside:r,theme:l}),WL({baseStyles:f,minMediaStyles:c,header:t}),GL({baseStyles:f,minMediaStyles:c,footer:n}),YL({baseStyles:f,minMediaStyles:c,padding:o});const p=dd(ln(c),l.breakpoints).map(y=>({query:`(min-width: ${Jh(y.px)})`,styles:c[y.value]})),m=dd(ln(d),l.breakpoints).map(y=>({query:`(max-width: ${Jh(y.px)})`,styles:d[y.value]})),g=[...p,...m];return{baseStyles:f,media:g}}function XL({navbar:e,header:t,aside:n,footer:r,padding:o}){const l=Sn(),c=wa(),{media:d,baseStyles:f}=KL({navbar:e,header:t,footer:r,aside:n,padding:o,theme:l});return a.jsx(bl,{media:d,styles:f,selector:c.cssVariablesSelector})}const Ab=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,unstyled:c,vars:d,withBorder:f,zIndex:p,mod:m,...g}=ae("AppShellNavbar",null,e),y=Xc();return y.disabled?null:a.jsx(ue,{component:"nav",ref:t,mod:[{"with-border":f??y.withBorder},m],...y.getStyles("navbar",{className:r,classNames:n,styles:l,style:o}),...g,__vars:{"--app-shell-navbar-z-index":`calc(${p??y.zIndex} + 1)`}})});Ab.classes=xs;Ab.displayName="@mantine/core/AppShellNavbar";const kb=pr((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,grow:d,mod:f,...p}=ae("AppShellSection",null,e),m=Xc();return a.jsx(ue,{ref:t,mod:[{grow:d},f],...m.getStyles("section",{className:r,style:o,classNames:n,styles:l}),...p})});kb.classes=xs;kb.displayName="@mantine/core/AppShellSection";function JL({transitionDuration:e,disabled:t}){const[n,r]=v.useState(!0),o=v.useRef(-1),l=v.useRef(-1);return f2("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),200)}),qc(()=>{r(!0),clearTimeout(l.current),l.current=window.setTimeout(()=>v.startTransition(()=>{r(!1)}),e||0)},[t,e]),n}const ZL={withBorder:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:di("app")},eI=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),qr=be((e,t)=>{const n=ae("AppShell",ZL,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,navbar:p,withBorder:m,padding:g,transitionDuration:y,transitionTimingFunction:b,header:w,zIndex:j,layout:C,disabled:T,aside:E,footer:R,offsetScrollbars:_=C!=="alt",mod:k,attributes:N,...A}=n,P=Ie({name:"AppShell",classes:xs,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:N,vars:f,varsResolver:eI}),U=JL({disabled:T,transitionDuration:y});return a.jsxs(HL,{value:{getStyles:P,withBorder:m,zIndex:j,disabled:T,offsetScrollbars:_},children:[a.jsx(XL,{navbar:p,header:w,aside:E,footer:R,padding:g}),a.jsx(ue,{ref:t,...P("root"),mod:[{resizing:U,layout:C,disabled:T},k],...A})]})});qr.classes=xs;qr.displayName="@mantine/core/AppShell";qr.Navbar=Ab;qr.Header=_b;qr.Main=Db;qr.Aside=Tb;qr.Footer=Rb;qr.Section=kb;function P_(e){return typeof e=="string"?{value:e,label:e}:"value"in e&&!("label"in e)?{value:e.value,label:e.value,disabled:e.disabled}:typeof e=="number"?{value:e.toString(),label:e.toString()}:"group"in e?{group:e.group,items:e.items.map(t=>P_(t))}:e}function O_(e){return e?e.map(t=>P_(t)):[]}function N_(e){return e.reduce((t,n)=>"group"in n?{...t,...N_(n.items)}:(t[n.value]=n,t),{})}var Wr={dropdown:"m_88b62a41",search:"m_985517d8",options:"m_b2821a6e",option:"m_92253aa5",empty:"m_2530cd1d",header:"m_858f94bd",footer:"m_82b967cb",group:"m_254f3e4f",groupLabel:"m_2bb2e9e5",chevron:"m_2943220b",optionsDropdownOption:"m_390b5f4",optionsDropdownCheckIcon:"m_8ee53fc2"};const tI={error:null},nI=(e,{size:t,color:n})=>({chevron:{"--combobox-chevron-size":at(t,"combobox-chevron-size"),"--combobox-chevron-color":n?Qt(n,e):void 0}}),Xp=be((e,t)=>{const n=ae("ComboboxChevron",tI,e),{size:r,error:o,style:l,className:c,classNames:d,styles:f,unstyled:p,vars:m,mod:g,...y}=n,b=Ie({name:"ComboboxChevron",classes:Wr,props:n,style:l,className:c,classNames:d,styles:f,unstyled:p,vars:m,varsResolver:nI,rootSelector:"chevron"});return a.jsx(ue,{component:"svg",...y,...b("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},g],ref:t,children:a.jsx("path",{d:"M4.93179 5.43179C4.75605 5.60753 4.75605 5.89245 4.93179 6.06819C5.10753 6.24392 5.39245 6.24392 5.56819 6.06819L7.49999 4.13638L9.43179 6.06819C9.60753 6.24392 9.89245 6.24392 10.0682 6.06819C10.2439 5.89245 10.2439 5.60753 10.0682 5.43179L7.81819 3.18179C7.73379 3.0974 7.61933 3.04999 7.49999 3.04999C7.38064 3.04999 7.26618 3.0974 7.18179 3.18179L4.93179 5.43179ZM10.0682 9.56819C10.2439 9.39245 10.2439 9.10753 10.0682 8.93179C9.89245 8.75606 9.60753 8.75606 9.43179 8.93179L7.49999 10.8636L5.56819 8.93179C5.39245 8.75606 5.10753 8.75606 4.93179 8.93179C4.75605 9.10753 4.75605 9.39245 4.93179 9.56819L7.18179 11.8182C7.35753 11.9939 7.64245 11.9939 7.81819 11.8182L10.0682 9.56819Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})});Xp.classes=Wr;Xp.displayName="@mantine/core/ComboboxChevron";const[rI,Ii]=kr("Combobox component was not found in tree"),M_=v.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},l)=>a.jsx(fn.ClearButton,{ref:l,tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:c=>{c.preventDefault(),t?.(c)},onClick:c=>{r(),n?.(c)}}));M_.displayName="@mantine/core/ComboboxClearButton";const Pb=be((e,t)=>{const{classNames:n,styles:r,className:o,style:l,hidden:c,...d}=ae("ComboboxDropdown",null,e),f=Ii();return a.jsx(Qr.Dropdown,{...d,ref:t,role:"presentation","data-hidden":c||void 0,...f.getStyles("dropdown",{className:o,style:l,classNames:n,styles:r})})});Pb.classes=Wr;Pb.displayName="@mantine/core/ComboboxDropdown";const iI={refProp:"ref"},L_=be((e,t)=>{const{children:n,refProp:r}=ae("ComboboxDropdownTarget",iI,e);if(Ii(),!Oo(n))throw new Error("Combobox.DropdownTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return a.jsx(Qr.Target,{ref:t,refProp:r,children:n})});L_.displayName="@mantine/core/ComboboxDropdownTarget";const Ob=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("ComboboxEmpty",null,e),f=Ii();return a.jsx(ue,{ref:t,...f.getStyles("empty",{className:r,classNames:n,styles:l,style:o}),...d})});Ob.classes=Wr;Ob.displayName="@mantine/core/ComboboxEmpty";function Nb({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:l}){const c=Ii(),[d,f]=v.useState(null),p=g=>{if(e?.(g),!c.readOnly&&t){if(g.nativeEvent.isComposing)return;if(g.nativeEvent.code==="ArrowDown"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectNextOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="ArrowUp"&&(g.preventDefault(),c.store.dropdownOpened?f(c.store.selectPreviousOption()):(c.store.openDropdown("keyboard"),f(c.store.selectActiveOption()),c.store.updateSelectedOptionIndex("selected",{scrollIntoView:!0}))),g.nativeEvent.code==="Enter"||g.nativeEvent.code==="NumpadEnter"){if(g.nativeEvent.keyCode===229)return;const y=c.store.getSelectedOptionIndex();c.store.dropdownOpened&&y!==-1?(g.preventDefault(),c.store.clickSelectedOption()):o==="button"&&(g.preventDefault(),c.store.openDropdown("keyboard"))}g.key==="Escape"&&c.store.closeDropdown("keyboard"),g.nativeEvent.code==="Space"&&o==="button"&&(g.preventDefault(),c.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r?!!(c.store.listId&&c.store.dropdownOpened):void 0,"aria-controls":c.store.dropdownOpened&&c.store.listId?c.store.listId:void 0,"aria-activedescendant":c.store.dropdownOpened&&d||void 0,autoComplete:l,"data-expanded":c.store.dropdownOpened||void 0,"data-mantine-stop-propagation":c.store.dropdownOpened||void 0}:{},onKeyDown:p}}const oI={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},I_=be((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:l,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=ae("ComboboxEventsTarget",oI,e);if(!Oo(n))throw new Error("Combobox.EventsTarget component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=Ii(),g=Nb({targetType:d,withAriaAttributes:l,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f});return v.cloneElement(n,{...g,...p,[r]:In(t,m.store.targetRef,Lp(n))})});I_.displayName="@mantine/core/ComboboxEventsTarget";const Mb=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("ComboboxFooter",null,e),f=Ii();return a.jsx(ue,{ref:t,...f.getStyles("footer",{className:r,classNames:n,style:o,styles:l}),...d,onMouseDown:p=>{p.preventDefault()}})});Mb.classes=Wr;Mb.displayName="@mantine/core/ComboboxFooter";const Lb=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,children:d,label:f,id:p,...m}=ae("ComboboxGroup",null,e),g=Ii(),y=hr(p);return a.jsxs(ue,{ref:t,role:"group","aria-labelledby":f?y:void 0,...g.getStyles("group",{className:r,classNames:n,style:o,styles:l}),...m,children:[f&&a.jsx("div",{id:y,...g.getStyles("groupLabel",{classNames:n,styles:l}),children:f}),d]})});Lb.classes=Wr;Lb.displayName="@mantine/core/ComboboxGroup";const Ib=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("ComboboxHeader",null,e),f=Ii();return a.jsx(ue,{ref:t,...f.getStyles("header",{className:r,classNames:n,style:o,styles:l}),...d,onMouseDown:p=>{p.preventDefault()}})});Ib.classes=Wr;Ib.displayName="@mantine/core/ComboboxHeader";function z_({value:e,valuesDivider:t=",",...n}){return a.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}z_.displayName="@mantine/core/ComboboxHiddenInput";const zb=be((e,t)=>{const n=ae("ComboboxOption",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,onClick:f,id:p,active:m,onMouseDown:g,onMouseOver:y,disabled:b,selected:w,mod:j,...C}=n,T=Ii(),E=v.useId(),R=p||E;return a.jsx(ue,{...T.getStyles("option",{className:o,classNames:r,styles:c,style:l}),...C,ref:t,id:R,mod:["combobox-option",{"combobox-active":m,"combobox-disabled":b,"combobox-selected":w},j],role:"option",onClick:_=>{b?_.preventDefault():(T.onOptionSubmit?.(n.value,n),f?.(_))},onMouseDown:_=>{_.preventDefault(),g?.(_)},onMouseOver:_=>{T.resetSelectionOnOptionHover&&T.store.resetSelectedOption(),y?.(_)}})});zb.classes=Wr;zb.displayName="@mantine/core/ComboboxOption";const $b=be((e,t)=>{const n=ae("ComboboxOptions",null,e),{classNames:r,className:o,style:l,styles:c,id:d,onMouseDown:f,labelledBy:p,...m}=n,g=Ii(),y=hr(d);return v.useEffect(()=>{g.store.setListId(y)},[y]),a.jsx(ue,{ref:t,...g.getStyles("options",{className:o,style:l,classNames:r,styles:c}),...m,id:y,role:"listbox","aria-labelledby":p,onMouseDown:b=>{b.preventDefault(),f?.(b)}})});$b.classes=Wr;$b.displayName="@mantine/core/ComboboxOptions";const aI={withAriaAttributes:!0,withKeyboardNavigation:!0},Ub=be((e,t)=>{const n=ae("ComboboxSearch",aI,e),{classNames:r,styles:o,unstyled:l,vars:c,withAriaAttributes:d,onKeyDown:f,withKeyboardNavigation:p,size:m,...g}=n,y=Ii(),b=y.getStyles("search"),w=Nb({targetType:"input",withAriaAttributes:d,withKeyboardNavigation:p,withExpandedAttribute:!1,onKeyDown:f,autoComplete:"off"});return a.jsx(fn,{ref:In(t,y.store.searchRef),classNames:[{input:b.className},r],styles:[{input:b.style},o],size:m||y.size,...w,...g,__staticSelector:"Combobox"})});Ub.classes=Wr;Ub.displayName="@mantine/core/ComboboxSearch";const sI={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},$_=be((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:l,withExpandedAttribute:c,targetType:d,autoComplete:f,...p}=ae("ComboboxTarget",sI,e);if(!Oo(n))throw new Error("Combobox.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const m=Ii(),g=Nb({targetType:d,withAriaAttributes:l,withKeyboardNavigation:o,withExpandedAttribute:c,onKeyDown:n.props.onKeyDown,autoComplete:f}),y=v.cloneElement(n,{...g,...p});return a.jsx(Qr.Target,{ref:In(t,m.store.targetRef),children:y})});$_.displayName="@mantine/core/ComboboxTarget";function lI(e,t,n){for(let r=e-1;r>=0;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=t.length-1;r>-1;r-=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function cI(e,t,n){for(let r=e+1;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r;if(n){for(let r=0;r<t.length;r+=1)if(!t[r].hasAttribute("data-combobox-disabled"))return r}return e}function uI(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Sl({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:l=!0,scrollBehavior:c="instant"}={}){const[d,f]=or({value:t,defaultValue:e,finalValue:!1,onChange:n}),p=v.useRef(null),m=v.useRef(-1),g=v.useRef(null),y=v.useRef(null),b=v.useRef(-1),w=v.useRef(-1),j=v.useRef(-1),C=v.useCallback((L="unknown")=>{d||(f(!0),o?.(L))},[f,o,d]),T=v.useCallback((L="unknown")=>{d&&(f(!1),r?.(L))},[f,r,d]),E=v.useCallback((L="unknown")=>{d?T(L):C(L)},[T,C,d]),R=v.useCallback(()=>{const L=document.querySelector(`#${p.current} [data-combobox-selected]`);L?.removeAttribute("data-combobox-selected"),L?.removeAttribute("aria-selected")},[]),_=v.useCallback(L=>{const z=document.getElementById(p.current)?.querySelectorAll("[data-combobox-option]");if(!z)return null;const V=L>=z.length?0:L<0?z.length-1:L;return m.current=V,z?.[V]&&!z[V].hasAttribute("data-combobox-disabled")?(R(),z[V].setAttribute("data-combobox-selected","true"),z[V].setAttribute("aria-selected","true"),z[V].scrollIntoView({block:"nearest",behavior:c}),z[V].id):null},[c,R]),k=v.useCallback(()=>{const L=document.querySelector(`#${p.current} [data-combobox-active]`);if(L){const I=document.querySelectorAll(`#${p.current} [data-combobox-option]`),z=Array.from(I).findIndex(V=>V===L);return _(z)}return _(0)},[_]),N=v.useCallback(()=>_(cI(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),l)),[_,l]),A=v.useCallback(()=>_(lI(m.current,document.querySelectorAll(`#${p.current} [data-combobox-option]`),l)),[_,l]),P=v.useCallback(()=>_(uI(document.querySelectorAll(`#${p.current} [data-combobox-option]`))),[_]),U=v.useCallback((L="selected",I)=>{j.current=window.setTimeout(()=>{const z=document.querySelectorAll(`#${p.current} [data-combobox-option]`),V=Array.from(z).findIndex(J=>J.hasAttribute(`data-combobox-${L}`));m.current=V,I?.scrollIntoView&&z[V]?.scrollIntoView({block:"nearest",behavior:c})},0)},[]),B=v.useCallback(()=>{m.current=-1,R()},[R]),Y=v.useCallback(()=>{document.querySelectorAll(`#${p.current} [data-combobox-option]`)?.[m.current]?.click()},[]),X=v.useCallback(L=>{p.current=L},[]),te=v.useCallback(()=>{b.current=window.setTimeout(()=>g.current?.focus(),0)},[]),$=v.useCallback(()=>{w.current=window.setTimeout(()=>y.current?.focus(),0)},[]),W=v.useCallback(()=>m.current,[]);return v.useEffect(()=>()=>{window.clearTimeout(b.current),window.clearTimeout(w.current),window.clearTimeout(j.current)},[]),{dropdownOpened:d,openDropdown:C,closeDropdown:T,toggleDropdown:E,selectedOptionIndex:m.current,getSelectedOptionIndex:W,selectOption:_,selectFirstOption:P,selectActiveOption:k,selectNextOption:N,selectPreviousOption:A,resetSelectedOption:B,updateSelectedOptionIndex:U,listId:p.current,setListId:X,clickSelectedOption:Y,searchRef:g,focusSearchInput:te,targetRef:y,focusTarget:$}}const dI={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0},size:"sm"},fI=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":Fn(t),"--combobox-option-padding":at(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:le(n),"--combobox-option-fz":Fn(t),"--combobox-option-padding":at(t,"combobox-option-padding")}});function Ke(e){const t=ae("Combobox",dI,e),{classNames:n,styles:r,unstyled:o,children:l,store:c,vars:d,onOptionSubmit:f,onClose:p,size:m,dropdownPadding:g,resetSelectionOnOptionHover:y,__staticSelector:b,readOnly:w,attributes:j,...C}=t,T=Sl(),E=c||T,R=Ie({name:b||"Combobox",classes:Wr,props:t,classNames:n,styles:r,unstyled:o,attributes:j,vars:d,varsResolver:fI}),_=()=>{p?.(),E.closeDropdown()};return a.jsx(rI,{value:{getStyles:R,store:E,onOptionSubmit:f,size:m,resetSelectionOnOptionHover:y,readOnly:w},children:a.jsx(Qr,{opened:E.dropdownOpened,preventPositionChangeWhenVisible:!0,...C,onChange:k=>!k&&_(),withRoles:!1,unstyled:o,children:l})})}const hI=e=>e;Ke.extend=hI;Ke.classes=Wr;Ke.displayName="@mantine/core/Combobox";Ke.Target=$_;Ke.Dropdown=Pb;Ke.Options=$b;Ke.Option=zb;Ke.Search=Ub;Ke.Empty=Ob;Ke.Chevron=Xp;Ke.Footer=Mb;Ke.Header=Ib;Ke.EventsTarget=I_;Ke.DropdownTarget=L_;Ke.Group=Lb;Ke.ClearButton=M_;Ke.HiddenInput=z_;var U_={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const B_=U_,Jp=v.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:l,children:c,label:d,description:f,id:p,disabled:m,error:g,size:y,labelPosition:b="left",bodyElement:w="div",labelElement:j="label",variant:C,style:T,vars:E,mod:R,attributes:_,...k},N)=>{const A=Ie({name:e,props:t,className:n,style:T,classes:U_,classNames:r,styles:o,unstyled:l,attributes:_});return a.jsx(ue,{...A("root"),ref:N,__vars:{"--label-fz":Fn(y),"--label-lh":at(y,"label-lh")},mod:[{"label-position":b},R],variant:C,size:y,...k,children:a.jsxs(ue,{component:w,htmlFor:w==="label"?p:void 0,...A("body"),children:[c,a.jsxs("div",{...A("labelWrapper"),"data-disabled":m||void 0,children:[d&&a.jsx(ue,{component:j,htmlFor:j==="label"?p:void 0,...A("label"),"data-disabled":m||void 0,children:d}),f&&a.jsx(fn.Description,{size:y,__inheritStyles:!1,...A("description"),children:f}),g&&typeof g!="boolean"&&a.jsx(fn.Error,{size:y,__inheritStyles:!1,...A("error"),children:g})]})]})})});Jp.displayName="@mantine/core/InlineInput";const V_=v.createContext(null),pI=V_.Provider,F_=()=>v.useContext(V_),[mI,gI]=No();var H_={card:"m_26775b0a"};const vI={withBorder:!0},yI=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),Bb=be((e,t)=>{const n=ae("CheckboxCard",vI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,defaultChecked:w,onChange:j,attributes:C,...T}=n,E=Ie({name:"CheckboxCard",classes:H_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:yI,rootSelector:"card"}),R=F_(),_=typeof p=="boolean"?p:R?R.value.includes(y||""):void 0,[k,N]=or({value:_,defaultValue:w,finalValue:!1,onChange:j});return a.jsx(mI,{value:{checked:k},children:a.jsx(ar,{ref:t,mod:[{"with-border":g,checked:k},m],...E("card"),...T,role:"checkbox","aria-checked":k,onClick:A=>{b?.(A),R?.onChange(y||""),N(!k)}})})});Bb.displayName="@mantine/core/CheckboxCard";Bb.classes=H_;function Vb({children:e,role:t}){const n=Kc();return n?a.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):a.jsx(a.Fragment,{children:e})}const Fb=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:l,wrapperProps:c,children:d,readOnly:f,...p}=ae("CheckboxGroup",null,e),[m,g]=or({value:n,defaultValue:r,finalValue:[],onChange:o}),y=b=>{const w=typeof b=="string"?b:b.currentTarget.value;!f&&g(m.includes(w)?m.filter(j=>j!==w):[...m,w])};return a.jsx(pI,{value:{value:m,onChange:y,size:l},children:a.jsx(fn.Wrapper,{size:l,ref:t,...c,...p,labelElement:"div",__staticSelector:"CheckboxGroup",children:a.jsx(Vb,{role:"group",children:d})})})});Fb.classes=fn.Wrapper.classes;Fb.displayName="@mantine/core/CheckboxGroup";function Ld({size:e,style:t,...n}){const r=e!==void 0?{width:le(e),height:le(e),...t}:t;return a.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:a.jsx("path",{d:"M4 4.586L1.707 2.293A1 1 0 1 0 .293 3.707l3 3a.997.997 0 0 0 1.414 0l5-5A1 1 0 1 0 8.293.293L4 4.586z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function q_({indeterminate:e,...t}){return e?a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:a.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):a.jsx(Ld,{...t})}var G_={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const xI={icon:q_,variant:"filled"},bI=(e,{radius:t,color:n,size:r,iconColor:o,variant:l,autoContrast:c})=>{const d=si({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--checkbox-size":at(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":l==="outline"?f:Qt(n,e),"--checkbox-icon-color":o?Qt(o,e):xl(c,e)?ja({color:n,theme:e,autoContrast:c}):void 0}}},Hb=be((e,t)=>{const n=ae("CheckboxIndicator",xI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,icon:p,indeterminate:m,radius:g,color:y,iconColor:b,autoContrast:w,checked:j,mod:C,variant:T,disabled:E,attributes:R,..._}=n,k=Ie({name:"CheckboxIndicator",classes:G_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:R,vars:f,varsResolver:bI,rootSelector:"indicator"}),N=gI(),A=typeof j=="boolean"||typeof m=="boolean"?j||m:N?.checked||!1;return a.jsx(ue,{ref:t,...k("indicator",{variant:T}),variant:T,mod:[{checked:A,disabled:E},C],..._,children:a.jsx(p,{indeterminate:m,...k("icon")})})});Hb.displayName="@mantine/core/CheckboxIndicator";Hb.classes=G_;var W_={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const SI={labelPosition:"right",icon:q_,variant:"filled"},wI=(e,{radius:t,color:n,size:r,iconColor:o,variant:l,autoContrast:c})=>{const d=si({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--checkbox-size":at(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:Vt(t),"--checkbox-color":l==="outline"?f:Qt(n,e),"--checkbox-icon-color":o?Qt(o,e):xl(c,e)?ja({color:n,theme:e,autoContrast:c}):void 0}}},Ln=be((e,t)=>{const n=ae("Checkbox",SI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,label:m,id:g,size:y,radius:b,wrapperProps:w,checked:j,labelPosition:C,description:T,error:E,disabled:R,variant:_,indeterminate:k,icon:N,rootRef:A,iconColor:P,onChange:U,autoContrast:B,mod:Y,attributes:X,...te}=n,$=F_(),W=y||$?.size,L=Ie({name:"Checkbox",props:n,classes:W_,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:X,vars:f,varsResolver:wI}),{styleProps:I,rest:z}=Ca(te),V=hr(g),J=$?{checked:$.value.includes(z.value),onChange:oe=>{$.onChange(oe),U?.(oe)}}:{},M=v.useRef(null),F=t||M;return v.useEffect(()=>{F&&"current"in F&&F.current&&(F.current.indeterminate=k||!1,k?F.current.setAttribute("data-indeterminate","true"):F.current.removeAttribute("data-indeterminate"))},[k,F]),a.jsx(Jp,{...L("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:V,size:W,labelPosition:C,label:m,description:T,error:E,disabled:R,classNames:r,styles:c,unstyled:d,"data-checked":J.checked||j||void 0,variant:_,ref:A,mod:Y,...I,...w,children:a.jsxs(ue,{...L("inner"),mod:{"data-label-position":C},children:[a.jsx(ue,{component:"input",id:V,ref:F,checked:j,disabled:R,mod:{error:!!E},...L("input",{focusable:!0,variant:_}),onChange:U,...z,...J,type:"checkbox"}),a.jsx(N,{indeterminate:k,...L("icon")})]})})});Ln.classes={...W_,...B_};Ln.displayName="@mantine/core/Checkbox";Ln.Group=Fb;Ln.Indicator=Hb;Ln.Card=Bb;function Ic(e){return"group"in e}function Q_({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let l=0;l<e.length;l+=1){const c=e[l];if(o.length===n)return o;Ic(c)&&o.push({group:c.group,items:Q_({options:c.items,search:t,limit:n-o.length})}),Ic(c)||c.label.toLowerCase().includes(r)&&o.push(c)}return o}function jI(e){if(e.length===0)return!0;for(const t of e)if(!("group"in t)||t.items.length>0)return!1;return!0}function Y_(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Ic(n))Y_(n.items,t);else{if(typeof n.value>"u")throw new Error("[@mantine/core] Each option must have value property");if(typeof n.value!="string")throw new Error(`[@mantine/core] Option value must be a string, other data formats are not supported, got ${typeof n.value}`);if(t.has(n.value))throw new Error(`[@mantine/core] Duplicate options are not supported. Option with value "${n.value}" was provided more than once`);t.add(n.value)}}function CI(e,t){return Array.isArray(e)?e.includes(t):e===t}function K_({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:l}){if(!Ic(e)){const d=CI(n,e.value),f=t&&d&&a.jsx(Ld,{className:Wr.optionsDropdownCheckIcon}),p=a.jsxs(a.Fragment,{children:[r==="left"&&f,a.jsx("span",{children:e.label}),r==="right"&&f]});return a.jsx(Ke.Option,{value:e.value,disabled:e.disabled,className:$t({[Wr.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":d||void 0,"aria-selected":d,active:d,children:typeof l=="function"?l({option:e,checked:d}):p})}const c=e.items.map(d=>a.jsx(K_,{data:d,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:l},d.value));return a.jsx(Ke.Group,{label:e.group,children:c})}function EI({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:l,maxDropdownHeight:c,withScrollArea:d=!0,filterOptions:f=!0,withCheckIcon:p=!1,value:m,checkIconPosition:g,nothingFoundMessage:y,unstyled:b,labelId:w,renderOption:j,scrollAreaProps:C,"aria-label":T}){Y_(e);const R=typeof o=="string"?(r||Q_)({options:e,search:f?o:"",limit:l??1/0}):e,_=jI(R),k=R.map(N=>a.jsx(K_,{data:N,withCheckIcon:p,value:m,checkIconPosition:g,unstyled:b,renderOption:j},Ic(N)?N.group:N.value));return a.jsx(Ke.Dropdown,{hidden:t||n&&_,"data-composed":!0,children:a.jsxs(Ke.Options,{labelledBy:w,"aria-label":T,children:[d?a.jsx(fi.Autosize,{mah:c??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...C,children:k}):k,_&&y&&a.jsx(Ke.Empty,{children:y})]})})}const X_=v.createContext(null),TI=X_.Provider;function RI(){return{withinGroup:!!v.useContext(X_)}}var Zp={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const _I=(e,{spacing:t})=>({group:{"--ag-spacing":Vn(t)}}),qb=be((e,t)=>{const n=ae("AvatarGroup",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,spacing:p,attributes:m,...g}=n,y=Ie({name:"AvatarGroup",classes:Zp,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:_I,rootSelector:"group"});return a.jsx(TI,{value:!0,children:a.jsx(ue,{ref:t,...y("group"),...g})})});qb.classes=Zp;qb.displayName="@mantine/core/AvatarGroup";function DI(e){return a.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M0.877014 7.49988C0.877014 3.84219 3.84216 0.877045 7.49985 0.877045C11.1575 0.877045 14.1227 3.84219 14.1227 7.49988C14.1227 11.1575 11.1575 14.1227 7.49985 14.1227C3.84216 14.1227 0.877014 11.1575 0.877014 7.49988ZM7.49985 1.82704C4.36683 1.82704 1.82701 4.36686 1.82701 7.49988C1.82701 8.97196 2.38774 10.3131 3.30727 11.3213C4.19074 9.94119 5.73818 9.02499 7.50023 9.02499C9.26206 9.02499 10.8093 9.94097 11.6929 11.3208C12.6121 10.3127 13.1727 8.97172 13.1727 7.49988C13.1727 4.36686 10.6328 1.82704 7.49985 1.82704ZM10.9818 11.9787C10.2839 10.7795 8.9857 9.97499 7.50023 9.97499C6.01458 9.97499 4.71624 10.7797 4.01845 11.9791C4.97952 12.7272 6.18765 13.1727 7.49985 13.1727C8.81227 13.1727 10.0206 12.727 10.9818 11.9787ZM5.14999 6.50487C5.14999 5.207 6.20212 4.15487 7.49999 4.15487C8.79786 4.15487 9.84999 5.207 9.84999 6.50487C9.84999 7.80274 8.79786 8.85487 7.49999 8.85487C6.20212 8.85487 5.14999 7.80274 5.14999 6.50487ZM7.49999 5.10487C6.72679 5.10487 6.09999 5.73167 6.09999 6.50487C6.09999 7.27807 6.72679 7.90487 7.49999 7.90487C8.27319 7.90487 8.89999 7.27807 8.89999 6.50487C8.89999 5.73167 8.27319 5.10487 7.49999 5.10487Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}function AI(e){let t=0;for(let n=0;n<e.length;n+=1){const r=e.charCodeAt(n);t=(t<<5)-t+r,t|=0}return t}const kI=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function PI(e,t=kI){const n=AI(e),r=Math.abs(n)%t.length;return t[r]}function OI(e,t=2){const n=e.split(" ");return n.length===1?e.slice(0,t).toUpperCase():n.map(r=>r[0]).slice(0,t).join("").toUpperCase()}const NI=(e,{size:t,radius:n,variant:r,gradient:o,color:l,autoContrast:c,name:d,allowedInitialsColors:f})=>{const p=l==="initials"&&typeof d=="string"?PI(d,f):l,m=e.variantColorResolver({color:p||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:c});return{root:{"--avatar-size":at(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:Vt(n),"--avatar-bg":p||r?m.background:void 0,"--avatar-color":p||r?m.color:void 0,"--avatar-bd":p||r?m.border:void 0}}},sl=pr((e,t)=>{const n=ae("Avatar",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,src:p,alt:m,radius:g,color:y,gradient:b,imageProps:w,children:j,autoContrast:C,mod:T,name:E,allowedInitialsColors:R,attributes:_,...k}=n,N=RI(),[A,P]=v.useState(!p),U=Ie({name:"Avatar",props:n,classes:Zp,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:NI});return v.useEffect(()=>P(!p),[p]),a.jsx(ue,{...U("root"),mod:[{"within-group":N.withinGroup},T],ref:t,...k,children:A||!p?a.jsx("span",{...U("placeholder"),title:m,children:j||typeof E=="string"&&OI(E)||a.jsx(DI,{})}):a.jsx("img",{...w,...U("image"),src:p,alt:m,onError:B=>{P(!0),w?.onError?.(B)}})})});sl.classes=Zp;sl.displayName="@mantine/core/Avatar";sl.Group=qb;var J_={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const MI=(e,{radius:t,color:n,gradient:r,variant:o,size:l,autoContrast:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:c});return{root:{"--badge-height":at(l,"badge-height"),"--badge-padding-x":at(l,"badge-padding-x"),"--badge-fz":at(l,"badge-fz"),"--badge-radius":t===void 0?void 0:Vt(t),"--badge-bg":n||o?d.background:void 0,"--badge-color":n||o?d.color:void 0,"--badge-bd":n||o?d.border:void 0,"--badge-dot-color":o==="dot"?Qt(n,e):void 0}}},em=pr((e,t)=>{const n=ae("Badge",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,radius:p,color:m,gradient:g,leftSection:y,rightSection:b,children:w,variant:j,fullWidth:C,autoContrast:T,circle:E,mod:R,attributes:_,...k}=n,N=Ie({name:"Badge",props:n,classes:J_,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:_,vars:f,varsResolver:MI});return a.jsxs(ue,{variant:j,mod:[{block:C,circle:E,"with-right-section":!!b,"with-left-section":!!y},R],...N("root",{variant:j}),ref:t,...k,children:[y&&a.jsx("span",{...N("section"),"data-position":"left",children:y}),a.jsx("span",{...N("label"),children:w}),b&&a.jsx("span",{...N("section"),"data-position":"right",children:b})]})});em.classes=J_;em.displayName="@mantine/core/Badge";var Z_={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const LI={iconSize:48},II=(e,{color:t,iconSize:n,radius:r})=>{const o=si({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),l=si({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":Ri(l.value,.07),"--bq-bg-dark":Ri(o.value,.06),"--bq-bd":Qt(t,e),"--bq-icon-size":le(n),"--bq-radius":Vt(r)}}},Gb=be((e,t)=>{const n=ae("Blockquote",LI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,icon:m,iconSize:g,cite:y,attributes:b,...w}=n,j=Ie({name:"Blockquote",classes:Z_,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:II});return a.jsxs(ue,{component:"blockquote",ref:t,...j("root"),...w,children:[m&&a.jsx("span",{...j("icon"),children:m}),p,y&&a.jsx("cite",{...j("cite"),children:y})]})});Gb.classes=Z_;Gb.displayName="@mantine/core/Blockquote";var Jc={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844",groupSection:"m_70be2a01"};const SE={orientation:"horizontal"},zI=(e,{borderWidth:t})=>({group:{"--button-border-width":le(t)}}),Wb=be((e,t)=>{const n=ae("ButtonGroup",SE,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,orientation:f,vars:p,borderWidth:m,variant:g,mod:y,attributes:b,...w}=ae("ButtonGroup",SE,e),j=Ie({name:"ButtonGroup",props:n,classes:Jc,className:r,style:o,classNames:l,styles:c,unstyled:d,attributes:b,vars:p,varsResolver:zI,rootSelector:"group"});return a.jsx(ue,{...j("group"),ref:t,variant:g,mod:[{"data-orientation":f},y],role:"group",...w})});Wb.classes=Jc;Wb.displayName="@mantine/core/ButtonGroup";const $I=(e,{radius:t,color:n,gradient:r,variant:o,autoContrast:l,size:c})=>{const d=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{groupSection:{"--section-height":at(c,"section-height"),"--section-padding-x":at(c,"section-padding-x"),"--section-fz":c?.includes("compact")?Fn(c.replace("compact-","")):Fn(c),"--section-radius":t===void 0?void 0:Vt(t),"--section-bg":n||o?d.background:void 0,"--section-color":d.color,"--section-bd":n||o?d.border:void 0}}},Qb=be((e,t)=>{const n=ae("ButtonGroupSection",null,e),{className:r,style:o,classNames:l,styles:c,unstyled:d,vars:f,variant:p,gradient:m,radius:g,autoContrast:y,attributes:b,...w}=n,j=Ie({name:"ButtonGroupSection",props:n,classes:Jc,className:r,style:o,classNames:l,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:$I,rootSelector:"groupSection"});return a.jsx(ue,{...j("groupSection"),ref:t,variant:p,...w})});Qb.classes=Jc;Qb.displayName="@mantine/core/ButtonGroupSection";const UI={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${le(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},BI=(e,{radius:t,color:n,gradient:r,variant:o,size:l,justify:c,autoContrast:d})=>{const f=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:d});return{root:{"--button-justify":c,"--button-height":at(l,"button-height"),"--button-padding-x":at(l,"button-padding-x"),"--button-fz":l?.includes("compact")?Fn(l.replace("compact-","")):Fn(l),"--button-radius":t===void 0?void 0:Vt(t),"--button-bg":n||o?f.background:void 0,"--button-hover":n||o?f.hover:void 0,"--button-color":f.color,"--button-bd":n||o?f.border:void 0,"--button-hover-color":n||o?f.hoverColor:void 0}}},Ae=pr((e,t)=>{const n=ae("Button",null,e),{style:r,vars:o,className:l,color:c,disabled:d,children:f,leftSection:p,rightSection:m,fullWidth:g,variant:y,radius:b,loading:w,loaderProps:j,gradient:C,classNames:T,styles:E,unstyled:R,"data-disabled":_,autoContrast:k,mod:N,attributes:A,...P}=n,U=Ie({name:"Button",props:n,classes:Jc,className:l,style:r,classNames:T,styles:E,unstyled:R,attributes:A,vars:o,varsResolver:BI}),B=!!p,Y=!!m;return a.jsxs(ar,{ref:t,...U("root",{active:!d&&!w&&!_}),unstyled:R,variant:y,disabled:d||w,mod:[{disabled:d||_,loading:w,block:g,"with-left-section":B,"with-right-section":Y},N],...P,children:[typeof w=="boolean"&&a.jsx(eo,{mounted:w,transition:UI,duration:150,children:X=>a.jsx(ue,{component:"span",...U("loader",{style:X}),"aria-hidden":!0,children:a.jsx(Gr,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...j})})}),a.jsxs("span",{...U("inner"),children:[p&&a.jsx(ue,{component:"span",...U("section"),mod:{position:"left"},children:p}),a.jsx(ue,{component:"span",mod:{loading:w},...U("label"),children:f}),m&&a.jsx(ue,{component:"span",...U("section"),mod:{position:"right"},children:m})]})]})});Ae.classes=Jc;Ae.displayName="@mantine/core/Button";Ae.Group=Wb;Ae.GroupSection=Qb;var eD={root:"m_4451eb3a"};const fr=pr((e,t)=>{const n=ae("Center",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,inline:p,mod:m,attributes:g,...y}=n,b=Ie({name:"Center",props:n,classes:eD,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:g,vars:f});return a.jsx(ue,{ref:t,mod:[{inline:p},m],...b("root"),...y})});fr.classes=eD;fr.displayName="@mantine/core/Center";const[VI,FI]=No();function tD(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:l}=ae("ChipGroup",null,e),[c,d]=or({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),f=m=>Array.isArray(c)?c.includes(m):m===c,p=m=>{const g=m.currentTarget.value;Array.isArray(c)?d(c.includes(g)?c.filter(y=>y!==g):[...c,g]):d(g)};return a.jsx(VI,{value:{isChipSelected:f,onChange:p,multiple:o},children:l})}tD.displayName="@mantine/core/ChipGroup";var nD={root:"m_f59ffda3",label:"m_be049a53","label--outline":"m_3904c1af","label--filled":"m_fa109255","label--light":"m_f7e165c3",iconWrapper:"m_9ac86df9",checkIcon:"m_d6d72580",input:"m_bde07329"};const HI={type:"checkbox"},qI=(e,{size:t,radius:n,variant:r,color:o,autoContrast:l})=>{const c=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:l});return{root:{"--chip-fz":Fn(t),"--chip-size":at(t,"chip-size"),"--chip-radius":n===void 0?void 0:Vt(n),"--chip-checked-padding":at(t,"chip-checked-padding"),"--chip-padding":at(t,"chip-padding"),"--chip-icon-size":at(t,"chip-icon-size"),"--chip-bg":o||r?c.background:void 0,"--chip-hover":o||r?c.hover:void 0,"--chip-color":o||r?c.color:void 0,"--chip-bd":o||r?c.border:void 0,"--chip-spacing":at(t,"chip-spacing")}}},gd=be((e,t)=>{const n=ae("Chip",HI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,id:p,checked:m,defaultChecked:g,onChange:y,value:b,wrapperProps:w,type:j,disabled:C,children:T,size:E,variant:R,icon:_,rootRef:k,autoContrast:N,mod:A,attributes:P,...U}=n,B=Ie({name:"Chip",classes:nD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:P,vars:f,varsResolver:qI}),Y=FI(),X=hr(p),{styleProps:te,rest:$}=Ca(U),[W,L]=or({value:m,defaultValue:g,finalValue:!1,onChange:y}),I=Y?{checked:Y.isChipSelected(b),onChange:V=>{Y.onChange(V),y?.(V.currentTarget.checked)},type:Y.multiple?"checkbox":"radio"}:{},z=I.checked||W;return a.jsxs(ue,{size:E,variant:R,ref:k,mod:A,...B("root"),...te,...w,children:[a.jsx("input",{type:j,...B("input"),checked:z,onChange:V=>L(V.currentTarget.checked),id:X,disabled:C,ref:t,value:b,...I,...$}),a.jsxs("label",{htmlFor:X,"data-checked":z||void 0,"data-disabled":C||void 0,...B("label",{variant:R||"filled"}),children:[z&&a.jsx("span",{...B("iconWrapper"),children:_===void 0?a.jsx(Ld,{...B("checkIcon")}):_}),a.jsx("span",{children:T})]})]})});gd.classes=nD;gd.displayName="@mantine/core/Chip";gd.Group=tD;var rD={root:"m_b183c0a2"};const GI=(e,{color:t})=>({root:{"--code-bg":t?Qt(t,e):void 0}}),Id=be((e,t)=>{const n=ae("Code",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,block:m,variant:g,mod:y,attributes:b,...w}=n,j=Ie({name:"Code",props:n,classes:rD,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:GI});return a.jsx(ue,{component:m?"pre":"code",variant:g,ref:t,mod:[{block:m},y],...j("root"),...w,dir:"ltr"})});Id.classes=rD;Id.displayName="@mantine/core/Code";var iD={root:"m_7485cace"};const WI=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:at(t,"container-size")}}),zd=be((e,t)=>{const n=ae("Container",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,fluid:p,mod:m,attributes:g,strategy:y,...b}=n,w=Ie({name:"Container",classes:iD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:WI});return a.jsx(ue,{ref:t,mod:[{fluid:p,strategy:y||"block"},m],...w("root"),...b})});zd.classes=iD;zd.displayName="@mantine/core/Container";const QI={timeout:1e3};function Yb(e){const{children:t,timeout:n,value:r,...o}=ae("CopyButton",QI,e),l=a2({timeout:n}),c=()=>l.copy(r);return a.jsx(a.Fragment,{children:t({copy:c,copied:l.copied,...o})})}Yb.displayName="@mantine/core/CopyButton";var oD={root:"m_3eebeb36",label:"m_9e365f20"};const YI={orientation:"horizontal"},KI=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?Qt(t,e):void 0,"--divider-border-style":n,"--divider-size":at(r,"divider-size")}}),vn=be((e,t)=>{const n=ae("Divider",YI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,orientation:m,label:g,labelPosition:y,mod:b,attributes:w,...j}=n,C=Ie({name:"Divider",classes:oD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:w,vars:f,varsResolver:KI});return a.jsx(ue,{ref:t,mod:[{orientation:m,"with-label":!!g},b],...C("root"),...j,role:"separator",children:g&&a.jsx(ue,{component:"span",mod:{position:y},...C("label"),children:g})})});vn.classes=oD;vn.displayName="@mantine/core/Divider";const[wE,aD]=kr("Grid component was not found in tree"),hx=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,jE=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":hx(e,t),CE=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},EE=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function XI({span:e,order:t,offset:n,selector:r}){const o=Sn(),l=aD(),c=l.breakpoints||o.breakpoints,f=Qi(e)===void 0?12:Qi(e),p=gs({"--col-order":Qi(t)?.toString(),"--col-flex-grow":CE(f,l.grow),"--col-flex-basis":hx(f,l.columns),"--col-width":f==="content"?"auto":void 0,"--col-max-width":jE(f,l.columns,l.grow),"--col-offset":EE(Qi(n),l.columns)}),m=ln(c).reduce((b,w)=>(b[w]||(b[w]={}),typeof t=="object"&&t[w]!==void 0&&(b[w]["--col-order"]=t[w]?.toString()),typeof e=="object"&&e[w]!==void 0&&(b[w]["--col-flex-grow"]=CE(e[w],l.grow),b[w]["--col-flex-basis"]=hx(e[w],l.columns),b[w]["--col-width"]=e[w]==="content"?"auto":void 0,b[w]["--col-max-width"]=jE(e[w],l.columns,l.grow)),typeof n=="object"&&n[w]!==void 0&&(b[w]["--col-offset"]=EE(n[w],l.columns)),b),{}),y=dd(ln(m),c).filter(b=>ln(m[b.value]).length>0).map(b=>({query:l.type==="container"?`mantine-grid (min-width: ${c[b.value]})`:`(min-width: ${c[b.value]})`,styles:m[b.value]}));return a.jsx(bl,{styles:p,media:l.type==="container"?void 0:y,container:l.type==="container"?y:void 0,selector:r})}var Kb={container:"m_8478a6da",root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const JI={span:12},Xb=be((e,t)=>{const n=ae("GridCol",JI,e),{classNames:r,className:o,style:l,styles:c,vars:d,span:f,order:p,offset:m,...g}=n,y=aD(),b=Dd();return a.jsxs(a.Fragment,{children:[a.jsx(XI,{selector:`.${b}`,span:f,order:p,offset:m}),a.jsx(ue,{ref:t,...y.getStyles("col",{className:$t(o,b),style:l,classNames:r,styles:c}),...g})]})});Xb.classes=Kb;Xb.displayName="@mantine/core/GridCol";function TE({gutter:e,selector:t,breakpoints:n,type:r}){const o=Sn(),l=n||o.breakpoints,c=gs({"--grid-gutter":Vn(Qi(e))}),d=ln(l).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--grid-gutter"]=Vn(e[g])),m),{}),p=dd(ln(d),l).filter(m=>ln(d[m.value]).length>0).map(m=>({query:r==="container"?`mantine-grid (min-width: ${l[m.value]})`:`(min-width: ${l[m.value]})`,styles:d[m.value]}));return a.jsx(bl,{styles:c,media:r==="container"?void 0:p,container:r==="container"?p:void 0,selector:t})}const ZI={gutter:"md",grow:!1,columns:12},e7=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),br=be((e,t)=>{const n=ae("Grid",ZI,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,grow:p,gutter:m,columns:g,align:y,justify:b,children:w,breakpoints:j,type:C,attributes:T,...E}=n,R=Ie({name:"Grid",classes:Kb,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:e7}),_=Dd();return C==="container"&&j?a.jsxs(wE,{value:{getStyles:R,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(TE,{selector:`.${_}`,...n}),a.jsx("div",{...R("container"),children:a.jsx(ue,{ref:t,...R("root",{className:_}),...E,children:a.jsx("div",{...R("inner"),children:w})})})]}):a.jsxs(wE,{value:{getStyles:R,grow:p,columns:g,breakpoints:j,type:C},children:[a.jsx(TE,{selector:`.${_}`,...n}),a.jsx(ue,{ref:t,...R("root",{className:_}),...E,children:a.jsx("div",{...R("inner"),children:w})})]})});br.classes=Kb;br.displayName="@mantine/core/Grid";br.Col=Xb;function lp(){return lp=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},lp.apply(null,arguments)}function Jb(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}var t7=v.useLayoutEffect,n7=function(t){var n=Dn.useRef(t);return t7(function(){n.current=t}),n},RE=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},r7=function(t,n){var r=Dn.useRef();return Dn.useCallback(function(o){t.current=o,r.current&&RE(r.current,null),r.current=n,n&&RE(n,o)},[n])},_E={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},i7=function(t){Object.keys(_E).forEach(function(n){t.style.setProperty(n,_E[n],"important")})},DE=i7,Tr=null,AE=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function o7(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Tr||(Tr=document.createElement("textarea"),Tr.setAttribute("tabindex","-1"),Tr.setAttribute("aria-hidden","true"),DE(Tr)),Tr.parentNode===null&&document.body.appendChild(Tr);var o=e.paddingSize,l=e.borderSize,c=e.sizingStyle,d=c.boxSizing;Object.keys(c).forEach(function(y){var b=y;Tr.style[b]=c[b]}),DE(Tr),Tr.value=t;var f=AE(Tr,e);Tr.value=t,f=AE(Tr,e),Tr.value="x";var p=Tr.scrollHeight-o,m=p*n;d==="border-box"&&(m=m+o+l),f=Math.max(m,f);var g=p*r;return d==="border-box"&&(g=g+o+l),f=Math.min(g,f),[f,p]}var kE=function(){},a7=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},s7=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],l7=!!document.documentElement.currentStyle,c7=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=a7(s7,n),o=r.boxSizing;if(o==="")return null;l7&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var l=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),c=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:l,borderSize:c}},u7=c7;function Zb(e,t,n){var r=n7(n);v.useLayoutEffect(function(){var o=function(c){return r.current(c)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var d7=function(t,n){Zb(document.body,"reset",function(r){t.current.form===r.target&&n(r)})},f7=function(t){Zb(window,"resize",t)},h7=function(t){Zb(document.fonts,"loadingdone",t)},p7=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],m7=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,l=t.minRows,c=t.onChange,d=c===void 0?kE:c,f=t.onHeightChange,p=f===void 0?kE:f,m=Jb(t,p7),g=m.value!==void 0,y=v.useRef(null),b=r7(y,n),w=v.useRef(0),j=v.useRef(),C=function(){var R=y.current,_=r&&j.current?j.current:u7(R);if(_){j.current=_;var k=o7(_,R.value||R.placeholder||"x",l,o),N=k[0],A=k[1];w.current!==N&&(w.current=N,R.style.setProperty("height",N+"px","important"),p(N,{rowHeight:A}))}},T=function(R){g||C(),d(R)};return v.useLayoutEffect(C),d7(y,function(){if(!g){var E=y.current.value;requestAnimationFrame(function(){var R=y.current;R&&E!==R.value&&C()})}}),f7(C),h7(C),v.createElement("textarea",lp({},m,{onChange:T,ref:b}))},g7=v.forwardRef(m7);const v7={size:"sm"},wl=be((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:l,resize:c,...d}=ae("Textarea",v7,e),f=n&&h2()!=="test",p=f?{maxRows:r,minRows:o}:{};return a.jsx(Pr,{component:f?g7:"textarea",ref:t,...d,__staticSelector:l||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":c},...p})});wl.classes=Pr.classes;wl.displayName="@mantine/core/Textarea";function PE(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const y7={serialize:JSON.stringify,deserialize:JSON.parse,size:"sm"},Zc=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:l,validationError:c,serialize:d,deserialize:f,onFocus:p,onBlur:m,readOnly:g,error:y,...b}=ae("JsonInput",y7,e),[w,j]=or({value:n,defaultValue:r,finalValue:"",onChange:o}),[C,T]=v.useState(PE(w,f)),E=_=>{p?.(_),T(!0)},R=_=>{typeof m=="function"&&m(_);const k=PE(_.currentTarget.value,f);l&&!g&&k&&_.currentTarget.value.trim()!==""&&j(d(f(_.currentTarget.value),null,2)),T(k)};return a.jsx(wl,{value:w,onChange:_=>j(_.currentTarget.value),onFocus:E,onBlur:R,ref:t,readOnly:g,...b,autoComplete:"off",__staticSelector:"JsonInput",error:C?y:c||!0,"data-monospace":!0})});Zc.classes=Pr.classes;Zc.displayName="@mantine/core/JsonInput";const[x7,b7]=kr("List component was not found in tree");var e0={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const t0=be((e,t)=>{const n=ae("ListItem",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,icon:f,children:p,mod:m,...g}=n,y=b7(),b=f||y.icon,w={classNames:r,styles:c};return a.jsx(ue,{...y.getStyles("item",{...w,className:o,style:l}),component:"li",mod:[{"with-icon":!!b,centered:y.center},m],ref:t,...g,children:a.jsxs("div",{...y.getStyles("itemWrapper",w),children:[b&&a.jsx("span",{...y.getStyles("itemIcon",w),children:b}),a.jsx("span",{...y.getStyles("itemLabel",w),children:p})]})})});t0.classes=e0;t0.displayName="@mantine/core/ListItem";const S7={type:"unordered"},w7=(e,{size:t,spacing:n})=>({root:{"--list-fz":Fn(t),"--list-lh":o2(t),"--list-spacing":Vn(n)}}),Dr=be((e,t)=>{const n=ae("List",S7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,type:m,withPadding:g,icon:y,spacing:b,center:w,listStyleType:j,mod:C,attributes:T,...E}=n,R=Ie({name:"List",classes:e0,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:T,vars:f,varsResolver:w7});return a.jsx(x7,{value:{center:w,icon:y,getStyles:R},children:a.jsx(ue,{...R("root",{style:{listStyleType:j}}),component:m==="unordered"?"ul":"ol",mod:[{"with-padding":g,type:j},C],ref:t,...E,children:p})})});Dr.classes=e0;Dr.displayName="@mantine/core/List";Dr.Item=t0;var sD={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const OE={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:di("overlay")},j7=(e,{zIndex:t})=>({root:{"--lo-z-index":t?.toString()}}),tm=be((e,t)=>{const n=ae("LoadingOverlay",OE,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,transitionProps:p,loaderProps:m,overlayProps:g,visible:y,zIndex:b,attributes:w,...j}=n,C=Sn(),T=Ie({name:"LoadingOverlay",classes:sD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:w,vars:f,varsResolver:j7}),E={...OE.overlayProps,...g};return a.jsx(eo,{transition:"fade",...p,mounted:!!y,children:R=>a.jsxs(ue,{...T("root",{style:R}),ref:t,...j,children:[a.jsx(Gr,{...T("loader"),unstyled:d,...m}),a.jsx(Mc,{...E,...T("overlay"),darkHidden:!0,unstyled:d,color:g?.color||C.white}),a.jsx(Mc,{...E,...T("overlay"),lightHidden:!0,unstyled:d,color:g?.color||C.colors.dark[5]})]})})});tm.classes=sD;tm.displayName="@mantine/core/LoadingOverlay";const[C7,bs]=kr("Menu component was not found in the tree");var Ss={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504",chevron:"m_b85b0bed"};const n0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("MenuDivider",null,e),f=bs();return a.jsx(ue,{ref:t,...f.getStyles("divider",{className:r,style:o,styles:l,classNames:n}),...d})});n0.classes=Ss;n0.displayName="@mantine/core/MenuDivider";const r0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=ae("MenuDropdown",null,e),y=v.useRef(null),b=bs(),w=ir(p,T=>{(T.key==="ArrowUp"||T.key==="ArrowDown")&&(T.preventDefault(),y.current?.querySelectorAll("[data-menu-item]:not(:disabled)")[0]?.focus())}),j=ir(d,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.openDropdown()),C=ir(f,()=>(b.trigger==="hover"||b.trigger==="click-hover")&&b.closeDropdown());return a.jsxs(Qr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:In(t,y),...b.getStyles("dropdown",{className:r,style:o,styles:l,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:w,children:[b.withInitialFocusPlaceholder&&a.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),m]})});r0.classes=Ss;r0.displayName="@mantine/core/MenuDropdown";const[E7,nm]=No(),i0=pr((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,color:d,closeMenuOnClick:f,leftSection:p,rightSection:m,children:g,disabled:y,"data-disabled":b,...w}=ae("MenuItem",null,e),j=bs(),C=nm(),T=Sn(),{dir:E}=vs(),R=v.useRef(null),_=w,k=ir(_.onClick,()=>{b||(typeof f=="boolean"?f&&j.closeDropdownImmediately():j.closeOnItemClick&&j.closeDropdownImmediately())}),N=d?T.variantColorResolver({color:d,theme:T,variant:"light"}):void 0,A=d?si({color:d,theme:T}):null,P=ir(_.onKeyDown,U=>{U.key==="ArrowLeft"&&C&&(C.close(),C.focusParentItem())});return a.jsxs(ar,{onMouseDown:U=>U.preventDefault(),...w,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:l,classNames:n}),ref:In(R,t),role:"menuitem",disabled:y,"data-menu-item":!0,"data-disabled":y||b||void 0,"data-mantine-stop-propagation":!0,onClick:k,onKeyDown:Xx({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:E,orientation:"vertical",onKeyDown:P}),__vars:{"--menu-item-color":A?.isThemeColor&&A?.shade===void 0?`var(--mantine-color-${A.color}-6)`:N?.color,"--menu-item-hover":N?.hover},children:[p&&a.jsx("div",{...j.getStyles("itemSection",{styles:l,classNames:n}),"data-position":"left",children:p}),g&&a.jsx("div",{...j.getStyles("itemLabel",{styles:l,classNames:n}),children:g}),m&&a.jsx("div",{...j.getStyles("itemSection",{styles:l,classNames:n}),"data-position":"right",children:m})]})});i0.classes=Ss;i0.displayName="@mantine/core/MenuItem";const o0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,...d}=ae("MenuLabel",null,e),f=bs();return a.jsx(ue,{ref:t,...f.getStyles("label",{className:r,style:o,styles:l,classNames:n}),...d})});o0.classes=Ss;o0.displayName="@mantine/core/MenuLabel";const a0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,onMouseEnter:d,onMouseLeave:f,onKeyDown:p,children:m,...g}=ae("MenuSubDropdown",null,e),y=v.useRef(null),b=bs(),w=nm(),j=ir(d,w?.open),C=ir(f,w?.close);return a.jsx(Qr.Dropdown,{...g,onMouseEnter:j,onMouseLeave:C,role:"menu","aria-orientation":"vertical",ref:In(t,y),...b.getStyles("dropdown",{className:r,style:o,styles:l,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,children:m})});a0.classes=Ss;a0.displayName="@mantine/core/MenuSubDropdown";const s0=pr((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,color:d,leftSection:f,rightSection:p,children:m,disabled:g,"data-disabled":y,closeMenuOnClick:b,...w}=ae("MenuSubItem",null,e),j=bs(),C=nm(),T=Sn(),{dir:E}=vs(),R=v.useRef(null),_=w,k=d?T.variantColorResolver({color:d,theme:T,variant:"light"}):void 0,N=d?si({color:d,theme:T}):null,A=ir(_.onKeyDown,Y=>{Y.key==="ArrowRight"&&(C?.open(),C?.focusFirstItem()),Y.key==="ArrowLeft"&&C?.parentContext&&(C.parentContext.close(),C.parentContext.focusParentItem())}),P=ir(_.onClick,()=>{!y&&b&&j.closeDropdownImmediately()}),U=ir(_.onMouseEnter,C?.open),B=ir(_.onMouseLeave,C?.close);return a.jsxs(ar,{onMouseDown:Y=>Y.preventDefault(),...w,unstyled:j.unstyled,tabIndex:j.menuItemTabIndex,...j.getStyles("item",{className:r,style:o,styles:l,classNames:n}),ref:In(R,t),role:"menuitem",disabled:g,"data-menu-item":!0,"data-sub-menu-item":!0,"data-disabled":g||y||void 0,"data-mantine-stop-propagation":!0,onMouseEnter:U,onMouseLeave:B,onClick:P,onKeyDown:Xx({siblingSelector:"[data-menu-item]:not([data-disabled])",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:j.loop,dir:E,orientation:"vertical",onKeyDown:A}),__vars:{"--menu-item-color":N?.isThemeColor&&N?.shade===void 0?`var(--mantine-color-${N.color}-6)`:k?.color,"--menu-item-hover":k?.hover},children:[f&&a.jsx("div",{...j.getStyles("itemSection",{styles:l,classNames:n}),"data-position":"left",children:f}),m&&a.jsx("div",{...j.getStyles("itemLabel",{styles:l,classNames:n}),children:m}),a.jsx("div",{...j.getStyles("itemSection",{styles:l,classNames:n}),"data-position":"right",children:p||a.jsx(__,{...j.getStyles("chevron"),size:14})})]})});s0.classes=Ss;s0.displayName="@mantine/core/MenuSubItem";function lD({children:e,refProp:t}){if(!Oo(e))throw new Error("Menu.Sub.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");return bs(),a.jsx(Qr.Target,{refProp:t,popupType:"menu",children:e})}lD.displayName="@mantine/core/MenuSubTarget";const T7={offset:0,position:"right-start",transitionProps:{duration:0},middlewares:{shift:{crossAxis:!0}}};function eu(e){const{children:t,closeDelay:n,...r}=ae("MenuSub",T7,e),o=hr(),[l,{open:c,close:d}]=Gc(!1),f=nm(),{openDropdown:p,closeDropdown:m}=R_({open:c,close:d,closeDelay:n,openDelay:0}),g=()=>window.setTimeout(()=>{document.getElementById(`${o}-dropdown`)?.querySelectorAll("[data-menu-item]:not([data-disabled])")[0]?.focus()},16),y=()=>window.setTimeout(()=>{document.getElementById(`${o}-target`)?.focus()},16);return a.jsx(E7,{value:{opened:l,close:m,open:p,focusFirstItem:g,focusParentItem:y,parentContext:f},children:a.jsx(Qr,{opened:l,withinPortal:!1,withArrow:!1,id:o,...r,children:t})})}eu.extend=e=>e;eu.displayName="@mantine/core/MenuSub";eu.Target=lD;eu.Dropdown=a0;eu.Item=s0;const R7={refProp:"ref"},cD=v.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=ae("MenuTarget",R7,e);if(!Oo(n))throw new Error("Menu.Target component children should be an element or a component that accepts ref. Fragments, strings, numbers and other primitive values are not supported");const l=bs(),c=n.props,d=ir(c.onClick,()=>{l.trigger==="click"?l.toggleDropdown():l.trigger==="click-hover"&&(l.setOpenedViaClick(!0),l.opened||l.openDropdown())}),f=ir(c.onMouseEnter,()=>(l.trigger==="hover"||l.trigger==="click-hover")&&l.openDropdown()),p=ir(c.onMouseLeave,()=>{(l.trigger==="hover"||l.trigger==="click-hover"&&!l.openedViaClick)&&l.closeDropdown()});return a.jsx(Qr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:v.cloneElement(n,{onClick:d,onMouseEnter:f,onMouseLeave:p,"data-expanded":l.opened?!0:void 0})})});cD.displayName="@mantine/core/MenuTarget";const _7={trapFocus:!0,closeOnItemClick:!0,withInitialFocusPlaceholder:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function we(e){const t=ae("Menu",_7,e),{children:n,onOpen:r,onClose:o,opened:l,defaultOpened:c,trapFocus:d,onChange:f,closeOnItemClick:p,loop:m,closeOnEscape:g,trigger:y,openDelay:b,closeDelay:w,classNames:j,styles:C,unstyled:T,variant:E,vars:R,menuItemTabIndex:_,keepMounted:k,withInitialFocusPlaceholder:N,attributes:A,...P}=t,U=Ie({name:"Menu",classes:Ss,props:t,classNames:j,styles:C,unstyled:T,attributes:A}),[B,Y]=or({value:l,defaultValue:c,finalValue:!1,onChange:f}),[X,te]=v.useState(!1),$=()=>{Y(!1),te(!1),B&&o?.()},W=()=>{Y(!0),!B&&r?.()},L=()=>{B?$():W()},{openDropdown:I,closeDropdown:z}=R_({open:W,close:$,closeDelay:w,openDelay:b}),V=F=>nM("[data-menu-item]","[data-menu-dropdown]",F),{resolvedClassNames:J,resolvedStyles:M}=yl({classNames:j,styles:C,props:t});return a.jsx(C7,{value:{getStyles:U,opened:B,toggleDropdown:L,getItemIndex:V,openedViaClick:X,setOpenedViaClick:te,closeOnItemClick:p,closeDropdown:y==="click"?$:z,openDropdown:y==="click"?W:I,closeDropdownImmediately:$,loop:m,trigger:y,unstyled:T,menuItemTabIndex:_,withInitialFocusPlaceholder:N},children:a.jsx(Qr,{...P,opened:B,onChange:L,defaultOpened:c,trapFocus:k?!1:d,closeOnEscape:g,__staticSelector:"Menu",classNames:J,styles:M,unstyled:T,variant:E,keepMounted:k,children:n})})}we.extend=e=>e;we.withProps=I4(we);we.classes=Ss;we.displayName="@mantine/core/Menu";we.Item=i0;we.Label=o0;we.Dropdown=r0;we.Target=cD;we.Divider=n0;we.Sub=eu;const[D7,tu]=kr("Modal component was not found in tree");var Ra={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const rm=be((e,t)=>{const n=ae("ModalBody",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=tu();return a.jsx(y_,{ref:t,...p.getStyles("body",{classNames:r,style:l,styles:c,className:o}),...f})});rm.classes=Ra;rm.displayName="@mantine/core/ModalBody";const im=be((e,t)=>{const n=ae("ModalCloseButton",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=tu();return a.jsx(x_,{ref:t,...p.getStyles("close",{classNames:r,style:l,styles:c,className:o}),...f})});im.classes=Ra;im.displayName="@mantine/core/ModalCloseButton";const om=be((e,t)=>{const n=ae("ModalContent",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,children:f,__hidden:p,...m}=n,g=tu(),y=g.scrollAreaComponent||xL;return a.jsx(b_,{...g.getStyles("content",{className:o,style:l,styles:c,classNames:r}),innerProps:g.getStyles("inner",{className:o,style:l,styles:c,classNames:r}),"data-full-screen":g.fullScreen||void 0,"data-modal-content":!0,"data-hidden":p||void 0,ref:t,...m,children:a.jsx(y,{style:{maxHeight:g.fullScreen?"100dvh":`calc(100dvh - (${le(g.yOffset)} * 2))`},children:f})})});om.classes=Ra;om.displayName="@mantine/core/ModalContent";const am=be((e,t)=>{const n=ae("ModalHeader",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=tu();return a.jsx(S_,{ref:t,...p.getStyles("header",{classNames:r,style:l,styles:c,className:o}),...f})});am.classes=Ra;am.displayName="@mantine/core/ModalHeader";const sm=be((e,t)=>{const n=ae("ModalOverlay",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=tu();return a.jsx(w_,{ref:t,...p.getStyles("overlay",{classNames:r,style:l,styles:c,className:o}),...f})});sm.classes=Ra;sm.displayName="@mantine/core/ModalOverlay";const A7={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:di("modal"),transitionProps:{duration:200,transition:"fade-down"},yOffset:"5dvh"},k7=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:Vt(t),"--modal-size":at(n,"modal-size"),"--modal-y-offset":le(r),"--modal-x-offset":le(o)}}),lm=be((e,t)=>{const n=ae("ModalRoot",A7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,yOffset:p,scrollAreaComponent:m,radius:g,fullScreen:y,centered:b,xOffset:w,__staticSelector:j,attributes:C,...T}=n,E=Ie({name:j,classes:Ra,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:k7});return a.jsx(D7,{value:{yOffset:p,scrollAreaComponent:m,getStyles:E,fullScreen:y},children:a.jsx(v_,{ref:t,...E("root"),"data-full-screen":y||void 0,"data-centered":b||void 0,"data-offset-scrollbars":m===fi.Autosize||void 0,unstyled:d,...T})})});lm.classes=Ra;lm.displayName="@mantine/core/ModalRoot";const[P7,O7]=No();function uD({children:e}){const[t,n]=v.useState([]),[r,o]=v.useState(di("modal"));return a.jsx(P7,{value:{stack:t,addModal:(l,c)=>{n(d=>[...new Set([...d,l])]),o(d=>typeof c=="number"&&typeof d=="number"?Math.max(d,c):d)},removeModal:l=>n(c=>c.filter(d=>d!==l)),getZIndex:l=>`calc(${r} + ${t.indexOf(l)} + 1)`,currentId:t[t.length-1],maxZIndex:r},children:e})}uD.displayName="@mantine/core/ModalStack";const cm=be((e,t)=>{const n=ae("ModalTitle",null,e),{classNames:r,className:o,style:l,styles:c,vars:d,...f}=n,p=tu();return a.jsx(j_,{ref:t,...p.getStyles("title",{classNames:r,style:l,styles:c,className:o}),...f})});cm.classes=Ra;cm.displayName="@mantine/core/ModalTitle";const N7={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:di("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Gn=be((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:l,closeButtonProps:c,children:d,radius:f,opened:p,stackId:m,zIndex:g,...y}=ae("Modal",N7,e),b=O7(),w=!!n||l,j=b&&m?{closeOnEscape:b.currentId===m,trapFocus:b.currentId===m,zIndex:b.getZIndex(m)}:{},C=r===!1?!1:m&&b?b.currentId===m:p;return v.useEffect(()=>{b&&m&&(p?b.addModal(m,g||di("modal")):b.removeModal(m))},[p,m,g]),a.jsxs(lm,{ref:t,radius:f,opened:p,zIndex:b&&m?b.getZIndex(m):g,...y,...j,children:[r&&a.jsx(sm,{visible:C,transitionProps:b&&m?{duration:0}:void 0,...o}),a.jsxs(om,{radius:f,__hidden:b&&m&&p?m!==b.currentId:!1,children:[w&&a.jsxs(am,{children:[n&&a.jsx(cm,{children:n}),l&&a.jsx(im,{...c})]}),a.jsx(rm,{children:d})]})]})});Gn.classes=Ra;Gn.displayName="@mantine/core/Modal";Gn.Root=lm;Gn.Overlay=sm;Gn.Content=om;Gn.Body=rm;Gn.Header=am;Gn.Title=cm;Gn.CloseButton=im;Gn.Stack=uD;const[M7,l0]=No(),[L7,I7]=No();var um={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const z7=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?at(t):at(n,"pg-gap")}}),c0=be((e,t)=>{const n=ae("PillGroup",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,disabled:m,attributes:g,...y}=n,w=l0()?.size||p||void 0,j=Ie({name:"PillGroup",classes:um,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:g,vars:f,varsResolver:z7,stylesCtx:{size:w},rootSelector:"group"});return a.jsx(L7,{value:{size:w,disabled:m},children:a.jsx(ue,{ref:t,size:w,...j("group"),...y})})});c0.classes=um;c0.displayName="@mantine/core/PillGroup";const $7={variant:"default"},U7=(e,{radius:t},{size:n})=>({root:{"--pill-fz":at(n,"pill-fz"),"--pill-height":at(n,"pill-height"),"--pill-radius":t===void 0?void 0:Vt(t)}}),ya=be((e,t)=>{const n=ae("Pill",$7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,variant:p,children:m,withRemoveButton:g,onRemove:y,removeButtonProps:b,radius:w,size:j,disabled:C,mod:T,attributes:E,...R}=n,_=I7(),k=l0(),N=j||_?.size||void 0,A=k?.variant==="filled"?"contrast":p||"default",P=Ie({name:"Pill",classes:um,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:U7,stylesCtx:{size:N}});return a.jsxs(ue,{component:"span",ref:t,variant:A,size:N,...P("root",{variant:A}),mod:[{"with-remove":g&&!C,disabled:C||_?.disabled},T],...R,children:[a.jsx("span",{...P("label"),children:m}),g&&a.jsx(ys,{variant:"transparent",radius:w,tabIndex:-1,"aria-hidden":!0,unstyled:d,...b,...P("remove",{className:b?.className,style:b?.style}),onMouseDown:U=>{U.preventDefault(),U.stopPropagation(),b?.onMouseDown?.(U)},onClick:U=>{U.stopPropagation(),y?.(),b?.onClick?.(U)}})]})});ya.classes=um;ya.displayName="@mantine/core/Pill";ya.Group=c0;var dD={field:"m_45c4369d"};const B7={type:"visible"},u0=be((e,t)=>{const n=ae("PillsInputField",B7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,type:p,disabled:m,id:g,pointer:y,mod:b,attributes:w,...j}=n,C=l0(),T=Kc(),E=Ie({name:"PillsInputField",classes:dD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:w,rootSelector:"field"}),R=m||C?.disabled;return a.jsx(ue,{component:"input",ref:In(t,C?.fieldRef),"data-type":p,disabled:R,mod:[{disabled:R,pointer:y},b],...E("field"),...j,id:T?.inputId||g,"aria-invalid":C?.hasError,"aria-describedby":T?.describedBy,type:"text",onMouseDown:_=>!y&&_.stopPropagation()})});u0.classes=dD;u0.displayName="@mantine/core/PillsInputField";const V7={size:"sm"},hs=be((e,t)=>{const n=ae("PillsInput",V7,e),{children:r,onMouseDown:o,onClick:l,size:c,disabled:d,__staticSelector:f,error:p,variant:m,...g}=n,y=v.useRef(null);return a.jsx(M7,{value:{fieldRef:y,size:c,disabled:d,hasError:!!p,variant:m},children:a.jsx(Pr,{size:c,error:p,variant:m,component:"div",ref:t,"data-no-overflow":!0,onMouseDown:b=>{b.preventDefault(),o?.(b),y.current?.focus()},onClick:b=>{b.preventDefault(),b.currentTarget.closest("fieldset")?.disabled||(y.current?.focus(),l?.(b))},...g,multiline:!0,disabled:d,__staticSelector:f||"PillsInput",withAria:!1,children:r})})});hs.displayName="@mantine/core/PillsInput";hs.Field=u0;function F7({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,l)=>(Ic(l)?o.push({group:l.group,items:l.items.filter(c=>n.indexOf(c.value.toLowerCase().trim())===-1)}):n.indexOf(l.value.toLowerCase().trim())===-1&&o.push(l),o),[])}const H7={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:",",clearSearchOnChange:!0,size:"sm"},dm=be((e,t)=>{const n=ae("MultiSelect",H7,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,size:p,value:m,defaultValue:g,onChange:y,onKeyDown:b,variant:w,data:j,dropdownOpened:C,defaultDropdownOpened:T,onDropdownOpen:E,onDropdownClose:R,selectFirstOptionOnChange:_,onOptionSubmit:k,comboboxProps:N,filter:A,limit:P,withScrollArea:U,maxDropdownHeight:B,searchValue:Y,defaultSearchValue:X,onSearchChange:te,readOnly:$,disabled:W,onFocus:L,onBlur:I,radius:z,rightSection:V,rightSectionWidth:J,rightSectionPointerEvents:M,rightSectionProps:F,leftSection:oe,leftSectionWidth:ce,leftSectionPointerEvents:Se,leftSectionProps:ge,inputContainer:Oe,inputWrapperOrder:nt,withAsterisk:Ce,labelProps:ht,descriptionProps:st,errorProps:vt,wrapperProps:rt,description:wt,label:pt,error:It,maxValues:Te,searchable:Ee,nothingFoundMessage:Me,withCheckIcon:Pe,checkIconPosition:lt,hidePickedOptions:et,withErrorStyles:ot,name:ve,form:pe,id:Ne,clearable:tt,clearButtonProps:Tt,hiddenInputProps:wn,placeholder:hn,hiddenInputValuesDivider:zn,required:Wn,mod:$n,renderOption:Rn,onRemove:Zn,onClear:kn,scrollAreaProps:Uo,chevronColor:oo,attributes:Xr,clearSearchOnChange:Bo,...Ui}=n,ao=hr(Ne),Or=O_(j),mr=N_(Or),Bi=v.useRef({}),Qn=Sl({opened:C,defaultOpened:T,onDropdownOpen:E,onDropdownClose:()=>{R?.(),Qn.resetSelectedOption()}}),{styleProps:Vo,rest:{type:kl,autoComplete:Fo,...q}}=Ca(Ui),[Q,ie]=or({value:m,defaultValue:g,finalValue:[],onChange:y}),[je,De]=or({value:Y,defaultValue:X,finalValue:"",onChange:te}),qe=ct=>{De(ct),Qn.resetSelectedOption()},Xe=Ie({name:"MultiSelect",classes:{},props:n,classNames:r,styles:c,unstyled:d,attributes:Xr}),{resolvedClassNames:Ge,resolvedStyles:He}=yl({props:n,styles:c,classNames:r}),Fe=ct=>{b?.(ct),ct.key===" "&&!Ee&&(ct.preventDefault(),Qn.toggleDropdown()),ct.key==="Backspace"&&je.length===0&&Q.length>0&&(Zn?.(Q[Q.length-1]),ie(Q.slice(0,Q.length-1)))},ze=Q.map((ct,Pn)=>{const Ht=mr[ct]||Bi.current[ct];return a.jsx(ya,{withRemoveButton:!$&&!mr[ct]?.disabled,onRemove:()=>{ie(Q.filter(qt=>ct!==qt)),Zn?.(ct)},unstyled:d,disabled:W,...Xe("pill"),children:Ht?.label||ct},`${ct}-${Pn}`)});v.useEffect(()=>{_&&Qn.selectFirstOption()},[_,je]),v.useEffect(()=>{Q.forEach(ct=>{ct in mr&&(Bi.current[ct]=mr[ct])})},[mr,Q]);const We=a.jsx(Ke.ClearButton,{...Tt,onClear:()=>{kn?.(),ie([]),qe("")}}),Ct=F7({data:Or,value:Q}),Xt=tt&&Q.length>0&&!W&&!$;return a.jsxs(a.Fragment,{children:[a.jsxs(Ke,{store:Qn,classNames:Ge,styles:He,unstyled:d,size:p,readOnly:$,__staticSelector:"MultiSelect",attributes:Xr,onOptionSubmit:ct=>{k?.(ct),Bo&&qe(""),Qn.updateSelectedOptionIndex("selected"),Q.includes(mr[ct].value)?(ie(Q.filter(Pn=>Pn!==mr[ct].value)),Zn?.(mr[ct].value)):Q.length<Te&&ie([...Q,mr[ct].value])},...N,children:[a.jsx(Ke.DropdownTarget,{children:a.jsx(hs,{...Vo,__staticSelector:"MultiSelect",classNames:Ge,styles:He,unstyled:d,size:p,className:o,style:l,variant:w,disabled:W,radius:z,__defaultRightSection:a.jsx(Ke.Chevron,{size:p,error:It,unstyled:d,color:oo}),__clearSection:We,__clearable:Xt,rightSection:V,rightSectionPointerEvents:M||"none",rightSectionWidth:J,rightSectionProps:F,leftSection:oe,leftSectionWidth:ce,leftSectionPointerEvents:Se,leftSectionProps:ge,inputContainer:Oe,inputWrapperOrder:nt,withAsterisk:Ce,labelProps:ht,descriptionProps:st,errorProps:vt,wrapperProps:rt,description:wt,label:pt,error:It,withErrorStyles:ot,__stylesApiProps:{...n,rightSectionPointerEvents:M||(Xt?"all":"none"),multiline:!0},pointer:!Ee,onClick:()=>Ee?Qn.openDropdown():Qn.toggleDropdown(),"data-expanded":Qn.dropdownOpened||void 0,id:ao,required:Wn,mod:$n,attributes:Xr,children:a.jsxs(ya.Group,{attributes:Xr,disabled:W,unstyled:d,...Xe("pillsList"),children:[ze,a.jsx(Ke.EventsTarget,{autoComplete:Fo,children:a.jsx(hs.Field,{...q,ref:t,id:ao,placeholder:hn,type:!Ee&&!hn?"hidden":"visible",...Xe("inputField"),unstyled:d,onFocus:ct=>{L?.(ct),Ee&&Qn.openDropdown()},onBlur:ct=>{I?.(ct),Qn.closeDropdown(),qe("")},onKeyDown:Fe,value:je,onChange:ct=>{qe(ct.currentTarget.value),Ee&&Qn.openDropdown(),_&&Qn.selectFirstOption()},disabled:W,readOnly:$||!Ee,pointer:!Ee})})]})})}),a.jsx(EI,{data:et?Ct:Or,hidden:$||W,filter:A,search:je,limit:P,hiddenWhenEmpty:!Me,withScrollArea:U,maxDropdownHeight:B,filterOptions:Ee,value:Q,checkIconPosition:lt,withCheckIcon:Pe,nothingFoundMessage:Me,unstyled:d,labelId:pt?`${ao}-label`:void 0,"aria-label":pt?void 0:Ui["aria-label"],renderOption:Rn,scrollAreaProps:Uo})]}),a.jsx(Ke.HiddenInput,{name:ve,valuesDivider:zn,value:Q,form:pe,disabled:W,...wn})]})});dm.classes={...Pr.classes,...Ke.classes};dm.displayName="@mantine/core/MultiSelect";function q7(e){return"group"in e}function d0({data:e}){if(q7(e)){const o=e.items.map(l=>a.jsx(d0,{data:l},l.value));return a.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return a.jsx("option",{value:e.value,...r,children:e.label},e.value)}d0.displayName="@mantine/core/NativeSelectOption";const G7={rightSectionPointerEvents:"none"},cn=be((e,t)=>{const{data:n,children:r,size:o,error:l,rightSection:c,unstyled:d,...f}=ae("NativeSelect",G7,e),p=O_(n).map((m,g)=>a.jsx(d0,{data:m},g));return a.jsx(Pr,{component:"select",ref:t,...f,__staticSelector:"NativeSelect",size:o,pointer:!0,error:l,unstyled:d,rightSection:c||a.jsx(Xp,{size:o,error:l,unstyled:d}),children:r||p})});cn.classes=Pr.classes;cn.displayName="@mantine/core/NativeSelect";var fD={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const W7={withCloseButton:!0},Q7=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:Vt(t),"--notification-color":n?Qt(n,e):void 0}}),f0=be((e,t)=>{const n=ae("Notification",W7,e),{className:r,color:o,radius:l,loading:c,withCloseButton:d,withBorder:f,title:p,icon:m,children:g,onClose:y,closeButtonProps:b,classNames:w,style:j,styles:C,unstyled:T,variant:E,vars:R,mod:_,loaderProps:k,role:N,attributes:A,...P}=n,U=Ie({name:"Notification",classes:fD,props:n,className:r,style:j,classNames:w,styles:C,unstyled:T,attributes:A,vars:R,varsResolver:Q7});return a.jsxs(ue,{...U("root"),mod:[{"data-with-icon":!!m||c,"data-with-border":f},_],ref:t,variant:E,role:N||"alert",...P,children:[m&&!c&&a.jsx("div",{...U("icon"),children:m}),c&&a.jsx(Gr,{size:28,color:o,...k,...U("loader")}),a.jsxs("div",{...U("body"),children:[p&&a.jsx("div",{...U("title"),children:p}),a.jsx(ue,{...U("description"),mod:{"data-with-title":!!p},children:g})]}),d&&a.jsx(ys,{iconSize:16,color:"gray",...b,unstyled:T,onClick:y,...U("closeButton")})]})});f0.classes=fD;f0.displayName="@mantine/core/Notification";function hD(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);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n}var vd;(function(e){e.event="event",e.props="prop"})(vd||(vd={}));function as(){}function Y7(e){var t,n=void 0;return function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t&&r.length===t.length&&r.every(function(l,c){return l===t[c]})||(t=r,n=e.apply(void 0,r)),n}}function yd(e){return!!(e||"").match(/\d/)}function _c(e){return e==null}function K7(e){return typeof e=="number"&&isNaN(e)}function pD(e){return _c(e)||K7(e)||typeof e=="number"&&!isFinite(e)}function mD(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function X7(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function J7(e,t,n){var r=X7(n),o=e.search(/[1-9]/);return o=o===-1?e.length:o,e.substring(0,o)+e.substring(o,e.length).replace(r,"$1"+t)}function Z7(e){var t=v.useRef(e);t.current=e;var n=v.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function h0(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),l=o[0],c=o[1]||"";return{beforeDecimal:l,afterDecimal:c,hasNegation:n,addNegation:r}}function e6(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",o=n[1]||"";return(t?"-":"")+r+(o?"."+o:"")}function gD(e,t,n){for(var r="",o=n?"0":"",l=0;l<=t-1;l++)r+=e[l]||o;return r}function NE(e,t){return Array(t+1).join(e)}function vD(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],l=r[1];if(l=Number(l),!l)return n+o;o=o.replace(".","");var c=1+l,d=o.length;return c<0?o="0."+NE("0",Math.abs(c))+o:c>=d?o=o+NE("0",c-d):o=(o.substring(0,c)||"0")+"."+o.substring(c),n+o}function ME(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=h0(e),l=o.beforeDecimal,c=o.afterDecimal,d=o.hasNegation,f=parseFloat("0."+(c||"0")),p=c.length<=t?"0."+c:f.toFixed(t),m=p.split("."),g=l;l&&Number(m[0])&&(g=l.split("").reverse().reduce(function(j,C,T){return j.length>T?(Number(j[0])+Number(C)).toString()+j.substring(1,j.length):C+j},m[0]));var y=gD(m[1]||"",t,n),b=d?"-":"",w=r?".":"";return""+b+g+w+y}function Qs(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var yD=Y7(function(e,t){for(var n=0,r=0,o=e.length,l=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[l-1-r]&&l-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:l-r}}}),t6=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function n6(e,t,n){return Math.min(Math.max(e,t),n)}function Sy(e){return Math.max(e.selectionStart,e.selectionEnd)}function r6(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function i6(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function o6(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function a6(e,t,n,r,o,l,c){c===void 0&&(c=o6);var d=o.findIndex(function(_){return _}),f=e.slice(0,d);!t&&!n.startsWith(f)&&(t=f,n=f+n,r=r+f.length);for(var p=n.length,m=e.length,g={},y=new Array(p),b=0;b<p;b++){y[b]=-1;for(var w=0,j=m;w<j;w++){var C=c({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:b,formattedValueIndex:w});if(C&&g[w]!==!0){y[b]=w,g[w]=!0;break}}}for(var T=r;T<p&&(y[T]===-1||!l(n[T]));)T++;var E=T===p||y[T]===-1?m:y[T];for(T=r-1;T>0&&y[T]===-1;)T--;var R=T===-1||y[T]===-1?0:y[T]+1;return R>E?E:r-R<E-r?R:E}function LE(e,t,n,r){var o=e.length;if(t=n6(t,0,o),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=o&&!n[t];)t++;t>o&&(t=n.lastIndexOf(!0))}return t===-1&&(t=o),t}function s6(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(yd(e[n])||yd(e[n-1]));return t}function xD(e,t,n,r,o,l){l===void 0&&(l=as);var c=Z7(function(w,j){var C,T;return pD(w)?(T="",C=""):typeof w=="number"||j?(T=typeof w=="number"?vD(w):w,C=r(T)):(T=o(w,void 0),C=r(T)),{formattedValue:C,numAsString:T}}),d=v.useState(function(){return c(_c(e)?t:e,n)}),f=d[0],p=d[1],m=function(w,j){w.formattedValue!==f.formattedValue&&p({formattedValue:w.formattedValue,numAsString:w.value}),l(w,j)},g=e,y=n;_c(e)&&(g=f.numAsString,y=!0);var b=c(g,y);return v.useMemo(function(){p(b)},[b.formattedValue]),[f,m]}function l6(e){return e.replace(/[^0-9]/g,"")}function c6(e){return e}function u6(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,o=e.renderText,l=e.getInputRef,c=e.format;c===void 0&&(c=c6);var d=e.removeFormatting;d===void 0&&(d=l6);var f=e.defaultValue,p=e.valueIsNumericString,m=e.onValueChange,g=e.isAllowed,y=e.onChange;y===void 0&&(y=as);var b=e.onKeyDown;b===void 0&&(b=as);var w=e.onMouseUp;w===void 0&&(w=as);var j=e.onFocus;j===void 0&&(j=as);var C=e.onBlur;C===void 0&&(C=as);var T=e.value,E=e.getCaretBoundary;E===void 0&&(E=s6);var R=e.isValidInputCharacter;R===void 0&&(R=yd);var _=e.isCharacterSame,k=hD(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),N=xD(T,f,!!p,c,d,m),A=N[0],P=A.formattedValue,U=A.numAsString,B=N[1],Y=v.useRef(),X=v.useRef({formattedValue:P,numAsString:U}),te=function(Te,Ee){X.current={formattedValue:Te.formattedValue,numAsString:Te.value},B(Te,Ee)},$=v.useState(!1),W=$[0],L=$[1],I=v.useRef(null),z=v.useRef({setCaretTimeout:null,focusTimeout:null});v.useEffect(function(){return L(!0),function(){clearTimeout(z.current.setCaretTimeout),clearTimeout(z.current.focusTimeout)}},[]);var V=c,J=function(Te,Ee){var Me=parseFloat(Ee);return{formattedValue:Te,value:Ee,floatValue:isNaN(Me)?void 0:Me}},M=function(Te,Ee,Me){Te.selectionStart===0&&Te.selectionEnd===Te.value.length||(Qs(Te,Ee),z.current.setCaretTimeout=setTimeout(function(){Te.value===Me&&Te.selectionStart!==Ee&&Qs(Te,Ee)},0))},F=function(Te,Ee,Me){return LE(Te,Ee,E(Te),Me)},oe=function(Te,Ee,Me){var Pe=E(Ee),lt=a6(Ee,P,Te,Me,Pe,R,_);return lt=LE(Ee,lt,Pe),lt},ce=function(Te){var Ee=Te.formattedValue;Ee===void 0&&(Ee="");var Me=Te.input,Pe=Te.source,lt=Te.event,et=Te.numAsString,ot;if(Me){var ve=Te.inputValue||Me.value,pe=Sy(Me);Me.value=Ee,ot=oe(ve,Ee,pe),ot!==void 0&&M(Me,ot,Ee)}Ee!==P&&te(J(Ee,et),{event:lt,source:Pe})};v.useEffect(function(){var Te=X.current,Ee=Te.formattedValue,Me=Te.numAsString;(P!==Ee||U!==Me)&&te(J(P,U),{event:void 0,source:vd.props})},[P,U]);var Se=I.current?Sy(I.current):void 0,ge=typeof window<"u"?v.useLayoutEffect:v.useEffect;ge(function(){var Te=I.current;if(P!==X.current.formattedValue&&Te){var Ee=oe(X.current.formattedValue,P,Se);Te.value=P,M(Te,Ee,P)}},[P]);var Oe=function(Te,Ee,Me){var Pe=Ee.target,lt=Y.current?t6(Y.current,Pe.selectionEnd):yD(P,Te),et=Object.assign(Object.assign({},lt),{lastValue:P}),ot=d(Te,et),ve=V(ot);if(ot=d(ve,void 0),g&&!g(J(ve,ot))){var pe=Ee.target,Ne=Sy(pe),tt=oe(Te,P,Ne);return pe.value=P,M(pe,tt,P),!1}return ce({formattedValue:ve,numAsString:ot,inputValue:Te,event:Ee,source:Me,input:Ee.target}),!0},nt=function(Te,Ee){Ee===void 0&&(Ee=0);var Me=Te.selectionStart,Pe=Te.selectionEnd;Y.current={selectionStart:Me,selectionEnd:Pe+Ee}},Ce=function(Te){var Ee=Te.target,Me=Ee.value,Pe=Oe(Me,Te,vd.event);Pe&&y(Te),Y.current=void 0},ht=function(Te){var Ee=Te.target,Me=Te.key,Pe=Ee.selectionStart,lt=Ee.selectionEnd,et=Ee.value;et===void 0&&(et="");var ot;Me==="ArrowLeft"||Me==="Backspace"?ot=Math.max(Pe-1,0):Me==="ArrowRight"?ot=Math.min(Pe+1,et.length):Me==="Delete"&&(ot=Pe);var ve=0;Me==="Delete"&&Pe===lt&&(ve=1);var pe=Me==="ArrowLeft"||Me==="ArrowRight";if(ot===void 0||Pe!==lt&&!pe){b(Te),nt(Ee,ve);return}var Ne=ot;if(pe){var tt=Me==="ArrowLeft"?"left":"right";Ne=F(et,ot,tt),Ne!==ot&&Te.preventDefault()}else Me==="Delete"&&!R(et[ot])?Ne=F(et,ot,"right"):Me==="Backspace"&&!R(et[ot])&&(Ne=F(et,ot,"left"));Ne!==ot&&M(Ee,Ne,et),b(Te),nt(Ee,ve)},st=function(Te){var Ee=Te.target,Me=function(){var Pe=Ee.selectionStart,lt=Ee.selectionEnd,et=Ee.value;if(et===void 0&&(et=""),Pe===lt){var ot=F(et,Pe);ot!==Pe&&M(Ee,ot,et)}};Me(),requestAnimationFrame(function(){Me()}),w(Te),nt(Ee)},vt=function(Te){Te.persist&&Te.persist();var Ee=Te.target,Me=Te.currentTarget;I.current=Ee,z.current.focusTimeout=setTimeout(function(){var Pe=Ee.selectionStart,lt=Ee.selectionEnd,et=Ee.value;et===void 0&&(et="");var ot=F(et,Pe);ot!==Pe&&!(Pe===0&<===et.length)&&M(Ee,ot,et),j(Object.assign(Object.assign({},Te),{currentTarget:Me}))},0)},rt=function(Te){I.current=null,clearTimeout(z.current.focusTimeout),clearTimeout(z.current.setCaretTimeout),C(Te)},wt=W&&r6()?"numeric":void 0,pt=Object.assign({inputMode:wt},k,{type:t,value:P,onChange:Ce,onKeyDown:ht,onMouseUp:st,onFocus:vt,onBlur:rt});if(n==="text")return o?Dn.createElement(Dn.Fragment,null,o(P,k)||null):Dn.createElement("span",Object.assign({},k,{ref:l}),P);if(r){var It=r;return Dn.createElement(It,Object.assign({},pt,{ref:l}))}return Dn.createElement("input",Object.assign({},pt,{ref:l}))}function IE(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var l=t.suffix;l===void 0&&(l="");var c=t.allowNegative,d=t.thousandsGroupStyle;if(d===void 0&&(d="thousand"),e===""||e==="-")return e;var f=fm(t),p=f.thousandSeparator,m=f.decimalSeparator,g=n!==0&&e.indexOf(".")!==-1||n&&r,y=h0(e,c),b=y.beforeDecimal,w=y.afterDecimal,j=y.addNegation;return n!==void 0&&(w=gD(w,n,!!r)),p&&(b=J7(b,p,d)),o&&(b=o+b),l&&(w=w+l),j&&(b="-"+b),e=b+(g&&m||"")+w,e}function fm(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function d6(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),l=r.test(e);return e=e.replace(/-/g,""),o&&!l&&t&&(e="-"+e),e}function f6(e,t){return new RegExp("(^-)|[0-9]|"+mD(e),"g")}function h6(e,t,n){return e===""?!0:!t?.match(/\d/)&&!n?.match(/\d/)&&typeof e=="string"&&!isNaN(Number(e))}function p6(e,t,n){var r;t===void 0&&(t=i6(e));var o=n.allowNegative,l=n.prefix;l===void 0&&(l="");var c=n.suffix;c===void 0&&(c="");var d=n.decimalScale,f=t.from,p=t.to,m=p.start,g=p.end,y=fm(n),b=y.allowedDecimalSeparators,w=y.decimalSeparator,j=e[g]===w;if(yd(e)&&(e===l||e===c)&&t.lastValue==="")return e;if(g-m===1&&b.indexOf(e[m])!==-1){var C=d===0?"":w;e=e.substring(0,m)+C+e.substring(m+1,e.length)}var T=function(I,z,V){var J=!1,M=!1;l.startsWith("-")?J=!1:I.startsWith("--")?(J=!1,M=!0):c.startsWith("-")&&I.length===c.length?J=!1:I[0]==="-"&&(J=!0);var F=J?1:0;return M&&(F=2),F&&(I=I.substring(F),z-=F,V-=F),{value:I,start:z,end:V,hasNegation:J}},E=T(e,m,g),R=E.hasNegation;r=E,e=r.value,m=r.start,g=r.end;var _=T(t.lastValue,f.start,f.end),k=_.start,N=_.end,A=_.value,P=e.substring(m,g);e.length&&A.length&&(k>A.length-c.length||N<l.length)&&!(P&&c.startsWith(P))&&(e=A);var U=0;e.startsWith(l)?U+=l.length:m<l.length&&(U=m),e=e.substring(U),g-=U;var B=e.length,Y=e.length-c.length;e.endsWith(c)?B=Y:(g>Y||g>e.length-c.length)&&(B=g),e=e.substring(0,B),e=d6(R?"-"+e:e,o),e=(e.match(f6(w))||[]).join("");var X=e.indexOf(w);e=e.replace(new RegExp(mD(w),"g"),function(I,z){return z===X?".":""});var te=h0(e,o),$=te.beforeDecimal,W=te.afterDecimal,L=te.addNegation;return p.end-p.start<f.end-f.start&&$===""&&j&&!parseFloat(W)&&(e=L?"-":""),e}function m6(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var o=Array.from({length:e.length+1}).map(function(){return!0}),l=e[0]==="-";o.fill(!1,0,n.length+(l?1:0));var c=e.length;return o.fill(!1,c-r.length+1,c+1),o}function g6(e){var t=fm(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var l=e.allowNegative;if(l===void 0&&(l=!0),n===r)throw new Error(`
|
|
73
|
+
Decimal separator can't be same as thousand separator.
|
|
74
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
75
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
76
|
+
`);return o.startsWith("-")&&l&&(console.error(`
|
|
77
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
78
|
+
prefix: `+o+`
|
|
79
|
+
allowNegative: `+l+`
|
|
80
|
+
`),l=!1),Object.assign(Object.assign({},e),{allowNegative:l})}function v6(e){e=g6(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=as);var l=e.onBlur;l===void 0&&(l=as);var c=e.thousandSeparator,d=e.decimalScale,f=e.fixedDecimalScale,p=e.prefix;p===void 0&&(p="");var m=e.defaultValue,g=e.value,y=e.valueIsNumericString,b=e.onValueChange,w=hD(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),j=fm(e),C=j.decimalSeparator,T=j.allowedDecimalSeparators,E=function(L){return IE(L,e)},R=function(L,I){return p6(L,I,e)},_=_c(g)?m:g,k=y??h6(_,p,t);_c(g)?_c(m)||(k=k||typeof m=="number"):k=k||typeof g=="number";var N=function(L){return pD(L)?L:(typeof L=="number"&&(L=vD(L)),k&&typeof d=="number"?ME(L,d,!!f):L)},A=xD(N(g),N(m),!!k,E,R,b),P=A[0],U=P.numAsString,B=P.formattedValue,Y=A[1],X=function(L){var I=L.target,z=L.key,V=I.selectionStart,J=I.selectionEnd,M=I.value;if(M===void 0&&(M=""),(z==="Backspace"||z==="Delete")&&J<p.length){L.preventDefault();return}if(V!==J){o(L);return}z==="Backspace"&&M[0]==="-"&&V===p.length+1&&n&&Qs(I,1),d&&f&&(z==="Backspace"&&M[V-1]===C?(Qs(I,V-1),L.preventDefault()):z==="Delete"&&M[V]===C&&L.preventDefault()),T?.includes(z)&&M[V]===C&&Qs(I,V+1);var F=c===!0?",":c;z==="Backspace"&&M[V-1]===F&&Qs(I,V-1),z==="Delete"&&M[V]===F&&Qs(I,V+1),o(L)},te=function(L){var I=U;if(I.match(/\d/g)||(I=""),r||(I=e6(I)),f&&d&&(I=ME(I,d,f)),I!==U){var z=IE(I,e);Y({formattedValue:z,value:I,floatValue:parseFloat(I)},{event:L,source:vd.event})}l(L)},$=function(L){return L===C?!0:yd(L)},W=function(L){var I=L.currentValue,z=L.lastValue,V=L.formattedValue,J=L.currentValueIndex,M=L.formattedValueIndex,F=I[J],oe=V[M],ce=yD(z,I),Se=ce.to,ge=function(Oe){return R(Oe).indexOf(".")+p.length};return g===0&&f&&d&&I[Se.start]===C&&ge(I)<J&&ge(V)>M?!1:J>=Se.start&&J<Se.end&&T&&T.includes(F)&&oe===C?!0:F===oe};return Object.assign(Object.assign({},w),{value:B,valueIsNumericString:!1,isValidInputCharacter:$,isCharacterSame:W,onValueChange:Y,format:E,removeFormatting:R,getCaretBoundary:function(L){return m6(L,e)},onKeyDown:X,onBlur:te})}function y6(e){var t=v6(e);return Dn.createElement(u6,Object.assign({},t))}function zE({direction:e,style:t,...n}){return a.jsx("svg",{style:{width:"var(--ni-chevron-size)",height:"var(--ni-chevron-size)",transform:e==="up"?"rotate(180deg)":void 0,...t},viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...n,children:a.jsx("path",{d:"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})})}var px={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const x6=/^(0\.0*|-0(\.0*)?)$/,b6=/^-?0\d+(\.\d+)?\.?$/,S6=/\.\d*0$/;function mx(e){return typeof e=="string"&&e!==""&&!Number.isNaN(Number(e))}function wy(e){return typeof e=="number"?e<Number.MAX_SAFE_INTEGER:e===""||mx(e)&&Number(e)<Number.MAX_SAFE_INTEGER}function w6(e){return e.toString().replace(".","").length}function j6(e,t){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)&&w6(t)<14&&t!==""}function $E(e,t,n){if(e===void 0)return!0;const r=t===void 0||e>=t,o=n===void 0||e<=n;return r&&o}const C6={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},E6=(e,{size:t})=>({controls:{"--ni-chevron-size":at(t,"ni-chevron-size")}});function T6(e,t,n){const r=e.toString().replace(/^0+(?=\d)/,""),o=parseFloat(r);return Number.isNaN(o)?r:o>Number.MAX_SAFE_INTEGER?t!==void 0?t:r:Uh(o,n,t)}const zc=be((e,t)=>{const n=ae("NumberInput",C6,e),{className:r,classNames:o,styles:l,unstyled:c,vars:d,onChange:f,onValueChange:p,value:m,defaultValue:g,max:y,min:b,step:w,hideControls:j,rightSection:C,isAllowed:T,clampBehavior:E,onBlur:R,allowDecimal:_,decimalScale:k,onKeyDown:N,onKeyDownCapture:A,handlersRef:P,startValue:U,disabled:B,rightSectionPointerEvents:Y,allowNegative:X,readOnly:te,size:$,rightSectionWidth:W,stepHoldInterval:L,stepHoldDelay:I,allowLeadingZeros:z,withKeyboardEvents:V,trimLeadingZeroesOnBlur:J,attributes:M,...F}=n,oe=Ie({name:"NumberInput",classes:px,props:n,classNames:o,styles:l,unstyled:c,attributes:M,vars:d,varsResolver:E6}),{resolvedClassNames:ce,resolvedStyles:Se}=yl({classNames:o,styles:l,props:n}),[ge,Oe]=or({value:m,defaultValue:g,finalValue:"",onChange:f}),nt=I!==void 0&&L!==void 0,Ce=v.useRef(null),ht=v.useRef(null),st=v.useRef(0),vt=(pe,Ne)=>{Ne.source==="event"&&Oe(j6(pe.floatValue,pe.value)&&!x6.test(pe.value)&&!(z&&b6.test(pe.value))&&!S6.test(pe.value)?pe.floatValue:pe.value),p?.(pe,Ne)},rt=pe=>{const Ne=String(pe).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ne?Math.max(0,(Ne[1]?Ne[1].length:0)-(Ne[2]?+Ne[2]:0)):0},wt=pe=>{Ce.current&&typeof pe<"u"&&Ce.current.setSelectionRange(pe,pe)},pt=v.useRef(ep);pt.current=()=>{if(!wy(ge))return;let pe;const Ne=rt(ge),tt=rt(w),Tt=Math.max(Ne,tt),wn=10**Tt;if(!mx(ge)&&(typeof ge!="number"||Number.isNaN(ge)))pe=Uh(U,b,y);else if(y!==void 0){const zn=(Math.round(Number(ge)*wn)+Math.round(w*wn))/wn;pe=zn<=y?zn:y}else pe=(Math.round(Number(ge)*wn)+Math.round(w*wn))/wn;const hn=pe.toFixed(Tt);Oe(parseFloat(hn)),p?.({floatValue:parseFloat(hn),formattedValue:hn,value:hn},{source:"increment"}),setTimeout(()=>wt(Ce.current?.value.length),0)};const It=v.useRef(ep);It.current=()=>{if(!wy(ge))return;let pe;const Ne=b!==void 0?b:X?Number.MIN_SAFE_INTEGER:0,tt=rt(ge),Tt=rt(w),wn=Math.max(tt,Tt),hn=10**wn;if(!mx(ge)&&typeof ge!="number"||Number.isNaN(ge))pe=Uh(U,Ne,y);else{const Wn=(Math.round(Number(ge)*hn)-Math.round(w*hn))/hn;pe=Ne!==void 0&&Wn<Ne?Ne:Wn}const zn=pe.toFixed(wn);Oe(parseFloat(zn)),p?.({floatValue:parseFloat(zn),formattedValue:zn,value:zn},{source:"decrement"}),setTimeout(()=>wt(Ce.current?.value.length),0)};const Te=pe=>{N?.(pe),!(te||!V)&&(pe.key==="ArrowUp"&&(pe.preventDefault(),pt.current?.()),pe.key==="ArrowDown"&&(pe.preventDefault(),It.current?.()))},Ee=pe=>{if(A?.(pe),pe.key==="Backspace"){const Ne=Ce.current;Ne&&Ne.selectionStart===0&&Ne.selectionStart===Ne.selectionEnd&&(pe.preventDefault(),window.setTimeout(()=>wt(0),0))}},Me=pe=>{let Ne=ge;E==="blur"&&typeof Ne=="number"&&(Ne=Uh(Ne,b,y)),J&&typeof Ne=="string"&&rt(Ne)<15&&(Ne=T6(Ne,y,b)),ge!==Ne&&Oe(Ne),R?.(pe)};fd(P,{increment:pt.current,decrement:It.current});const Pe=pe=>{pe?pt.current?.():It.current?.(),st.current+=1},lt=pe=>{if(Pe(pe),nt){const Ne=typeof L=="number"?L:L(st.current);ht.current=window.setTimeout(()=>lt(pe),Ne)}},et=(pe,Ne)=>{pe.preventDefault(),Ce.current?.focus(),Pe(Ne),nt&&(ht.current=window.setTimeout(()=>lt(Ne),I))},ot=()=>{ht.current&&window.clearTimeout(ht.current),ht.current=null,st.current=0},ve=a.jsxs("div",{...oe("controls"),children:[a.jsx(ar,{...oe("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof ge=="number"&&y!==void 0&&ge>=y,mod:{direction:"up"},onMouseDown:pe=>pe.preventDefault(),onPointerDown:pe=>{et(pe,!0)},onPointerUp:ot,onPointerLeave:ot,children:a.jsx(zE,{direction:"up"})}),a.jsx(ar,{...oe("control"),tabIndex:-1,"aria-hidden":!0,disabled:B||typeof ge=="number"&&b!==void 0&&ge<=b,mod:{direction:"down"},onMouseDown:pe=>pe.preventDefault(),onPointerDown:pe=>{et(pe,!1)},onPointerUp:ot,onPointerLeave:ot,children:a.jsx(zE,{direction:"down"})})]});return a.jsx(Pr,{component:y6,allowNegative:X,className:$t(px.root,r),size:$,...F,readOnly:te,disabled:B,value:ge,getInputRef:In(t,Ce),onValueChange:vt,rightSection:j||te||!wy(ge)?C:C||ve,classNames:ce,styles:Se,unstyled:c,__staticSelector:"NumberInput",decimalScale:_?k:0,onKeyDown:Te,onKeyDownCapture:Ee,rightSectionPointerEvents:Y??(B?"none":void 0),rightSectionWidth:W??`var(--ni-right-section-width-${$||"sm"})`,allowLeadingZeros:z,onBlur:Me,attributes:M,isAllowed:pe=>E==="strict"?T?T(pe)&&$E(pe.floatValue,b,y):$E(pe.floatValue,b,y):T?T(pe):!0})});zc.classes={...Pr.classes,...px};zc.displayName="@mantine/core/NumberInput";const[R6,hm]=kr("Pagination.Root component was not found in tree");var $d={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const _6={withPadding:!0},Ud=be((e,t)=>{const n=ae("PaginationControl",_6,e),{classNames:r,className:o,style:l,styles:c,vars:d,active:f,disabled:p,withPadding:m,mod:g,...y}=n,b=hm(),w=p||b.disabled;return a.jsx(ar,{ref:t,disabled:w,mod:[{active:f,disabled:w,"with-padding":m},g],...b.getStyles("control",{className:o,style:l,classNames:r,styles:c,active:!w}),...y})});Ud.classes=$d;Ud.displayName="@mantine/core/PaginationControl";function Bd({style:e,children:t,path:n,...r}){return a.jsx("svg",{viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)",...e},...r,children:a.jsx("path",{d:n,fill:"currentColor"})})}const D6=e=>a.jsx(Bd,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),A6=e=>a.jsx(Bd,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),k6=e=>a.jsx(Bd,{...e,path:"M6.85355 3.85355C7.04882 3.65829 7.04882 3.34171 6.85355 3.14645C6.65829 2.95118 6.34171 2.95118 6.14645 3.14645L2.14645 7.14645C1.95118 7.34171 1.95118 7.65829 2.14645 7.85355L6.14645 11.8536C6.34171 12.0488 6.65829 12.0488 6.85355 11.8536C7.04882 11.6583 7.04882 11.3417 6.85355 11.1464L3.20711 7.5L6.85355 3.85355ZM12.8536 3.85355C13.0488 3.65829 13.0488 3.34171 12.8536 3.14645C12.6583 2.95118 12.3417 2.95118 12.1464 3.14645L8.14645 7.14645C7.95118 7.34171 7.95118 7.65829 8.14645 7.85355L12.1464 11.8536C12.3417 12.0488 12.6583 12.0488 12.8536 11.8536C13.0488 11.6583 13.0488 11.3417 12.8536 11.1464L9.20711 7.5L12.8536 3.85355Z"}),P6=e=>a.jsx(Bd,{...e,path:"M2.14645 11.1464C1.95118 11.3417 1.95118 11.6583 2.14645 11.8536C2.34171 12.0488 2.65829 12.0488 2.85355 11.8536L6.85355 7.85355C7.04882 7.65829 7.04882 7.34171 6.85355 7.14645L2.85355 3.14645C2.65829 2.95118 2.34171 2.95118 2.14645 3.14645C1.95118 3.34171 1.95118 3.65829 2.14645 3.85355L5.79289 7.5L2.14645 11.1464ZM8.14645 11.1464C7.95118 11.3417 7.95118 11.6583 8.14645 11.8536C8.34171 12.0488 8.65829 12.0488 8.85355 11.8536L12.8536 7.85355C13.0488 7.65829 13.0488 7.34171 12.8536 7.14645L8.85355 3.14645C8.65829 2.95118 8.34171 2.95118 8.14645 3.14645C7.95118 3.34171 7.95118 3.65829 8.14645 3.85355L11.7929 7.5L8.14645 11.1464Z"}),O6=e=>a.jsx(Bd,{...e,path:"M2 8c0-.733.6-1.333 1.333-1.333.734 0 1.334.6 1.334 1.333s-.6 1.333-1.334 1.333C2.6 9.333 2 8.733 2 8zm9.333 0c0-.733.6-1.333 1.334-1.333C13.4 6.667 14 7.267 14 8s-.6 1.333-1.333 1.333c-.734 0-1.334-.6-1.334-1.333zM6.667 8c0-.733.6-1.333 1.333-1.333s1.333.6 1.333 1.333S8.733 9.333 8 9.333 6.667 8.733 6.667 8z"}),N6={icon:O6},pm=be((e,t)=>{const n=ae("PaginationDots",N6,e),{classNames:r,className:o,style:l,styles:c,vars:d,icon:f,...p}=n,m=hm();return a.jsx(ue,{ref:t,...m.getStyles("dots",{className:o,style:l,styles:c,classNames:r}),...p,children:a.jsx(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});pm.classes=$d;pm.displayName="@mantine/core/PaginationDots";function mm({icon:e,name:t,action:n,type:r}){const o={icon:e},l=v.forwardRef((c,d)=>{const{icon:f,...p}=ae(t,o,c),m=hm(),g=r==="next"?m.active===m.total:m.active===1;return a.jsx(Ud,{disabled:m.disabled||g,ref:d,onClick:m[n],withPadding:!1,...p,children:a.jsx(f,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return l.displayName=`@mantine/core/${t}`,l}const bD=mm({icon:D6,name:"PaginationNext",action:"onNext",type:"next"}),SD=mm({icon:A6,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),wD=mm({icon:k6,name:"PaginationFirst",action:"onFirst",type:"previous"}),jD=mm({icon:P6,name:"PaginationLast",action:"onLast",type:"next"});function p0({dotsIcon:e}){const t=hm(),n=t.range.map((r,o)=>r==="dots"?a.jsx(pm,{icon:e},o):a.jsx(Ud,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...t.getItemProps?.(r),children:t.getItemProps?.(r)?.children??r},o));return a.jsx(a.Fragment,{children:n})}p0.displayName="@mantine/core/PaginationItems";const M6={siblings:1,boundaries:1},L6=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:Vt(n),"--pagination-control-size":at(t,"pagination-control-size"),"--pagination-control-fz":Fn(t),"--pagination-active-bg":r?Qt(r,e):void 0,"--pagination-active-color":xl(o,e)?ja({color:r,theme:e,autoContrast:o}):void 0}}),gm=be((e,t)=>{const n=ae("PaginationRoot",M6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,total:p,value:m,defaultValue:g,onChange:y,disabled:b,siblings:w,boundaries:j,color:C,radius:T,onNextPage:E,onPreviousPage:R,onFirstPage:_,onLastPage:k,getItemProps:N,autoContrast:A,attributes:P,...U}=n,B=Ie({name:"Pagination",classes:$d,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:P,vars:f,varsResolver:L6}),{range:Y,setPage:X,next:te,previous:$,active:W,first:L,last:I}=bM({page:m,initialPage:g,onChange:y,total:p,siblings:w,boundaries:j}),z=ir(E,te),V=ir(R,$),J=ir(_,L),M=ir(k,I);return a.jsx(R6,{value:{total:p,range:Y,active:W,disabled:b,getItemProps:N,onChange:X,onNext:z,onPrevious:V,onFirst:J,onLast:M,getStyles:B},children:a.jsx(ue,{ref:t,...B("root"),...U})})});gm.classes=$d;gm.displayName="@mantine/core/PaginationRoot";const I6={withControls:!0,withPages:!0,siblings:1,boundaries:1,gap:8},zi=be((e,t)=>{const n=ae("Pagination",I6,e),{withEdges:r,withControls:o,getControlProps:l,nextIcon:c,previousIcon:d,lastIcon:f,firstIcon:p,dotsIcon:m,total:g,gap:y,hideWithOnePage:b,withPages:w,...j}=n;return g<=0||b&&g===1?null:a.jsx(gm,{ref:t,total:g,...j,children:a.jsxs(xe,{gap:y,children:[r&&a.jsx(wD,{icon:p,...l?.("first")}),o&&a.jsx(SD,{icon:d,...l?.("previous")}),w&&a.jsx(p0,{dotsIcon:m}),o&&a.jsx(bD,{icon:c,...l?.("next")}),r&&a.jsx(jD,{icon:f,...l?.("last")})]})})});zi.classes=$d;zi.displayName="@mantine/core/Pagination";zi.Root=gm;zi.Control=Ud;zi.Dots=pm;zi.First=wD;zi.Last=jD;zi.Next=bD;zi.Previous=SD;zi.Items=p0;const z6=({reveal:e})=>a.jsx("svg",{viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:a.jsx("path",{d:e?"M13.3536 2.35355C13.5488 2.15829 13.5488 1.84171 13.3536 1.64645C13.1583 1.45118 12.8417 1.45118 12.6464 1.64645L10.6828 3.61012C9.70652 3.21671 8.63759 3 7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C0.902945 9.08812 2.02314 10.1861 3.36061 10.9323L1.64645 12.6464C1.45118 12.8417 1.45118 13.1583 1.64645 13.3536C1.84171 13.5488 2.15829 13.5488 2.35355 13.3536L4.31723 11.3899C5.29348 11.7833 6.36241 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C14.0971 5.9119 12.9769 4.81391 11.6394 4.06771L13.3536 2.35355ZM9.90428 4.38861C9.15332 4.1361 8.34759 4 7.5 4C4.80285 4 2.52952 5.37816 1.09622 7.50001C1.87284 8.6497 2.89609 9.58106 4.09974 10.1931L9.90428 4.38861ZM5.09572 10.6114L10.9003 4.80685C12.1039 5.41894 13.1272 6.35031 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11C6.65241 11 5.84668 10.8639 5.09572 10.6114Z":"M7.5 11C4.80285 11 2.52952 9.62184 1.09622 7.50001C2.52952 5.37816 4.80285 4 7.5 4C10.1971 4 12.4705 5.37816 13.9038 7.50001C12.4705 9.62183 10.1971 11 7.5 11ZM7.5 3C4.30786 3 1.65639 4.70638 0.0760002 7.23501C-0.0253338 7.39715 -0.0253334 7.60288 0.0760014 7.76501C1.65639 10.2936 4.30786 12 7.5 12C10.6921 12 13.3436 10.2936 14.924 7.76501C15.0253 7.60288 15.0253 7.39715 14.924 7.23501C13.3436 4.70638 10.6921 3 7.5 3ZM7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5Z",fill:"currentColor",fillRule:"evenodd",clipRule:"evenodd"})});var gx={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const $6={visibilityToggleIcon:z6},U6=(e,{size:t})=>({root:{"--psi-icon-size":at(t,"psi-icon-size"),"--psi-button-size":at(t,"psi-button-size")}}),Xi=be((e,t)=>{const n=ae("PasswordInput",$6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,required:p,error:m,leftSection:g,disabled:y,id:b,variant:w,inputContainer:j,description:C,label:T,size:E,errorProps:R,descriptionProps:_,labelProps:k,withAsterisk:N,inputWrapperOrder:A,wrapperProps:P,radius:U,rightSection:B,rightSectionWidth:Y,rightSectionPointerEvents:X,leftSectionWidth:te,visible:$,defaultVisible:W,onVisibilityChange:L,visibilityToggleIcon:I,visibilityToggleButtonProps:z,rightSectionProps:V,leftSectionProps:J,leftSectionPointerEvents:M,withErrorStyles:F,mod:oe,attributes:ce,...Se}=n,ge=hr(b),[Oe,nt]=or({value:$,defaultValue:W,finalValue:!1,onChange:L}),Ce=()=>nt(!Oe),ht=Ie({name:"PasswordInput",classes:gx,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:ce,vars:f,varsResolver:U6}),{resolvedClassNames:st,resolvedStyles:vt}=yl({classNames:r,styles:c,props:n}),{styleProps:rt,rest:wt}=Ca(Se),pt=R?.id||`${ge}-error`,It=_?.id||`${ge}-description`,Me=`${!!m&&typeof m!="boolean"?pt:""} ${!!C?It:""}`,Pe=Me.trim().length>0?Me.trim():void 0,lt=a.jsx(En,{...ht("visibilityToggle"),disabled:y,radius:U,"aria-hidden":!z,tabIndex:-1,...z,variant:z?.variant??"subtle",color:"gray",unstyled:d,onTouchEnd:et=>{et.preventDefault(),z?.onTouchEnd?.(et),Ce()},onMouseDown:et=>{et.preventDefault(),z?.onMouseDown?.(et),Ce()},onKeyDown:et=>{z?.onKeyDown?.(et),et.key===" "&&(et.preventDefault(),Ce())},children:a.jsx(I,{reveal:Oe})});return a.jsx(fn.Wrapper,{required:p,id:ge,label:T,error:m,description:C,size:E,classNames:st,styles:vt,__staticSelector:"PasswordInput",unstyled:d,withAsterisk:N,inputWrapperOrder:A,inputContainer:j,variant:w,labelProps:{...k,htmlFor:ge},descriptionProps:{..._,id:It},errorProps:{...R,id:pt},mod:oe,attributes:ce,...ht("root"),...rt,...P,children:a.jsx(fn,{component:"div",error:m,leftSection:g,size:E,classNames:{...st,input:$t(gx.input,st.input)},styles:vt,radius:U,disabled:y,__staticSelector:"PasswordInput",rightSectionWidth:Y,rightSection:B??lt,variant:w,unstyled:d,leftSectionWidth:te,rightSectionPointerEvents:X||"all",rightSectionProps:V,leftSectionProps:J,leftSectionPointerEvents:M,withAria:!1,withErrorStyles:F,attributes:ce,children:a.jsx("input",{required:p,"data-invalid":!!m||void 0,"data-with-left-section":!!g||void 0,...ht("innerInput"),disabled:y,id:ge,ref:t,...wt,"aria-describedby":Pe,autoComplete:wt.autoComplete||"off",type:Oe?"text":"password"})})})});Xi.classes={...Pr.classes,...gx};Xi.displayName="@mantine/core/PasswordInput";const[B6,CD]=No(),[V6,F6]=No();var ED={card:"m_9dc8ae12"};const H6={withBorder:!0},q6=(e,{radius:t})=>({card:{"--card-radius":Vt(t)}}),m0=be((e,t)=>{const n=ae("RadioCard",H6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,checked:p,mod:m,withBorder:g,value:y,onClick:b,name:w,onKeyDown:j,attributes:C,...T}=n,E=Ie({name:"RadioCard",classes:ED,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:q6,rootSelector:"card"}),{dir:R}=vs(),_=CD(),k=typeof p=="boolean"?p:_?.value===y||!1,N=w||_?.name,A=P=>{if(j?.(P),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(P.nativeEvent.code)){P.preventDefault();const U=Array.from(document.querySelectorAll(`[role="radio"][name="${N||"__mantine"}"]`)),B=U.findIndex(te=>te===P.target),Y=B+1>=U.length?0:B+1,X=B-1<0?U.length-1:B-1;P.nativeEvent.code==="ArrowDown"&&(U[Y].focus(),U[Y].click()),P.nativeEvent.code==="ArrowUp"&&(U[X].focus(),U[X].click()),P.nativeEvent.code==="ArrowLeft"&&(U[R==="ltr"?X:Y].focus(),U[R==="ltr"?X:Y].click()),P.nativeEvent.code==="ArrowRight"&&(U[R==="ltr"?Y:X].focus(),U[R==="ltr"?Y:X].click())}};return a.jsx(V6,{value:{checked:k},children:a.jsx(ar,{ref:t,mod:[{"with-border":g,checked:k},m],...E("card"),...T,role:"radio","aria-checked":k,name:N,onClick:P=>{b?.(P),_?.onChange(y||"")},onKeyDown:A})})});m0.displayName="@mantine/core/RadioCard";m0.classes=ED;const g0=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:l,wrapperProps:c,children:d,name:f,readOnly:p,...m}=ae("RadioGroup",null,e),g=hr(f),[y,b]=or({value:n,defaultValue:r,finalValue:"",onChange:o}),w=j=>!p&&b(typeof j=="string"?j:j.currentTarget.value);return a.jsx(B6,{value:{value:y,onChange:w,size:l,name:g},children:a.jsx(fn.Wrapper,{size:l,ref:t,...c,...m,labelElement:"div",__staticSelector:"RadioGroup",children:a.jsx(Vb,{role:"radiogroup",children:d})})})});g0.classes=fn.Wrapper.classes;g0.displayName="@mantine/core/RadioGroup";function TD({size:e,style:t,...n}){return a.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:le(e),height:le(e),...t},"aria-hidden":!0,...n,children:a.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var RD={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const G6={icon:TD},W6=(e,{radius:t,color:n,size:r,iconColor:o,variant:l,autoContrast:c})=>{const d=si({color:n||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{indicator:{"--radio-size":at(r,"radio-size"),"--radio-radius":t===void 0?void 0:Vt(t),"--radio-color":l==="outline"?f:Qt(n,e),"--radio-icon-size":at(r,"radio-icon-size"),"--radio-icon-color":o?Qt(o,e):xl(c,e)?ja({color:n,theme:e,autoContrast:c}):void 0}}},v0=be((e,t)=>{const n=ae("RadioIndicator",G6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,icon:p,radius:m,color:g,iconColor:y,autoContrast:b,checked:w,mod:j,variant:C,disabled:T,attributes:E,...R}=n,_=Ie({name:"RadioIndicator",classes:RD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:E,vars:f,varsResolver:W6,rootSelector:"indicator"}),k=F6(),N=typeof w=="boolean"?w:k?.checked||!1;return a.jsx(ue,{ref:t,..._("indicator",{variant:C}),variant:C,mod:[{checked:N,disabled:T},j],...R,children:a.jsx(p,{..._("icon")})})});v0.displayName="@mantine/core/RadioIndicator";v0.classes=RD;var _D={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const Q6={labelPosition:"right"},Y6=(e,{size:t,radius:n,color:r,iconColor:o,variant:l,autoContrast:c})=>{const d=si({color:r||e.primaryColor,theme:e}),f=d.isThemeColor&&d.shade===void 0?`var(--mantine-color-${d.color}-outline)`:d.color;return{root:{"--radio-size":at(t,"radio-size"),"--radio-radius":n===void 0?void 0:Vt(n),"--radio-color":l==="outline"?f:Qt(r,e),"--radio-icon-color":o?Qt(o,e):xl(c,e)?ja({color:r,theme:e,autoContrast:c}):void 0,"--radio-icon-size":at(t,"radio-icon-size")}}},vr=be((e,t)=>{const n=ae("Radio",Q6,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,id:p,size:m,label:g,labelPosition:y,description:b,error:w,radius:j,color:C,variant:T,disabled:E,wrapperProps:R,icon:_=TD,rootRef:k,iconColor:N,onChange:A,mod:P,attributes:U,...B}=n,Y=Ie({name:"Radio",classes:_D,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:U,vars:f,varsResolver:Y6}),X=CD(),te=X?.size??m,$=n.size?m:te,{styleProps:W,rest:L}=Ca(B),I=hr(p),z=X?{checked:X.value===L.value,name:L.name??X.name,onChange:V=>{X.onChange(V),A?.(V)}}:{};return a.jsx(Jp,{...Y("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:$,labelPosition:y,label:g,description:b,error:w,disabled:E,classNames:r,styles:c,unstyled:d,"data-checked":z.checked||void 0,variant:T,ref:k,mod:P,...W,...R,children:a.jsxs(ue,{...Y("inner"),mod:{"label-position":y},children:[a.jsx(ue,{...Y("radio",{focusable:!0,variant:T}),onChange:A,...L,...z,component:"input",mod:{error:!!w},ref:t,id:I,disabled:E,type:"radio"}),a.jsx(_,{...Y("icon"),"aria-hidden":!0})]})})});vr.classes=_D;vr.displayName="@mantine/core/Radio";vr.Group=g0;vr.Card=m0;vr.Indicator=v0;const K6={duration:100,transition:"fade"};function UE(e,t){return{...K6,...t,...e}}function X6({offset:e,position:t,defaultOpened:n}){const[r,o]=v.useState(n),l=v.useRef(null),{x:c,y:d,elements:f,refs:p,update:m,placement:g}=vb({placement:t,middleware:[hb({crossAxis:!0,padding:5,rootBoundary:"document"})]}),y=g.includes("right")?e:t.includes("left")?e*-1:0,b=g.includes("bottom")?e:t.includes("top")?e*-1:0,w=v.useCallback(({clientX:j,clientY:C})=>{p.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:j,y:C,left:j+y,top:C+b,right:j,bottom:C}}})},[f.reference]);return v.useEffect(()=>{if(p.floating.current){const j=l.current;j.addEventListener("mousemove",w);const C=ma(p.floating.current);return C.forEach(T=>{T.addEventListener("scroll",m)}),()=>{j.removeEventListener("mousemove",w),C.forEach(T=>{T.removeEventListener("scroll",m)})}}},[f.reference,p.floating.current,m,w,r]),{handleMouseMove:w,x:c,y:d,opened:r,setOpened:o,boundaryRef:l,floating:p.setFloating}}var vm={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const J6={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:di("popover")},Z6=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?Qt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),y0=be((e,t)=>{const n=ae("TooltipFloating",J6,e),{children:r,refProp:o,withinPortal:l,style:c,className:d,classNames:f,styles:p,unstyled:m,radius:g,color:y,label:b,offset:w,position:j,multiline:C,zIndex:T,disabled:E,defaultOpened:R,variant:_,vars:k,portalProps:N,attributes:A,...P}=n,U=Sn(),B=Ie({name:"TooltipFloating",props:n,classes:vm,className:d,style:c,classNames:f,styles:p,unstyled:m,attributes:A,rootSelector:"tooltip",vars:k,varsResolver:Z6}),{handleMouseMove:Y,x:X,y:te,opened:$,boundaryRef:W,floating:L,setOpened:I}=X6({offset:w,position:j,defaultOpened:R});if(!Oo(r))throw new Error("[@mantine/core] Tooltip.Floating component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const z=In(W,Lp(r),t),V=r.props,J=F=>{V.onMouseEnter?.(F),Y(F),I(!0)},M=F=>{V.onMouseLeave?.(F),I(!1)};return a.jsxs(a.Fragment,{children:[a.jsx(va,{...N,withinPortal:l,children:a.jsx(ue,{...P,...B("tooltip",{style:{...b2(c,U),zIndex:T,display:!E&&$?"block":"none",top:(te&&Math.round(te))??"",left:(X&&Math.round(X))??""}}),variant:_,ref:L,mod:{multiline:C},children:b})}),v.cloneElement(r,{...V,[o]:z,onMouseEnter:J,onMouseLeave:M})]})});y0.classes=vm;y0.displayName="@mantine/core/TooltipFloating";const DD=v.createContext(!1),ez=DD.Provider,tz=()=>v.useContext(DD),nz={openDelay:0,closeDelay:0};function x0(e){const{openDelay:t,closeDelay:n,children:r}=ae("TooltipGroup",nz,e);return a.jsx(ez,{value:!0,children:a.jsx(x9,{delay:{open:t,close:n},children:r})})}x0.displayName="@mantine/core/TooltipGroup";x0.extend=e=>e;function rz(e){if(e===void 0)return{shift:!0,flip:!0};const t={...e};return e.shift===void 0&&(t.shift=!0),e.flip===void 0&&(t.flip=!0),t}function iz(e){const t=rz(e.middlewares),n=[I2(e.offset)];return t.shift&&n.push(hb(typeof t.shift=="boolean"?{padding:8}:{padding:8,...t.shift})),t.flip&&n.push(typeof t.flip=="boolean"?ap():ap(t.flip)),n.push(z2({element:e.arrowRef,padding:e.arrowOffset})),t.inline?n.push(typeof t.inline=="boolean"?ld():ld(t.inline)):e.inline&&n.push(ld()),n}function oz(e){const[t,n]=v.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,l=tz(),c=hr(),d=v.useCallback(k=>{n(k),k&&T(c)},[c]),{x:f,y:p,context:m,refs:g,placement:y,middlewareData:{arrow:{x:b,y:w}={}}}=vb({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:iz(e),whileElementsMounted:cx}),{delay:j,currentId:C,setCurrentId:T}=b9(m,{id:c}),{getReferenceProps:E,getFloatingProps:R}=T9([v9(m,{enabled:e.events?.hover,delay:l?j:{open:e.openDelay,close:e.closeDelay},mouseOnly:!e.events?.touch}),E9(m,{enabled:e.events?.focus,visibleOnly:!0}),_9(m,{role:"tooltip"}),j9(m,{enabled:typeof e.opened>"u"})]);rl(()=>{e.onPositionChange?.(y)},[y]);const _=o&&C&&C!==c;return{x:f,y:p,arrowX:b,arrowY:w,reference:g.setReference,floating:g.setFloating,getFloatingProps:R,getReferenceProps:E,isGroupPhase:_,opened:o,placement:y}}const BE={position:"top",refProp:"ref",withinPortal:!0,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:di("popover"),positionDependencies:[],middlewares:{flip:!0,shift:!0,inline:!1}},az=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const l=e.variantColorResolver({theme:e,color:n||e.primaryColor,autoContrast:o,variant:r||"filled"});return{tooltip:{"--tooltip-radius":t===void 0?void 0:Vt(t),"--tooltip-bg":n?l.background:void 0,"--tooltip-color":n?l.color:void 0}}},xa=be((e,t)=>{const n=ae("Tooltip",BE,e),{children:r,position:o,refProp:l,label:c,openDelay:d,closeDelay:f,onPositionChange:p,opened:m,defaultOpened:g,withinPortal:y,radius:b,color:w,classNames:j,styles:C,unstyled:T,style:E,className:R,withArrow:_,arrowSize:k,arrowOffset:N,arrowRadius:A,arrowPosition:P,offset:U,transitionProps:B,multiline:Y,events:X,zIndex:te,disabled:$,positionDependencies:W,onClick:L,onMouseEnter:I,onMouseLeave:z,inline:V,variant:J,keepMounted:M,vars:F,portalProps:oe,mod:ce,floatingStrategy:Se,middlewares:ge,autoContrast:Oe,attributes:nt,target:Ce,...ht}=ae("Tooltip",BE,n),{dir:st}=vs(),vt=v.useRef(null),rt=oz({position:r_(st,o),closeDelay:f,openDelay:d,onPositionChange:p,opened:m,defaultOpened:g,events:X,arrowRef:vt,arrowOffset:N,offset:typeof U=="number"?U+(_?k/2:0):U,positionDependencies:[...W,Ce??r],inline:V,strategy:Se,middlewares:ge});v.useEffect(()=>{const Me=Ce instanceof HTMLElement?Ce:typeof Ce=="string"?document.querySelector(Ce):Ce?.current||null;Me&&rt.reference(Me)},[Ce,rt]);const wt=Ie({name:"Tooltip",props:n,classes:vm,className:R,style:E,classNames:j,styles:C,unstyled:T,attributes:nt,rootSelector:"tooltip",vars:F,varsResolver:az});if(!Ce&&!Oo(r))return null;if(Ce){const Me=UE(B,{duration:100,transition:"fade"});return a.jsx(a.Fragment,{children:a.jsx(va,{...oe,withinPortal:y,children:a.jsx(eo,{...Me,keepMounted:M,mounted:!$&&!!rt.opened,duration:rt.isGroupPhase?10:Me.duration,children:Pe=>a.jsxs(ue,{...ht,"data-fixed":Se==="fixed"||void 0,variant:J,mod:[{multiline:Y},ce],...rt.getFloatingProps({ref:rt.floating,className:wt("tooltip").className,style:{...wt("tooltip").style,...Pe,zIndex:te,top:rt.y??0,left:rt.x??0}}),children:[c,a.jsx(sp,{ref:vt,arrowX:rt.arrowX,arrowY:rt.arrowY,visible:_,position:rt.placement,arrowSize:k,arrowOffset:N,arrowRadius:A,arrowPosition:P,...wt("arrow")})]})})})})}const pt=r,It=pt.props,Te=In(rt.reference,Lp(pt),t),Ee=UE(B,{duration:100,transition:"fade"});return a.jsxs(a.Fragment,{children:[a.jsx(va,{...oe,withinPortal:y,children:a.jsx(eo,{...Ee,keepMounted:M,mounted:!$&&!!rt.opened,duration:rt.isGroupPhase?10:Ee.duration,children:Me=>a.jsxs(ue,{...ht,"data-fixed":Se==="fixed"||void 0,variant:J,mod:[{multiline:Y},ce],...rt.getFloatingProps({ref:rt.floating,className:wt("tooltip").className,style:{...wt("tooltip").style,...Me,zIndex:te,top:rt.y??0,left:rt.x??0}}),children:[c,a.jsx(sp,{ref:vt,arrowX:rt.arrowX,arrowY:rt.arrowY,visible:_,position:rt.placement,arrowSize:k,arrowOffset:N,arrowRadius:A,arrowPosition:P,...wt("arrow")})]})})}),v.cloneElement(pt,rt.getReferenceProps({onClick:L,onMouseEnter:I,onMouseLeave:z,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,className:$t(R,It.className),...It,[l]:Te}))]})});xa.classes=vm;xa.displayName="@mantine/core/Tooltip";xa.Floating=y0;xa.Group=x0;function sz({size:e,thickness:t,sum:n,value:r,root:o,offset:l}){const c=(e*.9-t*2)/2,d=Math.PI*c*2/100,f=o||r===void 0?`${(100-n)*d}, ${n*d}`:`${r*d}, ${(100-r)*d}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:c||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:f,strokeDashoffset:o?0:l||0}}function AD({size:e,value:t,offset:n,sum:r,thickness:o,root:l,color:c,lineRoundCaps:d,tooltip:f,getStyles:p,display:m,...g}){const y=Sn();return a.jsx(xa.Floating,{disabled:!f,label:f,children:a.jsx(ue,{component:"circle",...g,...p("curve"),__vars:{"--curve-color":c?Qt(c,y):void 0},fill:"none",strokeLinecap:d?"round":"butt",...sz({sum:r,size:e,thickness:o,value:t,offset:n,root:l})})})}AD.displayName="@mantine/core/Curve";function lz({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const l=n.reduce((m,g)=>m+g.value,0),c=Math.PI*((e*.9-t*2)/2)*2;let d=c;const f=[],p=[];for(let m=0;m<n.length;m+=1)f.push({sum:l,offset:d,data:n[m],root:!1}),d-=n[m].value/100*c;if(f.push({sum:l,offset:d,data:{color:o},root:!0}),p.push({...f[f.length-1],lineRoundCaps:!1}),f.length>2){p.push({...f[0],lineRoundCaps:r}),p.push({...f[f.length-2],lineRoundCaps:r});for(let m=1;m<=f.length-3;m+=1)p.push({...f[m],lineRoundCaps:!1})}else p.push({...f[0],lineRoundCaps:r});return p}var kD={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function cz(e,t){return Math.min(e||12,(t||120)/4)}const uz={size:120,thickness:12},dz=(e,{size:t,thickness:n,transitionDuration:r})=>({root:{"--rp-size":le(t),"--rp-label-offset":le(n*2),"--rp-transition-duration":r?`${r}ms`:void 0}}),ym=be((e,t)=>{const n=ae("RingProgress",uz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,label:p,sections:m,size:g,thickness:y,roundCaps:b,rootColor:w,transitionDuration:j,attributes:C,...T}=n,E=Ie({name:"RingProgress",classes:kD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:C,vars:f,varsResolver:dz}),R=cz(y,g),_=lz({size:g,thickness:R,sections:m,renderRoundedLineCaps:b,rootColor:w}).map(({data:k,sum:N,root:A,lineRoundCaps:P,offset:U},B)=>v.createElement(AD,{...k,key:B,size:g,thickness:R,sum:N,offset:U,color:k?.color,root:A,lineRoundCaps:P,getStyles:E}));return a.jsxs(ue,{...E("root"),size:g,ref:t,...T,children:[a.jsx("svg",{...E("svg"),children:_}),p&&a.jsx("div",{...E("label"),children:p})]})});ym.classes=kD;ym.displayName="@mantine/core/RingProgress";var PD={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const fz={withItemsBorders:!0},hz=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:l})=>({root:{"--sc-radius":t===void 0?void 0:Vt(t),"--sc-color":n?Qt(n,e):void 0,"--sc-shadow":n?void 0:"var(--mantine-shadow-xs)","--sc-transition-duration":r===void 0?void 0:`${r}ms`,"--sc-transition-timing-function":l,"--sc-padding":at(o,"sc-padding"),"--sc-font-size":Fn(o)}}),Vd=be((e,t)=>{const n=ae("SegmentedControl",fz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,data:p,value:m,defaultValue:g,onChange:y,size:b,name:w,disabled:j,readOnly:C,fullWidth:T,orientation:E,radius:R,color:_,transitionDuration:k,transitionTimingFunction:N,variant:A,autoContrast:P,withItemsBorders:U,mod:B,attributes:Y,...X}=n,te=Ie({name:"SegmentedControl",props:n,classes:PD,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:Y,vars:f,varsResolver:hz}),$=Sn(),W=p.map(Ce=>typeof Ce=="string"?{label:Ce,value:Ce}:Ce),L=TM(),[I,z]=v.useState(tp()),[V,J]=v.useState(null),[M,F]=v.useState({}),oe=(Ce,ht)=>{M[ht]=Ce,F(M)},[ce,Se]=or({value:m,defaultValue:g,finalValue:Array.isArray(p)?W.find(Ce=>!Ce.disabled)?.value??p[0]?.value??null:null,onChange:y}),ge=hr(w),Oe=W.map(Ce=>v.createElement(ue,{...te("control"),mod:{active:ce===Ce.value,orientation:E},key:Ce.value},v.createElement("input",{...te("input"),disabled:j||Ce.disabled,type:"radio",name:ge,value:Ce.value,id:`${ge}-${Ce.value}`,checked:ce===Ce.value,onChange:()=>!C&&Se(Ce.value),"data-focus-ring":$.focusRing,key:`${Ce.value}-input`}),v.createElement(ue,{component:"label",...te("label"),mod:{active:ce===Ce.value&&!(j||Ce.disabled),disabled:j||Ce.disabled,"read-only":C},htmlFor:`${ge}-${Ce.value}`,ref:ht=>oe(ht,Ce.value),__vars:{"--sc-label-color":_!==void 0?ja({color:_,theme:$,autoContrast:P}):void 0},key:`${Ce.value}-label`},a.jsx("span",{...te("innerLabel"),children:Ce.label})))),nt=In(t,Ce=>J(Ce));return jM(()=>{z(tp())},[p.length]),p.length===0?null:a.jsxs(ue,{...te("root"),variant:A,size:b,ref:nt,mod:[{"full-width":T,orientation:E,initialized:L,"with-items-borders":U},B],...X,role:"radiogroup","data-disabled":j,children:[typeof ce=="string"&&a.jsx(Eb,{target:M[ce],parent:V,component:"span",transitionDuration:"var(--sc-transition-duration)",...te("indicator")},I),Oe]})});Vd.classes=PD;Vd.displayName="@mantine/core/SegmentedControl";function pz({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=Sn(),l=t===void 0?e:t,c=gs({"--sg-spacing-x":Vn(Qi(e)),"--sg-spacing-y":Vn(Qi(l)),"--sg-cols":Qi(n)?.toString()}),d=ln(o.breakpoints).reduce((m,g)=>(m[g]||(m[g]={}),typeof e=="object"&&e[g]!==void 0&&(m[g]["--sg-spacing-x"]=Vn(e[g])),typeof l=="object"&&l[g]!==void 0&&(m[g]["--sg-spacing-y"]=Vn(l[g])),typeof n=="object"&&n[g]!==void 0&&(m[g]["--sg-cols"]=n[g]),m),{}),p=dd(ln(d),o.breakpoints).filter(m=>ln(d[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:d[m.value]}));return a.jsx(bl,{styles:c,media:p,selector:r})}function jy(e){return typeof e=="object"&&e!==null?ln(e):[]}function mz(e){return e.sort((t,n)=>ud(t)-ud(n))}function gz({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...jy(e),...jy(t),...jy(n)]));return mz(r)}function vz({spacing:e,verticalSpacing:t,cols:n,selector:r}){const o=t===void 0?e:t,l=gs({"--sg-spacing-x":Vn(Qi(e)),"--sg-spacing-y":Vn(Qi(o)),"--sg-cols":Qi(n)?.toString()}),c=gz({spacing:e,verticalSpacing:t,cols:n}),d=c.reduce((p,m)=>(p[m]||(p[m]={}),typeof e=="object"&&e[m]!==void 0&&(p[m]["--sg-spacing-x"]=Vn(e[m])),typeof o=="object"&&o[m]!==void 0&&(p[m]["--sg-spacing-y"]=Vn(o[m])),typeof n=="object"&&n[m]!==void 0&&(p[m]["--sg-cols"]=n[m]),p),{}),f=c.map(p=>({query:`simple-grid (min-width: ${p})`,styles:d[p]}));return a.jsx(bl,{styles:l,container:f,selector:r})}var OD={container:"m_925c2d2c",root:"m_2415a157"};const yz={cols:1,spacing:"md",type:"media"},xm=be((e,t)=>{const n=ae("SimpleGrid",yz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,cols:p,verticalSpacing:m,spacing:g,type:y,attributes:b,...w}=n,j=Ie({name:"SimpleGrid",classes:OD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:b,vars:f}),C=Dd();return y==="container"?a.jsxs(a.Fragment,{children:[a.jsx(vz,{...n,selector:`.${C}`}),a.jsx("div",{...j("container"),children:a.jsx(ue,{ref:t,...j("root",{className:C}),...w})})]}):a.jsxs(a.Fragment,{children:[a.jsx(pz,{...n,selector:`.${C}`}),a.jsx(ue,{ref:t,...j("root",{className:C}),...w})]})});xm.classes=OD;xm.displayName="@mantine/core/SimpleGrid";const bm=be((e,t)=>{const{w:n,h:r,miw:o,mih:l,...c}=ae("Space",null,e);return a.jsx(ue,{ref:t,...c,w:n,miw:o??n,h:r,mih:l??r})});bm.displayName="@mantine/core/Space";var ND={root:"m_6d731127"};const xz={gap:"md",align:"stretch",justify:"flex-start"},bz=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Vn(t),"--stack-align":n,"--stack-justify":r}}),Ue=be((e,t)=>{const n=ae("Stack",xz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,align:p,justify:m,gap:g,variant:y,attributes:b,...w}=n,j=Ie({name:"Stack",props:n,classes:ND,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:b,vars:f,varsResolver:bz});return a.jsx(ue,{ref:t,...j("root"),variant:y,...w})});Ue.classes=ND;Ue.displayName="@mantine/core/Stack";const[Sz,wz]=kr("Stepper component was not found in tree"),cp=()=>null;cp.displayName="@mantine/core/StepperCompleted";var b0={root:"m_cbb4ea7e",steps:"m_aaf89d0b",separator:"m_2a371ac9",content:"m_78da155d",step:"m_cbb57068","step--horizontal":"m_f56b1e2c","step--vertical":"m_833edb7e",verticalSeparator:"m_6496b3f3",stepWrapper:"m_818e70b",stepIcon:"m_1959ad01",stepCompletedIcon:"m_a79331dc",stepBody:"m_1956aa2a",stepLabel:"m_12051f6c",stepDescription:"m_164eea74"};const Eh=(e,t)=>typeof e=="function"?a.jsx(e,{step:t||0}):e,jz={withIcon:!0,allowStepClick:!0,iconPosition:"left"},S0=be((e,t)=>{const{classNames:n,className:r,style:o,styles:l,vars:c,step:d,state:f,color:p,icon:m,completedIcon:g,progressIcon:y,label:b,description:w,withIcon:j,iconSize:C,loading:T,allowStepClick:E,allowStepSelect:R,iconPosition:_,orientation:k,mod:N,...A}=ae("StepperStep",jz,e),P=wz(),U=Sn(),B={classNames:n,styles:l},Y=f==="stepCompleted"?null:f==="stepProgress"?y:m,X={"data-progress":f==="stepProgress"||void 0,"data-completed":f==="stepCompleted"||void 0};return a.jsxs(ar,{...P.getStyles("step",{className:r,style:o,variant:P.orientation,...B}),mod:[{"icon-position":_||P.iconPosition,"allow-click":E},N],ref:t,...X,...A,__vars:{"--step-color":p?Qt(p,U):void 0},tabIndex:E?0:-1,children:[j&&a.jsxs("span",{...P.getStyles("stepWrapper",B),children:[a.jsxs("span",{...P.getStyles("stepIcon",B),...X,children:[a.jsx(eo,{mounted:f==="stepCompleted",transition:"pop",duration:200,children:te=>a.jsx("span",{...P.getStyles("stepCompletedIcon",{style:te,...B}),children:T?a.jsx(Gr,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...P.getStyles("stepLoader",B)}):Eh(g,d)||a.jsx(Ld,{size:"60%"})})}),f!=="stepCompleted"?T?a.jsx(Gr,{...P.getStyles("stepLoader",B),size:"calc(var(--stepper-icon-size) / 2)",color:p}):Eh(Y||m,d):null]}),k==="vertical"&&a.jsx("span",{...P.getStyles("verticalSeparator",B),"data-active":f==="stepCompleted"||void 0})]}),(b||w)&&a.jsxs("span",{...P.getStyles("stepBody",B),"data-orientation":P.orientation,"data-icon-position":_||P.iconPosition,children:[b&&a.jsx("span",{...P.getStyles("stepLabel",B),children:Eh(b,d)}),w&&a.jsx("span",{...P.getStyles("stepDescription",B),children:Eh(w,d)})]})]})});S0.classes=b0;S0.displayName="@mantine/core/StepperStep";const Cz={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},Ez=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:l,autoContrast:c})=>({root:{"--stepper-color":t?Qt(t,e):void 0,"--stepper-icon-color":xl(c,e)?ja({color:t,theme:e,autoContrast:c}):void 0,"--stepper-icon-size":n===void 0?at(r,"stepper-icon-size"):le(n),"--stepper-content-padding":Vn(o),"--stepper-radius":l===void 0?void 0:Vt(l),"--stepper-fz":Fn(r),"--stepper-spacing":Vn(r)}}),$c=be((e,t)=>{const n=ae("Stepper",Cz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,onStepClick:m,active:g,icon:y,completedIcon:b,progressIcon:w,color:j,iconSize:C,contentPadding:T,orientation:E,iconPosition:R,size:_,radius:k,allowNextStepsSelect:N,wrap:A,autoContrast:P,attributes:U,...B}=n,Y=Ie({name:"Stepper",classes:b0,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:U,vars:f,varsResolver:Ez}),X=v.Children.toArray(p),te=X.filter(V=>V.type!==cp),$=X.find(V=>V.type===cp),W=te.reduce((V,J,M)=>{const F=g===M?"stepProgress":g>M?"stepCompleted":"stepInactive",ce=typeof m!="function"?!1:typeof J.props.allowStepSelect=="boolean"?J.props.allowStepSelect:F==="stepCompleted"||N;return V.push(v.cloneElement(J,{icon:J.props.icon||y||M+1,key:M,step:M,state:F,onClick:()=>ce&&m?.(M),allowStepClick:ce,completedIcon:J.props.completedIcon||b,progressIcon:J.props.progressIcon||w,color:J.props.color||j,iconSize:C,iconPosition:J.props.iconPosition||R,orientation:E})),E==="horizontal"&&M!==te.length-1&&V.push(v.createElement("div",{...Y("separator"),"data-active":M<g||void 0,"data-orientation":E,key:`separator-${M}`})),V},[]),L=te[g]?.props?.children,I=$?.props?.children,z=g>te.length-1?I:L;return a.jsx(Sz,{value:{getStyles:Y,orientation:E,iconPosition:R},children:a.jsxs(ue,{...Y("root"),ref:t,size:_,...B,children:[a.jsx(ue,{...Y("steps"),mod:{orientation:E,"icon-position":R,wrap:A&&E!=="vertical"},children:W}),z&&a.jsx("div",{...Y("content"),children:z})]})})});$c.classes=b0;$c.displayName="@mantine/core/Stepper";$c.Completed=cp;$c.Step=S0;const MD=v.createContext(null),Tz=MD.Provider,Rz=()=>v.useContext(MD),w0=be((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:l,wrapperProps:c,children:d,readOnly:f,...p}=ae("SwitchGroup",null,e),[m,g]=or({value:n,defaultValue:r,finalValue:[],onChange:o}),y=b=>{const w=b.currentTarget.value;!f&&g(m.includes(w)?m.filter(j=>j!==w):[...m,w])};return a.jsx(Tz,{value:{value:m,onChange:y,size:l},children:a.jsx(fn.Wrapper,{size:l,ref:t,...c,...p,labelElement:"div",__staticSelector:"SwitchGroup",children:a.jsx(Vb,{role:"group",children:d})})})});w0.classes=fn.Wrapper.classes;w0.displayName="@mantine/core/SwitchGroup";var LD={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const _z={labelPosition:"right",withThumbIndicator:!0},Dz=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:Vt(t),"--switch-height":at(r,"switch-height"),"--switch-width":at(r,"switch-width"),"--switch-thumb-size":at(r,"switch-thumb-size"),"--switch-label-font-size":at(r,"switch-label-font-size"),"--switch-track-label-padding":at(r,"switch-track-label-padding"),"--switch-color":n?Qt(n,e):void 0}}),Fd=be((e,t)=>{const n=ae("Switch",_z,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,color:p,label:m,offLabel:g,onLabel:y,id:b,size:w,radius:j,wrapperProps:C,thumbIcon:T,checked:E,defaultChecked:R,onChange:_,labelPosition:k,description:N,error:A,disabled:P,variant:U,rootRef:B,mod:Y,withThumbIndicator:X,attributes:te,...$}=n,W=Rz(),L=w||W?.size,I=Ie({name:"Switch",props:n,classes:LD,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:te,vars:f,varsResolver:Dz}),{styleProps:z,rest:V}=Ca($),J=hr(b),M=W?{checked:W.value.includes(V.value),onChange:W.onChange}:{},[F,oe]=or({value:M.checked??E,defaultValue:R,finalValue:!1});return a.jsxs(Jp,{...I("root"),__staticSelector:"Switch",__stylesApiProps:n,id:J,size:L,labelPosition:k,label:m,description:N,error:A,disabled:P,bodyElement:"label",labelElement:"span",classNames:r,styles:c,unstyled:d,"data-checked":M.checked||E||void 0,variant:U,ref:B,mod:Y,...z,...C,children:[a.jsx("input",{...V,disabled:P,checked:F,"data-checked":M.checked||E||void 0,onChange:ce=>{W?M.onChange?.(ce):_?.(ce),oe(ce.currentTarget.checked)},id:J,ref:t,type:"checkbox",role:"switch",...I("input")}),a.jsxs(ue,{"aria-hidden":"true",component:"span",mod:{error:A,"label-position":k,"without-labels":!y&&!g},...I("track"),children:[a.jsx(ue,{component:"span",mod:{"reduce-motion":!0,"with-thumb-indicator":X&&!T},...I("thumb"),children:T}),a.jsx("span",{...I("trackLabel"),children:F?y:g})]})]})});Fd.classes={...LD,...B_};Fd.displayName="@mantine/core/Switch";Fd.Group=w0;const[Az,kz]=kr("Table component was not found in the tree");var Hd={table:"m_b23fa0ef",th:"m_4e7aa4f3",tr:"m_4e7aa4fd",td:"m_4e7aa4ef",tbody:"m_b2404537",thead:"m_b242d975",caption:"m_9e5a3ac7",scrollContainer:"m_a100c15",scrollContainerInner:"m_62259741"};function Pz(e,t){if(!t)return;const n={};return t.columnBorder&&e.withColumnBorders&&(n["data-with-column-border"]=!0),t.rowBorder&&e.withRowBorders&&(n["data-with-row-border"]=!0),t.striped&&e.striped&&(n["data-striped"]=e.striped),t.highlightOnHover&&e.highlightOnHover&&(n["data-hover"]=!0),t.captionSide&&e.captionSide&&(n["data-side"]=e.captionSide),t.stickyHeader&&e.stickyHeader&&(n["data-sticky"]=!0),n}function jl(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=be((o,l)=>{const c=ae(n,{},o),{classNames:d,className:f,style:p,styles:m,...g}=c,y=kz();return a.jsx(ue,{component:e,ref:l,...Pz(y,t),...y.getStyles(e,{className:f,classNames:d,style:p,styles:m,props:c}),...g})});return r.displayName=`@mantine/core/${n}`,r.classes=Hd,r}const vx=jl("th",{columnBorder:!0}),ID=jl("td",{columnBorder:!0}),Hh=jl("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),zD=jl("thead",{stickyHeader:!0}),$D=jl("tbody"),UD=jl("tfoot"),BD=jl("caption",{captionSide:!0});function j0({data:e}){return a.jsxs(a.Fragment,{children:[e.caption&&a.jsx(BD,{children:e.caption}),e.head&&a.jsx(zD,{children:a.jsx(Hh,{children:e.head.map((t,n)=>a.jsx(vx,{children:t},n))})}),e.body&&a.jsx($D,{children:e.body.map((t,n)=>a.jsx(Hh,{children:t.map((r,o)=>a.jsx(ID,{children:r},o))},n))}),e.foot&&a.jsx(UD,{children:a.jsx(Hh,{children:e.foot.map((t,n)=>a.jsx(vx,{children:t},n))})})]})}j0.displayName="@mantine/core/TableDataRenderer";const Oz={type:"scrollarea"},Nz=(e,{minWidth:t,maxHeight:n,type:r})=>({scrollContainer:{"--table-min-width":le(t),"--table-max-height":le(n),"--table-overflow":r==="native"?"auto":void 0}}),C0=be((e,t)=>{const n=ae("TableScrollContainer",Oz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,children:p,minWidth:m,maxHeight:g,type:y,scrollAreaProps:b,attributes:w,...j}=n,C=Ie({name:"TableScrollContainer",classes:Hd,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:w,vars:f,varsResolver:Nz,rootSelector:"scrollContainer"});return a.jsx(ue,{component:y==="scrollarea"?fi:"div",...y==="scrollarea"?g?{offsetScrollbars:"xy",...b}:{offsetScrollbars:"x",...b}:{},ref:t,...C("scrollContainer"),...j,children:a.jsx("div",{...C("scrollContainerInner"),children:p})})});C0.classes=Hd;C0.displayName="@mantine/core/TableScrollContainer";const Mz={withRowBorders:!0,verticalSpacing:7},Lz=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:l,stripedColor:c,highlightOnHoverColor:d,striped:f,highlightOnHover:p,stickyHeaderOffset:m,stickyHeader:g})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Vn(r),"--table-vertical-spacing":Vn(o),"--table-border-color":l?Qt(l,e):void 0,"--table-striped-color":f&&c?Qt(c,e):void 0,"--table-highlight-on-hover-color":p&&d?Qt(d,e):void 0,"--table-sticky-header-offset":g?le(m):void 0}}),he=be((e,t)=>{const n=ae("Table",Mz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,horizontalSpacing:p,verticalSpacing:m,captionSide:g,stripedColor:y,highlightOnHoverColor:b,striped:w,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,withTableBorder:E,borderColor:R,layout:_,variant:k,data:N,children:A,stickyHeader:P,stickyHeaderOffset:U,mod:B,tabularNums:Y,attributes:X,...te}=n,$=Ie({name:"Table",props:n,className:o,style:l,classes:Hd,classNames:r,styles:c,unstyled:d,attributes:X,rootSelector:"table",vars:f,varsResolver:Lz});return a.jsx(Az,{value:{getStyles:$,stickyHeader:P,striped:w===!0?"odd":w||void 0,highlightOnHover:j,withColumnBorders:C,withRowBorders:T,captionSide:g||"bottom"},children:a.jsx(ue,{component:"table",variant:k,ref:t,mod:[{"data-with-table-border":E,"data-tabular-nums":Y},B],...$("table"),...te,children:A||!!N&&a.jsx(j0,{data:N})})})});he.classes=Hd;he.displayName="@mantine/core/Table";he.Td=ID;he.Th=vx;he.Tr=Hh;he.Thead=zD;he.Tbody=$D;he.Tfoot=UD;he.Caption=BD;he.ScrollContainer=C0;he.DataRenderer=j0;const[Iz,E0]=kr("Tabs component was not found in the tree");var qd={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",tab:"m_4ec4dce6",panel:"m_b0c91715",tabSection:"m_fc420b1f",tabLabel:"m_42bbd1ae","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const T0=be((e,t)=>{const n=ae("TabsList",null,e),{children:r,className:o,grow:l,justify:c,classNames:d,styles:f,style:p,mod:m,...g}=n,y=E0();return a.jsx(ue,{...g,...y.getStyles("list",{className:o,style:p,classNames:d,styles:f,props:n,variant:y.variant}),ref:t,role:"tablist",variant:y.variant,mod:[{grow:l,orientation:y.orientation,placement:y.orientation==="vertical"&&y.placement,inverted:y.inverted},m],"aria-orientation":y.orientation,__vars:{"--tabs-justify":c},children:r})});T0.classes=qd;T0.displayName="@mantine/core/TabsList";const R0=be((e,t)=>{const n=ae("TabsPanel",null,e),{children:r,className:o,value:l,classNames:c,styles:d,style:f,mod:p,keepMounted:m,...g}=n,y=E0(),b=y.value===l,w=y.keepMounted||m||b?r:null;return a.jsx(ue,{...y.getStyles("panel",{className:o,classNames:c,styles:d,style:[f,b?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:y.orientation},p],role:"tabpanel",id:y.getPanelId(l),"aria-labelledby":y.getTabId(l),...g,children:w})});R0.classes=qd;R0.displayName="@mantine/core/TabsPanel";const _0=be((e,t)=>{const n=ae("TabsTab",null,e),{className:r,children:o,rightSection:l,leftSection:c,value:d,onClick:f,onKeyDown:p,disabled:m,color:g,style:y,classNames:b,styles:w,vars:j,mod:C,tabIndex:T,...E}=n,R=Sn(),{dir:_}=vs(),k=E0(),N=d===k.value,A=U=>{k.onChange(k.allowTabDeactivation&&d===k.value?null:d),f?.(U)},P={classNames:b,styles:w,props:n};return a.jsxs(ar,{...k.getStyles("tab",{className:r,style:y,variant:k.variant,...P}),disabled:m,unstyled:k.unstyled,variant:k.variant,mod:[{active:N,disabled:m,orientation:k.orientation,inverted:k.inverted,placement:k.orientation==="vertical"&&k.placement},C],ref:t,role:"tab",id:k.getTabId(d),"aria-selected":N,tabIndex:T!==void 0?T:N||k.value===null?0:-1,"aria-controls":k.getPanelId(d),onClick:A,__vars:{"--tabs-color":g?Qt(g,R):void 0},onKeyDown:Xx({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:k.activateTabWithKeyboard,loop:k.loop,orientation:k.orientation||"horizontal",dir:_,onKeyDown:p}),...E,children:[c&&a.jsx("span",{...k.getStyles("tabSection",P),"data-position":"left",children:c}),o&&a.jsx("span",{...k.getStyles("tabLabel",P),children:o}),l&&a.jsx("span",{...k.getStyles("tabSection",P),"data-position":"right",children:l})]})});_0.classes=qd;_0.displayName="@mantine/core/TabsTab";const VE="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",zz={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,variant:"default",placement:"left"},$z=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":Vt(t),"--tabs-color":Qt(n,e),"--tabs-text-color":xl(r,e)?ja({color:n,theme:e,autoContrast:r}):void 0}}),kt=be((e,t)=>{const n=ae("Tabs",zz,e),{defaultValue:r,value:o,onChange:l,orientation:c,children:d,loop:f,id:p,activateTabWithKeyboard:m,allowTabDeactivation:g,variant:y,color:b,radius:w,inverted:j,placement:C,keepMounted:T,classNames:E,styles:R,unstyled:_,className:k,style:N,vars:A,autoContrast:P,mod:U,attributes:B,...Y}=n,X=hr(p),[te,$]=or({value:o,defaultValue:r,finalValue:null,onChange:l}),W=Ie({name:"Tabs",props:n,classes:qd,className:k,style:N,classNames:E,styles:R,unstyled:_,attributes:B,vars:A,varsResolver:$z});return a.jsx(Iz,{value:{placement:C,value:te,orientation:c,id:X,loop:f,activateTabWithKeyboard:m,getTabId:IC(`${X}-tab`,VE),getPanelId:IC(`${X}-panel`,VE),onChange:$,allowTabDeactivation:g,variant:y,color:b,radius:w,inverted:j,keepMounted:T,unstyled:_,getStyles:W},children:a.jsx(ue,{ref:t,id:X,variant:y,mod:[{orientation:c,inverted:c==="horizontal"&&j,placement:c==="vertical"&&C},U],...W("root"),...Y,children:d})})});kt.classes=qd;kt.displayName="@mantine/core/Tabs";kt.Tab=_0;kt.Panel=R0;kt.List=T0;const Be=be((e,t)=>{const n=ae("TextInput",null,e);return a.jsx(Pr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});Be.classes=Pr.classes;Be.displayName="@mantine/core/TextInput";var VD={root:"m_7341320d"};const Uz=(e,{size:t,radius:n,variant:r,gradient:o,color:l,autoContrast:c})=>{const d=e.variantColorResolver({color:l||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:c});return{root:{"--ti-size":at(t,"ti-size"),"--ti-radius":n===void 0?void 0:Vt(n),"--ti-bg":l||r?d.background:void 0,"--ti-color":l||r?d.color:void 0,"--ti-bd":l||r?d.border:void 0}}},D0=be((e,t)=>{const n=ae("ThemeIcon",null,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,autoContrast:p,attributes:m,...g}=n,y=Ie({name:"ThemeIcon",classes:VD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:m,vars:f,varsResolver:Uz});return a.jsx(ue,{ref:t,...y("root"),...g})});D0.classes=VD;D0.displayName="@mantine/core/ThemeIcon";const Bz=["h1","h2","h3","h4","h5","h6"],Vz=["xs","sm","md","lg","xl"];function Fz(e,t){const n=t!==void 0?t:`h${e}`;return Bz.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:Vz.includes(n)?{fontSize:`var(--mantine-font-size-${n})`,fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}:{fontSize:le(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var FD={root:"m_8a5d1357"};const Hz={order:1},qz=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const l=Fz(t||1,n);return{root:{"--title-fw":l.fontWeight,"--title-lh":l.lineHeight,"--title-fz":l.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},Le=be((e,t)=>{const n=ae("Title",Hz,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,order:f,vars:p,size:m,variant:g,lineClamp:y,textWrap:b,mod:w,attributes:j,...C}=n,T=Ie({name:"Title",props:n,classes:FD,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:j,vars:p,varsResolver:qz});return[1,2,3,4,5,6].includes(f)?a.jsx(ue,{...T("root"),component:`h${f}`,variant:g,ref:t,mod:[{order:f,"data-line-clamp":typeof y=="number"},w],size:m,...C}):null});Le.classes=FD;Le.displayName="@mantine/core/Title";function Gz(e){let t=e,n=!1;const r=new Set;return{getState(){return t},updateState(o){t=typeof o=="function"?o(t):o},setState(o){this.updateState(o),r.forEach(l=>l(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function Wz(e){return v.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function Qz(e,t,n){const r=[],o=[],l={};for(const c of e){const d=c.position||t;l[d]=l[d]||0,l[d]+=1,l[d]<=n?o.push(c):r.push(c)}return{notifications:o,queue:r}}const Yz=()=>Gz({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Cl=Yz(),Kz=(e=Cl)=>Wz(e);function nu(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=Qz(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function ke(e,t=Cl){const n=e.id||tp();return nu(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function HD(e,t=Cl){return nu(t,n=>n.filter(r=>r.id===e?(r.onClose?.(r),!1):!0)),e}function Xs(e,t=Cl){return nu(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function Xz(e=Cl){nu(e,()=>[])}function Jz(e=Cl){nu(e,t=>t.slice(0,e.getState().limit))}const Di={show:ke,hide:HD,update:Xs,clean:Xz,cleanQueue:Jz,updateState:nu};function yx(e,t){return yx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},yx(e,t)}function qD(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,yx(e,t)}var Cy={exports:{}},Ey,FE;function Zz(){if(FE)return Ey;FE=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return Ey=e,Ey}var Ty,HE;function e8(){if(HE)return Ty;HE=1;var e=Zz();function t(){}function n(){}return n.resetWarningCache=t,Ty=function(){function r(c,d,f,p,m,g){if(g!==e){var y=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw y.name="Invariant Violation",y}}r.isRequired=r;function o(){return r}var l={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:n,resetWarningCache:t};return l.PropTypes=l,l},Ty}var qE;function t8(){return qE||(qE=1,Cy.exports=e8()()),Cy.exports}var n8=t8();const sn=Op(n8),GE={disabled:!1},up=Dn.createContext(null);var r8=function(t){return t.scrollTop},ad="unmounted",qs="exited",Gs="entering",jc="entered",xx="exiting",_a=(function(e){qD(t,e);function t(r,o){var l;l=e.call(this,r,o)||this;var c=o,d=c&&!c.isMounting?r.enter:r.appear,f;return l.appearStatus=null,r.in?d?(f=qs,l.appearStatus=Gs):f=jc:r.unmountOnExit||r.mountOnEnter?f=ad:f=qs,l.state={status:f},l.nextCallback=null,l}t.getDerivedStateFromProps=function(o,l){var c=o.in;return c&&l.status===ad?{status:qs}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var l=null;if(o!==this.props){var c=this.state.status;this.props.in?c!==Gs&&c!==jc&&(l=Gs):(c===Gs||c===jc)&&(l=xx)}this.updateStatus(!1,l)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,l,c,d;return l=c=d=o,o!=null&&typeof o!="number"&&(l=o.exit,c=o.enter,d=o.appear!==void 0?o.appear:c),{exit:l,enter:c,appear:d}},n.updateStatus=function(o,l){if(o===void 0&&(o=!1),l!==null)if(this.cancelNextCallback(),l===Gs){if(this.props.unmountOnExit||this.props.mountOnEnter){var c=this.props.nodeRef?this.props.nodeRef.current:od.findDOMNode(this);c&&r8(c)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===qs&&this.setState({status:ad})},n.performEnter=function(o){var l=this,c=this.props.enter,d=this.context?this.context.isMounting:o,f=this.props.nodeRef?[d]:[od.findDOMNode(this),d],p=f[0],m=f[1],g=this.getTimeouts(),y=d?g.appear:g.enter;if(!o&&!c||GE.disabled){this.safeSetState({status:jc},function(){l.props.onEntered(p)});return}this.props.onEnter(p,m),this.safeSetState({status:Gs},function(){l.props.onEntering(p,m),l.onTransitionEnd(y,function(){l.safeSetState({status:jc},function(){l.props.onEntered(p,m)})})})},n.performExit=function(){var o=this,l=this.props.exit,c=this.getTimeouts(),d=this.props.nodeRef?void 0:od.findDOMNode(this);if(!l||GE.disabled){this.safeSetState({status:qs},function(){o.props.onExited(d)});return}this.props.onExit(d),this.safeSetState({status:xx},function(){o.props.onExiting(d),o.onTransitionEnd(c.exit,function(){o.safeSetState({status:qs},function(){o.props.onExited(d)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,l){l=this.setNextCallback(l),this.setState(o,l)},n.setNextCallback=function(o){var l=this,c=!0;return this.nextCallback=function(d){c&&(c=!1,l.nextCallback=null,o(d))},this.nextCallback.cancel=function(){c=!1},this.nextCallback},n.onTransitionEnd=function(o,l){this.setNextCallback(l);var c=this.props.nodeRef?this.props.nodeRef.current:od.findDOMNode(this),d=o==null&&!this.props.addEndListener;if(!c||d){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var f=this.props.nodeRef?[this.nextCallback]:[c,this.nextCallback],p=f[0],m=f[1];this.props.addEndListener(p,m)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===ad)return null;var l=this.props,c=l.children;l.in,l.mountOnEnter,l.unmountOnExit,l.appear,l.enter,l.exit,l.timeout,l.addEndListener,l.onEnter,l.onEntering,l.onEntered,l.onExit,l.onExiting,l.onExited,l.nodeRef;var d=Jb(l,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Dn.createElement(up.Provider,{value:null},typeof c=="function"?c(o,d):Dn.cloneElement(Dn.Children.only(c),d))},t})(Dn.Component);_a.contextType=up;_a.propTypes={};function gc(){}_a.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:gc,onEntering:gc,onEntered:gc,onExit:gc,onExiting:gc,onExited:gc};_a.UNMOUNTED=ad;_a.EXITED=qs;_a.ENTERING=Gs;_a.ENTERED=jc;_a.EXITING=xx;function i8(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function A0(e,t){var n=function(l){return t&&v.isValidElement(l)?t(l):l},r=Object.create(null);return e&&v.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function o8(e,t){e=e||{},t=t||{};function n(m){return m in t?t[m]:e[m]}var r=Object.create(null),o=[];for(var l in e)l in t?o.length&&(r[l]=o,o=[]):o.push(l);var c,d={};for(var f in t){if(r[f])for(c=0;c<r[f].length;c++){var p=r[f][c];d[r[f][c]]=n(p)}d[f]=n(f)}for(c=0;c<o.length;c++)d[o[c]]=n(o[c]);return d}function Js(e,t,n){return n[t]!=null?n[t]:e.props[t]}function a8(e,t){return A0(e.children,function(n){return v.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Js(n,"appear",e),enter:Js(n,"enter",e),exit:Js(n,"exit",e)})})}function s8(e,t,n){var r=A0(e.children),o=o8(t,r);return Object.keys(o).forEach(function(l){var c=o[l];if(v.isValidElement(c)){var d=l in t,f=l in r,p=t[l],m=v.isValidElement(p)&&!p.props.in;f&&(!d||m)?o[l]=v.cloneElement(c,{onExited:n.bind(null,c),in:!0,exit:Js(c,"exit",e),enter:Js(c,"enter",e)}):!f&&d&&!m?o[l]=v.cloneElement(c,{in:!1}):f&&d&&v.isValidElement(p)&&(o[l]=v.cloneElement(c,{onExited:n.bind(null,c),in:p.props.in,exit:Js(c,"exit",e),enter:Js(c,"enter",e)}))}}),o}var l8=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},c8={component:"div",childFactory:function(t){return t}},is=(function(e){qD(t,e);function t(r,o){var l;l=e.call(this,r,o)||this;var c=l.handleExited.bind(i8(l));return l.state={contextValue:{isMounting:!0},handleExited:c,firstRender:!0},l}var n=t.prototype;return n.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},n.componentWillUnmount=function(){this.mounted=!1},t.getDerivedStateFromProps=function(o,l){var c=l.children,d=l.handleExited,f=l.firstRender;return{children:f?a8(o,d):s8(o,c,d),firstRender:!1}},n.handleExited=function(o,l){var c=A0(this.props.children);o.key in c||(o.props.onExited&&o.props.onExited(l),this.mounted&&this.setState(function(d){var f=lp({},d.children);return delete f[o.key],{children:f}}))},n.render=function(){var o=this.props,l=o.component,c=o.childFactory,d=Jb(o,["component","childFactory"]),f=this.state.contextValue,p=l8(this.state.children).map(c);return delete d.appear,delete d.enter,delete d.exit,l===null?Dn.createElement(up.Provider,{value:f},p):Dn.createElement(up.Provider,{value:f},Dn.createElement(l,d,p))},t})(Dn.Component);is.propTypes={};is.defaultProps=c8;const GD=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function u8(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),GD.reduce((n,r)=>(n[r]=[],n),{}))}const WE={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},d8={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function f8({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,l]=n.split("-"),c=l==="center"?`${o}-center`:l,d={opacity:0,maxHeight:t,transform:WE[c],transitionDuration:`${r}ms, ${r}ms, ${r}ms`,transitionTimingFunction:"cubic-bezier(.51,.3,0,1.21), cubic-bezier(.51,.3,0,1.21), linear",transitionProperty:"opacity, transform, max-height"},f={opacity:1,transform:d8[c]},p={opacity:0,maxHeight:0,transform:WE[c]};return{...d,...{entering:f,entered:f,exiting:p,exited:p}[e]}}function h8(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const WD=v.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:l,message:c,...d}=e,f=h8(n,e.autoClose),p=v.useRef(-1),m=()=>window.clearTimeout(p.current),g=()=>{t(e.id),m()},y=()=>{typeof f=="number"&&(p.current=window.setTimeout(g,f))};return v.useEffect(()=>{e.onOpen?.(e)},[]),v.useEffect(()=>(y(),m),[f]),a.jsx(f0,{...r,...d,onClose:g,ref:o,onMouseEnter:m,onMouseLeave:y,children:c})});WD.displayName="@mantine/notifications/NotificationContainer";var QD={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const p8=_a,m8={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:di("overlay"),store:Cl,withinPortal:!0},g8=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t?.toString(),"--notifications-container-width":le(n)}}),Da=be((e,t)=>{const n=ae("Notifications",m8,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,position:p,autoClose:m,transitionDuration:g,containerWidth:y,notificationMaxHeight:b,limit:w,zIndex:j,store:C,portalProps:T,withinPortal:E,...R}=n,_=Sn(),k=Kz(C),N=gM(),A=eb(),P=v.useRef({}),U=v.useRef(0),Y=(_.respectReducedMotion?A:!1)?1:g,X=Ie({name:"Notifications",classes:QD,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,vars:f,varsResolver:g8});v.useEffect(()=>{C?.updateState(W=>({...W,limit:w||5,defaultPosition:p}))},[w,p]),rl(()=>{k.notifications.length>U.current&&setTimeout(()=>N(),0),U.current=k.notifications.length},[k.notifications]);const te=u8(k.notifications,p),$=GD.reduce((W,L)=>(W[L]=te[L].map(({style:I,...z})=>a.jsx(p8,{timeout:Y,onEnter:()=>P.current[z.id].offsetHeight,nodeRef:{current:P.current[z.id]},children:V=>a.jsx(WD,{ref:J=>{J&&(P.current[z.id]=J)},data:z,onHide:J=>HD(J,C),autoClose:m,...X("notification",{style:{...f8({state:V,position:L,transitionDuration:Y,maxHeight:b}),...I}})})},z.id)),W),{});return a.jsxs(va,{withinPortal:E,...T,children:[a.jsx(ue,{...X("root"),"data-position":"top-center",ref:t,...R,children:a.jsx(is,{children:$["top-center"]})}),a.jsx(ue,{...X("root"),"data-position":"top-left",...R,children:a.jsx(is,{children:$["top-left"]})}),a.jsx(ue,{...X("root",{className:Pc.classNames.fullWidth}),"data-position":"top-right",...R,children:a.jsx(is,{children:$["top-right"]})}),a.jsx(ue,{...X("root",{className:Pc.classNames.fullWidth}),"data-position":"bottom-right",...R,children:a.jsx(is,{children:$["bottom-right"]})}),a.jsx(ue,{...X("root"),"data-position":"bottom-left",...R,children:a.jsx(is,{children:$["bottom-left"]})}),a.jsx(ue,{...X("root"),"data-position":"bottom-center",...R,children:a.jsx(is,{children:$["bottom-center"]})})]})});Da.classes=QD;Da.displayName="@mantine/notifications/Notifications";Da.show=Di.show;Da.hide=Di.hide;Da.update=Di.update;Da.clean=Di.clean;Da.cleanQueue=Di.cleanQueue;Da.updateState=Di.updateState;class v8{operator;child;constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Gd{operator;left;right;constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`(${this.left.toString()} ${this.operator} ${this.right.toString()})`}}class y8{prefixParselets={};infixParselets={};registerInfix(t,n){return this.infixParselets[t]=n,this}registerPrefix(t,n){return this.prefixParselets[t]=n,this}prefix(t,n,r){return this.registerPrefix(t,{parse(o,l){const c=o.consumeAndParse(n);return r(l,c)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,l,c){const d=o.consumeAndParse(n);return r(l,c,d)},precedence:n})}construct(t){return new x8(t,this.prefixParselets,this.infixParselets)}}class x8{tokens;prefixParselets;infixParselets;constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){return this.peek()?.id!==t?!1:(this.consume(),!0)}consumeAndParse(t=1/0){const n=this.consume(),r=this.prefixParselets[n.id];if(!r)throw Error(`Parse error at "${n.value}" (line ${n.line}, column ${n.column}). No matching prefix parselet.`);let o=r.parse(this,n);for(;t>this.getPrecedence();){const l=this.consume();o=this.getInfixParselet(l).parse(this,o,l)}return o}getPrecedence(){const t=this.peek();if(!t)return 1/0;const n=this.getInfixParselet(t);return n?n.precedence:1/0}consume(t,n){if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&this.peek()?.id!==t){const r=this.peek();throw Error(`Expected ${t} but got "${r.id}" (${r.value}) at line ${r.line} column ${r.column}.`)}if(n&&this.peek()?.value!==n){const r=this.peek();throw Error(`Expected "${n}" but got "${r.value}" at line ${r.line} column ${r.column}.`)}return this.tokens.shift()}peek(){return this.tokens.length>0?this.tokens[0]:void 0}removeComments(){this.tokens=this.tokens.filter(t=>t.id!=="Comment")}getInfixParselet(t){return this.infixParselets[t.id==="Symbol"?t.value:t.id]}}class YD{max;cache;constructor(t=10){this.max=t,this.cache=new Map}clear(){this.cache.clear()}get(t){const n=this.cache.get(t);return n&&(this.cache.delete(t),this.cache.set(t,n)),n}set(t,n){this.cache.has(t)?this.cache.delete(t):this.cache.size>=this.max&&this.cache.delete(this.first()),this.cache.set(t,n)}delete(t){this.cache.delete(t)}keys(){return this.cache.keys()}first(){return this.cache.keys().next().value}}const ro="http://hl7.org",KD="ok",b8="created",S8="gone",w8="not-modified",j8="not-found",C8="unauthorized",E8="forbidden",T8="accepted",R8={resourceType:"OperationOutcome",id:KD,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},_8={resourceType:"OperationOutcome",id:j8,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},xd={resourceType:"OperationOutcome",id:C8,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},D8={...xd,issue:[...xd.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},QE={...xd,issue:[...xd.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},Wd={resourceType:"OperationOutcome",id:E8,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function jo(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function xn(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function A8(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function k8(e){return!e||typeof e!="object"?!1:e instanceof Error||typeof DOMException<"u"&&e instanceof DOMException?!0:Object.prototype.toString.call(e)==="[object Error]"}function Sm(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function XD(e){return e.id===KD||e.id===b8||e.id===w8||e.id===T8}function P8(e){return e.id===S8}class gt extends Error{outcome;constructor(t,n){super(JD(t)),this.outcome=t,this.cause=n}}function Yt(e){return e instanceof gt?e.outcome:Sm(e)?e:jo(Ye(e))}function Ye(e){return e?typeof e=="string"?e:k8(e)?e.message:Sm(e)?JD(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function JD(e){const t=e.issue?.map(ZD)??[];return t.length>0?t.join("; "):"Unknown error"}function ZD(e){let t;return e.details?.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",e.expression?.length&&(t+=` (${e.expression.join(", ")})`),t}function O8(e,t){const n=t.max&&t.max===Number.MAX_SAFE_INTEGER?Number.POSITIVE_INFINITY:t.max;return{path:e,description:"",type:t.type??[],min:t.min??0,max:n??1,isArray:!!n&&n>1,constraints:[]}}function N8(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,type:n,path:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,l])=>[o,O8(o,l)])),constraints:[],innerTypes:[]};return t}const M8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},L8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},I8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"code"}]},text:{type:[{code:"string"}]},line:{max:9007199254740991,type:[{code:"string"}]},city:{type:[{code:"string"}]},district:{type:[{code:"string"}]},state:{type:[{code:"string"}]},postalCode:{type:[{code:"string"}]},country:{type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},$8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"author[x]":{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Organization"]},{code:"string"}]},time:{type:[{code:"dateTime"}]},text:{min:1,type:[{code:"markdown"}]}}},U8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},contentType:{type:[{code:"code"}]},language:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]},url:{type:[{code:"url"}]},size:{type:[{code:"unsignedInt"}]},hash:{type:[{code:"base64Binary"}]},title:{type:[{code:"string"}]},creation:{type:[{code:"dateTime"}]}}},B8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},V8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},code:{type:[{code:"code"}]},display:{type:[{code:"string"}]},userSelected:{type:[{code:"boolean"}]}}},F8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},H8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},system:{type:[{code:"code"}]},value:{type:[{code:"string"}]},use:{type:[{code:"code"}]},rank:{type:[{code:"positiveInt"}]},period:{type:[{code:"Period"}]}}},q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{min:1,type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]}}},G8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},W8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},"subject[x]":{type:[{code:"CodeableConcept"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Group"]}]},mustSupport:{max:9007199254740991,type:[{code:"string"}]},codeFilter:{max:9007199254740991,type:[{code:"DataRequirementCodeFilter"}]},dateFilter:{max:9007199254740991,type:[{code:"DataRequirementDateFilter"}]},limit:{type:[{code:"positiveInt"}]},sort:{max:9007199254740991,type:[{code:"DataRequirementSort"}]}}},Q8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]},code:{max:9007199254740991,type:[{code:"Coding"}]}}},Y8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{type:[{code:"string"}]},searchParam:{type:[{code:"string"}]},"value[x]":{type:[{code:"dateTime"},{code:"Period"},{code:"Duration"}]}}},K8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},direction:{min:1,type:[{code:"code"}]}}},X8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},J8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},sequence:{type:[{code:"integer"}]},text:{type:[{code:"string"}]},additionalInstruction:{max:9007199254740991,type:[{code:"CodeableConcept"}]},patientInstruction:{type:[{code:"string"}]},timing:{type:[{code:"Timing"}]},"asNeeded[x]":{type:[{code:"boolean"},{code:"CodeableConcept"}]},site:{type:[{code:"CodeableConcept"}]},route:{type:[{code:"CodeableConcept"}]},method:{type:[{code:"CodeableConcept"}]},doseAndRate:{max:9007199254740991,type:[{code:"DosageDoseAndRate"}]},maxDosePerPeriod:{type:[{code:"Ratio"}]},maxDosePerAdministration:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},maxDosePerLifetime:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},Z8={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{type:[{code:"CodeableConcept"}]},"dose[x]":{type:[{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},"rate[x]":{type:[{code:"Ratio"},{code:"Range"},{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},e$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},t$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},representation:{max:9007199254740991,type:[{code:"code"}]},sliceName:{type:[{code:"string"}]},sliceIsConstraining:{type:[{code:"boolean"}]},label:{type:[{code:"string"}]},code:{max:9007199254740991,type:[{code:"Coding"}]},slicing:{type:[{code:"ElementDefinitionSlicing"}]},short:{type:[{code:"string"}]},definition:{type:[{code:"markdown"}]},comment:{type:[{code:"markdown"}]},requirements:{type:[{code:"markdown"}]},alias:{max:9007199254740991,type:[{code:"string"}]},min:{type:[{code:"unsignedInt"}]},max:{type:[{code:"string"}]},base:{type:[{code:"ElementDefinitionBase"}]},contentReference:{type:[{code:"uri"}]},type:{max:9007199254740991,type:[{code:"ElementDefinitionType"}]},"defaultValue[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},meaningWhenMissing:{type:[{code:"markdown"}]},orderMeaning:{type:[{code:"string"}]},"fixed[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},"pattern[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]},example:{max:9007199254740991,type:[{code:"ElementDefinitionExample"}]},"minValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},"maxValue[x]":{type:[{code:"date"},{code:"dateTime"},{code:"instant"},{code:"time"},{code:"decimal"},{code:"integer"},{code:"positiveInt"},{code:"unsignedInt"},{code:"Quantity"}]},maxLength:{type:[{code:"integer"}]},condition:{max:9007199254740991,type:[{code:"id"}]},constraint:{max:9007199254740991,type:[{code:"ElementDefinitionConstraint"}]},mustSupport:{type:[{code:"boolean"}]},isModifier:{type:[{code:"boolean"}]},isModifierReason:{type:[{code:"string"}]},isSummary:{type:[{code:"boolean"}]},binding:{type:[{code:"ElementDefinitionBinding"}]},mapping:{max:9007199254740991,type:[{code:"ElementDefinitionMapping"}]}}},n$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},path:{min:1,type:[{code:"string"}]}}},r$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},discriminator:{max:9007199254740991,type:[{code:"ElementDefinitionSlicingDiscriminator"}]},description:{type:[{code:"string"}]},ordered:{type:[{code:"boolean"}]},rules:{min:1,type:[{code:"code"}]}}},i$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},path:{min:1,type:[{code:"string"}]},min:{min:1,type:[{code:"unsignedInt"}]},max:{min:1,type:[{code:"string"}]}}},o$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},targetProfile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition","http://hl7.org/fhir/StructureDefinition/ImplementationGuide"]}]},aggregation:{max:9007199254740991,type:[{code:"code"}]},versioning:{type:[{code:"code"}]}}},a$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},label:{min:1,type:[{code:"string"}]},"value[x]":{min:1,type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},s$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},key:{min:1,type:[{code:"id"}]},requirements:{type:[{code:"string"}]},severity:{min:1,type:[{code:"code"}]},human:{min:1,type:[{code:"string"}]},expression:{type:[{code:"string"}]},xpath:{type:[{code:"string"}]},source:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},l$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},strength:{min:1,type:[{code:"code"}]},description:{type:[{code:"string"}]},valueSet:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/ValueSet"]}]}}},c$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},identity:{min:1,type:[{code:"id"}]},language:{type:[{code:"code"}]},map:{min:1,type:[{code:"string"}]},comment:{type:[{code:"string"}]}}},u$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},description:{type:[{code:"string"}]},name:{type:[{code:"id"}]},language:{min:1,type:[{code:"code"}]},expression:{type:[{code:"string"}]},reference:{type:[{code:"uri"}]}}},d$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},url:{min:1,type:[{code:"uri"}]},"value[x]":{type:[{code:"base64Binary"},{code:"boolean"},{code:"canonical"},{code:"code"},{code:"date"},{code:"dateTime"},{code:"decimal"},{code:"id"},{code:"instant"},{code:"integer"},{code:"markdown"},{code:"oid"},{code:"positiveInt"},{code:"string"},{code:"time"},{code:"unsignedInt"},{code:"uri"},{code:"url"},{code:"uuid"},{code:"Address"},{code:"Age"},{code:"Annotation"},{code:"Attachment"},{code:"CodeableConcept"},{code:"Coding"},{code:"ContactPoint"},{code:"Count"},{code:"Distance"},{code:"Duration"},{code:"HumanName"},{code:"Identifier"},{code:"Money"},{code:"Period"},{code:"Quantity"},{code:"Range"},{code:"Ratio"},{code:"Reference"},{code:"SampledData"},{code:"Signature"},{code:"Timing"},{code:"ContactDetail"},{code:"Contributor"},{code:"DataRequirement"},{code:"Expression"},{code:"ParameterDefinition"},{code:"RelatedArtifact"},{code:"TriggerDefinition"},{code:"UsageContext"},{code:"Dosage"},{code:"Meta"}]}}},f$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},text:{type:[{code:"string"}]},family:{type:[{code:"string"}]},given:{max:9007199254740991,type:[{code:"string"}]},prefix:{max:9007199254740991,type:[{code:"string"}]},suffix:{max:9007199254740991,type:[{code:"string"}]},period:{type:[{code:"Period"}]}}},h$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},use:{type:[{code:"code"}]},type:{type:[{code:"CodeableConcept"}]},system:{type:[{code:"uri"}]},value:{type:[{code:"string"}]},period:{type:[{code:"Period"}]},assigner:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},p$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},country:{min:1,type:[{code:"CodeableConcept"}]},jurisdiction:{type:[{code:"CodeableConcept"}]},status:{min:1,type:[{code:"CodeableConcept"}]},dateRange:{min:1,type:[{code:"Period"}]},restoreDate:{type:[{code:"dateTime"}]}}},m$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},versionId:{type:[{code:"id"}]},lastUpdated:{type:[{code:"instant"}]},source:{type:[{code:"uri"}]},profile:{max:9007199254740991,type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]},security:{max:9007199254740991,type:[{code:"Coding"}]},tag:{max:9007199254740991,type:[{code:"Coding"}]},project:{type:[{code:"uri"}]},author:{type:[{code:"Reference"}]},onBehalfOf:{type:[{code:"Reference"}]},account:{type:[{code:"Reference"}]},accounts:{max:9007199254740991,type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},g$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},v$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},y$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"code"}]},use:{min:1,type:[{code:"code"}]},min:{type:[{code:"integer"}]},max:{type:[{code:"string"}]},documentation:{type:[{code:"string"}]},type:{min:1,type:[{code:"code"}]},profile:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/StructureDefinition"]}]}}},x$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},b$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"age[x]":{type:[{code:"Range"},{code:"CodeableConcept"}]},gender:{type:[{code:"CodeableConcept"}]},race:{type:[{code:"CodeableConcept"}]},physiologicalCondition:{type:[{code:"CodeableConcept"}]}}},S$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},height:{type:[{code:"Quantity"}]},width:{type:[{code:"Quantity"}]},depth:{type:[{code:"Quantity"}]},weight:{type:[{code:"Quantity"}]},nominalVolume:{type:[{code:"Quantity"}]},externalDiameter:{type:[{code:"Quantity"}]},shape:{type:[{code:"string"}]},color:{max:9007199254740991,type:[{code:"string"}]},imprint:{max:9007199254740991,type:[{code:"string"}]},image:{max:9007199254740991,type:[{code:"Attachment"}]},scoring:{type:[{code:"CodeableConcept"}]}}},w$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},identifier:{type:[{code:"Identifier"}]},type:{min:1,type:[{code:"CodeableConcept"}]},period:{min:1,type:[{code:"Quantity"}]},specialPrecautionsForStorage:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},j$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},C$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},low:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},high:{type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]}}},E$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},T$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},reference:{type:[{code:"string"}]},type:{type:[{code:"uri"}]},identifier:{type:[{code:"Identifier"}]},display:{type:[{code:"string"}]}}},R$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},label:{type:[{code:"string"}]},display:{type:[{code:"string"}]},citation:{type:[{code:"markdown"}]},url:{type:[{code:"url"}]},document:{type:[{code:"Attachment"}]},resource:{type:[{code:"canonical",targetProfile:["http://hl7.org/fhir/StructureDefinition/Resource"]}]}}},_$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},origin:{min:1,type:[{code:"Quantity",profile:["http://hl7.org/fhir/StructureDefinition/SimpleQuantity"]}]},period:{min:1,type:[{code:"decimal"}]},factor:{type:[{code:"decimal"}]},lowerLimit:{type:[{code:"decimal"}]},upperLimit:{type:[{code:"decimal"}]},dimensions:{min:1,type:[{code:"positiveInt"}]},data:{type:[{code:"string"}]}}},D$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,max:9007199254740991,type:[{code:"Coding"}]},when:{min:1,type:[{code:"instant"}]},who:{min:1,type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},onBehalfOf:{type:[{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Practitioner","http://hl7.org/fhir/StructureDefinition/PractitionerRole","http://hl7.org/fhir/StructureDefinition/RelatedPerson","http://hl7.org/fhir/StructureDefinition/Patient","http://hl7.org/fhir/StructureDefinition/Device","http://hl7.org/fhir/StructureDefinition/Organization"]}]},targetFormat:{type:[{code:"code"}]},sigFormat:{type:[{code:"code"}]},data:{type:[{code:"base64Binary"}]}}},A$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},"amount[x]":{type:[{code:"Quantity"},{code:"Range"},{code:"string"}]},amountType:{type:[{code:"CodeableConcept"}]},amountText:{type:[{code:"string"}]},referenceRange:{type:[{code:"SubstanceAmountReferenceRange"}]}}},k$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},lowLimit:{type:[{code:"Quantity"}]},highLimit:{type:[{code:"Quantity"}]}}},P$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},event:{max:9007199254740991,type:[{code:"dateTime"}]},repeat:{type:[{code:"TimingRepeat"}]},code:{type:[{code:"CodeableConcept"}]}}},O$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},"bounds[x]":{type:[{code:"Duration"},{code:"Range"},{code:"Period"}]},count:{type:[{code:"positiveInt"}]},countMax:{type:[{code:"positiveInt"}]},duration:{type:[{code:"decimal"}]},durationMax:{type:[{code:"decimal"}]},durationUnit:{type:[{code:"code"}]},frequency:{type:[{code:"positiveInt"}]},frequencyMax:{type:[{code:"positiveInt"}]},period:{type:[{code:"decimal"}]},periodMax:{type:[{code:"decimal"}]},periodUnit:{type:[{code:"code"}]},dayOfWeek:{max:9007199254740991,type:[{code:"code"}]},timeOfDay:{max:9007199254740991,type:[{code:"time"}]},when:{max:9007199254740991,type:[{code:"code"}]},offset:{type:[{code:"unsignedInt"}]}}},N$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},type:{min:1,type:[{code:"code"}]},name:{type:[{code:"string"}]},"timing[x]":{type:[{code:"Timing"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/Schedule"]},{code:"date"},{code:"dateTime"}]},data:{max:9007199254740991,type:[{code:"DataRequirement"}]},condition:{type:[{code:"Expression"}]}}},M$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},code:{min:1,type:[{code:"Coding"}]},"value[x]":{min:1,type:[{code:"CodeableConcept"},{code:"Quantity"},{code:"Range"},{code:"Reference",targetProfile:["http://hl7.org/fhir/StructureDefinition/PlanDefinition","http://hl7.org/fhir/StructureDefinition/ResearchStudy","http://hl7.org/fhir/StructureDefinition/InsurancePlan","http://hl7.org/fhir/StructureDefinition/HealthcareService","http://hl7.org/fhir/StructureDefinition/Group","http://hl7.org/fhir/StructureDefinition/Location","http://hl7.org/fhir/StructureDefinition/Organization"]}]}}},L$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},I$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},comparator:{max:0,type:[{code:"code"}]},unit:{type:[{code:"string"}]},system:{type:[{code:"uri"}]},code:{type:[{code:"code"}]}}},z$={elements:{authorizeUrl:{min:1,type:[{code:"string"}]},tokenUrl:{min:1,type:[{code:"string"}]},tokenAuthMethod:{type:[{code:"code"}]},userInfoUrl:{min:1,type:[{code:"string"}]},clientId:{min:1,type:[{code:"string"}]},clientSecret:{min:1,type:[{code:"string"}]},usePkce:{type:[{code:"boolean"}]},useSubject:{type:[{code:"boolean"}]}}},$$={Element:M8,BackboneElement:L8,Address:I8,Age:z8,Annotation:$8,Attachment:U8,CodeableConcept:B8,Coding:V8,ContactDetail:F8,ContactPoint:H8,Contributor:q8,Count:G8,DataRequirement:W8,DataRequirementCodeFilter:Q8,DataRequirementDateFilter:Y8,DataRequirementSort:K8,Distance:X8,Dosage:J8,DosageDoseAndRate:Z8,Duration:e$,ElementDefinition:t$,ElementDefinitionSlicingDiscriminator:n$,ElementDefinitionSlicing:r$,ElementDefinitionBase:i$,ElementDefinitionType:o$,ElementDefinitionExample:a$,ElementDefinitionConstraint:s$,ElementDefinitionBinding:l$,ElementDefinitionMapping:c$,Expression:u$,Extension:d$,HumanName:f$,Identifier:h$,MarketingStatus:p$,Meta:m$,Money:g$,Narrative:v$,ParameterDefinition:y$,Period:x$,Population:b$,ProdCharacteristic:S$,ProductShelfLife:w$,Quantity:j$,Range:C$,Ratio:E$,Reference:T$,RelatedArtifact:R$,SampledData:_$,Signature:D$,SubstanceAmount:A$,SubstanceAmountReferenceRange:k$,Timing:P$,TimingRepeat:O$,TriggerDefinition:N$,UsageContext:M$,MoneyQuantity:L$,SimpleQuantity:I$,IdentityProvider:z$};function U$(e){return new V$(e).parse()}const dp=N8($$),k0=Object.create(null),YE=Object.create(null),B$={"http://hl7.org/fhir/StructureDefinition/MoneyQuantity":"MoneyQuantity","http://hl7.org/fhir/StructureDefinition/SimpleQuantity":"SimpleQuantity","http://hl7.org/fhir/uv/sql-on-fhir/StructureDefinition/ViewDefinition":"ViewDefinition"};function eA(e){let t;return t=YE[e],t||(t=YE[e]=Object.create(null)),t}function KE(e){const n=(Array.isArray(e)?e:e.entry?.map(r=>r.resource)??[]).filter(r=>r?.resourceType==="StructureDefinition");PU(n);for(const r of n)tA(r)}function tA(e){if(!e?.name)throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=U$(e),n=B$[e.url];let r,o;n?(r=dp,o=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||e.type?.startsWith("http://")||e.type?.startsWith("https://")?(r=dp,o=e.type):(r=eA(e.url),o=e.type),r[o]=t;for(const l of t.innerTypes)l.parentType=t,r[l.name]=l;k0[e.url]=t}function nA(e){return!!dp[e]}function wm(e,t){if(t){const n=eA(t)[e];if(n)return n}return dp[e]}function rA(e,t){const n=wm(e,t);if(!n)throw new gt(jo("Unknown data type: "+e));return n}function P0(e){return!!k0[e]}function ru(e){return k0[e]}class V${root;elements;elementIndex;index;resourceSchema;slicingContext;innerTypes;backboneContext;constructor(t){if(!t.snapshot?.element||t.snapshot.element.length===0)throw new Error(`No snapshot defined for StructureDefinition '${t.name}'`);this.root=t.snapshot.element[0],this.elements=t.snapshot.element.slice(1),this.elementIndex=Object.create(null),this.index=0,this.resourceSchema={name:t.name,path:this.root.path,title:t.title,type:t.type,url:t.url,version:t.version,kind:t.kind,description:q$(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if(t.id?.includes(":")){if(this.slicingContext?.current){const n=Ry(t,this.slicingContext.path);this.slicingContext.current.elements[n]=this.parseElementDefinition(t)}}else{const n=this.parseElementDefinition(t);this.checkFieldEnter(t,n);let r=this.backboneContext;for(;r;){if(t.path?.startsWith(r.path+".")){r.type.elements[Ry(t,r.path)]=n;break}r=r.parent}if(!r){const o=Ry(t,this.root.path);t.isSummary&&this.resourceSchema.summaryProperties?.add(o.replace("[x]","")),n.min>0&&this.resourceSchema.mandatoryProperties?.add(o.replace("[x]","")),this.resourceSchema.elements[o]=n}this.checkFieldExit(t)}t=this.next()}return this.checkFieldExit(),this.innerTypes.length>0&&(this.resourceSchema.innerTypes=this.innerTypes),this.resourceSchema}checkFieldEnter(t,n){this.isInnerType(t)&&this.enterInnerType(t),this.slicingContext&&!vc(this.slicingContext.path,t?.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){for(;this.backboneContext&&!vc(this.backboneContext?.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=iT(t);this.backboneContext={type:{name:n,type:n,path:t.path,title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path,parent:vc(this.backboneContext?.path,t.path)?this.backboneContext:this.backboneContext?.parent}}enterSlice(t,n){H$(t)&&!this.peek()?.sliceName||(n.slicing={discriminator:(t.slicing?.discriminator??[]).map(r=>{if(r.type!=="value"&&r.type!=="pattern"&&r.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${r.type}`);return{path:r.path,type:r.type}}),slices:[],ordered:t.slicing?.ordered??!1,rule:t.slicing?.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!vc(this.backboneContext.path,t?.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!vc(this.backboneContext.path,t?.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0}next(){const t=this.peek();if(t)return this.index++,t}peek(){const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const n=t.contentReference.slice(t.contentReference.indexOf("#")+1),r=this.elementIndex[n];return r?{...r,id:t.id,path:t.path,min:t.min??r.min,max:t.max??r.max,base:{path:r.base?.path??n,min:t.base?.min??r.base?.min??r.min,max:t.base?.max??r.base?.max??r.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){const n=this.peek();return!!(vc(t?.path,n?.path)&&t.type?.some(r=>["BackboneElement","Element"].includes(r.code)))}parseSliceStart(t){if(!this.slicingContext)throw new Error(`Invalid slice start before discriminator: ${t.sliceName} (${t.id})`);this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}},this.slicingContext.field.slices.push(this.slicingContext.current)}parseElementDefinitionType(t){return(t.type??[]).map(n=>{let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=iT(t)),r||(r=Lo(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type")?.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){const n=XE(t.max),r=t.base?.max?XE(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||t.base?.path||"",min:t.min??0,max:n,isArray:r>1,constraints:(t.constraint??[]).map(l=>({key:l.key??"",severity:l.severity??"error",expression:l.expression??"",description:l.human??""})),type:this.parseElementDefinitionType(t),fixed:JE(Uc(o,"fixed[x]")),pattern:JE(Uc(o,"pattern[x]")),binding:t.binding}}}function XE(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Ry(e,t=""){return F$(e.path,t)}function F$(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function vc(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function JE(e){return Array.isArray(e)&&e.length>0?e[0]:bn(e)?void 0:e}function H$(e){const t=e.slicing?.discriminator;return!!(e.type?.some(n=>n.code==="Extension")&&t?.length===1&&t[0].type==="value"&&t[0].path==="url")}function q$(e){let t=e.description;return t?.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function G$(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n?.withPath?W$:Uc,[o,...l]=t.split(".");let c=[r(e,o,n)];for(const d of l){const f=[];for(const p of c)if(Array.isArray(p))for(const m of p)f.push(r(m,d,n));else(n?.withPath&&p?.value!==void 0||!n?.withPath&&p!==void 0)&&f.push(r(p,d,n));c=f}return c}function W$(e,t,n){const r=e.path;return Q$(Uc(e,t,n),r,t)}function Q$(e,t,n){const r=t?t+".":"";return e===void 0?{type:"undefined",value:void 0,path:`${r}${n}`}:Array.isArray(e)?e.map((o,l)=>({...o,path:`${r}${n}[${l}]`})):{...e,path:`${r}${n}`}}const iA={date:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1]))?)?$/,dateTime:/^(\d(\d(\d[1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2]\d|3[0-1])(T([01]\d|2[0-3])(:[0-5]\d:([0-5]\d|60)(\.\d{1,9})?)?)?)?(Z|[+-]((0\d|1[0-3]):[0-5]\d|14:00)?)?)?$/};function Y$(e,t,n,r){if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const l=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return M0(e,o.pattern);if(o.fixed)return Do(e,o.fixed);if(o.binding?.strength==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!l?.length?!1:l.some(c=>c.code===e.type)}return!1}function Ze(e){return[{type:re.boolean,value:e}]}function ci(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:re.integer,value:e}:typeof e=="number"?{type:re.decimal,value:e}:typeof e=="boolean"?{type:re.boolean,value:e}:typeof e=="string"?{type:re.string,value:e}:Ai(e)?{type:re.Quantity,value:e}:Io(e)?{type:e.resourceType,value:e}:vA(e)?{type:re.CodeableConcept,value:e}:gA(e)?{type:re.Coding,value:e}:{type:re.BackboneElement,value:e}}function bo(e){return e.length===0?!1:!!e[0].value}function ba(e,t){if(e.length!==0){if(e.length===1&&(!t||e[0].type===t))return e[0];throw new Error(`Expected singleton of type ${t}, but found ${JSON.stringify(e)}`)}}function Uc(e,t,n){if(!e.value)return;const r=ws(e.type,t,n?.profileUrl);return r?oA(e,t,r):Qd(e,t)}function oA(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let l,c="undefined",d;const f=n.path.lastIndexOf("."),p=n.path.substring(f+1);for(const m of o){const g=p.replace("[x]",qn(m.code));if(l=r[g],d=r["_"+g],l!==void 0||d!==void 0){c=m.code;break}}if(d)if(Array.isArray(l)){l=l.slice();for(let m=0;m<Math.max(l.length,d.length);m++)l[m]=_y(l[m],d[m])}else if(!l&&Array.isArray(d)){l=d.slice();for(let m=0;m<d.length;m++)l[m]=_y(void 0,d[m])}else l=_y(l,d);if(!bn(l))return(c==="Element"||c==="BackboneElement")&&(c=n.type[0].code),Array.isArray(l)?l.map(m=>ZE(m,c)):ZE(l,c)}function ZE(e,t){return t==="Resource"&&Io(e)&&(t=e.resourceType),{type:t,value:e}}function Qd(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n){const o=n[t];Array.isArray(o)?r=o.map(ci):r=ci(o)}else{const o=t.endsWith("[x]")?t.substring(0,t.length-3):t;for(const l of Object.values(re)){const c=o+qn(l);if(c in n){const d=n[c];Array.isArray(d)?r=d.map(f=>({type:l,value:f})):r={type:l,value:d};break}}}if(Array.isArray(r)){if(r.length===0||bn(r[0]))return}else if(bn(r))return;return r}function aA(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(bo(jm(n,o))){r=!0;break}r||t.push(n)}return t}function K$(e){return Ze(!bo(e))}function X$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!1):Ze(e.every((n,r)=>bo(jm(n,t[r]))))}function J$(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Ze(!0):Ze(e.some((n,r)=>!bo(jm(n,t[r]))))}function jm(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?Ze(Math.abs(n-r)<1e-8):Ai(n)&&Ai(r)?Ze(fA(n,r)):Ze(typeof n=="object"&&typeof r=="object"?O0(e,t):n===r)}function sA(e,t){return e.length===0&&t.length===0?Ze(!0):e.length!==t.length?Ze(!1):(e.sort(eT),t.sort(eT),Ze(e.every((n,r)=>bo(Z$(n,t[r])))))}function Z$(e,t){const{type:n,value:r}=e,{type:o,value:l}=t,c=r?.valueOf(),d=l?.valueOf();return typeof c=="number"&&typeof d=="number"?Ze(Math.abs(c-d)<.01):Ai(c)&&Ai(d)?Ze(fA(c,d)):Ze(n==="Coding"&&o==="Coding"?typeof c!="object"||typeof d!="object"?!1:c.code===d.code&&c.system===d.system:typeof c=="object"&&typeof d=="object"?O0({...c,id:void 0},{...d,id:void 0}):typeof c=="string"&&typeof d=="string"?c.toLowerCase()===d.toLowerCase():c===d)}function eT(e,t){const n=e.value?.valueOf(),r=t.value?.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function lA(e,t){const{value:n}=e;if(n==null)return!1;let r=t;switch(r.startsWith("System.")&&(r=r.substring(7)),r.startsWith("FHIR.")&&(r=r.substring(5)),r){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return cA(n);case"DateTime":return bd(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return uA(n);case"Quantity":return Ai(n);default:return e.type===r||typeof n=="object"&&n?.resourceType===r}}function cA(e){return typeof e=="string"&&!!iA.date.exec(e)}function bd(e){return typeof e=="string"&&!!iA.dateTime.exec(e)}function uA(e){return!!(e&&typeof e=="object"&&("start"in e&&bd(e.start)||"end"in e&&bd(e.end)))}function dA(e){if(e){if(cA(e)||bd(e))return{start:Th(e,"0000-01-01T00:00:00.000"),end:Th(e,"xxxx-12-31T23:59:59.999")};if(uA(e))return{start:e.start?Th(e.start,"0000-01-01T00:00:00.000"):void 0,end:e.end?Th(e.end,"xxxx-12-31T23:59:59.999"):void 0}}}function Th(e,t){let n="Z";const r=Math.max(e.indexOf("+",10),e.indexOf("-",10));r>-1?(n=e.substring(r),e=e.substring(0,r)):e.endsWith("Z")&&(e=e.substring(0,e.length-1));const o=e+t.substring(e.length)+n;return new Date(o).toISOString()}function Ai(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function fA(e,t){return Math.abs(e.value-t.value)<.01&&(e.unit===t.unit||e.code===t.code||e.unit===t.code||e.code===t.unit)}function O0(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const l=e[o],c=t[o];if(tT(l)&&tT(c)){if(!O0(l,c))return!1}else if(l!==c)return!1}return!0}function tT(e){return e!==null&&typeof e=="object"}function _y(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return eU(e??{},t)}return e}function eU(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function hA(e,t){return Io(e,t)&&"id"in e&&typeof e.id=="string"}function Wt(e){const t=Nt(e)??"undefined/undefined",n=Sa(e);return n===t?{reference:t}:{reference:t,display:n}}function Nt(e){if(Aa(e))return e.reference;if(hA(e))return`${e.resourceType}/${e.id}`}function ll(e){if(e)return Aa(e)?e.reference.split("/")[1]:e.id}function tU(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function Sa(e){if(tU(e)){const t=nU(e);if(t)return t}if(e.resourceType==="Device"){const t=rU(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return ps(e.medicationCodeableConcept);if(e.resourceType==="Subscription"&&e.criteria)return e.criteria;if(e.resourceType==="User"&&e.email)return e.email;if("name"in e&&e.name&&typeof e.name=="string")return e.name;if("code"in e&&e.code){let t=e.code;if(Array.isArray(t)&&(t=t[0]),vA(t))return ps(t);if(pU(t))return t.text}return Nt(e)??""}function nU(e){const t=e.name;if(t&&t.length>0)return iu(t[0])}function rU(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function iU(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=nT(n);if(r)return r}else return nT(t)}function nT(e){if(e.url&&e.contentType?.startsWith("image/"))return e.url}function pA(e,t){const n=new Date(e);n.setUTCHours(0,0,0,0);const r=t?new Date(t):new Date;r.setUTCHours(0,0,0,0);const o=n.getUTCFullYear(),l=n.getUTCMonth(),c=n.getUTCDate(),d=r.getUTCFullYear(),f=r.getUTCMonth(),p=r.getUTCDate();let m=d-o;(f<l||f===l&&p<c)&&m--;let g=d*12+f-(o*12+l);p<c&&g--;const y=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:m,months:g,days:y}}function oU(e,t){const{years:n,months:r,days:o}=pA(e,t);return n>=2?n.toString().padStart(3,"0")+"Y":r>=1?r.toString().padStart(3,"0")+"M":o.toString().padStart(3,"0")+"D"}function Lo(e,...t){let n=e;for(let r=0;r<t.length&&n;r++)n=n?.extension?.find(o=>o.url===t[r]);return n}function to(e,t){const n=N0(e);return JSON.stringify(n,null,t?2:void 0)??""}function N0(e){if(!(e==null||e===""))return typeof e=="object"?Array.isArray(e)?aU(e):sU(e):e}function aU(e){const t=e.length;if(t===0)return;let n,r=0;for(let o=0;o<t;o++){const l=e[o],c=N0(l);c!==l&&!n&&(n=Array.from(e)),c===void 0?n&&(n[o]=null):(n&&(n[o]=c),r++)}if(r!==0)return n??e}function sU(e){let t,n=0;for(const r in e){const o=e[r],l=N0(o);l!==o&&!t&&(t={...e}),l===void 0?t&&delete t[r]:(t&&(t[r]=l),n++)}if(n!==0)return t??e}function bn(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!An(e):!1}function An(e){if(e==null)return!1;const t=typeof e;return t==="string"&&e!==""||t==="object"&&("length"in e&&e.length>0||Object.keys(e).length>0)}function lU(e){if(!e)return;let t=e.length-1;for(;t>=0&&bn(e[t]);)t--;return t>=0?e.slice(0,t+1):void 0}function Do(e,t,n){return e===t||bn(e)&&bn(t)?!0:bn(e)||bn(t)?!1:Array.isArray(e)&&Array.isArray(t)?cU(e,t):Array.isArray(e)||Array.isArray(t)?!1:Sr(e)&&Sr(t)?uU(e,t,n):(Sr(e)||Sr(t),!1)}function cU(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Do(e[n],t[n]))return!1;return!0}function uU(e,t,n){const r=new Set;Object.keys(e).forEach(o=>r.add(o)),Object.keys(t).forEach(o=>r.add(o)),n==="meta"&&(r.delete("versionId"),r.delete("lastUpdated"),r.delete("author"));for(const o of r){const l=e[o],c=t[o];if(!Do(l,c,o))return!1}return!0}function M0(e,t){return bn(e)?!0:bn(t)?!1:Array.isArray(e)&&Array.isArray(t)?dU(e,t):Array.isArray(e)||Array.isArray(t)?!1:Sr(e)&&Sr(t)?fU(e,t):Sr(e)||Sr(t)?!1:e===t}function dU(e,t){return t.every(n=>e.some(r=>M0(r,n)))}function fU(e,t){return Object.entries(t).every(([n,r])=>n in e&&M0(e[n],r))}function ui(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function mA(e){return/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i.test(e)}function Sr(e){return e!==null&&typeof e=="object"}function hU(e){return typeof e=="string"}function gA(e){return Sr(e)&&"code"in e&&typeof e.code=="string"}function vA(e){return Sr(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(gA)}function pU(e){return Sr(e)&&"text"in e&&typeof e.text=="string"}const yA=[];for(let e=0;e<256;e++)yA.push(e.toString(16).padStart(2,"0"));function mU(e){const t=xA(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=yA[n[o]];return r.join("")}function gU(e){const t=xA(e),n=new Uint8Array(t),r=new Array(n.length);for(let o=0;o<n.length;o++)r[o]=String.fromCharCode(n[o]);return window.btoa(r.join(""))}function xA(e){return ArrayBuffer.isView(e)?e.buffer:e}function qn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function L0(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Zs(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function vU(e,t){return e.coding?.find(n=>n.system===t)?.code}function yU(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const rT=e=>new Promise(t=>{setTimeout(t,e)});function bx(e,t,n){const r=[];for(let o=0;o<n-1;o++){const l=e.indexOf(t);if(l<0)break;r.push(e.slice(0,l)),e=e.slice(l+t.length)}return r.push(e),r}function xU(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Zu(e,t){return e?(e.push(t),e):[t]}function Bc(e){return e.sort((t,n)=>t.localeCompare(n))}function I0(e){return e.endsWith("/")?e:e+"/"}function bU(e){return e.startsWith("/")?e.slice(1):e}function mo(e,t){return new URL(bU(t),I0(e.toString())).toString()}function SU(e,t){return mo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function wU(e){return typeof e=="object"&&!Array.isArray(e)&&!(e instanceof URLSearchParams)&&(e=Object.fromEntries(Object.entries(e).filter(t=>t[1]!==void 0))),new URLSearchParams(e).toString()}function bA(e,t){return e?.meta?.profile?.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function jU(e,t){if(e?.meta?.profile?.includes(t)){const n=e.meta.profile.indexOf(t);e.meta.profile.splice(n,1)}return e}function cl(e){if(!e)return"";switch(e.type){case"Address":return SA(e.value);case"CodeableConcept":return ps(e.value);case"Coding":return Yd(e.value);case"ContactPoint":return e.value.value;case"HumanName":return iu(e.value);case"Quantity":return el(e.value);case"Reference":return CU(e.value);default:return e.value?.toString()??""}}function CU(e){return e?e.display??e.reference??to(e):""}function SA(e,t){if(!e)return"";const n=[];if(e.line&&n.push(...e.line),e.city||e.state||e.postalCode){const r=[];e.city&&r.push(e.city),e.state&&r.push(e.state),e.postalCode&&r.push(e.postalCode),n.push(r.join(", "))}return e.use&&t?.use,n.join(", ").trim()}function iu(e,t){if(!e)return"";const n=[];if(e.prefix&&t?.prefix!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&t?.suffix!==!1&&n.push(...e.suffix),e.use&&(t?.all||t?.use)&&n.push("["+e.use+"]"),n.length===0){const r=wd(e.text);if(r)return r}return n.join(" ").trim()}function Cm(e){return e instanceof Date&&!isNaN(e.getTime())}function EU(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Cm(r)?r.toLocaleTimeString(t,n):""}function wr(e,t,n){if(!e)return"";const r=new Date(e);return Cm(r)?r.toLocaleString(t,n):""}function TU(e,t,n){return!e||!e.start&&!e.end?"":wr(e.start,t,n)+" - "+wr(e.end,t,n)}const RU={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},_U={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},DU={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function wA(e){if(!e)return"";const t=[];return AU(t,e.repeat),e.event&&t.push(e.event.map(n=>wr(n)).join(", ")),qn(t.join(" ").trim())}function AU(e,t){if(!t?.periodUnit)return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(RU[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+_U[o]):e.push("per "+r+" "+DU[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(qn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(l=>EU(l)).join(", "))}function Sd(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=e?.low&&{...e.low,comparator:void 0},o=e?.high&&{...e.high,comparator:void 0};return r?.value===void 0&&o?.value===void 0?"":r?.value!==void 0&&o?.value===void 0?`>= ${el(r)}`:r?.value===void 0&&o?.value!==void 0?`<= ${el(o)}`:(r?.unit===o?.unit&&delete r?.unit,`${el(r)} - ${el(o)}`)}function el(e,t){if(!e)return"";const n=[];return e.comparator&&(n.push(e.comparator),n.push(" ")),e.value!==void 0&&n.push(e.value),e.unit&&(e.unit!=="%"&&n.at(-1)!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function kU(e){return e?.value===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function ps(e){if(!e)return"";const t=wd(e.text);return t||(e.coding?e.coding.map(n=>Yd(n)).join(", "):"")}function Yd(e,t){const n=wd(e?.display);return n?`${n}`:wd(e?.code)??""}function jA(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(el(e.valueQuantity));else if(e.valueCodeableConcept)t.push(ps(e.valueCodeableConcept));else{const n=wd(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>jA(n)).join(" / ")),t.join(" / ").trim()}function wd(e){return typeof e=="string"?e:void 0}const re={Address:"Address",Age:"Age",Annotation:"Annotation",Attachment:"Attachment",BackboneElement:"BackboneElement",CodeableConcept:"CodeableConcept",Coding:"Coding",ContactDetail:"ContactDetail",ContactPoint:"ContactPoint",Contributor:"Contributor",Count:"Count",DataRequirement:"DataRequirement",Distance:"Distance",Dosage:"Dosage",Duration:"Duration",Expression:"Expression",Extension:"Extension",HumanName:"HumanName",Identifier:"Identifier",MarketingStatus:"MarketingStatus",Meta:"Meta",Money:"Money",Narrative:"Narrative",ParameterDefinition:"ParameterDefinition",Period:"Period",Population:"Population",ProdCharacteristic:"ProdCharacteristic",ProductShelfLife:"ProductShelfLife",Quantity:"Quantity",Range:"Range",Ratio:"Ratio",Reference:"Reference",RelatedArtifact:"RelatedArtifact",SampledData:"SampledData",Signature:"Signature",SubstanceAmount:"SubstanceAmount",SystemString:"http://hl7.org/fhirpath/System.String",Timing:"Timing",TriggerDefinition:"TriggerDefinition",UsageContext:"UsageContext",base64Binary:"base64Binary",boolean:"boolean",canonical:"canonical",code:"code",date:"date",dateTime:"dateTime",decimal:"decimal",id:"id",instant:"instant",integer:"integer",markdown:"markdown",oid:"oid",positiveInt:"positiveInt",string:"string",time:"time",unsignedInt:"unsignedInt",uri:"uri",url:"url",uuid:"uuid"};function PU(e){const t=Array.isArray(e)?e:e.entry?.map(n=>n.resource)??[];for(const n of t)n?.resourceType==="StructureDefinition"&&n.kind==="resource"&&CA(n.type)}function CA(e){let t=Ao.types[e];return t||(t={searchParamsDetails:{}},Ao.types[e]=t),!t.searchParams&&e!=="Binary"&&(t.searchParams={_id:{base:[e],code:"_id",type:"token",expression:e+".id"},_lastUpdated:{base:[e],code:"_lastUpdated",type:"date",expression:e+".meta.lastUpdated"},_compartment:{base:[e],code:"_compartment",type:"reference",expression:e+".meta.compartment"},_profile:{base:[e],code:"_profile",type:"uri",expression:e+".meta.profile"},_security:{base:[e],code:"_security",type:"token",expression:e+".meta.security"},_source:{base:[e],code:"_source",type:"uri",expression:e+".meta.source"},_tag:{base:[e],code:"_tag",type:"token",expression:e+".meta.tag"}}),t}function OU(e){for(const t of e.base??[]){const n=CA(t);n.searchParams||(n.searchParams={}),n.searchParams[e.code]=e}}function iT(e){const t=e.type?.[0]?.code;return t==="BackboneElement"||t==="Element"?NU((e.base?.path??e.path)?.split(".")):t}function NU(e){return e.length===1?e[0]:e.map(qn).join("")}function z0(e){return Ao.types[e]?.searchParams}function MU(e,t){return Ao.types[e]?.searchParams?.[t]}function ul(e){const t=e.replaceAll("[x]","").split(".").pop();return EA(t)}function EA(e){let t;return e.length<100?t=e.match(/[A-Z]+(?![a-z])|[A-Z]?[a-z]+|\d+/g)??[]:t=e.split(/(?=[A-Z])/),t.map(IU).join(" ").replace("_"," ").replace(/\s+/g," ")}const LU=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function IU(e){const t=e.toUpperCase();return e===t?e:LU.has(t)?t:t.charAt(0)+e.slice(1)}function ws(e,t,n){const r=wm(e,n);if(r)return zU(r.elements,t)}function zU(e,t){const n=e[t]??e[t+"[x]"];if(n)return n;for(let r=0;r<t.length;r++){const o=t[r];if(o>="A"&&o<="Z"){const l=t.slice(0,r)+"[x]",c=e[l];if(c)return c}}}function Io(e,t){return!(!e||typeof e!="object"||!("resourceType"in e)||t&&e.resourceType!==t)}function Aa(e,t){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Ao={types:{}};function qh(e){if(e.startsWith("T"))return e+"T00:00:00.000Z".substring(e.length);if(e.length<=10)return e;try{return new Date(e).toISOString()}catch{return e}}const ua=()=>[],Fr={empty:(e,t)=>Ze(t.length===0||t.every(n=>bn(n.value))),hasValue:(e,t)=>Ze(t.length!==0),exists:(e,t,n)=>Ze(n?t.filter(r=>bo(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!bn(r.value))),all:(e,t,n)=>Ze(t.every(r=>bo(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Ze(!1);return Ze(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Ze(!0);return Ze(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Ze(!1);return Ze(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Ze(!0);return Ze(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return Ze(!0);const r=n.eval(e,Vs(e));return r.length===0?Ze(!1):Ze(t.every(o=>r.some(l=>l.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,Vs(e));return r.length===0?Ze(!0):t.length===0?Ze(!1):Ze(r.every(o=>t.some(l=>l.value===o.value)))},count:(e,t)=>[{type:re.integer,value:t.length}],distinct:(e,t)=>{const n=[];for(const r of t)n.some(o=>o.value===r.value)||n.push(r);return n},isDistinct:(e,t)=>Ze(t.length===Fr.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>bo(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval({parent:e,variables:{$this:r}},[r])).flat(),repeat:ua,ofType:(e,t,n)=>t.filter(r=>r.type===n.name),single:(e,t)=>{if(t.length>1)throw new Error("Expected input length one for single()");return t.length===0?[]:t.slice(0,1)},first:(e,t)=>t.length===0?[]:t.slice(0,1),last:(e,t)=>t.length===0?[]:t.slice(t.length-1,t.length),tail:(e,t)=>t.length===0?[]:t.slice(1,t.length),skip:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new Error("Expected a number for skip(num)");return r>=t.length?[]:r<=0?t:t.slice(r,t.length)},take:(e,t,n)=>{const r=n.eval(e,t)[0]?.value;if(typeof r!="number")throw new Error("Expected a number for take(num)");return r>=t.length?t:r<=0?[]:t.slice(0,r)},intersect:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Vs(e)),o=[];for(const l of t)!o.some(c=>c.value===l.value)&&r.some(c=>c.value===l.value)&&o.push(l);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Vs(e)),o=[];for(const l of t)r.some(c=>c.value===l.value)||o.push(l);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Vs(e));return aA([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,Vs(e));return[...t,...r]},htmlChecks:(e,t,n)=>[ci(!0)],iif:(e,t,n,r,o)=>{const l=n.eval(e,t);if(l.length>1||l.length===1&&typeof l[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return bo(l)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);if(typeof n=="boolean")return[{type:re.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Ze(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Ze(!0);if(["false","f","no","n","0","0.0"].includes(r))return Ze(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Ze(Fr.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);return typeof n=="number"?[{type:re.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:re.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:re.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Ze(Fr.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.date,value:qh(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Ze(Fr.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:re.dateTime,value:qh(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Ze(Fr.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);return typeof n=="number"?[{type:re.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:re.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:re.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Ze(Fr.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);return Ai(n)?[{type:re.Quantity,value:n}]:typeof n=="number"?[{type:re.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:re.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:re.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Ze(Fr.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);return n==null?[]:Ai(n)?[{type:re.string,value:`${n.value} '${n.unit}'`}]:[{type:re.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Ze(Fr.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=go(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:re.time,value:qh("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Ze(Fr.toTime(e,t).length===1),indexOf:(e,t,n)=>Ei((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>Ei((o,l,c)=>{const d=l,f=c?d+c:o.length;return d<0||d>=o.length?void 0:o.substring(d,f)},e,t,n,r),startsWith:(e,t,n)=>Ei((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>Ei((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>Ei((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>Ei(n=>n.toUpperCase(),e,t),lower:(e,t)=>Ei(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>Ei((o,l,c)=>o.replaceAll(l,c),e,t,n,r),matches:(e,t,n)=>Ei((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>Ei((o,l,c)=>o.replaceAll(new RegExp(l,"g"),c.replaceAll(/\$\{(\w+)\}/g,"$<$1>")),e,t,n,r),length:(e,t)=>Ei(n=>n.length,e,t),toChars:(e,t)=>Ei(n=>n?n.split(""):void 0,e,t),encode:ua,decode:ua,escape:ua,unescape:ua,trim:ua,split:ua,join:(e,t,n)=>{const r=n?.eval(e,Vs(e))[0]?.value??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:re.string,value:t.map(o=>o.value?.toString()??"").join(r)}]},abs:(e,t)=>ho(Math.abs,e,t),ceiling:(e,t)=>ho(Math.ceil,e,t),exp:(e,t)=>ho(Math.exp,e,t),floor:(e,t)=>ho(Math.floor,e,t),ln:(e,t)=>ho(Math.log,e,t),log:(e,t,n)=>ho((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>ho(Math.pow,e,t,n),round:(e,t,...n)=>ho((r,o=0)=>{if(typeof o!="number"||o<0)throw new Error("Invalid precision provided to round()");const l=Math.pow(10,o);return Math.round(r*l)/l},e,t,...n),sqrt:(e,t)=>ho(Math.sqrt,e,t),truncate:(e,t)=>ho(n=>n|0,e,t),children:ua,descendants:ua,trace:(e,t,n)=>t,now:()=>[{type:re.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:re.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:re.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{const l=Fr.toDateTime(e,n.eval(e,t));if(l.length===0)throw new Error("Invalid start date");const c=Fr.toDateTime(e,r.eval(e,t));if(c.length===0)throw new Error("Invalid end date");const d=o.eval(e,t)[0]?.value;if(d!=="years"&&d!=="months"&&d!=="days")throw new Error("Invalid units");const f=pA(l[0].value,c[0].value);return[{type:re.Quantity,value:{value:f[d],unit:d}}]},is:(e,t,n)=>{let r="";return n instanceof fp?r=n.name:n instanceof $0&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:re.boolean,value:lA(o,r)})):[]},not:(e,t)=>Fr.toBoolean(e,t).map(n=>({type:re.boolean,value:!n.value})),resolve:(e,t)=>t.map(n=>{const r=n.value;let o;if(typeof r=="string")o=r;else if(typeof r=="object"){const l=r;if(l.resource)return ci(l.resource);l.reference?o=l.reference:l.type&&l.identifier&&(o=`${l.type}?identifier=${l.identifier.system}|${l.identifier.value}`)}if(o?.includes("?")){const[l]=o.split("?");return{type:l,value:{resourceType:l}}}if(o?.includes("/")){const[l,c]=o.split("/");return{type:l,value:{resourceType:l,id:c}}}return{type:re.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:re.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:re.BackboneElement,value:{namespace:"System",name:"Integer"}}:Io(n)?{type:re.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:re.BackboneElement,value:null}),conformsTo:(e,t,n)=>{const r=n.eval(e,t)[0].value;if(!r.startsWith("http://hl7.org/fhir/StructureDefinition/"))throw new Error("Expected a StructureDefinition URL");const o=r.replace("http://hl7.org/fhir/StructureDefinition/","");return t.map(l=>({type:re.boolean,value:l.value?.resourceType===o}))},getResourceKey:(e,t)=>{const n=t[0].value;return n?.id?[{type:re.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!r?.reference)return[];let o="";return n instanceof fp&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:re.id,value:ll(r)}]},extension:(e,t,n)=>{const r=n.eval(e,t)[0].value,o=t?.[0]?.value;if(o){const l=Lo(o,r);if(l)return[{type:re.Extension,value:l}]}return[]}};function Ei(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=go(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const l=r.map(d=>d?.eval(t,n)[0]?.value),c=e(o,...l);return c===void 0?[]:Array.isArray(c)?c.map(ci):[ci(c)]}function ho(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=go(n,1),l=Ai(o),c=l?o.value:o;if(typeof c!="number")throw new Error("Math function cannot be called with non-number");const d=e(c,...r.map(m=>m.eval(t,n)[0]?.value)),f=l?re.Quantity:n[0].type,p=l?{...o,value:d}:d;return[{type:f,value:p}]}function go(e,t){if(e.length!==t)throw new Error(`Expected ${t} arguments`);for(const n of e)if(n==null)throw new Error("Expected non-null argument");return e}function Vs(e){let t=e;for(;t.parent?.variables.$this;)t=t.parent;return[t.variables.$this]}class TA{original;child;constructor(t,n){this.original=t,this.child=n}eval(t,n){try{if(n.length>0){const r=[];for(const o of n)r.push(this.child.eval({parent:t,variables:{$this:o}},[o]));return r.flat()}else return this.child.eval(t,[])}catch(r){throw new Error(`FhirPathError on "${this.original}": ${r}`,{cause:r})}}toString(){return this.child.toString()}}class yc{value;constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class fp{name;constructor(t){this.name=t}eval(t,n){if(this.name==="$this")return n;const r=this.getVariable(t);if(r)return[r];if(this.name.startsWith("%"))throw new Error(`Undefined variable ${this.name}`);return n.flatMap(o=>this.evalValue(o)).filter(o=>o?.value!==void 0)}getVariable(t){const n=t.variables[this.name];if(n!==void 0)return n;if(t.parent)return this.getVariable(t.parent)}evalValue(t){const n=t.value;if(!(!n||typeof n!="object"))return Io(n,this.name)?t:Uc(t,this.name)}toString(){return this.name}}class $U{eval(){return[]}toString(){return"{}"}}class UU extends v8{impl;constructor(t,n,r){super(t,n),this.impl=r}eval(t,n){return this.impl(this.child.eval(t,n))}toString(){return this.operator+this.child.toString()}}class hp extends Gd{constructor(t,n){super("as",t,n)}eval(t,n){return Fr.ofType(t,this.left.eval(t,n),this.right)}}class Yr extends Gd{}class Gi extends Yr{impl;constructor(t,n,r,o){super(t,n,r),this.impl=o}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.eval(t,n);if(o.length!==1)return[];const l=r[0].value,c=o[0].value,d=Ai(l)?l.value:l,f=Ai(c)?c.value:c,p=this.impl(d,f);return typeof p=="boolean"?Ze(p):Ai(l)?[{type:re.Quantity,value:{...l,value:p}}]:[ci(p)]}}class BU extends Gd{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),l=[...r,...o];return l.length>0&&l.every(c=>typeof c.value=="string")?[{type:re.string,value:l.map(c=>c.value).join("")}]:l}}class VU extends Yr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Ze(r.some(l=>l.value===o[0].value))}}class FU extends Yr{constructor(t,n){super("in",t,n)}eval(t,n){const r=ba(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Ze(o.some(l=>jm(r,l)[0].value)):[]}}class $0 extends Gd{constructor(t,n){super(".",t,n)}eval(t,n){return this.right.eval(t,this.left.eval(t,n))}toString(){return`${this.left.toString()}.${this.right.toString()}`}}class U0 extends Gd{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return aA([...r,...o])}}class HU extends Yr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return X$(r,o)}}class qU extends Yr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return J$(r,o)}}class GU extends Yr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return sA(r,o)}}class WU extends Yr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return K$(sA(r,o))}}class B0 extends Yr{constructor(t,n){super("is",t,n)}eval(t,n){const r=this.left.eval(t,n);if(r.length!==1)return[];const o=this.right.name;return Ze(lA(r[0],o))}}class QU extends Yr{constructor(t,n){super("and",t,n)}eval(t,n){const r=ba(this.left.eval(t,n),"boolean"),o=ba(this.right.eval(t,n),"boolean");return r?.value===!0&&o?.value===!0?Ze(!0):r?.value===!1||o?.value===!1?Ze(!1):[]}}class YU extends Yr{constructor(t,n){super("or",t,n)}eval(t,n){const r=ba(this.left.eval(t,n),"boolean"),o=ba(this.right.eval(t,n),"boolean");return r?.value===!1&&o?.value===!1?Ze(!1):r?.value||o?.value?Ze(!0):[]}}class KU extends Yr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=ba(this.left.eval(t,n),"boolean"),o=ba(this.right.eval(t,n),"boolean");return!r||!o?[]:Ze(r.value!==o.value)}}class XU extends Yr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=ba(this.left.eval(t,n),"boolean"),o=ba(this.right.eval(t,n),"boolean");return o?.value===!0||r?.value===!1?Ze(!0):!r||!o?[]:Ze(!1)}}class V0{name;args;constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Fr[this.name];if(!r)throw new Error("Unrecognized function: "+this.name);return r(t,n,...this.args)}toString(){return`${this.name}(${this.args.map(t=>t.toString()).join(", ")})`}}class F0{left;expr;constructor(t,n){this.left=t,this.expr=n}eval(t,n){const r=this.expr.eval(t,n);if(r.length!==1)return[];const o=r[0].value;if(typeof o!="number")throw new Error("Invalid indexer expression: should return integer}");const l=this.left.eval(t,n);return o in l?[l[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const JU=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"],ZU={"'":"'",'"':'"',"`":"`",r:"\r",n:`
|
|
81
|
+
`,t:" ",f:"\f","\\":"\\"};class eB{str;keywords;operators;dateTimeLiterals;symbolRegex;result=[];pos={index:0,line:1,column:0};markStack=[];constructor(t,n,r,o){this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!o?.dateTimeLiterals,this.symbolRegex=o?.symbolRegex??/[$\w%]/}tokenize(){for(;this.pos.index<this.str.length;){const t=this.consumeToken();t&&this.result.push(t)}return this.result}prevToken(){return this.result.slice(-1)[0]}peekToken(){this.mark();const t=this.consumeToken();return this.reset(),t}consumeToken(){this.consumeWhitespace();const t=this.curr();if(!t)return;this.mark();const n=this.peek();return t==="/"&&n==="*"?this.consumeMultiLineComment():t==="/"&&n==="/"?this.consumeSingleLineComment():t==="'"||t==='"'||t==="`"?this.consumeString(t):t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():(t==="$"||t==="%")&&(n==="'"||n==='"'||n==="`")?this.consumeQuotedSymbol(n):this.consumeOperator()}consumeWhitespace(){this.consumeWhile(()=>/\s/.exec(this.curr()))}consumeMultiLineComment(){const t=this.pos.index;return this.consumeWhile(()=>this.curr()!=="*"||this.peek()!=="/"),this.advance(),this.advance(),this.buildToken("Comment",this.str.substring(t,this.pos.index))}consumeSingleLineComment(){return this.buildToken("Comment",this.consumeWhile(()=>this.curr()!==`
|
|
82
|
+
`))}consumeString(t){this.advance();let n="",r;for(;r=this.consumeChar(t);)n+=r;const o=this.buildToken(t==="`"?"Symbol":"String",n);return this.advance(),o}consumeChar(t){const n=this.curr();if(n==="\\"){this.advance();const r=this.curr(),o=ZU[r];if(o!==void 0)return this.advance(),o;if(r==="u"){this.advance();const l=/^[0-9a-fA-F]{4}$/.exec(this.str.substring(this.pos.index,this.pos.index+4))?.[0];return l?(this.advance(),this.advance(),this.advance(),this.advance(),String.fromCodePoint(parseInt(l,16))):"u"}return this.consumeChar(t)}return n===t||!n?"":(this.advance(),n)}consumeQuotedSymbol(t){this.mark();const n=this.pos.index;this.advance(),this.consumeString(t);const r=this.str.substring(n,this.pos.index);return this.buildToken("Symbol",r)}consumeDateTime(){this.advance();const t=this.pos.index;this.consumeWhile(()=>/[\d-]/.exec(this.curr()));let n=!1,r=!1;if(this.curr()==="T"&&(n=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="Z"?(r=!0,this.advance()):(this.curr()==="+"||this.curr()==="-")&&(r=!0,this.advance(),this.consumeWhile(()=>/[\d:]/.exec(this.curr())))),this.pos.index===t)throw new Error("Invalid DateTime literal");let o=this.str.substring(t,this.pos.index);return o.endsWith("T")?o=o.substring(0,o.length-1):!o.startsWith("T")&&n&&!r&&(o+="Z"),this.buildToken("DateTime",o)}consumeNumber(){const t=this.pos.index;let n="Number";return this.consumeWhile(()=>/\d/.exec(this.curr())),this.curr()==="."&&/\d/.exec(this.peek())&&(this.advance(),this.consumeWhile(()=>/\d/.exec(this.curr()))),this.curr()==="-"&&this.dateTimeLiterals?(this.pos.index=t-1,this.consumeDateTime()):(this.curr()===" "&&tB(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return this.prevToken()?.value!=="."&&this.keywords.includes(t)?this.buildToken(t,t):this.buildToken("Symbol",t)}consumeOperator(){const t=this.curr(),n=this.peek(),r=t+n;return this.operators.includes(r)?(this.advance(),this.advance(),this.buildToken(r,r)):(this.advance(),this.buildToken(t,t))}consumeWhile(t){const n=this.pos.index;for(;this.pos.index<this.str.length&&t();)this.advance();return this.str.substring(n,this.pos.index)}curr(){return this.str[this.pos.index]}peek(){return this.str[this.pos.index+1]??""}mark(){this.markStack.push({...this.pos})}reset(){const t=this.markStack.pop();if(!t)throw new Error("No mark to reset to");this.pos.index=t.index,this.pos.line=t.line,this.pos.column=t.column}advance(){this.pos.index++,this.curr()===`
|
|
83
|
+
`?(this.pos.line++,this.pos.column=0):this.pos.column++}buildToken(t,n){const r=this.markStack.pop();if(!r)throw new Error("No mark for token");return{id:t,value:n,...r}}}function tB(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&JU.includes(e.value)))}const nB=["true","false"],rB=["!=","!~","<=",">=","{}","->"];function iB(e){return new eB(e,nB,rB).tokenize()}const en={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,Modulo:4,Add:5,Subtract:5,Ampersand:5,Is:6,As:6,Union:7,GreaterThan:8,GreaterThanOrEquals:8,LessThan:8,LessThanOrEquals:8,Equals:9,Equivalent:9,NotEquals:9,NotEquivalent:9,In:10,Contains:10,And:11,Xor:12,Or:12,Implies:13},oB={parse(e){const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+e.peek()?.value+"`");return t}},aB={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new F0(t,n)},precedence:en.Indexer},sB={parse(e,t){if(!(t instanceof fp))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new V0(t.name,n)},precedence:en.FunctionCall};function lB(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r?.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function cB(){return new y8().registerPrefix("String",{parse:(e,t)=>new yc({type:re.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new yc({type:re.dateTime,value:qh(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new yc({type:re.Quantity,value:lB(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new yc({type:t.value.includes(".")?re.decimal:re.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new yc({type:re.boolean,value:!0})}).registerPrefix("false",{parse:()=>new yc({type:re.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new fp(t.value)}).registerPrefix("{}",{parse:()=>new $U}).registerPrefix("(",oB).registerInfix("[",aB).registerInfix("(",sB).prefix("+",en.UnaryAdd,(e,t)=>new UU("+",t,n=>n)).prefix("-",en.UnarySubtract,(e,t)=>new Gi("-",t,t,(n,r)=>-r)).infixLeft(".",en.Dot,(e,t,n)=>new $0(e,n)).infixLeft("/",en.Divide,(e,t,n)=>new Gi("/",e,n,(r,o)=>r/o)).infixLeft("*",en.Multiply,(e,t,n)=>new Gi("*",e,n,(r,o)=>r*o)).infixLeft("+",en.Add,(e,t,n)=>new Gi("+",e,n,(r,o)=>r+o)).infixLeft("-",en.Subtract,(e,t,n)=>new Gi("-",e,n,(r,o)=>r-o)).infixLeft("|",en.Union,(e,t,n)=>new U0(e,n)).infixLeft("=",en.Equals,(e,t,n)=>new HU(e,n)).infixLeft("!=",en.NotEquals,(e,t,n)=>new qU(e,n)).infixLeft("~",en.Equivalent,(e,t,n)=>new GU(e,n)).infixLeft("!~",en.NotEquivalent,(e,t,n)=>new WU(e,n)).infixLeft("<",en.LessThan,(e,t,n)=>new Gi("<",e,n,(r,o)=>r<o)).infixLeft("<=",en.LessThanOrEquals,(e,t,n)=>new Gi("<=",e,n,(r,o)=>r<=o)).infixLeft(">",en.GreaterThan,(e,t,n)=>new Gi(">",e,n,(r,o)=>r>o)).infixLeft(">=",en.GreaterThanOrEquals,(e,t,n)=>new Gi(">=",e,n,(r,o)=>r>=o)).infixLeft("&",en.Ampersand,(e,t,n)=>new BU(e,n)).infixLeft("and",en.And,(e,t,n)=>new QU(e,n)).infixLeft("as",en.As,(e,t,n)=>new hp(e,n)).infixLeft("contains",en.Contains,(e,t,n)=>new VU(e,n)).infixLeft("div",en.Divide,(e,t,n)=>new Gi("div",e,n,(r,o)=>r/o|0)).infixLeft("in",en.In,(e,t,n)=>new FU(e,n)).infixLeft("is",en.Is,(e,t,n)=>new B0(e,n)).infixLeft("mod",en.Modulo,(e,t,n)=>new Gi("mod",e,n,(r,o)=>r%o)).infixLeft("or",en.Or,(e,t,n)=>new YU(e,n)).infixLeft("xor",en.Xor,(e,t,n)=>new KU(e,n)).infixLeft("implies",en.Implies,(e,t,n)=>new XU(e,n))}const uB=cB();function H0(e){return new TA(e,uB.construct(iB(e)).consumeAndParse())}function dB(e,t){const n=Array.isArray(t)?t:[t];for(let r=0;r<n.length;r++){const o=n[r];typeof o=="object"&&"type"in o&&"value"in o||(n[r]=ci(n[r]))}return ms(e,n).map(r=>r.value)}function ms(e,t,n={},r=void 0){let o;if(typeof e=="string"){const l=r?.get(e);o=l??H0(e),r&&!l&&r.set(e,o)}else o=e;return o.eval({variables:n},t).map(l=>({type:l.type,value:l.value?.valueOf()}))}function fB(e){const t=[];for(const n of e){const r=dA(n.value);r&&t.push(r)}return t}function hB(e){const t=new Set;for(const n of e){const r=cl(n);r&&t.add(r)}return Array.from(t)}function pB(e){const t=new Set;for(const n of e){const{value:r}=n;r&&(hU(r)?t.add(r):Aa(r)?t.add(r.reference):hA(r)?t.add(Nt(r)):typeof r.identifier=="object"&&t.add(`identifier:${r.identifier.system}|${r.identifier.value}`))}return Array.from(t)}function mB(e,t={}){const n=[];for(const r of e)gB(t,n,r);return n}function gB(e,t,n){const{type:r,value:o}=n;switch(r){case re.Identifier:vB(t,e,o);break;case re.CodeableConcept:yB(t,e,o);break;case re.Coding:RA(t,e,o);break;case re.ContactPoint:xB(t,e,o);break;default:dl(t,e,void 0,o?.toString())}}function vB(e,t,n){n?.type?.text&&dl(e,t,t.textSearchSystem,n.type.text),dl(e,t,n?.system,n?.value)}function yB(e,t,n){if(n?.text&&dl(e,t,t.textSearchSystem,n.text),n?.coding)for(const r of n.coding)RA(e,t,r)}function RA(e,t,n){n&&(n.display&&dl(e,t,t.textSearchSystem,n.display),dl(e,t,n.system,n.code))}function xB(e,t,n){n&&dl(e,t,n.system,n.value?.toLocaleLowerCase())}function dl(e,t,n,r){(n||r)&&!e.some(o=>o.system===n&&o.value===r)&&e.push({system:n,value:r&&t.caseInsensitive?r.toLocaleLowerCase():r})}const Em=20,fe={EQUALS:"eq",NOT_EQUALS:"ne",GREATER_THAN:"gt",LESS_THAN:"lt",GREATER_THAN_OR_EQUALS:"ge",LESS_THAN_OR_EQUALS:"le",STARTS_AFTER:"sa",ENDS_BEFORE:"eb",APPROXIMATELY:"ap",CONTAINS:"contains",STARTS_WITH:"sw",EXACT:"exact",TEXT:"text",NOT:"not",ABOVE:"above",BELOW:"below",IN:"in",NOT_IN:"not-in",OF_TYPE:"of-type",MISSING:"missing",PRESENT:"present",IDENTIFIER:"identifier",ITERATE:"iterate"},_A={contains:fe.CONTAINS,exact:fe.EXACT,above:fe.ABOVE,below:fe.BELOW,text:fe.TEXT,not:fe.NOT,in:fe.IN,"not-in":fe.NOT_IN,"of-type":fe.OF_TYPE,missing:fe.MISSING,identifier:fe.IDENTIFIER,iterate:fe.ITERATE},q0={eq:fe.EQUALS,ne:fe.NOT_EQUALS,lt:fe.LESS_THAN,le:fe.LESS_THAN_OR_EQUALS,gt:fe.GREATER_THAN,ge:fe.GREATER_THAN_OR_EQUALS,sa:fe.STARTS_AFTER,eb:fe.ENDS_BEFORE,ap:fe.APPROXIMATELY,sw:fe.STARTS_WITH};function DA(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[c,d]=e.split("?");n=c,r=new URLSearchParams(d)}else n=e;else typeof e=="object"&&(n=e.pathname,r=e.searchParams);let o;n.includes("/")?o=n.split("/").filter(Boolean).pop():o=n;const l=[];return r&&l.push(...r.entries()),bB(o,l)}function bB(e,t){const n={resourceType:e};for(const[r,o]of t)SB(n,r,o);return n}function SB(e,t,n){let r,o;const l=t.indexOf(":");if(l>=0?(r=t.substring(0,l),o=t.substring(l+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Zu(e.filters,{code:t,operator:fe.EQUALS,value:n});return}switch(r){case"_sort":wB(e,n);break;case"_cursor":e.cursor=n;break;case"_count":e.count=parseInt(n,10);break;case"_offset":e.offset=parseInt(n,10);break;case"_total":e.total=n;break;case"_summary":n==="count"?(e.total="accurate",e.count=0):(n==="true"||n==="data"||n==="text")&&(e.summary=n);break;case"_include":{const c=oT(n);o==="iterate"&&(c.modifier=fe.ITERATE),e.include=Zu(e.include,c);break}case"_revinclude":{const c=oT(n);o==="iterate"&&(c.modifier=fe.ITERATE),e.revInclude=Zu(e.revInclude,c);break}case"_fields":case"_elements":e.fields=n.split(",");break;case"_type":e.types=n.split(",");break;case"_format":e.format=n;break;case"_pretty":e.pretty=n==="true";break;default:{const c=Ao.types[e.resourceType]?.searchParams?.[r];c?e.filters=Zu(e.filters,CB(c,o,n)):e.filters=Zu(e.filters,EB(r,o,n))}}}}function wB(e,t){for(const n of t.split(",")){let r,o=!1;n.startsWith("-")?(r=n.substring(1),o=!0):r=n,e.sortRules||(e.sortRules=[]),e.sortRules.push({code:r,descending:o})}}const jB=[fe.MISSING,fe.PRESENT];function CB(e,t,n){if(jB.includes(t))return{code:e.code,operator:t,value:n};switch(e.type){case"number":case"date":case"quantity":{const{operator:r,value:o}=TB(n,t||fe.EQUALS);if(!aT(e,o))throw new gt(jo(`Invalid format for ${e.type} search parameter: ${o}`));return{code:e.code,operator:r,value:o}}case"reference":case"string":case"token":case"uri":if(!aT(e,n))throw new gt(jo(`Invalid format for ${e.type} search parameter: ${n}`));return{code:e.code,operator:RB(t),value:n};default:throw new Error("Unrecognized search parameter type: "+e.type)}}function EB(e,t,n){let r=fe.EQUALS;if(t)r=t;else if(n.length>=2){const o=n.substring(0,2);o in q0&&(n.length===2||n.at(2)?.match(/\d/))&&(r=o,n=n.substring(o.length))}return{code:e,operator:r,value:n}}function TB(e,t){const n=e.substring(0,2),r=q0[n];return r?{operator:r,value:e.substring(2)}:{operator:t,value:e}}function RB(e){return _A[e]??fe.EQUALS}function oT(e){const t=e.split(":");if(t.includes("*"))throw new gt(jo("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new gt(jo(`Invalid include value '${e}': must be of the form ResourceType:search-parameter`));if(t.length===2)return{resourceType:t[0],searchParam:t[1]};if(t.length===3)return{resourceType:t[0],searchParam:t[1],targetType:t[2]};throw new gt(jo(`Invalid include value '${e}'`))}function aT(e,t){switch(e.type){case"date":return bd(t);default:return!0}}function us(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(_B(n))),e.sortRules&&e.sortRules.length>0&&t.push(DB(e.sortRules)),e.cursor!==void 0&&t.push("_cursor="+encodeURIComponent(e.cursor)),e.offset!==void 0&&e.offset!==0&&t.push("_offset="+e.offset),e.count!==void 0&&t.push("_count="+e.count),e.total!==void 0&&t.push("_total="+e.total),e.types&&e.types.length>0&&t.push("_type="+e.types.join(",")),e.include&&e.include.forEach(n=>t.push(sT("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(sT("_revinclude",n))),t.length===0?"":(Bc(t),"?"+t.join("&"))}function _B(e){const t=e.operator in _A?":"+e.operator:"",n=e.operator!==fe.EQUALS&&e.operator in q0?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function DB(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function sT(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Tm(e){const t=[];let n="",r=!1;for(const o of e)r?(n+=o,r=!1):o==="\\"?r=!0:o===","?(t.push(n),n=""):n+=o;return t.push(n),t}function AB(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!kB(e,t,n))return!1}return!0}function kB(e,t,n){const r=Ao.types[t.resourceType]?.searchParams?.[n.code];if(!r)return!1;const o=ms(r.expression,[ci(e)]);if(n.operator===fe.MISSING||n.operator===fe.PRESENT)return PB(o,n);switch(r.type){case"reference":return OB(o,n);case"string":case"uri":return LB(o,n);case"token":return NB(o,n);case"date":return zB(o,n);default:return!1}}function PB(e,t){const n=e.length>0;return(t.operator===fe.MISSING&&t.value==="false"||t.operator===fe.PRESENT&&t.value==="true")===n}function OB(e,t){const n=Rm(t.operator);if(t.value===""&&e.length===0)return t.operator===fe.EQUALS;const r=pB(e);for(const o of Tm(t.value)){let l=r.includes(o);if(!l&&t.code==="_compartment"&&(l=r.some(c=>c?.endsWith("/"+o))),l)return!n}return n}function NB(e,t){const n=mB(e),r=Tm(t.value),o=Rm(t.operator);for(const l of n)for(const c of r)if(MB(l,c))return!o;return o}function MB(e,t){if(t.includes("|")){const[n,r]=t.split("|").map(o=>o.toLowerCase());return!n&&!r?!1:n?e.system?.toLowerCase()===n&&(!r||e.value?.toLowerCase()===r):!e.system&&e.value?.toLowerCase()===r}return e.value?.toLowerCase()===t.toLowerCase()}function LB(e,t){const n=hB(e),r=Tm(t.value),o=Rm(t.operator);for(const l of n)for(const c of r)if(IB(l,c))return!o;return o}function IB(e,t){return e.toLowerCase().includes(t.toLowerCase())}function zB(e,t){const n=fB(e),r=Tm(t.value),o=Rm(t.operator);for(const l of n)for(const c of r)if($B(l,t.operator,c))return!o;return o}function $B(e,t,n){if(!e)return!1;const r=dA(n);if(!r)return!1;const o=e.start??"0000",l=e.end??"9999",c=r.start,d=r.end;switch(t){case fe.APPROXIMATELY:case fe.EQUALS:case fe.NOT_EQUALS:return o<d&&l>c;case fe.LESS_THAN:return o<c;case fe.GREATER_THAN:return l>d;case fe.LESS_THAN_OR_EQUALS:return o<=d;case fe.GREATER_THAN_OR_EQUALS:return l>=c;case fe.STARTS_AFTER:return o>d;case fe.ENDS_BEFORE:return l<c;default:return!1}}function Rm(e){return e===fe.NOT_EQUALS||e===fe.NOT}const UB={resourceType:"*"},BB=["DomainConfiguration","JsonWebKey","Login"],VB=["UserSecurityRequest","Project","ProjectMembership","User"],tl={READ:"read",VREAD:"vread",UPDATE:"update",HISTORY:"history",SEARCH:"search"},FB=[tl.READ,tl.VREAD,tl.HISTORY,tl.SEARCH];function HB(e,t){return BB.includes(t)?!1:qB(e,tl.UPDATE,t)}function qB(e,t,n){return!!e.resource?.some(r=>kA(r,n,t))}function AA(e,t,n){return n?n.resource?.find(r=>GB(e,t,r)):UB}function GB(e,t,n){const r=e.resourceType;return kA(n,r,t)?r==="Binary"?!0:!(n.compartment&&!e.meta?.compartment?.some(o=>o.reference===n.compartment?.reference)||n.criteria&&!AB(e,DA(n.criteria))):!1}function kA(e,t,n){return e.resourceType!==t&&(e.resourceType!=="*"||VB.includes(t))?!1:e.interaction?e.interaction.includes(n):!e.readonly||FB.includes(n)}function vo(){return typeof window<"u"}function PA(){return typeof Buffer<"u"?Buffer:void 0}const rr={assign(e){vo()&&globalThis.location.assign(e)},reload(){vo()&&globalThis.location.reload()},getSearch(){return vo()?globalThis.location.search:""},getPathname(){return vo()?globalThis.location.pathname:""},getLocation(){return vo()?globalThis.location.toString():""},getOrigin(){return vo()?globalThis.location.protocol+"//"+globalThis.location.host+"/":""}};function WB(e){if(vo()){const n=window.atob(e),r=Uint8Array.from(n,o=>o.charCodeAt(0));return new window.TextDecoder().decode(r)}const t=PA();if(t)return t.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function lT(e){if(vo()){const n=new window.TextEncoder().encode(e),r=String.fromCharCode.apply(null,n);return window.btoa(r)}const t=PA();if(t)return t.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function QB(e){e=e.padEnd(e.length+(4-e.length%4)%4,"=");const t=e.replace(/-/g,"+").replace(/_/g,"/");return WB(t)}function cT(){const e=new Uint32Array(28);return crypto.getRandomValues(e),mU(e.buffer)}async function YB(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function OA(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function NA(e){const t={};e=ui(e);for(const o of e.entry||[]){const l=o.resource;if(!l)continue;l.meta!==void 0&&(delete l.meta.author,delete l.meta.compartment,delete l.meta.lastUpdated,delete l.meta.project,delete l.meta.versionId,Object.keys(l.meta).length===0&&delete l.meta);const c=l?.id;c&&(t[c]=OA(),o.fullUrl="urn:uuid:"+t[c],delete o.resource?.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n?.map(o=>({fullUrl:o.fullUrl,request:{method:"POST",url:o.resource?.resourceType},resource:o.resource}))},(o,l)=>KB(o,l,t),2);return XB(JSON.parse(r))}function KB(e,t,n){if(e==="reference"&&typeof t=="string"){let r;if(t.includes("/")?r=t.split("/")[1]:t.startsWith("urn:uuid:")?r=t.slice(9):t.startsWith("#")&&(r=t.slice(1)),r){const o=n[r];if(o)return"urn:uuid:"+o}}return t}function XB(e){const t=ZB(e),{sorted:n,cycles:r}=JB(t),o={};for(const c of e.entry??[])c.fullUrl&&(o[c.fullUrl]=c);const l=n.map(c=>o[c]);for(const c of r)for(const d of c){const f=o[d],p={...f,request:{...f.request,method:"PUT"}};l.push(p)}return{...e,entry:l}}const xc={NotVisited:"NotVisited",Visiting:"Visiting",Visited:"Visited"};function JB(e){const t=[],n={},r=[];for(const l of Object.keys(e))n[l]=xc.NotVisited;function o(l,c){if(n[l]===xc.Visited)return!0;if(n[l]===xc.Visiting){const f=c.lastIndexOf(l);return f!==-1&&r.push(c.slice(f)),!0}n[l]=xc.Visiting,c.push(l);let d=!1;for(const f of e[l])o(f,c)||(d=!0);return n[l]=xc.Visited,c.pop(),t.unshift(l),!d}for(const l in e)n[l]===xc.NotVisited&&o(l,[]);return{sorted:t,cycles:r}}function MA(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Aa(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else MA(r,t)}}function ZB(e){const t={};for(const n of e.entry||[])n.fullUrl&&(t[n.fullUrl]=[]);for(const n of e.entry||[]){const r=n.fullUrl;n.resource&&MA(n.resource,o=>{t[o]&&t[o].push(r)})}return t}const on={CSS:"text/css",DICOM:"application/dicom",FAVICON:"image/vnd.microsoft.icon",FHIR_JSON:"application/fhir+json",FORM_URL_ENCODED:"application/x-www-form-urlencoded",HL7_V2:"x-application/hl7-v2+er7",HTML:"text/html",JAVASCRIPT:"text/javascript",JSON:"application/json",JSON_PATCH:"application/json-patch+json",JWT:"application/jwt",MULTIPART_FORM_DATA:"multipart/form-data",PNG:"image/png",SCIM_JSON:"application/scim+json",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript",PING:"x-application/ping",XML:"text/xml",CDA_XML:"application/cda+xml",OCTET_STREAM:"application/octet-stream"};let eV=class{listeners;constructor(){this.listeners={}}addEventListener(t,n){this.listeners[t]||(this.listeners[t]=[]),this.listeners[t].push(n)}removeEventListener(t,n){const r=this.listeners[t];if(r){for(let o=0;o<r.length;o++)if(r[o]===n){r.splice(o,1);return}}}dispatchEvent(t){const n=this.listeners[t.type];if(n)for(const r of n)r.call(this,t);return!t.defaultPrevented}removeAllListeners(){this.listeners={}}};class _m{emitter=new eV;dispatchEvent(t){this.emitter.dispatchEvent(t)}addEventListener(t,n){this.emitter.addEventListener(t,n)}removeEventListener(t,n){this.emitter.removeEventListener(t,n)}removeAllListeners(){this.emitter.removeAllListeners()}}const Sx={"Patient-open":"Patient-open","Patient-close":"Patient-close","ImagingStudy-open":"ImagingStudy-open","ImagingStudy-close":"ImagingStudy-close","Encounter-open":"Encounter-open","Encounter-close":"Encounter-close","DiagnosticReport-open":"DiagnosticReport-open","DiagnosticReport-close":"DiagnosticReport-close","DiagnosticReport-select":"DiagnosticReport-select","DiagnosticReport-update":"DiagnosticReport-update",syncerror:"syncerror"},tV=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],G0=["DiagnosticReport-update"];function nV(e){return G0.includes(e)}function rV(e){if(G0.includes(e))throw new gt(xn(`'context.version' is required for '${e}'.`))}const iV={"Patient-open":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"Patient-close":{patient:{resourceType:"Patient"},encounter:{resourceType:"Encounter",optional:!0}},"ImagingStudy-open":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"ImagingStudy-close":{study:{resourceType:"ImagingStudy"},encounter:{resourceType:"Encounter",optional:!0},patient:{resourceType:"Patient",optional:!0}},"Encounter-open":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"Encounter-close":{encounter:{resourceType:"Encounter"},patient:{resourceType:"Patient"}},"DiagnosticReport-open":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-close":{report:{resourceType:"DiagnosticReport"},encounter:{resourceType:"Encounter",optional:!0},study:{resourceType:"ImagingStudy",optional:!0,manyAllowed:!0},patient:{resourceType:"Patient"}},"DiagnosticReport-select":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},select:{resourceType:"*",reference:!0,manyAllowed:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport",reference:!0},patient:{resourceType:"Patient",optional:!0,reference:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function oV(e){return tV.includes(e)}function LA(e){return!!e.endpoint}function uT(e){if(!W0(e))throw new gt(xn("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,l={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return LA(e)&&(l.endpoint=e.endpoint),new URLSearchParams(l).toString()}function W0(e){if(typeof e!="object")return!1;const{channelType:t,mode:n,topic:r,events:o}=e;if(!(t&&n&&r&&o)||typeof r!="string"||typeof o!="object"||!Array.isArray(o)||o.length<1||t!=="websocket"||n!=="subscribe"&&n!=="unsubscribe")return!1;for(const l of o)if(!Sx[l])return!1;return!(LA(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function aV(e,t,n,r){if(typeof t!="object")throw new gt(xn(`context[${n}] is invalid. Context must contain a single valid FHIR resource! Resource is not an object.`));if(!(t.id&&typeof t.id=="string"))throw new gt(xn(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new gt(xn(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!oV(t.resourceType))throw new gt(xn(`context[${n}] is invalid. Resource must contain a valid FHIRcast resource type. Resource type is not a known resource type.`));if(o&&t.resourceType!==o)throw new gt(xn(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function sV(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),r.reference){if(!Aa(t.reference))throw new gt(xn(`context[${n}] is invalid. Expected key '${t.key}' to be a reference.`))}else aV(e,t.resource,n,r)}function lV(e,t){const n=new Map,r=iV[e];for(let o=0;o<t.length;o++){const l=t[o].key;if(!r[l])throw new gt(xn(`Key '${l}' not found for event '${e}'. Make sure to add only valid keys.`));sV(e,t[o],o,r[l],n)}for(const[o,l]of Object.entries(r)){if(!(l.optional||n.has(o)))throw new gt(xn(`Missing required key '${o}' on context for '${e}' event.`));if(!l.manyAllowed&&(n.get(o)??0)>1)throw new gt(xn(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function dT(e,t,n,r){if(!(e&&typeof e=="string"))throw new gt(xn("Must provide a topic."));if(!Sx[t])throw new gt(xn(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Sx).join(", ")}`));if(typeof n!="object")throw new gt(xn("context must be a context object or array of context objects."));if(G0.includes(t)&&!r)throw new gt(xn(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return lV(t,o),{timestamp:new Date().toISOString(),id:OA(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class cV extends _m{subRequest;websocket;constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new gt(xn("Subscription request should contain an endpoint."));if(!W0(t))throw new gt(xn("Subscription request failed validation."));const n=new WebSocket(t.endpoint);n.addEventListener("open",()=>{this.dispatchEvent({type:"connect"}),n.addEventListener("message",r=>{const o=JSON.parse(r.data);if(o["hub.topic"])return;const l=o;l.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:l}),n.send(JSON.stringify({id:o?.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function uV(e){return JSON.parse(QB(e))}function dV(e){return e.split(".").length===3}function Q0(e){const[t,n,r]=e.split(".");return uV(n)}function fV(e){try{return typeof Q0(e).login_id=="string"}catch{return!1}}function hV(e){try{const n=Q0(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class pV{medplum;constructor(t){this.medplum=t}async get(t){return this.medplum.get(`keyvalue/v1/${t}`)}async set(t,n){await this.medplum.put(`keyvalue/v1/${t}`,n,on.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}class Wi{[Symbol.toStringTag]="ReadablePromise";suspender;status="pending";response;error;constructor(t){this.suspender=t.then(n=>(this.status="success",this.response=n,n),n=>{throw this.status="error",this.error=n,n})}isPending(){return this.status==="pending"}isOk(){return this.status==="success"}read(){switch(this.status){case"pending":throw this.suspender;case"error":throw this.error;default:return this.response}}then(t,n){return this.suspender.then(t,n)}catch(t){return this.suspender.catch(t)}finally(t){return this.suspender.finally(t)}}class mV{storage;prefix="";constructor(t,n=""){this.storage=t??globalThis.localStorage??new gV,this.prefix=n}makeKey(t){return this.prefix+t}clear(){this.storage===globalThis.localStorage&&this.prefix?Object.keys(this.storage).filter(t=>t.startsWith(this.prefix)).forEach(t=>{this.storage.removeItem(t)}):this.storage.clear()}getString(t){return this.storage.getItem(this.makeKey(t))??void 0}setString(t,n){n?this.storage.setItem(this.makeKey(t),n):this.storage.removeItem(this.makeKey(t))}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?to(n):void 0)}}class gV{data;constructor(){this.data=new Map}get length(){return this.data.size}clear(){this.data.clear()}getItem(t){return this.data.get(t)??null}setItem(t,n){n?this.data.set(t,n):this.data.delete(t)}removeItem(t){this.data.delete(t)}key(t){return Array.from(this.data.keys())[t]}}/*!
|
|
84
|
+
* Reconnecting WebSocket
|
|
85
|
+
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
86
|
+
* https://github.com/pladaria/reconnecting-websocket
|
|
87
|
+
* License MIT
|
|
88
|
+
*
|
|
89
|
+
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
90
|
+
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
91
|
+
*/const Dc={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let fT=!1;function vV(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Dc.Event=globalThis.Event,Dc.ErrorEvent=class extends Event{message;error;constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Dc.CloseEvent=class extends Event{code;reason;wasClean=!0;constructor(t=1e3,n="",r){super("close",r),this.code=t,this.reason=n}}}function yV(e,t){if(!e)throw new Error(t)}function Rh(e){return new e.constructor(e.type,e)}const Fs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0};let hT=!1;class os extends _m{_ws;_retryCount=-1;_uptimeTimeout;_connectTimeout;_shouldReconnect=!0;_connectLock=!1;_binaryType;_closeCalled=!1;_messageQueue=[];_debugLogger=console.log.bind(console);_url;_protocols;_options;constructor(t,n,r={}){fT||(vV(),fT=!0),super(),this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),this._options.binaryType?this._binaryType=this._options.binaryType:this._binaryType="blob",this._options.debugLogger&&(this._debugLogger=this._options.debugLogger),this._connect()}static get CONNECTING(){return 0}static get OPEN(){return 1}static get CLOSING(){return 2}static get CLOSED(){return 3}get CONNECTING(){return os.CONNECTING}get OPEN(){return os.OPEN}get CLOSING(){return os.CLOSING}get CLOSED(){return os.CLOSED}get binaryType(){return this._ws?this._ws.binaryType:this._binaryType}set binaryType(t){this._binaryType=t,this._ws&&(this._ws.binaryType=t)}get retryCount(){return Math.max(this._retryCount,0)}get bufferedAmount(){return this._messageQueue.reduce((n,r)=>(typeof r=="string"?n+=r.length:r instanceof Blob?n+=r.size:n+=r.byteLength,n),0)+(this._ws?.bufferedAmount??0)}get extensions(){return this._ws?.extensions??""}get protocol(){return this._ws?.protocol??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?os.CLOSED:os.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}onclose=null;onerror=null;onmessage=null;onopen=null;close(t=1e3,n){if(this._closeCalled=!0,this._shouldReconnect=!1,this._clearTimeouts(),!this._ws){this._debug("close enqueued: no ws instance");return}if(this._ws.readyState===this.CLOSED){this._debug("close: already closed");return}this._ws.close(t,n)}reconnect(t,n){this._shouldReconnect=!0,this._closeCalled=!1,this._retryCount=-1,!this._ws||this._ws.readyState===this.CLOSED?this._connect():(this._disconnect(t,n),this._connect())}send(t){if(this._ws&&this._ws.readyState===this.OPEN)this._debug("send",t),this._ws.send(t);else{const{maxEnqueuedMessages:n=Fs.maxEnqueuedMessages}=this._options;this._messageQueue.length<n&&(this._debug("enqueue",t),this._messageQueue.push(t))}}_debug(...t){this._options.debug&&this._debugLogger("RWS>",...t)}_getNextDelay(){const{reconnectionDelayGrowFactor:t=Fs.reconnectionDelayGrowFactor,minReconnectionDelay:n=Fs.minReconnectionDelay,maxReconnectionDelay:r=Fs.maxReconnectionDelay}=this._options;let o=0;return this._retryCount>0&&(o=n*Math.pow(t,this._retryCount-1),o>r&&(o=r)),this._debug("next delay",o),o}_wait(){return new Promise(t=>{setTimeout(t,this._getNextDelay())})}_connect(){if(this._connectLock||!this._shouldReconnect)return;this._connectLock=!0;const{maxRetries:t=Fs.maxRetries,connectionTimeout:n=Fs.connectionTimeout}=this._options;if(this._retryCount>=t){this._debug("max retries reached",this._retryCount,">=",t);return}this._retryCount++,this._debug("connect",this._retryCount),this._removeListeners(),this._wait().then(()=>{if(this._closeCalled){this._connectLock=!1;return}!this._options.WebSocket&&typeof WebSocket>"u"&&!hT&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),hT=!0);const r=this._options.WebSocket||WebSocket;this._debug("connect",{url:this._url,protocols:this._protocols}),this._ws=this._protocols?new r(this._url,this._protocols):new r(this._url),this._ws.binaryType=this._binaryType,this._connectLock=!1,this._addListeners(),this._connectTimeout=setTimeout(()=>this._handleTimeout(),n)}).catch(r=>{this._connectLock=!1,this._handleError(new Dc.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Dc.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Dc.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_handleOpen=t=>{this._debug("open event");const{minUptime:n=Fs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),n),yV(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(r=>this._ws?.send(r)),this._messageQueue=[],this.onopen&&this.onopen(t),this.dispatchEvent(Rh(t))};_handleMessage=t=>{this._debug("message event"),this.onmessage&&this.onmessage(t),this.dispatchEvent(Rh(t))};_handleError=t=>{this._debug("error event",t.message),this._disconnect(void 0,t.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(t),this._debug("exec error listeners"),this.dispatchEvent(Rh(t)),this._connect()};_handleClose=t=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(t),this.dispatchEvent(Rh(t))};_removeListeners(){this._ws&&(this._debug("removeListeners"),this._ws.removeEventListener("open",this._handleOpen),this._ws.removeEventListener("close",this._handleClose),this._ws.removeEventListener("message",this._handleMessage),this._ws.removeEventListener("error",this._handleError))}_addListeners(){this._ws&&(this._debug("addListeners"),this._ws.addEventListener("open",this._handleOpen),this._ws.addEventListener("close",this._handleClose),this._ws.addEventListener("message",this._handleMessage),this._ws.addEventListener("error",this._handleError))}_clearTimeouts(){clearTimeout(this._connectTimeout),clearTimeout(this._uptimeTimeout)}}const xV=5e3;class wx extends _m{criteria;constructor(...t){super(),this.criteria=new Set(t)}getCriteria(){return this.criteria}_addCriteria(t){this.criteria.add(t)}_removeCriteria(t){this.criteria.delete(t)}}class bV{criteria;emitter;refCount;subscriptionProps;subscriptionId;token;connecting=!1;constructor(t,n){this.criteria=t,this.emitter=new wx(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class SV{medplum;ws;masterSubEmitter;criteriaEntries;criteriaEntriesBySubscriptionId;wsClosed;pingTimer=void 0;pingIntervalMs;waitingForPong=!1;currentProfile;constructor(t,n,r){if(!(t instanceof zA))throw new gt(xn("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new gt(xn("Not a valid URL"))}const l=r?.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger}):new os(o,void 0,{debug:r?.debug,debugLogger:r?.debugLogger});this.medplum=t,this.ws=l,this.masterSubEmitter=new wx,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=r?.pingIntervalMs??xV,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{try{const r=JSON.parse(n.data);if(r.type==="pong"){this.waitingForPong=!1;return}const o=r,l=o?.entry?.[0]?.resource;if(l.type==="heartbeat"){this.masterSubEmitter?.dispatchEvent({type:"heartbeat",payload:o});return}if(l.type==="handshake"){const d=ll(l.subscription),f={type:"connect",payload:{subscriptionId:d}};this.masterSubEmitter?.dispatchEvent(f);const p=this.criteriaEntriesBySubscriptionId.get(d);if(!p){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}p.connecting=!1,p.emitter.dispatchEvent({...f});return}this.masterSubEmitter?.dispatchEvent({type:"message",payload:o});const c=this.criteriaEntriesBySubscriptionId.get(ll(l.subscription));if(!c){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}c.emitter.dispatchEvent({type:"message",payload:o})}catch(r){console.error(r);const o={type:"error",payload:r};this.masterSubEmitter?.dispatchEvent(o);for(const l of this.getAllCriteriaEmitters())l.dispatchEvent({...o})}}),t.addEventListener("error",()=>{const n={type:"error",payload:new gt(A8(new Error("WebSocket error")))};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n})}),t.addEventListener("close",()=>{const n={type:"close"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),this.masterSubEmitter?.removeAllListeners())}),t.addEventListener("open",()=>{const n={type:"open"};this.masterSubEmitter?.dispatchEvent(n);for(const r of this.getAllCriteriaEmitters())r.dispatchEvent({...n});this.refreshAllSubscriptions().catch(console.error),this.pingTimer||(this.pingTimer=setInterval(()=>{if(this.waitingForPong){this.waitingForPong=!1,t.reconnect();return}t.send(JSON.stringify({type:"ping"})),this.waitingForPong=!0},this.pingIntervalMs))}),this.medplum.addEventListener("change",()=>{const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&this.currentProfile?.id!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){const r={type:"error",payload:n};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){const{subscriptionId:n}=t;if(n){const r={type:"disconnect",payload:{subscriptionId:n}};this.masterSubEmitter?.dispatchEvent(r),t.emitter.dispatchEvent({...r})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){let n=t?.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${Nt(this.medplum.getProfile())}`,channel:{type:"websocket"},criteria:t.criteria})).id);const{parameter:r}=await this.medplum.get(`fhir/R4/Subscription/${n}/$get-ws-binding-token`),o=r?.find(c=>c.name==="token")?.valueString,l=r?.find(c=>c.name==="websocket-url")?.valueUrl;if(!o)throw new gt(xn("Failed to get token"));if(!l)throw new gt(xn("Failed to get URL from $get-ws-binding-token"));return[n,o]}maybeGetCriteriaEntry(t,n){const r=this.criteriaEntries.get(t);if(r){if(!n)return r.bareCriteria;for(const o of r.criteriaWithProps)if(Do(n,o.subscriptionProps))return o}}getAllCriteriaEmitters(){const t=[];for(const n of this.criteriaEntries.values()){n.bareCriteria&&t.push(n.bareCriteria.emitter);for(const r of n.criteriaWithProps)t.push(r.emitter)}return t}addCriteriaEntry(t){const{criteria:n,subscriptionProps:r}=t;let o;this.criteriaEntries.has(n)?o=this.criteriaEntries.get(n):(o={criteriaWithProps:[]},this.criteriaEntries.set(n,o)),r?o.criteriaWithProps.push(t):o.bareCriteria=t}removeCriteriaEntry(t){const{criteria:n,subscriptionProps:r,subscriptionId:o,token:l}=t;if(!this.criteriaEntries.has(n))return;const c=this.criteriaEntries.get(n);r?c.criteriaWithProps=c.criteriaWithProps.filter(d=>{const f=d.subscriptionProps;return!Do(r,f)}):c.bareCriteria=void 0,!c.bareCriteria&&c.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),this.masterSubEmitter?._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),l&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:l}}))}async subscribeToCriteria(t){if(!(this.ws.readyState!==WebSocket.OPEN||t.connecting)){t.connecting=!0;try{const[n,r]=await this.getTokenForCriteria(t);t.subscriptionId=n,t.token=r,this.criteriaEntriesBySubscriptionId.set(n,t),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:r}}))}catch(n){console.error(Ye(n)),this.emitError(t,n),this.removeCriteriaEntry(t)}}}async refreshAllSubscriptions(){this.criteriaEntriesBySubscriptionId.clear();for(const t of this.criteriaEntries.values())for(const n of[...t.bareCriteria?[t.bareCriteria]:[],...t.criteriaWithProps])n.clearAttachedSubscription(),await this.subscribeToCriteria(n)}addCriteria(t,n){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const r=this.maybeGetCriteriaEntry(t,n);if(r)return r.refCount+=1,r.emitter;const o=new bV(t,n);return this.addCriteriaEntry(o),this.subscribeToCriteria(o).catch(console.error),o.emitter}removeCriteria(t,n){const r=this.maybeGetCriteriaEntry(t,n);if(!r){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}r.refCount-=1,!(r.refCount>0)&&(this.maybeEmitDisconnect(r),this.removeCriteriaEntry(r))}getWebSocket(){return this.ws}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}reconnectWebSocket(){this.ws.reconnect(),this.wsClosed=!1}getCriteriaCount(){return this.getAllCriteriaEmitters().length}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new wx(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const IA="5.0.0-fcd06dc",wV=on.FHIR_JSON+", */*; q=0.1",jV="https://api.medplum.com/",CV=1e3,EV=6e4,TV=0,RV=3e5,_V="Binary/",pT={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]},bc={ClientCredentials:"client_credentials",AuthorizationCode:"authorization_code",RefreshToken:"refresh_token",JwtBearer:"urn:ietf:params:oauth:grant-type:jwt-bearer",TokenExchange:"urn:ietf:params:oauth:grant-type:token-exchange"},DV={AccessToken:"urn:ietf:params:oauth:token-type:access_token"},AV={JwtBearer:"urn:ietf:params:oauth:client-assertion-type:jwt-bearer"};class zA extends _m{options;fetch;createPdfImpl;storage;requestCache;cacheTime;baseUrl;fhirBaseUrl;authorizeUrl;tokenUrl;logoutUrl;fhircastHubUrl;defaultHeaders;onUnauthenticated;autoBatchTime;autoBatchQueue;refreshGracePeriod;subscriptionManager;medplumServer;clientId;clientSecret;credentialsInHeader;autoBatchTimerId;accessToken;accessTokenExpires;refreshToken;refreshPromise;profilePromise;sessionDetails;currentRateLimits;basicAuth;initPromise;initComplete=!0;keyValueClient;constructor(t){if(super(),t?.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=t?.fetch??kV(),this.storage=t?.storage??new mV(void 0,t?.storagePrefix),this.createPdfImpl=t?.createPdf,this.baseUrl=I0(t?.baseUrl??jV),this.fhirBaseUrl=mo(this.baseUrl,t?.fhirUrlPath??"fhir/R4"),this.authorizeUrl=mo(this.baseUrl,t?.authorizeUrl??"oauth2/authorize"),this.tokenUrl=mo(this.baseUrl,t?.tokenUrl??"oauth2/token"),this.logoutUrl=mo(this.baseUrl,t?.logoutUrl??"oauth2/logout"),this.fhircastHubUrl=mo(this.baseUrl,t?.fhircastHubUrl??"fhircast/STU3"),this.clientId=t?.clientId??"",this.clientSecret=t?.clientSecret??"",this.credentialsInHeader=t?.authCredentialsMethod==="header",this.defaultHeaders=t?.defaultHeaders??{},this.onUnauthenticated=t?.onUnauthenticated,this.refreshGracePeriod=t?.refreshGracePeriod??RV,this.cacheTime=t?.cacheTime??(vo()?EV:TV),this.cacheTime>0?this.requestCache=new YD(t?.resourceCacheSize??CV):this.requestCache=void 0,t?.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t?.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t?.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initPromise=Promise.resolve(),this.dispatchEvent({type:"storageInitialized"})):(this.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t?.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0,this.dispatchEvent({type:"storageInitialized"})}).catch(n=>{console.error(n),this.initComplete=!0,this.dispatchEvent({type:"storageInitFailed",payload:{error:n}})})),this.setupStorageListener()}get isInitialized(){return this.initComplete}getInitPromise(){return this.initPromise}async attemptResumeActiveLogin(){const t=this.getActiveLogin();t&&(this.setAccessToken(t.accessToken,t.refreshToken),await this.refreshProfile())}getBaseUrl(){return this.baseUrl}getAuthorizeUrl(){return this.authorizeUrl}getTokenUrl(){return this.tokenUrl}getLogoutUrl(){return this.logoutUrl}getFhircastHubUrl(){return this.fhircastHubUrl}getDefaultHeaders(){return this.defaultHeaders}clear(){this.storage.clear(),vo()&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){this.storage.setString("activeLogin",void 0),this.requestCache?.clear(),this.accessToken=void 0,this.refreshToken=void 0,this.refreshPromise=void 0,this.accessTokenExpires=void 0,this.sessionDetails=void 0,this.medplumServer=void 0,this.dispatchEvent({type:"change"})}invalidateUrl(t){t=t.toString(),this.requestCache?.delete(t)}invalidateAll(){this.requestCache?.clear()}invalidateSearches(t){const n=mo(this.fhirBaseUrl,t);if(this.requestCache)for(const r of this.requestCache.keys())(r.endsWith(n)||r.includes(n+"?"))&&this.requestCache.delete(r)}get(t,n={}){t=t.toString();const r=this.getCacheEntry(t,n);if(r)return r.value;let o;t.startsWith(this.fhirBaseUrl)&&this.autoBatchQueue&&!n.disableAutoBatch?o=new Promise((c,d)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:c,reject:d}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const l=new Wi(o);return this.setCacheEntry(t,l),l}post(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("POST",t,o)}put(t,n,r,o={}){return t=t.toString(),this.setRequestBody(o,n),r&&this.setRequestContentType(o,r),this.invalidateUrl(t),this.request("PUT",t,o)}patch(t,n,r={}){return t=t.toString(),this.setRequestBody(r,n),this.setRequestContentType(r,on.JSON_PATCH),this.invalidateUrl(t),this.request("PATCH",t,r)}delete(t,n){return t=t.toString(),this.invalidateUrl(t),this.request("DELETE",t,n)}async startNewUser(t,n){const{codeChallengeMethod:r,codeChallenge:o}=await this.startPkce();return this.post("auth/newuser",{...t,clientId:t.clientId??this.clientId,codeChallengeMethod:r,codeChallenge:o},void 0,n)}async startNewProject(t,n){return this.post("auth/newproject",t,void 0,n)}async startNewPatient(t,n){return this.post("auth/newpatient",t,void 0,n)}async startLogin(t,n){return this.post("auth/login",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async startGoogleLogin(t,n){return this.post("auth/google",{...await this.ensureCodeChallenge(t),clientId:t.clientId??this.clientId,scope:t.scope},void 0,n)}async ensureCodeChallenge(t){return t.codeChallenge?t:{...t,...await this.startPkce()}}async signOut(){await this.post(this.logoutUrl,{}),this.clear()}async signInWithRedirect(t){const r=new URLSearchParams(rr.getSearch()).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){rr.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,l=!0){let c=o;l&&(c=await this.ensureCodeChallenge(o)),rr.assign(this.getExternalAuthRedirectUri(t,n,r,c,l))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");return this.fetchTokens({grant_type:bc.TokenExchange,subject_token_type:DV.AccessToken,client_id:n,subject_token:t})}getExternalAuthRedirectUri(t,n,r,o,l=!0){const c=new URL(t);if(c.searchParams.set("response_type","code"),c.searchParams.set("client_id",n),c.searchParams.set("redirect_uri",r),c.searchParams.set("scope",o.scope??"openid profile email"),c.searchParams.set("state",JSON.stringify(o)),l){const{codeChallenge:d,codeChallengeMethod:f}=o;if(!f)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!d)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");c.searchParams.set("code_challenge_method",f),c.searchParams.set("code_challenge",d)}return c.toString()}fhirUrl(...t){return new URL(mo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=wU(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),l="search-"+o.toString(),c=this.getCacheEntry(l,r);if(c)return c.value;const d=this.getBundle(o,r);return this.setCacheEntry(l,d),d}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const l="searchOne-"+o.toString(),c=this.getCacheEntry(l,r);if(c)return c.value;const d=new Wi(this.search(t,o.searchParams,r).then(f=>f.entry?.[0]?.resource));return this.setCacheEntry(l,d),d}searchResources(t,n,r){const l="searchResources-"+this.fhirSearchUrl(t,n).toString(),c=this.getCacheEntry(l,r);if(c)return c.value;const d=new Wi(this.search(t,n,r).then(gT));return this.setCacheEntry(l,d),d}async*searchResourcePages(t,n,r){let o=this.fhirSearchUrl(t,n);for(;o;){const l=new URL(o).searchParams;l.has("_count")||l.set("_count","1000");const c=await this.search(t,l,r),d=c.link?.find(f=>f.relation==="next");if(!c.entry?.length&&!d)break;yield gT(c),o=d?.url?new URL(d.url):void 0}}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){const r=this.requestCache?.get(this.fhirUrl(t,n).toString())?.value;return r?.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return pT;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){if(!n)throw new Error('The "id" parameter cannot be null, undefined, or an empty string.');return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new Wi(Promise.reject(new Error("Missing reference")));if(r==="system")return new Wi(Promise.resolve(pT));const[o,l]=r.split("/");return!o||!l?new Wi(Promise.reject(new Error("Invalid reference"))):this.readResource(o,l,n)}requestSchema(t){if(nA(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Wi((async()=>{const l=`{
|
|
92
|
+
StructureDefinitionList(_filter: "name eq ${t}") {
|
|
93
|
+
resourceType,
|
|
94
|
+
name,
|
|
95
|
+
kind,
|
|
96
|
+
description,
|
|
97
|
+
type,
|
|
98
|
+
url,
|
|
99
|
+
snapshot {
|
|
100
|
+
element {
|
|
101
|
+
id,
|
|
102
|
+
path,
|
|
103
|
+
definition,
|
|
104
|
+
min,
|
|
105
|
+
max,
|
|
106
|
+
base {
|
|
107
|
+
path,
|
|
108
|
+
min,
|
|
109
|
+
max
|
|
110
|
+
},
|
|
111
|
+
contentReference,
|
|
112
|
+
type {
|
|
113
|
+
code,
|
|
114
|
+
profile,
|
|
115
|
+
targetProfile
|
|
116
|
+
},
|
|
117
|
+
binding {
|
|
118
|
+
strength,
|
|
119
|
+
valueSet
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
SearchParameterList(base: "${t}", _count: 100) {
|
|
125
|
+
base,
|
|
126
|
+
code,
|
|
127
|
+
type,
|
|
128
|
+
expression,
|
|
129
|
+
target
|
|
130
|
+
}
|
|
131
|
+
}`.replace(/\s+/g," "),c=await this.graphql(l);KE(c.data.StructureDefinitionList);for(const d of c.data.SearchParameterList)OU(d)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!n?.expandProfile&&P0(t))return Promise.resolve();const r=t+"-requestSchema"+(n?.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const l=new Wi((async()=>{if(n?.expandProfile){const c=this.fhirUrl("StructureDefinition","$expand-profile");c.search=new URLSearchParams({url:t}).toString();const d=await this.post(c.toString(),{});KE(d)}else{const c=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!c){console.warn(`No StructureDefinition found for ${t}!`);return}tA(c)}})());return this.setCacheEntry(r,l),l}readHistory(t,n,r,o){const l=this.fhirUrl(t,n,"_history");return r?.count&&l.searchParams.set("_count",r.count.toString()),r?.offset&&l.searchParams.set("_offset",r.offset.toString()),this.get(l.toString(),o)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$everything"),n)}readPatientSummary(t,n){return this.getBundle(this.fhirUrl("Patient",t,"$summary"),n)}createResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");return this.invalidateSearches(t.resourceType),this.post(this.fhirUrl(t.resourceType),t,void 0,n)}async createResourceIfNoneExist(t,n,r){const o=this.fhirUrl(t.resourceType);r?r.headers?Array.isArray(r.headers)?r.headers.push(["If-None-Exist",n]):r.headers instanceof Headers?r.headers.set("If-None-Exist",n):r.headers["If-None-Exist"]=n:r.headers={"If-None-Exist":n}:r={headers:{"If-None-Exist":n}};const l=await this.post(o,t,void 0,r);return this.cacheResource(l),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),l}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let l=await this.put(o,t,void 0,r);return l||(l=t),this.cacheResource(l),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),l}async createAttachment(t,n,r,o,l){let c=vT(t,n,r,o);if(c.contentType===on.XML){const p=c.data;let m;p instanceof Blob?m=await new Promise((g,y)=>{const b=new FileReader;b.onload=()=>{if(!b.result){y(new Error("Failed to load file"));return}g(b.result)},b.readAsText(p,"utf-8")}):ArrayBuffer.isView(p)?m=new TextDecoder().decode(p):m=p,m.includes("<ClinicalDocument")&&m.includes("urn:hl7-org:v3")&&(c={...c,contentType:on.CDA_XML})}const d=l??(typeof n=="object"?n:{}),f=await this.createBinary(c,d);return{contentType:c.contentType,url:f.url,title:c.filename}}createBinary(t,n,r,o,l){const c=vT(t,n,r,o),d=l??(typeof n=="object"?n:{}),{data:f,contentType:p,filename:m,securityContext:g,onProgress:y}=c,b=this.fhirUrl("Binary");return m&&b.searchParams.set("_filename",m),g?.reference&&this.setRequestHeader(d,"X-Security-Context",g.reference),y?this.uploadwithProgress(b,f,p,y,d):this.post(b,f,p,d)}uploadwithProgress(t,n,r,o,l){return new Promise((c,d)=>{const f=new XMLHttpRequest,p=()=>f.abort();l?.signal?.addEventListener("abort",p);const m=g=>{l?.signal?.removeEventListener("abort",p),g instanceof Error?d(g):c(g)};if(f.responseType="json",f.onabort=()=>m(new DOMException("Request aborted","AbortError")),f.onerror=()=>m(new Error("Request error")),o&&(f.upload.onprogress=g=>o(g),f.upload.onload=g=>o(g)),f.onload=()=>{f.status>=200&&f.status<300?m(f.response):m(new gt(Yt(f.response||f.statusText)))},f.open("POST",t),f.withCredentials=!0,f.setRequestHeader("Authorization","Bearer "+this.accessToken),f.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),f.setRequestHeader("Content-Type",r),this.options.extendedMode!==!1&&f.setRequestHeader("X-Medplum","extended"),l?.headers){const g=l.headers;for(const[y,b]of Object.entries(g))f.setRequestHeader(y,b)}f.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const l=NV(t,n,r,o),c=typeof n=="object"?n:{},{docDefinition:d,tableLayouts:f,fonts:p,...m}=l,g=await this.createPdfImpl(d,f,p),y={...m,data:g,contentType:"application/pdf"};return this.createBinary(y,c)}createComment(t,n,r){const o=this.getProfile();let l,c;return t.resourceType==="Encounter"&&(l=Wt(t),c=t.subject),t.resourceType==="ServiceRequest"&&(l=t.encounter,c=t.subject),t.resourceType==="Patient"&&(c=Wt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Wt(t)],encounter:l,subject:c,sender:o?Wt(o):void 0,sent:new Date().toISOString(),payload:[{contentString:n}]},r)}async updateResource(t,n){if(!t.resourceType)throw new Error("Missing resourceType");if(!t.id)throw new Error("Missing id");let r=await this.put(this.fhirUrl(t.resourceType,t.id),t,void 0,n);return r||(r=t),this.cacheResource(r),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),r}async patchResource(t,n,r,o){const l=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(l),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),l}deleteResource(t,n,r){return this.deleteCacheEntry(this.fhirUrl(t,n).toString()),this.invalidateSearches(t),this.delete(this.fhirUrl(t,n),r)}validateResource(t,n){return this.post(this.fhirUrl(t.resourceType,"$validate"),t,void 0,n)}executeBot(t,n,r,o){let l;if(typeof t=="string"){const c=t;l=this.fhirUrl("Bot",c,"$execute")}else{const c=t;l=this.fhirUrl("Bot","$execute"),l.searchParams.set("identifier",c.system+"|"+c.value)}return this.post(l,n,r,o)}executeBatch(t,n){return this.post(this.fhirBaseUrl,t,void 0,n)}sendEmail(t,n){return this.post("email/v1/send",t,on.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},on.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,l,c){const{waitTimeout:d,...f}=c??{};return this.post(this.fhirUrl("Agent",ll(t),"$push"),{destination:typeof n=="string"?n:Nt(n),body:r,contentType:o,waitForResponse:l,...d!==void 0?{waitTimeout:d}:void 0},on.FHIR_JSON,f)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){(!this.sessionDetails?.profile||Nt(this.sessionDetails.profile)!==t.profile?.reference)&&this.clearActiveLogin(),this.setAccessToken(t.accessToken,t.refreshToken),this.storage.setObject("activeLogin",t),this.addLogin(t),this.refreshPromise=void 0,await this.refreshProfile()}getAccessToken(){return this.accessToken}isAuthenticated(t){return this.accessTokenExpires!==void 0&&Date.now()<this.accessTokenExpires-(t??this.refreshGracePeriod)}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=hV(t),this.medplumServer=fV(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>r.profile?.reference!==t.profile?.reference);n.push(t),this.storage.setObject("logins",n)}async refreshProfile(){return this.medplumServer?(this.profilePromise=new Promise((t,n)=>{this.get("auth/me",{cache:"no-cache"}).then(r=>{this.profilePromise=void 0;const o=this.sessionDetails?.profile?.id!==r.profile.id;this.sessionDetails=r,o&&this.dispatchEvent({type:"change"}),t(r.profile),this.dispatchEvent({type:"profileRefreshed"})}).catch(n)}),this.dispatchEvent({type:"profileRefreshing"}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!this.isInitialized||!!this.profilePromise&&!this.sessionDetails?.profile}isSuperAdmin(){return!!this.sessionDetails?.project.superAdmin}isProjectAdmin(){return!!this.sessionDetails?.membership.admin}getProject(){return this.sessionDetails?.project}getProjectMembership(){return this.sessionDetails?.membership}getProfile(){return this.sessionDetails?.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){return this.sessionDetails?.config}getAccessPolicy(){return this.sessionDetails?.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(_V)&&(t=this.fhirUrl(r));let o=n.headers;return o||(o={},n.headers=o),o.Accept||(o.Accept="*/*"),this.addFetchOptionsDefaults(n),(await this.fetchWithRetry(t.toString(),n)).blob()}async createMedia(t,n){const{additionalFields:r,...o}=t,l=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=Wt(l));const c=await this.createAttachment(o,n);return this.updateResource({...l,status:"completed",content:c})}async uploadMedia(t,n,r,o,l){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},l)}async createDocumentReference(t,n){const{additionalFields:r,...o}=t,l=await this.createResource({resourceType:"DocumentReference",status:"current",content:[{attachment:{contentType:t.contentType}}],...r});o.securityContext||(o.securityContext=Wt(l));const c=await this.createAttachment(o,n);return this.updateResource({...l,content:[{attachment:c}]})}async bulkExport(t="",n,r,o){const l=t&&`${t}/`,c=this.fhirUrl(`${l}$export`);return n&&c.searchParams.set("_type",n),r&&c.searchParams.set("_since",r),this.startAsyncRequest(c.toString(),o)}async startAsyncRequest(t,n={}){this.addFetchOptionsDefaults(n);const r=n.headers;return r.Prefer="respond-async",this.request("POST",t,n)}get keyValue(){return this.keyValueClient||(this.keyValueClient=new pV(this)),this.keyValueClient}getBundle(t,n){return new Wi((async()=>{const r=await this.get(t,n);if(r.entry)for(const o of r.entry)this.cacheResource(o.resource);return r})())}getCacheEntry(t,n){if(!this.requestCache||n?.cache==="no-cache"||n?.cache==="reload")return;const r=this.requestCache.get(t);if(!(!r||r.requestTime+this.cacheTime<Date.now()))return r}setCacheEntry(t,n){this.requestCache&&this.requestCache.set(t,{requestTime:Date.now(),value:n})}cacheResource(t){t?.id&&!t.meta?.tag?.some(n=>n.code==="SUBSETTED")&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Wi(Promise.resolve(t)))}deleteCacheEntry(t){this.requestCache&&this.requestCache.delete(t)}async request(t,n,r={},o={}){await this.refreshIfExpired(),r.method=t,this.addFetchOptionsDefaults(r);const l=await this.fetchWithRetry(n,r);if(l.status===401)return this.handleUnauthenticated(t,n,r);if(l.status===204||l.status===304)return;const d=l.headers.get("content-type")?.includes("json");if(l.status===404&&!d)throw new gt(_8);const f=await this.parseBody(l,d);if(l.status===200&&r.followRedirectOnOk||l.status===201&&r.followRedirectOnCreated){const p=await mT(l,f);if(p)return this.request("GET",p,{...r,body:void 0})}if(l.status===202&&r.pollStatusOnAccepted){const m=await mT(l,f)??o.statusUrl;if(m)return this.pollStatus(m,r,o)}if(l.status>=400)throw new gt(Yt(f));return f}async parseBody(t,n){let r;if(t.headers.get("content-length")!=="0"){if(n)try{r=await t.json()}catch(o){throw console.error("Error parsing response",t.status,o),o}else r=await t.text();return r}}async fetchWithRetry(t,n){t.startsWith("http")||(t=mo(this.baseUrl,t));const r=n?.maxRetries??2;for(let o=0;o<=r;o++)try{this.options.verbose&&this.logRequest(t,n);const l=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(l),this.setCurrentRateLimit(l),o>=r||!MV(l))return l;const c=this.getRetryDelay(o),d=n.maxRetryTime??2e3;if(c>d)return l;await rT(c)}catch(l){if(l.message==="Failed to fetch"&&o===0&&this.dispatchEvent({type:"offline"}),l.name==="AbortError"||o===r)throw l}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of Bc(Object.keys(r)))console.log(`> ${o}: ${r[o]}`)}}logResponse(t){console.log(`< ${t.status} ${t.statusText}`),t.headers&&t.headers.forEach((n,r)=>console.log(`< ${r}: ${n}`))}setCurrentRateLimit(t){if(!t?.headers||typeof t.headers.get!="function")return;const n=t.headers.get("ratelimit");n&&(this.currentRateLimits=n)}rateLimitStatus(){if(!this.currentRateLimits)return[];const t=this.currentRateLimits;return t.split(/\s*;\s*/g).map(n=>{const r=n.split(/\s*,\s*/g);if(r.length!==3)throw new Error("Could not parse RateLimit header: "+t);const o=r[0].substring(1,r[0].length-1),l=r.find(p=>p.startsWith("r=")),c=l?parseInt(l.substring(2),10):NaN,d=r.find(p=>p.startsWith("t=")),f=d?parseInt(d.substring(2),10):NaN;if(!o||Number.isNaN(c)||Number.isNaN(f))throw new Error("Could not parse RateLimit header: "+t);return{name:o,remainingUnits:c,secondsUntilReset:f}})}getRetryDelay(t){const n=this.rateLimitStatus();let r=500*Math.pow(1.5,t);for(const o of n)o.remainingUnits||(r=Math.max(r,o.secondsUntilReset*1e3));return r}async pollStatus(t,n,r){const o={...n,method:"GET",body:void 0,redirect:"follow"};if(r.pollCount===void 0)n.headers&&typeof n.headers=="object"&&"Prefer"in n.headers&&(o.headers={...n.headers},delete o.headers.Prefer),r.statusUrl=t,r.pollCount=1;else{const l=n.pollStatusPeriod??1e3;await rT(l),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){if(this.autoBatchQueue===void 0)return;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const o=t[0];try{o.resolve(await this.request(o.method,mo(this.fhirBaseUrl,o.url),o.options))}catch(l){o.reject(new gt(Yt(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(o=>({request:{method:o.method,url:o.url},resource:o.options.body?JSON.parse(o.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let o=0;o<t.length;o++){const l=t[o],c=r.entry?.[o];c?.response?.outcome&&!XD(c.response.outcome)?l.reject(new gt(c.response.outcome)):l.resolve(c?.resource)}}addFetchOptionsDefaults(t){Object.entries(this.defaultHeaders).forEach(([n,r])=>{this.setRequestHeader(t,n,r)}),this.setRequestHeader(t,"Accept",wV,!0),this.options.extendedMode!==!1&&this.setRequestHeader(t,"X-Medplum","extended"),t.body&&this.setRequestHeader(t,"Content-Type",on.FHIR_JSON,!0),this.accessToken?this.setRequestHeader(t,"Authorization","Bearer "+this.accessToken):this.basicAuth&&this.setRequestHeader(t,"Authorization","Basic "+this.basicAuth),t.cache||(t.cache="no-cache"),t.credentials||(t.credentials="include")}setRequestContentType(t,n){this.setRequestHeader(t,"Content-Type",n)}setRequestHeader(t,n,r,o=!1){t.headers||(t.headers={});const l=t.headers;o&&l[n]||(l[n]=r)}setRequestBody(t,n){typeof n=="string"||typeof Blob<"u"&&(n instanceof Blob||n?.constructor.name==="Blob")||typeof File<"u"&&(n instanceof File||n?.constructor.name==="File")||typeof Uint8Array<"u"&&(n instanceof Uint8Array||n?.constructor.name==="Uint8Array")?t.body=n:n&&(t.body=JSON.stringify(n))}handleUnauthenticated(t,n,r){return this.refresh()?this.request(t,n,r):(this.clear(),this.onUnauthenticated&&this.onUnauthenticated(),Promise.reject(new gt(xd)))}async startPkce(){const t=cT();sessionStorage.setItem("pkceState",t);const n=cT().slice(0,128);sessionStorage.setItem("codeVerifier",n);try{const r=await YB(n);return{codeChallengeMethod:"S256",codeChallenge:gU(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","")}}catch(r){return console.warn("Failed to hash code verifier. Falling back to 'plain' code challenge method",r),{codeChallengeMethod:"plain",codeChallenge:n}}}async requestAuthorization(t){const n=await this.ensureCodeChallenge(t??{}),r=new URL(this.authorizeUrl);r.searchParams.set("response_type","code"),r.searchParams.set("state",sessionStorage.getItem("pkceState")),r.searchParams.set("client_id",n.clientId??this.clientId),r.searchParams.set("redirect_uri",n.redirectUri??rr.getOrigin()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),rr.assign(r.toString())}processCode(t,n){const r={grant_type:bc.AuthorizationCode,code:t,client_id:n?.clientId??this.clientId??"",redirect_uri:n?.redirectUri??rr.getOrigin()};if(typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&(r.code_verifier=o)}return this.fetchTokens(r)}refreshIfExpired(t){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&!this.isAuthenticated(t)&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken)return this.refreshPromise=this.fetchTokens({grant_type:bc.RefreshToken,client_id:this.clientId??"",refresh_token:this.refreshToken}),this.refreshPromise;if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){return this.clientId=t,this.clientSecret=n,this.fetchTokens({grant_type:bc.ClientCredentials,client_id:t,client_secret:n})}async startJwtBearerLogin(t,n,r){return this.clientId=t,this.fetchTokens({grant_type:bc.JwtBearer,client_id:t,assertion:n,scope:r})}async startJwtAssertionLogin(t){return this.fetchTokens({grant_type:bc.ClientCredentials,client_assertion_type:AV.JwtBearer,client_assertion:t})}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=lT(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new gt(xn("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new gt(xn("Invalid events provided. Events must be an array of event names containing at least one event."));const r={channelType:"websocket",mode:"subscribe",topic:t,events:n},l=(await this.post(this.fhircastHubUrl,uT(r),on.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!l)throw new Error("Invalid response!");return r.endpoint=l,r}async fhircastUnsubscribe(t){if(!W0(t))throw new gt(xn("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new gt(xn("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post(this.fhircastHubUrl,uT(t),on.FORM_URL_ENCODED)}fhircastConnect(t){return new cV(t)}async fhircastPublish(t,n,r,o){return nV(n)?this.post(this.fhircastHubUrl,dT(t,n,r,o),on.JSON):(rV(n),this.post(this.fhircastHubUrl,dT(t,n,r),on.JSON))}async fhircastGetContext(t){return this.get(`${this.fhircastHubUrl}/${t}`,{cache:"no-cache"})}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n=new URLSearchParams(t),r={...this.defaultHeaders,"Content-Type":on.FORM_URL_ENCODED};this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`),this.credentialsInHeader&&(n.delete("client_id"),n.delete("client_secret"),!this.basicAuth&&t.client_id&&t.client_secret&&(r.Authorization=`Basic ${lT(t.client_id+":"+t.client_secret)}`));const o={method:"POST",headers:r,body:n.toString(),credentials:"include"};let l;try{l=await this.fetchWithRetry(this.tokenUrl,o)}catch(d){throw this.refreshPromise=void 0,d}if(!l.ok){this.clearActiveLogin();try{const d=await l.json();throw new gt(jo(d.error_description))}catch(d){throw new gt(jo("Failed to fetch tokens"),d)}}const c=await l.json();return await this.verifyTokens(c),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(dV(n)){const r=Q0(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new gt(D8);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new gt(QE)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new gt(QE)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){return this.sessionDetails&&t?t.profile?.reference?.endsWith(this.sessionDetails.profile.id)??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)rr.reload();else if(t.key===this.storage.makeKey("activeLogin")){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;n?.profile.reference!==r?.profile.reference||!this.checkSessionDetailsMatchLogin(r)?rr.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new SV(this,SU(this.baseUrl,"/ws/subscriptions-r4"))),this.subscriptionManager}subscribeToCriteria(t,n){return this.getSubscriptionManager().addCriteria(t,n)}unsubscribeFromCriteria(t,n){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t,n),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function kV(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}async function mT(e,t){const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Sm(t)&&t.issue?.[0]?.diagnostics)return t.issue[0].diagnostics}function gT(e){const t=e.entry?.map(n=>n.resource)??[];return Object.assign(t,{bundle:e})}function PV(e){return Sr(e)&&"data"in e&&"contentType"in e}function vT(e,t,n,r){return PV(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function OV(e){return Sr(e)&&"docDefinition"in e}function NV(e,t,n,r){return OV(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function MV(e){return e.status===429||e.status>=500}function Vc({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:l}){if(t===e?.path)return;o??=e?.debugMode??!1,l??=e?.accessPolicyResource;let c=LV(t,n,e,!!o);const d=bx(t,".",2)[1];c=IV(c,l,d),c=zV(c,l,d);const f=Object.create(null);for(const[m,g]of Object.entries(c))f[t+"."+m]=g;let p;if(e&&!e.isDefaultContext)p=e.getExtendedProps;else{const m=Object.create(null);p=g=>{const y=bx(g,".",2)[1];if(y){if(!m[y]){const b=pp(y,l?.hiddenFields);m[y]={hidden:b,readonly:b||pp(y,l?.readonlyFields)}}return m[y]}}}return{path:t,elements:c,elementsByPath:f,profileUrl:r??e?.profileUrl,debugMode:o,getExtendedProps:p,accessPolicyResource:l}}function LV(e,t,n,r){const o=Object.create(null);if(n)for(const[c,d]of Object.entries(n.elementsByPath)){const f=Zs(e,c);f!==void 0&&(o[f]=d)}let l=!1;if(t)for(const[c,d]of Object.entries(t))c in o||(o[c]=d,l=!0);return r&&console.assert(l,"Unnecessary ElementsContext; not using any newly provided elements"),o}function IV(e,t,n){if(!t?.hiddenFields?.length)return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([o])=>!pp(r+o,t.hiddenFields)))}function zV(e,t,n){if(!t?.readonlyFields?.length)return e;const r=Object.create(null),o=n?n+".":"";for(const[l,c]of Object.entries(e))pp(o+l,t.readonlyFields)?r[l]={...c,readonly:!0}:r[l]=c;return r}function pp(e,t){if(!t?.length)return!1;const n=e.split(".");for(let r=1;r<=n.length;r++){const o=n.slice(0,r).join(".");if(t.includes(o))return!0}return!1}function $A(e){return e.type!==void 0&&e.type.length>0}function $V(e,t,n,r){const o=G$(e,t.path,{profileUrl:r});if(o){const l=n.typeSchema?.elements??n.elements;return o.some(c=>Y$(c,t,n,l))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function UA(e,t,n,r){if(e)for(const o of t){const l={value:e,type:o.typeSchema?.type??o.type?.[0].code};if(n.every(c=>$V(l,c,o,o.typeSchema?.url??r)))return o.name}}class UV{rootSchema;visitor;elementsContextStack;sliceAllowList;constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Vc({parentContext:void 0,path:this.rootSchema.type,elements:r??this.rootSchema.elements,profileUrl:this.rootSchema.name===this.rootSchema.type?void 0:this.rootSchema.url});if(o===void 0)throw new Error("Could not create root elements context");this.elementsContextStack=[o],this.visitor=n}get elementsContext(){return this.elementsContextStack.at(-1)}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([l])=>l.startsWith(n)));this.crawlElementsImpl(o,r),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlSlice(t,n,r){const o=this.prepareSlices(r.slices,r);if(!An(o.slices))throw new Error(`cannot crawl slice ${n.name} since it has no type information`);this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.sliceAllowList=[n],this.crawlSliceImpl(o.slices[0],n.path,o),this.sliceAllowList=void 0,this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlResource(){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema),this.crawlElementsImpl(this.rootSchema.elements,this.rootSchema.type),this.visitor.onExitSchema&&this.visitor.onExitSchema(this.rootSchema)}crawlElementsImpl(t,n){const r=BV(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const o of t.children)this.crawlElementNode(o,n);An(t.element?.slicing?.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){const r=[];for(const l of t){if(!$A(l))continue;const c=l.type.find(d=>An(d.profile))?.profile?.[0];if(An(c)){const d=ru(c);d&&(l.typeSchema=d)}r.push(l)}return{...n,slices:r}}crawlSlicingImpl(t,n){const r=this.prepareSlices(t.slices,t);for(const o of r.slices)(this.sliceAllowList===void 0||this.sliceAllowList.includes(o))&&this.crawlSliceImpl(o,n,r)}crawlSliceImpl(t,n,r){const o=t.typeSchema;o&&this.visitor.onEnterSchema&&this.visitor.onEnterSchema(o),this.visitor.onEnterSlice&&this.visitor.onEnterSlice(n,t,r);let l;const c=o?.elements??t.elements;An(c)&&(l=Vc({path:n,parentContext:this.elementsContext,elements:c})),l&&this.elementsContextStack.push(l),this.crawlElementsImpl(c,n),l&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function BV(e){const t=[];function n(l,c){return c.startsWith(l+".")}function r(l,c){for(const d of l.children)if(n(d.key,c.key)){r(d,c);return}l.children.push(c)}const o=Object.entries(e);o.sort((l,c)=>l[0].localeCompare(c[0]));for(const[l,c]of o){const d={key:l,element:c,children:[]};let f=!1;for(const p of t)if(n(p.key,l)){r(p,d),f=!0;break}f||t.push(d)}return t}const Dy="__sliceName";function VV(e,t){const n=new FV(e,e.resourceType,"resource");return new UV(t,n).crawlResource(),n.getDefaultValue()}function yT(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){mp(e,r,o,t);continue}const l=Zs(n,r);l!==void 0&&mp(e,l,o,t)}return e}class FV{rootValue;schemaStack;valueStack;constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=ui(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack.at(-1)}get value(){return this.valueStack.at(-1)}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const o=this.value.values,l=this.value.path,c=Zs(l,t);if(c===void 0)throw new Error(`Expected ${t} to be prefixed by ${l}`);const d=[];for(const f of o){if(f===void 0)continue;const p=Zs(r.path,l),m=Array.isArray(f)?f:[f];for(const g of m){HV(g,c,n,r.elements,p),mp(g,c,n,r.elements);const y=Cx(g,c,r.elements,p);y!==void 0&&d.push(y)}}this.valueStack.push({type:"element",path:t,values:d})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const l=Zs(this.value.path,t);if(l===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);const c=Zs(r.path,this.value.path);for(const d of this.value.values){const f=Cx(d,l,r.elements,c);if(Array.isArray(f))for(let p=f.length-1;p>=0;p--){const m=f[p];An(m)||f.splice(p,1)}bn(f)&&jx(d,void 0,l,n)}}onEnterSlice(t,n,r){const o=this.value.values,l=[];for(const c of o)if(c!==void 0){const d=Array.isArray(c)?c:[c],f=this.getMatchingSliceValues(d,n,r);l.push(f)}this.valueStack.push({type:"slice",path:t,values:l})}getMatchingSliceValues(t,n,r){const o=[];for(const l of t)(l[Dy]??UA(l,[n],r.discriminator,this.schema.url))===n.name&&o.push(l);for(let l=o.length;l<n.min;l++)if(L0(n.type[0].code)){const c=Object.create(null);o.push(c),t.push(c)}return o}onExitSlice(){const t=this.valueStack.pop();if(!t)throw new Error("Expected value context to exist in onExitSlice");for(const n of t.values)for(let r=n.length-1;r>=0;r--){const o=n[r];Dy in o&&delete o[Dy]}}getDefaultValue(){return this.rootValue}}function HV(e,t,n,r,o){const l=Cx(e,t,r,o);n.min>0&&l===void 0&&L0(n.type[0].code)&&(n.isArray?jx(e,[Object.create(null)],t,n):jx(e,Object.create(null),t,n))}function jx(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const l=r.type[0].code;o=n.replace("[x]",qn(l))}t===void 0?delete e[o]:e[o]=t}function Cx(e,t,n,r){const o=t.split(".");let l=e,c;for(let d=0;d<o.length;d++){let f=o[d];if(f.includes("[x]")){const p=(r?r+".":"")+o.slice(0,d+1).join("."),g=n[p].type[0].code;f=f.replace("[x]",qn(g))}if(d===o.length-1){Array.isArray(l)?c=l.map(p=>p[f]):c=l[f];continue}if(Array.isArray(l))l=l.map(p=>p[f]);else if(Sr(l)){if(l[f]===void 0)return;l=l[f]}else return}return c}function mp(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(d=>mp(d,t,n,r));e==null&&(e=Object.create(null));const o=e,l=t.split(".");let c=o;for(let d=0;d<l.length;d++){let f=l[d];if(f.includes("[x]")){const m=r[l.slice(0,d+1).join(".")].type[0].code;f=f.replace("[x]",qn(m))}if(d===l.length-1){const p=Array.isArray(c)?c:[c];for(const m of p)n.fixed?m[f]??=n.fixed.value:n.pattern&&(m[f]=BA(m[f],n.pattern.value))}else{if(!(f in c)){const p=l.slice(0,d+1).join(".");c[f]=r[p].isArray?[Object.create(null)]:Object.create(null)}c=c[f]}}return o}function BA(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return(e?.length??0)>0?e:ui(t);if(Sr(t)&&(Sr(e)&&!Array.isArray(e)||e===void 0)){const n=ui(e)??Object.create(null);for(const r of Object.keys(t))n[r]=BA(n[r],t[r]);return n}return e}const yr={BOOLEAN:"BOOLEAN",NUMBER:"NUMBER",QUANTITY:"QUANTITY",TEXT:"TEXT",REFERENCE:"REFERENCE",CANONICAL:"CANONICAL",DATE:"DATE",DATETIME:"DATETIME"};function Dm(e,t){let n=Ao.types[e]?.searchParamsDetails?.[t.code];return n||(n=GV(e,t)),n}function qV(e,t,n){let r=Ao.types[e];r||(r={},Ao.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function GV(e,t){const n=t.code,r=KV(e,t.expression),o={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const c of r){const d=Gh(c),f=xU(()=>d.join("."));d.length===1&&d[0]instanceof Yr?o.propertyTypes.add("boolean"):t.code.endsWith(":identifier")?o.propertyTypes.add("Identifier"):f().endsWith("extension.value.code")||f().endsWith("extension.value.coding.code")?(o.array=!0,o.propertyTypes.clear(),o.propertyTypes.add("code")):VA(o,d,e,1),f().endsWith("extension.valueDateTime")&&(o.array=!1,o.propertyTypes.clear(),o.propertyTypes.add("dateTime"))}const l={type:YV(t,o.propertyTypes),elementDefinitions:o.elementDefinitions.map(c=>({...c,type:c.type?.filter(d=>o.propertyTypes.has(d.code))})).filter(c=>c.type&&c.type.length>0),parsedExpression:XV(e,t.expression),array:o.array};return qV(e,n,l),l}function VA(e,t,n,r){const o=t[r];if(o instanceof hp){e.propertyTypes.add(o.right.toString());return}if(o instanceof V0){WV(e,o);return}const l=o.toString(),c=ws(n,l);if(!c)throw new Error(`Element definition not found for ${n} ${l}`);let d=!1,f=r+1;f<t.length&&t[f]instanceof F0&&(d=!0,f++);const p=t[f];if(c.isArray&&!d&&(e.array=!0),f===t.length-1&&p instanceof hp){e.elementDefinitions.push(c),e.propertyTypes.add(p.right.toString());return}if(f>=t.length){e.elementDefinitions.push(c);for(const m of c.type)e.propertyTypes.add(m.code);return}for(const m of c.type){let g=m.code;QV(g)&&(g=c.type[0].code),VA(e,t,g,f)}}function WV(e,t){if(t.name==="as"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="ofType"){e.propertyTypes.add(t.args[0].toString());return}if(t.name==="resolve"){e.propertyTypes.add("string");return}if(t.name==="where"&&t.args[0]instanceof B0){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function QV(e){return e==="Element"||e==="BackboneElement"}function YV(e,t){switch(e.type){case"date":return t.size===1&&t.has(re.date)?yr.DATE:yr.DATETIME;case"number":return yr.NUMBER;case"quantity":return yr.QUANTITY;case"reference":return t.has(re.canonical)?yr.CANONICAL:yr.REFERENCE;case"token":return t.size===1&&t.has(re.boolean)?yr.BOOLEAN:yr.TEXT;default:return yr.TEXT}}function KV(e,t){const n=[],r=H0(t);return gp(e,r.child,n),n}function XV(e,t){const n=[],r=H0(t);if(gp(e,r.child,n),n.length===0)return r;let o=n[0];for(let l=1;l<n.length;l++)o=new U0(o,n[l]);return new TA("<original-not-available>",o)}function gp(e,t,n){t instanceof U0?(gp(e,t.left,n),gp(e,t.right,n)):t.toString().includes(e+".")&&n.push(t)}function Gh(e){if(e instanceof hp||e instanceof F0)return[Gh(e.left),e].flat();if(e instanceof Yr)return[e];if(e instanceof $0)return[Gh(e.left),Gh(e.right)].flat();if(e instanceof V0){if(e.name==="where"&&!(e.args[0]instanceof B0))return[];if(e.name==="last")return[]}return[e]}const JV="https://meta.medplum.com/releases",Ay=new Map;function ZV(e){const t=e;if(!t.tag_name)throw new Error("Manifest missing tag_name");const n=t.assets;if(!n?.length)throw new Error("Manifest missing assets list");for(const r of n){if(!r.browser_download_url)throw new Error("Asset missing browser download URL");if(!r.name)throw new Error("Asset missing name")}}async function eF(e,t,n){let r=Ay.get("latest");if(!r){const o="latest",l=new URL(`${JV}/${o}.json`);l.searchParams.set("a",e),l.searchParams.set("c",IA);const c=await fetch(l.toString());if(c.status!==200){let f;try{f=(await c.json()).message}catch(p){console.error(`Failed to parse message from body: ${Ye(p)}`)}throw new Error(`Received status code ${c.status} while fetching manifest for version 'latest'. Message: ${f}`)}const d=await c.json();ZV(d),r=d,Ay.set("latest",r),Ay.set(r.tag_name.slice(1),r)}return r}async function tF(e){const t=await eF(e);if(!t.tag_name.startsWith("v"))throw new Error(`Invalid release name found. Release tag '${t.tag_name}' did not start with 'v'`);return t.tag_name.slice(1)}const FA=v.createContext(void 0);function Am(){return v.useContext(FA)}function _e(){return Am().medplum}function km(){return Am().navigate}function Pm(){return Am().profile}const xT=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function nF(e){const t=e.medplum,n=e.navigate??rF,[r,o]=v.useState({profile:t.getProfile(),loading:t.isLoading()});v.useEffect(()=>{function c(){o(d=>({...d,profile:t.getProfile(),loading:t.isLoading()}))}for(const d of xT)t.addEventListener(d,c);return()=>{for(const d of xT)t.removeEventListener(d,c)}},[t]);const l=v.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return a.jsx(FA.Provider,{value:l,children:e.children})}function rF(e){window.location.assign(e)}const bT=new Map,HA=e=>v.useMemo(()=>{if(!e)return;const t=e.split("?")[0];if(!t)return e;let n;try{n=new URLSearchParams(new URL(e).search)}catch{return e}if(!n.has("Key-Pair-Id")||!n.has("Signature"))return e;const r=n.get("Expires");if(!r||r.length>13)return e;const o=bT.get(t);if(o){const c=new URLSearchParams(new URL(o).search).get("Expires");if(c&&parseInt(c,10)*1e3-5e3>Date.now())return o}return bT.set(t,e),e},[e]);function Kt(e,t){const n=_e(),[r,o]=v.useState(()=>ST(n,e)),l=v.useCallback(c=>{Do(c,r)||o(c)},[r]);return v.useEffect(()=>{let c=!0;const d=ST(n,e);return!d&&Aa(e)?n.readReference(e).then(f=>{c&&l(f)}).catch(f=>{c&&(l(void 0),t&&t(Yt(f)))}):l(d),(()=>c=!1)},[n,e,l,t]),r}function ST(e,t){if(t){if(Io(t))return t;if(Aa(t))return e.getCachedReference(t)}}const Et={group:"group",display:"display",boolean:"boolean",decimal:"decimal",integer:"integer",date:"date",dateTime:"dateTime",time:"time",string:"string",text:"text",url:"url",choice:"choice",openChoice:"open-choice",attachment:"attachment",reference:"reference",quantity:"quantity"},Y0=`${ro}/fhir/StructureDefinition/questionnaire-itemControl`,iF=`${ro}/fhir/StructureDefinition/questionnaire-referenceFilter`,Ex=`${ro}/fhir/StructureDefinition/questionnaire-referenceResource`,oF=`${ro}/fhir/StructureDefinition/questionnaire-validationError`,aF=`${ro}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-enableWhenExpression`,sF=`${ro}/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-calculatedExpression`,lF=`${ro}/fhir/StructureDefinition/questionnaire-signatureRequired`,Wh=`${ro}/fhir/StructureDefinition/questionnaireresponse-signature`;function cF(e){return e.type==="choice"||e.type==="open-choice"}function uF(e,t){const n=dF(e,t);return n!==void 0?n:fF(e,t)}function dF(e,t){const n=Lo(e,aF);if(t&&n){const r=n.valueExpression?.expression;if(r){const o=ci(t),l=ms(r,[o],{"%resource":o});return bo(l)}}}function fF(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=WA(t?.item,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!o?.length){if(n==="any")return!0;continue}const{anyMatch:l,allMatch:c}=yF(r,o,n);if(n==="any"&&l)return!0;if(n==="all"&&!c)return!1}return n!=="any"}function qA(e,t,n=t.item){for(const r of e){const o=n?.find(l=>l.linkId===r.linkId);o&&(hF(t,r,o),r.item&&o.item&&qA(r.item,t,o.item))}}function hF(e,t,n){try{const r=gF(t,e);if(!r)return;const o=mF(t,r);if(!o)return;n.answer=[o]}catch(r){n.extension=[{url:oF,valueString:`Expression evaluation failed: ${Ye(r)}`}]}}const pF={[Et.boolean]:[re.boolean],[Et.date]:[re.date],[Et.dateTime]:[re.dateTime],[Et.time]:[re.time],[Et.url]:[re.string,re.uri,re.url],[Et.attachment]:[re.Attachment],[Et.reference]:[re.Reference],[Et.quantity]:[re.Quantity],[Et.decimal]:[re.decimal,re.integer],[Et.integer]:[re.decimal,re.integer]};function mF(e,t){if(!e.type)return;if(e.type===Et.choice||e.type===Et.openChoice)return{[`value${qn(t.type)}`]:t.value};if(e.type===Et.string||e.type===Et.text)return typeof t.value=="string"?{valueString:t.value}:void 0;if(pF[e.type]?.includes(t.type))return{[`value${qn(e.type)}`]:t.value}}function gF(e,t){if(!t)return;const n=Lo(e,sF);if(n){const r=n.valueExpression?.expression;if(r){const o=ci(t),l=ms(r,[o],{"%resource":o});return l.length!==0?l[0]:void 0}}}function GA(e,t,n){const r=[];for(const o of e){const l=n.answerOption?.find(c=>cl(ko(c))===o);if(l){const c=ko(l);c&&r.push({[t]:c.value})}}return r}function WA(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=WA(n.item,t);if(r)return r}}}function vF(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n?.replace("=","~"):n,[{value:o}]=ms(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function yF(e,t,n){const r=t||[],o=SF(e);let l=!1,c=!0;for(const d of r){const f=wF(d),{operator:p}=e;if(vF(f,o,p)?l=!0:c=!1,n==="any"&&l)break}return{anyMatch:l,allMatch:c}}function QA(e){const t=Lo(e,Ex);if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return t.valueCodeableConcept?.coding?.map(n=>n.code)}}function ky(e,t){const n=ui(e);let r=Lo(n,Ex);return!t||t.length===0?(r&&(n.extension=n.extension?.filter(o=>o!==r)),n):(r||(n.extension??=[],r={url:Ex},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(o=>({code:o}))},delete r.valueCode),n)}function xF(e,t,n){const r=Lo(e,iF);if(!r?.valueString)return;let o=r.valueString;t?.reference&&(o=o.replaceAll("$subj",t.reference)),n?.reference&&(o=o.replaceAll("$encounter",n.reference));const l={},c=o.split("&");for(const d of c){const[f,p]=bx(d,"=",2);l[f]=p}return l}function wT(e,t){return{resourceType:"QuestionnaireResponse",questionnaire:e.url??Nt(e),item:K0(e.item,t?.item),status:"in-progress"}}function K0(e,t){if(!e)return;const n=[];for(const r of e){if(r.type===Et.display)continue;const o=t?.filter(l=>l.linkId===r.linkId);if(o&&o?.length>0)for(const l of o)l.id=l.id??KA(),l.text=l.text??r.text,l.item=K0(r.item,l.item),l.answer=XA(r,l),n.push(l);else n.push(YA(r))}return n}function YA(e){return{id:KA(),linkId:e.linkId,text:e.text,item:K0(e.item,void 0),answer:XA(e)}}let bF=1;function KA(){return"id-"+bF++}function XA(e,t){if(!(e.type===Et.display||e.type===Et.group)){if(t?.answer&&t.answer.length>0)return t.answer;if(e.initial&&e.initial.length>0)return e.initial.map(n=>({...n}));if(e.answerOption)return e.answerOption.filter(n=>n.initialSelected).map(n=>({...n,initialSelected:void 0}))}}function X0(e){return Qd({value:e},"value")}function ko(e){return Qd({value:e},"value")}function SF(e){return Qd({value:e},"answer")}function wF(e){return Qd({value:e},"value")}function jF(e){const t=Kt(e.questionnaire),n=Kt(e.defaultValue),[,r]=v.useReducer(w=>w+1,0),o=v.useRef({activePage:0});if(!o.current.questionnaire&&t&&(o.current.questionnaire=t,o.current.pages=e.disablePagination?void 0:CF(t)),t&&e.defaultValue&&n&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=wT(t,n),b()),t&&!e.defaultValue&&!o.current.questionnaireResponse&&(o.current.questionnaireResponse=wT(t),b()),!o.current.questionnaire||!o.current.questionnaireResponse)return{loading:!0};function l(w,j){let C=o.current.questionnaireResponse;for(const T of w)C=C?.item?.find(E=>T.id?E.id===T.id:E.linkId===T.linkId);return j&&(C=C?.item?.find(T=>T.linkId===j.linkId)),C}function c(){o.current.activePage=(o.current.activePage??0)+1,r()}function d(){o.current.activePage=(o.current.activePage??0)-1,r()}function f(w,j){const C=l(w);C&&(C.item??=[],C.item.push(YA(j)),b())}function p(w,j){const C=l(w,j);C&&(C.answer??=[],C.answer.push({}),b())}function m(w,j,C){const T=l(w,j);T&&(T.answer=C,b())}function g(w){const j=o.current.questionnaireResponse;j&&(w?(j.extension=j.extension??[],j.extension=j.extension.filter(C=>C.url!==Wh),j.extension.push({url:Wh,valueSignature:w})):j.extension=j.extension?.filter(C=>C.url!==Wh),b())}function y(){const w=o.current.questionnaire;if(w?.item){const j=o.current.questionnaireResponse;qA(w.item,j)}}function b(){const w=o.current.questionnaireResponse;w&&(y(),r(),e.onChange?.(w))}return{loading:!1,pagination:!!o.current.pages,questionnaire:o.current.questionnaire,questionnaireResponse:o.current.questionnaireResponse,subject:e.subject,encounter:e.encounter,activePage:o.current.activePage,pages:o.current.pages,items:EF(o.current.questionnaire,o.current.pages,o.current.activePage),responseItems:TF(o.current.questionnaireResponse,o.current.pages,o.current.activePage),onNextPage:c,onPrevPage:d,onAddGroup:f,onAddAnswer:p,onChangeAnswer:m,onChangeSignature:g}}function CF(e){if(!(!e?.item||Lo(e?.item?.[0],Y0)?.valueCodeableConcept?.coding?.[0]?.code!=="page"))return e.item.map((n,r)=>({linkId:n.linkId,title:n.text??`Page ${r+1}`,group:n}))}function EF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function TF(e,t,n=0){return t&&e?.item?.[n]?[e.item[n]]:e.item??[]}function RF(e,t,n={leading:!1}){const[r,o]=v.useState(e),l=v.useRef(!1),c=v.useRef(void 0),d=v.useRef(!1),f=v.useCallback(()=>window.clearTimeout(c.current),[]);return v.useEffect(()=>{l.current&&(!d.current&&n.leading?(d.current=!0,o(e)):(f(),c.current=setTimeout(()=>{d.current=!1,o(e)},t)))},[e,n.leading,t,f]),v.useEffect(()=>(l.current=!0,f),[f]),[r,f]}const _F=250;function DF(e,t,n){return JA("searchOne",e,t)}function Fc(e,t,n){return JA("searchResources",e,t)}function JA(e,t,n,r){const o=_e(),[l,c]=v.useState(),[d,f]=v.useState(!0),[p,m]=v.useState(),[g,y]=v.useState(),b=o.fhirSearchUrl(t,n).toString(),[w]=RF(b,_F,{leading:!0});return v.useEffect(()=>{w!==l&&(c(w),o[e](t,n).then(j=>{f(!1),m(j),y(R8)}).catch(j=>{f(!1),m(void 0),y(Yt(j))}))},[o,e,t,n,l,w]),[p,d,g]}function AF(e){const t=e.value;return t?a.jsx(a.Fragment,{children:SA(t)}):null}const ZA=["meta","implicitRules","contained","extension","modifierExtension"],ek=["language","text"],un=v.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),getExtendedProps:()=>({readonly:!1,hidden:!1}),accessPolicyResource:void 0,debugMode:!1,isDefaultContext:!0});un.displayName="ElementsContext";const J0=["extension","modifierExtension"],kF=["id",...ZA].filter(e=>!J0.includes(e));function PF(e){return Object.entries(e).filter(([n,r])=>!An(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||J0.includes(n)&&!An(r.slicing?.slices)||kF.includes(n)?!1:!(ek.includes(n)&&r.path.split(".").length===2||n.includes(".")))}function jT(e,t){return e.line&&e.line.length>t?e.line[t]:""}function CT(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:lU(r)}}function OF(e){const[t,n]=v.useState(e.defaultValue||{}),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(un),[l,c,d,f,p,m,g]=v.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(_=>o(e.path+"."+_)),[o,e.path]);function y(_){n(_),e.onChange&&e.onChange(_)}function b(_){y({...r.current,use:_})}function w(_){y({...r.current,type:_})}function j(_){y(CT(r.current||{},0,_))}function C(_){y(CT(r.current||{},1,_))}function T(_){y({...r.current,city:_})}function E(_){y({...r.current,state:_})}function R(_){y({...r.current,postalCode:_})}return a.jsxs(xe,{gap:"xs",wrap:"nowrap",grow:!0,children:[a.jsx(cn,{disabled:e.disabled||l?.readonly,"data-testid":"address-use",defaultValue:t.use,onChange:_=>b(_.currentTarget.value),data:["","home","work","temp","old","billing"]}),a.jsx(cn,{disabled:e.disabled||c?.readonly,"data-testid":"address-type",defaultValue:t.type,onChange:_=>w(_.currentTarget.value),data:["","postal","physical","both"]}),a.jsx(Be,{disabled:e.disabled||d?.readonly,placeholder:"Line 1",defaultValue:jT(t,0),onChange:_=>j(_.currentTarget.value)}),a.jsx(Be,{disabled:e.disabled||f?.readonly,placeholder:"Line 2",defaultValue:jT(t,1),onChange:_=>C(_.currentTarget.value)}),a.jsx(Be,{disabled:e.disabled||p?.readonly,placeholder:"City",defaultValue:t.city,onChange:_=>T(_.currentTarget.value)}),a.jsx(Be,{disabled:e.disabled||m?.readonly,placeholder:"State",defaultValue:t.state,onChange:_=>E(_.currentTarget.value)}),a.jsx(Be,{disabled:e.disabled||g?.readonly,placeholder:"Postal Code",defaultValue:t.postalCode,onChange:_=>R(_.currentTarget.value)})]})}function NF(e){const t=Pm(),[n,r]=v.useState(e.defaultValue||{});function o(l){const c=l?{text:l,authorReference:t&&Wt(t),time:new Date().toISOString()}:{};r(c),e.onChange&&e.onChange(c)}return a.jsx(Be,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:l=>o(l.currentTarget.value)})}/**
|
|
132
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the MIT license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/var MF={outline:{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"},filled:{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentColor",stroke:"none"}};/**
|
|
137
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the MIT license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const Ve=(e,t,n,r)=>{const o=v.forwardRef(({color:l="currentColor",size:c=24,stroke:d=2,title:f,className:p,children:m,...g},y)=>v.createElement("svg",{ref:y,...MF[e],width:c,height:c,className:["tabler-icon",`tabler-icon-${t}`,p].join(" "),...e==="filled"?{fill:l}:{strokeWidth:d,stroke:l},...g},[f&&v.createElement("title",{key:"svg-title"},f),...r.map(([b,w])=>v.createElement(b,w)),...Array.isArray(m)?m:[m]]));return o.displayName=`${n}`,o};/**
|
|
142
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the MIT license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const LF=[["path",{d:"M14 6m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-0"}],["path",{d:"M4 6l8 0",key:"svg-1"}],["path",{d:"M16 6l4 0",key:"svg-2"}],["path",{d:"M8 12m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-3"}],["path",{d:"M4 12l2 0",key:"svg-4"}],["path",{d:"M10 12l10 0",key:"svg-5"}],["path",{d:"M17 18m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-6"}],["path",{d:"M4 18l11 0",key:"svg-7"}],["path",{d:"M19 18l1 0",key:"svg-8"}]],IF=Ve("outline","adjustments-horizontal","AdjustmentsHorizontal",LF);/**
|
|
147
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the MIT license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const zF=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M12 8v4",key:"svg-1"}],["path",{d:"M12 16h.01",key:"svg-2"}]],El=Ve("outline","alert-circle","AlertCircle",zF);/**
|
|
152
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the MIT license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const $F=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 13l-6 6",key:"svg-1"}],["path",{d:"M6 13l6 6",key:"svg-2"}]],UF=Ve("outline","arrow-down","ArrowDown",$F);/**
|
|
157
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the MIT license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const BF=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M18 11l-6 -6",key:"svg-1"}],["path",{d:"M6 11l6 -6",key:"svg-2"}]],VF=Ve("outline","arrow-up","ArrowUp",BF);/**
|
|
162
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the MIT license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const FF=[["path",{d:"M5 19h14m1.986 -1.977a2 2 0 0 0 -.146 -.773l-7.1 -12.25a2 2 0 0 0 -3.5 0l-.815 1.405m-1.488 2.568l-4.797 8.277a2 2 0 0 0 1.75 2.75",key:"svg-0"}],["path",{d:"M3 3l18 18",key:"svg-1"}]],HF=Ve("outline","bleach-off","BleachOff",FF);/**
|
|
167
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the MIT license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const qF=[["path",{d:"M5 19h14a2 2 0 0 0 1.84 -2.75l-7.1 -12.25a2 2 0 0 0 -3.5 0l-7.1 12.25a2 2 0 0 0 1.75 2.75",key:"svg-0"}]],GF=Ve("outline","bleach","Bleach",qF);/**
|
|
172
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the MIT license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const WF=[["path",{d:"M7 3m0 2a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v10a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17v2a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-10a2 2 0 0 1 2 -2h2",key:"svg-1"}]],QF=Ve("outline","box-multiple","BoxMultiple",WF);/**
|
|
177
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the MIT license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const YF=[["path",{d:"M7 4h-4v16h4",key:"svg-0"}],["path",{d:"M17 4h4v16h-4",key:"svg-1"}],["path",{d:"M8 16h.01",key:"svg-2"}],["path",{d:"M12 16h.01",key:"svg-3"}],["path",{d:"M16 16h.01",key:"svg-4"}]],KF=Ve("outline","brackets-contain","BracketsContain",YF);/**
|
|
182
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the MIT license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const XF=[["path",{d:"M12 7m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-0"}],["path",{d:"M17 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-1"}],["path",{d:"M7 16m-3 0a3 3 0 1 0 6 0a3 3 0 1 0 -6 0",key:"svg-2"}]],JF=Ve("outline","brand-asana","BrandAsana",XF);/**
|
|
187
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the MIT license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const ZF=[["path",{d:"M5.029 5.036c-.655 .58 -1.029 1.25 -1.029 1.964c0 2.033 3.033 3.712 6.96 3.967m3.788 -.21c3.064 -.559 5.252 -2.029 5.252 -3.757c0 -2.21 -3.582 -4 -8 -4c-1.605 0 -3.1 .236 -4.352 .643",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.1 -.3 .252 -.812 .457 -1.535m.862 -3.146c.262 -.975 .735 -2.76 1.418 -5.354a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],eH=Ve("outline","bucket-off","BucketOff",ZF);/**
|
|
192
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the MIT license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const tH=[["path",{d:"M12 7m-8 0a8 4 0 1 0 16 0a8 4 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 7c0 .664 .088 1.324 .263 1.965l2.737 10.035c.5 1.5 2.239 2 5 2s4.5 -.5 5 -2c.333 -1 1.246 -4.345 2.737 -10.035a7.45 7.45 0 0 0 .263 -1.965",key:"svg-1"}]],nH=Ve("outline","bucket","Bucket",tH);/**
|
|
197
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the MIT license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const rH=[["path",{d:"M3 21l18 0",key:"svg-0"}],["path",{d:"M9 8l1 0",key:"svg-1"}],["path",{d:"M9 12l1 0",key:"svg-2"}],["path",{d:"M9 16l1 0",key:"svg-3"}],["path",{d:"M14 8l1 0",key:"svg-4"}],["path",{d:"M14 12l1 0",key:"svg-5"}],["path",{d:"M14 16l1 0",key:"svg-6"}],["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16",key:"svg-7"}]],iH=Ve("outline","building","Building",rH);/**
|
|
202
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the MIT license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const oH=[["path",{d:"M4 7a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v12a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12z",key:"svg-0"}],["path",{d:"M16 3v4",key:"svg-1"}],["path",{d:"M8 3v4",key:"svg-2"}],["path",{d:"M4 11h16",key:"svg-3"}],["path",{d:"M11 15h1",key:"svg-4"}],["path",{d:"M12 15v3",key:"svg-5"}]],rs=Ve("outline","calendar","Calendar",oH);/**
|
|
207
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the MIT license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const aH=[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]],zo=Ve("outline","check","Check",aH);/**
|
|
212
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the MIT license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const sH=[["path",{d:"M9 11l3 3l8 -8",key:"svg-0"}],["path",{d:"M20 12v6a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h9",key:"svg-1"}]],lH=Ve("outline","checkbox","Checkbox",sH);/**
|
|
217
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the MIT license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const cH=[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]],Z0=Ve("outline","chevron-down","ChevronDown",cH);/**
|
|
222
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the MIT license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const uH=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l2 2l4 -4",key:"svg-1"}]],dH=Ve("outline","circle-check","CircleCheck",uH);/**
|
|
227
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
228
|
+
*
|
|
229
|
+
* This source code is licensed under the MIT license.
|
|
230
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
231
|
+
*/const fH=[["path",{d:"M12 12m-9 0a9 9 0 1 0 18 0a9 9 0 1 0 -18 0",key:"svg-0"}],["path",{d:"M9 12l6 0",key:"svg-1"}]],vp=Ve("outline","circle-minus","CircleMinus",fH);/**
|
|
232
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
233
|
+
*
|
|
234
|
+
* This source code is licensed under the MIT license.
|
|
235
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
236
|
+
*/const hH=[["path",{d:"M3 12a9 9 0 1 0 18 0a9 9 0 0 0 -18 0",key:"svg-0"}],["path",{d:"M9 12h6",key:"svg-1"}],["path",{d:"M12 9v6",key:"svg-2"}]],yp=Ve("outline","circle-plus","CirclePlus",hH);/**
|
|
237
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
238
|
+
*
|
|
239
|
+
* This source code is licensed under the MIT license.
|
|
240
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
241
|
+
*/const pH=[["path",{d:"M7 18a4.6 4.4 0 0 1 0 -9a5 4.5 0 0 1 11 2h1a3.5 3.5 0 0 1 0 7h-1",key:"svg-0"}],["path",{d:"M9 15l3 -3l3 3",key:"svg-1"}],["path",{d:"M12 12l0 9",key:"svg-2"}]],eS=Ve("outline","cloud-upload","CloudUpload",pH);/**
|
|
242
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
243
|
+
*
|
|
244
|
+
* This source code is licensed under the MIT license.
|
|
245
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
246
|
+
*/const mH=[["path",{d:"M4 6l5.5 0",key:"svg-0"}],["path",{d:"M4 10l5.5 0",key:"svg-1"}],["path",{d:"M4 14l5.5 0",key:"svg-2"}],["path",{d:"M4 18l5.5 0",key:"svg-3"}],["path",{d:"M14.5 6l5.5 0",key:"svg-4"}],["path",{d:"M14.5 10l5.5 0",key:"svg-5"}],["path",{d:"M14.5 14l5.5 0",key:"svg-6"}],["path",{d:"M14.5 18l5.5 0",key:"svg-7"}]],gH=Ve("outline","columns","Columns",mH);/**
|
|
247
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
248
|
+
*
|
|
249
|
+
* This source code is licensed under the MIT license.
|
|
250
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
251
|
+
*/const vH=[["path",{d:"M7 7m0 2.667a2.667 2.667 0 0 1 2.667 -2.667h8.666a2.667 2.667 0 0 1 2.667 2.667v8.666a2.667 2.667 0 0 1 -2.667 2.667h-8.666a2.667 2.667 0 0 1 -2.667 -2.667z",key:"svg-0"}],["path",{d:"M4.012 16.737a2.005 2.005 0 0 1 -1.012 -1.737v-10c0 -1.1 .9 -2 2 -2h10c.75 0 1.158 .385 1.5 1",key:"svg-1"}]],tS=Ve("outline","copy","Copy",vH);/**
|
|
252
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
253
|
+
*
|
|
254
|
+
* This source code is licensed under the MIT license.
|
|
255
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
256
|
+
*/const yH=[["path",{d:"M16.7 8a3 3 0 0 0 -2.7 -2h-4a3 3 0 0 0 0 6h4a3 3 0 0 1 0 6h-4a3 3 0 0 1 -2.7 -2",key:"svg-0"}],["path",{d:"M12 3v3m0 12v3",key:"svg-1"}]],xH=Ve("outline","currency-dollar","CurrencyDollar",yH);/**
|
|
257
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
258
|
+
*
|
|
259
|
+
* This source code is licensed under the MIT license.
|
|
260
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
261
|
+
*/const bH=[["path",{d:"M12 6m-8 0a8 3 0 1 0 16 0a8 3 0 1 0 -16 0",key:"svg-0"}],["path",{d:"M4 6v6a8 3 0 0 0 16 0v-6",key:"svg-1"}],["path",{d:"M4 12v6a8 3 0 0 0 16 0v-6",key:"svg-2"}]],SH=Ve("outline","database","Database",bH);/**
|
|
262
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
263
|
+
*
|
|
264
|
+
* This source code is licensed under the MIT license.
|
|
265
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
266
|
+
*/const wH=[["path",{d:"M6 4h10l4 4v10a2 2 0 0 1 -2 2h-12a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2",key:"svg-0"}],["path",{d:"M12 14m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M14 4l0 4l-6 0l0 -4",key:"svg-2"}]],jH=Ve("outline","device-floppy","DeviceFloppy",wH);/**
|
|
267
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
268
|
+
*
|
|
269
|
+
* This source code is licensed under the MIT license.
|
|
270
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
271
|
+
*/const CH=[["path",{d:"M5 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-0"}],["path",{d:"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-1"}],["path",{d:"M19 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",key:"svg-2"}]],EH=Ve("outline","dots","Dots",CH);/**
|
|
272
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
273
|
+
*
|
|
274
|
+
* This source code is licensed under the MIT license.
|
|
275
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
276
|
+
*/const TH=[["path",{d:"M7 7h-1a2 2 0 0 0 -2 2v9a2 2 0 0 0 2 2h9a2 2 0 0 0 2 -2v-1",key:"svg-0"}],["path",{d:"M20.385 6.585a2.1 2.1 0 0 0 -2.97 -2.97l-8.415 8.385v3h3l8.385 -8.415z",key:"svg-1"}],["path",{d:"M16 5l3 3",key:"svg-2"}]],tk=Ve("outline","edit","Edit",TH);/**
|
|
277
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
278
|
+
*
|
|
279
|
+
* This source code is licensed under the MIT license.
|
|
280
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
281
|
+
*/const RH=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]],Kd=Ve("outline","equal-not","EqualNot",RH);/**
|
|
282
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
283
|
+
*
|
|
284
|
+
* This source code is licensed under the MIT license.
|
|
285
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
286
|
+
*/const _H=[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]],Xd=Ve("outline","equal","Equal",_H);/**
|
|
287
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
288
|
+
*
|
|
289
|
+
* This source code is licensed under the MIT license.
|
|
290
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
291
|
+
*/const DH=[["path",{d:"M10.585 10.587a2 2 0 0 0 2.829 2.828",key:"svg-0"}],["path",{d:"M16.681 16.673a8.717 8.717 0 0 1 -4.681 1.327c-3.6 0 -6.6 -2 -9 -6c1.272 -2.12 2.712 -3.678 4.32 -4.674m2.86 -1.146a9.055 9.055 0 0 1 1.82 -.18c3.6 0 6.6 2 9 6c-.666 1.11 -1.379 2.067 -2.138 2.87",key:"svg-1"}],["path",{d:"M3 3l18 18",key:"svg-2"}]],AH=Ve("outline","eye-off","EyeOff",DH);/**
|
|
292
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
293
|
+
*
|
|
294
|
+
* This source code is licensed under the MIT license.
|
|
295
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
296
|
+
*/const kH=[["path",{d:"M10 12a2 2 0 1 0 4 0a2 2 0 0 0 -4 0",key:"svg-0"}],["path",{d:"M21 12c-2.4 4 -5.4 6 -9 6c-3.6 0 -6.6 -2 -9 -6c2.4 -4 5.4 -6 9 -6c3.6 0 6.6 2 9 6",key:"svg-1"}]],PH=Ve("outline","eye","Eye",kH);/**
|
|
297
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
298
|
+
*
|
|
299
|
+
* This source code is licensed under the MIT license.
|
|
300
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
301
|
+
*/const OH=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 17l.01 0",key:"svg-2"}],["path",{d:"M12 11l0 3",key:"svg-3"}]],ET=Ve("outline","file-alert","FileAlert",OH);/**
|
|
302
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
303
|
+
*
|
|
304
|
+
* This source code is licensed under the MIT license.
|
|
305
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
306
|
+
*/const NH=[["path",{d:"M14 3v4a1 1 0 0 0 1 1h4",key:"svg-0"}],["path",{d:"M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z",key:"svg-1"}],["path",{d:"M12 11l0 6",key:"svg-2"}],["path",{d:"M9 14l6 0",key:"svg-3"}]],MH=Ve("outline","file-plus","FilePlus",NH);/**
|
|
307
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
308
|
+
*
|
|
309
|
+
* This source code is licensed under the MIT license.
|
|
310
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
311
|
+
*/const LH=[["path",{d:"M4 4h16v2.172a2 2 0 0 1 -.586 1.414l-4.414 4.414v7l-6 2v-8.5l-4.48 -4.928a2 2 0 0 1 -.52 -1.345v-2.227z",key:"svg-0"}]],IH=Ve("outline","filter","Filter",LH);/**
|
|
312
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
313
|
+
*
|
|
314
|
+
* This source code is licensed under the MIT license.
|
|
315
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
316
|
+
*/const zH=[["path",{d:"M12 3a3 3 0 0 0 -3 3v12a3 3 0 0 0 3 3",key:"svg-0"}],["path",{d:"M6 3a3 3 0 0 1 3 3v12a3 3 0 0 1 -3 3",key:"svg-1"}],["path",{d:"M13 7h7a1 1 0 0 1 1 1v8a1 1 0 0 1 -1 1h-7",key:"svg-2"}],["path",{d:"M5 7h-1a1 1 0 0 0 -1 1v8a1 1 0 0 0 1 1h1",key:"svg-3"}],["path",{d:"M17 12h.01",key:"svg-4"}],["path",{d:"M13 12h.01",key:"svg-5"}]],$H=Ve("outline","forms","Forms",zH);/**
|
|
317
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
318
|
+
*
|
|
319
|
+
* This source code is licensed under the MIT license.
|
|
320
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
321
|
+
*/const UH=[["path",{d:"M3 4m0 3a3 3 0 0 1 3 -3h12a3 3 0 0 1 3 3v10a3 3 0 0 1 -3 3h-12a3 3 0 0 1 -3 -3z",key:"svg-0"}],["path",{d:"M9 10m-2 0a2 2 0 1 0 4 0a2 2 0 1 0 -4 0",key:"svg-1"}],["path",{d:"M15 8l2 0",key:"svg-2"}],["path",{d:"M15 12l2 0",key:"svg-3"}],["path",{d:"M7 16l10 0",key:"svg-4"}]],BH=Ve("outline","id","Id",UH);/**
|
|
322
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
323
|
+
*
|
|
324
|
+
* This source code is licensed under the MIT license.
|
|
325
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
326
|
+
*/const VH=[["path",{d:"M13 5h8",key:"svg-0"}],["path",{d:"M13 9h5",key:"svg-1"}],["path",{d:"M13 15h8",key:"svg-2"}],["path",{d:"M13 19h5",key:"svg-3"}],["path",{d:"M3 4m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M3 14m0 1a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1z",key:"svg-5"}]],TT=Ve("outline","list-details","ListDetails",VH);/**
|
|
327
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
328
|
+
*
|
|
329
|
+
* This source code is licensed under the MIT license.
|
|
330
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
331
|
+
*/const FH=[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M8 11m0 1a1 1 0 0 1 1 -1h6a1 1 0 0 1 1 1v3a1 1 0 0 1 -1 1h-6a1 1 0 0 1 -1 -1z",key:"svg-4"}],["path",{d:"M10 11v-2a2 2 0 1 1 4 0v2",key:"svg-5"}]],HH=Ve("outline","lock-access","LockAccess",FH);/**
|
|
332
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
333
|
+
*
|
|
334
|
+
* This source code is licensed under the MIT license.
|
|
335
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
336
|
+
*/const qH=[["path",{d:"M5 13a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v6a2 2 0 0 1 -2 2h-10a2 2 0 0 1 -2 -2v-6z",key:"svg-0"}],["path",{d:"M11 16a1 1 0 1 0 2 0a1 1 0 0 0 -2 0",key:"svg-1"}],["path",{d:"M8 11v-4a4 4 0 1 1 8 0v4",key:"svg-2"}]],GH=Ve("outline","lock","Lock",qH);/**
|
|
337
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
338
|
+
*
|
|
339
|
+
* This source code is licensed under the MIT license.
|
|
340
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
341
|
+
*/const WH=[["path",{d:"M14 8v-2a2 2 0 0 0 -2 -2h-7a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h7a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M9 12h12l-3 -3",key:"svg-1"}],["path",{d:"M18 15l3 -3",key:"svg-2"}]],QH=Ve("outline","logout","Logout",WH);/**
|
|
342
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
343
|
+
*
|
|
344
|
+
* This source code is licensed under the MIT license.
|
|
345
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
346
|
+
*/const YH=[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]],nk=Ve("outline","math-greater","MathGreater",YH);/**
|
|
347
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
348
|
+
*
|
|
349
|
+
* This source code is licensed under the MIT license.
|
|
350
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
351
|
+
*/const KH=[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]],rk=Ve("outline","math-lower","MathLower",KH);/**
|
|
352
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
353
|
+
*
|
|
354
|
+
* This source code is licensed under the MIT license.
|
|
355
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
356
|
+
*/const XH=[["path",{d:"M8 9h8",key:"svg-0"}],["path",{d:"M8 13h6",key:"svg-1"}],["path",{d:"M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z",key:"svg-2"}]],JH=Ve("outline","message","Message",XH);/**
|
|
357
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
358
|
+
*
|
|
359
|
+
* This source code is licensed under the MIT license.
|
|
360
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
361
|
+
*/const ZH=[["path",{d:"M5 21h14",key:"svg-0"}],["path",{d:"M6 18h2",key:"svg-1"}],["path",{d:"M7 18v3",key:"svg-2"}],["path",{d:"M9 11l3 3l6 -6l-3 -3z",key:"svg-3"}],["path",{d:"M10.5 12.5l-1.5 1.5",key:"svg-4"}],["path",{d:"M17 3l3 3",key:"svg-5"}],["path",{d:"M12 21a6 6 0 0 0 3.715 -10.712",key:"svg-6"}]],eq=Ve("outline","microscope","Microscope",ZH);/**
|
|
362
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
363
|
+
*
|
|
364
|
+
* This source code is licensed under the MIT license.
|
|
365
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
366
|
+
*/const tq=[["path",{d:"M5 12l14 0",key:"svg-0"}]],nq=Ve("outline","minus","Minus",tq);/**
|
|
367
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
368
|
+
*
|
|
369
|
+
* This source code is licensed under the MIT license.
|
|
370
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
371
|
+
*/const rq=[["path",{d:"M7 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-0"}],["path",{d:"M2 13.5v5.5l5 3",key:"svg-1"}],["path",{d:"M7 16.545l5 -3.03",key:"svg-2"}],["path",{d:"M17 16.5l-5 -3l5 -3l5 3v5.5l-5 3z",key:"svg-3"}],["path",{d:"M12 19l5 3",key:"svg-4"}],["path",{d:"M17 16.5l5 -3",key:"svg-5"}],["path",{d:"M12 13.5v-5.5l-5 -3l5 -3l5 3v5.5",key:"svg-6"}],["path",{d:"M7 5.03v5.455",key:"svg-7"}],["path",{d:"M12 8l5 -3",key:"svg-8"}]],iq=Ve("outline","packages","Packages",rq);/**
|
|
372
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
373
|
+
*
|
|
374
|
+
* This source code is licensed under the MIT license.
|
|
375
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
376
|
+
*/const oq=[["path",{d:"M15 4.5l-4 4l-4 1.5l-1.5 1.5l7 7l1.5 -1.5l1.5 -4l4 -4",key:"svg-0"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-1"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-2"}]],aq=Ve("outline","pin","Pin",oq);/**
|
|
377
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
378
|
+
*
|
|
379
|
+
* This source code is licensed under the MIT license.
|
|
380
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
381
|
+
*/const sq=[["path",{d:"M3 3l18 18",key:"svg-0"}],["path",{d:"M15 4.5l-3.249 3.249m-2.57 1.433l-2.181 .818l-1.5 1.5l7 7l1.5 -1.5l.82 -2.186m1.43 -2.563l3.25 -3.251",key:"svg-1"}],["path",{d:"M9 15l-4.5 4.5",key:"svg-2"}],["path",{d:"M14.5 4l5.5 5.5",key:"svg-3"}]],lq=Ve("outline","pinned-off","PinnedOff",sq);/**
|
|
382
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
383
|
+
*
|
|
384
|
+
* This source code is licensed under the MIT license.
|
|
385
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
386
|
+
*/const cq=[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]],uq=Ve("outline","player-play","PlayerPlay",cq);/**
|
|
387
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
388
|
+
*
|
|
389
|
+
* This source code is licensed under the MIT license.
|
|
390
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
391
|
+
*/const dq=[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]],ik=Ve("outline","plus","Plus",dq);/**
|
|
392
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
393
|
+
*
|
|
394
|
+
* This source code is licensed under the MIT license.
|
|
395
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
396
|
+
*/const fq=[["path",{d:"M5 21v-16a2 2 0 0 1 2 -2h10a2 2 0 0 1 2 2v16l-3 -2l-2 2l-2 -2l-2 2l-2 -2l-3 2m4 -14h6m-6 4h6m-2 4h2",key:"svg-0"}]],hq=Ve("outline","receipt","Receipt",fq);/**
|
|
397
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
398
|
+
*
|
|
399
|
+
* This source code is licensed under the MIT license.
|
|
400
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
401
|
+
*/const pq=[["path",{d:"M20 11a8.1 8.1 0 0 0 -15.5 -2m-.5 -4v4h4",key:"svg-0"}],["path",{d:"M4 13a8.1 8.1 0 0 0 15.5 2m.5 4v-4h-4",key:"svg-1"}]],ok=Ve("outline","refresh","Refresh",pq);/**
|
|
402
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
403
|
+
*
|
|
404
|
+
* This source code is licensed under the MIT license.
|
|
405
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
406
|
+
*/const mq=[["path",{d:"M4 12v-3a3 3 0 0 1 3 -3h13m-3 -3l3 3l-3 3",key:"svg-0"}],["path",{d:"M20 12v3a3 3 0 0 1 -3 3h-13m3 3l-3 -3l3 -3",key:"svg-1"}]],gq=Ve("outline","repeat","Repeat",mq);/**
|
|
407
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
408
|
+
*
|
|
409
|
+
* This source code is licensed under the MIT license.
|
|
410
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
411
|
+
*/const vq=[["path",{d:"M9 5h-2a2 2 0 0 0 -2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-12a2 2 0 0 0 -2 -2h-2",key:"svg-0"}],["path",{d:"M9 3m0 2a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v0a2 2 0 0 1 -2 2h-2a2 2 0 0 1 -2 -2z",key:"svg-1"}],["path",{d:"M10 14l4 0",key:"svg-2"}],["path",{d:"M12 12l0 4",key:"svg-3"}]],yq=Ve("outline","report-medical","ReportMedical",vq);/**
|
|
412
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
413
|
+
*
|
|
414
|
+
* This source code is licensed under the MIT license.
|
|
415
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
416
|
+
*/const xq=[["path",{d:"M3 13m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v4a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}],["path",{d:"M17 17l0 .01",key:"svg-1"}],["path",{d:"M13 17l0 .01",key:"svg-2"}],["path",{d:"M15 13l0 -2",key:"svg-3"}],["path",{d:"M11.75 8.75a4 4 0 0 1 6.5 0",key:"svg-4"}],["path",{d:"M8.5 6.5a8 8 0 0 1 13 0",key:"svg-5"}]],bq=Ve("outline","router","Router",xq);/**
|
|
417
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
418
|
+
*
|
|
419
|
+
* This source code is licensed under the MIT license.
|
|
420
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
421
|
+
*/const Sq=[["path",{d:"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0",key:"svg-0"}],["path",{d:"M21 21l-6 -6",key:"svg-1"}]],wq=Ve("outline","search","Search",Sq);/**
|
|
422
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
423
|
+
*
|
|
424
|
+
* This source code is licensed under the MIT license.
|
|
425
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
426
|
+
*/const jq=[["path",{d:"M10.325 4.317c.426 -1.756 2.924 -1.756 3.35 0a1.724 1.724 0 0 0 2.573 1.066c1.543 -.94 3.31 .826 2.37 2.37a1.724 1.724 0 0 0 1.065 2.572c1.756 .426 1.756 2.924 0 3.35a1.724 1.724 0 0 0 -1.066 2.573c.94 1.543 -.826 3.31 -2.37 2.37a1.724 1.724 0 0 0 -2.572 1.065c-.426 1.756 -2.924 1.756 -3.35 0a1.724 1.724 0 0 0 -2.573 -1.066c-1.543 .94 -3.31 -.826 -2.37 -2.37a1.724 1.724 0 0 0 -1.065 -2.572c-1.756 -.426 -1.756 -2.924 0 -3.35a1.724 1.724 0 0 0 1.066 -2.573c-.94 -1.543 .826 -3.31 2.37 -2.37c1 .608 2.296 .07 2.572 -1.065z",key:"svg-0"}],["path",{d:"M9 12a3 3 0 1 0 6 0a3 3 0 0 0 -6 0",key:"svg-1"}]],Tx=Ve("outline","settings","Settings",jq);/**
|
|
427
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
428
|
+
*
|
|
429
|
+
* This source code is licensed under the MIT license.
|
|
430
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
431
|
+
*/const Cq=[["path",{d:"M4 6l7 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l9 0",key:"svg-2"}],["path",{d:"M15 9l3 -3l3 3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]],nS=Ve("outline","sort-ascending","SortAscending",Cq);/**
|
|
432
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
433
|
+
*
|
|
434
|
+
* This source code is licensed under the MIT license.
|
|
435
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
436
|
+
*/const Eq=[["path",{d:"M4 6l9 0",key:"svg-0"}],["path",{d:"M4 12l7 0",key:"svg-1"}],["path",{d:"M4 18l7 0",key:"svg-2"}],["path",{d:"M15 15l3 3l3 -3",key:"svg-3"}],["path",{d:"M18 6l0 12",key:"svg-4"}]],rS=Ve("outline","sort-descending","SortDescending",Eq);/**
|
|
437
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
438
|
+
*
|
|
439
|
+
* This source code is licensed under the MIT license.
|
|
440
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
441
|
+
*/const Tq=[["path",{d:"M3 3m0 2a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2z",key:"svg-0"}]],Rq=Ve("outline","square","Square",Tq);/**
|
|
442
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
443
|
+
*
|
|
444
|
+
* This source code is licensed under the MIT license.
|
|
445
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
446
|
+
*/const _q=[["path",{d:"M12 17.75l-6.172 3.245l1.179 -6.873l-5 -4.867l6.9 -1l3.086 -6.253l3.086 6.253l6.9 1l-5 4.867l1.179 6.873z",key:"svg-0"}]],Dq=Ve("outline","star","Star",_q);/**
|
|
447
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
448
|
+
*
|
|
449
|
+
* This source code is licensed under the MIT license.
|
|
450
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
451
|
+
*/const Aq=[["path",{d:"M16 3l4 4l-4 4",key:"svg-0"}],["path",{d:"M10 7l10 0",key:"svg-1"}],["path",{d:"M8 13l-4 4l4 4",key:"svg-2"}],["path",{d:"M4 17l9 0",key:"svg-3"}]],kq=Ve("outline","switch-horizontal","SwitchHorizontal",Aq);/**
|
|
452
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
453
|
+
*
|
|
454
|
+
* This source code is licensed under the MIT license.
|
|
455
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
456
|
+
*/const Pq=[["path",{d:"M12.5 21h-7.5a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h14a2 2 0 0 1 2 2v7.5",key:"svg-0"}],["path",{d:"M3 10h18",key:"svg-1"}],["path",{d:"M10 3v18",key:"svg-2"}],["path",{d:"M16 19h6",key:"svg-3"}],["path",{d:"M19 16l3 3l-3 3",key:"svg-4"}]],Oq=Ve("outline","table-export","TableExport",Pq);/**
|
|
457
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
458
|
+
*
|
|
459
|
+
* This source code is licensed under the MIT license.
|
|
460
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
461
|
+
*/const Nq=[["path",{d:"M4 8v-2a2 2 0 0 1 2 -2h2",key:"svg-0"}],["path",{d:"M4 16v2a2 2 0 0 0 2 2h2",key:"svg-1"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v2",key:"svg-2"}],["path",{d:"M16 20h2a2 2 0 0 0 2 -2v-2",key:"svg-3"}],["path",{d:"M12 16v-7",key:"svg-4"}],["path",{d:"M9 9h6",key:"svg-5"}]],Mq=Ve("outline","text-recognition","TextRecognition",Nq);/**
|
|
462
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
463
|
+
*
|
|
464
|
+
* This source code is licensed under the MIT license.
|
|
465
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
466
|
+
*/const Lq=[["path",{d:"M4 7l16 0",key:"svg-0"}],["path",{d:"M10 11l0 6",key:"svg-1"}],["path",{d:"M14 11l0 6",key:"svg-2"}],["path",{d:"M5 7l1 12a2 2 0 0 0 2 2h8a2 2 0 0 0 2 -2l1 -12",key:"svg-3"}],["path",{d:"M9 7v-3a1 1 0 0 1 1 -1h4a1 1 0 0 1 1 1v3",key:"svg-4"}]],Om=Ve("outline","trash","Trash",Lq);/**
|
|
467
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
468
|
+
*
|
|
469
|
+
* This source code is licensed under the MIT license.
|
|
470
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
471
|
+
*/const Iq=[["path",{d:"M4 17v2a2 2 0 0 0 2 2h12a2 2 0 0 0 2 -2v-2",key:"svg-0"}],["path",{d:"M7 9l5 -5l5 5",key:"svg-1"}],["path",{d:"M12 4l0 12",key:"svg-2"}]],RT=Ve("outline","upload","Upload",Iq);/**
|
|
472
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
473
|
+
*
|
|
474
|
+
* This source code is licensed under the MIT license.
|
|
475
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
476
|
+
*/const zq=[["path",{d:"M4.876 13.61a4 4 0 1 0 6.124 3.39h6",key:"svg-0"}],["path",{d:"M15.066 20.502a4 4 0 1 0 1.934 -7.502c-.706 0 -1.424 .179 -2 .5l-3 -5.5",key:"svg-1"}],["path",{d:"M16 8a4 4 0 1 0 -8 0c0 1.506 .77 2.818 2 3.5l-3 5.5",key:"svg-2"}]],$q=Ve("outline","webhook","Webhook",zq);/**
|
|
477
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
478
|
+
*
|
|
479
|
+
* This source code is licensed under the MIT license.
|
|
480
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
481
|
+
*/const Uq=[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]],fl=Ve("outline","x","X",Uq);/**
|
|
482
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
483
|
+
*
|
|
484
|
+
* This source code is licensed under the MIT license.
|
|
485
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
486
|
+
*/const Bq=[["path",{d:"M7 3.34a10 10 0 1 1 -4.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 4.995 -8.336z",key:"svg-0"}]],Vq=Ve("filled","circle-filled","CircleFilled",Bq);class ak extends v.Component{state;constructor(t){super(t),this.state={lastLocation:rr.getLocation()}}static getDerivedStateFromError(t){return{error:t,lastLocation:rr.getLocation()}}componentDidUpdate(t,n){rr.getLocation()!==this.state.lastLocation&&this.setState({lastLocation:rr.getLocation(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==rr.getLocation())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?a.jsx(Ta,{icon:a.jsx(El,{size:16}),title:"Something went wrong",color:"red",children:Ye(this.state.error)}):this.props.children}}function Oi(){return a.jsx(fr,{style:{width:"100%",height:"100vh"},children:a.jsx(Gr,{})})}const Fq="_main_6f7o5_1",Hq={main:Fq};function dn(e){e.preventDefault(),e.stopPropagation()}function sk(e){return e.button===1||e.ctrlKey||e.metaKey}function lk(e){if(_T(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&_T(t[0]))return!0}return!1}function _T(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}async function cd(e,t){return new Promise((n,r)=>{const o=new MessageChannel;o.port1.onmessage=({data:l})=>{o.port1.close(),l.error?r(l.error):n(l.result)},e.contentWindow?.postMessage(t,new URL(e.src).origin,[o.port2])})}function ck(e,t){const n=new Blob([e],{type:on.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const l=t??new Date().toISOString().replace(/\D/g,"");o.download=`${l}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function St(e){const t=km(),{to:n,suffix:r,label:o,onClick:l,children:c,...d}=e;let f=qq(n);return r&&(f+="/"+r),a.jsx(Mt,{href:f,"aria-label":o,onAuxClick:p=>{p.stopPropagation()},onClick:p=>{p.stopPropagation(),l?(p.preventDefault(),l(p)):n&&(sk(p)||(p.preventDefault(),t(f)))},...d,children:c})}function qq(e){if(e){if(typeof e=="string")return Gq(e);if(Io(e))return Wq(e);if(Aa(e))return Qq(e)}return"#"}function Gq(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Wq(e){return`/${e.resourceType}/${e.id}`}function Qq(e){return`/${e.reference}`}function Yq(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t.at(-1)?.at(0):t.length===1?t[0][0]:""}function js(e){const t=Kt(e.value),n=t?Sa(t):e.alt??"",r=Yq(n),o=(t&&iU(t))??e.src,l=HA(o??void 0),c=e.radius??"xl",d={...e,value:void 0,link:void 0};return e.link?a.jsx(St,{to:t,children:a.jsx(sl,{src:l,alt:n,radius:c,...d,children:r})}):a.jsx(sl,{src:l,alt:n,radius:c,...d,children:r})}const Kq="_logoButton_189g3_1",Xq="_user_189g3_11",Jq="_userName_189g3_21",Zq="_userActive_189g3_31",_h={logoButton:Kq,user:Xq,userName:Jq,userActive:Zq};function iS(e){const t=e.value;return t?a.jsx(a.Fragment,{children:iu(t,e.options)}):null}function uk(){return"Medplum"}function eG(e){const t=Am(),{medplum:n,profile:r,navigate:o}=t,l=n.getLogins(),{colorScheme:c,setColorScheme:d}=g4();return a.jsxs(a.Fragment,{children:[a.jsxs(Ue,{align:"center",p:"xl",children:[a.jsx(js,{size:"xl",radius:100,value:t.profile}),a.jsx(iS,{value:t.profile?.name?.[0]}),a.jsx(Re,{c:"dimmed",size:"xs",children:n.getActiveLogin()?.project.display})]}),l.length>1&&a.jsx(we.Divider,{}),l.map(f=>f.profile.reference!==Nt(t.profile)&&a.jsx(we.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>rr.reload()).catch(console.log)},children:a.jsxs(xe,{children:[a.jsx(sl,{radius:"xl"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Re,{size:"sm",fw:500,children:f.profile.display}),a.jsx(Re,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),a.jsx(we.Divider,{}),a.jsx(xe,{justify:"center",children:a.jsx(Vd,{size:"xs",value:c,onChange:f=>d(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(kq,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),a.jsx(we.Item,{leftSection:a.jsx(Tx,{size:14,stroke:1.5}),onClick:()=>o(`/${Nt(r)}`),children:"Account settings"}),a.jsx(we.Item,{leftSection:a.jsx(QH,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),a.jsxs(Re,{size:"xs",c:"dimmed",my:"sm",ta:"center",children:[uk()," ",e.version]})]})}const DT={selectedItems:"selected-items",options:"options"};function oS(e){const t=Sl({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:l,defaultValue:c,toOption:d,loadOptions:f,itemComponent:p,pillComponent:m,emptyComponent:g,onChange:y,onCreate:b,creatable:w,clearable:j,required:C,placeholder:T,leftSection:E,maxValues:R,optionsDropdownMaxHeight:_=320,minInputLength:k=0,...N}=e,A=N.disabled,P=tG(c),[U,B]=v.useState(""),[Y,X]=v.useState(),[te,$]=v.useState(),[W,L]=v.useState(),[I,z]=v.useState(P.map(d)),[V,J]=v.useState([]),M=p??nG,F=m??rG,oe=g??iG,ce=v.useRef(U);ce.current=U;const Se=v.useRef(void 0),ge=v.useRef(void 0),Oe=v.useRef(Y);Oe.current=Y;const nt=v.useRef(te);nt.current=te;const Ce=v.useRef(W);Ce.current=W;const ht=v.useRef(V);ht.current=V;const st=v.useCallback(()=>{if(X(void 0),ce.current===ge.current&&f===Se.current||(ce.current?.length??0)<k)return;ge.current=ce.current,Se.current=f;const Pe=new AbortController;$(Pe),f(ce.current??"",Pe.signal).then(lt=>{Pe.signal.aborted||(J(lt.map(d)),Ce.current?(lt.length>0&&y(lt.slice(0,1)),L(!1)):lt.length>0&&t.openDropdown())}).catch(lt=>{Pe.signal.aborted||lt.message.includes("aborted")||ke({color:"red",message:Ye(lt)})}).finally(()=>{Pe.signal.aborted||$(void 0)})},[t,f,y,d,k]),vt=v.useCallback(Pe=>{(V&&V.length>0||w)&&t.openDropdown(),t.updateSelectedOptionIndex(),B(Pe.currentTarget.value),nt.current&&(nt.current.abort(),$(void 0)),Oe.current!==void 0&&window.clearTimeout(Oe.current);const lt=window.setTimeout(()=>st(),100);X(lt)},[t,V,w,st]),rt=v.useCallback(Pe=>{const lt=I.some(ve=>ve.value===Pe),et=lt?I.filter(ve=>ve.value!==Pe):[...I];let ot=V?.find(ve=>ve.value===Pe);if(!ot&&w!==!1&&b){const ve=b(Pe);ot=d(ve)}if(ot){if(R===0){y([ot.resource]),I.length>0&&z([]);return}lt||et.push(ot)}if(R!==void 0)for(;et.length>R;)et.shift();y(et.map(ve=>ve.resource)),z(et)},[w,V,I,R,y,b,d]),wt=v.useMemo(()=>{if(!A)return Pe=>{A||(R===1&&(B(""),J([]),t.closeDropdown()),ge.current=void 0,Pe==="$create"?(B(""),rt(U)):rt(Pe))}},[rt,t,A,R,U]),pt=v.useCallback(Pe=>{const lt=I.filter(et=>et.value!==Pe.value);y(lt.map(et=>et.resource)),z(lt)},[I,y]),It=v.useCallback(Pe=>{Pe.key==="Enter"?(Y||te)&&L(!0):Pe.key==="Backspace"&&U.length===0&&(dn(Pe),pt(I[I.length-1]))},[te,pt,U.length,I,Y]);v.useEffect(()=>()=>{nt.current&&nt.current.abort()},[]);const Te=!A&&j&&I.length>0&&a.jsx(Ke.ClearButton,{title:"Clear all",size:"sm",onClear:()=>{B(""),z([]),y([]),t.closeDropdown()}}),Ee=w&&U.trim().length>0,Me=V.length>0||Ee;return a.jsxs(Ke,{store:t,onOptionSubmit:wt,withinPortal:!0,shadow:"xl",...N,children:[a.jsx(Ke.DropdownTarget,{children:a.jsx(hs,{label:r,description:o,error:l,className:e.className,leftSection:E,rightSection:te?a.jsx(Gr,{size:16}):Te,required:C,disabled:A,children:a.jsxs(ya.Group,{"data-testid":DT.selectedItems,children:[I.map(Pe=>a.jsx(F,{item:Pe,disabled:A,onRemove:()=>pt(Pe)},Pe.value)),!A&&(R===void 0||R===0||I.length<R)&&a.jsx(Ke.EventsTarget,{children:a.jsx(hs.Field,{role:"searchbox",name:n,value:U,placeholder:T,onFocus:vt,onBlur:()=>{t.closeDropdown(),B("")},onKeyDown:It,onChange:vt})})]})})}),a.jsx(Ke.Dropdown,{hidden:!Me,"data-testid":DT.options,children:a.jsx(Ke.Options,{children:a.jsxs(Wp,{type:"scroll",mah:_,children:[V.map(Pe=>{const lt=I.some(et=>et.value===Pe.value);return a.jsx(Ke.Option,{value:Pe.value,active:lt,children:a.jsx(M,{...Pe,active:lt})},Pe.value)}),Ee&&a.jsxs(Ke.Option,{value:"$create",children:["+ Create ",U]}),!w&&U.trim().length>0&&V.length===0&&a.jsx(oe,{search:U})]})})})]})}function tG(e){return e?Array.isArray(e)?e:[e]:[]}function nG(e){return a.jsxs(xe,{gap:"xs",children:[e.active&&a.jsx(zo,{size:12}),a.jsx("span",{children:e.label})]})}function rG({item:e,disabled:t,onRemove:n}){return a.jsx(ya,{withRemoveButton:!t,onRemove:n,children:e.label})}function iG(){return a.jsx(Ke.Empty,{children:"Nothing found"})}const oG="_searchInput_dick8_1",aG={searchInput:oG};function sG(e){return{value:e.id,label:Sa(e),resource:e}}function lG(e){const t=km(),n=_e(),r=v.useCallback(async(l,c)=>{const d=uG(l),f={signal:c},p=await n.graphql(d,void 0,void 0,f);return dG(p,l)},[n]),o=v.useCallback(l=>{l.length>0&&t(`/${Nt(l[0])}`)},[t]);return a.jsx(oS,{size:"sm",radius:"md",className:aG.searchInput,leftSection:a.jsx(wq,{size:16}),placeholder:"Search",itemComponent:cG,toOption:sG,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const cG=v.forwardRef(({resource:e,active:t,...n},r)=>{let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=e.subject?.display),a.jsx("div",{ref:r,...n,children:a.jsxs(xe,{wrap:"nowrap",children:[a.jsx(js,{value:e}),a.jsxs("div",{children:[a.jsx(Re,{children:Sa(e)}),a.jsx(Re,{size:"xs",c:"dimmed",children:o})]})]})})});function uG(e){const t=JSON.stringify(e);return mA(e)?`{
|
|
487
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
488
|
+
resourceType
|
|
489
|
+
id
|
|
490
|
+
identifier {
|
|
491
|
+
system
|
|
492
|
+
value
|
|
493
|
+
}
|
|
494
|
+
name {
|
|
495
|
+
given
|
|
496
|
+
family
|
|
497
|
+
}
|
|
498
|
+
birthDate
|
|
499
|
+
}
|
|
500
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
501
|
+
resourceType
|
|
502
|
+
id
|
|
503
|
+
identifier {
|
|
504
|
+
system
|
|
505
|
+
value
|
|
506
|
+
}
|
|
507
|
+
subject {
|
|
508
|
+
display
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
}`.replace(/\s+/g," "):`{
|
|
512
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
513
|
+
resourceType
|
|
514
|
+
id
|
|
515
|
+
identifier {
|
|
516
|
+
system
|
|
517
|
+
value
|
|
518
|
+
}
|
|
519
|
+
name {
|
|
520
|
+
given
|
|
521
|
+
family
|
|
522
|
+
}
|
|
523
|
+
birthDate
|
|
524
|
+
}
|
|
525
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
526
|
+
resourceType
|
|
527
|
+
id
|
|
528
|
+
identifier {
|
|
529
|
+
system
|
|
530
|
+
value
|
|
531
|
+
}
|
|
532
|
+
name {
|
|
533
|
+
given
|
|
534
|
+
family
|
|
535
|
+
}
|
|
536
|
+
birthDate
|
|
537
|
+
}
|
|
538
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
539
|
+
resourceType
|
|
540
|
+
id
|
|
541
|
+
identifier {
|
|
542
|
+
system
|
|
543
|
+
value
|
|
544
|
+
}
|
|
545
|
+
subject {
|
|
546
|
+
display
|
|
547
|
+
}
|
|
548
|
+
}
|
|
549
|
+
}`.replace(/\s+/g," ")}function dG(e,t){const n=[];return e.data.Patients1&&n.push(...e.data.Patients1),e.data.Patients2&&n.push(...e.data.Patients2),e.data.ServiceRequestList&&n.push(...e.data.ServiceRequestList),hG(fG(n),t).slice(0,5)}function fG(e){const t=new Set,n=[];for(const r of e)t.has(r.id)||(t.add(r.id),n.push(r));return n}function hG(e,t){return e.sort((n,r)=>AT(r,t)-AT(n,t))}function AT(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,kT(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,kT(iu(r),t));return n}function kT(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function pG(e){const t=Pm(),[n,r]=v.useState(!1);return a.jsx(qr.Header,{p:8,style:{zIndex:101},children:a.jsxs(xe,{justify:"space-between",children:[a.jsxs(xe,{gap:"xs",children:[a.jsx(ar,{className:_h.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&a.jsx(lG,{pathname:e.pathname,searchParams:e.searchParams})]}),a.jsxs(xe,{gap:"lg",pr:"sm",children:[e.notifications,a.jsxs(we,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[a.jsx(we.Target,{children:a.jsx(ar,{className:$t(_h.user,{[_h.userActive]:n}),onClick:()=>r(o=>!o),children:a.jsxs(xe,{gap:7,children:[a.jsx(js,{value:t,radius:"xl",size:24}),a.jsx(Re,{size:"sm",className:_h.userName,children:iu(t?.name?.[0])}),a.jsx(Z0,{size:12,stroke:1.5})]})})}),a.jsx(we.Dropdown,{children:a.jsx(eG,{version:e.version})})]})]})]})})}const aS=v.createContext({submitting:!1});aS.displayName="FormContext";function mG(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?gG(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&vG(t,n);return t}function gG(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function vG(e,t){e[t.name]=t.value}function ft(e){const[t,n]=v.useState(!1);return a.jsx(aS.Provider,{value:{submitting:t},children:a.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:r=>{r.preventDefault();const o=mG(r.target);if(e.onSubmit){n(!0);const l=e.onSubmit(o);l?.then?l.catch(console.error).finally(()=>{n(!1)}):n(!1)}},children:e.children})})}function jr(e){const{children:t,...n}=e,{submitting:r}=v.useContext(aS);return a.jsx(Ae,{type:"submit",loading:r,...n,children:t})}function yG(e){const t=_e(),n=t.getUserConfiguration();function r(o){const{menuname:l,bookmarkname:c}=o,d=`${e.pathname}?${e.searchParams.toString()}`,f=ui(n);f.menu?.find(({title:m})=>m===l)?.link?.push({name:c,target:d}),t.updateResource(f).then(m=>{n.menu=m.menu,t.dispatchEvent({type:"change"}),ke({color:"green",message:"Success"}),e.onOk()}).catch(m=>{ke({color:"red",message:Ye(m)})})}return a.jsx(Gn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:a.jsx(ft,{onSubmit:r,children:a.jsxs(Ue,{children:[a.jsx(xG,{config:n}),a.jsx(Be,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),a.jsx(xe,{justify:"flex-end",children:a.jsx(jr,{mt:"sm",children:"OK"})})]})})})}function xG(e){function t(r){return r?.menu?.map(o=>o.title)}const n=t(e.config);return a.jsx(cn,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function dk(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function bG(e){return typeof e.display=="string"?e.display:dk(e)}function SG(e){return{value:dk(e),label:bG(e),resource:e}}function wG(e){return{code:e,display:e}}function Nm(e){const t=_e(),{binding:n,creatable:r,clearable:o,expandParams:l,withHelpText:c,...d}=e,f=v.useCallback(async(p,m)=>{if(!n)return[];const y=(await t.valueSetExpand({...l,url:n,filter:p,count:10},{signal:m})).expansion?.contains??[],b=[];for(const w of y)w.code&&!b.some(j=>j.code===w.code)&&b.push(w);return b},[t,l,n]);return a.jsx(oS,{...d,creatable:r??!0,clearable:o??!0,toOption:SG,loadOptions:f,onCreate:wG,itemComponent:c?jG:void 0})}const jG=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(xe,{wrap:"nowrap",gap:"xs",children:[n&&a.jsx(zo,{size:12}),a.jsxs("div",{children:[a.jsx(Re,{children:e}),a.jsx(Re,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function fk(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[l,c]=v.useState(t);function d(f){const p=f[0],m=EG(p);c(m),n&&n(m)}return a.jsx(Nm,{defaultValue:CG(l),onChange:d,withHelpText:r??!0,...o})}function CG(e){return e?{code:e}:void 0}function EG(e){return e?.code}function sS(e){const[t,n]=v.useState(e.defaultValue),r=e.onChange,o=v.useCallback(l=>{n(l),r&&r(l)},[r]);return a.jsx(fk,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":e.testId,defaultValue:t,onChange:o,name:e.name,placeholder:e.placeholder,binding:"https://medplum.com/fhir/ValueSet/resource-types",creatable:!1,maxValues:e.maxValues??1,clearable:!1,withHelpText:!1})}const TG="_menuTitle_9g6l5_1",RG="_link_9g6l5_9",_G="_linkActive_9g6l5_38",Rx={menuTitle:TG,link:RG,linkActive:_G};function DG(e){const t=km(),n=PG(e.pathname,e.searchParams,e.menus),[r,o]=v.useState(!1);function l(d,f){d.stopPropagation(),d.preventDefault(),t(f),window.innerWidth<768&&e.closeNavbar()}function c(d){d&&t(`/${d}`)}return a.jsxs(a.Fragment,{children:[a.jsx(qr.Navbar,{children:a.jsxs(fi,{p:"xs",children:[!e.resourceTypeSearchDisabled&&a.jsx(qr.Section,{mb:"sm",children:a.jsx(sS,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:d=>c(d)},window.location.pathname)}),a.jsxs(qr.Section,{grow:!0,children:[e.menus?.map(d=>a.jsxs(v.Fragment,{children:[a.jsx(Re,{className:Rx.menuTitle,children:d.title}),d.links?.map(f=>a.jsxs(AG,{to:f.href,active:f.href===n?.href,onClick:p=>l(p,f.href),children:[a.jsx(kG,{icon:f.icon}),a.jsx("span",{children:f.label})]},f.href))]},`menu-${d.title}`)),e.displayAddBookmark&&a.jsx(Ae,{variant:"subtle",size:"xs",mt:"xl",leftSection:a.jsx(ik,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&a.jsx(yG,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function AG(e){return a.jsx(St,{onClick:e.onClick,to:e.to,className:$t(Rx.link,{[Rx.linkActive]:e.active}),children:e.children})}function kG(e){return e.icon?e.icon:a.jsx(bm,{w:30})}function PG(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const l of n)if(l.links)for(const c of l.links){const d=OG(e,t,c.href);d>o&&(o=d,r=c)}return r}function OG(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[c,d]of r.searchParams.entries())if(!o.includes(c)&&t.get(c)!==d)return 0;let l=1;for(const[c,d]of t.entries())o.includes(c)||r.searchParams.get(c)===d&&l++;return l}function NG(e){const[t,n]=v.useState(localStorage.navbarOpen==="true"),r=_e(),o=Pm();v.useEffect(()=>{function f(){ke({id:"offline",color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",f),()=>r.removeEventListener("offline",f)},[r]);function l(f){localStorage.navbarOpen=f.toString(),n(f)}function c(){l(!1)}function d(){l(!t)}return r.isLoading()?a.jsx(Oi,{}):a.jsxs(qr,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&a.jsx(pG,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:d,notifications:e.notifications}),o&&t?a.jsx(DG,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:c,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,a.jsx(qr.Main,{className:Hq.main,children:a.jsx(ak,{children:a.jsx(v.Suspense,{fallback:a.jsx(Oi,{}),children:e.children})})})]})}const MG="https://ccda.medplum.com",LG="https://ccda-validator.medplum.com/";function IG(e){const{url:t}=e,[n,r]=v.useState(!1),o=v.useRef(null),[l,c]=v.useState(),[d,f]=v.useState(!1);v.useEffect(()=>{t&&n&&o.current&&(cd(o.current,{command:"loadCcdaXml",value:t}).catch(console.error),r(!1))},[t,n]);const p=async()=>{if(t)try{f(!0);const b=await(await fetch(t)).text(),w=new FormData;w.append("ccdaFile",new Blob([b],{type:"text/xml"}),"ccda.xml");const j=`${LG}referenceccdaservice/?validationObjective=C-CDA_IG_Plus_Vocab&referenceFileName=No%20scenario%20File&curesUpdate=true&severityLevel=WARNING`,C=await fetch(j,{method:"POST",body:w,credentials:"omit",redirect:"manual"});if(!C.ok)throw new Error(`Validation failed: ${C.status} ${C.statusText}`);const T=await C.json();c(T)}catch(y){c(void 0),console.error("CCDA validation error:",y)}finally{f(!1)}},m=()=>{if(!l)return;const y=JSON.stringify(l,null,2);ck(y,"ccda-validation-results")},g=()=>l?l.resultsMetaData.resultMetaData.filter(y=>y?.type.includes("Error")).reduce((y,b)=>y+(b.count||0),0):0;return t?a.jsxs("div",{"data-testid":"ccda-iframe",style:{maxWidth:e.maxWidth},children:[a.jsx("div",{style:{minHeight:400},children:a.jsx("iframe",{title:"C-CDA Viewer",width:"100%",height:"400",ref:o,src:MG,allowFullScreen:!0,frameBorder:0,seamless:!0,onLoad:()=>r(!0)})}),a.jsxs("div",{style:{marginTop:"10px",marginBottom:"10px",display:"flex",alignItems:"center"},children:[a.jsx(Ae,{type:"button",onClick:p,disabled:d,children:d?"Validating...":"Validate"}),l&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{style:{marginLeft:"15px"},children:[a.jsx("strong",{children:"Validation Results:"})," ",g()," errors found"]}),a.jsx(Ae,{type:"button",onClick:m,color:"green",style:{marginLeft:"auto"},children:"Download Full Results"})]})]})]}):null}function Jd(e){const{contentType:t,url:n,title:r}=e.value??{},o=HA(n);return o?a.jsxs("div",{"data-testid":"attachment-display",children:[t?.startsWith("image/")&&a.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),t?.startsWith("video/")&&a.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:a.jsx("source",{type:t,src:o})}),(t?.startsWith("text/")||t==="application/json"||t==="application/pdf")&&a.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:a.jsx("iframe",{title:"Attachment",width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),t===on.CDA_XML&&a.jsx(IG,{url:o}),a.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:a.jsx(Mt,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:zG(r),children:r||"Download"})})]}):null}function zG(e){return e?.includes(".")?e:void 0}const $G="_root_17n8t_1",UG="_compact_17n8t_25",PT={root:$G,compact:UG};function Mm(e){const{children:t,compact:n}=e;return a.jsx("dl",{className:$t(PT.root,{[PT.compact]:n}),children:t})}function ki(e){return a.jsxs(a.Fragment,{children:[a.jsx("dt",{children:e.term}),a.jsx("dd",{children:e.children})]})}function BG(e){const t=e.values?.map((r,o)=>a.jsx("div",{children:a.jsx(Jd,{value:r,maxWidth:e.maxWidth})},"attatchment-"+o));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!An(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const r=e.path.split(".").pop();n=a.jsx(ki,{term:ul(r),children:t})}else n=a.jsx(a.Fragment,{children:t});return n}function lS(e){const t=_e(),n=v.useRef(null);function r(c){dn(c),n.current?.click()}function o(c){dn(c);const d=c.target.files;d&&Array.from(d).forEach(l)}function l(c){!c||!c.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:c,contentType:c.type||"application/octet-stream",filename:c.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(f=>e.onUpload(f)).catch(f=>{e.onUploadError&&e.onUploadError(Yt(f))}))}return a.jsxs(a.Fragment,{children:[a.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:c=>o(c)}),e.children({onClick:r,disabled:e.disabled})]})}function VG(e){const[t,n]=v.useState(e.defaultValue??[]),r=v.useRef(t);r.current=t;function o(l){n(l),e.onChange&&e.onChange(l)}return a.jsxs("table",{style:{width:"100%"},children:[a.jsxs("colgroup",{children:[a.jsx("col",{width:"97%"}),a.jsx("col",{width:"3%"})]}),a.jsxs("tbody",{children:[t.map((l,c)=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Jd,{value:l,maxWidth:200})}),a.jsx("td",{children:a.jsx(En,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:d=>{dn(d);const f=t.slice();f.splice(c,1),o(f)},children:a.jsx(vp,{})})})]},`${c}-${t.length}`)),a.jsxs("tr",{children:[a.jsx("td",{}),a.jsx("td",{children:a.jsx(lS,{disabled:e.disabled,onUpload:l=>{o([...r.current,l])},children:l=>a.jsx(En,{...l,title:"Add",variant:"subtle",size:"sm",color:l.disabled?"gray":"green",children:a.jsx(eS,{})})})})]})]})]})}function hk(e){const[t,n]=v.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?a.jsxs(a.Fragment,{children:[a.jsx(Jd,{value:t,maxWidth:200}),a.jsx(Ae,{disabled:e.disabled,onClick:o=>{dn(o),r(void 0)},children:"Remove"})]}):a.jsx(lS,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>a.jsx(Ae,{...o,children:"Upload..."})})}function $i(e){return a.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 180 180",style:{width:e.size,height:e.size},children:[a.jsx("title",{children:"Medplum Logo"}),a.jsx("path",{fill:e.fill??"#9c36b5",d:"M84 56c-3-15-15-24-23-28l5-10c8 2 14 8 20 14 0-12 1-16 5-21 8-9 13-9 41-9 0 7 1 18-3 24-7 9-16 7-41 8 5 8 7 14 8 22 36-24 74-7 74 39 0 42-40 83-80 83s-80-41-80-83c0-46 38-63 74-39Zm-3 43H65c-4 0-7 3-7 7v4c0 4 3 7 7 7h16v16c0 4 3 7 7 7h4c4 0 7-3 7-7v-16h16c4 0 7-3 7-7v-4c0-4-3-7-7-7H99V83c0-4-3-7-7-7h-4c-4 0-7 3-7 7z"})]})}function xp(e){const[t,n]=v.useState();return a.jsx(ft,{onSubmit:r=>{n(void 0),e.onSubmit(r)?.catch(o=>n(Ye(o)))},children:a.jsxs(Ue,{children:[a.jsxs(fr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(Le,{children:e.title})]}),t&&a.jsx(Ta,{icon:a.jsx(El,{size:16}),title:"Error",color:"red",children:t}),e.qrCodeUrl&&a.jsxs(Ue,{align:"center",children:[a.jsx(Re,{children:"Scan this QR code with your authenticator app."}),a.jsx("img",{src:e.qrCodeUrl,alt:"Multi Factor Auth QR Code"})]}),a.jsx(Ue,{children:a.jsx(Be,{name:"token",label:"MFA code",autoComplete:"one-time-code",required:!0,autoFocus:!0})}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(jr,{children:e.buttonText})})]})})}const FG="_root_1vii2_1",HG={root:FG};function ou(e){const{children:t,...n}=e;return a.jsx(zd,{className:HG.root,...n,children:t})}const qG="_paper_1igaj_1",GG="_fill_1igaj_20",OT={paper:qG,fill:GG};function Tl(e){const{width:t,fill:n,className:r,children:o,...l}=e,c=t?{maxWidth:t}:void 0;return a.jsx(Ar,{className:$t(OT.paper,n&&OT.fill,r),style:c,shadow:"sm",radius:"sm",withBorder:!0,...l,children:o})}function dt(e){const{children:t,...n}=e;return a.jsx(ou,{children:a.jsx(Tl,{...n,children:t})})}function Lt(e,t){return e?.issue?.filter(n=>pk(n.expression?.[0],t))?.map(n=>n.details?.text)?.join(`
|
|
550
|
+
`)}function au(e,t){return e?.issue?.filter(n=>pk(n.expression?.[0],t))}const Dh=/\[\d+\]/;function pk(e,t){const n=typeof e=="string"&&Dh.test(e),r=typeof t=="string"&&Dh.test(t);if(n!==r&&(e=e?.replace(Dh,""),t=t?.replace(Dh,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const l=t.indexOf(".");return l>=0&&t.substring(l+1)===e}function mk(e){const t=_e(),[n,r]=v.useState();return a.jsxs(ft,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(l){r(Yt(l))}},children:[a.jsxs(fr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(Le,{children:"Create project"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(Be,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Lt(n,"projectName")}),a.jsxs(Re,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Mt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Mt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(jr,{children:"Create project"})})]})}function gk(e,t){const n=document.getElementsByTagName("head")[0],r=document.createElement("script");r.async=!0,r.src=e,r.onload=t??null,n.appendChild(r)}function vk(e){const t=_e(),{googleClientId:n,handleGoogleCredential:r}=e,o=v.useRef(null),[l,c]=v.useState(typeof google<"u"),[d,f]=v.useState(!1),[p,m]=v.useState(!1);return v.useEffect(()=>{if(typeof google>"u"){gk("https://accounts.google.com/gsi/client",()=>c(!0));return}d||(google.accounts.id.initialize({client_id:n,callback:r}),f(!0)),o.current&&!p&&(google.accounts.id.renderButton(o.current,{}),m(!0))},[t,n,d,l,o,p,r]),n?a.jsx("div",{ref:o}):null}function yk(e){if(e)return e;const t=rr.getOrigin();if(t&&[].includes(t))return"__GOOGLE_CLIENT_ID__"}function Cr(e){const t=e.outcome?.issue||e.issues;return!t||t.length===0?null:a.jsx(Ta,{icon:a.jsx(El,{size:16}),color:"red",children:t.map(n=>a.jsx("div",{"data-testid":"text-field-error",children:ZD(n)},n.details?.text))})}function xk(e){typeof grecaptcha>"u"&&gk("https://www.google.com/recaptcha/api.js?render="+e)}function bk(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function WG(e){const t=yk(e.googleClientId),n=e.recaptchaSiteKey,r=_e(),[o,l]=v.useState(),c=au(o,void 0);return v.useEffect(()=>{n&&xk(n)},[n]),a.jsxs(ft,{onSubmit:async d=>{l(void 0);try{let f="";n&&(f=await bk(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:d.firstName,lastName:d.lastName,email:d.email,password:d.password,remember:d.remember==="true",recaptchaSiteKey:n,recaptchaToken:f}))}catch(f){l(Yt(f))}},children:[a.jsx(fr,{style:{flexDirection:"column"},children:e.children}),a.jsx(Cr,{issues:c}),t&&a.jsxs(a.Fragment,{children:[a.jsx(xe,{justify:"center",p:"xl",style:{height:70},children:a.jsx(vk,{googleClientId:t,handleGoogleCredential:async d=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:d.clientId,googleCredential:d.credential,projectId:e.projectId,createUser:!0}))}catch(f){l(Yt(f))}}})}),a.jsx(vn,{label:"or",labelPosition:"center",my:"lg"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(Be,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Lt(o,"firstName")}),a.jsx(Be,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Lt(o,"lastName")}),a.jsx(Be,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Lt(o,"email")}),a.jsx(Xi,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Lt(o,"password")}),a.jsxs(Re,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",a.jsx(Mt,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Mt,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),a.jsxs(Re,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",a.jsx(Mt,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",a.jsx(Mt,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),a.jsxs(xe,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Ln,{name:"remember",label:"Remember me",size:"xs"}),a.jsx(jr,{children:"Create account"})]})]})}function QG(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:l,onSuccess:c}=e,d=_e(),[f,p]=v.useState(),[m,g]=v.useState();v.useEffect(()=>{t==="patient"&&f&&d.startNewPatient({login:f,projectId:n}).then(b=>d.processCode(b.code)).then(()=>c()).catch(b=>g(Yt(b)))},[d,t,n,f,c]);function y(b){b.code?d.processCode(b.code).then(()=>c()).catch(console.log):b.login&&p(b.login)}return a.jsxs(dt,{width:450,children:[m&&a.jsx("pre",{children:JSON.stringify(m,null,2)}),!f&&a.jsx(WG,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:l,handleAuthResponse:y,children:e.children}),f&&t==="project"&&a.jsx(mk,{login:f,handleAuthResponse:y})]})}function YG(e){const[t,n]=v.useState();return t?a.jsx(XG,{email:t,...e}):a.jsx(KG,{setEmail:n,...e})}function KG(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:l,...c}=e,d=_e(),f=!e.disableGoogleAuth&&yk(e.googleClientId),[p,m]=v.useState(),g=au(p,void 0),y=v.useCallback(async j=>{if(!j.authorizeUrl)return!1;const C=JSON.stringify({...await d.ensureCodeChallenge(c),domain:j.domain}),T=new URL(j.authorizeUrl);return T.searchParams.set("state",C),rr.assign(T.toString()),!0},[d,c]),b=v.useCallback(async j=>{const C=await d.post("auth/method",{email:j.email});await y(C)||t(j.email)},[d,y,t]),w=v.useCallback(async j=>{try{const C=await d.startGoogleLogin({...c,googleCredential:j.credential});await y(C)||r(C)}catch(C){m(Yt(C))}},[d,c,y,r]);return a.jsxs(ft,{onSubmit:b,children:[a.jsx(fr,{style:{flexDirection:"column"},children:o}),a.jsx(Cr,{issues:g}),f&&a.jsxs(a.Fragment,{children:[a.jsx(xe,{justify:"center",p:"xl",style:{height:70},children:a.jsx(vk,{googleClientId:f,handleGoogleCredential:w})}),!l&&a.jsx(vn,{label:"or",labelPosition:"center",my:"lg"})]}),!l&&a.jsx(Be,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Lt(p,"email")}),a.jsxs(xe,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[a.jsx("div",{children:n&&a.jsx(Mt,{component:"button",type:"button",c:"dimmed",onClick:n,size:"xs","data-dashlane-ignore":"true","data-lp-ignore":"true","data-no-autofill":"true","data-form-type":"navigation",children:"Register"})}),!l&&a.jsx(jr,{children:"Next"})]})]})}function XG(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,l=_e(),[c,d]=v.useState(),f=au(c,void 0),p=v.useCallback(m=>{l.startLogin({...o,password:m.password,remember:m.remember==="on"}).then(n).catch(g=>d(Yt(g)))},[l,o,n]);return a.jsxs(ft,{onSubmit:p,children:[a.jsx(fr,{style:{flexDirection:"column"},children:r}),a.jsx(Cr,{issues:f}),a.jsx(Ue,{gap:"xl",children:a.jsx(Xi,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Lt(c,"password")})}),a.jsxs(xe,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&a.jsx(Mt,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),a.jsx(Ln,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),a.jsx(jr,{children:"Sign in"})]})]})}function JG(e){const t=_e(),n=Sl(),[r,o]=v.useState(""),[l,c]=v.useState();function d(g){return!!g?.toLowerCase()?.includes(r.toLowerCase())}function f(g){return d(g.profile?.display)||d(g.project?.display)}function p(g){t.post("auth/profile",{login:e.login,profile:g}).then(e.handleAuthResponse).catch(y=>c(Yt(y)))}const m=e.memberships.filter(f).slice(0,10).map(g=>a.jsx(Ke.Option,{value:g.id,children:a.jsx(ZG,{...g})},g.id));return a.jsxs(Ue,{children:[a.jsxs(_o,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[a.jsx($i,{size:32}),a.jsx(Le,{order:3,children:"Choose profile"})]}),a.jsx(Cr,{outcome:l}),a.jsxs(Ke,{store:n,onOptionSubmit:p,children:[a.jsx(Ke.EventsTarget,{children:a.jsx(Be,{placeholder:"Search",value:r,onChange:g=>{o(g.currentTarget.value),n.updateSelectedOptionIndex()}})}),a.jsx("div",{children:a.jsx(Ke.Options,{children:m.length>0?m:a.jsx(Ke.Empty,{children:"Nothing found..."})})})]})]})}function ZG(e){return a.jsxs(xe,{children:[a.jsx(sl,{radius:"xl"}),a.jsxs("div",{children:[a.jsx(Re,{fz:"sm",fw:500,children:e.profile?.display}),a.jsx(Re,{fz:"xs",opacity:.6,children:e.project?.display})]})]})}const eW=/^patient\/Condition\.(?:\*|c?r?u?d?s?)$/,tW="?category=http://terminology.hl7.org/CodeSystem/condition-category|encounter-diagnosis",nW="?category=http://terminology.hl7.org/CodeSystem/condition-category|problem-list-item",rW="?category=http://hl7.org/fhir/us/core/CodeSystem/condition-category|health-concern",iW=/^patient\/Observation\.(?:\*|c?r?u?d?s?)$/,oW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-observation-category|clinical-test",aW="?category=http://terminology.hl7.org/CodeSystem/observation-category|laboratory",sW="?category=http://terminology.hl7.org/CodeSystem/observation-category|social-history",lW="?category=http://hl7.org/fhir/us/core/CodeSystem/us-core-category|sdoh",cW="?category=http://terminology.hl7.org/CodeSystem/observation-category|survey",uW="?category=http://terminology.hl7.org/CodeSystem/observation-category|vital-signs";function dW(e){const t=_e();return a.jsx(ft,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:a.jsxs(Ue,{children:[a.jsxs(fr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(Le,{children:"Choose scope"})]}),a.jsx(Ue,{children:(e.scope??"openid").split(" ").map(n=>{let r;return eW.test(n)?r=[n+tW,n+nW,n+rW]:iW.test(n)&&(r=[n+oW,n+aW,n+sW,n+lW,n+cW,n+uW]),a.jsxs(a.Fragment,{children:[a.jsx(Ln,{id:n,name:n,label:n,defaultChecked:!0},n),r?.map(o=>a.jsx(Ln,{id:o,name:o,label:o},o))]},n+"_group")})}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(jr,{children:"Set scope"})})]})})}function Sk(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:l,onCode:c,...d}=e,f=_e(),[p,m]=v.useState(),g=v.useRef(!1),[y,b]=v.useState(!1),[w,j]=v.useState(),[C,T]=v.useState(!1),[E,R]=v.useState(),_=v.useCallback(A=>{c?c(A):f.processCode(A).then(()=>{r&&r()}).catch(P=>ke({color:"red",message:Ye(P)}))},[f,c,r]),k=v.useCallback(A=>{b(!!A.mfaEnrollRequired),j(A.enrollQrCode),T(!!A.mfaRequired),A.login&&m(A.login),A.memberships&&R(A.memberships),A.code&&(n?R(void 0):_(A.code))},[n,_]),N=v.useCallback(A=>{_(A.code)},[_]);return v.useEffect(()=>{t&&!g.current&&!p&&(g.current=!0,f.get("auth/login/"+t).then(k).catch(A=>ke({color:"red",message:Ye(A)})))},[f,t,g,p,k]),a.jsx(dt,{width:450,px:"sm",py:"md",children:p?y&&w?a.jsx(xp,{title:"Enroll in MFA",buttonText:"Enroll",qrCodeUrl:w,onSubmit:async A=>{const P=await f.post("auth/mfa/login-enroll",{login:p,token:A.token});k(P)}}):C?a.jsx(xp,{title:"Enter MFA code",buttonText:"Submit code",onSubmit:async A=>{const P=await f.post("auth/mfa/verify",{login:p,token:A.token});k(P)}}):E?a.jsx(JG,{login:p,memberships:E,handleAuthResponse:k}):e.projectId==="new"?a.jsx(mk,{login:p,handleAuthResponse:k}):e.chooseScopes?a.jsx(dW,{login:p,scope:e.scope,handleAuthResponse:N}):a.jsx("div",{children:"Success"}):a.jsx(YG,{onForgotPassword:o,onRegister:l,handleAuthResponse:k,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...d,children:e.children})})}function Co(e){return a.jsx(a.Fragment,{children:ps(e.value)})}function fW(e){return a.jsx(a.Fragment,{children:Yd(e.value)})}function wk(e){const t=e.value;if(!t)return null;const n=[];return t.value&&n.push(t.value),(t.use||t.system)&&(n.push(" ["),t.use&&n.push(t.use),t.use&&t.system&&n.push(" "),t.system&&n.push(t.system),n.push("]")),a.jsx(a.Fragment,{children:n.join("").trim()})}function hW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[t.name,t.name&&": ",t.telecom?.map(n=>a.jsx(wk,{value:n},`telecom-${t.name}-${n.value}`))]}):null}function Lm(e,t,n){const r=Uc(e,t,{profileUrl:n});return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function pW(e,t,n){const r=oA(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function mW(e){const{elementDefinitionType:t}=e,n=_e(),r=v.useContext(un),[o,l]=v.useState(rA("Extension")),c=v.useMemo(()=>{if(An(t?.profile))return t.profile[0]},[t]),[d,f]=v.useState(c!==void 0);if(v.useEffect(()=>{c&&(f(!0),n.requestProfileSchema(c).then(()=>{const g=ru(c);f(!1),g&&l(g)}).catch(g=>{f(!1),console.warn(g)}))},[n,c]),c&&(d||!P0(c)))return a.jsx("div",{children:"Loading..."});if(o.elements["value[x]"]?.max!==0){const[g,y]=Lm({type:"Extension",value:e.value},"value[x]",c??r.profileUrl);return a.jsx(no,{propertyType:y,value:g})}return a.jsx(Sp,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:c})}function gW(e){return a.jsxs("div",{children:[e.value?.system,": ",e.value?.value]})}function vW(e){return a.jsx(a.Fragment,{children:kU(e.value)})}function jd(e){return a.jsx(a.Fragment,{children:el(e.value)})}function cS(e){return a.jsx(a.Fragment,{children:Sd(e.value)})}function yW(e){const t=e.value;return t?a.jsxs(a.Fragment,{children:[a.jsx(jd,{value:t.numerator})," / ",a.jsx(jd,{value:t.denominator})]}):null}function bp(e){if(!e.value)return null;const t=e.value.display||e.value.reference||to(e.value);return e.link!==!1&&e.value.reference?a.jsx(St,{to:e.value,children:t}):a.jsx(a.Fragment,{children:t})}function jk(e,t,n,r){if(!An(n?.slices))return[e];const o=new Array(t.length+1);for(let l=0;l<o.length;l++)o[l]=[];for(const l of e){const c=UA(l,t,n.discriminator,r);let d=c?t.findIndex(f=>f.name===c):-1;d===-1&&(d=t.length),o[d].push(l)}return o}async function Ck({medplum:e,property:t}){return new Promise((n,r)=>{if(!t.slicing){n([]);return}const o=[],l=[],c=[];for(const d of t.slicing.slices){if(!$A(d)){console.debug("Unsupported slice definition",d);continue}let f;An(d.elements)||(f=d.type[0]?.profile?.[0]),o.push(d),l.push(f),f&&c.push(e.requestProfileSchema(f))}Promise.all(c).then(()=>{for(let d=0;d<o.length;d++){const f=o[d],p=l[d];if(p){const m=ru(p);f.typeSchema=m}}n(o)}).catch(r)})}function Im(e,t,n){return t!==void 0?a.jsx(e,{value:t,children:n}):n}function xW(e){const{slice:t,property:n}=e,r=t.typeSchema?.elements??t.elements,o=v.useContext(un),l=v.useMemo(()=>{if(An(r))return Vc({parentContext:o,elements:r,path:e.path,profileUrl:t.typeSchema?.url})},[o,e.path,t.typeSchema?.url,r]);return Im(un.Provider,l,a.jsx(a.Fragment,{children:e.value.map((c,d)=>a.jsx("div",{children:a.jsx(no,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${d}-${e.value.length}`))}))}const NT=50;function bW(e){const{property:t,propertyType:n}=e,r=_e(),o=v.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[l,c]=v.useState(!0),[d,f]=v.useState([]),[p,m]=v.useState(()=>[o]),[g,y]=v.useState(0),b=v.useContext(un);if(v.useEffect(()=>{Ck({medplum:r,property:t}).then(C=>{y(o.length),f(C);const T=o.slice(0,NT),E=jk(T,C,t.slicing,b.profileUrl);m(E),c(!1)}).catch(C=>{console.error(C),c(!1)})},[r,t,b.profileUrl,m,o]),l)return a.jsx("div",{children:"Loading..."});let w;if(t.type[0]?.code!=="Extension"){const C=p[d.length],T=C.map((E,R)=>a.jsx("div",{children:a.jsx(no,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:E,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${R}-${C.length}`));if(e.includeDescriptionListEntry){if(!An(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const E=e.path.split(".").pop();w=a.jsx(ki,{term:ul(E),children:T})}else w=a.jsx(a.Fragment,{children:T})}return a.jsxs(a.Fragment,{children:[d.map((C,T)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let E=a.jsx(xW,{path:e.path,slice:C,property:t,value:p[T],ignoreMissingValues:e.ignoreMissingValues,link:e.link},C.name);return e.includeDescriptionListEntry&&(E=a.jsx(ki,{term:ul(C.name),children:E},C.name)),E}),w,g>NT&&a.jsx(xe,{justify:"right",children:a.jsxs(Re,{children:["... ",g," total values"]})})]})}function no(e){const{property:t,propertyType:n,value:r}=e;if(t?.path?.endsWith(".id"))return a.jsxs(_o,{gap:3,align:"center",children:[r,!bn(r)&&a.jsx(Yb,{value:r,timeout:2e3,children:({copied:l,copy:c})=>a.jsx(xa,{label:l?"Copied":"Copy",withArrow:!0,position:"right",children:a.jsx(En,{variant:"subtle",color:l?"teal":"gray",onClick:c,children:l?a.jsx(zo,{size:"1rem"}):a.jsx(tS,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===re.Attachment?a.jsx(BG,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):a.jsx(bW,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case re.boolean:return a.jsx(a.Fragment,{children:r===void 0?"":(!!r).toString()});case re.SystemString:case re.string:return e.property?.path?.toLowerCase().includes("secret")?a.jsx(SW,{value:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case re.code:case re.date:case re.decimal:case re.id:case re.integer:case re.positiveInt:case re.unsignedInt:case re.uri:case re.url:return a.jsx(a.Fragment,{children:r});case re.canonical:return a.jsx(bp,{value:{reference:r},link:e.link});case re.dateTime:case re.instant:return a.jsx(a.Fragment,{children:wr(r)});case re.markdown:return a.jsx("pre",{children:r});case re.Address:return a.jsx(AF,{value:r});case re.Annotation:return a.jsx(a.Fragment,{children:r?.text});case re.Attachment:return a.jsx(Jd,{value:r,maxWidth:e.maxWidth});case re.CodeableConcept:return a.jsx(Co,{value:r});case re.Coding:return a.jsx(fW,{value:r});case re.ContactDetail:return a.jsx(hW,{value:r});case re.ContactPoint:return a.jsx(wk,{value:r});case re.HumanName:return a.jsx(iS,{value:r});case re.Identifier:return a.jsx(gW,{value:r});case re.Money:return a.jsx(vW,{value:r});case re.Period:return a.jsx(a.Fragment,{children:TU(r)});case re.Quantity:case re.Duration:return a.jsx(jd,{value:r});case re.Range:return a.jsx(cS,{value:r});case re.Ratio:return a.jsx(yW,{value:r});case re.Reference:return a.jsx(bp,{value:r,link:e.link});case re.Timing:return a.jsx(a.Fragment,{children:wA(r)});case re.Dosage:case re.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Sp,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case re.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(mW,{path:e.path,value:r,compact:!0,ignoreMissingValues:e.ignoreMissingValues,elementDefinitionType:e.elementDefinitionType});default:if(!t)throw Error(`Displaying property of type ${e.propertyType} requires element schema`);if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return a.jsx(Sp,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}function SW(e){const[t,n]=v.useState(!1),r=e.value??"",o=!bn(r),l="•".repeat(8);return a.jsxs(_o,{gap:3,align:"center",children:[t?a.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r}):a.jsx("div",{style:{whiteSpace:"pre-wrap"},"aria-hidden":"true",children:o?l:""}),o&&a.jsxs(a.Fragment,{children:[a.jsx(Yb,{value:e.value,timeout:2e3,children:({copied:c,copy:d})=>a.jsx(xa,{label:c?"Copied":"Copy secret",withArrow:!0,position:"right",children:a.jsx(En,{variant:"subtle",color:c?"teal":"gray",onClick:d,"aria-label":c?"Copied":"Copy secret",children:c?a.jsx(zo,{size:"1rem"}):a.jsx(tS,{size:"1rem"})})})}),a.jsx(xa,{label:t?"Hide secret":"Show secret",withArrow:!0,position:"right",children:a.jsx(En,{variant:"subtle",color:"gray",onClick:()=>n(!t),"aria-label":t?"Hide secret":"Show secret",children:t?a.jsx(AH,{size:"1rem"}):a.jsx(PH,{size:"1rem"})})})]})]})}const Ek=["extension","modifierExtension"],wW=ZA.filter(e=>!Ek.includes(e));function Sp(e){const t=e.value,{value:n,type:r}=t,o=v.useContext(un),l=e.profileUrl??o?.profileUrl,c=v.useMemo(()=>wm(r,l),[l,r]),d=v.useMemo(()=>{if(c)return Vc({parentContext:o,elements:c.elements,path:e.path,profileUrl:c.url,accessPolicyResource:e.accessPolicyResource})},[c,o,e.path,e.accessPolicyResource]);if(bn(n))return null;if(!c)return a.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return a.jsx("div",{children:n.name});const f=d??o;return Im(un.Provider,d,a.jsx(Mm,{compact:e.compact,children:Object.entries(f.elements).map(([p,m])=>{if(Ek.includes(p)&&bn(m.slicing?.slices))return null;if(wW.includes(p))return null;if(ek.includes(p)&&m.path.split(".").length===2||p.includes("."))return null;const[g,y]=Lm(t,p,f.profileUrl);if((e.ignoreMissingValues||m.max===0)&&bn(g)||e.path.endsWith(".extension")&&(p==="url"||p==="id"))return null;const b=m.max>1||m.isArray,w=a.jsx(no,{property:m,propertyType:y,path:e.path+"."+p,value:g,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:b,link:e.link},p);return b?w:a.jsx(ki,{term:ul(p),children:w},p)})}))}const jW="_dimmed_11me5_1",CW="_preserveBreaks_11me5_5",_x={dimmed:jW,preserveBreaks:CW},Tk="Read Only";function Rk(e,t){return e?a.jsx(xa.Floating,{label:e,children:t}):t}function _k(e){const{debugMode:t}=v.useContext(un);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Rk(e?.readonly?Tk:void 0,a.jsxs(xe,{wrap:"nowrap","data-testid":e.testId,children:[a.jsx("div",{children:e.children}),a.jsx("div",{children:a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e?.readonly?_x.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function zt(e){const{debugMode:t}=v.useContext(un);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Rk(e?.readonly?Tk:void 0,a.jsx(fn.Wrapper,{id:e.htmlFor,label:n,classNames:{label:$t({[_x.dimmed]:e?.readonly},_x.preserveBreaks)},description:e.description,withAsterisk:e.withAsterisk,error:Lt(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function EW(e,t,n,r,o){const l=r.type;if(l.length>1)for(const c of l){const d=t.replace("[x]",qn(c.code));d in e&&delete e[d]}return bn(o)?e[n]=void 0:e[n]=o,e}function TW(e){return!!e&&!bn(e.url)&&!bn(e.name)}function RW(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:l,valuePath:c,...d}=e,[f,p]=v.useState(t);function m(g){const y=DW(g);p(y),n&&n(y)}return a.jsx(Nm,{defaultValue:f&&_W(f),onChange:m,withHelpText:r??!0,...d})}function _W(e){return e.coding?.map(t=>({system:t.system,code:t.code,display:t.display}))}function DW(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function AW(e){const{defaultValue:t,onChange:n,withHelpText:r,response:o,...l}=e,[c,d]=v.useState(o?.answer?.[0]?.valueCoding??t);function f(p){const m=p[0],g=m&&PW(m);d(g),n&&n(g)}return a.jsx(Nm,{defaultValue:c?kW(c):void 0,maxValues:1,onChange:f,withHelpText:r??!0,...l})}function kW(e){return{system:e.system,code:e.code,display:e.display}}function PW(e){return{system:e.system,code:e.code,display:e.display}}function Dk(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=v.useContext(un),[l,c]=v.useState(e.defaultValue),d=v.useRef(l);d.current=l;const[f,p,m]=v.useMemo(()=>["system","use","value"].map(R=>r[t+"."+R]),[r,t]),[g,y,b]=v.useMemo(()=>["system","use","value"].map(R=>o(t+"."+R)),[o,t]);function w(R){R&&Object.keys(R).length===0&&(R=void 0),c(R),e.onChange&&e.onChange(R)}function j(R){const _={...d.current,system:R};R||delete _.system,w(_)}function C(R){const _={...d.current,use:R};R||delete _.use,w(_)}function T(R){const _={...d.current,value:R};R||delete _.value,w(_)}const E=e.valuePath??t;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(cn,{disabled:e.disabled||g?.readonly,"data-testid":"system",defaultValue:l?.system,required:(f?.min??0)>0,onChange:R=>j(R.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Lt(n,E+".system")}),a.jsx(cn,{disabled:e.disabled||y?.readonly,"data-testid":"use",defaultValue:l?.use,required:(p?.min??0)>0,onChange:R=>C(R.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Lt(n,E+".use")}),a.jsx(Be,{disabled:e.disabled||b?.readonly,placeholder:"Value",defaultValue:l?.value,required:(m?.min??0)>0,onChange:R=>T(R.currentTarget.value),error:Lt(n,E+".value")})]})}function OW(e){const[t,n]=v.useState(e.defaultValue),r=v.useRef(t);r.current=t;const{getExtendedProps:o}=v.useContext(un),[l,c]=v.useMemo(()=>["name","telecom"].map(m=>o(e.path+"."+m)),[o,e.path]);function d(m){n(m),e.onChange&&e.onChange(m)}function f(m){const g={...r.current,name:m};m||delete g.name,d(g)}function p(m){const g={...r.current,telecom:m&&[m]};m||delete g.telecom,d(g)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Be,{disabled:e.disabled||l?.readonly,"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t?.name,onChange:m=>f(m.currentTarget.value)}),a.jsx(Dk,{disabled:e.disabled||c?.readonly,name:e.name+"-telecom",path:e.path+".telecom",defaultValue:t?.telecom?.[0],onChange:p,outcome:e.outcome})]})}function NW(e){if(!e)return"";const t=new Date(e);return Cm(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function uS(e){if(!e)return"";const t=new Date(e);return Cm(t)?t.toISOString():""}function Eo(e){return a.jsx(Be,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e["data-testid"]??e.name,placeholder:e.placeholder,required:e.required,disabled:e.disabled,type:MW(),step:1,defaultValue:NW(e.defaultValue),autoFocus:e.autoFocus,error:Lt(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(uS(n))}}})}function MW(){return"datetime-local"}function LW(e){const{propertyType:t}=e,n=_e(),r=v.useMemo(()=>{if(An(t.profile))return t.profile[0]},[t]),[o,l]=v.useState(r!==void 0);return v.useEffect(()=>{r&&(l(!0),n.requestProfileSchema(r).then(()=>l(!1)).catch(c=>{l(!1),console.warn(c)}))},[n,r]),r&&(o||!P0(r))?a.jsx("div",{children:"Loading..."}):a.jsx(pS,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function IW(e){const{outcome:t,path:n}=e,[r,o]=v.useState(e.defaultValue),{getExtendedProps:l}=v.useContext(un),[c,d,f,p,m]=v.useMemo(()=>["use","prefix","given","family","suffix"].map(E=>l(e.path+"."+E)),[l,e.path]);function g(E){o(E),e.onChange&&e.onChange(E)}function y(E){g({...r,use:E||void 0})}function b(E){g({...r,prefix:E?E.split(" "):void 0})}function w(E){g({...r,given:E?E.split(" "):void 0})}function j(E){g({...r,family:E||void 0})}function C(E){g({...r,suffix:E?E.split(" "):void 0})}const T=e.valuePath??n;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(cn,{disabled:e.disabled||c?.readonly,defaultValue:r?.use,name:e.name+"-use","data-testid":"use",onChange:E=>y(E.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Lt(t,T+".use")}),a.jsx(Be,{disabled:e.disabled||d?.readonly,placeholder:"Prefix",name:e.name+"-prefix",defaultValue:r?.prefix?.join(" "),onChange:E=>b(E.currentTarget.value),error:Lt(t,T+".prefix")}),a.jsx(Be,{disabled:e.disabled||f?.readonly,placeholder:"Given",name:e.name+"-given",defaultValue:r?.given?.join(" "),onChange:E=>w(E.currentTarget.value),error:Lt(t,T+".given")}),a.jsx(Be,{disabled:e.disabled||p?.readonly,name:e.name+"-family",placeholder:"Family",defaultValue:r?.family,onChange:E=>j(E.currentTarget.value),error:Lt(t,T+".family")}),a.jsx(Be,{disabled:e.disabled||m?.readonly,placeholder:"Suffix",name:e.name+"-suffix",defaultValue:r?.suffix?.join(" "),onChange:E=>C(E.currentTarget.value),error:Lt(t,T+".suffix")})]})}function zW(e){const[t,n]=v.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=v.useContext(un),[l,c]=v.useMemo(()=>["system","value"].map(g=>r[e.path+"."+g]),[r,e.path]),[d,f]=v.useMemo(()=>["system","value"].map(g=>o(e.path+"."+g)),[o,e.path]);function p(g){n(g),e.onChange&&e.onChange(g)}const m=e.valuePath??e.path;return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(Be,{disabled:e.disabled||d?.readonly,placeholder:"System",required:(l?.min??0)>0,defaultValue:t?.system,onChange:g=>p({...t,system:g.currentTarget.value}),error:Lt(e.outcome,m+".system")}),a.jsx(Be,{disabled:e.disabled||f?.readonly,placeholder:"Value",required:(c?.min??0)>0,defaultValue:t?.value,onChange:g=>p({...t,value:g.currentTarget.value}),error:Lt(e.outcome,m+".value")})]})}const $W=["USD","EUR","CAD","GBP","AUD"];function UW(e){const{onChange:t}=e,[n,r]=v.useState(e.defaultValue),{getExtendedProps:o}=v.useContext(un),[l,c]=v.useMemo(()=>["currency","value"].map(g=>o(e.path+"."+g)),[o,e.path]),d=v.useCallback(g=>{r(g),t&&t(g)},[t]),f=v.useCallback(g=>{d({...n,currency:g.currentTarget.value})},[n,d]),p=v.useCallback(g=>{d({...n,value:g.currentTarget.valueAsNumber})},[n,d]),m=a.jsx(cn,{disabled:e.disabled||l?.readonly,defaultValue:n?.currency,data:$W,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:f});return a.jsx(Be,{disabled:e.disabled||c?.readonly,type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:n?.value?.toString()??"USD",leftSection:a.jsx(xH,{size:14}),rightSection:m,rightSectionWidth:92,onChange:p})}function BW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(un),[o,l]=v.useMemo(()=>["start","end"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Eo,{disabled:e.disabled||o?.readonly,name:e.name+".start",placeholder:"Start",defaultValue:t?.start,onChange:d=>c({...t,start:d})}),a.jsx(Eo,{disabled:e.disabled||l?.readonly,name:e.name+".end",placeholder:"End",defaultValue:t?.end,onChange:d=>c({...t,end:d})})]})}function hl(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(un),[o,l,c]=v.useMemo(()=>["comparator","value","unit"].map(f=>r(e.path+"."+f)),[r,e.path]);function d(f){n(f),e.onChange&&e.onChange(f)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(cn,{disabled:e.disabled||o?.readonly,style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t?.comparator,data:["","<","<=",">=",">"],onChange:f=>d({...t,comparator:f.currentTarget.value})}),a.jsx(Be,{disabled:e.disabled||l?.readonly,id:e.name,name:e.name,required:e.required,"data-autofocus":e.autoFocus,"data-testid":e.name+"-value",type:"number",placeholder:"Value",defaultValue:t?.value,autoFocus:e.autoFocus,step:"any",onWheel:f=>{e.disableWheel&&f.currentTarget.blur()},onChange:f=>{d({...t,value:VW(f.currentTarget.value)})}}),a.jsx(Be,{disabled:e.disabled||c?.readonly,placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t?.unit,onChange:f=>d({...t,unit:f.currentTarget.value})})]})}function VW(e){if(e)return parseFloat(e)}function dS(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(un),[o,l]=v.useMemo(()=>["low","high"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(hl,{path:e.path+".low",disabled:e.disabled||o?.readonly,name:e.name+"-low",defaultValue:t?.low,onChange:d=>c({...t,low:d})}),a.jsx(hl,{path:e.path+".high",disabled:e.disabled||l?.readonly,name:e.name+"-high",defaultValue:t?.high,onChange:d=>c({...t,high:d})})]})}function FW(e){const[t,n]=v.useState(e.defaultValue),{getExtendedProps:r}=v.useContext(un),[o,l]=v.useMemo(()=>["numerator","denominator"].map(d=>r(e.path+"."+d)),[r,e.path]);function c(d){n(d),e.onChange&&e.onChange(d)}return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(hl,{path:e.path+".numerator",disabled:e.disabled||o?.readonly,name:e.name+"-numerator",defaultValue:t?.numerator,onChange:d=>c({...t,numerator:d})}),a.jsx(hl,{path:e.path+".denominator",disabled:e.disabled||l?.readonly,name:e.name+"-denominator",defaultValue:t?.denominator,onChange:d=>c({...t,denominator:d})})]})}const HW={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},qW=["AccessPolicy","Account","ActivityDefinition","Bot","CapabilityStatement","CareTeam","ClientApplication","CodeSystem","CompartmentDefinition","ConceptMap","EffectEvidenceSynthesis","Endpoint","EventDefinition","Evidence","EvidenceVariable","ExampleScenario","GraphDefinition","Group","HealthcareService","ImplementationGuide","InsurancePlan","Library","Location","Measure","MedicinalProduct","MessageDefinition","NamingSystem","OperationDefinition","Organization","Patient","Person","PlanDefinition","Practitioner","Project","Questionnaire","RelatedPerson","ResearchDefinition","ResearchElementDefinition","ResearchStudy","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function GW(e){return{value:Nt(e)??"",label:Sa(e),resource:e}}function Rl(e){const t=_e(),{resourceType:n,searchCriteria:r}=e,[o,l]=v.useState(),c=Kt(e.defaultValue,l),d=e.itemComponent??WW,f=e.onChange,p=v.useCallback(async(g,y)=>{const b=QW(n),w=new URLSearchParams({[b]:g??"",_count:"10",...r});return await t.searchResources(n,w,{signal:y})},[t,n,r]),m=v.useCallback(g=>{f&&f(g[0])},[f]);return An(e.defaultValue)&&!o&&!c?null:a.jsx(oS,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:d,defaultValue:c,placeholder:e.placeholder,maxValues:1,toOption:GW,loadOptions:p,onChange:m,clearable:!0})}const WW=v.forwardRef(({label:e,resource:t,active:n,...r},o)=>a.jsx("div",{ref:o,...r,children:a.jsxs(xe,{wrap:"nowrap",children:[a.jsx(js,{value:t}),a.jsxs("div",{children:[a.jsx(Re,{children:e}),a.jsx(Re,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function QW(e){return HW[e]??(qW.includes(e)?"name":"_id")}function fs(e){const{onChange:t}=e,n=_e(),[r,o]=v.useState(e.defaultValue),[l,c]=v.useState(()=>YW(e.targetTypes)),[d,f]=v.useState(()=>KW(e.defaultValue,l)),p=v.useRef(new YD),m=v.useMemo(()=>d?.type==="profile"?{...e.searchCriteria,_profile:d.value}:e.searchCriteria,[e.searchCriteria,d]);v.useEffect(()=>{let b=!1;const w=l?.map(j=>{if(!JW(j))return Promise.resolve(j);b=!0;const C=j.value,T=p.current.get(C);if(T)return T;const E=XW(n,j.value).then(_=>{const k={...j};return _?An(_.type)?(k.resourceType=_.type,k.name=_.name,k.title=_.title):(console.error(`StructureDefinition.type missing for ${j.value}`),k.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${j.value}`),k.error="StructureDefinition not found"),k}).catch(_=>(console.error(_),{...j,error:_})),R=new Wi(E);return p.current.set(C,R),R});!w||!b||Promise.all(w).then(j=>{if(c(j),!d)return;const C=j.findIndex(T=>T.value===d.value||T.resourceType===d.resourceType);if(C===-1){console.debug(`defaultValue had unexpected resourceType: ${d.resourceType}`);return}f(j[C])}).catch(console.error)},[n,d,l]);const g=v.useCallback(b=>{const w=b?Wt(b):void 0;o(w),t&&t(w)},[t]),y=v.useMemo(()=>l?l.map(b=>({value:b.value,label:b.type==="profile"?b.title??b.name??b.resourceType??b.value:b.value})):[],[l]);return a.jsxs(a.Fragment,{children:[e.name&&a.jsx("input",{type:"hidden",name:e.name,value:r?.reference??""}),a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[l&&l.length>1&&a.jsx(cn,{name:e.name+"-resourceType",disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:d?.resourceType,autoFocus:e.autoFocus,onChange:b=>{const w=b.currentTarget.value,j=l.find(C=>C.value===w);f(j)},data:y}),!l&&a.jsx(sS,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:d?.resourceType,onChange:b=>{f(b?{type:"resourceType",value:b,resourceType:b}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),a.jsx(Rl,{resourceType:d?.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:m,onChange:g,disabled:e.disabled})]})]})}function YW(e){if(!e||e.length===0||e.length===1&&e[0]==="Resource")return;const t=[];for(const n of e)n.includes("/")?t.push({type:"profile",value:n}):t.push({type:"resourceType",value:n,resourceType:n});return t}function KW(e,t){const n=e?.reference?.split("/")[0];if(n){const r=t?.find(o=>o.resourceType===n);return r||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function XW(e,t){const n=ru(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
551
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
552
|
+
type,
|
|
553
|
+
name,
|
|
554
|
+
title,
|
|
555
|
+
}
|
|
556
|
+
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function JW(e){return e.type==="profile"&&!e?.error&&bn(e.resourceType)}function ZW(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}const eQ="_indented_ldk1d_1",Ak={indented:eQ};function fS({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?a.jsx(Ae,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:a.jsx(yp,{size:"1.25rem"}),onClick:t,children:r}):a.jsx(En,{title:r,color:"green.6","data-testid":n,onClick:t,children:a.jsx(yp,{size:"1.25rem"})})}function kk({propertyDisplayName:e,onClick:t,testId:n}){return a.jsx(En,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:a.jsx(vp,{size:"1.25rem"})})}function tQ(e){const{slice:t,property:n}=e,[r,o]=v.useState(e.defaultValue),l=t.typeSchema?.elements??t.elements,c=v.useContext(un),d=v.useMemo(()=>{if(An(l))return Vc({parentContext:c,elements:l,path:e.path,profileUrl:t.typeSchema?.url})},[c,e.path,t.typeSchema?.url,l]);function f(b){o(b),e.onChange&&e.onChange(b)}const p=t.min>0,m=bn(t.elements),g=EA(t.name),y=e.property.readonly&&r.length===0;return Im(un.Provider,d,a.jsx(zt,{title:g,description:t.definition,withAsterisk:p,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:y?a.jsx(Re,{c:"dimmed",children:"(empty)"}):a.jsxs(Ue,{className:m?Ak.indented:void 0,children:[r.map((b,w)=>a.jsxs(xe,{wrap:"nowrap",children:[a.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${w}`,children:a.jsx(hS,{elementDefinitionType:t.type[0],name:t.name,defaultValue:b,onChange:j=>{const C=[...r];C[w]=j,f(C)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0,readOnly:e.property.readonly})}),!e.property.readonly&&r.length>t.min&&a.jsx(kk,{propertyDisplayName:g,testId:e.testId&&`${e.testId}-remove-${w}`,onClick:j=>{dn(j);const C=[...r];C.splice(w,1),f(C)}})]},`${w}-${r.length}`)),!e.property.readonly&&r.length<t.max&&a.jsx(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(fS,{propertyDisplayName:g,onClick:b=>{dn(b);const w=[...r,void 0];f(w)},testId:e.testId&&`${e.testId}-add`})})]})}))}function nQ(e){const{property:t}=e,n=_e(),[r,o]=v.useState(!0),[l,c]=v.useState([]),[d]=v.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[f,p]=v.useState(()=>[d]),m=v.useContext(un),g=t.type[0]?.code;v.useEffect(()=>{Ck({medplum:n,property:t}).then(E=>{c(E);const R=jk(d,E,t.slicing,m.profileUrl);rQ(R,E),p(R),o(!1)}).catch(E=>{console.error(E),o(!1)})},[n,t,d,m.profileUrl,p]);function y(E,R){const _=[...f];if(_[R]=E,p(_),e.onChange){const k=_.flat().filter(N=>N!==void 0);e.onChange(k)}}if(r)return a.jsx("div",{children:"Loading..."});const b=l.length,w=f[b],j=!(e.hideNonSliceValues??(g==="Extension"&&l.length>0)),C=ul(t.path),T=e.property.readonly&&l.length===0&&d.length===0;return a.jsxs(Ue,{className:e.indent?Ak.indented:void 0,children:[T&&a.jsx(Re,{c:"dimmed",children:"(empty)"}),l.map((E,R)=>a.jsx(tQ,{slice:E,path:e.path,valuePath:e.valuePath,property:t,defaultValue:f[R],onChange:_=>{y(_,R)},testId:`slice-${E.name}`},E.name)),j&&w.map((E,R)=>a.jsxs(xe,{wrap:"nowrap",style:{flexGrow:1},children:[a.jsx("div",{style:{flexGrow:1},children:a.jsx(Zd,{arrayElement:!0,property:e.property,name:e.name+"."+R,path:e.path,valuePath:ZW(e.path,e.valuePath,R),defaultValue:E,onChange:_=>{const k=[...w];k[R]=_,y(k,b)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&a.jsx(kk,{propertyDisplayName:C,testId:`nonsliced-remove-${R}`,onClick:_=>{dn(_);const k=[...w];k.splice(R,1),y(k,b)}})]},`${R}-${w.length}`)),!e.property.readonly&&j&&f.flat().length<t.max&&a.jsx(xe,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:a.jsx(fS,{propertyDisplayName:C,onClick:E=>{dn(E);const R=[...w];R.push(void 0),y(R,b)},testId:"nonsliced-add"})})]})}function rQ(e,t){for(let n=0;n<t.length;n++){const r=t[n],o=e[n];for(;o.length<r.min;)o.push(void 0)}}function iQ(e){const[t,n]=v.useState(!1),r=a2(),o=v.useRef(null),l={...e.styles};return t||(l.input||(l.input={}),l.input.WebkitTextSecurity="disc"),a.jsxs(_o,{gap:"xs",children:[a.jsx(wl,{...e,styles:{...l,root:{...l.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),a.jsx(En,{title:"Copy secret",onClick:()=>{r.copy(o.current?.value),ke({color:"green",message:"Copied"})},children:a.jsx(tS,{})})]})}const oQ=["sun","mon","tue","wed","thu","fri","sat"];function aQ(e){const[t,n]=v.useState(e.defaultValue),[r,o]=v.useState(!e.disabled&&(e.defaultModalOpen??!1)),l=v.useRef(t);return l.current=t,a.jsxs(a.Fragment,{children:[a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx("span",{children:wA(l.current)||"No repeat"}),a.jsx(Ae,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&a.jsx(sQ,{path:e.path,visible:r,defaultValue:l.current,onOk:c=>{e.onChange&&e.onChange(c),n(c),o(!1)},onCancel:()=>o(!1)})]})}const MT={repeat:{period:1,periodUnit:"d"}};function sQ(e){const[t,n]=v.useState(e.defaultValue||MT),{getExtendedProps:r}=v.useContext(un),[o,l,c,d,f]=v.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(j=>r(e.path+"."+j)),[r,e.path]),p=v.useRef(t);p.current=t;function m(j){n({...p.current,event:[j]})}function g(j){n({...p.current,repeat:j})}function y(j){g({...p.current?.repeat,period:j})}function b(j){g({...p.current?.repeat,periodUnit:j})}function w(j){g({...p.current?.repeat,dayOfWeek:j})}return a.jsx(Gn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:a.jsxs(Ue,{children:[a.jsx(zt,{title:"Starts on",htmlFor:"timing-dialog-start",children:a.jsx(Eo,{disabled:o?.readonly,name:"timing-dialog-start",onChange:j=>m(j)})}),a.jsx(Fd,{disabled:l?.readonly,label:"Repeat",checked:!!t.repeat,onChange:j=>g(j.currentTarget.checked?MT.repeat:void 0)}),t.repeat&&a.jsxs(a.Fragment,{children:[a.jsx(zt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",children:[a.jsx(Be,{disabled:c?.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:j=>y(parseInt(j.currentTarget.value,10)||1)}),a.jsx(cn,{disabled:d?.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:j=>b(j.currentTarget.value),data:[{label:"minute",value:"min"},{label:"hour",value:"h"},{label:"day",value:"d"},{label:"week",value:"wk"},{label:"month",value:"mo"},{label:"year",value:"a"}]})]})}),t.repeat.periodUnit==="wk"&&a.jsx(zt,{title:"Repeat on",children:a.jsx(gd.Group,{multiple:!0,onChange:w,children:a.jsx(xe,{justify:"space-between",mt:"md",gap:"xs",children:oQ.map(j=>a.jsx(gd,{value:j,size:"xs",radius:"xl",disabled:f?.readonly,children:j.charAt(0).toUpperCase()},j))})})})]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ae,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Zd(e){const{property:t,name:n,onChange:r,defaultValue:o}=e,l=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,c=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(l===re.Attachment)return a.jsx(VG,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const d=c[0]?.code!==re.Extension;return a.jsx(nQ,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:d,onChange:r,outcome:e.outcome})}else return c.length>1?a.jsx(lQ,{elementDefinitionTypes:c,...e}):a.jsx(hS,{name:n,defaultValue:o,onChange:d=>{if(e.onChange){const f=e.name.replace("[x]",qn(c[0].code));e.onChange(d,f)}},outcome:e.outcome,elementDefinitionType:c[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function lQ(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(l=>l.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=v.useState(n);return a.jsxs(xe,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[a.jsx(cn,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:l=>{o(t.find(c=>c.code===l.currentTarget.value))},data:t.map(l=>({value:l.code,label:l.code}))}),a.jsx(hS,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:l=>{e.onChange&&e.onChange(l,e.name.replace("[x]",qn(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath,readOnly:e.property.readonly})]})}function hS(e){const{name:t,onChange:n,outcome:r,binding:o,path:l,valuePath:c,readOnly:d}=e,f=e.min!==void 0&&e.min>0,p=e.elementDefinitionType.code,m=v.useContext(un),g=v.useMemo(()=>{if(!L0(p)||!bn(e.defaultValue))return e.defaultValue;const w=Object.create(null);if(m.path===e.path)yT(w,m.elements);else{const j=Zs(m.path,e.path);if(j===void 0)return e.defaultValue;yT(w,m.elements,j)}return An(w)?w:e.defaultValue},[p,m.path,m.elements,e.path,e.defaultValue]);if(!p)return a.jsx("div",{children:"Property type not specified "});function y(){return{name:t,defaultValue:g,onChange:n,outcome:r,path:l,valuePath:c,disabled:d}}function b(){const w=Lt(e.outcome,c??l);return{id:t,name:t,"data-testid":t,defaultValue:g,required:f,error:w,disabled:d}}switch(p){case re.SystemString:case re.canonical:case re.string:case re.time:case re.uri:case re.url:return e.path==="Project.secret.value[x]"?a.jsx(iQ,{...b(),onChange:w=>{e.onChange&&e.onChange(w.currentTarget.value)}}):a.jsx(Be,{...b(),onChange:w=>{n&&n(w.currentTarget.value)}});case re.date:return a.jsx(Be,{...b(),type:"date",onChange:w=>{n&&n(w.currentTarget.value)}});case re.dateTime:case re.instant:return a.jsx(Eo,{...b(),onChange:n,outcome:r});case re.decimal:case re.integer:case re.positiveInt:case re.unsignedInt:return a.jsx(Be,{...b(),type:"number",step:p===re.decimal?"any":"1",onChange:w=>{if(n){const j=w.currentTarget.valueAsNumber;n(Number.isNaN(j)?void 0:j)}}});case re.code:return a.jsx(fk,{...b(),error:void 0,onChange:n,binding:o?.valueSet,creatable:!0,maxValues:1});case re.boolean:return a.jsx(Ln,{...b(),defaultChecked:!!g,onChange:w=>{n&&n(w.currentTarget.checked)}});case re.base64Binary:case re.markdown:return a.jsx(wl,{...b(),spellCheck:p!==re.base64Binary,onChange:w=>{n&&n(w.currentTarget.value)}});case re.Address:return a.jsx(OF,{...y()});case re.Annotation:return a.jsx(NF,{...y()});case re.Attachment:return a.jsx(hk,{...y()});case re.CodeableConcept:return a.jsx(RW,{binding:o?.valueSet,...y()});case re.Coding:return a.jsx(AW,{binding:o?.valueSet,...y()});case re.ContactDetail:return a.jsx(OW,{...y()});case re.ContactPoint:return a.jsx(Dk,{...y()});case re.Extension:return a.jsx(LW,{...y(),propertyType:e.elementDefinitionType});case re.HumanName:return a.jsx(IW,{...y()});case re.Identifier:return a.jsx(zW,{...y()});case re.Money:return a.jsx(UW,{...y()});case re.Period:return a.jsx(BW,{...y()});case re.Duration:case re.Quantity:return a.jsx(hl,{...y()});case re.Range:return a.jsx(dS,{...y()});case re.Ratio:return a.jsx(FW,{...y()});case re.Reference:return a.jsx(fs,{...y(),targetTypes:uQ(e.elementDefinitionType)});case re.Timing:return a.jsx(aQ,{...y()});case re.Dosage:case re.UsageContext:default:return a.jsx(pS,{...y(),typeName:p})}}const cQ=[`${ro}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function uQ(e){return e?.targetProfile?.map(t=>{const n=cQ.find(r=>t.startsWith(r));return n?t.slice(n.length):t})}function dQ(e){const[t,n]=v.useState(e.defaultValue??{}),r=v.useContext(un),o=v.useMemo(()=>PF(r.elements),[r.elements]);function l(d){n(d),e.onChange&&e.onChange(d)}const c={type:e.type,value:t};return a.jsx(Ue,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([d,f])=>{const[p,m]=pW(c,d,f),g=f.min!==void 0&&f.min>0,y=e.valuePath?e.valuePath+"."+d:void 0,b=a.jsx(Zd,{property:f,name:d,path:e.path+"."+d,valuePath:y,defaultValue:p,defaultPropertyType:m,onChange:(w,j)=>{l(EW({...t},d,j??d,f,w))},outcome:e.outcome},d);return e.type==="Extension"||J0.includes(d)?b:f.type.length===1&&f.type[0].code==="boolean"?a.jsx(_k,{title:ul(d),description:f.description,htmlFor:d,fhirPath:f.path,withAsterisk:g,readonly:f.readonly,children:b},d):a.jsx(zt,{title:ul(d),description:f.description,withAsterisk:g,htmlFor:d,outcome:e.outcome,fhirPath:f.path,errorExpression:y,readonly:f.readonly,children:b},d)})})}function pS(e){const[t]=v.useState(()=>e.defaultValue??{}),n=v.useContext(un),r=e.profileUrl??n?.profileUrl,o=v.useMemo(()=>wm(e.typeName,r),[e.typeName,r]),l=o?.type??e.typeName,c=v.useMemo(()=>{if(o)return Vc({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?Im(un.Provider,c,a.jsx(dQ,{path:e.path,valuePath:e.valuePath,type:l,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):a.jsxs("div",{children:[l," not implemented"]})}const fQ="_noteCite_10swh_5",hQ="_noteRoot_10swh_10",LT={noteCite:fQ,noteRoot:hQ};function Pk({value:e}){return e?a.jsx(Ue,{justify:"flex-start",gap:"xs",children:e.map(t=>t.text&&a.jsx(Gb,{classNames:{cite:LT.noteCite,root:LT.noteRoot},cite:t.authorReference?.display||t.authorString,icon:null,children:t.text},`note-${t.text}`))}):null}function _l(e){const{value:t,link:n,...r}=e,[o,l]=v.useState(),c=Kt(t,l);let d;if(o&&!XD(o))d=`[${Ye(o)}]`;else if(c)d=Sa(c);else return null;return n?a.jsx(St,{to:t,...r,children:d}):a.jsx(Re,{component:"span",...r,children:d})}function Ac(e){return a.jsxs(xe,{gap:"xs",children:[a.jsx(js,{size:24,radius:12,value:e.value,link:e.link}),a.jsx(_l,{value:e.value,link:e.link})]})}const pQ={draft:"blue",active:"blue","on-hold":"yellow",revoked:"red",completed:"green","entered-in-error":"red",unknown:"gray",retired:"gray",registered:"blue",preliminary:"blue",final:"green",amended:"yellow",corrected:"yellow",cancelled:"red",requested:"blue",received:"blue",accepted:"blue",rejected:"red",ready:"blue","in-progress":"blue",failed:"red",proposed:"blue",pending:"blue",booked:"blue",arrived:"blue",fulfilled:"green",noshow:"red","checked-in":"blue",waitlist:"gray",routine:"gray",urgent:"red",asap:"red",stat:"red","not-done":"red",connected:"green",disconnected:"red",finished:"green",planned:"gray"};function zm(e){const{status:t,...n}=e;return a.jsx(em,{color:e.color||pQ[t],...n,children:t.replace(/-/g," ")})}const mQ="_table_pe9td_1",gQ="_criticalRow_pe9td_12",Ok={table:mQ,criticalRow:gQ};mS.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1,hideSubject:!1};function mS(e){const t=_e(),n=Kt(e.value),[r,o]=v.useState();if(v.useEffect(()=>{n?.specimen&&Promise.allSettled(n.specimen.map(c=>t.readReference(c))).then(c=>c.filter(d=>d.status==="fulfilled").map(d=>d.value)).then(o).catch(console.error)},[t,n]),!n)return null;const l=r?.flatMap(c=>c.note||[])||[];if(n.presentedForm&&n.presentedForm.length>0){const c=n.presentedForm[0];c.contentType?.startsWith("text/plain")&&c.data&&l.push({text:window.atob(c.data)})}return a.jsxs(Ue,{children:[a.jsx(Le,{children:"Diagnostic Report"}),a.jsx(vQ,{value:n,hideSubject:e.hideSubject}),r&&!e.hideSpecimenInfo&&yQ(r),n.result&&a.jsx(xQ,{hideObservationNotes:e.hideObservationNotes,value:n.result}),l.length>0&&a.jsx(Pk,{value:l})]})}function vQ({value:e,hideSubject:t=!1}){return a.jsxs(xe,{mt:"md",gap:30,children:[e.subject&&!t&&a.jsxs("div",{children:[a.jsx(Re,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),a.jsx(Ac,{value:e.subject,link:!0})]}),e.resultsInterpreter?.map(n=>a.jsxs("div",{children:[a.jsx(Re,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),a.jsx(Ac,{value:n,link:!0})]},n.reference)),e.performer?.map(n=>a.jsxs("div",{children:[a.jsx(Re,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),a.jsx(Ac,{value:n,link:!0})]},n.reference)),e.issued&&a.jsxs("div",{children:[a.jsx(Re,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),a.jsx(Re,{children:wr(e.issued)})]}),e.status&&a.jsxs("div",{children:[a.jsx(Re,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),a.jsx(zm,{status:e.status})]})]})}function yQ(e){return a.jsxs(Ue,{gap:"xs",children:[a.jsx(Le,{order:2,size:"h6",children:"Specimens"}),a.jsx(Dr,{type:"ordered",children:e?.map(t=>a.jsx(Dr.Item,{ml:"sm",children:a.jsxs(xe,{gap:20,children:[a.jsxs(xe,{gap:5,children:[a.jsx(Re,{fw:500,children:"Collected:"})," ",wr(t.collection?.collectedDateTime)]}),a.jsxs(xe,{gap:5,children:[a.jsx(Re,{fw:500,children:"Received:"})," ",wr(t.receivedTime)]})]})},`specimen-${t.id}`))})]})}function xQ(e){return a.jsxs("table",{className:Ok.table,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Test"}),a.jsx("th",{children:"Value"}),a.jsx("th",{children:"Reference Range"}),a.jsx("th",{children:"Interpretation"}),a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Performer"}),a.jsx("th",{children:"Status"})]})}),a.jsx("tbody",{children:a.jsx(Nk,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function Nk(e){return a.jsx(a.Fragment,{children:e.value?.map(t=>a.jsx(bQ,{value:t,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Aa(t)?t.reference:t.id}`))})}function bQ(e){const t=Kt(e.value);if(!t||e.ancestorIds?.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=jQ(t);return a.jsxs(a.Fragment,{children:[a.jsxs("tr",{className:$t({[Ok.criticalRow]:r}),children:[a.jsx("td",{rowSpan:n?2:1,children:a.jsx(St,{to:t,children:a.jsx(Co,{value:t.code})})}),a.jsx("td",{children:a.jsx(SQ,{value:t})}),a.jsx("td",{children:a.jsx(wQ,{value:t.referenceRange})}),a.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&a.jsx(Co,{value:t.interpretation[0]})}),a.jsx("td",{children:t.category&&t.category.length>0&&a.jsx(a.Fragment,{children:t.category.map(o=>a.jsx("div",{children:a.jsx(Co,{value:o})},`category-${ps(o)}`))})}),a.jsx("td",{children:t.performer?.map(o=>a.jsx(bp,{value:o},o.reference))}),a.jsx("td",{children:t.status&&a.jsx(zm,{status:t.status})})]}),t.hasMember&&a.jsx(Nk,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&a.jsx("tr",{children:a.jsx("td",{colSpan:6,children:a.jsx(Pk,{value:t.note})})})]})}function SQ(e){const t=e.value;return a.jsx(a.Fragment,{children:jA(t)})}function wQ(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?a.jsx(a.Fragment,{children:t.text}):a.jsx(cS,{value:t}):null}function jQ(e){const t=e.interpretation?.[0]?.coding?.[0]?.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}var Py={},da={},IT;function Mk(){if(IT)return da;IT=1,Object.defineProperty(da,"__esModule",{value:!0}),da.Pointer=da.escapeToken=da.unescapeToken=void 0;function e(r){return r.replace(/~1/g,"/").replace(/~0/g,"~")}da.unescapeToken=e;function t(r){return r.replace(/~/g,"~0").replace(/\//g,"~1")}da.escapeToken=t;var n=(function(){function r(o){o===void 0&&(o=[""]),this.tokens=o}return r.fromJSON=function(o){var l=o.split("/").map(e);if(l[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(o));return new r(l)},r.prototype.toString=function(){return this.tokens.map(t).join("/")},r.prototype.evaluate=function(o){for(var l=null,c="",d=o,f=1,p=this.tokens.length;f<p;f++)l=d,c=this.tokens[f],!(c=="__proto__"||c=="constructor"||c=="prototype")&&(d=(l||{})[c]);return{parent:l,key:c,value:d}},r.prototype.get=function(o){return this.evaluate(o).value},r.prototype.set=function(o,l){var c=this.evaluate(o);c.parent&&(c.parent[c.key]=l)},r.prototype.push=function(o){this.tokens.push(o)},r.prototype.add=function(o){var l=this.tokens.concat(String(o));return new r(l)},r})();return da.Pointer=n,da}var gn={},Oy={},zT;function Lk(){return zT||(zT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.clone=e.objectType=e.hasOwnProperty=void 0,e.hasOwnProperty=Object.prototype.hasOwnProperty;function t(o){return o===void 0?"undefined":o===null?"null":Array.isArray(o)?"array":typeof o}e.objectType=t;function n(o){return o!=null&&typeof o=="object"}function r(o){if(!n(o))return o;if(o.constructor==Array){for(var l=o.length,c=new Array(l),d=0;d<l;d++)c[d]=r(o[d]);return c}if(o.constructor==Date){var f=new Date(+o);return f}var p={};for(var m in o)e.hasOwnProperty.call(o,m)&&(p[m]=r(o[m]));return p}e.clone=r})(Oy)),Oy}var Rr={},$T;function Ik(){if($T)return Rr;$T=1,Object.defineProperty(Rr,"__esModule",{value:!0}),Rr.diffAny=Rr.diffObjects=Rr.diffArrays=Rr.intersection=Rr.subtract=Rr.isDestructive=void 0;var e=Lk();function t(m){var g=m.op;return g==="remove"||g==="replace"||g==="copy"||g==="move"}Rr.isDestructive=t;function n(m,g){var y={};for(var b in m)e.hasOwnProperty.call(m,b)&&m[b]!==void 0&&(y[b]=1);for(var w in g)e.hasOwnProperty.call(g,w)&&g[w]!==void 0&&delete y[w];return Object.keys(y)}Rr.subtract=n;function r(m){for(var g=m.length,y={},b=0;b<g;b++){var w=m[b];for(var j in w)e.hasOwnProperty.call(w,j)&&w[j]!==void 0&&(y[j]=(y[j]||0)+1)}for(var j in y)y[j]<g&&delete y[j];return Object.keys(y)}Rr.intersection=r;function o(m){return m.op==="add"}function l(m){return m.op==="remove"}function c(m,g){return{operations:m.operations.concat(g),cost:m.cost+1}}function d(m,g,y,b){b===void 0&&(b=p);var w={"0,0":{operations:[],cost:0}};function j(_,k){var N="".concat(_,",").concat(k),A=w[N];if(A===void 0){if(_>0&&k>0&&!b(m[_-1],g[k-1],y.add(String(_-1))).length)A=j(_-1,k-1);else{var P=[];if(_>0){var U=j(_-1,k),B={op:"remove",index:_-1};P.push(c(U,B))}if(k>0){var Y=j(_,k-1),X={op:"add",index:_-1,value:g[k-1]};P.push(c(Y,X))}if(_>0&&k>0){var te=j(_-1,k-1),$={op:"replace",index:_-1,original:m[_-1],value:g[k-1]};P.push(c(te,$))}var W=P.sort(function(L,I){return L.cost-I.cost})[0];A=W}w[N]=A}return A}var C=isNaN(m.length)||m.length<=0?0:m.length,T=isNaN(g.length)||g.length<=0?0:g.length,E=j(C,T).operations,R=E.reduce(function(_,k){var N=_[0],A=_[1];if(o(k)){var P=k.index+1+A,U=P<C+A?String(P):"-",B={op:k.op,path:y.add(U).toString(),value:k.value};return[N.concat(B),A+1]}else if(l(k)){var B={op:k.op,path:y.add(String(k.index+A)).toString()};return[N.concat(B),A-1]}else{var Y=y.add(String(k.index+A)),X=b(k.original,k.value,Y);return[N.concat.apply(N,X),A]}},[[],0])[0];return R}Rr.diffArrays=d;function f(m,g,y,b){b===void 0&&(b=p);var w=[];return n(m,g).forEach(function(j){w.push({op:"remove",path:y.add(j).toString()})}),n(g,m).forEach(function(j){w.push({op:"add",path:y.add(j).toString(),value:g[j]})}),r([m,g]).forEach(function(j){w.push.apply(w,b(m[j],g[j],y.add(j)))}),w}Rr.diffObjects=f;function p(m,g,y,b){if(b===void 0&&(b=p),m===g)return[];var w=(0,e.objectType)(m),j=(0,e.objectType)(g);return w=="array"&&j=="array"?d(m,g,y,b):w=="object"&&j=="object"?f(m,g,y,b):[{op:"replace",path:y.toString(),value:g}]}return Rr.diffAny=p,Rr}var UT;function CQ(){if(UT)return gn;UT=1;var e=gn&&gn.__extends||(function(){var C=function(T,E){return C=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(R,_){R.__proto__=_}||function(R,_){for(var k in _)Object.prototype.hasOwnProperty.call(_,k)&&(R[k]=_[k])},C(T,E)};return function(T,E){if(typeof E!="function"&&E!==null)throw new TypeError("Class extends value "+String(E)+" is not a constructor or null");C(T,E);function R(){this.constructor=T}T.prototype=E===null?Object.create(E):(R.prototype=E.prototype,new R)}})();Object.defineProperty(gn,"__esModule",{value:!0}),gn.apply=gn.InvalidOperationError=gn.test=gn.copy=gn.move=gn.replace=gn.remove=gn.add=gn.TestError=gn.MissingError=void 0;var t=Mk(),n=Lk(),r=Ik(),o=(function(C){e(T,C);function T(E){var R=C.call(this,"Value required at path: ".concat(E))||this;return R.path=E,R.name="MissingError",R}return T})(Error);gn.MissingError=o;var l=(function(C){e(T,C);function T(E,R){var _=C.call(this,"Test failed: ".concat(E," != ").concat(R))||this;return _.actual=E,_.expected=R,_.name="TestError",_}return T})(Error);gn.TestError=l;function c(C,T,E){if(Array.isArray(C))if(T=="-")C.push(E);else{var R=parseInt(T,10);C.splice(R,0,E)}else C[T]=E}function d(C,T){if(Array.isArray(C)){var E=parseInt(T,10);C.splice(E,1)}else delete C[T]}function f(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.parent===void 0?new o(T.path):(c(E.parent,E.key,(0,n.clone)(T.value)),null)}gn.add=f;function p(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return E.value===void 0?new o(T.path):(d(E.parent,E.key),null)}gn.remove=p;function m(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);if(E.parent===null)return new o(T.path);if(Array.isArray(E.parent)){if(parseInt(E.key,10)>=E.parent.length)return new o(T.path)}else if(E.value===void 0)return new o(T.path);return E.parent[E.key]=(0,n.clone)(T.value),null}gn.replace=m;function g(C,T){var E=t.Pointer.fromJSON(T.from).evaluate(C);if(E.value===void 0)return new o(T.from);var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new o(T.path):(d(E.parent,E.key),c(R.parent,R.key,E.value),null)}gn.move=g;function y(C,T){var E=t.Pointer.fromJSON(T.from).evaluate(C);if(E.value===void 0)return new o(T.from);var R=t.Pointer.fromJSON(T.path).evaluate(C);return R.parent===void 0?new o(T.path):(c(R.parent,R.key,(0,n.clone)(E.value)),null)}gn.copy=y;function b(C,T){var E=t.Pointer.fromJSON(T.path).evaluate(C);return(0,r.diffAny)(E.value,T.value,new t.Pointer).length?new l(E.value,T.value):null}gn.test=b;var w=(function(C){e(T,C);function T(E){var R=C.call(this,"Invalid operation: ".concat(E.op))||this;return R.operation=E,R.name="InvalidOperationError",R}return T})(Error);gn.InvalidOperationError=w;function j(C,T){switch(T.op){case"add":return f(C,T);case"remove":return p(C,T);case"replace":return m(C,T);case"move":return g(C,T);case"copy":return y(C,T);case"test":return b(C,T)}return new w(T)}return gn.apply=j,gn}var BT;function EQ(){return BT||(BT=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=Mk();Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=CQ(),r=Ik();function o(p,m){return m.map(function(g){return(0,n.apply)(p,g)})}e.applyPatch=o;function l(p){function m(g,y,b){var w=p(g,y,b);return Array.isArray(w)?w:(0,r.diffAny)(g,y,b,m)}return m}function c(p,m,g){var y=new t.Pointer;return(g?l(g):r.diffAny)(p,m,y)}e.createPatch=c;function d(p,m){var g=t.Pointer.fromJSON(m).evaluate(p);if(g!==void 0)return{op:"test",path:m,value:g.value}}function f(p,m){var g=new Array;return m.filter(r.isDestructive).forEach(function(y){var b=d(p,y.path);if(b&&g.push(b),"from"in y){var w=d(p,y.from);w&&g.push(w)}}),g}e.createTests=f})(Py)),Py}var zk=EQ();const TQ="_removed_el5zk_1",RQ="_added_el5zk_6",VT={removed:TQ,added:RQ};function _Q(e){const{name:t,path:n,property:r,originalValue:o,revisedValue:l}=e,c=!!r?.type?.find(m=>m.code==="Attachment"),[d,f]=v.useState(c),p=()=>f(m=>!m);return a.jsx(a.Fragment,{children:c&&!d||!c?a.jsx(a.Fragment,{children:a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:t}),a.jsx(he.Td,{className:VT.removed,children:o&&a.jsx(no,{path:n,property:r,propertyType:o.type,value:o.value,ignoreMissingValues:!0})}),a.jsx(he.Td,{className:VT.added,children:l&&a.jsx(no,{path:n,property:r,propertyType:l.type,value:l.value,ignoreMissingValues:!0})})]})}):a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:t}),a.jsx(he.Td,{colSpan:2,style:{textAlign:"right"},children:a.jsx(Ae,{onClick:p,variant:"light",children:"Expand"})})]})})}const DQ="_root_15xvr_1",AQ={root:DQ};function kQ(e){const t=_e(),{original:n,revised:r}=e,[o,l]=v.useState(!1);v.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>l(!0)).catch(console.log)},[t,e.original.resourceType]);const c=v.useMemo(()=>{if(!o)return null;const d=[ci(n)],f=[ci(r)],p=[],m=PQ(zk.createPatch(n,r));for(const g of m){const y=g.path,b=OQ(y),w=NQ(n.resourceType,b),j=g.op==="add"?void 0:ms(b,d),C=g.op==="remove"?void 0:ms(b,f);p.push({key:`op-${g.op}-${g.path}`,name:`${qn(g.op)} ${b}`,path:w?.path??n.resourceType+"."+b,property:w,originalValue:FT(w,j),revisedValue:FT(w,C)})}return p},[o,n,r]);return c?a.jsxs(he,{className:AQ.root,children:[a.jsx(he.Thead,{children:a.jsxs(he.Tr,{children:[a.jsx(he.Th,{}),a.jsx(he.Th,{children:"Before"}),a.jsx(he.Th,{children:"After"})]})}),a.jsx(he.Tbody,{children:c.map(d=>{const{key:f,...p}=d;return a.jsx(_Q,{...p},f)})})]}):null}function PQ(e){const t=[];for(const n of e){const{op:r,path:o}=n;if(o.startsWith("/meta/author")||o.startsWith("/meta/compartment")||o.startsWith("/meta/lastUpdated")||o.startsWith("/meta/versionId"))continue;const l=e.filter(d=>d.op===r&&d.path===o).length,c={op:r,path:o};l>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(c.op="replace",c.path=o.replace(/\/[^/]+$/,"")),t.some(d=>d.op===c.op&&d.path===c.path)||t.push(c)}return t}function OQ(e){const t=e.split("/").filter(Boolean);let n="";for(let r=0;r<t.length;r++){const o=t[r];o==="-"?n+=".last()":/^\d+$/.test(o)?n+=`[${o}]`:(r>0&&(n+="."),n+=o)}return n.endsWith(".url")&&(n=n.replace(/\.url$/,"")),n}function NQ(e,t){try{return Dm(e,{resourceType:"SearchParameter",base:[e],code:e+"."+t,expression:e+"."+t})?.elementDefinitions?.[0]}catch(n){console.warn("Failed to get element definition",{resourceType:e,fhirPath:t,err:n});return}}function FT(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:MQ(t,!!e?.isArray)}}function MQ(e,t){const n=yU(e).flatMap(r=>r.value);return t?n:n[0]}function gS(e){const{profileUrl:t}=e,n=_e(),r=n.getAccessPolicy(),o=Kt(e.value),[l,c]=v.useState(!1);v.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{ru(t)?c(!0):console.error(`Schema not found for ${t}`)}).catch(f=>{console.error("Error in requestProfileSchema",f)});else{const f=o.resourceType;n.requestSchema(f).then(()=>{c(!0)}).catch(console.error)}},[n,t,o]);const d=v.useMemo(()=>o&&AA(o,tl.READ,r),[r,o]);return!l||!o?null:a.jsx(Sp,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:d})}const LQ="_item_5q6yx_1",IQ="_itemPadding_5q6yx_5",HT={item:LQ,itemPadding:IQ};function zQ(e){return a.jsx(ou,{children:e.children})}function pl(e){const{resource:t,profile:n,padding:r,popupMenuItems:o,...l}=e,c=n??t.meta?.author,d=e.dateTime??t.meta?.lastUpdated;return a.jsxs(Tl,{"data-testid":"timeline-item",fill:!0,...l,children:[a.jsxs(xe,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[a.jsx(js,{value:c,link:!0,size:"md"}),a.jsxs("div",{style:{flex:1},children:[a.jsx(Re,{size:"sm",children:a.jsx(_l,{c:"dark",fw:500,value:c,link:!0})}),a.jsxs(Re,{size:"xs",children:[a.jsx(St,{c:"dimmed",to:e.resource,children:wr(d)}),a.jsx(Re,{component:"span",c:"dimmed",mx:8,children:"·"}),a.jsx(St,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&a.jsxs(we,{position:"bottom-end",shadow:"md",width:200,children:[a.jsx(we.Target,{children:a.jsx(En,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${Nt(e.resource)}`,children:a.jsx(EH,{})})}),o]})]}),a.jsx(ak,{children:a.jsx("div",{className:$t(HT.item,{[HT.itemPadding]:r}),children:e.children})})]})}function $k(e,t){e.sort((n,r)=>{const o=qT(n,t),l=qT(r,t);return o>l?1:o<l?-1:GT(n,t)-GT(r,t)})}function qT(e,t){if(!Uk(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function GT(e,t){if(!Uk(e,t)){if(e.resourceType==="Communication"&&e.sent)return new Date(e.sent).getTime();if((e.resourceType==="DiagnosticReport"||e.resourceType==="Media"||e.resourceType==="Observation")&&e.issued)return new Date(e.issued).getTime();if(e.resourceType==="DocumentReference"&&e.date)return new Date(e.date).getTime()}const n=e.meta?.lastUpdated;return n?new Date(n).getTime():0}function Uk(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const $Q="_pinnedComment_u08s5_1",UQ={pinnedComment:$Q};function $m(e){const t=_e(),n=t.getProfile(),r=v.useRef(null),o=Kt(e.value),[l,c]=v.useState(),[d,f]=v.useState([]),[p,m]=v.useState(10),g=e.loadTimelineResources,y=v.useRef(d);y.current=d;const b=v.useCallback(A=>{$k(A,o),A.reverse(),f(A)},[o]),w=v.useCallback(A=>{const P=[];for(const U of A){if(U.status!=="fulfilled")continue;const B=U.value;if(B.type==="history"&&c(B),B.entry)for(const Y of B.entry)P.push(Y.resource)}b(P)},[b]),j=v.useCallback(A=>b([...y.current,A]),[b]),C=v.useCallback(()=>{let A,P;"resourceType"in e.value?(A=e.value.resourceType,P=e.value.id):[A,P]=e.value.reference?.split("/"),g(t,A,P).then(w).catch(console.error)},[t,e.value,g,w]);v.useEffect(()=>C(),[C]);function T(A){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,A)).then(P=>j(P)).catch(console.error)}function E(A){!o||!e.createMedia||t.createResource(e.createMedia(o,n,A)).then(P=>j(P)).then(()=>Xs({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:a.jsx(zo,{size:16}),autoClose:2e3})).catch(P=>Xs({id:"upload-notification",color:"red",title:"Upload error",message:Ye(P),icon:a.jsx(ET,{size:16}),autoClose:2e3}))}function R(){ke({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function _(A){Xs({id:"upload-notification",loading:!0,title:"Uploading...",message:WQ(A),autoClose:!1,withCloseButton:!1})}function k(A){Xs({id:"upload-notification",color:"red",title:"Upload error",message:Ye(A),icon:a.jsx(ET,{size:16}),autoClose:2e3})}if(!o)return a.jsx(fr,{style:{width:"100%",height:"100%"},children:a.jsx(Gr,{})});const N=d.filter(A=>A).slice(0,p);return a.jsxs(zQ,{children:[e.createCommunication&&a.jsx(Tl,{children:a.jsx(ft,{testid:"timeline-form",onSubmit:A=>{T(A.text);const P=r.current;P&&(P.value="",P.focus())},children:a.jsxs(xe,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[a.jsx(js,{value:n}),a.jsx(Be,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),a.jsx(En,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:a.jsx(JH,{size:16})}),a.jsx(lS,{securityContext:Wt(o),onUpload:E,onUploadStart:R,onUploadProgress:_,onUploadError:k,children:A=>a.jsx(En,{...A,radius:"xl",color:"blue",variant:"filled",children:a.jsx(eS,{size:16})})})]})})}),N.map(A=>{const P=`${A.resourceType}/${A.id}/${A.meta?.versionId}`,U=e.getMenu?e.getMenu({primaryResource:o,currentResource:A,reloadTimeline:C}):void 0;if(A.resourceType===o.resourceType&&A.id===o.id)return a.jsx(BQ,{history:l,resource:A,popupMenuItems:U},P);switch(A.resourceType){case"AuditEvent":return a.jsx(qQ,{resource:A,popupMenuItems:U},P);case"Communication":return a.jsx(FQ,{resource:A,popupMenuItems:U},P);case"DiagnosticReport":return a.jsx(GQ,{resource:A,popupMenuItems:U},P);case"Media":return a.jsx(HQ,{resource:A,popupMenuItems:U},P);default:return a.jsx(pl,{resource:A,padding:!0,children:a.jsx(gS,{value:A,ignoreMissingValues:!0})},P)}}),p<d.length&&a.jsx(xe,{justify:"center",pb:"lg",children:a.jsx(Ae,{onClick:()=>m(p+10),children:"Show More"})})]})}function BQ(e){const{history:t,resource:n,...r}=e,o=VQ(t,n);return o?a.jsx(pl,{resource:n,padding:!0,...r,children:a.jsx(kQ,{original:o,revised:e.resource})}):a.jsxs(pl,{resource:n,padding:!0,...r,children:[a.jsx("h3",{children:"Created"}),a.jsx(gS,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function VQ(e,t){const n=e.entry??[],r=n.findIndex(o=>o.resource?.meta?.versionId===t.meta?.versionId);if(!(r>=n.length-1))return n[r+1].resource}function FQ(e){const n=!e.resource.priority||e.resource.priority==="routine"?void 0:UQ.pinnedComment;return a.jsx(pl,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:a.jsx("p",{children:e.resource.payload?.[0]?.contentString})})}function HQ(e){const t=e.resource.content?.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return a.jsx(pl,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:a.jsx(Jd,{value:e.resource.content})})}function qQ(e){return a.jsx(pl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(fi,{children:a.jsx("pre",{children:e.resource.outcomeDesc})})})}function GQ(e){return a.jsx(pl,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:a.jsx(mS,{value:e.resource})})}function WQ(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Ny(e.loaded)} / ${Ny(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Ny(e.loaded)}`}function Ny(e){if(e===0)return"0.00 B";const t=Math.floor(Math.log(e)/Math.log(1024));return(e/Math.pow(1024,t)).toFixed(2)+" "+" KMGTP".charAt(t)+"B"}function QQ(e){const{resource:t,...n}=e;return a.jsx($m,{value:t,loadTimelineResources:async(r,o,l)=>{const c=`${o}/${l}`;return Promise.allSettled([r.readHistory(o,l),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:100})])},...n})}function YQ(e){const{encounter:t,...n}=e;return a.jsx($m,{value:t,loadTimelineResources:async(r,o,l)=>Promise.allSettled([r.readHistory("Encounter",l),r.search("Communication","encounter=Encounter/"+l),r.search("Media","encounter=Encounter/"+l)]),createCommunication:(r,o,l)=>({resourceType:"Communication",status:"completed",encounter:Wt(r),subject:r.subject,sender:Wt(o),sent:new Date().toISOString(),payload:[{contentString:l}]}),createMedia:(r,o,l)=>({resourceType:"Media",status:"completed",encounter:Wt(r),subject:r.subject,operator:Wt(o),issued:new Date().toISOString(),content:l}),...n})}function KQ(e){let t;try{t=dB(e.path,e.resource)}catch(n){return console.warn("FhirPathDisplay:",n),null}if(t.length>1)throw new Error(`Component "path" for "FhirPathDisplay" must resolve to a single element. Received ${t.length} elements [${JSON.stringify(t,null,2)}]`);return a.jsx(no,{value:t[0]||"",propertyType:e.propertyType})}function XQ(e){return a.jsxs(Gn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[a.jsxs(ue,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&a.jsx(WT,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&a.jsx(WT,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),a.jsx(Re,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function WT(e){return a.jsx(Ae,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const JQ={string:[fe.EQUALS,fe.NOT,fe.CONTAINS,fe.EXACT],fulltext:[fe.EQUALS,fe.NOT,fe.CONTAINS,fe.EXACT],token:[fe.EQUALS,fe.NOT],reference:[fe.EQUALS,fe.NOT],numeric:[fe.EQUALS,fe.NOT_EQUALS,fe.GREATER_THAN,fe.LESS_THAN,fe.GREATER_THAN_OR_EQUALS,fe.LESS_THAN_OR_EQUALS],quantity:[fe.EQUALS,fe.NOT_EQUALS,fe.GREATER_THAN,fe.LESS_THAN,fe.GREATER_THAN_OR_EQUALS,fe.LESS_THAN_OR_EQUALS],date:[fe.EQUALS,fe.NOT_EQUALS,fe.GREATER_THAN,fe.LESS_THAN,fe.GREATER_THAN_OR_EQUALS,fe.LESS_THAN_OR_EQUALS,fe.STARTS_AFTER,fe.ENDS_BEFORE,fe.APPROXIMATELY],datetime:[fe.EQUALS,fe.NOT_EQUALS,fe.GREATER_THAN,fe.LESS_THAN,fe.GREATER_THAN_OR_EQUALS,fe.LESS_THAN_OR_EQUALS,fe.STARTS_AFTER,fe.ENDS_BEFORE,fe.APPROXIMATELY],uri:[fe.EQUALS,fe.NOT,fe.ABOVE,fe.BELOW]},ZQ={eq:"equals",ne:"not equals",gt:"greater than",lt:"less than",ge:"greater than or equals",le:"less than or equals",sa:"starts after",eb:"ends before",ap:"approximately",sw:"starts with",contains:"contains",exact:"exact",text:"text",not:"not",above:"above",below:"below",in:"in","not-in":"not in","of-type":"of type",missing:"missing",present:"present",identifier:"identifier",iterate:"iterate"};function vS(e,t){return{...e,filters:t,offset:0,name:void 0}}function Bk(e,t){return vS(e,(e.filters??[]).filter(n=>n.code!==t))}function Um(e,t,n,r,o){const l=[];return e.filters&&l.push(...e.filters),l.push({code:t,operator:n,value:r??""}),vS(e,l)}function eY(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function tY(e,t){return yS(e,t,-1)}function nY(e,t){return yS(e,t,0)}function rY(e,t){return yS(e,t,1)}function yS(e,t,n){const r=new Date;r.setDate(r.getDate()+n),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setDate(o.getDate()+1),o.setTime(o.getTime()-1),Bm(e,t,r,o)}function iY(e,t){const n=new Date,r=new Date(n.getTime()+1440*60*1e3);return Bm(e,t,n,r)}function oY(e,t){return xS(e,t,-1)}function aY(e,t){return xS(e,t,0)}function sY(e,t){return xS(e,t,1)}function xS(e,t,n){const r=new Date;r.setMonth(r.getMonth()+n),r.setDate(1),r.setHours(0,0,0,0);const o=new Date(r.getTime());return o.setMonth(o.getMonth()+1),o.setDate(1),o.setHours(0,0,0,0),o.setTime(o.getTime()-1),Bm(e,t,r,o)}function lY(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),Bm(e,t,n,new Date)}function Bm(e,t,n,r){return e=Bk(e,t),e=QT(e,t,fe.GREATER_THAN_OR_EQUALS,n),e=QT(e,t,fe.LESS_THAN_OR_EQUALS,r),e}function QT(e,t,n,r){return Um(e,t,n,r.toISOString())}function YT(e,t,n=!0){return Um(e,t,fe.MISSING,n.toString())}function cY(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function uY(e,t){const n=e.count??Em,r=(t-1)*n;return cY(e,r)}function dY(e,t,n){return t===fY(e)&&n!==void 0&&n===hY(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function fY(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function hY(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function pY(e){return JQ[e.type]}function Vk(e){return ZQ[e]??""}function ml(e){let t=e;return t.includes(".")&&(t=t.split(".").pop()),t==="versionId"?"Version ID":(t=t.replace("[x]",""),t=t.replace(/([A-Z])/g," $1"),t=t.replace(/[-_]/g," "),t=t.replace(/\s+/g," "),t=t.trim(),t.toLowerCase()==="id"?"ID":t.split(/\s/).map(qn).join(" "))}function mY(e,t){const n=t.name;return n==="id"?a.jsx(St,{to:`/${e.resourceType}/${e.id}`,children:e.id}):n==="meta.versionId"?e.meta?.versionId:n==="_lastUpdated"?wr(e.meta?.lastUpdated):`${e.resourceType}.${t.name}`===t.elementDefinition?.path?gY(e,t.elementDefinition):t.searchParams?.length===1&&t.name===t.searchParams[0].code?vY(e,t.searchParams[0]):null}function gY(e,t){const n=t.path?.split(".")?.pop()?.replaceAll("[x]","")??"",[r,o]=Lm({type:e.resourceType,value:e},n);return r?a.jsx(no,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function vY(e,t){const n=ms(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:a.jsx(a.Fragment,{children:n.map((r,o)=>a.jsx(no,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function yY(e){const t=v.useRef(!1),[n,r]=v.useState({search:JSON.parse(to(e.search))}),[o,l]=v.useState(!1);v.useEffect(()=>{r({search:e.search})},[e.search]);const c=v.useMemo(()=>{if(!e.visible)return[];const f=e.search.resourceType,p=rA(f),m=z0(f);return Bc(xY(p,m)).map(g=>({value:g,label:ml(g)}))},[e.visible,e.search.resourceType]);function d(f){r({search:{...n.search,fields:f}})}return a.jsx(Gn,{title:"Fields",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>{e.onCancel()},size:"auto",withOverlay:!0,closeOnClickOutside:!1,overlayProps:{onMouseDownCapture:()=>{t.current=o},onClick:()=>{t.current||e.onCancel(),t.current=!1},children:a.jsx("div",{"data-testid":"overlay-child"})},children:a.jsxs(Ue,{children:[a.jsx(dm,{style:{width:550},placeholder:"Select fields to display",data:c,value:n.search.fields??[],onChange:d,onDropdownOpen:()=>l(!0),onDropdownClose:()=>l(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ae,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function xY(e,t){const n=[],r=new Set,o=new Set;for(const l of Object.keys(e.elements))n.push(l),r.add(l.toLowerCase()),o.add(ml(l));if(t)for(const l of Object.keys(t)){const c=ml(l);!r.has(l)&&!o.has(c)&&(n.push(l),r.add(l),o.add(c))}return n}function Fk(e){const t=Dm(e.resourceType,e.searchParam),n=e.name??"filter-value";switch(t.type){case yr.REFERENCE:return a.jsx(fs,{name:n,defaultValue:e.defaultValue?{reference:e.defaultValue}:void 0,targetTypes:e.searchParam.target,autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(r.reference):e.onChange("")}});case yr.BOOLEAN:return a.jsx(Ln,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultChecked:e.defaultValue==="true",autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.checked.toString())});case yr.DATE:return a.jsx(Be,{type:"date",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case yr.DATETIME:return a.jsx(Eo,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case yr.NUMBER:return a.jsx(Be,{type:"number",name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value)});case yr.QUANTITY:return a.jsx(hl,{name:n,path:"",defaultValue:bY(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return a.jsx(Be,{name:n,"data-autofocus":e.autoFocus,"data-testid":n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:r=>e.onChange(r.currentTarget.value),placeholder:"Search value"})}}function bY(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function SY(e){const[t,n]=v.useState(ui(e.search)),r=v.useRef(t);r.current=t,v.useEffect(()=>{n(ui(e.search))},[e.search]);function o(f){n(Um(r.current,f.code,f.operator,f.value))}const l=e.search.resourceType,c=z0(l)??{},d=t.filters||[];return a.jsx(Gn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:a.jsxs(ft,{onSubmit:()=>e.onOk(r.current),children:[a.jsxs("div",{children:[a.jsxs("table",{children:[a.jsxs("colgroup",{children:[a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:200}}),a.jsx("col",{style:{width:380}}),a.jsx("col",{style:{width:40}})]}),a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Field"}),a.jsx("th",{children:"Operation"}),a.jsx("th",{children:"Value"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:d.map((f,p)=>a.jsx(wY,{id:`filter-${p}-row`,resourceType:l,searchParams:c,value:f,onChange:m=>{const g=[...d];g[p]=m,n(vS(r.current,g))},onDelete:()=>n(eY(r.current,p))},`filter-${p}-row`))})]}),a.jsx(fS,{propertyDisplayName:"Filter",onClick:()=>o({})})]}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(jr,{children:"OK"})})]})})}function wY(e){const t=e.value,n=v.useRef(t);n.current=t;function r(f){n.current.code=f,n.current.operator=fe.EQUALS,n.current.value="",e.onChange(n.current)}function o(f){n.current.operator=f,n.current.value="",e.onChange(n.current)}function l(f){n.current.value=f,e.onChange(n.current)}const c=e.searchParams[t.code],d=c&&pY(c);return a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(cn,{"data-testid":`${e.id}-filter-field`,defaultValue:e.value.code,onChange:f=>r(f.currentTarget.value),data:["",...Object.keys(e.searchParams).map(f=>({value:f,label:ml(f)}))]})}),a.jsx("td",{children:d&&a.jsx(cn,{"data-testid":`${e.id}-filter-operation`,defaultValue:t.operator,onChange:f=>o(f.currentTarget.value),data:["",...d.map(f=>({value:f,label:Vk(f)}))]},`${e.id}-filter-value-${e.value.code}`)}),a.jsx("td",{children:c&&t.operator&&a.jsx(Fk,{name:`${e.id}-filter-value`,resourceType:e.resourceType,searchParam:c,defaultValue:t.value,onChange:l},`${e.id}-filter-value-${e.value.code}-${e.value.operator}`)}),a.jsx("td",{children:e.onDelete&&a.jsx(En,{variant:"outline",color:"red",radius:"xl","aria-label":"Delete filter",onClick:e.onDelete,children:a.jsx(fl,{style:{width:"70%",height:"70%"},stroke:1.5})})})]})}function jY(e){const[t,n]=v.useState(e.defaultValue??"");if(!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return a.jsx(Gn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:a.jsx(ft,{onSubmit:r,children:a.jsxs(br,{children:[a.jsx(br.Col,{span:10,children:a.jsx(Fk,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),a.jsx(br.Col,{span:2,children:a.jsx(Ae,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function CY(e){const{resourceType:t,filter:n}=e,r=Ao.types[t].searchParams?.[n.code];if(r){if(r.type==="reference"&&(n.operator===fe.EQUALS||n.operator===fe.NOT_EQUALS))return a.jsx(_l,{value:{reference:n.value}});const o=Dm(t,r);if(n.code==="_lastUpdated"||o.type===yr.DATETIME)return a.jsx(a.Fragment,{children:wr(n.value)})}return a.jsx(a.Fragment,{children:n.value})}function EY(e){if(!e.searchParams)return null;function t(l,c){o(dY(e.search,l.code,c))}function n(l){o(Bk(e.search,l.code))}function r(l,c){e.onPrompt(l,{code:l.code,operator:c,value:""})}function o(l){e.onChange(l)}return e.searchParams.length===1?a.jsx(TY,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):a.jsx(we.Dropdown,{children:e.searchParams.map(l=>a.jsx(we.Item,{children:ml(l.code)},l.code))})}function TY(e){switch(e.searchParam.type){case"date":return a.jsx(RY,{...e});case"number":case"quantity":return a.jsx(_Y,{...e});case"reference":return a.jsx(DY,{...e});case"string":return a.jsx(AY,{...e});case"token":case"uri":return a.jsx(kY,{...e});default:return a.jsxs(a.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function RY(e){const{searchParam:t}=e,n=t.code;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(nS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),a.jsx(we.Item,{leftSection:a.jsx(rS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(Xd,{size:14}),onClick:()=>e.onPrompt(t,fe.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(Kd,{size:14}),onClick:()=>e.onPrompt(t,fe.NOT_EQUALS),children:"Does not equal..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(rk,{size:14}),onClick:()=>e.onPrompt(t,fe.ENDS_BEFORE),children:"Before..."}),a.jsx(we.Item,{leftSection:a.jsx(nk,{size:14}),onClick:()=>e.onPrompt(t,fe.STARTS_AFTER),children:"After..."}),a.jsx(we.Item,{leftSection:a.jsx(KF,{size:14}),onClick:()=>e.onPrompt(t,fe.EQUALS),children:"Between..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(rY(e.search,n)),children:"Tomorrow"}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(nY(e.search,n)),children:"Today"}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(tY(e.search,n)),children:"Yesterday"}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(iY(e.search,n)),children:"Next 24 Hours"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(sY(e.search,n)),children:"Next Month"}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(aY(e.search,n)),children:"This Month"}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(oY(e.search,n)),children:"Last Month"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(rs,{size:14}),onClick:()=>e.onChange(lY(e.search,n)),children:"Year to date"}),a.jsx(ef,{...e})]})}function _Y(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(nS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),a.jsx(we.Item,{leftSection:a.jsx(rS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(Xd,{size:14}),onClick:()=>e.onPrompt(t,fe.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(Kd,{size:14}),onClick:()=>e.onPrompt(t,fe.NOT_EQUALS),children:"Does not equal..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(nk,{size:14}),onClick:()=>e.onPrompt(t,fe.GREATER_THAN),children:"Greater than..."}),a.jsx(we.Item,{leftSection:a.jsx(Tx,{size:14}),onClick:()=>e.onPrompt(t,fe.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),a.jsx(we.Item,{leftSection:a.jsx(rk,{size:14}),onClick:()=>e.onPrompt(t,fe.LESS_THAN),children:"Less than..."}),a.jsx(we.Item,{leftSection:a.jsx(Tx,{size:14}),onClick:()=>e.onPrompt(t,fe.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),a.jsx(ef,{...e})]})}function DY(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(Xd,{size:14}),onClick:()=>e.onPrompt(t,fe.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(Kd,{size:14}),onClick:()=>e.onPrompt(t,fe.NOT),children:"Does not equal..."}),a.jsx(ef,{...e})]})}function AY(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(nS,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),a.jsx(we.Item,{leftSection:a.jsx(rS,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(Xd,{size:14}),onClick:()=>e.onPrompt(t,fe.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(Kd,{size:14}),onClick:()=>e.onPrompt(t,fe.NOT),children:"Does not equal..."}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(nH,{size:14}),onClick:()=>e.onPrompt(t,fe.CONTAINS),children:"Contains..."}),a.jsx(we.Item,{leftSection:a.jsx(eH,{size:14}),onClick:()=>e.onPrompt(t,fe.EQUALS),children:"Does not contain..."}),a.jsx(ef,{...e})]})}function kY(e){const{searchParam:t}=e;return a.jsxs(we.Dropdown,{children:[a.jsx(we.Item,{leftSection:a.jsx(Xd,{size:14}),onClick:()=>e.onPrompt(t,fe.EQUALS),children:"Equals..."}),a.jsx(we.Item,{leftSection:a.jsx(Kd,{size:14}),onClick:()=>e.onPrompt(t,fe.NOT),children:"Does not equal..."}),a.jsx(ef,{...e})]})}function ef(e){const{searchParam:t}=e,n=t.code;return a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(GF,{size:14}),onClick:()=>e.onChange(YT(e.search,n)),children:"Missing"}),a.jsx(we.Item,{leftSection:a.jsx(HF,{size:14}),onClick:()=>e.onChange(YT(e.search,n,!1)),children:"Not missing"}),a.jsx(we.Divider,{}),a.jsx(we.Item,{leftSection:a.jsx(fl,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}function Hk(e){switch(e){case"next":return{"aria-label":"Next page"};case"previous":return{"aria-label":"Previous page"};case"first":return{"aria-label":"First page"};case"last":return{"aria-label":"Last page"};default:return{}}}const PY="_root_vlout_1",OY="_table_vlout_8",NY="_tr_vlout_12",MY="_control_vlout_22",LY="_icon_vlout_31",ed={root:PY,table:OY,tr:NY,control:MY,icon:LY};function IY(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(zY(t,r));return n}function zY(e,t){if(t==="_lastUpdated")return{name:"_lastUpdated",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_lastUpdated",name:"_lastUpdated",type:"date",expression:"Resource.meta.lastUpdated"}]};if(t==="meta.versionId")return{name:"meta.versionId",searchParams:[{resourceType:"SearchParameter",base:["Resource"],code:"_versionId",name:"_versionId",type:"token",expression:"Resource.meta.versionId"}]};const n=ws(e,t),r=MU(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const o=z0(e);let l;if(o){const c=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);l=Object.values(o).filter(d=>!!d.expression&&c.test(d?.expression)),l.length===0&&(l=void 0)}return{name:t,elementDefinition:n,searchParams:l}}if(r){const o=Dm(e,r);return{name:t,elementDefinition:o.elementDefinitions?.[0],searchParams:[r]}}return{name:t}}class $Y extends Event{definition;constructor(t){super("change"),this.definition=t}}class UY extends Event{response;constructor(t){super("load"),this.response=t}}class wp extends Event{resource;browserEvent;constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function su(e){const t=_e(),[n,r]=v.useState(),{search:o,onLoad:l}=e,[c,d]=v.useState(o);Do(o,c)||d(o);const[f,p]=v.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),m=v.useRef(f);m.current=f;const g=c.total??"accurate",y=v.useCallback($=>{r(void 0),t.requestSchema(c.resourceType).then(()=>t.search(c.resourceType,us({...c,total:g,fields:void 0}),$)).then(W=>{p({...m.current,searchResponse:W}),l&&l(new UY(W))}).catch(W=>{p({...m.current,searchResponse:void 0}),r(Yt(W))})},[t,c,g,l]),b=v.useCallback(()=>{p({...m.current,searchResponse:void 0}),y({cache:"reload"})},[y]);v.useEffect(()=>{y()},[y]);function w($,W){$.stopPropagation();const I=$.target.checked,z={...m.current.selected};I?z[W]=!0:delete z[W],p({...m.current,selected:z})}function j($){$.stopPropagation();const L=$.target.checked,I={},z=m.current.searchResponse;L&&z?.entry&&z.entry.forEach(V=>{V.resource?.id&&(I[V.resource.id]=!0)}),p({...m.current,selected:I})}function C(){const $=m.current;if(!$.searchResponse?.entry||$.searchResponse.entry.length===0)return!1;for(const W of $.searchResponse.entry)if(W.resource?.id&&!$.selected[W.resource.id])return!1;return!0}function T($){e.onChange&&e.onChange(new $Y($))}function E($,W){if(lk($.target)||$.button===2)return;dn($);const L=sk($);!L&&e.onClick&&e.onClick(new wp(W,$)),L&&e.onAuxClick&&e.onAuxClick(new wp(W,$))}function R(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return a.jsx(Cr,{outcome:n});if(!nA(c.resourceType))return a.jsx(fr,{style:{width:"100%",height:"100%"},children:a.jsx(Gr,{})});const _=e.checkboxesEnabled,k=IY(c),N=c.resourceType,A=f.searchResponse,U=A?.entry?.map($=>$.resource),B="subtle",Y="gray",X=16,te=window.innerWidth<768;return a.jsxs("div",{className:ed.root,"data-testid":"search-control",children:[!e.hideToolbar&&a.jsxs(xe,{justify:"space-between",mb:"xl",children:[a.jsxs(xe,{gap:2,children:[a.jsx(Ae,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(gH,{size:X}),onClick:()=>p({...m.current,fieldEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Fields"}),a.jsx(Ae,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(IH,{size:X}),onClick:()=>p({...m.current,filterEditorVisible:!0,dialogOpenTime:Date.now()}),children:"Filters"}),e.onNew&&a.jsx(Ae,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(MH,{size:X}),onClick:e.onNew,children:"New..."}),!te&&R()&&a.jsx(Ae,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(Oq,{size:X}),onClick:e.onExport?e.onExport:()=>p({...m.current,exportDialogVisible:!0,dialogOpenTime:Date.now()}),children:"Export..."}),!te&&e.onDelete&&a.jsx(Ae,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(Om,{size:X}),onClick:()=>e.onDelete(Object.keys(f.selected)),children:"Delete..."}),!te&&e.onBulk&&a.jsx(Ae,{size:"compact-md",variant:B,color:Y,leftSection:a.jsx(QF,{size:X}),onClick:()=>e.onBulk(Object.keys(f.selected)),children:"Bulk..."})]}),a.jsxs(xe,{gap:2,children:[A&&a.jsxs(Re,{size:"xs",c:"dimmed","data-testid":"count-display",children:[qk(c,A).toLocaleString(),"-",HY(c,A).toLocaleString(),A.total!==void 0&&` of ${c.total==="estimate"?"~":""}${A.total?.toLocaleString()}`]}),a.jsx(En,{variant:B,color:Y,title:"Refresh",onClick:b,children:a.jsx(ok,{size:X})})]})]}),a.jsxs(he,{className:ed.table,children:[a.jsxs(he.Thead,{children:[a.jsxs(he.Tr,{children:[_&&a.jsx(he.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:$=>j($)})}),k.map($=>a.jsx(he.Th,{children:a.jsxs(we,{shadow:"md",width:240,position:"bottom-end",children:[a.jsx(we.Target,{children:a.jsx(ar,{className:ed.control,p:2,children:a.jsxs(xe,{justify:"space-between",wrap:"nowrap",children:[a.jsx(Re,{fw:500,children:ml($.name)}),a.jsx(fr,{className:ed.icon,children:a.jsx(IF,{size:14,stroke:1.5})})]})})}),a.jsx(EY,{search:c,searchParams:$.searchParams,onPrompt:(W,L)=>{p({...m.current,filterDialogVisible:!0,filterDialogSearchParam:W,filterDialogFilter:L,dialogOpenTime:Date.now()})},onChange:W=>{T(W)}})]})},$.name))]}),!e.hideFilters&&a.jsxs(he.Tr,{children:[_&&a.jsx(he.Th,{}),k.map($=>a.jsx(he.Th,{children:$.searchParams&&a.jsx(BY,{resourceType:N,searchParams:$.searchParams,filters:c.filters})},$.name))]})]}),a.jsx(he.Tbody,{children:U?.map($=>$&&a.jsxs(he.Tr,{className:ed.tr,"data-testid":"search-control-row",onClick:W=>E(W,$),onAuxClick:W=>E(W,$),children:[_&&a.jsx(he.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${$.id}`,checked:!!f.selected[$.id],onChange:W=>w(W,$.id)})}),k.map(W=>a.jsx(he.Td,{children:mY($,W)},W.name))]},$.id))})]}),!U?.length&&a.jsx(ou,{children:a.jsx(fr,{style:{height:150},children:a.jsx(Re,{size:"xl",c:"dimmed",children:"No results"})})}),A&&a.jsx(fr,{m:"md",p:"md",children:a.jsx(zi,{value:VY(c),total:FY(c,A),onChange:$=>T(uY(c,$)),getControlProps:Hk})}),a.jsx(yY,{search:c,visible:m.current.fieldEditorVisible,onOk:$=>{T($),p({...m.current,fieldEditorVisible:!1})},onCancel:()=>{p({...m.current,fieldEditorVisible:!1})}},`search-field-editor-${f.dialogOpenTime}`),a.jsx(SY,{search:c,visible:m.current.filterEditorVisible,onOk:$=>{T($),p({...m.current,filterEditorVisible:!1})},onCancel:()=>{p({...m.current,filterEditorVisible:!1})}},`search-filter-editor-${f.dialogOpenTime}`),a.jsx(XQ,{visible:m.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{p({...m.current,exportDialogVisible:!1})}},`search-export-dialog-${f.dialogOpenTime}`),a.jsx(jY,{visible:m.current.filterDialogVisible,title:f.filterDialogSearchParam?.code?ml(f.filterDialogSearchParam.code):"",resourceType:N,searchParam:f.filterDialogSearchParam,filter:f.filterDialogFilter,defaultValue:"",onOk:$=>{T(Um(c,$.code,$.operator,$.value)),p({...m.current,filterDialogVisible:!1})},onCancel:()=>{p({...m.current,filterDialogVisible:!1})}},`search-filter-dialog-${f.dialogOpenTime}`)]})}function BY(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?a.jsx("span",{children:"no filters"}):a.jsx(a.Fragment,{children:t.map(n=>a.jsxs("div",{children:[Vk(n.operator)," ",a.jsx(CY,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function VY(e){return Math.floor((e.offset??0)/(e.count??Em))+1}function FY(e,t){const n=e.count??Em,r=Gk(e,t);return Math.ceil(r/n)}function qk(e,t){return Math.min(Gk(e,t),(e.offset??0)+1)}function HY(e,t){return Math.max(qk(e,t)+(t.entry?.length??0)-1,0)}function Gk(e,t){let n=t.total;return n===void 0&&(n=(e.offset??0)+(t.entry?.length??0)+(t.link?.some(r=>r.relation==="next")?1:0)),n}function qY(e){const t=_e(),[n,r]=v.useState(!1),[o,l]=v.useState(),{query:c,fields:d}=e,[f,p]=v.useState(),[m,g]=v.useState({}),y=v.useRef(f);y.current=f;const b=v.useRef({});b.current=m,v.useEffect(()=>{l(void 0),t.graphql(c).then(p).catch(R=>l(Yt(R)))},[t,c]);function w(R,_){R.stopPropagation();const N=R.target.checked,A={...b.current};N?A[_]=!0:delete A[_],g(A)}function j(R){R.stopPropagation();const k=R.target.checked,N={},A=y.current?.data.ResourceList;k&&A&&A.forEach(P=>{P.id&&(N[P.id]=!0)}),g(N)}function C(){const R=y.current?.data.ResourceList;if(!R||R.length===0)return!1;for(const _ of R)if(_.id&&!b.current[_.id])return!1;return!0}function T(R,_){lk(R.target)||(dn(R),R.button!==1&&e.onClick&&e.onClick(new wp(_,R)),R.button===1&&e.onAuxClick&&e.onAuxClick(new wp(_,R)))}if(v.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return a.jsx(Gr,{});const E=e.checkboxesEnabled;return a.jsxs("div",{onContextMenu:R=>dn(R),"data-testid":"search-control",children:[a.jsxs(he,{children:[a.jsx(he.Thead,{children:a.jsxs(he.Tr,{children:[E&&a.jsx(he.Th,{children:a.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:C(),onChange:R=>j(R)})}),d.map(R=>a.jsx(he.Th,{children:R.name},R.name))]})}),a.jsx(he.Tbody,{children:f?.data.ResourceList.map(R=>R&&a.jsxs(he.Tr,{"data-testid":"search-control-row",onClick:_=>T(_,R),onAuxClick:_=>T(_,R),children:[E&&a.jsx(he.Td,{children:a.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${R.id}`,checked:!!m[R.id],onChange:_=>w(_,R.id)})}),d.map(_=>a.jsx(he.Td,{children:a.jsx(KQ,{propertyType:_.propertyType,path:_.fhirPath,resource:R})},_.name))]},R.id))})]}),f?.data.ResourceList.length===0&&a.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&a.jsx("div",{"data-testid":"search-error",children:a.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&a.jsx(Ae,{onClick:()=>e.onBulk(Object.keys(b.current)),children:"Bulk..."})]})}const GY=v.memo(qY),WY="_root_1fbwr_1",QY="_entry_1fbwr_8",YY="_key_1fbwr_13",KY="_value_1fbwr_20",Vm={root:WY,entry:QY,key:YY,value:KY};function yt(e){return a.jsx(fi,{children:a.jsx("div",{className:Vm.root,children:e.children})})}yt.Entry=function(t){return a.jsx("div",{className:Vm.entry,children:t.children})};yt.Key=function(t){return a.jsx("div",{className:Vm.key,children:t.children})};yt.Value=function(t){return a.jsx("div",{className:Vm.value,children:t.children})};function XY(e){const{group:t}=e;return a.jsx(Ar,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:a.jsxs(xe,{children:[t.measureScore&&a.jsx(eK,{group:t}),!t.measureScore&&a.jsx(ZY,{group:t})]})})}function JY(e){const{measure:t}=e;return a.jsxs(a.Fragment,{children:[a.jsx(Re,{fz:"md",fw:500,mb:8,children:t.title}),a.jsx(Re,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function ZY(e){const{group:t}=e,n=t.population,r=n?.find(f=>ps(f.code)==="numerator"),o=n?.find(f=>ps(f.code)==="denominator"),l=r?.count,c=o?.count;if(c===0)return a.jsxs(ue,{children:[a.jsx(Le,{order:3,children:"Not Applicable"}),a.jsx(Re,{children:`Denominator: ${c}`})]});if(l===void 0||c===void 0)return a.jsxs(ue,{children:[a.jsx(Le,{order:3,children:"Insufficient Data"}),a.jsx(Re,{children:`Numerator: ${l}`}),a.jsx(Re,{children:`Denominator: ${c}`})]});const d=l/c*100;return a.jsx(ym,{size:120,thickness:12,roundCaps:!0,sections:[{value:d,color:Wk(d)}],label:a.jsx(_o,{justify:"center",children:a.jsxs(Re,{fw:700,fz:18,children:[l," / ",c]})})})}function eK(e){const{group:t}=e,n=t.measureScore?.unit??t.measureScore?.code;return a.jsx(a.Fragment,{children:n==="%"?a.jsx(ym,{size:120,thickness:12,roundCaps:!0,sections:[{value:tK(t),color:Wk(t?.measureScore?.value??0)}],label:a.jsx(_o,{justify:"center",children:a.jsx(Re,{fw:700,fz:18,children:a.jsx(jd,{value:t.measureScore})})})}):a.jsx(_o,{h:120,align:"center",children:a.jsx(Le,{order:3,children:a.jsx(jd,{value:t.measureScore})})})})}function tK(e){const t=e.measureScore?.value,n=e.measureScore?.unit;return t?t<=1&&n==="%"?t*100:t:0}function Wk(e){return e<=33?"red":e<=67?"yellow":"green"}function nK(e){const t=Kt(e.measureReport),[n]=DF("Measure",{url:t?.measure});return t?a.jsxs(ue,{children:[n&&a.jsx(JY,{measure:n}),a.jsx(xm,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:t.group?.map((r,o)=>a.jsx(XY,{group:r},r.id??o))})]}):null}const My="patient-export",Ly="Patient Export",rK={everything:{operation:"$everything",extension:"json",contentType:on.FHIR_JSON},summary:{operation:"$summary",extension:"json",contentType:on.FHIR_JSON},ccda:{operation:"$ccda-export",extension:"xml",contentType:on.CDA_XML},ccdaReferral:{operation:"$ccda-export",type:"referral",extension:"xml",contentType:on.CDA_XML}};function iK(e){const t=_e(),{patient:n}=e,r=v.useCallback(async o=>{const l=ll(n),c=o.format,{operation:d,type:f,contentType:p,extension:m}=rK[c],g=t.fhirUrl("Patient",l,d),y={};f&&(y.type=f),o.author&&(y.author={reference:o.author}),o.authoredOn&&(y.authoredOn=uS(o.authoredOn)),o.startDate&&(y.start=o.startDate),o.endDate&&(y.end=o.endDate),Di.show({id:My,title:Ly,loading:!0,message:"Exporting...",autoClose:!1,withCloseButton:!1});try{const b=await t.post(g,y,void 0,{cache:"no-cache",headers:{Accept:p}}),w=`Patient-export-${l}-${new Date().toISOString().replaceAll(":","-")}.${m}`;oK(b,w,p),Di.update({id:My,title:Ly,color:"green",message:"Done",icon:a.jsx(zo,{size:"1rem"}),loading:!1,autoClose:!0,withCloseButton:!0})}catch(b){Di.update({id:My,title:Ly,color:"red",message:Ye(b),icon:a.jsx(fl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}},[t,n]);return a.jsx(ft,{onSubmit:r,children:a.jsxs(Ue,{children:[a.jsx(zt,{title:"Export Format",description:"Required",withAsterisk:!0,children:a.jsx(Vd,{name:"format",data:[{label:"FHIR Everything",value:"everything"},{label:"Patient Summary",value:"summary"},{label:"C-CDA",value:"ccda"},{label:"C-CDA Referral",value:"ccdaReferral"}],fullWidth:!0})}),a.jsx(zt,{title:"Author",description:"Optional author for composition. Default value is current user.",children:a.jsx(fs,{name:"author",placeholder:"Author",targetTypes:["Organization","Practitioner","PractitionerRole"]})}),a.jsx(zt,{title:"Authored On",description:"Optional date for composition authored on. Default value is current date.",children:a.jsx(Eo,{name:"authoredOn",placeholder:"Authored on"})}),a.jsx(zt,{title:"Start Date",description:"The start date of care. If no start date is provided, all records prior to the end date are in scope.",children:a.jsx(Eo,{name:"startDate",placeholder:"Start date"})}),a.jsx(zt,{title:"End Date",description:"The end date of care. If no end date is provided, all records subsequent to the start date are in scope.",children:a.jsx(Eo,{name:"endDate",placeholder:"End date"})}),a.jsx(xe,{justify:"right",children:a.jsx(jr,{children:"Request Export"})})]})})}function oK(e,t,n){const r=typeof e=="string"?e:JSON.stringify(e,null,2),o=new Blob([r],{type:n}),l=window.URL.createObjectURL(o),c=document.createElement("a");document.body.appendChild(c),c.style.display="none",c.href=l,c.download=t,c.click(),window.URL.revokeObjectURL(l)}function aK(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function Qk(e){const t=Kt(e.patient);return t?a.jsxs(yt,{children:[a.jsx(js,{value:t,size:"lg",color:aK(t)}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Name"}),a.jsx(yt.Value,{children:a.jsx(St,{to:t,fw:500,children:t.name?a.jsx(iS,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&a.jsxs(a.Fragment,{children:[a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"DoB"}),a.jsx(yt.Value,{children:t.birthDate})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Age"}),a.jsx(yt.Value,{children:oU(t.birthDate)})]})]}),t.gender&&a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Gender"}),a.jsx(yt.Value,{children:t.gender})]}),t.address&&a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"State"}),a.jsx(yt.Value,{children:t.address[0]?.state})]}),t.identifier?.map(n=>a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:n?.system}),a.jsx(yt.Value,{children:n?.value})]},`${n?.system}-${n?.value}`))]}):null}function sK(e){const{patient:t,...n}=e,r=v.useCallback((o,l,c)=>{const d=`${l}/${c}`,f=100;return Promise.allSettled([o.readHistory("Patient",c),o.search("Communication",{subject:d,_count:f}),o.search("Device",{patient:d,_count:f}),o.search("DeviceRequest",{patient:d,_count:f}),o.search("DiagnosticReport",{subject:d,_count:f}),o.search("Media",{subject:d,_count:f}),o.search("ServiceRequest",{subject:d,_count:f}),o.search("Task",{subject:d,_count:f})])},[]);return a.jsx($m,{value:t,loadTimelineResources:r,createCommunication:(o,l,c)=>({resourceType:"Communication",status:"completed",subject:Wt(o),sender:Wt(l),sent:new Date().toISOString(),payload:[{contentString:c}]}),createMedia:(o,l,c)=>({resourceType:"Media",status:"completed",subject:Wt(o),operator:Wt(l),issued:new Date().toISOString(),content:c}),...n})}const lK="_section_pqpwm_1",cK="_hovering_pqpwm_7",Dx={section:lK,hovering:cK};function uK(e){const t=_e(),n=Kt(e.value),[r,o]=v.useState(!1),[l,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){f(void 0)}function y(){c(void 0)}const b=v.useRef(p);if(b.current=p,v.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(m(mK(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]),!r||!p)return null;function w(j,C){m({...b.current,[j]:C})}return a.jsx("div",{children:a.jsxs(ft,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(p),children:[a.jsx(Be,{label:"Plan Title",py:"md",defaultValue:p.title,onChange:j=>w("title",j.currentTarget.value)}),a.jsx(dK,{actions:p.action||[],selectedKey:l,setSelectedKey:c,hoverKey:d,setHoverKey:f,onChange:j=>w("action",j)}),a.jsx(jr,{children:"Save"})]})})}function dK(e){const t=v.useRef(e.actions);t.current=e.actions;function n(l){e.onChange(t.current.map(c=>c.id===l.id?l:c))}function r(l){e.onChange([...t.current,l]),e.setSelectedKey(l.id)}function o(l){e.onChange(t.current.filter(c=>c!==l))}return a.jsxs(Ue,{gap:"md",className:Dx.section,children:[e.actions.map(l=>a.jsx(fK,{action:l,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(l)},l.id)),a.jsx("div",{children:a.jsx(Ae,{variant:"outline",onClick:l=>{dn(l),r({id:Yk()})},children:"Add action"})})]})}function fK(e){const{action:t}=e,n=pK(t);function r(l){l.stopPropagation(),e.setSelectedKey(e.action.id)}function o(l){dn(l),e.setHoverKey(e.action.id)}return a.jsx("div",{onClick:r,onMouseOver:o,onFocus:o,children:a.jsx(hK,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,hoverKey:e.hoverKey,onRemove:e.onRemove})})}function hK(e){const{action:t}=e,[n,r]=v.useState(e.actionType),o=e.selectedKey===e.action.id,l=e.hoverKey===e.action.id;function c(f,p){e.onChange({...t,[f]:p})}const d=$t(Dx.section,{[Dx.hovering]:l&&!o});return a.jsxs(Ar,{"data-testid":t.id,className:d,p:0,radius:"sm",withBorder:!0,children:[a.jsxs(_o,{w:"100%",p:"xs",bg:"gray.0",gap:"md",align:"center",justify:"space-between",children:[a.jsx(Be,{w:"100%",name:`actionTitle-${t.id}`,defaultValue:t.title,placeholder:"Title",onChange:f=>c("title",f.currentTarget.value)}),a.jsx(ys,{"data-testid":"close-button",onClick:e.onRemove})]}),o&&a.jsxs(Ue,{gap:"xl",p:"md",children:[a.jsx(ue,{children:a.jsx(Be,{label:"Task Description",placeholder:"Enter task description",name:`actionDescription-${t.id}`,defaultValue:t.description,onChange:f=>c("description",f.currentTarget.value)})}),a.jsx(ue,{children:a.jsx(cn,{label:"Type of Action",value:n,onChange:f=>{const p=f.currentTarget.value==="standard"?void 0:f.currentTarget.value;r(p),e.onChange({...e.action,definitionCanonical:p==="standard"?void 0:e.action.definitionCanonical})},data:[{value:"standard",label:"Standard task"},{value:"questionnaire",label:"Task with Questionnaire"},{value:"activitydefinition",label:"Task with Activity Definition"}]})}),n==="questionnaire"&&a.jsxs(Ue,{gap:0,children:[a.jsxs(xe,{gap:0,mb:"xs",children:[a.jsx(Re,{fw:600,children:"Select questionnaire"}),a.jsx(Re,{c:"red",children:"*"})]}),a.jsxs(Re,{size:"sm",c:"dimmed",mb:"sm",children:["Questionnaire to be shown in the task in Encounter view. You can create new one from"," ",a.jsx(Mt,{href:"/Questionnaire",target:"_blank",c:"blue",children:"questionnaires list"})]}),a.jsx(KT,{resourceType:"Questionnaire",action:t,onChange:e.onChange})]}),n==="activitydefinition"&&a.jsxs(Ue,{gap:0,children:[a.jsxs(xe,{gap:0,mb:"xs",children:[a.jsx(Re,{fw:600,children:"Select activity definition"}),a.jsx(Re,{c:"red",children:"*"})]}),a.jsxs(Re,{size:"sm",c:"dimmed",mb:"sm",children:["ActivityDefinition.kind resource to be shown in the task in Encounter view. You can create new one from"," ",a.jsx(Mt,{href:"/ActivityDefinition",target:"_blank",c:"blue",children:"activity definitions list"})]}),a.jsx(KT,{resourceType:"ActivityDefinition",action:t,onChange:e.onChange})]})]})]})}function KT(e){const{id:t,definitionCanonical:n}=e.action,r=n?.startsWith(e.resourceType+"/")?{reference:n}:void 0;return a.jsx(Rl,{name:t,resourceType:e.resourceType,defaultValue:r,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:Nt(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function pK(e){return e.definitionCanonical?.startsWith("Questionnaire")?"questionnaire":e.definitionCanonical?.startsWith("ActivityDefinition")?"activitydefinition":"standard"}let Iy=1;function Yk(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(Iy=Math.max(Iy,t+1))}return e}return"id-"+Iy++}function mK(e){return{...e,action:Kk(e.action)}}function Kk(e){if(e)return e.map(t=>({...t,id:Yk(t.id),action:Kk(t.action)}))}const ol=30,jp=50;function Cp(e){const t=e.formState,n=e.item,r=e.responseItem;function o(g){t&&e.context&&t.onChangeAnswer(e.context,e.item,g)}const l=n.type;if(!l)return null;const c=n.linkId;if(!c)return null;let d;n.initial&&n.initial.length>0?d=n.initial[0]:n.answerOption&&n.answerOption.length>0&&(d=n.answerOption.find(g=>g.initialSelected));const f=SS(r,e.index)??X0(d),p=Lo(r,`${ro}/fhir/StructureDefinition/questionnaire-validationError`);let m=null;switch(l){case Et.display:m=a.jsx("p",{children:e.item.text},e.item.linkId);break;case Et.boolean:m=a.jsx(_k,{title:e.item.text,htmlFor:e.item.linkId,children:a.jsx(Ln,{id:e.item.linkId,name:e.item.linkId,required:e.required??n.required,defaultChecked:f?.value,onChange:g=>o([{valueBoolean:g.currentTarget.checked}])})},e.item.linkId);break;case Et.decimal:m=a.jsx(Be,{type:"number",step:"any",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueDecimal:g.currentTarget.valueAsNumber}])});break;case Et.integer:m=a.jsx(Be,{type:"number",step:1,id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o(g.currentTarget.value===""?[]:[{valueInteger:g.currentTarget.valueAsNumber}])});break;case Et.date:m=a.jsx(Be,{type:"date",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDate:g.currentTarget.value}])});break;case Et.dateTime:m=a.jsx(Eo,{name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueDateTime:g}])});break;case Et.time:m=a.jsx(Be,{type:"time",id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueTime:g.currentTarget.value}])});break;case Et.string:case Et.url:m=a.jsx(Be,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const y=g.currentTarget.value;o(y===""?[]:[{valueString:y}])}});break;case Et.text:m=a.jsx(wl,{id:c,name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>{const y=g.currentTarget.value;o(y===""?[]:[{valueString:y}])}});break;case Et.attachment:m=a.jsx(xe,{py:4,children:a.jsx(hk,{path:"",name:c,defaultValue:f?.value,onChange:g=>o([{valueAttachment:g}])})});break;case Et.reference:m=a.jsx(fs,{name:c,required:e.required??n.required,targetTypes:QA(n),searchCriteria:xF(n,t?.subject,t?.encounter),defaultValue:f?.value,onChange:g=>o([{valueReference:g}])});break;case Et.quantity:m=a.jsx(hl,{path:"",name:c,required:e.required??n.required,defaultValue:f?.value,onChange:g=>o([{valueQuantity:g}]),disableWheel:!0});break;case Et.choice:case Et.openChoice:wK(n)?m=a.jsx(xK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):SK(n)||n.answerValueSet&&!jK(n)?m=a.jsx(gK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)}):m=a.jsx(yK,{name:c,item:n,required:e.required??n.required,initial:d,response:r,onChangeAnswer:g=>o(g)});break;default:return null}return a.jsxs(a.Fragment,{children:[m,p?.valueString&&a.jsx(Re,{c:"red",size:"lg",mt:4,children:p.valueString})]})}function gK(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:l,response:c}=e;if(!n.answerOption?.length&&!n.answerValueSet)return a.jsx(bS,{});const d=X0(o),f=SS(c)??d,p=Zk(c),m=n.repeats||CK(n);if(n.answerValueSet)return a.jsx(Nm,{name:t,placeholder:"Select items",binding:n.answerValueSet,maxValues:m?void 0:1,required:r,onChange:g=>{m?g.length===0?l([{}]):l(g.map(y=>({valueCoding:y}))):l([{valueCoding:g[0]}])},defaultValue:f?.value});if(m){const{propertyName:g,data:y}=EK(n);return a.jsx(dm,{data:y,placeholder:"Select items",searchable:!0,defaultValue:p||[cl(d)],required:r,onChange:b=>{if(b.length===0)l([{}]);else{const w=GA(b,g,n);l(w)}}})}else{const g=[""];if(n.answerOption)for(const y of n.answerOption){const b=ko(y);g.push(cl(b))}return a.jsx(cn,{id:t,name:t,required:r,onChange:y=>{const b=y.currentTarget.selectedIndex;if(b===0){l([{}]);return}const w=n.answerOption[b-1],j=ko(w),C="value"+qn(j.type);l([{[C]:j.value}])},defaultValue:Yd(f?.value)||f?.value,data:g})}}function vK(e,t){return e?t.valueSetExpand({url:e,count:ol+1}).then(n=>n.expansion?.contains??[]):Promise.resolve([])}function Xk(e){const t=_e(),[n,r]=v.useState([]),[o,l]=v.useState(!1);return v.useEffect(()=>{async function c(){if(e){l(!0);try{const d=await vK(e,t);r(d)}catch(d){console.error("Error loading value set:",d)}finally{l(!1)}}}c().catch(console.error)},[e,t]),[n,o]}function Jk(e,t){return e.map((n,r)=>{const o=`${t}-valueset-${r}`,l={type:"Coding",value:{system:n.system,code:n.code,display:n.display}};return[o,l]})}function yK(e){const{name:t,item:n,required:r,initial:o,onChangeAnswer:l,response:c}=e,d=ws("QuestionnaireItemAnswerOption","value[x]"),f=X0(o),[p,m]=Xk(n.answerValueSet),g=[];let y;if(n.answerValueSet)g.push(...Jk(p,t));else if(n.answerOption){const C=n.answerOption.slice(0,jp).map((T,E)=>{const R=`${t}-option-${E}`,_=ko(T);return _?.value?(f&&to(_)===to(f)&&(y=R),[R,_]):null}).filter(T=>T!==null);g.push(...C)}const b=SS(c),w=bK(g,b);if(m)return a.jsx(Re,{children:"Loading options..."});if(g.length===0)return a.jsx(bS,{});const j=g.slice(0,ol);return a.jsxs(a.Fragment,{children:[a.jsx(vr.Group,{name:t,value:w??y,required:r,onChange:C=>{const T=g.find(E=>E[0]===C);if(T){const E=T[1],R="value"+qn(E.type);l([{[R]:E.value}])}},children:j.map(([C,T])=>a.jsx(vr,{id:C,value:C,py:4,required:r,label:a.jsx(no,{property:d,propertyType:T.type,value:T.value})},C))}),(n.answerValueSet&&g.length>ol||n.answerOption&&g.length>jp)&&a.jsxs(Re,{size:"sm",c:"dimmed",mt:"xs",children:["Showing first ",ol," options"]})]})}function xK(e){const{name:t,item:n,onChangeAnswer:r,response:o}=e,l=ws("QuestionnaireItemAnswerOption","value[x]"),[c,d]=Xk(n.answerValueSet),f=n.answerValueSet?(o?.answer?.map(w=>w.valueCoding)||[]).filter(w=>w!==void 0):Zk(o),[p,m]=v.useState(f),g=[];if(n.answerValueSet)g.push(...Jk(c,t));else if(n.answerOption){const w=n.answerOption.slice(0,jp).map((j,C)=>{const T=`${t}-option-${C}`,E=ko(j);return E?.value?[T,E]:null}).filter(j=>j!==null);g.push(...w)}if(d)return a.jsx(Re,{children:"Loading options..."});if(g.length===0)return a.jsx(bS,{});const y=g.slice(0,ol),b=(w,j)=>{if(n.answerValueSet){const C=p;let T;j?T=[...C,w.value]:T=C.filter(E=>!Do(E,w.value)),m(T),T.length===0?r([{}]):r(T.map(E=>({valueCoding:E})))}else{const C=p,T=cl(w);let E;if(j?E=[...C,T]:E=C.filter(R=>R!==T),m(E),E.length===0)r([{}]);else{const R=GA(E,"value"+qn(w.type),n);r(R)}}};return a.jsxs(xe,{style:{flexDirection:"column",alignItems:"flex-start"},children:[y.map(([w,j])=>{const C=cl(j),T=n.answerValueSet?p.some(E=>Do(E,j.value)):p.includes(C);return a.jsx(Ln,{id:w,label:a.jsx(no,{property:l,propertyType:j.type,value:j.value}),checked:T,onChange:E=>b(j,E.currentTarget.checked)},w)}),(n.answerValueSet&&g.length>ol||n.answerOption&&g.length>jp)&&a.jsxs(Re,{size:"sm",c:"dimmed",children:["Showing first ",ol," options"]})]})}function bS(){return a.jsx(Be,{disabled:!0,placeholder:"No Answers Defined"})}function SS(e,t=0){return ko(e?.answer?.[t]??{})}function Zk(e){const t=e?.answer;return t?t.map(r=>ko(r)).map(r=>Yd(r?.value)||r?.value).filter(Boolean):[]}function bK(e,t){return e.find(n=>Do(n[1].value,t?.value))?.[0]}function Fm(e,t){return!!e.extension?.some(n=>n.url===Y0&&n.valueCodeableConcept?.coding?.[0]?.code===t)}function SK(e){return Fm(e,"drop-down")}function wK(e){return Fm(e,"check-box")}function jK(e){return Fm(e,"radio-button")}function CK(e){return Fm(e,"multi-select")}function EK(e){if(e.answerOption?.length===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=ko(t),r="value"+qn(n.type),o=(e.answerOption??[]).map(l=>{const c=ko(l),d=cl(c);return{value:d,label:d}});return{propertyName:r,data:o}}const TK="_section_my8o4_1",RK="_hovering_my8o4_10",_K="_editing_my8o4_14",DK="_questionBody_my8o4_20",AK="_topActions_my8o4_24",kK="_bottomActions_my8o4_33",PK="_movementActions_my8o4_44",OK="_movementIcons_my8o4_56",NK="_columnAlignment_my8o4_60",MK="_linkIdInput_my8o4_65",LK="_typeSelect_my8o4_70",IK="_preserveBreaks_my8o4_74",oi={section:TK,hovering:RK,editing:_K,questionBody:DK,topActions:AK,bottomActions:kK,movementActions:PK,movementIcons:OK,columnAlignment:NK,linkIdInput:MK,typeSelect:LK,preserveBreaks:IK};function zK(e){const t=_e(),n=Kt(e.questionnaire),[r,o]=v.useState(!1),[l,c]=v.useState(),[d,f]=v.useState(),[p,m]=v.useState();function g(){m(void 0)}function y(){f(void 0)}v.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),v.useEffect(()=>(c(VK(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",g),document.addEventListener("click",y),()=>{document.removeEventListener("mouseover",g),document.removeEventListener("click",y)}),[n]);const b=(w,j)=>{c(w),e.autoSave&&!j&&e.onSubmit&&e.onSubmit(w)};return!r||!l?null:a.jsx("div",{children:a.jsxs(ft,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(l),children:[a.jsx(eP,{item:l,selectedKey:d,setSelectedKey:f,hoverKey:p,setHoverKey:m,onChange:b}),a.jsx(jr,{children:"Save"})]})})}function eP(e){const t=e.item,n=e.item,r=Io(e.item),o=r||n.type===Et.group,l=n.linkId??"[untitled]",c=e.selectedKey===e.item.id,d=e.hoverKey===e.item.id,f=v.useRef(e.item);f.current=e.item;function p(R){dn(R),e.setSelectedKey(e.item.id)}function m(R){dn(R),e.setHoverKey(e.item.id)}function g(R){const _=f.current;e.onChange({..._,item:_.item?.map(k=>k.id===R.id?R:k)})}function y(R,_){e.onChange({...e.item,item:[...e.item.item??[],R]},_)}function b(R){e.onChange({...e.item,item:e.item.item?.filter(_=>_!==R)})}function w(R,_){e.onChange({...f.current,[R]:_})}function j(R){e.onChange({...e.item,...R})}function C(R){e.onChange({...e.item,item:e.item.item?.map(_=>_===R?{..._,repeats:!_.repeats}:_)})}function T(R,_){const k=qK(e.item.item,R,_);e.onChange({...e.item,item:k})}const E=$t(oi.section,{[oi.editing]:c,[oi.hovering]:d&&!c});return a.jsxs("div",{"data-testid":n.linkId,className:E,onClick:p,onMouseOver:m,onFocus:m,children:[a.jsx("div",{className:oi.questionBody,children:c?a.jsxs(a.Fragment,{children:[r&&a.jsx(Be,{size:"xl",defaultValue:t.title,onBlur:R=>w("title",R.currentTarget.value)}),!r&&a.jsx(wl,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:R=>w("text",R.currentTarget.value)}),n.type==="reference"&&a.jsx(BK,{item:n,onChange:j}),cF(n)&&a.jsx($K,{item:n,onChange:R=>j(R)})]}):a.jsxs(a.Fragment,{children:[t.title&&a.jsx(Le,{children:t.title}),n.text&&a.jsx("div",{className:oi.preserveBreaks,children:n.text}),!o&&a.jsx(Cp,{item:n,index:0,required:!1,responseItem:{linkId:n.linkId}})]})}),n.item?.map((R,_)=>a.jsx("div",{children:a.jsx(eP,{item:R,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:_===0,isLast:_===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:g,onRemove:()=>b(R),onRepeatable:C,onMoveUp:()=>T(_,-1),onMoveDown:()=>T(_,1)})},R.id)),!o&&a.jsx("div",{className:oi.topActions,children:c?a.jsxs(a.Fragment,{children:[a.jsx(Be,{size:"xs",className:oi.linkIdInput,defaultValue:n.linkId,onBlur:R=>w("linkId",R.currentTarget.value)}),!o&&a.jsx(cn,{size:"xs",className:oi.typeSelect,defaultValue:n.type,onChange:R=>w("type",R.currentTarget.value),data:[{value:"display",label:"Display"},{value:"boolean",label:"Boolean"},{value:"decimal",label:"Decimal"},{value:"integer",label:"Integer"},{value:"date",label:"Date"},{value:"dateTime",label:"Date/Time"},{value:"time",label:"Time"},{value:"string",label:"String"},{value:"text",label:"Text"},{value:"url",label:"URL"},{value:"choice",label:"Choice"},{value:"open-choice",label:"Open Choice"},{value:"attachment",label:"Attachment"},{value:"reference",label:"Reference"},{value:"quantity",label:"Quantity"}]})]}):a.jsx("div",{children:l})}),!r&&a.jsx(ue,{className:oi.movementActions,children:a.jsxs(ue,{className:oi.columnAlignment,children:[!e.isFirst&&a.jsx(Mt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:a.jsx(VF,{"data-testid":"up-button",size:15,className:oi.movementIcons})}),!e.isLast&&a.jsx(Mt,{href:"#",onClick:R=>{R.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:a.jsx(UF,{"data-testid":"down-button",size:15,className:oi.movementIcons})})]})}),a.jsxs("div",{className:oi.bottomActions,children:[o&&a.jsxs(a.Fragment,{children:[a.jsx(Mt,{href:"#",onClick:R=>{R.preventDefault(),y({id:gl(),linkId:Px("q"),type:"string",text:"Question"})},children:"Add item"}),a.jsx(Mt,{href:"#",onClick:R=>{R.preventDefault(),y({id:gl(),linkId:Px("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&a.jsx(Mt,{href:"#",onClick:R=>{R.preventDefault(),y(HK(),!0)},children:"Add Page"}),c&&!r&&a.jsxs(a.Fragment,{children:[a.jsx(Mt,{href:"#",onClick:R=>{R.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),a.jsx(Mt,{href:"#",onClick:R=>{R.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function $K(e){const t=ws("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return a.jsxs("div",{children:[e.item.answerValueSet!==void 0?a.jsx(Be,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):a.jsx(UK,{options:n,property:t,item:e.item,onChange:e.onChange}),a.jsxs(ue,{display:"flex",children:[a.jsx(Mt,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:gl()}]})},children:"Add choice"}),a.jsx(bm,{w:"lg"}),a.jsx(Mt,{href:"#",onClick:r=>{dn(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function UK(e){return a.jsx("div",{children:e.options.map(t=>{const[n,r]=Lm({type:"QuestionnaireItemAnswerOption",value:t},"value");return a.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[a.jsx("div",{children:a.jsx(Zd,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,l)=>{const c=[...e.options],d=c.findIndex(f=>f.id===t.id);c[d]={id:t.id,[l]:o},e.onChange({...e.item,answerOption:c})},outcome:void 0},t.id)}),a.jsx("div",{children:a.jsx(Mt,{href:"#",onClick:o=>{dn(o),e.onChange({...e.item,answerOption:e.options.filter(l=>l.id!==t.id)})},children:"Remove"})})]},t.id)})})}function BK(e){const t=QA(e.item)??[];return a.jsxs(a.Fragment,{children:[t.map((n,r)=>a.jsxs(xe,{children:[a.jsx(sS,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(ky(e.item,t.map(l=>l===n?o:l)))}}),a.jsx(Mt,{href:"#",onClick:o=>{dn(o),e.onChange(ky(e.item,t.filter(l=>l!==n)))},children:"Remove"})]},`${n}-${r}`)),a.jsx(Mt,{href:"#",onClick:n=>{dn(n),e.onChange(ky(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Ax=1,kx=1;function Px(e){return e+Ax++}function gl(){return"id-"+kx++}function VK(e){return{...e,id:e.id||gl(),item:tP(e.item)}}function tP(e){if(e)return e.forEach(t=>{t.id?.match(/^id-\d+$/)&&(kx=Math.max(kx,parseInt(t.id.substring(3),10)+1)),t.linkId?.match(/^q\d+$/)&&(Ax=Math.max(Ax,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||gl(),item:tP(t.item),answerOption:FK(t.answerOption)}))}function FK(e){if(e)return e.map(t=>({...t,id:t.id||gl()}))}function HK(){return{id:gl(),linkId:Px("s"),type:"group",text:"New Page",extension:[{url:Y0,valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function qK(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const l=[...r];return[l[t],l[o]]=[l[o],l[t]],l}/*!
|
|
557
|
+
* Signature Pad v5.1.1 | https://github.com/szimek/signature_pad
|
|
558
|
+
* (c) 2025 Szymon Nowak | Released under the MIT license
|
|
559
|
+
*/var Ep=class{x;y;pressure;time;constructor(e,t,n,r){if(isNaN(e)||isNaN(t))throw new Error(`Point is invalid: (${e}, ${t})`);this.x=+e,this.y=+t,this.pressure=n||0,this.time=r||Date.now()}distanceTo(e){return Math.sqrt(Math.pow(this.x-e.x,2)+Math.pow(this.y-e.y,2))}equals(e){return this.x===e.x&&this.y===e.y&&this.pressure===e.pressure&&this.time===e.time}velocityFrom(e){return this.time!==e.time?this.distanceTo(e)/(this.time-e.time):0}},GK=class nP{constructor(t,n,r,o,l,c){this.startPoint=t,this.control2=n,this.control1=r,this.endPoint=o,this.startWidth=l,this.endWidth=c}static fromPoints(t,n){const r=this.calculateControlPoints(t[0],t[1],t[2]).c2,o=this.calculateControlPoints(t[1],t[2],t[3]).c1;return new nP(t[1],r,o,t[2],n.start,n.end)}static calculateControlPoints(t,n,r){const o=t.x-n.x,l=t.y-n.y,c=n.x-r.x,d=n.y-r.y,f={x:(t.x+n.x)/2,y:(t.y+n.y)/2},p={x:(n.x+r.x)/2,y:(n.y+r.y)/2},m=Math.sqrt(o*o+l*l),g=Math.sqrt(c*c+d*d),y=f.x-p.x,b=f.y-p.y,w=m+g==0?0:g/(m+g),j={x:p.x+y*w,y:p.y+b*w},C=n.x-j.x,T=n.y-j.y;return{c1:new Ep(f.x+C,f.y+T),c2:new Ep(p.x+C,p.y+T)}}length(){let n=0,r,o;for(let l=0;l<=10;l+=1){const c=l/10,d=this.point(c,this.startPoint.x,this.control1.x,this.control2.x,this.endPoint.x),f=this.point(c,this.startPoint.y,this.control1.y,this.control2.y,this.endPoint.y);if(l>0){const p=d-r,m=f-o;n+=Math.sqrt(p*p+m*m)}r=d,o=f}return n}point(t,n,r,o,l){return n*(1-t)*(1-t)*(1-t)+3*r*(1-t)*(1-t)*t+3*o*(1-t)*t*t+l*t*t*t}},WK=class{_et;constructor(){try{this._et=new EventTarget}catch{this._et=document}}addEventListener(e,t,n){this._et.addEventListener(e,t,n)}dispatchEvent(e){return this._et.dispatchEvent(e)}removeEventListener(e,t,n){this._et.removeEventListener(e,t,n)}};function QK(e,t=250){let n=0,r=null,o,l,c;const d=()=>{n=Date.now(),r=null,o=e.apply(l,c),r||(l=null,c=[])};return function(...p){const m=Date.now(),g=t-(m-n);return l=this,c=p,g<=0||g>t?(r&&(clearTimeout(r),r=null),n=m,o=e.apply(l,c),r||(l=null,c=[])):r||(r=window.setTimeout(d,g)),o}}var YK=class Ox extends WK{constructor(t,n={}){super(),this.canvas=t,this.velocityFilterWeight=n.velocityFilterWeight||.7,this.minWidth=n.minWidth||.5,this.maxWidth=n.maxWidth||2.5,this.throttle=n.throttle??16,this.minDistance=n.minDistance??5,this.dotSize=n.dotSize||0,this.penColor=n.penColor||"black",this.backgroundColor=n.backgroundColor||"rgba(0,0,0,0)",this.compositeOperation=n.compositeOperation||"source-over",this.canvasContextOptions=n.canvasContextOptions??{},this._strokeMoveUpdate=this.throttle?QK(Ox.prototype._strokeUpdate,this.throttle):Ox.prototype._strokeUpdate,this._handleMouseDown=this._handleMouseDown.bind(this),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this._handleTouchStart=this._handleTouchStart.bind(this),this._handleTouchMove=this._handleTouchMove.bind(this),this._handleTouchEnd=this._handleTouchEnd.bind(this),this._handlePointerDown=this._handlePointerDown.bind(this),this._handlePointerMove=this._handlePointerMove.bind(this),this._handlePointerUp=this._handlePointerUp.bind(this),this._ctx=t.getContext("2d",this.canvasContextOptions),this.clear(),this.on()}dotSize;minWidth;maxWidth;penColor;minDistance;velocityFilterWeight;compositeOperation;backgroundColor;throttle;canvasContextOptions;_ctx;_drawingStroke=!1;_isEmpty=!0;_dataUrl;_dataUrlOptions;_lastPoints=[];_data=[];_lastVelocity=0;_lastWidth=0;_strokeMoveUpdate;_strokePointerId;clear(){const{_ctx:t,canvas:n}=this;t.fillStyle=this.backgroundColor,t.clearRect(0,0,n.width,n.height),t.fillRect(0,0,n.width,n.height),this._data=[],this._reset(this._getPointGroupOptions()),this._isEmpty=!0,this._dataUrl=void 0,this._dataUrlOptions=void 0,this._strokePointerId=void 0}redraw(){const t=this._data,n=this._dataUrl,r=this._dataUrlOptions;this.clear(),n&&this.fromDataURL(n,r),this.fromData(t,{clear:!1})}fromDataURL(t,n={}){return new Promise((r,o)=>{const l=new Image,c=n.ratio||window.devicePixelRatio||1,d=n.width||this.canvas.width/c,f=n.height||this.canvas.height/c,p=n.xOffset||0,m=n.yOffset||0;this._reset(this._getPointGroupOptions()),l.onload=()=>{this._ctx.drawImage(l,p,m,d,f),r()},l.onerror=g=>{o(g)},l.crossOrigin="anonymous",l.src=t,this._isEmpty=!1,this._dataUrl=t,this._dataUrlOptions={...n}})}toDataURL(t="image/png",n){switch(t){case"image/svg+xml":return typeof n!="object"&&(n=void 0),`data:image/svg+xml;base64,${btoa(this.toSVG(n))}`;default:return typeof n!="number"&&(n=void 0),this.canvas.toDataURL(t,n)}}on(){this.canvas.style.touchAction="none",this.canvas.style.msTouchAction="none",this.canvas.style.userSelect="none";const t=/Macintosh/.test(navigator.userAgent)&&"ontouchstart"in document;window.PointerEvent&&!t?this._handlePointerEvents():(this._handleMouseEvents(),"ontouchstart"in window&&this._handleTouchEvents())}off(){this.canvas.style.touchAction="auto",this.canvas.style.msTouchAction="auto",this.canvas.style.userSelect="auto",this.canvas.removeEventListener("pointerdown",this._handlePointerDown),this.canvas.removeEventListener("mousedown",this._handleMouseDown),this.canvas.removeEventListener("touchstart",this._handleTouchStart),this._removeMoveUpEventListeners()}_getListenerFunctions(){const t=window.document===this.canvas.ownerDocument?window:this.canvas.ownerDocument.defaultView??this.canvas.ownerDocument;return{addEventListener:t.addEventListener.bind(t),removeEventListener:t.removeEventListener.bind(t)}}_removeMoveUpEventListeners(){const{removeEventListener:t}=this._getListenerFunctions();t("pointermove",this._handlePointerMove),t("pointerup",this._handlePointerUp),t("mousemove",this._handleMouseMove),t("mouseup",this._handleMouseUp),t("touchmove",this._handleTouchMove),t("touchend",this._handleTouchEnd)}isEmpty(){return this._isEmpty}fromData(t,{clear:n=!0}={}){n&&this.clear(),this._fromData(t,this._drawCurve.bind(this),this._drawDot.bind(this)),this._data=this._data.concat(t)}toData(){return this._data}_isLeftButtonPressed(t,n){return n?t.buttons===1:(t.buttons&1)===1}_pointerEventToSignatureEvent(t){return{event:t,type:t.type,x:t.clientX,y:t.clientY,pressure:"pressure"in t?t.pressure:0}}_touchEventToSignatureEvent(t){const n=t.changedTouches[0];return{event:t,type:t.type,x:n.clientX,y:n.clientY,pressure:n.force}}_handleMouseDown(t){!this._isLeftButtonPressed(t,!0)||this._drawingStroke||this._strokeBegin(this._pointerEventToSignatureEvent(t))}_handleMouseMove(t){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}_handleMouseUp(t){this._isLeftButtonPressed(t)||this._strokeEnd(this._pointerEventToSignatureEvent(t))}_handleTouchStart(t){t.targetTouches.length!==1||this._drawingStroke||(t.cancelable&&t.preventDefault(),this._strokeBegin(this._touchEventToSignatureEvent(t)))}_handleTouchMove(t){if(t.targetTouches.length===1){if(t.cancelable&&t.preventDefault(),!this._drawingStroke){this._strokeEnd(this._touchEventToSignatureEvent(t),!1);return}this._strokeMoveUpdate(this._touchEventToSignatureEvent(t))}}_handleTouchEnd(t){t.targetTouches.length===0&&(t.cancelable&&t.preventDefault(),this._strokeEnd(this._touchEventToSignatureEvent(t)))}_getPointerId(t){return t.persistentDeviceId||t.pointerId}_allowPointerId(t,n=!1){return typeof this._strokePointerId>"u"?n:this._getPointerId(t)===this._strokePointerId}_handlePointerDown(t){this._drawingStroke||!this._isLeftButtonPressed(t)||!this._allowPointerId(t,!0)||(this._strokePointerId=this._getPointerId(t),t.preventDefault(),this._strokeBegin(this._pointerEventToSignatureEvent(t)))}_handlePointerMove(t){if(this._allowPointerId(t)){if(!this._isLeftButtonPressed(t,!0)||!this._drawingStroke){this._strokeEnd(this._pointerEventToSignatureEvent(t),!1);return}t.preventDefault(),this._strokeMoveUpdate(this._pointerEventToSignatureEvent(t))}}_handlePointerUp(t){this._isLeftButtonPressed(t)||!this._allowPointerId(t)||(t.preventDefault(),this._strokeEnd(this._pointerEventToSignatureEvent(t)))}_getPointGroupOptions(t){return{penColor:t&&"penColor"in t?t.penColor:this.penColor,dotSize:t&&"dotSize"in t?t.dotSize:this.dotSize,minWidth:t&&"minWidth"in t?t.minWidth:this.minWidth,maxWidth:t&&"maxWidth"in t?t.maxWidth:this.maxWidth,velocityFilterWeight:t&&"velocityFilterWeight"in t?t.velocityFilterWeight:this.velocityFilterWeight,compositeOperation:t&&"compositeOperation"in t?t.compositeOperation:this.compositeOperation}}_strokeBegin(t){if(!this.dispatchEvent(new CustomEvent("beginStroke",{detail:t,cancelable:!0})))return;const{addEventListener:r}=this._getListenerFunctions();switch(t.event.type){case"mousedown":r("mousemove",this._handleMouseMove,{passive:!1}),r("mouseup",this._handleMouseUp,{passive:!1});break;case"touchstart":r("touchmove",this._handleTouchMove,{passive:!1}),r("touchend",this._handleTouchEnd,{passive:!1});break;case"pointerdown":r("pointermove",this._handlePointerMove,{passive:!1}),r("pointerup",this._handlePointerUp,{passive:!1});break}this._drawingStroke=!0;const o=this._getPointGroupOptions(),l={...o,points:[]};this._data.push(l),this._reset(o),this._strokeUpdate(t)}_strokeUpdate(t){if(!this._drawingStroke)return;if(this._data.length===0){this._strokeBegin(t);return}this.dispatchEvent(new CustomEvent("beforeUpdateStroke",{detail:t}));const n=this._createPoint(t.x,t.y,t.pressure),r=this._data[this._data.length-1],o=r.points,l=o.length>0&&o[o.length-1],c=l?n.distanceTo(l)<=this.minDistance:!1,d=this._getPointGroupOptions(r);if(!l||!(l&&c)){const f=this._addPoint(n,d);l?f&&this._drawCurve(f,d):this._drawDot(n,d),o.push({time:n.time,x:n.x,y:n.y,pressure:n.pressure})}this.dispatchEvent(new CustomEvent("afterUpdateStroke",{detail:t}))}_strokeEnd(t,n=!0){this._removeMoveUpEventListeners(),this._drawingStroke&&(n&&this._strokeUpdate(t),this._drawingStroke=!1,this._strokePointerId=void 0,this.dispatchEvent(new CustomEvent("endStroke",{detail:t})))}_handlePointerEvents(){this._drawingStroke=!1,this.canvas.addEventListener("pointerdown",this._handlePointerDown,{passive:!1})}_handleMouseEvents(){this._drawingStroke=!1,this.canvas.addEventListener("mousedown",this._handleMouseDown,{passive:!1})}_handleTouchEvents(){this.canvas.addEventListener("touchstart",this._handleTouchStart,{passive:!1})}_reset(t){this._lastPoints=[],this._lastVelocity=0,this._lastWidth=(t.minWidth+t.maxWidth)/2,this._ctx.fillStyle=t.penColor,this._ctx.globalCompositeOperation=t.compositeOperation}_createPoint(t,n,r){const o=this.canvas.getBoundingClientRect();return new Ep(t-o.left,n-o.top,r,new Date().getTime())}_addPoint(t,n){const{_lastPoints:r}=this;if(r.push(t),r.length>2){r.length===3&&r.unshift(r[0]);const o=this._calculateCurveWidths(r[1],r[2],n),l=GK.fromPoints(r,o);return r.shift(),l}return null}_calculateCurveWidths(t,n,r){const o=r.velocityFilterWeight*n.velocityFrom(t)+(1-r.velocityFilterWeight)*this._lastVelocity,l=this._strokeWidth(o,r),c={end:l,start:this._lastWidth};return this._lastVelocity=o,this._lastWidth=l,c}_strokeWidth(t,n){return Math.max(n.maxWidth/(t+1),n.minWidth)}_drawCurveSegment(t,n,r){const o=this._ctx;o.moveTo(t,n),o.arc(t,n,r,0,2*Math.PI,!1),this._isEmpty=!1}_drawCurve(t,n){const r=this._ctx,o=t.endWidth-t.startWidth,l=Math.ceil(t.length())*2;r.beginPath(),r.fillStyle=n.penColor;for(let c=0;c<l;c+=1){const d=c/l,f=d*d,p=f*d,m=1-d,g=m*m,y=g*m;let b=y*t.startPoint.x;b+=3*g*d*t.control1.x,b+=3*m*f*t.control2.x,b+=p*t.endPoint.x;let w=y*t.startPoint.y;w+=3*g*d*t.control1.y,w+=3*m*f*t.control2.y,w+=p*t.endPoint.y;const j=Math.min(t.startWidth+p*o,n.maxWidth);this._drawCurveSegment(b,w,j)}r.closePath(),r.fill()}_drawDot(t,n){const r=this._ctx,o=n.dotSize>0?n.dotSize:(n.minWidth+n.maxWidth)/2;r.beginPath(),this._drawCurveSegment(t.x,t.y,o),r.closePath(),r.fillStyle=n.penColor,r.fill()}_fromData(t,n,r){for(const o of t){const{points:l}=o,c=this._getPointGroupOptions(o);if(l.length>1)for(let d=0;d<l.length;d+=1){const f=l[d],p=new Ep(f.x,f.y,f.pressure,f.time);d===0&&this._reset(c);const m=this._addPoint(p,c);m&&n(m,c)}else this._reset(c),r(l[0],c)}}toSVG({includeBackgroundColor:t=!1,includeDataUrl:n=!1}={}){const r=this._data,o=Math.max(window.devicePixelRatio||1,1),l=0,c=0,d=this.canvas.width/o,f=this.canvas.height/o,p=document.createElementNS("http://www.w3.org/2000/svg","svg");if(p.setAttribute("xmlns","http://www.w3.org/2000/svg"),p.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),p.setAttribute("viewBox",`${l} ${c} ${d} ${f}`),p.setAttribute("width",d.toString()),p.setAttribute("height",f.toString()),t&&this.backgroundColor){const m=document.createElement("rect");m.setAttribute("width","100%"),m.setAttribute("height","100%"),m.setAttribute("fill",this.backgroundColor),p.appendChild(m)}if(n&&this._dataUrl){const m=this._dataUrlOptions?.ratio||window.devicePixelRatio||1,g=this._dataUrlOptions?.width||this.canvas.width/m,y=this._dataUrlOptions?.height||this.canvas.height/m,b=this._dataUrlOptions?.xOffset||0,w=this._dataUrlOptions?.yOffset||0,j=document.createElement("image");j.setAttribute("x",b.toString()),j.setAttribute("y",w.toString()),j.setAttribute("width",g.toString()),j.setAttribute("height",y.toString()),j.setAttribute("preserveAspectRatio","none"),j.setAttribute("href",this._dataUrl),p.appendChild(j)}return this._fromData(r,(m,{penColor:g})=>{const y=document.createElement("path");if(!isNaN(m.control1.x)&&!isNaN(m.control1.y)&&!isNaN(m.control2.x)&&!isNaN(m.control2.y)){const b=`M ${m.startPoint.x.toFixed(3)},${m.startPoint.y.toFixed(3)} C ${m.control1.x.toFixed(3)},${m.control1.y.toFixed(3)} ${m.control2.x.toFixed(3)},${m.control2.y.toFixed(3)} ${m.endPoint.x.toFixed(3)},${m.endPoint.y.toFixed(3)}`;y.setAttribute("d",b),y.setAttribute("stroke-width",(m.endWidth*2.25).toFixed(3)),y.setAttribute("stroke",g),y.setAttribute("fill","none"),y.setAttribute("stroke-linecap","round"),p.appendChild(y)}},(m,{penColor:g,dotSize:y,minWidth:b,maxWidth:w})=>{const j=document.createElement("circle"),C=y>0?y:(b+w)/2;j.setAttribute("r",C.toString()),j.setAttribute("cx",m.x.toString()),j.setAttribute("cy",m.y.toString()),j.setAttribute("fill",g),p.appendChild(j)}),p.outerHTML}};function KK(e){const t=_e(),{width:n=500,height:r=200,defaultValue:o,who:l,onChange:c,...d}=e,f=v.useRef(null),p=v.useRef(null),m=v.useRef(c);m.current=c,v.useEffect(()=>{function y(){m.current?.({type:[{system:ro+"/fhir/signature-type",code:"ProofOfOrigin",display:"Proof of Origin"}],when:new Date().toISOString(),who:l??Wt(t.getProfile()),data:p.current?.toDataURL().split(",")[1]})}if(f.current){const b=new YK(f.current);o?.data&&b.fromDataURL(o.data).catch(console.error),b.addEventListener("endStroke",y),p.current=b}return()=>{p.current&&p.current.removeEventListener("beginStroke",y)}},[t,o,l]);const g=()=>{p.current&&p.current.clear(),m.current?.(void 0)};return a.jsxs(Ar,{withBorder:!0,p:0,w:n,h:r,pos:"relative",...d,children:[a.jsx("canvas",{ref:f,width:n,height:r,"aria-label":"Signature input area"}),a.jsx(Ae,{onClick:g,"aria-label":"Clear signature",pos:"absolute",top:0,right:0,size:"xs",leftSection:a.jsx(Om,{size:16}),variant:"subtle",color:"gray",children:"Clear"})]})}function rP(e){const t=[...e.context,e.responseItem];return a.jsxs("div",{children:[e.item.text&&a.jsx(Le,{order:3,mb:"md",children:e.item.text}),a.jsx(Nx,{formState:e.formState,context:t,items:e.item.item??[],responseItems:e.responseItem.item??[]})]},e.item.linkId)}function XK(e){return a.jsxs(a.Fragment,{children:[e.responseItems.map(t=>a.jsx(rP,{formState:e.formState,context:e.context,item:e.item,responseItem:t},`group-${t.id}`)),a.jsx(Mt,{onClick:()=>e.formState.onAddGroup(e.context,e.item),children:`Add Group: ${e.item.text}`})]})}function JK(e){const{formState:t,context:n,item:r,responseItem:o}=e,l=r.type!==Et.choice&&r.type!==Et.openChoice,c=o.answer&&o.answer.length>0?o.answer:[{}];return a.jsxs(zt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[a.jsx(Ue,{gap:"xs",children:c?.map((d,f)=>a.jsx(Cp,{formState:t,context:n,item:r,responseItem:o,index:f},`${r.linkId}-${f}`))}),l&&a.jsx(Mt,{onClick:()=>t.onAddAnswer(n,r),children:"Add Item"})]},e.item.linkId)}function Nx(e){const{formState:t,context:n,items:r,responseItems:o}=e;return a.jsx(Ue,{children:r.map((l,c)=>{if(!uF(l,t.questionnaireResponse))return null;if(l.type===Et.display)return a.jsx("p",{children:l.text},`display-${l.id}-${c}`);const d=o.filter(f=>f.linkId===l.linkId);return l.type===Et.group&&l.repeats?a.jsx(XK,{formState:t,context:n,item:l,responseItems:d},`repeating-group-${l.id}-${c}`):l.type===Et.group?a.jsx(rP,{formState:t,context:n,item:l,responseItem:d[0]},`group-${l.id}-${c}`):l.type===Et.boolean?a.jsx(Cp,{formState:t,context:n,item:l,responseItem:d[0],index:0},`boolean-item-${l.id}-${c}`):l.repeats?a.jsx(JK,{formState:t,context:n,item:l,responseItem:d[0]},`repeating-item-${l.id}-${c}`):a.jsx(zt,{htmlFor:l.linkId,title:l.text,withAsterisk:l.required,children:a.jsx(Cp,{formState:t,context:n,item:l,responseItem:d[0],index:0})},`repeating-item-${l.id}-${c}`)})})}function ZK(e){const{formState:t,submitButtonText:n,excludeButtons:r,children:o}=e,l=t.pages,c=t.activePage,d=c>0,f=c<l.length-1,p=c===l.length-1;return a.jsxs(a.Fragment,{children:[a.jsx($c,{active:c,allowNextStepsSelect:!1,p:6,children:l.map((m,g)=>a.jsx($c.Step,{label:m.title,children:g===c&&o},m.linkId))}),!r&&a.jsxs(xe,{justify:"flex-end",mt:"xl",gap:"xs",children:[d&&a.jsx(Ae,{onClick:t.onPrevPage,children:"Back"}),f&&a.jsx(Ae,{onClick:m=>{m.currentTarget.closest("form").reportValidity()&&t.onNextPage()},children:"Next"}),p&&a.jsx(jr,{children:n??"Submit"})]})]})}function iP(e){const t=_e(),[n,r]=v.useState(!1),o=v.useRef(e);o.current=e;const l=v.useCallback(g=>{r(!1),o.current.onChange?.(g)},[]),c=jF({questionnaire:e.questionnaire,defaultValue:e.questionnaireResponse,subject:e.subject,encounter:e.encounter,source:e.source,disablePagination:e.disablePagination,onChange:l}),d=v.useRef(c);d.current=c;const f=v.useMemo(()=>c.loading?!1:!!Lo(c.questionnaire,lF),[c]),p=v.useMemo(()=>c.loading?!1:!!c.questionnaireResponse.extension?.find(g=>g.url===Wh),[c]),m=v.useCallback(()=>{const g=d.current;if(g.loading)return;const y=o.current.onSubmit;if(!y)return;if(f&&!p){r(!0);return}const b=g.questionnaire,w=g.questionnaireResponse,j=o.current.subject;let C=o.current.source;if(!C){const T=t.getProfile();T&&(C=Wt(T))}y({...w,questionnaire:b.url??Nt(b),subject:j,source:C,authored:new Date().toISOString(),status:"completed"})},[t,f,p]);return c.loading?null:a.jsxs(ft,{testid:"questionnaire-form",onSubmit:m,children:[c.questionnaire.title&&a.jsx(Le,{children:c.questionnaire.title}),c.pagination?a.jsx(ZK,{formState:c,submitButtonText:e.submitButtonText,excludeButtons:e.excludeButtons,children:a.jsx(Nx,{formState:c,context:[],items:c.items,responseItems:c.responseItems})}):a.jsxs(a.Fragment,{children:[a.jsx(Nx,{formState:c,context:[],items:c.items,responseItems:c.responseItems}),f&&a.jsxs(Ue,{mt:"md",gap:0,children:[a.jsx(Re,{size:"sm",fw:500,children:"Signature"}),a.jsx(KK,{onChange:c.onChangeSignature}),!p&&n&&a.jsx(Re,{c:"red",size:"sm",children:"Signature is required."})]}),!e.excludeButtons&&a.jsx(xe,{justify:"flex-end",mt:"xl",gap:"xs",children:a.jsx(jr,{children:e.submitButtonText??"Submit"})})]})]})}const eX="_section_4m5it_1",tX={section:eX},nX=["gender","age","gestationalAge","context","appliesTo","category"],rX={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function iX(e){e=Object.assign(rX,e);const t=e.definition,[n,r]=v.useState([]),[o,l]=v.useState(1),[c,d]=v.useState(1);return v.useEffect(()=>{const w=sX(t,d);r(lX(w.qualifiedInterval||[],l))},[t]),a.jsxs(ft,{testid:"reference-range-editor",onSubmit:f,children:[a.jsx(Ue,{children:n.map(w=>a.jsx(oX,{unit:uX(t.quantitativeDetails?.unit),onChange:g,onAdd:y,onRemove:b,onRemoveGroup:m,intervalGroup:w},`group-${w.id}`))}),a.jsx(En,{title:"Add Group",variant:"subtle",size:"sm",onClick:w=>{dn(w),p({id:`group-id-${o}`,filters:{},intervals:[]}),l(j=>j+1)},children:a.jsx(yp,{})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(jr,{children:"Save"})})]});function f(){const w=n.flatMap(j=>j.intervals).filter(j=>!dX(j));e.onSubmit({...t,qualifiedInterval:w})}function p(w){r(j=>[...j,w])}function m(w){r(j=>j.filter(C=>C.id!==w.id))}function g(w,j){r(C=>{C=[...C];const T=C.find(R=>R.id===w),E=T?.intervals.findIndex(R=>R.id===j.id);return E!==void 0&&T?.intervals[E]&&(T.intervals[E]=j),C})}function y(w,j){j.id===void 0&&(j.id=`id-${c}`,d(C=>C+1)),r(C=>{C=[...C];const T=C.findIndex(E=>E.id===w);if(T!==-1){const E={...C[T]};j={...j,...E.filters},E.intervals=[...E.intervals,j],C[T]=E}return C})}function b(w,j){r(C=>{C=[...C];const T=C.find(E=>E.id===w);return T&&(T.intervals=T.intervals.filter(E=>E.id!==j.id)),C})}}function oX(e){const{intervalGroup:t,unit:n}=e;return a.jsx(ou,{"data-testid":t.id,className:tX.section,children:a.jsxs(Ue,{gap:"lg",children:[a.jsx(xe,{justify:"flex-end",children:a.jsx(En,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{dn(r),e.onRemoveGroup(t)},children:a.jsx(vp,{})},`remove-group-button-${t.id}`)}),a.jsx(aX,{intervalGroup:t,onChange:e.onChange}),a.jsx(vn,{}),t.intervals.map(r=>a.jsxs(Ue,{gap:"xs",children:[a.jsxs(xe,{children:[a.jsx(Be,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{dn(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),a.jsx(En,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{dn(o),e.onRemove(t.id,r)},children:a.jsx(vp,{})},`remove-interval-${r.id}`)]}),a.jsx(dS,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),a.jsx(En,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{dn(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:a.jsx(yp,{})})]})})}function aX(e){const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const r of["low","high"])t.filters.age[r]?.unit||(t.filters.age[r]={...t.filters.age[r],unit:"years",system:"http://unitsofmeasure.org"});return a.jsxs(Ue,{style:{maxWidth:"50%"},children:[a.jsx(xe,{children:a.jsx(cn,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:r=>{for(const o of t.intervals){let l=r.currentTarget.value;l===""&&(l=void 0),n(t.id,{...o,gender:l})}}})}),a.jsxs(xe,{gap:"xs",children:[a.jsx(Re,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),a.jsx("div",{id:`div-age-${t.id}`,children:a.jsx(dS,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:r=>{for(const o of t.intervals)n(t.id,{...o,age:r})}},`age-${t.id}`)})]}),a.jsx(cn,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:t.filters.context?.text||"",onChange:r=>{for(const o of t.intervals){let l=r.currentTarget.value;l===""?(l=void 0,n(t.id,{...o,context:void 0})):n(t.id,{...o,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),a.jsx(cn,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:r=>{for(const o of t.intervals){const l=r.currentTarget.value;l===""?n(t.id,{...o,category:void 0}):n(t.id,{...o,category:l})}}})]})}function sX(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{const l=parseInt(o.id?.substring(3)||"",10);return isNaN(l)?Number.NEGATIVE_INFINITY:l}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function lX(e,t){let n=1;const r={};for(const o of e){const l=cX(o);l in r||(r[l]={id:`group-id-${n++}`,filters:Object.fromEntries(nX.map(c=>[c,o[c]])),intervals:[]}),r[l].intervals.push(o)}return t(n),Object.values(r)}function cX(e){return[`gender=${e.gender}`,`age=${Sd(e.age)}`,`gestationalAge=${Sd(e.gestationalAge)}`,`context=${e.context?.text}`,`appliesTo=${e.appliesTo?.map(n=>n.text).join("+")}`,`category=${e.category}`].join(":")}function uX(e){return e&&(vU(e,"http://unitsofmeasure.org")||e.text)}function dX(e){return e.range?.low?.value===void 0&&e.range?.high?.value===void 0}function fX(e){const t=_e(),n=Kt(e.value),[r,o]=v.useState(!1),[l,c]=v.useState();if(v.useEffect(()=>{n&&!r&&(t.executeBatch(d(n)).then(c).catch(console.log),o(!0))},[t,n,r]),!n||!l)return null;return a.jsx(br,{children:n.action?.map((p,m)=>{const g=p.resource&&f(p.resource),y=g?.input?.[0]?.valueReference,b=g?.output?.[0]?.valueReference;return a.jsxs(v.Fragment,{children:[a.jsx(br.Col,{span:1,p:"md",children:g?.status==="completed"?a.jsx(lH,{}):a.jsx(Rq,{color:"gray"})}),a.jsxs(br.Col,{span:9,p:"xs",children:[a.jsx(Re,{fw:500,children:p.title}),p.description&&a.jsx("div",{children:p.description}),a.jsxs("div",{children:["Last edited by ",a.jsx(_l,{value:g?.meta?.author})," on ",wr(g?.meta?.lastUpdated)]}),a.jsxs("div",{children:["Status: ",a.jsx(zm,{status:g?.status||"unknown"})]})]}),a.jsxs(br.Col,{span:2,p:"md",children:[y&&!b&&a.jsx(Ae,{onClick:()=>e.onStart(g,y),children:"Start"}),y&&b&&a.jsx(Ae,{onClick:()=>e.onEdit(g,y,b),children:"Edit"})]})]},`action-${m}`)})});function d(p){const m=[];if(p.action)for(const g of p.action)g.resource?.reference&&m.push({request:{method:"GET",url:g.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:m}}function f(p){for(const m of l?.entry??[])if(m.resource&&p.reference===Nt(m.resource))return m.resource}}function oP(e,t){const n=hX(e,t);return pX(n,e,t)}function hX(e,t){const n=e.length,r=t.length,o=n+r+1,l=1+2*o,c=l/2|0,d=new Array(l);d[c+1]={i:0,j:-1,prev:void 0,snake:!0};for(let f=0;f<o;f++){for(let p=-f;p<=f;p+=2){const m=c+p,g=m+1,y=m-1,b=d[g],w=d[y];let j,C=0;p===-f||p!==f&&w.i<b.i?(C=b.i,j=b):(C=w.i+1,j=w),d[y]=void 0;let T=C-p,E={i:C,j:T,prev:mX(j),snake:!1};for(;C<n&&T<r&&e[C]===t[T];)C++,T++;if(C>E.i&&(E={i:C,j:T,prev:E,snake:!0}),d[m]=E,C>=n&&T>=r)return d[m]}d[c+f-1]=void 0}}function pX(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o?.prev&&o.prev.j>=0;){const l=o.i,c=o.j;o=o.prev;const d=o.i,f=o.j,p={position:d,lines:t.slice(d,l)},m={position:f,lines:n.slice(f,c)};let g;p.lines.length===0&&m.lines.length>0?g="insert":p.lines.length>0&&m.lines.length===0?g="delete":g="change",r.push({original:p,revised:m,type:g}),o.snake&&(o=o.prev)}return r}function mX(e){return e&&!e.snake&&e.prev?e.prev:e}function gX(e){const t=(e.entry??[]).filter(r=>!!r.resource).map(r=>({meta:r.resource?.meta,lines:to(r.resource,!0).match(/[^\r\n]+/g)})).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated));if(!t.length)return[];const n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return vX(n,t),yX(n),n}function vX(e,t){for(let n=1;n<t.length;n++){const r=oP(t[n-1].lines,t[n].lines);for(const o of r){const l=o.original.position,c=o.original.lines,d=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(l,c.length),o.type==="insert"||o.type==="change")for(let f=0;f<o.revised.lines.length;f++)e.splice(l+f,0,{id:t[n].meta.versionId,meta:t[n].meta,value:d[f],span:1})}}}function yX(e){let t=0;for(;t<e.length;){let n=t;for(;n<e.length&&e[n].id===e[t].id;)e[n].span=-1,n++;e[t].span=n-t,t=n}}const xX="_container_1tyf3_1",bX="_root_1tyf3_5",SX="_startRow_1tyf3_20",wX="_normalRow_1tyf3_25",jX="_author_1tyf3_30",CX="_dateTime_1tyf3_34",EX="_lineNumber_1tyf3_40",TX="_line_1tyf3_40",RX="_pre_1tyf3_55",fa={container:xX,root:bX,startRow:SX,normalRow:wX,author:jX,dateTime:CX,lineNumber:EX,line:TX,pre:RX};function _X(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function DX(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Sc(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Sc(r,"month");const o=Math.floor(t/86400);if(o>0)return Sc(o,"day");const l=Math.floor(t/3600);if(l>0)return Sc(l,"hour");const c=Math.floor(t/60);return c>0?Sc(c,"minute"):Sc(t,"second")}function Sc(e,t){return`${e} ${e===1?t:t+"s"} ago`}function AX(e){const t=_e(),[n,r]=v.useState(e.history);if(v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),!n)return a.jsx("div",{children:"Loading..."});const o=n.entry?.[0]?.resource;if(!o)return null;const l=gX(n);return a.jsx("div",{className:fa.container,children:a.jsx("table",{className:fa.root,children:a.jsx("tbody",{children:l.map((c,d)=>a.jsxs("tr",{className:c.span>0?fa.startRow:fa.normalRow,children:[c.span>0&&a.jsxs(a.Fragment,{children:[a.jsx("td",{className:fa.author,rowSpan:c.span,children:a.jsx(_l,{value:c.meta.author,link:!0,fz:"xs"})}),a.jsx("td",{className:fa.dateTime,rowSpan:c.span,children:a.jsx(St,{to:_X(o,c.meta.versionId),fz:"xs",children:DX(c.meta.lastUpdated)})})]}),a.jsx("td",{className:fa.lineNumber,children:d+1}),a.jsx("td",{className:fa.line,children:a.jsx("pre",{className:fa.pre,children:c.value})})]},"row-"+d))})})})}const kX="_removed_el5zk_1",PX="_added_el5zk_6",XT={removed:kX,added:PX};function OX(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=to(t,!0).match(/[^\r\n]+/g),o=to(n,!0).match(/[^\r\n]+/g),l=oP(r,o);return a.jsx("pre",{style:{color:"gray"},children:l.map((c,d)=>a.jsx(NX,{delta:c},"delta"+d))})}function NX(e){return a.jsxs(a.Fragment,{children:["...",a.jsx("br",{}),e.delta.original.lines.length>0&&a.jsx("div",{className:XT.removed,children:e.delta.original.lines.join(`
|
|
560
|
+
`)}),e.delta.revised.lines.length>0&&a.jsx("div",{className:XT.added,children:e.delta.revised.lines.join(`
|
|
561
|
+
`)}),"...",a.jsx("br",{})]})}const MX="_splitButton_1i0gi_1",LX="_menuControl_1i0gi_6",JT={splitButton:MX,menuControl:LX};function Tp(e){const{outcome:t}=e,n=_e(),r=Kt(e.defaultValue),o=r?.resourceType,[l,c]=v.useState(!1),[d,f]=v.useState(),p=n.getAccessPolicy(),m=Sn();v.useEffect(()=>{if(r)if(e.profileUrl){const b=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const w=ru(b);if(w){c(!0);const j=VV(r,w);f(j)}else console.error(`Schema not found for ${b}`)}).catch(w=>{console.error("Error in requestProfileSchema",w)})}else n.requestSchema(o).then(()=>{f(r),c(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const g=v.useMemo(()=>r&&AA(r,tl.READ,p),[p,r]),y=v.useMemo(()=>n.isSuperAdmin()||!p||!An(d?.resourceType)?!0:HB(p,d?.resourceType),[n,p,d?.resourceType]);return!l||!d?a.jsx("div",{children:"Loading..."}):y?a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b=>{b.preventDefault(),e.onSubmit&&e.onSubmit(d)},children:[a.jsxs(Ue,{mb:"xl",children:[a.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:a.jsx(Be,{name:"resourceType",defaultValue:d.resourceType,disabled:!0})}),a.jsx(zt,{title:"ID",htmlFor:"id",outcome:t,children:a.jsx(Be,{name:"id",defaultValue:d.id,disabled:!0})})]}),a.jsx(pS,{path:d.resourceType,valuePath:d.resourceType,typeName:o,defaultValue:d,outcome:t,onChange:f,profileUrl:e.profileUrl,accessPolicyResource:g}),a.jsxs(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[a.jsx(Ae,{type:"submit",className:$t((e.onPatch||e.onDelete)&&JT.splitButton),children:r?.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&a.jsxs(we,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[a.jsx(we.Target,{children:a.jsx(En,{variant:"filled",color:m.primaryColor,size:36,className:JT.menuControl,"aria-label":"More actions",children:a.jsx(Z0,{size:14,stroke:1.5})})}),a.jsxs(we.Dropdown,{children:[e.onPatch&&a.jsx(we.Item,{leftSection:a.jsx(tk,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(d)},children:"Patch"}),e.onDelete&&a.jsx(we.Item,{color:"red",leftSection:a.jsx(Om,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(d)},children:"Delete"})]})]})]})]}):a.jsxs(Ta,{color:"red",title:"Permission denied",icon:a.jsx(El,{}),children:["Your access level prevents you from editing and creating ",d.resourceType," resources."]})}function IX(e){const t=_e(),[n,r]=v.useState(e.history);return v.useEffect(()=>{!e.history&&e.resourceType&&e.id&&t.readHistory(e.resourceType,e.id).then(r).catch(console.log)},[t,e.history,e.resourceType,e.id]),n?a.jsxs(he,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx(he.Thead,{children:a.jsxs(he.Tr,{children:[a.jsx(he.Th,{children:"Author"}),a.jsx(he.Th,{children:"Date"}),a.jsx(he.Th,{children:"Version"})]})}),a.jsx(he.Tbody,{children:n.entry?.map((o,l)=>a.jsx(zX,{entry:o},"entry-"+l))})]}):a.jsx("div",{children:"Loading..."})}function zX(e){const{response:t,resource:n}=e.entry;return n?a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:a.jsx(Ac,{value:n.meta?.author,link:!0})}),a.jsx(he.Td,{children:wr(n.meta?.lastUpdated)}),a.jsx(he.Td,{children:a.jsx(St,{to:$X(n),children:n.meta?.versionId})})]}):a.jsx(he.Tr,{children:a.jsx(he.Td,{colSpan:3,children:Ye(t?.outcome)})})}function $X(e){return`/${e.resourceType}/${e.id}/_history/${e.meta?.versionId}`}function UX(e){const{serviceRequest:t,...n}=e;return a.jsx($m,{value:t,loadTimelineResources:async(r,o,l)=>{const c=`${o}/${l}`,d=100;return Promise.allSettled([r.readHistory("ServiceRequest",l),r.search("Communication",{"based-on":c,_count:d}),r.search("DiagnosticReport",{"based-on":c,_count:d}),r.search("Media",{"based-on":c,_count:d}),r.search("DocumentReference",{related:c,_count:d}),r.search("Task",{_filter:`based-on eq ${c} or focus eq ${c} or subject eq ${c}`,_count:d})])},createCommunication:(r,o,l)=>({resourceType:"Communication",status:"completed",basedOn:[Wt(r)],subject:r.subject,sender:Wt(o),sent:new Date().toISOString(),payload:[{contentString:l}]}),createMedia:(r,o,l)=>({resourceType:"Media",status:"completed",basedOn:[Wt(r)],subject:r.subject,operator:Wt(o),issued:new Date().toISOString(),content:l}),...n})}function BX(e){const t=_e(),{client:n,patient:r,encounter:o,children:l,...c}=e;function d(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(f=>{const p=new URL(n.launchUri);p.searchParams.set("iss",I0(t.fhirUrl().toString())),p.searchParams.set("launch",f.id),rr.assign(p.toString())}).catch(f=>ke({color:"red",message:Ye(f),autoClose:!1}))}return a.jsx(Mt,{onClick:()=>d(),...c,children:l})}var zy={exports:{}},td={},$y={exports:{}},Uy={};/**
|
|
562
|
+
* @license React
|
|
563
|
+
* scheduler.production.js
|
|
564
|
+
*
|
|
565
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
566
|
+
*
|
|
567
|
+
* This source code is licensed under the MIT license found in the
|
|
568
|
+
* LICENSE file in the root directory of this source tree.
|
|
569
|
+
*/var ZT;function VX(){return ZT||(ZT=1,(function(e){function t(L,I){var z=L.length;L.push(I);e:for(;0<z;){var V=z-1>>>1,J=L[V];if(0<o(J,I))L[V]=I,L[z]=J,z=V;else break e}}function n(L){return L.length===0?null:L[0]}function r(L){if(L.length===0)return null;var I=L[0],z=L.pop();if(z!==I){L[0]=z;e:for(var V=0,J=L.length,M=J>>>1;V<M;){var F=2*(V+1)-1,oe=L[F],ce=F+1,Se=L[ce];if(0>o(oe,z))ce<J&&0>o(Se,oe)?(L[V]=Se,L[ce]=z,V=ce):(L[V]=oe,L[F]=z,V=F);else if(ce<J&&0>o(Se,z))L[V]=Se,L[ce]=z,V=ce;else break e}}return I}function o(L,I){var z=L.sortIndex-I.sortIndex;return z!==0?z:L.id-I.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var l=performance;e.unstable_now=function(){return l.now()}}else{var c=Date,d=c.now();e.unstable_now=function(){return c.now()-d}}var f=[],p=[],m=1,g=null,y=3,b=!1,w=!1,j=!1,C=!1,T=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function _(L){for(var I=n(p);I!==null;){if(I.callback===null)r(p);else if(I.startTime<=L)r(p),I.sortIndex=I.expirationTime,t(f,I);else break;I=n(p)}}function k(L){if(j=!1,_(L),!w)if(n(f)!==null)w=!0,N||(N=!0,X());else{var I=n(p);I!==null&&W(k,I.startTime-L)}}var N=!1,A=-1,P=5,U=-1;function B(){return C?!0:!(e.unstable_now()-U<P)}function Y(){if(C=!1,N){var L=e.unstable_now();U=L;var I=!0;try{e:{w=!1,j&&(j=!1,E(A),A=-1),b=!0;var z=y;try{t:{for(_(L),g=n(f);g!==null&&!(g.expirationTime>L&&B());){var V=g.callback;if(typeof V=="function"){g.callback=null,y=g.priorityLevel;var J=V(g.expirationTime<=L);if(L=e.unstable_now(),typeof J=="function"){g.callback=J,_(L),I=!0;break t}g===n(f)&&r(f),_(L)}else r(f);g=n(f)}if(g!==null)I=!0;else{var M=n(p);M!==null&&W(k,M.startTime-L),I=!1}}break e}finally{g=null,y=z,b=!1}I=void 0}}finally{I?X():N=!1}}}var X;if(typeof R=="function")X=function(){R(Y)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,$=te.port2;te.port1.onmessage=Y,X=function(){$.postMessage(null)}}else X=function(){T(Y,0)};function W(L,I){A=T(function(){L(e.unstable_now())},I)}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(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125<L?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):P=0<L?Math.floor(1e3/L):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(L){switch(y){case 1:case 2:case 3:var I=3;break;default:I=y}var z=y;y=I;try{return L()}finally{y=z}},e.unstable_requestPaint=function(){C=!0},e.unstable_runWithPriority=function(L,I){switch(L){case 1:case 2:case 3:case 4:case 5:break;default:L=3}var z=y;y=L;try{return I()}finally{y=z}},e.unstable_scheduleCallback=function(L,I,z){var V=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?V+z:V):z=V,L){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=z+J,L={id:m++,callback:I,priorityLevel:L,startTime:z,expirationTime:J,sortIndex:-1},z>V?(L.sortIndex=z,t(p,L),n(f)===null&&L===n(p)&&(j?(E(A),A=-1):j=!0,W(k,z-V))):(L.sortIndex=J,t(f,L),w||b||(w=!0,N||(N=!0,X()))),L},e.unstable_shouldYield=B,e.unstable_wrapCallback=function(L){var I=y;return function(){var z=y;y=I;try{return L.apply(this,arguments)}finally{y=z}}}})(Uy)),Uy}var eR;function FX(){return eR||(eR=1,$y.exports=VX()),$y.exports}/**
|
|
570
|
+
* @license React
|
|
571
|
+
* react-dom-client.production.js
|
|
572
|
+
*
|
|
573
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
574
|
+
*
|
|
575
|
+
* This source code is licensed under the MIT license found in the
|
|
576
|
+
* LICENSE file in the root directory of this source tree.
|
|
577
|
+
*/var tR;function HX(){if(tR)return td;tR=1;var e=FX(),t=Yx(),n=E2();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function l(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function c(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(l(i)!==i)throw Error(r(188))}function p(i){var s=i.alternate;if(!s){if(s=l(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,h=s;;){var x=u.return;if(x===null)break;var S=x.alternate;if(S===null){if(h=x.return,h!==null){u=h;continue}break}if(x.child===S.child){for(S=x.child;S;){if(S===u)return f(x),i;if(S===h)return f(x),s;S=S.sibling}throw Error(r(188))}if(u.return!==h.return)u=x,h=S;else{for(var D=!1,O=x.child;O;){if(O===u){D=!0,u=x,h=S;break}if(O===h){D=!0,h=x,u=S;break}O=O.sibling}if(!D){for(O=S.child;O;){if(O===u){D=!0,u=S,h=x;break}if(O===h){D=!0,h=S,u=x;break}O=O.sibling}if(!D)throw Error(r(189))}}if(u.alternate!==h)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function m(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=m(i),s!==null)return s;i=i.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),j=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),R=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),A=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),B=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function X(i){return i===null||typeof i!="object"?null:(i=Y&&i[Y]||i["@@iterator"],typeof i=="function"?i:null)}var te=Symbol.for("react.client.reference");function $(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===te?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case j:return"Fragment";case T:return"Profiler";case C:return"StrictMode";case k:return"Suspense";case N:return"SuspenseList";case U:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case w:return"Portal";case R:return i.displayName||"Context";case E:return(i._context.displayName||"Context")+".Consumer";case _:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case A:return s=i.displayName||null,s!==null?s:$(i.type)||"Memo";case P:s=i._payload,i=i._init;try{return $(i(s))}catch{}}return null}var W=Array.isArray,L=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},V=[],J=-1;function M(i){return{current:i}}function F(i){0>J||(i.current=V[J],V[J]=null,J--)}function oe(i,s){J++,V[J]=i.current,i.current=s}var ce=M(null),Se=M(null),ge=M(null),Oe=M(null);function nt(i,s){switch(oe(ge,s),oe(Se,i),oe(ce,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?Kj(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=Kj(s),i=Xj(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}F(ce),oe(ce,i)}function Ce(){F(ce),F(Se),F(ge)}function ht(i){i.memoizedState!==null&&oe(Oe,i);var s=ce.current,u=Xj(s,i.type);s!==u&&(oe(Se,i),oe(ce,u))}function st(i){Se.current===i&&(F(ce),F(Se)),Oe.current===i&&(F(Oe),qu._currentValue=z)}var vt,rt;function wt(i){if(vt===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);vt=s&&s[1]||"",rt=-1<u.stack.indexOf(`
|
|
578
|
+
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
579
|
+
`+vt+i+rt}var pt=!1;function It(i,s){if(!i||pt)return"";pt=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var h={DetermineComponentFrameRoot:function(){try{if(s){var ye=function(){throw Error()};if(Object.defineProperty(ye.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ye,[])}catch(se){var ne=se}Reflect.construct(i,[],ye)}else{try{ye.call()}catch(se){ne=se}i.call(ye.prototype)}}else{try{throw Error()}catch(se){ne=se}(ye=i())&&typeof ye.catch=="function"&&ye.catch(function(){})}}catch(se){if(se&&ne&&typeof se.stack=="string")return[se.stack,ne.stack]}return[null,null]}};h.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(h.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(h.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var S=h.DetermineComponentFrameRoot(),D=S[0],O=S[1];if(D&&O){var H=D.split(`
|
|
580
|
+
`),ee=O.split(`
|
|
581
|
+
`);for(x=h=0;h<H.length&&!H[h].includes("DetermineComponentFrameRoot");)h++;for(;x<ee.length&&!ee[x].includes("DetermineComponentFrameRoot");)x++;if(h===H.length||x===ee.length)for(h=H.length-1,x=ee.length-1;1<=h&&0<=x&&H[h]!==ee[x];)x--;for(;1<=h&&0<=x;h--,x--)if(H[h]!==ee[x]){if(h!==1||x!==1)do if(h--,x--,0>x||H[h]!==ee[x]){var de=`
|
|
582
|
+
`+H[h].replace(" at new "," at ");return i.displayName&&de.includes("<anonymous>")&&(de=de.replace("<anonymous>",i.displayName)),de}while(1<=h&&0<=x);break}}}finally{pt=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?wt(u):""}function Te(i,s){switch(i.tag){case 26:case 27:case 5:return wt(i.type);case 16:return wt("Lazy");case 13:return i.child!==s&&s!==null?wt("Suspense Fallback"):wt("Suspense");case 19:return wt("SuspenseList");case 0:case 15:return It(i.type,!1);case 11:return It(i.type.render,!1);case 1:return It(i.type,!0);case 31:return wt("Activity");default:return""}}function Ee(i){try{var s="",u=null;do s+=Te(i,u),u=i,i=i.return;while(i);return s}catch(h){return`
|
|
583
|
+
Error generating stack: `+h.message+`
|
|
584
|
+
`+h.stack}}var Me=Object.prototype.hasOwnProperty,Pe=e.unstable_scheduleCallback,lt=e.unstable_cancelCallback,et=e.unstable_shouldYield,ot=e.unstable_requestPaint,ve=e.unstable_now,pe=e.unstable_getCurrentPriorityLevel,Ne=e.unstable_ImmediatePriority,tt=e.unstable_UserBlockingPriority,Tt=e.unstable_NormalPriority,wn=e.unstable_LowPriority,hn=e.unstable_IdlePriority,zn=e.log,Wn=e.unstable_setDisableYieldValue,$n=null,Rn=null;function Zn(i){if(typeof zn=="function"&&Wn(i),Rn&&typeof Rn.setStrictMode=="function")try{Rn.setStrictMode($n,i)}catch{}}var kn=Math.clz32?Math.clz32:Xr,Uo=Math.log,oo=Math.LN2;function Xr(i){return i>>>=0,i===0?32:31-(Uo(i)/oo|0)|0}var Bo=256,Ui=262144,ao=4194304;function Or(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function mr(i,s,u){var h=i.pendingLanes;if(h===0)return 0;var x=0,S=i.suspendedLanes,D=i.pingedLanes;i=i.warmLanes;var O=h&134217727;return O!==0?(h=O&~S,h!==0?x=Or(h):(D&=O,D!==0?x=Or(D):u||(u=O&~i,u!==0&&(x=Or(u))))):(O=h&~S,O!==0?x=Or(O):D!==0?x=Or(D):u||(u=h&~i,u!==0&&(x=Or(u)))),x===0?0:s!==0&&s!==x&&(s&S)===0&&(S=x&-x,u=s&-s,S>=u||S===32&&(u&4194048)!==0)?s:x}function Bi(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Qn(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vo(){var i=ao;return ao<<=1,(ao&62914560)===0&&(ao=4194304),i}function kl(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Fo(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function q(i,s,u,h,x,S){var D=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var O=i.entanglements,H=i.expirationTimes,ee=i.hiddenUpdates;for(u=D&~u;0<u;){var de=31-kn(u),ye=1<<de;O[de]=0,H[de]=-1;var ne=ee[de];if(ne!==null)for(ee[de]=null,de=0;de<ne.length;de++){var se=ne[de];se!==null&&(se.lane&=-536870913)}u&=~ye}h!==0&&Q(i,h,0),S!==0&&x===0&&i.tag!==0&&(i.suspendedLanes|=S&~(D&~s))}function Q(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var h=31-kn(s);i.entangledLanes|=s,i.entanglements[h]=i.entanglements[h]|1073741824|u&261930}function ie(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var h=31-kn(u),x=1<<h;x&s|i[h]&s&&(i[h]|=s),u&=~x}}function je(i,s){var u=s&-s;return u=(u&42)!==0?1:De(u),(u&(i.suspendedLanes|s))!==0?0:u}function De(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function qe(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function Xe(){var i=I.p;return i!==0?i:(i=window.event,i===void 0?32:bC(i.type))}function Ge(i,s){var u=I.p;try{return I.p=i,s()}finally{I.p=u}}var He=Math.random().toString(36).slice(2),Fe="__reactFiber$"+He,ze="__reactProps$"+He,We="__reactContainer$"+He,Ct="__reactEvents$"+He,Xt="__reactListeners$"+He,ct="__reactHandles$"+He,Pn="__reactResources$"+He,Ht="__reactMarker$"+He;function qt(i){delete i[Fe],delete i[ze],delete i[Ct],delete i[Xt],delete i[ct]}function Nr(i){var s=i[Fe];if(s)return s;for(var u=i.parentNode;u;){if(s=u[We]||u[Fe]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=iC(i);i!==null;){if(u=i[Fe])return u;i=iC(i)}return s}i=u,u=i.parentNode}return null}function hi(i){if(i=i[Fe]||i[We]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Mr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function sr(i){var s=i[Pn];return s||(s=i[Pn]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function On(i){i[Ht]=!0}var Pa=new Set,so={};function pi(i,s){Vi(i,s),Vi(i+"Capture",s)}function Vi(i,s){for(so[i]=s,i=0;i<s.length;i++)Pa.add(s[i])}var Pt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),er={},Ho={};function qo(i){return Me.call(Ho,i)?!0:Me.call(er,i)?!1:Pt.test(i)?Ho[i]=!0:(er[i]=!0,!1)}function jn(i,s,u){if(qo(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var h=s.toLowerCase().slice(0,5);if(h!=="data-"&&h!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Go(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function mi(i,s,u,h){if(h===null)i.removeAttribute(u);else{switch(typeof h){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+h)}}function Lr(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function VS(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function nO(i,s,u){var h=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var x=h.get,S=h.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return x.call(this)},set:function(D){u=""+D,S.call(this,D)}}),Object.defineProperty(i,s,{enumerable:h.enumerable}),{getValue:function(){return u},setValue:function(D){u=""+D},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function Wm(i){if(!i._valueTracker){var s=VS(i)?"checked":"value";i._valueTracker=nO(i,s,""+i[s])}}function FS(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),h="";return i&&(h=VS(i)?i.checked?"true":"false":i.value),i=h,i!==u?(s.setValue(i),!0):!1}function sf(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var rO=/[\n"\\]/g;function gi(i){return i.replace(rO,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Qm(i,s,u,h,x,S,D,O){i.name="",D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.type=D:i.removeAttribute("type"),s!=null?D==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Lr(s)):i.value!==""+Lr(s)&&(i.value=""+Lr(s)):D!=="submit"&&D!=="reset"||i.removeAttribute("value"),s!=null?Ym(i,D,Lr(s)):u!=null?Ym(i,D,Lr(u)):h!=null&&i.removeAttribute("value"),x==null&&S!=null&&(i.defaultChecked=!!S),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?i.name=""+Lr(O):i.removeAttribute("name")}function HS(i,s,u,h,x,S,D,O){if(S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(i.type=S),s!=null||u!=null){if(!(S!=="submit"&&S!=="reset"||s!=null)){Wm(i);return}u=u!=null?""+Lr(u):"",s=s!=null?""+Lr(s):u,O||s===i.value||(i.value=s),i.defaultValue=s}h=h??x,h=typeof h!="function"&&typeof h!="symbol"&&!!h,i.checked=O?i.checked:!!h,i.defaultChecked=!!h,D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"&&(i.name=D),Wm(i)}function Ym(i,s,u){s==="number"&&sf(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function Pl(i,s,u,h){if(i=i.options,s){s={};for(var x=0;x<u.length;x++)s["$"+u[x]]=!0;for(u=0;u<i.length;u++)x=s.hasOwnProperty("$"+i[u].value),i[u].selected!==x&&(i[u].selected=x),x&&h&&(i[u].defaultSelected=!0)}else{for(u=""+Lr(u),s=null,x=0;x<i.length;x++){if(i[x].value===u){i[x].selected=!0,h&&(i[x].defaultSelected=!0);return}s!==null||i[x].disabled||(s=i[x])}s!==null&&(s.selected=!0)}}function qS(i,s,u){if(s!=null&&(s=""+Lr(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+Lr(u):""}function GS(i,s,u,h){if(s==null){if(h!=null){if(u!=null)throw Error(r(92));if(W(h)){if(1<h.length)throw Error(r(93));h=h[0]}u=h}u==null&&(u=""),s=u}u=Lr(s),i.defaultValue=u,h=i.textContent,h===u&&h!==""&&h!==null&&(i.value=h),Wm(i)}function Ol(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var iO=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function WS(i,s,u){var h=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?h?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":h?i.setProperty(s,u):typeof u!="number"||u===0||iO.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function QS(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var h in u)!u.hasOwnProperty(h)||s!=null&&s.hasOwnProperty(h)||(h.indexOf("--")===0?i.setProperty(h,""):h==="float"?i.cssFloat="":i[h]="");for(var x in s)h=s[x],s.hasOwnProperty(x)&&u[x]!==h&&WS(i,x,h)}else for(var S in s)s.hasOwnProperty(S)&&WS(i,S,s[S])}function Km(i){if(i.indexOf("-")===-1)return!1;switch(i){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 oO=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),aO=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function lf(i){return aO.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Wo(){}var Xm=null;function Jm(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var Nl=null,Ml=null;function YS(i){var s=hi(i);if(s&&(i=s.stateNode)){var u=i[ze]||null;e:switch(i=s.stateNode,s.type){case"input":if(Qm(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+gi(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var h=u[s];if(h!==i&&h.form===i.form){var x=h[ze]||null;if(!x)throw Error(r(90));Qm(h,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(s=0;s<u.length;s++)h=u[s],h.form===i.form&&FS(h)}break e;case"textarea":qS(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&Pl(i,!!u.multiple,s,!1)}}}var Zm=!1;function KS(i,s,u){if(Zm)return i(s,u);Zm=!0;try{var h=i(s);return h}finally{if(Zm=!1,(Nl!==null||Ml!==null)&&(Yf(),Nl&&(s=Nl,i=Ml,Ml=Nl=null,YS(s),i)))for(s=0;s<i.length;s++)YS(i[s])}}function lu(i,s){var u=i.stateNode;if(u===null)return null;var h=u[ze]||null;if(h===null)return null;u=h[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(h=!h.disabled)||(i=i.type,h=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!h;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var Qo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),eg=!1;if(Qo)try{var cu={};Object.defineProperty(cu,"passive",{get:function(){eg=!0}}),window.addEventListener("test",cu,cu),window.removeEventListener("test",cu,cu)}catch{eg=!1}var Oa=null,tg=null,cf=null;function XS(){if(cf)return cf;var i,s=tg,u=s.length,h,x="value"in Oa?Oa.value:Oa.textContent,S=x.length;for(i=0;i<u&&s[i]===x[i];i++);var D=u-i;for(h=1;h<=D&&s[u-h]===x[S-h];h++);return cf=x.slice(i,1<h?1-h:void 0)}function uf(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function df(){return!0}function JS(){return!1}function Ir(i){function s(u,h,x,S,D){this._reactName=u,this._targetInst=x,this.type=h,this.nativeEvent=S,this.target=D,this.currentTarget=null;for(var O in i)i.hasOwnProperty(O)&&(u=i[O],this[O]=u?u(S):S[O]);return this.isDefaultPrevented=(S.defaultPrevented!=null?S.defaultPrevented:S.returnValue===!1)?df:JS,this.isPropagationStopped=JS,this}return g(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=df)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=df)},persist:function(){},isPersistent:df}),s}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ff=Ir(Ts),uu=g({},Ts,{view:0,detail:0}),sO=Ir(uu),ng,rg,du,hf=g({},uu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:og,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==du&&(du&&i.type==="mousemove"?(ng=i.screenX-du.screenX,rg=i.screenY-du.screenY):rg=ng=0,du=i),ng)},movementY:function(i){return"movementY"in i?i.movementY:rg}}),ZS=Ir(hf),lO=g({},hf,{dataTransfer:0}),cO=Ir(lO),uO=g({},uu,{relatedTarget:0}),ig=Ir(uO),dO=g({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),fO=Ir(dO),hO=g({},Ts,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),pO=Ir(hO),mO=g({},Ts,{data:0}),e1=Ir(mO),gO={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vO={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yO={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xO(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=yO[i])?!!s[i]:!1}function og(){return xO}var bO=g({},uu,{key:function(i){if(i.key){var s=gO[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=uf(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?vO[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:og,charCode:function(i){return i.type==="keypress"?uf(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?uf(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),SO=Ir(bO),wO=g({},hf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),t1=Ir(wO),jO=g({},uu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:og}),CO=Ir(jO),EO=g({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),TO=Ir(EO),RO=g({},hf,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),_O=Ir(RO),DO=g({},Ts,{newState:0,oldState:0}),AO=Ir(DO),kO=[9,13,27,32],ag=Qo&&"CompositionEvent"in window,fu=null;Qo&&"documentMode"in document&&(fu=document.documentMode);var PO=Qo&&"TextEvent"in window&&!fu,n1=Qo&&(!ag||fu&&8<fu&&11>=fu),r1=" ",i1=!1;function o1(i,s){switch(i){case"keyup":return kO.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function a1(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ll=!1;function OO(i,s){switch(i){case"compositionend":return a1(s);case"keypress":return s.which!==32?null:(i1=!0,r1);case"textInput":return i=s.data,i===r1&&i1?null:i;default:return null}}function NO(i,s){if(Ll)return i==="compositionend"||!ag&&o1(i,s)?(i=XS(),cf=tg=Oa=null,Ll=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return n1&&s.locale!=="ko"?null:s.data;default:return null}}var MO={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function s1(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!MO[i.type]:s==="textarea"}function l1(i,s,u,h){Nl?Ml?Ml.push(h):Ml=[h]:Nl=h,s=nh(s,"onChange"),0<s.length&&(u=new ff("onChange","change",null,u,h),i.push({event:u,listeners:s}))}var hu=null,pu=null;function LO(i){Hj(i,0)}function pf(i){var s=Mr(i);if(FS(s))return i}function c1(i,s){if(i==="change")return s}var u1=!1;if(Qo){var sg;if(Qo){var lg="oninput"in document;if(!lg){var d1=document.createElement("div");d1.setAttribute("oninput","return;"),lg=typeof d1.oninput=="function"}sg=lg}else sg=!1;u1=sg&&(!document.documentMode||9<document.documentMode)}function f1(){hu&&(hu.detachEvent("onpropertychange",h1),pu=hu=null)}function h1(i){if(i.propertyName==="value"&&pf(pu)){var s=[];l1(s,pu,i,Jm(i)),KS(LO,s)}}function IO(i,s,u){i==="focusin"?(f1(),hu=s,pu=u,hu.attachEvent("onpropertychange",h1)):i==="focusout"&&f1()}function zO(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return pf(pu)}function $O(i,s){if(i==="click")return pf(s)}function UO(i,s){if(i==="input"||i==="change")return pf(s)}function BO(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var Jr=typeof Object.is=="function"?Object.is:BO;function mu(i,s){if(Jr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),h=Object.keys(s);if(u.length!==h.length)return!1;for(h=0;h<u.length;h++){var x=u[h];if(!Me.call(s,x)||!Jr(i[x],s[x]))return!1}return!0}function p1(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function m1(i,s){var u=p1(i);i=0;for(var h;u;){if(u.nodeType===3){if(h=i+u.textContent.length,i<=s&&h>=s)return{node:u,offset:s-i};i=h}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=p1(u)}}function g1(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?g1(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function v1(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=sf(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=sf(i.document)}return s}function cg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var VO=Qo&&"documentMode"in document&&11>=document.documentMode,Il=null,ug=null,gu=null,dg=!1;function y1(i,s,u){var h=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;dg||Il==null||Il!==sf(h)||(h=Il,"selectionStart"in h&&cg(h)?h={start:h.selectionStart,end:h.selectionEnd}:(h=(h.ownerDocument&&h.ownerDocument.defaultView||window).getSelection(),h={anchorNode:h.anchorNode,anchorOffset:h.anchorOffset,focusNode:h.focusNode,focusOffset:h.focusOffset}),gu&&mu(gu,h)||(gu=h,h=nh(ug,"onSelect"),0<h.length&&(s=new ff("onSelect","select",null,s,u),i.push({event:s,listeners:h}),s.target=Il)))}function Rs(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var zl={animationend:Rs("Animation","AnimationEnd"),animationiteration:Rs("Animation","AnimationIteration"),animationstart:Rs("Animation","AnimationStart"),transitionrun:Rs("Transition","TransitionRun"),transitionstart:Rs("Transition","TransitionStart"),transitioncancel:Rs("Transition","TransitionCancel"),transitionend:Rs("Transition","TransitionEnd")},fg={},x1={};Qo&&(x1=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function _s(i){if(fg[i])return fg[i];if(!zl[i])return i;var s=zl[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in x1)return fg[i]=s[u];return i}var b1=_s("animationend"),S1=_s("animationiteration"),w1=_s("animationstart"),FO=_s("transitionrun"),HO=_s("transitionstart"),qO=_s("transitioncancel"),j1=_s("transitionend"),C1=new Map,hg="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");hg.push("scrollEnd");function Fi(i,s){C1.set(i,s),pi(s,[i])}var mf=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},vi=[],$l=0,pg=0;function gf(){for(var i=$l,s=pg=$l=0;s<i;){var u=vi[s];vi[s++]=null;var h=vi[s];vi[s++]=null;var x=vi[s];vi[s++]=null;var S=vi[s];if(vi[s++]=null,h!==null&&x!==null){var D=h.pending;D===null?x.next=x:(x.next=D.next,D.next=x),h.pending=x}S!==0&&E1(u,x,S)}}function vf(i,s,u,h){vi[$l++]=i,vi[$l++]=s,vi[$l++]=u,vi[$l++]=h,pg|=h,i.lanes|=h,i=i.alternate,i!==null&&(i.lanes|=h)}function mg(i,s,u,h){return vf(i,s,u,h),yf(i)}function Ds(i,s){return vf(i,null,null,s),yf(i)}function E1(i,s,u){i.lanes|=u;var h=i.alternate;h!==null&&(h.lanes|=u);for(var x=!1,S=i.return;S!==null;)S.childLanes|=u,h=S.alternate,h!==null&&(h.childLanes|=u),S.tag===22&&(i=S.stateNode,i===null||i._visibility&1||(x=!0)),i=S,S=S.return;return i.tag===3?(S=i.stateNode,x&&s!==null&&(x=31-kn(u),i=S.hiddenUpdates,h=i[x],h===null?i[x]=[s]:h.push(s),s.lane=u|536870912),S):null}function yf(i){if(50<zu)throw zu=0,Cv=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Ul={};function GO(i,s,u,h){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=h,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zr(i,s,u,h){return new GO(i,s,u,h)}function gg(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Yo(i,s){var u=i.alternate;return u===null?(u=Zr(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function T1(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function xf(i,s,u,h,x,S){var D=0;if(h=i,typeof i=="function")gg(i)&&(D=1);else if(typeof i=="string")D=X3(i,u,ce.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case U:return i=Zr(31,u,s,x),i.elementType=U,i.lanes=S,i;case j:return As(u.children,x,S,s);case C:D=8,x|=24;break;case T:return i=Zr(12,u,s,x|2),i.elementType=T,i.lanes=S,i;case k:return i=Zr(13,u,s,x),i.elementType=k,i.lanes=S,i;case N:return i=Zr(19,u,s,x),i.elementType=N,i.lanes=S,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case R:D=10;break e;case E:D=9;break e;case _:D=11;break e;case A:D=14;break e;case P:D=16,h=null;break e}D=29,u=Error(r(130,i===null?"null":typeof i,"")),h=null}return s=Zr(D,u,s,x),s.elementType=i,s.type=h,s.lanes=S,s}function As(i,s,u,h){return i=Zr(7,i,h,s),i.lanes=u,i}function vg(i,s,u){return i=Zr(6,i,null,s),i.lanes=u,i}function R1(i){var s=Zr(18,null,null,0);return s.stateNode=i,s}function yg(i,s,u){return s=Zr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var _1=new WeakMap;function yi(i,s){if(typeof i=="object"&&i!==null){var u=_1.get(i);return u!==void 0?u:(s={value:i,source:s,stack:Ee(s)},_1.set(i,s),s)}return{value:i,source:s,stack:Ee(s)}}var Bl=[],Vl=0,bf=null,vu=0,xi=[],bi=0,Na=null,lo=1,co="";function Ko(i,s){Bl[Vl++]=vu,Bl[Vl++]=bf,bf=i,vu=s}function D1(i,s,u){xi[bi++]=lo,xi[bi++]=co,xi[bi++]=Na,Na=i;var h=lo;i=co;var x=32-kn(h)-1;h&=~(1<<x),u+=1;var S=32-kn(s)+x;if(30<S){var D=x-x%5;S=(h&(1<<D)-1).toString(32),h>>=D,x-=D,lo=1<<32-kn(s)+x|u<<x|h,co=S+i}else lo=1<<S|u<<x|h,co=i}function xg(i){i.return!==null&&(Ko(i,1),D1(i,1,0))}function bg(i){for(;i===bf;)bf=Bl[--Vl],Bl[Vl]=null,vu=Bl[--Vl],Bl[Vl]=null;for(;i===Na;)Na=xi[--bi],xi[bi]=null,co=xi[--bi],xi[bi]=null,lo=xi[--bi],xi[bi]=null}function A1(i,s){xi[bi++]=lo,xi[bi++]=co,xi[bi++]=Na,lo=s.id,co=s.overflow,Na=i}var lr=null,pn=null,Ot=!1,Ma=null,Si=!1,Sg=Error(r(519));function La(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw yu(yi(s,i)),Sg}function k1(i){var s=i.stateNode,u=i.type,h=i.memoizedProps;switch(s[Fe]=i,s[ze]=h,u){case"dialog":_t("cancel",s),_t("close",s);break;case"iframe":case"object":case"embed":_t("load",s);break;case"video":case"audio":for(u=0;u<Uu.length;u++)_t(Uu[u],s);break;case"source":_t("error",s);break;case"img":case"image":case"link":_t("error",s),_t("load",s);break;case"details":_t("toggle",s);break;case"input":_t("invalid",s),HS(s,h.value,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name,!0);break;case"select":_t("invalid",s);break;case"textarea":_t("invalid",s),GS(s,h.value,h.defaultValue,h.children)}u=h.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||h.suppressHydrationWarning===!0||Qj(s.textContent,u)?(h.popover!=null&&(_t("beforetoggle",s),_t("toggle",s)),h.onScroll!=null&&_t("scroll",s),h.onScrollEnd!=null&&_t("scrollend",s),h.onClick!=null&&(s.onclick=Wo),s=!0):s=!1,s||La(i,!0)}function P1(i){for(lr=i.return;lr;)switch(lr.tag){case 5:case 31:case 13:Si=!1;return;case 27:case 3:Si=!0;return;default:lr=lr.return}}function Fl(i){if(i!==lr)return!1;if(!Ot)return P1(i),Ot=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||$v(i.type,i.memoizedProps)),u=!u),u&&pn&&La(i),P1(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));pn=rC(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));pn=rC(i)}else s===27?(s=pn,Ka(i.type)?(i=Hv,Hv=null,pn=i):pn=s):pn=lr?ji(i.stateNode.nextSibling):null;return!0}function ks(){pn=lr=null,Ot=!1}function wg(){var i=Ma;return i!==null&&(Br===null?Br=i:Br.push.apply(Br,i),Ma=null),i}function yu(i){Ma===null?Ma=[i]:Ma.push(i)}var jg=M(null),Ps=null,Xo=null;function Ia(i,s,u){oe(jg,s._currentValue),s._currentValue=u}function Jo(i){i._currentValue=jg.current,F(jg)}function Cg(i,s,u){for(;i!==null;){var h=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,h!==null&&(h.childLanes|=s)):h!==null&&(h.childLanes&s)!==s&&(h.childLanes|=s),i===u)break;i=i.return}}function Eg(i,s,u,h){var x=i.child;for(x!==null&&(x.return=i);x!==null;){var S=x.dependencies;if(S!==null){var D=x.child;S=S.firstContext;e:for(;S!==null;){var O=S;S=x;for(var H=0;H<s.length;H++)if(O.context===s[H]){S.lanes|=u,O=S.alternate,O!==null&&(O.lanes|=u),Cg(S.return,u,i),h||(D=null);break e}S=O.next}}else if(x.tag===18){if(D=x.return,D===null)throw Error(r(341));D.lanes|=u,S=D.alternate,S!==null&&(S.lanes|=u),Cg(D,u,i),D=null}else D=x.child;if(D!==null)D.return=x;else for(D=x;D!==null;){if(D===i){D=null;break}if(x=D.sibling,x!==null){x.return=D.return,D=x;break}D=D.return}x=D}}function Hl(i,s,u,h){i=null;for(var x=s,S=!1;x!==null;){if(!S){if((x.flags&524288)!==0)S=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var D=x.alternate;if(D===null)throw Error(r(387));if(D=D.memoizedProps,D!==null){var O=x.type;Jr(x.pendingProps.value,D.value)||(i!==null?i.push(O):i=[O])}}else if(x===Oe.current){if(D=x.alternate,D===null)throw Error(r(387));D.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(i!==null?i.push(qu):i=[qu])}x=x.return}i!==null&&Eg(s,i,u,h),s.flags|=262144}function Sf(i){for(i=i.firstContext;i!==null;){if(!Jr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function Os(i){Ps=i,Xo=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function cr(i){return O1(Ps,i)}function wf(i,s){return Ps===null&&Os(i),O1(i,s)}function O1(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Xo===null){if(i===null)throw Error(r(308));Xo=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Xo=Xo.next=s;return u}var WO=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,h){i.push(h)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},QO=e.unstable_scheduleCallback,YO=e.unstable_NormalPriority,Yn={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tg(){return{controller:new WO,data:new Map,refCount:0}}function xu(i){i.refCount--,i.refCount===0&&QO(YO,function(){i.controller.abort()})}var bu=null,Rg=0,ql=0,Gl=null;function KO(i,s){if(bu===null){var u=bu=[];Rg=0,ql=Av(),Gl={status:"pending",value:void 0,then:function(h){u.push(h)}}}return Rg++,s.then(N1,N1),s}function N1(){if(--Rg===0&&bu!==null){Gl!==null&&(Gl.status="fulfilled");var i=bu;bu=null,ql=0,Gl=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function XO(i,s){var u=[],h={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return i.then(function(){h.status="fulfilled",h.value=s;for(var x=0;x<u.length;x++)(0,u[x])(s)},function(x){for(h.status="rejected",h.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),h}var M1=L.S;L.S=function(i,s){yj=ve(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&KO(i,s),M1!==null&&M1(i,s)};var Ns=M(null);function _g(){var i=Ns.current;return i!==null?i:an.pooledCache}function jf(i,s){s===null?oe(Ns,Ns.current):oe(Ns,s.pool)}function L1(){var i=_g();return i===null?null:{parent:Yn._currentValue,pool:i}}var Wl=Error(r(460)),Dg=Error(r(474)),Cf=Error(r(542)),Ef={then:function(){}};function I1(i){return i=i.status,i==="fulfilled"||i==="rejected"}function z1(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(Wo,Wo),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,U1(i),i;default:if(typeof s.status=="string")s.then(Wo,Wo);else{if(i=an,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(h){if(s.status==="pending"){var x=s;x.status="fulfilled",x.value=h}},function(h){if(s.status==="pending"){var x=s;x.status="rejected",x.reason=h}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,U1(i),i}throw Ls=s,Wl}}function Ms(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Ls=u,Wl):u}}var Ls=null;function $1(){if(Ls===null)throw Error(r(459));var i=Ls;return Ls=null,i}function U1(i){if(i===Wl||i===Cf)throw Error(r(483))}var Ql=null,Su=0;function Tf(i){var s=Su;return Su+=1,Ql===null&&(Ql=[]),z1(Ql,i,s)}function wu(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Rf(i,s){throw s.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function B1(i){function s(K,G){if(i){var Z=K.deletions;Z===null?(K.deletions=[G],K.flags|=16):Z.push(G)}}function u(K,G){if(!i)return null;for(;G!==null;)s(K,G),G=G.sibling;return null}function h(K){for(var G=new Map;K!==null;)K.key!==null?G.set(K.key,K):G.set(K.index,K),K=K.sibling;return G}function x(K,G){return K=Yo(K,G),K.index=0,K.sibling=null,K}function S(K,G,Z){return K.index=Z,i?(Z=K.alternate,Z!==null?(Z=Z.index,Z<G?(K.flags|=67108866,G):Z):(K.flags|=67108866,G)):(K.flags|=1048576,G)}function D(K){return i&&K.alternate===null&&(K.flags|=67108866),K}function O(K,G,Z,me){return G===null||G.tag!==6?(G=vg(Z,K.mode,me),G.return=K,G):(G=x(G,Z),G.return=K,G)}function H(K,G,Z,me){var it=Z.type;return it===j?de(K,G,Z.props.children,me,Z.key):G!==null&&(G.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===P&&Ms(it)===G.type)?(G=x(G,Z.props),wu(G,Z),G.return=K,G):(G=xf(Z.type,Z.key,Z.props,null,K.mode,me),wu(G,Z),G.return=K,G)}function ee(K,G,Z,me){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=yg(Z,K.mode,me),G.return=K,G):(G=x(G,Z.children||[]),G.return=K,G)}function de(K,G,Z,me,it){return G===null||G.tag!==7?(G=As(Z,K.mode,me,it),G.return=K,G):(G=x(G,Z),G.return=K,G)}function ye(K,G,Z){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=vg(""+G,K.mode,Z),G.return=K,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case b:return Z=xf(G.type,G.key,G.props,null,K.mode,Z),wu(Z,G),Z.return=K,Z;case w:return G=yg(G,K.mode,Z),G.return=K,G;case P:return G=Ms(G),ye(K,G,Z)}if(W(G)||X(G))return G=As(G,K.mode,Z,null),G.return=K,G;if(typeof G.then=="function")return ye(K,Tf(G),Z);if(G.$$typeof===R)return ye(K,wf(K,G),Z);Rf(K,G)}return null}function ne(K,G,Z,me){var it=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return it!==null?null:O(K,G,""+Z,me);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:return Z.key===it?H(K,G,Z,me):null;case w:return Z.key===it?ee(K,G,Z,me):null;case P:return Z=Ms(Z),ne(K,G,Z,me)}if(W(Z)||X(Z))return it!==null?null:de(K,G,Z,me,null);if(typeof Z.then=="function")return ne(K,G,Tf(Z),me);if(Z.$$typeof===R)return ne(K,G,wf(K,Z),me);Rf(K,Z)}return null}function se(K,G,Z,me,it){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return K=K.get(Z)||null,O(G,K,""+me,it);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case b:return K=K.get(me.key===null?Z:me.key)||null,H(G,K,me,it);case w:return K=K.get(me.key===null?Z:me.key)||null,ee(G,K,me,it);case P:return me=Ms(me),se(K,G,Z,me,it)}if(W(me)||X(me))return K=K.get(Z)||null,de(G,K,me,it,null);if(typeof me.then=="function")return se(K,G,Z,Tf(me),it);if(me.$$typeof===R)return se(K,G,Z,wf(G,me),it);Rf(G,me)}return null}function Qe(K,G,Z,me){for(var it=null,Ut=null,Je=G,jt=G=0,At=null;Je!==null&&jt<Z.length;jt++){Je.index>jt?(At=Je,Je=null):At=Je.sibling;var Bt=ne(K,Je,Z[jt],me);if(Bt===null){Je===null&&(Je=At);break}i&&Je&&Bt.alternate===null&&s(K,Je),G=S(Bt,G,jt),Ut===null?it=Bt:Ut.sibling=Bt,Ut=Bt,Je=At}if(jt===Z.length)return u(K,Je),Ot&&Ko(K,jt),it;if(Je===null){for(;jt<Z.length;jt++)Je=ye(K,Z[jt],me),Je!==null&&(G=S(Je,G,jt),Ut===null?it=Je:Ut.sibling=Je,Ut=Je);return Ot&&Ko(K,jt),it}for(Je=h(Je);jt<Z.length;jt++)At=se(Je,K,jt,Z[jt],me),At!==null&&(i&&At.alternate!==null&&Je.delete(At.key===null?jt:At.key),G=S(At,G,jt),Ut===null?it=At:Ut.sibling=At,Ut=At);return i&&Je.forEach(function(ts){return s(K,ts)}),Ot&&Ko(K,jt),it}function ut(K,G,Z,me){if(Z==null)throw Error(r(151));for(var it=null,Ut=null,Je=G,jt=G=0,At=null,Bt=Z.next();Je!==null&&!Bt.done;jt++,Bt=Z.next()){Je.index>jt?(At=Je,Je=null):At=Je.sibling;var ts=ne(K,Je,Bt.value,me);if(ts===null){Je===null&&(Je=At);break}i&&Je&&ts.alternate===null&&s(K,Je),G=S(ts,G,jt),Ut===null?it=ts:Ut.sibling=ts,Ut=ts,Je=At}if(Bt.done)return u(K,Je),Ot&&Ko(K,jt),it;if(Je===null){for(;!Bt.done;jt++,Bt=Z.next())Bt=ye(K,Bt.value,me),Bt!==null&&(G=S(Bt,G,jt),Ut===null?it=Bt:Ut.sibling=Bt,Ut=Bt);return Ot&&Ko(K,jt),it}for(Je=h(Je);!Bt.done;jt++,Bt=Z.next())Bt=se(Je,K,jt,Bt.value,me),Bt!==null&&(i&&Bt.alternate!==null&&Je.delete(Bt.key===null?jt:Bt.key),G=S(Bt,G,jt),Ut===null?it=Bt:Ut.sibling=Bt,Ut=Bt);return i&&Je.forEach(function(lN){return s(K,lN)}),Ot&&Ko(K,jt),it}function rn(K,G,Z,me){if(typeof Z=="object"&&Z!==null&&Z.type===j&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case b:e:{for(var it=Z.key;G!==null;){if(G.key===it){if(it=Z.type,it===j){if(G.tag===7){u(K,G.sibling),me=x(G,Z.props.children),me.return=K,K=me;break e}}else if(G.elementType===it||typeof it=="object"&&it!==null&&it.$$typeof===P&&Ms(it)===G.type){u(K,G.sibling),me=x(G,Z.props),wu(me,Z),me.return=K,K=me;break e}u(K,G);break}else s(K,G);G=G.sibling}Z.type===j?(me=As(Z.props.children,K.mode,me,Z.key),me.return=K,K=me):(me=xf(Z.type,Z.key,Z.props,null,K.mode,me),wu(me,Z),me.return=K,K=me)}return D(K);case w:e:{for(it=Z.key;G!==null;){if(G.key===it)if(G.tag===4&&G.stateNode.containerInfo===Z.containerInfo&&G.stateNode.implementation===Z.implementation){u(K,G.sibling),me=x(G,Z.children||[]),me.return=K,K=me;break e}else{u(K,G);break}else s(K,G);G=G.sibling}me=yg(Z,K.mode,me),me.return=K,K=me}return D(K);case P:return Z=Ms(Z),rn(K,G,Z,me)}if(W(Z))return Qe(K,G,Z,me);if(X(Z)){if(it=X(Z),typeof it!="function")throw Error(r(150));return Z=it.call(Z),ut(K,G,Z,me)}if(typeof Z.then=="function")return rn(K,G,Tf(Z),me);if(Z.$$typeof===R)return rn(K,G,wf(K,Z),me);Rf(K,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,G!==null&&G.tag===6?(u(K,G.sibling),me=x(G,Z),me.return=K,K=me):(u(K,G),me=vg(Z,K.mode,me),me.return=K,K=me),D(K)):u(K,G)}return function(K,G,Z,me){try{Su=0;var it=rn(K,G,Z,me);return Ql=null,it}catch(Je){if(Je===Wl||Je===Cf)throw Je;var Ut=Zr(29,Je,null,K.mode);return Ut.lanes=me,Ut.return=K,Ut}finally{}}}var Is=B1(!0),V1=B1(!1),za=!1;function Ag(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function kg(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function $a(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Ua(i,s,u){var h=i.updateQueue;if(h===null)return null;if(h=h.shared,(Gt&2)!==0){var x=h.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),h.pending=s,s=yf(i),E1(i,null,u),s}return vf(i,h,s,u),yf(i)}function ju(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,ie(i,u)}}function Pg(i,s){var u=i.updateQueue,h=i.alternate;if(h!==null&&(h=h.updateQueue,u===h)){var x=null,S=null;if(u=u.firstBaseUpdate,u!==null){do{var D={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};S===null?x=S=D:S=S.next=D,u=u.next}while(u!==null);S===null?x=S=s:S=S.next=s}else x=S=s;u={baseState:h.baseState,firstBaseUpdate:x,lastBaseUpdate:S,shared:h.shared,callbacks:h.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var Og=!1;function Cu(){if(Og){var i=Gl;if(i!==null)throw i}}function Eu(i,s,u,h){Og=!1;var x=i.updateQueue;za=!1;var S=x.firstBaseUpdate,D=x.lastBaseUpdate,O=x.shared.pending;if(O!==null){x.shared.pending=null;var H=O,ee=H.next;H.next=null,D===null?S=ee:D.next=ee,D=H;var de=i.alternate;de!==null&&(de=de.updateQueue,O=de.lastBaseUpdate,O!==D&&(O===null?de.firstBaseUpdate=ee:O.next=ee,de.lastBaseUpdate=H))}if(S!==null){var ye=x.baseState;D=0,de=ee=H=null,O=S;do{var ne=O.lane&-536870913,se=ne!==O.lane;if(se?(Dt&ne)===ne:(h&ne)===ne){ne!==0&&ne===ql&&(Og=!0),de!==null&&(de=de.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});e:{var Qe=i,ut=O;ne=s;var rn=u;switch(ut.tag){case 1:if(Qe=ut.payload,typeof Qe=="function"){ye=Qe.call(rn,ye,ne);break e}ye=Qe;break e;case 3:Qe.flags=Qe.flags&-65537|128;case 0:if(Qe=ut.payload,ne=typeof Qe=="function"?Qe.call(rn,ye,ne):Qe,ne==null)break e;ye=g({},ye,ne);break e;case 2:za=!0}}ne=O.callback,ne!==null&&(i.flags|=64,se&&(i.flags|=8192),se=x.callbacks,se===null?x.callbacks=[ne]:se.push(ne))}else se={lane:ne,tag:O.tag,payload:O.payload,callback:O.callback,next:null},de===null?(ee=de=se,H=ye):de=de.next=se,D|=ne;if(O=O.next,O===null){if(O=x.shared.pending,O===null)break;se=O,O=se.next,se.next=null,x.lastBaseUpdate=se,x.shared.pending=null}}while(!0);de===null&&(H=ye),x.baseState=H,x.firstBaseUpdate=ee,x.lastBaseUpdate=de,S===null&&(x.shared.lanes=0),qa|=D,i.lanes=D,i.memoizedState=ye}}function F1(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function H1(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)F1(u[i],s)}var Yl=M(null),_f=M(0);function q1(i,s){i=sa,oe(_f,i),oe(Yl,s),sa=i|s.baseLanes}function Ng(){oe(_f,sa),oe(Yl,Yl.current)}function Mg(){sa=_f.current,F(Yl),F(_f)}var ei=M(null),wi=null;function Ba(i){var s=i.alternate;oe(Un,Un.current&1),oe(ei,i),wi===null&&(s===null||Yl.current!==null||s.memoizedState!==null)&&(wi=i)}function Lg(i){oe(Un,Un.current),oe(ei,i),wi===null&&(wi=i)}function G1(i){i.tag===22?(oe(Un,Un.current),oe(ei,i),wi===null&&(wi=i)):Va()}function Va(){oe(Un,Un.current),oe(ei,ei.current)}function ti(i){F(ei),wi===i&&(wi=null),F(Un)}var Un=M(0);function Df(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||Vv(u)||Fv(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Zo=0,xt=null,tn=null,Kn=null,Af=!1,Kl=!1,zs=!1,kf=0,Tu=0,Xl=null,JO=0;function Nn(){throw Error(r(321))}function Ig(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!Jr(i[u],s[u]))return!1;return!0}function zg(i,s,u,h,x,S){return Zo=S,xt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,L.H=i===null||i.memoizedState===null?Dw:Zg,zs=!1,S=u(h,x),zs=!1,Kl&&(S=Q1(s,u,h,x)),W1(i),S}function W1(i){L.H=Du;var s=tn!==null&&tn.next!==null;if(Zo=0,Kn=tn=xt=null,Af=!1,Tu=0,Xl=null,s)throw Error(r(300));i===null||Xn||(i=i.dependencies,i!==null&&Sf(i)&&(Xn=!0))}function Q1(i,s,u,h){xt=i;var x=0;do{if(Kl&&(Xl=null),Tu=0,Kl=!1,25<=x)throw Error(r(301));if(x+=1,Kn=tn=null,i.updateQueue!=null){var S=i.updateQueue;S.lastEffect=null,S.events=null,S.stores=null,S.memoCache!=null&&(S.memoCache.index=0)}L.H=Aw,S=s(u,h)}while(Kl);return S}function ZO(){var i=L.H,s=i.useState()[0];return s=typeof s.then=="function"?Ru(s):s,i=i.useState()[0],(tn!==null?tn.memoizedState:null)!==i&&(xt.flags|=1024),s}function $g(){var i=kf!==0;return kf=0,i}function Ug(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function Bg(i){if(Af){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Af=!1}Zo=0,Kn=tn=xt=null,Kl=!1,Tu=kf=0,Xl=null}function Er(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kn===null?xt.memoizedState=Kn=i:Kn=Kn.next=i,Kn}function Bn(){if(tn===null){var i=xt.alternate;i=i!==null?i.memoizedState:null}else i=tn.next;var s=Kn===null?xt.memoizedState:Kn.next;if(s!==null)Kn=s,tn=i;else{if(i===null)throw xt.alternate===null?Error(r(467)):Error(r(310));tn=i,i={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},Kn===null?xt.memoizedState=Kn=i:Kn=Kn.next=i}return Kn}function Pf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ru(i){var s=Tu;return Tu+=1,Xl===null&&(Xl=[]),i=z1(Xl,i,s),s=xt,(Kn===null?s.memoizedState:Kn.next)===null&&(s=s.alternate,L.H=s===null||s.memoizedState===null?Dw:Zg),i}function Of(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ru(i);if(i.$$typeof===R)return cr(i)}throw Error(r(438,String(i)))}function Vg(i){var s=null,u=xt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var h=xt.alternate;h!==null&&(h=h.updateQueue,h!==null&&(h=h.memoCache,h!=null&&(s={data:h.data.map(function(x){return x.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Pf(),xt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),h=0;h<i;h++)u[h]=B;return s.index++,u}function ea(i,s){return typeof s=="function"?s(i):s}function Nf(i){var s=Bn();return Fg(s,tn,i)}function Fg(i,s,u){var h=i.queue;if(h===null)throw Error(r(311));h.lastRenderedReducer=u;var x=i.baseQueue,S=h.pending;if(S!==null){if(x!==null){var D=x.next;x.next=S.next,S.next=D}s.baseQueue=x=S,h.pending=null}if(S=i.baseState,x===null)i.memoizedState=S;else{s=x.next;var O=D=null,H=null,ee=s,de=!1;do{var ye=ee.lane&-536870913;if(ye!==ee.lane?(Dt&ye)===ye:(Zo&ye)===ye){var ne=ee.revertLane;if(ne===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ye===ql&&(de=!0);else if((Zo&ne)===ne){ee=ee.next,ne===ql&&(de=!0);continue}else ye={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(O=H=ye,D=S):H=H.next=ye,xt.lanes|=ne,qa|=ne;ye=ee.action,zs&&u(S,ye),S=ee.hasEagerState?ee.eagerState:u(S,ye)}else ne={lane:ye,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},H===null?(O=H=ne,D=S):H=H.next=ne,xt.lanes|=ye,qa|=ye;ee=ee.next}while(ee!==null&&ee!==s);if(H===null?D=S:H.next=O,!Jr(S,i.memoizedState)&&(Xn=!0,de&&(u=Gl,u!==null)))throw u;i.memoizedState=S,i.baseState=D,i.baseQueue=H,h.lastRenderedState=S}return x===null&&(h.lanes=0),[i.memoizedState,h.dispatch]}function Hg(i){var s=Bn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var h=u.dispatch,x=u.pending,S=s.memoizedState;if(x!==null){u.pending=null;var D=x=x.next;do S=i(S,D.action),D=D.next;while(D!==x);Jr(S,s.memoizedState)||(Xn=!0),s.memoizedState=S,s.baseQueue===null&&(s.baseState=S),u.lastRenderedState=S}return[S,h]}function Y1(i,s,u){var h=xt,x=Bn(),S=Ot;if(S){if(u===void 0)throw Error(r(407));u=u()}else u=s();var D=!Jr((tn||x).memoizedState,u);if(D&&(x.memoizedState=u,Xn=!0),x=x.queue,Wg(J1.bind(null,h,x,i),[i]),x.getSnapshot!==s||D||Kn!==null&&Kn.memoizedState.tag&1){if(h.flags|=2048,Jl(9,{destroy:void 0},X1.bind(null,h,x,u,s),null),an===null)throw Error(r(349));S||(Zo&127)!==0||K1(h,s,u)}return u}function K1(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=xt.updateQueue,s===null?(s=Pf(),xt.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function X1(i,s,u,h){s.value=u,s.getSnapshot=h,Z1(s)&&ew(i)}function J1(i,s,u){return u(function(){Z1(s)&&ew(i)})}function Z1(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!Jr(i,u)}catch{return!0}}function ew(i){var s=Ds(i,2);s!==null&&Vr(s,i,2)}function qg(i){var s=Er();if(typeof i=="function"){var u=i;if(i=u(),zs){Zn(!0);try{u()}finally{Zn(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:i},s}function tw(i,s,u,h){return i.baseState=u,Fg(i,tn,typeof h=="function"?h:ea)}function e3(i,s,u,h,x){if(If(i))throw Error(r(485));if(i=s.action,i!==null){var S={payload:x,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(D){S.listeners.push(D)}};L.T!==null?u(!0):S.isTransition=!1,h(S),u=s.pending,u===null?(S.next=s.pending=S,nw(s,S)):(S.next=u.next,s.pending=u.next=S)}}function nw(i,s){var u=s.action,h=s.payload,x=i.state;if(s.isTransition){var S=L.T,D={};L.T=D;try{var O=u(x,h),H=L.S;H!==null&&H(D,O),rw(i,s,O)}catch(ee){Gg(i,s,ee)}finally{S!==null&&D.types!==null&&(S.types=D.types),L.T=S}}else try{S=u(x,h),rw(i,s,S)}catch(ee){Gg(i,s,ee)}}function rw(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(h){iw(i,s,h)},function(h){return Gg(i,s,h)}):iw(i,s,u)}function iw(i,s,u){s.status="fulfilled",s.value=u,ow(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,nw(i,u)))}function Gg(i,s,u){var h=i.pending;if(i.pending=null,h!==null){h=h.next;do s.status="rejected",s.reason=u,ow(s),s=s.next;while(s!==h)}i.action=null}function ow(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function aw(i,s){return s}function sw(i,s){if(Ot){var u=an.formState;if(u!==null){e:{var h=xt;if(Ot){if(pn){t:{for(var x=pn,S=Si;x.nodeType!==8;){if(!S){x=null;break t}if(x=ji(x.nextSibling),x===null){x=null;break t}}S=x.data,x=S==="F!"||S==="F"?x:null}if(x){pn=ji(x.nextSibling),h=x.data==="F!";break e}}La(h)}h=!1}h&&(s=u[0])}}return u=Er(),u.memoizedState=u.baseState=s,h={pending:null,lanes:0,dispatch:null,lastRenderedReducer:aw,lastRenderedState:s},u.queue=h,u=Tw.bind(null,xt,h),h.dispatch=u,h=qg(!1),S=Jg.bind(null,xt,!1,h.queue),h=Er(),x={state:s,dispatch:null,action:i,pending:null},h.queue=x,u=e3.bind(null,xt,x,S,u),x.dispatch=u,h.memoizedState=i,[s,u,!1]}function lw(i){var s=Bn();return cw(s,tn,i)}function cw(i,s,u){if(s=Fg(i,s,aw)[0],i=Nf(ea)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var h=Ru(s)}catch(D){throw D===Wl?Cf:D}else h=s;s=Bn();var x=s.queue,S=x.dispatch;return u!==s.memoizedState&&(xt.flags|=2048,Jl(9,{destroy:void 0},t3.bind(null,x,u),null)),[h,S,i]}function t3(i,s){i.action=s}function uw(i){var s=Bn(),u=tn;if(u!==null)return cw(s,u,i);Bn(),s=s.memoizedState,u=Bn();var h=u.queue.dispatch;return u.memoizedState=i,[s,h,!1]}function Jl(i,s,u,h){return i={tag:i,create:u,deps:h,inst:s,next:null},s=xt.updateQueue,s===null&&(s=Pf(),xt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(h=u.next,u.next=i,i.next=h,s.lastEffect=i),i}function dw(){return Bn().memoizedState}function Mf(i,s,u,h){var x=Er();xt.flags|=i,x.memoizedState=Jl(1|s,{destroy:void 0},u,h===void 0?null:h)}function Lf(i,s,u,h){var x=Bn();h=h===void 0?null:h;var S=x.memoizedState.inst;tn!==null&&h!==null&&Ig(h,tn.memoizedState.deps)?x.memoizedState=Jl(s,S,u,h):(xt.flags|=i,x.memoizedState=Jl(1|s,S,u,h))}function fw(i,s){Mf(8390656,8,i,s)}function Wg(i,s){Lf(2048,8,i,s)}function n3(i){xt.flags|=4;var s=xt.updateQueue;if(s===null)s=Pf(),xt.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function hw(i){var s=Bn().memoizedState;return n3({ref:s,nextImpl:i}),function(){if((Gt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function pw(i,s){return Lf(4,2,i,s)}function mw(i,s){return Lf(4,4,i,s)}function gw(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function vw(i,s,u){u=u!=null?u.concat([i]):null,Lf(4,4,gw.bind(null,s,i),u)}function Qg(){}function yw(i,s){var u=Bn();s=s===void 0?null:s;var h=u.memoizedState;return s!==null&&Ig(s,h[1])?h[0]:(u.memoizedState=[i,s],i)}function xw(i,s){var u=Bn();s=s===void 0?null:s;var h=u.memoizedState;if(s!==null&&Ig(s,h[1]))return h[0];if(h=i(),zs){Zn(!0);try{i()}finally{Zn(!1)}}return u.memoizedState=[h,s],h}function Yg(i,s,u){return u===void 0||(Zo&1073741824)!==0&&(Dt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=bj(),xt.lanes|=i,qa|=i,u)}function bw(i,s,u,h){return Jr(u,s)?u:Yl.current!==null?(i=Yg(i,u,h),Jr(i,s)||(Xn=!0),i):(Zo&42)===0||(Zo&1073741824)!==0&&(Dt&261930)===0?(Xn=!0,i.memoizedState=u):(i=bj(),xt.lanes|=i,qa|=i,s)}function Sw(i,s,u,h,x){var S=I.p;I.p=S!==0&&8>S?S:8;var D=L.T,O={};L.T=O,Jg(i,!1,s,u);try{var H=x(),ee=L.S;if(ee!==null&&ee(O,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var de=XO(H,h);_u(i,s,de,ii(i))}else _u(i,s,h,ii(i))}catch(ye){_u(i,s,{then:function(){},status:"rejected",reason:ye},ii())}finally{I.p=S,D!==null&&O.types!==null&&(D.types=O.types),L.T=D}}function r3(){}function Kg(i,s,u,h){if(i.tag!==5)throw Error(r(476));var x=ww(i).queue;Sw(i,x,s,z,u===null?r3:function(){return jw(i),u(h)})}function ww(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:z},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ea,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function jw(i){var s=ww(i);s.next===null&&(s=i.alternate.memoizedState),_u(i,s.next.queue,{},ii())}function Xg(){return cr(qu)}function Cw(){return Bn().memoizedState}function Ew(){return Bn().memoizedState}function i3(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=ii();i=$a(u);var h=Ua(s,i,u);h!==null&&(Vr(h,s,u),ju(h,s,u)),s={cache:Tg()},i.payload=s;return}s=s.return}}function o3(i,s,u){var h=ii();u={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},If(i)?Rw(s,u):(u=mg(i,s,u,h),u!==null&&(Vr(u,i,h),_w(u,s,h)))}function Tw(i,s,u){var h=ii();_u(i,s,u,h)}function _u(i,s,u,h){var x={lane:h,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(If(i))Rw(s,x);else{var S=i.alternate;if(i.lanes===0&&(S===null||S.lanes===0)&&(S=s.lastRenderedReducer,S!==null))try{var D=s.lastRenderedState,O=S(D,u);if(x.hasEagerState=!0,x.eagerState=O,Jr(O,D))return vf(i,s,x,0),an===null&&gf(),!1}catch{}finally{}if(u=mg(i,s,x,h),u!==null)return Vr(u,i,h),_w(u,s,h),!0}return!1}function Jg(i,s,u,h){if(h={lane:2,revertLane:Av(),gesture:null,action:h,hasEagerState:!1,eagerState:null,next:null},If(i)){if(s)throw Error(r(479))}else s=mg(i,u,h,2),s!==null&&Vr(s,i,2)}function If(i){var s=i.alternate;return i===xt||s!==null&&s===xt}function Rw(i,s){Kl=Af=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function _w(i,s,u){if((u&4194048)!==0){var h=s.lanes;h&=i.pendingLanes,u|=h,s.lanes=u,ie(i,u)}}var Du={readContext:cr,use:Of,useCallback:Nn,useContext:Nn,useEffect:Nn,useImperativeHandle:Nn,useLayoutEffect:Nn,useInsertionEffect:Nn,useMemo:Nn,useReducer:Nn,useRef:Nn,useState:Nn,useDebugValue:Nn,useDeferredValue:Nn,useTransition:Nn,useSyncExternalStore:Nn,useId:Nn,useHostTransitionStatus:Nn,useFormState:Nn,useActionState:Nn,useOptimistic:Nn,useMemoCache:Nn,useCacheRefresh:Nn};Du.useEffectEvent=Nn;var Dw={readContext:cr,use:Of,useCallback:function(i,s){return Er().memoizedState=[i,s===void 0?null:s],i},useContext:cr,useEffect:fw,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,Mf(4194308,4,gw.bind(null,s,i),u)},useLayoutEffect:function(i,s){return Mf(4194308,4,i,s)},useInsertionEffect:function(i,s){Mf(4,2,i,s)},useMemo:function(i,s){var u=Er();s=s===void 0?null:s;var h=i();if(zs){Zn(!0);try{i()}finally{Zn(!1)}}return u.memoizedState=[h,s],h},useReducer:function(i,s,u){var h=Er();if(u!==void 0){var x=u(s);if(zs){Zn(!0);try{u(s)}finally{Zn(!1)}}}else x=s;return h.memoizedState=h.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},h.queue=i,i=i.dispatch=o3.bind(null,xt,i),[h.memoizedState,i]},useRef:function(i){var s=Er();return i={current:i},s.memoizedState=i},useState:function(i){i=qg(i);var s=i.queue,u=Tw.bind(null,xt,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:Qg,useDeferredValue:function(i,s){var u=Er();return Yg(u,i,s)},useTransition:function(){var i=qg(!1);return i=Sw.bind(null,xt,i.queue,!0,!1),Er().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var h=xt,x=Er();if(Ot){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),an===null)throw Error(r(349));(Dt&127)!==0||K1(h,s,u)}x.memoizedState=u;var S={value:u,getSnapshot:s};return x.queue=S,fw(J1.bind(null,h,S,i),[i]),h.flags|=2048,Jl(9,{destroy:void 0},X1.bind(null,h,S,u,s),null),u},useId:function(){var i=Er(),s=an.identifierPrefix;if(Ot){var u=co,h=lo;u=(h&~(1<<32-kn(h)-1)).toString(32)+u,s="_"+s+"R_"+u,u=kf++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=JO++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:Xg,useFormState:sw,useActionState:sw,useOptimistic:function(i){var s=Er();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=Jg.bind(null,xt,!0,u),u.dispatch=s,[i,s]},useMemoCache:Vg,useCacheRefresh:function(){return Er().memoizedState=i3.bind(null,xt)},useEffectEvent:function(i){var s=Er(),u={impl:i};return s.memoizedState=u,function(){if((Gt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},Zg={readContext:cr,use:Of,useCallback:yw,useContext:cr,useEffect:Wg,useImperativeHandle:vw,useInsertionEffect:pw,useLayoutEffect:mw,useMemo:xw,useReducer:Nf,useRef:dw,useState:function(){return Nf(ea)},useDebugValue:Qg,useDeferredValue:function(i,s){var u=Bn();return bw(u,tn.memoizedState,i,s)},useTransition:function(){var i=Nf(ea)[0],s=Bn().memoizedState;return[typeof i=="boolean"?i:Ru(i),s]},useSyncExternalStore:Y1,useId:Cw,useHostTransitionStatus:Xg,useFormState:lw,useActionState:lw,useOptimistic:function(i,s){var u=Bn();return tw(u,tn,i,s)},useMemoCache:Vg,useCacheRefresh:Ew};Zg.useEffectEvent=hw;var Aw={readContext:cr,use:Of,useCallback:yw,useContext:cr,useEffect:Wg,useImperativeHandle:vw,useInsertionEffect:pw,useLayoutEffect:mw,useMemo:xw,useReducer:Hg,useRef:dw,useState:function(){return Hg(ea)},useDebugValue:Qg,useDeferredValue:function(i,s){var u=Bn();return tn===null?Yg(u,i,s):bw(u,tn.memoizedState,i,s)},useTransition:function(){var i=Hg(ea)[0],s=Bn().memoizedState;return[typeof i=="boolean"?i:Ru(i),s]},useSyncExternalStore:Y1,useId:Cw,useHostTransitionStatus:Xg,useFormState:uw,useActionState:uw,useOptimistic:function(i,s){var u=Bn();return tn!==null?tw(u,tn,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:Vg,useCacheRefresh:Ew};Aw.useEffectEvent=hw;function ev(i,s,u,h){s=i.memoizedState,u=u(h,s),u=u==null?s:g({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var tv={enqueueSetState:function(i,s,u){i=i._reactInternals;var h=ii(),x=$a(h);x.payload=s,u!=null&&(x.callback=u),s=Ua(i,x,h),s!==null&&(Vr(s,i,h),ju(s,i,h))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var h=ii(),x=$a(h);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=Ua(i,x,h),s!==null&&(Vr(s,i,h),ju(s,i,h))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=ii(),h=$a(u);h.tag=2,s!=null&&(h.callback=s),s=Ua(i,h,u),s!==null&&(Vr(s,i,u),ju(s,i,u))}};function kw(i,s,u,h,x,S,D){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(h,S,D):s.prototype&&s.prototype.isPureReactComponent?!mu(u,h)||!mu(x,S):!0}function Pw(i,s,u,h){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,h),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,h),s.state!==i&&tv.enqueueReplaceState(s,s.state,null)}function $s(i,s){var u=s;if("ref"in s){u={};for(var h in s)h!=="ref"&&(u[h]=s[h])}if(i=i.defaultProps){u===s&&(u=g({},u));for(var x in i)u[x]===void 0&&(u[x]=i[x])}return u}function Ow(i){mf(i)}function Nw(i){console.error(i)}function Mw(i){mf(i)}function zf(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(h){setTimeout(function(){throw h})}}function Lw(i,s,u){try{var h=i.onCaughtError;h(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function nv(i,s,u){return u=$a(u),u.tag=3,u.payload={element:null},u.callback=function(){zf(i,s)},u}function Iw(i){return i=$a(i),i.tag=3,i}function zw(i,s,u,h){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var S=h.value;i.payload=function(){return x(S)},i.callback=function(){Lw(s,u,h)}}var D=u.stateNode;D!==null&&typeof D.componentDidCatch=="function"&&(i.callback=function(){Lw(s,u,h),typeof x!="function"&&(Ga===null?Ga=new Set([this]):Ga.add(this));var O=h.stack;this.componentDidCatch(h.value,{componentStack:O!==null?O:""})})}function a3(i,s,u,h,x){if(u.flags|=32768,h!==null&&typeof h=="object"&&typeof h.then=="function"){if(s=u.alternate,s!==null&&Hl(s,u,x,!0),u=ei.current,u!==null){switch(u.tag){case 31:case 13:return wi===null?Kf():u.alternate===null&&Mn===0&&(Mn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,h===Ef?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([h]):s.add(h),Rv(i,h,x)),!1;case 22:return u.flags|=65536,h===Ef?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([h])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([h]):u.add(h)),Rv(i,h,x)),!1}throw Error(r(435,u.tag))}return Rv(i,h,x),Kf(),!1}if(Ot)return s=ei.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=x,h!==Sg&&(i=Error(r(422),{cause:h}),yu(yi(i,u)))):(h!==Sg&&(s=Error(r(423),{cause:h}),yu(yi(s,u))),i=i.current.alternate,i.flags|=65536,x&=-x,i.lanes|=x,h=yi(h,u),x=nv(i.stateNode,h,x),Pg(i,x),Mn!==4&&(Mn=2)),!1;var S=Error(r(520),{cause:h});if(S=yi(S,u),Iu===null?Iu=[S]:Iu.push(S),Mn!==4&&(Mn=2),s===null)return!0;h=yi(h,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=x&-x,u.lanes|=i,i=nv(u.stateNode,h,i),Pg(u,i),!1;case 1:if(s=u.type,S=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||S!==null&&typeof S.componentDidCatch=="function"&&(Ga===null||!Ga.has(S))))return u.flags|=65536,x&=-x,u.lanes|=x,x=Iw(x),zw(x,i,u,h),Pg(u,x),!1}u=u.return}while(u!==null);return!1}var rv=Error(r(461)),Xn=!1;function ur(i,s,u,h){s.child=i===null?V1(s,null,u,h):Is(s,i.child,u,h)}function $w(i,s,u,h,x){u=u.render;var S=s.ref;if("ref"in h){var D={};for(var O in h)O!=="ref"&&(D[O]=h[O])}else D=h;return Os(s),h=zg(i,s,u,D,S,x),O=$g(),i!==null&&!Xn?(Ug(i,s,x),ta(i,s,x)):(Ot&&O&&xg(s),s.flags|=1,ur(i,s,h,x),s.child)}function Uw(i,s,u,h,x){if(i===null){var S=u.type;return typeof S=="function"&&!gg(S)&&S.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=S,Bw(i,s,S,h,x)):(i=xf(u.type,null,h,s,s.mode,x),i.ref=s.ref,i.return=s,s.child=i)}if(S=i.child,!dv(i,x)){var D=S.memoizedProps;if(u=u.compare,u=u!==null?u:mu,u(D,h)&&i.ref===s.ref)return ta(i,s,x)}return s.flags|=1,i=Yo(S,h),i.ref=s.ref,i.return=s,s.child=i}function Bw(i,s,u,h,x){if(i!==null){var S=i.memoizedProps;if(mu(S,h)&&i.ref===s.ref)if(Xn=!1,s.pendingProps=h=S,dv(i,x))(i.flags&131072)!==0&&(Xn=!0);else return s.lanes=i.lanes,ta(i,s,x)}return iv(i,s,u,h,x)}function Vw(i,s,u,h){var x=h.children,S=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),h.mode==="hidden"){if((s.flags&128)!==0){if(S=S!==null?S.baseLanes|u:u,i!==null){for(h=s.child=i.child,x=0;h!==null;)x=x|h.lanes|h.childLanes,h=h.sibling;h=x&~S}else h=0,s.child=null;return Fw(i,s,S,u,h)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&jf(s,S!==null?S.cachePool:null),S!==null?q1(s,S):Ng(),G1(s);else return h=s.lanes=536870912,Fw(i,s,S!==null?S.baseLanes|u:u,u,h)}else S!==null?(jf(s,S.cachePool),q1(s,S),Va(),s.memoizedState=null):(i!==null&&jf(s,null),Ng(),Va());return ur(i,s,x,u),s.child}function Au(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Fw(i,s,u,h,x){var S=_g();return S=S===null?null:{parent:Yn._currentValue,pool:S},s.memoizedState={baseLanes:u,cachePool:S},i!==null&&jf(s,null),Ng(),G1(s),i!==null&&Hl(i,s,h,!0),s.childLanes=x,null}function $f(i,s){return s=Bf({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Hw(i,s,u){return Is(s,i.child,null,u),i=$f(s,s.pendingProps),i.flags|=2,ti(s),s.memoizedState=null,i}function s3(i,s,u){var h=s.pendingProps,x=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(Ot){if(h.mode==="hidden")return i=$f(s,h),s.lanes=536870912,Au(null,i);if(Lg(s),(i=pn)?(i=nC(i,Si),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Na!==null?{id:lo,overflow:co}:null,retryLane:536870912,hydrationErrors:null},u=R1(i),u.return=s,s.child=u,lr=s,pn=null)):i=null,i===null)throw La(s);return s.lanes=536870912,null}return $f(s,h)}var S=i.memoizedState;if(S!==null){var D=S.dehydrated;if(Lg(s),x)if(s.flags&256)s.flags&=-257,s=Hw(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(Xn||Hl(i,s,u,!1),x=(u&i.childLanes)!==0,Xn||x){if(h=an,h!==null&&(D=je(h,u),D!==0&&D!==S.retryLane))throw S.retryLane=D,Ds(i,D),Vr(h,i,D),rv;Kf(),s=Hw(i,s,u)}else i=S.treeContext,pn=ji(D.nextSibling),lr=s,Ot=!0,Ma=null,Si=!1,i!==null&&A1(s,i),s=$f(s,h),s.flags|=4096;return s}return i=Yo(i.child,{mode:h.mode,children:h.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Uf(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function iv(i,s,u,h,x){return Os(s),u=zg(i,s,u,h,void 0,x),h=$g(),i!==null&&!Xn?(Ug(i,s,x),ta(i,s,x)):(Ot&&h&&xg(s),s.flags|=1,ur(i,s,u,x),s.child)}function qw(i,s,u,h,x,S){return Os(s),s.updateQueue=null,u=Q1(s,h,u,x),W1(i),h=$g(),i!==null&&!Xn?(Ug(i,s,S),ta(i,s,S)):(Ot&&h&&xg(s),s.flags|=1,ur(i,s,u,S),s.child)}function Gw(i,s,u,h,x){if(Os(s),s.stateNode===null){var S=Ul,D=u.contextType;typeof D=="object"&&D!==null&&(S=cr(D)),S=new u(h,S),s.memoizedState=S.state!==null&&S.state!==void 0?S.state:null,S.updater=tv,s.stateNode=S,S._reactInternals=s,S=s.stateNode,S.props=h,S.state=s.memoizedState,S.refs={},Ag(s),D=u.contextType,S.context=typeof D=="object"&&D!==null?cr(D):Ul,S.state=s.memoizedState,D=u.getDerivedStateFromProps,typeof D=="function"&&(ev(s,u,D,h),S.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof S.getSnapshotBeforeUpdate=="function"||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(D=S.state,typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount(),D!==S.state&&tv.enqueueReplaceState(S,S.state,null),Eu(s,h,S,x),Cu(),S.state=s.memoizedState),typeof S.componentDidMount=="function"&&(s.flags|=4194308),h=!0}else if(i===null){S=s.stateNode;var O=s.memoizedProps,H=$s(u,O);S.props=H;var ee=S.context,de=u.contextType;D=Ul,typeof de=="object"&&de!==null&&(D=cr(de));var ye=u.getDerivedStateFromProps;de=typeof ye=="function"||typeof S.getSnapshotBeforeUpdate=="function",O=s.pendingProps!==O,de||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(O||ee!==D)&&Pw(s,S,h,D),za=!1;var ne=s.memoizedState;S.state=ne,Eu(s,h,S,x),Cu(),ee=s.memoizedState,O||ne!==ee||za?(typeof ye=="function"&&(ev(s,u,ye,h),ee=s.memoizedState),(H=za||kw(s,u,H,h,ne,ee,D))?(de||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(s.flags|=4194308)):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=h,s.memoizedState=ee),S.props=h,S.state=ee,S.context=D,h=H):(typeof S.componentDidMount=="function"&&(s.flags|=4194308),h=!1)}else{S=s.stateNode,kg(i,s),D=s.memoizedProps,de=$s(u,D),S.props=de,ye=s.pendingProps,ne=S.context,ee=u.contextType,H=Ul,typeof ee=="object"&&ee!==null&&(H=cr(ee)),O=u.getDerivedStateFromProps,(ee=typeof O=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(D!==ye||ne!==H)&&Pw(s,S,h,H),za=!1,ne=s.memoizedState,S.state=ne,Eu(s,h,S,x),Cu();var se=s.memoizedState;D!==ye||ne!==se||za||i!==null&&i.dependencies!==null&&Sf(i.dependencies)?(typeof O=="function"&&(ev(s,u,O,h),se=s.memoizedState),(de=za||kw(s,u,de,h,ne,se,H)||i!==null&&i.dependencies!==null&&Sf(i.dependencies))?(ee||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(h,se,H),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(h,se,H)),typeof S.componentDidUpdate=="function"&&(s.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof S.componentDidUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(s.flags|=1024),s.memoizedProps=h,s.memoizedState=se),S.props=h,S.state=se,S.context=H,h=de):(typeof S.componentDidUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(s.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||D===i.memoizedProps&&ne===i.memoizedState||(s.flags|=1024),h=!1)}return S=h,Uf(i,s),h=(s.flags&128)!==0,S||h?(S=s.stateNode,u=h&&typeof u.getDerivedStateFromError!="function"?null:S.render(),s.flags|=1,i!==null&&h?(s.child=Is(s,i.child,null,x),s.child=Is(s,null,u,x)):ur(i,s,u,x),s.memoizedState=S.state,i=s.child):i=ta(i,s,x),i}function Ww(i,s,u,h){return ks(),s.flags|=256,ur(i,s,u,h),s.child}var ov={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function av(i){return{baseLanes:i,cachePool:L1()}}function sv(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=ri),i}function Qw(i,s,u){var h=s.pendingProps,x=!1,S=(s.flags&128)!==0,D;if((D=S)||(D=i!==null&&i.memoizedState===null?!1:(Un.current&2)!==0),D&&(x=!0,s.flags&=-129),D=(s.flags&32)!==0,s.flags&=-33,i===null){if(Ot){if(x?Ba(s):Va(),(i=pn)?(i=nC(i,Si),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Na!==null?{id:lo,overflow:co}:null,retryLane:536870912,hydrationErrors:null},u=R1(i),u.return=s,s.child=u,lr=s,pn=null)):i=null,i===null)throw La(s);return Fv(i)?s.lanes=32:s.lanes=536870912,null}var O=h.children;return h=h.fallback,x?(Va(),x=s.mode,O=Bf({mode:"hidden",children:O},x),h=As(h,x,u,null),O.return=s,h.return=s,O.sibling=h,s.child=O,h=s.child,h.memoizedState=av(u),h.childLanes=sv(i,D,u),s.memoizedState=ov,Au(null,h)):(Ba(s),lv(s,O))}var H=i.memoizedState;if(H!==null&&(O=H.dehydrated,O!==null)){if(S)s.flags&256?(Ba(s),s.flags&=-257,s=cv(i,s,u)):s.memoizedState!==null?(Va(),s.child=i.child,s.flags|=128,s=null):(Va(),O=h.fallback,x=s.mode,h=Bf({mode:"visible",children:h.children},x),O=As(O,x,u,null),O.flags|=2,h.return=s,O.return=s,h.sibling=O,s.child=h,Is(s,i.child,null,u),h=s.child,h.memoizedState=av(u),h.childLanes=sv(i,D,u),s.memoizedState=ov,s=Au(null,h));else if(Ba(s),Fv(O)){if(D=O.nextSibling&&O.nextSibling.dataset,D)var ee=D.dgst;D=ee,h=Error(r(419)),h.stack="",h.digest=D,yu({value:h,source:null,stack:null}),s=cv(i,s,u)}else if(Xn||Hl(i,s,u,!1),D=(u&i.childLanes)!==0,Xn||D){if(D=an,D!==null&&(h=je(D,u),h!==0&&h!==H.retryLane))throw H.retryLane=h,Ds(i,h),Vr(D,i,h),rv;Vv(O)||Kf(),s=cv(i,s,u)}else Vv(O)?(s.flags|=192,s.child=i.child,s=null):(i=H.treeContext,pn=ji(O.nextSibling),lr=s,Ot=!0,Ma=null,Si=!1,i!==null&&A1(s,i),s=lv(s,h.children),s.flags|=4096);return s}return x?(Va(),O=h.fallback,x=s.mode,H=i.child,ee=H.sibling,h=Yo(H,{mode:"hidden",children:h.children}),h.subtreeFlags=H.subtreeFlags&65011712,ee!==null?O=Yo(ee,O):(O=As(O,x,u,null),O.flags|=2),O.return=s,h.return=s,h.sibling=O,s.child=h,Au(null,h),h=s.child,O=i.child.memoizedState,O===null?O=av(u):(x=O.cachePool,x!==null?(H=Yn._currentValue,x=x.parent!==H?{parent:H,pool:H}:x):x=L1(),O={baseLanes:O.baseLanes|u,cachePool:x}),h.memoizedState=O,h.childLanes=sv(i,D,u),s.memoizedState=ov,Au(i.child,h)):(Ba(s),u=i.child,i=u.sibling,u=Yo(u,{mode:"visible",children:h.children}),u.return=s,u.sibling=null,i!==null&&(D=s.deletions,D===null?(s.deletions=[i],s.flags|=16):D.push(i)),s.child=u,s.memoizedState=null,u)}function lv(i,s){return s=Bf({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Bf(i,s){return i=Zr(22,i,null,s),i.lanes=0,i}function cv(i,s,u){return Is(s,i.child,null,u),i=lv(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function Yw(i,s,u){i.lanes|=s;var h=i.alternate;h!==null&&(h.lanes|=s),Cg(i.return,s,u)}function uv(i,s,u,h,x,S){var D=i.memoizedState;D===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:h,tail:u,tailMode:x,treeForkCount:S}:(D.isBackwards=s,D.rendering=null,D.renderingStartTime=0,D.last=h,D.tail=u,D.tailMode=x,D.treeForkCount=S)}function Kw(i,s,u){var h=s.pendingProps,x=h.revealOrder,S=h.tail;h=h.children;var D=Un.current,O=(D&2)!==0;if(O?(D=D&1|2,s.flags|=128):D&=1,oe(Un,D),ur(i,s,h,u),h=Ot?vu:0,!O&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&Yw(i,u,s);else if(i.tag===19)Yw(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(x){case"forwards":for(u=s.child,x=null;u!==null;)i=u.alternate,i!==null&&Df(i)===null&&(x=u),u=u.sibling;u=x,u===null?(x=s.child,s.child=null):(x=u.sibling,u.sibling=null),uv(s,!1,x,u,S,h);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=s.child,s.child=null;x!==null;){if(i=x.alternate,i!==null&&Df(i)===null){s.child=x;break}i=x.sibling,x.sibling=u,u=x,x=i}uv(s,!0,u,null,S,h);break;case"together":uv(s,!1,null,null,void 0,h);break;default:s.memoizedState=null}return s.child}function ta(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),qa|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Hl(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=Yo(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=Yo(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function dv(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Sf(i)))}function l3(i,s,u){switch(s.tag){case 3:nt(s,s.stateNode.containerInfo),Ia(s,Yn,i.memoizedState.cache),ks();break;case 27:case 5:ht(s);break;case 4:nt(s,s.stateNode.containerInfo);break;case 10:Ia(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,Lg(s),null;break;case 13:var h=s.memoizedState;if(h!==null)return h.dehydrated!==null?(Ba(s),s.flags|=128,null):(u&s.child.childLanes)!==0?Qw(i,s,u):(Ba(s),i=ta(i,s,u),i!==null?i.sibling:null);Ba(s);break;case 19:var x=(i.flags&128)!==0;if(h=(u&s.childLanes)!==0,h||(Hl(i,s,u,!1),h=(u&s.childLanes)!==0),x){if(h)return Kw(i,s,u);s.flags|=128}if(x=s.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),oe(Un,Un.current),h)break;return null;case 22:return s.lanes=0,Vw(i,s,u,s.pendingProps);case 24:Ia(s,Yn,i.memoizedState.cache)}return ta(i,s,u)}function Xw(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)Xn=!0;else{if(!dv(i,u)&&(s.flags&128)===0)return Xn=!1,l3(i,s,u);Xn=(i.flags&131072)!==0}else Xn=!1,Ot&&(s.flags&1048576)!==0&&D1(s,vu,s.index);switch(s.lanes=0,s.tag){case 16:e:{var h=s.pendingProps;if(i=Ms(s.elementType),s.type=i,typeof i=="function")gg(i)?(h=$s(i,h),s.tag=1,s=Gw(null,s,i,h,u)):(s.tag=0,s=iv(null,s,i,h,u));else{if(i!=null){var x=i.$$typeof;if(x===_){s.tag=11,s=$w(null,s,i,h,u);break e}else if(x===A){s.tag=14,s=Uw(null,s,i,h,u);break e}}throw s=$(i)||i,Error(r(306,s,""))}}return s;case 0:return iv(i,s,s.type,s.pendingProps,u);case 1:return h=s.type,x=$s(h,s.pendingProps),Gw(i,s,h,x,u);case 3:e:{if(nt(s,s.stateNode.containerInfo),i===null)throw Error(r(387));h=s.pendingProps;var S=s.memoizedState;x=S.element,kg(i,s),Eu(s,h,null,u);var D=s.memoizedState;if(h=D.cache,Ia(s,Yn,h),h!==S.cache&&Eg(s,[Yn],u,!0),Cu(),h=D.element,S.isDehydrated)if(S={element:h,isDehydrated:!1,cache:D.cache},s.updateQueue.baseState=S,s.memoizedState=S,s.flags&256){s=Ww(i,s,h,u);break e}else if(h!==x){x=yi(Error(r(424)),s),yu(x),s=Ww(i,s,h,u);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(pn=ji(i.firstChild),lr=s,Ot=!0,Ma=null,Si=!0,u=V1(s,null,h,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(ks(),h===x){s=ta(i,s,u);break e}ur(i,s,h,u)}s=s.child}return s;case 26:return Uf(i,s),i===null?(u=lC(s.type,null,s.pendingProps,null))?s.memoizedState=u:Ot||(u=s.type,i=s.pendingProps,h=rh(ge.current).createElement(u),h[Fe]=s,h[ze]=i,dr(h,u,i),On(h),s.stateNode=h):s.memoizedState=lC(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return ht(s),i===null&&Ot&&(h=s.stateNode=oC(s.type,s.pendingProps,ge.current),lr=s,Si=!0,x=pn,Ka(s.type)?(Hv=x,pn=ji(h.firstChild)):pn=x),ur(i,s,s.pendingProps.children,u),Uf(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&Ot&&((x=h=pn)&&(h=z3(h,s.type,s.pendingProps,Si),h!==null?(s.stateNode=h,lr=s,pn=ji(h.firstChild),Si=!1,x=!0):x=!1),x||La(s)),ht(s),x=s.type,S=s.pendingProps,D=i!==null?i.memoizedProps:null,h=S.children,$v(x,S)?h=null:D!==null&&$v(x,D)&&(s.flags|=32),s.memoizedState!==null&&(x=zg(i,s,ZO,null,null,u),qu._currentValue=x),Uf(i,s),ur(i,s,h,u),s.child;case 6:return i===null&&Ot&&((i=u=pn)&&(u=$3(u,s.pendingProps,Si),u!==null?(s.stateNode=u,lr=s,pn=null,i=!0):i=!1),i||La(s)),null;case 13:return Qw(i,s,u);case 4:return nt(s,s.stateNode.containerInfo),h=s.pendingProps,i===null?s.child=Is(s,null,h,u):ur(i,s,h,u),s.child;case 11:return $w(i,s,s.type,s.pendingProps,u);case 7:return ur(i,s,s.pendingProps,u),s.child;case 8:return ur(i,s,s.pendingProps.children,u),s.child;case 12:return ur(i,s,s.pendingProps.children,u),s.child;case 10:return h=s.pendingProps,Ia(s,s.type,h.value),ur(i,s,h.children,u),s.child;case 9:return x=s.type._context,h=s.pendingProps.children,Os(s),x=cr(x),h=h(x),s.flags|=1,ur(i,s,h,u),s.child;case 14:return Uw(i,s,s.type,s.pendingProps,u);case 15:return Bw(i,s,s.type,s.pendingProps,u);case 19:return Kw(i,s,u);case 31:return s3(i,s,u);case 22:return Vw(i,s,u,s.pendingProps);case 24:return Os(s),h=cr(Yn),i===null?(x=_g(),x===null&&(x=an,S=Tg(),x.pooledCache=S,S.refCount++,S!==null&&(x.pooledCacheLanes|=u),x=S),s.memoizedState={parent:h,cache:x},Ag(s),Ia(s,Yn,x)):((i.lanes&u)!==0&&(kg(i,s),Eu(s,null,null,u),Cu()),x=i.memoizedState,S=s.memoizedState,x.parent!==h?(x={parent:h,cache:h},s.memoizedState=x,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=x),Ia(s,Yn,h)):(h=S.cache,Ia(s,Yn,h),h!==x.cache&&Eg(s,[Yn],u,!0))),ur(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function na(i){i.flags|=4}function fv(i,s,u,h,x){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(x&335544128)===x)if(i.stateNode.complete)i.flags|=8192;else if(Cj())i.flags|=8192;else throw Ls=Ef,Dg}else i.flags&=-16777217}function Jw(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!hC(s))if(Cj())i.flags|=8192;else throw Ls=Ef,Dg}function Vf(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Vo():536870912,i.lanes|=s,nc|=s)}function ku(i,s){if(!Ot)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var h=null;u!==null;)u.alternate!==null&&(h=u),u=u.sibling;h===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:h.sibling=null}}function mn(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,h=0;if(s)for(var x=i.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags&65011712,h|=x.flags&65011712,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)u|=x.lanes|x.childLanes,h|=x.subtreeFlags,h|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=h,i.childLanes=u,s}function c3(i,s,u){var h=s.pendingProps;switch(bg(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mn(s),null;case 1:return mn(s),null;case 3:return u=s.stateNode,h=null,i!==null&&(h=i.memoizedState.cache),s.memoizedState.cache!==h&&(s.flags|=2048),Jo(Yn),Ce(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Fl(s)?na(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,wg())),mn(s),null;case 26:var x=s.type,S=s.memoizedState;return i===null?(na(s),S!==null?(mn(s),Jw(s,S)):(mn(s),fv(s,x,null,h,u))):S?S!==i.memoizedState?(na(s),mn(s),Jw(s,S)):(mn(s),s.flags&=-16777217):(i=i.memoizedProps,i!==h&&na(s),mn(s),fv(s,x,i,h,u)),null;case 27:if(st(s),u=ge.current,x=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==h&&na(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return mn(s),null}i=ce.current,Fl(s)?k1(s):(i=oC(x,h,u),s.stateNode=i,na(s))}return mn(s),null;case 5:if(st(s),x=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==h&&na(s);else{if(!h){if(s.stateNode===null)throw Error(r(166));return mn(s),null}if(S=ce.current,Fl(s))k1(s);else{var D=rh(ge.current);switch(S){case 1:S=D.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:S=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":S=D.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":S=D.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":S=D.createElement("div"),S.innerHTML="<script><\/script>",S=S.removeChild(S.firstChild);break;case"select":S=typeof h.is=="string"?D.createElement("select",{is:h.is}):D.createElement("select"),h.multiple?S.multiple=!0:h.size&&(S.size=h.size);break;default:S=typeof h.is=="string"?D.createElement(x,{is:h.is}):D.createElement(x)}}S[Fe]=s,S[ze]=h;e:for(D=s.child;D!==null;){if(D.tag===5||D.tag===6)S.appendChild(D.stateNode);else if(D.tag!==4&&D.tag!==27&&D.child!==null){D.child.return=D,D=D.child;continue}if(D===s)break e;for(;D.sibling===null;){if(D.return===null||D.return===s)break e;D=D.return}D.sibling.return=D.return,D=D.sibling}s.stateNode=S;e:switch(dr(S,x,h),x){case"button":case"input":case"select":case"textarea":h=!!h.autoFocus;break e;case"img":h=!0;break e;default:h=!1}h&&na(s)}}return mn(s),fv(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==h&&na(s);else{if(typeof h!="string"&&s.stateNode===null)throw Error(r(166));if(i=ge.current,Fl(s)){if(i=s.stateNode,u=s.memoizedProps,h=null,x=lr,x!==null)switch(x.tag){case 27:case 5:h=x.memoizedProps}i[Fe]=s,i=!!(i.nodeValue===u||h!==null&&h.suppressHydrationWarning===!0||Qj(i.nodeValue,u)),i||La(s,!0)}else i=rh(i).createTextNode(h),i[Fe]=s,s.stateNode=i}return mn(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(h=Fl(s),u!==null){if(i===null){if(!h)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[Fe]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;mn(s),i=!1}else u=wg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(ti(s),s):(ti(s),null);if((s.flags&128)!==0)throw Error(r(558))}return mn(s),null;case 13:if(h=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Fl(s),h!==null&&h.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[Fe]=s}else ks(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;mn(s),x=!1}else x=wg(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return s.flags&256?(ti(s),s):(ti(s),null)}return ti(s),(s.flags&128)!==0?(s.lanes=u,s):(u=h!==null,i=i!==null&&i.memoizedState!==null,u&&(h=s.child,x=null,h.alternate!==null&&h.alternate.memoizedState!==null&&h.alternate.memoizedState.cachePool!==null&&(x=h.alternate.memoizedState.cachePool.pool),S=null,h.memoizedState!==null&&h.memoizedState.cachePool!==null&&(S=h.memoizedState.cachePool.pool),S!==x&&(h.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),Vf(s,s.updateQueue),mn(s),null);case 4:return Ce(),i===null&&Nv(s.stateNode.containerInfo),mn(s),null;case 10:return Jo(s.type),mn(s),null;case 19:if(F(Un),h=s.memoizedState,h===null)return mn(s),null;if(x=(s.flags&128)!==0,S=h.rendering,S===null)if(x)ku(h,!1);else{if(Mn!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(S=Df(i),S!==null){for(s.flags|=128,ku(h,!1),i=S.updateQueue,s.updateQueue=i,Vf(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)T1(u,i),u=u.sibling;return oe(Un,Un.current&1|2),Ot&&Ko(s,h.treeForkCount),s.child}i=i.sibling}h.tail!==null&&ve()>Wf&&(s.flags|=128,x=!0,ku(h,!1),s.lanes=4194304)}else{if(!x)if(i=Df(S),i!==null){if(s.flags|=128,x=!0,i=i.updateQueue,s.updateQueue=i,Vf(s,i),ku(h,!0),h.tail===null&&h.tailMode==="hidden"&&!S.alternate&&!Ot)return mn(s),null}else 2*ve()-h.renderingStartTime>Wf&&u!==536870912&&(s.flags|=128,x=!0,ku(h,!1),s.lanes=4194304);h.isBackwards?(S.sibling=s.child,s.child=S):(i=h.last,i!==null?i.sibling=S:s.child=S,h.last=S)}return h.tail!==null?(i=h.tail,h.rendering=i,h.tail=i.sibling,h.renderingStartTime=ve(),i.sibling=null,u=Un.current,oe(Un,x?u&1|2:u&1),Ot&&Ko(s,h.treeForkCount),i):(mn(s),null);case 22:case 23:return ti(s),Mg(),h=s.memoizedState!==null,i!==null?i.memoizedState!==null!==h&&(s.flags|=8192):h&&(s.flags|=8192),h?(u&536870912)!==0&&(s.flags&128)===0&&(mn(s),s.subtreeFlags&6&&(s.flags|=8192)):mn(s),u=s.updateQueue,u!==null&&Vf(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==u&&(s.flags|=2048),i!==null&&F(Ns),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Jo(Yn),mn(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function u3(i,s){switch(bg(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Jo(Yn),Ce(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return st(s),null;case 31:if(s.memoizedState!==null){if(ti(s),s.alternate===null)throw Error(r(340));ks()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(ti(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));ks()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return F(Un),null;case 4:return Ce(),null;case 10:return Jo(s.type),null;case 22:case 23:return ti(s),Mg(),i!==null&&F(Ns),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Jo(Yn),null;case 25:return null;default:return null}}function Zw(i,s){switch(bg(s),s.tag){case 3:Jo(Yn),Ce();break;case 26:case 27:case 5:st(s);break;case 4:Ce();break;case 31:s.memoizedState!==null&&ti(s);break;case 13:ti(s);break;case 19:F(Un);break;case 10:Jo(s.type);break;case 22:case 23:ti(s),Mg(),i!==null&&F(Ns);break;case 24:Jo(Yn)}}function Pu(i,s){try{var u=s.updateQueue,h=u!==null?u.lastEffect:null;if(h!==null){var x=h.next;u=x;do{if((u.tag&i)===i){h=void 0;var S=u.create,D=u.inst;h=S(),D.destroy=h}u=u.next}while(u!==x)}}catch(O){Zt(s,s.return,O)}}function Fa(i,s,u){try{var h=s.updateQueue,x=h!==null?h.lastEffect:null;if(x!==null){var S=x.next;h=S;do{if((h.tag&i)===i){var D=h.inst,O=D.destroy;if(O!==void 0){D.destroy=void 0,x=s;var H=u,ee=O;try{ee()}catch(de){Zt(x,H,de)}}}h=h.next}while(h!==S)}}catch(de){Zt(s,s.return,de)}}function ej(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{H1(s,u)}catch(h){Zt(i,i.return,h)}}}function tj(i,s,u){u.props=$s(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(h){Zt(i,s,h)}}function Ou(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var h=i.stateNode;break;case 30:h=i.stateNode;break;default:h=i.stateNode}typeof u=="function"?i.refCleanup=u(h):u.current=h}}catch(x){Zt(i,s,x)}}function uo(i,s){var u=i.ref,h=i.refCleanup;if(u!==null)if(typeof h=="function")try{h()}catch(x){Zt(i,s,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){Zt(i,s,x)}else u.current=null}function nj(i){var s=i.type,u=i.memoizedProps,h=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&h.focus();break e;case"img":u.src?h.src=u.src:u.srcSet&&(h.srcset=u.srcSet)}}catch(x){Zt(i,i.return,x)}}function hv(i,s,u){try{var h=i.stateNode;P3(h,i.type,u,s),h[ze]=s}catch(x){Zt(i,i.return,x)}}function rj(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ka(i.type)||i.tag===4}function pv(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||rj(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ka(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function mv(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Wo));else if(h!==4&&(h===27&&Ka(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(mv(i,s,u),i=i.sibling;i!==null;)mv(i,s,u),i=i.sibling}function Ff(i,s,u){var h=i.tag;if(h===5||h===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(h!==4&&(h===27&&Ka(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Ff(i,s,u),i=i.sibling;i!==null;)Ff(i,s,u),i=i.sibling}function ij(i){var s=i.stateNode,u=i.memoizedProps;try{for(var h=i.type,x=s.attributes;x.length;)s.removeAttributeNode(x[0]);dr(s,h,u),s[Fe]=i,s[ze]=u}catch(S){Zt(i,i.return,S)}}var ra=!1,Jn=!1,gv=!1,oj=typeof WeakSet=="function"?WeakSet:Set,nr=null;function d3(i,s){if(i=i.containerInfo,Iv=uh,i=v1(i),cg(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var h=u.getSelection&&u.getSelection();if(h&&h.rangeCount!==0){u=h.anchorNode;var x=h.anchorOffset,S=h.focusNode;h=h.focusOffset;try{u.nodeType,S.nodeType}catch{u=null;break e}var D=0,O=-1,H=-1,ee=0,de=0,ye=i,ne=null;t:for(;;){for(var se;ye!==u||x!==0&&ye.nodeType!==3||(O=D+x),ye!==S||h!==0&&ye.nodeType!==3||(H=D+h),ye.nodeType===3&&(D+=ye.nodeValue.length),(se=ye.firstChild)!==null;)ne=ye,ye=se;for(;;){if(ye===i)break t;if(ne===u&&++ee===x&&(O=D),ne===S&&++de===h&&(H=D),(se=ye.nextSibling)!==null)break;ye=ne,ne=ye.parentNode}ye=se}u=O===-1||H===-1?null:{start:O,end:H}}else u=null}u=u||{start:0,end:0}}else u=null;for(zv={focusedElem:i,selectionRange:u},uh=!1,nr=s;nr!==null;)if(s=nr,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,nr=i;else for(;nr!==null;){switch(s=nr,S=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)x=i[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&S!==null){i=void 0,u=s,x=S.memoizedProps,S=S.memoizedState,h=u.stateNode;try{var Qe=$s(u.type,x);i=h.getSnapshotBeforeUpdate(Qe,S),h.__reactInternalSnapshotBeforeUpdate=i}catch(ut){Zt(u,u.return,ut)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)Bv(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":Bv(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,nr=i;break}nr=s.return}}function aj(i,s,u){var h=u.flags;switch(u.tag){case 0:case 11:case 15:oa(i,u),h&4&&Pu(5,u);break;case 1:if(oa(i,u),h&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(D){Zt(u,u.return,D)}else{var x=$s(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(x,s,i.__reactInternalSnapshotBeforeUpdate)}catch(D){Zt(u,u.return,D)}}h&64&&ej(u),h&512&&Ou(u,u.return);break;case 3:if(oa(i,u),h&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{H1(i,s)}catch(D){Zt(u,u.return,D)}}break;case 27:s===null&&h&4&&ij(u);case 26:case 5:oa(i,u),s===null&&h&4&&nj(u),h&512&&Ou(u,u.return);break;case 12:oa(i,u);break;case 31:oa(i,u),h&4&&cj(i,u);break;case 13:oa(i,u),h&4&&uj(i,u),h&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=b3.bind(null,u),U3(i,u))));break;case 22:if(h=u.memoizedState!==null||ra,!h){s=s!==null&&s.memoizedState!==null||Jn,x=ra;var S=Jn;ra=h,(Jn=s)&&!S?aa(i,u,(u.subtreeFlags&8772)!==0):oa(i,u),ra=x,Jn=S}break;case 30:break;default:oa(i,u)}}function sj(i){var s=i.alternate;s!==null&&(i.alternate=null,sj(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&qt(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Cn=null,zr=!1;function ia(i,s,u){for(u=u.child;u!==null;)lj(i,s,u),u=u.sibling}function lj(i,s,u){if(Rn&&typeof Rn.onCommitFiberUnmount=="function")try{Rn.onCommitFiberUnmount($n,u)}catch{}switch(u.tag){case 26:Jn||uo(u,s),ia(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Jn||uo(u,s);var h=Cn,x=zr;Ka(u.type)&&(Cn=u.stateNode,zr=!1),ia(i,s,u),Vu(u.stateNode),Cn=h,zr=x;break;case 5:Jn||uo(u,s);case 6:if(h=Cn,x=zr,Cn=null,ia(i,s,u),Cn=h,zr=x,Cn!==null)if(zr)try{(Cn.nodeType===9?Cn.body:Cn.nodeName==="HTML"?Cn.ownerDocument.body:Cn).removeChild(u.stateNode)}catch(S){Zt(u,s,S)}else try{Cn.removeChild(u.stateNode)}catch(S){Zt(u,s,S)}break;case 18:Cn!==null&&(zr?(i=Cn,eC(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),uc(i)):eC(Cn,u.stateNode));break;case 4:h=Cn,x=zr,Cn=u.stateNode.containerInfo,zr=!0,ia(i,s,u),Cn=h,zr=x;break;case 0:case 11:case 14:case 15:Fa(2,u,s),Jn||Fa(4,u,s),ia(i,s,u);break;case 1:Jn||(uo(u,s),h=u.stateNode,typeof h.componentWillUnmount=="function"&&tj(u,s,h)),ia(i,s,u);break;case 21:ia(i,s,u);break;case 22:Jn=(h=Jn)||u.memoizedState!==null,ia(i,s,u),Jn=h;break;default:ia(i,s,u)}}function cj(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{uc(i)}catch(u){Zt(s,s.return,u)}}}function uj(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{uc(i)}catch(u){Zt(s,s.return,u)}}function f3(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new oj),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new oj),s;default:throw Error(r(435,i.tag))}}function Hf(i,s){var u=f3(i);s.forEach(function(h){if(!u.has(h)){u.add(h);var x=S3.bind(null,i,h);h.then(x,x)}})}function $r(i,s){var u=s.deletions;if(u!==null)for(var h=0;h<u.length;h++){var x=u[h],S=i,D=s,O=D;e:for(;O!==null;){switch(O.tag){case 27:if(Ka(O.type)){Cn=O.stateNode,zr=!1;break e}break;case 5:Cn=O.stateNode,zr=!1;break e;case 3:case 4:Cn=O.stateNode.containerInfo,zr=!0;break e}O=O.return}if(Cn===null)throw Error(r(160));lj(S,D,x),Cn=null,zr=!1,S=x.alternate,S!==null&&(S.return=null),x.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)dj(s,i),s=s.sibling}var Hi=null;function dj(i,s){var u=i.alternate,h=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:$r(s,i),Ur(i),h&4&&(Fa(3,i,i.return),Pu(3,i),Fa(5,i,i.return));break;case 1:$r(s,i),Ur(i),h&512&&(Jn||u===null||uo(u,u.return)),h&64&&ra&&(i=i.updateQueue,i!==null&&(h=i.callbacks,h!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?h:u.concat(h))));break;case 26:var x=Hi;if($r(s,i),Ur(i),h&512&&(Jn||u===null||uo(u,u.return)),h&4){var S=u!==null?u.memoizedState:null;if(h=i.memoizedState,u===null)if(h===null)if(i.stateNode===null){e:{h=i.type,u=i.memoizedProps,x=x.ownerDocument||x;t:switch(h){case"title":S=x.getElementsByTagName("title")[0],(!S||S[Ht]||S[Fe]||S.namespaceURI==="http://www.w3.org/2000/svg"||S.hasAttribute("itemprop"))&&(S=x.createElement(h),x.head.insertBefore(S,x.querySelector("head > title"))),dr(S,h,u),S[Fe]=i,On(S),h=S;break e;case"link":var D=dC("link","href",x).get(h+(u.href||""));if(D){for(var O=0;O<D.length;O++)if(S=D[O],S.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&S.getAttribute("rel")===(u.rel==null?null:u.rel)&&S.getAttribute("title")===(u.title==null?null:u.title)&&S.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){D.splice(O,1);break t}}S=x.createElement(h),dr(S,h,u),x.head.appendChild(S);break;case"meta":if(D=dC("meta","content",x).get(h+(u.content||""))){for(O=0;O<D.length;O++)if(S=D[O],S.getAttribute("content")===(u.content==null?null:""+u.content)&&S.getAttribute("name")===(u.name==null?null:u.name)&&S.getAttribute("property")===(u.property==null?null:u.property)&&S.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&S.getAttribute("charset")===(u.charSet==null?null:u.charSet)){D.splice(O,1);break t}}S=x.createElement(h),dr(S,h,u),x.head.appendChild(S);break;default:throw Error(r(468,h))}S[Fe]=i,On(S),h=S}i.stateNode=h}else fC(x,i.type,i.stateNode);else i.stateNode=uC(x,h,i.memoizedProps);else S!==h?(S===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):S.count--,h===null?fC(x,i.type,i.stateNode):uC(x,h,i.memoizedProps)):h===null&&i.stateNode!==null&&hv(i,i.memoizedProps,u.memoizedProps)}break;case 27:$r(s,i),Ur(i),h&512&&(Jn||u===null||uo(u,u.return)),u!==null&&h&4&&hv(i,i.memoizedProps,u.memoizedProps);break;case 5:if($r(s,i),Ur(i),h&512&&(Jn||u===null||uo(u,u.return)),i.flags&32){x=i.stateNode;try{Ol(x,"")}catch(Qe){Zt(i,i.return,Qe)}}h&4&&i.stateNode!=null&&(x=i.memoizedProps,hv(i,x,u!==null?u.memoizedProps:x)),h&1024&&(gv=!0);break;case 6:if($r(s,i),Ur(i),h&4){if(i.stateNode===null)throw Error(r(162));h=i.memoizedProps,u=i.stateNode;try{u.nodeValue=h}catch(Qe){Zt(i,i.return,Qe)}}break;case 3:if(ah=null,x=Hi,Hi=ih(s.containerInfo),$r(s,i),Hi=x,Ur(i),h&4&&u!==null&&u.memoizedState.isDehydrated)try{uc(s.containerInfo)}catch(Qe){Zt(i,i.return,Qe)}gv&&(gv=!1,fj(i));break;case 4:h=Hi,Hi=ih(i.stateNode.containerInfo),$r(s,i),Ur(i),Hi=h;break;case 12:$r(s,i),Ur(i);break;case 31:$r(s,i),Ur(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Hf(i,h)));break;case 13:$r(s,i),Ur(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Gf=ve()),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Hf(i,h)));break;case 22:x=i.memoizedState!==null;var H=u!==null&&u.memoizedState!==null,ee=ra,de=Jn;if(ra=ee||x,Jn=de||H,$r(s,i),Jn=de,ra=ee,Ur(i),h&8192)e:for(s=i.stateNode,s._visibility=x?s._visibility&-2:s._visibility|1,x&&(u===null||H||ra||Jn||Us(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){H=u=s;try{if(S=H.stateNode,x)D=S.style,typeof D.setProperty=="function"?D.setProperty("display","none","important"):D.display="none";else{O=H.stateNode;var ye=H.memoizedProps.style,ne=ye!=null&&ye.hasOwnProperty("display")?ye.display:null;O.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(Qe){Zt(H,H.return,Qe)}}}else if(s.tag===6){if(u===null){H=s;try{H.stateNode.nodeValue=x?"":H.memoizedProps}catch(Qe){Zt(H,H.return,Qe)}}}else if(s.tag===18){if(u===null){H=s;try{var se=H.stateNode;x?tC(se,!0):tC(H.stateNode,!1)}catch(Qe){Zt(H,H.return,Qe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}h&4&&(h=i.updateQueue,h!==null&&(u=h.retryQueue,u!==null&&(h.retryQueue=null,Hf(i,u))));break;case 19:$r(s,i),Ur(i),h&4&&(h=i.updateQueue,h!==null&&(i.updateQueue=null,Hf(i,h)));break;case 30:break;case 21:break;default:$r(s,i),Ur(i)}}function Ur(i){var s=i.flags;if(s&2){try{for(var u,h=i.return;h!==null;){if(rj(h)){u=h;break}h=h.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,S=pv(i);Ff(i,S,x);break;case 5:var D=u.stateNode;u.flags&32&&(Ol(D,""),u.flags&=-33);var O=pv(i);Ff(i,O,D);break;case 3:case 4:var H=u.stateNode.containerInfo,ee=pv(i);mv(i,ee,H);break;default:throw Error(r(161))}}catch(de){Zt(i,i.return,de)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function fj(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;fj(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function oa(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)aj(i,s.alternate,s),s=s.sibling}function Us(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:Fa(4,s,s.return),Us(s);break;case 1:uo(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&tj(s,s.return,u),Us(s);break;case 27:Vu(s.stateNode);case 26:case 5:uo(s,s.return),Us(s);break;case 22:s.memoizedState===null&&Us(s);break;case 30:Us(s);break;default:Us(s)}i=i.sibling}}function aa(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var h=s.alternate,x=i,S=s,D=S.flags;switch(S.tag){case 0:case 11:case 15:aa(x,S,u),Pu(4,S);break;case 1:if(aa(x,S,u),h=S,x=h.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(ee){Zt(h,h.return,ee)}if(h=S,x=h.updateQueue,x!==null){var O=h.stateNode;try{var H=x.shared.hiddenCallbacks;if(H!==null)for(x.shared.hiddenCallbacks=null,x=0;x<H.length;x++)F1(H[x],O)}catch(ee){Zt(h,h.return,ee)}}u&&D&64&&ej(S),Ou(S,S.return);break;case 27:ij(S);case 26:case 5:aa(x,S,u),u&&h===null&&D&4&&nj(S),Ou(S,S.return);break;case 12:aa(x,S,u);break;case 31:aa(x,S,u),u&&D&4&&cj(x,S);break;case 13:aa(x,S,u),u&&D&4&&uj(x,S);break;case 22:S.memoizedState===null&&aa(x,S,u),Ou(S,S.return);break;case 30:break;default:aa(x,S,u)}s=s.sibling}}function vv(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&xu(u))}function yv(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&xu(i))}function qi(i,s,u,h){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)hj(i,s,u,h),s=s.sibling}function hj(i,s,u,h){var x=s.flags;switch(s.tag){case 0:case 11:case 15:qi(i,s,u,h),x&2048&&Pu(9,s);break;case 1:qi(i,s,u,h);break;case 3:qi(i,s,u,h),x&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&xu(i)));break;case 12:if(x&2048){qi(i,s,u,h),i=s.stateNode;try{var S=s.memoizedProps,D=S.id,O=S.onPostCommit;typeof O=="function"&&O(D,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(H){Zt(s,s.return,H)}}else qi(i,s,u,h);break;case 31:qi(i,s,u,h);break;case 13:qi(i,s,u,h);break;case 23:break;case 22:S=s.stateNode,D=s.alternate,s.memoizedState!==null?S._visibility&2?qi(i,s,u,h):Nu(i,s):S._visibility&2?qi(i,s,u,h):(S._visibility|=2,Zl(i,s,u,h,(s.subtreeFlags&10256)!==0||!1)),x&2048&&vv(D,s);break;case 24:qi(i,s,u,h),x&2048&&yv(s.alternate,s);break;default:qi(i,s,u,h)}}function Zl(i,s,u,h,x){for(x=x&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var S=i,D=s,O=u,H=h,ee=D.flags;switch(D.tag){case 0:case 11:case 15:Zl(S,D,O,H,x),Pu(8,D);break;case 23:break;case 22:var de=D.stateNode;D.memoizedState!==null?de._visibility&2?Zl(S,D,O,H,x):Nu(S,D):(de._visibility|=2,Zl(S,D,O,H,x)),x&&ee&2048&&vv(D.alternate,D);break;case 24:Zl(S,D,O,H,x),x&&ee&2048&&yv(D.alternate,D);break;default:Zl(S,D,O,H,x)}s=s.sibling}}function Nu(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,h=s,x=h.flags;switch(h.tag){case 22:Nu(u,h),x&2048&&vv(h.alternate,h);break;case 24:Nu(u,h),x&2048&&yv(h.alternate,h);break;default:Nu(u,h)}s=s.sibling}}var Mu=8192;function ec(i,s,u){if(i.subtreeFlags&Mu)for(i=i.child;i!==null;)pj(i,s,u),i=i.sibling}function pj(i,s,u){switch(i.tag){case 26:ec(i,s,u),i.flags&Mu&&i.memoizedState!==null&&J3(u,Hi,i.memoizedState,i.memoizedProps);break;case 5:ec(i,s,u);break;case 3:case 4:var h=Hi;Hi=ih(i.stateNode.containerInfo),ec(i,s,u),Hi=h;break;case 22:i.memoizedState===null&&(h=i.alternate,h!==null&&h.memoizedState!==null?(h=Mu,Mu=16777216,ec(i,s,u),Mu=h):ec(i,s,u));break;default:ec(i,s,u)}}function mj(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Lu(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];nr=h,vj(h,i)}mj(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)gj(i),i=i.sibling}function gj(i){switch(i.tag){case 0:case 11:case 15:Lu(i),i.flags&2048&&Fa(9,i,i.return);break;case 3:Lu(i);break;case 12:Lu(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,qf(i)):Lu(i);break;default:Lu(i)}}function qf(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var h=s[u];nr=h,vj(h,i)}mj(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:Fa(8,s,s.return),qf(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,qf(s));break;default:qf(s)}i=i.sibling}}function vj(i,s){for(;nr!==null;){var u=nr;switch(u.tag){case 0:case 11:case 15:Fa(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var h=u.memoizedState.cachePool.pool;h!=null&&h.refCount++}break;case 24:xu(u.memoizedState.cache)}if(h=u.child,h!==null)h.return=u,nr=h;else e:for(u=i;nr!==null;){h=nr;var x=h.sibling,S=h.return;if(sj(h),h===u){nr=null;break e}if(x!==null){x.return=S,nr=x;break e}nr=S}}}var h3={getCacheForType:function(i){var s=cr(Yn),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return cr(Yn).controller.signal}},p3=typeof WeakMap=="function"?WeakMap:Map,Gt=0,an=null,Rt=null,Dt=0,Jt=0,ni=null,Ha=!1,tc=!1,xv=!1,sa=0,Mn=0,qa=0,Bs=0,bv=0,ri=0,nc=0,Iu=null,Br=null,Sv=!1,Gf=0,yj=0,Wf=1/0,Qf=null,Ga=null,tr=0,Wa=null,rc=null,la=0,wv=0,jv=null,xj=null,zu=0,Cv=null;function ii(){return(Gt&2)!==0&&Dt!==0?Dt&-Dt:L.T!==null?Av():Xe()}function bj(){if(ri===0)if((Dt&536870912)===0||Ot){var i=Ui;Ui<<=1,(Ui&3932160)===0&&(Ui=262144),ri=i}else ri=536870912;return i=ei.current,i!==null&&(i.flags|=32),ri}function Vr(i,s,u){(i===an&&(Jt===2||Jt===9)||i.cancelPendingCommit!==null)&&(ic(i,0),Qa(i,Dt,ri,!1)),Fo(i,u),((Gt&2)===0||i!==an)&&(i===an&&((Gt&2)===0&&(Bs|=u),Mn===4&&Qa(i,Dt,ri,!1)),fo(i))}function Sj(i,s,u){if((Gt&6)!==0)throw Error(r(327));var h=!u&&(s&127)===0&&(s&i.expiredLanes)===0||Bi(i,s),x=h?v3(i,s):Tv(i,s,!0),S=h;do{if(x===0){tc&&!h&&Qa(i,s,0,!1);break}else{if(u=i.current.alternate,S&&!m3(u)){x=Tv(i,s,!1),S=!1;continue}if(x===2){if(S=s,i.errorRecoveryDisabledLanes&S)var D=0;else D=i.pendingLanes&-536870913,D=D!==0?D:D&536870912?536870912:0;if(D!==0){s=D;e:{var O=i;x=Iu;var H=O.current.memoizedState.isDehydrated;if(H&&(ic(O,D).flags|=256),D=Tv(O,D,!1),D!==2){if(xv&&!H){O.errorRecoveryDisabledLanes|=S,Bs|=S,x=4;break e}S=Br,Br=x,S!==null&&(Br===null?Br=S:Br.push.apply(Br,S))}x=D}if(S=!1,x!==2)continue}}if(x===1){ic(i,0),Qa(i,s,0,!0);break}e:{switch(h=i,S=x,S){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Qa(h,s,ri,!Ha);break e;case 2:Br=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(x=Gf+300-ve(),10<x)){if(Qa(h,s,ri,!Ha),mr(h,0,!0)!==0)break e;la=s,h.timeoutHandle=Jj(wj.bind(null,h,u,Br,Qf,Sv,s,ri,Bs,nc,Ha,S,"Throttled",-0,0),x);break e}wj(h,u,Br,Qf,Sv,s,ri,Bs,nc,Ha,S,null,-0,0)}}break}while(!0);fo(i)}function wj(i,s,u,h,x,S,D,O,H,ee,de,ye,ne,se){if(i.timeoutHandle=-1,ye=s.subtreeFlags,ye&8192||(ye&16785408)===16785408){ye={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Wo},pj(s,S,ye);var Qe=(S&62914560)===S?Gf-ve():(S&4194048)===S?yj-ve():0;if(Qe=Z3(ye,Qe),Qe!==null){la=S,i.cancelPendingCommit=Qe(Aj.bind(null,i,s,S,u,h,x,D,O,H,de,ye,null,ne,se)),Qa(i,S,D,!ee);return}}Aj(i,s,S,u,h,x,D,O,H)}function m3(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var h=0;h<u.length;h++){var x=u[h],S=x.getSnapshot;x=x.value;try{if(!Jr(S(),x))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Qa(i,s,u,h){s&=~bv,s&=~Bs,i.suspendedLanes|=s,i.pingedLanes&=~s,h&&(i.warmLanes|=s),h=i.expirationTimes;for(var x=s;0<x;){var S=31-kn(x),D=1<<S;h[S]=-1,x&=~D}u!==0&&Q(i,u,s)}function Yf(){return(Gt&6)===0?($u(0),!1):!0}function Ev(){if(Rt!==null){if(Jt===0)var i=Rt.return;else i=Rt,Xo=Ps=null,Bg(i),Ql=null,Su=0,i=Rt;for(;i!==null;)Zw(i.alternate,i),i=i.return;Rt=null}}function ic(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,M3(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),la=0,Ev(),an=i,Rt=u=Yo(i.current,null),Dt=s,Jt=0,ni=null,Ha=!1,tc=Bi(i,s),xv=!1,nc=ri=bv=Bs=qa=Mn=0,Br=Iu=null,Sv=!1,(s&8)!==0&&(s|=s&32);var h=i.entangledLanes;if(h!==0)for(i=i.entanglements,h&=s;0<h;){var x=31-kn(h),S=1<<x;s|=i[x],h&=~S}return sa=s,gf(),u}function jj(i,s){xt=null,L.H=Du,s===Wl||s===Cf?(s=$1(),Jt=3):s===Dg?(s=$1(),Jt=4):Jt=s===rv?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,ni=s,Rt===null&&(Mn=1,zf(i,yi(s,i.current)))}function Cj(){var i=ei.current;return i===null?!0:(Dt&4194048)===Dt?wi===null:(Dt&62914560)===Dt||(Dt&536870912)!==0?i===wi:!1}function Ej(){var i=L.H;return L.H=Du,i===null?Du:i}function Tj(){var i=L.A;return L.A=h3,i}function Kf(){Mn=4,Ha||(Dt&4194048)!==Dt&&ei.current!==null||(tc=!0),(qa&134217727)===0&&(Bs&134217727)===0||an===null||Qa(an,Dt,ri,!1)}function Tv(i,s,u){var h=Gt;Gt|=2;var x=Ej(),S=Tj();(an!==i||Dt!==s)&&(Qf=null,ic(i,s)),s=!1;var D=Mn;e:do try{if(Jt!==0&&Rt!==null){var O=Rt,H=ni;switch(Jt){case 8:Ev(),D=6;break e;case 3:case 2:case 9:case 6:ei.current===null&&(s=!0);var ee=Jt;if(Jt=0,ni=null,oc(i,O,H,ee),u&&tc){D=0;break e}break;default:ee=Jt,Jt=0,ni=null,oc(i,O,H,ee)}}g3(),D=Mn;break}catch(de){jj(i,de)}while(!0);return s&&i.shellSuspendCounter++,Xo=Ps=null,Gt=h,L.H=x,L.A=S,Rt===null&&(an=null,Dt=0,gf()),D}function g3(){for(;Rt!==null;)Rj(Rt)}function v3(i,s){var u=Gt;Gt|=2;var h=Ej(),x=Tj();an!==i||Dt!==s?(Qf=null,Wf=ve()+500,ic(i,s)):tc=Bi(i,s);e:do try{if(Jt!==0&&Rt!==null){s=Rt;var S=ni;t:switch(Jt){case 1:Jt=0,ni=null,oc(i,s,S,1);break;case 2:case 9:if(I1(S)){Jt=0,ni=null,_j(s);break}s=function(){Jt!==2&&Jt!==9||an!==i||(Jt=7),fo(i)},S.then(s,s);break e;case 3:Jt=7;break e;case 4:Jt=5;break e;case 7:I1(S)?(Jt=0,ni=null,_j(s)):(Jt=0,ni=null,oc(i,s,S,7));break;case 5:var D=null;switch(Rt.tag){case 26:D=Rt.memoizedState;case 5:case 27:var O=Rt;if(D?hC(D):O.stateNode.complete){Jt=0,ni=null;var H=O.sibling;if(H!==null)Rt=H;else{var ee=O.return;ee!==null?(Rt=ee,Xf(ee)):Rt=null}break t}}Jt=0,ni=null,oc(i,s,S,5);break;case 6:Jt=0,ni=null,oc(i,s,S,6);break;case 8:Ev(),Mn=6;break e;default:throw Error(r(462))}}y3();break}catch(de){jj(i,de)}while(!0);return Xo=Ps=null,L.H=h,L.A=x,Gt=u,Rt!==null?0:(an=null,Dt=0,gf(),Mn)}function y3(){for(;Rt!==null&&!et();)Rj(Rt)}function Rj(i){var s=Xw(i.alternate,i,sa);i.memoizedProps=i.pendingProps,s===null?Xf(i):Rt=s}function _j(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=qw(u,s,s.pendingProps,s.type,void 0,Dt);break;case 11:s=qw(u,s,s.pendingProps,s.type.render,s.ref,Dt);break;case 5:Bg(s);default:Zw(u,s),s=Rt=T1(s,sa),s=Xw(u,s,sa)}i.memoizedProps=i.pendingProps,s===null?Xf(i):Rt=s}function oc(i,s,u,h){Xo=Ps=null,Bg(s),Ql=null,Su=0;var x=s.return;try{if(a3(i,x,s,u,Dt)){Mn=1,zf(i,yi(u,i.current)),Rt=null;return}}catch(S){if(x!==null)throw Rt=x,S;Mn=1,zf(i,yi(u,i.current)),Rt=null;return}s.flags&32768?(Ot||h===1?i=!0:tc||(Dt&536870912)!==0?i=!1:(Ha=i=!0,(h===2||h===9||h===3||h===6)&&(h=ei.current,h!==null&&h.tag===13&&(h.flags|=16384))),Dj(s,i)):Xf(s)}function Xf(i){var s=i;do{if((s.flags&32768)!==0){Dj(s,Ha);return}i=s.return;var u=c3(s.alternate,s,sa);if(u!==null){Rt=u;return}if(s=s.sibling,s!==null){Rt=s;return}Rt=s=i}while(s!==null);Mn===0&&(Mn=5)}function Dj(i,s){do{var u=u3(i.alternate,i);if(u!==null){u.flags&=32767,Rt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){Rt=i;return}Rt=i=u}while(i!==null);Mn=6,Rt=null}function Aj(i,s,u,h,x,S,D,O,H){i.cancelPendingCommit=null;do Jf();while(tr!==0);if((Gt&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(S=s.lanes|s.childLanes,S|=pg,q(i,u,S,D,O,H),i===an&&(Rt=an=null,Dt=0),rc=s,Wa=i,la=u,wv=S,jv=x,xj=h,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,w3(Tt,function(){return Mj(),null})):(i.callbackNode=null,i.callbackPriority=0),h=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||h){h=L.T,L.T=null,x=I.p,I.p=2,D=Gt,Gt|=4;try{d3(i,s,u)}finally{Gt=D,I.p=x,L.T=h}}tr=1,kj(),Pj(),Oj()}}function kj(){if(tr===1){tr=0;var i=Wa,s=rc,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=L.T,L.T=null;var h=I.p;I.p=2;var x=Gt;Gt|=4;try{dj(s,i);var S=zv,D=v1(i.containerInfo),O=S.focusedElem,H=S.selectionRange;if(D!==O&&O&&O.ownerDocument&&g1(O.ownerDocument.documentElement,O)){if(H!==null&&cg(O)){var ee=H.start,de=H.end;if(de===void 0&&(de=ee),"selectionStart"in O)O.selectionStart=ee,O.selectionEnd=Math.min(de,O.value.length);else{var ye=O.ownerDocument||document,ne=ye&&ye.defaultView||window;if(ne.getSelection){var se=ne.getSelection(),Qe=O.textContent.length,ut=Math.min(H.start,Qe),rn=H.end===void 0?ut:Math.min(H.end,Qe);!se.extend&&ut>rn&&(D=rn,rn=ut,ut=D);var K=m1(O,ut),G=m1(O,rn);if(K&&G&&(se.rangeCount!==1||se.anchorNode!==K.node||se.anchorOffset!==K.offset||se.focusNode!==G.node||se.focusOffset!==G.offset)){var Z=ye.createRange();Z.setStart(K.node,K.offset),se.removeAllRanges(),ut>rn?(se.addRange(Z),se.extend(G.node,G.offset)):(Z.setEnd(G.node,G.offset),se.addRange(Z))}}}}for(ye=[],se=O;se=se.parentNode;)se.nodeType===1&&ye.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<ye.length;O++){var me=ye[O];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}uh=!!Iv,zv=Iv=null}finally{Gt=x,I.p=h,L.T=u}}i.current=s,tr=2}}function Pj(){if(tr===2){tr=0;var i=Wa,s=rc,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=L.T,L.T=null;var h=I.p;I.p=2;var x=Gt;Gt|=4;try{aj(i,s.alternate,s)}finally{Gt=x,I.p=h,L.T=u}}tr=3}}function Oj(){if(tr===4||tr===3){tr=0,ot();var i=Wa,s=rc,u=la,h=xj;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?tr=5:(tr=0,rc=Wa=null,Nj(i,i.pendingLanes));var x=i.pendingLanes;if(x===0&&(Ga=null),qe(u),s=s.stateNode,Rn&&typeof Rn.onCommitFiberRoot=="function")try{Rn.onCommitFiberRoot($n,s,void 0,(s.current.flags&128)===128)}catch{}if(h!==null){s=L.T,x=I.p,I.p=2,L.T=null;try{for(var S=i.onRecoverableError,D=0;D<h.length;D++){var O=h[D];S(O.value,{componentStack:O.stack})}}finally{L.T=s,I.p=x}}(la&3)!==0&&Jf(),fo(i),x=i.pendingLanes,(u&261930)!==0&&(x&42)!==0?i===Cv?zu++:(zu=0,Cv=i):zu=0,$u(0)}}function Nj(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,xu(s)))}function Jf(){return kj(),Pj(),Oj(),Mj()}function Mj(){if(tr!==5)return!1;var i=Wa,s=wv;wv=0;var u=qe(la),h=L.T,x=I.p;try{I.p=32>u?32:u,L.T=null,u=jv,jv=null;var S=Wa,D=la;if(tr=0,rc=Wa=null,la=0,(Gt&6)!==0)throw Error(r(331));var O=Gt;if(Gt|=4,gj(S.current),hj(S,S.current,D,u),Gt=O,$u(0,!1),Rn&&typeof Rn.onPostCommitFiberRoot=="function")try{Rn.onPostCommitFiberRoot($n,S)}catch{}return!0}finally{I.p=x,L.T=h,Nj(i,s)}}function Lj(i,s,u){s=yi(u,s),s=nv(i.stateNode,s,2),i=Ua(i,s,2),i!==null&&(Fo(i,2),fo(i))}function Zt(i,s,u){if(i.tag===3)Lj(i,i,u);else for(;s!==null;){if(s.tag===3){Lj(s,i,u);break}else if(s.tag===1){var h=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof h.componentDidCatch=="function"&&(Ga===null||!Ga.has(h))){i=yi(u,i),u=Iw(2),h=Ua(s,u,2),h!==null&&(zw(u,h,s,i),Fo(h,2),fo(h));break}}s=s.return}}function Rv(i,s,u){var h=i.pingCache;if(h===null){h=i.pingCache=new p3;var x=new Set;h.set(s,x)}else x=h.get(s),x===void 0&&(x=new Set,h.set(s,x));x.has(u)||(xv=!0,x.add(u),i=x3.bind(null,i,s,u),s.then(i,i))}function x3(i,s,u){var h=i.pingCache;h!==null&&h.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,an===i&&(Dt&u)===u&&(Mn===4||Mn===3&&(Dt&62914560)===Dt&&300>ve()-Gf?(Gt&2)===0&&ic(i,0):bv|=u,nc===Dt&&(nc=0)),fo(i)}function Ij(i,s){s===0&&(s=Vo()),i=Ds(i,s),i!==null&&(Fo(i,s),fo(i))}function b3(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),Ij(i,u)}function S3(i,s){var u=0;switch(i.tag){case 31:case 13:var h=i.stateNode,x=i.memoizedState;x!==null&&(u=x.retryLane);break;case 19:h=i.stateNode;break;case 22:h=i.stateNode._retryCache;break;default:throw Error(r(314))}h!==null&&h.delete(s),Ij(i,u)}function w3(i,s){return Pe(i,s)}var Zf=null,ac=null,_v=!1,eh=!1,Dv=!1,Ya=0;function fo(i){i!==ac&&i.next===null&&(ac===null?Zf=ac=i:ac=ac.next=i),eh=!0,_v||(_v=!0,C3())}function $u(i,s){if(!Dv&&eh){Dv=!0;do for(var u=!1,h=Zf;h!==null;){if(i!==0){var x=h.pendingLanes;if(x===0)var S=0;else{var D=h.suspendedLanes,O=h.pingedLanes;S=(1<<31-kn(42|i)+1)-1,S&=x&~(D&~O),S=S&201326741?S&201326741|1:S?S|2:0}S!==0&&(u=!0,Bj(h,S))}else S=Dt,S=mr(h,h===an?S:0,h.cancelPendingCommit!==null||h.timeoutHandle!==-1),(S&3)===0||Bi(h,S)||(u=!0,Bj(h,S));h=h.next}while(u);Dv=!1}}function j3(){zj()}function zj(){eh=_v=!1;var i=0;Ya!==0&&N3()&&(i=Ya);for(var s=ve(),u=null,h=Zf;h!==null;){var x=h.next,S=$j(h,s);S===0?(h.next=null,u===null?Zf=x:u.next=x,x===null&&(ac=u)):(u=h,(i!==0||(S&3)!==0)&&(eh=!0)),h=x}tr!==0&&tr!==5||$u(i),Ya!==0&&(Ya=0)}function $j(i,s){for(var u=i.suspendedLanes,h=i.pingedLanes,x=i.expirationTimes,S=i.pendingLanes&-62914561;0<S;){var D=31-kn(S),O=1<<D,H=x[D];H===-1?((O&u)===0||(O&h)!==0)&&(x[D]=Qn(O,s)):H<=s&&(i.expiredLanes|=O),S&=~O}if(s=an,u=Dt,u=mr(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h=i.callbackNode,u===0||i===s&&(Jt===2||Jt===9)||i.cancelPendingCommit!==null)return h!==null&&h!==null&<(h),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||Bi(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(h!==null&<(h),qe(u)){case 2:case 8:u=tt;break;case 32:u=Tt;break;case 268435456:u=hn;break;default:u=Tt}return h=Uj.bind(null,i),u=Pe(u,h),i.callbackPriority=s,i.callbackNode=u,s}return h!==null&&h!==null&<(h),i.callbackPriority=2,i.callbackNode=null,2}function Uj(i,s){if(tr!==0&&tr!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Jf()&&i.callbackNode!==u)return null;var h=Dt;return h=mr(i,i===an?h:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),h===0?null:(Sj(i,h,s),$j(i,ve()),i.callbackNode!=null&&i.callbackNode===u?Uj.bind(null,i):null)}function Bj(i,s){if(Jf())return null;Sj(i,s,!0)}function C3(){L3(function(){(Gt&6)!==0?Pe(Ne,j3):zj()})}function Av(){if(Ya===0){var i=ql;i===0&&(i=Bo,Bo<<=1,(Bo&261888)===0&&(Bo=256)),Ya=i}return Ya}function Vj(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:lf(""+i)}function Fj(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function E3(i,s,u,h,x){if(s==="submit"&&u&&u.stateNode===x){var S=Vj((x[ze]||null).action),D=h.submitter;D&&(s=(s=D[ze]||null)?Vj(s.formAction):D.getAttribute("formAction"),s!==null&&(S=s,D=null));var O=new ff("action","action",null,h,x);i.push({event:O,listeners:[{instance:null,listener:function(){if(h.defaultPrevented){if(Ya!==0){var H=D?Fj(x,D):new FormData(x);Kg(u,{pending:!0,data:H,method:x.method,action:S},null,H)}}else typeof S=="function"&&(O.preventDefault(),H=D?Fj(x,D):new FormData(x),Kg(u,{pending:!0,data:H,method:x.method,action:S},S,H))},currentTarget:x}]})}}for(var kv=0;kv<hg.length;kv++){var Pv=hg[kv],T3=Pv.toLowerCase(),R3=Pv[0].toUpperCase()+Pv.slice(1);Fi(T3,"on"+R3)}Fi(b1,"onAnimationEnd"),Fi(S1,"onAnimationIteration"),Fi(w1,"onAnimationStart"),Fi("dblclick","onDoubleClick"),Fi("focusin","onFocus"),Fi("focusout","onBlur"),Fi(FO,"onTransitionRun"),Fi(HO,"onTransitionStart"),Fi(qO,"onTransitionCancel"),Fi(j1,"onTransitionEnd"),Vi("onMouseEnter",["mouseout","mouseover"]),Vi("onMouseLeave",["mouseout","mouseover"]),Vi("onPointerEnter",["pointerout","pointerover"]),Vi("onPointerLeave",["pointerout","pointerover"]),pi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),pi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),pi("onBeforeInput",["compositionend","keypress","textInput","paste"]),pi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),pi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),pi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uu="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),_3=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uu));function Hj(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var h=i[u],x=h.event;h=h.listeners;e:{var S=void 0;if(s)for(var D=h.length-1;0<=D;D--){var O=h[D],H=O.instance,ee=O.currentTarget;if(O=O.listener,H!==S&&x.isPropagationStopped())break e;S=O,x.currentTarget=ee;try{S(x)}catch(de){mf(de)}x.currentTarget=null,S=H}else for(D=0;D<h.length;D++){if(O=h[D],H=O.instance,ee=O.currentTarget,O=O.listener,H!==S&&x.isPropagationStopped())break e;S=O,x.currentTarget=ee;try{S(x)}catch(de){mf(de)}x.currentTarget=null,S=H}}}}function _t(i,s){var u=s[Ct];u===void 0&&(u=s[Ct]=new Set);var h=i+"__bubble";u.has(h)||(qj(s,i,2,!1),u.add(h))}function Ov(i,s,u){var h=0;s&&(h|=4),qj(u,i,h,s)}var th="_reactListening"+Math.random().toString(36).slice(2);function Nv(i){if(!i[th]){i[th]=!0,Pa.forEach(function(u){u!=="selectionchange"&&(_3.has(u)||Ov(u,!1,i),Ov(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[th]||(s[th]=!0,Ov("selectionchange",!1,s))}}function qj(i,s,u,h){switch(bC(s)){case 2:var x=nN;break;case 8:x=rN;break;default:x=Yv}u=x.bind(null,s,u,i),x=void 0,!eg||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(x=!0),h?x!==void 0?i.addEventListener(s,u,{capture:!0,passive:x}):i.addEventListener(s,u,!0):x!==void 0?i.addEventListener(s,u,{passive:x}):i.addEventListener(s,u,!1)}function Mv(i,s,u,h,x){var S=h;if((s&1)===0&&(s&2)===0&&h!==null)e:for(;;){if(h===null)return;var D=h.tag;if(D===3||D===4){var O=h.stateNode.containerInfo;if(O===x)break;if(D===4)for(D=h.return;D!==null;){var H=D.tag;if((H===3||H===4)&&D.stateNode.containerInfo===x)return;D=D.return}for(;O!==null;){if(D=Nr(O),D===null)return;if(H=D.tag,H===5||H===6||H===26||H===27){h=S=D;continue e}O=O.parentNode}}h=h.return}KS(function(){var ee=S,de=Jm(u),ye=[];e:{var ne=C1.get(i);if(ne!==void 0){var se=ff,Qe=i;switch(i){case"keypress":if(uf(u)===0)break e;case"keydown":case"keyup":se=SO;break;case"focusin":Qe="focus",se=ig;break;case"focusout":Qe="blur",se=ig;break;case"beforeblur":case"afterblur":se=ig;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":se=ZS;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=cO;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=CO;break;case b1:case S1:case w1:se=fO;break;case j1:se=TO;break;case"scroll":case"scrollend":se=sO;break;case"wheel":se=_O;break;case"copy":case"cut":case"paste":se=pO;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=t1;break;case"toggle":case"beforetoggle":se=AO}var ut=(s&4)!==0,rn=!ut&&(i==="scroll"||i==="scrollend"),K=ut?ne!==null?ne+"Capture":null:ne;ut=[];for(var G=ee,Z;G!==null;){var me=G;if(Z=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||Z===null||K===null||(me=lu(G,K),me!=null&&ut.push(Bu(G,me,Z))),rn)break;G=G.return}0<ut.length&&(ne=new se(ne,Qe,null,u,de),ye.push({event:ne,listeners:ut}))}}if((s&7)===0){e:{if(ne=i==="mouseover"||i==="pointerover",se=i==="mouseout"||i==="pointerout",ne&&u!==Xm&&(Qe=u.relatedTarget||u.fromElement)&&(Nr(Qe)||Qe[We]))break e;if((se||ne)&&(ne=de.window===de?de:(ne=de.ownerDocument)?ne.defaultView||ne.parentWindow:window,se?(Qe=u.relatedTarget||u.toElement,se=ee,Qe=Qe?Nr(Qe):null,Qe!==null&&(rn=l(Qe),ut=Qe.tag,Qe!==rn||ut!==5&&ut!==27&&ut!==6)&&(Qe=null)):(se=null,Qe=ee),se!==Qe)){if(ut=ZS,me="onMouseLeave",K="onMouseEnter",G="mouse",(i==="pointerout"||i==="pointerover")&&(ut=t1,me="onPointerLeave",K="onPointerEnter",G="pointer"),rn=se==null?ne:Mr(se),Z=Qe==null?ne:Mr(Qe),ne=new ut(me,G+"leave",se,u,de),ne.target=rn,ne.relatedTarget=Z,me=null,Nr(de)===ee&&(ut=new ut(K,G+"enter",Qe,u,de),ut.target=Z,ut.relatedTarget=rn,me=ut),rn=me,se&&Qe)t:{for(ut=D3,K=se,G=Qe,Z=0,me=K;me;me=ut(me))Z++;me=0;for(var it=G;it;it=ut(it))me++;for(;0<Z-me;)K=ut(K),Z--;for(;0<me-Z;)G=ut(G),me--;for(;Z--;){if(K===G||G!==null&&K===G.alternate){ut=K;break t}K=ut(K),G=ut(G)}ut=null}else ut=null;se!==null&&Gj(ye,ne,se,ut,!1),Qe!==null&&rn!==null&&Gj(ye,rn,Qe,ut,!0)}}e:{if(ne=ee?Mr(ee):window,se=ne.nodeName&&ne.nodeName.toLowerCase(),se==="select"||se==="input"&&ne.type==="file")var Ut=c1;else if(s1(ne))if(u1)Ut=UO;else{Ut=zO;var Je=IO}else se=ne.nodeName,!se||se.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?ee&&Km(ee.elementType)&&(Ut=c1):Ut=$O;if(Ut&&(Ut=Ut(i,ee))){l1(ye,Ut,u,de);break e}Je&&Je(i,ne,ee),i==="focusout"&&ee&&ne.type==="number"&&ee.memoizedProps.value!=null&&Ym(ne,"number",ne.value)}switch(Je=ee?Mr(ee):window,i){case"focusin":(s1(Je)||Je.contentEditable==="true")&&(Il=Je,ug=ee,gu=null);break;case"focusout":gu=ug=Il=null;break;case"mousedown":dg=!0;break;case"contextmenu":case"mouseup":case"dragend":dg=!1,y1(ye,u,de);break;case"selectionchange":if(VO)break;case"keydown":case"keyup":y1(ye,u,de)}var jt;if(ag)e:{switch(i){case"compositionstart":var At="onCompositionStart";break e;case"compositionend":At="onCompositionEnd";break e;case"compositionupdate":At="onCompositionUpdate";break e}At=void 0}else Ll?o1(i,u)&&(At="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(At="onCompositionStart");At&&(n1&&u.locale!=="ko"&&(Ll||At!=="onCompositionStart"?At==="onCompositionEnd"&&Ll&&(jt=XS()):(Oa=de,tg="value"in Oa?Oa.value:Oa.textContent,Ll=!0)),Je=nh(ee,At),0<Je.length&&(At=new e1(At,i,null,u,de),ye.push({event:At,listeners:Je}),jt?At.data=jt:(jt=a1(u),jt!==null&&(At.data=jt)))),(jt=PO?OO(i,u):NO(i,u))&&(At=nh(ee,"onBeforeInput"),0<At.length&&(Je=new e1("onBeforeInput","beforeinput",null,u,de),ye.push({event:Je,listeners:At}),Je.data=jt)),E3(ye,i,ee,u,de)}Hj(ye,s)})}function Bu(i,s,u){return{instance:i,listener:s,currentTarget:u}}function nh(i,s){for(var u=s+"Capture",h=[];i!==null;){var x=i,S=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||S===null||(x=lu(i,u),x!=null&&h.unshift(Bu(i,x,S)),x=lu(i,s),x!=null&&h.push(Bu(i,x,S))),i.tag===3)return h;i=i.return}return[]}function D3(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Gj(i,s,u,h,x){for(var S=s._reactName,D=[];u!==null&&u!==h;){var O=u,H=O.alternate,ee=O.stateNode;if(O=O.tag,H!==null&&H===h)break;O!==5&&O!==26&&O!==27||ee===null||(H=ee,x?(ee=lu(u,S),ee!=null&&D.unshift(Bu(u,ee,H))):x||(ee=lu(u,S),ee!=null&&D.push(Bu(u,ee,H)))),u=u.return}D.length!==0&&i.push({event:s,listeners:D})}var A3=/\r\n?/g,k3=/\u0000|\uFFFD/g;function Wj(i){return(typeof i=="string"?i:""+i).replace(A3,`
|
|
585
|
+
`).replace(k3,"")}function Qj(i,s){return s=Wj(s),Wj(i)===s}function nn(i,s,u,h,x,S){switch(u){case"children":typeof h=="string"?s==="body"||s==="textarea"&&h===""||Ol(i,h):(typeof h=="number"||typeof h=="bigint")&&s!=="body"&&Ol(i,""+h);break;case"className":Go(i,"class",h);break;case"tabIndex":Go(i,"tabindex",h);break;case"dir":case"role":case"viewBox":case"width":case"height":Go(i,u,h);break;case"style":QS(i,h,S);break;case"data":if(s!=="object"){Go(i,"data",h);break}case"src":case"href":if(h===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(h==null||typeof h=="function"||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=lf(""+h),i.setAttribute(u,h);break;case"action":case"formAction":if(typeof h=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof S=="function"&&(u==="formAction"?(s!=="input"&&nn(i,s,"name",x.name,x,null),nn(i,s,"formEncType",x.formEncType,x,null),nn(i,s,"formMethod",x.formMethod,x,null),nn(i,s,"formTarget",x.formTarget,x,null)):(nn(i,s,"encType",x.encType,x,null),nn(i,s,"method",x.method,x,null),nn(i,s,"target",x.target,x,null)));if(h==null||typeof h=="symbol"||typeof h=="boolean"){i.removeAttribute(u);break}h=lf(""+h),i.setAttribute(u,h);break;case"onClick":h!=null&&(i.onclick=Wo);break;case"onScroll":h!=null&&_t("scroll",i);break;case"onScrollEnd":h!=null&&_t("scrollend",i);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=h&&typeof h!="function"&&typeof h!="symbol";break;case"muted":i.muted=h&&typeof h!="function"&&typeof h!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(h==null||typeof h=="function"||typeof h=="boolean"||typeof h=="symbol"){i.removeAttribute("xlink:href");break}u=lf(""+h),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""+h):i.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":h&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":h===!0?i.setAttribute(u,""):h!==!1&&h!=null&&typeof h!="function"&&typeof h!="symbol"?i.setAttribute(u,h):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":h!=null&&typeof h!="function"&&typeof h!="symbol"&&!isNaN(h)&&1<=h?i.setAttribute(u,h):i.removeAttribute(u);break;case"rowSpan":case"start":h==null||typeof h=="function"||typeof h=="symbol"||isNaN(h)?i.removeAttribute(u):i.setAttribute(u,h);break;case"popover":_t("beforetoggle",i),_t("toggle",i),jn(i,"popover",h);break;case"xlinkActuate":mi(i,"http://www.w3.org/1999/xlink","xlink:actuate",h);break;case"xlinkArcrole":mi(i,"http://www.w3.org/1999/xlink","xlink:arcrole",h);break;case"xlinkRole":mi(i,"http://www.w3.org/1999/xlink","xlink:role",h);break;case"xlinkShow":mi(i,"http://www.w3.org/1999/xlink","xlink:show",h);break;case"xlinkTitle":mi(i,"http://www.w3.org/1999/xlink","xlink:title",h);break;case"xlinkType":mi(i,"http://www.w3.org/1999/xlink","xlink:type",h);break;case"xmlBase":mi(i,"http://www.w3.org/XML/1998/namespace","xml:base",h);break;case"xmlLang":mi(i,"http://www.w3.org/XML/1998/namespace","xml:lang",h);break;case"xmlSpace":mi(i,"http://www.w3.org/XML/1998/namespace","xml:space",h);break;case"is":jn(i,"is",h);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=oO.get(u)||u,jn(i,u,h))}}function Lv(i,s,u,h,x,S){switch(u){case"style":QS(i,h,S);break;case"dangerouslySetInnerHTML":if(h!=null){if(typeof h!="object"||!("__html"in h))throw Error(r(61));if(u=h.__html,u!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof h=="string"?Ol(i,h):(typeof h=="number"||typeof h=="bigint")&&Ol(i,""+h);break;case"onScroll":h!=null&&_t("scroll",i);break;case"onScrollEnd":h!=null&&_t("scrollend",i);break;case"onClick":h!=null&&(i.onclick=Wo);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!so.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),s=u.slice(2,x?u.length-7:void 0),S=i[ze]||null,S=S!=null?S[u]:null,typeof S=="function"&&i.removeEventListener(s,S,x),typeof h=="function")){typeof S!="function"&&S!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,h,x);break e}u in i?i[u]=h:h===!0?i.setAttribute(u,""):jn(i,u,h)}}}function dr(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_t("error",i),_t("load",i);var h=!1,x=!1,S;for(S in u)if(u.hasOwnProperty(S)){var D=u[S];if(D!=null)switch(S){case"src":h=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:nn(i,s,S,D,u,null)}}x&&nn(i,s,"srcSet",u.srcSet,u,null),h&&nn(i,s,"src",u.src,u,null);return;case"input":_t("invalid",i);var O=S=D=x=null,H=null,ee=null;for(h in u)if(u.hasOwnProperty(h)){var de=u[h];if(de!=null)switch(h){case"name":x=de;break;case"type":D=de;break;case"checked":H=de;break;case"defaultChecked":ee=de;break;case"value":S=de;break;case"defaultValue":O=de;break;case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(r(137,s));break;default:nn(i,s,h,de,u,null)}}HS(i,S,O,H,ee,D,x,!1);return;case"select":_t("invalid",i),h=D=S=null;for(x in u)if(u.hasOwnProperty(x)&&(O=u[x],O!=null))switch(x){case"value":S=O;break;case"defaultValue":D=O;break;case"multiple":h=O;default:nn(i,s,x,O,u,null)}s=S,u=D,i.multiple=!!h,s!=null?Pl(i,!!h,s,!1):u!=null&&Pl(i,!!h,u,!0);return;case"textarea":_t("invalid",i),S=x=h=null;for(D in u)if(u.hasOwnProperty(D)&&(O=u[D],O!=null))switch(D){case"value":h=O;break;case"defaultValue":x=O;break;case"children":S=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(r(91));break;default:nn(i,s,D,O,u,null)}GS(i,h,x,S);return;case"option":for(H in u)if(u.hasOwnProperty(H)&&(h=u[H],h!=null))switch(H){case"selected":i.selected=h&&typeof h!="function"&&typeof h!="symbol";break;default:nn(i,s,H,h,u,null)}return;case"dialog":_t("beforetoggle",i),_t("toggle",i),_t("cancel",i),_t("close",i);break;case"iframe":case"object":_t("load",i);break;case"video":case"audio":for(h=0;h<Uu.length;h++)_t(Uu[h],i);break;case"image":_t("error",i),_t("load",i);break;case"details":_t("toggle",i);break;case"embed":case"source":case"link":_t("error",i),_t("load",i);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in u)if(u.hasOwnProperty(ee)&&(h=u[ee],h!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:nn(i,s,ee,h,u,null)}return;default:if(Km(s)){for(de in u)u.hasOwnProperty(de)&&(h=u[de],h!==void 0&&Lv(i,s,de,h,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(h=u[O],h!=null&&nn(i,s,O,h,u,null))}function P3(i,s,u,h){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,S=null,D=null,O=null,H=null,ee=null,de=null;for(se in u){var ye=u[se];if(u.hasOwnProperty(se)&&ye!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":H=ye;default:h.hasOwnProperty(se)||nn(i,s,se,null,h,ye)}}for(var ne in h){var se=h[ne];if(ye=u[ne],h.hasOwnProperty(ne)&&(se!=null||ye!=null))switch(ne){case"type":S=se;break;case"name":x=se;break;case"checked":ee=se;break;case"defaultChecked":de=se;break;case"value":D=se;break;case"defaultValue":O=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(r(137,s));break;default:se!==ye&&nn(i,s,ne,se,h,ye)}}Qm(i,D,O,H,ee,de,S,x);return;case"select":se=D=O=ne=null;for(S in u)if(H=u[S],u.hasOwnProperty(S)&&H!=null)switch(S){case"value":break;case"multiple":se=H;default:h.hasOwnProperty(S)||nn(i,s,S,null,h,H)}for(x in h)if(S=h[x],H=u[x],h.hasOwnProperty(x)&&(S!=null||H!=null))switch(x){case"value":ne=S;break;case"defaultValue":O=S;break;case"multiple":D=S;default:S!==H&&nn(i,s,x,S,h,H)}s=O,u=D,h=se,ne!=null?Pl(i,!!u,ne,!1):!!h!=!!u&&(s!=null?Pl(i,!!u,s,!0):Pl(i,!!u,u?[]:"",!1));return;case"textarea":se=ne=null;for(O in u)if(x=u[O],u.hasOwnProperty(O)&&x!=null&&!h.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:nn(i,s,O,null,h,x)}for(D in h)if(x=h[D],S=u[D],h.hasOwnProperty(D)&&(x!=null||S!=null))switch(D){case"value":ne=x;break;case"defaultValue":se=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==S&&nn(i,s,D,x,h,S)}qS(i,ne,se);return;case"option":for(var Qe in u)if(ne=u[Qe],u.hasOwnProperty(Qe)&&ne!=null&&!h.hasOwnProperty(Qe))switch(Qe){case"selected":i.selected=!1;break;default:nn(i,s,Qe,null,h,ne)}for(H in h)if(ne=h[H],se=u[H],h.hasOwnProperty(H)&&ne!==se&&(ne!=null||se!=null))switch(H){case"selected":i.selected=ne&&typeof ne!="function"&&typeof ne!="symbol";break;default:nn(i,s,H,ne,h,se)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ut in u)ne=u[ut],u.hasOwnProperty(ut)&&ne!=null&&!h.hasOwnProperty(ut)&&nn(i,s,ut,null,h,ne);for(ee in h)if(ne=h[ee],se=u[ee],h.hasOwnProperty(ee)&&ne!==se&&(ne!=null||se!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,s));break;default:nn(i,s,ee,ne,h,se)}return;default:if(Km(s)){for(var rn in u)ne=u[rn],u.hasOwnProperty(rn)&&ne!==void 0&&!h.hasOwnProperty(rn)&&Lv(i,s,rn,void 0,h,ne);for(de in h)ne=h[de],se=u[de],!h.hasOwnProperty(de)||ne===se||ne===void 0&&se===void 0||Lv(i,s,de,ne,h,se);return}}for(var K in u)ne=u[K],u.hasOwnProperty(K)&&ne!=null&&!h.hasOwnProperty(K)&&nn(i,s,K,null,h,ne);for(ye in h)ne=h[ye],se=u[ye],!h.hasOwnProperty(ye)||ne===se||ne==null&&se==null||nn(i,s,ye,ne,h,se)}function Yj(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function O3(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),h=0;h<u.length;h++){var x=u[h],S=x.transferSize,D=x.initiatorType,O=x.duration;if(S&&O&&Yj(D)){for(D=0,O=x.responseEnd,h+=1;h<u.length;h++){var H=u[h],ee=H.startTime;if(ee>O)break;var de=H.transferSize,ye=H.initiatorType;de&&Yj(ye)&&(H=H.responseEnd,D+=de*(H<O?1:(O-ee)/(H-ee)))}if(--h,s+=8*(S+D)/(x.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var Iv=null,zv=null;function rh(i){return i.nodeType===9?i:i.ownerDocument}function Kj(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Xj(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function $v(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var Uv=null;function N3(){var i=window.event;return i&&i.type==="popstate"?i===Uv?!1:(Uv=i,!0):(Uv=null,!1)}var Jj=typeof setTimeout=="function"?setTimeout:void 0,M3=typeof clearTimeout=="function"?clearTimeout:void 0,Zj=typeof Promise=="function"?Promise:void 0,L3=typeof queueMicrotask=="function"?queueMicrotask:typeof Zj<"u"?function(i){return Zj.resolve(null).then(i).catch(I3)}:Jj;function I3(i){setTimeout(function(){throw i})}function Ka(i){return i==="head"}function eC(i,s){var u=s,h=0;do{var x=u.nextSibling;if(i.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(h===0){i.removeChild(x),uc(s);return}h--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")h++;else if(u==="html")Vu(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Vu(u);for(var S=u.firstChild;S;){var D=S.nextSibling,O=S.nodeName;S[Ht]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&S.rel.toLowerCase()==="stylesheet"||u.removeChild(S),S=D}}else u==="body"&&Vu(i.ownerDocument.body);u=x}while(u);uc(s)}function tC(i,s){var u=i;i=0;do{var h=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),h&&h.nodeType===8)if(u=h.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=h}while(u)}function Bv(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Bv(u),qt(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function z3(i,s,u,h){for(;i.nodeType===1;){var x=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!h&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(h){if(!i[Ht])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(S=i.getAttribute("rel"),S==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(S!==x.rel||i.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||i.getAttribute("title")!==(x.title==null?null:x.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(S=i.getAttribute("src"),(S!==(x.src==null?null:x.src)||i.getAttribute("type")!==(x.type==null?null:x.type)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&S&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var S=x.name==null?null:""+x.name;if(x.type==="hidden"&&i.getAttribute("name")===S)return i}else return i;if(i=ji(i.nextSibling),i===null)break}return null}function $3(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=ji(i.nextSibling),i===null))return null;return i}function nC(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=ji(i.nextSibling),i===null))return null;return i}function Vv(i){return i.data==="$?"||i.data==="$~"}function Fv(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function U3(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var h=function(){s(),u.removeEventListener("DOMContentLoaded",h)};u.addEventListener("DOMContentLoaded",h),i._reactRetry=h}}function ji(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var Hv=null;function rC(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return ji(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function iC(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function oC(i,s,u){switch(s=rh(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Vu(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);qt(i)}var Ci=new Map,aC=new Set;function ih(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ca=I.d;I.d={f:B3,r:V3,D:F3,C:H3,L:q3,m:G3,X:Q3,S:W3,M:Y3};function B3(){var i=ca.f(),s=Yf();return i||s}function V3(i){var s=hi(i);s!==null&&s.tag===5&&s.type==="form"?jw(s):ca.r(i)}var sc=typeof document>"u"?null:document;function sC(i,s,u){var h=sc;if(h&&typeof s=="string"&&s){var x=gi(s);x='link[rel="'+i+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),aC.has(x)||(aC.add(x),i={rel:i,crossOrigin:u,href:s},h.querySelector(x)===null&&(s=h.createElement("link"),dr(s,"link",i),On(s),h.head.appendChild(s)))}}function F3(i){ca.D(i),sC("dns-prefetch",i,null)}function H3(i,s){ca.C(i,s),sC("preconnect",i,s)}function q3(i,s,u){ca.L(i,s,u);var h=sc;if(h&&i&&s){var x='link[rel="preload"][as="'+gi(s)+'"]';s==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+gi(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+gi(u.imageSizes)+'"]')):x+='[href="'+gi(i)+'"]';var S=x;switch(s){case"style":S=lc(i);break;case"script":S=cc(i)}Ci.has(S)||(i=g({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),Ci.set(S,i),h.querySelector(x)!==null||s==="style"&&h.querySelector(Fu(S))||s==="script"&&h.querySelector(Hu(S))||(s=h.createElement("link"),dr(s,"link",i),On(s),h.head.appendChild(s)))}}function G3(i,s){ca.m(i,s);var u=sc;if(u&&i){var h=s&&typeof s.as=="string"?s.as:"script",x='link[rel="modulepreload"][as="'+gi(h)+'"][href="'+gi(i)+'"]',S=x;switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":S=cc(i)}if(!Ci.has(S)&&(i=g({rel:"modulepreload",href:i},s),Ci.set(S,i),u.querySelector(x)===null)){switch(h){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Hu(S)))return}h=u.createElement("link"),dr(h,"link",i),On(h),u.head.appendChild(h)}}}function W3(i,s,u){ca.S(i,s,u);var h=sc;if(h&&i){var x=sr(h).hoistableStyles,S=lc(i);s=s||"default";var D=x.get(S);if(!D){var O={loading:0,preload:null};if(D=h.querySelector(Fu(S)))O.loading=5;else{i=g({rel:"stylesheet",href:i,"data-precedence":s},u),(u=Ci.get(S))&&qv(i,u);var H=D=h.createElement("link");On(H),dr(H,"link",i),H._p=new Promise(function(ee,de){H.onload=ee,H.onerror=de}),H.addEventListener("load",function(){O.loading|=1}),H.addEventListener("error",function(){O.loading|=2}),O.loading|=4,oh(D,s,h)}D={type:"stylesheet",instance:D,count:1,state:O},x.set(S,D)}}}function Q3(i,s){ca.X(i,s);var u=sc;if(u&&i){var h=sr(u).hoistableScripts,x=cc(i),S=h.get(x);S||(S=u.querySelector(Hu(x)),S||(i=g({src:i,async:!0},s),(s=Ci.get(x))&&Gv(i,s),S=u.createElement("script"),On(S),dr(S,"link",i),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(x,S))}}function Y3(i,s){ca.M(i,s);var u=sc;if(u&&i){var h=sr(u).hoistableScripts,x=cc(i),S=h.get(x);S||(S=u.querySelector(Hu(x)),S||(i=g({src:i,async:!0,type:"module"},s),(s=Ci.get(x))&&Gv(i,s),S=u.createElement("script"),On(S),dr(S,"link",i),u.head.appendChild(S)),S={type:"script",instance:S,count:1,state:null},h.set(x,S))}}function lC(i,s,u,h){var x=(x=ge.current)?ih(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=lc(u.href),u=sr(x).hoistableStyles,h=u.get(s),h||(h={type:"style",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=lc(u.href);var S=sr(x).hoistableStyles,D=S.get(i);if(D||(x=x.ownerDocument||x,D={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},S.set(i,D),(S=x.querySelector(Fu(i)))&&!S._p&&(D.instance=S,D.state.loading=5),Ci.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Ci.set(i,u),S||K3(x,i,u,D.state))),s&&h===null)throw Error(r(528,""));return D}if(s&&h!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=cc(u),u=sr(x).hoistableScripts,h=u.get(s),h||(h={type:"script",instance:null,count:0,state:null},u.set(s,h)),h):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function lc(i){return'href="'+gi(i)+'"'}function Fu(i){return'link[rel="stylesheet"]['+i+"]"}function cC(i){return g({},i,{"data-precedence":i.precedence,precedence:null})}function K3(i,s,u,h){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?h.loading=1:(s=i.createElement("link"),h.preload=s,s.addEventListener("load",function(){return h.loading|=1}),s.addEventListener("error",function(){return h.loading|=2}),dr(s,"link",u),On(s),i.head.appendChild(s))}function cc(i){return'[src="'+gi(i)+'"]'}function Hu(i){return"script[async]"+i}function uC(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var h=i.querySelector('style[data-href~="'+gi(u.href)+'"]');if(h)return s.instance=h,On(h),h;var x=g({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return h=(i.ownerDocument||i).createElement("style"),On(h),dr(h,"style",x),oh(h,u.precedence,i),s.instance=h;case"stylesheet":x=lc(u.href);var S=i.querySelector(Fu(x));if(S)return s.state.loading|=4,s.instance=S,On(S),S;h=cC(u),(x=Ci.get(x))&&qv(h,x),S=(i.ownerDocument||i).createElement("link"),On(S);var D=S;return D._p=new Promise(function(O,H){D.onload=O,D.onerror=H}),dr(S,"link",h),s.state.loading|=4,oh(S,u.precedence,i),s.instance=S;case"script":return S=cc(u.src),(x=i.querySelector(Hu(S)))?(s.instance=x,On(x),x):(h=u,(x=Ci.get(S))&&(h=g({},u),Gv(h,x)),i=i.ownerDocument||i,x=i.createElement("script"),On(x),dr(x,"link",h),i.head.appendChild(x),s.instance=x);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(h=s.instance,s.state.loading|=4,oh(h,u.precedence,i));return s.instance}function oh(i,s,u){for(var h=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=h.length?h[h.length-1]:null,S=x,D=0;D<h.length;D++){var O=h[D];if(O.dataset.precedence===s)S=O;else if(S!==x)break}S?S.parentNode.insertBefore(i,S.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function qv(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function Gv(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var ah=null;function dC(i,s,u){if(ah===null){var h=new Map,x=ah=new Map;x.set(u,h)}else x=ah,h=x.get(u),h||(h=new Map,x.set(u,h));if(h.has(i))return h;for(h.set(i,null),u=u.getElementsByTagName(i),x=0;x<u.length;x++){var S=u[x];if(!(S[Ht]||S[Fe]||i==="link"&&S.getAttribute("rel")==="stylesheet")&&S.namespaceURI!=="http://www.w3.org/2000/svg"){var D=S.getAttribute(s)||"";D=i+D;var O=h.get(D);O?O.push(S):h.set(D,[S])}}return h}function fC(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function X3(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function hC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function J3(i,s,u,h){if(u.type==="stylesheet"&&(typeof h.media!="string"||matchMedia(h.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=lc(h.href),S=s.querySelector(Fu(x));if(S){s=S._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=sh.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=S,On(S);return}S=s.ownerDocument||s,h=cC(h),(x=Ci.get(x))&&qv(h,x),S=S.createElement("link"),On(S);var D=S;D._p=new Promise(function(O,H){D.onload=O,D.onerror=H}),dr(S,"link",h),u.instance=S}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=sh.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var Wv=0;function Z3(i,s){return i.stylesheets&&i.count===0&&ch(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var h=setTimeout(function(){if(i.stylesheets&&ch(i,i.stylesheets),i.unsuspend){var S=i.unsuspend;i.unsuspend=null,S()}},6e4+s);0<i.imgBytes&&Wv===0&&(Wv=62500*O3());var x=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&ch(i,i.stylesheets),i.unsuspend)){var S=i.unsuspend;i.unsuspend=null,S()}},(i.imgBytes>Wv?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(h),clearTimeout(x)}}:null}function sh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ch(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var lh=null;function ch(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,lh=new Map,s.forEach(eN,i),lh=null,sh.call(i))}function eN(i,s){if(!(s.state.loading&4)){var u=lh.get(i);if(u)var h=u.get(null);else{u=new Map,lh.set(i,u);for(var x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),S=0;S<x.length;S++){var D=x[S];(D.nodeName==="LINK"||D.getAttribute("media")!=="not all")&&(u.set(D.dataset.precedence,D),h=D)}h&&u.set(null,h)}x=s.instance,D=x.getAttribute("data-precedence"),S=u.get(D)||h,S===h&&u.set(null,x),u.set(D,x),this.count++,h=sh.bind(this),x.addEventListener("load",h),x.addEventListener("error",h),S?S.parentNode.insertBefore(x,S.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(x,i.firstChild)),s.state.loading|=4}}var qu={$$typeof:R,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function tN(i,s,u,h,x,S,D,O,H){this.tag=1,this.containerInfo=i,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=kl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=kl(0),this.hiddenUpdates=kl(null),this.identifierPrefix=h,this.onUncaughtError=x,this.onCaughtError=S,this.onRecoverableError=D,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function pC(i,s,u,h,x,S,D,O,H,ee,de,ye){return i=new tN(i,s,u,D,H,ee,de,ye,O),s=1,S===!0&&(s|=24),S=Zr(3,null,null,s),i.current=S,S.stateNode=i,s=Tg(),s.refCount++,i.pooledCache=s,s.refCount++,S.memoizedState={element:h,isDehydrated:u,cache:s},Ag(S),i}function mC(i){return i?(i=Ul,i):Ul}function gC(i,s,u,h,x,S){x=mC(x),h.context===null?h.context=x:h.pendingContext=x,h=$a(s),h.payload={element:u},S=S===void 0?null:S,S!==null&&(h.callback=S),u=Ua(i,h,s),u!==null&&(Vr(u,i,s),ju(u,i,s))}function vC(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function Qv(i,s){vC(i,s),(i=i.alternate)&&vC(i,s)}function yC(i){if(i.tag===13||i.tag===31){var s=Ds(i,67108864);s!==null&&Vr(s,i,67108864),Qv(i,67108864)}}function xC(i){if(i.tag===13||i.tag===31){var s=ii();s=De(s);var u=Ds(i,s);u!==null&&Vr(u,i,s),Qv(i,s)}}var uh=!0;function nN(i,s,u,h){var x=L.T;L.T=null;var S=I.p;try{I.p=2,Yv(i,s,u,h)}finally{I.p=S,L.T=x}}function rN(i,s,u,h){var x=L.T;L.T=null;var S=I.p;try{I.p=8,Yv(i,s,u,h)}finally{I.p=S,L.T=x}}function Yv(i,s,u,h){if(uh){var x=Kv(h);if(x===null)Mv(i,s,h,dh,u),SC(i,h);else if(oN(x,i,s,u,h))h.stopPropagation();else if(SC(i,h),s&4&&-1<iN.indexOf(i)){for(;x!==null;){var S=hi(x);if(S!==null)switch(S.tag){case 3:if(S=S.stateNode,S.current.memoizedState.isDehydrated){var D=Or(S.pendingLanes);if(D!==0){var O=S;for(O.pendingLanes|=2,O.entangledLanes|=2;D;){var H=1<<31-kn(D);O.entanglements[1]|=H,D&=~H}fo(S),(Gt&6)===0&&(Wf=ve()+500,$u(0))}}break;case 31:case 13:O=Ds(S,2),O!==null&&Vr(O,S,2),Yf(),Qv(S,2)}if(S=Kv(h),S===null&&Mv(i,s,h,dh,u),S===x)break;x=S}x!==null&&h.stopPropagation()}else Mv(i,s,h,null,u)}}function Kv(i){return i=Jm(i),Xv(i)}var dh=null;function Xv(i){if(dh=null,i=Nr(i),i!==null){var s=l(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=c(s),i!==null)return i;i=null}else if(u===31){if(i=d(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return dh=i,null}function bC(i){switch(i){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(pe()){case Ne:return 2;case tt:return 8;case Tt:case wn:return 32;case hn:return 268435456;default:return 32}default:return 32}}var Jv=!1,Xa=null,Ja=null,Za=null,Gu=new Map,Wu=new Map,es=[],iN="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function SC(i,s){switch(i){case"focusin":case"focusout":Xa=null;break;case"dragenter":case"dragleave":Ja=null;break;case"mouseover":case"mouseout":Za=null;break;case"pointerover":case"pointerout":Gu.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Wu.delete(s.pointerId)}}function Qu(i,s,u,h,x,S){return i===null||i.nativeEvent!==S?(i={blockedOn:s,domEventName:u,eventSystemFlags:h,nativeEvent:S,targetContainers:[x]},s!==null&&(s=hi(s),s!==null&&yC(s)),i):(i.eventSystemFlags|=h,s=i.targetContainers,x!==null&&s.indexOf(x)===-1&&s.push(x),i)}function oN(i,s,u,h,x){switch(s){case"focusin":return Xa=Qu(Xa,i,s,u,h,x),!0;case"dragenter":return Ja=Qu(Ja,i,s,u,h,x),!0;case"mouseover":return Za=Qu(Za,i,s,u,h,x),!0;case"pointerover":var S=x.pointerId;return Gu.set(S,Qu(Gu.get(S)||null,i,s,u,h,x)),!0;case"gotpointercapture":return S=x.pointerId,Wu.set(S,Qu(Wu.get(S)||null,i,s,u,h,x)),!0}return!1}function wC(i){var s=Nr(i.target);if(s!==null){var u=l(s);if(u!==null){if(s=u.tag,s===13){if(s=c(u),s!==null){i.blockedOn=s,Ge(i.priority,function(){xC(u)});return}}else if(s===31){if(s=d(u),s!==null){i.blockedOn=s,Ge(i.priority,function(){xC(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function fh(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=Kv(i.nativeEvent);if(u===null){u=i.nativeEvent;var h=new u.constructor(u.type,u);Xm=h,u.target.dispatchEvent(h),Xm=null}else return s=hi(u),s!==null&&yC(s),i.blockedOn=u,!1;s.shift()}return!0}function jC(i,s,u){fh(i)&&u.delete(s)}function aN(){Jv=!1,Xa!==null&&fh(Xa)&&(Xa=null),Ja!==null&&fh(Ja)&&(Ja=null),Za!==null&&fh(Za)&&(Za=null),Gu.forEach(jC),Wu.forEach(jC)}function hh(i,s){i.blockedOn===s&&(i.blockedOn=null,Jv||(Jv=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,aN)))}var ph=null;function CC(i){ph!==i&&(ph=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ph===i&&(ph=null);for(var s=0;s<i.length;s+=3){var u=i[s],h=i[s+1],x=i[s+2];if(typeof h!="function"){if(Xv(h||u)===null)continue;break}var S=hi(u);S!==null&&(i.splice(s,3),s-=3,Kg(S,{pending:!0,data:x,method:u.method,action:h},h,x))}}))}function uc(i){function s(H){return hh(H,i)}Xa!==null&&hh(Xa,i),Ja!==null&&hh(Ja,i),Za!==null&&hh(Za,i),Gu.forEach(s),Wu.forEach(s);for(var u=0;u<es.length;u++){var h=es[u];h.blockedOn===i&&(h.blockedOn=null)}for(;0<es.length&&(u=es[0],u.blockedOn===null);)wC(u),u.blockedOn===null&&es.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(h=0;h<u.length;h+=3){var x=u[h],S=u[h+1],D=x[ze]||null;if(typeof S=="function")D||CC(u);else if(D){var O=null;if(S&&S.hasAttribute("formAction")){if(x=S,D=S[ze]||null)O=D.formAction;else if(Xv(x)!==null)continue}else O=D.action;typeof O=="function"?u[h+1]=O:(u.splice(h,3),h-=3),CC(u)}}}function EC(){function i(S){S.canIntercept&&S.info==="react-transition"&&S.intercept({handler:function(){return new Promise(function(D){return x=D})},focusReset:"manual",scroll:"manual"})}function s(){x!==null&&(x(),x=null),h||setTimeout(u,20)}function u(){if(!h&&!navigation.transition){var S=navigation.currentEntry;S&&S.url!=null&&navigation.navigate(S.url,{state:S.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var h=!1,x=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){h=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),x!==null&&(x(),x=null)}}}function Zv(i){this._internalRoot=i}mh.prototype.render=Zv.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,h=ii();gC(u,h,i,s,null,null)},mh.prototype.unmount=Zv.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;gC(i.current,2,null,i,null,null),Yf(),s[We]=null}};function mh(i){this._internalRoot=i}mh.prototype.unstable_scheduleHydration=function(i){if(i){var s=Xe();i={blockedOn:null,target:i,priority:s};for(var u=0;u<es.length&&s!==0&&s<es[u].priority;u++);es.splice(u,0,i),u===0&&wC(i)}};var TC=t.version;if(TC!=="19.2.0")throw Error(r(527,TC,"19.2.0"));I.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=p(s),i=i!==null?m(i):null,i=i===null?null:i.stateNode,i};var sN={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:L,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var gh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!gh.isDisabled&&gh.supportsFiber)try{$n=gh.inject(sN),Rn=gh}catch{}}return td.createRoot=function(i,s){if(!o(i))throw Error(r(299));var u=!1,h="",x=Ow,S=Nw,D=Mw;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(S=s.onCaughtError),s.onRecoverableError!==void 0&&(D=s.onRecoverableError)),s=pC(i,1,!1,null,null,u,h,null,x,S,D,EC),i[We]=s.current,Nv(i),new Zv(s)},td.hydrateRoot=function(i,s,u){if(!o(i))throw Error(r(299));var h=!1,x="",S=Ow,D=Nw,O=Mw,H=null;return u!=null&&(u.unstable_strictMode===!0&&(h=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(S=u.onUncaughtError),u.onCaughtError!==void 0&&(D=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.formState!==void 0&&(H=u.formState)),s=pC(i,1,!0,s,u??null,h,x,H,S,D,O,EC),s.context=mC(null),u=s.current,h=ii(),h=De(h),x=$a(h),x.callback=null,Ua(u,x,h),u=h,s.current.lanes=u,Fo(s,u),fo(s),i[We]=s.current,Nv(i),new mh(s)},td.version="19.2.0",td}var nR;function qX(){if(nR)return zy.exports;nR=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zy.exports=HX(),zy.exports}var GX=qX();/**
|
|
586
|
+
* react-router v7.9.5
|
|
587
|
+
*
|
|
588
|
+
* Copyright (c) Remix Software Inc.
|
|
589
|
+
*
|
|
590
|
+
* This source code is licensed under the MIT license found in the
|
|
591
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
592
|
+
*
|
|
593
|
+
* @license MIT
|
|
594
|
+
*/var aP=e=>{throw TypeError(e)},WX=(e,t,n)=>t.has(e)||aP("Cannot "+n),By=(e,t,n)=>(WX(e,t,"read from private field"),n?n.call(e):t.get(e)),QX=(e,t,n)=>t.has(e)?aP("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),rR="popstate";function YX(e={}){function t(r,o){let{pathname:l,search:c,hash:d}=r.location;return Cd("",{pathname:l,search:c,hash:d},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Po(o)}return XX(t,n,null,e)}function bt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function KX(){return Math.random().toString(36).substring(2,10)}function iR(e,t){return{usr:e.state,key:e.key,idx:t}}function Cd(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ka(t):t,state:n,key:t&&t.key||r||KX()}}function Po({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function ka(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function XX(e,t,n,r={}){let{window:o=document.defaultView,v5Compat:l=!1}=r,c=o.history,d="POP",f=null,p=m();p==null&&(p=0,c.replaceState({...c.state,idx:p},""));function m(){return(c.state||{idx:null}).idx}function g(){d="POP";let C=m(),T=C==null?null:C-p;p=C,f&&f({action:d,location:j.location,delta:T})}function y(C,T){d="PUSH";let E=Cd(j.location,C,T);p=m()+1;let R=iR(E,p),_=j.createHref(E);try{c.pushState(R,"",_)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(_)}l&&f&&f({action:d,location:j.location,delta:1})}function b(C,T){d="REPLACE";let E=Cd(j.location,C,T);p=m();let R=iR(E,p),_=j.createHref(E);c.replaceState(R,"",_),l&&f&&f({action:d,location:j.location,delta:0})}function w(C){return sP(C)}let j={get action(){return d},get location(){return e(o,c)},listen(C){if(f)throw new Error("A history only accepts one active listener");return o.addEventListener(rR,g),f=C,()=>{o.removeEventListener(rR,g),f=null}},createHref(C){return t(o,C)},createURL:w,encodeLocation(C){let T=w(C);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:y,replace:b,go(C){return c.go(C)}};return j}function sP(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),bt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:Po(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}var sd,oR=class{constructor(e){if(QX(this,sd,new Map),e)for(let[t,n]of e)this.set(t,n)}get(e){if(By(this,sd).has(e))return By(this,sd).get(e);if(e.defaultValue!==void 0)return e.defaultValue;throw new Error("No value found for context")}set(e,t){By(this,sd).set(e,t)}};sd=new WeakMap;var JX=new Set(["lazy","caseSensitive","path","id","index","children"]);function ZX(e){return JX.has(e)}var eJ=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function tJ(e){return eJ.has(e)}function nJ(e){return e.index===!0}function Ed(e,t,n=[],r={},o=!1){return e.map((l,c)=>{let d=[...n,String(c)],f=typeof l.id=="string"?l.id:d.join("-");if(bt(l.index!==!0||!l.children,"Cannot specify children on an index route"),bt(o||!r[f],`Found a route id collision on id "${f}". Route id's must be globally unique within Data Router usages`),nJ(l)){let p={...l,id:f};return r[f]=aR(p,t(p)),p}else{let p={...l,id:f,children:void 0};return r[f]=aR(p,t(p)),l.children&&(p.children=Ed(l.children,t,d,r,o)),p}})}function aR(e,t){return Object.assign(e,{...t,...typeof t.lazy=="object"&&t.lazy!=null?{lazy:{...e.lazy,...t.lazy}}:{}})}function ss(e,t,n="/"){return Qh(e,t,n,!1)}function Qh(e,t,n,r){let o=typeof t=="string"?ka(t):t,l=Ni(o.pathname||"/",n);if(l==null)return null;let c=lP(e);iJ(c);let d=null;for(let f=0;d==null&&f<c.length;++f){let p=mJ(l);d=hJ(c[f],p,r)}return d}function rJ(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],loaderData:t[n.id],handle:n.handle}}function lP(e,t=[],n=[],r="",o=!1){let l=(c,d,f=o,p)=>{let m={relativePath:p===void 0?c.path||"":p,caseSensitive:c.caseSensitive===!0,childrenIndex:d,route:c};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(r)&&f)return;bt(m.relativePath.startsWith(r),`Absolute route path "${m.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(r.length)}let g=To([r,m.relativePath]),y=n.concat(m);c.children&&c.children.length>0&&(bt(c.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),lP(c.children,t,y,g,f)),!(c.path==null&&!c.index)&&t.push({path:g,score:dJ(g,c.index),routesMeta:y})};return e.forEach((c,d)=>{if(c.path===""||!c.path?.includes("?"))l(c,d);else for(let f of cP(c.path))l(c,d,!0,f)}),t}function cP(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),l=n.replace(/\?$/,"");if(r.length===0)return o?[l,""]:[l];let c=cP(r.join("/")),d=[];return d.push(...c.map(f=>f===""?l:[l,f].join("/"))),o&&d.push(...c),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function iJ(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:fJ(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var oJ=/^:[\w-]+$/,aJ=3,sJ=2,lJ=1,cJ=10,uJ=-2,sR=e=>e==="*";function dJ(e,t){let n=e.split("/"),r=n.length;return n.some(sR)&&(r+=uJ),t&&(r+=sJ),n.filter(o=>!sR(o)).reduce((o,l)=>o+(oJ.test(l)?aJ:l===""?lJ:cJ),r)}function fJ(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 hJ(e,t,n=!1){let{routesMeta:r}=e,o={},l="/",c=[];for(let d=0;d<r.length;++d){let f=r[d],p=d===r.length-1,m=l==="/"?t:t.slice(l.length)||"/",g=Rp({path:f.relativePath,caseSensitive:f.caseSensitive,end:p},m),y=f.route;if(!g&&p&&n&&!r[r.length-1].route.index&&(g=Rp({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},m)),!g)return null;Object.assign(o,g.params),c.push({params:o,pathname:To([l,g.pathname]),pathnameBase:xJ(To([l,g.pathnameBase])),route:y}),g.pathnameBase!=="/"&&(l=To([l,g.pathnameBase]))}return c}function Rp(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=pJ(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let l=o[0],c=l.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((p,{paramName:m,isOptional:g},y)=>{if(m==="*"){let w=d[y]||"";c=l.slice(0,l.length-w.length).replace(/(.)\/+$/,"$1")}const b=d[y];return g&&!b?p[m]=void 0:p[m]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:l,pathnameBase:c,pattern:e}}function pJ(e,t=!1,n=!0){Hn(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,(c,d,f)=>(r.push({paramName:d,isOptional:f!=null}),f?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function mJ(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Hn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ni(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 gJ({basename:e,pathname:t}){return t==="/"?e:To([e,t])}function vJ(e,t="/"){let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?ka(e):e;return{pathname:n?n.startsWith("/")?n:yJ(n,t):t,search:bJ(r),hash:SJ(o)}}function yJ(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 Vy(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function uP(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function wS(e){let t=uP(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function jS(e,t,n,r=!1){let o;typeof e=="string"?o=ka(e):(o={...e},bt(!o.pathname||!o.pathname.includes("?"),Vy("?","pathname","search",o)),bt(!o.pathname||!o.pathname.includes("#"),Vy("#","pathname","hash",o)),bt(!o.search||!o.search.includes("#"),Vy("#","search","hash",o)));let l=e===""||o.pathname==="",c=l?"/":o.pathname,d;if(c==null)d=n;else{let g=t.length-1;if(!r&&c.startsWith("..")){let y=c.split("/");for(;y[0]==="..";)y.shift(),g-=1;o.pathname=y.join("/")}d=g>=0?t[g]:"/"}let f=vJ(o,d),p=c&&c!=="/"&&c.endsWith("/"),m=(l||c===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(p||m)&&(f.pathname+="/"),f}var To=e=>e.join("/").replace(/\/\/+/g,"/"),xJ=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),bJ=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,SJ=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,_p=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Td(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function CS(e){return e.filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var ds=Symbol("Uninstrumented");function wJ(e,t){let n={lazy:[],"lazy.loader":[],"lazy.action":[],"lazy.middleware":[],middleware:[],loader:[],action:[]};e.forEach(o=>o({id:t.id,index:t.index,path:t.path,instrument(l){let c=Object.keys(n);for(let d of c)l[d]&&n[d].push(l[d])}}));let r={};if(typeof t.lazy=="function"&&n.lazy.length>0){let o=Ec(n.lazy,t.lazy,()=>{});o&&(r.lazy=o)}if(typeof t.lazy=="object"){let o=t.lazy;["middleware","loader","action"].forEach(l=>{let c=o[l],d=n[`lazy.${l}`];if(typeof c=="function"&&d.length>0){let f=Ec(d,c,()=>{});f&&(r.lazy=Object.assign(r.lazy||{},{[l]:f}))}})}return["loader","action"].forEach(o=>{let l=t[o];if(typeof l=="function"&&n[o].length>0){let c=l[ds]??l,d=Ec(n[o],c,(...f)=>lR(f[0]));d&&(d[ds]=c,r[o]=d)}}),t.middleware&&t.middleware.length>0&&n.middleware.length>0&&(r.middleware=t.middleware.map(o=>{let l=o[ds]??o,c=Ec(n.middleware,l,(...d)=>lR(d[0]));return c?(c[ds]=l,c):o})),r}function jJ(e,t){let n={navigate:[],fetch:[]};if(t.forEach(r=>r({instrument(o){let l=Object.keys(o);for(let c of l)o[c]&&n[c].push(o[c])}})),n.navigate.length>0){let r=e.navigate[ds]??e.navigate,o=Ec(n.navigate,r,(...l)=>{let[c,d]=l;return{to:typeof c=="number"||typeof c=="string"?c:c?Po(c):".",...cR(e,d??{})}});o&&(o[ds]=r,e.navigate=o)}if(n.fetch.length>0){let r=e.fetch[ds]??e.fetch,o=Ec(n.fetch,r,(...l)=>{let[c,,d,f]=l;return{href:d??".",fetcherKey:c,...cR(e,f??{})}});o&&(o[ds]=r,e.fetch=o)}return e}function Ec(e,t,n){return e.length===0?null:async(...r)=>{let o=await dP(e,n(...r),()=>t(...r),e.length-1);if(o.type==="error")throw o.value;return o.value}}async function dP(e,t,n,r){let o=e[r],l;if(o){let c,d=async()=>(c?console.error("You cannot call instrumented handlers more than once"):c=dP(e,t,n,r-1),l=await c,bt(l,"Expected a result"),l.type==="error"&&l.value instanceof Error?{status:"error",error:l.value}:{status:"success",error:void 0});try{await o(d,t)}catch(f){console.error("An instrumentation function threw an error:",f)}c||await d(),await c}else try{l={type:"success",value:await n()}}catch(c){l={type:"error",value:c}}return l||{type:"error",value:new Error("No result assigned in instrumentation chain.")}}function lR(e){let{request:t,context:n,params:r,unstable_pattern:o}=e;return{request:CJ(t),params:{...r},unstable_pattern:o,context:EJ(n)}}function cR(e,t){return{currentUrl:Po(e.state.location),..."formMethod"in t?{formMethod:t.formMethod}:{},..."formEncType"in t?{formEncType:t.formEncType}:{},..."formData"in t?{formData:t.formData}:{},..."body"in t?{body:t.body}:{}}}function CJ(e){return{method:e.method,url:e.url,headers:{get:(...t)=>e.headers.get(...t)}}}function EJ(e){if(RJ(e)){let t={...e};return Object.freeze(t),t}else return{get:t=>e.get(t)}}var TJ=Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function RJ(e){if(e===null||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);return t===Object.prototype||t===null||Object.getOwnPropertyNames(t).sort().join("\0")===TJ}var fP=["POST","PUT","PATCH","DELETE"],_J=new Set(fP),DJ=["GET",...fP],AJ=new Set(DJ),kJ=new Set([301,302,303,307,308]),PJ=new Set([307,308]),Fy={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},OJ={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},nd={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},NJ=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ES=e=>NJ.test(e),MJ=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),hP="remix-router-transitions",pP=Symbol("ResetLoaderData");function LJ(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";bt(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let r=e.hydrationRouteProperties||[],o=e.mapRouteProperties||MJ,l=o;if(e.unstable_instrumentations){let q=e.unstable_instrumentations;l=Q=>({...o(Q),...wJ(q.map(ie=>ie.route).filter(Boolean),Q)})}let c={},d=Ed(e.routes,l,void 0,c),f,p=e.basename||"/";p.startsWith("/")||(p=`/${p}`);let m=e.dataStrategy||BJ,g={...e.future},y=null,b=new Set,w=null,j=null,C=null,T=e.hydrationData!=null,E=ss(d,e.history.location,p),R=!1,_=null,k;if(E==null&&!e.patchRoutesOnNavigation){let q=_i(404,{pathname:e.history.location.pathname}),{matches:Q,route:ie}=Ah(d);k=!0,E=Q,_={[ie.id]:q}}else if(E&&!e.hydrationData&&Qn(E,d,e.history.location.pathname).active&&(E=null),E)if(E.some(q=>q.route.lazy))k=!1;else if(!E.some(q=>TS(q.route)))k=!0;else{let q=e.hydrationData?e.hydrationData.loaderData:null,Q=e.hydrationData?e.hydrationData.errors:null;if(Q){let ie=E.findIndex(je=>Q[je.route.id]!==void 0);k=E.slice(0,ie+1).every(je=>!Lx(je.route,q,Q))}else k=E.every(ie=>!Lx(ie.route,q,Q))}else{k=!1,E=[];let q=Qn(null,d,e.history.location.pathname);q.active&&q.matches&&(R=!0,E=q.matches)}let N,A={historyAction:e.history.action,location:e.history.location,matches:E,initialized:k,navigation:Fy,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||_,fetchers:new Map,blockers:new Map},P="POP",U=!1,B,Y=!1,X=new Map,te=null,$=!1,W=!1,L=new Set,I=new Map,z=0,V=-1,J=new Map,M=new Set,F=new Map,oe=new Map,ce=new Set,Se=new Map,ge,Oe=null;function nt(){if(y=e.history.listen(({action:q,location:Q,delta:ie})=>{if(ge){ge(),ge=void 0;return}Hn(Se.size===0||ie!=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 je=Bo({currentLocation:A.location,nextLocation:Q,historyAction:q});if(je&&ie!=null){let De=new Promise(qe=>{ge=qe});e.history.go(ie*-1),Xr(je,{state:"blocked",location:Q,proceed(){Xr(je,{state:"proceeding",proceed:void 0,reset:void 0,location:Q}),De.then(()=>e.history.go(ie))},reset(){let qe=new Map(A.blockers);qe.set(je,nd),st({blockers:qe})}});return}return pt(q,Q)}),n){nZ(t,X);let q=()=>rZ(t,X);t.addEventListener("pagehide",q),te=()=>t.removeEventListener("pagehide",q)}return A.initialized||pt("POP",A.location,{initialHydration:!0}),N}function Ce(){y&&y(),te&&te(),b.clear(),B&&B.abort(),A.fetchers.forEach((q,Q)=>zn(Q)),A.blockers.forEach((q,Q)=>oo(Q))}function ht(q){return b.add(q),()=>b.delete(q)}function st(q,Q={}){q.matches&&(q.matches=q.matches.map(De=>{let qe=c[De.route.id],Xe=De.route;return Xe.element!==qe.element||Xe.errorElement!==qe.errorElement||Xe.hydrateFallbackElement!==qe.hydrateFallbackElement?{...De,route:qe}:De})),A={...A,...q};let ie=[],je=[];A.fetchers.forEach((De,qe)=>{De.state==="idle"&&(ce.has(qe)?ie.push(qe):je.push(qe))}),ce.forEach(De=>{!A.fetchers.has(De)&&!I.has(De)&&ie.push(De)}),[...b].forEach(De=>De(A,{deletedFetchers:ie,viewTransitionOpts:Q.viewTransitionOpts,flushSync:Q.flushSync===!0})),ie.forEach(De=>zn(De)),je.forEach(De=>A.fetchers.delete(De))}function vt(q,Q,{flushSync:ie}={}){let je=A.actionData!=null&&A.navigation.formMethod!=null&&_r(A.navigation.formMethod)&&A.navigation.state==="loading"&&q.state?._isRedirect!==!0,De;Q.actionData?Object.keys(Q.actionData).length>0?De=Q.actionData:De=null:je?De=A.actionData:De=null;let qe=Q.loaderData?xR(A.loaderData,Q.loaderData,Q.matches||[],Q.errors):A.loaderData,Xe=A.blockers;Xe.size>0&&(Xe=new Map(Xe),Xe.forEach((ze,We)=>Xe.set(We,nd)));let Ge=$?!1:Bi(q,Q.matches||A.matches),He=U===!0||A.navigation.formMethod!=null&&_r(A.navigation.formMethod)&&q.state?._isRedirect!==!0;f&&(d=f,f=void 0),$||P==="POP"||(P==="PUSH"?e.history.push(q,q.state):P==="REPLACE"&&e.history.replace(q,q.state));let Fe;if(P==="POP"){let ze=X.get(A.location.pathname);ze&&ze.has(q.pathname)?Fe={currentLocation:A.location,nextLocation:q}:X.has(q.pathname)&&(Fe={currentLocation:q,nextLocation:A.location})}else if(Y){let ze=X.get(A.location.pathname);ze?ze.add(q.pathname):(ze=new Set([q.pathname]),X.set(A.location.pathname,ze)),Fe={currentLocation:A.location,nextLocation:q}}st({...Q,actionData:De,loaderData:qe,historyAction:P,location:q,initialized:!0,navigation:Fy,revalidation:"idle",restoreScrollPosition:Ge,preventScrollReset:He,blockers:Xe},{viewTransitionOpts:Fe,flushSync:ie===!0}),P="POP",U=!1,Y=!1,$=!1,W=!1,Oe?.resolve(),Oe=null}async function rt(q,Q){if(typeof q=="number"){e.history.go(q);return}let ie=Mx(A.location,A.matches,p,q,Q?.fromRouteId,Q?.relative),{path:je,submission:De,error:qe}=uR(!1,ie,Q),Xe=A.location,Ge=Cd(A.location,je,Q&&Q.state);Ge={...Ge,...e.history.encodeLocation(Ge)};let He=Q&&Q.replace!=null?Q.replace:void 0,Fe="PUSH";He===!0?Fe="REPLACE":He===!1||De!=null&&_r(De.formMethod)&&De.formAction===A.location.pathname+A.location.search&&(Fe="REPLACE");let ze=Q&&"preventScrollReset"in Q?Q.preventScrollReset===!0:void 0,We=(Q&&Q.flushSync)===!0,Ct=Bo({currentLocation:Xe,nextLocation:Ge,historyAction:Fe});if(Ct){Xr(Ct,{state:"blocked",location:Ge,proceed(){Xr(Ct,{state:"proceeding",proceed:void 0,reset:void 0,location:Ge}),rt(q,Q)},reset(){let Xt=new Map(A.blockers);Xt.set(Ct,nd),st({blockers:Xt})}});return}await pt(Fe,Ge,{submission:De,pendingError:qe,preventScrollReset:ze,replace:Q&&Q.replace,enableViewTransition:Q&&Q.viewTransition,flushSync:We})}function wt(){Oe||(Oe=iZ()),Ne(),st({revalidation:"loading"});let q=Oe.promise;return A.navigation.state==="submitting"?q:A.navigation.state==="idle"?(pt(A.historyAction,A.location,{startUninterruptedRevalidation:!0}),q):(pt(P||A.historyAction,A.navigation.location,{overrideNavigation:A.navigation,enableViewTransition:Y===!0}),q)}async function pt(q,Q,ie){B&&B.abort(),B=null,P=q,$=(ie&&ie.startUninterruptedRevalidation)===!0,mr(A.location,A.matches),U=(ie&&ie.preventScrollReset)===!0,Y=(ie&&ie.enableViewTransition)===!0;let je=f||d,De=ie&&ie.overrideNavigation,qe=ie?.initialHydration&&A.matches&&A.matches.length>0&&!R?A.matches:ss(je,Q,p),Xe=(ie&&ie.flushSync)===!0;if(qe&&A.initialized&&!W&&YJ(A.location,Q)&&!(ie&&ie.submission&&_r(ie.submission.formMethod))){vt(Q,{matches:qe},{flushSync:Xe});return}let Ge=Qn(qe,je,Q.pathname);if(Ge.active&&Ge.matches&&(qe=Ge.matches),!qe){let{error:Pn,notFoundMatches:Ht,route:qt}=Ui(Q.pathname);vt(Q,{matches:Ht,loaderData:{},errors:{[qt.id]:Pn}},{flushSync:Xe});return}B=new AbortController;let He=Cc(e.history,Q,B.signal,ie&&ie.submission),Fe=e.getContext?await e.getContext():new oR,ze;if(ie&&ie.pendingError)ze=[ls(qe).route.id,{type:"error",error:ie.pendingError}];else if(ie&&ie.submission&&_r(ie.submission.formMethod)){let Pn=await It(He,Q,ie.submission,qe,Fe,Ge.active,ie&&ie.initialHydration===!0,{replace:ie.replace,flushSync:Xe});if(Pn.shortCircuited)return;if(Pn.pendingActionResult){let[Ht,qt]=Pn.pendingActionResult;if(ai(qt)&&Td(qt.error)&&qt.error.status===404){B=null,vt(Q,{matches:Pn.matches,loaderData:{},errors:{[Ht]:qt.error}});return}}qe=Pn.matches||qe,ze=Pn.pendingActionResult,De=Hy(Q,ie.submission),Xe=!1,Ge.active=!1,He=Cc(e.history,He.url,He.signal)}let{shortCircuited:We,matches:Ct,loaderData:Xt,errors:ct}=await Te(He,Q,qe,Fe,Ge.active,De,ie&&ie.submission,ie&&ie.fetcherSubmission,ie&&ie.replace,ie&&ie.initialHydration===!0,Xe,ze);We||(B=null,vt(Q,{matches:Ct||qe,...bR(ze),loaderData:Xt,errors:ct}))}async function It(q,Q,ie,je,De,qe,Xe,Ge={}){Ne();let He=eZ(Q,ie);if(st({navigation:He},{flushSync:Ge.flushSync===!0}),qe){let We=await Vo(je,Q.pathname,q.signal);if(We.type==="aborted")return{shortCircuited:!0};if(We.type==="error"){if(We.partialMatches.length===0){let{matches:Xt,route:ct}=Ah(d);return{matches:Xt,pendingActionResult:[ct.id,{type:"error",error:We.error}]}}let Ct=ls(We.partialMatches).route.id;return{matches:We.partialMatches,pendingActionResult:[Ct,{type:"error",error:We.error}]}}else if(We.matches)je=We.matches;else{let{notFoundMatches:Ct,error:Xt,route:ct}=Ui(Q.pathname);return{matches:Ct,pendingActionResult:[ct.id,{type:"error",error:Xt}]}}}let Fe,ze=Yh(je,Q);if(!ze.route.action&&!ze.route.lazy)Fe={type:"error",error:_i(405,{method:q.method,pathname:Q.pathname,routeId:ze.route.id})};else{let We=kc(l,c,q,je,ze,Xe?[]:r,De),Ct=await ve(q,We,De,null);if(Fe=Ct[ze.route.id],!Fe){for(let Xt of je)if(Ct[Xt.route.id]){Fe=Ct[Xt.route.id];break}}if(q.signal.aborted)return{shortCircuited:!0}}if(nl(Fe)){let We;return Ge&&Ge.replace!=null?We=Ge.replace:We=gR(Fe.response.headers.get("Location"),new URL(q.url),p)===A.location.pathname+A.location.search,await ot(q,Fe,!0,{submission:ie,replace:We}),{shortCircuited:!0}}if(ai(Fe)){let We=ls(je,ze.route.id);return(Ge&&Ge.replace)!==!0&&(P="PUSH"),{matches:je,pendingActionResult:[We.route.id,Fe,ze.route.id]}}return{matches:je,pendingActionResult:[ze.route.id,Fe]}}async function Te(q,Q,ie,je,De,qe,Xe,Ge,He,Fe,ze,We){let Ct=qe||Hy(Q,Xe),Xt=Xe||Ge||wR(Ct),ct=!$&&!Fe;if(De){if(ct){let er=Ee(We);st({navigation:Ct,...er!==void 0?{actionData:er}:{}},{flushSync:ze})}let Pt=await Vo(ie,Q.pathname,q.signal);if(Pt.type==="aborted")return{shortCircuited:!0};if(Pt.type==="error"){if(Pt.partialMatches.length===0){let{matches:Ho,route:qo}=Ah(d);return{matches:Ho,loaderData:{},errors:{[qo.id]:Pt.error}}}let er=ls(Pt.partialMatches).route.id;return{matches:Pt.partialMatches,loaderData:{},errors:{[er]:Pt.error}}}else if(Pt.matches)ie=Pt.matches;else{let{error:er,notFoundMatches:Ho,route:qo}=Ui(Q.pathname);return{matches:Ho,loaderData:{},errors:{[qo.id]:er}}}}let Pn=f||d,{dsMatches:Ht,revalidatingFetchers:qt}=dR(q,je,l,c,e.history,A,ie,Xt,Q,Fe?[]:r,Fe===!0,W,L,ce,F,M,Pn,p,e.patchRoutesOnNavigation!=null,We);if(V=++z,!e.dataStrategy&&!Ht.some(Pt=>Pt.shouldLoad)&&!Ht.some(Pt=>Pt.route.middleware&&Pt.route.middleware.length>0)&&qt.length===0){let Pt=Zn();return vt(Q,{matches:ie,loaderData:{},errors:We&&ai(We[1])?{[We[0]]:We[1].error}:null,...bR(We),...Pt?{fetchers:new Map(A.fetchers)}:{}},{flushSync:ze}),{shortCircuited:!0}}if(ct){let Pt={};if(!De){Pt.navigation=Ct;let er=Ee(We);er!==void 0&&(Pt.actionData=er)}qt.length>0&&(Pt.fetchers=Me(qt)),st(Pt,{flushSync:ze})}qt.forEach(Pt=>{$n(Pt.key),Pt.controller&&I.set(Pt.key,Pt.controller)});let Nr=()=>qt.forEach(Pt=>$n(Pt.key));B&&B.signal.addEventListener("abort",Nr);let{loaderResults:hi,fetcherResults:Mr}=await pe(Ht,qt,q,je);if(q.signal.aborted)return{shortCircuited:!0};B&&B.signal.removeEventListener("abort",Nr),qt.forEach(Pt=>I.delete(Pt.key));let sr=kh(hi);if(sr)return await ot(q,sr.result,!0,{replace:He}),{shortCircuited:!0};if(sr=kh(Mr),sr)return M.add(sr.key),await ot(q,sr.result,!0,{replace:He}),{shortCircuited:!0};let{loaderData:On,errors:Pa}=yR(A,ie,hi,We,qt,Mr);Fe&&A.errors&&(Pa={...A.errors,...Pa});let so=Zn(),pi=kn(V),Vi=so||pi||qt.length>0;return{matches:ie,loaderData:On,errors:Pa,...Vi?{fetchers:new Map(A.fetchers)}:{}}}function Ee(q){if(q&&!ai(q[1]))return{[q[0]]:q[1].data};if(A.actionData)return Object.keys(A.actionData).length===0?null:A.actionData}function Me(q){return q.forEach(Q=>{let ie=A.fetchers.get(Q.key),je=rd(void 0,ie?ie.data:void 0);A.fetchers.set(Q.key,je)}),new Map(A.fetchers)}async function Pe(q,Q,ie,je){$n(q);let De=(je&&je.flushSync)===!0,qe=f||d,Xe=Mx(A.location,A.matches,p,ie,Q,je?.relative),Ge=ss(qe,Xe,p),He=Qn(Ge,qe,Xe);if(He.active&&He.matches&&(Ge=He.matches),!Ge){Tt(q,Q,_i(404,{pathname:Xe}),{flushSync:De});return}let{path:Fe,submission:ze,error:We}=uR(!0,Xe,je);if(We){Tt(q,Q,We,{flushSync:De});return}let Ct=e.getContext?await e.getContext():new oR,Xt=(je&&je.preventScrollReset)===!0;if(ze&&_r(ze.formMethod)){await lt(q,Q,Fe,Ge,Ct,He.active,De,Xt,ze);return}F.set(q,{routeId:Q,path:Fe}),await et(q,Q,Fe,Ge,Ct,He.active,De,Xt,ze)}async function lt(q,Q,ie,je,De,qe,Xe,Ge,He){Ne(),F.delete(q);let Fe=A.fetchers.get(q);tt(q,tZ(He,Fe),{flushSync:Xe});let ze=new AbortController,We=Cc(e.history,ie,ze.signal,He);if(qe){let jn=await Vo(je,new URL(We.url).pathname,We.signal,q);if(jn.type==="aborted")return;if(jn.type==="error"){Tt(q,Q,jn.error,{flushSync:Xe});return}else if(jn.matches)je=jn.matches;else{Tt(q,Q,_i(404,{pathname:ie}),{flushSync:Xe});return}}let Ct=Yh(je,ie);if(!Ct.route.action&&!Ct.route.lazy){let jn=_i(405,{method:He.formMethod,pathname:ie,routeId:Q});Tt(q,Q,jn,{flushSync:Xe});return}I.set(q,ze);let Xt=z,ct=kc(l,c,We,je,Ct,r,De),Ht=(await ve(We,ct,De,q))[Ct.route.id];if(We.signal.aborted){I.get(q)===ze&&I.delete(q);return}if(ce.has(q)){if(nl(Ht)||ai(Ht)){tt(q,ha(void 0));return}}else{if(nl(Ht))if(I.delete(q),V>Xt){tt(q,ha(void 0));return}else return M.add(q),tt(q,rd(He)),ot(We,Ht,!1,{fetcherSubmission:He,preventScrollReset:Ge});if(ai(Ht)){Tt(q,Q,Ht.error);return}}let qt=A.navigation.location||A.location,Nr=Cc(e.history,qt,ze.signal),hi=f||d,Mr=A.navigation.state!=="idle"?ss(hi,A.navigation.location,p):A.matches;bt(Mr,"Didn't find any matches after fetcher action");let sr=++z;J.set(q,sr);let On=rd(He,Ht.data);A.fetchers.set(q,On);let{dsMatches:Pa,revalidatingFetchers:so}=dR(Nr,De,l,c,e.history,A,Mr,He,qt,r,!1,W,L,ce,F,M,hi,p,e.patchRoutesOnNavigation!=null,[Ct.route.id,Ht]);so.filter(jn=>jn.key!==q).forEach(jn=>{let Go=jn.key,mi=A.fetchers.get(Go),Lr=rd(void 0,mi?mi.data:void 0);A.fetchers.set(Go,Lr),$n(Go),jn.controller&&I.set(Go,jn.controller)}),st({fetchers:new Map(A.fetchers)});let pi=()=>so.forEach(jn=>$n(jn.key));ze.signal.addEventListener("abort",pi);let{loaderResults:Vi,fetcherResults:Pt}=await pe(Pa,so,Nr,De);if(ze.signal.aborted)return;if(ze.signal.removeEventListener("abort",pi),J.delete(q),I.delete(q),so.forEach(jn=>I.delete(jn.key)),A.fetchers.has(q)){let jn=ha(Ht.data);A.fetchers.set(q,jn)}let er=kh(Vi);if(er)return ot(Nr,er.result,!1,{preventScrollReset:Ge});if(er=kh(Pt),er)return M.add(er.key),ot(Nr,er.result,!1,{preventScrollReset:Ge});let{loaderData:Ho,errors:qo}=yR(A,Mr,Vi,void 0,so,Pt);kn(sr),A.navigation.state==="loading"&&sr>V?(bt(P,"Expected pending action"),B&&B.abort(),vt(A.navigation.location,{matches:Mr,loaderData:Ho,errors:qo,fetchers:new Map(A.fetchers)})):(st({errors:qo,loaderData:xR(A.loaderData,Ho,Mr,qo),fetchers:new Map(A.fetchers)}),W=!1)}async function et(q,Q,ie,je,De,qe,Xe,Ge,He){let Fe=A.fetchers.get(q);tt(q,rd(He,Fe?Fe.data:void 0),{flushSync:Xe});let ze=new AbortController,We=Cc(e.history,ie,ze.signal);if(qe){let qt=await Vo(je,new URL(We.url).pathname,We.signal,q);if(qt.type==="aborted")return;if(qt.type==="error"){Tt(q,Q,qt.error,{flushSync:Xe});return}else if(qt.matches)je=qt.matches;else{Tt(q,Q,_i(404,{pathname:ie}),{flushSync:Xe});return}}let Ct=Yh(je,ie);I.set(q,ze);let Xt=z,ct=kc(l,c,We,je,Ct,r,De),Ht=(await ve(We,ct,De,q))[Ct.route.id];if(I.get(q)===ze&&I.delete(q),!We.signal.aborted){if(ce.has(q)){tt(q,ha(void 0));return}if(nl(Ht))if(V>Xt){tt(q,ha(void 0));return}else{M.add(q),await ot(We,Ht,!1,{preventScrollReset:Ge});return}if(ai(Ht)){Tt(q,Q,Ht.error);return}tt(q,ha(Ht.data))}}async function ot(q,Q,ie,{submission:je,fetcherSubmission:De,preventScrollReset:qe,replace:Xe}={}){Q.response.headers.has("X-Remix-Revalidate")&&(W=!0);let Ge=Q.response.headers.get("Location");bt(Ge,"Expected a Location header on the redirect Response"),Ge=gR(Ge,new URL(q.url),p);let He=Cd(A.location,Ge,{_isRedirect:!0});if(n){let ct=!1;if(Q.response.headers.has("X-Remix-Reload-Document"))ct=!0;else if(ES(Ge)){const Pn=sP(Ge,!0);ct=Pn.origin!==t.location.origin||Ni(Pn.pathname,p)==null}if(ct){Xe?t.location.replace(Ge):t.location.assign(Ge);return}}B=null;let Fe=Xe===!0||Q.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:ze,formAction:We,formEncType:Ct}=A.navigation;!je&&!De&&ze&&We&&Ct&&(je=wR(A.navigation));let Xt=je||De;if(PJ.has(Q.response.status)&&Xt&&_r(Xt.formMethod))await pt(Fe,He,{submission:{...Xt,formAction:Ge},preventScrollReset:qe||U,enableViewTransition:ie?Y:void 0});else{let ct=Hy(He,je);await pt(Fe,He,{overrideNavigation:ct,fetcherSubmission:De,preventScrollReset:qe||U,enableViewTransition:ie?Y:void 0})}}async function ve(q,Q,ie,je){let De,qe={};try{De=await FJ(m,q,Q,je,ie,!1)}catch(Xe){return Q.filter(Ge=>Ge.shouldLoad).forEach(Ge=>{qe[Ge.route.id]={type:"error",error:Xe}}),qe}if(q.signal.aborted)return qe;for(let[Xe,Ge]of Object.entries(De))if(JJ(Ge)){let He=Ge.result;qe[Xe]={type:"redirect",response:WJ(He,q,Xe,Q,p)}}else qe[Xe]=await GJ(Ge);return qe}async function pe(q,Q,ie,je){let De=ve(ie,q,je,null),qe=Promise.all(Q.map(async He=>{if(He.matches&&He.match&&He.request&&He.controller){let ze=(await ve(He.request,He.matches,je,He.key))[He.match.route.id];return{[He.key]:ze}}else return Promise.resolve({[He.key]:{type:"error",error:_i(404,{pathname:He.path})}})})),Xe=await De,Ge=(await qe).reduce((He,Fe)=>Object.assign(He,Fe),{});return{loaderResults:Xe,fetcherResults:Ge}}function Ne(){W=!0,F.forEach((q,Q)=>{I.has(Q)&&L.add(Q),$n(Q)})}function tt(q,Q,ie={}){A.fetchers.set(q,Q),st({fetchers:new Map(A.fetchers)},{flushSync:(ie&&ie.flushSync)===!0})}function Tt(q,Q,ie,je={}){let De=ls(A.matches,Q);zn(q),st({errors:{[De.route.id]:ie},fetchers:new Map(A.fetchers)},{flushSync:(je&&je.flushSync)===!0})}function wn(q){return oe.set(q,(oe.get(q)||0)+1),ce.has(q)&&ce.delete(q),A.fetchers.get(q)||OJ}function hn(q,Q){$n(q,Q?.reason),tt(q,ha(null))}function zn(q){let Q=A.fetchers.get(q);I.has(q)&&!(Q&&Q.state==="loading"&&J.has(q))&&$n(q),F.delete(q),J.delete(q),M.delete(q),ce.delete(q),L.delete(q),A.fetchers.delete(q)}function Wn(q){let Q=(oe.get(q)||0)-1;Q<=0?(oe.delete(q),ce.add(q)):oe.set(q,Q),st({fetchers:new Map(A.fetchers)})}function $n(q,Q){let ie=I.get(q);ie&&(ie.abort(Q),I.delete(q))}function Rn(q){for(let Q of q){let ie=wn(Q),je=ha(ie.data);A.fetchers.set(Q,je)}}function Zn(){let q=[],Q=!1;for(let ie of M){let je=A.fetchers.get(ie);bt(je,`Expected fetcher: ${ie}`),je.state==="loading"&&(M.delete(ie),q.push(ie),Q=!0)}return Rn(q),Q}function kn(q){let Q=[];for(let[ie,je]of J)if(je<q){let De=A.fetchers.get(ie);bt(De,`Expected fetcher: ${ie}`),De.state==="loading"&&($n(ie),J.delete(ie),Q.push(ie))}return Rn(Q),Q.length>0}function Uo(q,Q){let ie=A.blockers.get(q)||nd;return Se.get(q)!==Q&&Se.set(q,Q),ie}function oo(q){A.blockers.delete(q),Se.delete(q)}function Xr(q,Q){let ie=A.blockers.get(q)||nd;bt(ie.state==="unblocked"&&Q.state==="blocked"||ie.state==="blocked"&&Q.state==="blocked"||ie.state==="blocked"&&Q.state==="proceeding"||ie.state==="blocked"&&Q.state==="unblocked"||ie.state==="proceeding"&&Q.state==="unblocked",`Invalid blocker state transition: ${ie.state} -> ${Q.state}`);let je=new Map(A.blockers);je.set(q,Q),st({blockers:je})}function Bo({currentLocation:q,nextLocation:Q,historyAction:ie}){if(Se.size===0)return;Se.size>1&&Hn(!1,"A router only supports one blocker at a time");let je=Array.from(Se.entries()),[De,qe]=je[je.length-1],Xe=A.blockers.get(De);if(!(Xe&&Xe.state==="proceeding")&&qe({currentLocation:q,nextLocation:Q,historyAction:ie}))return De}function Ui(q){let Q=_i(404,{pathname:q}),ie=f||d,{matches:je,route:De}=Ah(ie);return{notFoundMatches:je,route:De,error:Q}}function ao(q,Q,ie){if(w=q,C=Q,j=ie||null,!T&&A.navigation===Fy){T=!0;let je=Bi(A.location,A.matches);je!=null&&st({restoreScrollPosition:je})}return()=>{w=null,C=null,j=null}}function Or(q,Q){return j&&j(q,Q.map(je=>rJ(je,A.loaderData)))||q.key}function mr(q,Q){if(w&&C){let ie=Or(q,Q);w[ie]=C()}}function Bi(q,Q){if(w){let ie=Or(q,Q),je=w[ie];if(typeof je=="number")return je}return null}function Qn(q,Q,ie){if(e.patchRoutesOnNavigation)if(q){if(Object.keys(q[0].params).length>0)return{active:!0,matches:Qh(Q,ie,p,!0)}}else return{active:!0,matches:Qh(Q,ie,p,!0)||[]};return{active:!1,matches:null}}async function Vo(q,Q,ie,je){if(!e.patchRoutesOnNavigation)return{type:"success",matches:q};let De=q;for(;;){let qe=f==null,Xe=f||d,Ge=c;try{await e.patchRoutesOnNavigation({signal:ie,path:Q,matches:De,fetcherKey:je,patch:(ze,We)=>{ie.aborted||fR(ze,We,Xe,Ge,l,!1)}})}catch(ze){return{type:"error",error:ze,partialMatches:De}}finally{qe&&!ie.aborted&&(d=[...d])}if(ie.aborted)return{type:"aborted"};let He=ss(Xe,Q,p);if(He)return{type:"success",matches:He};let Fe=Qh(Xe,Q,p,!0);if(!Fe||De.length===Fe.length&&De.every((ze,We)=>ze.route.id===Fe[We].route.id))return{type:"success",matches:null};De=Fe}}function kl(q){c={},f=Ed(q,l,void 0,c)}function Fo(q,Q,ie=!1){let je=f==null;fR(q,Q,f||d,c,l,ie),je&&(d=[...d],st({}))}return N={get basename(){return p},get future(){return g},get state(){return A},get routes(){return d},get window(){return t},initialize:nt,subscribe:ht,enableScrollRestoration:ao,navigate:rt,fetch:Pe,revalidate:wt,createHref:q=>e.history.createHref(q),encodeLocation:q=>e.history.encodeLocation(q),getFetcher:wn,resetFetcher:hn,deleteFetcher:Wn,dispose:Ce,getBlocker:Uo,deleteBlocker:oo,patchRoutes:Fo,_internalFetchControllers:I,_internalSetRoutes:kl,_internalSetStateDoNotUseOrYouWillBreakYourApp(q){st(q)}},e.unstable_instrumentations&&(N=jJ(N,e.unstable_instrumentations.map(q=>q.router).filter(Boolean))),N}function IJ(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Mx(e,t,n,r,o,l){let c,d;if(o){c=[];for(let p of t)if(c.push(p),p.route.id===o){d=p;break}}else c=t,d=t[t.length-1];let f=jS(r||".",wS(c),Ni(e.pathname,n)||e.pathname,l==="path");if(r==null&&(f.search=e.search,f.hash=e.hash),(r==null||r===""||r===".")&&d){let p=RS(f.search);if(d.route.index&&!p)f.search=f.search?f.search.replace(/^\?/,"?index&"):"?index";else if(!d.route.index&&p){let m=new URLSearchParams(f.search),g=m.getAll("index");m.delete("index"),g.filter(b=>b).forEach(b=>m.append("index",b));let y=m.toString();f.search=y?`?${y}`:""}}return n!=="/"&&(f.pathname=gJ({basename:n,pathname:f.pathname})),Po(f)}function uR(e,t,n){if(!n||!IJ(n))return{path:t};if(n.formMethod&&!ZJ(n.formMethod))return{path:t,error:_i(405,{method:n.formMethod})};let r=()=>({path:t,error:_i(400,{type:"invalid-body"})}),l=(n.formMethod||"get").toUpperCase(),c=bP(t);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!_r(l))return r();let g=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((y,[b,w])=>`${y}${b}=${w}
|
|
595
|
+
`,""):String(n.body);return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:void 0,text:g}}}else if(n.formEncType==="application/json"){if(!_r(l))return r();try{let g=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:t,submission:{formMethod:l,formAction:c,formEncType:n.formEncType,formData:void 0,json:g,text:void 0}}}catch{return r()}}}bt(typeof FormData=="function","FormData is not available in this environment");let d,f;if(n.formData)d=zx(n.formData),f=n.formData;else if(n.body instanceof FormData)d=zx(n.body),f=n.body;else if(n.body instanceof URLSearchParams)d=n.body,f=vR(d);else if(n.body==null)d=new URLSearchParams,f=new FormData;else try{d=new URLSearchParams(n.body),f=vR(d)}catch{return r()}let p={formMethod:l,formAction:c,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:f,json:void 0,text:void 0};if(_r(p.formMethod))return{path:t,submission:p};let m=ka(t);return e&&m.search&&RS(m.search)&&d.append("index",""),m.search=`?${d}`,{path:Po(m),submission:p}}function dR(e,t,n,r,o,l,c,d,f,p,m,g,y,b,w,j,C,T,E,R){let _=R?ai(R[1])?R[1].error:R[1].data:void 0,k=o.createURL(l.location),N=o.createURL(f),A;if(m&&l.errors){let $=Object.keys(l.errors)[0];A=c.findIndex(W=>W.route.id===$)}else if(R&&ai(R[1])){let $=R[0];A=c.findIndex(W=>W.route.id===$)-1}let P=R?R[1].statusCode:void 0,U=P&&P>=400,B={currentUrl:k,currentParams:l.matches[0]?.params||{},nextUrl:N,nextParams:c[0].params,...d,actionResult:_,actionStatus:P},Y=CS(c.map($=>$.route.path)),X=c.map(($,W)=>{let{route:L}=$,I=null;if(A!=null&&W>A?I=!1:L.lazy?I=!0:TS(L)?m?I=Lx(L,l.loaderData,l.errors):zJ(l.loaderData,l.matches[W],$)&&(I=!0):I=!1,I!==null)return Ix(n,r,e,Y,$,p,t,I);let z=U?!1:g||k.pathname+k.search===N.pathname+N.search||k.search!==N.search||$J(l.matches[W],$),V={...B,defaultShouldRevalidate:z},J=Dp($,V);return Ix(n,r,e,Y,$,p,t,J,V)}),te=[];return w.forEach(($,W)=>{if(m||!c.some(oe=>oe.route.id===$.routeId)||b.has(W))return;let L=l.fetchers.get(W),I=L&&L.state!=="idle"&&L.data===void 0,z=ss(C,$.path,T);if(!z){if(E&&I)return;te.push({key:W,routeId:$.routeId,path:$.path,matches:null,match:null,request:null,controller:null});return}if(j.has(W))return;let V=Yh(z,$.path),J=new AbortController,M=Cc(o,$.path,J.signal),F=null;if(y.has(W))y.delete(W),F=kc(n,r,M,z,V,p,t);else if(I)g&&(F=kc(n,r,M,z,V,p,t));else{let oe={...B,defaultShouldRevalidate:U?!1:g};Dp(V,oe)&&(F=kc(n,r,M,z,V,p,t,oe))}F&&te.push({key:W,routeId:$.routeId,path:$.path,matches:F,match:V,request:M,controller:J})}),{dsMatches:X,revalidatingFetchers:te}}function TS(e){return e.loader!=null||e.middleware!=null&&e.middleware.length>0}function Lx(e,t,n){if(e.lazy)return!0;if(!TS(e))return!1;let r=t!=null&&e.id in t,o=n!=null&&n[e.id]!==void 0;return!r&&o?!1:typeof e.loader=="function"&&e.loader.hydrate===!0?!0:!r&&!o}function zJ(e,t,n){let r=!t||n.route.id!==t.route.id,o=!e.hasOwnProperty(n.route.id);return r||o}function $J(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function Dp(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}function fR(e,t,n,r,o,l){let c;if(e){let p=r[e];bt(p,`No route found to patch children into: routeId = ${e}`),p.children||(p.children=[]),c=p.children}else c=n;let d=[],f=[];if(t.forEach(p=>{let m=c.find(g=>mP(p,g));m?f.push({existingRoute:m,newRoute:p}):d.push(p)}),d.length>0){let p=Ed(d,o,[e||"_","patch",String(c?.length||"0")],r);c.push(...p)}if(l&&f.length>0)for(let p=0;p<f.length;p++){let{existingRoute:m,newRoute:g}=f[p],y=m,[b]=Ed([g],o,[],{},!0);Object.assign(y,{element:b.element?b.element:y.element,errorElement:b.errorElement?b.errorElement:y.errorElement,hydrateFallbackElement:b.hydrateFallbackElement?b.hydrateFallbackElement:y.hydrateFallbackElement})}}function mP(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)=>t.children?.some(o=>mP(n,o))):!1}var hR=new WeakMap,gP=({key:e,route:t,manifest:n,mapRouteProperties:r})=>{let o=n[t.id];if(bt(o,"No route found in manifest"),!o.lazy||typeof o.lazy!="object")return;let l=o.lazy[e];if(!l)return;let c=hR.get(o);c||(c={},hR.set(o,c));let d=c[e];if(d)return d;let f=(async()=>{let p=ZX(e),g=o[e]!==void 0&&e!=="hasErrorBoundary";if(p)Hn(!p,"Route property "+e+" is not a supported lazy route property. This property will be ignored."),c[e]=Promise.resolve();else if(g)Hn(!1,`Route "${o.id}" has a static property "${e}" defined. The lazy property will be ignored.`);else{let y=await l();y!=null&&(Object.assign(o,{[e]:y}),Object.assign(o,r(o)))}typeof o.lazy=="object"&&(o.lazy[e]=void 0,Object.values(o.lazy).every(y=>y===void 0)&&(o.lazy=void 0))})();return c[e]=f,f},pR=new WeakMap;function UJ(e,t,n,r,o){let l=n[e.id];if(bt(l,"No route found in manifest"),!e.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof e.lazy=="function"){let m=pR.get(l);if(m)return{lazyRoutePromise:m,lazyHandlerPromise:m};let g=(async()=>{bt(typeof e.lazy=="function","No lazy route function found");let y=await e.lazy(),b={};for(let w in y){let j=y[w];if(j===void 0)continue;let C=tJ(w),E=l[w]!==void 0&&w!=="hasErrorBoundary";C?Hn(!C,"Route property "+w+" is not a supported property to be returned from a lazy route function. This property will be ignored."):E?Hn(!E,`Route "${l.id}" has a static property "${w}" defined but its lazy function is also returning a value for this property. The lazy route property "${w}" will be ignored.`):b[w]=j}Object.assign(l,b),Object.assign(l,{...r(l),lazy:void 0})})();return pR.set(l,g),g.catch(()=>{}),{lazyRoutePromise:g,lazyHandlerPromise:g}}let c=Object.keys(e.lazy),d=[],f;for(let m of c){if(o&&o.includes(m))continue;let g=gP({key:m,route:e,manifest:n,mapRouteProperties:r});g&&(d.push(g),m===t&&(f=g))}let p=d.length>0?Promise.all(d).then(()=>{}):void 0;return p?.catch(()=>{}),f?.catch(()=>{}),{lazyRoutePromise:p,lazyHandlerPromise:f}}async function mR(e){let t=e.matches.filter(o=>o.shouldLoad),n={};return(await Promise.all(t.map(o=>o.resolve()))).forEach((o,l)=>{n[t[l].route.id]=o}),n}async function BJ(e){return e.matches.some(t=>t.route.middleware)?vP(e,()=>mR(e)):mR(e)}function vP(e,t){return VJ(e,t,r=>r,KJ,n);function n(r,o,l){if(l)return Promise.resolve(Object.assign(l.value,{[o]:{type:"error",result:r}}));{let{matches:c}=e,d=Math.min(Math.max(c.findIndex(p=>p.route.id===o),0),Math.max(c.findIndex(p=>p.unstable_shouldCallHandler()),0)),f=ls(c,c[d].route.id).route.id;return Promise.resolve({[f]:{type:"error",result:r}})}}}async function VJ(e,t,n,r,o){let{matches:l,request:c,params:d,context:f,unstable_pattern:p}=e,m=l.flatMap(y=>y.route.middleware?y.route.middleware.map(b=>[y.route.id,b]):[]);return await yP({request:c,params:d,context:f,unstable_pattern:p},m,t,n,r,o)}async function yP(e,t,n,r,o,l,c=0){let{request:d}=e;if(d.signal.aborted)throw d.signal.reason??new Error(`Request aborted: ${d.method} ${d.url}`);let f=t[c];if(!f)return await n();let[p,m]=f,g,y=async()=>{if(g)throw new Error("You may only call `next()` once per middleware");try{return g={value:await yP(e,t,n,r,o,l,c+1)},g.value}catch(b){return g={value:await l(b,p,g)},g.value}};try{let b=await m(e,y),w=b!=null?r(b):void 0;return o(w)?w:g?w??g.value:(g={value:await y()},g.value)}catch(b){return await l(b,p,g)}}function xP(e,t,n,r,o){let l=gP({key:"middleware",route:r.route,manifest:t,mapRouteProperties:e}),c=UJ(r.route,_r(n.method)?"action":"loader",t,e,o);return{middleware:l,route:c.lazyRoutePromise,handler:c.lazyHandlerPromise}}function Ix(e,t,n,r,o,l,c,d,f=null){let p=!1,m=xP(e,t,n,o,l);return{...o,_lazyPromises:m,shouldLoad:d,unstable_shouldRevalidateArgs:f,unstable_shouldCallHandler(g){return p=!0,f?typeof g=="boolean"?Dp(o,{...f,defaultShouldRevalidate:g}):Dp(o,f):d},resolve(g){let{lazy:y,loader:b,middleware:w}=o.route,j=p||d||g&&!_r(n.method)&&(y||b),C=w&&w.length>0&&!b&&!y;return j&&(_r(n.method)||!C)?HJ({request:n,unstable_pattern:r,match:o,lazyHandlerPromise:m?.handler,lazyRoutePromise:m?.route,handlerOverride:g,scopedContext:c}):Promise.resolve({type:"data",result:void 0})}}}function kc(e,t,n,r,o,l,c,d=null){return r.map(f=>f.route.id!==o.route.id?{...f,shouldLoad:!1,unstable_shouldRevalidateArgs:d,unstable_shouldCallHandler:()=>!1,_lazyPromises:xP(e,t,n,f,l),resolve:()=>Promise.resolve({type:"data",result:void 0})}:Ix(e,t,n,CS(r.map(p=>p.route.path)),f,l,c,!0,d))}async function FJ(e,t,n,r,o,l){n.some(p=>p._lazyPromises?.middleware)&&await Promise.all(n.map(p=>p._lazyPromises?.middleware));let c={request:t,unstable_pattern:CS(n.map(p=>p.route.path)),params:n[0].params,context:o,matches:n},f=await e({...c,fetcherKey:r,runClientMiddleware:p=>{let m=c;return vP(m,()=>p({...m,fetcherKey:r,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(p=>[p._lazyPromises?.handler,p._lazyPromises?.route]))}catch{}return f}async function HJ({request:e,unstable_pattern:t,match:n,lazyHandlerPromise:r,lazyRoutePromise:o,handlerOverride:l,scopedContext:c}){let d,f,p=_r(e.method),m=p?"action":"loader",g=y=>{let b,w=new Promise((T,E)=>b=E);f=()=>b(),e.signal.addEventListener("abort",f);let j=T=>typeof y!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${m}" [routeId: ${n.route.id}]`)):y({request:e,unstable_pattern:t,params:n.params,context:c},...T!==void 0?[T]:[]),C=(async()=>{try{return{type:"data",result:await(l?l(E=>j(E)):j())}}catch(T){return{type:"error",result:T}}})();return Promise.race([C,w])};try{let y=p?n.route.action:n.route.loader;if(r||o)if(y){let b,[w]=await Promise.all([g(y).catch(j=>{b=j}),r,o]);if(b!==void 0)throw b;d=w}else{await r;let b=p?n.route.action:n.route.loader;if(b)[d]=await Promise.all([g(b),o]);else if(m==="action"){let w=new URL(e.url),j=w.pathname+w.search;throw _i(405,{method:e.method,pathname:j,routeId:n.route.id})}else return{type:"data",result:void 0}}else if(y)d=await g(y);else{let b=new URL(e.url),w=b.pathname+b.search;throw _i(404,{pathname:w})}}catch(y){return{type:"error",result:y}}finally{f&&e.signal.removeEventListener("abort",f)}return d}async function qJ(e){let t=e.headers.get("Content-Type");return t&&/\bapplication\/json\b/.test(t)?e.body==null?null:e.json():e.text()}async function GJ(e){let{result:t,type:n}=e;if(SP(t)){let r;try{r=await qJ(t)}catch(o){return{type:"error",error:o}}return n==="error"?{type:"error",error:new _p(t.status,t.statusText,r),statusCode:t.status,headers:t.headers}:{type:"data",data:r,statusCode:t.status,headers:t.headers}}return n==="error"?SR(t)?t.data instanceof Error?{type:"error",error:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:new _p(t.init?.status||500,void 0,t.data),statusCode:Td(t)?t.status:void 0,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"error",error:t,statusCode:Td(t)?t.status:void 0}:SR(t)?{type:"data",data:t.data,statusCode:t.init?.status,headers:t.init?.headers?new Headers(t.init.headers):void 0}:{type:"data",data:t}}function WJ(e,t,n,r,o){let l=e.headers.get("Location");if(bt(l,"Redirects returned/thrown from loaders/actions must have a Location header"),!ES(l)){let c=r.slice(0,r.findIndex(d=>d.route.id===n)+1);l=Mx(new URL(t.url),c,o,l),e.headers.set("Location",l)}return e}function gR(e,t,n){if(ES(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),l=Ni(o.pathname,n)!=null;if(o.origin===t.origin&&l)return o.pathname+o.search+o.hash}return e}function Cc(e,t,n,r){let o=e.createURL(bP(t)).toString(),l={signal:n};if(r&&_r(r.formMethod)){let{formMethod:c,formEncType:d}=r;l.method=c.toUpperCase(),d==="application/json"?(l.headers=new Headers({"Content-Type":d}),l.body=JSON.stringify(r.json)):d==="text/plain"?l.body=r.text:d==="application/x-www-form-urlencoded"&&r.formData?l.body=zx(r.formData):l.body=r.formData}return new Request(o,l)}function zx(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function vR(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function QJ(e,t,n,r=!1,o=!1){let l={},c=null,d,f=!1,p={},m=n&&ai(n[1])?n[1].error:void 0;return e.forEach(g=>{if(!(g.route.id in t))return;let y=g.route.id,b=t[y];if(bt(!nl(b),"Cannot handle redirect results in processLoaderData"),ai(b)){let w=b.error;if(m!==void 0&&(w=m,m=void 0),c=c||{},o)c[y]=w;else{let j=ls(e,y);c[j.route.id]==null&&(c[j.route.id]=w)}r||(l[y]=pP),f||(f=!0,d=Td(b.error)?b.error.status:500),b.headers&&(p[y]=b.headers)}else l[y]=b.data,b.statusCode&&b.statusCode!==200&&!f&&(d=b.statusCode),b.headers&&(p[y]=b.headers)}),m!==void 0&&n&&(c={[n[0]]:m},n[2]&&(l[n[2]]=void 0)),{loaderData:l,errors:c,statusCode:d||200,loaderHeaders:p}}function yR(e,t,n,r,o,l){let{loaderData:c,errors:d}=QJ(t,n,r);return o.filter(f=>!f.matches||f.matches.some(p=>p.shouldLoad)).forEach(f=>{let{key:p,match:m,controller:g}=f;if(g&&g.signal.aborted)return;let y=l[p];if(bt(y,"Did not find corresponding fetcher result"),ai(y)){let b=ls(e.matches,m?.route.id);d&&d[b.route.id]||(d={...d,[b.route.id]:y.error}),e.fetchers.delete(p)}else if(nl(y))bt(!1,"Unhandled fetcher revalidation redirect");else{let b=ha(y.data);e.fetchers.set(p,b)}}),{loaderData:c,errors:d}}function xR(e,t,n,r){let o=Object.entries(t).filter(([,l])=>l!==pP).reduce((l,[c,d])=>(l[c]=d,l),{});for(let l of n){let c=l.route.id;if(!t.hasOwnProperty(c)&&e.hasOwnProperty(c)&&l.route.loader&&(o[c]=e[c]),r&&r.hasOwnProperty(c))break}return o}function bR(e){return e?ai(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function ls(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 Ah(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 _i(e,{pathname:t,routeId:n,method:r,type:o,message:l}={}){let c="Unknown Server Error",d="Unknown @remix-run/router error";return e===400?(c="Bad Request",r&&t&&n?d=`You made a ${r} request to "${t}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:o==="invalid-body"&&(d="Unable to encode submission body")):e===403?(c="Forbidden",d=`Route "${n}" does not match URL "${t}"`):e===404?(c="Not Found",d=`No route matches URL "${t}"`):e===405&&(c="Method Not Allowed",r&&t&&n?d=`You made a ${r.toUpperCase()} request to "${t}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:r&&(d=`Invalid request method "${r.toUpperCase()}"`)),new _p(e||500,c,new Error(d),!0)}function kh(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(nl(o))return{key:r,result:o}}}function bP(e){let t=typeof e=="string"?ka(e):e;return Po({...t,hash:""})}function YJ(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function KJ(e){return e!=null&&typeof e=="object"&&Object.entries(e).every(([t,n])=>typeof t=="string"&&XJ(n))}function XJ(e){return e!=null&&typeof e=="object"&&"type"in e&&"result"in e&&(e.type==="data"||e.type==="error")}function JJ(e){return SP(e.result)&&kJ.has(e.result.status)}function ai(e){return e.type==="error"}function nl(e){return(e&&e.type)==="redirect"}function SR(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function SP(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function ZJ(e){return AJ.has(e.toUpperCase())}function _r(e){return _J.has(e.toUpperCase())}function RS(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Yh(e,t){let n=typeof t=="string"?ka(t).search:t.search;if(e[e.length-1].route.index&&RS(n||""))return e[e.length-1];let r=uP(e);return r[r.length-1]}function wR(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:l,json:c}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(l!=null)return{formMethod:t,formAction:n,formEncType:r,formData:l,json:void 0,text:void 0};if(c!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:c,text:void 0}}}function Hy(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 eZ(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 rd(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 tZ(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 ha(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 nZ(e,t){try{let n=e.sessionStorage.getItem(hP);if(n){let r=JSON.parse(n);for(let[o,l]of Object.entries(r||{}))l&&Array.isArray(l)&&t.set(o,new Set(l||[]))}}catch{}}function rZ(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(hP,JSON.stringify(n))}catch(r){Hn(!1,`Failed to save applied view transitions in sessionStorage (${r}).`)}}}function iZ(){let e,t,n=new Promise((r,o)=>{e=async l=>{r(l);try{await n}catch{}},t=async l=>{o(l);try{await n}catch{}}});return{promise:n,resolve:e,reject:t}}var Dl=v.createContext(null);Dl.displayName="DataRouter";var tf=v.createContext(null);tf.displayName="DataRouterState";v.createContext(!1);var _S=v.createContext({isTransitioning:!1});_S.displayName="ViewTransition";var wP=v.createContext(new Map);wP.displayName="Fetchers";var oZ=v.createContext(null);oZ.displayName="Await";var $o=v.createContext(null);$o.displayName="Navigation";var nf=v.createContext(null);nf.displayName="Location";var io=v.createContext({outlet:null,matches:[],isDataRoute:!1});io.displayName="Route";var DS=v.createContext(null);DS.displayName="RouteError";function aZ(e,{relative:t}={}){bt(rf(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=v.useContext($o),{hash:o,pathname:l,search:c}=of(e,{relative:t}),d=l;return n!=="/"&&(d=l==="/"?n:To([n,l])),r.createHref({pathname:d,search:c,hash:o})}function rf(){return v.useContext(nf)!=null}function Kr(){return bt(rf(),"useLocation() may be used only in the context of a <Router> component."),v.useContext(nf).location}var jP="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function CP(e){v.useContext($o).static||v.useLayoutEffect(e)}function Tn(){let{isDataRoute:e}=v.useContext(io);return e?SZ():sZ()}function sZ(){bt(rf(),"useNavigate() may be used only in the context of a <Router> component.");let e=v.useContext(Dl),{basename:t,navigator:n}=v.useContext($o),{matches:r}=v.useContext(io),{pathname:o}=Kr(),l=JSON.stringify(wS(r)),c=v.useRef(!1);return CP(()=>{c.current=!0}),v.useCallback((f,p={})=>{if(Hn(c.current,jP),!c.current)return;if(typeof f=="number"){n.go(f);return}let m=jS(f,JSON.parse(l),o,p.relative==="path");e==null&&t!=="/"&&(m.pathname=m.pathname==="/"?t:To([t,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[t,n,l,o,e])}var lZ=v.createContext(null);function cZ(e){let t=v.useContext(io).outlet;return v.useMemo(()=>t&&v.createElement(lZ.Provider,{value:e},t),[t,e])}function Ft(){let{matches:e}=v.useContext(io),t=e[e.length-1];return t?t.params:{}}function of(e,{relative:t}={}){let{matches:n}=v.useContext(io),{pathname:r}=Kr(),o=JSON.stringify(wS(n));return v.useMemo(()=>jS(e,JSON.parse(o),r,t==="path"),[e,o,r,t])}function uZ(e,t){return EP(e,t)}function EP(e,t,n,r,o){bt(rf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=v.useContext($o),{matches:c}=v.useContext(io),d=c[c.length-1],f=d?d.params:{},p=d?d.pathname:"/",m=d?d.pathnameBase:"/",g=d&&d.route;{let E=g&&g.path||"";TP(p,!g||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
596
|
+
|
|
597
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=Kr(),b;if(t){let E=typeof t=="string"?ka(t):t;bt(m==="/"||E.pathname?.startsWith(m),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${m}" but pathname "${E.pathname}" was given in the \`location\` prop.`),b=E}else b=y;let w=b.pathname||"/",j=w;if(m!=="/"){let E=m.replace(/^\//,"").split("/");j="/"+w.replace(/^\//,"").split("/").slice(E.length).join("/")}let C=ss(e,{pathname:j});Hn(g||C!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Hn(C==null||C[C.length-1].route.element!==void 0||C[C.length-1].route.Component!==void 0||C[C.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let T=mZ(C&&C.map(E=>Object.assign({},E,{params:Object.assign({},f,E.params),pathname:To([m,l.encodeLocation?l.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?m:To([m,l.encodeLocation?l.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),c,n,r,o);return t&&T?v.createElement(nf.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},T):T}function dZ(){let e=bZ(),t=Td(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},l={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=v.createElement(v.Fragment,null,v.createElement("p",null,"💿 Hey developer 👋"),v.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",v.createElement("code",{style:l},"ErrorBoundary")," or"," ",v.createElement("code",{style:l},"errorElement")," prop on your route.")),v.createElement(v.Fragment,null,v.createElement("h2",null,"Unexpected Application Error!"),v.createElement("h3",{style:{fontStyle:"italic"}},t),n?v.createElement("pre",{style:o},n):null,c)}var fZ=v.createElement(dZ,null),hZ=class extends v.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?v.createElement(io.Provider,{value:this.props.routeContext},v.createElement(DS.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function pZ({routeContext:e,match:t,children:n}){let r=v.useContext(Dl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),v.createElement(io.Provider,{value:e},n)}function mZ(e,t=[],n=null,r=null,o=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let l=e,c=n?.errors;if(c!=null){let p=l.findIndex(m=>m.route.id&&c?.[m.route.id]!==void 0);bt(p>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),l=l.slice(0,Math.min(l.length,p+1))}let d=!1,f=-1;if(n)for(let p=0;p<l.length;p++){let m=l[p];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(f=p),m.route.id){let{loaderData:g,errors:y}=n,b=m.route.loader&&!g.hasOwnProperty(m.route.id)&&(!y||y[m.route.id]===void 0);if(m.route.lazy||b){d=!0,f>=0?l=l.slice(0,f+1):l=[l[0]];break}}}return l.reduceRight((p,m,g)=>{let y,b=!1,w=null,j=null;n&&(y=c&&m.route.id?c[m.route.id]:void 0,w=m.route.errorElement||fZ,d&&(f<0&&g===0?(TP("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),b=!0,j=null):f===g&&(b=!0,j=m.route.hydrateFallbackElement||null)));let C=t.concat(l.slice(0,g+1)),T=()=>{let E;return y?E=w:b?E=j:m.route.Component?E=v.createElement(m.route.Component,null):m.route.element?E=m.route.element:E=p,v.createElement(pZ,{match:m,routeContext:{outlet:p,matches:C,isDataRoute:n!=null},children:E})};return n&&(m.route.ErrorBoundary||m.route.errorElement||g===0)?v.createElement(hZ,{location:n.location,revalidation:n.revalidation,component:w,error:y,children:T(),routeContext:{outlet:null,matches:C,isDataRoute:!0},unstable_onError:r}):T()},null)}function AS(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function gZ(e){let t=v.useContext(Dl);return bt(t,AS(e)),t}function vZ(e){let t=v.useContext(tf);return bt(t,AS(e)),t}function yZ(e){let t=v.useContext(io);return bt(t,AS(e)),t}function kS(e){let t=yZ(e),n=t.matches[t.matches.length-1];return bt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function xZ(){return kS("useRouteId")}function bZ(){let e=v.useContext(DS),t=vZ("useRouteError"),n=kS("useRouteError");return e!==void 0?e:t.errors?.[n]}function SZ(){let{router:e}=gZ("useNavigate"),t=kS("useNavigate"),n=v.useRef(!1);return CP(()=>{n.current=!0}),v.useCallback(async(o,l={})=>{Hn(n.current,jP),n.current&&(typeof o=="number"?e.navigate(o):await e.navigate(o,{fromRouteId:t,...l}))},[e,t])}var jR={};function TP(e,t,n){!t&&!jR[e]&&(jR[e]=!0,Hn(!1,n))}var CR={};function ER(e,t){!e&&!CR[t]&&(CR[t]=!0,console.warn(t))}function wZ(e){let t={hasErrorBoundary:e.hasErrorBoundary||e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&(e.element&&Hn(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(t,{element:v.createElement(e.Component),Component:void 0})),e.HydrateFallback&&(e.hydrateFallbackElement&&Hn(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(t,{hydrateFallbackElement:v.createElement(e.HydrateFallback),HydrateFallback:void 0})),e.ErrorBoundary&&(e.errorElement&&Hn(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(t,{errorElement:v.createElement(e.ErrorBoundary),ErrorBoundary:void 0})),t}var jZ=["HydrateFallback","hydrateFallbackElement"],CZ=class{constructor(){this.status="pending",this.promise=new Promise((e,t)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",e(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",t(n))}})}};function EZ({router:e,flushSync:t,unstable_onError:n}){let[r,o]=v.useState(e.state),[l,c]=v.useState(),[d,f]=v.useState({isTransitioning:!1}),[p,m]=v.useState(),[g,y]=v.useState(),[b,w]=v.useState(),j=v.useRef(new Map),C=v.useCallback(k=>{o(N=>(k.errors&&n&&Object.entries(k.errors).forEach(([A,P])=>{N.errors?.[A]!==P&&n(P)}),k))},[n]),T=v.useCallback((k,{deletedFetchers:N,flushSync:A,viewTransitionOpts:P})=>{k.fetchers.forEach((B,Y)=>{B.data!==void 0&&j.current.set(Y,B.data)}),N.forEach(B=>j.current.delete(B)),ER(A===!1||t!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let U=e.window!=null&&e.window.document!=null&&typeof e.window.document.startViewTransition=="function";if(ER(P==null||U,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!P||!U){t&&A?t(()=>C(k)):v.startTransition(()=>C(k));return}if(t&&A){t(()=>{g&&(p&&p.resolve(),g.skipTransition()),f({isTransitioning:!0,flushSync:!0,currentLocation:P.currentLocation,nextLocation:P.nextLocation})});let B=e.window.document.startViewTransition(()=>{t(()=>C(k))});B.finished.finally(()=>{t(()=>{m(void 0),y(void 0),c(void 0),f({isTransitioning:!1})})}),t(()=>y(B));return}g?(p&&p.resolve(),g.skipTransition(),w({state:k,currentLocation:P.currentLocation,nextLocation:P.nextLocation})):(c(k),f({isTransitioning:!0,flushSync:!1,currentLocation:P.currentLocation,nextLocation:P.nextLocation}))},[e.window,t,g,p,C]);v.useLayoutEffect(()=>e.subscribe(T),[e,T]),v.useEffect(()=>{d.isTransitioning&&!d.flushSync&&m(new CZ)},[d]),v.useEffect(()=>{if(p&&l&&e.window){let k=l,N=p.promise,A=e.window.document.startViewTransition(async()=>{v.startTransition(()=>C(k)),await N});A.finished.finally(()=>{m(void 0),y(void 0),c(void 0),f({isTransitioning:!1})}),y(A)}},[l,p,e.window,C]),v.useEffect(()=>{p&&l&&r.location.key===l.location.key&&p.resolve()},[p,g,r.location,l]),v.useEffect(()=>{!d.isTransitioning&&b&&(c(b.state),f({isTransitioning:!0,flushSync:!1,currentLocation:b.currentLocation,nextLocation:b.nextLocation}),w(void 0))},[d.isTransitioning,b]);let E=v.useMemo(()=>({createHref:e.createHref,encodeLocation:e.encodeLocation,go:k=>e.navigate(k),push:(k,N,A)=>e.navigate(k,{state:N,preventScrollReset:A?.preventScrollReset}),replace:(k,N,A)=>e.navigate(k,{replace:!0,state:N,preventScrollReset:A?.preventScrollReset})}),[e]),R=e.basename||"/",_=v.useMemo(()=>({router:e,navigator:E,static:!1,basename:R,unstable_onError:n}),[e,E,R,n]);return v.createElement(v.Fragment,null,v.createElement(Dl.Provider,{value:_},v.createElement(tf.Provider,{value:r},v.createElement(wP.Provider,{value:j.current},v.createElement(_S.Provider,{value:d},v.createElement(_Z,{basename:R,location:r.location,navigationType:r.historyAction,navigator:E},v.createElement(TZ,{routes:e.routes,future:e.future,state:r,unstable_onError:n})))))),null)}var TZ=v.memo(RZ);function RZ({routes:e,future:t,state:n,unstable_onError:r}){return EP(e,void 0,n,r,t)}function PS(e){return cZ(e.context)}function $e(e){bt(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function _Z({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:o,static:l=!1}){bt(!rf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),d=v.useMemo(()=>({basename:c,navigator:o,static:l,future:{}}),[c,o,l]);typeof n=="string"&&(n=ka(n));let{pathname:f="/",search:p="",hash:m="",state:g=null,key:y="default"}=n,b=v.useMemo(()=>{let w=Ni(f,c);return w==null?null:{location:{pathname:w,search:p,hash:m,state:g,key:y},navigationType:r}},[c,f,p,m,g,y,r]);return Hn(b!=null,`<Router basename="${c}"> is not able to match the URL "${f}${p}${m}" because it does not start with the basename, so the <Router> won't render anything.`),b==null?null:v.createElement($o.Provider,{value:d},v.createElement(nf.Provider,{children:t,value:b}))}function DZ({children:e,location:t}){return uZ($x(e),t)}function $x(e,t=[]){let n=[];return v.Children.forEach(e,(r,o)=>{if(!v.isValidElement(r))return;let l=[...t,o];if(r.type===v.Fragment){n.push.apply(n,$x(r.props.children,l));return}bt(r.type===$e,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),bt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||l.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=$x(r.props.children,l)),n.push(c)}),n}var Kh="get",Xh="application/x-www-form-urlencoded";function Hm(e){return e!=null&&typeof e.tagName=="string"}function AZ(e){return Hm(e)&&e.tagName.toLowerCase()==="button"}function kZ(e){return Hm(e)&&e.tagName.toLowerCase()==="form"}function PZ(e){return Hm(e)&&e.tagName.toLowerCase()==="input"}function OZ(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function NZ(e,t){return e.button===0&&(!t||t==="_self")&&!OZ(e)}function Ux(e=""){return 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 MZ(e,t){let n=Ux(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(l=>{n.append(o,l)})}),n}var Ph=null;function LZ(){if(Ph===null)try{new FormData(document.createElement("form"),0),Ph=!1}catch{Ph=!0}return Ph}var IZ=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function qy(e){return e!=null&&!IZ.has(e)?(Hn(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xh}"`),null):e}function zZ(e,t){let n,r,o,l,c;if(kZ(e)){let d=e.getAttribute("action");r=d?Ni(d,t):null,n=e.getAttribute("method")||Kh,o=qy(e.getAttribute("enctype"))||Xh,l=new FormData(e)}else if(AZ(e)||PZ(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?Ni(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Kh,o=qy(e.getAttribute("formenctype"))||qy(d.getAttribute("enctype"))||Xh,l=new FormData(d,e),!LZ()){let{name:p,type:m,value:g}=e;if(m==="image"){let y=p?`${p}.`:"";l.append(`${y}x`,"0"),l.append(`${y}y`,"0")}else p&&l.append(p,g)}}else{if(Hm(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Kh,r=null,o=Xh,c=e}return l&&o==="text/plain"&&(c=l,l=void 0),{action:r,method:n.toLowerCase(),encType:o,formData:l,body:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function OS(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function $Z(e,t,n){let r=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return r.pathname==="/"?r.pathname=`_root.${n}`:t&&Ni(r.pathname,t)==="/"?r.pathname=`${t.replace(/\/$/,"")}/_root.${n}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${n}`,r}async function UZ(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function BZ(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function VZ(e,t,n){let r=await Promise.all(e.map(async o=>{let l=t.routes[o.route.id];if(l){let c=await UZ(l,n);return c.links?c.links():[]}return[]}));return GZ(r.flat(1).filter(BZ).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function TR(e,t,n,r,o,l){let c=(f,p)=>n[p]?f.route.id!==n[p].route.id:!0,d=(f,p)=>n[p].pathname!==f.pathname||n[p].route.path?.endsWith("*")&&n[p].params["*"]!==f.params["*"];return l==="assets"?t.filter((f,p)=>c(f,p)||d(f,p)):l==="data"?t.filter((f,p)=>{let m=r.routes[f.route.id];if(!m||!m.hasLoader)return!1;if(c(f,p)||d(f,p))return!0;if(f.route.shouldRevalidate){let g=f.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof g=="boolean")return g}return!0}):[]}function FZ(e,t,{includeHydrateFallback:n}={}){return HZ(e.map(r=>{let o=t.routes[r.route.id];if(!o)return[];let l=[o.module];return o.clientActionModule&&(l=l.concat(o.clientActionModule)),o.clientLoaderModule&&(l=l.concat(o.clientLoaderModule)),n&&o.hydrateFallbackModule&&(l=l.concat(o.hydrateFallbackModule)),o.imports&&(l=l.concat(o.imports)),l}).flat(1))}function HZ(e){return[...new Set(e)]}function qZ(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function GZ(e,t){let n=new Set;return new Set(t),e.reduce((r,o)=>{let l=JSON.stringify(qZ(o));return n.has(l)||(n.add(l),r.push({key:l,link:o})),r},[])}function RP(){let e=v.useContext(Dl);return OS(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function WZ(){let e=v.useContext(tf);return OS(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var NS=v.createContext(void 0);NS.displayName="FrameworkContext";function _P(){let e=v.useContext(NS);return OS(e,"You must render this element inside a <HydratedRouter> element"),e}function QZ(e,t){let n=v.useContext(NS),[r,o]=v.useState(!1),[l,c]=v.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=t,y=v.useRef(null);v.useEffect(()=>{if(e==="render"&&c(!0),e==="viewport"){let j=T=>{T.forEach(E=>{c(E.isIntersecting)})},C=new IntersectionObserver(j,{threshold:.5});return y.current&&C.observe(y.current),()=>{C.disconnect()}}},[e]),v.useEffect(()=>{if(r){let j=setTimeout(()=>{c(!0)},100);return()=>{clearTimeout(j)}}},[r]);let b=()=>{o(!0)},w=()=>{o(!1),c(!1)};return n?e!=="intent"?[l,y,{}]:[l,y,{onFocus:id(d,b),onBlur:id(f,w),onMouseEnter:id(p,b),onMouseLeave:id(m,w),onTouchStart:id(g,b)}]:[!1,y,{}]}function id(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function YZ({page:e,...t}){let{router:n}=RP(),r=v.useMemo(()=>ss(n.routes,e,n.basename),[n.routes,e,n.basename]);return r?v.createElement(XZ,{page:e,matches:r,...t}):null}function KZ(e){let{manifest:t,routeModules:n}=_P(),[r,o]=v.useState([]);return v.useEffect(()=>{let l=!1;return VZ(e,t,n).then(c=>{l||o(c)}),()=>{l=!0}},[e,t,n]),r}function XZ({page:e,matches:t,...n}){let r=Kr(),{manifest:o,routeModules:l}=_P(),{basename:c}=RP(),{loaderData:d,matches:f}=WZ(),p=v.useMemo(()=>TR(e,t,f,o,r,"data"),[e,t,f,o,r]),m=v.useMemo(()=>TR(e,t,f,o,r,"assets"),[e,t,f,o,r]),g=v.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let w=new Set,j=!1;if(t.forEach(T=>{let E=o.routes[T.route.id];!E||!E.hasLoader||(!p.some(R=>R.route.id===T.route.id)&&T.route.id in d&&l[T.route.id]?.shouldRevalidate||E.hasClientLoader?j=!0:w.add(T.route.id))}),w.size===0)return[];let C=$Z(e,c,"data");return j&&w.size>0&&C.searchParams.set("_routes",t.filter(T=>w.has(T.route.id)).map(T=>T.route.id).join(",")),[C.pathname+C.search]},[c,d,r,o,p,t,e,l]),y=v.useMemo(()=>FZ(m,o),[m,o]),b=KZ(m);return v.createElement(v.Fragment,null,g.map(w=>v.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...n})),y.map(w=>v.createElement("link",{key:w,rel:"modulepreload",href:w,...n})),b.map(({key:w,link:j})=>v.createElement("link",{key:w,nonce:n.nonce,...j})))}function JZ(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var DP=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{DP&&(window.__reactRouterVersion="7.9.5")}catch{}function ZZ(e,t){return LJ({basename:t?.basename,getContext:t?.getContext,future:t?.future,history:YX({window:t?.window}),hydrationData:eee(),routes:e,mapRouteProperties:wZ,hydrationRouteProperties:jZ,dataStrategy:t?.dataStrategy,patchRoutesOnNavigation:t?.patchRoutesOnNavigation,window:t?.window,unstable_instrumentations:t?.unstable_instrumentations}).initialize()}function eee(){let e=window?.__staticRouterHydrationData;return e&&e.errors&&(e={...e,errors:tee(e.errors)}),e}function tee(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 _p(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let l=window[o.__subType];if(typeof l=="function")try{let c=new l(o.message);c.stack="",n[r]=c}catch{}}if(n[r]==null){let l=new Error(o.message);l.stack="",n[r]=l}}else n[r]=o;return n}var AP=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kP=v.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:o,reloadDocument:l,replace:c,state:d,target:f,to:p,preventScrollReset:m,viewTransition:g,...y},b){let{basename:w}=v.useContext($o),j=typeof p=="string"&&AP.test(p),C,T=!1;if(typeof p=="string"&&j&&(C=p,DP))try{let U=new URL(window.location.href),B=p.startsWith("//")?new URL(U.protocol+p):new URL(p),Y=Ni(B.pathname,w);B.origin===U.origin&&Y!=null?p=Y+B.search+B.hash:T=!0}catch{Hn(!1,`<Link to="${p}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let E=aZ(p,{relative:o}),[R,_,k]=QZ(r,y),N=oee(p,{replace:c,state:d,target:f,preventScrollReset:m,relative:o,viewTransition:g});function A(U){t&&t(U),U.defaultPrevented||N(U)}let P=v.createElement("a",{...y,...k,href:C||E,onClick:T||l?t:A,ref:JZ(b,_),target:f,"data-discover":!j&&n==="render"?"true":void 0});return R&&!j?v.createElement(v.Fragment,null,P,v.createElement(YZ,{page:E})):P});kP.displayName="Link";var nee=v.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:o=!1,style:l,to:c,viewTransition:d,children:f,...p},m){let g=of(c,{relative:p.relative}),y=Kr(),b=v.useContext(tf),{navigator:w,basename:j}=v.useContext($o),C=b!=null&&uee(g)&&d===!0,T=w.encodeLocation?w.encodeLocation(g).pathname:g.pathname,E=y.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(E=E.toLowerCase(),R=R?R.toLowerCase():null,T=T.toLowerCase()),R&&j&&(R=Ni(R,j)||R);const _=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let k=E===T||!o&&E.startsWith(T)&&E.charAt(_)==="/",N=R!=null&&(R===T||!o&&R.startsWith(T)&&R.charAt(T.length)==="/"),A={isActive:k,isPending:N,isTransitioning:C},P=k?t:void 0,U;typeof r=="function"?U=r(A):U=[r,k?"active":null,N?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let B=typeof l=="function"?l(A):l;return v.createElement(kP,{...p,"aria-current":P,className:U,ref:m,style:B,to:c,viewTransition:d},typeof f=="function"?f(A):f)});nee.displayName="NavLink";var ree=v.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:o,state:l,method:c=Kh,action:d,onSubmit:f,relative:p,preventScrollReset:m,viewTransition:g,...y},b)=>{let w=lee(),j=cee(d,{relative:p}),C=c.toLowerCase()==="get"?"get":"post",T=typeof d=="string"&&AP.test(d),E=R=>{if(f&&f(R),R.defaultPrevented)return;R.preventDefault();let _=R.nativeEvent.submitter,k=_?.getAttribute("formmethod")||c;w(_||R.currentTarget,{fetcherKey:t,method:k,navigate:n,replace:o,state:l,relative:p,preventScrollReset:m,viewTransition:g})};return v.createElement("form",{ref:b,method:C,action:j,onSubmit:r?f:E,...y,"data-discover":!T&&e==="render"?"true":void 0})});ree.displayName="Form";function iee(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function PP(e){let t=v.useContext(Dl);return bt(t,iee(e)),t}function oee(e,{target:t,replace:n,state:r,preventScrollReset:o,relative:l,viewTransition:c}={}){let d=Tn(),f=Kr(),p=of(e,{relative:l});return v.useCallback(m=>{if(NZ(m,t)){m.preventDefault();let g=n!==void 0?n:Po(f)===Po(p);d(e,{replace:g,state:r,preventScrollReset:o,relative:l,viewTransition:c})}},[f,d,p,n,r,t,e,o,l,c])}function MS(e){Hn(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let t=v.useRef(Ux(e)),n=v.useRef(!1),r=Kr(),o=v.useMemo(()=>MZ(r.search,n.current?null:t.current),[r.search]),l=Tn(),c=v.useCallback((d,f)=>{const p=Ux(typeof d=="function"?d(new URLSearchParams(o)):d);n.current=!0,l("?"+p,f)},[l,o]);return[o,c]}var aee=0,see=()=>`__${String(++aee)}__`;function lee(){let{router:e}=PP("useSubmit"),{basename:t}=v.useContext($o),n=xZ();return v.useCallback(async(r,o={})=>{let{action:l,method:c,encType:d,formData:f,body:p}=zZ(r,t);if(o.navigate===!1){let m=o.fetcherKey||see();await e.fetch(m,n,o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,flushSync:o.flushSync})}else await e.navigate(o.action||l,{preventScrollReset:o.preventScrollReset,formData:f,body:p,formMethod:o.method||c,formEncType:o.encType||d,replace:o.replace,state:o.state,fromRouteId:n,flushSync:o.flushSync,viewTransition:o.viewTransition})},[e,t,n])}function cee(e,{relative:t}={}){let{basename:n}=v.useContext($o),r=v.useContext(io);bt(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),l={...of(e||".",{relative:t})},c=Kr();if(e==null){l.search=c.search;let d=new URLSearchParams(l.search),f=d.getAll("index");if(f.some(m=>m==="")){d.delete("index"),f.filter(g=>g).forEach(g=>d.append("index",g));let m=d.toString();l.search=m?`?${m}`:""}}return(!e||e===".")&&o.route.index&&(l.search=l.search?l.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(l.pathname=l.pathname==="/"?n:To([n,l.pathname])),Po(l)}function uee(e,{relative:t}={}){let n=v.useContext(_S);bt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=PP("useViewTransitionState"),o=of(e,{relative:t});if(!n.isTransitioning)return!1;let l=Ni(n.currentLocation.pathname,r)||n.currentLocation.pathname,c=Ni(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Rp(o.pathname,c)!=null||Rp(o.pathname,l)!=null}function LS(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function dee(e){if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return e.specimen?.[0]}function Cs(e){return ll(e.getActiveLogin()?.project)}function qm(e){const t=_e(),n=Cs(t),r=Tn(),[o,l]=v.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:fe.EQUALS,value:"Project/"+n},{code:"profile-type",operator:fe.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return a.jsx(su,{search:o,onClick:c=>r(`/admin/members/${c.resource.id}`)?.catch(console.error),onChange:c=>l(c.definition),hideFilters:!0,hideToolbar:!0})}function fee(){return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Bots"}),a.jsx(qm,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/bots/new",children:"Create new bot"})})]})}function hee(){return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Clients"}),a.jsx(qm,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/clients/new",children:"Create new client"})})]})}function Gm(e){return a.jsx(Rl,{resourceType:"AccessPolicy",name:e.name,defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{Io(t)?e.onChange(Wt(t)):e.onChange(void 0)}})}function pee(){const e=_e(),t=Cs(e),[n,r]=v.useState(""),[o,l]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Create new Bot"}),a.jsxs(ft,{onSubmit:()=>{const y={name:n,description:o,accessPolicy:c};e.post("admin/projects/"+t+"/bot",y).then(b=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),g(b),ke({color:"green",message:"Bot created"})}).catch(b=>{ke({color:"red",message:Ye(b),autoClose:!1}),p(Yt(b))})},children:[!m&&a.jsxs(Ue,{children:[a.jsx(zt,{title:"Name",htmlFor:"name",outcome:f,children:a.jsx(Be,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:y=>r(y.currentTarget.value),error:Lt(f,"name")})}),a.jsx(zt,{title:"Description",htmlFor:"description",outcome:f,children:a.jsx(Be,{id:"description",name:"description",onChange:y=>l(y.currentTarget.value),error:Lt(f,"description")})}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:a.jsx(Gm,{name:"accessPolicy",onChange:d})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ae,{type:"submit",children:"Create Bot"})})]}),m&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Re,{children:"Bot created"}),a.jsxs(Dr,{children:[a.jsx(Dr.Item,{children:a.jsx(St,{to:m,children:"Go to new bot"})}),a.jsx(Dr.Item,{children:a.jsx(St,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function mee(){const e=_e(),t=Cs(e),[n,r]=v.useState(""),[o,l]=v.useState(""),[c,d]=v.useState(""),[f,p]=v.useState(),[m,g]=v.useState(),[y,b]=v.useState(void 0);return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Create new Client"}),a.jsxs(ft,{onSubmit:()=>{const w={name:n,description:o,redirectUri:c,accessPolicy:f};e.post("admin/projects/"+t+"/client",w).then(j=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),b(j),ke({color:"green",message:"Client created"})}).catch(j=>{ke({color:"red",message:Ye(j),autoClose:!1}),g(Yt(j))})},children:[!y&&a.jsxs(Ue,{children:[a.jsx(zt,{title:"Name",htmlFor:"name",outcome:m,children:a.jsx(Be,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:w=>r(w.currentTarget.value),error:Lt(m,"name")})}),a.jsx(zt,{title:"Description",htmlFor:"description",outcome:m,children:a.jsx(Be,{id:"description",name:"description",onChange:w=>l(w.currentTarget.value),error:Lt(m,"description")})}),a.jsx(zt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:m,children:a.jsx(Be,{id:"redirectUri",name:"redirectUri",onChange:w=>d(w.currentTarget.value),error:Lt(m,"redirectUri")})}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:m,children:a.jsx(Gm,{name:"accessPolicy",onChange:p})}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ae,{type:"submit",children:"Create Client"})})]}),y&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Re,{children:"Client created"}),a.jsxs(Dr,{children:[a.jsx(Dr.Item,{children:a.jsx(St,{to:y,children:"Go to new client"})}),a.jsx(Dr.Item,{children:a.jsx(St,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function IS(e,t,n,r){const o=Date.now().toString();ke({id:o,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const l={method:"POST",pollStatusOnAccepted:!0};return r&&(l.body=JSON.stringify(r)),e.startAsyncRequest(n,l).then(c=>{let d="Done";return c.resourceType==="AsyncJob"?d=a.jsx(St,{to:c,children:"View AsyncJob"}):c.resourceType==="OperationOutcome"&&c.issue?.[0]?.details?.text&&(d=a.jsx(Re,{children:c.issue[0].details.text})),Di.update({id:o,color:"green",title:t,message:d,icon:a.jsx(zo,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c}).catch(c=>{throw Di.update({id:o,color:"red",title:t,message:Ye(c),icon:a.jsx(fl,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0}),c})}function Hs(e,t,n,r){IS(e,t,n,r).catch(()=>{})}const gee=8;function vee({pillInputProps:e,inputProps:t,data:n,onChange:r}){const o=Sl({onDropdownClose:()=>o.resetSelectedOption(),onDropdownOpen:()=>o.updateSelectedOptionIndex("active")}),[l,c]=v.useState(""),[d,f]=v.useState([]),p=w=>{const j=d.includes(w)?d.filter(C=>C!==w):[...d,w];f(j),r&&r(j)},m=w=>f(j=>j.filter(C=>C!==w)),g=v.useMemo(()=>d.map(w=>a.jsx(ya,{withRemoveButton:!0,onRemove:()=>m(w),children:w},w)),[d]),y=v.useMemo(()=>{const w=l.trim().toLowerCase();return n.filter(j=>j.toLowerCase().includes(w))},[n,l]),b=v.useMemo(()=>{const w=new Array(Math.min(y.length,gee));for(let j=0;j<w.length;j++){const C=y[j];w[j]=a.jsx(Ke.Option,{value:C,active:d.includes(C),children:a.jsxs(xe,{gap:"sm",children:[d.includes(C)?a.jsx(Ld,{size:12}):null,a.jsx("span",{children:C})]})},C)}return w},[y,d]);return a.jsxs(Ke,{store:o,onOptionSubmit:p,withinPortal:!1,children:[a.jsx(Ke.DropdownTarget,{children:a.jsx(hs,{onClick:()=>o.openDropdown(),...e,children:a.jsxs(ya.Group,{children:[g,a.jsx(Ke.EventsTarget,{children:a.jsx(hs.Field,{onFocus:()=>o.openDropdown(),onBlur:()=>{o.closeDropdown(),c("")},value:l,onChange:w=>{o.updateSelectedOptionIndex(),c(w.currentTarget.value)},onKeyDown:w=>{w.key==="Backspace"&&l.length===0&&d.length>0&&(w.preventDefault(),m(d[d.length-1]))},...t})})]})})}),a.jsx(Ke.Dropdown,{children:a.jsx(Ke.Options,{children:b.length>0?b:a.jsx(Ke.Empty,{children:"Nothing found..."})})})]})}function yee({defaultGinPendingListLimit:e,availableTables:t,onResponse:n}){const r=_e(),[o,l]=v.useState(!1),[c,d]=v.useState([]),[f,p]=v.useState("unspecified"),[m,g]=v.useState("unspecified"),[y,b]=v.useState(void 0),w=()=>{const j={tableName:c};f==="reset"?j.fastUpdateAction="reset":f==="on"?(j.fastUpdateAction="set",j.fastUpdateValue=!0):f==="off"&&(j.fastUpdateAction="set",j.fastUpdateValue=!1),m==="reset"?j.ginPendingListLimitAction="reset":m==="set"&&(j.ginPendingListLimitAction="set",j.ginPendingListLimitValue=y),l(!0),IS(r,"Configure GIN Indexes","fhir/R4/$db-configure-indexes",j).then(C=>{n(C)}).catch(()=>{}).finally(()=>{l(!1)})};return a.jsx(ft,{onSubmit:w,children:a.jsxs(Ue,{gap:"sm",maw:"800",children:[a.jsx(Pd,{label:"Table(s)",children:a.jsx(vee,{data:t,onChange:j=>d(j),inputProps:{name:"tables",placeholder:"e.g. Observation"}})}),a.jsx(vr.Group,{name:"fastUpdate",label:"fastupdate",value:f,onChange:j=>p(j),children:a.jsxs(xe,{h:"36",children:[a.jsx(vr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(vr,{size:"sm",value:"reset",label:"reset to default (on)"}),a.jsx(vr,{size:"sm",value:"off",label:"off"}),a.jsx(vr,{size:"sm",value:"on",label:"on"})]})}),a.jsx(vr.Group,{name:"ginPendingListLimit",label:"gin_pending_list_limit",value:m,onChange:j=>{g(j),j!=="set"&&b(void 0)},children:a.jsxs(xe,{h:"36",children:[a.jsx(vr,{size:"sm",value:"unspecified",label:"unspecified"}),a.jsx(vr,{size:"sm",value:"reset",label:`reset to default (${e}kB)`}),a.jsxs(xe,{children:[a.jsx(vr,{size:"sm",value:"set",label:"Set to (kB)"}),a.jsx(zc,{title:"gin_pending_list_limit_value",name:"gin_pending_list_limit_value",value:(m==="set"?y:"")||"",disabled:m!=="set",required:m==="set",size:"sm",w:"100",min:64,max:2147483647,onChange:j=>{b(typeof j=="number"?j:void 0)}})]})]})}),a.jsx(xe,{justify:"center",children:a.jsx(jr,{size:"sm",loading:o,children:"Update"})})]})})}const xee=8;function bee({inputProps:e,data:t,onChange:n}){const r=Sl({onDropdownClose:()=>r.resetSelectedOption()}),[o,l]=v.useState(null),[c,d]=v.useState(""),f=v.useMemo(()=>t.filter(m=>m.toLowerCase().includes(c.toLowerCase().trim())),[t,c]),p=v.useMemo(()=>{const m=new Array(Math.min(f.length,xee));for(let g=0;g<m.length;g++){const y=f[g];m[g]=a.jsx(Ke.Option,{value:y,children:y},y)}return m},[f]);return a.jsxs(Ke,{store:r,withinPortal:!1,onOptionSubmit:m=>{n&&n(m),l(m),d(m),r.closeDropdown()},children:[a.jsx(Ke.Target,{children:a.jsx(Pr,{rightSection:a.jsx(Ke.Chevron,{}),value:c,onChange:m=>{r.openDropdown(),r.updateSelectedOptionIndex(),d(m.currentTarget.value)},onClick:()=>r.openDropdown(),onFocus:()=>r.openDropdown(),onBlur:()=>{r.closeDropdown(),d(o||"")},rightSectionPointerEvents:"none",...e})}),a.jsx(Ke.Dropdown,{children:a.jsx(Ke.Options,{children:p.length>0?p:a.jsx(Ke.Empty,{children:"Nothing found"})})})]})}function See(e){let t=[];for(const n of e)t.push(n),t.push(n+"_History"),t.push(n+"_References");return t.push("Address"),t.push("ContactPoint"),t.push("HumanName"),t.push("Coding"),t.push("Coding_Property"),t.push("DatabaseMigration"),t=Bc(t),t}function OP(e){return typeof e=="string"?e.length>50?e.substring(0,50)+"...":e:typeof e=="boolean"?e.toString().toLocaleUpperCase():e}function wee(){const e=_e(),[t,{open:n,close:r}]=Gc(!1),[o,l]=v.useState(""),[c,d]=v.useState(),[f,p]=v.useState(void 0),[m,g]=v.useState(0),[y,b]=v.useState(!1),[w,j]=v.useState(void 0),[C,T]=v.useState([]),[E,R]=v.useState(0);v.useEffect(()=>{async function A(){return(await e.valueSetExpand({url:"https://medplum.com/fhir/ValueSet/resource-types",count:200})).expansion?.contains?.map(U=>U.code).filter(U=>U!==void 0)??[]}A().then(P=>{T(See(P))}).catch(console.error)},[e]),v.useEffect(()=>{b(!0),e.get("fhir/R4/$db-indexes?tableName="+encodeURIComponent(f??""),{cache:"no-cache"}).then(A=>{const P=A.parameter?.find(B=>B.name==="defaultGinPendingListLimit")?.valueInteger??0;g(P);const U=A.parameter?.filter(B=>B.name==="index");j(U??[])}).finally(()=>{b(!1)}).catch(A=>{ke({color:"red",message:A.message})})},[e,f,E]);const _=A=>{l("Configure results"),d(a.jsx("pre",{children:JSON.stringify(A,null,2)})),n(),R(P=>(P+1)%100)},k={onClick:A=>{l("Details"),d(a.jsx("pre",{children:A})),n()}};let N;return y?N="Loading...":f?w?.length===0&&(N="No GIN indexes on this table"):N="Select a table",a.jsxs(a.Fragment,{children:[a.jsxs(Ue,{gap:"sm",children:[a.jsx("h2",{children:"Configure GIN indexes"}),a.jsx(xe,{children:a.jsx(yee,{defaultGinPendingListLimit:m,availableTables:C,onResponse:_})}),a.jsx("h2",{children:"GIN index stats"}),a.jsxs(xe,{children:[a.jsx(bee,{data:C,inputProps:{placeholder:"Table name",inputSize:"50"},onChange:A=>{p(A)}}),a.jsx(Ae,{loading:y,onClick:()=>R(A=>(A+1)%100),disabled:!f,children:"Refresh"})]}),a.jsx(he.ScrollContainer,{minWidth:500,children:a.jsxs(he,{striped:!0,highlightOnHover:!0,children:[a.jsx(he.Thead,{children:a.jsxs(he.Tr,{children:[a.jsx(he.Th,{children:"Schema"}),a.jsx(he.Th,{children:"Table"}),a.jsx(he.Th,{children:"Index"}),a.jsx(he.Th,{children:"fastupdate"}),a.jsx(he.Th,{children:"gin_pending_list_limit"}),a.jsx(he.Th,{children:"options"})]})}),a.jsxs(he.Tbody,{children:[N&&a.jsx(he.Tr,{children:a.jsx(he.Td,{colSpan:16,children:N})}),!N&&w?.map(A=>{const P=A.part??[],U=P.find(B=>B.name==="indexName")?.valueString;if(!U)throw new Error("Index missing name",{cause:A});return a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:P.find(B=>B.name==="schemaName")?.valueString}),a.jsx(he.Td,{children:P.find(B=>B.name==="tableName")?.valueString}),a.jsx(he.Td,{children:U}),a.jsx(Gy,{value:P.find(B=>B.name==="fastUpdate")?.valueBoolean,defaultValue:a.jsxs(Re,{span:!0,c:"dimmed",fs:"italic",children:["default (",OP(!0),")"]}),...k}),a.jsx(Gy,{value:P.find(B=>B.name==="ginPendingListLimit")?.valueInteger,defaultValue:a.jsxs(Re,{span:!0,c:"dimmed",fs:"italic",children:["default (",m,")"]}),...k}),a.jsx(Gy,{value:P.find(B=>B.name==="indexOptions")?.valueString,defaultValue:a.jsx(Re,{span:!0,c:"dimmed",fs:"italic",children:"NULL"}),...k})]},U)})]})]})})]}),a.jsx(Gn,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function Gy({value:e,onClick:t,defaultValue:n}){return a.jsx(he.Td,{style:{cursor:"pointer"},onClick:()=>t?.(e),children:e===void 0?n:OP(e)})}function jee(){const e=_e(),t=["GIN Indexes"],[n,r]=v.useState(t[0]);function o(l){l||(l=t[0]),r(l)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(Cr,{outcome:Wd}):a.jsx(ou,{maw:"100%",children:a.jsxs(Tl,{children:[a.jsx(Le,{order:1,children:"Database Tools"}),a.jsxs(kt,{value:n,onChange:o,children:[a.jsx(kt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:t.map(l=>a.jsx(kt.Tab,{value:l,children:l},l))}),a.jsx(kt.Panel,{value:"GIN Indexes",pt:"md",children:a.jsx(wee,{})})]})]})})}function Cee(e){return a.jsx(Rl,{resourceType:"UserConfiguration",name:e.name,defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{Io(t)?e.onChange(Wt(t)):e.onChange(void 0)}})}function Eee(){const{membershipId:e}=Ft(),t=_e(),n=Cs(t),r=Tn(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[l,c]=v.useState(o.accessPolicy),[d,f]=v.useState(o.userConfiguration),[p,m]=v.useState(o.admin),[g,y]=v.useState(),[b,w]=v.useState(!1);function j(){window.confirm("Are you sure?")&&t.delete(`admin/projects/${n}/members/${e}`).then(()=>t.get(`admin/projects/${n}`,{cache:"no-cache"})).then(()=>r("/admin/project")).catch(C=>y(Yt(C)))}return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Edit membership"}),a.jsx("h3",{children:a.jsx(Ac,{value:o.profile,link:!0})}),a.jsxs(ft,{onSubmit:()=>{const C={...o,accessPolicy:l,userConfiguration:d,admin:p};t.post(`admin/projects/${n}/members/${e}`,C).then(()=>w(!0)).catch(T=>y(Yt(T)))},children:[!b&&a.jsxs(Ue,{children:[a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:g,children:a.jsx(Gm,{name:"accessPolicy",defaultValue:l,onChange:c})}),a.jsx(zt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:g,children:a.jsx(Cee,{name:"userConfiguration",defaultValue:d,onChange:f})}),a.jsx(zt,{title:"Admin",htmlFor:"admin",outcome:g,children:a.jsx(Ln,{id:"admin",name:"admin",defaultChecked:p,onChange:C=>m(C.currentTarget.checked)})}),a.jsxs(xe,{justify:"flex-end",mt:"xl",children:[a.jsx(Ae,{type:"submit",children:"Save"}),a.jsx(Ae,{type:"button",color:"red",variant:"outline",onClick:j,children:"Remove user"})]})]}),b&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User updated"}),a.jsx("pre",{children:JSON.stringify(g,void 0,2)}),a.jsxs("p",{children:["Click ",a.jsx(St,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function Tee(){const e=_e(),[t,n]=v.useState(e.getProject()),[r,o]=v.useState(),[l,c]=v.useState(),[d,f]=v.useState(!1),[p,m]=v.useState(void 0),g=v.useCallback(y=>{const b={resourceType:y.resourceType,firstName:y.firstName,lastName:y.lastName,email:y.email,sendEmail:y.sendEmail==="on",accessPolicy:r,admin:y.isAdmin==="on",scope:y.isProjectScoped==="on"?"project":"server",mfaRequired:y.mfaRequired==="on"};return e.invite(t?.id,b).then(w=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Sm(w)?c(w):m(w),f(b.sendEmail??!1),ke({color:"green",message:"Invite success"})}).catch(w=>{ke({color:"red",message:Ye(w),autoClose:!1}),c(Yt(w))})},[e,t,r]);return a.jsxs(ft,{onSubmit:g,children:[!p&&!l&&a.jsxs(Ue,{children:[a.jsx(Le,{children:"Invite new member"}),e.isSuperAdmin()&&a.jsx(zt,{title:"Project",htmlFor:"project",outcome:l,children:a.jsx(Rl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),a.jsx(cn,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Lt(l,"resourceType")}),a.jsx(Be,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Lt(l,"firstName")}),a.jsx(Be,{name:"lastName",label:"Last Name",required:!0,error:Lt(l,"lastName")}),a.jsx(Be,{name:"email",type:"email",label:"Email",required:!0,error:Lt(l,"email")}),a.jsx(zt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:l,children:a.jsx(Gm,{name:"accessPolicy",onChange:o})}),a.jsx(Ln,{name:"sendEmail",label:"Send email",defaultChecked:!0}),a.jsx(Ln,{name:"isAdmin",label:"Admin"}),a.jsx(Ln,{name:"isProjectScoped",label:"Project scoped"}),a.jsx(Ln,{name:"mfaRequired",label:"MFA required"}),a.jsx(xe,{justify:"flex-end",children:a.jsx(jr,{children:"Invite"})})]}),l&&a.jsxs("div",{"data-testid":"success",children:[a.jsx("p",{children:"User created, email couldn't be sent"}),a.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),a.jsxs("p",{children:["Click ",a.jsx(St,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),p&&a.jsxs("div",{"data-testid":"success",children:[a.jsx(Re,{children:"User created"}),d&&a.jsx(Re,{children:"Email sent"}),a.jsxs(Dr,{children:[a.jsx(Dr.Item,{children:a.jsx(St,{to:p,children:"Go to new membership"})}),a.jsx(Dr.Item,{children:a.jsx(St,{to:p.profile,children:"Go to new profile"})}),a.jsx(Dr.Item,{children:a.jsx(St,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function Ree(){return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Patients"}),a.jsx(qm,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/invite",children:"Invite new patient"})})]})}function _ee(){const e=_e();if(!e.isLoading()&&!e.isProjectAdmin())return a.jsx(Cr,{outcome:Wd});function t(n){e.post("admin/projects/setpassword",n).then(()=>ke({color:"green",message:"Done"})).catch(r=>ke({color:"red",message:Ye(r),autoClose:!1}))}return a.jsxs(dt,{width:600,children:[a.jsx(Le,{order:1,children:"Project Admin"}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Force Set Password"}),a.jsx(Re,{children:"Sets the password for the specified user in this project."}),a.jsx(Re,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),a.jsx(ft,{onSubmit:t,children:a.jsxs(Ue,{children:[a.jsx(Be,{name:"email",label:"Email",required:!0}),a.jsx(Xi,{name:"password",label:"Password",required:!0}),a.jsx(Ae,{type:"submit",children:"Force Set Password"})]})})]})}function RR(){const e=_e(),t=Cs(e),n=e.get(`admin/projects/${t}`).read();return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Details"}),a.jsxs(Mm,{children:[a.jsx(ki,{term:"ID",children:n.project.id}),a.jsx(ki,{term:"Name",children:n.project.name})]})]})}const _R=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function Dee(){const e=Tn(),n=Kr().pathname.replace("/admin/","")||_R[0],r=_e(),o=Cs(r),l=v.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function c(d){e(`/admin/${d}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(Ar,{children:[a.jsx(yt,{children:a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Project"}),a.jsx(yt.Value,{children:l.project.name})]})}),a.jsx(fi,{children:a.jsx(kt,{value:n.toLowerCase(),onChange:c,children:a.jsx(kt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:_R.map(d=>a.jsx(kt.Tab,{value:d.toLowerCase(),children:d},d))})})})]}),a.jsx(dt,{children:a.jsx(PS,{})})]})}function Aee(){const e=_e(),t=Cs(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[l,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(ui(n.project.secret||[]))},[e,n]),!r||!l?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/secrets`,l).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>ke({color:"green",message:"Saved"})).catch(console.log)},children:[a.jsx(Le,{children:"Project Secrets"}),a.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),a.jsx(Zd,{property:ws("Project","secret"),name:"secret",path:"Project.secret",defaultValue:l,onChange:c,outcome:void 0}),a.jsx(Ae,{type:"submit",children:"Save"})]})}function kee(){const e=_e(),t=Cs(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=v.useState(!1),[l,c]=v.useState();return v.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),v.useEffect(()=>{n&&c(ui(n.project.site||[]))},[e,n]),!r||!l?a.jsx("div",{children:"Loading..."}):a.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d=>{d.preventDefault(),e.post(`admin/projects/${t}/sites`,l).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>ke({color:"green",message:"Saved"})).catch(f=>{const p=Yt(f);ke({color:"red",message:`Error ${p.issue?.[0].details?.text} ${p.issue?.[0].expression?.[0]}`,autoClose:!1})})},children:[a.jsx(Le,{children:"Project Sites"}),a.jsx("p",{children:"Use project sites configure your project on a separate domain."}),a.jsx(Zd,{property:ws("Project","site"),name:"site",path:"Project.site",defaultValue:l,onChange:c,outcome:void 0}),a.jsx(Ae,{type:"submit",children:"Save"})]})}const NP="System AsyncJob",MP="Post-deploy Migrations",Oh=[MP,NP];function Pee(){const e=_e(),[t,n]=v.useState(Oh[0]);function r(o){o||=Oh[0],Oh.includes(o)&&n(o)}return!e.isLoading()&&!e.isSuperAdmin()?a.jsx(Cr,{outcome:Wd}):a.jsx(ou,{miw:"1600",maw:"2000",children:a.jsxs(Tl,{children:[a.jsx(Le,{order:1,children:"AsyncJob Dashboard"}),a.jsxs(kt,{keepMounted:!1,value:t,onChange:r,children:[a.jsx(kt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Oh.map(o=>a.jsx(kt.Tab,{value:o,children:o},o))}),a.jsx(kt.Panel,{value:NP,pt:"md",children:a.jsx(Nee,{})}),a.jsx(kt.Panel,{value:MP,pt:"md",children:a.jsx(Lee,{})})]})]})})}const Oee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:fe.MISSING,value:"true"}],sortRules:[{code:"_lastUpdated",descending:!0}]};function Nee(){const e=Tn(),[t]=v.useState(Oee);return a.jsxs(Ue,{children:[a.jsx(St,{to:`/${t.resourceType}/${us(t)}`,children:"Show in search page"}),a.jsx(su,{checkboxesEnabled:!1,search:t,onClick:n=>e(DR(n.resource))?.catch(console.error),onAuxClick:n=>window.open(DR(n.resource),"_blank")})]})}const Mee={resourceType:"AsyncJob",fields:["id","_lastUpdated","request","status","type"],filters:[{code:"_project",operator:fe.MISSING,value:"true"},{code:"type",operator:fe.EQUALS,value:"data-migration"}],count:1e3,sortRules:[{code:"_lastUpdated",descending:!0}]};function Lee(){const e=_e(),[t,n]=v.useState(),[r,o]=v.useState(),[l,c]=v.useState([]),[d,f]=v.useState(0),[p,m]=v.useState([]);v.useEffect(()=>{const j="info";m(C=>C.includes(j)?C:[...C,j]),e.get("admin/super/migrations",{cache:"no-cache"}).then(C=>{C.postDeployMigrations.sort((T,E)=>E-T),n(C)}).catch(C=>{ke({color:"red",message:Ye(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]),v.useEffect(()=>{const j="jobs";m(C=>C.includes(j)?C:[...C,j]),e.requestSchema("AsyncJob").then(()=>e.search("AsyncJob",us({...Mee,total:"accurate",fields:void 0}),{cache:"no-cache"}).then(C=>{o(C.entry?.map(T=>T.resource))})).catch(C=>{o(void 0),ke({color:"red",message:Ye(C),autoClose:!1})}).finally(()=>m(C=>C.filter(T=>T!==j)))},[e,d]);function g(){f(j=>j+1)}function y(j){IS(e,"Run Pending Data Migration","admin/super/migrate",{dataVersion:j}).finally(()=>{g()}).catch(()=>{}),g()}const b=p.length>0;function w(j,{isLoading:C}){return a.jsxs("div",{style:{position:"relative"},children:[a.jsx(tm,{visible:C}),a.jsxs(he,{children:[a.jsx(he.Thead,{children:a.jsxs(he.Tr,{children:[a.jsx(he.Th,{children:"Version"}),a.jsx(he.Th,{children:"Action"}),a.jsx(he.Th,{children:"Status"}),a.jsx(he.Th,{children:"AsyncJob"}),a.jsx(he.Th,{children:"Last Updated"}),a.jsx(he.Th,{children:"Request Time"}),a.jsx(he.Th,{children:"Duration"}),a.jsx(he.Th,{children:"Attempts"})]})}),a.jsx(he.Tbody,{children:j()})]})]})}return a.jsxs(a.Fragment,{children:[a.jsx(Ae,{size:"xs",mb:"xs",variant:"subtle",leftSection:a.jsx(ok,{size:14}),onClick:g,loading:b,children:"Refresh"}),w(()=>{if(!b){if(!t)return a.jsx(he.Tr,{children:a.jsx(he.Td,{colSpan:6,children:"Failed to load migration info"})});if(!r)return a.jsx(he.Tr,{children:a.jsx(he.Td,{colSpan:6,children:"Failed to load async jobs"})})}return!t||!r?null:t.postDeployMigrations?.map(j=>{const{status:C,asyncJob:T,asyncJobs:E}=Iee(j,r??[],t?.pendingPostDeployMigration),R=l.includes(j),_=j===t?.pendingPostDeployMigration&&(!T||T?.status==="error"),k=[a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:j}),a.jsx(he.Td,{children:_&&a.jsx(Ae,{color:"green",size:"xs",onClick:()=>y(j),children:"Start"})}),a.jsx(he.Td,{children:C}),a.jsx(he.Td,{children:T&&a.jsx(St,{to:`/AsyncJob/${T?.id}`,children:T?.id})}),a.jsx(he.Td,{children:T?.meta?.lastUpdated}),a.jsx(he.Td,{children:T?.requestTime}),a.jsx(he.Td,{children:AR(T)}),a.jsx(he.Td,{display:"flex",children:a.jsxs(xe,{gap:"xs",children:[E.length?E.length:"",R&&E.length>1&&a.jsx(Ae,{leftSection:a.jsx(nq,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(N=>N.includes(j)?N.filter(A=>A!==j):N),children:"Hide all"}),!R&&E.length>1&&a.jsx(Ae,{leftSection:a.jsx(ik,{size:14}),variant:"subtle",color:"blue",size:"xs",radius:"xs",onClick:()=>c(N=>N.includes(j)?N:[...N,j]),children:"Show all"})]})})]},j)];return R&&k.push(...E.filter(N=>N.id!==T?.id).map(N=>a.jsxs(he.Tr,{bg:"gray.1",children:[a.jsx(he.Td,{children:j}),a.jsx(he.Td,{}),a.jsx(he.Td,{children:N.status}),a.jsx(he.Td,{children:a.jsx(St,{to:`/AsyncJob/${N.id}`,children:N.id})}),a.jsx(he.Td,{children:N.meta?.lastUpdated}),a.jsx(he.Td,{children:N.requestTime}),a.jsx(he.Td,{children:AR(N)}),a.jsx(he.Td,{})]},N.id))),k})},{isLoading:b})]})}function Iee(e,t,n){const r=t.filter(c=>c.dataVersion===e),o=r.find(c=>c.status==="completed")??r[0];let l;return n===0?l=o?.status??"completed":e>n?l=o?.status??"pending":e===n?l=o?.status??"next":l=o?.status??"completed",{status:l,asyncJob:o,asyncJobs:r}}function DR(e){return`/${e.resourceType}/${e.id}`}function AR(e){const t=e?.requestTime,n=e?.transactionTime??e?.meta?.lastUpdated;if(!t||!n)return"";const r=new Date(t),l=new Date(n).getTime()-r.getTime();if(l<1e3)return`${l.toFixed(0)}ms`;const c=l/1e3;return c<60?`${c.toFixed(2)}s`:c<3600?`${(c/60).toFixed(2)}m`:`${(c/3600).toFixed(2)}h`}function zee(){const e=_e(),[t,{open:n,close:r}]=Gc(!1),[o,l]=v.useState(""),[c,d]=v.useState();if(!e.isLoading()&&!e.isSuperAdmin())return a.jsx(Cr,{outcome:Wd});function f(){Hs(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function p(){Hs(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function m(){Hs(e,"Rebuilding Value Sets","admin/super/valuesets")}function g(k){Hs(e,"Reindexing Resources","admin/super/reindex",k)}function y(){Hs(e,"Reload Cron Resources","admin/super/reloadcron")}function b(){Hs(e,"Run Pending Data Migration","admin/super/migrate")}function w(k){e.post("admin/super/removebotidjobsfromqueue",k).then(()=>ke({color:"green",message:"Done"})).catch(N=>ke({color:"red",message:Ye(N),autoClose:!1}))}function j(k){e.post("admin/super/purge",{...k,before:uS(k.before)}).then(()=>ke({color:"green",message:"Done"})).catch(N=>ke({color:"red",message:Ye(N),autoClose:!1}))}function C(k){e.post("admin/super/setpassword",k).then(()=>ke({color:"green",message:"Done"})).catch(N=>ke({color:"red",message:Ye(N),autoClose:!1}))}function T(k){e.post("fhir/R4/$db-stats",k.tableNames?{resourceType:"Parameters",parameter:[{name:"tableNames",valueString:k.tableNames}]}:void 0).then(N=>{l("Database Stats"),d(a.jsx("pre",{children:N.parameter?.find(A=>A.name==="tableString")?.valueString})),n()}).catch(N=>ke({color:"red",message:Ye(N),autoClose:!1}))}function E(){e.post("fhir/R4/$db-invalid-indexes").then(k=>{l("Database Invalid Indexes"),d(a.jsx("pre",{children:k.parameter?.filter(N=>N.name==="invalidIndex").map(N=>N.valueString).join(`
|
|
598
|
+
`)})),n()}).catch(k=>ke({color:"red",message:Ye(k),autoClose:!1}))}function R(){e.post("fhir/R4/$db-schema-diff").then(k=>{l("Schema Diff"),d(a.jsx("pre",{children:k.parameter?.find(N=>N.name==="migrationString")?.valueString})),n()}).catch(k=>ke({color:"red",message:Ye(k),autoClose:!1}))}function _(){Hs(e,"Reconcile Schema Diff","admin/super/reconcile-db-schema-drift")}return a.jsxs(dt,{width:600,children:[a.jsx(Le,{order:1,children:"Super Admin"}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Structure Definitions"}),a.jsx("p",{children:"StructureDefinition resources contain the metadata about resource types. They are provided with the FHIR specification. Medplum also includes some custom StructureDefinition resources for internal data types. Press this button to update the database StructureDefinitions from the FHIR specification."}),a.jsx(ft,{children:a.jsx(Ae,{onClick:f,children:"Rebuild StructureDefinitions"})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Search Parameters"}),a.jsx("p",{children:"SearchParameter resources contain the metadata about filters and sorting. They are provided with the FHIR specification. Medplum also includes some custom SearchParameter resources for internal data types. Press this button to update the database SearchParameters from the FHIR specification."}),a.jsx(ft,{children:a.jsx(Ae,{onClick:p,children:"Rebuild SearchParameters"})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Value Sets"}),a.jsx("p",{children:"ValueSet resources enum values for a wide variety of use cases. Press this button to update the database ValueSets from the FHIR specification."}),a.jsx(ft,{children:a.jsx(Ae,{onClick:m,children:"Rebuild ValueSets"})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Run Pending Data Migration"}),a.jsx("p",{children:"When a Medplum version releases with data migrations to apply, you can run them here. Press this button to kick off the background data migration process."}),a.jsx(ft,{onSubmit:b,children:a.jsx(Ue,{children:a.jsx(Ae,{type:"submit",children:"Start Migration"})})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Reindex Resources"}),a.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),a.jsx(ft,{onSubmit:g,children:a.jsxs(Ue,{children:[a.jsx(zt,{title:"Resource Type",htmlFor:"resourceType",children:a.jsx(Be,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),a.jsx(zt,{title:"Search Filter",htmlFor:"filter",children:a.jsx(Be,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),a.jsx(zt,{title:"Max Resource Version",htmlFor:"maxResourceVersion",children:a.jsx($ee,{})}),a.jsx(Ae,{type:"submit",children:"Reindex"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Purge Resources"}),a.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),a.jsx(ft,{onSubmit:j,children:a.jsxs(Ue,{children:[a.jsx(zt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:a.jsx(cn,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),a.jsx(zt,{title:"Purge Before",htmlFor:"before",children:a.jsx(Eo,{name:"before",placeholder:"Before Date"})}),a.jsx(Ae,{type:"submit",children:"Purge"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Remove Bot ID Jobs from Queue"}),a.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),a.jsx(ft,{onSubmit:w,children:a.jsxs(Ue,{children:[a.jsx(zt,{title:"Bot ID",children:a.jsx(Be,{name:"botId",placeholder:"Bot Id"})}),a.jsx(Ae,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Force Set Password"}),a.jsx("p",{children:'Note that this applies to all projects for the user. Therefore, this should only be used in extreme circumstances. Always prefer to use the "Forgot Password" flow first.'}),a.jsx(ft,{onSubmit:C,children:a.jsxs(Ue,{children:[a.jsx(Be,{name:"email",label:"Email",required:!0}),a.jsx(Xi,{name:"password",label:"Password",required:!0}),a.jsx(Be,{name:"projectId",label:"Project ID"}),a.jsx(Ae,{type:"submit",children:"Force Set Password"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Database Stats"}),a.jsx("p",{children:"Query current table statistics from the database."}),a.jsx(ft,{onSubmit:T,children:a.jsxs(Ue,{children:[a.jsx(zt,{title:"Table Names (comma-delimited)",htmlFor:"tableNames",children:a.jsx(Be,{id:"tableNames",name:"tableNames",placeholder:"Observation,Observation_History"})}),a.jsx(Ae,{type:"submit",children:"Get Database Stats"})]})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Database Invalid Indexes"}),a.jsx("p",{children:"Query invalid indexes from the database."}),a.jsx(ft,{onSubmit:E,children:a.jsx(Ue,{children:a.jsx(Ae,{type:"submit",children:"Get Database Invalid Indexes"})})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Database Schema Drift"}),a.jsx("p",{children:"Show the schema migration needed to match the expected database schema."}),a.jsxs(br,{children:[a.jsx(br.Col,{span:6,children:a.jsx(ft,{onSubmit:R,children:a.jsx(Ue,{children:a.jsx(Ae,{type:"submit",children:"Get Schema Drift"})})})}),a.jsx(br.Col,{span:6,children:a.jsx(ft,{onSubmit:_,children:a.jsx(Ue,{children:a.jsx(Ae,{type:"submit",children:"Reconcile Schema Drift"})})})})]}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Reload Cron Resources"}),a.jsx("p",{children:"Obliterates the cron queue and rebuilds all the cron job schedulers for cron resources (eg. cron bots)."}),a.jsx(ft,{onSubmit:y,children:a.jsx(Ue,{children:a.jsx(Ae,{type:"submit",children:"Reload Cron Resources"})})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Database Explain Search"}),a.jsx("p",{children:"Runs an EXPLAIN query on the database to show the query plan for a search."}),a.jsx(Uee,{setModalTitle:l,setModalContent:d,openModal:n}),a.jsx(Gn,{opened:t,onClose:r,title:o,centered:!0,size:"auto",children:c})]})}function $ee(){const[e,t]=v.useState("outdated");return a.jsxs(a.Fragment,{children:[a.jsx(cn,{id:"reindexType",name:"reindexType",value:e,onChange:n=>t(n.target.value),data:[{label:"Outdated resources",value:"outdated"},{label:"All resources",value:"all"},{label:"Less than or equal to a specific version",value:"specific"}]}),e==="specific"&&a.jsx(zc,{required:!0,name:"maxResourceVersion",placeholder:"Max Resource Version",min:0})]})}function Uee({setModalTitle:e,setModalContent:t,openModal:n}){const r=_e(),[o,l]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(),[m,g]=v.useState(),y=v.useMemo(()=>{if(o?.reference)return{"_has:ProjectMembership:profile:project":o.reference}},[o]);v.useEffect(()=>{if(g(void 0),!c?.reference&&!o?.reference){p(void 0);return}r.searchResources("ProjectMembership",{profile:c?.reference,project:o?.reference,_count:20}).then(j=>{p(j),j.length===1&&g(Wt(j[0]))}).catch(j=>{console.error(j),ke({color:"red",message:Ye(j),autoClose:!1})})},[r,c,o]);const b=v.useMemo(()=>{const j={};return c?.reference&&(j.profile=c?.reference),o?.reference&&(j.project=o?.reference),j},[c,o]);function w(j){if(!j.query){ke({color:"red",message:"Query is required",autoClose:!1});return}const C=j.onBehalfOfProjectMembership;delete j.onBehalfOfProjectMembership;const T={query:j.query,analyze:j.analyze==="on",format:"text"},E={};C&&(E["x-medplum-on-behalf-of"]=C),r.post("fhir/R4/$explain",T,void 0,{headers:E}).then(R=>{e("Database Explain");const _=R.parameter?.find(P=>P.name==="explain")?.valueString,k=R.parameter?.find(P=>P.name==="query")?.valueString,N=R.parameter?.find(P=>P.name==="parameters")?.valueString,A=[k,N,`
|
|
599
|
+
`,_].join(`
|
|
600
|
+
`);t(a.jsx(Id,{block:!0,maw:"100%",children:A})),n()}).catch(R=>{ke({color:"red",message:Ye(R),autoClose:!1})})}return!r.isLoading()&&!r.isSuperAdmin()?a.jsx(Cr,{outcome:Wd}):a.jsx(ft,{onSubmit:w,children:a.jsxs(Ue,{children:[a.jsx(Be,{name:"query",label:"Search",required:!0,placeholder:"Observation?code=85354-9&_sort=-date&_count=5"}),a.jsx(Ln,{name:"analyze",label:"Analyze"}),a.jsx(Pd,{label:"On Behalf Of",children:a.jsxs(Ue,{gap:"sm",children:[a.jsx(fs,{required:!0,placeholder:"Project",targetTypes:["Project"],name:"onBehalfOfProject",onChange:l}),a.jsx(fs,{required:!0,placeholder:"Practitioner or Patient",name:"onBehalfOfProfile",targetTypes:["Practitioner","Patient"],onChange:d,searchCriteria:y}),f?.length!==1&&a.jsx(fs,{required:!0,placeholder:"ProjectMembership",name:"onBehalfOfProjectMembership",targetTypes:["ProjectMembership"],onChange:g,searchCriteria:b}),f?.length===1&&a.jsxs(a.Fragment,{children:[a.jsx("input",{type:"hidden",name:"onBehalfOfProjectMembership",value:Nt(f[0])}),a.jsx(bp,{value:Wt(f[0])})]}),!m&&a.jsx(Re,{fs:"italic",children:"On Behalf Of not set. Running as super admin"})]})}),a.jsx(Ae,{type:"submit",children:"Explain Search"})]})})}function Bee(){return a.jsxs(a.Fragment,{children:[a.jsx(Le,{children:"Users"}),a.jsx(qm,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),a.jsx(xe,{justify:"flex-end",children:a.jsx(St,{to:"/admin/invite",children:"Invite new user"})})]})}const Vee=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function Hc(e,t,n){const r=Fee(e),{webkitRelativePath:o}=e,l=typeof t=="string"?t:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&kR(r,"path",l),kR(r,"relativePath",l),r}function Fee(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=Vee.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function kR(e,t,n){Object.defineProperty(e,t,{value:n,writable:!1,configurable:!1,enumerable:!0})}const Hee=[".DS_Store","Thumbs.db"];function qee(e){return vl(this,void 0,void 0,function*(){return Ap(e)&&Gee(e.dataTransfer)?Kee(e.dataTransfer,e.type):Wee(e)?Qee(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Yee(e):[]})}function Gee(e){return Ap(e)}function Wee(e){return Ap(e)&&Ap(e.target)}function Ap(e){return typeof e=="object"&&e!==null}function Qee(e){return Bx(e.target.files).map(t=>Hc(t))}function Yee(e){return vl(this,void 0,void 0,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Hc(n))})}function Kee(e,t){return vl(this,void 0,void 0,function*(){if(e.items){const n=Bx(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(Xee));return PR(LP(r))}return PR(Bx(e.files).map(n=>Hc(n)))})}function PR(e){return e.filter(t=>Hee.indexOf(t.name)===-1)}function Bx(e){if(e===null)return[];const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(r)}return t}function Xee(e){if(typeof e.webkitGetAsEntry!="function")return OR(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?IP(t):OR(e,t)}function LP(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?LP(n):[n]],[])}function OR(e,t){return vl(this,void 0,void 0,function*(){var n;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const l=yield e.getAsFileSystemHandle();if(l===null)throw new Error(`${e} is not a File`);if(l!==void 0){const c=yield l.getFile();return c.handle=l,Hc(c)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return Hc(r,(n=t?.fullPath)!==null&&n!==void 0?n:void 0)})}function Jee(e){return vl(this,void 0,void 0,function*(){return e.isDirectory?IP(e):Zee(e)})}function IP(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function l(){t.readEntries(c=>vl(this,void 0,void 0,function*(){if(c.length){const d=Promise.all(c.map(Jee));o.push(d),l()}else try{const d=yield Promise.all(o);n(d)}catch(d){r(d)}}),c=>{r(c)})}l()})}function Zee(e){return vl(this,void 0,void 0,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Hc(r,e.fullPath);t(o)},r=>{n(r)})})})}var Nh={},NR;function ete(){return NR||(NR=1,Nh.__esModule=!0,Nh.default=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(",");if(n.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),l=o.replace(/\/.*$/,"");return n.some(function(c){var d=c.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?l===d.replace(/\/.*$/,""):o===d})}return!0}),Nh}var tte=ete();const Wy=Op(tte);function MR(e){return ite(e)||rte(e)||$P(e)||nte()}function nte(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
601
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rte(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ite(e){if(Array.isArray(e))return Vx(e)}function LR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function IR(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?LR(Object(n),!0).forEach(function(r){zP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):LR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function zP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Rd(e,t){return ste(e)||ate(e,t)||$P(e,t)||ote()}function ote(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
602
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $P(e,t){if(e){if(typeof e=="string")return Vx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Vx(e,t)}}function Vx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function ate(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,l=!1,c,d;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){l=!0,d=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(l)throw d}}return r}}function ste(e){if(Array.isArray(e))return e}var lte=typeof Wy=="function"?Wy:Wy.default,cte="file-invalid-type",ute="file-too-large",dte="file-too-small",fte="too-many-files",hte=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=t.split(","),r=n.length>1?"one of ".concat(n.join(", ")):n[0];return{code:cte,message:"File type must be ".concat(r)}},zR=function(t){return{code:ute,message:"File is larger than ".concat(t," ").concat(t===1?"byte":"bytes")}},$R=function(t){return{code:dte,message:"File is smaller than ".concat(t," ").concat(t===1?"byte":"bytes")}},pte={code:fte,message:"Too many files"};function UP(e,t){var n=e.type==="application/x-moz-file"||lte(e,t);return[n,n?null:hte(t)]}function BP(e,t,n){if(Ys(e.size))if(Ys(t)&&Ys(n)){if(e.size>n)return[!1,zR(n)];if(e.size<t)return[!1,$R(t)]}else{if(Ys(t)&&e.size<t)return[!1,$R(t)];if(Ys(n)&&e.size>n)return[!1,zR(n)]}return[!0,null]}function Ys(e){return e!=null}function mte(e){var t=e.files,n=e.accept,r=e.minSize,o=e.maxSize,l=e.multiple,c=e.maxFiles,d=e.validator;return!l&&t.length>1||l&&c>=1&&t.length>c?!1:t.every(function(f){var p=UP(f,n),m=Rd(p,1),g=m[0],y=BP(f,r,o),b=Rd(y,1),w=b[0],j=d?d(f):null;return g&&w&&!j})}function kp(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function Mh(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(t){return t==="Files"||t==="application/x-moz-file"}):!!e.target&&!!e.target.files}function UR(e){e.preventDefault()}function gte(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function vte(e){return e.indexOf("Edge/")!==-1}function yte(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return gte(e)||vte(e)}function po(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(r){for(var o=arguments.length,l=new Array(o>1?o-1:0),c=1;c<o;c++)l[c-1]=arguments[c];return t.some(function(d){return!kp(r)&&d&&d.apply(void 0,[r].concat(l)),kp(r)})}}function xte(){return"showOpenFilePicker"in window}function bte(e){if(Ys(e)){var t=Object.entries(e).filter(function(n){var r=Rd(n,2),o=r[0],l=r[1],c=!0;return VP(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),c=!1),(!Array.isArray(l)||!l.every(FP))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),c=!1),c}).reduce(function(n,r){var o=Rd(r,2),l=o[0],c=o[1];return IR(IR({},n),{},zP({},l,c))},{});return[{description:"Files",accept:t}]}return e}function Ste(e){if(Ys(e))return Object.entries(e).reduce(function(t,n){var r=Rd(n,2),o=r[0],l=r[1];return[].concat(MR(t),[o],MR(l))},[]).filter(function(t){return VP(t)||FP(t)}).join(",")}function wte(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function jte(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function VP(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function FP(e){return/^.*\.[\w]+$/.test(e)}var Cte=["children"],Ete=["open"],Tte=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],Rte=["refKey","onChange","onClick"];function _te(e){return kte(e)||Ate(e)||HP(e)||Dte()}function Dte(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
603
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ate(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function kte(e){if(Array.isArray(e))return Fx(e)}function Qy(e,t){return Nte(e)||Ote(e,t)||HP(e,t)||Pte()}function Pte(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
604
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function HP(e,t){if(e){if(typeof e=="string")return Fx(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Fx(e,t)}}function Fx(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Ote(e,t){var n=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r=[],o=!0,l=!1,c,d;try{for(n=n.call(e);!(o=(c=n.next()).done)&&(r.push(c.value),!(t&&r.length===t));o=!0);}catch(f){l=!0,d=f}finally{try{!o&&n.return!=null&&n.return()}finally{if(l)throw d}}return r}}function Nte(e){if(Array.isArray(e))return e}function BR(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),n.push.apply(n,r)}return n}function _n(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?BR(Object(n),!0).forEach(function(r){Hx(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):BR(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function Hx(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Pp(e,t){if(e==null)return{};var n=Mte(e,t),r,o;if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(o=0;o<l.length;o++)r=l[o],!(t.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Mte(e,t){if(e==null)return{};var n={},r=Object.keys(e),o,l;for(l=0;l<r.length;l++)o=r[l],!(t.indexOf(o)>=0)&&(n[o]=e[o]);return n}var zS=v.forwardRef(function(e,t){var n=e.children,r=Pp(e,Cte),o=GP(r),l=o.open,c=Pp(o,Ete);return v.useImperativeHandle(t,function(){return{open:l}},[l]),Dn.createElement(v.Fragment,null,n(_n(_n({},c),{},{open:l})))});zS.displayName="Dropzone";var qP={disabled:!1,getFilesFromEvent:qee,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};zS.defaultProps=qP;zS.propTypes={children:sn.func,accept:sn.objectOf(sn.arrayOf(sn.string)),multiple:sn.bool,preventDropOnDocument:sn.bool,noClick:sn.bool,noKeyboard:sn.bool,noDrag:sn.bool,noDragEventsBubbling:sn.bool,minSize:sn.number,maxSize:sn.number,maxFiles:sn.number,disabled:sn.bool,getFilesFromEvent:sn.func,onFileDialogCancel:sn.func,onFileDialogOpen:sn.func,useFsAccessApi:sn.bool,autoFocus:sn.bool,onDragEnter:sn.func,onDragLeave:sn.func,onDragOver:sn.func,onDrop:sn.func,onDropAccepted:sn.func,onDropRejected:sn.func,onError:sn.func,validator:sn.func};var qx={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function GP(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=_n(_n({},qP),e),n=t.accept,r=t.disabled,o=t.getFilesFromEvent,l=t.maxSize,c=t.minSize,d=t.multiple,f=t.maxFiles,p=t.onDragEnter,m=t.onDragLeave,g=t.onDragOver,y=t.onDrop,b=t.onDropAccepted,w=t.onDropRejected,j=t.onFileDialogCancel,C=t.onFileDialogOpen,T=t.useFsAccessApi,E=t.autoFocus,R=t.preventDropOnDocument,_=t.noClick,k=t.noKeyboard,N=t.noDrag,A=t.noDragEventsBubbling,P=t.onError,U=t.validator,B=v.useMemo(function(){return Ste(n)},[n]),Y=v.useMemo(function(){return bte(n)},[n]),X=v.useMemo(function(){return typeof C=="function"?C:VR},[C]),te=v.useMemo(function(){return typeof j=="function"?j:VR},[j]),$=v.useRef(null),W=v.useRef(null),L=v.useReducer(Lte,qx),I=Qy(L,2),z=I[0],V=I[1],J=z.isFocused,M=z.isFileDialogActive,F=v.useRef(typeof window<"u"&&window.isSecureContext&&T&&xte()),oe=function(){!F.current&&M&&setTimeout(function(){if(W.current){var pe=W.current.files;pe.length||(V({type:"closeDialog"}),te())}},300)};v.useEffect(function(){return window.addEventListener("focus",oe,!1),function(){window.removeEventListener("focus",oe,!1)}},[W,M,te,F]);var ce=v.useRef([]),Se=function(pe){$.current&&$.current.contains(pe.target)||(pe.preventDefault(),ce.current=[])};v.useEffect(function(){return R&&(document.addEventListener("dragover",UR,!1),document.addEventListener("drop",Se,!1)),function(){R&&(document.removeEventListener("dragover",UR),document.removeEventListener("drop",Se))}},[$,R]),v.useEffect(function(){return!r&&E&&$.current&&$.current.focus(),function(){}},[$,E,r]);var ge=v.useCallback(function(ve){P?P(ve):console.error(ve)},[P]),Oe=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),Pe(ve),ce.current=[].concat(_te(ce.current),[ve.target]),Mh(ve)&&Promise.resolve(o(ve)).then(function(pe){if(!(kp(ve)&&!A)){var Ne=pe.length,tt=Ne>0&&mte({files:pe,accept:B,minSize:c,maxSize:l,multiple:d,maxFiles:f,validator:U}),Tt=Ne>0&&!tt;V({isDragAccept:tt,isDragReject:Tt,isDragActive:!0,type:"setDraggedFiles"}),p&&p(ve)}}).catch(function(pe){return ge(pe)})},[o,p,ge,A,B,c,l,d,f,U]),nt=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),Pe(ve);var pe=Mh(ve);if(pe&&ve.dataTransfer)try{ve.dataTransfer.dropEffect="copy"}catch{}return pe&&g&&g(ve),!1},[g,A]),Ce=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),Pe(ve);var pe=ce.current.filter(function(tt){return $.current&&$.current.contains(tt)}),Ne=pe.indexOf(ve.target);Ne!==-1&&pe.splice(Ne,1),ce.current=pe,!(pe.length>0)&&(V({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Mh(ve)&&m&&m(ve))},[$,m,A]),ht=v.useCallback(function(ve,pe){var Ne=[],tt=[];ve.forEach(function(Tt){var wn=UP(Tt,B),hn=Qy(wn,2),zn=hn[0],Wn=hn[1],$n=BP(Tt,c,l),Rn=Qy($n,2),Zn=Rn[0],kn=Rn[1],Uo=U?U(Tt):null;if(zn&&Zn&&!Uo)Ne.push(Tt);else{var oo=[Wn,kn];Uo&&(oo=oo.concat(Uo)),tt.push({file:Tt,errors:oo.filter(function(Xr){return Xr})})}}),(!d&&Ne.length>1||d&&f>=1&&Ne.length>f)&&(Ne.forEach(function(Tt){tt.push({file:Tt,errors:[pte]})}),Ne.splice(0)),V({acceptedFiles:Ne,fileRejections:tt,isDragReject:tt.length>0,type:"setFiles"}),y&&y(Ne,tt,pe),tt.length>0&&w&&w(tt,pe),Ne.length>0&&b&&b(Ne,pe)},[V,d,B,c,l,f,y,b,w,U]),st=v.useCallback(function(ve){ve.preventDefault(),ve.persist(),Pe(ve),ce.current=[],Mh(ve)&&Promise.resolve(o(ve)).then(function(pe){kp(ve)&&!A||ht(pe,ve)}).catch(function(pe){return ge(pe)}),V({type:"reset"})},[o,ht,ge,A]),vt=v.useCallback(function(){if(F.current){V({type:"openDialog"}),X();var ve={multiple:d,types:Y};window.showOpenFilePicker(ve).then(function(pe){return o(pe)}).then(function(pe){ht(pe,null),V({type:"closeDialog"})}).catch(function(pe){wte(pe)?(te(pe),V({type:"closeDialog"})):jte(pe)?(F.current=!1,W.current?(W.current.value=null,W.current.click()):ge(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):ge(pe)});return}W.current&&(V({type:"openDialog"}),X(),W.current.value=null,W.current.click())},[V,X,te,T,ht,ge,Y,d]),rt=v.useCallback(function(ve){!$.current||!$.current.isEqualNode(ve.target)||(ve.key===" "||ve.key==="Enter"||ve.keyCode===32||ve.keyCode===13)&&(ve.preventDefault(),vt())},[$,vt]),wt=v.useCallback(function(){V({type:"focus"})},[]),pt=v.useCallback(function(){V({type:"blur"})},[]),It=v.useCallback(function(){_||(yte()?setTimeout(vt,0):vt())},[_,vt]),Te=function(pe){return r?null:pe},Ee=function(pe){return k?null:Te(pe)},Me=function(pe){return N?null:Te(pe)},Pe=function(pe){A&&pe.stopPropagation()},lt=v.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pe=ve.refKey,Ne=pe===void 0?"ref":pe,tt=ve.role,Tt=ve.onKeyDown,wn=ve.onFocus,hn=ve.onBlur,zn=ve.onClick,Wn=ve.onDragEnter,$n=ve.onDragOver,Rn=ve.onDragLeave,Zn=ve.onDrop,kn=Pp(ve,Tte);return _n(_n(Hx({onKeyDown:Ee(po(Tt,rt)),onFocus:Ee(po(wn,wt)),onBlur:Ee(po(hn,pt)),onClick:Te(po(zn,It)),onDragEnter:Me(po(Wn,Oe)),onDragOver:Me(po($n,nt)),onDragLeave:Me(po(Rn,Ce)),onDrop:Me(po(Zn,st)),role:typeof tt=="string"&&tt!==""?tt:"presentation"},Ne,$),!r&&!k?{tabIndex:0}:{}),kn)}},[$,rt,wt,pt,It,Oe,nt,Ce,st,k,N,r]),et=v.useCallback(function(ve){ve.stopPropagation()},[]),ot=v.useMemo(function(){return function(){var ve=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},pe=ve.refKey,Ne=pe===void 0?"ref":pe,tt=ve.onChange,Tt=ve.onClick,wn=Pp(ve,Rte),hn=Hx({accept:B,multiple:d,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Te(po(tt,st)),onClick:Te(po(Tt,et)),tabIndex:-1},Ne,W);return _n(_n({},hn),wn)}},[W,n,d,st,r]);return _n(_n({},z),{},{isFocused:J&&!r,getRootProps:lt,getInputProps:ot,rootRef:$,inputRef:W,open:Te(vt)})}function Lte(e,t){switch(t.type){case"focus":return _n(_n({},e),{},{isFocused:!0});case"blur":return _n(_n({},e),{},{isFocused:!1});case"openDialog":return _n(_n({},qx),{},{isFileDialogActive:!0});case"closeDialog":return _n(_n({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return _n(_n({},e),{},{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return _n(_n({},e),{},{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections,isDragReject:t.isDragReject});case"reset":return _n({},qx);default:return e}}function VR(){}const[Ite,zte]=kr("Dropzone component was not found in tree");function $S(e){const t=n=>{const{children:r,...o}=ae(`Dropzone${zC(e)}`,{},n),l=zte(),c=Oo(r)?r:a.jsx("span",{children:r});return l[e]?v.cloneElement(c,o):null};return t.displayName=`@mantine/dropzone/${zC(e)}`,t}const $te=$S("accept"),Ute=$S("reject"),Bte=$S("idle");var _d={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const Vte={multiple:!0,maxSize:1/0,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},Fte=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const l=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),c=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":Vt(t),"--dropzone-accept-color":l.color,"--dropzone-accept-bg":l.background,"--dropzone-reject-color":c.color,"--dropzone-reject-bg":c.background}}},Es=be((e,t)=>{const n=ae("Dropzone",Vte,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,radius:p,disabled:m,loading:g,multiple:y,maxSize:b,accept:w,children:j,onDropAny:C,onDrop:T,onReject:E,openRef:R,name:_,maxFiles:k,autoFocus:N,activateOnClick:A,activateOnDrag:P,dragEventsBubbling:U,activateOnKeyboard:B,onDragEnter:Y,onDragLeave:X,onDragOver:te,onFileDialogCancel:$,onFileDialogOpen:W,preventDropOnDocument:L,useFsAccessApi:I,getFilesFromEvent:z,validator:V,rejectColor:J,acceptColor:M,enablePointerEvents:F,loaderProps:oe,inputProps:ce,mod:Se,attributes:ge,...Oe}=n,nt=Ie({name:"Dropzone",classes:_d,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:ge,vars:f,varsResolver:Fte}),{getRootProps:Ce,getInputProps:ht,isDragAccept:st,isDragReject:vt,isDragActive:rt,open:wt}=GP({onDrop:C,onDropAccepted:T,onDropRejected:E,disabled:m||g,accept:Array.isArray(w)?w.reduce((Ee,Me)=>({...Ee,[Me]:[]}),{}):w,multiple:y,maxSize:b,maxFiles:k,autoFocus:N,noClick:!A,noDrag:!P,noDragEventsBubbling:!U,noKeyboard:!B,onDragEnter:Y,onDragLeave:X,onDragOver:te,onFileDialogCancel:$,onFileDialogOpen:W,preventDropOnDocument:L,useFsAccessApi:I,validator:V,...z?{getFilesFromEvent:z}:null});fd(R,wt);const pt=rt&&st,It=rt&&vt,Te=!pt&&!It;return a.jsx(Ite,{value:{accept:pt,reject:It,idle:Te},children:a.jsxs(ue,{...Ce(),...nt("root",{focusable:!0}),...Oe,mod:[{accept:pt,reject:It,idle:Te,disabled:m,loading:g,"activate-on-click":A},Se],children:[a.jsx(tm,{visible:g,overlayProps:{radius:p},unstyled:d,loaderProps:oe}),a.jsx("input",{...ht(ce),name:_}),a.jsx("div",{...nt("inner"),ref:t,"data-enable-pointer-events":F||void 0,children:j})]})})});Es.classes=_d;Es.displayName="@mantine/dropzone/Dropzone";Es.Accept=$te;Es.Idle=Bte;Es.Reject=Ute;const Hte={maxSize:1/0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:di("max"),withinPortal:!0},US=be((e,t)=>{const n=ae("DropzoneFullScreen",Hte,e),{classNames:r,className:o,style:l,styles:c,unstyled:d,vars:f,active:p,onDrop:m,onReject:g,zIndex:y,withinPortal:b,portalProps:w,attributes:j,...C}=n,T=Ie({name:"DropzoneFullScreen",classes:_d,props:n,className:o,style:l,classNames:r,styles:c,unstyled:d,attributes:j,rootSelector:"fullScreen"}),{resolvedClassNames:E,resolvedStyles:R}=yl({classNames:r,styles:c,props:n}),[_,k]=v.useState(0),[N,{open:A,close:P}]=Gc(!1),U=Y=>{Y.dataTransfer?.types.includes("Files")&&(k(X=>X+1),A())},B=()=>{k(Y=>Y-1)};return v.useEffect(()=>{_===0&&P()},[_]),v.useEffect(()=>{if(p)return document.addEventListener("dragenter",U,!1),document.addEventListener("dragleave",B,!1),()=>{document.removeEventListener("dragenter",U,!1),document.removeEventListener("dragleave",B,!1)}},[p]),a.jsx(va,{...w,withinPortal:b,children:a.jsx(ue,{ref:t,...T("fullScreen",{style:{opacity:N?1:0,pointerEvents:N?"all":"none",zIndex:y}}),children:a.jsx(Es,{activateOnClick:!1,...C,classNames:E,styles:R,unstyled:d,className:_d.dropzone,onDrop:Y=>{m?.(Y),P(),k(0)},onReject:Y=>{g?.(Y),P(),k(0)}})})})});US.classes=_d;US.displayName="@mantine/dropzone/DropzoneFullScreen";Es.FullScreen=US;const Lh=Es,qte='{"resourceType": "Bundle"}';function Yy({id:e,title:t,message:n,color:r,icon:o,withCloseButton:l=!1,method:c="show",loading:d}){Di[c]({id:e,loading:d,title:t,message:n,color:r,icon:o,withCloseButton:l,autoClose:!1})}function Gte(){const e=Sn(),t=_e(),[n,r]=v.useState({}),o=v.useCallback(async(d,f)=>{const p="batch-upload";Yy({id:p,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let m=JSON.parse(d);m.type!=="batch"&&m.type!=="transaction"&&(m=NA(m));const g=await t.executeBatch(m);r(y=>({...y,[f]:g})),Yy({id:p,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:a.jsx(zo,{size:"1rem"}),withCloseButton:!0})}catch(m){Yy({id:p,title:"Batch Upload Failed",color:"red",message:Ye(m),method:"update",icon:a.jsx(fl,{size:"1rem"}),withCloseButton:!0})}},[t]),l=v.useCallback(async d=>{for(const f of d){const p=new FileReader;p.onload=m=>o(m.target?.result,f.name),p.readAsText(f)}},[o]),c=v.useCallback(async d=>{await o(d.input,"JSON Data")},[o]);return a.jsxs(dt,{children:[a.jsx(Le,{children:"Batch Create"}),a.jsxs(Re,{children:["Use this page to create, read, or update multiple resources. For more details, see"," ",a.jsx(Mt,{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Input"}),a.jsxs(kt,{defaultValue:"upload",children:[a.jsxs(kt.List,{children:[a.jsx(kt.Tab,{value:"upload",children:"File Upload"}),a.jsx(kt.Tab,{value:"json",children:"JSON"})]}),a.jsx(kt.Panel,{value:"upload",pt:"xs",children:a.jsx(Lh,{onDrop:l,accept:["application/json"],children:a.jsxs(xe,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[a.jsx(Lh.Accept,{children:a.jsx(RT,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),a.jsx(Lh.Reject,{children:a.jsx(fl,{size:50,stroke:1.5,color:e.colors.red[5]})}),a.jsx(Lh.Idle,{children:a.jsx(RT,{size:50,stroke:1.5})}),a.jsxs("div",{children:[a.jsx(Re,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),a.jsx(Re,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),a.jsx(kt.Panel,{value:"json",pt:"xs",children:a.jsxs(ft,{onSubmit:c,children:[a.jsx(Zc,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:qte,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ae,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&a.jsxs(a.Fragment,{children:[a.jsx("h3",{children:"Output"}),a.jsxs(kt,{defaultValue:Object.keys(n)[0],children:[a.jsx(kt.List,{children:Object.keys(n).map(d=>a.jsx(kt.Tab,{value:d,children:d},d))}),Object.keys(n).map(d=>a.jsx(kt.Panel,{value:d,children:a.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[d],void 0,2)})},d))]}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ae,{onClick:()=>r({}),children:"Start over"})})]})]})}function Wte(){const{resourceType:e}=Ft(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=Fc("Questionnaire",`subject-type=${e}`);return r?r.length===0?a.jsxs(dt,{children:[a.jsxs(Le,{children:["No apps for ",e]}),a.jsx(St,{to:`/${e}`,children:"Return to search page"})]}):a.jsx(dt,{children:a.jsx("div",{children:r.map(o=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(St,{to:`/forms/${o.id}?subject=`+n.map(l=>`${e}/${l}`).join(","),children:o.name})}),a.jsx("p",{children:o.description})]},o.id))})}):a.jsx(Oi,{})}function Qte(){const e=_e(),[t,n]=v.useState(),[r,o]=v.useState(!1);return a.jsx(dt,{width:450,children:a.jsxs(ft,{onSubmit:l=>{n(void 0),e.post("auth/changepassword",l).then(()=>o(!0)).catch(c=>n(Yt(c)))},children:[a.jsxs(fr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(Le,{children:"Change password"})]}),!r&&a.jsxs(Ue,{gap:"xl",mt:"xl",children:[a.jsx(Xi,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Lt(t,"oldPassword")}),a.jsx(Xi,{name:"newPassword",label:"New password",required:!0,error:Lt(t,"newPassword")}),a.jsx(Xi,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Lt(t,"confirmPassword")}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ae,{type:"submit",children:"Change password"})})]}),r&&a.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const Gx=["Form","JSON","Profiles"],Yte=["Profiles"],Ky=Gx[0].toLowerCase();function Kte(){const e=Tn(),t=Sn(),{resourceType:n}=Ft(),[r,o]=v.useState(()=>{const c=window.location.pathname.split("/").pop();return c&&Gx.map(d=>d.toLowerCase()).includes(c)?c:Ky});function l(c){c||(c=Ky),o(c),e(`/${n}/new/${c}`)?.catch(console.error)}return a.jsxs(a.Fragment,{children:[a.jsxs(Ar,{children:[a.jsxs(Re,{p:"md",fw:500,children:["New ",n]}),a.jsx(fi,{children:a.jsx(kt,{defaultValue:Ky,value:r,onChange:l,children:a.jsx(kt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Gx.map(c=>a.jsx(kt.Tab,{value:c.toLowerCase(),px:"md",children:Yte.includes(c)?a.jsxs(xe,{gap:"xs",wrap:"nowrap",children:[c,a.jsx(em,{color:t.primaryColor,size:"sm",children:"Beta"})]}):c},c))})})})]}),a.jsx(PS,{})]})}function Xte(){return a.jsx(dt,{children:a.jsxs(Ue,{children:[a.jsx(Le,{order:1,children:"Unexpected Error"}),a.jsx(Re,{children:"We're sorry, something went wrong."}),a.jsxs(Re,{children:["Please contact ",a.jsx(Mt,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}function WP(e){const t=Kt(e.resource);if(!t)return null;const n=[{key:"Type",value:a.jsx(St,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(c,d){c&&d&&n.push({key:c,value:d})}function o(c){c&&r(c.system,c.value)}function l(c,d){Array.isArray(d)?d.forEach(f=>l(c,f)):typeof d=="string"?r(c,d):d&&(Array.isArray(d.coding)?r(c,d.coding.map(f=>f.display||f.code).join(", ")):r(c,d.text))}if("name"in t){const c=Sa(t);c!==Nt(t)&&r("Name",c)}return"category"in t&&l("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&l("Code",t.code),"identifier"in t&&(Array.isArray(t.identifier)?t.identifier.forEach(o):o(t.identifier)),n.length===1&&n.push({key:"ID",value:t.id}),a.jsx(yt,{children:n.map((c,d)=>a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:c.key}),a.jsx(yt.Value,{children:c.value})]},`${c.key}-${d}`))})}function Jte(){const{id:e}=Ft(),t=Kr(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=_e(),[l,c]=v.useState(!0),[d,f]=v.useState(),[p,m]=v.useState(),[g,y]=v.useState(),[b,w]=v.useState(),[j,C]=v.useState();if(v.useEffect(()=>{const R={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const _=r.split(",").filter(k=>!!k);_.length===1&&R.entry.push({request:{method:"GET",url:_[0]}}),m(_)}o.executeBatch(R).then(_=>{_.entry?.[0]?.response?.status!=="200"?w(_.entry?.[0]?.response?.outcome):(f(_.entry[0]?.resource),y(_.entry[1]?.resource)),c(!1)}).catch(_=>{w(_),c(!1)})},[o,e,r]),b)return a.jsx(dt,{children:a.jsx("pre",{"data-testid":"error",children:JSON.stringify(b,void 0,2)})});if(j)return a.jsxs(dt,{children:[a.jsx(Le,{children:d?.title}),a.jsx("p",{children:"Your response has been recorded."}),a.jsxs("ul",{children:[j.length===1&&a.jsx("li",{children:a.jsx(St,{to:j[0],children:"Review your answers"})}),j.length>1&&a.jsxs("li",{children:["Review your answers:",a.jsx("ul",{children:j.map(R=>a.jsx("li",{children:a.jsx(St,{to:R,children:Nt(R)})},R.id))})]}),g&&a.jsx("li",{children:a.jsxs(St,{to:g,children:["Back to ",Sa(g)]})}),a.jsx("li",{children:a.jsx(St,{to:"/",children:"Go back home"})})]})]});if(l||!d)return a.jsx(Oi,{});const T=g&&LS(g);return a.jsxs(a.Fragment,{children:[a.jsxs(Ar,{shadow:"xs",radius:0,children:[T&&a.jsx(Qk,{patient:T}),g&&g.resourceType!=="Patient"&&a.jsx(WP,{resource:g}),a.jsx(ue,{px:"xl",py:"md",children:a.jsxs(Re,{children:[Sa(d),p&&p.length>1&&a.jsxs(a.Fragment,{children:[" (for ",p.length," resources)"]})]})})]}),a.jsx(dt,{children:a.jsx(iP,{questionnaire:d,subject:g&&Wt(g),onSubmit:E})})]});async function E(R){const _=[];if(!p||p.length===0)_.push(await o.createResource(R));else for(const k of p)_.push(await o.createResource({...R,subject:{reference:k}}));C(_)}}const Zte="_paper_unw9o_1",ene={paper:Zte},tne={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function QP(e,t){const n=e.resourceType||nne(t),r=e.fields??rne(n),o=e.filters??(e.resourceType?void 0:ine(n)),l=e.sortRules??one(n),c=e.offset??0,d=e.count??Em;return{...e,resourceType:n,fields:r,filters:o,sortRules:l,offset:c,count:d}}function nne(e){return localStorage.getItem("defaultResourceType")??e?.option?.find(t=>t.id==="defaultResourceType")?.valueString??"Patient"}function rne(e){const t=BS(e);if(t?.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");break;case"AsyncJob":n.push("status","dataVersion");break;case"AccessPolicy":case"Bot":case"ClientApplication":case"Practitioner":case"Project":case"Organization":case"Questionnaire":case"UserConfiguration":n.push("name");break;case"CodeSystem":case"ValueSet":n.push("name","title","status");break;case"Condition":n.push("subject","code","clinicalStatus");break;case"Device":n.push("manufacturer","deviceName","patient");break;case"DeviceDefinition":n.push("manufacturer[x]","deviceName");break;case"DeviceRequest":n.push("code[x]","subject");break;case"DiagnosticReport":case"Observation":n.push("subject","code","status");break;case"Encounter":n.push("subject");break;case"ServiceRequest":n.push("subject","code","status","orderDetail");break;case"Subscription":n.push("criteria");break;case"User":n.push("email");break}return n}function ine(e){return BS(e)?.filters}function one(e){const t=BS(e);return t?.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function BS(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function ane(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function sne(e,t){const n={...e,count:1e3,offset:0},r=QP(n,t.getUserConfiguration()),o=await t.search(r.resourceType,us({...r,total:"accurate",fields:void 0}));return NA(o)}function FR(){const e=_e(),t=Tn(),n=Kr(),[r,o]=v.useState();return v.useEffect(()=>{const l=DA(n.pathname+n.search),c=QP(l,e.getUserConfiguration());n.pathname===`/${c.resourceType}`&&n.search===us(c)?(ane(c),o(c)):t(`/${c.resourceType}${us(c)}`)?.catch(console.error)},[e,t,n]),!r?.resourceType||!r.fields||r.fields.length===0?a.jsx(Oi,{}):a.jsx(Ar,{shadow:"xs",m:"md",p:"xs",className:ene.paper,children:a.jsx(su,{checkboxesEnabled:!0,search:r,onClick:l=>t(`/${l.resource.resourceType}/${l.resource.id}`)?.catch(console.error),onAuxClick:l=>window.open(`/${l.resource.resourceType}/${l.resource.id}`,"_blank"),onChange:l=>{t(`/${r.resourceType}${us(l.definition)}`)?.catch(console.error)},onNew:()=>{t(tne[r.resourceType]??`/${r.resourceType}/new`)?.catch(console.error)},onExportCsv:()=>{const l=e.fhirUrl(r.resourceType,"$csv")+us(r);e.download(l).then(c=>{window.open(window.URL.createObjectURL(c),"_blank")}).catch(c=>ke({color:"red",message:Ye(c),autoClose:!1}))},onExportTransactionBundle:async()=>{sne(r,e).then(l=>ck(JSON.stringify(l,void 0,2))).catch(l=>ke({color:"red",message:Ye(l),autoClose:!1}))},onDelete:l=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:l.map(c=>({request:{method:"DELETE",url:`${r.resourceType}/${c}`}}))}).then(()=>o({...r})).catch(c=>ke({color:"red",message:Ye(c),autoClose:!1})))},onBulk:l=>{t(`/bulk/${r.resourceType}?ids=${l.join(",")}`)?.catch(console.error)}})})}function lne(){const[e]=Fc("ObservationDefinition","_count=100");return e?a.jsxs(he,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Code"}),a.jsx("th",{children:"Method"}),a.jsx("th",{children:"Unit"}),a.jsx("th",{children:"Precision"}),a.jsx("th",{children:"Ranges"})]})}),a.jsx("tbody",{children:e.map(t=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Co,{value:t.category?.[0]})}),a.jsx("td",{children:a.jsx(Co,{value:t.code})}),a.jsx("td",{children:a.jsx(Co,{value:t.method})}),a.jsx("td",{children:t.quantitativeDetails?.unit?.text}),a.jsx("td",{children:t.quantitativeDetails?.decimalPrecision}),a.jsx("td",{children:a.jsx(Wx,{ranges:t.qualifiedInterval})})]},t.id))})]}):a.jsx(Oi,{})}function Wx(e){const{ranges:t}=e;if(!t)return null;const n=HR(t.map(o=>o.gender));if(n.length>1)return Bc(n),a.jsx(a.Fragment,{children:n.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:qn(o)})}),a.jsx(Wx,{ranges:e.ranges?.filter(l=>l.gender===o)})]},o))});const r=HR(t.map(o=>o.age&&Sd(o.age)));return r.length>1?(Bc(r),a.jsx(a.Fragment,{children:r.map(o=>a.jsxs(v.Fragment,{children:[a.jsx("div",{children:a.jsx("strong",{children:qn(o)})}),a.jsx(Wx,{ranges:e.ranges?.filter(l=>Sd(l.age)===o)})]},o))})):a.jsx(a.Fragment,{children:t.map(o=>a.jsx("table",{children:a.jsx("tbody",{children:a.jsxs("tr",{children:[a.jsx("td",{children:o.condition}),a.jsx("td",{children:a.jsx(cS,{value:o.range})})]})})},`range-${o.condition}`))})}function HR(e){return[...new Set(e.filter(t=>!!t))]}function cne(){const[e]=Fc("ActivityDefinition","_count=100"),[t]=Fc("ObservationDefinition","_count=100");return!e||!t?a.jsx(Oi,{}):a.jsxs(he,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"Category"}),a.jsx("th",{children:"Assay"}),e.map(n=>a.jsx("th",{children:n.name},n.id))]})}),a.jsx("tbody",{children:t.map(n=>a.jsxs("tr",{children:[a.jsx("td",{children:a.jsx(Co,{value:n.category?.[0]})}),a.jsx("td",{children:a.jsx(Co,{value:n.code})}),e.map(r=>a.jsx("td",{children:r.observationResultRequirement?.find(o=>o.reference?.includes(n.id))?"✅":""},r.id))]},n.id))})]})}function une(){const e=_e(),[t,n]=v.useState(),[r,o]=v.useState(void 0),[l,c]=v.useState(!1),d=v.useCallback(()=>{e.get("auth/mfa/status",{cache:"no-cache"}).then(m=>{n(m.enrollQrCode),o(m.enrolled)}).catch(m=>ke({color:"red",message:Ye(m),autoClose:!1}))},[e]);v.useEffect(()=>{d()},[d]);const f=v.useCallback(m=>{e.post("auth/mfa/enroll",m).then(()=>{o(!0),ke({color:"green",message:"Success"})}).catch(g=>ke({color:"red",message:Ye(g),autoClose:!1}))},[e]),p=v.useCallback(async m=>e.post("auth/mfa/disable",{token:m.token}),[e]);return r===void 0?null:r?a.jsxs(dt,{children:[a.jsx(Gn,{title:"Disable MFA",opened:l,onClose:()=>c(!1),children:a.jsx(xp,{title:"Disable MFA",buttonText:"Submit code",onSubmit:async m=>{await p(m),c(!1),o(!1),ke({id:"mfa-disabled",color:"green",title:"Success",message:"MFA disabled",icon:a.jsx(dH,{})}),d()}})}),a.jsxs(xe,{children:[a.jsx(Le,{children:"MFA is enabled"}),a.jsx(Ae,{onClick:()=>c(!0),children:"Disable MFA"})]})]}):a.jsx(dt,{width:400,children:a.jsx(xp,{title:"Multi Factor Auth Setup",buttonText:"Enroll",qrCodeUrl:t,onSubmit:f})})}const dne={},Qx={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:dne?.MEDPLUM_AWS_TEXTRACT_ENABLED};function af(){return Qx}function YP(){return KP("registerEnabled")}function fne(){return KP("awsTextractEnabled")}function KP(e){try{return Qx[e]!==!1&&Qx[e]!=="false"}catch{return!0}}function hne(){const e=Tn(),[t]=MS(),n=_e(),r=t.get("scope")||"openid",[o,l]=v.useState(),[c,d]=v.useState(!0),f=t.get("client_id"),p=t.get("login");if(v.useEffect(()=>{if(!f||f==="medplum-cli")return;async function g(){try{const y=await n.get(`/auth/clientinfo/${f}`);l(y)}catch(y){ke({id:"clientinfofail",title:"Failed to retrieve client information.",color:"red",message:Ye(y),withCloseButton:!0})}finally{d(!1)}}g().catch(console.error)},[n,f]),!f)return null;function m(g){const y=new URL(t.get("redirect_uri"));for(const b of["scope","state","nonce"])t.has(b)&&y.searchParams.set(b,t.get(b));y.searchParams.set("code",g),rr.assign(y.toString())}return a.jsx(Sk,{onCode:m,onForgotPassword:()=>e("/resetpassword")?.catch(console.error),onRegister:()=>e("/register")?.catch(console.error),googleClientId:af().googleClientId,clientId:f||void 0,redirectUri:t.get("redirect_uri")||void 0,scope:r,nonce:t.get("nonce")||void 0,launch:t.get("launch")||void 0,codeChallenge:t.get("code_challenge")||void 0,codeChallengeMethod:t.get("code_challenge_method")||void 0,chooseScopes:r!=="openid",login:p||void 0,children:!c&&a.jsxs(a.Fragment,{children:[o?.logo?.url?a.jsx("img",{src:o?.logo?.url,alt:"Welcome Logo",height:60,style:{width:"auto"}}):a.jsx($i,{size:32}),a.jsx(Le,{children:o?.welcomeString??"Sign in to Medplum"})]})})}function pne(){const e=_e(),t=Tn(),n=af();return v.useEffect(()=>{e.getProfile()&&t("/signin?project=new")?.catch(console.error)},[e,t]),YP()?a.jsxs(QG,{type:"project",projectId:"new",onSuccess:()=>{window.location.href="/"},googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[a.jsx($i,{size:32}),a.jsx(Le,{children:"Create a new account"})]}):a.jsx(dt,{width:450,children:a.jsx(Ta,{icon:a.jsx(El,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function mne(){const e=Tn(),t=_e(),[n,r]=v.useState(),[o,l]=v.useState(!1),c=af().recaptchaSiteKey;return v.useEffect(()=>{xk(c)},[c]),a.jsx(dt,{width:450,children:a.jsxs(ft,{onSubmit:async d=>{let f="";f=await bk(c),t.post("auth/resetpassword",{...d,recaptchaToken:f}).then(()=>l(!0)).catch(p=>r(Yt(p)))},children:[a.jsxs(Ue,{gap:"lg",mb:"xl",align:"center",children:[a.jsx($i,{size:32}),a.jsx(Le,{children:"Password Reset"})]}),a.jsxs(Ue,{gap:"xl",children:[a.jsx(Cr,{issues:au(n,void 0)}),!o&&a.jsxs(a.Fragment,{children:[a.jsx(Be,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Lt(n,"email")}),a.jsxs(xe,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[a.jsx(Mt,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register")?.catch(console.error),size:"xs",children:"Register"}),a.jsx(Ae,{type:"submit",children:"Reset password"})]})]}),o&&a.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function gne(e){const t=_e(),[n,r]=v.useState(),[o,l]=v.useState();return o?a.jsxs(a.Fragment,{children:[a.jsx("p",{children:"Request group created successfully."}),a.jsxs("ul",{children:[a.jsxs("li",{children:["Go to the"," ",a.jsx(St,{to:o,suffix:"checklist",children:"Request Group"})]}),a.jsxs("li",{children:["Back to the ",a.jsx(St,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):a.jsx(ft,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n?.reference}]}).then(l).catch(console.log)},children:a.jsxs(Ue,{children:[a.jsxs(Le,{children:['Start "',e.planDefinition.title,'"']}),a.jsxs(Re,{children:["Use the ",a.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),a.jsx(Re,{children:"The following tasks will be created:"}),a.jsx("ul",{children:e.planDefinition.action?.map((c,d)=>a.jsxs("li",{children:[c.definitionCanonical?.startsWith("Questionnaire/")&&"Questionnaire request: ",c.title&&a.jsx(a.Fragment,{children:c.title}),c.code&&a.jsx(Co,{value:c.code[0]})]},`action-${d}`))}),a.jsx(zt,{title:"Subject",children:a.jsx(fs,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ae,{type:"submit",children:"Go"})})]})})}function vne(){const{resourceType:e,id:t}=Ft(),n=Kt({reference:e+"/"+t});return n?a.jsx(dt,{children:a.jsx(gne,{planDefinition:n})}):null}function yne(){const{resourceType:e,id:t}=Ft(),n=Kt({reference:e+"/"+t}),[r,o]=Fc("Questionnaire","subject-type="+e),[l,c]=Fc("ClientApplication",{_count:1e3});if(!n||o||c)return a.jsx(Oi,{});const d=l?.filter(m=>xne(e)&&!!m.launchUri);if((!r||r.length===0)&&(!d||d.length===0))return a.jsxs(dt,{children:[a.jsx(Le,{children:"Apps"}),a.jsxs("p",{children:["No apps found. Contact your administrator or ",a.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let f,p;return n.resourceType==="Patient"?f=Wt(n):n.resourceType==="Encounter"&&(f=n.subject,p=Wt(n)),a.jsxs(dt,{children:[r?.map(m=>a.jsxs("div",{children:[a.jsx(Le,{order:3,children:a.jsx(St,{to:`/forms/${m.id}?subject=${Nt(n)}`,children:m.title||m.name})}),a.jsx(Re,{children:m.description})]},m.id)),d?.map(m=>a.jsxs("div",{children:[a.jsx(Le,{order:3,children:a.jsx(BX,{client:m,patient:f,encounter:p,children:m.name})}),a.jsx(Re,{children:m.description})]},m.id))]})}function xne(e){return e==="Patient"||e==="Encounter"}function bne(){const{resourceType:e,id:t}=Ft(),n=Tn(),[r,o]=v.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:fe.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return a.jsx(dt,{children:a.jsx(su,{search:r,onClick:l=>n(`/${l.resource.resourceType}/${l.resource.id}`)?.catch(console.error),onChange:l=>o(l.definition),hideFilters:!0})})}function Sne(){const e=_e(),{resourceType:t,id:n}=Ft(),r=e.readHistory(t,n).read();return a.jsx(zd,{maw:1200,children:a.jsx(Tl,{children:a.jsx(AX,{history:r})})})}const wne="_hl7Input_k5xm3_1",jne={hl7Input:wne};function Cne(e){return a.jsx("iframe",{title:"Bot Runner",frameBorder:"0",src:"https://codeeditor.medplum.com/bot-runner.html",className:e.className,ref:e.iframeRef,"data-testid":e.testId,style:{width:"100%",height:"100%",minHeight:e.minHeight}})}function Ene(e){const t=e.defaultValue,n=new URL(`https://codeeditor.medplum.com/${e.language}-editor.html`);return e.module&&n.searchParams.set("module",e.module),a.jsx("iframe",{title:"Code Editor",frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{cd(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const Tne=`{
|
|
605
|
+
"resourceType": "Patient",
|
|
606
|
+
"name": [
|
|
607
|
+
{
|
|
608
|
+
"given": [
|
|
609
|
+
"Alice"
|
|
610
|
+
],
|
|
611
|
+
"family": "Smith"
|
|
612
|
+
}
|
|
613
|
+
]
|
|
614
|
+
}`,Rne="MSH|^~\\&|ADT1|MCM|LABADT|MCM|198808181126|SECURITY|ADT|MSG00001|P|2.1\rPID|||PATID1234^5^M11||JONES^WILLIAM^A^III||19610615|M-||C|1200 N ELM STREET^^GREENSBORO^NC^27401-1020|GL|(919)379-1212|(919)271-3434||S||PATID12345001^2^M10|123456789|987654^NC\rNK1|1|JONES^BARBARA^K|SPO|||||20011105\rPV1|1|I|2000^2012^01||||004777^LEBAUER^SIDNEY^J.|||SUR||-||1|A0-";function _ne(){const e=_e(),{id:t}=Ft(),[n,r]=v.useState(),[o,l]=v.useState(),[c,d]=v.useState(),[f,p]=v.useState(Tne),[m,g]=v.useState(Rne),[y,b]=v.useState(on.FHIR_JSON),w=v.useRef(null),j=v.useRef(null),[C,T]=v.useState(!1);v.useEffect(()=>{e.readResource("Bot",t).then(async P=>{r(P),l(P.runtimeVersion==="vmcontext"?"commonjs":"esnext"),d(await Dne(e,P))}).catch(P=>ke({color:"red",message:Ye(P),autoClose:!1}))},[e,t]);const E=v.useCallback(async()=>cd(w.current,{command:"getValue"}),[]),R=v.useCallback(async()=>cd(w.current,{command:"getOutput"}),[]),_=v.useCallback(async()=>y===on.FHIR_JSON?JSON.parse(f):m,[y,f,m]),k=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{const U=await E(),B=await R(),Y=await e.createAttachment({data:U,filename:"index.ts",contentType:on.TYPESCRIPT}),X=await e.createAttachment({data:B,filename:o==="commonjs"?"index.cjs":"index.mjs",contentType:on.JAVASCRIPT}),te=[{op:"add",path:"/sourceCode",value:Y},{op:"add",path:"/executableCode",value:X}];await e.patchResource("Bot",t,te),ke({color:"green",message:"Saved"})}catch(U){ke({color:"red",message:Ye(U),autoClose:!1})}finally{T(!1)}},[e,t,o,E,R]),N=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{await e.post(e.fhirUrl("Bot",t,"$deploy")),ke({color:"green",message:"Deployed"})}catch(U){ke({color:"red",message:Ye(U),autoClose:!1})}finally{T(!1)}},[e,t]),A=v.useCallback(async P=>{P.preventDefault(),P.stopPropagation(),T(!0);try{const U=await _(),B=await e.post(e.fhirUrl("Bot",t,"$execute"),U,y);await cd(j.current,{command:"setValue",value:B}),ke({color:"green",message:"Success"})}catch(U){ke({color:"red",message:Ye(U),autoClose:!1})}finally{T(!1)}},[e,t,_,y]);return!n||c===void 0?null:a.jsxs(br,{m:0,gutter:0,style:{overflow:"hidden"},children:[a.jsx(br.Col,{span:8,children:a.jsxs(Ar,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[a.jsx(Ene,{iframeRef:w,language:"typescript",module:o,testId:"code-frame",defaultValue:c,minHeight:"528px"}),a.jsxs(xe,{justify:"flex-end",gap:"xs",children:[a.jsx(Ae,{type:"button",onClick:k,loading:C,leftSection:a.jsx(jH,{size:"1rem"}),children:"Save"}),a.jsx(Ae,{type:"button",onClick:N,loading:C,leftSection:a.jsx(eS,{size:"1rem"}),children:"Deploy"}),a.jsx(Ae,{type:"button",onClick:A,loading:C,leftSection:a.jsx(uq,{size:"1rem"}),children:"Execute"})]})]})}),a.jsxs(br.Col,{span:4,children:[a.jsxs(Ar,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[a.jsx(cn,{data:[{label:"FHIR",value:on.FHIR_JSON},{label:"HL7",value:on.HL7_V2}],onChange:P=>b(P.currentTarget.value)}),y===on.FHIR_JSON?a.jsx(Zc,{value:f,onChange:P=>p(P),autosize:!0,minRows:15}):a.jsx("textarea",{className:jne.hl7Input,value:m,onChange:P=>g(P.currentTarget.value),rows:15})]}),a.jsx(Ar,{m:2,p:"xs",shadow:"md",children:a.jsx(Cne,{iframeRef:j,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function Dne(e,t){if(t.sourceCode?.url){const n=t.sourceCode.url?.split("/")?.find(mA);return(await e.download(e.fhirUrl("Binary",n))).text()}return t.code??""}function Al(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function Ane(){const e=_e(),{resourceType:t,id:n}=Ft(),r={reference:t+"/"+n},o=v.useCallback(l=>{e.updateResource(Al(l)).then(()=>{ke({color:"green",message:"Success"})}).catch(c=>{ke({color:"red",message:Ye(c),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return a.jsx(dt,{children:a.jsx(uK,{value:r,onSubmit:o})});case"Questionnaire":return a.jsx(dt,{children:a.jsx(zK,{questionnaire:r,onSubmit:o})});default:return null}}function kne(){const{resourceType:e,id:t}=Ft(),n=Kt({reference:e+"/"+t}),r=Tn();return n?a.jsx(dt,{children:a.jsx(fX,{value:n,onStart:(o,l)=>r(`/forms/${ll(l)}`)?.catch(console.error),onEdit:(o,l,c)=>r(`/${c.reference}}`)?.catch(console.error)})}):null}function Pne(){const e=_e(),{resourceType:t,id:n}=Ft(),r=Tn();return a.jsxs(dt,{children:[a.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),a.jsx(Ae,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)?.catch(console.error)).catch(o=>ke({color:"red",message:Ye(o),autoClose:!1}))},children:"Delete"})]})}const One="_selectProfileBtn_tbaz6_1",Nne="_chevron_tbaz6_13",qR={selectProfileBtn:One,chevron:Nne};function Mne(){const{resourceType:e,id:t}=Ft(),n=Kt({reference:e+"/"+t}),[r,o]=v.useState(),l=Sl({onDropdownClose:()=>l.resetSelectedOption()}),c=v.useMemo(()=>{if(An(n?.meta?.profile))return[a.jsx(Ke.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>a.jsx(Ke.Option,{value:f,children:f},f))]},[n?.meta?.profile]);if(v.useEffect(()=>{n?.meta?.profile?.length===1&&o(n.meta.profile[0])},[n?.meta?.profile]),!n)return null;let d;return An(c)&&(d=a.jsx(xe,{justify:"flex-end",children:a.jsxs(Ue,{align:"flex-end",gap:"xs",children:[a.jsxs(Ke,{store:l,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:f=>{o(f),l.closeDropdown()},children:[a.jsx(Ke.Target,{children:a.jsx(ar,{onClick:()=>l.toggleDropdown(),children:a.jsxs(Id,{fw:"bold",fs:"sm",className:qR.selectProfileBtn,children:[a.jsx("span",{children:"Pick profile"}),a.jsx(Z0,{stroke:1.5,className:qR.chevron})]})})}),a.jsx(Ke.Dropdown,{w:"max-content",children:a.jsx(Ke.Options,{children:c})})]}),a.jsx(ue,{children:r?a.jsxs(a.Fragment,{children:[a.jsx(Re,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),a.jsx(Re,{span:!0,size:"sm",children:r||"Nothing selected"})]}):a.jsx(Re,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),a.jsx(dt,{children:a.jsxs(Ue,{gap:"xl",children:[d,a.jsx(gS,{value:n,profileUrl:r})]})})}function Lne(){const e=_e(),{resourceType:t,id:n}=Ft(),[r,o]=v.useState(),[l,c]=v.useState(),d=Tn(),[f,p]=v.useState();v.useEffect(()=>{e.readResource(t,n).then(b=>{o(ui(b)),c(ui(b))}).catch(b=>{p(Yt(b)),ke({color:"red",message:Ye(b),autoClose:!1})})},[e,t,n]);const m=v.useCallback(b=>{p(void 0),e.updateResource(Al(b)).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),ke({id:"succes",color:"green",message:"Success"})}).catch(w=>{p(Yt(w)),ke({color:"red",message:Ye(w),autoClose:!1})})},[e,t,n,d]),g=v.useCallback(b=>{p(void 0);const w=zk.createPatch(r,b);e.patchResource(t,n,w).then(()=>{d(`/${t}/${n}/details`)?.catch(console.error),ke({id:"succes",color:"green",message:"Success"})}).catch(j=>{p(Yt(j)),ke({color:"red",message:Ye(j),autoClose:!1})})},[e,t,n,r,d]),y=v.useCallback(()=>d(`/${t}/${n}/delete`)?.catch(console.error),[d,t,n]);return l?a.jsx(dt,{children:a.jsx(Tp,{defaultValue:l,onSubmit:m,onPatch:g,onDelete:y,outcome:f})}):null}function Ine(){const{resourceType:e,id:t}=Ft(),n=Kt({reference:e+"/"+t});return n?a.jsx(dt,{maw:700,children:n.resourceType==="Patient"?a.jsx(iK,{patient:n}):a.jsx(Ta,{icon:a.jsx(El,{size:16}),title:"Unsupported export type",color:"red",children:"This page is only supported for Patient resources"})}):null}function XP({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=_e(),[l,c]=v.useState();return v.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(d=>{c(d.filter(TW))}).catch(console.error)},[o,n,r]),a.jsx(kt,{value:t?.url,onChange:d=>{const f=l?.find(p=>p.url===d);f&&n(f)},children:a.jsx(kt.List,{children:l?.map(d=>{const f=e.meta?.profile?.includes(d.url),p=f?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return a.jsx(kt.Tab,{value:d.url,title:p,rightSection:f&&a.jsx(D0,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:a.jsx(Vq,{size:"90%"})}),children:d.title||d.name},d.url)})})})}function JP(e,t){const n=_e(),r=Tn();return{defaultValue:{resourceType:e},handleSubmit:c=>{t&&t(void 0),n.createResource(c).then(d=>r("/"+d.resourceType+"/"+d.id)).catch(d=>{t&&t(Yt(d)),ke({color:"red",message:Ye(d),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Xy(){const{resourceType:e}=Ft(),t=Kr(),[n,r]=v.useState(),{defaultValue:o,handleSubmit:l}=JP(e,r),[c,d]=v.useState(),f=t.pathname.toLowerCase().endsWith("profiles"),p=v.useCallback(m=>{const g=Al(m);c&&bA(g,c.url),l(g)},[c,l]);return f?a.jsx(dt,{children:a.jsxs(Ue,{children:[a.jsx(XP,{resource:o,currentProfile:c,onChange:d}),c?a.jsx(Tp,{defaultValue:o,onSubmit:p,outcome:n,profileUrl:c.url},c.url):a.jsx(Re,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):a.jsx(dt,{children:a.jsx(Tp,{defaultValue:o,onSubmit:l,outcome:n})})}function GR(){const e=_e(),{resourceType:t,id:n}=Ft(),r=e.readHistory(t,n).read();return a.jsx(dt,{children:a.jsx(IX,{history:r})})}function zne(){const{resourceType:e}=Ft(),[t,n]=v.useState(),{defaultValue:r,handleSubmit:o}=JP(e,n),l=v.useCallback(c=>{o(JSON.parse(c["new-resource"]))},[o]);return a.jsxs(dt,{children:[t&&a.jsx(Cr,{outcome:t}),a.jsxs(ft,{onSubmit:l,children:[a.jsx(Zc,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:to(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ae,{type:"submit",children:"OK"})})]})]})}function $ne(){const e=_e(),{resourceType:t,id:n}=Ft(),r=Kt({reference:t+"/"+n}),o=Tn(),[l,c]=v.useState(),d=v.useCallback(f=>{e.updateResource(Al(JSON.parse(f.resource))).then(()=>{c(void 0),o(`/${t}/${n}/details`)?.catch(console.error),ke({color:"green",message:"Success"})}).catch(p=>{ke({color:"red",message:Ye(p),autoClose:!1})})},[e,t,n,o]);return r?a.jsxs(dt,{children:[l&&a.jsx(Cr,{outcome:l}),a.jsxs(ft,{onSubmit:d,children:[a.jsx(Zc,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:to(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),a.jsx(xe,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:a.jsx(Ae,{type:"submit",children:"OK"})})]})]}):null}function Une(){const{resourceType:e,id:t}=Ft();return Kt({reference:e+"/"+t})?a.jsxs(dt,{children:[a.jsxs(Ta,{icon:a.jsx(El,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",a.jsx("br",{}),a.jsx(Mt,{href:`/forms/${t}`,children:`/forms/${t}`})]}),a.jsx(iP,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function Bne(){const e=_e(),{resourceType:t,id:n}=Ft(),[r,o]=v.useState(),[l,c]=v.useState();return v.useEffect(()=>{e.readResource(t,n).then(d=>o(ui(d))).catch(d=>{ke({color:"red",message:Ye(d)})})},[e,t,n]),r?a.jsxs(dt,{children:[a.jsxs(Le,{order:2,children:["Available ",t," profiles"]}),a.jsx(Ue,{children:a.jsxs(a.Fragment,{children:[a.jsx(XP,{resource:r,currentProfile:l,onChange:c}),l?a.jsx(Vne,{profile:l,resource:r,onResourceUpdated:d=>o(d)},l.url):a.jsx(Re,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const Vne=({profile:e,resource:t,onResourceUpdated:n})=>{const r=_e(),[o,l]=v.useState(),[c,d]=v.useState(()=>t.meta?.profile?.includes(e.url)),f=v.useCallback(p=>{l(void 0);const m=Al(p);c?bA(m,e.url):jU(m,e.url),r.updateResource(m).then(g=>{n(g),ke({color:"green",message:"Success"})}).catch(g=>{l(Yt(g)),ke({color:"red",message:Ye(g),autoClose:!1})})},[r,e.url,n,c]);return a.jsxs(Ue,{children:[a.jsx(Fd,{size:"md",checked:c,label:`Conform resource to ${e.title}`,onChange:p=>d(p.currentTarget.checked),"data-testid":"profile-toggle"}),c?a.jsx(Tp,{profileUrl:e.url,defaultValue:t,onSubmit:f,outcome:o}):a.jsx("form",{noValidate:!0,onSubmit:p=>{p.preventDefault(),f(t)},children:a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ae,{type:"submit",children:"OK"})})})]})},ZP={"Create Only":"create","Update Only":"update","Delete Only":"delete","All Interactions":void 0},Fne=Object.keys(ZP);function Hne(){const e=_e(),{id:t}=Ft(),n=Kt({reference:`Questionnaire/${t}`}),[r,o]=v.useState(),[l,c]=v.useState("create"),[d,f]=v.useState(0),p=e.searchResources("Subscription","status=active&_count=100").read().filter(g=>qne(g,n));function m(){r&&n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${r.name} to questionnaire responses`,criteria:`QuestionnaireResponse?questionnaire=${n.url?`${n.url},${Nt(n)}`:Nt(n)}`,channel:{type:"rest-hook",endpoint:Nt(r)},...l?{extension:[{url:"https://medplum.com/fhir/StructureDefinition/subscription-supported-interaction",valueCode:l}]}:void 0}).then(()=>{o(void 0),f(Date.now()),e.invalidateSearches("Subscription"),ke({color:"green",message:"Success"})}).catch(g=>ke({color:"red",message:Ye(g),autoClose:!1}))}return a.jsxs(dt,{children:[a.jsx(Le,{children:"Bots"}),a.jsxs(Ue,{children:[p.length===0&&a.jsx("p",{children:"No bots found."}),p.map(g=>a.jsxs("div",{children:[a.jsx("h3",{children:a.jsx(_l,{value:{reference:g.channel?.endpoint},link:!0})}),a.jsxs("p",{children:["Criteria: ",g.criteria]})]},g.id))]}),a.jsx(vn,{}),a.jsxs(Ue,{mt:10,children:[a.jsx(kd,{size:"lg",htmlFor:"bot",children:"Connect to bot"}),a.jsxs(xe,{children:[a.jsx(Rl,{name:"bot",resourceType:"Bot",onChange:g=>o(g)}),a.jsx(Ae,{onClick:m,children:"Connect"})]}),a.jsx(xe,{children:a.jsx(cn,{name:"subscription-trigger-event",defaultValue:"Create Only",label:"Subscription Trigger Event",data:Fne,onChange:g=>c(ZP[g.target.value])})})]}),a.jsx("div",{style:{display:"none"},children:d})]})}function qne(e,t){if(!t)return!1;const n=e.criteria||"",r=e.channel?.endpoint||"";return n.startsWith("QuestionnaireResponse?")&&r.startsWith("Bot/")&&(n.includes(Nt(t))||(t.url?n.includes(t.url):!1))}function Gne(){const{id:e}=Ft(),t=Tn(),r=_e().readReference({reference:`Questionnaire/${e}`}).read(),[o,l]=v.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:fe.EQUALS,value:r.url?`${r.url},Questionnaire/${e}`:`Questionnaire/${e}`}],fields:["id","_lastUpdated"]});return a.jsx(dt,{children:a.jsx(su,{search:o,onClick:c=>t(`/${c.resource.resourceType}/${c.resource.id}`)?.catch(console.error),onChange:c=>l(c.definition),hideFilters:!0,hideToolbar:!0})})}function Wne(){const e=_e(),{resourceType:t,id:n}=Ft(),r=Kt({reference:t+"/"+n}),o=v.useCallback(l=>{e.updateResource(Al(l)).then(()=>{ke({color:"green",message:"Success"})}).catch(c=>{ke({color:"red",message:Ye(c),autoClose:!1})})},[e]);return r?a.jsx(dt,{children:a.jsx(iX,{onSubmit:o,definition:r})}):null}function Qne(){const{resourceType:e,id:t}=Ft(),n=Kt({reference:e+"/"+t});return n?a.jsx(dt,{children:e==="MeasureReport"?a.jsx(nK,{measureReport:n}):a.jsx(mS,{value:n})}):null}const Yne="_container_1ue98_1",Kne="_entry_1ue98_14",Xne="_active_1ue98_21",Jy={container:Yne,entry:Kne,active:Xne};function Jne(e){const t=_e(),n=Kt(e.value),[r,o]=v.useState();return v.useEffect(()=>{if(!n)return;const l=LS(n);if(!l)return;const c="reference"in l?l.reference:Nt(l);t.search("ServiceRequest","subject="+c).then(d=>{const p=(d.entry??[]).map(m=>m.resource);$k(p),p.reverse(),o(p)}).catch(d=>ke({color:"red",message:Ye(d),autoClose:!1}))},[t,n]),r?a.jsx("div",{"data-testid":"quick-service-requests",className:Jy.container,children:r.map(l=>a.jsxs("div",{className:$t(Jy.entry,{[Jy.active]:l.id===n?.id}),children:[a.jsx("p",{children:a.jsx(St,{to:l,children:Zne(l)})}),l.category?.[0]?.text&&a.jsx("p",{children:l.category[0]?.text}),l.code?.coding?.[0]?.code&&a.jsx("p",{children:l.code.coding[0]?.code}),a.jsx("p",{children:ere(l)})]},l.id))}):null}function Zne(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function ere(e){return e.authoredOn?e.authoredOn.substring(0,10):e.meta?.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const tre="_container_1l2dh_1",nre={container:tre};function rre(e){const t=Kt(e.valueSet);if(!t)return null;const n=[""],r=t.compose?.include?.[0]?.concept?.map(o=>o.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),a.jsx("div",{className:nre.container,children:a.jsx(cn,{defaultValue:e.defaultValue,onChange:o=>e.onChange(o.currentTarget.value),data:n})})}function ire(e){const t=Kt(e.specimen);return t?a.jsxs(yt,{children:[a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Type"}),a.jsx(yt.Value,{children:"Specimen"})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Collected"}),a.jsx(yt.Value,{children:wr(t.collection?.collectedDateTime)})]}),a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Specimen Age"}),a.jsx(yt.Value,{children:ore(t)})]}),t.collection?.collectedDateTime&&t.receivedTime?a.jsxs(yt.Entry,{children:[a.jsx(yt.Key,{children:"Specimen Stability"}),a.jsx(yt.Value,{children:are(t)})]}):a.jsx(a.Fragment,{})]}):null}function ore(e){const t=e.collection?.collectedDateTime;if(!t)return;const n=new Date(t);return eO(tO(n,new Date))}function are(e){if(!e.collection?.collectedDateTime||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return eO(tO(t,n))}function eO(e){return e.toString().padStart(3,"0")+"D"}function tO(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function sre(e){const t=["Timeline"];return e==="Bot"&&t.push("Editor","Subscriptions"),e==="PlanDefinition"&&t.push("Apply","Builder"),e==="Questionnaire"&&t.push("Preview","Builder","Bots","Responses"),(e==="DiagnosticReport"||e==="MeasureReport")&&t.push("Report"),e==="RequestGroup"&&t.push("Checklist"),e==="ObservationDefinition"&&t.push("Ranges"),e==="Agent"&&t.push("Tools"),t.push("Details","Edit","Event","History","Blame","JSON","Apps","Profiles"),e==="Patient"&&t.push("Export"),t}function lre(){const e=_e(),{resourceType:t,id:n}=Ft(),r={reference:t+"/"+n},o=Tn(),[l,c]=v.useState(),d=Kt(r,c),f=sre(t),[p,m]=v.useState(()=>{const E=window.location.pathname.split("/").pop();return E&&f.map(R=>R.toLowerCase()).includes(E)?E:f[0].toLowerCase()});async function g(){const R=(await e.readHistory(t,n)).entry?.find(_=>!!_.resource)?.resource;R?y(R):ke({color:"red",message:"No history to restore",autoClose:!1})}function y(E){e.updateResource(Al(E)).then(()=>{c(void 0),ke({color:"green",message:"Success"})}).catch(R=>{ke({color:"red",message:Ye(R),autoClose:!1})})}if(l)return P8(l)?a.jsxs(dt,{children:[a.jsx(Le,{children:"Deleted"}),a.jsx("p",{children:"The resource was deleted."}),a.jsx(Ae,{color:"red",onClick:g,children:"Restore"})]}):a.jsx(Cr,{outcome:l});function b(E){E||(E=f[0].toLowerCase()),m(E),o(`/${t}/${n}/${E}`)?.catch(console.error)}function w(E){const R=d,_=R.orderDetail||[];_.length===0&&_.push({}),_[0].text!==E&&(_[0].text=E,y({...R,orderDetail:_}))}const j=d&&LS(d),C=d&&dee(d),T=e.getUserConfiguration()?.option?.find(E=>E.id==="statusValueSet")?.valueString;return a.jsxs(a.Fragment,{children:[d?.resourceType==="ServiceRequest"&&T&&a.jsx(rre,{valueSet:{reference:T},defaultValue:d.orderDetail?.[0]?.text,onChange:w},Nt(d)+"-"+d.orderDetail?.[0]?.text),d&&a.jsx(Jne,{value:d}),d&&a.jsxs(Ar,{children:[j&&a.jsx(Qk,{patient:j}),C&&a.jsx(ire,{specimen:C}),t!=="Patient"&&a.jsx(WP,{resource:r}),a.jsx(fi,{children:a.jsx(kt,{value:p.toLowerCase(),onChange:b,children:a.jsx(kt.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:f.map(E=>a.jsx(kt.Tab,{value:E.toLowerCase(),children:E},E))})})})]}),a.jsx(PS,{})]})}function Ih(){const e=Tn(),{resourceType:t,id:n,versionId:r,tab:o}=Ft(),l=_e(),[c,d]=v.useState(!0),[f,p]=v.useState(),[m,g]=v.useState();if(v.useEffect(()=>{g(void 0),d(!0),l.readHistory(t,n).then(R=>p(R)).then(()=>d(!1)).catch(R=>{g(R),d(!1)})},[l,t,n]),c)return a.jsx(Oi,{});const y=f?.entry??[],b=y.findIndex(R=>R.resource?.meta?.versionId===r);if(b===-1)return a.jsxs(dt,{children:[a.jsx(Le,{children:"Version not found"}),a.jsx(St,{to:`/${t}/${n}`,children:"Return to resource"})]});const w=y[b].resource,j=b<y.length-1?y[b+1].resource:void 0,C="diff",T=o||C,E=y.length-b;return a.jsx(zd,{maw:1200,children:a.jsx(Tl,{children:a.jsxs(Ue,{gap:"lg",children:[m&&a.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)}),a.jsxs(xm,{cols:2,mb:"lg",children:[a.jsx(zi,{total:y.length,value:E,getControlProps:Hk,onChange:R=>e(`/${t}/${n}/_history/${y[y.length-R]?.resource?.meta?.versionId}/${T}`)?.catch(console.error)}),a.jsx(xe,{justify:"right",children:a.jsx(Vd,{data:[{value:"diff",label:"Diff"},{value:"raw",label:"Raw"}],value:T,onChange:R=>e(`/${t}/${n}/_history/${r}/${R||C}`)?.catch(console.error)})})]}),a.jsx(ue,{mb:"lg",children:a.jsxs(Mm,{compact:!0,children:[a.jsx(ki,{term:"Version ID",children:w.meta?.versionId}),a.jsx(ki,{term:"Author",children:a.jsx(Ac,{value:w.meta?.author,link:!0},w.meta?.author?.reference)}),a.jsx(ki,{term:"Date/Time",children:wr(w.meta?.lastUpdated)})]})}),T==="diff"&&a.jsx(OX,{original:j??{resourceType:t,id:n},revised:w}),T==="raw"&&a.jsx("pre",{style:{fontSize:"9pt"},children:JSON.stringify(w,void 0,2)})]})})})}function cre(){const{resourceType:e,id:t}=Ft(),n=Tn(),[r,o]=v.useState({resourceType:"Subscription",filters:[{code:"url",operator:fe.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return a.jsx(dt,{children:a.jsx(su,{search:r,onClick:l=>n(`/${l.resource.resourceType}/${l.resource.id}`)?.catch(console.error),onChange:l=>o(l.definition),hideFilters:!0})})}function ure(e){const t=_e(),{resource:n,opened:r,onClose:o}=e,[l,c]=v.useState(!1),[d,f]=v.useState(),[p,m]=v.useState(!1),g=v.useCallback(async()=>{if(n?.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:l&&d?Nt(d):void 0,verbose:p}),ke({color:"green",message:"Done"}),o()}catch(y){ke({color:"red",message:Ye(y),autoClose:!1})}},[t,n,o,l,d,p]);return a.jsx(Gn,{opened:r,onClose:o,title:"Resend Subscriptions",children:a.jsx(ft,{onSubmit:g,children:a.jsxs(Ue,{children:[a.jsx(Ln,{label:"Choose subscription (all subscriptions by default)",onChange:y=>c(y.currentTarget.checked)}),l&&a.jsx(Rl,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:f}),a.jsx(Ln,{label:"Verbose mode",onChange:y=>m(y.currentTarget.checked)}),a.jsx(xe,{justify:"flex-end",children:a.jsx(Ae,{type:"submit",children:"Resend"})})]})})})}function WR(){const e=_e(),t=km(),{resourceType:n,id:r}=Ft(),o={reference:n+"/"+r},[l,c]=v.useState(),d=Gc(!1);function f(E,R){return e.updateResource({...E,priority:R})}function p(E,R){f(E,"stat").then(R).catch(console.error)}function m(E,R){f(E,"routine").then(R).catch(console.error)}function g(E){t(`/${E.resourceType}/${E.id}`)}function y(E){t(`/${E.resourceType}/${E.id}/edit`)}function b(E){t(`/${E.resourceType}/${E.id}/delete`)}function w(E){c(E),d[1].open()}function j(E){t(`/${E.resourceType}/${E.id}/_history/${E.meta?.versionId}`)}function C(E,R){const _="aws-textract";ke({id:_,title:"AWS Textract in Progress",message:"Extracting text... This may take a moment...",loading:!0,autoClose:!1}),e.post(e.fhirUrl(E.resourceType,E.id,"$aws-textract"),{}).then(()=>{R(),Xs({id:_,title:"AWS Textract Successful",message:"Text successfully extracted.",color:"green",icon:a.jsx(zo,{size:"1rem"}),loading:!1,withCloseButton:!0})}).catch(k=>Xs({id:_,title:"AWS Textract Error",color:"red",message:Ye(k),icon:a.jsx(fl,{size:"1rem"}),loading:!1,withCloseButton:!0}))}function T(E){const{primaryResource:R,currentResource:_,reloadTimeline:k}=E,N=_.resourceType===R.resourceType&&_.id===R.id,A=_.resourceType==="Communication"&&_.priority!=="stat",P=_.resourceType==="Communication"&&_.priority==="stat",U=N,B=!N,Y=!N,X=!N,te=e.getProjectMembership()?.admin,$=te,W=fne()&&(_.resourceType==="DocumentReference"||_.resourceType==="Media");return a.jsxs(we.Dropdown,{children:[a.jsx(we.Label,{children:"Resource"}),A&&a.jsx(we.Item,{leftSection:a.jsx(aq,{size:14}),onClick:()=>p(_,k),"aria-label":`Pin ${Nt(_)}`,children:"Pin"}),P&&a.jsx(we.Item,{leftSection:a.jsx(lq,{size:14}),onClick:()=>m(_,k),"aria-label":`Unpin ${Nt(_)}`,children:"Unpin"}),B&&a.jsx(we.Item,{leftSection:a.jsx(TT,{size:14}),onClick:()=>g(_),"aria-label":`Details ${Nt(_)}`,children:"Details"}),U&&a.jsx(we.Item,{leftSection:a.jsx(TT,{size:14}),onClick:()=>j(_),"aria-label":`Details ${Nt(_)}`,children:"Details"}),Y&&a.jsx(we.Item,{leftSection:a.jsx(tk,{size:14}),onClick:()=>y(_),"aria-label":`Edit ${Nt(_)}`,children:"Edit"}),te&&a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Label,{children:"Admin"}),$&&a.jsx(we.Item,{leftSection:a.jsx(gq,{size:14}),onClick:()=>w(_),"aria-label":`Resend Subscriptions ${Nt(_)}`,children:"Resend Subscriptions"})]}),W&&a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Label,{children:"AWS AI"}),a.jsx(we.Item,{leftSection:a.jsx(Mq,{size:14}),onClick:()=>C(_,k),"aria-label":`AWS Textract ${Nt(_)}`,children:"AWS Textract"})]}),X&&a.jsxs(a.Fragment,{children:[a.jsx(we.Divider,{}),a.jsx(we.Label,{children:"Danger zone"}),a.jsx(we.Item,{color:"red",leftSection:a.jsx(Om,{size:14}),onClick:()=>b(_),"aria-label":`Delete ${Nt(_)}`,children:"Delete"})]})]})}return a.jsxs(a.Fragment,{children:[n==="Encounter"&&a.jsx(YQ,{encounter:o,getMenu:T}),n==="Patient"&&a.jsx(sK,{patient:o,getMenu:T}),n==="ServiceRequest"&&a.jsx(UX,{serviceRequest:o,getMenu:T}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&a.jsx(QQ,{resource:o,getMenu:T}),a.jsx(ure,{resource:l,opened:d[0],onClose:d[1].close},`resend-subscriptions-${l?.id}`)]})}function dre(e){const{opened:t,close:n,version:r,loadingStatus:o,handleStatus:l,handleUpgrade:c}=e,[d,f]=v.useState(),[p,m]=v.useState(!1);return v.useEffect(()=>{t&&(d||tF("app-tools-page").then(f).catch(console.error),l())},[t,d,l]),d&&r&&!o?r==="unknown"?a.jsx("p",{children:"Unable to determine the current version of the agent. Check the network connectivity of the agent."}):r.startsWith(d)?a.jsxs("p",{children:["This agent is already on the latest version (",d,")."]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{children:["Are you sure you want to upgrade this agent from version ",r," to version ",d,"?"]}),a.jsxs(xe,{children:[a.jsx(Ae,{onClick:()=>{c(p),n()},"aria-label":"Confirm upgrade",children:"Confirm Upgrade"}),a.jsx(Ln,{label:"Force",onChange:g=>m(g.currentTarget.checked)})]})]}):a.jsx(Oi,{})}function fre(){const e=_e(),{id:t}=Ft(),n=v.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=v.useState(!1),[l,c]=v.useState(!1),[d,f]=v.useState(!1),[p,m]=v.useState(!1),[g,y]=v.useState(),[b,w]=v.useState(),[j,C]=v.useState(),[T,E]=v.useState(),[R,_]=v.useState(!1),[k,N]=v.useState(!1),[A,P]=v.useState(),[U,{open:B,close:Y}]=Gc(!1);v.useEffect(()=>{if(r||l||d||R){N(!0);return}N(!1)},[r,l,d,R]);const X=v.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(V=>{y(V.parameter?.find(J=>J.name==="status")?.valueCode),w(V.parameter?.find(J=>J.name==="version")?.valueString),C(V.parameter?.find(J=>J.name==="lastUpdated")?.valueInstant)}).catch(V=>z(Ye(V))).finally(()=>o(!1))},[e,t]),te=v.useCallback(V=>{const J=V.host,M=V.pingCount||1;J&&(_(!0),e.pushToAgent(n,J,`PING ${M}`,on.PING,!0).then(F=>E(F)).catch(F=>z(Ye(F))).finally(()=>_(!1)))},[e,n]),$=v.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(V=>{I("Agent config reloaded successfully.")}).catch(V=>z(Ye(V))).finally(()=>c(!1))},[e,t]),W=v.useCallback(V=>{f(!0);const J=e.fhirUrl("Agent",t,"$upgrade");J.searchParams.set("force",String(V)),e.get(J,{cache:"reload"}).then(M=>{I("Agent upgraded successfully.")}).catch(M=>z(Ye(M))).finally(()=>f(!1))},[e,t]),L=v.useCallback(V=>{m(!0);const J=V.logLimit||20;e.get(e.fhirUrl("Agent",t,`$fetch-logs${J!==void 0?`?limit=${J}`:""}`),{cache:"reload"}).then(M=>{const F=M?.parameter?.find(oe=>oe.name==="logs");F&&P(F?.valueString)}).catch(M=>z(Ye(M))).finally(()=>m(!1))},[e,t]);function I(V){ke({color:"green",title:"Success",icon:a.jsx(zo,{size:"1rem"}),message:V})}function z(V){ke({color:"red",title:"Error",message:V,autoClose:!1})}return a.jsxs(dt,{children:[a.jsx(Gn,{opened:U,onClose:Y,title:"Upgrade Agent",centered:!0,children:a.jsx(dre,{opened:U,close:Y,version:b,loadingStatus:r,handleStatus:X,handleUpgrade:W})}),a.jsx(Le,{order:1,children:"Agent Tools"}),a.jsxs("div",{style:{marginBottom:10},children:["Agent: ",a.jsx(_l,{value:n,link:!0})]}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Agent Status"}),a.jsx("p",{children:"Retrieve the status of the agent. This tests whether the agent is connected to the Medplum server, and the last time it was able to communicate."}),a.jsx(Ae,{onClick:X,loading:r,disabled:k&&!r,children:"Get Status"}),!r&&g&&a.jsx(he,{children:a.jsxs(he.Tbody,{children:[a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:"Status"}),a.jsx(he.Td,{children:a.jsx(zm,{status:g})})]}),a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:"Version"}),a.jsx(he.Td,{children:b})]}),a.jsxs(he.Tr,{children:[a.jsx(he.Td,{children:"Last Updated"}),a.jsx(he.Td,{children:wr(j,void 0,{timeZoneName:"longOffset"})})]})]})}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Reload Config"}),a.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),a.jsx(Ae,{onClick:$,loading:l,disabled:k&&!l,"aria-label":"Reload config",children:"Reload Config"}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Upgrade Agent"}),a.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),a.jsx(Ae,{onClick:B,loading:d,disabled:k&&!d,"aria-label":"Upgrade agent",children:"Upgrade"}),a.jsx(vn,{my:"lg"}),a.jsxs(ft,{onSubmit:L,children:[a.jsx(Le,{order:2,children:"Fetch Logs"}),a.jsx("p",{children:"Fetch logs from the agent."}),A?.length?a.jsx(Id,{block:!0,mb:15,children:A}):null,a.jsxs(xe,{children:[a.jsx(zc,{w:100,id:"logLimit",name:"logLimit",placeholder:"20",label:"Log Limit"}),a.jsx(Ae,{mt:22,loading:p,disabled:k&&!p,"aria-label":"Fetch logs",type:"submit",children:"Fetch Logs"})]})]}),a.jsx(vn,{my:"lg"}),a.jsx(Le,{order:2,children:"Ping from Agent"}),a.jsx("p",{children:"Send a ping command from the agent to a valid IP address or hostname. Use this tool to troubleshoot local network connectivity."}),a.jsx(ft,{onSubmit:te,children:a.jsxs(xe,{children:[a.jsx(Be,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:a.jsx(En,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:R,disabled:k&&!R,children:a.jsx(bq,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),a.jsx(zc,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!R&&T&&a.jsxs(a.Fragment,{children:[a.jsx(Le,{order:5,mt:"sm",mb:0,children:"Last Ping"}),a.jsx("pre",{children:T})]})]})}function hre(){const e=Tn(),t=_e(),[n,r]=v.useState();v.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(l=>ke({color:"red",message:Ye(l),autoClose:!1}))},[t]);function o(l){t.post("auth/revoke",{loginId:l}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>ke({color:"green",message:"Login revoked"})).catch(c=>ke({color:"red",message:Ye(c),autoClose:!1}))}return n?a.jsxs(a.Fragment,{children:[a.jsxs(dt,{children:[a.jsx(Le,{children:"Security"}),a.jsxs(Mm,{children:[a.jsx(ki,{term:"ID",children:a.jsx(Mt,{href:`/${Nt(n.profile)}`,children:n.profile.id})}),a.jsx(ki,{term:"Resource Type",children:n.profile.resourceType}),a.jsx(ki,{term:"Name",children:iu(n.profile.name?.[0])})]})]}),a.jsxs(dt,{children:[a.jsx(Le,{children:"Sessions"}),a.jsxs(he,{children:[a.jsx("thead",{children:a.jsxs("tr",{children:[a.jsx("th",{children:"OS"}),a.jsx("th",{children:"Browser"}),a.jsx("th",{children:"IP Address"}),a.jsx("th",{children:"Auth Method"}),a.jsx("th",{children:"Last Updated"}),a.jsx("th",{})]})}),a.jsx("tbody",{children:n.security.sessions.map(l=>a.jsxs("tr",{children:[a.jsx("td",{children:l.os}),a.jsx("td",{children:l.browser}),a.jsx("td",{children:l.remoteAddress}),a.jsx("td",{children:l.authMethod}),a.jsx("td",{children:wr(l.lastUpdated)}),a.jsx("td",{children:a.jsx(Mt,{href:"#",onClick:()=>o(l.id),children:"Revoke"})})]},l.id))})]})]}),a.jsxs(dt,{children:[a.jsx(Le,{children:"Password"}),a.jsx(Ae,{onClick:()=>e("/changepassword")?.catch(console.error),children:"Change password"})]}),a.jsxs(dt,{children:[a.jsx(Le,{children:"Multi Factor Auth"}),a.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&a.jsx(Ae,{onClick:()=>e("/mfa")?.catch(console.error),children:"Enroll"})]})]}):null}function pre(){const{id:e,secret:t}=Ft(),n=_e(),[r,o]=v.useState(),[l,c]=v.useState(!1),d=au(r,void 0);return a.jsxs(dt,{width:450,children:[a.jsx(Cr,{issues:d}),a.jsxs(ft,{onSubmit:f=>{if(f.password!==f.confirmPassword){o(jo("Passwords do not match","confirmPassword"));return}o(void 0);const p={id:e,secret:t,password:f.password};n.post("auth/setpassword",p).then(()=>c(!0)).catch(m=>o(Yt(m)))},children:[a.jsxs(fr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(Le,{children:"Set password"})]}),!l&&a.jsxs(Ue,{children:[a.jsx(Xi,{name:"password",label:"New password",required:!0,error:Lt(r,"password")}),a.jsx(Xi,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Lt(r,"confirmPassword")}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ae,{type:"submit",children:"Set password"})})]}),l&&a.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",a.jsx(St,{to:"/signin",children:"sign in"}),"."]})]})]})}function mre(){const e=Pm(),t=Tn(),[n]=MS(),r=af(),o=v.useCallback(()=>{const l=n.get("next");t(l?.startsWith("/")?l:"/")?.catch(console.error)},[n,t]);return v.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),a.jsxs(Sk,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword")?.catch(console.error),onRegister:YP()?()=>t("/register")?.catch(console.error):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[a.jsx($i,{size:32}),a.jsxs(Le,{children:["Sign in to ",uk()]}),n.get("project")==="new"&&a.jsx("div",{children:"Sign in again to create a new project"})]})}function gre(){const e=Tn(),t=Kr(),[n,r]=v.useState(),[o,l]=v.useState(),[c,d]=v.useState();return v.useEffect(()=>{const f=Object.fromEntries(new URLSearchParams(t.search).entries());r(f.resourceType),l(f.query),d(JSON.parse(f.fields))},[t]),!n||!o||!c?null:a.jsx(GY,{resourceType:n,checkboxesEnabled:!0,query:o,fields:c,onClick:f=>e(`/${n}/${f.resource.id}`)?.catch(console.error),onAuxClick:f=>window.open(`/${n}/${f.resource.id}`,"_blank"),onBulk:f=>{e(`/bulk/${n}?ids=${f.join(",")}`)?.catch(console.error)}})}function vre(){const{id:e,secret:t}=Ft(),n=_e(),[r,o]=v.useState(),[l,c]=v.useState(!1),d=au(r,void 0);return a.jsxs(dt,{width:450,children:[a.jsx(Cr,{issues:d}),a.jsxs(ft,{onSubmit:()=>{o(void 0);const f={id:e,secret:t};n.post("auth/verifyemail",f).then(()=>c(!0)).catch(p=>o(Yt(p)))},children:[a.jsxs(fr,{style:{flexDirection:"column"},children:[a.jsx($i,{size:32}),a.jsx(Le,{children:"Email address verification required"})]}),!l&&a.jsxs(Ue,{children:[a.jsx("p",{children:"In order to sign in, click the button below to verify your ability to receive email at the address this link was sent to."}),a.jsx(xe,{justify:"flex-end",mt:"xl",children:a.jsx(Ae,{type:"submit",children:"Verify email"})})]}),l&&a.jsxs("div",{"data-testid":"success",children:["Email verified. You can now ",a.jsx(St,{to:"/signin",children:"sign in"}),"."]})]})]})}function yre(){return a.jsx(DZ,{children:a.jsxs($e,{errorElement:a.jsx(Xte,{}),children:[a.jsx($e,{path:"/signin",element:a.jsx(mre,{})}),a.jsx($e,{path:"/oauth",element:a.jsx(hne,{})}),a.jsx($e,{path:"/resetpassword",element:a.jsx(mne,{})}),a.jsx($e,{path:"/setpassword/:id/:secret",element:a.jsx(pre,{})}),a.jsx($e,{path:"/verifyemail/:id/:secret",element:a.jsx(vre,{})}),a.jsx($e,{path:"/register",element:a.jsx(pne,{})}),a.jsx($e,{path:"/changepassword",element:a.jsx(Qte,{})}),a.jsx($e,{path:"/security",element:a.jsx(hre,{})}),a.jsx($e,{path:"/mfa",element:a.jsx(une,{})}),a.jsx($e,{path:"/batch",element:a.jsx(Gte,{})}),a.jsx($e,{path:"/bulk/:resourceType",element:a.jsx(Wte,{})}),a.jsx($e,{path:"/smart",element:a.jsx(gre,{})}),a.jsx($e,{path:"/forms/:id",element:a.jsx(Jte,{})}),a.jsx($e,{path:"/admin/super",element:a.jsx(zee,{})}),a.jsx($e,{path:"/admin/super/asyncjob",element:a.jsx(Pee,{})}),a.jsx($e,{path:"/admin/super/db",element:a.jsx(jee,{})}),a.jsx($e,{path:"/admin/config",element:a.jsx(_ee,{})}),a.jsxs($e,{path:"/admin",element:a.jsx(Dee,{}),children:[a.jsx($e,{path:"patients",element:a.jsx(Ree,{})}),a.jsx($e,{path:"bots/new",element:a.jsx(pee,{})}),a.jsx($e,{path:"bots",element:a.jsx(fee,{})}),a.jsx($e,{path:"clients/new",element:a.jsx(mee,{})}),a.jsx($e,{path:"clients",element:a.jsx(hee,{})}),a.jsx($e,{path:"details",element:a.jsx(RR,{})}),a.jsx($e,{path:"invite",element:a.jsx(Tee,{})}),a.jsx($e,{path:"users",element:a.jsx(Bee,{})}),a.jsx($e,{path:"project",element:a.jsx(RR,{})}),a.jsx($e,{path:"secrets",element:a.jsx(Aee,{})}),a.jsx($e,{path:"sites",element:a.jsx(kee,{})}),a.jsx($e,{path:"members/:membershipId",element:a.jsx(Eee,{})})]}),a.jsx($e,{path:"/lab/assays",element:a.jsx(lne,{})}),a.jsx($e,{path:"/lab/panels",element:a.jsx(cne,{})}),a.jsxs($e,{path:"/:resourceType/new",element:a.jsx(Kte,{}),children:[a.jsx($e,{index:!0,element:a.jsx(Xy,{})}),a.jsx($e,{path:"form",element:a.jsx(Xy,{})}),a.jsx($e,{path:"json",element:a.jsx(zne,{})}),a.jsx($e,{path:"profiles",element:a.jsx(Xy,{})})]}),a.jsxs($e,{path:"/:resourceType/:id",element:a.jsx(lre,{}),children:[a.jsx($e,{index:!0,element:a.jsx(WR,{})}),a.jsx($e,{path:"apply",element:a.jsx(vne,{})}),a.jsx($e,{path:"apps",element:a.jsx(yne,{})}),a.jsx($e,{path:"event",element:a.jsx(bne,{})}),a.jsx($e,{path:"blame",element:a.jsx(Sne,{})}),a.jsx($e,{path:"bots",element:a.jsx(Hne,{})}),a.jsx($e,{path:"builder",element:a.jsx(Ane,{})}),a.jsx($e,{path:"checklist",element:a.jsx(kne,{})}),a.jsx($e,{path:"delete",element:a.jsx(Pne,{})}),a.jsx($e,{path:"details",element:a.jsx(Mne,{})}),a.jsx($e,{path:"edit",element:a.jsx(Lne,{})}),a.jsx($e,{path:"editor",element:a.jsx(_ne,{})}),a.jsxs($e,{path:"history",children:[a.jsx($e,{index:!0,element:a.jsx(GR,{})}),a.jsx($e,{path:":versionId/:tab",element:a.jsx(Ih,{})}),a.jsx($e,{path:":versionId",element:a.jsx(Ih,{})})]}),a.jsxs($e,{path:"_history",children:[a.jsx($e,{index:!0,element:a.jsx(GR,{})}),a.jsx($e,{path:":versionId/:tab",element:a.jsx(Ih,{})}),a.jsx($e,{path:":versionId",element:a.jsx(Ih,{})})]}),a.jsx($e,{path:"json",element:a.jsx($ne,{})}),a.jsx($e,{path:"preview",element:a.jsx(Une,{})}),a.jsx($e,{path:"responses",element:a.jsx(Gne,{})}),a.jsx($e,{path:"report",element:a.jsx(Qne,{})}),a.jsx($e,{path:"ranges",element:a.jsx(Wne,{})}),a.jsx($e,{path:"subscriptions",element:a.jsx(cre,{})}),a.jsx($e,{path:"timeline",element:a.jsx(WR,{})}),a.jsx($e,{path:"tools",element:a.jsx(fre,{})}),a.jsx($e,{path:"profiles",element:a.jsx(Bne,{})}),a.jsx($e,{path:"export",element:a.jsx(Ine,{})})]}),a.jsx($e,{path:"/:resourceType",element:a.jsx(FR,{})}),a.jsx($e,{path:"/",element:a.jsx(FR,{})})]})})}function xre(){const e=_e(),t=e.getUserConfiguration(),n=Kr(),[r]=MS();return e.isLoading()?a.jsx(Oi,{}):a.jsx(NG,{logo:a.jsx($i,{size:24}),pathname:n.pathname,searchParams:r,version:IA,menus:bre(t),displayAddBookmark:!!t?.id,children:a.jsx(v.Suspense,{fallback:a.jsx(Oi,{}),children:a.jsx(yre,{})})})}function bre(e){const t=e?.menu?.map(n=>({title:n.title,links:n.link?.map(r=>({label:r.name,href:r.target,icon:Sre(r.target)}))||[]}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:a.jsx(GH,{})}]}),t}const QR={Patient:Dq,Practitioner:BH,Organization:iH,ServiceRequest:hq,DiagnosticReport:yq,Questionnaire:$H,admin:JF,AccessPolicy:HH,Subscription:$q,batch:iq,Observation:eq};function Sre(e){if(e.includes("admin/super/db"))return a.jsx(SH,{});try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in QR){const n=QR[t];return a.jsx(n,{})}}catch{}return a.jsx(bm,{w:30})}async function wre(){const e=af(),t=new zA({baseUrl:e.baseUrl,clientId:e.clientId,storagePrefix:"@medplum:",cacheTime:6e4,autoBatchTime:100,onUnauthenticated:()=>{window.location.pathname!=="/signin"&&window.location.pathname!=="/oauth"&&(window.location.href="/signin?next="+encodeURIComponent(window.location.pathname+window.location.search))}}),n={headings:{sizes:{h1:{fontSize:"1.125rem",fontWeight:"500",lineHeight:"2.0"}}},fontSizes:{xs:"0.6875rem",sm:"0.875rem",md:"0.875rem",lg:"1.0rem",xl:"1.125rem"}},r=ZZ([{path:"*",element:a.jsx(xre,{})}]),o=c=>r.navigate(c);GX.createRoot(document.getElementById("root")).render(a.jsx(v.StrictMode,{children:a.jsx(nF,{medplum:t,navigate:o,children:a.jsxs(y2,{theme:n,children:[a.jsx(Da,{position:"bottom-right"}),a.jsx(EZ,{router:r})]})})}))}wre().catch(console.error);
|
|
615
|
+
//# sourceMappingURL=index-OECDiSt3.js.map
|