@medplum/app 3.2.16 → 3.2.17
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-Co2cvOKb.css +1 -0
- package/dist/assets/index-s9XRkbjl.js +583 -0
- package/dist/assets/index-s9XRkbjl.js.map +1 -0
- package/dist/index.html +3 -3
- package/package.json +14 -14
- package/dist/assets/index-CGpybjvv.css +0 -1
- package/dist/assets/index-DiO5UUQN.js +0 -583
- package/dist/assets/index-DiO5UUQN.js.map +0 -1
|
@@ -1,583 +0,0 @@
|
|
|
1
|
-
function $S(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 i=Object.getOwnPropertyDescriptor(r,o);i&&Object.defineProperty(e,o,i.get?i:{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 i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(o){if(o.ep)return;o.ep=!0;const i=n(o);fetch(o.href,i)}})();var L0=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Xg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var FS={exports:{}},Lf={},zS={exports:{}},Ge={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its 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 qc=Symbol.for("react.element"),V2=Symbol.for("react.portal"),W2=Symbol.for("react.fragment"),H2=Symbol.for("react.strict_mode"),q2=Symbol.for("react.profiler"),G2=Symbol.for("react.provider"),Q2=Symbol.for("react.context"),K2=Symbol.for("react.forward_ref"),Y2=Symbol.for("react.suspense"),X2=Symbol.for("react.memo"),J2=Symbol.for("react.lazy"),$0=Symbol.iterator;function Z2(e){return e===null||typeof e!="object"?null:(e=$0&&e[$0]||e["@@iterator"],typeof e=="function"?e:null)}var BS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},US=Object.assign,VS={};function cl(e,t,n){this.props=e,this.context=t,this.refs=VS,this.updater=n||BS}cl.prototype.isReactComponent={};cl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};cl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function WS(){}WS.prototype=cl.prototype;function Jg(e,t,n){this.props=e,this.context=t,this.refs=VS,this.updater=n||BS}var Zg=Jg.prototype=new WS;Zg.constructor=Jg;US(Zg,cl.prototype);Zg.isPureReactComponent=!0;var F0=Array.isArray,HS=Object.prototype.hasOwnProperty,ev={current:null},qS={key:!0,ref:!0,__self:!0,__source:!0};function GS(e,t,n){var r,o={},i=null,a=null;if(t!=null)for(r in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)HS.call(t,r)&&!qS.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];o.children=c}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:qc,type:e,key:i,ref:a,props:o,_owner:ev.current}}function e_(e,t){return{$$typeof:qc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function tv(e){return typeof e=="object"&&e!==null&&e.$$typeof===qc}function t_(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var z0=/\/+/g;function ap(e,t){return typeof e=="object"&&e!==null&&e.key!=null?t_(""+e.key):t.toString(36)}function yd(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var a=!1;if(e===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(e.$$typeof){case qc:case V2:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+ap(a,0):r,F0(o)?(n="",e!=null&&(n=e.replace(z0,"$&/")+"/"),yd(o,t,n,"",function(u){return u})):o!=null&&(tv(o)&&(o=e_(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(z0,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",F0(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+ap(i,l);a+=yd(i,t,n,c,o)}else if(c=Z2(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+ap(i,l++),a+=yd(i,t,n,c,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return a}function $u(e,t,n){if(e==null)return e;var r=[],o=0;return yd(e,r,"","",function(i){return t.call(n,i,o++)}),r}function n_(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Bn={current:null},xd={transition:null},r_={ReactCurrentDispatcher:Bn,ReactCurrentBatchConfig:xd,ReactCurrentOwner:ev};Ge.Children={map:$u,forEach:function(e,t,n){$u(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $u(e,function(){t++}),t},toArray:function(e){return $u(e,function(t){return t})||[]},only:function(e){if(!tv(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ge.Component=cl;Ge.Fragment=W2;Ge.Profiler=q2;Ge.PureComponent=Jg;Ge.StrictMode=H2;Ge.Suspense=Y2;Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r_;Ge.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=US({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=ev.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)HS.call(t,c)&&!qS.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&l!==void 0?l[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:qc,type:e.type,key:o,ref:i,props:r,_owner:a}};Ge.createContext=function(e){return e={$$typeof:Q2,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:G2,_context:e},e.Consumer=e};Ge.createElement=GS;Ge.createFactory=function(e){var t=GS.bind(null,e);return t.type=e,t};Ge.createRef=function(){return{current:null}};Ge.forwardRef=function(e){return{$$typeof:K2,render:e}};Ge.isValidElement=tv;Ge.lazy=function(e){return{$$typeof:J2,_payload:{_status:-1,_result:e},_init:n_}};Ge.memo=function(e,t){return{$$typeof:X2,type:e,compare:t===void 0?null:t}};Ge.startTransition=function(e){var t=xd.transition;xd.transition={};try{e()}finally{xd.transition=t}};Ge.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ge.useCallback=function(e,t){return Bn.current.useCallback(e,t)};Ge.useContext=function(e){return Bn.current.useContext(e)};Ge.useDebugValue=function(){};Ge.useDeferredValue=function(e){return Bn.current.useDeferredValue(e)};Ge.useEffect=function(e,t){return Bn.current.useEffect(e,t)};Ge.useId=function(){return Bn.current.useId()};Ge.useImperativeHandle=function(e,t,n){return Bn.current.useImperativeHandle(e,t,n)};Ge.useInsertionEffect=function(e,t){return Bn.current.useInsertionEffect(e,t)};Ge.useLayoutEffect=function(e,t){return Bn.current.useLayoutEffect(e,t)};Ge.useMemo=function(e,t){return Bn.current.useMemo(e,t)};Ge.useReducer=function(e,t,n){return Bn.current.useReducer(e,t,n)};Ge.useRef=function(e){return Bn.current.useRef(e)};Ge.useState=function(e){return Bn.current.useState(e)};Ge.useSyncExternalStore=function(e,t,n){return Bn.current.useSyncExternalStore(e,t,n)};Ge.useTransition=function(){return Bn.current.useTransition()};Ge.version="18.2.0";zS.exports=Ge;var p=zS.exports;const fn=Xg(p),QS=$S({__proto__:null,default:fn},[p]);/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its 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 o_=p,i_=Symbol.for("react.element"),s_=Symbol.for("react.fragment"),a_=Object.prototype.hasOwnProperty,l_=o_.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c_={key:!0,ref:!0,__self:!0,__source:!0};function KS(e,t,n){var r,o={},i=null,a=null;n!==void 0&&(i=""+n),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)a_.call(t,r)&&!c_.hasOwnProperty(r)&&(o[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)o[r]===void 0&&(o[r]=t[r]);return{$$typeof:i_,type:e,key:i,ref:a,props:o,_owner:l_.current}}Lf.Fragment=s_;Lf.jsx=KS;Lf.jsxs=KS;FS.exports=Lf;var s=FS.exports,lo=function(){return lo=Object.assign||function(t){for(var n,r=1,o=arguments.length;r<o;r++){n=arguments[r];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},lo.apply(this,arguments)};function YS(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 u_(e,t,n){if(n||arguments.length===2)for(var r=0,o=t.length,i;r<o;r++)(i||!(r in t))&&(i||(i=Array.prototype.slice.call(t,0,r)),i[r]=t[r]);return e.concat(i||Array.prototype.slice.call(t))}var bd="right-scroll-bar-position",wd="width-before-scroll-bar",d_="with-scroll-bars-hidden",f_="--removed-body-scroll-bar-size";function lp(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function h_(e,t){var n=p.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 p_=typeof window<"u"?p.useLayoutEffect:p.useEffect,B0=new WeakMap;function m_(e,t){var n=h_(null,function(r){return e.forEach(function(o){return lp(o,r)})});return p_(function(){var r=B0.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(l){i.has(l)||lp(l,null)}),i.forEach(function(l){o.has(l)||lp(l,a)})}B0.set(n,e)},[e]),n}function g_(e){return e}function v_(e,t){t===void 0&&(t=g_);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(i){var a=t(i,r);return n.push(a),function(){n=n.filter(function(l){return l!==a})}},assignSyncMedium:function(i){for(r=!0;n.length;){var a=n;n=[],a.forEach(i)}n={push:function(l){return i(l)},filter:function(){return n}}},assignMedium:function(i){r=!0;var a=[];if(n.length){var l=n;n=[],l.forEach(i),a=n}var c=function(){var d=a;a=[],d.forEach(i)},u=function(){return Promise.resolve().then(c)};u(),n={push:function(d){a.push(d),u()},filter:function(d){return a=a.filter(d),n}}}};return o}function y_(e){e===void 0&&(e={});var t=v_(null);return t.options=lo({async:!0,ssr:!1},e),t}var XS=function(e){var t=e.sideCar,n=YS(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 p.createElement(r,lo({},n))};XS.isSideCarExport=!0;function x_(e,t){return e.useMedium(t),XS}var JS=y_(),cp=function(){},$f=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:cp,onWheelCapture:cp,onTouchMoveCapture:cp}),o=r[0],i=r[1],a=e.forwardProps,l=e.children,c=e.className,u=e.removeScrollBar,d=e.enabled,f=e.shards,h=e.sideCar,m=e.noIsolation,g=e.inert,v=e.allowPinchZoom,S=e.as,b=S===void 0?"div":S,w=e.gapMode,y=YS(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),x=h,C=m_([n,t]),E=lo(lo({},y),o);return p.createElement(p.Fragment,null,d&&p.createElement(x,{sideCar:JS,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),a?p.cloneElement(p.Children.only(l),lo(lo({},E),{ref:C})):p.createElement(b,lo({},E,{className:c,ref:C}),l))});$f.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};$f.classNames={fullWidth:wd,zeroRight:bd};var b_=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function w_(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=b_();return t&&e.setAttribute("nonce",t),e}function S_(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function j_(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var C_=function(){var e=0,t=null;return{add:function(n){e==0&&(t=w_())&&(S_(t,n),j_(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},E_=function(){var e=C_();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ZS=function(){var e=E_(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},T_={left:0,top:0,right:0,gap:0},up=function(e){return parseInt(e||"",10)||0},P_=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[up(n),up(r),up(o)]},k_=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return T_;var t=P_(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])}},R_=ZS(),Ma="data-scroll-locked",__=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,l=e.gap;return n===void 0&&(n="margin"),`
|
|
18
|
-
.`.concat(d_,` {
|
|
19
|
-
overflow: hidden `).concat(r,`;
|
|
20
|
-
padding-right: `).concat(l,"px ").concat(r,`;
|
|
21
|
-
}
|
|
22
|
-
body[`).concat(Ma,`] {
|
|
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(i,`px;
|
|
28
|
-
padding-right: `).concat(a,`px;
|
|
29
|
-
margin-left:0;
|
|
30
|
-
margin-top:0;
|
|
31
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
32
|
-
`),n==="padding"&&"padding-right: ".concat(l,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.`).concat(bd,` {
|
|
36
|
-
right: `).concat(l,"px ").concat(r,`;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.`).concat(wd,` {
|
|
40
|
-
margin-right: `).concat(l,"px ").concat(r,`;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.`).concat(bd," .").concat(bd,` {
|
|
44
|
-
right: 0 `).concat(r,`;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.`).concat(wd," .").concat(wd,` {
|
|
48
|
-
margin-right: 0 `).concat(r,`;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
body[`).concat(Ma,`] {
|
|
52
|
-
`).concat(f_,": ").concat(l,`px;
|
|
53
|
-
}
|
|
54
|
-
`)},U0=function(){var e=parseInt(document.body.getAttribute(Ma)||"0",10);return isFinite(e)?e:0},D_=function(){p.useEffect(function(){return document.body.setAttribute(Ma,(U0()+1).toString()),function(){var e=U0()-1;e<=0?document.body.removeAttribute(Ma):document.body.setAttribute(Ma,e.toString())}},[])},I_=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;D_();var i=p.useMemo(function(){return k_(o)},[o]);return p.createElement(R_,{styles:__(i,!t,o,n?"":"!important")})},pm=!1;if(typeof window<"u")try{var Fu=Object.defineProperty({},"passive",{get:function(){return pm=!0,!0}});window.addEventListener("test",Fu,Fu),window.removeEventListener("test",Fu,Fu)}catch{pm=!1}var sa=pm?{passive:!1}:!1,A_=function(e){return e.tagName==="TEXTAREA"},ej=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!A_(e)&&n[t]==="visible")},N_=function(e){return ej(e,"overflowY")},M_=function(e){return ej(e,"overflowX")},V0=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=tj(e,r);if(o){var i=nj(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},O_=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},L_=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},tj=function(e,t){return e==="v"?N_(t):M_(t)},nj=function(e,t){return e==="v"?O_(t):L_(t)},$_=function(e,t){return e==="h"&&t==="rtl"?-1:1},F_=function(e,t,n,r,o){var i=$_(e,window.getComputedStyle(t).direction),a=i*r,l=n.target,c=t.contains(l),u=!1,d=a>0,f=0,h=0;do{var m=nj(e,l),g=m[0],v=m[1],S=m[2],b=v-S-i*g;(g||b)&&tj(e,l)&&(f+=b,h+=g),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!c&&l!==document.body||c&&(t.contains(l)||t===l));return(d&&(Math.abs(f)<1||!o)||!d&&(Math.abs(h)<1||!o))&&(u=!0),u},zu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},W0=function(e){return[e.deltaX,e.deltaY]},H0=function(e){return e&&"current"in e?e.current:e},z_=function(e,t){return e[0]===t[0]&&e[1]===t[1]},B_=function(e){return`
|
|
55
|
-
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
-
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
-
`)},U_=0,aa=[];function V_(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(U_++)[0],i=p.useState(ZS)[0],a=p.useRef(e);p.useEffect(function(){a.current=e},[e]),p.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var v=u_([e.lockRef.current],(e.shards||[]).map(H0),!0).filter(Boolean);return v.forEach(function(S){return S.classList.add("allow-interactivity-".concat(o))}),function(){document.body.classList.remove("block-interactivity-".concat(o)),v.forEach(function(S){return S.classList.remove("allow-interactivity-".concat(o))})}}},[e.inert,e.lockRef.current,e.shards]);var l=p.useCallback(function(v,S){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!a.current.allowPinchZoom;var b=zu(v),w=n.current,y="deltaX"in v?v.deltaX:w[0]-b[0],x="deltaY"in v?v.deltaY:w[1]-b[1],C,E=v.target,T=Math.abs(y)>Math.abs(x)?"h":"v";if("touches"in v&&T==="h"&&E.type==="range")return!1;var j=V0(T,E);if(!j)return!0;if(j?C=T:(C=T==="v"?"h":"v",j=V0(T,E)),!j)return!1;if(!r.current&&"changedTouches"in v&&(y||x)&&(r.current=C),!C)return!0;var R=r.current||C;return F_(R,S,v,R==="h"?y:x,!0)},[]),c=p.useCallback(function(v){var S=v;if(!(!aa.length||aa[aa.length-1]!==i)){var b="deltaY"in S?W0(S):zu(S),w=t.current.filter(function(C){return C.name===S.type&&(C.target===S.target||S.target===C.shadowParent)&&z_(C.delta,b)})[0];if(w&&w.should){S.cancelable&&S.preventDefault();return}if(!w){var y=(a.current.shards||[]).map(H0).filter(Boolean).filter(function(C){return C.contains(S.target)}),x=y.length>0?l(S,y[0]):!a.current.noIsolation;x&&S.cancelable&&S.preventDefault()}}},[]),u=p.useCallback(function(v,S,b,w){var y={name:v,delta:S,target:b,should:w,shadowParent:W_(b)};t.current.push(y),setTimeout(function(){t.current=t.current.filter(function(x){return x!==y})},1)},[]),d=p.useCallback(function(v){n.current=zu(v),r.current=void 0},[]),f=p.useCallback(function(v){u(v.type,W0(v),v.target,l(v,e.lockRef.current))},[]),h=p.useCallback(function(v){u(v.type,zu(v),v.target,l(v,e.lockRef.current))},[]);p.useEffect(function(){return aa.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,sa),document.addEventListener("touchmove",c,sa),document.addEventListener("touchstart",d,sa),function(){aa=aa.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,sa),document.removeEventListener("touchmove",c,sa),document.removeEventListener("touchstart",d,sa)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(i,{styles:B_(o)}):null,m?p.createElement(I_,{gapMode:e.gapMode}):null)}function W_(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const H_=x_(JS,V_);var Ff=p.forwardRef(function(e,t){return p.createElement($f,lo({},e,{ref:t,sideCar:H_}))});Ff.classNames=$f.classNames;function bt(e){return Object.keys(e)}function dp(e){return e&&typeof e=="object"&&!Array.isArray(e)}function nv(e,t){const n={...e},r=t;return dp(e)&&dp(t)&&Object.keys(t).forEach(o=>{dp(r[o])&&o in e?n[o]=nv(n[o],r[o]):n[o]=r[o]}),n}function q_(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function G_(e){var t;return typeof e!="string"||!e.includes("var(--mantine-scale)")?e:(t=e.match(/^calc\((.*?)\)$/))==null?void 0:t[1].split("*")[0].trim()}function cc(e){const t=G_(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 fp(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function rj(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?fp(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(i=>n(i)).join(",");if(r.includes(" "))return r.split(" ").map(i=>n(i)).join(" ");if(r.includes(e))return t?fp(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?fp(i):i}}return r}return n}const U=rj("rem",{shouldScale:!0}),$d=rj("em");function Hi(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function oj(e){return typeof e=="number"?!0:typeof e=="string"?e.startsWith("calc(")||e.startsWith("var(")||e.includes(" ")&&e.trim()!==""?!0:/[0-9]/.test(e.trim().replace("-","")[0]):!1}function Qo(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==p.Fragment:!1}function Un(e){const t=p.createContext(null);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>{const o=p.useContext(t);if(o===null)throw new Error(e);return o}]}function Ls(e=null){const t=p.createContext(e);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>p.useContext(t)]}function q0(e,t){return n=>{if(typeof n!="string"||n.trim().length===0)throw new Error(t);return`${e}-${n}`}}function Fd(e,t){let n=e;for(;(n=n.parentElement)&&!n.matches(t););return n}function Q_(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 K_(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 Y_(e,t,n){return Fd(e,n)===Fd(t,n)}function ij({parentSelector:e,siblingSelector:t,onKeyDown:n,loop:r=!0,activateOnFocus:o=!1,dir:i="rtl",orientation:a}){return l=>{var g;n==null||n(l);const c=Array.from(((g=Fd(l.currentTarget,e))==null?void 0:g.querySelectorAll(t))||[]).filter(v=>Y_(l.currentTarget,v,e)),u=c.findIndex(v=>l.currentTarget===v),d=K_(u,c,r),f=Q_(u,c,r),h=i==="rtl"?f:d,m=i==="rtl"?d:f;switch(l.key){case"ArrowRight":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[h].focus(),o&&c[h].click());break}case"ArrowLeft":{a==="horizontal"&&(l.stopPropagation(),l.preventDefault(),c[m].focus(),o&&c[m].click());break}case"ArrowUp":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[f].focus(),o&&c[f].click());break}case"ArrowDown":{a==="vertical"&&(l.stopPropagation(),l.preventDefault(),c[d].focus(),o&&c[d].click());break}case"Home":{l.stopPropagation(),l.preventDefault(),!c[0].disabled&&c[0].focus();break}case"End":{l.stopPropagation(),l.preventDefault();const v=c.length-1;!c[v].disabled&&c[v].focus();break}}}}const X_={app:100,modal:200,popover:300,overlay:400,max:9999};function Jr(e){return X_[e]}const J_=()=>{};function Z_(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||J_:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Ne(e,t="size",n=!0){if(e!==void 0)return oj(e)?n?U(e):e:`var(--${t}-${e})`}function Yt(e){return Ne(e,"mantine-spacing")}function it(e){return e===void 0?"var(--mantine-radius-default)":Ne(e,"mantine-radius")}function hn(e){return Ne(e,"mantine-font-size")}function sj(e){return Ne(e,"mantine-line-height",!1)}function rv(e){if(e)return Ne(e,"mantine-shadow",!1)}function ar(e,t){return n=>{e==null||e(n),t==null||t(n)}}function ov(e,t){return e in t.breakpoints?cc(t.breakpoints[e]):cc(e)}function uc(e,t){const n=e.map(r=>({value:r,px:ov(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function Br(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function eD(e,t,n){var r;return n?Array.from(((r=Fd(n,t))==null?void 0:r.querySelectorAll(e))||[]).findIndex(o=>o===n):null}function tD(){const[e,t]=p.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function Bu(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 iv(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function G0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function cs(e){const t=p.useRef(e);return p.useEffect(()=>{t.current=e}),p.useMemo(()=>(...n)=>{var r;return(r=t.current)==null?void 0:r.call(t,...n)},[])}function zf(e,t){const n=cs(e),r=p.useRef(0);return p.useEffect(()=>()=>window.clearTimeout(r.current),[]),p.useCallback((...o)=>{window.clearTimeout(r.current),r.current=window.setTimeout(()=>n(...o),t)},[n,t])}const Q0=["mousedown","touchstart"];function nD(e,t,n){const r=p.useRef();return p.useEffect(()=>{const o=i=>{const{target:a}=i??{};if(Array.isArray(n)){const l=(a==null?void 0:a.hasAttribute("data-ignore-outside-clicks"))||!document.body.contains(a)&&a.tagName!=="HTML";n.every(u=>!!u&&!i.composedPath().includes(u))&&!l&&e()}else r.current&&!r.current.contains(a)&&e()};return(t||Q0).forEach(i=>document.addEventListener(i,o)),()=>{(t||Q0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function aj({timeout:e=2e3}={}){const[t,n]=p.useState(null),[r,o]=p.useState(!1),[i,a]=p.useState(null),l=d=>{window.clearTimeout(i),a(window.setTimeout(()=>o(!1),e)),o(d)};return{copy:d=>{"clipboard"in navigator?navigator.clipboard.writeText(d).then(()=>l(!0)).catch(f=>n(f)):n(new Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{o(!1),n(null),window.clearTimeout(i)},error:t,copied:r}}function rD(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function oD(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function lj(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:oD(e)),i=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),rD(i.current,a=>o(a.matches))},[e]),r}function iD(e,t){return lj("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const ul=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Lo(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function cj({opened:e,shouldReturnFocus:t=!0}){const n=p.useRef(),r=()=>{var o;n.current&&"focus"in n.current&&typeof n.current.focus=="function"&&((o=n.current)==null||o.focus({preventScroll:!0}))};return Lo(()=>{let o=-1;const i=a=>{a.key==="Tab"&&window.clearTimeout(o)};return document.addEventListener("keydown",i),e?n.current=document.activeElement:t&&(o=window.setTimeout(r,10)),()=>{window.clearTimeout(o),document.removeEventListener("keydown",i)}},[e,t]),r}function sD(e,t="body > :not(script)"){const n=iv(),r=Array.from(document.querySelectorAll(t)).map(o=>{var c;if((c=o==null?void 0:o.shadowRoot)!=null&&c.contains(e)||o.contains(e))return;const i=o.getAttribute("aria-hidden"),a=o.getAttribute("data-hidden"),l=o.getAttribute("data-focus-id");return o.setAttribute("data-focus-id",n),i===null||i==="false"?o.setAttribute("aria-hidden","true"):!a&&!l&&o.setAttribute("data-hidden",i),{node:o,ariaHidden:a||null}});return()=>{r.forEach(o=>{!o||n!==o.node.getAttribute("data-focus-id")||(o.ariaHidden===null?o.node.removeAttribute("aria-hidden"):o.node.setAttribute("aria-hidden",o.ariaHidden),o.node.removeAttribute("data-focus-id"),o.node.removeAttribute("data-hidden"))})}}const aD=/input|select|textarea|button|object/,uj="a, input, select, textarea, button, object, [tabindex]";function lD(e){return e.style.display==="none"}function cD(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(lD(n))return!1;n=n.parentNode}return!0}function dj(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function mm(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(dj(e));return(aD.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&cD(e)}function fj(e){const t=dj(e);return(Number.isNaN(t)||t>=0)&&mm(e)}function uD(e){return Array.from(e.querySelectorAll(uj)).filter(fj)}function dD(e,t){const n=uD(e);if(!n.length){t.preventDefault();return}const r=n[t.shiftKey?0:n.length-1],o=e.getRootNode();let i=r===o.activeElement||e===o.activeElement;const a=o.activeElement;if(a.tagName==="INPUT"&&a.getAttribute("type")==="radio"&&(i=n.filter(d=>d.getAttribute("type")==="radio"&&d.getAttribute("name")===a.getAttribute("name")).includes(r)),!i)return;t.preventDefault();const c=n[t.shiftKey?n.length-1:0];c&&c.focus()}function fD(e=!0){const t=p.useRef(),n=p.useRef(null),r=i=>{let a=i.querySelector("[data-autofocus]");if(!a){const l=Array.from(i.querySelectorAll(uj));a=l.find(fj)||l.find(mm)||null,!a&&mm(i)&&(a=i)}a&&a.focus({preventScroll:!0})},o=p.useCallback(i=>{if(e){if(i===null){n.current&&(n.current(),n.current=null);return}n.current=sD(i),t.current!==i&&(i?(setTimeout(()=>{i.getRootNode()&&r(i)}),t.current=i):t.current=null)}},[e]);return p.useEffect(()=>{if(!e)return;t.current&&setTimeout(()=>r(t.current));const i=a=>{a.key==="Tab"&&t.current&&dD(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const hD=e=>(e+1)%1e6;function pD(){const[,e]=p.useReducer(hD,0);return e}const mD=fn.useId||(()=>{});function gD(){const e=mD();return e?`mantine-${e.replace(/:/g,"")}`:""}function Vn(e){const t=gD(),[n,r]=p.useState(t);return ul(()=>{r(iv())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function hj(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function Bf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function vD(...e){return t=>{e.forEach(n=>Bf(n,t))}}function nn(...e){return p.useCallback(vD(...e),e)}function bn({value:e,defaultValue:t,finalValue:n,onChange:r=()=>{}}){const[o,i]=p.useState(t!==void 0?t:n),a=(l,...c)=>{i(l),r==null||r(l,...c)};return e!==void 0?[e,r,!0]:[o,a,!1]}function fi(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const Uu="dots";function yD({total:e,siblings:t=1,boundaries:n=1,page:r,initialPage:o=1,onChange:i}){const a=Math.max(Math.trunc(e),0),[l,c]=bn({value:r,onChange:i,defaultValue:o,finalValue:o}),u=v=>{v<=0?c(1):v>a?c(a):c(v)},d=()=>u(l+1),f=()=>u(l-1),h=()=>u(1),m=()=>u(a);return{range:p.useMemo(()=>{if(t*2+3+n*2>=a)return fi(1,a);const S=Math.max(l-t,n),b=Math.min(l+t,a-n),w=S>n+2,y=b<a-(n+1);if(!w&&y){const x=t*2+n+2;return[...fi(1,x),Uu,...fi(a-(n-1),a)]}if(w&&!y){const x=n+1+2*t;return[...fi(1,n),Uu,...fi(a-x,a)]}return[...fi(1,n),Uu,...fi(S,b),Uu,...fi(a-n+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:m}}function sv(e,t){return lj("(prefers-reduced-motion: reduce)",e,t)}function av(e=!1,t){const{onOpen:n,onClose:r}={},[o,i]=p.useState(e),a=p.useCallback(()=>{i(u=>u||(n==null||n(),!0))},[n]),l=p.useCallback(()=>{i(u=>u&&(r==null||r(),!1))},[r]),c=p.useCallback(()=>{o?l():a()},[l,a,o]);return[o,{open:a,close:l,toggle:c}]}function xD(e,t,n={autoInvoke:!1}){const r=p.useRef(null),o=p.useCallback((...a)=>{r.current||(r.current=window.setTimeout(()=>{e(a),r.current=null},t))},[t]),i=p.useCallback(()=>{r.current&&(window.clearTimeout(r.current),r.current=null)},[]);return p.useEffect(()=>(n.autoInvoke&&o(),i),[i,o]),{start:o,clear:i}}function bD(e,t,n){const r=p.useRef(),o=p.useRef(null);return p.useEffect(()=>{const i=typeof n=="function"?n():n;return(i||o.current)&&(r.current=new MutationObserver(e),r.current.observe(i||o.current,t)),()=>{var a;(a=r.current)==null||a.disconnect()}},[e,t]),o}function wD(){const[e,t]=p.useState(!1);return p.useEffect(()=>t(!0),[]),e}var SD={};function pj(){return typeof process<"u"&&SD?"production":"development"}function mj(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=mj(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function tt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=mj(e))&&(r&&(r+=" "),r+=t);return r}const jD={};function CD(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=tt(t[r],o):t[r]=o})}),t}function Uf({theme:e,classNames:t,props:n,stylesCtx:r}){const i=(Array.isArray(t)?t:[t]).map(a=>typeof a=="function"?a(e,n,r):a||jD);return CD(i)}function zd({theme:e,styles:t,props:n,stylesCtx:r}){return(Array.isArray(t)?t:[t]).reduce((i,a)=>typeof a=="function"?{...i,...a(e,n,r)}:{...i,...a},{})}const lv=p.createContext(null);function qi(){const e=p.useContext(lv);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function ED(){return qi().cssVariablesResolver}function TD(){return qi().classNamesPrefix}function Vf(){return qi().getStyleNonce}function PD(){return qi().withStaticClasses}function kD(){return qi().headless}function RD(){var e;return(e=qi().stylesTransform)==null?void 0:e.sx}function _D(){var e;return(e=qi().stylesTransform)==null?void 0:e.styles}function DD(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function ID(e){let t=e.replace("#","");if(t.length===3){const a=t.split("");t=[a[0],a[0],a[1],a[1],a[2],a[2]].join("")}if(t.length===8){const a=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}}const n=parseInt(t,16),r=n>>16&255,o=n>>8&255,i=n&255;return{r,g:o,b:i,a:1}}function AD(e){const[t,n,r,o]=e.replace(/[^0-9,./]/g,"").split(/[/,]/).map(Number);return{r:t,g:n,b:r,a:o||1}}function ND(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,i=parseInt(n[3],10)/100,a=n[5]?parseFloat(n[5]):void 0,l=(1-Math.abs(2*i-1))*o,c=r/60,u=l*(1-Math.abs(c%2-1)),d=i-l/2;let f,h,m;return c>=0&&c<1?(f=l,h=u,m=0):c>=1&&c<2?(f=u,h=l,m=0):c>=2&&c<3?(f=0,h=l,m=u):c>=3&&c<4?(f=0,h=u,m=l):c>=4&&c<5?(f=u,h=0,m=l):(f=l,h=0,m=u),{r:Math.round((f+d)*255),g:Math.round((h+d)*255),b:Math.round((m+d)*255),a:a||1}}function cv(e){return DD(e)?ID(e):e.startsWith("rgb")?AD(e):e.startsWith("hsl")?ND(e):{r:0,g:0,b:0,a:1}}function Vu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=cv(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function dc(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function hp(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function MD(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function OD(e){if(e.startsWith("oklch("))return(MD(e)||0)/100;const{r:t,g:n,b:r}=cv(e),o=t/255,i=n/255,a=r/255,l=hp(o),c=hp(i),u=hp(a);return .2126*l+.7152*c+.0722*u}function _l(e,t=.179){return e.startsWith("var(")?!1:OD(e)>t}function Er({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:_l(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:_l(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:_l(e==="white"?t.white:t.black,t.luminanceThreshold),variable:`--mantine-color-${e}`};const[r,o]=e.split("."),i=o?Number(o):void 0,a=r in t.colors;if(a){const l=i!==void 0?t.colors[r][i]:t.colors[r][dc(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:a,isLight:_l(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:_l(e,t.luminanceThreshold),shade:i,variable:void 0}}function ot(e,t){const n=Er({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function gm(e,t){const n={from:(e==null?void 0:e.from)||t.defaultGradient.from,to:(e==null?void 0:e.to)||t.defaultGradient.to,deg:(e==null?void 0:e.deg)||t.defaultGradient.deg||0},r=ot(n.from,t),o=ot(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function xr(e,t){if(typeof e!="string"||t>1||t<0)return"rgba(0, 0, 0, 1)";if(e.startsWith("var(")){const i=(1-t)*100;return`color-mix(in srgb, ${e}, transparent ${i}%)`}if(e.startsWith("oklch"))return e.includes("/")?e.replace(/\/\s*[\d.]+\s*\)/,`/ ${t})`):e.replace(")",` / ${t})`);const{r:n,g:r,b:o}=cv(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const la=xr,LD=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=Er({color:e,theme:t}),a=typeof o=="boolean"?o:t.autoContrast;if(n==="filled"){const l=a&&i.isLight?"var(--mantine-color-black)":"var(--mantine-color-white)";return i.isThemeColor?i.shade===void 0?{background:`var(--mantine-color-${e}-filled)`,hover:`var(--mantine-color-${e}-filled-hover)`,color:l,border:`${U(1)} solid transparent`}:{background:`var(--mantine-color-${i.color}-${i.shade})`,hover:`var(--mantine-color-${i.color}-${i.shade===9?8:i.shade+1})`,color:l,border:`${U(1)} solid transparent`}:{background:e,hover:Vu(e,.1),color:l,border:`${U(1)} solid transparent`}}if(n==="light"){if(i.isThemeColor){if(i.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:`${U(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:xr(l,.1),hover:xr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${U(1)} solid transparent`}}return{background:xr(e,.1),hover:xr(e,.12),color:e,border:`${U(1)} solid transparent`}}if(n==="outline")return i.isThemeColor?i.shade===void 0?{background:"transparent",hover:`var(--mantine-color-${e}-outline-hover)`,color:`var(--mantine-color-${e}-outline)`,border:`${U(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:xr(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${U(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:xr(e,.05),color:e,border:`${U(1)} solid ${e}`};if(n==="subtle"){if(i.isThemeColor){if(i.shade===void 0)return{background:"transparent",hover:`var(--mantine-color-${e}-light-hover)`,color:`var(--mantine-color-${e}-light-color)`,border:`${U(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:xr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${U(1)} solid transparent`}}return{background:"transparent",hover:xr(e,.12),color:e,border:`${U(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${U(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${U(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${U(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:Vu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${U(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Vu(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${U(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:Vu(t.white,.01),color:e,border:`${U(1)} solid transparent`}:n==="gradient"?{background:gm(r,t),hover:gm(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:`${U(1)} solid var(--mantine-color-default-border)`}:{}},$D={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"]},K0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",uv={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:$D,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:LD,autoContrast:!1,luminanceThreshold:.3,fontFamily:K0,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:K0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:U(34),lineHeight:"1.3"},h2:{fontSize:U(26),lineHeight:"1.35"},h3:{fontSize:U(22),lineHeight:"1.4"},h4:{fontSize:U(18),lineHeight:"1.45"},h5:{fontSize:U(16),lineHeight:"1.5"},h6:{fontSize:U(14),lineHeight:"1.5"}}},fontSizes:{xs:U(12),sm:U(14),md:U(16),lg:U(18),xl:U(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:U(2),sm:U(4),md:U(8),lg:U(16),xl:U(32)},spacing:{xs:U(10),sm:U(12),md:U(16),lg:U(20),xl:U(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${U(1)} ${U(3)} rgba(0, 0, 0, 0.05), 0 ${U(1)} ${U(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${U(1)} ${U(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${U(10)} ${U(15)} ${U(-5)}, rgba(0, 0, 0, 0.04) 0 ${U(7)} ${U(7)} ${U(-5)}`,md:`0 ${U(1)} ${U(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${U(20)} ${U(25)} ${U(-5)}, rgba(0, 0, 0, 0.04) 0 ${U(10)} ${U(10)} ${U(-5)}`,lg:`0 ${U(1)} ${U(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${U(28)} ${U(23)} ${U(-7)}, rgba(0, 0, 0, 0.04) 0 ${U(12)} ${U(12)} ${U(-7)}`,xl:`0 ${U(1)} ${U(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${U(36)} ${U(28)} ${U(-7)}, rgba(0, 0, 0, 0.04) 0 ${U(17)} ${U(17)} ${U(-7)}`},other:{},components:{}};function Y0(e){return e==="auto"||e==="dark"||e==="light"}function FD({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 Y0(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&&Y0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const zD="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",X0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function pp(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function J0(e){if(!(e.primaryColor in e.colors))throw new Error(zD);if(typeof e.primaryShade=="object"&&(!pp(e.primaryShade.dark)||!pp(e.primaryShade.light)))throw new Error(X0);if(typeof e.primaryShade=="number"&&!pp(e.primaryShade))throw new Error(X0)}function BD(e,t){var r;if(!t)return J0(e),e;const n=nv(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),J0(n),n}const dv=p.createContext(null),UD=()=>p.useContext(dv)||uv;function At(){const e=p.useContext(dv);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 gj({theme:e,children:t,inherit:n=!0}){const r=UD(),o=p.useMemo(()=>BD(n?r:uv,e),[e,r,n]);return s.jsx(dv.Provider,{value:o,children:t})}gj.displayName="@mantine/core/MantineThemeProvider";function VD(){const e=At(),t=Vf(),n=bt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),a=cc(e.breakpoints[o]),l=i?`${a-.1}px`:$d(a-.1),c=i?`${a}px`:$d(a);return`${r}@media (max-width: ${l}) {.mantine-visible-from-${o} {display: none !important;}}@media (min-width: ${c}) {.mantine-hidden-from-${o} {display: none !important;}}`},"");return s.jsx("style",{"data-mantine-styles":"classes",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:n}})}function mp(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Dl(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function WD(e,t){const n=mp(e.variables),r=n?Dl(t,n):"",o=mp(e.dark),i=mp(e.light),a=o?Dl(t===":host"?`${t}([data-mantine-color-scheme="dark"])`:`${t}[data-mantine-color-scheme="dark"]`,o):"",l=i?Dl(t===":host"?`${t}([data-mantine-color-scheme="light"])`:`${t}[data-mantine-color-scheme="light"]`,i):"";return`${r}${a}${l}`}function Ko({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&Er({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function Z0(e,t){return Ko({color:e.colors[e.primaryColor][dc(e,t)],theme:e,autoContrast:null})}function Wu({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const l=dc(e,"light"),c={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-filled)`,[`--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`]:la(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:la(e.colors[t][l],.12),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${l})`,[`--mantine-color-${r}-outline-hover`]:la(e.colors[t][l],.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}const i=dc(e,"dark"),a={[`--mantine-color-${r}-text`]:`var(--mantine-color-${r}-4)`,[`--mantine-color-${r}-filled`]:`var(--mantine-color-${r}-${i})`,[`--mantine-color-${r}-filled-hover`]:`var(--mantine-color-${r}-${i===9?8:i+1})`,[`--mantine-color-${r}-light`]:la(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:la(e.colors[t][Math.max(0,i-2)],.2),[`--mantine-color-${r}-light-color`]:`var(--mantine-color-${r}-${Math.max(i-5,0)})`,[`--mantine-color-${r}-outline`]:`var(--mantine-color-${r}-${Math.max(i-4,0)})`,[`--mantine-color-${r}-outline-hover`]:la(e.colors[t][Math.max(i-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],...a}:a}function HD(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function ca(e,t,n){bt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const vj=e=>{const t=dc(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:U(e.defaultRadius),r={variables:{"--mantine-scale":e.scale.toString(),"--mantine-cursor-type":e.cursorType,"--mantine-color-scheme":"light dark","--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-primary-color-contrast":Z0(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)"},dark:{"--mantine-primary-color-contrast":Z0(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)"}};ca(r.variables,e.breakpoints,"breakpoint"),ca(r.variables,e.spacing,"spacing"),ca(r.variables,e.fontSizes,"font-size"),ca(r.variables,e.lineHeights,"line-height"),ca(r.variables,e.shadows,"shadow"),ca(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,a)=>{r.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${e.primaryColor}-${a})`}),bt(e.colors).forEach(i=>{const a=e.colors[i];if(HD(a)){Object.assign(r.light,Wu({theme:e,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Wu({theme:e,name:a.name,color:a.dark,colorScheme:"dark",withColorValues:!0}));return}a.forEach((l,c)=>{r.variables[`--mantine-color-${i}-${c}`]=l}),Object.assign(r.light,Wu({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Wu({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return bt(o).forEach(i=>{r.variables[`--mantine-${i}-font-size`]=o[i].fontSize,r.variables[`--mantine-${i}-line-height`]=o[i].lineHeight,r.variables[`--mantine-${i}-font-weight`]=o[i].fontWeight||e.headings.fontWeight}),r};function qD({theme:e,generator:t}){const n=vj(e),r=t==null?void 0:t(e);return r?nv(n,r):n}const gp=vj(uv);function GD(e){const t={variables:{},light:{},dark:{}};return bt(e.variables).forEach(n=>{gp.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),bt(e.light).forEach(n=>{gp.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),bt(e.dark).forEach(n=>{gp.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function QD(e){return`
|
|
58
|
-
${e}[data-mantine-color-scheme="dark"] { --mantine-color-scheme: dark; }
|
|
59
|
-
${e}[data-mantine-color-scheme="light"] { --mantine-color-scheme: light; }
|
|
60
|
-
`}function yj({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=At(),r=Vf(),o=ED(),i=qD({theme:n,generator:o}),a=e===":root"&&t,l=a?GD(i):i,c=WD(l,e);return c?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${a?"":QD(e)}`}}):null}yj.displayName="@mantine/CssVariables";function KD(){const e=console.error;console.error=(...t)=>{t.length>1&&typeof t[0]=="string"&&t[0].toLowerCase().includes("extra attributes from the server")&&typeof t[1]=="string"&&t[1].toLowerCase().includes("data-mantine-color-scheme")||e(...t)}}function ua(e,t){var r;const n=e!=="auto"?e:window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";(r=t())==null||r.setAttribute("data-mantine-color-scheme",n)}function YD({manager:e,defaultColorScheme:t,getRootElement:n,forceColorScheme:r}){const o=p.useRef(),[i,a]=p.useState(()=>e.get(t)),l=r||i,c=p.useCallback(d=>{r||(ua(d,n),a(d),e.set(d))},[e.set,l,r]),u=p.useCallback(()=>{a(t),ua(t,n),e.clear()},[e.clear,t]);return p.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),ul(()=>{ua(e.get(t),n)},[]),p.useEffect(()=>{var f;if(r)return ua(r,n),()=>{};r===void 0&&ua(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&ua(h.matches?"dark":"light",n)};return(f=o.current)==null||f.addEventListener("change",d),()=>{var h;return(h=o.current)==null?void 0:h.removeEventListener("change",d)}},[i,r]),{colorScheme:l,setColorScheme:c,clearColorScheme:u}}function XD({respectReducedMotion:e,getRootElement:t}){ul(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}KD();function xj({theme:e,children:t,getStyleNonce:n,withStaticClasses:r=!0,withGlobalClasses:o=!0,deduplicateCssVariables:i=!0,withCssVariables:a=!0,cssVariablesSelector:l=":root",classNamesPrefix:c="mantine",colorSchemeManager:u=FD(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:m,stylesTransform:g}){const{colorScheme:v,setColorScheme:S,clearColorScheme:b}=YD({defaultColorScheme:d,forceColorScheme:m,manager:u,getRootElement:f});return XD({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),s.jsx(lv.Provider,{value:{colorScheme:v,setColorScheme:S,clearColorScheme:b,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r,stylesTransform:g},children:s.jsxs(gj,{theme:e,children:[a&&s.jsx(yj,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&s.jsx(VD,{}),t]})})}xj.displayName="@mantine/core/MantineProvider";function Gc({classNames:e,styles:t,props:n,stylesCtx:r}){const o=At();return{resolvedClassNames:Uf({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:zd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const JD={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function ZD({theme:e,options:t,unstyled:n}){return tt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||JD[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function eI({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return Uf({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function e1({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return Uf({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function tI({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function nI({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function rI({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function oI({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var a,l;return(l=Uf({theme:t,classNames:(a=t.components[i])==null?void 0:a.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function iI({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function sI({theme:e,options:t,themeName:n,selector:r,classNamesPrefix:o,classNames:i,classes:a,unstyled:l,className:c,rootSelector:u,props:d,stylesCtx:f,withStaticClasses:h,headless:m,transformedStyles:g}){return tt(ZD({theme:e,options:t,unstyled:l||m}),oI({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),iI({options:t,classes:a,selector:r,unstyled:l}),e1({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),e1({selector:r,stylesCtx:f,theme:e,classNames:g,props:d}),eI({selector:r,stylesCtx:f,options:t,props:d,theme:e}),tI({rootSelector:u,selector:r,className:c}),nI({selector:r,classes:a,unstyled:l||m}),h&&!m&&rI({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function aI({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var a;return zd({theme:e,styles:(a=e.components[i])==null?void 0:a.styles,props:n,stylesCtx:r})[o]}).reduce((i,a)=>({...i,...a}),{})}function vm({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...vm({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function lI(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...Hi(n[r])}}),t),{})}function cI({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:a,headless:l}){var c;return(c=lI([l?{}:t==null?void 0:t(n,r,o),...a.map(u=>{var d,f,h;return(h=(f=(d=n.components)==null?void 0:d[u])==null?void 0:f.vars)==null?void 0:h.call(f,n,r,o)}),e==null?void 0:e(n,r,o)]))==null?void 0:c[i]}function uI({theme:e,themeName:t,selector:n,options:r,props:o,stylesCtx:i,rootSelector:a,styles:l,style:c,vars:u,varsResolver:d,headless:f,withStylesTransform:h}){return{...!h&&aI({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!h&&zd({theme:e,styles:l,props:o,stylesCtx:i})[n],...!h&&zd({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...cI({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...a===n?vm({style:c,theme:e}):null,...vm({style:r==null?void 0:r.style,theme:e})}}function dI({props:e,stylesCtx:t,themeName:n}){var a;const r=At(),o=(a=_D())==null?void 0:a();return{getTransformedStyles:l=>o?[...l.map(u=>o(u,{props:e,theme:r,ctx:t})),...n.map(u=>{var d;return o((d=r.components[u])==null?void 0:d.styles,{props:e,theme:r,ctx:t})})].filter(Boolean):[],withStylesTransform:!!o}}function he({name:e,classes:t,props:n,stylesCtx:r,className:o,style:i,rootSelector:a="root",unstyled:l,classNames:c,styles:u,vars:d,varsResolver:f}){const h=At(),m=TD(),g=PD(),v=kD(),S=(Array.isArray(e)?e:[e]).filter(y=>y),{withStylesTransform:b,getTransformedStyles:w}=dI({props:n,stylesCtx:r,themeName:S});return(y,x)=>({className:sI({theme:h,options:x,themeName:S,selector:y,classNamesPrefix:m,classNames:c,classes:t,unstyled:l,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:g,headless:v,transformedStyles:w([x==null?void 0:x.styles,u])}),style:uI({theme:h,themeName:S,selector:y,options:x,props:n,stylesCtx:r,rootSelector:a,styles:u,style:i,vars:d,varsResolver:f,headless:v,withStylesTransform:b})})}function $s(e,t){return typeof e=="boolean"?e:t.autoContrast}function t1(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 fI({keepTransitions:e}={}){const t=p.useRef(),n=p.useRef(),r=p.useContext(lv),o=Vf(),i=p.useRef(o==null?void 0:o());if(!r)throw new Error("[@mantine/core] MantineProvider was not found in tree");const a=f=>{r.setColorScheme(f),t.current=e?()=>{}:t1(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var h;(h=t.current)==null||h.call(t)},10)},l=()=>{r.clearColorScheme(),t.current=e?()=>{}:t1(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var f;(f=t.current)==null||f.call(t)},10)},c=iD("light",{getInitialValueInEffect:!1}),u=r.colorScheme==="auto"?c:r.colorScheme,d=p.useCallback(()=>a(u==="light"?"dark":"light"),[a,u]);return p.useEffect(()=>()=>{var f;(f=t.current)==null||f.call(t),window.clearTimeout(n.current)},[]),{colorScheme:r.colorScheme,setColorScheme:a,clearColorScheme:l,toggleColorScheme:d}}function V(e,t,n){var a;const r=At(),o=(a=r.components[e])==null?void 0:a.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...Hi(n)}}function vp(e){return bt(e).reduce((t,n)=>e[n]!==void 0?`${t}${q_(n)}:${e[n]};`:t,"").trim()}function hI({selector:e,styles:t,media:n,container:r}){const o=t?vp(t):"",i=Array.isArray(n)?n.map(l=>`@media${l.query}{${e}{${vp(l.styles)}}}`):[],a=Array.isArray(r)?r.map(l=>`@container ${l.query}{${e}{${vp(l.styles)}}}`):[];return`${o?`${e}{${o}}`:""}${i.join("")}${a.join("")}`.trim()}function Fs(e){const t=Vf();return s.jsx("style",{"data-mantine-styles":"inline",nonce:t==null?void 0:t(),dangerouslySetInnerHTML:{__html:hI(e)}})}function Yo(e){const{m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:v,pr:S,pe:b,ps:w,bd:y,bg:x,c:C,opacity:E,ff:T,fz:j,fw:R,lts:k,ta:I,lh:O,fs:F,tt:L,td:B,w:D,miw:_,maw:P,h:N,mih:$,mah:H,bgsz:X,bgp:ce,bgr:Ie,bga:ue,pos:xe,top:_e,left:de,bottom:Oe,right:Ye,inset:jt,display:mt,flex:at,hiddenFrom:Re,visibleFrom:et,lightHidden:ht,darkHidden:oe,sx:Q,...fe}=e;return{styleProps:Hi({m:t,mx:n,my:r,mt:o,mb:i,ml:a,mr:l,me:c,ms:u,p:d,px:f,py:h,pt:m,pb:g,pl:v,pr:S,pe:b,ps:w,bd:y,bg:x,c:C,opacity:E,ff:T,fz:j,fw:R,lts:k,ta:I,lh:O,fs:F,tt:L,td:B,w:D,miw:_,maw:P,h:N,mih:$,mah:H,bgsz:X,bgp:ce,bgr:Ie,bga:ue,pos:xe,top:_e,left:de,bottom:Oe,right:Ye,inset:jt,display:mt,flex:at,hiddenFrom:Re,visibleFrom:et,lightHidden:ht,darkHidden:oe,sx:Q}),rest:fe}}const pI={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"},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:"identity",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 fv(e,t){const n=Er({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 mI(e,t){const n=Er({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:fv(e,t)}function gI(e,t){if(typeof e=="number")return U(e);if(typeof e=="string"){const[n,r,...o]=e.split(" ").filter(a=>a.trim()!=="");let i=`${U(n)}`;return r&&(i+=` ${r}`),o.length>0&&(i+=` ${fv(o.join(" "),t)}`),i.trim()}return e}const n1={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 vI(e){return typeof e=="string"&&e in n1?n1[e]:e}const yI=["h1","h2","h3","h4","h5","h6"];function xI(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&yI.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?U(e):e}function bI(e){return e}const wI=["h1","h2","h3","h4","h5","h6"];function SI(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&wI.includes(e)?`var(--mantine-${e}-line-height)`:e}function jI(e){return typeof e=="number"?U(e):e}function CI(e,t){if(typeof e=="number")return U(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return U(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const yp={color:fv,textColor:mI,fontSize:xI,spacing:CI,identity:bI,size:jI,lineHeight:SI,fontFamily:vI,border:gI};function r1(e){return e.replace("(min-width: ","").replace("em)","")}function EI({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(r1(o))-Number(r1(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function TI(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function PI(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function kI(e){return typeof e=="object"&&e!==null?bt(e).filter(t=>t!=="base"):[]}function RI(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function bj({styleProps:e,data:t,theme:n}){return EI(bt(e).reduce((r,o)=>{if(o==="hiddenFrom"||o==="visibleFrom"||o==="sx")return r;const i=t[o],a=Array.isArray(i.property)?i.property:[i.property],l=PI(e[o]);if(!TI(e[o]))return a.forEach(u=>{r.inlineStyles[u]=yp[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=kI(e[o]);return a.forEach(u=>{l&&(r.styles[u]=yp[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:yp[i.type](RI(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Qc(){return`__m__-${p.useId().replace(/:/g,"")}`}function wj(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...wj(r,t)}),{}):typeof e=="function"?e(t):e??{}}function Sj(e){return e.startsWith("data-")?e:`data-${e}`}function _I(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[Sj(n)]=e[n]),t},{})}function jj(e){return e?typeof e=="string"?{[Sj(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,...jj(n)}),{}):_I(e):null}function ym(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...ym(r,t)}),{}):typeof e=="function"?e(t):e??{}}function DI({theme:e,style:t,vars:n,styleProps:r}){const o=ym(t,e),i=ym(n,e);return{...o,...i,...r}}const Cj=p.forwardRef(({component:e,style:t,__vars:n,className:r,variant:o,mod:i,size:a,hiddenFrom:l,visibleFrom:c,lightHidden:u,darkHidden:d,renderRoot:f,__size:h,...m},g)=>{var j;const v=At(),S=e||"div",{styleProps:b,rest:w}=Yo(m),y=RD(),x=(j=y==null?void 0:y())==null?void 0:j(b.sx),C=Qc(),E=bj({styleProps:b,theme:v,data:pI}),T={ref:g,style:DI({theme:v,style:t,vars:n,styleProps:E.inlineStyles}),className:tt(r,x,{[C]:E.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":oj(a)?void 0:a||void 0,size:h,...jj(i),...w};return s.jsxs(s.Fragment,{children:[E.hasResponsiveStyles&&s.jsx(Fs,{selector:`.${C}`,styles:E.styles,media:E.media}),typeof f=="function"?f(T):s.jsx(S,{...T})]})});Cj.displayName="@mantine/core/Box";const q=Cj;function Ej(e){return e}function Y(e){const t=p.forwardRef(e);return t.extend=Ej,t.withProps=n=>{const r=p.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t}function In(e){const t=p.forwardRef(e);return t.withProps=n=>{const r=p.forwardRef((o,i)=>s.jsx(t,{...n,...o,ref:i}));return r.extend=t.extend,r.displayName=`WithProps(${t.displayName})`,r},t.extend=Ej,t}const II=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function zs(){return p.useContext(II)}var Tj={exports:{}},pr={},Pj={exports:{}},kj={};/**
|
|
61
|
-
* @license React
|
|
62
|
-
* scheduler.production.min.js
|
|
63
|
-
*
|
|
64
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
65
|
-
*
|
|
66
|
-
* This source code is licensed under the MIT license found in the
|
|
67
|
-
* LICENSE file in the root directory of this source tree.
|
|
68
|
-
*/(function(e){function t(P,N){var $=P.length;P.push(N);e:for(;0<$;){var H=$-1>>>1,X=P[H];if(0<o(X,N))P[H]=N,P[$]=X,$=H;else break e}}function n(P){return P.length===0?null:P[0]}function r(P){if(P.length===0)return null;var N=P[0],$=P.pop();if($!==N){P[0]=$;e:for(var H=0,X=P.length,ce=X>>>1;H<ce;){var Ie=2*(H+1)-1,ue=P[Ie],xe=Ie+1,_e=P[xe];if(0>o(ue,$))xe<X&&0>o(_e,ue)?(P[H]=_e,P[xe]=$,H=xe):(P[H]=ue,P[Ie]=$,H=Ie);else if(xe<X&&0>o(_e,$))P[H]=_e,P[xe]=$,H=xe;else break e}}return N}function o(P,N){var $=P.sortIndex-N.sortIndex;return $!==0?$:P.id-N.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,l=a.now();e.unstable_now=function(){return a.now()-l}}var c=[],u=[],d=1,f=null,h=3,m=!1,g=!1,v=!1,S=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function y(P){for(var N=n(u);N!==null;){if(N.callback===null)r(u);else if(N.startTime<=P)r(u),N.sortIndex=N.expirationTime,t(c,N);else break;N=n(u)}}function x(P){if(v=!1,y(P),!g)if(n(c)!==null)g=!0,D(C);else{var N=n(u);N!==null&&_(x,N.startTime-P)}}function C(P,N){g=!1,v&&(v=!1,b(j),j=-1),m=!0;var $=h;try{for(y(N),f=n(c);f!==null&&(!(f.expirationTime>N)||P&&!I());){var H=f.callback;if(typeof H=="function"){f.callback=null,h=f.priorityLevel;var X=H(f.expirationTime<=N);N=e.unstable_now(),typeof X=="function"?f.callback=X:f===n(c)&&r(c),y(N)}else r(c);f=n(c)}if(f!==null)var ce=!0;else{var Ie=n(u);Ie!==null&&_(x,Ie.startTime-N),ce=!1}return ce}finally{f=null,h=$,m=!1}}var E=!1,T=null,j=-1,R=5,k=-1;function I(){return!(e.unstable_now()-k<R)}function O(){if(T!==null){var P=e.unstable_now();k=P;var N=!0;try{N=T(!0,P)}finally{N?F():(E=!1,T=null)}}else E=!1}var F;if(typeof w=="function")F=function(){w(O)};else if(typeof MessageChannel<"u"){var L=new MessageChannel,B=L.port2;L.port1.onmessage=O,F=function(){B.postMessage(null)}}else F=function(){S(O,0)};function D(P){T=P,E||(E=!0,F())}function _(P,N){j=S(function(){P(e.unstable_now())},N)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(P){P.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,D(C))},e.unstable_forceFrameRate=function(P){0>P||125<P?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<P?Math.floor(1e3/P):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(P){switch(h){case 1:case 2:case 3:var N=3;break;default:N=h}var $=h;h=N;try{return P()}finally{h=$}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(P,N){switch(P){case 1:case 2:case 3:case 4:case 5:break;default:P=3}var $=h;h=P;try{return N()}finally{h=$}},e.unstable_scheduleCallback=function(P,N,$){var H=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?H+$:H):$=H,P){case 1:var X=-1;break;case 2:X=250;break;case 5:X=1073741823;break;case 4:X=1e4;break;default:X=5e3}return X=$+X,P={id:d++,callback:N,priorityLevel:P,startTime:$,expirationTime:X,sortIndex:-1},$>H?(P.sortIndex=$,t(u,P),n(c)===null&&P===n(u)&&(v?(b(j),j=-1):v=!0,_(x,$-H))):(P.sortIndex=X,t(c,P),g||m||(g=!0,D(C))),P},e.unstable_shouldYield=I,e.unstable_wrapCallback=function(P){var N=h;return function(){var $=h;h=N;try{return P.apply(this,arguments)}finally{h=$}}}})(kj);Pj.exports=kj;var AI=Pj.exports;/**
|
|
69
|
-
* @license React
|
|
70
|
-
* react-dom.production.min.js
|
|
71
|
-
*
|
|
72
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
73
|
-
*
|
|
74
|
-
* This source code is licensed under the MIT license found in the
|
|
75
|
-
* LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/var Rj=p,dr=AI;function ee(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var _j=new Set,fc={};function Bs(e,t){qa(e,t),qa(e+"Capture",t)}function qa(e,t){for(fc[e]=t,e=0;e<t.length;e++)_j.add(t[e])}var $o=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xm=Object.prototype.hasOwnProperty,NI=/^[: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]*$/,o1={},i1={};function MI(e){return xm.call(i1,e)?!0:xm.call(o1,e)?!1:NI.test(e)?i1[e]=!0:(o1[e]=!0,!1)}function OI(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function LI(e,t,n,r){if(t===null||typeof t>"u"||OI(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Wn(e,t,n,r,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var wn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){wn[e]=new Wn(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];wn[t]=new Wn(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){wn[e]=new Wn(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){wn[e]=new Wn(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){wn[e]=new Wn(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){wn[e]=new Wn(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){wn[e]=new Wn(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){wn[e]=new Wn(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){wn[e]=new Wn(e,5,!1,e.toLowerCase(),null,!1,!1)});var hv=/[\-:]([a-z])/g;function pv(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(hv,pv);wn[t]=new Wn(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(hv,pv);wn[t]=new Wn(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(hv,pv);wn[t]=new Wn(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){wn[e]=new Wn(e,1,!1,e.toLowerCase(),null,!1,!1)});wn.xlinkHref=new Wn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){wn[e]=new Wn(e,1,!1,e.toLowerCase(),null,!0,!0)});function mv(e,t,n,r){var o=wn.hasOwnProperty(t)?wn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(LI(t,n,o,r)&&(n=null),r||o===null?MI(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var Xo=Rj.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Hu=Symbol.for("react.element"),xa=Symbol.for("react.portal"),ba=Symbol.for("react.fragment"),gv=Symbol.for("react.strict_mode"),bm=Symbol.for("react.profiler"),Dj=Symbol.for("react.provider"),Ij=Symbol.for("react.context"),vv=Symbol.for("react.forward_ref"),wm=Symbol.for("react.suspense"),Sm=Symbol.for("react.suspense_list"),yv=Symbol.for("react.memo"),mi=Symbol.for("react.lazy"),Aj=Symbol.for("react.offscreen"),s1=Symbol.iterator;function Il(e){return e===null||typeof e!="object"?null:(e=s1&&e[s1]||e["@@iterator"],typeof e=="function"?e:null)}var zt=Object.assign,xp;function ql(e){if(xp===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);xp=t&&t[1]||""}return`
|
|
77
|
-
`+xp+e}var bp=!1;function wp(e,t){if(!e||bp)return"";bp=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
|
|
78
|
-
`),i=r.stack.split(`
|
|
79
|
-
`),a=o.length-1,l=i.length-1;1<=a&&0<=l&&o[a]!==i[l];)l--;for(;1<=a&&0<=l;a--,l--)if(o[a]!==i[l]){if(a!==1||l!==1)do if(a--,l--,0>l||o[a]!==i[l]){var c=`
|
|
80
|
-
`+o[a].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=a&&0<=l);break}}}finally{bp=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?ql(e):""}function $I(e){switch(e.tag){case 5:return ql(e.type);case 16:return ql("Lazy");case 13:return ql("Suspense");case 19:return ql("SuspenseList");case 0:case 2:case 15:return e=wp(e.type,!1),e;case 11:return e=wp(e.type.render,!1),e;case 1:return e=wp(e.type,!0),e;default:return""}}function jm(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ba:return"Fragment";case xa:return"Portal";case bm:return"Profiler";case gv:return"StrictMode";case wm:return"Suspense";case Sm:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Ij:return(e.displayName||"Context")+".Consumer";case Dj:return(e._context.displayName||"Context")+".Provider";case vv:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case yv:return t=e.displayName||null,t!==null?t:jm(e.type)||"Memo";case mi:t=e._payload,e=e._init;try{return jm(e(t))}catch{}}return null}function FI(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return jm(t);case 8:return t===gv?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function $i(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Nj(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function zI(e){var t=Nj(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){r=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(a){r=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function qu(e){e._valueTracker||(e._valueTracker=zI(e))}function Mj(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Nj(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Bd(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Cm(e,t){var n=t.checked;return zt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function a1(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=$i(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function Oj(e,t){t=t.checked,t!=null&&mv(e,"checked",t,!1)}function Em(e,t){Oj(e,t);var n=$i(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Tm(e,t.type,n):t.hasOwnProperty("defaultValue")&&Tm(e,t.type,$i(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function l1(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function Tm(e,t,n){(t!=="number"||Bd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var Gl=Array.isArray;function Oa(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+$i(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Pm(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(ee(91));return zt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function c1(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(ee(92));if(Gl(n)){if(1<n.length)throw Error(ee(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:$i(n)}}function Lj(e,t){var n=$i(t.value),r=$i(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function u1(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function $j(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function km(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?$j(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Gu,Fj=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Gu=Gu||document.createElement("div"),Gu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Gu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function hc(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Zl={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},BI=["Webkit","ms","Moz","O"];Object.keys(Zl).forEach(function(e){BI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Zl[t]=Zl[e]})});function zj(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Zl.hasOwnProperty(e)&&Zl[e]?(""+t).trim():t+"px"}function Bj(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=zj(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var UI=zt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Rm(e,t){if(t){if(UI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(ee(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(ee(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(ee(61))}if(t.style!=null&&typeof t.style!="object")throw Error(ee(62))}}function _m(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Dm=null;function xv(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Im=null,La=null,$a=null;function d1(e){if(e=Xc(e)){if(typeof Im!="function")throw Error(ee(280));var t=e.stateNode;t&&(t=Qf(t),Im(e.stateNode,e.type,t))}}function Uj(e){La?$a?$a.push(e):$a=[e]:La=e}function Vj(){if(La){var e=La,t=$a;if($a=La=null,d1(e),t)for(e=0;e<t.length;e++)d1(t[e])}}function Wj(e,t){return e(t)}function Hj(){}var Sp=!1;function qj(e,t,n){if(Sp)return e(t,n);Sp=!0;try{return Wj(e,t,n)}finally{Sp=!1,(La!==null||$a!==null)&&(Hj(),Vj())}}function pc(e,t){var n=e.stateNode;if(n===null)return null;var r=Qf(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(ee(231,t,typeof n));return n}var Am=!1;if($o)try{var Al={};Object.defineProperty(Al,"passive",{get:function(){Am=!0}}),window.addEventListener("test",Al,Al),window.removeEventListener("test",Al,Al)}catch{Am=!1}function VI(e,t,n,r,o,i,a,l,c){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(d){this.onError(d)}}var ec=!1,Ud=null,Vd=!1,Nm=null,WI={onError:function(e){ec=!0,Ud=e}};function HI(e,t,n,r,o,i,a,l,c){ec=!1,Ud=null,VI.apply(WI,arguments)}function qI(e,t,n,r,o,i,a,l,c){if(HI.apply(this,arguments),ec){if(ec){var u=Ud;ec=!1,Ud=null}else throw Error(ee(198));Vd||(Vd=!0,Nm=u)}}function Us(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Gj(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function f1(e){if(Us(e)!==e)throw Error(ee(188))}function GI(e){var t=e.alternate;if(!t){if(t=Us(e),t===null)throw Error(ee(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return f1(o),e;if(i===r)return f1(o),t;i=i.sibling}throw Error(ee(188))}if(n.return!==r.return)n=o,r=i;else{for(var a=!1,l=o.child;l;){if(l===n){a=!0,n=o,r=i;break}if(l===r){a=!0,r=o,n=i;break}l=l.sibling}if(!a){for(l=i.child;l;){if(l===n){a=!0,n=i,r=o;break}if(l===r){a=!0,r=i,n=o;break}l=l.sibling}if(!a)throw Error(ee(189))}}if(n.alternate!==r)throw Error(ee(190))}if(n.tag!==3)throw Error(ee(188));return n.stateNode.current===n?e:t}function Qj(e){return e=GI(e),e!==null?Kj(e):null}function Kj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Kj(e);if(t!==null)return t;e=e.sibling}return null}var Yj=dr.unstable_scheduleCallback,h1=dr.unstable_cancelCallback,QI=dr.unstable_shouldYield,KI=dr.unstable_requestPaint,Kt=dr.unstable_now,YI=dr.unstable_getCurrentPriorityLevel,bv=dr.unstable_ImmediatePriority,Xj=dr.unstable_UserBlockingPriority,Wd=dr.unstable_NormalPriority,XI=dr.unstable_LowPriority,Jj=dr.unstable_IdlePriority,Wf=null,uo=null;function JI(e){if(uo&&typeof uo.onCommitFiberRoot=="function")try{uo.onCommitFiberRoot(Wf,e,void 0,(e.current.flags&128)===128)}catch{}}var Vr=Math.clz32?Math.clz32:tA,ZI=Math.log,eA=Math.LN2;function tA(e){return e>>>=0,e===0?32:31-(ZI(e)/eA|0)|0}var Qu=64,Ku=4194304;function Ql(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Hd(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,a=n&268435455;if(a!==0){var l=a&~o;l!==0?r=Ql(l):(i&=a,i!==0&&(r=Ql(i)))}else a=n&~o,a!==0?r=Ql(a):i!==0&&(r=Ql(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-Vr(t),o=1<<n,r|=e[n],t&=~o;return r}function nA(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function rA(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-Vr(i),l=1<<a,c=o[a];c===-1?(!(l&n)||l&r)&&(o[a]=nA(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Mm(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Zj(){var e=Qu;return Qu<<=1,!(Qu&4194240)&&(Qu=64),e}function jp(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Kc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Vr(t),e[t]=n}function oA(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-Vr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function wv(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Vr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var dt=0;function eC(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var tC,Sv,nC,rC,oC,Om=!1,Yu=[],ki=null,Ri=null,_i=null,mc=new Map,gc=new Map,wi=[],iA="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 submit".split(" ");function p1(e,t){switch(e){case"focusin":case"focusout":ki=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":_i=null;break;case"pointerover":case"pointerout":mc.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":gc.delete(t.pointerId)}}function Nl(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Xc(t),t!==null&&Sv(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function sA(e,t,n,r,o){switch(t){case"focusin":return ki=Nl(ki,e,t,n,r,o),!0;case"dragenter":return Ri=Nl(Ri,e,t,n,r,o),!0;case"mouseover":return _i=Nl(_i,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return mc.set(i,Nl(mc.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,gc.set(i,Nl(gc.get(i)||null,e,t,n,r,o)),!0}return!1}function iC(e){var t=hs(e.target);if(t!==null){var n=Us(t);if(n!==null){if(t=n.tag,t===13){if(t=Gj(n),t!==null){e.blockedOn=t,oC(e.priority,function(){nC(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Sd(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Lm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Dm=r,n.target.dispatchEvent(r),Dm=null}else return t=Xc(n),t!==null&&Sv(t),e.blockedOn=n,!1;t.shift()}return!0}function m1(e,t,n){Sd(e)&&n.delete(t)}function aA(){Om=!1,ki!==null&&Sd(ki)&&(ki=null),Ri!==null&&Sd(Ri)&&(Ri=null),_i!==null&&Sd(_i)&&(_i=null),mc.forEach(m1),gc.forEach(m1)}function Ml(e,t){e.blockedOn===t&&(e.blockedOn=null,Om||(Om=!0,dr.unstable_scheduleCallback(dr.unstable_NormalPriority,aA)))}function vc(e){function t(o){return Ml(o,e)}if(0<Yu.length){Ml(Yu[0],e);for(var n=1;n<Yu.length;n++){var r=Yu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(ki!==null&&Ml(ki,e),Ri!==null&&Ml(Ri,e),_i!==null&&Ml(_i,e),mc.forEach(t),gc.forEach(t),n=0;n<wi.length;n++)r=wi[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<wi.length&&(n=wi[0],n.blockedOn===null);)iC(n),n.blockedOn===null&&wi.shift()}var Fa=Xo.ReactCurrentBatchConfig,qd=!0;function lA(e,t,n,r){var o=dt,i=Fa.transition;Fa.transition=null;try{dt=1,jv(e,t,n,r)}finally{dt=o,Fa.transition=i}}function cA(e,t,n,r){var o=dt,i=Fa.transition;Fa.transition=null;try{dt=4,jv(e,t,n,r)}finally{dt=o,Fa.transition=i}}function jv(e,t,n,r){if(qd){var o=Lm(e,t,n,r);if(o===null)Ap(e,t,r,Gd,n),p1(e,r);else if(sA(o,e,t,n,r))r.stopPropagation();else if(p1(e,r),t&4&&-1<iA.indexOf(e)){for(;o!==null;){var i=Xc(o);if(i!==null&&tC(i),i=Lm(e,t,n,r),i===null&&Ap(e,t,r,Gd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Ap(e,t,r,null,n)}}var Gd=null;function Lm(e,t,n,r){if(Gd=null,e=xv(r),e=hs(e),e!==null)if(t=Us(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Gj(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Gd=e,null}function sC(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(YI()){case bv:return 1;case Xj:return 4;case Wd:case XI:return 16;case Jj:return 536870912;default:return 16}default:return 16}}var Ei=null,Cv=null,jd=null;function aC(){if(jd)return jd;var e,t=Cv,n=t.length,r,o="value"in Ei?Ei.value:Ei.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var a=n-e;for(r=1;r<=a&&t[n-r]===o[i-r];r++);return jd=o.slice(e,1<r?1-r:void 0)}function Cd(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Xu(){return!0}function g1(){return!1}function mr(e){function t(n,r,o,i,a){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Xu:g1,this.isPropagationStopped=g1,this}return zt(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Xu)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Xu)},persist:function(){},isPersistent:Xu}),t}var dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ev=mr(dl),Yc=zt({},dl,{view:0,detail:0}),uA=mr(Yc),Cp,Ep,Ol,Hf=zt({},Yc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Tv,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Ol&&(Ol&&e.type==="mousemove"?(Cp=e.screenX-Ol.screenX,Ep=e.screenY-Ol.screenY):Ep=Cp=0,Ol=e),Cp)},movementY:function(e){return"movementY"in e?e.movementY:Ep}}),v1=mr(Hf),dA=zt({},Hf,{dataTransfer:0}),fA=mr(dA),hA=zt({},Yc,{relatedTarget:0}),Tp=mr(hA),pA=zt({},dl,{animationName:0,elapsedTime:0,pseudoElement:0}),mA=mr(pA),gA=zt({},dl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vA=mr(gA),yA=zt({},dl,{data:0}),y1=mr(yA),xA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},bA={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"},wA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function SA(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=wA[e])?!!t[e]:!1}function Tv(){return SA}var jA=zt({},Yc,{key:function(e){if(e.key){var t=xA[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Cd(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?bA[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Tv,charCode:function(e){return e.type==="keypress"?Cd(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Cd(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),CA=mr(jA),EA=zt({},Hf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),x1=mr(EA),TA=zt({},Yc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Tv}),PA=mr(TA),kA=zt({},dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),RA=mr(kA),_A=zt({},Hf,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),DA=mr(_A),IA=[9,13,27,32],Pv=$o&&"CompositionEvent"in window,tc=null;$o&&"documentMode"in document&&(tc=document.documentMode);var AA=$o&&"TextEvent"in window&&!tc,lC=$o&&(!Pv||tc&&8<tc&&11>=tc),b1=" ",w1=!1;function cC(e,t){switch(e){case"keyup":return IA.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uC(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var wa=!1;function NA(e,t){switch(e){case"compositionend":return uC(t);case"keypress":return t.which!==32?null:(w1=!0,b1);case"textInput":return e=t.data,e===b1&&w1?null:e;default:return null}}function MA(e,t){if(wa)return e==="compositionend"||!Pv&&cC(e,t)?(e=aC(),jd=Cv=Ei=null,wa=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return lC&&t.locale!=="ko"?null:t.data;default:return null}}var OA={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(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!OA[e.type]:t==="textarea"}function dC(e,t,n,r){Uj(r),t=Qd(t,"onChange"),0<t.length&&(n=new Ev("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var nc=null,yc=null;function LA(e){SC(e,0)}function qf(e){var t=Ca(e);if(Mj(t))return e}function $A(e,t){if(e==="change")return t}var fC=!1;if($o){var Pp;if($o){var kp="oninput"in document;if(!kp){var j1=document.createElement("div");j1.setAttribute("oninput","return;"),kp=typeof j1.oninput=="function"}Pp=kp}else Pp=!1;fC=Pp&&(!document.documentMode||9<document.documentMode)}function C1(){nc&&(nc.detachEvent("onpropertychange",hC),yc=nc=null)}function hC(e){if(e.propertyName==="value"&&qf(yc)){var t=[];dC(t,yc,e,xv(e)),qj(LA,t)}}function FA(e,t,n){e==="focusin"?(C1(),nc=t,yc=n,nc.attachEvent("onpropertychange",hC)):e==="focusout"&&C1()}function zA(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qf(yc)}function BA(e,t){if(e==="click")return qf(t)}function UA(e,t){if(e==="input"||e==="change")return qf(t)}function VA(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var qr=typeof Object.is=="function"?Object.is:VA;function xc(e,t){if(qr(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!xm.call(t,o)||!qr(e[o],t[o]))return!1}return!0}function E1(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function T1(e,t){var n=E1(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=E1(n)}}function pC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?pC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mC(){for(var e=window,t=Bd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Bd(e.document)}return t}function kv(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function WA(e){var t=mC(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&pC(n.ownerDocument.documentElement,n)){if(r!==null&&kv(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=T1(n,i);var a=T1(n,r);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var HA=$o&&"documentMode"in document&&11>=document.documentMode,Sa=null,$m=null,rc=null,Fm=!1;function P1(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Fm||Sa==null||Sa!==Bd(r)||(r=Sa,"selectionStart"in r&&kv(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),rc&&xc(rc,r)||(rc=r,r=Qd($m,"onSelect"),0<r.length&&(t=new Ev("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=Sa)))}function Ju(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ja={animationend:Ju("Animation","AnimationEnd"),animationiteration:Ju("Animation","AnimationIteration"),animationstart:Ju("Animation","AnimationStart"),transitionend:Ju("Transition","TransitionEnd")},Rp={},gC={};$o&&(gC=document.createElement("div").style,"AnimationEvent"in window||(delete ja.animationend.animation,delete ja.animationiteration.animation,delete ja.animationstart.animation),"TransitionEvent"in window||delete ja.transitionend.transition);function Gf(e){if(Rp[e])return Rp[e];if(!ja[e])return e;var t=ja[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in gC)return Rp[e]=t[n];return e}var vC=Gf("animationend"),yC=Gf("animationiteration"),xC=Gf("animationstart"),bC=Gf("transitionend"),wC=new Map,k1="abort auxClick 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(" ");function Gi(e,t){wC.set(e,t),Bs(t,[e])}for(var _p=0;_p<k1.length;_p++){var Dp=k1[_p],qA=Dp.toLowerCase(),GA=Dp[0].toUpperCase()+Dp.slice(1);Gi(qA,"on"+GA)}Gi(vC,"onAnimationEnd");Gi(yC,"onAnimationIteration");Gi(xC,"onAnimationStart");Gi("dblclick","onDoubleClick");Gi("focusin","onFocus");Gi("focusout","onBlur");Gi(bC,"onTransitionEnd");qa("onMouseEnter",["mouseout","mouseover"]);qa("onMouseLeave",["mouseout","mouseover"]);qa("onPointerEnter",["pointerout","pointerover"]);qa("onPointerLeave",["pointerout","pointerover"]);Bs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Bs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Bs("onBeforeInput",["compositionend","keypress","textInput","paste"]);Bs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Bs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Kl="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(" "),QA=new Set("cancel close invalid load scroll toggle".split(" ").concat(Kl));function R1(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,qI(r,t,void 0,e),e.currentTarget=null}function SC(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var a=r.length-1;0<=a;a--){var l=r[a],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&o.isPropagationStopped())break e;R1(o,l,u),i=c}else for(a=0;a<r.length;a++){if(l=r[a],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&o.isPropagationStopped())break e;R1(o,l,u),i=c}}}if(Vd)throw e=Nm,Vd=!1,Nm=null,e}function kt(e,t){var n=t[Wm];n===void 0&&(n=t[Wm]=new Set);var r=e+"__bubble";n.has(r)||(jC(t,e,2,!1),n.add(r))}function Ip(e,t,n){var r=0;t&&(r|=4),jC(n,e,r,t)}var Zu="_reactListening"+Math.random().toString(36).slice(2);function bc(e){if(!e[Zu]){e[Zu]=!0,_j.forEach(function(n){n!=="selectionchange"&&(QA.has(n)||Ip(n,!1,e),Ip(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Zu]||(t[Zu]=!0,Ip("selectionchange",!1,t))}}function jC(e,t,n,r){switch(sC(t)){case 1:var o=lA;break;case 4:o=cA;break;default:o=jv}n=o.bind(null,t,n,e),o=void 0,!Am||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function Ap(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var a=r.tag;if(a===3||a===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(a===4)for(a=r.return;a!==null;){var c=a.tag;if((c===3||c===4)&&(c=a.stateNode.containerInfo,c===o||c.nodeType===8&&c.parentNode===o))return;a=a.return}for(;l!==null;){if(a=hs(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}qj(function(){var u=i,d=xv(n),f=[];e:{var h=wC.get(e);if(h!==void 0){var m=Ev,g=e;switch(e){case"keypress":if(Cd(n)===0)break e;case"keydown":case"keyup":m=CA;break;case"focusin":g="focus",m=Tp;break;case"focusout":g="blur",m=Tp;break;case"beforeblur":case"afterblur":m=Tp;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":m=v1;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=fA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=PA;break;case vC:case yC:case xC:m=mA;break;case bC:m=RA;break;case"scroll":m=uA;break;case"wheel":m=DA;break;case"copy":case"cut":case"paste":m=vA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=x1}var v=(t&4)!==0,S=!v&&e==="scroll",b=v?h!==null?h+"Capture":null:h;v=[];for(var w=u,y;w!==null;){y=w;var x=y.stateNode;if(y.tag===5&&x!==null&&(y=x,b!==null&&(x=pc(w,b),x!=null&&v.push(wc(w,x,y)))),S)break;w=w.return}0<v.length&&(h=new m(h,g,null,n,d),f.push({event:h,listeners:v}))}}if(!(t&7)){e:{if(h=e==="mouseover"||e==="pointerover",m=e==="mouseout"||e==="pointerout",h&&n!==Dm&&(g=n.relatedTarget||n.fromElement)&&(hs(g)||g[Fo]))break e;if((m||h)&&(h=d.window===d?d:(h=d.ownerDocument)?h.defaultView||h.parentWindow:window,m?(g=n.relatedTarget||n.toElement,m=u,g=g?hs(g):null,g!==null&&(S=Us(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=v1,x="onMouseLeave",b="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=x1,x="onPointerLeave",b="onPointerEnter",w="pointer"),S=m==null?h:Ca(m),y=g==null?h:Ca(g),h=new v(x,w+"leave",m,n,d),h.target=S,h.relatedTarget=y,x=null,hs(d)===u&&(v=new v(b,w+"enter",g,n,d),v.target=y,v.relatedTarget=S,x=v),S=x,m&&g)t:{for(v=m,b=g,w=0,y=v;y;y=da(y))w++;for(y=0,x=b;x;x=da(x))y++;for(;0<w-y;)v=da(v),w--;for(;0<y-w;)b=da(b),y--;for(;w--;){if(v===b||b!==null&&v===b.alternate)break t;v=da(v),b=da(b)}v=null}else v=null;m!==null&&_1(f,h,m,v,!1),g!==null&&S!==null&&_1(f,S,g,v,!0)}}e:{if(h=u?Ca(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var C=$A;else if(S1(h))if(fC)C=UA;else{C=zA;var E=FA}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=BA);if(C&&(C=C(e,u))){dC(f,C,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Tm(h,"number",h.value)}switch(E=u?Ca(u):window,e){case"focusin":(S1(E)||E.contentEditable==="true")&&(Sa=E,$m=u,rc=null);break;case"focusout":rc=$m=Sa=null;break;case"mousedown":Fm=!0;break;case"contextmenu":case"mouseup":case"dragend":Fm=!1,P1(f,n,d);break;case"selectionchange":if(HA)break;case"keydown":case"keyup":P1(f,n,d)}var T;if(Pv)e:{switch(e){case"compositionstart":var j="onCompositionStart";break e;case"compositionend":j="onCompositionEnd";break e;case"compositionupdate":j="onCompositionUpdate";break e}j=void 0}else wa?cC(e,n)&&(j="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(j="onCompositionStart");j&&(lC&&n.locale!=="ko"&&(wa||j!=="onCompositionStart"?j==="onCompositionEnd"&&wa&&(T=aC()):(Ei=d,Cv="value"in Ei?Ei.value:Ei.textContent,wa=!0)),E=Qd(u,j),0<E.length&&(j=new y1(j,e,null,n,d),f.push({event:j,listeners:E}),T?j.data=T:(T=uC(n),T!==null&&(j.data=T)))),(T=AA?NA(e,n):MA(e,n))&&(u=Qd(u,"onBeforeInput"),0<u.length&&(d=new y1("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=T))}SC(f,t)})}function wc(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Qd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=pc(e,n),i!=null&&r.unshift(wc(e,i,o)),i=pc(e,t),i!=null&&r.push(wc(e,i,o))),e=e.return}return r}function da(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function _1(e,t,n,r,o){for(var i=t._reactName,a=[];n!==null&&n!==r;){var l=n,c=l.alternate,u=l.stateNode;if(c!==null&&c===r)break;l.tag===5&&u!==null&&(l=u,o?(c=pc(n,i),c!=null&&a.unshift(wc(n,c,l))):o||(c=pc(n,i),c!=null&&a.push(wc(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var KA=/\r\n?/g,YA=/\u0000|\uFFFD/g;function D1(e){return(typeof e=="string"?e:""+e).replace(KA,`
|
|
81
|
-
`).replace(YA,"")}function ed(e,t,n){if(t=D1(t),D1(e)!==t&&n)throw Error(ee(425))}function Kd(){}var zm=null,Bm=null;function Um(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Vm=typeof setTimeout=="function"?setTimeout:void 0,XA=typeof clearTimeout=="function"?clearTimeout:void 0,I1=typeof Promise=="function"?Promise:void 0,JA=typeof queueMicrotask=="function"?queueMicrotask:typeof I1<"u"?function(e){return I1.resolve(null).then(e).catch(ZA)}:Vm;function ZA(e){setTimeout(function(){throw e})}function Np(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),vc(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);vc(t)}function Di(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function A1(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var fl=Math.random().toString(36).slice(2),co="__reactFiber$"+fl,Sc="__reactProps$"+fl,Fo="__reactContainer$"+fl,Wm="__reactEvents$"+fl,eN="__reactListeners$"+fl,tN="__reactHandles$"+fl;function hs(e){var t=e[co];if(t)return t;for(var n=e.parentNode;n;){if(t=n[Fo]||n[co]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=A1(e);e!==null;){if(n=e[co])return n;e=A1(e)}return t}e=n,n=e.parentNode}return null}function Xc(e){return e=e[co]||e[Fo],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Ca(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(ee(33))}function Qf(e){return e[Sc]||null}var Hm=[],Ea=-1;function Qi(e){return{current:e}}function Dt(e){0>Ea||(e.current=Hm[Ea],Hm[Ea]=null,Ea--)}function Et(e,t){Ea++,Hm[Ea]=e.current,e.current=t}var Fi={},_n=Qi(Fi),Qn=Qi(!1),Ss=Fi;function Ga(e,t){var n=e.type.contextTypes;if(!n)return Fi;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Kn(e){return e=e.childContextTypes,e!=null}function Yd(){Dt(Qn),Dt(_n)}function N1(e,t,n){if(_n.current!==Fi)throw Error(ee(168));Et(_n,t),Et(Qn,n)}function CC(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(ee(108,FI(e)||"Unknown",o));return zt({},n,r)}function Xd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Fi,Ss=_n.current,Et(_n,e),Et(Qn,Qn.current),!0}function M1(e,t,n){var r=e.stateNode;if(!r)throw Error(ee(169));n?(e=CC(e,t,Ss),r.__reactInternalMemoizedMergedChildContext=e,Dt(Qn),Dt(_n),Et(_n,e)):Dt(Qn),Et(Qn,n)}var Ro=null,Kf=!1,Mp=!1;function EC(e){Ro===null?Ro=[e]:Ro.push(e)}function nN(e){Kf=!0,EC(e)}function Ki(){if(!Mp&&Ro!==null){Mp=!0;var e=0,t=dt;try{var n=Ro;for(dt=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}Ro=null,Kf=!1}catch(o){throw Ro!==null&&(Ro=Ro.slice(e+1)),Yj(bv,Ki),o}finally{dt=t,Mp=!1}}return null}var Ta=[],Pa=0,Jd=null,Zd=0,br=[],wr=0,js=null,Do=1,Io="";function is(e,t){Ta[Pa++]=Zd,Ta[Pa++]=Jd,Jd=e,Zd=t}function TC(e,t,n){br[wr++]=Do,br[wr++]=Io,br[wr++]=js,js=e;var r=Do;e=Io;var o=32-Vr(r)-1;r&=~(1<<o),n+=1;var i=32-Vr(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,Do=1<<32-Vr(t)+o|n<<o|r,Io=i+e}else Do=1<<i|n<<o|r,Io=e}function Rv(e){e.return!==null&&(is(e,1),TC(e,1,0))}function _v(e){for(;e===Jd;)Jd=Ta[--Pa],Ta[Pa]=null,Zd=Ta[--Pa],Ta[Pa]=null;for(;e===js;)js=br[--wr],br[wr]=null,Io=br[--wr],br[wr]=null,Do=br[--wr],br[wr]=null}var ur=null,lr=null,Nt=!1,zr=null;function PC(e,t){var n=Sr(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function O1(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ur=e,lr=Di(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ur=e,lr=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=js!==null?{id:Do,overflow:Io}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Sr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ur=e,lr=null,!0):!1;default:return!1}}function qm(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Gm(e){if(Nt){var t=lr;if(t){var n=t;if(!O1(e,t)){if(qm(e))throw Error(ee(418));t=Di(n.nextSibling);var r=ur;t&&O1(e,t)?PC(r,n):(e.flags=e.flags&-4097|2,Nt=!1,ur=e)}}else{if(qm(e))throw Error(ee(418));e.flags=e.flags&-4097|2,Nt=!1,ur=e}}}function L1(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ur=e}function td(e){if(e!==ur)return!1;if(!Nt)return L1(e),Nt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!Um(e.type,e.memoizedProps)),t&&(t=lr)){if(qm(e))throw kC(),Error(ee(418));for(;t;)PC(e,t),t=Di(t.nextSibling)}if(L1(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(ee(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){lr=Di(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}lr=null}}else lr=ur?Di(e.stateNode.nextSibling):null;return!0}function kC(){for(var e=lr;e;)e=Di(e.nextSibling)}function Qa(){lr=ur=null,Nt=!1}function Dv(e){zr===null?zr=[e]:zr.push(e)}var rN=Xo.ReactCurrentBatchConfig;function Lr(e,t){if(e&&e.defaultProps){t=zt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var ef=Qi(null),tf=null,ka=null,Iv=null;function Av(){Iv=ka=tf=null}function Nv(e){var t=ef.current;Dt(ef),e._currentValue=t}function Qm(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function za(e,t){tf=e,Iv=ka=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Gn=!0),e.firstContext=null)}function Tr(e){var t=e._currentValue;if(Iv!==e)if(e={context:e,memoizedValue:t,next:null},ka===null){if(tf===null)throw Error(ee(308));ka=e,tf.dependencies={lanes:0,firstContext:e}}else ka=ka.next=e;return t}var ps=null;function Mv(e){ps===null?ps=[e]:ps.push(e)}function RC(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Mv(t)):(n.next=o.next,o.next=n),t.interleaved=n,zo(e,r)}function zo(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var gi=!1;function Ov(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _C(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function No(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Ii(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,Ze&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,zo(e,n)}return o=r.interleaved,o===null?(t.next=t,Mv(r)):(t.next=o.next,o.next=t),r.interleaved=t,zo(e,n)}function Ed(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wv(e,n)}}function $1(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var a={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=a:i=i.next=a,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function nf(e,t,n,r){var o=e.updateQueue;gi=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var c=l,u=c.next;c.next=null,a===null?i=u:a.next=u,a=c;var d=e.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==a&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var f=o.baseState;a=0,d=u=c=null,l=i;do{var h=l.lane,m=l.eventTime;if((r&h)===h){d!==null&&(d=d.next={eventTime:m,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var g=e,v=l;switch(h=t,m=n,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(m,f,h);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,h=typeof g=="function"?g.call(m,f,h):g,h==null)break e;f=zt({},f,h);break e;case 2:gi=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,h=o.effects,h===null?o.effects=[l]:h.push(l))}else m={eventTime:m,lane:h,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=m,c=f):d=d.next=m,a|=h;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;h=l,l=h.next,h.next=null,o.lastBaseUpdate=h,o.shared.pending=null}}while(!0);if(d===null&&(c=f),o.baseState=c,o.firstBaseUpdate=u,o.lastBaseUpdate=d,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);Es|=a,e.lanes=a,e.memoizedState=f}}function F1(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(ee(191,o));o.call(r)}}}var DC=new Rj.Component().refs;function Km(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:zt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Yf={isMounted:function(e){return(e=e._reactInternals)?Us(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Fn(),o=Ni(e),i=No(r,o);i.payload=t,n!=null&&(i.callback=n),t=Ii(e,i,o),t!==null&&(Wr(t,e,o,r),Ed(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Fn(),o=Ni(e),i=No(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ii(e,i,o),t!==null&&(Wr(t,e,o,r),Ed(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Fn(),r=Ni(e),o=No(n,r);o.tag=2,t!=null&&(o.callback=t),t=Ii(e,o,r),t!==null&&(Wr(t,e,r,n),Ed(t,e,r))}};function z1(e,t,n,r,o,i,a){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,a):t.prototype&&t.prototype.isPureReactComponent?!xc(n,r)||!xc(o,i):!0}function IC(e,t,n){var r=!1,o=Fi,i=t.contextType;return typeof i=="object"&&i!==null?i=Tr(i):(o=Kn(t)?Ss:_n.current,r=t.contextTypes,i=(r=r!=null)?Ga(e,o):Fi),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Yf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function B1(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Yf.enqueueReplaceState(t,t.state,null)}function Ym(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=DC,Ov(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Tr(i):(i=Kn(t)?Ss:_n.current,o.context=Ga(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(Km(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Yf.enqueueReplaceState(o,o.state,null),nf(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Ll(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(ee(309));var r=n.stateNode}if(!r)throw Error(ee(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(a){var l=o.refs;l===DC&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(ee(284));if(!n._owner)throw Error(ee(290,e))}return e}function nd(e,t){throw e=Object.prototype.toString.call(t),Error(ee(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function U1(e){var t=e._init;return t(e._payload)}function AC(e){function t(b,w){if(e){var y=b.deletions;y===null?(b.deletions=[w],b.flags|=16):y.push(w)}}function n(b,w){if(!e)return null;for(;w!==null;)t(b,w),w=w.sibling;return null}function r(b,w){for(b=new Map;w!==null;)w.key!==null?b.set(w.key,w):b.set(w.index,w),w=w.sibling;return b}function o(b,w){return b=Mi(b,w),b.index=0,b.sibling=null,b}function i(b,w,y){return b.index=y,e?(y=b.alternate,y!==null?(y=y.index,y<w?(b.flags|=2,w):y):(b.flags|=2,w)):(b.flags|=1048576,w)}function a(b){return e&&b.alternate===null&&(b.flags|=2),b}function l(b,w,y,x){return w===null||w.tag!==6?(w=Up(y,b.mode,x),w.return=b,w):(w=o(w,y),w.return=b,w)}function c(b,w,y,x){var C=y.type;return C===ba?d(b,w,y.props.children,x,y.key):w!==null&&(w.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===mi&&U1(C)===w.type)?(x=o(w,y.props),x.ref=Ll(b,w,y),x.return=b,x):(x=Dd(y.type,y.key,y.props,null,b.mode,x),x.ref=Ll(b,w,y),x.return=b,x)}function u(b,w,y,x){return w===null||w.tag!==4||w.stateNode.containerInfo!==y.containerInfo||w.stateNode.implementation!==y.implementation?(w=Vp(y,b.mode,x),w.return=b,w):(w=o(w,y.children||[]),w.return=b,w)}function d(b,w,y,x,C){return w===null||w.tag!==7?(w=bs(y,b.mode,x,C),w.return=b,w):(w=o(w,y),w.return=b,w)}function f(b,w,y){if(typeof w=="string"&&w!==""||typeof w=="number")return w=Up(""+w,b.mode,y),w.return=b,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Hu:return y=Dd(w.type,w.key,w.props,null,b.mode,y),y.ref=Ll(b,null,w),y.return=b,y;case xa:return w=Vp(w,b.mode,y),w.return=b,w;case mi:var x=w._init;return f(b,x(w._payload),y)}if(Gl(w)||Il(w))return w=bs(w,b.mode,y,null),w.return=b,w;nd(b,w)}return null}function h(b,w,y,x){var C=w!==null?w.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return C!==null?null:l(b,w,""+y,x);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case Hu:return y.key===C?c(b,w,y,x):null;case xa:return y.key===C?u(b,w,y,x):null;case mi:return C=y._init,h(b,w,C(y._payload),x)}if(Gl(y)||Il(y))return C!==null?null:d(b,w,y,x,null);nd(b,y)}return null}function m(b,w,y,x,C){if(typeof x=="string"&&x!==""||typeof x=="number")return b=b.get(y)||null,l(w,b,""+x,C);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case Hu:return b=b.get(x.key===null?y:x.key)||null,c(w,b,x,C);case xa:return b=b.get(x.key===null?y:x.key)||null,u(w,b,x,C);case mi:var E=x._init;return m(b,w,y,E(x._payload),C)}if(Gl(x)||Il(x))return b=b.get(y)||null,d(w,b,x,C,null);nd(w,x)}return null}function g(b,w,y,x){for(var C=null,E=null,T=w,j=w=0,R=null;T!==null&&j<y.length;j++){T.index>j?(R=T,T=null):R=T.sibling;var k=h(b,T,y[j],x);if(k===null){T===null&&(T=R);break}e&&T&&k.alternate===null&&t(b,T),w=i(k,w,j),E===null?C=k:E.sibling=k,E=k,T=R}if(j===y.length)return n(b,T),Nt&&is(b,j),C;if(T===null){for(;j<y.length;j++)T=f(b,y[j],x),T!==null&&(w=i(T,w,j),E===null?C=T:E.sibling=T,E=T);return Nt&&is(b,j),C}for(T=r(b,T);j<y.length;j++)R=m(T,b,j,y[j],x),R!==null&&(e&&R.alternate!==null&&T.delete(R.key===null?j:R.key),w=i(R,w,j),E===null?C=R:E.sibling=R,E=R);return e&&T.forEach(function(I){return t(b,I)}),Nt&&is(b,j),C}function v(b,w,y,x){var C=Il(y);if(typeof C!="function")throw Error(ee(150));if(y=C.call(y),y==null)throw Error(ee(151));for(var E=C=null,T=w,j=w=0,R=null,k=y.next();T!==null&&!k.done;j++,k=y.next()){T.index>j?(R=T,T=null):R=T.sibling;var I=h(b,T,k.value,x);if(I===null){T===null&&(T=R);break}e&&T&&I.alternate===null&&t(b,T),w=i(I,w,j),E===null?C=I:E.sibling=I,E=I,T=R}if(k.done)return n(b,T),Nt&&is(b,j),C;if(T===null){for(;!k.done;j++,k=y.next())k=f(b,k.value,x),k!==null&&(w=i(k,w,j),E===null?C=k:E.sibling=k,E=k);return Nt&&is(b,j),C}for(T=r(b,T);!k.done;j++,k=y.next())k=m(T,b,j,k.value,x),k!==null&&(e&&k.alternate!==null&&T.delete(k.key===null?j:k.key),w=i(k,w,j),E===null?C=k:E.sibling=k,E=k);return e&&T.forEach(function(O){return t(b,O)}),Nt&&is(b,j),C}function S(b,w,y,x){if(typeof y=="object"&&y!==null&&y.type===ba&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case Hu:e:{for(var C=y.key,E=w;E!==null;){if(E.key===C){if(C=y.type,C===ba){if(E.tag===7){n(b,E.sibling),w=o(E,y.props.children),w.return=b,b=w;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===mi&&U1(C)===E.type){n(b,E.sibling),w=o(E,y.props),w.ref=Ll(b,E,y),w.return=b,b=w;break e}n(b,E);break}else t(b,E);E=E.sibling}y.type===ba?(w=bs(y.props.children,b.mode,x,y.key),w.return=b,b=w):(x=Dd(y.type,y.key,y.props,null,b.mode,x),x.ref=Ll(b,w,y),x.return=b,b=x)}return a(b);case xa:e:{for(E=y.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===y.containerInfo&&w.stateNode.implementation===y.implementation){n(b,w.sibling),w=o(w,y.children||[]),w.return=b,b=w;break e}else{n(b,w);break}else t(b,w);w=w.sibling}w=Vp(y,b.mode,x),w.return=b,b=w}return a(b);case mi:return E=y._init,S(b,w,E(y._payload),x)}if(Gl(y))return g(b,w,y,x);if(Il(y))return v(b,w,y,x);nd(b,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,w!==null&&w.tag===6?(n(b,w.sibling),w=o(w,y),w.return=b,b=w):(n(b,w),w=Up(y,b.mode,x),w.return=b,b=w),a(b)):n(b,w)}return S}var Ka=AC(!0),NC=AC(!1),Jc={},fo=Qi(Jc),jc=Qi(Jc),Cc=Qi(Jc);function ms(e){if(e===Jc)throw Error(ee(174));return e}function Lv(e,t){switch(Et(Cc,t),Et(jc,e),Et(fo,Jc),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:km(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=km(t,e)}Dt(fo),Et(fo,t)}function Ya(){Dt(fo),Dt(jc),Dt(Cc)}function MC(e){ms(Cc.current);var t=ms(fo.current),n=km(t,e.type);t!==n&&(Et(jc,e),Et(fo,n))}function $v(e){jc.current===e&&(Dt(fo),Dt(jc))}var Lt=Qi(0);function rf(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Op=[];function Fv(){for(var e=0;e<Op.length;e++)Op[e]._workInProgressVersionPrimary=null;Op.length=0}var Td=Xo.ReactCurrentDispatcher,Lp=Xo.ReactCurrentBatchConfig,Cs=0,Ft=null,on=null,un=null,of=!1,oc=!1,Ec=0,oN=0;function En(){throw Error(ee(321))}function zv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!qr(e[n],t[n]))return!1;return!0}function Bv(e,t,n,r,o,i){if(Cs=i,Ft=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,Td.current=e===null||e.memoizedState===null?lN:cN,e=n(r,o),oc){i=0;do{if(oc=!1,Ec=0,25<=i)throw Error(ee(301));i+=1,un=on=null,t.updateQueue=null,Td.current=uN,e=n(r,o)}while(oc)}if(Td.current=sf,t=on!==null&&on.next!==null,Cs=0,un=on=Ft=null,of=!1,t)throw Error(ee(300));return e}function Uv(){var e=Ec!==0;return Ec=0,e}function so(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return un===null?Ft.memoizedState=un=e:un=un.next=e,un}function Pr(){if(on===null){var e=Ft.alternate;e=e!==null?e.memoizedState:null}else e=on.next;var t=un===null?Ft.memoizedState:un.next;if(t!==null)un=t,on=e;else{if(e===null)throw Error(ee(310));on=e,e={memoizedState:on.memoizedState,baseState:on.baseState,baseQueue:on.baseQueue,queue:on.queue,next:null},un===null?Ft.memoizedState=un=e:un=un.next=e}return un}function Tc(e,t){return typeof t=="function"?t(e):t}function $p(e){var t=Pr(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=on,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var a=o.next;o.next=i.next,i.next=a}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=a=null,c=null,u=i;do{var d=u.lane;if((Cs&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var f={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=f,a=r):c=c.next=f,Ft.lanes|=d,Es|=d}u=u.next}while(u!==null&&u!==i);c===null?a=r:c.next=l,qr(r,t.memoizedState)||(Gn=!0),t.memoizedState=r,t.baseState=a,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,Ft.lanes|=i,Es|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Fp(e){var t=Pr(),n=t.queue;if(n===null)throw Error(ee(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var a=o=o.next;do i=e(i,a.action),a=a.next;while(a!==o);qr(i,t.memoizedState)||(Gn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function OC(){}function LC(e,t){var n=Ft,r=Pr(),o=t(),i=!qr(r.memoizedState,o);if(i&&(r.memoizedState=o,Gn=!0),r=r.queue,Vv(zC.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||un!==null&&un.memoizedState.tag&1){if(n.flags|=2048,Pc(9,FC.bind(null,n,r,o,t),void 0,null),pn===null)throw Error(ee(349));Cs&30||$C(n,t,o)}return o}function $C(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Ft.updateQueue,t===null?(t={lastEffect:null,stores:null},Ft.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function FC(e,t,n,r){t.value=n,t.getSnapshot=r,BC(t)&&UC(e)}function zC(e,t,n){return n(function(){BC(t)&&UC(e)})}function BC(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!qr(e,n)}catch{return!0}}function UC(e){var t=zo(e,1);t!==null&&Wr(t,e,1,-1)}function V1(e){var t=so();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Tc,lastRenderedState:e},t.queue=e,e=e.dispatch=aN.bind(null,Ft,e),[t.memoizedState,e]}function Pc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Ft.updateQueue,t===null?(t={lastEffect:null,stores:null},Ft.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function VC(){return Pr().memoizedState}function Pd(e,t,n,r){var o=so();Ft.flags|=e,o.memoizedState=Pc(1|t,n,void 0,r===void 0?null:r)}function Xf(e,t,n,r){var o=Pr();r=r===void 0?null:r;var i=void 0;if(on!==null){var a=on.memoizedState;if(i=a.destroy,r!==null&&zv(r,a.deps)){o.memoizedState=Pc(t,n,i,r);return}}Ft.flags|=e,o.memoizedState=Pc(1|t,n,i,r)}function W1(e,t){return Pd(8390656,8,e,t)}function Vv(e,t){return Xf(2048,8,e,t)}function WC(e,t){return Xf(4,2,e,t)}function HC(e,t){return Xf(4,4,e,t)}function qC(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function GC(e,t,n){return n=n!=null?n.concat([e]):null,Xf(4,4,qC.bind(null,t,e),n)}function Wv(){}function QC(e,t){var n=Pr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function KC(e,t){var n=Pr();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&zv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function YC(e,t,n){return Cs&21?(qr(n,t)||(n=Zj(),Ft.lanes|=n,Es|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Gn=!0),e.memoizedState=n)}function iN(e,t){var n=dt;dt=n!==0&&4>n?n:4,e(!0);var r=Lp.transition;Lp.transition={};try{e(!1),t()}finally{dt=n,Lp.transition=r}}function XC(){return Pr().memoizedState}function sN(e,t,n){var r=Ni(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},JC(e))ZC(t,n);else if(n=RC(e,t,n,r),n!==null){var o=Fn();Wr(n,e,r,o),eE(n,t,r)}}function aN(e,t,n){var r=Ni(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(JC(e))ZC(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,l=i(a,n);if(o.hasEagerState=!0,o.eagerState=l,qr(l,a)){var c=t.interleaved;c===null?(o.next=o,Mv(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=RC(e,t,o,r),n!==null&&(o=Fn(),Wr(n,e,r,o),eE(n,t,r))}}function JC(e){var t=e.alternate;return e===Ft||t!==null&&t===Ft}function ZC(e,t){oc=of=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function eE(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wv(e,n)}}var sf={readContext:Tr,useCallback:En,useContext:En,useEffect:En,useImperativeHandle:En,useInsertionEffect:En,useLayoutEffect:En,useMemo:En,useReducer:En,useRef:En,useState:En,useDebugValue:En,useDeferredValue:En,useTransition:En,useMutableSource:En,useSyncExternalStore:En,useId:En,unstable_isNewReconciler:!1},lN={readContext:Tr,useCallback:function(e,t){return so().memoizedState=[e,t===void 0?null:t],e},useContext:Tr,useEffect:W1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,Pd(4194308,4,qC.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Pd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Pd(4,2,e,t)},useMemo:function(e,t){var n=so();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=so();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=sN.bind(null,Ft,e),[r.memoizedState,e]},useRef:function(e){var t=so();return e={current:e},t.memoizedState=e},useState:V1,useDebugValue:Wv,useDeferredValue:function(e){return so().memoizedState=e},useTransition:function(){var e=V1(!1),t=e[0];return e=iN.bind(null,e[1]),so().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Ft,o=so();if(Nt){if(n===void 0)throw Error(ee(407));n=n()}else{if(n=t(),pn===null)throw Error(ee(349));Cs&30||$C(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,W1(zC.bind(null,r,i,e),[e]),r.flags|=2048,Pc(9,FC.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=so(),t=pn.identifierPrefix;if(Nt){var n=Io,r=Do;n=(r&~(1<<32-Vr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Ec++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=oN++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},cN={readContext:Tr,useCallback:QC,useContext:Tr,useEffect:Vv,useImperativeHandle:GC,useInsertionEffect:WC,useLayoutEffect:HC,useMemo:KC,useReducer:$p,useRef:VC,useState:function(){return $p(Tc)},useDebugValue:Wv,useDeferredValue:function(e){var t=Pr();return YC(t,on.memoizedState,e)},useTransition:function(){var e=$p(Tc)[0],t=Pr().memoizedState;return[e,t]},useMutableSource:OC,useSyncExternalStore:LC,useId:XC,unstable_isNewReconciler:!1},uN={readContext:Tr,useCallback:QC,useContext:Tr,useEffect:Vv,useImperativeHandle:GC,useInsertionEffect:WC,useLayoutEffect:HC,useMemo:KC,useReducer:Fp,useRef:VC,useState:function(){return Fp(Tc)},useDebugValue:Wv,useDeferredValue:function(e){var t=Pr();return on===null?t.memoizedState=e:YC(t,on.memoizedState,e)},useTransition:function(){var e=Fp(Tc)[0],t=Pr().memoizedState;return[e,t]},useMutableSource:OC,useSyncExternalStore:LC,useId:XC,unstable_isNewReconciler:!1};function Xa(e,t){try{var n="",r=t;do n+=$I(r),r=r.return;while(r);var o=n}catch(i){o=`
|
|
82
|
-
Error generating stack: `+i.message+`
|
|
83
|
-
`+i.stack}return{value:e,source:t,stack:o,digest:null}}function zp(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function Xm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var dN=typeof WeakMap=="function"?WeakMap:Map;function tE(e,t,n){n=No(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){lf||(lf=!0,ag=r),Xm(e,t)},n}function nE(e,t,n){n=No(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){Xm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){Xm(e,t),typeof r!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function H1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new dN;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=EN.bind(null,e,t,n),t.then(e,e))}function q1(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function G1(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=No(-1,1),t.tag=2,Ii(n,t,1))),n.lanes|=1),e)}var fN=Xo.ReactCurrentOwner,Gn=!1;function Mn(e,t,n,r){t.child=e===null?NC(t,null,n,r):Ka(t,e.child,n,r)}function Q1(e,t,n,r,o){n=n.render;var i=t.ref;return za(t,o),r=Bv(e,t,n,r,i,o),n=Uv(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Bo(e,t,o)):(Nt&&n&&Rv(t),t.flags|=1,Mn(e,t,r,o),t.child)}function K1(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Jv(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,rE(e,t,i,r,o)):(e=Dd(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var a=i.memoizedProps;if(n=n.compare,n=n!==null?n:xc,n(a,r)&&e.ref===t.ref)return Bo(e,t,o)}return t.flags|=1,e=Mi(i,r),e.ref=t.ref,e.return=t,t.child=e}function rE(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(xc(i,r)&&e.ref===t.ref)if(Gn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Gn=!0);else return t.lanes=e.lanes,Bo(e,t,o)}return Jm(e,t,n,r,o)}function oE(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Et(_a,ir),ir|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Et(_a,ir),ir|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,Et(_a,ir),ir|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,Et(_a,ir),ir|=r;return Mn(e,t,o,n),t.child}function iE(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Jm(e,t,n,r,o){var i=Kn(n)?Ss:_n.current;return i=Ga(t,i),za(t,o),n=Bv(e,t,n,r,i,o),r=Uv(),e!==null&&!Gn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,Bo(e,t,o)):(Nt&&r&&Rv(t),t.flags|=1,Mn(e,t,n,o),t.child)}function Y1(e,t,n,r,o){if(Kn(n)){var i=!0;Xd(t)}else i=!1;if(za(t,o),t.stateNode===null)kd(e,t),IC(t,n,r),Ym(t,n,r,o),r=!0;else if(e===null){var a=t.stateNode,l=t.memoizedProps;a.props=l;var c=a.context,u=n.contextType;typeof u=="object"&&u!==null?u=Tr(u):(u=Kn(n)?Ss:_n.current,u=Ga(t,u));var d=n.getDerivedStateFromProps,f=typeof d=="function"||typeof a.getSnapshotBeforeUpdate=="function";f||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==r||c!==u)&&B1(t,a,r,u),gi=!1;var h=t.memoizedState;a.state=h,nf(t,r,a,o),c=t.memoizedState,l!==r||h!==c||Qn.current||gi?(typeof d=="function"&&(Km(t,n,d,r),c=t.memoizedState),(l=gi||z1(t,n,l,r,h,c,u))?(f||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(t.flags|=4194308)):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=c),a.props=r,a.state=c,a.context=u,r=l):(typeof a.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,_C(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Lr(t.type,l),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Tr(c):(c=Kn(n)?Ss:_n.current,c=Ga(t,c));var m=n.getDerivedStateFromProps;(d=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(l!==f||h!==c)&&B1(t,a,r,c),gi=!1,h=t.memoizedState,a.state=h,nf(t,r,a,o);var g=t.memoizedState;l!==f||h!==g||Qn.current||gi?(typeof m=="function"&&(Km(t,n,m,r),g=t.memoizedState),(u=gi||z1(t,n,u,r,h,g,c)||!1)?(d||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(r,g,c),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(r,g,c)),typeof a.componentDidUpdate=="function"&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=g),a.props=r,a.state=g,a.context=c,r=u):(typeof a.componentDidUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),r=!1)}return Zm(e,t,n,r,i,o)}function Zm(e,t,n,r,o,i){iE(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&M1(t,n,!1),Bo(e,t,i);r=t.stateNode,fN.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Ka(t,e.child,null,i),t.child=Ka(t,null,l,i)):Mn(e,t,l,i),t.memoizedState=r.state,o&&M1(t,n,!0),t.child}function sE(e){var t=e.stateNode;t.pendingContext?N1(e,t.pendingContext,t.pendingContext!==t.context):t.context&&N1(e,t.context,!1),Lv(e,t.containerInfo)}function X1(e,t,n,r,o){return Qa(),Dv(o),t.flags|=256,Mn(e,t,n,r),t.child}var eg={dehydrated:null,treeContext:null,retryLane:0};function tg(e){return{baseLanes:e,cachePool:null,transitions:null}}function aE(e,t,n){var r=t.pendingProps,o=Lt.current,i=!1,a=(t.flags&128)!==0,l;if((l=a)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),Et(Lt,o&1),e===null)return Gm(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(a=r.children,e=r.fallback,i?(r=t.mode,i=t.child,a={mode:"hidden",children:a},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=eh(a,r,0,null),e=bs(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=tg(n),t.memoizedState=eg,e):Hv(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return hN(e,t,a,r,l,o,n);if(i){i=r.fallback,a=t.mode,o=e.child,l=o.sibling;var c={mode:"hidden",children:r.children};return!(a&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Mi(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Mi(l,i):(i=bs(i,a,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,a=e.child.memoizedState,a=a===null?tg(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=eg,r}return i=e.child,e=i.sibling,r=Mi(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Hv(e,t){return t=eh({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rd(e,t,n,r){return r!==null&&Dv(r),Ka(t,e.child,null,n),e=Hv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hN(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=zp(Error(ee(422))),rd(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=eh({mode:"visible",children:r.children},o,0,null),i=bs(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Ka(t,e.child,null,a),t.child.memoizedState=tg(a),t.memoizedState=eg,i);if(!(t.mode&1))return rd(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(ee(419)),r=zp(i,r,void 0),rd(e,t,a,r)}if(l=(a&e.childLanes)!==0,Gn||l){if(r=pn,r!==null){switch(a&-a){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|a)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,zo(e,o),Wr(r,e,o,-1))}return Xv(),r=zp(Error(ee(421))),rd(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=TN.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,lr=Di(o.nextSibling),ur=t,Nt=!0,zr=null,e!==null&&(br[wr++]=Do,br[wr++]=Io,br[wr++]=js,Do=e.id,Io=e.overflow,js=t),t=Hv(t,r.children),t.flags|=4096,t)}function J1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qm(e.return,t,n)}function Bp(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function lE(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(Mn(e,t,r.children,n),r=Lt.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&J1(e,n,t);else if(e.tag===19)J1(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(Et(Lt,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&rf(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Bp(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&rf(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Bp(t,!0,n,null,i);break;case"together":Bp(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function kd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Bo(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Es|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(ee(153));if(t.child!==null){for(e=t.child,n=Mi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Mi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function pN(e,t,n){switch(t.tag){case 3:sE(t),Qa();break;case 5:MC(t);break;case 1:Kn(t.type)&&Xd(t);break;case 4:Lv(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;Et(ef,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(Et(Lt,Lt.current&1),t.flags|=128,null):n&t.child.childLanes?aE(e,t,n):(Et(Lt,Lt.current&1),e=Bo(e,t,n),e!==null?e.sibling:null);Et(Lt,Lt.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return lE(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Et(Lt,Lt.current),r)break;return null;case 22:case 23:return t.lanes=0,oE(e,t,n)}return Bo(e,t,n)}var cE,ng,uE,dE;cE=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};ng=function(){};uE=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,ms(fo.current);var i=null;switch(n){case"input":o=Cm(e,o),r=Cm(e,r),i=[];break;case"select":o=zt({},o,{value:void 0}),r=zt({},r,{value:void 0}),i=[];break;case"textarea":o=Pm(e,o),r=Pm(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Kd)}Rm(n,r);var a;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(a in l)l.hasOwnProperty(a)&&(n||(n={}),n[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(fc.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var c=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(a in l)!l.hasOwnProperty(a)||c&&c.hasOwnProperty(a)||(n||(n={}),n[a]="");for(a in c)c.hasOwnProperty(a)&&l[a]!==c[a]&&(n||(n={}),n[a]=c[a])}else n||(i||(i=[]),i.push(u,n)),n=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(fc.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&kt("scroll",e),i||l===c||(i=[])):(i=i||[]).push(u,c))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};dE=function(e,t,n,r){n!==r&&(t.flags|=4)};function $l(e,t){if(!Nt)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Tn(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function mN(e,t,n){var r=t.pendingProps;switch(_v(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Tn(t),null;case 1:return Kn(t.type)&&Yd(),Tn(t),null;case 3:return r=t.stateNode,Ya(),Dt(Qn),Dt(_n),Fv(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(td(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,zr!==null&&(ug(zr),zr=null))),ng(e,t),Tn(t),null;case 5:$v(t);var o=ms(Cc.current);if(n=t.type,e!==null&&t.stateNode!=null)uE(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(ee(166));return Tn(t),null}if(e=ms(fo.current),td(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[co]=t,r[Sc]=i,e=(t.mode&1)!==0,n){case"dialog":kt("cancel",r),kt("close",r);break;case"iframe":case"object":case"embed":kt("load",r);break;case"video":case"audio":for(o=0;o<Kl.length;o++)kt(Kl[o],r);break;case"source":kt("error",r);break;case"img":case"image":case"link":kt("error",r),kt("load",r);break;case"details":kt("toggle",r);break;case"input":a1(r,i),kt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},kt("invalid",r);break;case"textarea":c1(r,i),kt("invalid",r)}Rm(n,i),o=null;for(var a in i)if(i.hasOwnProperty(a)){var l=i[a];a==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&ed(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&ed(r.textContent,l,e),o=["children",""+l]):fc.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&kt("scroll",r)}switch(n){case"input":qu(r),l1(r,i,!0);break;case"textarea":qu(r),u1(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Kd)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{a=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=$j(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=a.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=a.createElement(n,{is:r.is}):(e=a.createElement(n),n==="select"&&(a=e,r.multiple?a.multiple=!0:r.size&&(a.size=r.size))):e=a.createElementNS(e,n),e[co]=t,e[Sc]=r,cE(e,t,!1,!1),t.stateNode=e;e:{switch(a=_m(n,r),n){case"dialog":kt("cancel",e),kt("close",e),o=r;break;case"iframe":case"object":case"embed":kt("load",e),o=r;break;case"video":case"audio":for(o=0;o<Kl.length;o++)kt(Kl[o],e);o=r;break;case"source":kt("error",e),o=r;break;case"img":case"image":case"link":kt("error",e),kt("load",e),o=r;break;case"details":kt("toggle",e),o=r;break;case"input":a1(e,r),o=Cm(e,r),kt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=zt({},r,{value:void 0}),kt("invalid",e);break;case"textarea":c1(e,r),o=Pm(e,r),kt("invalid",e);break;default:o=r}Rm(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Bj(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&Fj(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&hc(e,c):typeof c=="number"&&hc(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(fc.hasOwnProperty(i)?c!=null&&i==="onScroll"&&kt("scroll",e):c!=null&&mv(e,i,c,a))}switch(n){case"input":qu(e),l1(e,r,!1);break;case"textarea":qu(e),u1(e);break;case"option":r.value!=null&&e.setAttribute("value",""+$i(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?Oa(e,!!r.multiple,i,!1):r.defaultValue!=null&&Oa(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Kd)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Tn(t),null;case 6:if(e&&t.stateNode!=null)dE(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(ee(166));if(n=ms(Cc.current),ms(fo.current),td(t)){if(r=t.stateNode,n=t.memoizedProps,r[co]=t,(i=r.nodeValue!==n)&&(e=ur,e!==null))switch(e.tag){case 3:ed(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&ed(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[co]=t,t.stateNode=r}return Tn(t),null;case 13:if(Dt(Lt),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Nt&&lr!==null&&t.mode&1&&!(t.flags&128))kC(),Qa(),t.flags|=98560,i=!1;else if(i=td(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(ee(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(ee(317));i[co]=t}else Qa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Tn(t),i=!1}else zr!==null&&(ug(zr),zr=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||Lt.current&1?sn===0&&(sn=3):Xv())),t.updateQueue!==null&&(t.flags|=4),Tn(t),null);case 4:return Ya(),ng(e,t),e===null&&bc(t.stateNode.containerInfo),Tn(t),null;case 10:return Nv(t.type._context),Tn(t),null;case 17:return Kn(t.type)&&Yd(),Tn(t),null;case 19:if(Dt(Lt),i=t.memoizedState,i===null)return Tn(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)$l(i,!1);else{if(sn!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=rf(e),a!==null){for(t.flags|=128,$l(i,!1),r=a.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,a=i.alternate,a===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,e=a.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return Et(Lt,Lt.current&1|2),t.child}e=e.sibling}i.tail!==null&&Kt()>Ja&&(t.flags|=128,r=!0,$l(i,!1),t.lanes=4194304)}else{if(!r)if(e=rf(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),$l(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Nt)return Tn(t),null}else 2*Kt()-i.renderingStartTime>Ja&&n!==1073741824&&(t.flags|=128,r=!0,$l(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(n=i.last,n!==null?n.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Kt(),t.sibling=null,n=Lt.current,Et(Lt,r?n&1|2:n&1),t):(Tn(t),null);case 22:case 23:return Yv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?ir&1073741824&&(Tn(t),t.subtreeFlags&6&&(t.flags|=8192)):Tn(t),null;case 24:return null;case 25:return null}throw Error(ee(156,t.tag))}function gN(e,t){switch(_v(t),t.tag){case 1:return Kn(t.type)&&Yd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ya(),Dt(Qn),Dt(_n),Fv(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return $v(t),null;case 13:if(Dt(Lt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(ee(340));Qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Dt(Lt),null;case 4:return Ya(),null;case 10:return Nv(t.type._context),null;case 22:case 23:return Yv(),null;case 24:return null;default:return null}}var od=!1,Pn=!1,vN=typeof WeakSet=="function"?WeakSet:Set,be=null;function Ra(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Ht(e,t,r)}else n.current=null}function rg(e,t,n){try{n()}catch(r){Ht(e,t,r)}}var Z1=!1;function yN(e,t){if(zm=qd,e=mC(),kv(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var a=0,l=-1,c=-1,u=0,d=0,f=e,h=null;t:for(;;){for(var m;f!==n||o!==0&&f.nodeType!==3||(l=a+o),f!==i||r!==0&&f.nodeType!==3||(c=a+r),f.nodeType===3&&(a+=f.nodeValue.length),(m=f.firstChild)!==null;)h=f,f=m;for(;;){if(f===e)break t;if(h===n&&++u===o&&(l=a),h===i&&++d===r&&(c=a),(m=f.nextSibling)!==null)break;f=h,h=f.parentNode}f=m}n=l===-1||c===-1?null:{start:l,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(Bm={focusedElem:e,selectionRange:n},qd=!1,be=t;be!==null;)if(t=be,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,be=e;else for(;be!==null;){t=be;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,S=g.memoizedState,b=t.stateNode,w=b.getSnapshotBeforeUpdate(t.elementType===t.type?v:Lr(t.type,v),S);b.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var y=t.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(ee(163))}}catch(x){Ht(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,be=e;break}be=t.return}return g=Z1,Z1=!1,g}function ic(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&rg(t,n,i)}o=o.next}while(o!==r)}}function Jf(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function og(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function fE(e){var t=e.alternate;t!==null&&(e.alternate=null,fE(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[co],delete t[Sc],delete t[Wm],delete t[eN],delete t[tN])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function hE(e){return e.tag===5||e.tag===3||e.tag===4}function eb(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hE(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ig(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Kd));else if(r!==4&&(e=e.child,e!==null))for(ig(e,t,n),e=e.sibling;e!==null;)ig(e,t,n),e=e.sibling}function sg(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(sg(e,t,n),e=e.sibling;e!==null;)sg(e,t,n),e=e.sibling}var gn=null,$r=!1;function hi(e,t,n){for(n=n.child;n!==null;)pE(e,t,n),n=n.sibling}function pE(e,t,n){if(uo&&typeof uo.onCommitFiberUnmount=="function")try{uo.onCommitFiberUnmount(Wf,n)}catch{}switch(n.tag){case 5:Pn||Ra(n,t);case 6:var r=gn,o=$r;gn=null,hi(e,t,n),gn=r,$r=o,gn!==null&&($r?(e=gn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):gn.removeChild(n.stateNode));break;case 18:gn!==null&&($r?(e=gn,n=n.stateNode,e.nodeType===8?Np(e.parentNode,n):e.nodeType===1&&Np(e,n),vc(e)):Np(gn,n.stateNode));break;case 4:r=gn,o=$r,gn=n.stateNode.containerInfo,$r=!0,hi(e,t,n),gn=r,$r=o;break;case 0:case 11:case 14:case 15:if(!Pn&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&rg(n,t,a),o=o.next}while(o!==r)}hi(e,t,n);break;case 1:if(!Pn&&(Ra(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Ht(n,t,l)}hi(e,t,n);break;case 21:hi(e,t,n);break;case 22:n.mode&1?(Pn=(r=Pn)||n.memoizedState!==null,hi(e,t,n),Pn=r):hi(e,t,n);break;default:hi(e,t,n)}}function tb(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new vN),t.forEach(function(r){var o=PN.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Nr(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,a=t,l=a;e:for(;l!==null;){switch(l.tag){case 5:gn=l.stateNode,$r=!1;break e;case 3:gn=l.stateNode.containerInfo,$r=!0;break e;case 4:gn=l.stateNode.containerInfo,$r=!0;break e}l=l.return}if(gn===null)throw Error(ee(160));pE(i,a,o),gn=null,$r=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){Ht(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)mE(t,e),t=t.sibling}function mE(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nr(t,e),ro(e),r&4){try{ic(3,e,e.return),Jf(3,e)}catch(v){Ht(e,e.return,v)}try{ic(5,e,e.return)}catch(v){Ht(e,e.return,v)}}break;case 1:Nr(t,e),ro(e),r&512&&n!==null&&Ra(n,n.return);break;case 5:if(Nr(t,e),ro(e),r&512&&n!==null&&Ra(n,n.return),e.flags&32){var o=e.stateNode;try{hc(o,"")}catch(v){Ht(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,a=n!==null?n.memoizedProps:i,l=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&Oj(o,i),_m(l,a);var u=_m(l,i);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?Bj(o,f):d==="dangerouslySetInnerHTML"?Fj(o,f):d==="children"?hc(o,f):mv(o,d,f,u)}switch(l){case"input":Em(o,i);break;case"textarea":Lj(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?Oa(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?Oa(o,!!i.multiple,i.defaultValue,!0):Oa(o,!!i.multiple,i.multiple?[]:"",!1))}o[Sc]=i}catch(v){Ht(e,e.return,v)}}break;case 6:if(Nr(t,e),ro(e),r&4){if(e.stateNode===null)throw Error(ee(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Ht(e,e.return,v)}}break;case 3:if(Nr(t,e),ro(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{vc(t.containerInfo)}catch(v){Ht(e,e.return,v)}break;case 4:Nr(t,e),ro(e);break;case 13:Nr(t,e),ro(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Qv=Kt())),r&4&&tb(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(Pn=(u=Pn)||d,Nr(t,e),Pn=u):Nr(t,e),ro(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(be=e,d=e.child;d!==null;){for(f=be=d;be!==null;){switch(h=be,m=h.child,h.tag){case 0:case 11:case 14:case 15:ic(4,h,h.return);break;case 1:Ra(h,h.return);var g=h.stateNode;if(typeof g.componentWillUnmount=="function"){r=h,n=h.return;try{t=r,g.props=t.memoizedProps,g.state=t.memoizedState,g.componentWillUnmount()}catch(v){Ht(r,n,v)}}break;case 5:Ra(h,h.return);break;case 22:if(h.memoizedState!==null){rb(f);continue}}m!==null?(m.return=h,be=m):rb(f)}d=d.sibling}e:for(d=null,f=e;;){if(f.tag===5){if(d===null){d=f;try{o=f.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=f.stateNode,c=f.memoizedProps.style,a=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=zj("display",a))}catch(v){Ht(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Ht(e,e.return,v)}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===e)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===e)break e;for(;f.sibling===null;){if(f.return===null||f.return===e)break e;d===f&&(d=null),f=f.return}d===f&&(d=null),f.sibling.return=f.return,f=f.sibling}}break;case 19:Nr(t,e),ro(e),r&4&&tb(e);break;case 21:break;default:Nr(t,e),ro(e)}}function ro(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(hE(n)){var r=n;break e}n=n.return}throw Error(ee(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(hc(o,""),r.flags&=-33);var i=eb(e);sg(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,l=eb(e);ig(e,l,a);break;default:throw Error(ee(161))}}catch(c){Ht(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xN(e,t,n){be=e,gE(e)}function gE(e,t,n){for(var r=(e.mode&1)!==0;be!==null;){var o=be,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||od;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||Pn;l=od;var u=Pn;if(od=a,(Pn=c)&&!u)for(be=o;be!==null;)a=be,c=a.child,a.tag===22&&a.memoizedState!==null?ob(o):c!==null?(c.return=a,be=c):ob(o);for(;i!==null;)be=i,gE(i),i=i.sibling;be=o,od=l,Pn=u}nb(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,be=i):nb(e)}}function nb(e){for(;be!==null;){var t=be;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Pn||Jf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Pn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Lr(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&F1(t,i,r);break;case 3:var a=t.updateQueue;if(a!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}F1(t,a,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var f=d.dehydrated;f!==null&&vc(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(ee(163))}Pn||t.flags&512&&og(t)}catch(h){Ht(t,t.return,h)}}if(t===e){be=null;break}if(n=t.sibling,n!==null){n.return=t.return,be=n;break}be=t.return}}function rb(e){for(;be!==null;){var t=be;if(t===e){be=null;break}var n=t.sibling;if(n!==null){n.return=t.return,be=n;break}be=t.return}}function ob(e){for(;be!==null;){var t=be;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Jf(4,t)}catch(c){Ht(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Ht(t,o,c)}}var i=t.return;try{og(t)}catch(c){Ht(t,i,c)}break;case 5:var a=t.return;try{og(t)}catch(c){Ht(t,a,c)}}}catch(c){Ht(t,t.return,c)}if(t===e){be=null;break}var l=t.sibling;if(l!==null){l.return=t.return,be=l;break}be=t.return}}var bN=Math.ceil,af=Xo.ReactCurrentDispatcher,qv=Xo.ReactCurrentOwner,jr=Xo.ReactCurrentBatchConfig,Ze=0,pn=null,Zt=null,yn=0,ir=0,_a=Qi(0),sn=0,kc=null,Es=0,Zf=0,Gv=0,sc=null,qn=null,Qv=0,Ja=1/0,ko=null,lf=!1,ag=null,Ai=null,id=!1,Ti=null,cf=0,ac=0,lg=null,Rd=-1,_d=0;function Fn(){return Ze&6?Kt():Rd!==-1?Rd:Rd=Kt()}function Ni(e){return e.mode&1?Ze&2&&yn!==0?yn&-yn:rN.transition!==null?(_d===0&&(_d=Zj()),_d):(e=dt,e!==0||(e=window.event,e=e===void 0?16:sC(e.type)),e):1}function Wr(e,t,n,r){if(50<ac)throw ac=0,lg=null,Error(ee(185));Kc(e,n,r),(!(Ze&2)||e!==pn)&&(e===pn&&(!(Ze&2)&&(Zf|=n),sn===4&&Si(e,yn)),Yn(e,r),n===1&&Ze===0&&!(t.mode&1)&&(Ja=Kt()+500,Kf&&Ki()))}function Yn(e,t){var n=e.callbackNode;rA(e,t);var r=Hd(e,e===pn?yn:0);if(r===0)n!==null&&h1(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&h1(n),t===1)e.tag===0?nN(ib.bind(null,e)):EC(ib.bind(null,e)),JA(function(){!(Ze&6)&&Ki()}),n=null;else{switch(eC(r)){case 1:n=bv;break;case 4:n=Xj;break;case 16:n=Wd;break;case 536870912:n=Jj;break;default:n=Wd}n=CE(n,vE.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function vE(e,t){if(Rd=-1,_d=0,Ze&6)throw Error(ee(327));var n=e.callbackNode;if(Ba()&&e.callbackNode!==n)return null;var r=Hd(e,e===pn?yn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=uf(e,r);else{t=r;var o=Ze;Ze|=2;var i=xE();(pn!==e||yn!==t)&&(ko=null,Ja=Kt()+500,xs(e,t));do try{jN();break}catch(l){yE(e,l)}while(!0);Av(),af.current=i,Ze=o,Zt!==null?t=0:(pn=null,yn=0,t=sn)}if(t!==0){if(t===2&&(o=Mm(e),o!==0&&(r=o,t=cg(e,o))),t===1)throw n=kc,xs(e,0),Si(e,r),Yn(e,Kt()),n;if(t===6)Si(e,r);else{if(o=e.current.alternate,!(r&30)&&!wN(o)&&(t=uf(e,r),t===2&&(i=Mm(e),i!==0&&(r=i,t=cg(e,i))),t===1))throw n=kc,xs(e,0),Si(e,r),Yn(e,Kt()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(ee(345));case 2:ss(e,qn,ko);break;case 3:if(Si(e,r),(r&130023424)===r&&(t=Qv+500-Kt(),10<t)){if(Hd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Fn(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=Vm(ss.bind(null,e,qn,ko),t);break}ss(e,qn,ko);break;case 4:if(Si(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-Vr(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Kt()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*bN(r/1960))-r,10<r){e.timeoutHandle=Vm(ss.bind(null,e,qn,ko),r);break}ss(e,qn,ko);break;case 5:ss(e,qn,ko);break;default:throw Error(ee(329))}}}return Yn(e,Kt()),e.callbackNode===n?vE.bind(null,e):null}function cg(e,t){var n=sc;return e.current.memoizedState.isDehydrated&&(xs(e,t).flags|=256),e=uf(e,t),e!==2&&(t=qn,qn=n,t!==null&&ug(t)),e}function ug(e){qn===null?qn=e:qn.push.apply(qn,e)}function wN(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!qr(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Si(e,t){for(t&=~Gv,t&=~Zf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Vr(t),r=1<<n;e[n]=-1,t&=~r}}function ib(e){if(Ze&6)throw Error(ee(327));Ba();var t=Hd(e,0);if(!(t&1))return Yn(e,Kt()),null;var n=uf(e,t);if(e.tag!==0&&n===2){var r=Mm(e);r!==0&&(t=r,n=cg(e,r))}if(n===1)throw n=kc,xs(e,0),Si(e,t),Yn(e,Kt()),n;if(n===6)throw Error(ee(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,ss(e,qn,ko),Yn(e,Kt()),null}function Kv(e,t){var n=Ze;Ze|=1;try{return e(t)}finally{Ze=n,Ze===0&&(Ja=Kt()+500,Kf&&Ki())}}function Ts(e){Ti!==null&&Ti.tag===0&&!(Ze&6)&&Ba();var t=Ze;Ze|=1;var n=jr.transition,r=dt;try{if(jr.transition=null,dt=1,e)return e()}finally{dt=r,jr.transition=n,Ze=t,!(Ze&6)&&Ki()}}function Yv(){ir=_a.current,Dt(_a)}function xs(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,XA(n)),Zt!==null)for(n=Zt.return;n!==null;){var r=n;switch(_v(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Yd();break;case 3:Ya(),Dt(Qn),Dt(_n),Fv();break;case 5:$v(r);break;case 4:Ya();break;case 13:Dt(Lt);break;case 19:Dt(Lt);break;case 10:Nv(r.type._context);break;case 22:case 23:Yv()}n=n.return}if(pn=e,Zt=e=Mi(e.current,null),yn=ir=t,sn=0,kc=null,Gv=Zf=Es=0,qn=sc=null,ps!==null){for(t=0;t<ps.length;t++)if(n=ps[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var a=i.next;i.next=o,r.next=a}n.pending=r}ps=null}return e}function yE(e,t){do{var n=Zt;try{if(Av(),Td.current=sf,of){for(var r=Ft.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}of=!1}if(Cs=0,un=on=Ft=null,oc=!1,Ec=0,qv.current=null,n===null||n.return===null){sn=1,kc=t,Zt=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=yn,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,f=d.tag;if(!(d.mode&1)&&(f===0||f===11||f===15)){var h=d.alternate;h?(d.updateQueue=h.updateQueue,d.memoizedState=h.memoizedState,d.lanes=h.lanes):(d.updateQueue=null,d.memoizedState=null)}var m=q1(a);if(m!==null){m.flags&=-257,G1(m,a,l,i,t),m.mode&1&&H1(i,u,t),t=m,c=u;var g=t.updateQueue;if(g===null){var v=new Set;v.add(c),t.updateQueue=v}else g.add(c);break e}else{if(!(t&1)){H1(i,u,t),Xv();break e}c=Error(ee(426))}}else if(Nt&&l.mode&1){var S=q1(a);if(S!==null){!(S.flags&65536)&&(S.flags|=256),G1(S,a,l,i,t),Dv(Xa(c,l));break e}}i=c=Xa(c,l),sn!==4&&(sn=2),sc===null?sc=[i]:sc.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var b=tE(i,c,t);$1(i,b);break e;case 1:l=c;var w=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Ai===null||!Ai.has(y)))){i.flags|=65536,t&=-t,i.lanes|=t;var x=nE(i,l,t);$1(i,x);break e}}i=i.return}while(i!==null)}wE(n)}catch(C){t=C,Zt===n&&n!==null&&(Zt=n=n.return);continue}break}while(!0)}function xE(){var e=af.current;return af.current=sf,e===null?sf:e}function Xv(){(sn===0||sn===3||sn===2)&&(sn=4),pn===null||!(Es&268435455)&&!(Zf&268435455)||Si(pn,yn)}function uf(e,t){var n=Ze;Ze|=2;var r=xE();(pn!==e||yn!==t)&&(ko=null,xs(e,t));do try{SN();break}catch(o){yE(e,o)}while(!0);if(Av(),Ze=n,af.current=r,Zt!==null)throw Error(ee(261));return pn=null,yn=0,sn}function SN(){for(;Zt!==null;)bE(Zt)}function jN(){for(;Zt!==null&&!QI();)bE(Zt)}function bE(e){var t=jE(e.alternate,e,ir);e.memoizedProps=e.pendingProps,t===null?wE(e):Zt=t,qv.current=null}function wE(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=gN(n,t),n!==null){n.flags&=32767,Zt=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{sn=6,Zt=null;return}}else if(n=mN(n,t,ir),n!==null){Zt=n;return}if(t=t.sibling,t!==null){Zt=t;return}Zt=t=e}while(t!==null);sn===0&&(sn=5)}function ss(e,t,n){var r=dt,o=jr.transition;try{jr.transition=null,dt=1,CN(e,t,n,r)}finally{jr.transition=o,dt=r}return null}function CN(e,t,n,r){do Ba();while(Ti!==null);if(Ze&6)throw Error(ee(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(ee(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(oA(e,i),e===pn&&(Zt=pn=null,yn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||id||(id=!0,CE(Wd,function(){return Ba(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=jr.transition,jr.transition=null;var a=dt;dt=1;var l=Ze;Ze|=4,qv.current=null,yN(e,n),mE(n,e),WA(Bm),qd=!!zm,Bm=zm=null,e.current=n,xN(n),KI(),Ze=l,dt=a,jr.transition=i}else e.current=n;if(id&&(id=!1,Ti=e,cf=o),i=e.pendingLanes,i===0&&(Ai=null),JI(n.stateNode),Yn(e,Kt()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(lf)throw lf=!1,e=ag,ag=null,e;return cf&1&&e.tag!==0&&Ba(),i=e.pendingLanes,i&1?e===lg?ac++:(ac=0,lg=e):ac=0,Ki(),null}function Ba(){if(Ti!==null){var e=eC(cf),t=jr.transition,n=dt;try{if(jr.transition=null,dt=16>e?16:e,Ti===null)var r=!1;else{if(e=Ti,Ti=null,cf=0,Ze&6)throw Error(ee(331));var o=Ze;for(Ze|=4,be=e.current;be!==null;){var i=be,a=i.child;if(be.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(be=u;be!==null;){var d=be;switch(d.tag){case 0:case 11:case 15:ic(8,d,i)}var f=d.child;if(f!==null)f.return=d,be=f;else for(;be!==null;){d=be;var h=d.sibling,m=d.return;if(fE(d),d===u){be=null;break}if(h!==null){h.return=m,be=h;break}be=m}}}var g=i.alternate;if(g!==null){var v=g.child;if(v!==null){g.child=null;do{var S=v.sibling;v.sibling=null,v=S}while(v!==null)}}be=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,be=a;else e:for(;be!==null;){if(i=be,i.flags&2048)switch(i.tag){case 0:case 11:case 15:ic(9,i,i.return)}var b=i.sibling;if(b!==null){b.return=i.return,be=b;break e}be=i.return}}var w=e.current;for(be=w;be!==null;){a=be;var y=a.child;if(a.subtreeFlags&2064&&y!==null)y.return=a,be=y;else e:for(a=w;be!==null;){if(l=be,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Jf(9,l)}}catch(C){Ht(l,l.return,C)}if(l===a){be=null;break e}var x=l.sibling;if(x!==null){x.return=l.return,be=x;break e}be=l.return}}if(Ze=o,Ki(),uo&&typeof uo.onPostCommitFiberRoot=="function")try{uo.onPostCommitFiberRoot(Wf,e)}catch{}r=!0}return r}finally{dt=n,jr.transition=t}}return!1}function sb(e,t,n){t=Xa(n,t),t=tE(e,t,1),e=Ii(e,t,1),t=Fn(),e!==null&&(Kc(e,1,t),Yn(e,t))}function Ht(e,t,n){if(e.tag===3)sb(e,e,n);else for(;t!==null;){if(t.tag===3){sb(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ai===null||!Ai.has(r))){e=Xa(n,e),e=nE(t,e,1),t=Ii(t,e,1),e=Fn(),t!==null&&(Kc(t,1,e),Yn(t,e));break}}t=t.return}}function EN(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Fn(),e.pingedLanes|=e.suspendedLanes&n,pn===e&&(yn&n)===n&&(sn===4||sn===3&&(yn&130023424)===yn&&500>Kt()-Qv?xs(e,0):Gv|=n),Yn(e,t)}function SE(e,t){t===0&&(e.mode&1?(t=Ku,Ku<<=1,!(Ku&130023424)&&(Ku=4194304)):t=1);var n=Fn();e=zo(e,t),e!==null&&(Kc(e,t,n),Yn(e,n))}function TN(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),SE(e,n)}function PN(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(ee(314))}r!==null&&r.delete(t),SE(e,n)}var jE;jE=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Qn.current)Gn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Gn=!1,pN(e,t,n);Gn=!!(e.flags&131072)}else Gn=!1,Nt&&t.flags&1048576&&TC(t,Zd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;kd(e,t),e=t.pendingProps;var o=Ga(t,_n.current);za(t,n),o=Bv(null,t,r,e,o,n);var i=Uv();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Kn(r)?(i=!0,Xd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Ov(t),o.updater=Yf,t.stateNode=o,o._reactInternals=t,Ym(t,r,e,n),t=Zm(null,t,r,!0,i,n)):(t.tag=0,Nt&&i&&Rv(t),Mn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(kd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=RN(r),e=Lr(r,e),o){case 0:t=Jm(null,t,r,e,n);break e;case 1:t=Y1(null,t,r,e,n);break e;case 11:t=Q1(null,t,r,e,n);break e;case 14:t=K1(null,t,r,Lr(r.type,e),n);break e}throw Error(ee(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),Jm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),Y1(e,t,r,o,n);case 3:e:{if(sE(t),e===null)throw Error(ee(387));r=t.pendingProps,i=t.memoizedState,o=i.element,_C(e,t),nf(t,r,null,n);var a=t.memoizedState;if(r=a.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Xa(Error(ee(423)),t),t=X1(e,t,r,n,o);break e}else if(r!==o){o=Xa(Error(ee(424)),t),t=X1(e,t,r,n,o);break e}else for(lr=Di(t.stateNode.containerInfo.firstChild),ur=t,Nt=!0,zr=null,n=NC(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Qa(),r===o){t=Bo(e,t,n);break e}Mn(e,t,r,n)}t=t.child}return t;case 5:return MC(t),e===null&&Gm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,Um(r,o)?a=null:i!==null&&Um(r,i)&&(t.flags|=32),iE(e,t),Mn(e,t,a,n),t.child;case 6:return e===null&&Gm(t),null;case 13:return aE(e,t,n);case 4:return Lv(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ka(t,null,r,n):Mn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),Q1(e,t,r,o,n);case 7:return Mn(e,t,t.pendingProps,n),t.child;case 8:return Mn(e,t,t.pendingProps.children,n),t.child;case 12:return Mn(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,Et(ef,r._currentValue),r._currentValue=a,i!==null)if(qr(i.value,a)){if(i.children===o.children&&!Qn.current){t=Bo(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){a=i.child;for(var c=l.firstContext;c!==null;){if(c.context===r){if(i.tag===1){c=No(-1,n&-n),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=n,c=i.alternate,c!==null&&(c.lanes|=n),Qm(i.return,n,t),l.lanes|=n;break}c=c.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(ee(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),Qm(a,n,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Mn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,za(t,n),o=Tr(o),r=r(o),t.flags|=1,Mn(e,t,r,n),t.child;case 14:return r=t.type,o=Lr(r,t.pendingProps),o=Lr(r.type,o),K1(e,t,r,o,n);case 15:return rE(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Lr(r,o),kd(e,t),t.tag=1,Kn(r)?(e=!0,Xd(t)):e=!1,za(t,n),IC(t,r,o),Ym(t,r,o,n),Zm(null,t,r,!0,e,n);case 19:return lE(e,t,n);case 22:return oE(e,t,n)}throw Error(ee(156,t.tag))};function CE(e,t){return Yj(e,t)}function kN(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Sr(e,t,n,r){return new kN(e,t,n,r)}function Jv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function RN(e){if(typeof e=="function")return Jv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===vv)return 11;if(e===yv)return 14}return 2}function Mi(e,t){var n=e.alternate;return n===null?(n=Sr(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Dd(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")Jv(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case ba:return bs(n.children,o,i,t);case gv:a=8,o|=8;break;case bm:return e=Sr(12,n,t,o|2),e.elementType=bm,e.lanes=i,e;case wm:return e=Sr(13,n,t,o),e.elementType=wm,e.lanes=i,e;case Sm:return e=Sr(19,n,t,o),e.elementType=Sm,e.lanes=i,e;case Aj:return eh(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Dj:a=10;break e;case Ij:a=9;break e;case vv:a=11;break e;case yv:a=14;break e;case mi:a=16,r=null;break e}throw Error(ee(130,e==null?e:typeof e,""))}return t=Sr(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function bs(e,t,n,r){return e=Sr(7,e,r,t),e.lanes=n,e}function eh(e,t,n,r){return e=Sr(22,e,r,t),e.elementType=Aj,e.lanes=n,e.stateNode={isHidden:!1},e}function Up(e,t,n){return e=Sr(6,e,null,t),e.lanes=n,e}function Vp(e,t,n){return t=Sr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function _N(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=jp(0),this.expirationTimes=jp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=jp(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Zv(e,t,n,r,o,i,a,l,c){return e=new _N(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Sr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Ov(i),e}function DN(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xa,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function EE(e){if(!e)return Fi;e=e._reactInternals;e:{if(Us(e)!==e||e.tag!==1)throw Error(ee(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Kn(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(ee(171))}if(e.tag===1){var n=e.type;if(Kn(n))return CC(e,n,t)}return t}function TE(e,t,n,r,o,i,a,l,c){return e=Zv(n,r,!0,e,o,i,a,l,c),e.context=EE(null),n=e.current,r=Fn(),o=Ni(n),i=No(r,o),i.callback=t??null,Ii(n,i,o),e.current.lanes=o,Kc(e,o,r),Yn(e,r),e}function th(e,t,n,r){var o=t.current,i=Fn(),a=Ni(o);return n=EE(n),t.context===null?t.context=n:t.pendingContext=n,t=No(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=Ii(o,t,a),e!==null&&(Wr(e,o,a,i),Ed(e,o,a)),a}function df(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function ab(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ey(e,t){ab(e,t),(e=e.alternate)&&ab(e,t)}function IN(){return null}var PE=typeof reportError=="function"?reportError:function(e){console.error(e)};function ty(e){this._internalRoot=e}nh.prototype.render=ty.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(ee(409));th(e,t,null,null)};nh.prototype.unmount=ty.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Ts(function(){th(null,e,null,null)}),t[Fo]=null}};function nh(e){this._internalRoot=e}nh.prototype.unstable_scheduleHydration=function(e){if(e){var t=rC();e={blockedOn:null,target:e,priority:t};for(var n=0;n<wi.length&&t!==0&&t<wi[n].priority;n++);wi.splice(n,0,e),n===0&&iC(e)}};function ny(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function rh(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function lb(){}function AN(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=df(a);i.call(u)}}var a=TE(t,r,e,0,null,!1,!1,"",lb);return e._reactRootContainer=a,e[Fo]=a.current,bc(e.nodeType===8?e.parentNode:e),Ts(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=df(c);l.call(u)}}var c=Zv(e,0,!1,null,null,!1,!1,"",lb);return e._reactRootContainer=c,e[Fo]=c.current,bc(e.nodeType===8?e.parentNode:e),Ts(function(){th(t,c,n,r)}),c}function oh(e,t,n,r,o){var i=n._reactRootContainer;if(i){var a=i;if(typeof o=="function"){var l=o;o=function(){var c=df(a);l.call(c)}}th(t,a,e,o)}else a=AN(n,t,e,o,r);return df(a)}tC=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Ql(t.pendingLanes);n!==0&&(wv(t,n|1),Yn(t,Kt()),!(Ze&6)&&(Ja=Kt()+500,Ki()))}break;case 13:Ts(function(){var r=zo(e,1);if(r!==null){var o=Fn();Wr(r,e,1,o)}}),ey(e,1)}};Sv=function(e){if(e.tag===13){var t=zo(e,134217728);if(t!==null){var n=Fn();Wr(t,e,134217728,n)}ey(e,134217728)}};nC=function(e){if(e.tag===13){var t=Ni(e),n=zo(e,t);if(n!==null){var r=Fn();Wr(n,e,t,r)}ey(e,t)}};rC=function(){return dt};oC=function(e,t){var n=dt;try{return dt=e,t()}finally{dt=n}};Im=function(e,t,n){switch(t){case"input":if(Em(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=Qf(r);if(!o)throw Error(ee(90));Mj(r),Em(r,o)}}}break;case"textarea":Lj(e,n);break;case"select":t=n.value,t!=null&&Oa(e,!!n.multiple,t,!1)}};Wj=Kv;Hj=Ts;var NN={usingClientEntryPoint:!1,Events:[Xc,Ca,Qf,Uj,Vj,Kv]},Fl={findFiberByHostInstance:hs,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},MN={bundleType:Fl.bundleType,version:Fl.version,rendererPackageName:Fl.rendererPackageName,rendererConfig:Fl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Xo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Qj(e),e===null?null:e.stateNode},findFiberByHostInstance:Fl.findFiberByHostInstance||IN,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sd.isDisabled&&sd.supportsFiber)try{Wf=sd.inject(MN),uo=sd}catch{}}pr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=NN;pr.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ny(t))throw Error(ee(200));return DN(e,t,null,n)};pr.createRoot=function(e,t){if(!ny(e))throw Error(ee(299));var n=!1,r="",o=PE;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Zv(e,1,!1,null,null,n,!1,r,o),e[Fo]=t.current,bc(e.nodeType===8?e.parentNode:e),new ty(t)};pr.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(ee(188)):(e=Object.keys(e).join(","),Error(ee(268,e)));return e=Qj(t),e=e===null?null:e.stateNode,e};pr.flushSync=function(e){return Ts(e)};pr.hydrate=function(e,t,n){if(!rh(t))throw Error(ee(200));return oh(null,e,t,!0,n)};pr.hydrateRoot=function(e,t,n){if(!ny(e))throw Error(ee(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=PE;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=TE(t,null,e,1,n??null,o,!1,i,a),e[Fo]=t.current,bc(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new nh(t)};pr.render=function(e,t,n){if(!rh(t))throw Error(ee(200));return oh(null,e,t,!1,n)};pr.unmountComponentAtNode=function(e){if(!rh(e))throw Error(ee(40));return e._reactRootContainer?(Ts(function(){oh(null,null,e,!1,function(){e._reactRootContainer=null,e[Fo]=null})}),!0):!1};pr.unstable_batchedUpdates=Kv;pr.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!rh(n))throw Error(ee(200));if(e==null||e._reactInternals===void 0)throw Error(ee(38));return oh(e,t,n,!1,r)};pr.version="18.2.0-next-9e3b772b8-20220608";function kE(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(kE)}catch(e){console.error(e)}}kE(),Tj.exports=pr;var Zc=Tj.exports;const Da=Xg(Zc),ON=$S({__proto__:null,default:Da},[Zc]),[LN,Rr]=Un("ScrollArea.Root component was not found in tree");function Za(e,t){const n=cs(t);ul(()=>{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 $N=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Rr(),[i,a]=p.useState(0),[l,c]=p.useState(0),u=!!(i&&l);return Za(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),Za(o.scrollbarY,()=>{var f;const d=((f=o.scrollbarY)==null?void 0:f.offsetWidth)||0;o.onCornerWidthChange(d),a(d)}),u?s.jsx("div",{...r,ref:t,style:{...n,width:i,height:l}}):null}),FN=p.forwardRef((e,t)=>{const n=Rr(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx($N,{...e,ref:t}):null}),zN={scrollHideDelay:1e3,type:"hover"},RE=p.forwardRef((e,t)=>{const n=V("ScrollAreaRoot",zN,e),{type:r,scrollHideDelay:o,scrollbars:i,...a}=n,[l,c]=p.useState(null),[u,d]=p.useState(null),[f,h]=p.useState(null),[m,g]=p.useState(null),[v,S]=p.useState(null),[b,w]=p.useState(0),[y,x]=p.useState(0),[C,E]=p.useState(!1),[T,j]=p.useState(!1),R=nn(t,k=>c(k));return s.jsx(LN,{value:{type:r,scrollHideDelay:o,scrollArea:l,viewport:u,onViewportChange:d,content:f,onContentChange:h,scrollbarX:m,onScrollbarXChange:g,scrollbarXEnabled:C,onScrollbarXEnabledChange:E,scrollbarY:v,onScrollbarYChange:S,scrollbarYEnabled:T,onScrollbarYEnabledChange:j,onCornerWidthChange:w,onCornerHeightChange:x},children:s.jsx(q,{...a,ref:R,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${b}px`,"--sa-corner-height":i!=="xy"?"0px":`${y}px`}})})});RE.displayName="@mantine/core/ScrollAreaRoot";function _E(e,t){const n=e/t;return Number.isNaN(n)?0:n}function ih(e){const t=_E(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function DE(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 BN(e,[t,n]){return Math.min(n,Math.max(t,e))}function cb(e,t,n="ltr"){const r=ih(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,i=t.scrollbar.size-o,a=t.content-t.viewport,l=i-r,c=n==="ltr"?[0,a]:[a*-1,0],u=BN(e,c);return DE([0,a],[0,l])(u)}function UN(e,t,n,r="ltr"){const o=ih(n),i=o/2,a=t||i,l=o-a,c=n.scrollbar.paddingStart+a,u=n.scrollbar.size-n.scrollbar.paddingEnd-l,d=n.content-n.viewport,f=r==="ltr"?[0,d]:[d*-1,0];return DE([c,u],f)(e)}function IE(e,t){return e>0&&e<t}function ff(e){return e?parseInt(e,10):0}function ws(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[VN,AE]=Un("ScrollAreaScrollbar was not found in tree"),NE=p.forwardRef((e,t)=>{const{sizes:n,hasThumb:r,onThumbChange:o,onThumbPointerUp:i,onThumbPointerDown:a,onThumbPositionChange:l,onDragScroll:c,onWheelScroll:u,onResize:d,...f}=e,h=Rr(),[m,g]=p.useState(null),v=nn(t,j=>g(j)),S=p.useRef(null),b=p.useRef(""),{viewport:w}=h,y=n.content-n.viewport,x=cs(u),C=cs(l),E=zf(d,10),T=j=>{if(S.current){const R=j.clientX-S.current.left,k=j.clientY-S.current.top;c({x:R,y:k})}};return p.useEffect(()=>{const j=R=>{const k=R.target;(m==null?void 0:m.contains(k))&&x(R,y)};return document.addEventListener("wheel",j,{passive:!1}),()=>document.removeEventListener("wheel",j,{passive:!1})},[w,m,y,x]),p.useEffect(C,[n,C]),Za(m,E),Za(h.content,E),s.jsx(VN,{value:{scrollbar:m,hasThumb:r,onThumbChange:cs(o),onThumbPointerUp:cs(i),onThumbPositionChange:C,onThumbPointerDown:cs(a)},children:s.jsx("div",{...f,ref:v,"data-mantine-scrollbar":!0,style:{position:"absolute",...f.style},onPointerDown:ws(e.onPointerDown,j=>{j.preventDefault(),j.button===0&&(j.target.setPointerCapture(j.pointerId),S.current=m.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",T(j))}),onPointerMove:ws(e.onPointerMove,T),onPointerUp:ws(e.onPointerUp,j=>{j.preventDefault();const R=j.target;R.hasPointerCapture(j.pointerId)&&R.releasePointerCapture(j.pointerId),document.body.style.webkitUserSelect=b.current,S.current=null})})})}),WN=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Rr(),[l,c]=p.useState(),u=p.useRef(null),d=nn(t,u,a.onScrollbarXChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),s.jsx(NE,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${ih(n)}px`},onThumbPointerDown:f=>e.onThumbPointerDown(f.x),onDragScroll:f=>e.onDragScroll(f.x),onWheelScroll:(f,h)=>{if(a.viewport){const m=a.viewport.scrollLeft+f.deltaX;e.onWheelScroll(m),IE(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&a.viewport&&l&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:u.current.clientWidth,paddingStart:ff(l.paddingLeft),paddingEnd:ff(l.paddingRight)}})}})}),HN=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Rr(),[l,c]=p.useState(),u=p.useRef(null),d=nn(t,u,a.onScrollbarYChange);return p.useEffect(()=>{u.current&&c(window.getComputedStyle(u.current))},[]),s.jsx(NE,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${ih(n)}px`,...o},onThumbPointerDown:f=>e.onThumbPointerDown(f.y),onDragScroll:f=>e.onDragScroll(f.y),onWheelScroll:(f,h)=>{if(a.viewport){const m=a.viewport.scrollTop+f.deltaY;e.onWheelScroll(m),IE(m,h)&&f.preventDefault()}},onResize:()=>{u.current&&a.viewport&&l&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:u.current.clientHeight,paddingStart:ff(l.paddingTop),paddingEnd:ff(l.paddingBottom)}})}})}),ry=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=zs(),i=Rr(),a=p.useRef(null),l=p.useRef(0),[c,u]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=_E(c.viewport,c.content),f={...r,sizes:c,onSizesChange:u,hasThumb:d>0&&d<1,onThumbChange:m=>{a.current=m},onThumbPointerUp:()=>{l.current=0},onThumbPointerDown:m=>{l.current=m}},h=(m,g)=>UN(m,l.current,c,g);return n==="horizontal"?s.jsx(WN,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollLeft,g=cb(m,c,o);a.current.style.transform=`translate3d(${g}px, 0, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollLeft=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollLeft=h(m,o))}}):n==="vertical"?s.jsx(HN,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollTop,g=cb(m,c);c.scrollbar.size===0?a.current.style.opacity="0":a.current.style.opacity="1",a.current.style.transform=`translate3d(0, ${g}px, 0)`}},onWheelScroll:m=>{i.viewport&&(i.viewport.scrollTop=m)},onDragScroll:m=>{i.viewport&&(i.viewport.scrollTop=h(m))}}):null}),ME=p.forwardRef((e,t)=>{const n=Rr(),{forceMount:r,...o}=e,[i,a]=p.useState(!1),l=e.orientation==="horizontal",c=zf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?u:d)}},10);return Za(n.viewport,c),Za(n.content,c),r||i?s.jsx(ry,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),qN=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Rr(),[i,a]=p.useState(!1);return p.useEffect(()=>{const{scrollArea:l}=o;let c=0;if(l){const u=()=>{window.clearTimeout(c),a(!0)},d=()=>{c=window.setTimeout(()=>a(!1),o.scrollHideDelay)};return l.addEventListener("pointerenter",u),l.addEventListener("pointerleave",d),()=>{window.clearTimeout(c),l.removeEventListener("pointerenter",u),l.removeEventListener("pointerleave",d)}}},[o.scrollArea,o.scrollHideDelay]),n||i?s.jsx(ME,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),GN=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Rr(),i=e.orientation==="horizontal",[a,l]=p.useState("hidden"),c=zf(()=>l("idle"),100);return p.useEffect(()=>{if(a==="idle"){const u=window.setTimeout(()=>l("hidden"),o.scrollHideDelay);return()=>window.clearTimeout(u)}},[a,o.scrollHideDelay]),p.useEffect(()=>{const{viewport:u}=o,d=i?"scrollLeft":"scrollTop";if(u){let f=u[d];const h=()=>{const m=u[d];f!==m&&(l("scrolling"),c()),f=m};return u.addEventListener("scroll",h),()=>u.removeEventListener("scroll",h)}},[o.viewport,i,c]),n||a!=="hidden"?s.jsx(ry,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:ws(e.onPointerEnter,()=>l("interacting")),onPointerLeave:ws(e.onPointerLeave,()=>l("idle"))}):null}),ub=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Rr(),{onScrollbarXEnabledChange:i,onScrollbarYEnabledChange:a}=o,l=e.orientation==="horizontal";return p.useEffect(()=>(l?i(!0):a(!0),()=>{l?i(!1):a(!1)}),[l,i,a]),o.type==="hover"?s.jsx(qN,{...r,ref:t,forceMount:n}):o.type==="scroll"?s.jsx(GN,{...r,ref:t,forceMount:n}):o.type==="auto"?s.jsx(ME,{...r,ref:t,forceMount:n}):o.type==="always"?s.jsx(ry,{...r,ref:t}):null});function QN(e,t=()=>{}){let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const i={left:e.scrollLeft,top:e.scrollTop},a=n.left!==i.left,l=n.top!==i.top;(a||l)&&t(),n=i,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)}const KN=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Rr(),i=AE(),{onThumbPositionChange:a}=i,l=nn(t,d=>i.onThumbChange(d)),c=p.useRef(),u=zf(()=>{c.current&&(c.current(),c.current=void 0)},100);return p.useEffect(()=>{const{viewport:d}=o;if(d){const f=()=>{if(u(),!c.current){const h=QN(d,a);c.current=h,a()}};return a(),d.addEventListener("scroll",f),()=>d.removeEventListener("scroll",f)}},[o.viewport,u,a]),s.jsx("div",{"data-state":i.hasThumb?"visible":"hidden",...r,ref:l,style:{width:"var(--sa-thumb-width)",height:"var(--sa-thumb-height)",...n},onPointerDownCapture:ws(e.onPointerDownCapture,d=>{const h=d.target.getBoundingClientRect(),m=d.clientX-h.left,g=d.clientY-h.top;i.onThumbPointerDown({x:m,y:g})}),onPointerUp:ws(e.onPointerUp,i.onThumbPointerUp)})}),db=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=AE();return n||o.hasThumb?s.jsx(KN,{ref:t,...r}):null}),OE=p.forwardRef(({children:e,style:t,...n},r)=>{const o=Rr(),i=nn(r,o.onViewportChange);return s.jsx(q,{...n,ref:i,style:{overflowX:o.scrollbarXEnabled?"scroll":"hidden",overflowY:o.scrollbarYEnabled?"scroll":"hidden",...t},children:s.jsx("div",{style:{minWidth:"100%",display:"table"},ref:o.onContentChange,children:e})})});OE.displayName="@mantine/core/ScrollAreaViewport";var oy={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const LE={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},YN=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":U(t)}}),_r=Y((e,t)=>{const n=V("ScrollArea",LE,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,scrollbarSize:c,vars:u,type:d,scrollHideDelay:f,viewportProps:h,viewportRef:m,onScrollPositionChange:g,children:v,offsetScrollbars:S,scrollbars:b,onBottomReached:w,onTopReached:y,...x}=n,[C,E]=p.useState(!1),T=he({name:"ScrollArea",props:n,classes:oy,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:YN});return s.jsxs(RE,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:b,...T("root"),...x,children:[s.jsx(OE,{...h,...T("viewport",{style:h==null?void 0:h.style}),ref:m,"data-offset-scrollbars":S===!0?"xy":S||void 0,"data-scrollbars":b||void 0,onScroll:j=>{var O;(O=h==null?void 0:h.onScroll)==null||O.call(h,j),g==null||g({x:j.currentTarget.scrollLeft,y:j.currentTarget.scrollTop});const{scrollTop:R,scrollHeight:k,clientHeight:I}=j.currentTarget;R-(k-I)===0&&(w==null||w()),R===0&&(y==null||y())},children:v}),(b==="xy"||b==="x")&&s.jsx(ub,{...T("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),children:s.jsx(db,{...T("thumb")})}),(b==="xy"||b==="y")&&s.jsx(ub,{...T("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),children:s.jsx(db,{...T("thumb")})}),s.jsx(FN,{...T("corner"),"data-hovered":C||void 0,"data-hidden":d==="never"||void 0})]})});_r.displayName="@mantine/core/ScrollArea";const sh=Y((e,t)=>{const{children:n,classNames:r,styles:o,scrollbarSize:i,scrollHideDelay:a,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,scrollbars:v,style:S,vars:b,onBottomReached:w,...y}=V("ScrollAreaAutosize",LE,e);return s.jsx(q,{...y,ref:t,style:[{display:"flex",overflow:"auto"},S],children:s.jsx(q,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(_r,{classNames:r,styles:o,scrollHideDelay:a,scrollbarSize:i,type:l,dir:c,offsetScrollbars:u,viewportRef:d,onScrollPositionChange:f,unstyled:h,variant:m,viewportProps:g,vars:b,scrollbars:v,onBottomReached:w,children:n})})})});_r.classes=oy;sh.displayName="@mantine/core/ScrollAreaAutosize";sh.classes=oy;_r.Autosize=sh;var $E={root:"m_87cf2631"};const XN={__staticSelector:"UnstyledButton"},Sn=In((e,t)=>{const n=V("UnstyledButton",XN,e),{className:r,component:o="button",__staticSelector:i,unstyled:a,classNames:l,styles:c,style:u,...d}=n,f=he({name:i,props:n,classes:$E,className:r,style:u,classNames:l,styles:c,unstyled:a});return s.jsx(q,{...f("root",{focusable:!0}),component:o,ref:t,type:o==="button"?"button":void 0,...d})});Sn.classes=$E;Sn.displayName="@mantine/core/UnstyledButton";var FE={root:"m_515a97f8"};const JN={},iy=Y((e,t)=>{const n=V("VisuallyHidden",JN,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,...u}=n,d=he({name:"VisuallyHidden",classes:FE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l});return s.jsx(q,{component:"span",ref:t,...d("root"),...u})});iy.classes=FE;iy.displayName="@mantine/core/VisuallyHidden";var zE={root:"m_1b7284a3"};const ZN={},e4=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:it(t),"--paper-shadow":rv(n)}}),Xn=In((e,t)=>{const n=V("Paper",ZN,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,withBorder:c,vars:u,radius:d,shadow:f,variant:h,mod:m,...g}=n,v=he({name:"Paper",props:n,classes:zE,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:e4});return s.jsx(q,{ref:t,mod:[{"data-with-border":c},m],...v("root"),variant:h,...g})});Xn.classes=zE;Xn.displayName="@mantine/core/Paper";function ah(){return typeof window<"u"}function hl(e){return BE(e)?(e.nodeName||"").toLowerCase():"#document"}function Jn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function xo(e){var t;return(t=(BE(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function BE(e){return ah()?e instanceof Node||e instanceof Jn(e).Node:!1}function Rt(e){return ah()?e instanceof Element||e instanceof Jn(e).Element:!1}function fr(e){return ah()?e instanceof HTMLElement||e instanceof Jn(e).HTMLElement:!1}function dg(e){return!ah()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Jn(e).ShadowRoot}function eu(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=kr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function t4(e){return["table","td","th"].includes(hl(e))}function lh(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function sy(e){const t=ay(),n=Rt(e)?kr(e):e;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function n4(e){let t=Uo(e);for(;fr(t)&&!zi(t);){if(sy(t))return t;if(lh(t))return null;t=Uo(t)}return null}function ay(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function zi(e){return["html","body","#document"].includes(hl(e))}function kr(e){return Jn(e).getComputedStyle(e)}function ch(e){return Rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Uo(e){if(hl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dg(e)&&e.host||xo(e);return dg(t)?t.host:t}function UE(e){const t=Uo(e);return zi(t)?e.ownerDocument?e.ownerDocument.body:e.body:fr(t)&&eu(t)?t:UE(t)}function Mo(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=UE(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=Jn(o);if(i){const l=fg(a);return t.concat(a,a.visualViewport||[],eu(o)?o:[],l&&n?Mo(l):[])}return t.concat(o,Mo(o,[],n))}function fg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fb(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 Rc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&dg(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function VE(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function WE(){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 r4(e){return s4()?!1:!hb()&&e.width===0&&e.height===0||hb()&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType==="mouse"||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType==="touch"}function o4(){return/apple/i.test(navigator.vendor)}function hb(){const e=/android/i;return e.test(VE())||e.test(WE())}function i4(){return VE().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function s4(){return WE().includes("jsdom/")}function hg(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function a4(e){return"nativeEvent"in e}function l4(e){return e.matches("html,body")}function gs(e){return(e==null?void 0:e.ownerDocument)||document}function Wp(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 va(e){return"composedPath"in e?e.composedPath()[0]:e.target}const c4="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function u4(e){return fr(e)&&e.matches(c4)}const Gr=Math.min,kn=Math.max,hf=Math.round,ad=Math.floor,Bi=e=>({x:e,y:e}),d4={left:"right",right:"left",bottom:"top",top:"bottom"},f4={start:"end",end:"start"};function pg(e,t,n){return kn(e,Gr(t,n))}function Vo(e,t){return typeof e=="function"?e(t):e}function Qr(e){return e.split("-")[0]}function pl(e){return e.split("-")[1]}function ly(e){return e==="x"?"y":"x"}function cy(e){return e==="y"?"height":"width"}function Wo(e){return["top","bottom"].includes(Qr(e))?"y":"x"}function uy(e){return ly(Wo(e))}function h4(e,t,n){n===void 0&&(n=!1);const r=pl(e),o=uy(e),i=cy(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=pf(a)),[a,pf(a)]}function p4(e){const t=pf(e);return[mg(e),t,mg(t)]}function mg(e){return e.replace(/start|end/g,t=>f4[t])}function m4(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],a=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:a;default:return[]}}function g4(e,t,n,r){const o=pl(e);let i=m4(Qr(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(mg)))),i}function pf(e){return e.replace(/left|right|bottom|top/g,t=>d4[t])}function v4(e){return{top:0,right:0,bottom:0,left:0,...e}}function dy(e){return typeof e!="number"?v4(e):{top:e,right:e,bottom:e,left:e}}function el(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 pb(e,t,n){let{reference:r,floating:o}=e;const i=Wo(t),a=uy(t),l=cy(a),c=Qr(t),u=i==="y",d=r.x+r.width/2-o.width/2,f=r.y+r.height/2-o.height/2,h=r[l]/2-o[l]/2;let m;switch(c){case"top":m={x:d,y:r.y-o.height};break;case"bottom":m={x:d,y:r.y+r.height};break;case"right":m={x:r.x+r.width,y:f};break;case"left":m={x:r.x-o.width,y:f};break;default:m={x:r.x,y:r.y}}switch(pl(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const y4=async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,l=i.filter(Boolean),c=await(a.isRTL==null?void 0:a.isRTL(t));let u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:d,y:f}=pb(u,r,c),h=r,m={},g=0;for(let v=0;v<l.length;v++){const{name:S,fn:b}=l[v],{x:w,y,data:x,reset:C}=await b({x:d,y:f,initialPlacement:r,placement:h,strategy:o,middlewareData:m,rects:u,platform:a,elements:{reference:e,floating:t}});d=w??d,f=y??f,m={...m,[S]:{...m[S],...x}},C&&g<=50&&(g++,typeof C=="object"&&(C.placement&&(h=C.placement),C.rects&&(u=C.rects===!0?await a.getElementRects({reference:e,floating:t,strategy:o}):C.rects),{x:d,y:f}=pb(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}};async function fy(e,t){var n;t===void 0&&(t={});const{x:r,y:o,platform:i,rects:a,elements:l,strategy:c}=e,{boundary:u="clippingAncestors",rootBoundary:d="viewport",elementContext:f="floating",altBoundary:h=!1,padding:m=0}=Vo(t,e),g=dy(m),S=l[h?f==="floating"?"reference":"floating":f],b=el(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(S)))==null||n?S:S.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(l.floating)),boundary:u,rootBoundary:d,strategy:c})),w=f==="floating"?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,y=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),x=await(i.isElement==null?void 0:i.isElement(y))?await(i.getScale==null?void 0:i.getScale(y))||{x:1,y:1}:{x:1,y:1},C=el(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:y,strategy:c}):w);return{top:(b.top-C.top+g.top)/x.y,bottom:(C.bottom-b.bottom+g.bottom)/x.y,left:(b.left-C.left+g.left)/x.x,right:(C.right-b.right+g.right)/x.x}}const x4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:l,middlewareData:c}=t,{element:u,padding:d=0}=Vo(e,t)||{};if(u==null)return{};const f=dy(d),h={x:n,y:r},m=uy(o),g=cy(m),v=await a.getDimensions(u),S=m==="y",b=S?"top":"left",w=S?"bottom":"right",y=S?"clientHeight":"clientWidth",x=i.reference[g]+i.reference[m]-h[m]-i.floating[g],C=h[m]-i.reference[m],E=await(a.getOffsetParent==null?void 0:a.getOffsetParent(u));let T=E?E[y]:0;(!T||!await(a.isElement==null?void 0:a.isElement(E)))&&(T=l.floating[y]||i.floating[g]);const j=x/2-C/2,R=T/2-v[g]/2-1,k=Gr(f[b],R),I=Gr(f[w],R),O=k,F=T-v[g]-I,L=T/2-v[g]/2+j,B=pg(O,L,F),D=!c.arrow&&pl(o)!=null&&L!==B&&i.reference[g]/2-(L<O?k:I)-v[g]/2<0,_=D?L<O?L-O:L-F:0;return{[m]:h[m]+_,data:{[m]:B,centerOffset:L-B-_,...D&&{alignmentOffset:_}},reset:D}}}),b4=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:l,platform:c,elements:u}=t,{mainAxis:d=!0,crossAxis:f=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...S}=Vo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=Qr(o),w=Wo(l),y=Qr(l)===l,x=await(c.isRTL==null?void 0:c.isRTL(u.floating)),C=h||(y||!v?[pf(l)]:p4(l)),E=g!=="none";!h&&E&&C.push(...g4(l,v,g,x));const T=[l,...C],j=await fy(t,S),R=[];let k=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&R.push(j[b]),f){const L=h4(o,a,x);R.push(j[L[0]],j[L[1]])}if(k=[...k,{placement:o,overflows:R}],!R.every(L=>L<=0)){var I,O;const L=(((I=i.flip)==null?void 0:I.index)||0)+1,B=T[L];if(B)return{data:{index:L,overflows:k},reset:{placement:B}};let D=(O=k.filter(_=>_.overflows[0]<=0).sort((_,P)=>_.overflows[1]-P.overflows[1])[0])==null?void 0:O.placement;if(!D)switch(m){case"bestFit":{var F;const _=(F=k.filter(P=>{if(E){const N=Wo(P.placement);return N===w||N==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(N=>N>0).reduce((N,$)=>N+$,0)]).sort((P,N)=>P[1]-N[1])[0])==null?void 0:F[0];_&&(D=_);break}case"initialPlacement":D=l;break}if(o!==D)return{reset:{placement:D}}}return{}}}};function HE(e){const t=Gr(...e.map(i=>i.left)),n=Gr(...e.map(i=>i.top)),r=kn(...e.map(i=>i.right)),o=kn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function w4(e){const t=e.slice().sort((o,i)=>o.y-i.y),n=[];let r=null;for(let o=0;o<t.length;o++){const i=t[o];!r||i.y-r.y>r.height/2?n.push([i]):n[n.length-1].push(i),r=i}return n.map(o=>el(HE(o)))}const S4=function(e){return e===void 0&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:r,rects:o,platform:i,strategy:a}=t,{padding:l=2,x:c,y:u}=Vo(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=w4(d),h=el(HE(d)),m=dy(l);function g(){if(f.length===2&&f[0].left>f[1].right&&c!=null&&u!=null)return f.find(S=>c>S.left-m.left&&c<S.right+m.right&&u>S.top-m.top&&u<S.bottom+m.bottom)||h;if(f.length>=2){if(Wo(n)==="y"){const k=f[0],I=f[f.length-1],O=Qr(n)==="top",F=k.top,L=I.bottom,B=O?k.left:I.left,D=O?k.right:I.right,_=D-B,P=L-F;return{top:F,bottom:L,left:B,right:D,width:_,height:P,x:B,y:F}}const S=Qr(n)==="left",b=kn(...f.map(k=>k.right)),w=Gr(...f.map(k=>k.left)),y=f.filter(k=>S?k.left===w:k.right===b),x=y[0].top,C=y[y.length-1].bottom,E=w,T=b,j=T-E,R=C-x;return{top:x,bottom:C,left:E,right:T,width:j,height:R,x:E,y:x}}return h}const v=await i.getElementRects({reference:{getBoundingClientRect:g},floating:r.floating,strategy:a});return o.reference.x!==v.reference.x||o.reference.y!==v.reference.y||o.reference.width!==v.reference.width||o.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}};async function j4(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Qr(n),l=pl(n),c=Wo(n)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,f=Vo(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return l&&typeof g=="number"&&(m=l==="end"?g*-1:g),c?{x:m*d,y:h*u}:{x:h*u,y:m*d}}const C4=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:l}=t,c=await j4(t,e);return a===((n=l.offset)==null?void 0:n.placement)&&(r=l.arrow)!=null&&r.alignmentOffset?{}:{x:o+c.x,y:i+c.y,data:{...c,placement:a}}}}},E4=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:l={fn:S=>{let{x:b,y:w}=S;return{x:b,y:w}}},...c}=Vo(e,t),u={x:n,y:r},d=await fy(t,c),f=Wo(Qr(o)),h=ly(f);let m=u[h],g=u[f];if(i){const S=h==="y"?"top":"left",b=h==="y"?"bottom":"right",w=m+d[S],y=m-d[b];m=pg(w,m,y)}if(a){const S=f==="y"?"top":"left",b=f==="y"?"bottom":"right",w=g+d[S],y=g-d[b];g=pg(w,g,y)}const v=l.fn({...t,[h]:m,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r,enabled:{[h]:i,[f]:a}}}}}},T4=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:l=0,mainAxis:c=!0,crossAxis:u=!0}=Vo(e,t),d={x:n,y:r},f=Wo(o),h=ly(f);let m=d[h],g=d[f];const v=Vo(l,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const y=h==="y"?"height":"width",x=i.reference[h]-i.floating[y]+S.mainAxis,C=i.reference[h]+i.reference[y]-S.mainAxis;m<x?m=x:m>C&&(m=C)}if(u){var b,w;const y=h==="y"?"width":"height",x=["top","left"].includes(Qr(o)),C=i.reference[f]-i.floating[y]+(x&&((b=a.offset)==null?void 0:b[f])||0)+(x?0:S.crossAxis),E=i.reference[f]+i.reference[y]+(x?0:((w=a.offset)==null?void 0:w[f])||0)-(x?S.crossAxis:0);g<C?g=C:g>E&&(g=E)}return{[h]:m,[f]:g}}}},P4=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:l}=t,{apply:c=()=>{},...u}=Vo(e,t),d=await fy(t,u),f=Qr(o),h=pl(o),m=Wo(o)==="y",{width:g,height:v}=i.floating;let S,b;f==="top"||f==="bottom"?(S=f,b=h===(await(a.isRTL==null?void 0:a.isRTL(l.floating))?"start":"end")?"left":"right"):(b=f,S=h==="end"?"top":"bottom");const w=v-d.top-d.bottom,y=g-d.left-d.right,x=Gr(v-d[S],w),C=Gr(g-d[b],y),E=!t.middlewareData.shift;let T=x,j=C;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(j=y),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(T=w),E&&!h){const k=kn(d.left,0),I=kn(d.right,0),O=kn(d.top,0),F=kn(d.bottom,0);m?j=g-2*(k!==0||I!==0?k+I:kn(d.left,d.right)):T=v-2*(O!==0||F!==0?O+F:kn(d.top,d.bottom))}await c({...t,availableWidth:j,availableHeight:T});const R=await a.getDimensions(l.floating);return g!==R.width||v!==R.height?{reset:{rects:!0}}:{}}}};function qE(e){const t=kr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=fr(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=hf(n)!==i||hf(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function hy(e){return Rt(e)?e:e.contextElement}function Ua(e){const t=hy(e);if(!fr(t))return Bi(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=qE(t);let a=(i?hf(n.width):n.width)/r,l=(i?hf(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const k4=Bi(0);function GE(e){const t=Jn(e);return!ay()||!t.visualViewport?k4:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function R4(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Jn(e)?!1:t}function Ps(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=hy(e);let a=Bi(1);t&&(r?Rt(r)&&(a=Ua(r)):a=Ua(e));const l=R4(i,n,r)?GE(i):Bi(0);let c=(o.left+l.x)/a.x,u=(o.top+l.y)/a.y,d=o.width/a.x,f=o.height/a.y;if(i){const h=Jn(i),m=r&&Rt(r)?Jn(r):r;let g=h,v=fg(g);for(;v&&r&&m!==g;){const S=Ua(v),b=v.getBoundingClientRect(),w=kr(v),y=b.left+(v.clientLeft+parseFloat(w.paddingLeft))*S.x,x=b.top+(v.clientTop+parseFloat(w.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,f*=S.y,c+=y,u+=x,g=Jn(v),v=fg(g)}}return el({width:d,height:f,x:c,y:u})}function _4(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=xo(r),l=t?lh(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=Bi(1);const d=Bi(0),f=fr(r);if((f||!f&&!i)&&((hl(r)!=="body"||eu(a))&&(c=ch(r)),fr(r))){const h=Ps(r);u=Ua(r),d.x=h.x+r.clientLeft,d.y=h.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-c.scrollLeft*u.x+d.x,y:n.y*u.y-c.scrollTop*u.y+d.y}}function D4(e){return Array.from(e.getClientRects())}function gg(e,t){const n=ch(e).scrollLeft;return t?t.left+n:Ps(xo(e)).left+n}function I4(e){const t=xo(e),n=ch(e),r=e.ownerDocument.body,o=kn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=kn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+gg(e);const l=-n.scrollTop;return kr(r).direction==="rtl"&&(a+=kn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}function A4(e,t){const n=Jn(e),r=xo(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,l=0,c=0;if(o){i=o.width,a=o.height;const u=ay();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function N4(e,t){const n=Ps(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=fr(e)?Ua(e):Bi(1),a=e.clientWidth*i.x,l=e.clientHeight*i.y,c=o*i.x,u=r*i.y;return{width:a,height:l,x:c,y:u}}function mb(e,t,n){let r;if(t==="viewport")r=A4(e,n);else if(t==="document")r=I4(xo(e));else if(Rt(t))r=N4(t,n);else{const o=GE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return el(r)}function QE(e,t){const n=Uo(e);return n===t||!Rt(n)||zi(n)?!1:kr(n).position==="fixed"||QE(n,t)}function M4(e,t){const n=t.get(e);if(n)return n;let r=Mo(e,[],!1).filter(l=>Rt(l)&&hl(l)!=="body"),o=null;const i=kr(e).position==="fixed";let a=i?Uo(e):e;for(;Rt(a)&&!zi(a);){const l=kr(a),c=sy(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||eu(a)&&!c&&QE(e,a))?r=r.filter(d=>d!==a):o=l,a=Uo(a)}return t.set(e,r),r}function O4(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?lh(t)?[]:M4(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((u,d)=>{const f=mb(t,d,o);return u.top=kn(f.top,u.top),u.right=Gr(f.right,u.right),u.bottom=Gr(f.bottom,u.bottom),u.left=kn(f.left,u.left),u},mb(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function L4(e){const{width:t,height:n}=qE(e);return{width:t,height:n}}function $4(e,t,n){const r=fr(t),o=xo(t),i=n==="fixed",a=Ps(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=Bi(0);if(r||!r&&!i)if((hl(t)!=="body"||eu(o))&&(l=ch(t)),r){const m=Ps(t,!0,i,t);c.x=m.x+t.clientLeft,c.y=m.y+t.clientTop}else o&&(c.x=gg(o));let u=0,d=0;if(o&&!r&&!i){const m=o.getBoundingClientRect();d=m.top+l.scrollTop,u=m.left+l.scrollLeft-gg(o,m)}const f=a.left+l.scrollLeft-c.x-u,h=a.top+l.scrollTop-c.y-d;return{x:f,y:h,width:a.width,height:a.height}}function Hp(e){return kr(e).position==="static"}function gb(e,t){if(!fr(e)||kr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return xo(e)===n&&(n=n.ownerDocument.body),n}function KE(e,t){const n=Jn(e);if(lh(e))return n;if(!fr(e)){let o=Uo(e);for(;o&&!zi(o);){if(Rt(o)&&!Hp(o))return o;o=Uo(o)}return n}let r=gb(e,t);for(;r&&t4(r)&&Hp(r);)r=gb(r,t);return r&&zi(r)&&Hp(r)&&!sy(r)?n:r||n4(e)||n}const F4=async function(e){const t=this.getOffsetParent||KE,n=this.getDimensions,r=await n(e.floating);return{reference:$4(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function z4(e){return kr(e).direction==="rtl"}const B4={convertOffsetParentRelativeRectToViewportRelativeRect:_4,getDocumentElement:xo,getClippingRect:O4,getOffsetParent:KE,getElementRects:F4,getClientRects:D4,getDimensions:L4,getScale:Ua,isElement:Rt,isRTL:z4};function U4(e,t){let n=null,r;const o=xo(e);function i(){var l;clearTimeout(r),(l=n)==null||l.disconnect(),n=null}function a(l,c){l===void 0&&(l=!1),c===void 0&&(c=1),i();const{left:u,top:d,width:f,height:h}=e.getBoundingClientRect();if(l||t(),!f||!h)return;const m=ad(d),g=ad(o.clientWidth-(u+f)),v=ad(o.clientHeight-(d+h)),S=ad(u),w={rootMargin:-m+"px "+-g+"px "+-v+"px "+-S+"px",threshold:kn(0,Gr(1,c))||1};let y=!0;function x(C){const E=C[0].intersectionRatio;if(E!==c){if(!y)return a();E?a(!1,E):r=setTimeout(()=>{a(!1,1e-7)},1e3)}y=!1}try{n=new IntersectionObserver(x,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(x,w)}n.observe(e)}return a(!0),i}function V4(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:l=typeof IntersectionObserver=="function",animationFrame:c=!1}=r,u=hy(e),d=o||i?[...u?Mo(u):[],...Mo(t)]:[];d.forEach(b=>{o&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const f=u&&l?U4(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(b=>{let[w]=b;w&&w.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var y;(y=m)==null||y.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,v=c?Ps(e):null;c&&S();function S(){const b=Ps(e);v&&(b.x!==v.x||b.y!==v.y||b.width!==v.width||b.height!==v.height)&&n(),v=b,g=requestAnimationFrame(S)}return n(),()=>{var b;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(b=m)==null||b.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const W4=C4,H4=E4,q4=b4,G4=P4,vb=x4,Q4=S4,K4=T4,Y4=(e,t,n)=>{const r=new Map,o={platform:B4,...n},i={...o.platform,_c:r};return y4(e,t,{...o,platform:i})};var Id=typeof document<"u"?p.useLayoutEffect:p.useEffect;function mf(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(!mf(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;r--!==0;){const i=o[r];if(!(i==="_owner"&&e.$$typeof)&&!mf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function YE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function yb(e,t){const n=YE(e);return Math.round(t*n)/n}function qp(e){const t=p.useRef(e);return Id(()=>{t.current=e}),t}function X4(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:o,elements:{reference:i,floating:a}={},transform:l=!0,whileElementsMounted:c,open:u}=e,[d,f]=p.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[h,m]=p.useState(r);mf(h,r)||m(r);const[g,v]=p.useState(null),[S,b]=p.useState(null),w=p.useCallback(P=>{P!==E.current&&(E.current=P,v(P))},[]),y=p.useCallback(P=>{P!==T.current&&(T.current=P,b(P))},[]),x=i||g,C=a||S,E=p.useRef(null),T=p.useRef(null),j=p.useRef(d),R=c!=null,k=qp(c),I=qp(o),O=qp(u),F=p.useCallback(()=>{if(!E.current||!T.current)return;const P={placement:t,strategy:n,middleware:h};I.current&&(P.platform=I.current),Y4(E.current,T.current,P).then(N=>{const $={...N,isPositioned:O.current!==!1};L.current&&!mf(j.current,$)&&(j.current=$,Zc.flushSync(()=>{f($)}))})},[h,t,n,I,O]);Id(()=>{u===!1&&j.current.isPositioned&&(j.current.isPositioned=!1,f(P=>({...P,isPositioned:!1})))},[u]);const L=p.useRef(!1);Id(()=>(L.current=!0,()=>{L.current=!1}),[]),Id(()=>{if(x&&(E.current=x),C&&(T.current=C),x&&C){if(k.current)return k.current(x,C,F);F()}},[x,C,F,k,R]);const B=p.useMemo(()=>({reference:E,floating:T,setReference:w,setFloating:y}),[w,y]),D=p.useMemo(()=>({reference:x,floating:C}),[x,C]),_=p.useMemo(()=>{const P={position:n,left:0,top:0};if(!D.floating)return P;const N=yb(D.floating,d.x),$=yb(D.floating,d.y);return l?{...P,transform:"translate("+N+"px, "+$+"px)",...YE(D.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:N,top:$}},[n,l,D.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:F,refs:B,elements:D,floatingStyles:_}),[d,F,B,D,_])}const J4=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?vb({element:r.current,padding:o}).fn(n):{}:r?vb({element:r,padding:o}).fn(n):{}}}},XE=(e,t)=>({...W4(e),options:[e,t]}),py=(e,t)=>({...H4(e),options:[e,t]}),xb=(e,t)=>({...K4(e),options:[e,t]}),vg=(e,t)=>({...q4(e),options:[e,t]}),Z4=(e,t)=>({...G4(e),options:[e,t]}),yg=(e,t)=>({...Q4(e),options:[e,t]}),JE=(e,t)=>({...J4(e),options:[e,t]}),ZE={...QS},e3=ZE.useInsertionEffect,t3=e3||(e=>e());function ji(e){const t=p.useRef(()=>{});return t3(()=>{t.current=e}),p.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)},[])}var ho=typeof document<"u"?p.useLayoutEffect:p.useEffect;let bb=!1,n3=0;const wb=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+n3++;function r3(){const[e,t]=p.useState(()=>bb?wb():void 0);return ho(()=>{e==null&&t(wb())},[]),p.useEffect(()=>{bb=!0},[]),e}const o3=ZE.useId,eT=o3||r3;function i3(){const e=new Map;return{emit(t,n){var r;(r=e.get(t))==null||r.forEach(o=>o(n))},on(t,n){e.set(t,[...e.get(t)||[],n])},off(t,n){var r;e.set(t,((r=e.get(t))==null?void 0:r.filter(o=>o!==n))||[])}}}const s3=p.createContext(null),a3=p.createContext(null),my=()=>{var e;return((e=p.useContext(s3))==null?void 0:e.id)||null},gy=()=>p.useContext(a3);function vy(e){return"data-floating-ui-"+e}function Gp(e){const t=p.useRef(e);return ho(()=>{t.current=e}),t}const Sb=vy("safe-polygon");function Ad(e,t,n){return n&&!hg(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function l3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:a}=e,{enabled:l=!0,delay:c=0,handleClose:u=null,mouseOnly:d=!1,restMs:f=0,move:h=!0}=t,m=gy(),g=my(),v=Gp(u),S=Gp(c),b=Gp(n),w=p.useRef(),y=p.useRef(-1),x=p.useRef(),C=p.useRef(-1),E=p.useRef(!0),T=p.useRef(!1),j=p.useRef(()=>{}),R=p.useCallback(()=>{var B;const D=(B=o.current.openEvent)==null?void 0:B.type;return(D==null?void 0:D.includes("mouse"))&&D!=="mousedown"},[o]);p.useEffect(()=>{if(!l)return;function B(D){let{open:_}=D;_||(clearTimeout(y.current),clearTimeout(C.current),E.current=!0)}return i.on("openchange",B),()=>{i.off("openchange",B)}},[l,i]),p.useEffect(()=>{if(!l||!v.current||!n)return;function B(_){R()&&r(!1,_,"hover")}const D=gs(a.floating).documentElement;return D.addEventListener("mouseleave",B),()=>{D.removeEventListener("mouseleave",B)}},[a.floating,n,r,l,v,R]);const k=p.useCallback(function(B,D,_){D===void 0&&(D=!0),_===void 0&&(_="hover");const P=Ad(S.current,"close",w.current);P&&!x.current?(clearTimeout(y.current),y.current=window.setTimeout(()=>r(!1,B,_),P)):D&&(clearTimeout(y.current),r(!1,B,_))},[S,r]),I=ji(()=>{j.current(),x.current=void 0}),O=ji(()=>{if(T.current){const B=gs(a.floating).body;B.style.pointerEvents="",B.removeAttribute(Sb),T.current=!1}});p.useEffect(()=>{if(!l)return;function B(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function D($){if(clearTimeout(y.current),E.current=!1,d&&!hg(w.current)||f>0&&!Ad(S.current,"open"))return;const H=Ad(S.current,"open",w.current);H?y.current=window.setTimeout(()=>{b.current||r(!0,$,"hover")},H):r(!0,$,"hover")}function _($){if(B())return;j.current();const H=gs(a.floating);if(clearTimeout(C.current),v.current&&o.current.floatingContext){n||clearTimeout(y.current),x.current=v.current({...o.current.floatingContext,tree:m,x:$.clientX,y:$.clientY,onClose(){O(),I(),k($,!0,"safe-polygon")}});const ce=x.current;H.addEventListener("mousemove",ce),j.current=()=>{H.removeEventListener("mousemove",ce)};return}(w.current==="touch"?!Rc(a.floating,$.relatedTarget):!0)&&k($)}function P($){B()||o.current.floatingContext&&(v.current==null||v.current({...o.current.floatingContext,tree:m,x:$.clientX,y:$.clientY,onClose(){O(),I(),k($)}})($))}if(Rt(a.domReference)){var N;const $=a.domReference;return n&&$.addEventListener("mouseleave",P),(N=a.floating)==null||N.addEventListener("mouseleave",P),h&&$.addEventListener("mousemove",D,{once:!0}),$.addEventListener("mouseenter",D),$.addEventListener("mouseleave",_),()=>{var H;n&&$.removeEventListener("mouseleave",P),(H=a.floating)==null||H.removeEventListener("mouseleave",P),h&&$.removeEventListener("mousemove",D),$.removeEventListener("mouseenter",D),$.removeEventListener("mouseleave",_)}}},[a,l,e,d,f,h,k,I,O,r,n,b,m,S,v,o]),ho(()=>{var B;if(l&&n&&(B=v.current)!=null&&B.__options.blockPointerEvents&&R()){T.current=!0;const _=a.floating;if(Rt(a.domReference)&&_){var D;const P=gs(a.floating).body;P.setAttribute(Sb,"");const N=a.domReference,$=m==null||(D=m.nodesRef.current.find(H=>H.id===g))==null||(D=D.context)==null?void 0:D.elements.floating;return $&&($.style.pointerEvents=""),P.style.pointerEvents="none",N.style.pointerEvents="auto",_.style.pointerEvents="auto",()=>{P.style.pointerEvents="",N.style.pointerEvents="",_.style.pointerEvents=""}}}},[l,n,g,a,m,v,R]),ho(()=>{n||(w.current=void 0,I(),O())},[n,I,O]),p.useEffect(()=>()=>{I(),clearTimeout(y.current),clearTimeout(C.current),O()},[l,a.domReference,I,O]);const F=p.useMemo(()=>{function B(D){w.current=D.pointerType}return{onPointerDown:B,onPointerEnter:B,onMouseMove(D){const{nativeEvent:_}=D;function P(){!E.current&&!b.current&&r(!0,_,"hover")}d&&!hg(w.current)||n||f===0||(clearTimeout(C.current),w.current==="touch"?P():C.current=window.setTimeout(P,f))}}},[d,r,n,b,f]),L=p.useMemo(()=>({onMouseEnter(){clearTimeout(y.current)},onMouseLeave(B){k(B.nativeEvent,!1)}}),[k]);return p.useMemo(()=>l?{reference:F,floating:L}:{},[l,F,L])}const xg=()=>{},tT=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:xg,setState:xg,isInstantPhase:!1}),nT=()=>p.useContext(tT);function c3(e){const{children:t,delay:n,timeoutMs:r=0}=e,[o,i]=p.useReducer((c,u)=>({...c,...u}),{delay:n,timeoutMs:r,initialDelay:n,currentId:null,isInstantPhase:!1}),a=p.useRef(null),l=p.useCallback(c=>{i({currentId:c})},[]);return ho(()=>{o.currentId?a.current===null?a.current=o.currentId:o.isInstantPhase||i({isInstantPhase:!0}):(o.isInstantPhase&&i({isInstantPhase:!1}),a.current=null)},[o.currentId,o.isInstantPhase]),p.createElement(tT.Provider,{value:p.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)}function u3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i}=t,a=i??o,l=nT(),{currentId:c,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:h}=l;return ho(()=>{c&&(f({delay:{open:1,close:Ad(d,"close")}}),c!==a&&r(!1))},[a,r,f,c,d]),ho(()=>{function m(){r(!1),f({delay:d,currentId:null})}if(c&&!n&&c===a){if(h){const g=window.setTimeout(m,h);return()=>{clearTimeout(g)}}m()}},[n,f,c,a,r,d,h]),ho(()=>{u===xg||!n||u(a)},[n,u,a]),l}function Qp(e,t){let n=e.filter(o=>{var i;return o.parentId===t&&((i=o.context)==null?void 0:i.open)}),r=n;for(;r.length;)r=e.filter(o=>{var i;return(i=r)==null?void 0:i.some(a=>{var l;return o.parentId===a.id&&((l=o.context)==null?void 0:l.open)})}),n=n.concat(r);return n}const d3="data-floating-ui-focusable",f3={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},h3={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},jb=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e==null?void 0:e.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e==null?void 0:e.outsidePress)!=null?n:!0}};function p3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:o,dataRef:i}=e,{enabled:a=!0,escapeKey:l=!0,outsidePress:c=!0,outsidePressEvent:u="pointerdown",referencePress:d=!1,referencePressEvent:f="pointerdown",ancestorScroll:h=!1,bubbles:m,capture:g}=t,v=gy(),S=ji(typeof c=="function"?c:()=>!1),b=typeof c=="function"?S:c,w=p.useRef(!1),y=p.useRef(!1),{escapeKey:x,outsidePress:C}=jb(m),{escapeKey:E,outsidePress:T}=jb(g),j=ji(L=>{var B;if(!n||!a||!l||L.key!=="Escape")return;const D=(B=i.current.floatingContext)==null?void 0:B.nodeId,_=v?Qp(v.nodesRef.current,D):[];if(!x&&(L.stopPropagation(),_.length>0)){let P=!0;if(_.forEach(N=>{var $;if(($=N.context)!=null&&$.open&&!N.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}r(!1,a4(L)?L.nativeEvent:L,"escape-key")}),R=ji(L=>{var B;const D=()=>{var _;j(L),(_=va(L))==null||_.removeEventListener("keydown",D)};(B=va(L))==null||B.addEventListener("keydown",D)}),k=ji(L=>{var B;const D=w.current;w.current=!1;const _=y.current;if(y.current=!1,u==="click"&&_||D||typeof b=="function"&&!b(L))return;const P=va(L),N="["+vy("inert")+"]",$=gs(o.floating).querySelectorAll(N);let H=Rt(P)?P:null;for(;H&&!zi(H);){const ue=Uo(H);if(zi(ue)||!Rt(ue))break;H=ue}if($.length&&Rt(P)&&!l4(P)&&!Rc(P,o.floating)&&Array.from($).every(ue=>!Rc(H,ue)))return;if(fr(P)&&F){const ue=P.clientWidth>0&&P.scrollWidth>P.clientWidth,xe=P.clientHeight>0&&P.scrollHeight>P.clientHeight;let _e=xe&&L.offsetX>P.clientWidth;if(xe&&kr(P).direction==="rtl"&&(_e=L.offsetX<=P.offsetWidth-P.clientWidth),_e||ue&&L.offsetY>P.clientHeight)return}const X=(B=i.current.floatingContext)==null?void 0:B.nodeId,ce=v&&Qp(v.nodesRef.current,X).some(ue=>{var xe;return Wp(L,(xe=ue.context)==null?void 0:xe.elements.floating)});if(Wp(L,o.floating)||Wp(L,o.domReference)||ce)return;const Ie=v?Qp(v.nodesRef.current,X):[];if(Ie.length>0){let ue=!0;if(Ie.forEach(xe=>{var _e;if((_e=xe.context)!=null&&_e.open&&!xe.context.dataRef.current.__outsidePressBubbles){ue=!1;return}}),!ue)return}r(!1,L,"outside-press")}),I=ji(L=>{var B;const D=()=>{var _;k(L),(_=va(L))==null||_.removeEventListener(u,D)};(B=va(L))==null||B.addEventListener(u,D)});p.useEffect(()=>{if(!n||!a)return;i.current.__escapeKeyBubbles=x,i.current.__outsidePressBubbles=C;function L(_){r(!1,_,"ancestor-scroll")}const B=gs(o.floating);l&&B.addEventListener("keydown",E?R:j,E),b&&B.addEventListener(u,T?I:k,T);let D=[];return h&&(Rt(o.domReference)&&(D=Mo(o.domReference)),Rt(o.floating)&&(D=D.concat(Mo(o.floating))),!Rt(o.reference)&&o.reference&&o.reference.contextElement&&(D=D.concat(Mo(o.reference.contextElement)))),D=D.filter(_=>{var P;return _!==((P=B.defaultView)==null?void 0:P.visualViewport)}),D.forEach(_=>{_.addEventListener("scroll",L,{passive:!0})}),()=>{l&&B.removeEventListener("keydown",E?R:j,E),b&&B.removeEventListener(u,T?I:k,T),D.forEach(_=>{_.removeEventListener("scroll",L)})}},[i,o,l,b,u,n,r,h,a,x,C,j,E,R,k,T,I]),p.useEffect(()=>{w.current=!1},[b,u]);const O=p.useMemo(()=>({onKeyDown:j,[f3[f]]:L=>{d&&r(!1,L.nativeEvent,"reference-press")}}),[j,r,d,f]),F=p.useMemo(()=>({onKeyDown:j,onMouseDown(){y.current=!0},onMouseUp(){y.current=!0},[h3[u]]:()=>{w.current=!0}}),[j,u]);return p.useMemo(()=>a?{reference:O,floating:F}:{},[a,O,F])}function m3(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=eT(),i=p.useRef({}),[a]=p.useState(()=>i3()),l=my()!=null,[c,u]=p.useState(r.reference),d=ji((m,g,v)=>{i.current.openEvent=m?g:void 0,a.emit("openchange",{open:m,event:g,reason:v,nested:l}),n==null||n(m,g,v)}),f=p.useMemo(()=>({setPositionReference:u}),[]),h=p.useMemo(()=>({reference:c||r.reference||null,floating:r.floating||null,domReference:r.reference}),[c,r.reference,r.floating]);return p.useMemo(()=>({dataRef:i,open:t,onOpenChange:d,elements:h,events:a,floatingId:o,refs:f}),[t,d,h,a,o,f])}function yy(e){e===void 0&&(e={});const{nodeId:t}=e,n=m3({...e,elements:{reference:null,floating:null,...e.elements}}),r=e.rootContext||n,o=r.elements,[i,a]=p.useState(null),[l,c]=p.useState(null),d=(o==null?void 0:o.reference)||i,f=p.useRef(null),h=gy();ho(()=>{d&&(f.current=d)},[d]);const m=X4({...e,elements:{...o,...l&&{reference:l}}}),g=p.useCallback(y=>{const x=Rt(y)?{getBoundingClientRect:()=>y.getBoundingClientRect(),contextElement:y}:y;c(x),m.refs.setReference(x)},[m.refs]),v=p.useCallback(y=>{(Rt(y)||y===null)&&(f.current=y,a(y)),(Rt(m.refs.reference.current)||m.refs.reference.current===null||y!==null&&!Rt(y))&&m.refs.setReference(y)},[m.refs]),S=p.useMemo(()=>({...m.refs,setReference:v,setPositionReference:g,domReference:f}),[m.refs,v,g]),b=p.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),w=p.useMemo(()=>({...m,...r,refs:S,elements:b,nodeId:t}),[m,S,b,t,r]);return ho(()=>{r.dataRef.current.floatingContext=w;const y=h==null?void 0:h.nodesRef.current.find(x=>x.id===t);y&&(y.context=w)}),p.useMemo(()=>({...m,context:w,refs:S,elements:b}),[m,S,b,w])}function g3(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:a}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=p.useRef(!1),d=p.useRef(),f=p.useRef(!0);p.useEffect(()=>{if(!l)return;const m=Jn(a.domReference);function g(){!n&&fr(a.domReference)&&a.domReference===fb(gs(a.domReference))&&(u.current=!0)}function v(){f.current=!0}return m.addEventListener("blur",g),m.addEventListener("keydown",v,!0),()=>{m.removeEventListener("blur",g),m.removeEventListener("keydown",v,!0)}},[a.domReference,n,l]),p.useEffect(()=>{if(!l)return;function m(g){let{reason:v}=g;(v==="reference-press"||v==="escape-key")&&(u.current=!0)}return o.on("openchange",m),()=>{o.off("openchange",m)}},[o,l]),p.useEffect(()=>()=>{clearTimeout(d.current)},[]);const h=p.useMemo(()=>({onPointerDown(m){r4(m.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(m){if(u.current)return;const g=va(m.nativeEvent);if(c&&Rt(g))try{if(o4()&&i4())throw Error();if(!g.matches(":focus-visible"))return}catch{if(!f.current&&!u4(g))return}r(!0,m.nativeEvent,"focus")},onBlur(m){u.current=!1;const g=m.relatedTarget,v=m.nativeEvent,S=Rt(g)&&g.hasAttribute(vy("focus-guard"))&&g.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var b;const w=fb(a.domReference?a.domReference.ownerDocument:document);!g&&w===a.domReference||Rc((b=i.current.floatingContext)==null?void 0:b.refs.floating.current,w)||Rc(a.domReference,w)||S||r(!1,v,"focus")})}}),[i,a.domReference,r,c]);return p.useMemo(()=>l?{reference:h}:{},[l,h])}const Cb="active",Eb="selected";function Kp(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[Cb]:a,[Eb]:l,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[d3]:""},...i,...t.map(a=>{const l=a?a[n]:null;return typeof l=="function"?e?l(e):null:l}).concat(e).reduce((a,l)=>(l&&Object.entries(l).forEach(c=>{let[u,d]=c;if(!(o&&[Cb,Eb].includes(u)))if(u.indexOf("on")===0){if(r.has(u)||r.set(u,[]),typeof d=="function"){var f;(f=r.get(u))==null||f.push(d),a[u]=function(){for(var h,m=arguments.length,g=new Array(m),v=0;v<m;v++)g[v]=arguments[v];return(h=r.get(u))==null?void 0:h.map(S=>S(...g)).find(S=>S!==void 0)}}}else a[u]=d}),a),{})}}function v3(e){e===void 0&&(e=[]);const t=e.map(l=>l==null?void 0:l.reference),n=e.map(l=>l==null?void 0:l.floating),r=e.map(l=>l==null?void 0:l.item),o=p.useCallback(l=>Kp(l,e,"reference"),t),i=p.useCallback(l=>Kp(l,e,"floating"),n),a=p.useCallback(l=>Kp(l,e,"item"),r);return p.useMemo(()=>({getReferenceProps:o,getFloatingProps:i,getItemProps:a}),[o,i,a])}const y3=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function x3(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=(n=y3.get(a))!=null?n:a,c=eT(),d=my()!=null,f=p.useMemo(()=>l==="tooltip"||a==="label"?{["aria-"+(a==="label"?"labelledby":"describedby")]:r?o:void 0}:{"aria-expanded":r?"true":"false","aria-haspopup":l==="alertdialog"?"dialog":l,"aria-controls":r?o:void 0,...l==="listbox"&&{role:"combobox"},...l==="menu"&&{id:c},...l==="menu"&&d&&{role:"menuitem"},...a==="select"&&{"aria-autocomplete":"none"},...a==="combobox"&&{"aria-autocomplete":"list"}},[l,o,d,r,c,a]),h=p.useMemo(()=>{const g={id:o,...l&&{role:l}};return l==="tooltip"||a==="label"?g:{...g,...l==="menu"&&{"aria-labelledby":c}}},[l,o,c,a]),m=p.useCallback(g=>{let{active:v,selected:S}=g;const b={role:"option",...v&&{id:o+"-option"}};switch(a){case"select":return{...b,"aria-selected":v&&S};case"combobox":return{...b,...v&&{"aria-selected":!0}}}return{}},[o,a]);return p.useMemo(()=>i?{reference:f,floating:h,item:m}:{},[i,f,h,m])}function rT(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}function Tb(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function Pb(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 b3={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function w3({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:t,height:t,transform:"rotate(45deg)",position:"absolute",[b3[c]]:r},f=-t/2;return c==="left"?{...d,...Tb(u,a,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...Tb(u,a,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...Pb(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...Pb(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const xy=p.forwardRef(({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,visible:i,arrowX:a,arrowY:l,style:c,...u},d)=>{const{dir:f}=zs();return i?s.jsx("div",{...u,ref:d,style:{...c,...w3({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:a,arrowY:l})}}):null});xy.displayName="@mantine/core/FloatingArrow";const[S3,oT]=Un("Popover component was not found in the tree");function uh({children:e,active:t=!0,refProp:n="ref",innerRef:r}){const o=fD(t),i=nn(o,r);return Qo(e)?p.cloneElement(e,{[n]:i}):e}function iT(e){return s.jsx(iy,{tabIndex:-1,"data-autofocus":!0,...e})}uh.displayName="@mantine/core/FocusTrap";iT.displayName="@mantine/core/FocusTrapInitialFocus";uh.InitialFocus=iT;function j3(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}const C3={},sT=p.forwardRef((e,t)=>{const{children:n,target:r,...o}=V("Portal",C3,e),[i,a]=p.useState(!1),l=p.useRef(null);return ul(()=>(a(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:j3(o),Bf(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:Zc.createPortal(s.jsx(s.Fragment,{children:n}),l.current)});sT.displayName="@mantine/core/Portal";function Vs({withinPortal:e=!0,children:t,...n}){return e?s.jsx(sT,{...n,children:t}):s.jsx(s.Fragment,{children:t})}Vs.displayName="@mantine/core/OptionalPortal";const zl=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${U(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),ld={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${U(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${U(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${U(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${U(-30)}`},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(${U(-20)}) 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(${U(20)}) skew(-10deg, -5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-left":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${U(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${U(20)}) 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:{...zl("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...zl("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...zl("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...zl("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...zl("top"),common:{transformOrigin:"top right"}}},kb={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function E3({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in ld?{transitionProperty:ld[e].transitionProperty,...o,...ld[e].common,...ld[e][kb[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[kb[t]]}}function T3({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:a,onExited:l,enterDelay:c,exitDelay:u}){const d=At(),f=sv(),h=d.respectReducedMotion?f:!1,[m,g]=p.useState(h?0:e),[v,S]=p.useState(r?"entered":"exited"),b=p.useRef(-1),w=p.useRef(-1),y=p.useRef(-1),x=E=>{const T=E?o:i,j=E?a:l;window.clearTimeout(b.current);const R=h?0:E?e:t;g(R),R===0?(typeof T=="function"&&T(),typeof j=="function"&&j(),S(E?"entered":"exited")):y.current=requestAnimationFrame(()=>{Da.flushSync(()=>{S(E?"pre-entering":"pre-exiting")}),y.current=requestAnimationFrame(()=>{typeof T=="function"&&T(),S(E?"entering":"exiting"),b.current=window.setTimeout(()=>{typeof j=="function"&&j(),S(E?"entered":"exited")},R)})})},C=E=>{if(window.clearTimeout(w.current),typeof(E?c:u)!="number"){x(E);return}w.current=window.setTimeout(()=>{x(E)},E?c:u)};return Lo(()=>{C(r)},[r]),p.useEffect(()=>()=>{window.clearTimeout(b.current),cancelAnimationFrame(y.current)},[]),{transitionDuration:m,transitionStatus:v,transitionTimingFunction:n||"ease"}}function Jo({keepMounted:e,transition:t="fade",duration:n=250,exitDuration:r=n,mounted:o,children:i,timingFunction:a="ease",onExit:l,onEntered:c,onEnter:u,onExited:d,enterDelay:f,exitDelay:h}){const{transitionDuration:m,transitionStatus:g,transitionTimingFunction:v}=T3({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d,enterDelay:f,exitDelay:h});return m===0?o?s.jsx(s.Fragment,{children:i({})}):e?i({display:"none"}):null:g==="exited"?e?i({display:"none"}):null:s.jsx(s.Fragment,{children:i(E3({transition:t,duration:m,state:g,timingFunction:v}))})}Jo.displayName="@mantine/core/Transition";var aT={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const P3={},by=Y((e,t)=>{var S,b,w,y;const n=V("PopoverDropdown",P3,e),{className:r,style:o,vars:i,children:a,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=oT(),m=cj({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=nn(t,h.floating);return h.disabled?null:s.jsx(Vs,{...h.portalProps,withinPortal:h.withinPortal,children:s.jsx(Jo,{mounted:h.opened,...h.transitionProps,transition:((S=h.transitionProps)==null?void 0:S.transition)||"fade",duration:((b=h.transitionProps)==null?void 0:b.duration)??150,keepMounted:h.keepMounted,exitDuration:typeof((w=h.transitionProps)==null?void 0:w.exitDuration)=="number"?h.transitionProps.exitDuration:(y=h.transitionProps)==null?void 0:y.duration,children:x=>s.jsx(uh,{active:h.trapFocus&&h.opened,innerRef:v,children:s.jsxs(q,{...g,...f,variant:c,onKeyDownCapture:Z_(h.onClose,{active:h.closeOnEscape,onTrigger:m,onKeyDown:l}),"data-position":h.placement,"data-fixed":h.floatingStrategy==="fixed"||void 0,...h.getStyles("dropdown",{className:r,props:n,classNames:u,styles:d,style:[{...x,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:U(h.width)},o]}),children:[a,s.jsx(xy,{ref:h.arrowRef,arrowX:h.arrowX,arrowY:h.arrowY,visible:h.withArrow,position:h.placement,arrowSize:h.arrowSize,arrowRadius:h.arrowRadius,arrowOffset:h.arrowOffset,arrowPosition:h.arrowPosition,...h.getStyles("arrow",{props:n,classNames:u,styles:d})})]})})})})});by.classes=aT;by.displayName="@mantine/core/PopoverDropdown";const k3={refProp:"ref",popupType:"dialog"},lT=Y((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=V("PopoverTarget",k3,e);if(!Qo(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 a=i,l=oT(),c=nn(l.reference,n.ref,t),u=l.withRoles?{"aria-haspopup":o,"aria-expanded":l.opened,"aria-controls":l.getDropdownId(),id:l.getTargetId()}:{};return p.cloneElement(n,{...a,...u,...l.targetProps,className:tt(l.targetProps.className,a.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});lT.displayName="@mantine/core/PopoverTarget";function cT({opened:e,floating:t,position:n,positionDependencies:r}){const[o,i]=p.useState(0);p.useEffect(()=>{if(t.refs.reference.current&&t.refs.floating.current)return V4(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Lo(()=>{t.update()},r),Lo(()=>{i(a=>a+1)},[e])}function R3(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 _3(e,t){const n=R3(e.middlewares),r=[XE(e.offset)];return n.shift&&r.push(py(typeof n.shift=="boolean"?{limiter:xb(),padding:5}:{limiter:xb(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?vg():vg(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?yg():yg(n.inline)),r.push(JE({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(Z4({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:i,availableHeight:a,...l}){var d;const u=((d=t().refs.floating.current)==null?void 0:d.style)??{};n.size&&(typeof n.size=="object"&&n.size.apply?n.size.apply({rects:o,availableWidth:i,availableHeight:a,...l}):Object.assign(u,{maxWidth:`${i}px`,maxHeight:`${a}px`})),e.width==="target"&&Object.assign(u,{width:`${o.reference.width}px`})}})),r}function D3(e){const[t,n]=bn({value:e.opened,defaultValue:e.defaultOpened,finalValue:!1,onChange:e.onChange}),r=()=>{var a;t&&((a=e.onClose)==null||a.call(e),n(!1))},o=()=>{var a,l;t?((a=e.onClose)==null||a.call(e),n(!1)):((l=e.onOpen)==null||l.call(e),n(!0))},i=yy({strategy:e.strategy,placement:e.position,middleware:_3(e,()=>i)});return cT({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),Lo(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),Lo(()=>{var a,l;e.opened?(l=e.onOpen)==null||l.call(e):(a=e.onClose)==null||a.call(e)},[e.opened]),{floating:i,controlled:typeof e.opened=="boolean",opened:t,onClose:r,onToggle:o}}const I3={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,clickOutsideEvents:["mousedown","touchstart"],zIndex:Jr("popover"),__staticSelector:"Popover",width:"max-content"},A3=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:it(t),"--popover-shadow":rv(n)}});function Zr(e){var oe,Q,fe,Pe,J,ie;const t=V("Popover",I3,e),{children:n,position:r,offset:o,onPositionChange:i,positionDependencies:a,opened:l,transitionProps:c,width:u,middlewares:d,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,unstyled:S,classNames:b,styles:w,closeOnClickOutside:y,withinPortal:x,portalProps:C,closeOnEscape:E,clickOutsideEvents:T,trapFocus:j,onClose:R,onOpen:k,onChange:I,zIndex:O,radius:F,shadow:L,id:B,defaultOpened:D,__staticSelector:_,withRoles:P,disabled:N,returnFocus:$,variant:H,keepMounted:X,vars:ce,floatingStrategy:Ie,...ue}=t,xe=he({name:_,props:t,classes:aT,classNames:b,styles:w,unstyled:S,rootSelector:"dropdown",vars:ce,varsResolver:A3}),_e=p.useRef(null),[de,Oe]=p.useState(null),[Ye,jt]=p.useState(null),{dir:mt}=zs(),at=Vn(B),Re=D3({middlewares:d,width:u,position:rT(mt,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:_e,arrowOffset:m,onPositionChange:i,positionDependencies:a,opened:l,defaultOpened:D,onChange:I,onOpen:k,onClose:R,strategy:Ie});nD(()=>y&&Re.onClose(),T,[de,Ye]);const et=p.useCallback(G=>{Oe(G),Re.floating.refs.setReference(G)},[Re.floating.refs.setReference]),ht=p.useCallback(G=>{jt(G),Re.floating.refs.setFloating(G)},[Re.floating.refs.setFloating]);return s.jsx(S3,{value:{returnFocus:$,disabled:N,controlled:Re.controlled,reference:et,floating:ht,x:Re.floating.x,y:Re.floating.y,arrowX:(fe=(Q=(oe=Re.floating)==null?void 0:oe.middlewareData)==null?void 0:Q.arrow)==null?void 0:fe.x,arrowY:(ie=(J=(Pe=Re.floating)==null?void 0:Pe.middlewareData)==null?void 0:J.arrow)==null?void 0:ie.y,opened:Re.opened,arrowRef:_e,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,placement:Re.floating.placement,trapFocus:j,withinPortal:x,portalProps:C,zIndex:O,radius:F,shadow:L,closeOnEscape:E,onClose:Re.onClose,onToggle:Re.onToggle,getTargetId:()=>`${at}-target`,getDropdownId:()=>`${at}-dropdown`,withRoles:P,targetProps:ue,__staticSelector:_,classNames:b,styles:w,unstyled:S,variant:H,keepMounted:X,getStyles:xe,floatingStrategy:Ie},children:n})}Zr.Target=lT;Zr.Dropdown=by;Zr.displayName="@mantine/core/Popover";Zr.extend=e=>e;var Ur={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 N3=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:tt(Ur.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Ur.bar}),s.jsx("span",{className:Ur.bar}),s.jsx("span",{className:Ur.bar})]})),M3=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:tt(Ur.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:Ur.dot}),s.jsx("span",{className:Ur.dot}),s.jsx("span",{className:Ur.dot})]})),O3=p.forwardRef(({className:e,...t},n)=>s.jsx(q,{component:"span",className:tt(Ur.ovalLoader,e),...t,ref:n})),uT={bars:N3,oval:O3,dots:M3},L3={loaders:uT,type:"oval"},$3=(e,{size:t,color:n})=>({root:{"--loader-size":Ne(t,"loader-size"),"--loader-color":n?ot(n,e):void 0}}),er=Y((e,t)=>{const n=V("Loader",L3,e),{size:r,color:o,type:i,vars:a,className:l,style:c,classNames:u,styles:d,unstyled:f,loaders:h,variant:m,children:g,...v}=n,S=he({name:"Loader",props:n,classes:Ur,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:a,varsResolver:$3});return g?s.jsx(q,{...S("root"),ref:t,...v,children:g}):s.jsx(q,{...S("root"),ref:t,component:h[i],variant:m,size:r,...v})});er.defaultLoaders=uT;er.classes=Ur;er.displayName="@mantine/core/Loader";var dh={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21"};const Rb={orientation:"horizontal"},F3=(e,{borderWidth:t})=>({group:{"--ai-border-width":U(t)}}),wy=Y((e,t)=>{const n=V("ActionIconGroup",Rb,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=V("ActionIconGroup",Rb,e),g=he({name:"ActionIconGroup",props:n,classes:dh,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:F3,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});wy.classes=dh;wy.displayName="@mantine/core/ActionIconGroup";const z3={},B3=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:a});return{root:{"--ai-size":Ne(t,"ai-size"),"--ai-radius":n===void 0?void 0:it(n),"--ai-bg":i||r?l.background:void 0,"--ai-hover":i||r?l.hover:void 0,"--ai-hover-color":i||r?l.hoverColor:void 0,"--ai-color":l.color,"--ai-bd":i||r?l.border:void 0}}},en=In((e,t)=>{const n=V("ActionIcon",z3,e),{className:r,unstyled:o,variant:i,classNames:a,styles:l,style:c,loading:u,loaderProps:d,size:f,color:h,radius:m,__staticSelector:g,gradient:v,vars:S,children:b,disabled:w,"data-disabled":y,autoContrast:x,mod:C,...E}=n,T=he({name:["ActionIcon",g],props:n,className:r,style:c,classes:dh,classNames:a,styles:l,unstyled:o,vars:S,varsResolver:B3});return s.jsxs(Sn,{...T("root",{active:!w&&!u&&!y}),...E,unstyled:o,variant:i,size:f,disabled:w||u,ref:t,mod:[{loading:u,disabled:w||y},C],children:[s.jsx(Jo,{mounted:!!u,transition:"slide-down",duration:150,children:j=>s.jsx(q,{component:"span",...T("loader",{style:j}),"aria-hidden":!0,children:s.jsx(er,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d})})}),s.jsx(q,{component:"span",mod:{loading:u},...T("icon"),children:b})]})});en.classes=dh;en.displayName="@mantine/core/ActionIcon";en.Group=wy;const dT=p.forwardRef(({size:e="var(--cb-icon-size, 70%)",style:t,...n},r)=>s.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:s.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"})}));dT.displayName="@mantine/core/CloseIcon";var fT={root:"m_86a44da5","root--subtle":"m_220c80f2"};const U3={variant:"subtle"},V3=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Ne(t,"cb-size"),"--cb-radius":n===void 0?void 0:it(n),"--cb-icon-size":U(r)}}),Ws=In((e,t)=>{const n=V("CloseButton",U3,e),{iconSize:r,children:o,vars:i,radius:a,className:l,classNames:c,style:u,styles:d,unstyled:f,"data-disabled":h,disabled:m,variant:g,icon:v,mod:S,...b}=n,w=he({name:"CloseButton",props:n,className:l,style:u,classes:fT,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:V3});return s.jsxs(Sn,{ref:t,...b,unstyled:f,variant:g,disabled:m,mod:[{disabled:m||h},S],...w("root",{variant:g,active:!m&&!h}),children:[v||s.jsx(dT,{}),o]})});Ws.classes=fT;Ws.displayName="@mantine/core/CloseButton";function W3(e){return p.Children.toArray(e).filter(Boolean)}var hT={root:"m_4081bf90"};const H3={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},q3=(e,{grow:t,preventGrowOverflow:n,gap:r,align:o,justify:i,wrap:a},{childWidth:l})=>({root:{"--group-child-width":t&&n?l:void 0,"--group-gap":Yt(r),"--group-align":o,"--group-justify":i,"--group-wrap":a}}),te=Y((e,t)=>{const n=V("Group",H3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,children:c,gap:u,align:d,justify:f,wrap:h,grow:m,preventGrowOverflow:g,vars:v,variant:S,__size:b,mod:w,...y}=n,x=W3(c),C=x.length,E=Yt(u??"md"),j={childWidth:`calc(${100/C}% - (${E} - ${E} / ${C}))`},R=he({name:"Group",props:n,stylesCtx:j,className:o,style:i,classes:hT,classNames:r,styles:a,unstyled:l,vars:v,varsResolver:q3});return s.jsx(q,{...R("root"),ref:t,variant:S,mod:[{grow:m},w],size:b,...y,children:x})});te.classes=hT;te.displayName="@mantine/core/Group";var pT={root:"m_9814e45f"};const G3={zIndex:Jr("modal")},Q3=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:a})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&xr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${U(o)})`:void 0,"--overlay-radius":i===void 0?void 0:it(i),"--overlay-z-index":a==null?void 0:a.toString()}}),_c=In((e,t)=>{const n=V("Overlay",G3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fixed:u,center:d,children:f,radius:h,zIndex:m,gradient:g,blur:v,color:S,backgroundOpacity:b,mod:w,...y}=n,x=he({name:"Overlay",props:n,classes:pT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Q3});return s.jsx(q,{ref:t,...x("root"),mod:[{center:d,fixed:u},w],...y,children:f})});_c.classes=pT;_c.displayName="@mantine/core/Overlay";const[K3,Zo]=Un("ModalBase component was not found in tree");function Y3({opened:e,transitionDuration:t}){const[n,r]=p.useState(e),o=p.useRef(),a=sv()?0:t;return p.useEffect(()=>(e?(r(!0),window.clearTimeout(o.current)):a===0?r(!1):o.current=window.setTimeout(()=>r(!1),a),()=>window.clearTimeout(o.current)),[e,a]),n}function X3({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:a}){const l=Vn(e),[c,u]=p.useState(!1),[d,f]=p.useState(!1),h=typeof(t==null?void 0:t.duration)=="number"?t==null?void 0:t.duration:200,m=Y3({opened:n,transitionDuration:h});return hj("keydown",g=>{var v;g.key==="Escape"&&o&&n&&((v=g.target)==null?void 0:v.getAttribute("data-mantine-stop-propagation"))!=="true"&&i()},{capture:!0}),cj({opened:n,shouldReturnFocus:r&&a}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:m,setTitleMounted:u,setBodyMounted:f}}const J3=p.forwardRef(({keepMounted:e,opened:t,onClose:n,id:r,transitionProps:o,trapFocus:i,closeOnEscape:a,returnFocus:l,closeOnClickOutside:c,withinPortal:u,portalProps:d,lockScroll:f,children:h,zIndex:m,shadow:g,padding:v,__vars:S,unstyled:b,removeScrollProps:w,...y},x)=>{const{_id:C,titleMounted:E,bodyMounted:T,shouldLockScroll:j,setTitleMounted:R,setBodyMounted:k}=X3({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:a,onClose:n,returnFocus:l}),{key:I,...O}=w||{};return s.jsx(Vs,{...d,withinPortal:u,children:s.jsx(K3,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:E,bodyMounted:T,setTitleMounted:R,setBodyMounted:k,trapFocus:i,closeOnEscape:a,zIndex:m,unstyled:b},children:s.jsx(Ff,{enabled:j&&f,...O,children:s.jsx(q,{ref:x,...y,__vars:{...S,"--mb-z-index":(m||Jr("modal")).toString(),"--mb-shadow":rv(g),"--mb-padding":Yt(v)},children:h})},I)})})});function Z3(){const e=Zo();return p.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var tl={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const mT=p.forwardRef(({className:e,...t},n)=>{const r=Z3(),o=Zo();return s.jsx(q,{ref:n,...t,id:r,className:tt({[tl.body]:!o.unstyled},e)})});mT.displayName="@mantine/core/ModalBaseBody";const gT=p.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Zo();return s.jsx(Ws,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:tt({[tl.close]:!o.unstyled},e),unstyled:o.unstyled})});gT.displayName="@mantine/core/ModalBaseCloseButton";const eM=p.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},a)=>{const l=Zo();return s.jsx(Jo,{mounted:l.opened,transition:"pop",...l.transitionProps,...e,children:c=>s.jsx("div",{...n,className:tt({[tl.inner]:!l.unstyled},n.className),children:s.jsx(uh,{active:l.opened&&l.trapFocus,innerRef:a,children:s.jsx(Xn,{...i,component:"section",role:"dialog",tabIndex:-1,"aria-modal":!0,"aria-describedby":l.bodyMounted?l.getBodyId():void 0,"aria-labelledby":l.titleMounted?l.getTitleId():void 0,style:[o,c],className:tt({[tl.content]:!l.unstyled},t),unstyled:l.unstyled,children:i.children})})})})}),vT=p.forwardRef(({className:e,...t},n)=>{const r=Zo();return s.jsx(q,{component:"header",ref:n,className:tt({[tl.header]:!r.unstyled},e),...t})});vT.displayName="@mantine/core/ModalBaseHeader";const tM={duration:200,timingFunction:"ease",transition:"fade"};function nM(e){const t=Zo();return{...tM,...t.transitionProps,...e}}const yT=p.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Zo(),a=nM(t);return s.jsx(Jo,{mounted:i.opened,...a,transition:"fade",children:l=>s.jsx(_c,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r})})});yT.displayName="@mantine/core/ModalBaseOverlay";function rM(){const e=Zo();return p.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const xT=p.forwardRef(({className:e,...t},n)=>{const r=rM(),o=Zo();return s.jsx(q,{component:"h2",ref:n,className:tt({[tl.title]:!o.unstyled},e),...t,id:r})});xT.displayName="@mantine/core/ModalBaseTitle";function oM({children:e}){return s.jsx(s.Fragment,{children:e})}const[iM,ml]=Ls({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Dr={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 _b={},sM=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${hn(t)} - ${U(2)})`}}),fh=Y((e,t)=>{const n=V("InputDescription",_b,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=V("InputDescription",_b,n),g=ml(),v=he({name:["InputWrapper",d],props:n,classes:Dr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"description",vars:c,varsResolver:sM}),S=f&&(g==null?void 0:g.getStyles)||v;return s.jsx(q,{component:"p",ref:t,variant:h,size:u,...S("description",g!=null&&g.getStyles?{className:o,style:i}:void 0),...m})});fh.classes=Dr;fh.displayName="@mantine/core/InputDescription";const aM={},lM=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${hn(t)} - ${U(2)})`}}),hh=Y((e,t)=>{const n=V("InputError",aM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=n,g=he({name:["InputWrapper",d],props:n,classes:Dr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"error",vars:c,varsResolver:lM}),v=ml(),S=f&&(v==null?void 0:v.getStyles)||g;return s.jsx(q,{component:"p",ref:t,variant:h,size:u,...S("error",v!=null&&v.getStyles?{className:o,style:i}:void 0),...m})});hh.classes=Dr;hh.displayName="@mantine/core/InputError";const Db={labelElement:"label"},cM=(e,{size:t})=>({label:{"--input-label-size":hn(t),"--input-asterisk-color":void 0}}),ph=Y((e,t)=>{const n=V("InputLabel",Db,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,labelElement:u,size:d,required:f,htmlFor:h,onMouseDown:m,children:g,__staticSelector:v,variant:S,mod:b,...w}=V("InputLabel",Db,n),y=he({name:["InputWrapper",v],props:n,classes:Dr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"label",vars:c,varsResolver:cM}),x=ml(),C=(x==null?void 0:x.getStyles)||y;return s.jsxs(q,{...C("label",x!=null&&x.getStyles?{className:o,style:i}:void 0),component:u,variant:S,size:d,ref:t,htmlFor:u==="label"?h:void 0,mod:[{required:f},b],onMouseDown:E=>{m==null||m(E),!E.defaultPrevented&&E.detail>1&&E.preventDefault()},...w,children:[g,f&&s.jsx("span",{...C("required"),"aria-hidden":!0,children:" *"})]})});ph.classes=Dr;ph.displayName="@mantine/core/InputLabel";const Ib={},Sy=Y((e,t)=>{const n=V("InputPlaceholder",Ib,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...m}=V("InputPlaceholder",Ib,n),g=he({name:["InputPlaceholder",u],props:n,classes:Dr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"placeholder"});return s.jsx(q,{...g("placeholder"),mod:[{error:!!f},h],component:"span",variant:d,ref:t,...m})});Sy.classes=Dr;Sy.displayName="@mantine/core/InputPlaceholder";function uM(e,{hasDescription:t,hasError:n}){const r=e.findIndex(c=>c==="input"),o=e.slice(0,r),i=e.slice(r+1),a=t&&o.includes("description")||n&&o.includes("error");return{offsetBottom:t&&i.includes("description")||n&&i.includes("error"),offsetTop:a}}const dM={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},fM=(e,{size:t})=>({label:{"--input-label-size":hn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${hn(t)} - ${U(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${hn(t)} - ${U(2)})`}}),jy=Y((e,t)=>{const n=V("InputWrapper",dM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,variant:d,__staticSelector:f,inputContainer:h,inputWrapperOrder:m,label:g,error:v,description:S,labelProps:b,descriptionProps:w,errorProps:y,labelElement:x,children:C,withAsterisk:E,id:T,required:j,__stylesApiProps:R,mod:k,...I}=n,O=he({name:["InputWrapper",f],props:R||n,classes:Dr,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:fM}),F={size:u,variant:d,__staticSelector:f},L=Vn(T),B=typeof E=="boolean"?E:j,D=(y==null?void 0:y.id)||`${L}-error`,_=(w==null?void 0:w.id)||`${L}-description`,P=L,N=!!v&&typeof v!="boolean",$=!!S,H=`${N?D:""} ${$?_:""}`,X=H.trim().length>0?H.trim():void 0,ce=(b==null?void 0:b.id)||`${L}-label`,Ie=g&&s.jsx(ph,{labelElement:x,id:ce,htmlFor:P,required:B,...F,...b,children:g},"label"),ue=$&&s.jsx(fh,{...w,...F,size:(w==null?void 0:w.size)||F.size,id:(w==null?void 0:w.id)||_,children:S},"description"),xe=s.jsx(p.Fragment,{children:h(C)},"input"),_e=N&&p.createElement(hh,{...y,...F,size:(y==null?void 0:y.size)||F.size,key:"error",id:(y==null?void 0:y.id)||D},v),de=m.map(Oe=>{switch(Oe){case"label":return Ie;case"input":return xe;case"description":return ue;case"error":return _e;default:return null}});return s.jsx(iM,{value:{getStyles:O,describedBy:X,inputId:P,labelId:ce,...uM(m,{hasDescription:$,hasError:N})},children:s.jsx(q,{ref:t,variant:d,size:u,mod:[{error:!!v},k],...O("root"),...I,children:de})})});jy.classes=Dr;jy.displayName="@mantine/core/InputWrapper";const hM={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},pM=(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":Ne(t.size,"input-height"),"--input-fz":hn(t.size),"--input-radius":t.radius===void 0?void 0:it(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?U(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?U(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Ne(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),Mt=In((e,t)=>{const n=V("Input",hM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,required:c,__staticSelector:u,__stylesApiProps:d,size:f,wrapperProps:h,error:m,disabled:g,leftSection:v,leftSectionProps:S,leftSectionWidth:b,rightSection:w,rightSectionProps:y,rightSectionWidth:x,rightSectionPointerEvents:C,leftSectionPointerEvents:E,variant:T,vars:j,pointer:R,multiline:k,radius:I,id:O,withAria:F,withErrorStyles:L,mod:B,inputSize:D,..._}=n,{styleProps:P,rest:N}=Yo(_),$=ml(),H={offsetBottom:$==null?void 0:$.offsetBottom,offsetTop:$==null?void 0:$.offsetTop},X=he({name:["Input",u],props:d||n,classes:Dr,className:o,style:i,classNames:r,styles:a,unstyled:l,stylesCtx:H,rootSelector:"wrapper",vars:j,varsResolver:pM}),ce=F?{required:c,disabled:g,"aria-invalid":!!m,"aria-describedby":$==null?void 0:$.describedBy,id:($==null?void 0:$.inputId)||O}:{};return s.jsxs(q,{...X("wrapper"),...P,...h,mod:[{error:!!m&&L,pointer:R,disabled:g,multiline:k,"data-with-right-section":!!w,"data-with-left-section":!!v},B],variant:T,size:f,children:[v&&s.jsx("div",{...S,"data-position":"left",...X("section",{className:S==null?void 0:S.className,style:S==null?void 0:S.style}),children:v}),s.jsx(q,{component:"input",...N,...ce,ref:t,required:c,mod:{disabled:g,error:!!m&&L},variant:T,__size:D,...X("input")}),w&&s.jsx("div",{...y,"data-position":"right",...X("section",{className:y==null?void 0:y.className,style:y==null?void 0:y.style}),children:w})]})});Mt.classes=Dr;Mt.Wrapper=jy;Mt.Label=ph;Mt.Error=hh;Mt.Description=fh;Mt.Placeholder=Sy;Mt.displayName="@mantine/core/Input";function mM(e,t,n){const r=V(e,t,n),{label:o,description:i,error:a,required:l,classNames:c,styles:u,className:d,unstyled:f,__staticSelector:h,__stylesApiProps:m,errorProps:g,labelProps:v,descriptionProps:S,wrapperProps:b,id:w,size:y,style:x,inputContainer:C,inputWrapperOrder:E,withAsterisk:T,variant:j,vars:R,mod:k,...I}=r,{styleProps:O,rest:F}=Yo(I),L={label:o,description:i,error:a,required:l,classNames:c,className:d,__staticSelector:h,__stylesApiProps:m||r,errorProps:g,labelProps:v,descriptionProps:S,unstyled:f,styles:u,size:y,style:x,inputContainer:C,inputWrapperOrder:E,withAsterisk:T,variant:j,id:w,mod:k,...b};return{...F,classNames:c,styles:u,unstyled:f,wrapperProps:{...L,...O},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:y,__staticSelector:h,__stylesApiProps:m||r,error:a,variant:j,id:w}}}const gM={__staticSelector:"InputBase",withAria:!0},nr=In((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=mM("InputBase",gM,e);return s.jsx(Mt.Wrapper,{...r,children:s.jsx(Mt,{...n,...o,ref:t})})});nr.classes={...Mt.classes,...Mt.Wrapper.classes};nr.displayName="@mantine/core/InputBase";const vM={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 bT={root:"m_8bffd616"};const yM={},ks=In((e,t)=>{const n=V("Flex",yM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v,...S}=n,b=he({name:"Flex",classes:bT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),w=At(),y=Qc(),x=bj({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v},theme:w,data:vM});return s.jsxs(s.Fragment,{children:[x.hasResponsiveStyles&&s.jsx(Fs,{selector:`.${y}`,styles:x.styles,media:x.media}),s.jsx(q,{ref:t,...b("root",{className:y,style:Hi(x.inlineStyles)}),...S})]})});ks.classes=bT;ks.displayName="@mantine/core/Flex";function xM(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 bM({target:e,parent:t,ref:n,displayAfterTransitionEnd:r}){const o=p.useRef(),[i,a]=p.useState(!1),[l,c]=p.useState(typeof r=="boolean"?r:!1),u=()=>{if(!e||!t)return;const m=e.getBoundingClientRect(),g=t.getBoundingClientRect(),v={top:m.top-g.top,left:m.left-g.left,width:m.width,height:m.height};n.current&&(n.current.style.transform=`translateY(${v.top}px) translateX(${v.left}px)`,n.current.style.width=`${v.width}px`,n.current.style.height=`${v.height}px`)},d=()=>{window.clearTimeout(o.current),n.current&&(n.current.style.transitionDuration="0ms"),u(),o.current=window.setTimeout(()=>{n.current&&(n.current.style.transitionDuration="")},30)},f=p.useRef(),h=p.useRef();return p.useEffect(()=>{if(u(),e)return f.current=new ResizeObserver(d),f.current.observe(e),t&&(h.current=new ResizeObserver(d),h.current.observe(t)),()=>{var m,g;(m=f.current)==null||m.disconnect(),(g=h.current)==null||g.disconnect()}},[t,e]),p.useEffect(()=>{if(t){const m=g=>{xM(g.target,t)&&(d(),c(!1))};return t.addEventListener("transitionend",m),()=>{t.removeEventListener("transitionend",m)}}},[t]),xD(()=>{pj()!=="test"&&a(!0)},20,{autoInvoke:!0}),bD(m=>{m.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:l}}var wT={root:"m_96b553a6"};const wM={},SM=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),Cy=Y((e,t)=>{const n=V("FloatingIndicator",wM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,target:u,parent:d,transitionDuration:f,mod:h,displayAfterTransitionEnd:m,...g}=n,v=he({name:"FloatingIndicator",classes:wT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:SM}),S=p.useRef(null),{initialized:b,hidden:w}=bM({target:u,parent:d,ref:S,displayAfterTransitionEnd:m}),y=nn(t,S);return!u||!d?null:s.jsx(q,{ref:y,mod:[{initialized:b,hidden:w},h],...v("root"),...g})});Cy.displayName="@mantine/core/FloatingIndicator";Cy.classes=wT;var ST={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 jM={},CM=(e,{radius:t,color:n,variant:r,autoContrast:o})=>{const i=e.variantColorResolver({color:n||e.primaryColor,theme:e,variant:r||"light",autoContrast:o});return{root:{"--alert-radius":t===void 0?void 0:it(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},Yi=Y((e,t)=>{const n=V("Alert",jM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,color:d,title:f,children:h,id:m,icon:g,withCloseButton:v,onClose:S,closeButtonLabel:b,variant:w,autoContrast:y,...x}=n,C=he({name:"Alert",classes:ST,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:CM}),E=Vn(m),T=f&&`${E}-title`||void 0,j=`${E}-body`;return s.jsx(q,{id:E,...C("root",{variant:w}),variant:w,ref:t,...x,role:"alert","aria-describedby":j,"aria-labelledby":T,children:s.jsxs("div",{...C("wrapper"),children:[g&&s.jsx("div",{...C("icon"),children:g}),s.jsxs("div",{...C("body"),children:[f&&s.jsx("div",{...C("title"),"data-with-close-button":v||void 0,children:s.jsx("span",{id:T,...C("label"),children:f})}),h&&s.jsx("div",{id:j,...C("message"),"data-variant":w,children:h})]}),v&&s.jsx(Ws,{...C("closeButton"),onClick:S,variant:"transparent",size:16,iconSize:16,"aria-label":b,unstyled:l})]})})});Yi.classes=ST;Yi.displayName="@mantine/core/Alert";var jT={root:"m_b6d8b162"};function EM(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const TM={inherit:!1},PM=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":hn(o),"--text-lh":sj(o),"--text-gradient":t==="gradient"?gm(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?ot(i,e):void 0}}),me=In((e,t)=>{const n=V("Text",TM,e),{lineClamp:r,truncate:o,inline:i,inherit:a,gradient:l,span:c,__staticSelector:u,vars:d,className:f,style:h,classNames:m,styles:g,unstyled:v,variant:S,mod:b,size:w,...y}=n,x=he({name:["Text",u],props:n,classes:jT,className:f,style:h,classNames:m,styles:g,unstyled:v,vars:d,varsResolver:PM});return s.jsx(q,{...x("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:S,mod:[{"data-truncate":EM(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":a},b],size:w,...y})});me.classes=jT;me.displayName="@mantine/core/Text";var CT={root:"m_849cf0da"};const kM={underline:"hover"},Ke=In((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...a}=V("Anchor",kM,e);return s.jsx(me,{component:"a",ref:t,className:tt({[CT.root]:!o},r),...a,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Ke.classes=CT;Ke.displayName="@mantine/core/Anchor";const[RM,gl]=Un("AppShell was not found in tree");var Xi={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const _M={},Ey=Y((e,t)=>{const n=V("AppShellAside",_M,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=gl();return m.disabled?null:s.jsx(q,{component:"aside",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("aside",{className:o,classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-aside-z-index":`calc(${d??m.zIndex} + 1)`}})});Ey.classes=Xi;Ey.displayName="@mantine/core/AppShellAside";const DM={},Ty=Y((e,t)=>{var g;const n=V("AppShellFooter",DM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=gl();return m.disabled?null:s.jsx(q,{component:"footer",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:tt({[Ff.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-footer-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});Ty.classes=Xi;Ty.displayName="@mantine/core/AppShellFooter";const IM={},Py=Y((e,t)=>{var g;const n=V("AppShellHeader",IM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=gl();return m.disabled?null:s.jsx(q,{component:"header",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:tt({[Ff.classNames.zeroRight]:m.offsetScrollbars},o),classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-header-z-index":(g=d??m.zIndex)==null?void 0:g.toString()}})});Py.classes=Xi;Py.displayName="@mantine/core/AppShellHeader";const AM={},ky=Y((e,t)=>{const n=V("AppShellMain",AM,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=gl();return s.jsx(q,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:a}),...c})});ky.classes=Xi;ky.displayName="@mantine/core/AppShellMain";function tu(e){return typeof e=="object"?e.base:e}function nu(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 ru(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function NM({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,aside:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,a="translateX(var(--app-shell-aside-width))",l="translateX(calc(var(--app-shell-aside-width) * -1))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-aside-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-aside-offset"]="0px"),nu(i)){const f=U(tu(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(ru(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=U(i.base),e["--app-shell-aside-offset"]=U(i.base)),bt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=U(i[f]),t[f]["--app-shell-aside-offset"]=U(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-aside-transform"]=a,t[f]["--app-shell-aside-transform-rtl"]=l,t[f]["--app-shell-aside-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=ov(r.breakpoint,o)-.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"]=a,n[f]["--app-shell-aside-transform-rtl"]=l}}function MM({baseStyles:e,minMediaStyles:t,footer:n}){const r=n==null?void 0:n.height,o="translateY(var(--app-shell-footer-height))",i=(n==null?void 0:n.offset)??!0;if(nu(r)){const a=U(tu(r));e["--app-shell-footer-height"]=a,i&&(e["--app-shell-footer-offset"]=a)}ru(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=U(r.base),i&&(e["--app-shell-footer-offset"]=U(r.base))),bt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-footer-height"]=U(r[a]),i&&(t[a]["--app-shell-footer-offset"]=U(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function OM({baseStyles:e,minMediaStyles:t,header:n}){const r=n==null?void 0:n.height,o="translateY(calc(var(--app-shell-header-height) * -1))",i=(n==null?void 0:n.offset)??!0;if(nu(r)){const a=U(tu(r));e["--app-shell-header-height"]=a,i&&(e["--app-shell-header-offset"]=a)}ru(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=U(r.base),i&&(e["--app-shell-header-offset"]=U(r.base))),bt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-header-height"]=U(r[a]),i&&(t[a]["--app-shell-header-offset"]=U(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function LM({baseStyles:e,minMediaStyles:t,maxMediaStyles:n,navbar:r,theme:o}){var c,u,d;const i=r==null?void 0:r.width,a="translateX(calc(var(--app-shell-navbar-width) * -1))",l="translateX(var(--app-shell-navbar-width))";if(r!=null&&r.breakpoint&&!((c=r==null?void 0:r.collapsed)!=null&&c.mobile)&&(n[r==null?void 0:r.breakpoint]=n[r==null?void 0:r.breakpoint]||{},n[r==null?void 0:r.breakpoint]["--app-shell-navbar-width"]="100%",n[r==null?void 0:r.breakpoint]["--app-shell-navbar-offset"]="0px"),nu(i)){const f=U(tu(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(ru(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=U(i.base),e["--app-shell-navbar-offset"]=U(i.base)),bt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=U(i[f]),t[f]["--app-shell-navbar-offset"]=U(i[f]))})),(u=r==null?void 0:r.collapsed)!=null&&u.desktop){const f=r.breakpoint;t[f]=t[f]||{},t[f]["--app-shell-navbar-transform"]=a,t[f]["--app-shell-navbar-transform-rtl"]=l,t[f]["--app-shell-navbar-offset"]="0px !important"}if((d=r==null?void 0:r.collapsed)!=null&&d.mobile){const f=ov(r.breakpoint,o)-.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"]=a,n[f]["--app-shell-navbar-transform-rtl"]=l}}function Yp(e){return Number(e)===0?"0px":Yt(e)}function $M({padding:e,baseStyles:t,minMediaStyles:n}){nu(e)&&(t["--app-shell-padding"]=Yp(tu(e))),ru(e)&&(e.base&&(t["--app-shell-padding"]=Yp(e.base)),bt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=Yp(e[r]))}))}function FM({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const a={},l={},c={};LM({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,navbar:e,theme:i}),NM({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,aside:r,theme:i}),OM({baseStyles:c,minMediaStyles:a,header:t}),MM({baseStyles:c,minMediaStyles:a,footer:n}),$M({baseStyles:c,minMediaStyles:a,padding:o});const u=uc(bt(a),i).map(h=>({query:`(min-width: ${$d(h.px)})`,styles:a[h.value]})),d=uc(bt(l),i).map(h=>({query:`(max-width: ${$d(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function zM({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=At(),a=qi(),{media:l,baseStyles:c}=FM({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return s.jsx(Fs,{media:l,styles:c,selector:a.cssVariablesSelector})}const BM={},Ry=Y((e,t)=>{const n=V("AppShellNavbar",BM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=gl();return m.disabled?null:s.jsx(q,{component:"nav",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("navbar",{className:o,classNames:r,styles:a,style:i}),...h,__vars:{"--app-shell-navbar-z-index":`calc(${d??m.zIndex} + 1)`}})});Ry.classes=Xi;Ry.displayName="@mantine/core/AppShellNavbar";const UM={},_y=In((e,t)=>{const n=V("AppShellSection",UM,e),{classNames:r,className:o,style:i,styles:a,vars:l,grow:c,mod:u,...d}=n,f=gl();return s.jsx(q,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:a}),...d})});_y.classes=Xi;_y.displayName="@mantine/core/AppShellSection";function VM({transitionDuration:e,disabled:t}){const[n,r]=p.useState(!0),o=p.useRef(),i=p.useRef();return hj("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),ul(()=>{p.startTransition(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)})},[t,e]),n}const WM={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Jr("app")},HM=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Zn=Y((e,t)=>{const n=V("AppShell",WM,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,navbar:u,withBorder:d,padding:f,transitionDuration:h,transitionTimingFunction:m,header:g,zIndex:v,layout:S,disabled:b,aside:w,footer:y,offsetScrollbars:x,mod:C,...E}=n,T=he({name:"AppShell",classes:Xi,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:HM}),j=VM({disabled:b,transitionDuration:h});return s.jsxs(RM,{value:{getStyles:T,withBorder:d,zIndex:v,disabled:b,offsetScrollbars:x},children:[s.jsx(zM,{navbar:u,header:g,aside:w,footer:y,padding:f}),s.jsx(q,{ref:t,...T("root"),mod:[{resizing:j,layout:S,disabled:b},C],...E})]})});Zn.classes=Xi;Zn.displayName="@mantine/core/AppShell";Zn.Navbar=Ry;Zn.Header=Py;Zn.Main=ky;Zn.Aside=Ey;Zn.Footer=Ty;Zn.Section=_y;function ET(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=>ET(t))}:e}function TT(e){return e?e.map(t=>ET(t)):[]}function PT(e){return e.reduce((t,n)=>"group"in n?{...t,...PT(n.items)}:(t[n.value]=n,t),{})}var tr={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 qM={error:null},GM=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Ne(t,"combobox-chevron-size")}}),mh=Y((e,t)=>{const n=V("ComboboxChevron",qM,e),{size:r,error:o,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,m=he({name:"ComboboxChevron",classes:tr,props:n,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:GM,rootSelector:"chevron"});return s.jsx(q,{component:"svg",...h,...m("chevron"),size:r,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",mod:["combobox-chevron",{error:o},f],ref:t,children:s.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"})})});mh.classes=tr;mh.displayName="@mantine/core/ComboboxChevron";const[QM,Ir]=Un("Combobox component was not found in tree"),kT=p.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>s.jsx(Ws,{ref:i,size:e||"sm",variant:"transparent",tabIndex:-1,"aria-hidden":!0,...o,onMouseDown:a=>{a.preventDefault(),t==null||t(a)},onClick:a=>{r(),n==null||n(a)}}));kT.displayName="@mantine/core/ComboboxClearButton";const KM={},Dy=Y((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:a,...l}=V("ComboboxDropdown",KM,e),c=Ir();return s.jsx(Zr.Dropdown,{...l,ref:t,role:"presentation","data-hidden":a||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});Dy.classes=tr;Dy.displayName="@mantine/core/ComboboxDropdown";const YM={refProp:"ref"},RT=Y((e,t)=>{const{children:n,refProp:r}=V("ComboboxDropdownTarget",YM,e);if(Ir(),!Qo(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 s.jsx(Zr.Target,{ref:t,refProp:r,children:n})});RT.displayName="@mantine/core/ComboboxDropdownTarget";const XM={},Iy=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxEmpty",XM,e),c=Ir();return s.jsx(q,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});Iy.classes=tr;Iy.displayName="@mantine/core/ComboboxEmpty";function Ay({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const a=Ir(),[l,c]=p.useState(null),u=f=>{if(e==null||e(f),!a.readOnly&&t){if(f.nativeEvent.isComposing)return;if(f.nativeEvent.code==="ArrowDown"&&(f.preventDefault(),a.store.dropdownOpened?c(a.store.selectNextOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()))),f.nativeEvent.code==="ArrowUp"&&(f.preventDefault(),a.store.dropdownOpened?c(a.store.selectPreviousOption()):(a.store.openDropdown("keyboard"),c(a.store.selectActiveOption()))),f.nativeEvent.code==="Enter"||f.nativeEvent.code==="NumpadEnter"){if(f.nativeEvent.keyCode===229)return;const h=a.store.getSelectedOptionIndex();a.store.dropdownOpened&&h!==-1?(f.preventDefault(),a.store.clickSelectedOption()):o==="button"&&(f.preventDefault(),a.store.openDropdown("keyboard"))}f.nativeEvent.code==="Escape"&&a.store.closeDropdown("keyboard"),f.nativeEvent.code==="Space"&&o==="button"&&(f.preventDefault(),a.store.toggleDropdown("keyboard"))}};return{...n?{"aria-haspopup":"listbox","aria-expanded":r&&!!(a.store.listId&&a.store.dropdownOpened)||void 0,"aria-controls":a.store.listId,"aria-activedescendant":a.store.dropdownOpened&&l||void 0,autoComplete:i,"data-expanded":a.store.dropdownOpened||void 0,"data-mantine-stop-propagation":a.store.dropdownOpened||void 0}:{},onKeyDown:u}}const JM={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},_T=Y((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=V("ComboboxEventsTarget",JM,e);if(!Qo(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 d=Ir(),f=Ay({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c});return p.cloneElement(n,{...f,...u,[r]:nn(t,d.store.targetRef,n==null?void 0:n.ref)})});_T.displayName="@mantine/core/ComboboxEventsTarget";const ZM={},Ny=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxFooter",ZM,e),c=Ir();return s.jsx(q,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l,onMouseDown:u=>{u.preventDefault()}})});Ny.classes=tr;Ny.displayName="@mantine/core/ComboboxFooter";const eO={},My=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,children:l,label:c,...u}=V("ComboboxGroup",eO,e),d=Ir();return s.jsxs(q,{ref:t,...d.getStyles("group",{className:r,classNames:n,style:o,styles:i}),...u,children:[c&&s.jsx("div",{...d.getStyles("groupLabel",{classNames:n,styles:i}),children:c}),l]})});My.classes=tr;My.displayName="@mantine/core/ComboboxGroup";const tO={},Oy=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("ComboboxHeader",tO,e),c=Ir();return s.jsx(q,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l,onMouseDown:u=>{u.preventDefault()}})});Oy.classes=tr;Oy.displayName="@mantine/core/ComboboxHeader";function DT({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}DT.displayName="@mantine/core/ComboboxHiddenInput";const nO={},Ly=Y((e,t)=>{const n=V("ComboboxOption",nO,e),{classNames:r,className:o,style:i,styles:a,vars:l,onClick:c,id:u,active:d,onMouseDown:f,onMouseOver:h,disabled:m,selected:g,mod:v,...S}=n,b=Ir(),w=p.useId(),y=u||w;return s.jsx(q,{...b.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...S,ref:t,id:y,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":g},v],role:"option",onClick:x=>{var C;m?x.preventDefault():((C=b.onOptionSubmit)==null||C.call(b,n.value,n),c==null||c(x))},onMouseDown:x=>{x.preventDefault(),f==null||f(x)},onMouseOver:x=>{b.resetSelectionOnOptionHover&&b.store.resetSelectedOption(),h==null||h(x)}})});Ly.classes=tr;Ly.displayName="@mantine/core/ComboboxOption";const rO={},$y=Y((e,t)=>{const n=V("ComboboxOptions",rO,e),{classNames:r,className:o,style:i,styles:a,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=Ir(),h=Vn(l);return p.useEffect(()=>{f.store.setListId(h)},[h]),s.jsx(q,{ref:t,...f.getStyles("options",{className:o,style:i,classNames:r,styles:a}),...d,id:h,role:"listbox","aria-labelledby":u,onMouseDown:m=>{m.preventDefault(),c==null||c(m)}})});$y.classes=tr;$y.displayName="@mantine/core/ComboboxOptions";const oO={withAriaAttributes:!0,withKeyboardNavigation:!0},Fy=Y((e,t)=>{const n=V("ComboboxSearch",oO,e),{classNames:r,styles:o,unstyled:i,vars:a,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=Ir(),m=h.getStyles("search"),g=Ay({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return s.jsx(Mt,{ref:nn(t,h.store.searchRef),classNames:[{input:m.className},r],styles:[{input:m.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});Fy.classes=tr;Fy.displayName="@mantine/core/ComboboxSearch";const iO={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},IT=Y((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=V("ComboboxTarget",iO,e);if(!Qo(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 d=Ir(),f=Ay({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=p.cloneElement(n,{...f,...u});return s.jsx(Zr.Target,{ref:nn(t,d.store.targetRef),children:h})});IT.displayName="@mantine/core/ComboboxTarget";function sO(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 aO(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 lO(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function ou({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:a="instant"}={}){const[l,c]=bn({value:t,defaultValue:e,finalValue:!1,onChange:n}),u=p.useRef(null),d=p.useRef(-1),f=p.useRef(null),h=p.useRef(null),m=p.useRef(-1),g=p.useRef(-1),v=p.useRef(-1),S=p.useCallback((D="unknown")=>{l||(c(!0),o==null||o(D))},[c,o,l]),b=p.useCallback((D="unknown")=>{l&&(c(!1),r==null||r(D))},[c,r,l]),w=p.useCallback((D="unknown")=>{l?b(D):S(D)},[b,S,l]),y=p.useCallback(()=>{const D=document.querySelector(`#${u.current} [data-combobox-selected]`);D==null||D.removeAttribute("data-combobox-selected"),D==null||D.removeAttribute("aria-selected")},[]),x=p.useCallback(D=>{const _=document.getElementById(u.current),P=_==null?void 0:_.querySelectorAll("[data-combobox-option]");if(!P)return null;const N=D>=P.length?0:D<0?P.length-1:D;return d.current=N,P!=null&&P[N]&&!P[N].hasAttribute("data-combobox-disabled")?(y(),P[N].setAttribute("data-combobox-selected","true"),P[N].setAttribute("aria-selected","true"),P[N].scrollIntoView({block:"nearest",behavior:a}),P[N].id):null},[a,y]),C=p.useCallback(()=>{const D=document.querySelector(`#${u.current} [data-combobox-active]`);if(D){const _=document.querySelectorAll(`#${u.current} [data-combobox-option]`),P=Array.from(_).findIndex(N=>N===D);return x(P)}return x(0)},[x]),E=p.useCallback(()=>x(aO(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[x,i]),T=p.useCallback(()=>x(sO(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[x,i]),j=p.useCallback(()=>x(lO(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[x]),R=p.useCallback((D="selected",_)=>{v.current=window.setTimeout(()=>{var $;const P=document.querySelectorAll(`#${u.current} [data-combobox-option]`),N=Array.from(P).findIndex(H=>H.hasAttribute(`data-combobox-${D}`));d.current=N,_!=null&&_.scrollIntoView&&(($=P[N])==null||$.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),k=p.useCallback(()=>{d.current=-1,y()},[y]),I=p.useCallback(()=>{const D=document.querySelectorAll(`#${u.current} [data-combobox-option]`),_=D==null?void 0:D[d.current];_==null||_.click()},[]),O=p.useCallback(D=>{u.current=D},[]),F=p.useCallback(()=>{m.current=window.setTimeout(()=>f.current.focus(),0)},[]),L=p.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),B=p.useCallback(()=>d.current,[]);return p.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:b,toggleDropdown:w,selectedOptionIndex:d.current,getSelectedOptionIndex:B,selectOption:x,selectFirstOption:j,selectActiveOption:C,selectNextOption:E,selectPreviousOption:T,resetSelectedOption:k,updateSelectedOptionIndex:R,listId:u.current,setListId:O,clickSelectedOption:I,searchRef:f,focusSearchInput:F,targetRef:h,focusTarget:L}}const cO={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},uO=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":hn(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:U(n),"--combobox-option-fz":hn(t),"--combobox-option-padding":Ne(t,"combobox-option-padding")}});function Le(e){const t=V("Combobox",cO,e),{classNames:n,styles:r,unstyled:o,children:i,store:a,vars:l,onOptionSubmit:c,onClose:u,size:d,dropdownPadding:f,resetSelectionOnOptionHover:h,__staticSelector:m,readOnly:g,...v}=t,S=ou(),b=a||S,w=he({name:m||"Combobox",classes:tr,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:uO}),y=()=>{u==null||u(),b.closeDropdown()};return s.jsx(QM,{value:{getStyles:w,store:b,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g},children:s.jsx(Zr,{opened:b.dropdownOpened,...v,onClose:y,withRoles:!1,unstyled:o,children:i})})}const dO=e=>e;Le.extend=dO;Le.classes=tr;Le.displayName="@mantine/core/Combobox";Le.Target=IT;Le.Dropdown=Dy;Le.Options=$y;Le.Option=Ly;Le.Search=Fy;Le.Empty=Iy;Le.Chevron=mh;Le.Footer=Ny;Le.Header=Oy;Le.EventsTarget=_T;Le.DropdownTarget=RT;Le.Group=My;Le.ClearButton=kT;Le.HiddenInput=DT;var AT={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const NT=AT,gh=p.forwardRef(({__staticSelector:e,__stylesApiProps:t,className:n,classNames:r,styles:o,unstyled:i,children:a,label:l,description:c,id:u,disabled:d,error:f,size:h,labelPosition:m="left",bodyElement:g="div",labelElement:v="label",variant:S,style:b,vars:w,mod:y,...x},C)=>{const E=he({name:e,props:t,className:n,style:b,classes:AT,classNames:r,styles:o,unstyled:i});return s.jsx(q,{...E("root"),ref:C,__vars:{"--label-fz":hn(h),"--label-lh":Ne(h,"label-lh")},mod:[{"label-position":m},y],variant:S,size:h,...x,children:s.jsxs(q,{component:g,htmlFor:g==="label"?u:void 0,...E("body"),children:[a,s.jsxs("div",{...E("labelWrapper"),"data-disabled":d||void 0,children:[l&&s.jsx(q,{component:v,htmlFor:v==="label"?u:void 0,...E("label"),"data-disabled":d||void 0,children:l}),c&&s.jsx(Mt.Description,{size:h,__inheritStyles:!1,...E("description"),children:c}),f&&typeof f!="boolean"&&s.jsx(Mt.Error,{size:h,__inheritStyles:!1,...E("error"),children:f})]})]})})});gh.displayName="@mantine/core/InlineInput";const MT=p.createContext(null),fO=MT.Provider,OT=()=>p.useContext(MT),[hO,pO]=Ls();var LT={card:"m_26775b0a"};const mO={withBorder:!0},gO=(e,{radius:t})=>({card:{"--card-radius":it(t)}}),zy=Y((e,t)=>{const n=V("CheckboxCard",mO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,checked:u,mod:d,withBorder:f,value:h,onClick:m,...g}=n,v=he({name:"CheckboxCard",classes:LT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:gO,rootSelector:"card"}),S=OT(),b=typeof u=="boolean"?u:(S==null?void 0:S.value.includes(h||""))||!1;return s.jsx(hO,{value:{checked:b},children:s.jsx(Sn,{ref:t,mod:[{"with-border":f,checked:b},d],...v("card"),...g,role:"checkbox","aria-checked":b,onClick:w=>{m==null||m(w),S==null||S.onChange(h||"")}})})});zy.displayName="@mantine/core/CheckboxCard";zy.classes=LT;function By({children:e,role:t}){const n=ml();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const vO={},Uy=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=V("CheckboxGroup",vO,e),[d,f]=bn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=typeof m=="string"?m:m.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return s.jsx(fO,{value:{value:d,onChange:h,size:i},children:s.jsx(Mt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(By,{role:"group",children:l})})})});Uy.classes=Mt.Wrapper.classes;Uy.displayName="@mantine/core/CheckboxGroup";function vh({size:e,style:t,...n}){const r=e!==void 0?{width:U(e),height:U(e),...t}:t;return s.jsx("svg",{viewBox:"0 0 10 7",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:r,"aria-hidden":!0,...n,children:s.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 $T({indeterminate:e,...t}){return e?s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 32 6","aria-hidden":!0,...t,children:s.jsx("rect",{width:"32",height:"6",fill:"currentColor",rx:"3"})}):s.jsx(vh,{...t})}var FT={indicator:"m_5e5256ee",icon:"m_1b1c543a","indicator--outline":"m_76e20374"};const yO={icon:$T},xO=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Er({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--checkbox-size":Ne(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:it(t),"--checkbox-color":i==="outline"?c:ot(n,e),"--checkbox-icon-color":o?ot(o,e):$s(a,e)?Ko({color:n,theme:e,autoContrast:a}):void 0}}},Vy=Y((e,t)=>{const n=V("CheckboxIndicator",yO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,icon:u,indeterminate:d,radius:f,color:h,iconColor:m,autoContrast:g,checked:v,mod:S,variant:b,disabled:w,...y}=n,x=u,C=he({name:"CheckboxIndicator",classes:FT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:xO,rootSelector:"indicator"}),E=pO(),T=typeof v=="boolean"||typeof d=="boolean"?v||d:(E==null?void 0:E.checked)||!1;return s.jsx(q,{ref:t,...C("indicator",{variant:b}),variant:b,mod:[{checked:T,disabled:w},S],...y,children:s.jsx(x,{indeterminate:d,...C("icon")})})});Vy.displayName="@mantine/core/CheckboxIndicator";Vy.classes=FT;var zT={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const bO={labelPosition:"right",icon:$T},wO=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Er({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--checkbox-size":Ne(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:it(t),"--checkbox-color":i==="outline"?c:ot(n,e),"--checkbox-icon-color":o?ot(o,e):$s(a,e)?Ko({color:n,theme:e,autoContrast:a}):void 0}}},Dn=Y((e,t)=>{const n=V("Checkbox",bO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,label:d,id:f,size:h,radius:m,wrapperProps:g,checked:v,labelPosition:S,description:b,error:w,disabled:y,variant:x,indeterminate:C,icon:E,rootRef:T,iconColor:j,onChange:R,autoContrast:k,mod:I,...O}=n,F=OT(),L=h||(F==null?void 0:F.size),B=E,D=he({name:"Checkbox",props:n,classes:zT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:wO}),{styleProps:_,rest:P}=Yo(O),N=Vn(f),$=F?{checked:F.value.includes(P.value),onChange:H=>{F.onChange(H),R==null||R(H)}}:{};return s.jsx(gh,{...D("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:N,size:L,labelPosition:S,label:d,description:b,error:w,disabled:y,classNames:r,styles:a,unstyled:l,"data-checked":$.checked||v||void 0,variant:x,ref:T,mod:I,..._,...g,children:s.jsxs(q,{...D("inner"),mod:{"data-label-position":S},children:[s.jsx(q,{component:"input",id:N,ref:t,checked:v,disabled:y,mod:{error:!!w,indeterminate:C},...D("input",{focusable:!0,variant:x}),onChange:R,...P,...$,type:"checkbox"}),s.jsx(B,{indeterminate:C,...D("icon")})]})})});Dn.classes={...zT,...NT};Dn.displayName="@mantine/core/Checkbox";Dn.Group=Uy;Dn.Indicator=Vy;Dn.Card=zy;function nl(e){return"group"in e}function BT({options:e,search:t,limit:n}){const r=t.trim().toLowerCase(),o=[];for(let i=0;i<e.length;i+=1){const a=e[i];if(o.length===n)return o;nl(a)&&o.push({group:a.group,items:BT({options:a.items,search:t,limit:n-o.length})}),nl(a)||a.label.toLowerCase().includes(r)&&o.push(a)}return o}function SO(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 UT(e,t=new Set){if(Array.isArray(e))for(const n of e)if(nl(n))UT(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 jO(e,t){return Array.isArray(e)?e.includes(t):e===t}function VT({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!nl(e)){const l=jO(n,e.value),c=t&&l&&s.jsx(vh,{className:tr.optionsDropdownCheckIcon}),u=s.jsxs(s.Fragment,{children:[r==="left"&&c,s.jsx("span",{children:e.label}),r==="right"&&c]});return s.jsx(Le.Option,{value:e.value,disabled:e.disabled,className:tt({[tr.optionsDropdownOption]:!o}),"data-reverse":r==="right"||void 0,"data-checked":l||void 0,"aria-selected":l,active:l,children:typeof i=="function"?i({option:e,checked:l}):u})}const a=e.items.map(l=>s.jsx(VT,{data:l,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},l.value));return s.jsx(Le.Group,{label:e.group,children:a})}function CO({data:e,hidden:t,hiddenWhenEmpty:n,filter:r,search:o,limit:i,maxDropdownHeight:a,withScrollArea:l=!0,filterOptions:c=!0,withCheckIcon:u=!1,value:d,checkIconPosition:f,nothingFoundMessage:h,unstyled:m,labelId:g,renderOption:v,scrollAreaProps:S,"aria-label":b}){UT(e);const y=typeof o=="string"?(r||BT)({options:e,search:c?o:"",limit:i??1/0}):e,x=SO(y),C=y.map(E=>s.jsx(VT,{data:E,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:m,renderOption:v},nl(E)?E.group:E.value));return s.jsx(Le.Dropdown,{hidden:t||n&&x,children:s.jsxs(Le.Options,{labelledBy:g,"aria-label":b,children:[l?s.jsx(_r.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:C}):C,x&&h&&s.jsx(Le.Empty,{children:h})]})})}const WT=p.createContext(null),EO=WT.Provider;function TO(){return{withinGroup:!!p.useContext(WT)}}var yh={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const PO={},kO=(e,{spacing:t})=>({group:{"--ag-spacing":Yt(t)}}),Wy=Y((e,t)=>{const n=V("AvatarGroup",PO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,spacing:u,...d}=n,f=he({name:"AvatarGroup",classes:yh,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:kO,rootSelector:"group"});return s.jsx(EO,{value:!0,children:s.jsx(q,{ref:t,...f("group"),...d})})});Wy.classes=yh;Wy.displayName="@mantine/core/AvatarGroup";function RO(e){return s.jsx("svg",{...e,"data-avatar-placeholder-icon":!0,viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:s.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 HT(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()}function _O(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 DO=["blue","cyan","grape","green","indigo","lime","orange","pink","red","teal","violet"];function IO(e,t=DO){const n=_O(HT(e)),r=Math.abs(n)%t.length;return t[r]}const AO={},NO=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a,name:l,allowedInitialsColors:c})=>{const u=i==="initials"&&typeof l=="string"?IO(l,c):i,d=e.variantColorResolver({color:u||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:a});return{root:{"--avatar-size":Ne(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:it(n),"--avatar-bg":u||r?d.background:void 0,"--avatar-color":u||r?d.color:void 0,"--avatar-bd":u||r?d.border:void 0}}},Rs=In((e,t)=>{const n=V("Avatar",AO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,src:u,alt:d,radius:f,color:h,gradient:m,imageProps:g,children:v,autoContrast:S,mod:b,name:w,allowedInitialsColors:y,...x}=n,C=TO(),[E,T]=p.useState(!u),j=he({name:"Avatar",props:n,classes:yh,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:NO});return p.useEffect(()=>T(!u),[u]),s.jsx(q,{...j("root"),mod:[{"within-group":C.withinGroup},b],ref:t,...x,children:E?s.jsx("span",{...j("placeholder"),title:d,children:v||typeof w=="string"&&HT(w)||s.jsx(RO,{})}):s.jsx("img",{...g,...j("image"),src:u,alt:d,onError:R=>{var k;T(!0),(k=g==null?void 0:g.onError)==null||k.call(g,R)}})})});Rs.classes=yh;Rs.displayName="@mantine/core/Avatar";Rs.Group=Wy;var qT={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const MO={},OO=(e,{radius:t,color:n,gradient:r,variant:o,size:i,autoContrast:a})=>{const l=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:a});return{root:{"--badge-height":Ne(i,"badge-height"),"--badge-padding-x":Ne(i,"badge-padding-x"),"--badge-fz":Ne(i,"badge-fz"),"--badge-radius":t===void 0?void 0:it(t),"--badge-bg":n||o?l.background:void 0,"--badge-color":n||o?l.color:void 0,"--badge-bd":n||o?l.border:void 0,"--badge-dot-color":o==="dot"?ot(n,e):void 0}}},iu=In((e,t)=>{const n=V("Badge",MO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,color:d,gradient:f,leftSection:h,rightSection:m,children:g,variant:v,fullWidth:S,autoContrast:b,circle:w,mod:y,...x}=n,C=he({name:"Badge",props:n,classes:qT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:OO});return s.jsxs(q,{variant:v,mod:[{block:S,circle:w,"with-right-section":!!m,"with-left-section":!!h},y],...C("root",{variant:v}),ref:t,...x,children:[h&&s.jsx("span",{...C("section"),"data-position":"left",children:h}),s.jsx("span",{...C("label"),children:g}),m&&s.jsx("span",{...C("section"),"data-position":"right",children:m})]})});iu.classes=qT;iu.displayName="@mantine/core/Badge";var GT={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const LO={iconSize:48},$O=(e,{color:t,iconSize:n,radius:r})=>{const o=Er({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=Er({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":xr(i.value,.07),"--bq-bg-dark":xr(o.value,.06),"--bq-bd":ot(t,e),"--bq-icon-size":U(n),"--bq-radius":it(r)}}},Hy=Y((e,t)=>{const n=V("Blockquote",LO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...m}=n,g=he({name:"Blockquote",classes:GT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:$O});return s.jsxs(q,{component:"blockquote",ref:t,...g("root"),...m,children:[d&&s.jsx("span",{...g("icon"),children:d}),u,h&&s.jsx("cite",{...g("cite"),children:h})]})});Hy.classes=GT;Hy.displayName="@mantine/core/Blockquote";var xh={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const Ab={orientation:"horizontal"},FO=(e,{borderWidth:t})=>({group:{"--button-border-width":U(t)}}),qy=Y((e,t)=>{const n=V("ButtonGroup",Ab,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=V("ButtonGroup",Ab,e),g=he({name:"ButtonGroup",props:n,classes:xh,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:FO,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});qy.classes=xh;qy.displayName="@mantine/core/ButtonGroup";const zO={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${U(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},BO={},UO=(e,{radius:t,color:n,gradient:r,variant:o,size:i,justify:a,autoContrast:l})=>{const c=e.variantColorResolver({color:n||e.primaryColor,theme:e,gradient:r,variant:o||"filled",autoContrast:l});return{root:{"--button-justify":a,"--button-height":Ne(i,"button-height"),"--button-padding-x":Ne(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?hn(i.replace("compact-","")):hn(i),"--button-radius":t===void 0?void 0:it(t),"--button-bg":n||o?c.background:void 0,"--button-hover":n||o?c.hover:void 0,"--button-color":c.color,"--button-bd":n||o?c.border:void 0,"--button-hover-color":n||o?c.hoverColor:void 0}}},ae=In((e,t)=>{const n=V("Button",BO,e),{style:r,vars:o,className:i,color:a,disabled:l,children:c,leftSection:u,rightSection:d,fullWidth:f,variant:h,radius:m,loading:g,loaderProps:v,gradient:S,classNames:b,styles:w,unstyled:y,"data-disabled":x,autoContrast:C,mod:E,...T}=n,j=he({name:"Button",props:n,classes:xh,className:i,style:r,classNames:b,styles:w,unstyled:y,vars:o,varsResolver:UO}),R=!!u,k=!!d;return s.jsxs(Sn,{ref:t,...j("root",{active:!l&&!g&&!x}),unstyled:y,variant:h,disabled:l||g,mod:[{disabled:l||x,loading:g,block:f,"with-left-section":R,"with-right-section":k},E],...T,children:[s.jsx(Jo,{mounted:!!g,transition:zO,duration:150,children:I=>s.jsx(q,{component:"span",...j("loader",{style:I}),"aria-hidden":!0,children:s.jsx(er,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v})})}),s.jsxs("span",{...j("inner"),children:[u&&s.jsx(q,{component:"span",...j("section"),mod:{position:"left"},children:u}),s.jsx(q,{component:"span",mod:{loading:g},...j("label"),children:c}),d&&s.jsx(q,{component:"span",...j("section"),mod:{position:"right"},children:d})]})]})});ae.classes=xh;ae.displayName="@mantine/core/Button";ae.Group=qy;var QT={root:"m_4451eb3a"};const VO={},vn=In((e,t)=>{const n=V("Center",VO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=he({name:"Center",props:n,classes:QT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c});return s.jsx(q,{ref:t,mod:[{inline:u},d],...h("root"),...f})});vn.classes=QT;vn.displayName="@mantine/core/Center";const[WO,HO]=Ls(),qO={};function KT(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=V("ChipGroup",qO,e),[a,l]=bn({value:t,defaultValue:n,finalValue:o?[]:null,onChange:r}),c=d=>Array.isArray(a)?a.includes(d):d===a,u=d=>{const f=d.currentTarget.value;Array.isArray(a)?l(a.includes(f)?a.filter(h=>h!==f):[...a,f]):l(f)};return s.jsx(WO,{value:{isChipSelected:c,onChange:u,multiple:o},children:i})}KT.displayName="@mantine/core/ChipGroup";var YT={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 GO={type:"checkbox"},QO=(e,{size:t,radius:n,variant:r,color:o,autoContrast:i})=>{const a=e.variantColorResolver({color:o||e.primaryColor,theme:e,variant:r||"filled",autoContrast:i});return{root:{"--chip-fz":hn(t),"--chip-size":Ne(t,"chip-size"),"--chip-radius":n===void 0?void 0:it(n),"--chip-checked-padding":Ne(t,"chip-checked-padding"),"--chip-padding":Ne(t,"chip-padding"),"--chip-icon-size":Ne(t,"chip-icon-size"),"--chip-bg":o||r?a.background:void 0,"--chip-hover":o||r?a.hover:void 0,"--chip-color":o||r?a.color:void 0,"--chip-bd":o||r?a.border:void 0,"--chip-spacing":Ne(t,"chip-spacing")}}},Dc=Y((e,t)=>{const n=V("Chip",GO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,id:u,checked:d,defaultChecked:f,onChange:h,value:m,wrapperProps:g,type:v,disabled:S,children:b,size:w,variant:y,icon:x,rootRef:C,autoContrast:E,mod:T,...j}=n,R=he({name:"Chip",classes:YT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:QO}),k=HO(),I=Vn(u),{styleProps:O,rest:F}=Yo(j),[L,B]=bn({value:d,defaultValue:f,finalValue:!1,onChange:h}),D=k?{checked:k.isChipSelected(m),onChange:P=>{k.onChange(P),h==null||h(P.currentTarget.checked)},type:k.multiple?"checkbox":"radio"}:{},_=D.checked||L;return s.jsxs(q,{size:w,variant:y,ref:C,mod:T,...R("root"),...O,...g,children:[s.jsx("input",{type:v,...R("input"),checked:_,onChange:P=>B(P.currentTarget.checked),id:I,disabled:S,ref:t,value:m,...D,...F}),s.jsxs("label",{htmlFor:I,"data-checked":_||void 0,"data-disabled":S||void 0,...R("label",{variant:y||"filled"}),children:[_&&s.jsx("span",{...R("iconWrapper"),children:x||s.jsx(vh,{...R("checkIcon")})}),s.jsx("span",{children:b})]})]})});Dc.classes=YT;Dc.displayName="@mantine/core/Chip";Dc.Group=KT;var XT={root:"m_b183c0a2"};const KO={},YO=(e,{color:t})=>({root:{"--code-bg":t?ot(t,e):void 0}}),Gy=Y((e,t)=>{const n=V("Code",KO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...m}=n,g=he({name:"Code",props:n,classes:XT,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:YO});return s.jsx(q,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...m,dir:"ltr"})});Gy.classes=XT;Gy.displayName="@mantine/core/Code";var JT={root:"m_7485cace"};const XO={},JO=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Ne(t,"container-size")}}),Qy=Y((e,t)=>{const n=V("Container",XO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=he({name:"Container",classes:JT,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:JO});return s.jsx(q,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});Qy.classes=JT;Qy.displayName="@mantine/core/Container";const ZO={timeout:1e3};function ZT(e){const{children:t,timeout:n,value:r,...o}=V("CopyButton",ZO,e),i=aj({timeout:n}),a=()=>i.copy(r);return s.jsx(s.Fragment,{children:t({copy:a,copied:i.copied,...o})})}ZT.displayName="@mantine/core/CopyButton";var eP={root:"m_3eebeb36",label:"m_9e365f20"};const e5={orientation:"horizontal"},t5=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?ot(t,e):void 0,"--divider-border-style":n,"--divider-size":Ne(r,"divider-size")}}),dn=Y((e,t)=>{const n=V("Divider",e5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,orientation:d,label:f,labelPosition:h,mod:m,...g}=n,v=he({name:"Divider",classes:eP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:t5});return s.jsx(q,{ref:t,mod:[{orientation:d,"with-label":!!f},m],...v("root"),...g,role:"separator",children:f&&s.jsx(q,{component:"span",mod:{position:h},...v("label"),children:f})})});dn.classes=eP;dn.displayName="@mantine/core/Divider";function n5({open:e,close:t,openDelay:n,closeDelay:r}){const o=p.useRef(-1),i=p.useRef(-1),a=()=>{window.clearTimeout(o.current),window.clearTimeout(i.current)},l=()=>{a(),n===0||n===void 0?e():o.current=window.setTimeout(e,n)},c=()=>{a(),r===0||r===void 0?t():i.current=window.setTimeout(t,r)};return p.useEffect(()=>a,[]),{openDropdown:l,closeDropdown:c}}const[r5,tP]=Un("Grid component was not found in tree"),bg=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,Nb=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":bg(e,t),Mb=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},Ob=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function o5({span:e,order:t,offset:n,selector:r}){var h;const o=At(),i=tP(),l=Br(e)===void 0?12:Br(e),c=Hi({"--col-order":(h=Br(t))==null?void 0:h.toString(),"--col-flex-grow":Mb(l,i.grow),"--col-flex-basis":bg(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":Nb(l,i.columns,i.grow),"--col-offset":Ob(Br(n),i.columns)}),u=bt(o.breakpoints).reduce((m,g)=>{var v;return m[g]||(m[g]={}),typeof t=="object"&&t[g]!==void 0&&(m[g]["--col-order"]=(v=t[g])==null?void 0:v.toString()),typeof e=="object"&&e[g]!==void 0&&(m[g]["--col-flex-grow"]=Mb(e[g],i.grow),m[g]["--col-flex-basis"]=bg(e[g],i.columns),m[g]["--col-width"]=e[g]==="content"?"auto":void 0,m[g]["--col-max-width"]=Nb(e[g],i.columns,i.grow)),typeof n=="object"&&n[g]!==void 0&&(m[g]["--col-offset"]=Ob(n[g],i.columns)),m},{}),f=uc(bt(u),o).filter(m=>bt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return s.jsx(Fs,{styles:c,media:f,selector:r})}var Ky={root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const i5={span:12},Yy=Y((e,t)=>{const n=V("GridCol",i5,e),{classNames:r,className:o,style:i,styles:a,vars:l,span:c,order:u,offset:d,...f}=n,h=tP(),m=Qc();return s.jsxs(s.Fragment,{children:[s.jsx(o5,{selector:`.${m}`,span:c,order:u,offset:d}),s.jsx(q,{ref:t,...h.getStyles("col",{className:tt(o,m),style:i,classNames:r,styles:a}),...f})]})});Yy.classes=Ky;Yy.displayName="@mantine/core/GridCol";function s5({gutter:e,selector:t}){const n=At(),r=Hi({"--grid-gutter":Yt(Br(e))}),o=bt(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=Yt(e[c])),l),{}),a=uc(bt(o),n).filter(l=>bt(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return s.jsx(Fs,{styles:r,media:a,selector:t})}const a5={gutter:"md",grow:!1,columns:12},l5=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),cr=Y((e,t)=>{const n=V("Grid",a5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,grow:u,gutter:d,columns:f,align:h,justify:m,children:g,...v}=n,S=he({name:"Grid",classes:Ky,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:l5}),b=Qc();return s.jsxs(r5,{value:{getStyles:S,grow:u,columns:f},children:[s.jsx(s5,{selector:`.${b}`,...n}),s.jsx(q,{ref:t,...S("root",{className:b}),...v,children:s.jsx("div",{...S("inner"),children:g})})]})});cr.classes=Ky;cr.displayName="@mantine/core/Grid";cr.Col=Yy;function gf(){return gf=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},gf.apply(null,arguments)}function Xy(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var c5=p.useLayoutEffect,u5=function(t){var n=p.useRef(t);return c5(function(){n.current=t}),n},Lb=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},d5=function(t,n){var r=p.useRef();return p.useCallback(function(o){t.current=o,r.current&&Lb(r.current,null),r.current=n,n&&Lb(n,o)},[n])},$b={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},f5=function(t){Object.keys($b).forEach(function(n){t.style.setProperty(n,$b[n],"important")})},Fb=f5,An=null,zb=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function h5(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),An||(An=document.createElement("textarea"),An.setAttribute("tabindex","-1"),An.setAttribute("aria-hidden","true"),Fb(An)),An.parentNode===null&&document.body.appendChild(An);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;An.style[m]=a[m]}),Fb(An),An.value=t;var c=zb(An,e);An.value=t,c=zb(An,e),An.value="x";var u=An.scrollHeight-o,d=u*n;l==="border-box"&&(d=d+o+i),c=Math.max(d,c);var f=u*r;return l==="border-box"&&(f=f+o+i),c=Math.min(f,c),[c,u]}var Bb=function(){},p5=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},m5=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],g5=!!document.documentElement.currentStyle,v5=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=p5(m5,n),o=r.boxSizing;if(o==="")return null;g5&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var i=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),a=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:i,borderSize:a}},y5=v5;function nP(e,t,n){var r=u5(n);p.useLayoutEffect(function(){var o=function(a){return r.current(a)};if(e)return e.addEventListener(t,o),function(){return e.removeEventListener(t,o)}},[])}var x5=function(t){nP(window,"resize",t)},b5=function(t){nP(document.fonts,"loadingdone",t)},w5=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],S5=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?Bb:a,c=t.onHeightChange,u=c===void 0?Bb:c,d=Xy(t,w5),f=d.value!==void 0,h=p.useRef(null),m=d5(h,n),g=p.useRef(0),v=p.useRef(),S=function(){var y=h.current,x=r&&v.current?v.current:y5(y);if(x){v.current=x;var C=h5(x,y.value||y.placeholder||"x",i,o),E=C[0],T=C[1];g.current!==E&&(g.current=E,y.style.setProperty("height",E+"px","important"),u(E,{rowHeight:T}))}},b=function(y){f||S(),l(y)};return p.useLayoutEffect(S),x5(S),b5(S),p.createElement("textarea",gf({},d,{onChange:b,ref:m}))},j5=p.forwardRef(S5);const C5={},Hs=Y((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:a,...l}=V("Textarea",C5,e),c=n&&pj()!=="test",u=c?{maxRows:r,minRows:o}:{};return s.jsx(nr,{component:c?j5:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":a},...u})});Hs.classes=nr.classes;Hs.displayName="@mantine/core/Textarea";function Ub(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const E5={serialize:JSON.stringify,deserialize:JSON.parse},vl=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,formatOnBlur:i,validationError:a,serialize:l,deserialize:c,onFocus:u,onBlur:d,readOnly:f,error:h,...m}=V("JsonInput",E5,e),[g,v]=bn({value:n,defaultValue:r,finalValue:"",onChange:o}),[S,b]=p.useState(Ub(g,c)),w=x=>{u==null||u(x),b(!0)},y=x=>{typeof d=="function"&&d(x);const C=Ub(x.currentTarget.value,c);i&&!f&&C&&x.currentTarget.value.trim()!==""&&v(l(c(x.currentTarget.value),null,2)),b(C)};return s.jsx(Hs,{value:g,onChange:x=>v(x.currentTarget.value),onFocus:w,onBlur:y,ref:t,readOnly:f,...m,autoComplete:"off",__staticSelector:"JsonInput",error:S?h:a||!0,"data-monospace":!0})});vl.classes=nr.classes;vl.displayName="@mantine/core/JsonInput";const[T5,P5]=Un("List component was not found in tree");var Jy={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const k5={},Zy=Y((e,t)=>{const n=V("ListItem",k5,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,children:u,mod:d,...f}=n,h=P5(),m=c||h.icon,g={classNames:r,styles:a};return s.jsx(q,{...h.getStyles("item",{...g,className:o,style:i}),component:"li",mod:[{"with-icon":!!m,centered:h.center},d],ref:t,...f,children:s.jsxs("div",{...h.getStyles("itemWrapper",g),children:[m&&s.jsx("span",{...h.getStyles("itemIcon",g),children:m}),s.jsx("span",{...h.getStyles("itemLabel",g),children:u})]})})});Zy.classes=Jy;Zy.displayName="@mantine/core/ListItem";const R5={type:"unordered"},_5=(e,{size:t,spacing:n})=>({root:{"--list-fz":hn(t),"--list-lh":sj(t),"--list-spacing":Yt(n)}}),$n=Y((e,t)=>{const n=V("List",R5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,type:d,withPadding:f,icon:h,spacing:m,center:g,listStyleType:v,mod:S,...b}=n,w=he({name:"List",classes:Jy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:_5});return s.jsx(T5,{value:{center:g,icon:h,getStyles:w},children:s.jsx(q,{...w("root",{style:{listStyleType:v}}),component:d==="unordered"?"ul":"ol",mod:[{"with-padding":f},S],ref:t,...b,children:u})})});$n.classes=Jy;$n.displayName="@mantine/core/List";$n.Item=Zy;var rP={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const Vb={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Jr("overlay")},D5=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),ex=Y((e,t)=>{const n=V("LoadingOverlay",Vb,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,transitionProps:u,loaderProps:d,overlayProps:f,visible:h,zIndex:m,...g}=n,v=At(),S=he({name:"LoadingOverlay",classes:rP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:D5}),b={...Vb.overlayProps,...f};return s.jsx(Jo,{transition:"fade",...u,mounted:!!h,children:w=>s.jsxs(q,{...S("root",{style:w}),ref:t,...g,children:[s.jsx(er,{...S("loader"),unstyled:l,...d}),s.jsx(_c,{...b,...S("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.white}),s.jsx(_c,{...b,...S("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.colors.dark[5]})]})})});ex.classes=rP;ex.displayName="@mantine/core/LoadingOverlay";const[I5,su]=Un("Menu component was not found in the tree");var yl={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const A5={},tx=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("MenuDivider",A5,e),c=su();return s.jsx(q,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});tx.classes=yl;tx.displayName="@mantine/core/MenuDivider";const N5={},nx=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,onMouseEnter:l,onMouseLeave:c,children:u,...d}=V("MenuDropdown",N5,e),f=p.useRef(null),h=su(),m=S=>{var b,w;(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(w=(b=f.current)==null?void 0:b.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||w.focus())},g=ar(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),v=ar(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return s.jsxs(Zr.Dropdown,{...d,onMouseEnter:g,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:nn(t,f),...h.getStyles("dropdown",{className:r,style:o,styles:i,classNames:n,withStaticClass:!1}),tabIndex:-1,"data-menu-dropdown":!0,onKeyDown:m,children:[s.jsx("div",{tabIndex:-1,"data-autofocus":!0,"data-mantine-stop-propagation":!0,style:{outline:0}}),u]})});nx.classes=yl;nx.displayName="@mantine/core/MenuDropdown";const M5={},rx=In((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,color:l,closeMenuOnClick:c,leftSection:u,rightSection:d,children:f,disabled:h,...m}=V("MenuItem",M5,e),g=su(),v=At(),{dir:S}=zs(),b=p.useRef(),w=g.getItemIndex(b.current),y=m,x=ar(y.onMouseLeave,()=>g.setHovered(-1)),C=ar(y.onMouseEnter,()=>g.setHovered(g.getItemIndex(b.current))),E=ar(y.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),T=ar(y.onFocus,()=>g.setHovered(g.getItemIndex(b.current))),j=l?v.variantColorResolver({color:l,theme:v,variant:"light"}):void 0,R=l?Er({color:l,theme:v}):null;return s.jsxs(Sn,{...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:T,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:nn(b,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===w?!0:void 0,"data-mantine-stop-propagation":!0,onMouseEnter:C,onMouseLeave:x,onClick:E,onKeyDown:ij({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:S,orientation:"vertical",onKeyDown:y.onKeydown}),__vars:{"--menu-item-color":R!=null&&R.isThemeColor&&(R==null?void 0:R.shade)===void 0?`var(--mantine-color-${R.color}-6)`:j==null?void 0:j.color,"--menu-item-hover":j==null?void 0:j.hover},children:[u&&s.jsx("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"left",children:u}),f&&s.jsx("div",{...g.getStyles("itemLabel",{styles:i,classNames:n}),children:f}),d&&s.jsx("div",{...g.getStyles("itemSection",{styles:i,classNames:n}),"data-position":"right",children:d})]})});rx.classes=yl;rx.displayName="@mantine/core/MenuItem";const O5={},ox=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=V("MenuLabel",O5,e),c=su();return s.jsx(q,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});ox.classes=yl;ox.displayName="@mantine/core/MenuLabel";const L5={refProp:"ref"},oP=p.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=V("MenuTarget",L5,e);if(!Qo(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 i=su(),a=ar(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=ar(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=ar(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return s.jsx(Zr.Target,{refProp:r,popupType:"menu",ref:t,...o,children:p.cloneElement(n,{onClick:a,onMouseEnter:l,onMouseLeave:c,"data-expanded":i.opened?!0:void 0})})});oP.displayName="@mantine/core/MenuTarget";const $5={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function Z(e){const t=V("Menu",$5,e),{children:n,onOpen:r,onClose:o,opened:i,defaultOpened:a,trapFocus:l,onChange:c,closeOnItemClick:u,loop:d,closeOnEscape:f,trigger:h,openDelay:m,closeDelay:g,classNames:v,styles:S,unstyled:b,variant:w,vars:y,menuItemTabIndex:x,keepMounted:C,...E}=t,T=he({name:"Menu",classes:yl,props:t,classNames:v,styles:S,unstyled:b}),[j,{setHovered:R,resetHovered:k}]=tD(),[I,O]=bn({value:i,defaultValue:a,finalValue:!1,onChange:c}),[F,L]=p.useState(!1),B=()=>{O(!1),L(!1),I&&(o==null||o())},D=()=>{O(!0),!I&&(r==null||r())},_=()=>{I?B():D()},{openDropdown:P,closeDropdown:N}=n5({open:D,close:B,closeDelay:g,openDelay:m}),$=ce=>eD("[data-menu-item]","[data-menu-dropdown]",ce),{resolvedClassNames:H,resolvedStyles:X}=Gc({classNames:v,styles:S,props:t});return Lo(()=>{k()},[I]),s.jsx(I5,{value:{getStyles:T,opened:I,toggleDropdown:_,getItemIndex:$,hovered:j,setHovered:R,openedViaClick:F,setOpenedViaClick:L,closeOnItemClick:u,closeDropdown:h==="click"?B:N,openDropdown:h==="click"?D:P,closeDropdownImmediately:B,loop:d,trigger:h,unstyled:b,menuItemTabIndex:x},children:s.jsx(Zr,{...E,opened:I,onChange:_,defaultOpened:a,trapFocus:C?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:H,styles:X,unstyled:b,variant:w,keepMounted:C,children:n})})}Z.extend=e=>e;Z.classes=yl;Z.displayName="@mantine/core/Menu";Z.Item=rx;Z.Label=ox;Z.Dropdown=nx;Z.Target=oP;Z.Divider=tx;const[F5,xl]=Un("Modal component was not found in tree");var ei={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const z5={},bh=Y((e,t)=>{const n=V("ModalBody",z5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=xl();return s.jsx(mT,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:a,className:o}),...c})});bh.classes=ei;bh.displayName="@mantine/core/ModalBody";const B5={},wh=Y((e,t)=>{const n=V("ModalCloseButton",B5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=xl();return s.jsx(gT,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:a,className:o}),...c})});wh.classes=ei;wh.displayName="@mantine/core/ModalCloseButton";const U5={},Sh=Y((e,t)=>{const n=V("ModalContent",U5,e),{classNames:r,className:o,style:i,styles:a,vars:l,children:c,...u}=n,d=xl(),f=d.scrollAreaComponent||oM;return s.jsx(eM,{...d.getStyles("content",{className:o,style:i,styles:a,classNames:r}),innerProps:d.getStyles("inner",{className:o,style:i,styles:a,classNames:r}),"data-full-screen":d.fullScreen||void 0,"data-modal-content":!0,ref:t,...u,children:s.jsx(f,{style:{maxHeight:d.fullScreen?"100dvh":`calc(100dvh - (${U(d.yOffset)} * 2))`},children:c})})});Sh.classes=ei;Sh.displayName="@mantine/core/ModalContent";const V5={},jh=Y((e,t)=>{const n=V("ModalHeader",V5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=xl();return s.jsx(vT,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:a,className:o}),...c})});jh.classes=ei;jh.displayName="@mantine/core/ModalHeader";const W5={},Ch=Y((e,t)=>{const n=V("ModalOverlay",W5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=xl();return s.jsx(yT,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:a,className:o}),...c})});Ch.classes=ei;Ch.displayName="@mantine/core/ModalOverlay";const H5={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Jr("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},q5=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:it(t),"--modal-size":Ne(n,"modal-size"),"--modal-y-offset":U(r),"--modal-x-offset":U(o)}}),Eh=Y((e,t)=>{const n=V("ModalRoot",H5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,yOffset:u,scrollAreaComponent:d,radius:f,fullScreen:h,centered:m,xOffset:g,__staticSelector:v,...S}=n,b=he({name:v,classes:ei,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:q5});return s.jsx(F5,{value:{yOffset:u,scrollAreaComponent:d,getStyles:b,fullScreen:h},children:s.jsx(J3,{ref:t,...b("root"),"data-full-screen":h||void 0,"data-centered":m||void 0,unstyled:l,...S})})});Eh.classes=ei;Eh.displayName="@mantine/core/ModalRoot";const G5={},Th=Y((e,t)=>{const n=V("ModalTitle",G5,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=xl();return s.jsx(xT,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:a,className:o}),...c})});Th.classes=ei;Th.displayName="@mantine/core/ModalTitle";const Q5={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Jr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},jn=Y((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l,radius:c,...u}=V("Modal",Q5,e),d=!!n||i;return s.jsxs(Eh,{ref:t,radius:c,...u,children:[r&&s.jsx(Ch,{...o}),s.jsxs(Sh,{radius:c,children:[d&&s.jsxs(jh,{children:[n&&s.jsx(Th,{children:n}),i&&s.jsx(wh,{...a})]}),s.jsx(bh,{children:l})]})]})});jn.classes=ei;jn.displayName="@mantine/core/Modal";jn.Root=Eh;jn.Overlay=Ch;jn.Content=Sh;jn.Body=bh;jn.Header=jh;jn.Title=Th;jn.CloseButton=wh;const[K5,ix]=Ls(),[Y5,X5]=Ls();var Ph={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const J5={},Z5=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Ne(t):Ne(n,"pg-gap")}}),sx=Y((e,t)=>{const n=V("PillGroup",J5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=ix(),m=(h==null?void 0:h.size)||u||void 0,g=he({name:"PillGroup",classes:Ph,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Z5,stylesCtx:{size:m},rootSelector:"group"});return s.jsx(Y5,{value:{size:m,disabled:d},children:s.jsx(q,{ref:t,size:m,...g("group"),...f})})});sx.classes=Ph;sx.displayName="@mantine/core/PillGroup";const e9={variant:"default"},t9=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Ne(n,"pill-fz"),"--pill-height":Ne(n,"pill-height"),"--pill-radius":t===void 0?void 0:it(t)}}),_s=Y((e,t)=>{const n=V("Pill",e9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,variant:u,children:d,withRemoveButton:f,onRemove:h,removeButtonProps:m,radius:g,size:v,disabled:S,mod:b,...w}=n,y=X5(),x=ix(),C=v||(y==null?void 0:y.size)||void 0,E=(x==null?void 0:x.variant)==="filled"?"contrast":u||"default",T=he({name:"Pill",classes:Ph,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:t9,stylesCtx:{size:C}});return s.jsxs(q,{component:"span",ref:t,variant:E,size:C,...T("root",{variant:E}),mod:[{"with-remove":f&&!S,disabled:S||(y==null?void 0:y.disabled)},b],...w,children:[s.jsx("span",{...T("label"),children:d}),f&&s.jsx(Ws,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...m,...T("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:j=>{var R;j.preventDefault(),j.stopPropagation(),(R=m==null?void 0:m.onMouseDown)==null||R.call(m,j)},onClick:j=>{var R;j.stopPropagation(),h==null||h(),(R=m==null?void 0:m.onClick)==null||R.call(m,j)}})]})});_s.classes=Ph;_s.displayName="@mantine/core/Pill";_s.Group=sx;var iP={field:"m_45c4369d"};const n9={type:"visible"},ax=Y((e,t)=>{const n=V("PillsInputField",n9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,type:u,disabled:d,id:f,pointer:h,mod:m,...g}=n,v=ix(),S=ml(),b=he({name:"PillsInputField",classes:iP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"field"}),w=d||(v==null?void 0:v.disabled);return s.jsx(q,{component:"input",ref:nn(t,v==null?void 0:v.fieldRef),"data-type":u,disabled:w,mod:[{disabled:w,pointer:h},m],...b("field"),...g,id:(S==null?void 0:S.inputId)||f,"aria-invalid":v==null?void 0:v.hasError,"aria-describedby":S==null?void 0:S.describedBy,type:"text",onMouseDown:y=>!h&&y.stopPropagation()})});ax.classes=iP;ax.displayName="@mantine/core/PillsInputField";const r9={},rl=Y((e,t)=>{const n=V("PillsInput",r9,e),{children:r,onMouseDown:o,onClick:i,size:a,disabled:l,__staticSelector:c,error:u,variant:d,...f}=n,h=p.useRef();return s.jsx(K5,{value:{fieldRef:h,size:a,disabled:l,hasError:!!u,variant:d},children:s.jsx(nr,{size:a,error:u,variant:d,component:"div",ref:t,onMouseDown:m=>{var g;m.preventDefault(),o==null||o(m),(g=h.current)==null||g.focus()},onClick:m=>{var g;m.preventDefault(),i==null||i(m),(g=h.current)==null||g.focus()},...f,multiline:!0,disabled:l,__staticSelector:c||"PillsInput",withAria:!1,children:r})})});rl.displayName="@mantine/core/PillsInput";rl.Field=ax;function o9({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(nl(i)?o.push({group:i.group,items:i.items.filter(a=>n.indexOf(a.value.toLowerCase().trim())===-1)}):n.indexOf(i.value.toLowerCase().trim())===-1&&o.push(i),o),[])}const i9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},kh=Y((e,t)=>{const n=V("MultiSelect",i9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,value:d,defaultValue:f,onChange:h,onKeyDown:m,variant:g,data:v,dropdownOpened:S,defaultDropdownOpened:b,onDropdownOpen:w,onDropdownClose:y,selectFirstOptionOnChange:x,onOptionSubmit:C,comboboxProps:E,filter:T,limit:j,withScrollArea:R,maxDropdownHeight:k,searchValue:I,defaultSearchValue:O,onSearchChange:F,readOnly:L,disabled:B,onFocus:D,onBlur:_,onPaste:P,radius:N,rightSection:$,rightSectionWidth:H,rightSectionPointerEvents:X,rightSectionProps:ce,leftSection:Ie,leftSectionWidth:ue,leftSectionPointerEvents:xe,leftSectionProps:_e,inputContainer:de,inputWrapperOrder:Oe,withAsterisk:Ye,labelProps:jt,descriptionProps:mt,errorProps:at,wrapperProps:Re,description:et,label:ht,error:oe,maxValues:Q,searchable:fe,nothingFoundMessage:Pe,withCheckIcon:J,checkIconPosition:ie,hidePickedOptions:G,withErrorStyles:Ce,name:He,form:lt,id:gt,clearable:mn,clearButtonProps:Xt,hiddenInputProps:Bt,placeholder:an,hiddenInputValuesDivider:si,required:ai,mod:ip,renderOption:no,onRemove:gr,onClear:ta,scrollAreaProps:ku,...Ru}=n,na=Vn(gt),li=TT(v),bo=PT(li),Cn=ou({opened:S,defaultOpened:b,onDropdownOpen:w,onDropdownClose:()=>{y==null||y(),Cn.resetSelectedOption()}}),{styleProps:ra,rest:{type:_u,autoComplete:sp,...Du}}=Yo(Ru),[ln,ci]=bn({value:d,defaultValue:f,finalValue:[],onChange:h}),[ui,wo]=bn({value:I,defaultValue:O,finalValue:"",onChange:F}),oa=he({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:l}),{resolvedClassNames:Iu,resolvedStyles:Au}=Gc({props:n,styles:a,classNames:r}),A=ne=>{m==null||m(ne),ne.key===" "&&!fe&&(ne.preventDefault(),Cn.toggleDropdown()),ne.key==="Backspace"&&ui.length===0&&ln.length>0&&(gr==null||gr(ln[ln.length-1]),ci(ln.slice(0,ln.length-1)))},M=ln.map((ne,Ee)=>{var Fe,se;return s.jsx(_s,{withRemoveButton:!L&&!((Fe=bo[ne])!=null&&Fe.disabled),onRemove:()=>{ci(ln.filter(De=>ne!==De)),gr==null||gr(ne)},unstyled:l,disabled:B,...oa("pill"),children:((se=bo[ne])==null?void 0:se.label)||ne},`${ne}-${Ee}`)});p.useEffect(()=>{x&&Cn.selectFirstOption()},[x,ln]);const z=mn&&ln.length>0&&!B&&!L&&s.jsx(Le.ClearButton,{size:u,...Xt,onClear:()=>{ta==null||ta(),ci([]),wo("")}}),K=o9({data:li,value:ln});return s.jsxs(s.Fragment,{children:[s.jsxs(Le,{store:Cn,classNames:Iu,styles:Au,unstyled:l,size:u,readOnly:L,__staticSelector:"MultiSelect",onOptionSubmit:ne=>{C==null||C(ne),wo(""),Cn.updateSelectedOptionIndex("selected"),ln.includes(bo[ne].value)?(ci(ln.filter(Ee=>Ee!==bo[ne].value)),gr==null||gr(bo[ne].value)):ln.length<Q&&ci([...ln,bo[ne].value])},...E,children:[s.jsx(Le.DropdownTarget,{children:s.jsx(rl,{...ra,__staticSelector:"MultiSelect",classNames:Iu,styles:Au,unstyled:l,size:u,className:o,style:i,variant:g,disabled:B,radius:N,rightSection:$||z||s.jsx(Le.Chevron,{size:u,error:oe,unstyled:l}),rightSectionPointerEvents:X||(z?"all":"none"),rightSectionWidth:H,rightSectionProps:ce,leftSection:Ie,leftSectionWidth:ue,leftSectionPointerEvents:xe,leftSectionProps:_e,inputContainer:de,inputWrapperOrder:Oe,withAsterisk:Ye,labelProps:jt,descriptionProps:mt,errorProps:at,wrapperProps:Re,description:et,label:ht,error:oe,multiline:!0,withErrorStyles:Ce,__stylesApiProps:{...n,rightSectionPointerEvents:X||(z?"all":"none"),multiline:!0},pointer:!fe,onClick:()=>fe?Cn.openDropdown():Cn.toggleDropdown(),"data-expanded":Cn.dropdownOpened||void 0,id:na,required:ai,mod:ip,children:s.jsxs(_s.Group,{disabled:B,unstyled:l,...oa("pillsList"),children:[M,s.jsx(Le.EventsTarget,{autoComplete:sp,children:s.jsx(rl.Field,{...Du,ref:t,id:na,placeholder:an,type:!fe&&!an?"hidden":"visible",...oa("inputField"),unstyled:l,onFocus:ne=>{D==null||D(ne),fe&&Cn.openDropdown()},onBlur:ne=>{_==null||_(ne),Cn.closeDropdown(),wo("")},onKeyDown:A,value:ui,onChange:ne=>{wo(ne.currentTarget.value),fe&&Cn.openDropdown(),x&&Cn.selectFirstOption()},disabled:B,readOnly:L||!fe,pointer:!fe})})]})})}),s.jsx(CO,{data:G?K:li,hidden:L||B,filter:T,search:ui,limit:j,hiddenWhenEmpty:!Pe,withScrollArea:R,maxDropdownHeight:k,filterOptions:fe,value:ln,checkIconPosition:ie,withCheckIcon:J,nothingFoundMessage:Pe,unstyled:l,labelId:ht?`${na}-label`:void 0,"aria-label":ht?void 0:Ru["aria-label"],renderOption:no,scrollAreaProps:ku})]}),s.jsx(Le.HiddenInput,{name:He,valuesDivider:si,value:ln,form:lt,disabled:B,...Bt})]})});kh.classes={...nr.classes,...Le.classes};kh.displayName="@mantine/core/MultiSelect";function s9(e){return"group"in e}function lx({data:e}){if(s9(e)){const o=e.items.map(i=>s.jsx(lx,{data:i},i.value));return s.jsx("optgroup",{label:e.group,children:o})}const{value:t,label:n,...r}=e;return s.jsx("option",{value:e.value,...r,children:e.label},e.value)}lx.displayName="@mantine/core/NativeSelectOption";const a9={rightSectionPointerEvents:"none"},It=Y((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:a,unstyled:l,...c}=V("NativeSelect",a9,e),u=TT(n).map((d,f)=>s.jsx(lx,{data:d},f));return s.jsx(nr,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:a||s.jsx(mh,{size:o,error:i,unstyled:l}),children:r||u})});It.classes=nr.classes;It.displayName="@mantine/core/NativeSelect";var sP={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const l9={withCloseButton:!0},c9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:it(t),"--notification-color":n?ot(n,e):void 0}}),cx=Y((e,t)=>{const n=V("Notification",l9,e),{className:r,color:o,radius:i,loading:a,withCloseButton:l,withBorder:c,title:u,icon:d,children:f,onClose:h,closeButtonProps:m,classNames:g,style:v,styles:S,unstyled:b,variant:w,vars:y,mod:x,...C}=n,E=he({name:"Notification",classes:sP,props:n,className:r,style:v,classNames:g,styles:S,unstyled:b,vars:y,varsResolver:c9});return s.jsxs(q,{...E("root"),mod:[{"data-with-icon":!!d||a,"data-with-border":c},x],ref:t,variant:w,...C,role:"alert",children:[d&&!a&&s.jsx("div",{...E("icon"),children:d}),a&&s.jsx(er,{size:28,color:o,...E("loader")}),s.jsxs("div",{...E("body"),children:[u&&s.jsx("div",{...E("title"),children:u}),s.jsx(q,{...E("description"),mod:{"data-with-title":!!u},children:f})]}),l&&s.jsx(Ws,{iconSize:16,color:"gray",...m,unstyled:b,onClick:h,...E("closeButton")})]})});cx.classes=sP;cx.displayName="@mantine/core/Notification";function aP(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 Ic;(function(e){e.event="event",e.props="prop"})(Ic||(Ic={}));function Ci(){}function u9(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(i,a){return i===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function Ac(e){return!!(e||"").match(/\d/)}function Va(e){return e==null}function d9(e){return typeof e=="number"&&isNaN(e)}function lP(e){return Va(e)||d9(e)||typeof e=="number"&&!isFinite(e)}function cP(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function f9(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 h9(e,t,n){var r=f9(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 p9(e){var t=p.useRef(e);t.current=e;var n=p.useRef(function(){for(var r=[],o=arguments.length;o--;)r[o]=arguments[o];return t.current.apply(t,r)});return n.current}function ux(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var o=e.split("."),i=o[0],a=o[1]||"";return{beforeDecimal:i,afterDecimal:a,hasNegation:n,addNegation:r}}function m9(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 uP(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function Wb(e,t){return Array(t+1).join(e)}function dP(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),o=r[0],i=r[1];if(i=Number(i),!i)return n+o;o=o.replace(".","");var a=1+i,l=o.length;return a<0?o="0."+Wb("0",Math.abs(a))+o:a>=l?o=o+Wb("0",a-l):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function Hb(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=ux(e),i=o.beforeDecimal,a=o.afterDecimal,l=o.hasNegation,c=parseFloat("0."+(a||"0")),u=a.length<=t?"0."+a:c.toFixed(t),d=u.split("."),f=i;i&&Number(d[0])&&(f=i.split("").reverse().reduce(function(v,S,b){return v.length>b?(Number(v[0])+Number(S)).toString()+v.substring(1,v.length):S+v},d[0]));var h=uP(d[1]||"",t,n),m=l?"-":"",g=r?".":"";return""+m+f+g+h}function us(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 fP=u9(function(e,t){for(var n=0,r=0,o=e.length,i=t.length;e[n]===t[n]&&n<o;)n++;for(;e[o-1-r]===t[i-1-r]&&i-r>n&&o-r>n;)r++;return{from:{start:n,end:o-r},to:{start:n,end:i-r}}}),g9=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function v9(e,t,n){return Math.min(Math.max(e,t),n)}function Xp(e){return Math.max(e.selectionStart,e.selectionEnd)}function y9(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function x9(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function b9(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function w9(e,t,n,r,o,i,a){a===void 0&&(a=b9);var l=o.findIndex(function(x){return x}),c=e.slice(0,l);!t&&!n.startsWith(c)&&(t=c,n=c+n,r=r+c.length);for(var u=n.length,d=e.length,f={},h=new Array(u),m=0;m<u;m++){h[m]=-1;for(var g=0,v=d;g<v;g++){var S=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:m,formattedValueIndex:g});if(S&&f[g]!==!0){h[m]=g,f[g]=!0;break}}}for(var b=r;b<u&&(h[b]===-1||!i(n[b]));)b++;var w=b===u||h[b]===-1?d:h[b];for(b=r-1;b>0&&h[b]===-1;)b--;var y=b===-1||h[b]===-1?0:h[b]+1;return y>w?w:r-y<w-r?y:w}function qb(e,t,n,r){var o=e.length;if(t=v9(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 S9(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(Ac(e[n])||Ac(e[n-1]));return t}function hP(e,t,n,r,o,i){i===void 0&&(i=Ci);var a=p9(function(g,v){var S,b;return lP(g)?(b="",S=""):typeof g=="number"||v?(b=typeof g=="number"?dP(g):g,S=r(b)):(b=o(g,void 0),S=r(b)),{formattedValue:S,numAsString:b}}),l=p.useState(function(){return a(Va(e)?t:e,n)}),c=l[0],u=l[1],d=function(g,v){g.formattedValue!==c.formattedValue&&u({formattedValue:g.formattedValue,numAsString:g.value}),i(g,v)},f=e,h=n;Va(e)&&(f=c.numAsString,h=!0);var m=a(f,h);return p.useMemo(function(){u(m)},[m.formattedValue]),[c,d]}function j9(e){return e.replace(/[^0-9]/g,"")}function C9(e){return e}function E9(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,i=e.getInputRef,a=e.format;a===void 0&&(a=C9);var l=e.removeFormatting;l===void 0&&(l=j9);var c=e.defaultValue,u=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=Ci);var m=e.onKeyDown;m===void 0&&(m=Ci);var g=e.onMouseUp;g===void 0&&(g=Ci);var v=e.onFocus;v===void 0&&(v=Ci);var S=e.onBlur;S===void 0&&(S=Ci);var b=e.value,w=e.getCaretBoundary;w===void 0&&(w=S9);var y=e.isValidInputCharacter;y===void 0&&(y=Ac);var x=e.isCharacterSame,C=aP(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=hP(b,c,!!u,a,l,d),T=E[0],j=T.formattedValue,R=T.numAsString,k=E[1],I=p.useRef(),O=p.useRef({formattedValue:j,numAsString:R}),F=function(oe,Q){O.current={formattedValue:oe.formattedValue,numAsString:oe.value},k(oe,Q)},L=p.useState(!1),B=L[0],D=L[1],_=p.useRef(null),P=p.useRef({setCaretTimeout:null,focusTimeout:null});p.useEffect(function(){return D(!0),function(){clearTimeout(P.current.setCaretTimeout),clearTimeout(P.current.focusTimeout)}},[]);var N=a,$=function(oe,Q){var fe=parseFloat(Q);return{formattedValue:oe,value:Q,floatValue:isNaN(fe)?void 0:fe}},H=function(oe,Q,fe){oe.selectionStart===0&&oe.selectionEnd===oe.value.length||(us(oe,Q),P.current.setCaretTimeout=setTimeout(function(){oe.value===fe&&oe.selectionStart!==Q&&us(oe,Q)},0))},X=function(oe,Q,fe){return qb(oe,Q,w(oe),fe)},ce=function(oe,Q,fe){var Pe=w(Q),J=w9(Q,j,oe,fe,Pe,y,x);return J=qb(Q,J,Pe),J},Ie=function(oe){var Q=oe.formattedValue;Q===void 0&&(Q="");var fe=oe.input,Pe=oe.source,J=oe.event,ie=oe.numAsString,G;if(fe){var Ce=oe.inputValue||fe.value,He=Xp(fe);fe.value=Q,G=ce(Ce,Q,He),G!==void 0&&H(fe,G,Q)}Q!==j&&F($(Q,ie),{event:J,source:Pe})};p.useEffect(function(){var oe=O.current,Q=oe.formattedValue,fe=oe.numAsString;(j!==Q||R!==fe)&&F($(j,R),{event:void 0,source:Ic.props})},[j,R]);var ue=_.current?Xp(_.current):void 0,xe=typeof window<"u"?p.useLayoutEffect:p.useEffect;xe(function(){var oe=_.current;if(j!==O.current.formattedValue&&oe){var Q=ce(O.current.formattedValue,j,ue);oe.value=j,H(oe,Q,j)}},[j]);var _e=function(oe,Q,fe){var Pe=Q.target,J=I.current?g9(I.current,Pe.selectionEnd):fP(j,oe),ie=Object.assign(Object.assign({},J),{lastValue:j}),G=l(oe,ie),Ce=N(G);if(G=l(Ce,void 0),f&&!f($(Ce,G))){var He=Q.target,lt=Xp(He),gt=ce(oe,j,lt);return He.value=j,H(He,gt,j),!1}return Ie({formattedValue:Ce,numAsString:G,inputValue:oe,event:Q,source:fe,input:Q.target}),!0},de=function(oe,Q){Q===void 0&&(Q=0);var fe=oe.selectionStart,Pe=oe.selectionEnd;I.current={selectionStart:fe,selectionEnd:Pe+Q}},Oe=function(oe){var Q=oe.target,fe=Q.value,Pe=_e(fe,oe,Ic.event);Pe&&h(oe),I.current=void 0},Ye=function(oe){var Q=oe.target,fe=oe.key,Pe=Q.selectionStart,J=Q.selectionEnd,ie=Q.value;ie===void 0&&(ie="");var G;fe==="ArrowLeft"||fe==="Backspace"?G=Math.max(Pe-1,0):fe==="ArrowRight"?G=Math.min(Pe+1,ie.length):fe==="Delete"&&(G=Pe);var Ce=0;fe==="Delete"&&Pe===J&&(Ce=1);var He=fe==="ArrowLeft"||fe==="ArrowRight";if(G===void 0||Pe!==J&&!He){m(oe),de(Q,Ce);return}var lt=G;if(He){var gt=fe==="ArrowLeft"?"left":"right";lt=X(ie,G,gt),lt!==G&&oe.preventDefault()}else fe==="Delete"&&!y(ie[G])?lt=X(ie,G,"right"):fe==="Backspace"&&!y(ie[G])&&(lt=X(ie,G,"left"));lt!==G&&H(Q,lt,ie),m(oe),de(Q,Ce)},jt=function(oe){var Q=oe.target,fe=function(){var Pe=Q.selectionStart,J=Q.selectionEnd,ie=Q.value;if(ie===void 0&&(ie=""),Pe===J){var G=X(ie,Pe);G!==Pe&&H(Q,G,ie)}};fe(),requestAnimationFrame(function(){fe()}),g(oe),de(Q)},mt=function(oe){oe.persist&&oe.persist();var Q=oe.target,fe=oe.currentTarget;_.current=Q,P.current.focusTimeout=setTimeout(function(){var Pe=Q.selectionStart,J=Q.selectionEnd,ie=Q.value;ie===void 0&&(ie="");var G=X(ie,Pe);G!==Pe&&!(Pe===0&&J===ie.length)&&H(Q,G,ie),v(Object.assign(Object.assign({},oe),{currentTarget:fe}))},0)},at=function(oe){_.current=null,clearTimeout(P.current.focusTimeout),clearTimeout(P.current.setCaretTimeout),S(oe)},Re=B&&y9()?"numeric":void 0,et=Object.assign({inputMode:Re},C,{type:t,value:j,onChange:Oe,onKeyDown:Ye,onMouseUp:jt,onFocus:mt,onBlur:at});if(n==="text")return o?fn.createElement(fn.Fragment,null,o(j,C)||null):fn.createElement("span",Object.assign({},C,{ref:i}),j);if(r){var ht=r;return fn.createElement(ht,Object.assign({},et,{ref:i}))}return fn.createElement("input",Object.assign({},et,{ref:i}))}function Gb(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,o=t.prefix;o===void 0&&(o="");var i=t.suffix;i===void 0&&(i="");var a=t.allowNegative,l=t.thousandsGroupStyle;if(l===void 0&&(l="thousand"),e===""||e==="-")return e;var c=Rh(t),u=c.thousandSeparator,d=c.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=ux(e,a),m=h.beforeDecimal,g=h.afterDecimal,v=h.addNegation;return n!==void 0&&(g=uP(g,n,!!r)),u&&(m=h9(m,u,l)),o&&(m=o+m),i&&(g=g+i),v&&(m="-"+m),e=m+(f&&d||"")+g,e}function Rh(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 T9(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),o=n.test(e),i=r.test(e);return e=e.replace(/-/g,""),o&&!i&&t&&(e="-"+e),e}function P9(e,t){return new RegExp("(^-)|[0-9]|"+cP(e),"g")}function k9(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function R9(e,t,n){var r;t===void 0&&(t=x9(e));var o=n.allowNegative,i=n.prefix;i===void 0&&(i="");var a=n.suffix;a===void 0&&(a="");var l=n.decimalScale,c=t.from,u=t.to,d=u.start,f=u.end,h=Rh(n),m=h.allowedDecimalSeparators,g=h.decimalSeparator,v=e[f]===g;if(Ac(e)&&(e===i||e===a)&&t.lastValue==="")return e;if(f-d===1&&m.indexOf(e[d])!==-1){var S=l===0?"":g;e=e.substring(0,d)+S+e.substring(d+1,e.length)}var b=function(_,P,N){var $=!1,H=!1;i.startsWith("-")?$=!1:_.startsWith("--")?($=!1,H=!0):a.startsWith("-")&&_.length===a.length?$=!1:_[0]==="-"&&($=!0);var X=$?1:0;return H&&(X=2),X&&(_=_.substring(X),P-=X,N-=X),{value:_,start:P,end:N,hasNegation:$}},w=b(e,d,f),y=w.hasNegation;r=w,e=r.value,d=r.start,f=r.end;var x=b(t.lastValue,c.start,c.end),C=x.start,E=x.end,T=x.value,j=e.substring(d,f);e.length&&T.length&&(C>T.length-a.length||E<i.length)&&!(j&&a.startsWith(j))&&(e=T);var R=0;e.startsWith(i)?R+=i.length:d<i.length&&(R=d),e=e.substring(R),f-=R;var k=e.length,I=e.length-a.length;e.endsWith(a)?k=I:(f>I||f>e.length-a.length)&&(k=f),e=e.substring(0,k),e=T9(y?"-"+e:e,o),e=(e.match(P9(g))||[]).join("");var O=e.indexOf(g);e=e.replace(new RegExp(cP(g),"g"),function(_,P){return P===O?".":""});var F=ux(e,o),L=F.beforeDecimal,B=F.afterDecimal,D=F.addNegation;return u.end-u.start<c.end-c.start&&L===""&&v&&!parseFloat(B)&&(e=D?"-":""),e}function _9(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}),i=e[0]==="-";o.fill(!1,0,n.length+(i?1:0));var a=e.length;return o.fill(!1,a-r.length+1,a+1),o}function D9(e){var t=Rh(e),n=t.thousandSeparator,r=t.decimalSeparator,o=e.prefix;o===void 0&&(o="");var i=e.allowNegative;if(i===void 0&&(i=!0),n===r)throw new Error(`
|
|
84
|
-
Decimal separator can't be same as thousand separator.
|
|
85
|
-
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
86
|
-
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
87
|
-
`);return o.startsWith("-")&&i&&(console.error(`
|
|
88
|
-
Prefix can't start with '-' when allowNegative is true.
|
|
89
|
-
prefix: `+o+`
|
|
90
|
-
allowNegative: `+i+`
|
|
91
|
-
`),i=!1),Object.assign(Object.assign({},e),{allowNegative:i})}function I9(e){e=D9(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=Ci);var i=e.onBlur;i===void 0&&(i=Ci);var a=e.thousandSeparator,l=e.decimalScale,c=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var d=e.defaultValue,f=e.value,h=e.valueIsNumericString,m=e.onValueChange,g=aP(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=Rh(e),S=v.decimalSeparator,b=v.allowedDecimalSeparators,w=function(D){return Gb(D,e)},y=function(D,_){return R9(D,_,e)},x=Va(f)?d:f,C=h??k9(x,u,t);Va(f)?Va(d)||(C=C||typeof d=="number"):C=C||typeof f=="number";var E=function(D){return lP(D)?D:(typeof D=="number"&&(D=dP(D)),C&&typeof l=="number"?Hb(D,l,!!c):D)},T=hP(E(f),E(d),!!C,w,y,m),j=T[0],R=j.numAsString,k=j.formattedValue,I=T[1],O=function(D){var _=D.target,P=D.key,N=_.selectionStart,$=_.selectionEnd,H=_.value;if(H===void 0&&(H=""),(P==="Backspace"||P==="Delete")&&$<u.length){D.preventDefault();return}if(N!==$){o(D);return}P==="Backspace"&&H[0]==="-"&&N===u.length+1&&n&&us(_,1),l&&c&&(P==="Backspace"&&H[N-1]===S?(us(_,N-1),D.preventDefault()):P==="Delete"&&H[N]===S&&D.preventDefault()),b!=null&&b.includes(P)&&H[N]===S&&us(_,N+1);var X=a===!0?",":a;P==="Backspace"&&H[N-1]===X&&us(_,N-1),P==="Delete"&&H[N]===X&&us(_,N+1),o(D)},F=function(D){var _=R;if(_.match(/\d/g)||(_=""),r||(_=m9(_)),c&&l&&(_=Hb(_,l,c)),_!==R){var P=Gb(_,e);I({formattedValue:P,value:_,floatValue:parseFloat(_)},{event:D,source:Ic.event})}i(D)},L=function(D){return D===S?!0:Ac(D)},B=function(D){var _=D.currentValue,P=D.lastValue,N=D.formattedValue,$=D.currentValueIndex,H=D.formattedValueIndex,X=_[$],ce=N[H],Ie=fP(P,_),ue=Ie.to,xe=function(_e){return y(_e).indexOf(".")+u.length};return f===0&&c&&l&&_[ue.start]===S&&xe(_)<$&&xe(N)>H?!1:$>=ue.start&&$<ue.end&&b&&b.includes(X)&&ce===S?!0:X===ce};return Object.assign(Object.assign({},g),{value:k,valueIsNumericString:!1,isValidInputCharacter:L,isCharacterSame:B,onValueChange:I,format:w,removeFormatting:y,getCaretBoundary:function(D){return _9(D,e)},onKeyDown:O,onBlur:F})}function A9(e){var t=I9(e);return fn.createElement(E9,Object.assign({},t))}function Qb({direction:e,style:t,...n}){return s.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:s.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 wg={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const N9=/^(0\.0*|-0(\.0*)?)$/,M9=/^-?0\d+(\.\d+)?\.?$/;function O9(e){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)}function Kb(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 L9={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,allowLeadingZeros:!0,trimLeadingZeroesOnBlur:!0,startValue:0},$9=(e,{size:t})=>({controls:{"--ni-chevron-size":Ne(t,"ni-chevron-size")}}),dx=Y((e,t)=>{const n=V("NumberInput",L9,e),{className:r,classNames:o,styles:i,unstyled:a,vars:l,onChange:c,onValueChange:u,value:d,defaultValue:f,max:h,min:m,step:g,hideControls:v,rightSection:S,isAllowed:b,clampBehavior:w,onBlur:y,allowDecimal:x,decimalScale:C,onKeyDown:E,onKeyDownCapture:T,handlersRef:j,startValue:R,disabled:k,rightSectionPointerEvents:I,allowNegative:O,readOnly:F,size:L,rightSectionWidth:B,stepHoldInterval:D,stepHoldDelay:_,allowLeadingZeros:P,withKeyboardEvents:N,trimLeadingZeroesOnBlur:$,...H}=n,X=he({name:"NumberInput",classes:wg,props:n,classNames:o,styles:i,unstyled:a,vars:l,varsResolver:$9}),{resolvedClassNames:ce,resolvedStyles:Ie}=Gc({classNames:o,styles:i,props:n}),[ue,xe]=bn({value:d,defaultValue:f,onChange:c}),_e=_!==void 0&&D!==void 0,de=p.useRef(null),Oe=p.useRef(null),Ye=p.useRef(0),jt=(G,Ce)=>{Ce.source==="event"&&xe(O9(G.floatValue)&&!N9.test(G.value)&&!(P&&M9.test(G.value))?G.floatValue:G.value),u==null||u(G,Ce)},mt=G=>{const Ce=String(G).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return Ce?Math.max(0,(Ce[1]?Ce[1].length:0)-(Ce[2]?+Ce[2]:0)):0},at=G=>{de.current&&typeof G<"u"&&de.current.setSelectionRange(G,G)},Re=p.useRef();Re.current=()=>{let G;const Ce=mt(ue),He=mt(g),lt=Math.max(Ce,He),gt=10**lt;if(typeof ue!="number"||Number.isNaN(ue))G=Bu(R,m,h);else if(h!==void 0){const Xt=(Math.round(ue*gt)+Math.round(g*gt))/gt;G=Xt<=h?Xt:h}else G=(Math.round(ue*gt)+Math.round(g*gt))/gt;const mn=G.toFixed(lt);xe(parseFloat(mn)),u==null||u({floatValue:parseFloat(mn),formattedValue:mn,value:mn},{source:"increment"}),setTimeout(()=>{var Xt;return at((Xt=de.current)==null?void 0:Xt.value.length)},0)};const et=p.useRef();et.current=()=>{let G;const Ce=m!==void 0?m:O?Number.MIN_SAFE_INTEGER:0,He=mt(ue),lt=mt(g),gt=Math.max(He,lt),mn=10**gt;if(typeof ue!="number"||Number.isNaN(ue))G=Bu(R,Ce,h);else{const Bt=(Math.round(ue*mn)-Math.round(g*mn))/mn;G=Ce!==void 0&&Bt<Ce?Ce:Bt}const Xt=G.toFixed(gt);xe(parseFloat(Xt)),u==null||u({floatValue:parseFloat(Xt),formattedValue:Xt,value:Xt},{source:"decrement"}),setTimeout(()=>{var Bt;return at((Bt=de.current)==null?void 0:Bt.value.length)},0)};const ht=G=>{E==null||E(G),!(F||!N)&&(G.key==="ArrowUp"&&(G.preventDefault(),Re.current()),G.key==="ArrowDown"&&(G.preventDefault(),et.current()))},oe=G=>{if(T==null||T(G),G.key==="Backspace"){const Ce=de.current;Ce.selectionStart===0&&Ce.selectionStart===Ce.selectionEnd&&(G.preventDefault(),window.setTimeout(()=>at(0),0))}};Bf(j,{increment:Re.current,decrement:et.current});const Q=G=>{G?Re.current():et.current(),Ye.current+=1},fe=G=>{if(Q(G),_e){const Ce=typeof D=="number"?D:D(Ye.current);Oe.current=window.setTimeout(()=>fe(G),Ce)}},Pe=(G,Ce)=>{var He;G.preventDefault(),(He=de.current)==null||He.focus(),Q(Ce),_e&&(Oe.current=window.setTimeout(()=>fe(Ce),_))},J=()=>{Oe.current&&window.clearTimeout(Oe.current),Oe.current=null,Ye.current=0},ie=s.jsxs("div",{...X("controls"),children:[s.jsx(Sn,{...X("control"),tabIndex:-1,"aria-hidden":!0,disabled:k||typeof ue=="number"&&h!==void 0&&ue>=h,mod:{direction:"up"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{Pe(G,!0)},onPointerUp:J,onPointerLeave:J,children:s.jsx(Qb,{direction:"up"})}),s.jsx(Sn,{...X("control"),tabIndex:-1,"aria-hidden":!0,disabled:k||typeof ue=="number"&&m!==void 0&&ue<=m,mod:{direction:"down"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{Pe(G,!1)},onPointerUp:J,onPointerLeave:J,children:s.jsx(Qb,{direction:"down"})})]});return s.jsx(nr,{component:A9,allowNegative:O,className:tt(wg.root,r),size:L,...H,readOnly:F,disabled:k,value:ue,getInputRef:nn(t,de),onValueChange:jt,rightSection:v||F?S:S||ie,classNames:ce,styles:Ie,unstyled:a,__staticSelector:"NumberInput",decimalScale:x?C:0,onKeyDown:ht,onKeyDownCapture:oe,rightSectionPointerEvents:I??(k?"none":void 0),rightSectionWidth:B??`var(--ni-right-section-width-${L||"sm"})`,allowLeadingZeros:P,onBlur:G=>{if(y==null||y(G),w==="blur"&&typeof ue=="number"&&Bu(ue,m,h)!==ue&&xe(Bu(ue,m,h)),$&&typeof ue=="string"){const Ce=ue.replace(/^0+/,""),He=parseFloat(Ce);xe(Number.isNaN(He)||He>Number.MAX_SAFE_INTEGER?Ce:He)}},isAllowed:G=>w==="strict"?b?b(G)&&Kb(G.floatValue,m,h):Kb(G.floatValue,m,h):b?b(G):!0})});dx.classes={...nr.classes,...wg};dx.displayName="@mantine/core/NumberInput";const[F9,_h]=Un("Pagination.Root component was not found in tree");var au={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const z9={withPadding:!0},lu=Y((e,t)=>{const n=V("PaginationControl",z9,e),{classNames:r,className:o,style:i,styles:a,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,m=_h(),g=u||m.disabled;return s.jsx(Sn,{ref:t,disabled:g,mod:[{active:c,disabled:g,"with-padding":d},f],...m.getStyles("control",{className:o,style:i,classNames:r,styles:a,active:!g}),...h})});lu.classes=au;lu.displayName="@mantine/core/PaginationControl";function cu({style:e,children:t,path:n,...r}){return s.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:s.jsx("path",{d:n,fill:"currentColor"})})}const B9=e=>s.jsx(cu,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),U9=e=>s.jsx(cu,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),V9=e=>s.jsx(cu,{...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"}),W9=e=>s.jsx(cu,{...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"}),H9=e=>s.jsx(cu,{...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"}),q9={icon:H9},Dh=Y((e,t)=>{const n=V("PaginationDots",q9,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,...u}=n,d=_h(),f=c;return s.jsx(q,{ref:t,...d.getStyles("dots",{className:o,style:i,styles:a,classNames:r}),...u,children:s.jsx(f,{style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});Dh.classes=au;Dh.displayName="@mantine/core/PaginationDots";function Ih({icon:e,name:t,action:n,type:r}){const o={icon:e},i=p.forwardRef((a,l)=>{const{icon:c,...u}=V(t,o,a),d=c,f=_h(),h=r==="next"?f.active===f.total:f.active===1;return s.jsx(lu,{disabled:f.disabled||h,ref:l,onClick:f[n],withPadding:!1,...u,children:s.jsx(d,{className:"mantine-rotate-rtl",style:{width:"calc(var(--pagination-control-size) / 1.8)",height:"calc(var(--pagination-control-size) / 1.8)"}})})});return i.displayName=`@mantine/core/${t}`,i}const pP=Ih({icon:B9,name:"PaginationNext",action:"onNext",type:"next"}),mP=Ih({icon:U9,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),gP=Ih({icon:V9,name:"PaginationFirst",action:"onFirst",type:"previous"}),vP=Ih({icon:W9,name:"PaginationLast",action:"onLast",type:"next"});function fx({dotsIcon:e}){const t=_h(),n=t.range.map((r,o)=>{var i;return r==="dots"?s.jsx(Dh,{icon:e},o):s.jsx(lu,{active:r===t.active,"aria-current":r===t.active?"page":void 0,onClick:()=>t.onChange(r),disabled:t.disabled,...(i=t.getItemProps)==null?void 0:i.call(t,r),children:r},o)});return s.jsx(s.Fragment,{children:n})}fx.displayName="@mantine/core/PaginationItems";const G9={siblings:1,boundaries:1},Q9=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:it(n),"--pagination-control-size":Ne(t,"pagination-control-size"),"--pagination-control-fz":hn(t),"--pagination-active-bg":r?ot(r,e):void 0,"--pagination-active-color":$s(o,e)?Ko({color:r,theme:e,autoContrast:o}):void 0}}),Ah=Y((e,t)=>{const n=V("PaginationRoot",G9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,total:u,value:d,defaultValue:f,onChange:h,disabled:m,siblings:g,boundaries:v,color:S,radius:b,onNextPage:w,onPreviousPage:y,onFirstPage:x,onLastPage:C,getItemProps:E,autoContrast:T,...j}=n,R=he({name:"Pagination",classes:au,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:Q9}),{range:k,setPage:I,next:O,previous:F,active:L,first:B,last:D}=yD({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:v}),_=ar(w,O),P=ar(y,F),N=ar(x,B),$=ar(C,D);return s.jsx(F9,{value:{total:u,range:k,active:L,disabled:m,getItemProps:E,onChange:I,onNext:_,onPrevious:P,onFirst:N,onLast:$,getStyles:R},children:s.jsx(q,{ref:t,...R("root"),...j})})});Ah.classes=au;Ah.displayName="@mantine/core/PaginationRoot";const K9={withControls:!0,siblings:1,boundaries:1,gap:8},eo=Y((e,t)=>{const n=V("Pagination",K9,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:a,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,hideWithOnePage:m,...g}=n;return f<=0||m&&f===1?null:s.jsx(Ah,{ref:t,total:f,...g,children:s.jsxs(te,{gap:h,children:[r&&s.jsx(gP,{icon:u,...i==null?void 0:i("first")}),o&&s.jsx(mP,{icon:l,...i==null?void 0:i("previous")}),s.jsx(fx,{dotsIcon:d}),o&&s.jsx(pP,{icon:a,...i==null?void 0:i("next")}),r&&s.jsx(vP,{icon:c,...i==null?void 0:i("last")})]})})});eo.classes=au;eo.displayName="@mantine/core/Pagination";eo.Root=Ah;eo.Control=lu;eo.Dots=Dh;eo.First=gP;eo.Last=vP;eo.Next=pP;eo.Previous=mP;eo.Items=fx;const Y9=({reveal:e})=>s.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:s.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 Sg={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const X9={visibilityToggleIcon:Y9},J9=(e,{size:t})=>({root:{"--psi-icon-size":Ne(t,"psi-icon-size"),"--psi-button-size":Ne(t,"psi-button-size")}}),Hr=Y((e,t)=>{const n=V("PasswordInput",X9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,required:u,error:d,leftSection:f,disabled:h,id:m,variant:g,inputContainer:v,description:S,label:b,size:w,errorProps:y,descriptionProps:x,labelProps:C,withAsterisk:E,inputWrapperOrder:T,wrapperProps:j,radius:R,rightSection:k,rightSectionWidth:I,rightSectionPointerEvents:O,leftSectionWidth:F,visible:L,defaultVisible:B,onVisibilityChange:D,visibilityToggleIcon:_,visibilityToggleButtonProps:P,rightSectionProps:N,leftSectionProps:$,leftSectionPointerEvents:H,withErrorStyles:X,mod:ce,...Ie}=n,ue=Vn(m),[xe,_e]=bn({value:L,defaultValue:B,finalValue:!1,onChange:D}),de=()=>_e(!xe),Oe=he({name:"PasswordInput",classes:Sg,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:J9}),{resolvedClassNames:Ye,resolvedStyles:jt}=Gc({classNames:r,styles:a,props:n}),{styleProps:mt,rest:at}=Yo(Ie),Re=_,et=s.jsx(en,{...Oe("visibilityToggle"),disabled:h,radius:R,"aria-hidden":!P,tabIndex:-1,...P,variant:"subtle",color:"gray",unstyled:l,onMouseDown:ht=>{var oe;ht.preventDefault(),(oe=P==null?void 0:P.onMouseDown)==null||oe.call(P,ht),de()},onKeyDown:ht=>{var oe;(oe=P==null?void 0:P.onKeyDown)==null||oe.call(P,ht),ht.key===" "&&(ht.preventDefault(),de())},children:s.jsx(Re,{reveal:xe})});return s.jsx(Mt.Wrapper,{required:u,id:ue,label:b,error:d,description:S,size:w,classNames:Ye,styles:jt,__staticSelector:"PasswordInput",errorProps:y,descriptionProps:x,unstyled:l,withAsterisk:E,inputWrapperOrder:T,inputContainer:v,variant:g,labelProps:{...C,htmlFor:ue},mod:ce,...Oe("root"),...mt,...j,children:s.jsx(Mt,{component:"div",error:d,leftSection:f,size:w,classNames:{...Ye,input:tt(Sg.input,Ye.input)},styles:jt,radius:R,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:I,rightSection:k??et,variant:g,unstyled:l,leftSectionWidth:F,rightSectionPointerEvents:O||"all",rightSectionProps:N,leftSectionProps:$,leftSectionPointerEvents:H,withAria:!1,withErrorStyles:X,children:s.jsx("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...Oe("innerInput"),disabled:h,id:ue,ref:t,...at,autoComplete:at.autoComplete||"off",type:xe?"text":"password"})})})});Hr.classes={...nr.classes,...Sg};Hr.displayName="@mantine/core/PasswordInput";const[Z9,yP]=Ls(),[eL,tL]=Ls();var xP={card:"m_9dc8ae12"};const nL={withBorder:!0},rL=(e,{radius:t})=>({card:{"--card-radius":it(t)}}),hx=Y((e,t)=>{const n=V("RadioCard",nL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,checked:u,mod:d,withBorder:f,value:h,onClick:m,name:g,onKeyDown:v,...S}=n,b=he({name:"RadioCard",classes:xP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:rL,rootSelector:"card"}),{dir:w}=zs(),y=yP(),x=typeof u=="boolean"?u:(y==null?void 0:y.value)===h||!1,C=g||(y==null?void 0:y.name),E=T=>{if(v==null||v(T),["ArrowDown","ArrowUp","ArrowLeft","ArrowRight"].includes(T.nativeEvent.code)){T.preventDefault();const j=Array.from(document.querySelectorAll(`[role="radio"][name="${C||"__mantine"}"]`)),R=j.findIndex(O=>O===T.target),k=R+1>=j.length?0:R+1,I=R-1<0?j.length-1:R-1;T.nativeEvent.code==="ArrowDown"&&(j[k].focus(),j[k].click()),T.nativeEvent.code==="ArrowUp"&&(j[I].focus(),j[I].click()),T.nativeEvent.code==="ArrowLeft"&&(j[w==="ltr"?I:k].focus(),j[w==="ltr"?I:k].click()),T.nativeEvent.code==="ArrowRight"&&(j[w==="ltr"?k:I].focus(),j[w==="ltr"?k:I].click())}};return s.jsx(eL,{value:{checked:x},children:s.jsx(Sn,{ref:t,mod:[{"with-border":f,checked:x},d],...b("card"),...S,role:"radio","aria-checked":x,name:C,onClick:T=>{m==null||m(T),y==null||y.onChange(h||"")},onKeyDown:E})})});hx.displayName="@mantine/core/RadioCard";hx.classes=xP;const oL={},px=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,name:c,readOnly:u,...d}=V("RadioGroup",oL,e),f=Vn(c),[h,m]=bn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=v=>!u&&m(typeof v=="string"?v:v.currentTarget.value);return s.jsx(Z9,{value:{value:h,onChange:g,size:i,name:f},children:s.jsx(Mt.Wrapper,{size:i,ref:t,...a,...d,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(By,{role:"radiogroup",children:l})})})});px.classes=Mt.Wrapper.classes;px.displayName="@mantine/core/RadioGroup";function bP({size:e,style:t,...n}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 5 5",style:{width:U(e),height:U(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var wP={indicator:"m_717d7ff6",icon:"m_3e4da632","indicator--outline":"m_2980836c"};const iL={icon:bP},sL=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Er({color:n||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{indicator:{"--radio-size":Ne(r,"radio-size"),"--radio-radius":t===void 0?void 0:it(t),"--radio-color":i==="outline"?c:ot(n,e),"--radio-icon-size":Ne(r,"radio-icon-size"),"--radio-icon-color":o?ot(o,e):$s(a,e)?Ko({color:n,theme:e,autoContrast:a}):void 0}}},mx=Y((e,t)=>{const n=V("RadioIndicator",iL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,icon:u,radius:d,color:f,iconColor:h,autoContrast:m,checked:g,mod:v,variant:S,disabled:b,...w}=n,y=u,x=he({name:"RadioIndicator",classes:wP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:sL,rootSelector:"indicator"}),C=tL(),E=typeof g=="boolean"?g:(C==null?void 0:C.checked)||!1;return s.jsx(q,{ref:t,...x("indicator",{variant:S}),variant:S,mod:[{checked:E,disabled:b},v],...w,children:s.jsx(y,{...x("icon")})})});mx.displayName="@mantine/core/RadioIndicator";mx.classes=wP;var SP={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const aL={labelPosition:"right"},lL=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:a})=>{const l=Er({color:r||e.primaryColor,theme:e}),c=l.isThemeColor&&l.shade===void 0?`var(--mantine-color-${l.color}-outline)`:l.color;return{root:{"--radio-size":Ne(t,"radio-size"),"--radio-radius":n===void 0?void 0:it(n),"--radio-color":i==="outline"?c:ot(r,e),"--radio-icon-color":o?ot(o,e):$s(a,e)?Ko({color:r,theme:e,autoContrast:a}):void 0,"--radio-icon-size":Ne(t,"radio-icon-size")}}},Ds=Y((e,t)=>{const n=V("Radio",aL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,id:u,size:d,label:f,labelPosition:h,description:m,error:g,radius:v,color:S,variant:b,disabled:w,wrapperProps:y,icon:x=bP,rootRef:C,iconColor:E,onChange:T,mod:j,...R}=n,k=he({name:"Radio",classes:SP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:lL}),I=yP(),O=(I==null?void 0:I.size)??d,F=n.size?d:O,{styleProps:L,rest:B}=Yo(R),D=Vn(u),_=I?{checked:I.value===B.value,name:B.name??I.name,onChange:P=>{I.onChange(P),T==null||T(P)}}:{};return s.jsx(gh,{...k("root"),__staticSelector:"Radio",__stylesApiProps:n,id:D,size:F,labelPosition:h,label:f,description:m,error:g,disabled:w,classNames:r,styles:a,unstyled:l,"data-checked":_.checked||void 0,variant:b,ref:C,mod:j,...L,...y,children:s.jsxs(q,{...k("inner"),mod:{"label-position":h},children:[s.jsx(q,{...k("radio",{focusable:!0,variant:b}),onChange:T,...B,..._,component:"input",mod:{error:!!g},ref:t,id:D,disabled:w,type:"radio"}),s.jsx(x,{...k("icon"),"aria-hidden":!0})]})})});Ds.classes=SP;Ds.displayName="@mantine/core/Radio";Ds.Group=px;Ds.Card=hx;Ds.Indicator=mx;const cL={duration:100,transition:"fade"};function uL(e,t){return{...cL,...t,...e}}function dL({offset:e,position:t,defaultOpened:n}){const[r,o]=p.useState(n),i=p.useRef(),{x:a,y:l,elements:c,refs:u,update:d,placement:f}=yy({placement:t,middleware:[py({crossAxis:!0,padding:5,rootBoundary:"document"})]}),h=f.includes("right")?e:t.includes("left")?e*-1:0,m=f.includes("bottom")?e:t.includes("top")?e*-1:0,g=p.useCallback(({clientX:v,clientY:S})=>{u.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:v,y:S,left:v+h,top:S+m,right:v,bottom:S}}})},[c.reference]);return p.useEffect(()=>{if(u.floating.current){const v=i.current;v.addEventListener("mousemove",g);const S=Mo(u.floating.current);return S.forEach(b=>{b.addEventListener("scroll",d)}),()=>{v.removeEventListener("mousemove",g),S.forEach(b=>{b.removeEventListener("scroll",d)})}}},[c.reference,u.floating.current,d,g,r]),{handleMouseMove:g,x:a,y:l,opened:r,setOpened:o,boundaryRef:i,floating:u.setFloating}}var Nh={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const fL={refProp:"ref",withinPortal:!0,offset:10,defaultOpened:!1,position:"right",zIndex:Jr("popover")},hL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:it(t),"--tooltip-bg":n?ot(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),gx=Y((e,t)=>{const n=V("TooltipFloating",fL,e),{children:r,refProp:o,withinPortal:i,style:a,className:l,classNames:c,styles:u,unstyled:d,radius:f,color:h,label:m,offset:g,position:v,multiline:S,zIndex:b,disabled:w,defaultOpened:y,variant:x,vars:C,portalProps:E,...T}=n,j=At(),R=he({name:"TooltipFloating",props:n,classes:Nh,className:l,style:a,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:C,varsResolver:hL}),{handleMouseMove:k,x:I,y:O,opened:F,boundaryRef:L,floating:B,setOpened:D}=dL({offset:g,position:v,defaultOpened:y});if(!Qo(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 _=nn(L,r.ref,t),P=$=>{var H,X;(X=(H=r.props).onMouseEnter)==null||X.call(H,$),k($),D(!0)},N=$=>{var H,X;(X=(H=r.props).onMouseLeave)==null||X.call(H,$),D(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(Vs,{...E,withinPortal:i,children:s.jsx(q,{...T,...R("tooltip",{style:{...wj(a,j),zIndex:b,display:!w&&F?"block":"none",top:(O&&Math.round(O))??"",left:(I&&Math.round(I))??""}}),variant:x,ref:B,mod:{multiline:S},children:m})}),p.cloneElement(r,{...r.props,[o]:_,onMouseEnter:P,onMouseLeave:N})]})});gx.classes=Nh;gx.displayName="@mantine/core/TooltipFloating";const jP=p.createContext(!1),pL=jP.Provider,mL=()=>p.useContext(jP),gL={openDelay:0,closeDelay:0};function vx(e){const{openDelay:t,closeDelay:n,children:r}=V("TooltipGroup",gL,e);return s.jsx(pL,{value:!0,children:s.jsx(c3,{delay:{open:t,close:n},children:r})})}vx.displayName="@mantine/core/TooltipGroup";vx.extend=e=>e;function vL(e){var E,T,j;const[t,n]=p.useState(e.defaultOpened),o=typeof e.opened=="boolean"?e.opened:t,i=mL(),a=Vn(),{delay:l,currentId:c,setCurrentId:u}=nT(),d=p.useCallback(R=>{n(R),R&&u(a)},[u,a]),{x:f,y:h,context:m,refs:g,update:v,placement:S,middlewareData:{arrow:{x:b,y:w}={}}}=yy({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[XE(e.offset),py({padding:8}),vg(),JE({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[yg()]:[]]}),{getReferenceProps:y,getFloatingProps:x}=v3([l3(m,{enabled:(E=e.events)==null?void 0:E.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((T=e.events)!=null&&T.touch)}),g3(m,{enabled:(j=e.events)==null?void 0:j.focus,visibleOnly:!0}),x3(m,{role:"tooltip"}),p3(m,{enabled:typeof e.opened>"u"}),u3(m,{id:a})]);cT({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Lo(()=>{var R;(R=e.onPositionChange)==null||R.call(e,S)},[S]);const C=o&&c&&c!==a;return{x:f,y:h,arrowX:b,arrowY:w,reference:g.setReference,floating:g.setFloating,getFloatingProps:x,getReferenceProps:y,isGroupPhase:C,opened:o,placement:S}}const Yb={position:"top",refProp:"ref",withinPortal:!0,inline:!1,defaultOpened:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Jr("popover"),positionDependencies:[]},yL=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:it(t),"--tooltip-bg":n?ot(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),qs=Y((e,t)=>{const n=V("Tooltip",Yb,e),{children:r,position:o,refProp:i,label:a,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,defaultOpened:f,withinPortal:h,radius:m,color:g,classNames:v,styles:S,unstyled:b,style:w,className:y,withArrow:x,arrowSize:C,arrowOffset:E,arrowRadius:T,arrowPosition:j,offset:R,transitionProps:k,multiline:I,events:O,zIndex:F,disabled:L,positionDependencies:B,onClick:D,onMouseEnter:_,onMouseLeave:P,inline:N,variant:$,keepMounted:H,vars:X,portalProps:ce,mod:Ie,floatingStrategy:ue,...xe}=V("Tooltip",Yb,n),{dir:_e}=zs(),de=p.useRef(null),Oe=vL({position:rT(_e,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,defaultOpened:f,events:O,arrowRef:de,arrowOffset:E,offset:typeof R=="number"?R+(x?C/2:0):R,positionDependencies:[...B,r],inline:N,strategy:ue}),Ye=he({name:"Tooltip",props:n,classes:Nh,className:y,style:w,classNames:v,styles:S,unstyled:b,rootSelector:"tooltip",vars:X,varsResolver:yL});if(!Qo(r))throw new Error("[@mantine/core] Tooltip component children should be an element or a component that accepts ref, fragments, strings, numbers and other primitive values are not supported");const jt=nn(Oe.reference,r.ref,t),mt=uL(k,{duration:100,transition:"fade"});return s.jsxs(s.Fragment,{children:[s.jsx(Vs,{...ce,withinPortal:h,children:s.jsx(Jo,{...mt,keepMounted:H,mounted:!L&&!!Oe.opened,duration:Oe.isGroupPhase?10:mt.duration,children:at=>s.jsxs(q,{...xe,"data-fixed":ue==="fixed"||void 0,variant:$,mod:[{multiline:I},Ie],...Oe.getFloatingProps({ref:Oe.floating,className:Ye("tooltip").className,style:{...Ye("tooltip").style,...at,zIndex:F,top:Oe.y??0,left:Oe.x??0}}),children:[a,s.jsx(xy,{ref:de,arrowX:Oe.arrowX,arrowY:Oe.arrowY,visible:x,position:Oe.placement,arrowSize:C,arrowOffset:E,arrowRadius:T,arrowPosition:j,...Ye("arrow")})]})})}),p.cloneElement(r,Oe.getReferenceProps({onClick:D,onMouseEnter:_,onMouseLeave:P,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:jt,className:tt(y,r.props.className),...r.props}))]})});qs.classes=Nh;qs.displayName="@mantine/core/Tooltip";qs.Floating=gx;qs.Group=vx;function xL({size:e,thickness:t,sum:n,value:r,root:o,offset:i}){const a=(e*.9-t*2)/2,l=Math.PI*a*2/100,c=o||r===void 0?`${(100-n)*l}, ${n*l}`:`${r*l}, ${(100-r)*l}`;return{strokeWidth:Number.isNaN(t)?12:t,cx:e/2||0,cy:e/2||0,r:a||0,transform:o?`scale(1, -1) translate(0, -${e})`:void 0,strokeDasharray:c,strokeDashoffset:o?0:i||0}}function CP({size:e,value:t,offset:n,sum:r,thickness:o,root:i,color:a,lineRoundCaps:l,tooltip:c,getStyles:u,display:d,...f}){const h=At();return s.jsx(qs.Floating,{disabled:!c,label:c,children:s.jsx(q,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":a?ot(a,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...xL({sum:r,size:e,thickness:o,value:t,offset:n,root:i})})})}CP.displayName="@mantine/core/Curve";function bL({size:e,thickness:t,sections:n,renderRoundedLineCaps:r,rootColor:o}){const i=n.reduce((d,f)=>d+f.value,0),a=Math.PI*((e*.9-t*2)/2)*2;let l=a;const c=[],u=[];for(let d=0;d<n.length;d+=1)c.push({sum:i,offset:l,data:n[d],root:!1}),l-=n[d].value/100*a;if(c.push({sum:i,offset:l,data:{color:o},root:!0}),u.push({...c[c.length-1],lineRoundCaps:!1}),c.length>2){u.push({...c[0],lineRoundCaps:r}),u.push({...c[c.length-2],lineRoundCaps:r});for(let d=1;d<=c.length-3;d+=1)u.push({...c[d],lineRoundCaps:!1})}else u.push({...c[0],lineRoundCaps:r});return u}var EP={root:"m_b32e4812",svg:"m_d43b5134",curve:"m_b1ca1fbf",label:"m_b23f9dc4"};function wL(e,t){return Math.min(e||12,(t||120)/4)}const SL={size:120,thickness:12},jL=(e,{size:t,thickness:n})=>({root:{"--rp-size":U(t),"--rp-label-offset":U(n*2)}}),Mh=Y((e,t)=>{const n=V("RingProgress",SL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,label:u,sections:d,size:f,thickness:h,roundCaps:m,rootColor:g,...v}=n,S=he({name:"RingProgress",classes:EP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:jL}),b=wL(h,f),w=bL({size:f,thickness:b,sections:d,renderRoundedLineCaps:m,rootColor:g}).map(({data:y,sum:x,root:C,lineRoundCaps:E,offset:T},j)=>p.createElement(CP,{...y,key:j,size:f,thickness:b,sum:x,offset:T,color:y==null?void 0:y.color,root:C,lineRoundCaps:E,getStyles:S}));return s.jsxs(q,{...S("root"),size:f,ref:t,...v,children:[s.jsx("svg",{...S("svg"),children:w}),u&&s.jsx("div",{...S("label"),children:u})]})});Mh.classes=EP;Mh.displayName="@mantine/core/RingProgress";var TP={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const CL={withItemsBorders:!0},EL=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:it(t),"--sc-color":n?ot(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":i,"--sc-padding":Ne(o,"sc-padding"),"--sc-font-size":hn(o)}}),yx=Y((e,t)=>{var xe,_e;const n=V("SegmentedControl",CL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,data:u,value:d,defaultValue:f,onChange:h,size:m,name:g,disabled:v,readOnly:S,fullWidth:b,orientation:w,radius:y,color:x,transitionDuration:C,transitionTimingFunction:E,variant:T,autoContrast:j,withItemsBorders:R,mod:k,...I}=n,O=he({name:"SegmentedControl",props:n,classes:TP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:EL}),F=At(),L=u.map(de=>typeof de=="string"?{label:de,value:de}:de),B=wD(),[D,_]=p.useState(null),[P,N]=p.useState({}),$=(de,Oe)=>{P[Oe]=de,N(P)},[H,X]=bn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((xe=L.find(de=>!de.disabled))==null?void 0:xe.value)??((_e=u[0])==null?void 0:_e.value)??null:null,onChange:h}),ce=Vn(g),Ie=L.map(de=>p.createElement(q,{...O("control"),mod:{active:H===de.value,orientation:w},key:de.value},p.createElement("input",{...O("input"),disabled:v||de.disabled,type:"radio",name:ce,value:de.value,id:`${ce}-${de.value}`,checked:H===de.value,onChange:()=>!S&&X(de.value),"data-focus-ring":F.focusRing,key:`${de.value}-input`}),p.createElement(q,{component:"label",...O("label"),mod:{active:H===de.value&&!(v||de.disabled),disabled:v||de.disabled,"read-only":S},htmlFor:`${ce}-${de.value}`,ref:Oe=>$(Oe,de.value),__vars:{"--sc-label-color":x!==void 0?Ko({color:x,theme:F,autoContrast:j}):void 0},key:`${de.value}-label`},s.jsx("span",{...O("innerLabel"),children:de.label})))),ue=nn(t,de=>_(de));return u.length===0?null:s.jsxs(q,{...O("root"),variant:T,size:m,ref:ue,mod:[{"full-width":b,orientation:w,initialized:B,"with-items-borders":R},k],...I,role:"radiogroup","data-disabled":v,children:[typeof H=="string"&&s.jsx(Cy,{target:P[H],parent:D,component:"span",transitionDuration:"var(--sc-transition-duration)",...O("indicator")}),Ie]})});yx.classes=TP;yx.displayName="@mantine/core/SegmentedControl";function TL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=At(),i=t===void 0?e:t,a=Hi({"--sg-spacing-x":Yt(Br(e)),"--sg-spacing-y":Yt(Br(i)),"--sg-cols":(d=Br(n))==null?void 0:d.toString()}),l=bt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=Yt(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=Yt(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=uc(bt(l),o).filter(f=>bt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return s.jsx(Fs,{styles:a,media:u,selector:r})}function Jp(e){return typeof e=="object"&&e!==null?bt(e):[]}function PL(e){return e.sort((t,n)=>cc(t)-cc(n))}function kL({spacing:e,verticalSpacing:t,cols:n}){const r=Array.from(new Set([...Jp(e),...Jp(t),...Jp(n)]));return PL(r)}function RL({spacing:e,verticalSpacing:t,cols:n,selector:r}){var u;const o=t===void 0?e:t,i=Hi({"--sg-spacing-x":Yt(Br(e)),"--sg-spacing-y":Yt(Br(o)),"--sg-cols":(u=Br(n))==null?void 0:u.toString()}),a=kL({spacing:e,verticalSpacing:t,cols:n}),l=a.reduce((d,f)=>(d[f]||(d[f]={}),typeof e=="object"&&e[f]!==void 0&&(d[f]["--sg-spacing-x"]=Yt(e[f])),typeof o=="object"&&o[f]!==void 0&&(d[f]["--sg-spacing-y"]=Yt(o[f])),typeof n=="object"&&n[f]!==void 0&&(d[f]["--sg-cols"]=n[f]),d),{}),c=a.map(d=>({query:`simple-grid (min-width: ${d})`,styles:l[d]}));return s.jsx(Fs,{styles:i,container:c,selector:r})}var PP={container:"m_925c2d2c",root:"m_2415a157"};const _L={cols:1,spacing:"md",type:"media"},xx=Y((e,t)=>{const n=V("SimpleGrid",_L,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,type:h,...m}=n,g=he({name:"SimpleGrid",classes:PP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),v=Qc();return h==="container"?s.jsxs(s.Fragment,{children:[s.jsx(RL,{...n,selector:`.${v}`}),s.jsx("div",{...g("container"),children:s.jsx(q,{ref:t,...g("root",{className:v}),...m})})]}):s.jsxs(s.Fragment,{children:[s.jsx(TL,{...n,selector:`.${v}`}),s.jsx(q,{ref:t,...g("root",{className:v}),...m})]})});xx.classes=PP;xx.displayName="@mantine/core/SimpleGrid";const DL={},Oh=Y((e,t)=>{const{w:n,h:r,miw:o,mih:i,...a}=V("Space",DL,e);return s.jsx(q,{ref:t,...a,w:n,miw:o??n,h:r,mih:i??r})});Oh.displayName="@mantine/core/Space";var kP={root:"m_6d731127"};const IL={gap:"md",align:"stretch",justify:"flex-start"},AL=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":Yt(t),"--stack-align":n,"--stack-justify":r}}),$e=Y((e,t)=>{const n=V("Stack",IL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...m}=n,g=he({name:"Stack",props:n,classes:kP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:AL});return s.jsx(q,{ref:t,...g("root"),variant:h,...m})});$e.classes=kP;$e.displayName="@mantine/core/Stack";const[NL,ML]=Un("Stepper component was not found in tree"),vf=()=>null;vf.displayName="@mantine/core/StepperCompleted";var bx={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 cd=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,OL={withIcon:!0,allowStepClick:!0,iconPosition:"left"},wx=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,step:l,state:c,color:u,icon:d,completedIcon:f,progressIcon:h,label:m,description:g,withIcon:v,iconSize:S,loading:b,allowStepClick:w,allowStepSelect:y,iconPosition:x,orientation:C,mod:E,...T}=V("StepperStep",OL,e),j=ML(),R=At(),k={classNames:n,styles:i},I=c==="stepCompleted"?null:c==="stepProgress"?h:d,O={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return s.jsxs(Sn,{...j.getStyles("step",{className:r,style:o,variant:j.orientation,...k}),mod:[{"icon-position":x||j.iconPosition,"allow-click":w},E],ref:t,...O,...T,__vars:{"--step-color":u?ot(u,R):void 0},tabIndex:w?0:-1,children:[v&&s.jsxs("span",{...j.getStyles("stepWrapper",k),children:[s.jsxs("span",{...j.getStyles("stepIcon",k),...O,children:[s.jsx(Jo,{mounted:c==="stepCompleted",transition:"pop",duration:200,children:F=>s.jsx("span",{...j.getStyles("stepCompletedIcon",{style:F,...k}),children:b?s.jsx(er,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...j.getStyles("stepLoader",k)}):cd(f,l)||s.jsx(vh,{size:"60%"})})}),c!=="stepCompleted"?b?s.jsx(er,{...j.getStyles("stepLoader",k),size:"calc(var(--stepper-icon-size) / 2)",color:u}):cd(I||d,l):null]}),C==="vertical"&&s.jsx("span",{...j.getStyles("verticalSeparator",k),"data-active":c==="stepCompleted"||void 0})]}),(m||g)&&s.jsxs("span",{...j.getStyles("stepBody",k),"data-orientation":j.orientation,"data-icon-position":x||j.iconPosition,children:[m&&s.jsx("span",{...j.getStyles("stepLabel",k),children:cd(m,l)}),g&&s.jsx("span",{...j.getStyles("stepDescription",k),children:cd(g,l)})]})]})});wx.classes=bx;wx.displayName="@mantine/core/StepperStep";const LL={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},$L=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:a})=>({root:{"--stepper-color":t?ot(t,e):void 0,"--stepper-icon-color":$s(a,e)?Ko({color:t,theme:e,autoContrast:a}):void 0,"--stepper-icon-size":n===void 0?Ne(r,"stepper-icon-size"):U(n),"--stepper-content-padding":Yt(o),"--stepper-radius":i===void 0?void 0:it(i),"--stepper-fz":hn(r),"--stepper-spacing":Yt(r)}}),ol=Y((e,t)=>{var P,N,$;const n=V("Stepper",LL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,onStepClick:d,active:f,icon:h,completedIcon:m,progressIcon:g,color:v,iconSize:S,contentPadding:b,orientation:w,iconPosition:y,size:x,radius:C,allowNextStepsSelect:E,wrap:T,autoContrast:j,...R}=n,k=he({name:"Stepper",classes:bx,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:$L}),I=p.Children.toArray(u),O=I.filter(H=>H.type!==vf),F=I.find(H=>H.type===vf),L=O.reduce((H,X,ce)=>{const Ie=f===ce?"stepProgress":f>ce?"stepCompleted":"stepInactive",xe=typeof d!="function"?!1:typeof X.props.allowStepSelect=="boolean"?X.props.allowStepSelect:Ie==="stepCompleted"||E;return H.push(p.cloneElement(X,{icon:X.props.icon||h||ce+1,key:ce,step:ce,state:Ie,onClick:()=>xe&&(d==null?void 0:d(ce)),allowStepClick:xe,completedIcon:X.props.completedIcon||m,progressIcon:X.props.progressIcon||g,color:X.props.color||v,iconSize:S,radius:C,iconPosition:X.props.iconPosition||y,orientation:w,unstyled:l})),w==="horizontal"&&ce!==O.length-1&&H.push(p.createElement("div",{...k("separator"),"data-active":ce<f||void 0,"data-orientation":w,key:`separator-${ce}`})),H},[]),B=(N=(P=O[f])==null?void 0:P.props)==null?void 0:N.children,D=($=F==null?void 0:F.props)==null?void 0:$.children,_=f>O.length-1?D:B;return s.jsx(NL,{value:{getStyles:k,orientation:w,iconPosition:y},children:s.jsxs(q,{...k("root"),ref:t,size:x,...R,children:[s.jsx(q,{...k("steps"),mod:{orientation:w,"icon-position":y,wrap:T&&w!=="vertical"},children:L}),_&&s.jsx("div",{...k("content"),children:_})]})})});ol.classes=bx;ol.displayName="@mantine/core/Stepper";ol.Completed=vf;ol.Step=wx;const RP=p.createContext(null),FL=RP.Provider,zL=()=>p.useContext(RP),BL={},Sx=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=V("SwitchGroup",BL,e),[d,f]=bn({value:n,defaultValue:r,finalValue:[],onChange:o}),h=m=>{const g=m.currentTarget.value;!c&&f(d.includes(g)?d.filter(v=>v!==g):[...d,g])};return s.jsx(FL,{value:{value:d,onChange:h,size:i},children:s.jsx(Mt.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(By,{role:"group",children:l})})})});Sx.classes=Mt.Wrapper.classes;Sx.displayName="@mantine/core/SwitchGroup";var _P={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const UL={labelPosition:"right"},VL=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:it(t),"--switch-height":Ne(r,"switch-height"),"--switch-width":Ne(r,"switch-width"),"--switch-thumb-size":Ne(r,"switch-thumb-size"),"--switch-label-font-size":Ne(r,"switch-label-font-size"),"--switch-track-label-padding":Ne(r,"switch-track-label-padding"),"--switch-color":n?ot(n,e):void 0}}),uu=Y((e,t)=>{const n=V("Switch",UL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,label:d,offLabel:f,onLabel:h,id:m,size:g,radius:v,wrapperProps:S,thumbIcon:b,checked:w,defaultChecked:y,onChange:x,labelPosition:C,description:E,error:T,disabled:j,variant:R,rootRef:k,mod:I,...O}=n,F=zL(),L=g||(F==null?void 0:F.size),B=he({name:"Switch",props:n,classes:_P,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:VL}),{styleProps:D,rest:_}=Yo(O),P=Vn(m),N=F?{checked:F.value.includes(_.value),onChange:F.onChange}:{},[$,H]=bn({value:N.checked??w,defaultValue:y,finalValue:!1});return s.jsxs(gh,{...B("root"),__staticSelector:"Switch",__stylesApiProps:n,id:P,size:L,labelPosition:C,label:d,description:E,error:T,disabled:j,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:l,"data-checked":N.checked||void 0,variant:R,ref:k,mod:I,...D,...S,children:[s.jsx("input",{..._,disabled:j,checked:$,onChange:X=>{var ce;F?(ce=N.onChange)==null||ce.call(N,X):x==null||x(X),H(X.currentTarget.checked)},id:P,ref:t,type:"checkbox",role:"switch",...B("input")}),s.jsxs(q,{"aria-hidden":"true",mod:{error:T,"label-position":C,"without-labels":!h&&!f},...B("track"),children:[s.jsx(q,{component:"span",mod:"reduce-motion",...B("thumb"),children:b}),s.jsx("span",{...B("trackLabel"),children:$?h:f})]})]})});uu.classes={..._P,...NT};uu.displayName="@mantine/core/Switch";uu.Group=Sx;const[WL,HL]=Un("Table component was not found in the tree");var du={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 qL(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 Gs(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=Y((o,i)=>{const a=V(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=a,h=HL();return s.jsx(q,{component:e,ref:i,...qL(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:a}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=du,r}const jg=Gs("th",{columnBorder:!0}),DP=Gs("td",{columnBorder:!0}),Nd=Gs("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),IP=Gs("thead",{stickyHeader:!0}),AP=Gs("tbody"),NP=Gs("tfoot"),MP=Gs("caption",{captionSide:!0});function jx({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(MP,{children:e.caption}),e.head&&s.jsx(IP,{children:s.jsx(Nd,{children:e.head.map((t,n)=>s.jsx(jg,{children:t},n))})}),e.body&&s.jsx(AP,{children:e.body.map((t,n)=>s.jsx(Nd,{children:t.map((r,o)=>s.jsx(DP,{children:r},o))},n))}),e.foot&&s.jsx(NP,{children:s.jsx(Nd,{children:e.foot.map((t,n)=>s.jsx(jg,{children:t},n))})})]})}jx.displayName="@mantine/core/TableDataRenderer";const GL={type:"scrollarea"},QL=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":U(t),"--table-overflow":n==="native"?"auto":void 0}}),Cx=Y((e,t)=>{const n=V("TableScrollContainer",GL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,m=he({name:"TableScrollContainer",classes:du,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:QL,rootSelector:"scrollContainer"});return s.jsx(q,{component:f==="scrollarea"?_r:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...m("scrollContainer"),...h,children:s.jsx("div",{...m("scrollContainerInner"),children:u})})});Cx.classes=du;Cx.displayName="@mantine/core/TableScrollContainer";const KL={withRowBorders:!0,verticalSpacing:7},YL=(e,{layout:t,captionSide:n,horizontalSpacing:r,verticalSpacing:o,borderColor:i,stripedColor:a,highlightOnHoverColor:l,striped:c,highlightOnHover:u,stickyHeaderOffset:d,stickyHeader:f})=>({table:{"--table-layout":t,"--table-caption-side":n,"--table-horizontal-spacing":Yt(r),"--table-vertical-spacing":Yt(o),"--table-border-color":i?ot(i,e):void 0,"--table-striped-color":c&&a?ot(a,e):void 0,"--table-highlight-on-hover-color":u&&l?ot(l,e):void 0,"--table-sticky-header-offset":f?U(d):void 0}}),pe=Y((e,t)=>{const n=V("Table",KL,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,horizontalSpacing:u,verticalSpacing:d,captionSide:f,stripedColor:h,highlightOnHoverColor:m,striped:g,highlightOnHover:v,withColumnBorders:S,withRowBorders:b,withTableBorder:w,borderColor:y,layout:x,variant:C,data:E,children:T,stickyHeader:j,stickyHeaderOffset:R,mod:k,...I}=n,O=he({name:"Table",props:n,className:o,style:i,classes:du,classNames:r,styles:a,unstyled:l,rootSelector:"table",vars:c,varsResolver:YL});return s.jsx(WL,{value:{getStyles:O,stickyHeader:j,striped:g===!0?"odd":g||void 0,highlightOnHover:v,withColumnBorders:S,withRowBorders:b,captionSide:f||"bottom"},children:s.jsx(q,{component:"table",variant:C,ref:t,mod:[{"data-with-table-border":w},k],...O("table"),...I,children:T||!!E&&s.jsx(jx,{data:E})})})});pe.classes=du;pe.displayName="@mantine/core/Table";pe.Td=DP;pe.Th=jg;pe.Tr=Nd;pe.Thead=IP;pe.Tbody=AP;pe.Tfoot=NP;pe.Caption=MP;pe.ScrollContainer=Cx;pe.DataRenderer=jx;const[XL,Ex]=Un("Tabs component was not found in the tree");var fu={root:"m_89d60db1","list--default":"m_576c9d4",list:"m_89d33d6d",panel:"m_b0c91715",tab:"m_4ec4dce6",tabSection:"m_fc420b1f","tab--default":"m_539e827b","list--outline":"m_6772fbd5","tab--outline":"m_b59ab47c","tab--pills":"m_c3381914"};const JL={},Tx=Y((e,t)=>{const n=V("TabsList",JL,e),{children:r,className:o,grow:i,justify:a,classNames:l,styles:c,style:u,mod:d,...f}=n,h=Ex();return s.jsx(q,{...f,...h.getStyles("list",{className:o,style:u,classNames:l,styles:c,props:n,variant:h.variant}),ref:t,role:"tablist",variant:h.variant,mod:[{grow:i,orientation:h.orientation,placement:h.orientation==="vertical"&&h.placement,inverted:h.inverted},d],"aria-orientation":h.orientation,__vars:{"--tabs-justify":a},children:r})});Tx.classes=fu;Tx.displayName="@mantine/core/TabsList";const ZL={},Px=Y((e,t)=>{const n=V("TabsPanel",ZL,e),{children:r,className:o,value:i,classNames:a,styles:l,style:c,mod:u,keepMounted:d,...f}=n,h=Ex(),m=h.value===i,g=h.keepMounted||d||m?r:null;return s.jsx(q,{...f,...h.getStyles("panel",{className:o,classNames:a,styles:l,style:[c,m?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:h.orientation},u],role:"tabpanel",id:h.getPanelId(i),"aria-labelledby":h.getTabId(i),children:g})});Px.classes=fu;Px.displayName="@mantine/core/TabsPanel";const e$={},kx=Y((e,t)=>{const n=V("TabsTab",e$,e),{className:r,children:o,rightSection:i,leftSection:a,value:l,onClick:c,onKeyDown:u,disabled:d,color:f,style:h,classNames:m,styles:g,vars:v,mod:S,...b}=n,w=At(),{dir:y}=zs(),x=Ex(),C=l===x.value,E=j=>{x.onChange(x.allowTabDeactivation&&l===x.value?null:l),c==null||c(j)},T={classNames:m,styles:g,props:n};return s.jsxs(Sn,{...b,...x.getStyles("tab",{className:r,style:h,variant:x.variant,...T}),disabled:d,unstyled:x.unstyled,variant:x.variant,mod:[{active:C,disabled:d,orientation:x.orientation,inverted:x.inverted,placement:x.orientation==="vertical"&&x.placement},S],ref:t,role:"tab",id:x.getTabId(l),"aria-selected":C,tabIndex:C||x.value===null?0:-1,"aria-controls":x.getPanelId(l),onClick:E,__vars:{"--tabs-color":f?ot(f,w):void 0},onKeyDown:ij({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:x.activateTabWithKeyboard,loop:x.loop,orientation:x.orientation||"horizontal",dir:y,onKeyDown:u}),children:[a&&s.jsx("span",{...x.getStyles("tabSection",T),"data-position":"left",children:a}),o&&s.jsx("span",{...x.getStyles("tabLabel",T),children:o}),i&&s.jsx("span",{...x.getStyles("tabSection",T),"data-position":"right",children:i})]})});kx.classes=fu;kx.displayName="@mantine/core/TabsTab";const Xb="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",t$={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},n$=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":it(t),"--tabs-color":ot(n,e),"--tabs-text-color":$s(r,e)?Ko({color:n,theme:e,autoContrast:r}):void 0}}),Je=Y((e,t)=>{const n=V("Tabs",t$,e),{defaultValue:r,value:o,onChange:i,orientation:a,children:l,loop:c,id:u,activateTabWithKeyboard:d,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,placement:S,keepMounted:b,classNames:w,styles:y,unstyled:x,className:C,style:E,vars:T,autoContrast:j,mod:R,...k}=n,I=Vn(u),[O,F]=bn({value:o,defaultValue:r,finalValue:null,onChange:i}),L=he({name:"Tabs",props:n,classes:fu,className:C,style:E,classNames:w,styles:y,unstyled:x,vars:T,varsResolver:n$});return s.jsx(XL,{value:{placement:S,value:O,orientation:a,id:I,loop:c,activateTabWithKeyboard:d,getTabId:q0(`${I}-tab`,Xb),getPanelId:q0(`${I}-panel`,Xb),onChange:F,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,keepMounted:b,unstyled:x,getStyles:L},children:s.jsx(q,{ref:t,id:I,variant:h,mod:[{orientation:a,inverted:a==="horizontal"&&v,placement:a==="vertical"&&S},R],...L("root"),...k,children:l})})});Je.classes=fu;Je.displayName="@mantine/core/Tabs";Je.Tab=kx;Je.Panel=Px;Je.List=Tx;const r$={},ye=Y((e,t)=>{const n=V("TextInput",r$,e);return s.jsx(nr,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});ye.classes=nr.classes;ye.displayName="@mantine/core/TextInput";var OP={root:"m_7341320d"};const o$={},i$=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||e.primaryColor,theme:e,gradient:o,variant:r||"filled",autoContrast:a});return{root:{"--ti-size":Ne(t,"ti-size"),"--ti-radius":n===void 0?void 0:it(n),"--ti-bg":i||r?l.background:void 0,"--ti-color":i||r?l.color:void 0,"--ti-bd":i||r?l.border:void 0}}},Rx=Y((e,t)=>{const n=V("ThemeIcon",o$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,autoContrast:u,...d}=n,f=he({name:"ThemeIcon",classes:OP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:i$});return s.jsx(q,{ref:t,...f("root"),...d})});Rx.classes=OP;Rx.displayName="@mantine/core/ThemeIcon";const s$=["h1","h2","h3","h4","h5","h6"];function a$(e,t){const n=t!==void 0?t:`h${e}`;return s$.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:U(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var LP={root:"m_8a5d1357"};const l$={order:1},c$=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=a$(t,n);return{root:{"--title-fw":i.fontWeight,"--title-lh":i.lineHeight,"--title-fz":i.fontSize,"--title-line-clamp":typeof r=="number"?r.toString():void 0,"--title-text-wrap":o}}},ve=Y((e,t)=>{const n=V("Title",l$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,order:c,vars:u,size:d,variant:f,lineClamp:h,textWrap:m,mod:g,...v}=n,S=he({name:"Title",props:n,classes:LP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:c$});return[1,2,3,4,5,6].includes(c)?s.jsx(q,{...S("root"),component:`h${c}`,variant:f,ref:t,mod:[{order:c,"data-line-clamp":typeof h=="number"},g],size:d,...v}):null});ve.classes=LP;ve.displayName="@mantine/core/Title";function u$(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(i=>i(t))},initialize(o){n||(t=o,n=!0)},subscribe(o){return r.add(o),()=>r.delete(o)}}}function d$(e){return p.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}function f$(e,t,n){const r=[],o=[],i={};for(const a of e){const l=a.position||t;i[l]=i[l]||0,i[l]+=1,i[l]<=n?o.push(a):r.push(a)}return{notifications:o,queue:r}}const h$=()=>u$({notifications:[],queue:[],defaultPosition:"bottom-right",limit:5}),Qs=h$(),p$=(e=Qs)=>d$(e);function bl(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]),o=f$(r,n.defaultPosition,n.limit);e.setState({notifications:o.notifications,queue:o.queue,limit:n.limit,defaultPosition:n.defaultPosition})}function ge(e,t=Qs){const n=e.id||iv();return bl(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function $P(e,t=Qs){return bl(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function Yl(e,t=Qs){return bl(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function m$(e=Qs){bl(e,()=>[])}function g$(e=Qs){bl(e,t=>t.slice(0,e.getState().limit))}const po={show:ge,hide:$P,update:Yl,clean:m$,cleanQueue:g$,updateState:bl};function Cg(e,t){return Cg=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Cg(e,t)}function FP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Cg(e,t)}var zP={exports:{}},v$="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",y$=v$,x$=y$;function BP(){}function UP(){}UP.resetWarningCache=BP;var b$=function(){function e(r,o,i,a,l,c){if(c!==x$){var u=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 u.name="Invariant Violation",u}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:UP,resetWarningCache:BP};return n.PropTypes=n,n};zP.exports=b$();var w$=zP.exports;const vt=Xg(w$),Jb={disabled:!1},yf=fn.createContext(null);var S$=function(t){return t.scrollTop},Xl="unmounted",as="exited",ls="entering",ya="entered",Eg="exiting",ti=function(e){FP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=o,l=a&&!a.isMounting?r.enter:r.appear,c;return i.appearStatus=null,r.in?l?(c=as,i.appearStatus=ls):c=ya:r.unmountOnExit||r.mountOnEnter?c=Xl:c=as,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Xl?{status:as}:null};var n=t.prototype;return n.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},n.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==ls&&a!==ya&&(i=ls):(a===ls||a===ya)&&(i=Eg)}this.updateStatus(!1,i)},n.componentWillUnmount=function(){this.cancelNextCallback()},n.getTimeouts=function(){var o=this.props.timeout,i,a,l;return i=a=l=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,l=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:l}},n.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===ls){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Da.findDOMNode(this);a&&S$(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===as&&this.setState({status:Xl})},n.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[Da.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!a||Jb.disabled){this.safeSetState({status:ya},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:ls},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:ya},function(){i.props.onEntered(u,d)})})})},n.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),l=this.props.nodeRef?void 0:Da.findDOMNode(this);if(!i||Jb.disabled){this.safeSetState({status:as},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Eg},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:as},function(){o.props.onExited(l)})})})},n.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},n.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},n.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(l){a&&(a=!1,i.nextCallback=null,o(l))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},n.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Da.findDOMNode(this),l=o==null&&!this.props.addEndListener;if(!a||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var c=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=c[0],d=c[1];this.props.addEndListener(u,d)}o!=null&&setTimeout(this.nextCallback,o)},n.render=function(){var o=this.state.status;if(o===Xl)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var l=Xy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return fn.createElement(yf.Provider,{value:null},typeof a=="function"?a(o,l):fn.cloneElement(fn.Children.only(a),l))},t}(fn.Component);ti.contextType=yf;ti.propTypes={};function fa(){}ti.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:fa,onEntering:fa,onEntered:fa,onExit:fa,onExiting:fa,onExited:fa};ti.UNMOUNTED=Xl;ti.EXITED=as;ti.ENTERING=ls;ti.ENTERED=ya;ti.EXITING=Eg;function j$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _x(e,t){var n=function(i){return t&&p.isValidElement(i)?t(i):i},r=Object.create(null);return e&&p.Children.map(e,function(o){return o}).forEach(function(o){r[o.key]=n(o)}),r}function C$(e,t){e=e||{},t=t||{};function n(d){return d in t?t[d]:e[d]}var r=Object.create(null),o=[];for(var i in e)i in t?o.length&&(r[i]=o,o=[]):o.push(i);var a,l={};for(var c in t){if(r[c])for(a=0;a<r[c].length;a++){var u=r[c][a];l[r[c][a]]=n(u)}l[c]=n(c)}for(a=0;a<o.length;a++)l[o[a]]=n(o[a]);return l}function vs(e,t,n){return n[t]!=null?n[t]:e.props[t]}function E$(e,t){return _x(e.children,function(n){return p.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:vs(n,"appear",e),enter:vs(n,"enter",e),exit:vs(n,"exit",e)})})}function T$(e,t,n){var r=_x(e.children),o=C$(t,r);return Object.keys(o).forEach(function(i){var a=o[i];if(p.isValidElement(a)){var l=i in t,c=i in r,u=t[i],d=p.isValidElement(u)&&!u.props.in;c&&(!l||d)?o[i]=p.cloneElement(a,{onExited:n.bind(null,a),in:!0,exit:vs(a,"exit",e),enter:vs(a,"enter",e)}):!c&&l&&!d?o[i]=p.cloneElement(a,{in:!1}):c&&l&&p.isValidElement(u)&&(o[i]=p.cloneElement(a,{onExited:n.bind(null,a),in:u.props.in,exit:vs(a,"exit",e),enter:vs(a,"enter",e)}))}}),o}var P$=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},k$={component:"div",childFactory:function(t){return t}},vi=function(e){FP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=i.handleExited.bind(j$(i));return i.state={contextValue:{isMounting:!0},handleExited:a,firstRender:!0},i}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,i){var a=i.children,l=i.handleExited,c=i.firstRender;return{children:c?E$(o,l):T$(o,a,l),firstRender:!1}},n.handleExited=function(o,i){var a=_x(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=gf({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=Xy(o,["component","childFactory"]),c=this.state.contextValue,u=P$(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?fn.createElement(yf.Provider,{value:c},u):fn.createElement(yf.Provider,{value:c},fn.createElement(i,l,u))},t}(fn.Component);vi.propTypes={};vi.defaultProps=k$;const VP=["bottom-center","bottom-left","bottom-right","top-center","top-left","top-right"];function R$(e,t){return e.reduce((n,r)=>(n[r.position||t].push(r),n),VP.reduce((n,r)=>(n[r]=[],n),{}))}const Zb={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},_$={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function D$({state:e,maxHeight:t,position:n,transitionDuration:r}){const[o,i]=n.split("-"),a=i==="center"?`${o}-center`:i,l={opacity:0,maxHeight:t,transform:Zb[a],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"},c={opacity:1,transform:_$[a]},u={opacity:0,maxHeight:0,transform:Zb[a]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function I$(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const WP=p.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:a,...l}=e,c=I$(n,e.autoClose),u=p.useRef(),d=()=>window.clearTimeout(u.current),f=()=>{t(e.id),d()},h=()=>{typeof c=="number"&&(u.current=window.setTimeout(f,c))};return p.useEffect(()=>{var m;(m=e.onOpen)==null||m.call(e,e)},[]),p.useEffect(()=>(h(),d),[c]),s.jsx(cx,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h,children:a})});WP.displayName="@mantine/notifications/NotificationContainer";var HP={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const A$=ti,N$={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Jr("overlay"),store:Qs,withinPortal:!0},M$=(e,{zIndex:t,containerWidth:n})=>({root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-container-width":U(n)}}),ni=Y((e,t)=>{const n=V("Notifications",N$,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,position:u,autoClose:d,transitionDuration:f,containerWidth:h,notificationMaxHeight:m,limit:g,zIndex:v,store:S,portalProps:b,withinPortal:w,...y}=n,x=At(),C=p$(S),E=pD(),T=sv(),j=p.useRef({}),R=p.useRef(0),I=(x.respectReducedMotion?T:!1)?1:f,O=he({name:"Notifications",classes:HP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:M$});p.useEffect(()=>{S==null||S.updateState(B=>({...B,limit:g||5,defaultPosition:u}))},[g,u]),Lo(()=>{C.notifications.length>R.current&&setTimeout(()=>E(),0),R.current=C.notifications.length},[C.notifications]);const F=R$(C.notifications,u),L=VP.reduce((B,D)=>(B[D]=F[D].map(({style:_,...P})=>s.jsx(A$,{timeout:I,onEnter:()=>j.current[P.id].offsetHeight,nodeRef:{current:j.current[P.id]},children:N=>s.jsx(WP,{ref:$=>{j.current[P.id]=$},data:P,onHide:$=>$P($,S),autoClose:d,...O("notification",{style:{...D$({state:N,position:D,transitionDuration:I,maxHeight:m}),..._}})})},P.id)),B),{});return s.jsxs(Vs,{withinPortal:w,...b,children:[s.jsx(q,{...O("root"),"data-position":"top-center",ref:t,...y,children:s.jsx(vi,{children:L["top-center"]})}),s.jsx(q,{...O("root"),"data-position":"top-left",...y,children:s.jsx(vi,{children:L["top-left"]})}),s.jsx(q,{...O("root"),"data-position":"top-right",...y,children:s.jsx(vi,{children:L["top-right"]})}),s.jsx(q,{...O("root"),"data-position":"bottom-right",...y,children:s.jsx(vi,{children:L["bottom-right"]})}),s.jsx(q,{...O("root"),"data-position":"bottom-left",...y,children:s.jsx(vi,{children:L["bottom-left"]})}),s.jsx(q,{...O("root"),"data-position":"bottom-center",...y,children:s.jsx(vi,{children:L["bottom-center"]})})]})});ni.classes=HP;ni.displayName="@mantine/notifications/Notifications";ni.show=po.show;ni.hide=po.hide;ni.update=po.update;ni.clean=po.clean;ni.cleanQueue=po.cleanQueue;ni.updateState=po.updateState;class O${constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class hu{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class L${constructor(){this.prefixParselets={},this.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,i){const a=o.consumeAndParse(n);return r(i,a)}})}infixLeft(t,n,r){return this.registerInfix(t,{parse(o,i,a){const l=o.consumeAndParse(n);return r(i,a,l)},precedence:n})}construct(t){return new $$(t,this.prefixParselets,this.infixParselets)}}class $${constructor(t,n,r){this.tokens=t,this.prefixParselets=n,this.infixParselets=r}hasMore(){return this.tokens.length>0}match(t){const n=this.peek();return(n==null?void 0:n.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 i=this.consume();o=this.getInfixParselet(i).parse(this,o,i)}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){var r,o;if(!this.tokens.length)throw Error("Cant consume unknown more tokens.");if(t&&((r=this.peek())==null?void 0:r.id)!==t){const i=this.peek();throw Error(`Expected ${t} but got "${i.id}" (${i.value}) at line ${i.line} column ${i.column}.`)}if(n&&((o=this.peek())==null?void 0:o.value)!==n){const i=this.peek();throw Error(`Expected "${n}" but got "${i.value}" at line ${i.line} column ${i.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]}}const F$="http://hl7.org",qP="ok",z$="created",B$="gone",U$="not-modified",V$="not-found",W$="unauthorized",H$="forbidden",q$="accepted",G$={resourceType:"OperationOutcome",id:qP,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},Q$={resourceType:"OperationOutcome",id:V$,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},Nc={resourceType:"OperationOutcome",id:W$,issue:[{severity:"error",code:"login",details:{text:"Unauthorized"}}]},K$={...Nc,issue:[...Nc.issue,{severity:"error",code:"expired",details:{text:"Token expired"}}]},ew={...Nc,issue:[...Nc.issue,{severity:"error",code:"invalid",details:{text:"Token not issued for this audience"}}]},GP={resourceType:"OperationOutcome",id:H$,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function Oi(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function _t(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function Y$(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function Lh(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function QP(e){return e.id===qP||e.id===z$||e.id===U$||e.id===q$}function X$(e){return e.id===B$}class Be extends Error{constructor(t,n){super(KP(t)),this.outcome=t,this.cause=n}}function ft(e){return e instanceof Be?e.outcome:Lh(e)?e:Oi(Ae(e))}function Ae(e){return e?typeof e=="string"?e:e instanceof Error?e.message:Lh(e)?KP(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function KP(e){var n;const t=((n=e.issue)==null?void 0:n.map(YP))??[];return t.length>0?t.join("; "):"Unknown error"}function YP(e){var n,r;let t;return(n=e.details)!=null&&n.text?e.diagnostics?t=`${e.details.text} (${e.diagnostics})`:t=e.details.text:e.diagnostics?t=e.diagnostics:t="Unknown error",(r=e.expression)!=null&&r.length&&(t+=` (${e.expression.join(", ")})`),t}function J$(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 Z$(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,i])=>[o,J$(o,i)])),constraints:[],innerTypes:[]};return t}const e7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},t7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},n7={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"}]}}},r7={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"}]}}},o7={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"}]}}},i7={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"}]}}},s7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},a7={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"}]}}},l7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},c7={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"}]}}},u7={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"}]}}},d7={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"}]}}},f7={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"}]}}},h7={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"}]}}},p7={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"]}]}}},m7={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"}]}}},g7={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"}]}}},v7={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"}]}}},y7={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"}]}}},x7={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"}]}}},b7={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"]}]}}},w7={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"}]}}},S7={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"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},j7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},C7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},E7={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"]}]}}},T7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},P7={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"}]}}},k7={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"}]}}},R7={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"}]}}},_7={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"}]}}},D7={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"]}]}}},I7={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},A7={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"}]}}},N7={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"]}]}}},M7={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"}]}}},O7={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"}]}}},L7={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"}]}}},$7={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"}]}}},F7={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"}]}}},z7={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"]}]}}},B7={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"}]}}},U7={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"}]}}},V7={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"}]}}},W7={Element:e7,BackboneElement:t7,Address:n7,Age:r7,Annotation:o7,Attachment:i7,CodeableConcept:s7,Coding:a7,ContactDetail:l7,ContactPoint:c7,Contributor:u7,Count:d7,DataRequirement:f7,Distance:h7,Dosage:p7,Duration:m7,ElementDefinition:g7,Expression:v7,Extension:y7,HumanName:x7,Identifier:b7,MarketingStatus:w7,Meta:S7,Money:j7,Narrative:C7,ParameterDefinition:E7,Period:T7,Population:P7,ProdCharacteristic:k7,ProductShelfLife:R7,Quantity:_7,Range:D7,Ratio:I7,Reference:A7,RelatedArtifact:N7,SampledData:M7,Signature:O7,SubstanceAmount:L7,Timing:$7,TriggerDefinition:F7,UsageContext:z7,MoneyQuantity:B7,SimpleQuantity:U7,IdentityProvider:V7};function H7(e){return new G7(e).parse()}const xf=Z$(W7),Dx=Object.create(null),tw=Object.create(null),q7={"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 XP(e){let t;return t=tw[e],t||(t=tw[e]=Object.create(null)),t}function nw(e){var n;const t=Array.isArray(e)?e:((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];for(const r of t)JP(r)}function JP(e){var i,a;if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const t=H7(e),n=q7[e.url];let r,o;n?(r=xf,o=n):e.url===`http://hl7.org/fhir/StructureDefinition/${e.type}`||e.url===`https://medplum.com/fhir/StructureDefinition/${e.type}`||(i=e.type)!=null&&i.startsWith("http://")||(a=e.type)!=null&&a.startsWith("https://")?(r=xf,o=e.type):(r=XP(e.url),o=e.type),r[o]=t;for(const l of t.innerTypes)l.parentType=t,r[l.name]=l;Dx[e.url]=t}function ZP(e){return!!xf[e]}function $h(e,t){if(t){const n=XP(t)[e];if(n)return n}return xf[e]}function ek(e,t){const n=$h(e,t);if(!n)throw new Be(Oi("Unknown data type: "+e));return n}function Ix(e){return!!Dx[e]}function wl(e){return Dx[e]}class G7{constructor(t){var n;if(!((n=t.snapshot)!=null&&n.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,kind:t.kind,description:Y7(t),elements:{},constraints:this.parseElementDefinition(this.root).constraints,innerTypes:[],summaryProperties:new Set,mandatoryProperties:new Set},this.innerTypes=[]}parse(){var n,r,o,i,a;let t=this.next();for(;t;){if(t.sliceName)this.parseSliceStart(t);else if((n=t.id)!=null&&n.includes(":")){if((r=this.slicingContext)!=null&&r.current){const l=Zp(t,this.slicingContext.path);this.slicingContext.current.elements[l]=this.parseElementDefinition(t)}}else{const l=this.parseElementDefinition(t);this.checkFieldEnter(t,l);let c=this.backboneContext;for(;c;){if((o=t.path)!=null&&o.startsWith(c.path+".")){c.type.elements[Zp(t,c.path)]=l;break}c=c.parent}if(!c){const u=Zp(t,this.root.path);t.isSummary&&((i=this.resourceSchema.summaryProperties)==null||i.add(u.replace("[x]",""))),l.min>0&&((a=this.resourceSchema.mandatoryProperties)==null||a.add(u.replace("[x]",""))),this.resourceSchema.elements[u]=l}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&&!ha(this.slicingContext.path,t==null?void 0:t.path)&&(this.slicingContext=void 0),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var r,o,i;for(;this.backboneContext&&!ha((r=this.backboneContext)==null?void 0:r.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;const n=dw(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:ha((o=this.backboneContext)==null?void 0:o.path,t.path)?this.backboneContext:(i=this.backboneContext)==null?void 0:i.parent}}enterSlice(t,n){var r,o,i,a;K7(t)&&!((r=this.peek())!=null&&r.sliceName)||(n.slicing={discriminator:(((o=t.slicing)==null?void 0:o.discriminator)??[]).map(l=>{if(l.type!=="value"&&l.type!=="pattern"&&l.type!=="type")throw new Error(`Unsupported slicing discriminator type: ${l.type}`);return{path:l.path,type:l.type}}),slices:[],ordered:((i=t.slicing)==null?void 0:i.ordered)??!1,rule:(a=t.slicing)==null?void 0:a.rules},this.slicingContext={field:n.slicing,path:t.path??""})}checkFieldExit(t=void 0){if(this.backboneContext&&!ha(this.backboneContext.path,t==null?void 0:t.path))if(this.backboneContext.parent)do this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;while(this.backboneContext&&!ha(this.backboneContext.path,t==null?void 0: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(){var n,r,o,i,a;const t=this.elements[this.index];if(t){if(this.elementIndex[t.path??""]=t,t.contentReference){const l=t.contentReference.slice(t.contentReference.indexOf("#")+1),c=this.elementIndex[l];return c?{...c,id:t.id,path:t.path,min:t.min??c.min,max:t.max??c.max,base:{path:((n=c.base)==null?void 0:n.path)??l,min:((r=t.base)==null?void 0:r.min)??((o=c.base)==null?void 0:o.min)??c.min,max:((i=t.base)==null?void 0:i.max)??((a=c.base)==null?void 0:a.max)??c.max},contentReference:t.contentReference,definition:t.definition}:void 0}return t}}isInnerType(t){var r;const n=this.peek();return!!(ha(t==null?void 0:t.path,n==null?void 0:n.path)&&((r=t.type)!=null&&r.some(o=>["BackboneElement","Element"].includes(o.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=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=dw(t)),r||(r=(o=Sl(n,"http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type"))==null?void 0:o.valueUrl),r||(r=n.code??""),{code:r,targetProfile:n.targetProfile,profile:n.profile}})}parseElementDefinition(t){var i,a;const n=rw(t.max),r=(i=t.base)!=null&&i.max?rw(t.base.max):n,o={type:"ElementDefinition",value:t};return{description:t.definition||"",path:t.path||((a=t.base)==null?void 0:a.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:ow(xn(o,"fixed[x]")),pattern:ow(xn(o,"pattern[x]")),binding:t.binding}}}function rw(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function Zp(e,t=""){return Q7(e.path,t)}function Q7(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function ha(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function ow(e){return Array.isArray(e)&&e.length>0?e[0]:qt(e)?void 0:e}function K7(e){var n,r;const t=(n=e.slicing)==null?void 0:n.discriminator;return!!((r=e.type)!=null&&r.some(o=>o.code==="Extension")&&(t==null?void 0:t.length)===1&&t[0].type==="value"&&t[0].path==="url")}function Y7(e){let t=e.description;return t!=null&&t.startsWith(`Base StructureDefinition for ${e.name} Type: `)&&(t=t.substring(`Base StructureDefinition for ${e.name} Type: `.length)),t}function X7(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?J7:xn,[o,...i]=t.split(".");let a=[r(e,o,n)];for(const l of i){const c=[];for(const u of a)if(Array.isArray(u))for(const d of u)c.push(r(d,l,n));else(n!=null&&n.withPath&&u&&u.value!==void 0||!(n!=null&&n.withPath)&&u!==void 0)&&c.push(r(u,l,n));a=c}return a}function J7(e,t,n){const r=e.path;return Z7(xn(e,t,n),r,t)}function Z7(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,i)=>({...o,path:`${r}${n}[${i}]`})):{...e,path:`${r}${n}`}}const tk={base64Binary:/^([A-Za-z\d+/]{4})*([A-Za-z\d+/]{2}==|[A-Za-z\d+/]{3}=)?$/,canonical:/^\S*$/,code:/^[^\s]+( [^\s]+)*$/,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)?)?)?$/,id:/^[A-Za-z0-9\-.]{1,64}$/,instant:/^(\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))$/,markdown:/^[\s\S]+$/,oid:/^urn:oid:[0-2](\.(0|[1-9]\d*))+$/,string:/^[\s\S]+$/,time:/^([01]\d|2[0-3]):[0-5]\d:([0-5]\d|60)(\.\d{1,9})?$/,uri:/^\S*$/,url:/^\S*$/,uuid:/^urn:uuid:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/,xhtml:/.*/};function e6(e,t,n,r){var a;if(Array.isArray(e))return!1;let o;t.path==="$this"?o=n:o=(r??n.elements)[t.path];const i=n.type;switch(t.type){case"value":case"pattern":if(!e||!o)return!1;if(o.pattern)return Mx(e,o.pattern);if(o.fixed)return Ui(e,o.fixed);if(((a=o.binding)==null?void 0:a.strength)==="required"&&o.binding.valueSet)return!0;break;case"type":return!e||!(i!=null&&i.length)?!1:i.some(l=>l.code===e.type)}return!1}function je(e){return[{type:W.boolean,value:e}]}function vo(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:W.integer,value:e}:typeof e=="number"?{type:W.decimal,value:e}:typeof e=="boolean"?{type:W.boolean,value:e}:typeof e=="string"?{type:W.string,value:e}:Cr(e)?{type:W.Quantity,value:e}:ri(e)?{type:e.resourceType,value:e}:{type:W.BackboneElement,value:e}}function Ao(e){return e.length===0?!1:!!e[0].value}function Ho(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 xn(e,t,n){if(!e.value)return;const r=Ys(e.type,t,n==null?void 0:n.profileUrl);return r?nk(e,t,r):t6(e,t)}function nk(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let i,a="undefined",l;const c=n.path.lastIndexOf("."),u=n.path.substring(c+1);for(const d of o){const f=u.replace("[x]",tn(d.code));if(i=r[f],l=r["_"+f],i!==void 0||l!==void 0){a=d.code;break}}if(l)if(Array.isArray(i)){i=i.slice();for(let d=0;d<Math.max(i.length,l.length);d++)i[d]=lw(i[d],l[d])}else i=lw(i,l);if(!qt(i))return(a==="Element"||a==="BackboneElement")&&(a=n.type[0].code),Array.isArray(i)?i.map(d=>iw(d,a)):iw(i,a)}function iw(e,t){return t==="Resource"&&ri(e)&&(t=e.resourceType),{type:t,value:e}}function t6(e,t){const n=e.value;if(!n||typeof n!="object")return;let r;if(t in n)r=n[t];else for(const o in W){const i=t+tn(o);if(i in n){r=n[i];break}}if(!qt(r))return Array.isArray(r)?r.map(vo):vo(r)}function rk(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(Ao(Ax(n,o))){r=!0;break}r||t.push(n)}return t}function n6(e){return je(!Ao(e))}function r6(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?je(!1):je(e.every((n,r)=>Ao(Ax(n,t[r]))))}function o6(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?je(!0):je(e.some((n,r)=>!Ao(Ax(n,t[r]))))}function Ax(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?je(Math.abs(n-r)<1e-8):Cr(n)&&Cr(r)?je(sk(n,r)):je(typeof n=="object"&&typeof r=="object"?Nx(e,t):n===r)}function ok(e,t){return e.length===0&&t.length===0?je(!0):e.length!==t.length?je(!1):(e.sort(sw),t.sort(sw),je(e.every((n,r)=>Ao(i6(n,t[r])))))}function i6(e,t){const{type:n,value:r}=e,{type:o,value:i}=t,a=r==null?void 0:r.valueOf(),l=i==null?void 0:i.valueOf();return typeof a=="number"&&typeof l=="number"?je(Math.abs(a-l)<.01):Cr(a)&&Cr(l)?je(sk(a,l)):je(n==="Coding"&&o==="Coding"?typeof a!="object"||typeof l!="object"?!1:a.code===l.code&&a.system===l.system:typeof a=="object"&&typeof l=="object"?Nx({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function sw(e,t){var o,i;const n=(o=e.value)==null?void 0:o.valueOf(),r=(i=t.value)==null?void 0:i.valueOf();return typeof n=="number"&&typeof r=="number"?n-r:typeof n=="string"&&typeof r=="string"?n.localeCompare(r):0}function ik(e,t){const{value:n}=e;if(n==null)return!1;switch(t){case"Boolean":return typeof n=="boolean";case"Decimal":case"Integer":return typeof n=="number";case"Date":return s6(n);case"DateTime":return Tg(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return a6(n);case"Quantity":return Cr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function s6(e){return typeof e=="string"&&!!tk.date.exec(e)}function Tg(e){return typeof e=="string"&&!!tk.dateTime.exec(e)}function a6(e){return!!(e&&typeof e=="object"&&("start"in e&&Tg(e.start)||"end"in e&&Tg(e.end)))}function Cr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function sk(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 Nx(e,t){const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const i=e[o],a=t[o];if(aw(i)&&aw(a)){if(!Nx(i,a))return!1}else if(i!==a)return!1}return!0}function aw(e){return e!==null&&typeof e=="object"}function lw(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return l6(e??{},t)}return e}function l6(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function Tt(e){const t=rt(e),n=qo(e);return n===t?{reference:t}:{reference:t,display:n}}function rt(e){return Xs(e)?e.reference:`${e.resourceType}/${e.id}`}function il(e){if(e)return Xs(e)?e.reference.split("/")[1]:e.id}function c6(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function qo(e){if(c6(e)){const t=u6(e);if(t)return t}if(e.resourceType==="Device"){const t=d6(e);if(t)return t}if(e.resourceType==="MedicationRequest"&&e.medicationCodeableConcept)return Vi(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]),w6(t))return Vi(t);if(S6(t))return t.text}return rt(e)}function u6(e){const t=e.name;if(t&&t.length>0)return pu(t[0])}function d6(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function f6(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=cw(n);if(r)return r}else return cw(t)}function cw(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function ak(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(),i=n.getUTCMonth(),a=n.getUTCDate(),l=r.getUTCFullYear(),c=r.getUTCMonth(),u=r.getUTCDate();let d=l-o;(c<i||c===i&&u<a)&&d--;let f=l*12+c-(o*12+i);u<a&&f--;const h=Math.floor((r.getTime()-n.getTime())/(1e3*60*60*24));return{years:d,months:f,days:h}}function h6(e,t){const{years:n,months:r,days:o}=ak(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 Sl(e,...t){var r;let n=e;for(let o=0;o<t.length&&n;o++)n=(r=n==null?void 0:n.extension)==null?void 0:r.find(i=>i.url===t[o]);return n}function hr(e,t){return JSON.stringify(e,p6,t?2:void 0)}function p6(e,t){return!m6(e)&&qt(t)?void 0:t}function m6(e){return!!/\d+$/.exec(e)}function qt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!$t(e):!1}function $t(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 Ui(e,t,n){return e===t||qt(e)&&qt(t)?!0:qt(e)||qt(t)?!1:Array.isArray(e)&&Array.isArray(t)?g6(e,t):Array.isArray(e)||Array.isArray(t)?!1:Rn(e)&&Rn(t)?v6(e,t,n):(Rn(e)||Rn(t),!1)}function g6(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Ui(e[n],t[n]))return!1;return!0}function v6(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 i=e[o],a=t[o];if(!Ui(i,a,o))return!1}return!0}function Mx(e,t){return qt(e)?!0:qt(t)?!1:Array.isArray(e)&&Array.isArray(t)?y6(e,t):Array.isArray(e)||Array.isArray(t)?!1:Rn(e)&&Rn(t)?x6(e,t):Rn(e)||Rn(t)?!1:e===t}function y6(e,t){return t.every(n=>e.some(r=>Mx(r,n)))}function x6(e,t){return Object.entries(t).every(([n,r])=>n in e&&Mx(e[n],r))}function Kr(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function lk(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Rn(e){return e!==null&&typeof e=="object"}function b6(e){return Rn(e)&&"code"in e&&typeof e.code=="string"}function w6(e){return Rn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(b6)}function S6(e){return Rn(e)&&"text"in e&&typeof e.text=="string"}const ck=[];for(let e=0;e<256;e++)ck.push(e.toString(16).padStart(2,"0"));function j6(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=ck[t[r]];return n.join("")}function C6(e){const t=new Uint8Array(e),n=[];for(let r=0;r<t.length;r++)n[r]=String.fromCharCode(t[r]);return window.btoa(n.join(""))}function tn(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function Ox(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function Mc(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function E6(e,t){var n,r;return(r=(n=e.coding)==null?void 0:n.find(o=>o.system===t))==null?void 0:r.code}function T6(e){if(e!==void 0)return Array.isArray(e)?e:[e]}const uw=e=>new Promise(t=>{setTimeout(t,e)});function Pg(e,t,n){const r=[];for(let o=0;o<n-1;o++){const i=e.indexOf(t);if(i<0)break;r.push(e.slice(0,i)),e=e.slice(i+t.length)}return r.push(e),r}function P6(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function Bl(e,t){return e?(e.push(t),e):[t]}function Oc(e){return e.sort((t,n)=>t.localeCompare(n))}function uk(e){return e.endsWith("/")?e:e+"/"}function k6(e){return e.startsWith("/")?e.slice(1):e}function Po(e,t){return new URL(k6(t),uk(e.toString())).toString()}function R6(e,t){return Po(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function _6(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 dk(e,t){var n,r;return(r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)||(e.meta=e.meta??{},e.meta.profile=e.meta.profile??[],e.meta.profile.push(t)),e}function D6(e,t){var n,r;if((r=(n=e==null?void 0:e.meta)==null?void 0:n.profile)!=null&&r.includes(t)){const o=e.meta.profile.indexOf(t);e.meta.profile.splice(o,1)}return e}function I6(e,t){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!=null&&t.use)&&n.push("["+e.use+"]"),n.join(", ").trim()}function pu(e,t){const n=[];if(e.prefix&&(t==null?void 0:t.prefix)!==!1&&n.push(...e.prefix),e.given&&n.push(...e.given),e.family&&n.push(e.family),e.suffix&&(t==null?void 0:t.suffix)!==!1&&n.push(...e.suffix),e.use&&(t!=null&&t.all||t!=null&&t.use)&&n.push("["+e.use+"]"),n.length===0){const r=$c(e.text);if(r)return r}return n.join(" ").trim()}function Fh(e){return e instanceof Date&&!isNaN(e.getTime())}function A6(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return Fh(r)?r.toLocaleTimeString(t,n):""}function zn(e,t,n){if(!e)return"";const r=new Date(e);return Fh(r)?r.toLocaleString(t,n):""}function N6(e,t,n){return!e||!e.start&&!e.end?"":zn(e.start,t,n)+" - "+zn(e.end,t,n)}const M6={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},O6={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},L6={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function fk(e){if(!e)return"";const t=[];return $6(t,e.repeat),e.event&&t.push(e.event.map(n=>zn(n)).join(", ")),tn(t.join(" ").trim())}function $6(e,t){if(!(t!=null&&t.periodUnit))return;const n=t.frequency??1,r=t.period??1,o=t.periodUnit;n===1&&r===1?e.push(M6[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+O6[o]):e.push("per "+r+" "+L6[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(tn).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>A6(i)).join(", "))}function Lc(e,t,n=!1){if(n&&t===void 0)throw new Error("Precision must be specified for exclusive ranges");const r=(e==null?void 0:e.low)&&{...e.low,comparator:void 0},o=(e==null?void 0:e.high)&&{...e.high,comparator:void 0};return(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)===void 0?"":(r==null?void 0:r.value)!==void 0&&(o==null?void 0:o.value)===void 0?n&&t!==void 0?(r.value=B6(r.value,t),`> ${yi(r)}`):`>= ${yi(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=z6(o.value,t),`< ${yi(o)}`):`<= ${yi(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${yi(r)} - ${yi(o)}`)}function yi(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[n.length-1]!==" "&&n.push(" "),n.push(e.unit)),n.join("").trim()}function F6(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Vi(e){if(!e)return"";const t=$c(e.text);return t||(e.coding?e.coding.map(n=>Ks(n)).join(", "):"")}function Ks(e,t){const n=$c(e==null?void 0:e.display);return n?`${n}`:$c(e==null?void 0:e.code)??""}function hk(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(yi(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Vi(e.valueCodeableConcept));else{const n=$c(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>hk(n)).join(" / ")),t.join(" / ").trim()}function $c(e){return typeof e=="string"?e:void 0}function z6(e,t,n=1){return(pk(e)+n)*Math.pow(10,-t)}function B6(e,t,n=1){return(pk(e)-n)*Math.pow(10,-t)}function pk(e,t){return e}const W={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 U6(e){for(const t of e.base??[]){let n=yo.types[t];n||(n={searchParamsDetails:{}},yo.types[t]=n),n.searchParams||(n.searchParams={_id:{base:[t],code:"_id",type:"token",expression:t+".id"},_lastUpdated:{base:[t],code:"_lastUpdated",type:"date",expression:t+".meta.lastUpdated"},_compartment:{base:[t],code:"_compartment",type:"reference",expression:t+".meta.compartment"},_profile:{base:[t],code:"_profile",type:"uri",expression:t+".meta.profile"},_security:{base:[t],code:"_security",type:"token",expression:t+".meta.security"},_source:{base:[t],code:"_source",type:"uri",expression:t+".meta.source"},_tag:{base:[t],code:"_tag",type:"token",expression:t+".meta.tag"}}),n.searchParams[e.code]=e}}function dw(e){var n,r,o,i;const t=(r=(n=e.type)==null?void 0:n[0])==null?void 0:r.code;return t==="BackboneElement"||t==="Element"?V6((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function V6(e){return e.length===1?e[0]:e.map(tn).join("")}function Lx(e){var t;return(t=yo.types[e])==null?void 0:t.searchParams}function W6(e,t){var n,r;return(r=(n=yo.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function Is(e){const t=e.replaceAll("[x]","").split(".").pop();return mk(t)}function mk(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(q6).join(" ").replace("_"," ").replace(/\s+/g," ")}const H6=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function q6(e){const t=e.toUpperCase();return e===t?e:H6.has(t)?t:t.charAt(0)+e.slice(1)}function Ys(e,t,n){const r=$h(e,n);if(r)return G6(r.elements,t)}function G6(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 i=t.slice(0,r)+"[x]",a=e[i];if(a)return a}}}function ri(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Xs(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const yo={types:{}};function Md(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 Eo=()=>[],Hn={empty:(e,t)=>je(t.length===0||t.every(n=>qt(n.value))),hasValue:(e,t)=>je(t.length!==0),exists:(e,t,n)=>je(n?t.filter(r=>Ao(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!qt(r.value))),all:(e,t,n)=>je(t.every(r=>Ao(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return je(!1);return je(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return je(!0);return je(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return je(!1);return je(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return je(!0);return je(!1)},subsetOf:(e,t,n)=>{if(t.length===0)return je(!0);const r=n.eval(e,ns(e));return r.length===0?je(!1):je(t.every(o=>r.some(i=>i.value===o.value)))},supersetOf:(e,t,n)=>{const r=n.eval(e,ns(e));return r.length===0?je(!0):t.length===0?je(!1):je(r.every(o=>t.some(i=>i.value===o.value)))},count:(e,t)=>[{type:W.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)=>je(t.length===Hn.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>Ao(n.eval(e,[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:Eo,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)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.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)=>{var o;const r=(o=n.eval(e,t)[0])==null?void 0:o.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,ns(e)),o=[];for(const i of t)!o.some(a=>a.value===i.value)&&r.some(a=>a.value===i.value)&&o.push(i);return o},exclude:(e,t,n)=>{if(!n)return t;const r=n.eval(e,ns(e)),o=[];for(const i of t)r.some(a=>a.value===i.value)||o.push(i);return o},union:(e,t,n)=>{if(!n)return t;const r=n.eval(e,ns(e));return rk([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,ns(e));return[...t,...r]},htmlChecks:(e,t,n)=>[vo(!0)],iif:(e,t,n,r,o)=>{const i=n.eval(e,t);if(i.length>1||i.length===1&&typeof i[0].value!="boolean")throw new Error("Expected criterion to evaluate to a Boolean");return Ao(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);if(typeof n=="boolean")return[{type:W.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return je(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return je(!0);if(["false","f","no","n","0","0.0"].includes(r))return je(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:je(Hn.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);return typeof n=="number"?[{type:W.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:W.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:W.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:je(Hn.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.date,value:Md(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:je(Hn.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:W.dateTime,value:Md(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:je(Hn.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);return typeof n=="number"?[{type:W.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:W.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:W.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:je(Hn.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);return Cr(n)?[{type:W.Quantity,value:n}]:typeof n=="number"?[{type:W.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:W.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:W.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:je(Hn.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);return n==null?[]:Cr(n)?[{type:W.string,value:`${n.value} '${n.unit}'`}]:[{type:W.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:je(Hn.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=ao(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:W.time,value:Md("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:je(Hn.toTime(e,t).length===1),indexOf:(e,t,n)=>vr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>vr((o,i,a)=>{const l=i,c=a?l+a:o.length;return l<0||l>=o.length?void 0:o.substring(l,c)},e,t,n,r),startsWith:(e,t,n)=>vr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>vr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>vr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>vr(n=>n.toUpperCase(),e,t),lower:(e,t)=>vr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>vr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),matches:(e,t,n)=>vr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>vr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),length:(e,t)=>vr(n=>n.length,e,t),toChars:(e,t)=>vr(n=>n?n.split(""):void 0,e,t),encode:Eo,decode:Eo,escape:Eo,unescape:Eo,trim:Eo,split:Eo,join:(e,t,n)=>{var o;const r=((o=n==null?void 0:n.eval(e,ns(e))[0])==null?void 0:o.value)??"";if(typeof r!="string")throw new Error("Separator must be a string.");return[{type:W.string,value:t.map(i=>{var a;return((a=i.value)==null?void 0:a.toString())??""}).join(r)}]},abs:(e,t)=>oo(Math.abs,e,t),ceiling:(e,t)=>oo(Math.ceil,e,t),exp:(e,t)=>oo(Math.exp,e,t),floor:(e,t)=>oo(Math.floor,e,t),ln:(e,t)=>oo(Math.log,e,t),log:(e,t,n)=>oo((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>oo(Math.pow,e,t,n),round:(e,t)=>oo(Math.round,e,t),sqrt:(e,t)=>oo(Math.sqrt,e,t),truncate:(e,t)=>oo(n=>n|0,e,t),children:Eo,descendants:Eo,trace:(e,t,n)=>t,now:()=>[{type:W.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:W.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:W.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=Hn.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=Hn.toDateTime(e,r.eval(e,t));if(a.length===0)throw new Error("Invalid end date");const l=(u=o.eval(e,t)[0])==null?void 0:u.value;if(l!=="years"&&l!=="months"&&l!=="days")throw new Error("Invalid units");const c=ak(i[0].value,a[0].value);return[{type:W.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof bf?r=n.name:n instanceof Fx&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:W.boolean,value:ik(o,r)})):[]},not:(e,t)=>Hn.toBoolean(e,t).map(n=>({type:W.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 i=r;if(i.resource)return vo(i.resource);i.reference?o=i.reference:i.type&&i.identifier&&(o=`${i.type}?identifier=${i.identifier.system}|${i.identifier.value}`)}if(o!=null&&o.includes("?")){const[i]=o.split("?");return{type:i,value:{resourceType:i}}}if(o!=null&&o.includes("/")){const[i,a]=o.split("/");return{type:i,value:{resourceType:i,id:a}}}return{type:W.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:W.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:W.BackboneElement,value:{namespace:"System",name:"Integer"}}:ri(n)?{type:W.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:W.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(i=>{var a;return{type:W.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})},getResourceKey:(e,t)=>{const n=t[0].value;return n!=null&&n.id?[{type:W.id,value:n.id}]:[]},getReferenceKey:(e,t,n)=>{const r=t[0].value;if(!(r!=null&&r.reference))return[];let o="";return n instanceof bf&&(o=n.name),o&&!r.reference.startsWith(o+"/")?[]:[{type:W.id,value:il(r)}]},extension:(e,t,n)=>{var i;const r=n.eval(e,t)[0].value,o=(i=t==null?void 0:t[0])==null?void 0:i.value;if(o){const a=Sl(o,r);if(a)return[{type:W.Extension,value:a}]}return[]}};function vr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=ao(n,1);if(typeof o!="string")throw new Error("String function cannot be called with non-string");const i=e(o,...r.map(a=>{var l;return(l=a==null?void 0:a.eval(t,n)[0])==null?void 0:l.value}));return i===void 0?[]:Array.isArray(i)?i.map(vo):[vo(i)]}function oo(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=ao(n,1),i=Cr(o),a=i?o.value:o;if(typeof a!="number")throw new Error("Math function cannot be called with non-number");const l=e(a,...r.map(d=>{var f;return(f=d.eval(t,n)[0])==null?void 0:f.value})),c=i?W.Quantity:n[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function ao(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 ns(e){var n;let t=e;for(;(n=t.parent)!=null&&n.variables.$this;)t=t.parent;return[t.variables.$this]}class Q6{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 pa{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class bf{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==null?void 0: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 ri(n)&&n.resourceType===this.name?t:xn(t,this.name)}toString(){return this.name}}class K6{eval(){return[]}toString(){return"{}"}}class Y6 extends O${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 $x extends hu{constructor(t,n){super("as",t,n)}eval(t,n){return Hn.ofType(t,this.left.eval(t,n),this.right)}}class rr extends hu{}class Mr extends rr{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 i=r[0].value,a=o[0].value,l=Cr(i)?i.value:i,c=Cr(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?je(u):Cr(i)?[{type:W.Quantity,value:{...i,value:u}}]:[vo(u)]}}class X6 extends hu{constructor(t,n){super("&",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n),i=[...r,...o];return i.length>0&&i.every(a=>typeof a.value=="string")?[{type:W.string,value:i.map(a=>a.value).join("")}]:i}}class J6 extends rr{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return je(r.some(i=>i.value===o[0].value))}}class Z6 extends rr{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ho(this.left.eval(t,n)),o=this.right.eval(t,n);return r?je(o.some(i=>i.value===r.value)):[]}}class Fx extends hu{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 gk extends hu{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return rk([...r,...o])}}class eF extends rr{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return r6(r,o)}}class tF extends rr{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return o6(r,o)}}class nF extends rr{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return ok(r,o)}}class rF extends rr{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return n6(ok(r,o))}}class zx extends rr{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 je(ik(r[0],o))}}class oF extends rr{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ho(this.left.eval(t,n),"boolean"),o=Ho(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?je(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?je(!1):[]}}class iF extends rr{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ho(this.left.eval(t,n),"boolean"),o=Ho(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?je(!1):r!=null&&r.value||o!=null&&o.value?je(!0):[]}}class sF extends rr{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ho(this.left.eval(t,n),"boolean"),o=Ho(this.right.eval(t,n),"boolean");return!r||!o?[]:je(r.value!==o.value)}}class aF extends rr{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ho(this.left.eval(t,n),"boolean"),o=Ho(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?je(!0):!r||!o?[]:je(!1)}}class Bx{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Hn[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 Ux{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 i=this.left.eval(t,n);return o in i?[i[o]]:[]}toString(){return`${this.left.toString()}[${this.expr.toString()}]`}}const lF=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class cF{constructor(t,n,r,o){this.result=[],this.pos={index:0,line:1,column:0},this.markStack=[],this.str=t,this.keywords=n,this.operators=r,this.dateTimeLiterals=!!(o!=null&&o.dateTimeLiterals),this.symbolRegex=(o==null?void 0: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==='"'?this.consumeString(t):t==="`"?this.consumeBacktickSymbol():t==="@"?this.consumeDateTime():/\d/.exec(t)?this.consumeNumber():/\w/.exec(t)?this.consumeSymbol():(t==="$"||t==="%")&&/\w/.exec(n)?this.consumeSymbol():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()!==`
|
|
92
|
-
`))}consumeString(t){this.advance();const n=this.buildToken("String",this.consumeWhile(()=>this.prev()==="\\"||this.curr()!==t));return this.advance(),n}consumeBacktickSymbol(){this.advance();const t=this.buildToken("Symbol",this.consumeWhile(()=>this.curr()!=="`"));return this.advance(),t}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()===" "&&uF(this.peekToken())&&(n="Quantity",this.consumeToken()),this.buildToken(n,this.str.substring(t,this.pos.index)))}consumeSymbol(){var n;const t=this.consumeWhile(()=>this.symbolRegex.exec(this.curr()));return((n=this.prevToken())==null?void 0:n.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]}prev(){return this.str[this.pos.index-1]??""}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()===`
|
|
93
|
-
`?(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 uF(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&lF.includes(e.value)))}const dF=["true","false"],fF=["!=","!~","<=",">=","{}","->"];function hF(e){return new cF(e,dF,fF).tokenize()}const ut={FunctionCall:0,Dot:1,Indexer:2,UnaryAdd:3,UnarySubtract:3,Multiply:4,Divide:4,IntegerDivide: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,Arrow:100,Semicolon:200},pF={parse(e){var n;const t=e.consumeAndParse();if(!e.match(")"))throw new Error("Parse error: expected `)` got `"+((n=e.peek())==null?void 0:n.value)+"`");return t}},mF={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new Ux(t,n)},precedence:ut.Indexer},gF={parse(e,t){if(!(t instanceof bf))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Bx(t.name,n)},precedence:ut.FunctionCall};function vF(e){const t=e.split(" "),n=parseFloat(t[0]);let r=t[1];return r!=null&&r.startsWith("'")&&r.endsWith("'")?r=r.substring(1,r.length-1):r="{"+r+"}",{value:n,unit:r}}function yF(){return new L$().registerPrefix("String",{parse:(e,t)=>new pa({type:W.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new pa({type:W.dateTime,value:Md(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new pa({type:W.Quantity,value:vF(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new pa({type:t.value.includes(".")?W.decimal:W.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new pa({type:W.boolean,value:!0})}).registerPrefix("false",{parse:()=>new pa({type:W.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new bf(t.value)}).registerPrefix("{}",{parse:()=>new K6}).registerPrefix("(",pF).registerInfix("[",mF).registerInfix("(",gF).prefix("+",ut.UnaryAdd,(e,t)=>new Y6("+",t,n=>n)).prefix("-",ut.UnarySubtract,(e,t)=>new Mr("-",t,t,(n,r)=>-r)).infixLeft(".",ut.Dot,(e,t,n)=>new Fx(e,n)).infixLeft("/",ut.Divide,(e,t,n)=>new Mr("/",e,n,(r,o)=>r/o)).infixLeft("*",ut.Multiply,(e,t,n)=>new Mr("*",e,n,(r,o)=>r*o)).infixLeft("+",ut.Add,(e,t,n)=>new Mr("+",e,n,(r,o)=>r+o)).infixLeft("-",ut.Subtract,(e,t,n)=>new Mr("-",e,n,(r,o)=>r-o)).infixLeft("|",ut.Union,(e,t,n)=>new gk(e,n)).infixLeft("=",ut.Equals,(e,t,n)=>new eF(e,n)).infixLeft("!=",ut.NotEquals,(e,t,n)=>new tF(e,n)).infixLeft("~",ut.Equivalent,(e,t,n)=>new nF(e,n)).infixLeft("!~",ut.NotEquivalent,(e,t,n)=>new rF(e,n)).infixLeft("<",ut.LessThan,(e,t,n)=>new Mr("<",e,n,(r,o)=>r<o)).infixLeft("<=",ut.LessThanOrEquals,(e,t,n)=>new Mr("<=",e,n,(r,o)=>r<=o)).infixLeft(">",ut.GreaterThan,(e,t,n)=>new Mr(">",e,n,(r,o)=>r>o)).infixLeft(">=",ut.GreaterThanOrEquals,(e,t,n)=>new Mr(">=",e,n,(r,o)=>r>=o)).infixLeft("&",ut.Ampersand,(e,t,n)=>new X6(e,n)).infixLeft("and",ut.And,(e,t,n)=>new oF(e,n)).infixLeft("as",ut.As,(e,t,n)=>new $x(e,n)).infixLeft("contains",ut.Contains,(e,t,n)=>new J6(e,n)).infixLeft("div",ut.Divide,(e,t,n)=>new Mr("div",e,n,(r,o)=>r/o|0)).infixLeft("in",ut.In,(e,t,n)=>new Z6(e,n)).infixLeft("is",ut.Is,(e,t,n)=>new zx(e,n)).infixLeft("mod",ut.Modulo,(e,t,n)=>new Mr("mod",e,n,(r,o)=>r%o)).infixLeft("or",ut.Or,(e,t,n)=>new iF(e,n)).infixLeft("xor",ut.Xor,(e,t,n)=>new sF(e,n)).infixLeft("implies",ut.Implies,(e,t,n)=>new aF(e,n))}const xF=yF();function vk(e){return new Q6(e,xF.construct(hF(e)).consumeAndParse())}function jl(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]=vo(n[r]))}return Fc(e,n).map(r=>r.value)}function Fc(e,t,n={}){return vk(e).eval({variables:n},t).map(o=>{var i;return{type:o.type,value:(i=o.value)==null?void 0:i.valueOf()}})}var _o=(e=>(e.BOOLEAN="BOOLEAN",e.NUMBER="NUMBER",e.QUANTITY="QUANTITY",e.TEXT="TEXT",e.REFERENCE="REFERENCE",e.CANONICAL="CANONICAL",e.DATE="DATE",e.DATETIME="DATETIME",e.PERIOD="PERIOD",e.UUID="UUID",e))(_o||{});function Cl(e,t){var r,o;let n=(o=(r=yo.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=wF(e,t)),n}function bF(e,t,n){let r=yo.types[e];r||(r={},yo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function wF(e,t){const n=t.code,r=CF(n),o=TF(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=lc(l),u=P6(()=>c.join("."));c.length===1&&c[0]instanceof rr?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):yk(i,lc(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const a={columnName:r,type:EF(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return bF(e,n,a),a}function yk(e,t,n,r){const o=t[r];if(o instanceof $x){e.propertyTypes.add(o.right.toString());return}if(o instanceof Bx){SF(e,o);return}const i=o.toString(),a=Ys(n,i);if(!a)throw new Error(`Element definition not found for ${n} ${i}`);let l=!1,c=r+1;if(c<t.length&&t[c]instanceof Ux&&(l=!0,c++),a.isArray&&!l&&(e.array=!0),c>=t.length){e.elementDefinitions.push(a);for(const u of a.type)e.propertyTypes.add(u.code);return}for(const u of a.type){let d=u.code;jF(d)&&(d=a.type[0].code),yk(e,t,d,c)}}function SF(e,t){if(t.name==="as"){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 zx){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function jF(e){return e==="Element"||e==="BackboneElement"}function CF(e){return e.split("-").reduce((t,n,r)=>t+(r?tn(n):n),"")}function EF(e,t){switch(e.type){case"date":return t.size===1&&t.has(W.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(W.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(W.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function TF(e,t){const n=[],r=vk(t);return kg(e,r.child,n),n}function kg(e,t,n){t instanceof gk?(kg(e,t.left,n),kg(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function lc(e){if(e instanceof $x||e instanceof Ux)return[lc(e.left),e].flat();if(e instanceof rr)return[e];if(e instanceof Fx)return[lc(e.left),lc(e.right)].flat();if(e instanceof Bx){if(e.name==="where"&&!(e.args[0]instanceof zx))return[];if(e.name==="last")return[]}return[e]}const zh=20;var re=(e=>(e.EQUALS="eq",e.NOT_EQUALS="ne",e.GREATER_THAN="gt",e.LESS_THAN="lt",e.GREATER_THAN_OR_EQUALS="ge",e.LESS_THAN_OR_EQUALS="le",e.STARTS_AFTER="sa",e.ENDS_BEFORE="eb",e.APPROXIMATELY="ap",e.CONTAINS="contains",e.EXACT="exact",e.TEXT="text",e.NOT="not",e.ABOVE="above",e.BELOW="below",e.IN="in",e.NOT_IN="not-in",e.OF_TYPE="of-type",e.MISSING="missing",e.PRESENT="present",e.IDENTIFIER="identifier",e.ITERATE="iterate",e))(re||{});const xk={contains:"contains",exact:"exact",above:"above",below:"below",text:"text",not:"not",in:"in","not-in":"not-in","of-type":"of-type",missing:"missing",identifier:"identifier",iterate:"iterate"},Vx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function bk(e,t){if(!e)throw new Error("Invalid search URL");let n="",r;if(typeof e=="string")if(e.includes("?")){const[a,l]=e.split("?");n=a,r=new URLSearchParams(l)}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 i=[];return r&&i.push(...r.entries()),PF(o,i)}function PF(e,t){const n={resourceType:e};for(const[r,o]of t)kF(n,r,o);return n}function kF(e,t,n){var a,l;let r,o;const i=t.indexOf(":");if(i>=0?(r=t.substring(0,i),o=t.substring(i+1)):(r=t,o=""),r!=="_"){if(r==="_has"||t.includes(".")){e.filters=Bl(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":RF(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=fw(n);o==="iterate"&&(c.modifier="iterate"),e.include=Bl(e.include,c);break}case"_revinclude":{const c=fw(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=Bl(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=(l=(a=yo.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[r];c?e.filters=Bl(e.filters,_F(c,o,n)):e.filters=Bl(e.filters,AF(r,o,n))}}}}function RF(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})}}function _F(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return DF(e,n);case"reference":case"string":case"token":case"uri":return IF(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function DF(e,t){const{operator:n,value:r}=NF(t);return{code:e.code,operator:n,value:r}}function IF(e,t,n){return{code:e.code,operator:MF(t),value:n}}function AF(e,t,n){var o;let r="eq";if(t)r=t;else if(n.length>=2){const i=n.substring(0,2);i in Vx&&(n.length===2||(o=n.at(2))!=null&&o.match(/\d/))&&(r=i,n=n.substring(i.length))}return{code:e,operator:r,value:n}}function NF(e){const t=e.substring(0,2),n=Vx[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function MF(e){return xk[e]??"eq"}function fw(e){const t=e.split(":");if(t.includes("*"))throw new Be(Oi("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new Be(Oi(`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 Be(Oi(`Invalid include value '${e}'`))}function Ia(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(OF(n))),e.sortRules&&e.sortRules.length>0&&t.push(LF(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.include&&e.include.forEach(n=>t.push(hw("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(hw("_revinclude",n))),t.length===0?"":(Oc(t),"?"+t.join("&"))}function OF(e){const t=e.operator in xk?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in Vx?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function LF(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function hw(e,t){return e+(t.modifier?":"+t.modifier:"")+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function Wx(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 $F(e,t){if(t.resourceType!==e.resourceType)return!1;if(t.filters){for(const n of t.filters)if(!FF(e,t,n))return!1}return!0}function FF(e,t,n){var o,i;const r=(i=(o=yo.types[t.resourceType])==null?void 0:o.searchParams)==null?void 0:i[n.code];if(!r)return!1;if(n.operator===re.MISSING||n.operator===re.PRESENT)return zF(e,n,r);switch(r.type){case"reference":return BF(e,n,r);case"string":case"uri":return wk(e,n,r);case"token":return UF(e,n,r);case"date":return qF(e,n,r);default:return!1}}function zF(e,t,n){const o=jl(n.expression,e).length>0;return(t.operator===re.MISSING&&t.value==="false"||t.operator===re.PRESENT&&t.value==="true")===o}function BF(e,t,n){const r=jl(n.expression,e),o=Bh(t.operator);if(t.value===""&&r.length===0)return t.operator===re.EQUALS;const i=r.map(a=>typeof a=="string"?a:a.reference);for(const a of Wx(t.value)){let l=i.includes(a);if(!l&&t.code==="_compartment"&&(l=i.some(c=>c==null?void 0:c.endsWith("/"+a))),l)return!o}return o}function UF(e,t,n){return Cl(e.resourceType,n).type===_o.BOOLEAN?VF(e,t,n):wk(e,t,n,!0)}function VF(e,t,n){const r=jl(n.expression,e),o=t.value==="true",i=r.includes(o);return Bh(t.operator)?!i:i}function wk(e,t,n,r){var u,d,f,h;const i=(h=(f=(d=(u=Cl(e.resourceType,n).elementDefinitions)==null?void 0:u[0])==null?void 0:d.type)==null?void 0:f[0])==null?void 0:h.code,a=jl(n.expression,e),l=Wx(t.value),c=Bh(t.operator);for(const m of a)for(const g of l){let v;if(i===W.Identifier?v=WF(m,t.operator,g):i===W.CodeableConcept?v=HF(m,t.operator,g):v=Rg(m,t.operator,g,r),v)return!c}return c}function Rg(e,t,n,r){if(r&&n.includes("|")){const[i,a]=n.split("|");return Rg(e,t,i,!1)&&(!a||Rg(e,t,a,!1))}let o="";return e&&(typeof e=="string"?o=e:typeof e=="object"&&(o=JSON.stringify(e))),o.toLowerCase().includes(n.toLowerCase())}function WF(e,t,n){var r,o,i,a;if(n.includes("|")){const[l,c]=n.split("|").map(u=>u.toLowerCase());return!l&&!c?!1:l?((o=e.system)==null?void 0:o.toLowerCase())===l&&(!c||((i=e.value)==null?void 0:i.toLowerCase())===c):!e.system&&((r=e.value)==null?void 0:r.toLowerCase())===c}return((a=e.value)==null?void 0:a.toLowerCase())===n.toLowerCase()}function HF(e,t,n){var r,o,i,a;if(n.includes("|")){const[l,c]=n.split("|").map(u=>u.toLowerCase());return!l&&!c?!1:l?((o=e.coding)==null?void 0:o.some(u=>{var d,f;return((d=u.system)==null?void 0:d.toLowerCase())===l&&(!c||((f=u.code)==null?void 0:f.toLowerCase())===c)}))??!1:((r=e.coding)==null?void 0:r.some(u=>{var d;return!u.system&&((d=u.code)==null?void 0:d.toLowerCase())===c}))??!1}return((i=e.text)==null?void 0:i.toLowerCase())===n.toLowerCase()||(((a=e.coding)==null?void 0:a.some(l=>{var c;return((c=l.code)==null?void 0:c.toLowerCase())===n.toLowerCase()}))??!1)}function qF(e,t,n){const r=jl(n.expression,e),o=Wx(t.value),i=Bh(t.operator);for(const a of r)for(const l of o)if(GF(a,t.operator,l))return!i;return i}function GF(e,t,n){switch(t){case re.STARTS_AFTER:case re.GREATER_THAN:return e>n;case re.GREATER_THAN_OR_EQUALS:return e>=n;case re.ENDS_BEFORE:case re.LESS_THAN:return e<n;case re.LESS_THAN_OR_EQUALS:return e<=n;case re.EQUALS:case re.NOT_EQUALS:return e===n;default:return!1}}function Bh(e){return e===re.NOT_EQUALS||e===re.NOT}const QF={resourceType:"*"},KF=["DomainConfiguration","JsonWebKey","Login"],YF=["PasswordChangeRequest","UserSecurityRequest","Project","ProjectMembership","User"];var Hx=(e=>(e.READ="read",e.VREAD="vread",e.UPDATE="update",e.PATCH="patch",e.DELETE="delete",e.HISTORY="history",e.HISTORY_INSTANCE="history-instance",e.HISTORY_TYPE="history-type",e.HISTORY_SYSTEM="history-system",e.CREATE="create",e.SEARCH="search",e.SEARCH_TYPE="search-type",e.SEARCH_SYSTEM="search-system",e.SEARCH_COMPARTMENT="search-compartment",e.CAPABILITIES="capabilities",e.TRANSACTION="transaction",e.BATCH="batch",e.OPERATION="operation",e))(Hx||{});const XF=["read","vread","history","history-instance"];function JF(e,t){if(KF.includes(t))return!1;if(e.resource){for(const n of e.resource)if(jk(n.resourceType,t)&&!n.readonly)return!0}return!1}function Sk(e,t,n){if(!n)return QF;if(n.resource){for(const r of n.resource)if(ZF(e,t,r))return r}}function ZF(e,t,n){var o,i;const r=e.resourceType;return!(!jk(n.resourceType,r)||n.readonly&&!XF.includes(t)||n.compartment&&!((i=(o=e.meta)==null?void 0:o.compartment)!=null&&i.find(a=>{var l;return a.reference===((l=n.compartment)==null?void 0:l.reference)}))||n.criteria&&!$F(e,bk(n.criteria)))}function jk(e,t){return e===t||e==="*"&&!YF.includes(t)}function e8(e){if(typeof window<"u"){const t=window.atob(e),n=Uint8Array.from(t,r=>r.charCodeAt(0));return new window.TextDecoder().decode(n)}if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("utf-8");throw new Error("Unable to decode base64")}function t8(e){if(typeof window<"u"){const t=new window.TextEncoder().encode(e),n=String.fromCharCode.apply(null,t);return window.btoa(n)}if(typeof Buffer<"u")return Buffer.from(e,"utf8").toString("base64");throw new Error("Unable to encode base64")}function pw(){const e=new Uint32Array(28);return crypto.getRandomValues(e),j6(e.buffer)}async function n8(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function Ck(){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 Ek(e){var o,i,a;const t={};e=Kr(e);for(const l of e.entry||[]){((o=l.resource)==null?void 0:o.meta)!==void 0&&(delete l.resource.meta.author,delete l.resource.meta.compartment,delete l.resource.meta.lastUpdated,delete l.resource.meta.project,delete l.resource.meta.versionId);const c=(i=l.resource)==null?void 0:i.id;c&&(t[c]=Ck(),l.fullUrl="urn:uuid:"+t[c],(a=l.resource)==null||delete a.id)}const n=e.entry,r=JSON.stringify({resourceType:"Bundle",type:"transaction",entry:n==null?void 0:n.map(l=>({fullUrl:l.fullUrl,request:{method:"POST",url:l.resource.resourceType},resource:l.resource}))},(l,c)=>r8(l,c,t),2);return o8(JSON.parse(r))}function r8(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 o8(e){const t=s8(e),{sorted:n,cycles:r}=i8(t),o={};for(const a of e.entry||[])a.fullUrl&&(o[a.fullUrl]=a);const i=n.map(a=>o[a]);for(const a of r)for(const l of a){const c=o[l],u={...c,request:{...c.request,method:"PUT"}};i.push(u)}return{...e,entry:i}}function i8(e){const t=[],n={},r=[];for(const i of Object.keys(e))n[i]=0;function o(i,a){if(n[i]===2)return!0;if(n[i]===1){const c=a.lastIndexOf(i);return c!==-1&&r.push(a.slice(c)),!0}n[i]=1,a.push(i);let l=!1;for(const c of e[i])o(c,a)||(l=!0);return n[i]=2,a.pop(),t.unshift(i),!l}for(const i in e)n[i]===0&&o(i,[]);return{sorted:t,cycles:r}}function Tk(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Xs(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else Tk(r,t)}}function s8(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&&Tk(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class Pk{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 rn={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",PNG:"image/png",SCIM_JSON:"application/scim+json",SVG:"image/svg+xml",TEXT:"text/plain",TYPESCRIPT:"text/typescript",PING:"x-application/ping"};class a8{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 Uh{constructor(){this.emitter=new a8}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 _g={"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"},l8=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],qx=["DiagnosticReport-update"];function c8(e){return qx.includes(e)}function u8(e){if(qx.includes(e))throw new Be(_t(`'context.version' is required for '${e}'.`))}const d8={"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"},select:{resourceType:"*",isArray:!0}},"DiagnosticReport-update":{report:{resourceType:"DiagnosticReport"},patient:{resourceType:"Patient",optional:!0},study:{resourceType:"ImagingStudy",optional:!0},updates:{resourceType:"Bundle"}},syncerror:{operationoutcome:{resourceType:"OperationOutcome"}}};function f8(e){return l8.includes(e)}function kk(e){return!!e.endpoint}function mw(e){if(!Gx(e))throw new Be(_t("subscriptionRequest must be an object conforming to SubscriptionRequest type."));const{channelType:t,mode:n,topic:r,events:o}=e,i={"hub.channel.type":t,"hub.mode":n,"hub.topic":r,"hub.events":o.join(",")};return kk(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function Gx(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 i of o)if(!_g[i])return!1;return!(kk(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function gw(e,t,n,r){if(typeof t!="object")throw new Be(_t(`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 Be(_t(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new Be(_t(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!f8(t.resourceType))throw new Be(_t(`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 Be(_t(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function h8(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)gw(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new Be(_t(`context[${n}] is invalid. context[${n}] for the '${e}' with key '${String(t.key)}' should contain an array of resources on the key 'resources'.`));for(const a of i)gw(e,a,n,r)}}function p8(e,t){const n=new Map,r=d8[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new Be(_t(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));h8(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new Be(_t(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new Be(_t(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function vw(e,t,n,r){if(!(e&&typeof e=="string"))throw new Be(_t("Must provide a topic."));if(!_g[t])throw new Be(_t(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(_g).join(", ")}`));if(typeof n!="object")throw new Be(_t("context must be a context object or array of context objects."));if(qx.includes(t)&&!r)throw new Be(_t(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return p8(t,o),{timestamp:new Date().toISOString(),id:Ck(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class m8 extends Uh{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new Be(_t("Subscription request should contain an endpoint."));if(!Gx(t))throw new Be(_t("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 i=o;i.event["hub.event"]!=="heartbeat"&&(this.dispatchEvent({type:"message",payload:i}),n.send(JSON.stringify({id:o==null?void 0:o.id,timestamp:new Date().toISOString()})))}),n.addEventListener("close",()=>{this.dispatchEvent({type:"disconnect"})})}),this.websocket=n}disconnect(){this.websocket.close()}}function g8(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=e8(t),r=Array.from(n).reduce((i,a)=>{const l=("00"+a.charCodeAt(0).toString(16)).slice(-2);return`${i}%${l}`},""),o=decodeURIComponent(r);return JSON.parse(o)}function v8(e){return e.split(".").length===3}function Qx(e){const[t,n,r]=e.split(".");return g8(n)}function y8(e){try{return typeof Qx(e).login_id=="string"}catch{return!1}}function x8(e){try{const n=Qx(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class b8{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,rn.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var Rk;Rk=Symbol.toStringTag;class Or{constructor(t){this[Rk]="ReadablePromise",this.status="pending",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 w8{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new S8)}clear(){this.storage.clear()}getString(t){return this.storage.getItem(t)??void 0}setString(t,n){n?this.storage.setItem(t,n):this.storage.removeItem(t)}getObject(t){const n=this.getString(t);return n?JSON.parse(n):void 0}setObject(t,n){this.setString(t,n?hr(n):void 0)}}class S8{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]}}/*!
|
|
94
|
-
* Reconnecting WebSocket
|
|
95
|
-
* by Pedro Ladaria <pedro.ladaria@gmail.com>
|
|
96
|
-
* https://github.com/pladaria/reconnecting-websocket
|
|
97
|
-
* License MIT
|
|
98
|
-
*
|
|
99
|
-
* Copy of "partysocket" from Partykit team, a fork of the original "Reconnecting WebSocket"
|
|
100
|
-
* https://github.com/partykit/partykit/blob/main/packages/partysocket
|
|
101
|
-
*/const Wa={Event:typeof globalThis.Event<"u"?globalThis.Event:void 0,ErrorEvent:void 0,CloseEvent:void 0};let yw=!1;function j8(){if(typeof globalThis.Event>"u")throw new Error("Unable to lazy init events for ReconnectingWebSocket. globalThis.Event is not defined yet");Wa.Event=globalThis.Event,Wa.ErrorEvent=class extends Event{constructor(t,n){super("error",n),this.message=t.message,this.error=t}},Wa.CloseEvent=class extends Event{constructor(t=1e3,n="",r){super("close",r),this.wasClean=!0,this.code=t,this.reason=n}}}function C8(e,t){if(!e)throw new Error(t)}function ud(e){return new e.constructor(e.type,e)}const rs={maxReconnectionDelay:1e4,minReconnectionDelay:1e3+Math.random()*4e3,minUptime:5e3,reconnectionDelayGrowFactor:1.3,connectionTimeout:4e3,maxRetries:1/0,maxEnqueuedMessages:1/0,startClosed:!1,debug:!1};let xw=!1;class xi extends Uh{constructor(t,n,r={}){yw||(j8(),yw=!0),super(),this._retryCount=-1,this._shouldReconnect=!0,this._connectLock=!1,this._binaryType="blob",this._closeCalled=!1,this._messageQueue=[],this._debugLogger=console.log.bind(console),this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this._handleOpen=o=>{this._debug("open event");const{minUptime:i=rs.minUptime}=this._options;clearTimeout(this._connectTimeout),this._uptimeTimeout=setTimeout(()=>this._acceptOpen(),i),C8(this._ws,"WebSocket is not defined"),this._ws.binaryType=this._binaryType,this._messageQueue.forEach(a=>{var l;return(l=this._ws)==null?void 0:l.send(a)}),this._messageQueue=[],this.onopen&&this.onopen(o),this.dispatchEvent(ud(o))},this._handleMessage=o=>{this._debug("message event"),this.onmessage&&this.onmessage(o),this.dispatchEvent(ud(o))},this._handleError=o=>{this._debug("error event",o.message),this._disconnect(void 0,o.message==="TIMEOUT"?"timeout":void 0),this.onerror&&this.onerror(o),this._debug("exec error listeners"),this.dispatchEvent(ud(o)),this._connect()},this._handleClose=o=>{this._debug("close event"),this._clearTimeouts(),this._shouldReconnect&&this._connect(),this.onclose&&this.onclose(o),this.dispatchEvent(ud(o))},this._url=t,this._protocols=n,this._options=r,this._options.startClosed&&(this._shouldReconnect=!1),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 xi.CONNECTING}get OPEN(){return xi.OPEN}get CLOSING(){return xi.CLOSING}get CLOSED(){return xi.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(){var n;return this._messageQueue.reduce((r,o)=>(typeof o=="string"?r+=o.length:o instanceof Blob?r+=o.size:r+=o.byteLength,r),0)+(((n=this._ws)==null?void 0:n.bufferedAmount)??0)}get extensions(){var t;return((t=this._ws)==null?void 0:t.extensions)??""}get protocol(){var t;return((t=this._ws)==null?void 0:t.protocol)??""}get readyState(){return this._ws?this._ws.readyState:this._options.startClosed?xi.CLOSED:xi.CONNECTING}get url(){return this._ws?this._ws.url:""}get shouldReconnect(){return this._shouldReconnect}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=rs.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=rs.reconnectionDelayGrowFactor,minReconnectionDelay:n=rs.minReconnectionDelay,maxReconnectionDelay:r=rs.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=rs.maxRetries,connectionTimeout:n=rs.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"&&!xw&&(console.error("‼️ No WebSocket implementation available. You should define options.WebSocket."),xw=!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 Wa.ErrorEvent(Error(r.message),this))})}_handleTimeout(){this._debug("timeout event"),this._handleError(new Wa.ErrorEvent(Error("TIMEOUT"),this))}_disconnect(t=1e3,n){if(this._clearTimeouts(),!!this._ws){this._removeListeners();try{this._ws.close(t,n),this._handleClose(new Wa.CloseEvent(t,n,this))}catch{}}}_acceptOpen(){this._debug("accept open"),this._retryCount=0}_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 E8=5e3;class Dg extends Uh{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 T8{constructor(t,n){this.connecting=!1,this.criteria=t,this.emitter=new Dg(t),this.refCount=1,this.subscriptionProps=n?{...n}:void 0}clearAttachedSubscription(){this.subscriptionId=void 0,this.token=void 0}}class P8{constructor(t,n,r){if(this.pingTimer=void 0,this.waitingForPong=!1,!(t instanceof _k))throw new Be(_t("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new Be(_t("Not a valid URL"))}const i=r!=null&&r.ReconnectingWebSocket?new r.ReconnectingWebSocket(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger}):new xi(o,void 0,{debug:r==null?void 0:r.debug,debugLogger:r==null?void 0:r.debugLogger});this.medplum=t,this.ws=i,this.masterSubEmitter=new Dg,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.pingIntervalMs=(r==null?void 0:r.pingIntervalMs)??E8,this.currentProfile=t.getProfile(),this.setupListeners()}setupListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,o,i,a,l,c;try{const u=JSON.parse(n.data);if(u.type==="pong"){this.waitingForPong=!1;return}const d=u,f=(o=(r=d==null?void 0:d.entry)==null?void 0:r[0])==null?void 0:o.resource;if(f.type==="heartbeat"){(i=this.masterSubEmitter)==null||i.dispatchEvent({type:"heartbeat",payload:d});return}if(f.type==="handshake"){const m=il(f.subscription),g={type:"connect",payload:{subscriptionId:m}};(a=this.masterSubEmitter)==null||a.dispatchEvent(g);const v=this.criteriaEntriesBySubscriptionId.get(m);if(!v){console.warn("Received handshake for criteria the SubscriptionManager is not listening for yet");return}v.connecting=!1,v.emitter.dispatchEvent({...g});return}(l=this.masterSubEmitter)==null||l.dispatchEvent({type:"message",payload:d});const h=this.criteriaEntriesBySubscriptionId.get(il(f.subscription));if(!h){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}h.emitter.dispatchEvent({type:"message",payload:d})}catch(u){console.error(u);const d={type:"error",payload:u};(c=this.masterSubEmitter)==null||c.dispatchEvent(d);for(const f of this.getAllCriteriaEmitters())f.dispatchEvent({...d})}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new Be(Y$(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.dispatchEvent({...n})}),t.addEventListener("close",()=>{var r,o;const n={type:"close"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const i of this.getAllCriteriaEmitters())i.dispatchEvent({...n});this.pingTimer&&(clearInterval(this.pingTimer),this.pingTimer=void 0,this.waitingForPong=!1),this.wsClosed&&(this.criteriaEntries.clear(),this.criteriaEntriesBySubscriptionId.clear(),(o=this.masterSubEmitter)==null||o.removeAllListeners())}),t.addEventListener("open",()=>{var r;const n={type:"open"};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const o of this.getAllCriteriaEmitters())o.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",()=>{var r;const n=this.medplum.getProfile();this.currentProfile&&n===void 0?this.ws.close():n&&((r=this.currentProfile)==null?void 0:r.id)!==n.id&&this.ws.reconnect(),this.currentProfile=n})}emitError(t,n){var o;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),t.emitter.dispatchEvent({...r})}maybeEmitDisconnect(t){var r;const{subscriptionId:n}=t;if(n){const o={type:"disconnect",payload:{subscriptionId:n}};(r=this.masterSubEmitter)==null||r.dispatchEvent(o),t.emitter.dispatchEvent({...o})}else console.warn("Called disconnect for `CriteriaEntry` before `subscriptionId` was present.")}async getTokenForCriteria(t){var a,l;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({...t.subscriptionProps,resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${rt(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=(a=r==null?void 0:r.find(c=>c.name==="token"))==null?void 0:a.valueString,i=(l=r==null?void 0:r.find(c=>c.name==="websocket-url"))==null?void 0:l.valueUrl;if(!o)throw new Be(_t("Failed to get token"));if(!i)throw new Be(_t("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(Ui(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){var l;const{criteria:n,subscriptionProps:r,subscriptionId:o,token:i}=t;if(!this.criteriaEntries.has(n))return;const a=this.criteriaEntries.get(n);r?a.criteriaWithProps=a.criteriaWithProps.filter(c=>{const u=c.subscriptionProps;return!Ui(r,u)}):a.bareCriteria=void 0,!a.bareCriteria&&a.criteriaWithProps.length===0&&(this.criteriaEntries.delete(n),(l=this.masterSubEmitter)==null||l._removeCriteria(n)),o&&this.criteriaEntriesBySubscriptionId.delete(o),i&&this.ws.readyState===WebSocket.OPEN&&this.ws.send(JSON.stringify({type:"unbind-from-token",payload:{token:i}}))}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(Ae(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 T8(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 Dg(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const k8="3.2.16-a2ededb30",R8=rn.FHIR_JSON+", */*; q=0.1",_8="https://api.medplum.com/",D8=1e3,I8=6e4,A8=0,N8=3e5,M8="Binary/",bw={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class _k extends Uh{constructor(t){if(super(),this.initComplete=!0,t!=null&&t.baseUrl&&!t.baseUrl.startsWith("http"))throw new Error("Base URL must start with http or https");this.options=t??{},this.fetch=(t==null?void 0:t.fetch)??O8(),this.storage=(t==null?void 0:t.storage)??new w8,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=uk((t==null?void 0:t.baseUrl)??_8),this.fhirBaseUrl=Po(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=Po(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=Po(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=Po(this.baseUrl,(t==null?void 0:t.logoutUrl)??"oauth2/logout"),this.clientId=(t==null?void 0:t.clientId)??"",this.clientSecret=(t==null?void 0:t.clientSecret)??"",this.onUnauthenticated=t==null?void 0:t.onUnauthenticated,this.refreshGracePeriod=(t==null?void 0:t.refreshGracePeriod)??N8,this.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?A8:I8),this.cacheTime>0?this.requestCache=new Pk((t==null?void 0:t.resourceCacheSize)??D8):this.requestCache=void 0,t!=null&&t.autoBatchTime?(this.autoBatchTime=t.autoBatchTime,this.autoBatchQueue=[]):(this.autoBatchTime=0,this.autoBatchQueue=void 0),t!=null&&t.accessToken&&this.setAccessToken(t.accessToken),this.storage.getInitPromise===void 0?(t!=null&&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!=null&&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}clear(){this.storage.clear(),typeof window<"u"&&sessionStorage.clear(),this.clearActiveLogin()}clearActiveLogin(){var t;this.storage.setString("activeLogin",void 0),(t=this.requestCache)==null||t.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){var n;t=t.toString(),(n=this.requestCache)==null||n.delete(t)}invalidateAll(){var t;(t=this.requestCache)==null||t.clear()}invalidateSearches(t){const n=Po(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?o=new Promise((a,l)=>{this.autoBatchQueue.push({method:"GET",url:t.replace(this.fhirBaseUrl,""),options:n,resolve:a,reject:l}),this.autoBatchTimerId||(this.autoBatchTimerId=setTimeout(()=>this.executeAutoBatch(),this.autoBatchTime))}):o=this.request("GET",t,n);const i=new Or(o);return this.setCacheEntry(t,i),i}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,rn.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(window.location.search).get("code");if(!r){await this.requestAuthorization(t);return}return this.processCode(r)}signOutWithRedirect(){window.location.assign(this.logoutUrl)}async signInWithExternalAuth(t,n,r,o,i=!0){let a=o;i&&(a=await this.ensureCodeChallenge(o)),window.location.assign(this.getExternalAuthRedirectUri(t,n,r,a,i))}async exchangeExternalAccessToken(t,n){if(n=n??this.clientId,!n)throw new Error("MedplumClient is missing clientId");const r=new URLSearchParams;return r.set("grant_type","urn:ietf:params:oauth:grant-type:token-exchange"),r.set("subject_token_type","urn:ietf:params:oauth:token-type:access_token"),r.set("client_id",n),r.set("subject_token",t),this.fetchTokens(r)}getExternalAuthRedirectUri(t,n,r,o,i=!0){const a=new URL(t);if(a.searchParams.set("response_type","code"),a.searchParams.set("client_id",n),a.searchParams.set("redirect_uri",r),a.searchParams.set("scope",o.scope??"openid profile email"),a.searchParams.set("state",JSON.stringify(o)),i){const{codeChallenge:l,codeChallengeMethod:c}=o;if(!c)throw new Error("`LoginRequest` for external auth must include a `codeChallengeMethod`.");if(!l)throw new Error("`LoginRequest` for external auth must include a `codeChallenge`.");a.searchParams.set("code_challenge_method",c),a.searchParams.set("code_challenge",l)}return a.toString()}fhirUrl(...t){return new URL(Po(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=_6(n)),r}search(t,n,r){const o=this.fhirSearchUrl(t,n),i="search-"+o.toString(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Or((async()=>{const c=await this.get(o,r);if(c.entry)for(const u of c.entry)this.cacheResource(u.resource);return c})());return this.setCacheEntry(i,l),l}searchOne(t,n,r){const o=this.fhirSearchUrl(t,n);o.searchParams.set("_count","1"),o.searchParams.sort();const i="searchOne-"+o.toString(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Or(this.search(t,o.searchParams,r).then(c=>{var u,d;return(d=(u=c.entry)==null?void 0:u[0])==null?void 0:d.resource}));return this.setCacheEntry(i,l),l}searchResources(t,n,r){const i="searchResources-"+this.fhirSearchUrl(t,n).toString(),a=this.getCacheEntry(i,r);if(a)return a.value;const l=new Or(this.search(t,n,r).then(jw));return this.setCacheEntry(i,l),l}async*searchResourcePages(t,n,r){var i,a;let o=this.fhirSearchUrl(t,n);for(;o;){const l=new URL(o).searchParams,c=await this.search(t,l,r),u=(i=c.link)==null?void 0:i.find(d=>d.relation==="next");if(!((a=c.entry)!=null&&a.length)&&!u)break;yield jw(c),o=u!=null&&u.url?new URL(u.url):void 0}}searchValueSet(t,n,r){return this.valueSetExpand({url:t,filter:n},r)}valueSetExpand(t,n){const r=this.fhirUrl("ValueSet","$expand");return r.search=new URLSearchParams(t).toString(),this.get(r.toString(),n)}getCached(t,n){var o,i;const r=(i=(o=this.requestCache)==null?void 0:o.get(this.fhirUrl(t,n).toString()))==null?void 0:i.value;return r!=null&&r.isOk()?r.read():void 0}getCachedReference(t){const n=t.reference;if(!n)return;if(n==="system")return bw;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 Or(Promise.reject(new Error("Missing reference")));if(r==="system")return new Or(Promise.resolve(bw));const[o,i]=r.split("/");return!o||!i?new Or(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(ZP(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Or((async()=>{const i=`{
|
|
102
|
-
StructureDefinitionList(name: "${t}") {
|
|
103
|
-
resourceType,
|
|
104
|
-
name,
|
|
105
|
-
kind,
|
|
106
|
-
description,
|
|
107
|
-
type,
|
|
108
|
-
url,
|
|
109
|
-
snapshot {
|
|
110
|
-
element {
|
|
111
|
-
id,
|
|
112
|
-
path,
|
|
113
|
-
definition,
|
|
114
|
-
min,
|
|
115
|
-
max,
|
|
116
|
-
base {
|
|
117
|
-
path,
|
|
118
|
-
min,
|
|
119
|
-
max
|
|
120
|
-
},
|
|
121
|
-
contentReference,
|
|
122
|
-
type {
|
|
123
|
-
code,
|
|
124
|
-
profile,
|
|
125
|
-
targetProfile
|
|
126
|
-
},
|
|
127
|
-
binding {
|
|
128
|
-
strength,
|
|
129
|
-
valueSet
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
SearchParameterList(base: "${t}", _count: 100) {
|
|
135
|
-
base,
|
|
136
|
-
code,
|
|
137
|
-
type,
|
|
138
|
-
expression,
|
|
139
|
-
target
|
|
140
|
-
}
|
|
141
|
-
}`.replace(/\s+/g," "),a=await this.graphql(i);nw(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)U6(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&Ix(t))return Promise.resolve();const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const i=new Or((async()=>{if(n!=null&&n.expandProfile){const a=this.fhirUrl("StructureDefinition","$expand-profile");a.search=new URLSearchParams({url:t}).toString();const l=await this.post(a.toString(),{});nw(l)}else{const a=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});if(!a){console.warn(`No StructureDefinition found for ${t}!`);return}JP(a)}})());return this.setCacheEntry(r,i),i}readHistory(t,n,r){return this.get(this.fhirUrl(t,n,"_history"),r)}readVersion(t,n,r,o){return this.get(this.fhirUrl(t,n,"_history",r),o)}readPatientEverything(t,n){return this.get(this.fhirUrl("Patient",t,"$everything"),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){return await this.searchOne(t.resourceType,n,r)??this.createResource(t,r)}async upsertResource(t,n,r){const o=this.fhirSearchUrl(t.resourceType,n);let i=await this.put(o,t,void 0,r);return i||(i=t),this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t.resourceType,t.id,"_history")),this.invalidateSearches(t.resourceType),i}async createAttachment(t,n,r,o,i){const a=Cw(t,n,r,o),l=i??(typeof n=="object"?n:{}),c=await this.createBinary(a,l);return{contentType:a.contentType,url:c.url,title:a.filename}}createBinary(t,n,r,o,i){const a=Cw(t,n,r,o),l=i??(typeof n=="object"?n:{}),{data:c,contentType:u,filename:d,securityContext:f,onProgress:h}=a,m=this.fhirUrl("Binary");return d&&m.searchParams.set("_filename",d),f!=null&&f.reference&&this.setRequestHeader(l,"X-Security-Context",f.reference),h?this.uploadwithProgress(m,c,u,h,l):this.post(m,c,u,l)}uploadwithProgress(t,n,r,o,i){return new Promise((a,l)=>{var f;const c=new XMLHttpRequest,u=()=>c.abort();(f=i==null?void 0:i.signal)==null||f.addEventListener("abort",u);const d=h=>{var m;(m=i==null?void 0:i.signal)==null||m.removeEventListener("abort",u),h instanceof Error?l(h):a(h)};if(c.responseType="json",c.onabort=()=>d(new DOMException("Request aborted","AbortError")),c.onerror=()=>d(new Error("Request error")),o&&(c.upload.onprogress=h=>o(h),c.upload.onload=h=>o(h)),c.onload=()=>{c.status>=200&&c.status<300?d(c.response):d(new Be(ft(c.response||c.statusText)))},c.open("POST",t),c.withCredentials=!0,c.setRequestHeader("Authorization","Bearer "+this.accessToken),c.setRequestHeader("Cache-Control","no-cache, no-store, max-age=0"),c.setRequestHeader("Content-Type",r),c.setRequestHeader("X-Medplum","extended"),i!=null&&i.headers){const h=i.headers;for(const[m,g]of Object.entries(h))c.setRequestHeader(m,g)}c.send(n)})}async createPdf(t,n,r,o){if(!this.createPdfImpl)throw new Error("PDF creation not enabled");const i=F8(t,n,r,o),a=typeof n=="object"?n:{},{docDefinition:l,tableLayouts:c,fonts:u,...d}=i,f=await this.createPdfImpl(l,c,u),h={...d,data:f,contentType:"application/pdf"};return this.createBinary(h,a)}createComment(t,n,r){const o=this.getProfile();let i,a;return t.resourceType==="Encounter"&&(i=Tt(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=Tt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[Tt(t)],encounter:i,subject:a,sender:o?Tt(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 i=await this.patch(this.fhirUrl(t,n),r,o);return this.cacheResource(i),this.invalidateUrl(this.fhirUrl(t,n,"_history")),this.invalidateSearches(t),i}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 i;if(typeof t=="string"){const a=t;i=this.fhirUrl("Bot",a,"$execute")}else{const a=t;i=this.fhirUrl("Bot","$execute"),i.searchParams.set("identifier",a.system+"|"+a.value)}return this.post(i,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,rn.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},rn.JSON,o)}readResourceGraph(t,n,r,o){return this.get(`${this.fhirUrl(t,n)}/$graph?graph=${r}`,o)}pushToAgent(t,n,r,o,i,a){return this.post(this.fhirUrl("Agent",il(t),"$push"),{destination:typeof n=="string"?n:rt(n),body:r,contentType:o,waitForResponse:i},rn.FHIR_JSON,a)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||rt(this.sessionDetails.profile)!==((r=t.profile)==null?void 0:r.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}setAccessToken(t,n){this.accessToken=t,this.refreshToken=n,this.accessTokenExpires=x8(t),this.medplumServer=y8(t)}getLogins(){return this.storage.getObject("logins")??[]}addLogin(t){const n=this.getLogins().filter(r=>{var o,i;return((o=r.profile)==null?void 0:o.reference)!==((i=t.profile)==null?void 0:i.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=>{var i,a;this.profilePromise=void 0;const o=((a=(i=this.sessionDetails)==null?void 0:i.profile)==null?void 0:a.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(){var t;return!this.isInitialized||!!this.profilePromise&&!((t=this.sessionDetails)!=null&&t.profile)}isSuperAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.project.superAdmin)}isProjectAdmin(){var t;return!!((t=this.sessionDetails)!=null&&t.membership.admin)}getProject(){var t;return(t=this.sessionDetails)==null?void 0:t.project}getProjectMembership(){var t;return(t=this.sessionDetails)==null?void 0:t.membership}getProfile(){var t;return(t=this.sessionDetails)==null?void 0:t.profile}async getProfileAsync(){return this.profilePromise?this.profilePromise:this.sessionDetails?this.sessionDetails.profile:this.refreshProfile()}getUserConfiguration(){var t;return(t=this.sessionDetails)==null?void 0:t.config}getAccessPolicy(){var t;return(t=this.sessionDetails)==null?void 0:t.accessPolicy}async download(t,n={}){this.refreshPromise&&await this.refreshPromise;const r=t.toString();r.startsWith(M8)&&(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,i=await this.createResource({resourceType:"Media",status:"preparation",content:{contentType:t.contentType},...r});o.securityContext||(o.securityContext=Tt(i));const a=await this.createAttachment(o,n);return this.updateResource({...i,status:"completed",content:a})}async uploadMedia(t,n,r,o,i){return this.createMedia({data:t,contentType:n,filename:r,additionalFields:o},i)}async bulkExport(t="",n,r,o){const i=t&&`${t}/`,a=this.fhirUrl(`${i}$export`);return n&&a.searchParams.set("_type",n),r&&a.searchParams.set("_since",r),this.startAsyncRequest(a.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 b8(this)),this.keyValueClient}getCacheEntry(t,n){if(!this.requestCache||(n==null?void 0:n.cache)==="no-cache"||(n==null?void 0: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){var n,r;t!=null&&t.id&&!((r=(n=t.meta)==null?void 0:n.tag)!=null&&r.some(o=>o.code==="SUBSETTED"))&&this.setCacheEntry(this.fhirUrl(t.resourceType,t.id).toString(),new Or(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 i=await this.fetchWithRetry(n,r);if(i.status===401)return this.handleUnauthenticated(t,n,r);if(i.status===204||i.status===304)return;const a=i.headers.get("content-type"),l=a==null?void 0:a.includes("json");if(i.status===404&&!l)throw new Be(Q$);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await Sw(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await Sw(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new Be(ft(c));return c}async parseBody(t,n){let r;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=Po(this.baseUrl,t));const r=(n==null?void 0:n.maxRetries)??2,o=200;for(let i=0;i<=r;i++){try{this.options.verbose&&this.logRequest(t,n);const a=await this.fetch(t,n);if(this.options.verbose&&this.logResponse(a),a.status<500||i===r)return a}catch(a){if(a.message==="Failed to fetch"&&i===0&&this.dispatchEvent({type:"offline"}),a.name==="AbortError"||i===r)throw a}await uw(o)}throw new Error("Unreachable")}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of Oc(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}`))}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 i=n.pollStatusPeriod??1e3;await uw(i),r.pollCount++}return this.request("GET",t,o,r)}async executeAutoBatch(){var o,i;const t=[...this.autoBatchQueue];if(this.autoBatchQueue.length=0,this.autoBatchTimerId=void 0,t.length===1){const a=t[0];try{a.resolve(await this.request(a.method,Po(this.fhirBaseUrl,a.url),a.options))}catch(l){a.reject(new Be(ft(l)))}return}const n={resourceType:"Bundle",type:"batch",entry:t.map(a=>({request:{method:a.method,url:a.url},resource:a.options.body?JSON.parse(a.options.body):void 0}))},r=await this.post(this.fhirBaseUrl,n);for(let a=0;a<t.length;a++){const l=t[a],c=(o=r.entry)==null?void 0:o[a];(i=c==null?void 0:c.response)!=null&&i.outcome&&!QP(c.response.outcome)?l.reject(new Be(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",R8,!0),t.body&&this.setRequestHeader(t,"Content-Type",rn.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 i=t.headers;o&&i[n]||(i[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 Be(Nc)))}async startPkce(){const t=pw();sessionStorage.setItem("pkceState",t);const n=pw().slice(0,128);sessionStorage.setItem("codeVerifier",n);const r=await n8(n),o=C6(r).replaceAll("+","-").replaceAll("/","_").replaceAll("=","");return sessionStorage.setItem("codeChallenge",o),{codeChallengeMethod:"S256",codeChallenge:o}}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??ww()),r.searchParams.set("code_challenge_method",n.codeChallengeMethod),r.searchParams.set("code_challenge",n.codeChallenge),r.searchParams.set("scope",n.scope??"openid profile"),window.location.assign(r.toString())}processCode(t,n){const r=new URLSearchParams;if(r.set("grant_type","authorization_code"),r.set("code",t),r.set("client_id",(n==null?void 0:n.clientId)??this.clientId),r.set("redirect_uri",(n==null?void 0:n.redirectUri)??ww()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&r.set("code_verifier",o)}return this.fetchTokens(r)}refreshIfExpired(t){return t===void 0&&(t=this.refreshGracePeriod),!this.refreshPromise&&this.accessTokenExpires!==void 0&&Date.now()>this.accessTokenExpires-t&&this.refresh(),this.refreshPromise??Promise.resolve()}refresh(){if(this.refreshPromise)return this.refreshPromise;if(this.refreshToken){const t=new URLSearchParams;return t.set("grant_type","refresh_token"),t.set("client_id",this.clientId),t.set("refresh_token",this.refreshToken),this.refreshPromise=this.fetchTokens(t),this.refreshPromise}if(this.clientId&&this.clientSecret)return this.refreshPromise=this.startClientLogin(this.clientId,this.clientSecret),this.refreshPromise}async startClientLogin(t,n){this.clientId=t,this.clientSecret=n;const r=new URLSearchParams;return r.set("grant_type","client_credentials"),r.set("client_id",t),r.set("client_secret",n),this.fetchTokens(r)}async startJwtBearerLogin(t,n,r){this.clientId=t;const o=new URLSearchParams;return o.set("grant_type","urn:ietf:params:oauth:grant-type:jwt-bearer"),o.set("client_id",t),o.set("assertion",n),o.set("scope",r),this.fetchTokens(o)}async startJwtAssertionLogin(t){const n=new URLSearchParams;return n.append("grant_type","client_credentials"),n.append("client_assertion_type","urn:ietf:params:oauth:client-assertion-type:jwt-bearer"),n.append("client_assertion",t),this.fetchTokens(n)}setBasicAuth(t,n){this.clientId=t,this.clientSecret=n,this.basicAuth=t8(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new Be(_t("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new Be(_t("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},i=(await this.post("/fhircast/STU3",mw(r),rn.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!Gx(t))throw new Be(_t("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new Be(_t("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",mw(t),rn.FORM_URL_ENCODED)}fhircastConnect(t){return new m8(t)}async fhircastPublish(t,n,r,o){return c8(n)?this.post(`/fhircast/STU3/${t}`,vw(t,n,r,o),rn.JSON):(u8(n),this.post(`/fhircast/STU3/${t}`,vw(t,n,r),rn.JSON))}async fhircastGetContext(t){return this.get(`/fhircast/STU3/${t}`)}async invite(t,n){return this.post("admin/projects/"+t+"/invite",n)}async fetchTokens(t){const n={method:"POST",headers:{"Content-Type":rn.FORM_URL_ENCODED},body:t.toString(),credentials:"include"},r=n.headers;this.basicAuth&&(r.Authorization=`Basic ${this.basicAuth}`);let o;try{o=await this.fetchWithRetry(this.tokenUrl,n)}catch(a){throw this.refreshPromise=void 0,a}if(!o.ok){this.clearActiveLogin();try{const a=await o.json();throw new Be(Oi(a.error_description))}catch(a){throw new Be(Oi("Failed to fetch tokens"),a)}}const i=await o.json();return await this.verifyTokens(i),this.getProfile()}async verifyTokens(t){const n=t.access_token;if(v8(n)){const r=Qx(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new Be(K$);if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new Be(ew)}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new Be(ew)}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}checkSessionDetailsMatchLogin(t){var n,r;return this.sessionDetails&&t?((r=(n=t.profile)==null?void 0:n.reference)==null?void 0:r.endsWith(this.sessionDetails.profile.id))??!1:!0}setupStorageListener(){try{window.addEventListener("storage",t=>{if(t.key===null)window.location.reload();else if(t.key==="activeLogin"){const n=t.oldValue?JSON.parse(t.oldValue):void 0,r=t.newValue?JSON.parse(t.newValue):void 0;(n==null?void 0:n.profile.reference)!==(r==null?void 0:r.profile.reference)||!this.checkSessionDetailsMatchLogin(r)?window.location.reload():r?this.setAccessToken(r.accessToken,r.refreshToken):this.clear()}})}catch{}}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new P8(this,R6(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 O8(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function ww(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function Sw(e,t){var o,i;const n=e.headers.get("content-location");if(n)return n;const r=e.headers.get("location");if(r)return r;if(Lh(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function jw(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function L8(e){return Rn(e)&&"data"in e&&"contentType"in e}function Cw(e,t,n,r){return L8(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function $8(e){return Rn(e)&&"docDefinition"in e}function F8(e,t,n,r){return $8(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function sl({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o,accessPolicyResource:i}){if(t===(e==null?void 0:e.path))return;o??(o=(e==null?void 0:e.debugMode)??!1),i??(i=e==null?void 0:e.accessPolicyResource);let a=z8(t,n,e,!!o);const l=Pg(t,".",2)[1];a=B8(a,i,l),a=U8(a,i,l);const c=Object.create(null);for(const[d,f]of Object.entries(a))c[t+"."+d]=f;let u;if(e&&!e.isDefaultContext)u=e.getExtendedProps;else{const d=Object.create(null);u=f=>{const h=Pg(f,".",2)[1];if(h){if(!d[h]){const m=wf(h,i==null?void 0:i.hiddenFields);d[h]={hidden:m,readonly:m||wf(h,i==null?void 0:i.readonlyFields)}}return d[h]}}}return{path:t,elements:a,elementsByPath:c,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o,getExtendedProps:u,accessPolicyResource:i}}function z8(e,t,n,r){const o=Object.create(null);if(n)for(const[a,l]of Object.entries(n.elementsByPath)){const c=Mc(e,a);c!==void 0&&(o[c]=l)}let i=!1;if(t)for(const[a,l]of Object.entries(t))a in o||(o[a]=l,i=!0);return r&&console.assert(i,"Unnecessary ElementsContext; not using any newly provided elements"),o}function B8(e,t,n){var o;if(!((o=t==null?void 0:t.hiddenFields)!=null&&o.length))return e;const r=n?n+".":"";return Object.fromEntries(Object.entries(e).filter(([i])=>!wf(r+i,t.hiddenFields)))}function U8(e,t,n){var i;if(!((i=t==null?void 0:t.readonlyFields)!=null&&i.length))return e;const r=Object.create(null),o=n?n+".":"";for(const[a,l]of Object.entries(e))wf(o+a,t.readonlyFields)?r[a]={...l,readonly:!0}:r[a]=l;return r}function wf(e,t){if(!(t!=null&&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 Dk(e){return e.type!==void 0&&e.type.length>0}function V8(e,t,n,r){var i;const o=X7(e,t.path,{profileUrl:r});if(o){const a=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>e6(l,t,n,a))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function Ik(e,t,n,r){var o,i;if(e)for(const a of t){const l={value:e,type:((o=a.typeSchema)==null?void 0:o.type)??((i=a.type)==null?void 0:i[0].code)};if(n.every(c=>{var u;return V8(l,c,a,((u=a.typeSchema)==null?void 0:u.url)??r)}))return a.name}}class W8{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=sl({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[this.elementsContextStack.length-1]}crawlElement(t,n,r){this.visitor.onEnterSchema&&this.visitor.onEnterSchema(this.rootSchema);const o=Object.fromEntries(Object.entries(this.elementsContext.elements).filter(([i])=>i.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(!$t(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=H8(t);for(const o of r)this.crawlElementNode(o,n)}crawlElementNode(t,n){var o,i;const r=n+"."+t.key;this.visitor.onEnterElement&&this.visitor.onEnterElement(r,t.element,this.elementsContext);for(const a of t.children)this.crawlElementNode(a,n);$t((i=(o=t.element)==null?void 0:o.slicing)==null?void 0:i.slices)&&this.crawlSlicingImpl(t.element.slicing,r),this.visitor.onExitElement&&this.visitor.onExitElement(r,t.element,this.elementsContext)}prepareSlices(t,n){var i,a;const r=[];for(const l of t){if(!Dk(l))continue;const c=(a=(i=l.type.find(u=>$t(u.profile)))==null?void 0:i.profile)==null?void 0:a[0];if($t(c)){const u=wl(c);u&&(l.typeSchema=u)}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 i;const a=(o==null?void 0:o.elements)??t.elements;$t(a)&&(i=sl({path:n,parentContext:this.elementsContext,elements:a})),i&&this.elementsContextStack.push(i),this.crawlElementsImpl(a,n),i&&this.elementsContextStack.pop(),this.visitor.onExitSlice&&this.visitor.onExitSlice(n,t,r),o&&this.visitor.onExitSchema&&this.visitor.onExitSchema(o)}}function H8(e){const t=[];function n(i,a){return a.startsWith(i+".")}function r(i,a){for(const l of i.children)if(n(l.key,a.key)){r(l,a);return}i.children.push(a)}const o=Object.entries(e);o.sort((i,a)=>i[0].localeCompare(a[0]));for(const[i,a]of o){const l={key:i,element:a,children:[]};let c=!1;for(const u of t)if(n(u.key,i)){r(u,l),c=!0;break}c||t.push(l)}return t}const em="__sliceName";function q8(e,t){const n=new G8(e,e.resourceType,"resource");return new W8(t,n).crawlResource(),n.getDefaultValue()}function Ew(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Sf(e,r,o,t);continue}const i=Mc(n,r);i!==void 0&&Sf(e,i,o,t)}return e}class G8{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=Kr(t),this.valueStack.splice(0,this.valueStack.length,{type:r,path:n,values:[this.rootValue]})}get schema(){return this.schemaStack[this.schemaStack.length-1]}get value(){return this.valueStack[this.valueStack.length-1]}onEnterSchema(t){this.schemaStack.push(t)}onExitSchema(){this.schemaStack.pop()}onEnterElement(t,n,r){const o=this.value.values,i=this.value.path,a=Mc(i,t);if(a===void 0)throw new Error(`Expected ${t} to be prefixed by ${i}`);const l=[];for(const c of o){if(c===void 0)continue;const u=Array.isArray(c)?c:[c];for(const d of u){Q8(d,a,n,r.elements),Sf(d,a,n,r.elements);const f=Ag(d,a,n,r.elements);f!==void 0&&l.push(f)}}this.valueStack.push({type:"element",path:t,values:l})}onExitElement(t,n,r){if(!this.valueStack.pop())throw new Error("Expected value context to exist when exiting element");const i=Mc(this.value.path,t);if(i===void 0)throw new Error(`Expected ${t} to be prefixed by ${this.value.path}`);for(const a of this.value.values){const l=Ag(a,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];$t(u)||l.splice(c,1)}qt(l)&&Ig(a,void 0,i,n)}}onEnterSlice(t,n,r){const o=this.value.values,i=[];for(const a of o){if(a===void 0)continue;if(!Array.isArray(a))throw new Error("Expected array value for sliced element");const l=this.getMatchingSliceValues(a,n,r);i.push(l)}this.valueStack.push({type:"slice",path:t,values:i})}getMatchingSliceValues(t,n,r){const o=[];for(const i of t)(i[em]??Ik(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(Ox(n.type[0].code)){const a=Object.create(null);o.push(a),t.push(a)}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];em in o&&delete o[em]}}getDefaultValue(){return this.rootValue}}function Q8(e,t,n,r){const o=Ag(e,t,n,r);n.min>0&&o===void 0&&Ox(n.type[0].code)&&(n.isArray?Ig(e,[Object.create(null)],t,n):Ig(e,Object.create(null),t,n))}function Ig(e,t,n,r){if(n.includes("."))throw new Error("key cannot be nested");let o=n;if(n.includes("[x]")){const i=r.type[0].code;o=n.replace("[x]",tn(i))}t===void 0?delete e[o]:e[o]=t}function Ag(e,t,n,r){const o=t.split(".");let i=e,a;for(let l=0;l<o.length;l++){let c=o[l];if(c.includes("[x]")){const d=r[o.slice(0,l+1).join(".")].type[0].code;c=c.replace("[x]",tn(d))}if(l===o.length-1){Array.isArray(i)?a=i.map(u=>u[c]):a=i[c];continue}if(Array.isArray(i))i=i.map(u=>u[c]);else if(Rn(i)){if(i[c]===void 0)return;i=i[c]}else return}return a}function Sf(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>Sf(l,t,n,r));e==null&&(e=Object.create(null));const o=e,i=t.split(".");let a=o;for(let l=0;l<i.length;l++){let c=i[l];if(c.includes("[x]")){const d=r[i.slice(0,l+1).join(".")].type[0].code;c=c.replace("[x]",tn(d))}if(l===i.length-1){const u=Array.isArray(a)?a:[a];for(const d of u)n.fixed?d[c]??(d[c]=n.fixed.value):n.pattern&&(d[c]=Ak(d[c],n.pattern.value))}else{if(!(c in a)){const u=i.slice(0,l+1).join(".");a[c]=r[u].isArray?[Object.create(null)]:Object.create(null)}a=a[c]}}return o}function Ak(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:Kr(t);if(Rn(t)&&(Rn(e)&&!Array.isArray(e)||e===void 0)){const n=Kr(e)??Object.create(null);for(const r of Object.keys(t))n[r]=Ak(n[r],t[r]);return n}return e}const Nk=p.createContext(void 0);function Vh(){return p.useContext(Nk)}function le(){return Vh().medplum}function Wh(){return Vh().navigate}function Hh(){return Vh().profile}const Tw=["change","storageInitialized","storageInitFailed","profileRefreshing","profileRefreshed"];function K8(e){const t=e.medplum,n=e.navigate??Y8,[r,o]=p.useState({profile:t.getProfile(),loading:t.isLoading()});p.useEffect(()=>{function a(){o(l=>({...l,profile:t.getProfile(),loading:t.isLoading()}))}for(const l of Tw)t.addEventListener(l,a);return()=>{for(const l of Tw)t.removeEventListener(l,a)}},[t]);const i=p.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(Nk.Provider,{value:i,children:e.children})}function Y8(e){window.location.assign(e)}const Pw=new Map,Mk=e=>p.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=Pw.get(t);if(o){const a=new URLSearchParams(new URL(o).search).get("Expires");if(a&&parseInt(a,10)*1e3-5e3>Date.now())return o}return Pw.set(t,e),e},[e]);function St(e,t){const n=le(),[r,o]=p.useState(()=>kw(n,e)),i=p.useCallback(a=>{Ui(a,r)||o(a)},[r]);return p.useEffect(()=>{let a=!0;const l=kw(n,e);return!l&&Xs(e)?n.readReference(e).then(c=>{a&&i(c)}).catch(c=>{a&&(i(void 0),t&&t(ft(c)))}):i(l),()=>a=!1},[n,e,i,t]),r}function kw(e,t){if(t){if(ri(t))return t;if(Xs(t))return e.getCachedReference(t)}}function X8(e,t){return Ok("searchOne",e,t)}function al(e,t){return Ok("searchResources",e,t)}function Ok(e,t,n){const r=le(),[o,i]=p.useState(),[a,l]=p.useState(!0),[c,u]=p.useState(),[d,f]=p.useState();return p.useEffect(()=>{const h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(m=>{l(!1),u(m),f(G$)}).catch(m=>{l(!1),u(void 0),f(ft(m))}))},[r,e,t,n,o]),[c,a,d]}function J8(e){const t=e.value;return t?s.jsx(s.Fragment,{children:I6(t)}):null}const Lk=["meta","implicitRules","contained","extension","modifierExtension"],$k=["language","text"],wt=p.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});wt.displayName="ElementsContext";const Kx=["extension","modifierExtension"],Z8=["id",...Lk].filter(e=>!Kx.includes(e));function ez(e){return Object.entries(e).filter(([n,r])=>{var o;return!$t(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||Kx.includes(n)&&!$t((o=r.slicing)==null?void 0:o.slices)||Z8.includes(n)?!1:!($k.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function Rw(e,t){return e.line&&e.line.length>t?e.line[t]:""}function _w(e,t,n){const r=e.line||[];for(;r.length<=t;)r.push("");return r[t]=n,{...e,line:r}}function tz(e){const[t,n]=p.useState(e.defaultValue||{}),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(wt),[i,a,l,c,u,d,f]=p.useMemo(()=>["use","type","line1","line2","city","state","postalCode"].map(x=>o(e.path+"."+x)),[o,e.path]);function h(x){n(x),e.onChange&&e.onChange(x)}function m(x){h({...r.current,use:x})}function g(x){h({...r.current,type:x})}function v(x){h(_w(r.current||{},0,x))}function S(x){h(_w(r.current||{},1,x))}function b(x){h({...r.current,city:x})}function w(x){h({...r.current,state:x})}function y(x){h({...r.current,postalCode:x})}return s.jsxs(te,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(It,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":"address-use",defaultValue:t.use,onChange:x=>m(x.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(It,{disabled:e.disabled||(a==null?void 0:a.readonly),"data-testid":"address-type",defaultValue:t.type,onChange:x=>g(x.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(ye,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Line 1",defaultValue:Rw(t,0),onChange:x=>v(x.currentTarget.value)}),s.jsx(ye,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Line 2",defaultValue:Rw(t,1),onChange:x=>S(x.currentTarget.value)}),s.jsx(ye,{disabled:e.disabled||(u==null?void 0:u.readonly),placeholder:"City",defaultValue:t.city,onChange:x=>b(x.currentTarget.value)}),s.jsx(ye,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"State",defaultValue:t.state,onChange:x=>w(x.currentTarget.value)}),s.jsx(ye,{disabled:e.disabled||(f==null?void 0:f.readonly),placeholder:"Postal Code",defaultValue:t.postalCode,onChange:x=>y(x.currentTarget.value)})]})}function nz(e){const t=Hh(),[n,r]=p.useState(e.defaultValue||{});function o(i){const a=i?{text:i,authorReference:t&&Tt(t),time:new Date().toISOString()}:{};r(a),e.onChange&&e.onChange(a)}return s.jsx(ye,{disabled:e.disabled,name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
142
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var rz={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"}};/**
|
|
147
|
-
* @license @tabler/icons-react v3.17.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 we=(e,t,n,r)=>{const o=p.forwardRef(({color:i="currentColor",size:a=24,stroke:l=2,title:c,className:u,children:d,...f},h)=>p.createElement("svg",{ref:h,...rz[e],width:a,height:a,className:["tabler-icon",`tabler-icon-${t}`,u].join(" "),...e==="filled"?{fill:i}:{strokeWidth:l,stroke:i},...f},[c&&p.createElement("title",{key:"svg-title"},c),...r.map(([m,g])=>p.createElement(m,g)),...Array.isArray(d)?d:[d]]));return o.displayName=`${n}`,o};/**
|
|
152
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var oz=we("outline","adjustments-horizontal","IconAdjustmentsHorizontal",[["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"}]]);/**
|
|
157
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var El=we("outline","alert-circle","IconAlertCircle",[["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"}]]);/**
|
|
162
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var iz=we("outline","arrow-down","IconArrowDown",[["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"}]]);/**
|
|
167
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var sz=we("outline","arrow-up","IconArrowUp",[["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"}]]);/**
|
|
172
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var az=we("outline","bleach-off","IconBleachOff",[["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"}]]);/**
|
|
177
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var lz=we("outline","bleach","IconBleach",[["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"}]]);/**
|
|
182
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var cz=we("outline","box-multiple","IconBoxMultiple",[["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"}]]);/**
|
|
187
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var uz=we("outline","brackets-contain","IconBracketsContain",[["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"}]]);/**
|
|
192
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var dz=we("outline","brand-asana","IconBrandAsana",[["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"}]]);/**
|
|
197
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var fz=we("outline","bucket-off","IconBucketOff",[["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"}]]);/**
|
|
202
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var hz=we("outline","bucket","IconBucket",[["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"}]]);/**
|
|
207
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var pz=we("outline","building","IconBuilding",[["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"}]]);/**
|
|
212
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var os=we("outline","calendar","IconCalendar",[["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"}]]);/**
|
|
217
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Js=we("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
222
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var mz=we("outline","checkbox","IconCheckbox",[["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"}]]);/**
|
|
227
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Yx=we("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
232
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var jf=we("outline","circle-minus","IconCircleMinus",[["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"}]]);/**
|
|
237
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Cf=we("outline","circle-plus","IconCirclePlus",[["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"}]]);/**
|
|
242
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Xx=we("outline","cloud-upload","IconCloudUpload",[["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"}]]);/**
|
|
247
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var gz=we("outline","columns","IconColumns",[["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"}]]);/**
|
|
252
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Fk=we("outline","copy","IconCopy",[["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"}]]);/**
|
|
257
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var vz=we("outline","currency-dollar","IconCurrencyDollar",[["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"}]]);/**
|
|
262
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var yz=we("outline","device-floppy","IconDeviceFloppy",[["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"}]]);/**
|
|
267
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var xz=we("outline","dots","IconDots",[["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"}]]);/**
|
|
272
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var zk=we("outline","edit","IconEdit",[["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"}]]);/**
|
|
277
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var mu=we("outline","equal-not","IconEqualNot",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}],["path",{d:"M5 19l14 -14",key:"svg-2"}]]);/**
|
|
282
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var gu=we("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
287
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Dw=we("outline","file-alert","IconFileAlert",[["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"}]]);/**
|
|
292
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var bz=we("outline","file-plus","IconFilePlus",[["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"}]]);/**
|
|
297
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var wz=we("outline","filter","IconFilter",[["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"}]]);/**
|
|
302
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Sz=we("outline","forms","IconForms",[["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"}]]);/**
|
|
307
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var jz=we("outline","id","IconId",[["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"}]]);/**
|
|
312
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Iw=we("outline","list-details","IconListDetails",[["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"}]]);/**
|
|
317
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Cz=we("outline","lock-access","IconLockAccess",[["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"}]]);/**
|
|
322
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Ez=we("outline","lock","IconLock",[["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"}]]);/**
|
|
327
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Tz=we("outline","logout","IconLogout",[["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"}]]);/**
|
|
332
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Bk=we("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
337
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Uk=we("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
342
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Pz=we("outline","message","IconMessage",[["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"}]]);/**
|
|
347
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var kz=we("outline","microscope","IconMicroscope",[["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"}]]);/**
|
|
352
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Rz=we("outline","packages","IconPackages",[["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"}]]);/**
|
|
357
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var _z=we("outline","pin","IconPin",[["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"}]]);/**
|
|
362
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Dz=we("outline","pinned-off","IconPinnedOff",[["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"}]]);/**
|
|
367
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Iz=we("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
372
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Az=we("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
|
|
377
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Nz=we("outline","receipt","IconReceipt",[["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"}]]);/**
|
|
382
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Mz=we("outline","refresh","IconRefresh",[["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"}]]);/**
|
|
387
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Oz=we("outline","repeat","IconRepeat",[["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"}]]);/**
|
|
392
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Lz=we("outline","report-medical","IconReportMedical",[["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"}]]);/**
|
|
397
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var $z=we("outline","router","IconRouter",[["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"}]]);/**
|
|
402
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Fz=we("outline","search","IconSearch",[["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"}]]);/**
|
|
407
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Ng=we("outline","settings","IconSettings",[["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"}]]);/**
|
|
412
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Jx=we("outline","sort-ascending","IconSortAscending",[["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"}]]);/**
|
|
417
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Zx=we("outline","sort-descending","IconSortDescending",[["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"}]]);/**
|
|
422
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var zz=we("outline","square","IconSquare",[["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"}]]);/**
|
|
427
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Bz=we("outline","star","IconStar",[["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"}]]);/**
|
|
432
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Uz=we("outline","switch-horizontal","IconSwitchHorizontal",[["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"}]]);/**
|
|
437
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Vz=we("outline","table-export","IconTableExport",[["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"}]]);/**
|
|
442
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Wz=we("outline","text-recognition","IconTextRecognition",[["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"}]]);/**
|
|
447
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var e0=we("outline","trash","IconTrash",[["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"}]]);/**
|
|
452
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Aw=we("outline","upload","IconUpload",[["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"}]]);/**
|
|
457
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Hz=we("outline","webhook","IconWebhook",[["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"}]]);/**
|
|
462
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var Ef=we("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
467
|
-
* @license @tabler/icons-react v3.17.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
|
-
*/var qz=we("filled","circle-filled","IconCircleFilled",[["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"}]]);class Vk extends p.Component{constructor(t){super(t),this.state={lastLocation:window.location.toString()}}static getDerivedStateFromError(t){return{error:t,lastLocation:window.location.toString()}}componentDidUpdate(t,n){window.location.toString()!==this.state.lastLocation&&this.setState({lastLocation:window.location.toString(),error:void 0})}shouldComponentUpdate(t,n){return!!(this.props.children!==t.children||n.error&&!this.state.error||this.state.lastLocation!==window.location.toString())}componentDidCatch(t,n){console.error("Uncaught error:",t,n)}render(){return this.state.error?s.jsx(Yi,{icon:s.jsx(El,{size:16}),title:"Something went wrong",color:"red",children:Ae(this.state.error)}):this.props.children}}function Yr(){return s.jsx(vn,{style:{width:"100%",height:"100vh"},children:s.jsx(er,{})})}const Gz="_main_g2hyx_1",Qz={main:Gz};function xt(e){e.preventDefault(),e.stopPropagation()}function Wk(e){if(Nw(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&Nw(t[0]))return!0}return!1}function Nw(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function We(e){const t=Wh(),{to:n,suffix:r,label:o,onClick:i,children:a,...l}=e;let c=Kz(n);return r&&(c+="/"+r),s.jsx(Ke,{href:c,"aria-label":o,onClick:u=>{xt(u),i?i(u):n&&t(c)},...l,children:a})}function Kz(e){if(e){if(typeof e=="string")return Yz(e);if(ri(e))return Xz(e);if(Xs(e))return Jz(e)}return"#"}function Yz(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function Xz(e){return`/${e.resourceType}/${e.id}`}function Jz(e){return`/${e.reference}`}function Zz(e){const t=e.split(" ").filter(Boolean);return t.length>1?t[0][0]+t[t.length-1][0]:t.length===1?t[0][0]:""}function Ji(e){const t=St(e.value),n=t?qo(t):e.alt??"",r=Zz(n),o=(t&&f6(t))??e.src,i=Mk(o??void 0),a=e.radius??"xl",l={...e,value:void 0,link:void 0};return e.link?s.jsx(We,{to:t,children:s.jsx(Rs,{src:i,alt:n,radius:a,...l,children:r})}):s.jsx(Rs,{src:i,alt:n,radius:a,...l,children:r})}const eB="_logoButton_189g3_1",tB="_user_189g3_11",nB="_userName_189g3_21",rB="_userActive_189g3_31",dd={logoButton:eB,user:tB,userName:nB,userActive:rB};function t0(e){const t=e.value;return t?s.jsx(s.Fragment,{children:pu(t,e.options)}):null}function oB(e){var c,u,d;const t=Vh(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:a,setColorScheme:l}=fI();return s.jsxs(s.Fragment,{children:[s.jsxs($e,{align:"center",p:"xl",children:[s.jsx(Ji,{size:"xl",radius:100,value:t.profile}),s.jsx(t0,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),s.jsx(me,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&s.jsx(Z.Divider,{}),i.map(f=>f.profile.reference!==rt(t.profile)&&s.jsx(Z.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(te,{children:[s.jsx(Rs,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(me,{size:"sm",fw:500,children:f.profile.display}),s.jsx(me,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),s.jsx(Z.Divider,{}),s.jsx(te,{justify:"center",children:s.jsx(yx,{size:"xs",value:a,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(Uz,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(Z.Item,{leftSection:s.jsx(Ng,{size:14,stroke:1.5}),onClick:()=>o(`/${rt(r)}`),children:"Account settings"}),s.jsx(Z.Item,{leftSection:s.jsx(Tz,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),s.jsx(me,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}const Mw={selectedItems:"selected-items",options:"options"};function n0(e){const t=ou({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:a,toOption:l,loadOptions:c,itemComponent:u,pillComponent:d,emptyComponent:f,onChange:h,onCreate:m,creatable:g,clearable:v,required:S,placeholder:b,leftSection:w,maxValues:y,optionsDropdownMaxHeight:x=320,minInputLength:C=0,...E}=e,T=E.disabled,j=iB(a),[R,k]=p.useState(""),[I,O]=p.useState(),[F,L]=p.useState(),[B,D]=p.useState(),[_,P]=p.useState(j.map(l)),[N,$]=p.useState([]),H=u??sB,X=d??aB,ce=f??lB,Ie=p.useRef();Ie.current=R;const ue=p.useRef(),xe=p.useRef(),_e=p.useRef();_e.current=I;const de=p.useRef();de.current=F;const Oe=p.useRef();Oe.current=B;const Ye=p.useRef();Ye.current=N;const jt=p.useCallback(()=>{var fe;if(O(void 0),Ie.current===xe.current&&c===ue.current||(((fe=Ie.current)==null?void 0:fe.length)??0)<C)return;xe.current=Ie.current,ue.current=c;const Q=new AbortController;L(Q),c(Ie.current??"",Q.signal).then(Pe=>{Q.signal.aborted||($(Pe.map(l)),Oe.current?(Pe.length>0&&h(Pe.slice(0,1)),D(!1)):Pe.length>0&&t.openDropdown())}).catch(Pe=>{Q.signal.aborted||Pe.message.includes("aborted")||ge({color:"red",message:Ae(Pe)})}).finally(()=>{Q.signal.aborted||L(void 0)})},[t,c,h,l,C]),mt=p.useCallback(Q=>{(N&&N.length>0||g)&&t.openDropdown(),t.updateSelectedOptionIndex(),k(Q.currentTarget.value),de.current&&(de.current.abort(),L(void 0)),_e.current!==void 0&&window.clearTimeout(_e.current);const fe=window.setTimeout(()=>jt(),100);O(fe)},[t,N,g,jt]),at=p.useCallback(Q=>{const fe=_.some(ie=>ie.value===Q),Pe=fe?_.filter(ie=>ie.value!==Q):[..._];let J=N==null?void 0:N.find(ie=>ie.value===Q);if(!J&&g!==!1&&m){const ie=m(Q);J=l(ie)}if(J){if(y===0){h([J.resource]),_.length>0&&P([]);return}fe||Pe.push(J)}if(y!==void 0)for(;Pe.length>y;)Pe.shift();h(Pe.map(ie=>ie.resource)),P(Pe)},[g,N,_,y,h,m,l]),Re=p.useMemo(()=>{if(!T)return Q=>{T||(y===1&&(k(""),$([]),t.closeDropdown()),xe.current=void 0,at(Q==="$create"?R:Q))}},[at,t,T,y,R]),et=p.useCallback(Q=>{const fe=_.filter(Pe=>Pe.value!==Q.value);h(fe.map(Pe=>Pe.resource)),P(fe)},[_,h]),ht=p.useCallback(Q=>{Q.key==="Enter"?(I||F)&&D(!0):Q.key==="Backspace"&&R.length===0&&(xt(Q),et(_[_.length-1]))},[F,et,R.length,_,I]);p.useEffect(()=>()=>{de.current&&de.current.abort()},[]);const oe=!T&&v&&_.length>0&&s.jsx(Le.ClearButton,{title:"Clear all",size:16,onClear:()=>{k(""),P([]),h([]),t.closeDropdown()}});return s.jsxs(Le,{store:t,onOptionSubmit:Re,withinPortal:!0,shadow:"xl",...E,children:[s.jsx(Le.DropdownTarget,{children:s.jsx(rl,{label:r,description:o,error:i,className:e.className,leftSection:w,rightSection:F?s.jsx(er,{size:16}):oe,required:S,disabled:T,children:s.jsxs(_s.Group,{"data-testid":Mw.selectedItems,children:[_.map(Q=>s.jsx(X,{item:Q,disabled:T,onRemove:()=>et(Q)},Q.value)),!T&&(y===void 0||y===0||_.length<y)&&s.jsx(Le.EventsTarget,{children:s.jsx(rl.Field,{role:"searchbox",name:n,value:R,placeholder:b,onFocus:mt,onBlur:()=>{t.closeDropdown(),k("")},onKeyDown:ht,onChange:mt})})]})})}),s.jsx(Le.Dropdown,{hidden:N.length===0,"data-testid":Mw.options,children:s.jsx(Le.Options,{children:s.jsxs(sh,{type:"scroll",mah:x,children:[N.map(Q=>{const fe=_.some(Pe=>Pe.value===Q.value);return s.jsx(Le.Option,{value:Q.value,active:fe,children:s.jsx(H,{...Q,active:fe})},Q.value)}),g&&R.trim().length>0&&s.jsxs(Le.Option,{value:"$create",children:["+ Create ",R]}),!g&&R.trim().length>0&&N.length===0&&s.jsx(ce,{search:R})]})})})]})}function iB(e){return e?Array.isArray(e)?e:[e]:[]}function sB(e){return s.jsxs(te,{gap:"xs",children:[e.active&&s.jsx(Js,{size:12}),s.jsx("span",{children:e.label})]})}function aB({item:e,disabled:t,onRemove:n}){return s.jsx(_s,{withRemoveButton:!t,onRemove:n,children:e.label})}function lB(){return s.jsx(Le.Empty,{children:"Nothing found"})}const cB="_searchInput_dick8_1",uB={searchInput:cB};function dB(e){return{value:e.id,label:qo(e),resource:e}}function fB(e){const t=Wh(),n=le(),r=p.useCallback(async(i,a)=>{const l=pB(i),c={signal:a},u=await n.graphql(l,void 0,void 0,c);return mB(u,i)},[n]),o=p.useCallback(i=>{i.length>0&&t(`/${rt(i[0])}`)},[t]);return s.jsx(n0,{size:"sm",radius:"md",className:uB.searchInput,leftSection:s.jsx(Fz,{size:16}),placeholder:"Search",itemComponent:hB,toOption:dB,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const hB=p.forwardRef(({resource:e,active:t,...n},r)=>{var i;let o;return e.resourceType==="Patient"?o=e.birthDate:e.resourceType==="ServiceRequest"&&(o=(i=e.subject)==null?void 0:i.display),s.jsx("div",{ref:r,...n,children:s.jsxs(te,{wrap:"nowrap",children:[s.jsx(Ji,{value:e}),s.jsxs("div",{children:[s.jsx(me,{children:qo(e)}),s.jsx(me,{size:"xs",c:"dimmed",children:o})]})]})})});function pB(e){const t=JSON.stringify(e);return lk(e)?`{
|
|
472
|
-
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
473
|
-
resourceType
|
|
474
|
-
id
|
|
475
|
-
identifier {
|
|
476
|
-
system
|
|
477
|
-
value
|
|
478
|
-
}
|
|
479
|
-
name {
|
|
480
|
-
given
|
|
481
|
-
family
|
|
482
|
-
}
|
|
483
|
-
birthDate
|
|
484
|
-
}
|
|
485
|
-
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
486
|
-
resourceType
|
|
487
|
-
id
|
|
488
|
-
identifier {
|
|
489
|
-
system
|
|
490
|
-
value
|
|
491
|
-
}
|
|
492
|
-
subject {
|
|
493
|
-
display
|
|
494
|
-
}
|
|
495
|
-
}
|
|
496
|
-
}`.replace(/\s+/g," "):`{
|
|
497
|
-
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
498
|
-
resourceType
|
|
499
|
-
id
|
|
500
|
-
identifier {
|
|
501
|
-
system
|
|
502
|
-
value
|
|
503
|
-
}
|
|
504
|
-
name {
|
|
505
|
-
given
|
|
506
|
-
family
|
|
507
|
-
}
|
|
508
|
-
birthDate
|
|
509
|
-
}
|
|
510
|
-
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
511
|
-
resourceType
|
|
512
|
-
id
|
|
513
|
-
identifier {
|
|
514
|
-
system
|
|
515
|
-
value
|
|
516
|
-
}
|
|
517
|
-
name {
|
|
518
|
-
given
|
|
519
|
-
family
|
|
520
|
-
}
|
|
521
|
-
birthDate
|
|
522
|
-
}
|
|
523
|
-
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
524
|
-
resourceType
|
|
525
|
-
id
|
|
526
|
-
identifier {
|
|
527
|
-
system
|
|
528
|
-
value
|
|
529
|
-
}
|
|
530
|
-
subject {
|
|
531
|
-
display
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
}`.replace(/\s+/g," ")}function mB(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),vB(gB(n),t).slice(0,5)}function gB(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 vB(e,t){return e.sort((n,r)=>Ow(r,t)-Ow(n,t))}function Ow(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,Lw(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,Lw(pu(r),t));return n}function Lw(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function yB(e){var o;const t=Hh(),[n,r]=p.useState(!1);return s.jsx(Zn.Header,{p:8,style:{zIndex:101},children:s.jsxs(te,{justify:"space-between",children:[s.jsxs(te,{gap:"xs",children:[s.jsx(Sn,{className:dd.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(fB,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(te,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(Z,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(Z.Target,{children:s.jsx(Sn,{className:tt(dd.user,{[dd.userActive]:n}),onClick:()=>r(i=>!i),children:s.jsxs(te,{gap:7,children:[s.jsx(Ji,{value:t,radius:"xl",size:24}),s.jsx(me,{size:"sm",className:dd.userName,children:pu((o=t==null?void 0:t.name)==null?void 0:o[0])}),s.jsx(Yx,{size:12,stroke:1.5})]})})}),s.jsx(Z.Dropdown,{children:s.jsx(oB,{version:e.version})})]})]})]})})}function xB(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?bB(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&wB(t,n);return t}function bB(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function wB(e,t){e[t.name]=t.value}function qe(e){return s.jsx("form",{style:e.style,"data-testid":e.testid,onSubmit:t=>{t.preventDefault();const n=xB(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function SB(e){const t=le(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=Kr(n),u=(d=c.menu)==null?void 0:d.find(({title:h})=>h===i);(f=u==null?void 0:u.link)==null||f.push({name:a,target:l}),t.updateResource(c).then(h=>{n.menu=h.menu,t.dispatchEvent({type:"change"}),ge({color:"green",message:"Success"}),e.onOk()}).catch(h=>{ge({color:"red",message:Ae(h)})})}return s.jsx(jn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(qe,{onSubmit:r,children:s.jsxs($e,{children:[s.jsx(jB,{config:n}),s.jsx(ye,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{mt:"sm",type:"submit",children:"OK"})})]})})})}function jB(e){function t(r){var o;return(o=r==null?void 0:r.menu)==null?void 0:o.map(i=>i.title)}const n=t(e.config);return s.jsx(It,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function Hk(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function CB(e){return typeof e.display=="string"?e.display:Hk(e)}function EB(e){return{value:Hk(e),label:CB(e),resource:e}}function TB(e){return{code:e,display:e}}function r0(e){const t=le(),{binding:n,creatable:r,clearable:o,expandParams:i,withHelpText:a,...l}=e,c=p.useCallback(async(u,d)=>{var g;if(!n)return[];const h=(g=(await t.valueSetExpand({...i,url:n,filter:u},{signal:d})).expansion)==null?void 0:g.contains,m=[];for(const v of h)v.code&&!m.some(S=>S.code===v.code)&&m.push(v);return m},[t,i,n]);return s.jsx(n0,{...l,creatable:r??!0,clearable:o??!0,toOption:EB,loadOptions:c,onCreate:TB,itemComponent:a?PB:void 0})}const PB=p.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(te,{wrap:"nowrap",gap:"xs",children:[n&&s.jsx(Js,{size:12}),s.jsxs("div",{children:[s.jsx(me,{children:e}),s.jsx(me,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})]})}));function qk(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=RB(u);a(d),n&&n(d)}return s.jsx(r0,{defaultValue:kB(i),onChange:l,withHelpText:r??!0,...o})}function kB(e){return e?{code:e}:void 0}function RB(e){return e==null?void 0:e.code}function o0(e){const[t,n]=p.useState(e.defaultValue),r=e.onChange,o=p.useCallback(i=>{n(i),r&&r(i)},[r]);return s.jsx(qk,{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 _B="_menuTitle_9g6l5_1",DB="_link_9g6l5_9",IB="_linkActive_9g6l5_38",Mg={menuTitle:_B,link:DB,linkActive:IB};function AB(e){var l;const t=Wh(),n=OB(e.pathname,e.searchParams,e.menus),[r,o]=p.useState(!1);function i(c,u){c.stopPropagation(),c.preventDefault(),t(u),window.innerWidth<768&&e.closeNavbar()}function a(c){c&&t(`/${c}`)}return s.jsxs(s.Fragment,{children:[s.jsx(Zn.Navbar,{children:s.jsxs(_r,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Zn.Section,{mb:"sm",children:s.jsx(o0,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>a(c)},window.location.pathname)}),s.jsxs(Zn.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return s.jsxs(p.Fragment,{children:[s.jsx(me,{className:Mg.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>s.jsxs(NB,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[s.jsx(MB,{to:d.href,icon:d.icon}),s.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&s.jsx(ae,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(Az,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(SB,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function NB(e){return s.jsx(We,{onClick:e.onClick,to:e.to,className:tt(Mg.link,{[Mg.linkActive]:e.active}),children:e.children})}function MB(e){return e.icon?e.icon:s.jsx(Oh,{w:30})}function OB(e,t,n){if(!e||!t||!n)return;let r,o=0;for(const i of n)if(i.links)for(const a of i.links){const l=LB(e,t,a.href);l>o&&(o=l,r=a)}return r}function LB(e,t,n){const r=new URL(n,"https://example.com");if(e!==r.pathname)return 0;const o=["_count","_offset"];for(const[a,l]of r.searchParams.entries())if(!o.includes(a)&&t.get(a)!==l)return 0;let i=1;for(const[a,l]of t.entries())o.includes(a)||r.searchParams.get(a)===l&&i++;return i}function $B(e){const[t,n]=p.useState(localStorage.navbarOpen==="true"),r=le(),o=Hh();p.useEffect(()=>{function c(){ge({color:"red",message:"No connection to server",autoClose:!1})}return r.addEventListener("offline",c),()=>r.removeEventListener("offline",c)},[r]);function i(c){localStorage.navbarOpen=c.toString(),n(c)}function a(){i(!1)}function l(){i(!t)}return r.isLoading()?s.jsx(Yr,{}):s.jsxs(Zn,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&s.jsx(yB,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?s.jsx(AB,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:a,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Zn.Main,{className:Qz.main,children:s.jsx(Vk,{children:s.jsx(p.Suspense,{fallback:s.jsx(Yr,{}),children:e.children})})})]})}function vu(e){const{contentType:t,url:n,title:r}=e.value??{},o=Mk(n);return o?s.jsxs("div",{"data-testid":"attachment-display",children:[(t==null?void 0:t.startsWith("image/"))&&s.jsx("img",{"data-testid":"attachment-image",style:{maxWidth:e.maxWidth},src:o,alt:r}),(t==null?void 0:t.startsWith("video/"))&&s.jsx("video",{"data-testid":"attachment-video",style:{maxWidth:e.maxWidth},controls:!0,children:s.jsx("source",{type:t,src:o})}),((t==null?void 0:t.startsWith("text/"))||t==="application/json"||t==="application/pdf")&&s.jsx("div",{"data-testid":"attachment-iframe",style:{maxWidth:e.maxWidth,minHeight:400},children:s.jsx("iframe",{width:"100%",height:"400",src:o+"#navpanes=0",allowFullScreen:!0,frameBorder:0,seamless:!0})}),s.jsx("div",{"data-testid":"download-link",style:{padding:"2px 16px 16px 16px"},children:s.jsx(Ke,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:FB(r),children:r||"Download"})})]}):null}function FB(e){return e!=null&&e.includes(".")?e:void 0}const zB="_root_17n8t_1",BB="_compact_17n8t_25",$w={root:zB,compact:BB};function i0(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:tt($w.root,{[$w.compact]:n}),children:t})}function Oo(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function UB(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>s.jsx("div",{children:s.jsx(vu,{value:o,maxWidth:e.maxWidth})},"attatchment-"+i));let n;if(e.includeDescriptionListEntry){if(e.property===void 0)throw new Error("props.property is required when includeDescriptionListEntry is true");if(!$t(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=s.jsx(Oo,{term:Is(o),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function s0(e){const t=le(),n=p.useRef(null);function r(a){var l;xt(a),(l=n.current)==null||l.click()}function o(a){xt(a);const l=a.target.files;l&&Array.from(l).forEach(i)}function i(a){!a||!a.name||(e.onUploadStart&&e.onUploadStart(),t.createAttachment({data:a,contentType:a.type||"application/octet-stream",filename:a.name,securityContext:e.securityContext,onProgress:e.onUploadProgress}).then(c=>e.onUpload(c)).catch(c=>{e.onUploadError&&e.onUploadError(ft(c))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{disabled:e.disabled,type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:a=>o(a)}),e.children({onClick:r,disabled:e.disabled})]})}function VB(e){const[t,n]=p.useState(e.defaultValue??[]),r=p.useRef();r.current=t;function o(i){n(i),e.onChange&&e.onChange(i)}return s.jsxs("table",{style:{width:"100%"},children:[s.jsxs("colgroup",{children:[s.jsx("col",{width:"97%"}),s.jsx("col",{width:"3%"})]}),s.jsxs("tbody",{children:[t.map((i,a)=>s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(vu,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(en,{disabled:e.disabled,title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{xt(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(jf,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(s0,{disabled:e.disabled,onUpload:i=>{o([...r.current,i])},children:i=>s.jsx(en,{...i,title:"Add",variant:"subtle",size:"sm",color:i.disabled?"gray":"green",children:s.jsx(Xx,{})})})})]})]})]})}function Gk(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return t?s.jsxs(s.Fragment,{children:[s.jsx(vu,{value:t,maxWidth:200}),s.jsx(ae,{disabled:e.disabled,onClick:o=>{xt(o),r(void 0)},children:"Remove"})]}):s.jsx(s0,{disabled:e.disabled,securityContext:e.securityContext,onUpload:r,children:o=>s.jsx(ae,{...o,children:"Upload..."})})}function mo(e){return s.jsx(s.Fragment,{children:Vi(e.value)})}function WB(e){return s.jsx(s.Fragment,{children:Ks(e.value)})}function Qk(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("]")),s.jsx(s.Fragment,{children:n.join("").trim()})}function HB(e){var n;const t=e.value;return t?s.jsxs(s.Fragment,{children:[t.name,t.name&&": ",(n=t.telecom)==null?void 0:n.map(r=>s.jsx(Qk,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function qB(e){var t,n;return s.jsxs("div",{children:[(t=e.value)==null?void 0:t.system,": ",(n=e.value)==null?void 0:n.value]})}function GB(e){return s.jsx(s.Fragment,{children:F6(e.value)})}function zc(e){return s.jsx(s.Fragment,{children:yi(e.value)})}function a0(e){return s.jsx(s.Fragment,{children:Lc(e.value)})}function QB(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(zc,{value:t.numerator})," / ",s.jsx(zc,{value:t.denominator})]}):null}function Tf(e){if(!e.value)return null;const t=e.value.display||e.value.reference||hr(e.value);return e.link!==!1&&e.value.reference?s.jsx(We,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}function Kk(e,t,n,r){if(!$t(n==null?void 0:n.slices))return[e];const o=new Array(t.length+1);for(let i=0;i<o.length;i++)o[i]=[];for(const i of e){const a=Ik(i,t,n.discriminator,r);let l=a?t.findIndex(c=>c.name===a):-1;l===-1&&(l=t.length),o[l].push(i)}return o}async function Yk({medplum:e,property:t}){return new Promise((n,r)=>{var l,c;if(!t.slicing){n([]);return}const o=[],i=[],a=[];for(const u of t.slicing.slices){if(!Dk(u)){console.debug("Unsupported slice definition",u);continue}let d;$t(u.elements)||(d=(c=(l=u.type[0])==null?void 0:l.profile)==null?void 0:c[0]),o.push(u),i.push(d),d&&a.push(e.requestProfileSchema(d))}Promise.all(a).then(()=>{for(let u=0;u<o.length;u++){const d=o[u],f=i[u];if(f){const h=wl(f);d.typeSchema=h}}n(o)}).catch(r)})}function qh(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function KB(e){var a,l;const{slice:t,property:n}=e,r=((a=t.typeSchema)==null?void 0:a.elements)??t.elements,o=p.useContext(wt),i=p.useMemo(()=>{var c;if($t(r))return sl({parentContext:o,elements:r,path:e.path,profileUrl:(c=t.typeSchema)==null?void 0:c.url})},[o,e.path,(l=t.typeSchema)==null?void 0:l.url,r]);return qh(wt.Provider,i,s.jsx(s.Fragment,{children:e.value.map((c,u)=>s.jsx("div",{children:s.jsx(Xr,{property:n,path:e.path,arrayElement:!0,elementDefinitionType:t.type[0],propertyType:t.type[0].code,value:c,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${u}-${e.value.length}`))}))}function YB(e){var g;const{property:t,propertyType:n}=e,r=le(),o=p.useMemo(()=>Array.isArray(e.values)?e.values:[],[e.values]),[i,a]=p.useState(!0),[l,c]=p.useState([]),[u,d]=p.useState(()=>[o]),f=p.useContext(wt);if(p.useEffect(()=>{Yk({medplum:r,property:t}).then(v=>{c(v);const S=Kk(o,v,t.slicing,f.profileUrl);d(S),a(!1)}).catch(v=>{console.error(v),a(!1)})},[r,t,f.profileUrl,d,o]),i)return s.jsx("div",{children:"Loading..."});let h;if(((g=t.type[0])==null?void 0:g.code)!=="Extension"){const v=u[l.length],S=v.map((b,w)=>s.jsx("div",{children:s.jsx(Xr,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:b,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${w}-${v.length}`));if(e.includeDescriptionListEntry){if(!$t(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const b=e.path.split(".").pop();h=s.jsx(Oo,{term:Is(b),children:S})}else h=s.jsx(s.Fragment,{children:S})}return s.jsxs(s.Fragment,{children:[l.map((v,S)=>{if(!e.path)throw Error(`Displaying a resource property with slices of type ${e.propertyType} requires path`);let b=s.jsx(KB,{path:e.path,slice:v,property:t,value:u[S],ignoreMissingValues:e.ignoreMissingValues,link:e.link},v.name);return e.includeDescriptionListEntry&&(b=s.jsx(Oo,{term:Is(v.name),children:b},v.name)),b}),h]})}function yu(e,t,n){const r=xn(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 XB(e,t,n){const r=nk(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function JB(e){const{elementDefinitionType:t}=e,n=le(),r=p.useContext(wt),[o,i]=p.useState(ek("Extension")),a=p.useMemo(()=>{if($t(t==null?void 0:t.profile))return t.profile[0]},[t]),[l,c]=p.useState(a!==void 0);if(p.useEffect(()=>{a&&(c(!0),n.requestProfileSchema(a).then(()=>{const f=wl(a);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,a]),a&&(l||!Ix(a)))return s.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=yu({type:"Extension",value:e.value},"value[x]",a??r.profileUrl);return s.jsx(Xr,{propertyType:h,value:f})}return s.jsx(Pf,{path:e.path,value:{type:o.type,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:a})}function Xr(e){var i;const{property:t,propertyType:n,value:r}=e;if((i=t==null?void 0:t.path)==null?void 0:i.endsWith(".id"))return s.jsxs(q,{component:"div",style:{display:"flex",gap:3,alignItems:"center"},children:[r,!qt(r)&&s.jsx(ZT,{value:r,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(qs,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(en,{variant:"subtle",color:a?"teal":"gray",onClick:l,children:a?s.jsx(Js,{size:"1rem"}):s.jsx(Fk,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===W.Attachment?s.jsx(UB,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(YB,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case W.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case W.SystemString:case W.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case W.code:case W.date:case W.decimal:case W.id:case W.integer:case W.positiveInt:case W.unsignedInt:case W.uri:case W.url:return s.jsx(s.Fragment,{children:r});case W.canonical:return s.jsx(Tf,{value:{reference:r},link:e.link});case W.dateTime:case W.instant:return s.jsx(s.Fragment,{children:zn(r)});case W.markdown:return s.jsx("pre",{children:r});case W.Address:return s.jsx(J8,{value:r});case W.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case W.Attachment:return s.jsx(vu,{value:r,maxWidth:e.maxWidth});case W.CodeableConcept:return s.jsx(mo,{value:r});case W.Coding:return s.jsx(WB,{value:r});case W.ContactDetail:return s.jsx(HB,{value:r});case W.ContactPoint:return s.jsx(Qk,{value:r});case W.HumanName:return s.jsx(t0,{value:r});case W.Identifier:return s.jsx(qB,{value:r});case W.Money:return s.jsx(GB,{value:r});case W.Period:return s.jsx(s.Fragment,{children:N6(r)});case W.Quantity:case W.Duration:return s.jsx(zc,{value:r});case W.Range:return s.jsx(a0,{value:r});case W.Ratio:return s.jsx(QB,{value:r});case W.Reference:return s.jsx(Tf,{value:r,link:e.link});case W.Timing:return s.jsx(s.Fragment,{children:fk(r)});case W.Dosage:case W.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Pf,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case W.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(JB,{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 s.jsx(Pf,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const Xk=["extension","modifierExtension"],ZB=Lk.filter(e=>!Xk.includes(e));function Pf(e){const t=e.value,{value:n,type:r}=t,o=p.useContext(wt),i=e.profileUrl??(o==null?void 0:o.profileUrl),a=p.useMemo(()=>$h(r,i),[i,r]),l=p.useMemo(()=>{if(a)return sl({parentContext:o,elements:a.elements,path:e.path,profileUrl:a.url,accessPolicyResource:e.accessPolicyResource})},[a,o,e.path,e.accessPolicyResource]);if(qt(n))return null;if(!a)return s.jsxs("div",{children:[r," not implemented"]});if(typeof n=="object"&&"name"in n&&Object.keys(n).length===1&&typeof n.name=="string")return s.jsx("div",{children:n.name});const c=l??o;return qh(wt.Provider,l,s.jsx(i0,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var v;if(Xk.includes(u)&&qt((v=d.slicing)==null?void 0:v.slices))return null;if(ZB.includes(u))return null;if($k.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=yu(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&qt(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const m=d.max>1||d.isArray,g=s.jsx(Xr,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:m,link:e.link},u);return m?g:s.jsx(Oo,{term:Is(u),children:g},u)})}))}const Jk="Read Only";function Zk(e,t){return e?s.jsx(qs.Floating,{label:e,children:t}):t}const eU="_dimmed_1pxw4_1",eR={dimmed:eU};function tR(e){const{debugMode:t}=p.useContext(wt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Zk(e!=null&&e.readonly?Jk:void 0,s.jsxs(te,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(Mt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?eR.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,children:null})})]}))}function Qe(e,t){var n,r,o;return(o=(r=(n=e==null?void 0:e.issue)==null?void 0:n.filter(i=>{var a;return nR((a=i.expression)==null?void 0:a[0],t)}))==null?void 0:r.map(i=>{var a;return(a=i.details)==null?void 0:a.text}))==null?void 0:o.join(`
|
|
535
|
-
`)}function xu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return nR((o=r.expression)==null?void 0:o[0],t)})}const fd=/\[\d+\]/;function nR(e,t){const n=typeof e=="string"&&fd.test(e),r=typeof t=="string"&&fd.test(t);if(n!==r&&(e=e==null?void 0:e.replace(fd,""),t=t==null?void 0:t.replace(fd,"")),e===t)return!0;if(!e||!t)return!1;const o=e.indexOf(".");if(o>=0&&e.substring(o+1)===t)return!0;const i=t.indexOf(".");return i>=0&&t.substring(i+1)===e}function yt(e){const{debugMode:t}=p.useContext(wt);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,Zk(e!=null&&e.readonly?Jk:void 0,s.jsx(Mt.Wrapper,{id:e.htmlFor,label:n,classNames:{label:e!=null&&e.readonly?eR.dimmed:void 0},description:e.description,withAsterisk:e.withAsterisk,error:Qe(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children}))}function rR(e,t,n,r,o){const i=r.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",tn(a.code));l in e&&delete e[l]}return e[n]=o,e}function tU(e){return!!e&&!qt(e.url)&&!qt(e.name)}function nU(e){const{defaultValue:t,onChange:n,withHelpText:r,outcome:o,path:i,valuePath:a,...l}=e,[c,u]=p.useState(t);function d(f){const h=oU(f);u(h),n&&n(h)}return s.jsx(r0,{defaultValue:c&&rU(c),onChange:d,withHelpText:r??!0,...l})}function rU(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function oU(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function oR(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=u&&sU(u);a(d),n&&n(d)}return s.jsx(r0,{defaultValue:i&&iU(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function iU(e){return{system:e.system,code:e.code,display:e.display}}function sU(e){return{system:e.system,code:e.code,display:e.display}}function iR(e){const{path:t,outcome:n}=e,{elementsByPath:r,getExtendedProps:o}=p.useContext(wt),[i,a]=p.useState(e.defaultValue),l=p.useRef();l.current=i;const[c,u,d]=p.useMemo(()=>["system","use","value"].map(y=>r[t+"."+y]),[r,t]),[f,h,m]=p.useMemo(()=>["system","use","value"].map(y=>o(t+"."+y)),[o,t]);function g(y){y&&Object.keys(y).length===0&&(y=void 0),a(y),e.onChange&&e.onChange(y)}function v(y){const x={...l.current,system:y};y||delete x.system,g(x)}function S(y){const x={...l.current,use:y};y||delete x.use,g(x)}function b(y){const x={...l.current,value:y};y||delete x.value,g(x)}const w=e.valuePath??t;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(It,{disabled:e.disabled||(f==null?void 0:f.readonly),"data-testid":"system",defaultValue:i==null?void 0:i.system,required:((c==null?void 0:c.min)??0)>0,onChange:y=>v(y.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Qe(n,w+".system")}),s.jsx(It,{disabled:e.disabled||(h==null?void 0:h.readonly),"data-testid":"use",defaultValue:i==null?void 0:i.use,required:((u==null?void 0:u.min)??0)>0,onChange:y=>S(y.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Qe(n,w+".use")}),s.jsx(ye,{disabled:e.disabled||(m==null?void 0:m.readonly),placeholder:"Value",defaultValue:i==null?void 0:i.value,required:((d==null?void 0:d.min)??0)>0,onChange:y=>b(y.currentTarget.value),error:Qe(n,w+".value")})]})}function aU(e){var d;const[t,n]=p.useState(e.defaultValue),r=p.useRef();r.current=t;const{getExtendedProps:o}=p.useContext(wt),[i,a]=p.useMemo(()=>["name","telecom"].map(f=>o(e.path+"."+f)),[o,e.path]);function l(f){n(f),e.onChange&&e.onChange(f)}function c(f){const h={...r.current,name:f};f||delete h.name,l(h)}function u(f){const h={...r.current,telecom:f&&[f]};f||delete h.telecom,l(h)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ye,{disabled:e.disabled||(i==null?void 0:i.readonly),"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:f=>c(f.currentTarget.value)}),s.jsx(iR,{disabled:e.disabled||(a==null?void 0:a.readonly),name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(d=t==null?void 0:t.telecom)==null?void 0:d[0],onChange:u,outcome:e.outcome})]})}function lU(e){if(!e)return"";const t=new Date(e);return Fh(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function sR(e){if(!e)return"";const t=new Date(e);return Fh(t)?t.toISOString():""}function As(e){return s.jsx(ye,{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:cU(),defaultValue:lU(e.defaultValue),autoFocus:e.autoFocus,error:Qe(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(sR(n))}}})}function cU(){return"datetime-local"}function uU(e){const{propertyType:t}=e,n=le(),r=p.useMemo(()=>{if($t(t.profile))return t.profile[0]},[t]),[o,i]=p.useState(r!==void 0);return p.useEffect(()=>{r&&(i(!0),n.requestProfileSchema(r).then(()=>i(!1)).catch(a=>{i(!1),console.warn(a)}))},[n,r]),r&&(o||!Ix(r))?s.jsx("div",{children:"Loading..."}):s.jsx(u0,{profileUrl:r,path:e.path,typeName:"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function dU(e){var w,y,x;const{outcome:t,path:n}=e,[r,o]=p.useState(e.defaultValue),{getExtendedProps:i}=p.useContext(wt),[a,l,c,u,d]=p.useMemo(()=>["use","prefix","given","family","suffix"].map(C=>i(e.path+"."+C)),[i,e.path]);function f(C){o(C),e.onChange&&e.onChange(C)}function h(C){f({...r,use:C||void 0})}function m(C){f({...r,prefix:C?C.split(" "):void 0})}function g(C){f({...r,given:C?C.split(" "):void 0})}function v(C){f({...r,family:C||void 0})}function S(C){f({...r,suffix:C?C.split(" "):void 0})}const b=e.valuePath??n;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(It,{disabled:e.disabled||(a==null?void 0:a.readonly),defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:C=>h(C.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Qe(t,b+".use")}),s.jsx(ye,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(w=r==null?void 0:r.prefix)==null?void 0:w.join(" "),onChange:C=>m(C.currentTarget.value),error:Qe(t,b+".prefix")}),s.jsx(ye,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Given",name:e.name+"-given",defaultValue:(y=r==null?void 0:r.given)==null?void 0:y.join(" "),onChange:C=>g(C.currentTarget.value),error:Qe(t,b+".given")}),s.jsx(ye,{disabled:e.disabled||(u==null?void 0:u.readonly),name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:C=>v(C.currentTarget.value),error:Qe(t,b+".family")}),s.jsx(ye,{disabled:e.disabled||(d==null?void 0:d.readonly),placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(x=r==null?void 0:r.suffix)==null?void 0:x.join(" "),onChange:C=>S(C.currentTarget.value),error:Qe(t,b+".suffix")})]})}function fU(e){const[t,n]=p.useState(e.defaultValue),{elementsByPath:r,getExtendedProps:o}=p.useContext(wt),[i,a]=p.useMemo(()=>["system","value"].map(f=>r[e.path+"."+f]),[r,e.path]),[l,c]=p.useMemo(()=>["system","value"].map(f=>o(e.path+"."+f)),[o,e.path]);function u(f){n(f),e.onChange&&e.onChange(f)}const d=e.valuePath??e.path;return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(ye,{disabled:e.disabled||(l==null?void 0:l.readonly),placeholder:"System",required:((i==null?void 0:i.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:f=>u({...t,system:f.currentTarget.value}),error:Qe(e.outcome,d+".system")}),s.jsx(ye,{disabled:e.disabled||(c==null?void 0:c.readonly),placeholder:"Value",required:((a==null?void 0:a.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:f=>u({...t,value:f.currentTarget.value}),error:Qe(e.outcome,d+".value")})]})}const hU=["USD","EUR","CAD","GBP","AUD"];function pU(e){var f;const{onChange:t}=e,[n,r]=p.useState(e.defaultValue),{getExtendedProps:o}=p.useContext(wt),[i,a]=p.useMemo(()=>["currency","value"].map(h=>o(e.path+"."+h)),[o,e.path]),l=p.useCallback(h=>{r(h),t&&t(h)},[t]),c=p.useCallback(h=>{l({...n,currency:h.currentTarget.value})},[n,l]),u=p.useCallback(h=>{l({...n,value:h.currentTarget.valueAsNumber})},[n,l]),d=s.jsx(It,{disabled:e.disabled||(i==null?void 0:i.readonly),defaultValue:n==null?void 0:n.currency,data:hU,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:c});return s.jsx(ye,{disabled:e.disabled||(a==null?void 0:a.readonly),type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((f=n==null?void 0:n.value)==null?void 0:f.toString())??"USD",leftSection:s.jsx(vz,{size:14}),rightSection:d,rightSectionWidth:92,onChange:u})}function mU(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i]=p.useMemo(()=>["start","end"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(As,{disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:l=>a({...t,start:l})}),s.jsx(As,{disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:l=>a({...t,end:l})})]})}function Ns(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i,a]=p.useMemo(()=>["comparator","value","unit"].map(c=>r(e.path+"."+c)),[r,e.path]);function l(c){n(c),e.onChange&&e.onChange(c)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(It,{disabled:e.disabled||(o==null?void 0:o.readonly),style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:c=>l({...t,comparator:c.currentTarget.value})}),s.jsx(ye,{disabled:e.disabled||(i==null?void 0:i.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==null?void 0:t.value,autoFocus:e.autoFocus,step:"any",onWheel:c=>{e.disableWheel&&c.currentTarget.blur()},onChange:c=>{l({...t,value:gU(c.currentTarget.value)})}}),s.jsx(ye,{disabled:e.disabled||(a==null?void 0:a.readonly),placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:c=>l({...t,unit:c.currentTarget.value})})]})}function gU(e){if(e)return parseFloat(e)}function l0(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i]=p.useMemo(()=>["low","high"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ns,{path:e.path+".low",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:l=>a({...t,low:l})}),s.jsx(Ns,{path:e.path+".high",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:l=>a({...t,high:l})})]})}function vU(e){const[t,n]=p.useState(e.defaultValue),{getExtendedProps:r}=p.useContext(wt),[o,i]=p.useMemo(()=>["numerator","denominator"].map(l=>r(e.path+"."+l)),[r,e.path]);function a(l){n(l),e.onChange&&e.onChange(l)}return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Ns,{path:e.path+".numerator",disabled:e.disabled||(o==null?void 0:o.readonly),name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:l=>a({...t,numerator:l})}),s.jsx(Ns,{path:e.path+".denominator",disabled:e.disabled||(i==null?void 0:i.readonly),name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:l=>a({...t,denominator:l})})]})}const yU={Device:"device-name",Observation:"code",Subscription:"criteria",User:"email:contains"},xU=["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","RiskEvidenceSynthesis","SearchParameter","StructureDefinition","StructureMap","TerminologyCapabilities","TestScript","UserConfiguration","ValueSet"];function bU(e){return{value:rt(e),label:qo(e),resource:e}}function Zs(e){const t=le(),{resourceType:n,searchCriteria:r}=e,[o,i]=p.useState(),a=St(e.defaultValue,i),l=e.itemComponent??wU,c=e.onChange,u=p.useCallback(async(f,h)=>{const m=SU(n),g=new URLSearchParams({[m]:f??"",_count:"10",...r});return await t.searchResources(n,g,{signal:h})},[t,n,r]),d=p.useCallback(f=>{c&&c(f[0])},[c]);return $t(e.defaultValue)&&!o&&!a?null:s.jsx(n0,{disabled:e.disabled,name:e.name,label:e.label,error:e.error,required:e.required,itemComponent:l,defaultValue:a,placeholder:e.placeholder,maxValues:1,toOption:bU,loadOptions:u,onChange:d,clearable:!0})}const wU=p.forwardRef(({label:e,resource:t,active:n,...r},o)=>s.jsx("div",{ref:o,...r,children:s.jsxs(te,{wrap:"nowrap",children:[s.jsx(Ji,{value:t}),s.jsxs("div",{children:[s.jsx(me,{children:e}),s.jsx(me,{size:"xs",c:"dimmed",children:t.birthDate||t.id})]})]})}));function SU(e){return yU[e]??(xU.includes(e)?"name":"_id")}function Gh(e){const{onChange:t}=e,n=le(),[r,o]=p.useState(e.defaultValue),[i,a]=p.useState(()=>jU(e.targetTypes)),[l,c]=p.useState(()=>CU(e.defaultValue,i)),u=p.useRef(new Pk),d=p.useMemo(()=>(l==null?void 0:l.type)==="profile"?{...e.searchCriteria,_profile:l.value}:e.searchCriteria,[e.searchCriteria,l]);p.useEffect(()=>{let m=!1;const g=i==null?void 0:i.map(v=>{if(!TU(v))return Promise.resolve(v);m=!0;const S=v.value,b=u.current.get(S);if(b)return b;const w=EU(n,v.value).then(x=>{const C={...v};return x?$t(x.type)?(C.resourceType=x.type,C.name=x.name,C.title=x.title):(console.error(`StructureDefinition.type missing for ${v.value}`),C.error="StructureDefinition.type missing"):(console.error(`StructureDefinition not found for ${v.value}`),C.error="StructureDefinition not found"),C}).catch(x=>(console.error(x),{...v,error:x})),y=new Or(w);return u.current.set(S,y),y});!g||!m||Promise.all(g).then(v=>{if(a(v),!l)return;const S=v.findIndex(b=>b.value===l.value||b.resourceType===l.resourceType);if(S===-1){console.debug(`defaultValue had unexpected resourceType: ${l.resourceType}`);return}c(v[S])}).catch(console.error)},[n,l,i]);const f=p.useCallback(m=>{const g=m?Tt(m):void 0;o(g),t&&t(g)},[t]),h=p.useMemo(()=>i?i.map(m=>({value:m.value,label:m.type==="profile"?m.title??m.name??m.resourceType??m.value:m.value})):[],[i]);return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&s.jsx(It,{disabled:e.disabled,"data-autofocus":e.autoFocus,"data-testid":"reference-input-resource-type-select",defaultValue:l==null?void 0:l.resourceType,autoFocus:e.autoFocus,onChange:m=>{const g=m.currentTarget.value,v=i.find(S=>S.value===g);c(v)},data:h}),!i&&s.jsx(o0,{disabled:e.disabled,autoFocus:e.autoFocus,testId:"reference-input-resource-type-input",defaultValue:l==null?void 0:l.resourceType,onChange:m=>{c(m?{type:"resourceType",value:m,resourceType:m}:void 0)},name:e.name+"-resourceType",placeholder:"Resource Type"}),s.jsx(Zs,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f,disabled:e.disabled})]})}function jU(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 CU(e,t){var r;const n=(r=e==null?void 0:e.reference)==null?void 0:r.split("/")[0];if(n){const o=t==null?void 0:t.find(i=>i.resourceType===n);return o||{type:"resourceType",value:n,resourceType:n}}if(t&&t.length>0)return t[0]}async function EU(e,t){const n=wl(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
536
|
-
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
537
|
-
type,
|
|
538
|
-
name,
|
|
539
|
-
title,
|
|
540
|
-
}
|
|
541
|
-
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function TU(e){return e.type==="profile"&&!(e!=null&&e.error)&&qt(e.resourceType)}const PU="_indented_ldk1d_1",aR={indented:PU};function lR({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(ae,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Cf,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(en,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Cf,{size:"1.25rem"})})}function cR({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(en,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(jf,{size:"1.25rem"})})}function kU(e){var m,g;const{slice:t,property:n}=e,[r,o]=p.useState(e.defaultValue),i=((m=t.typeSchema)==null?void 0:m.elements)??t.elements,a=p.useContext(wt),l=p.useMemo(()=>{var v;if($t(i))return sl({parentContext:a,elements:i,path:e.path,profileUrl:(v=t.typeSchema)==null?void 0:v.url})},[a,e.path,(g=t.typeSchema)==null?void 0:g.url,i]);function c(v){o(v),e.onChange&&e.onChange(v)}const u=t.min>0,d=qt(t.elements),f=mk(t.name),h=e.property.readonly&&r.length===0;return qh(wt.Provider,l,s.jsx(yt,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,readonly:e.property.readonly,children:h?s.jsx(me,{c:"dimmed",children:"(empty)"}):s.jsxs($e,{className:d?aR.indented:void 0,children:[r.map((v,S)=>s.jsxs(te,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${S}`,children:s.jsx(c0,{elementDefinitionType:t.type[0],name:t.name,defaultValue:v,onChange:b=>{const w=[...r];w[S]=b,c(w)},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&&s.jsx(cR,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${S}`,onClick:b=>{xt(b);const w=[...r];w.splice(S,1),c(w)}})]},`${S}-${r.length}`)),!e.property.readonly&&r.length<t.max&&s.jsx(te,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(lR,{propertyDisplayName:f,onClick:v=>{xt(v);const S=[...r,void 0];c(S)},testId:e.testId&&`${e.testId}-add`})})]})}))}function RU(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function _U(e){var w;const{property:t}=e,n=le(),[r,o]=p.useState(!0),[i,a]=p.useState([]),[l]=p.useState(()=>Array.isArray(e.defaultValue)?e.defaultValue:[]),[c,u]=p.useState(()=>[l]),d=p.useContext(wt),f=(w=t.type[0])==null?void 0:w.code;p.useEffect(()=>{Yk({medplum:n,property:t}).then(y=>{a(y);const x=Kk(l,y,t.slicing,d.profileUrl);DU(x,y),u(x),o(!1)}).catch(y=>{console.error(y),o(!1)})},[n,t,l,d.profileUrl,u]);function h(y,x){const C=[...c];if(C[x]=y,u(C),e.onChange){const E=C.flat().filter(T=>T!==void 0);e.onChange(E)}}if(r)return s.jsx("div",{children:"Loading..."});const m=i.length,g=c[m],v=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),S=Is(t.path),b=e.property.readonly&&i.length===0&&l.length===0;return s.jsxs($e,{className:e.indent?aR.indented:void 0,children:[b&&s.jsx(me,{c:"dimmed",children:"(empty)"}),i.map((y,x)=>s.jsx(kU,{slice:y,path:e.path,valuePath:e.valuePath,property:t,defaultValue:c[x],onChange:C=>{h(C,x)},testId:`slice-${y.name}`},y.name)),v&&g.map((y,x)=>s.jsxs(te,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(Tl,{arrayElement:!0,property:e.property,name:e.name+"."+x,path:e.path,valuePath:RU(e.path,e.valuePath,x),defaultValue:y,onChange:C=>{const E=[...g];E[x]=C,h(E,m)},defaultPropertyType:void 0,outcome:e.outcome})}),!e.property.readonly&&s.jsx(cR,{propertyDisplayName:S,testId:`nonsliced-remove-${x}`,onClick:C=>{xt(C);const E=[...g];E.splice(x,1),h(E,m)}})]},`${x}-${g.length}`)),!e.property.readonly&&v&&c.flat().length<t.max&&s.jsx(te,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(lR,{propertyDisplayName:S,onClick:y=>{xt(y);const x=[...g];x.push(void 0),h(x,m)},testId:"nonsliced-add"})})]})}function DU(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 IU(e){const[t,n]=p.useState(!1),r=aj(),o=p.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),s.jsxs(ks,{gap:"xs",children:[s.jsx(Hs,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(en,{title:"Copy secret",onClick:()=>{var a;r.copy((a=o.current)==null?void 0:a.value),ge({color:"green",message:"Copied"})},children:s.jsx(Fk,{})})]})}const AU=["sun","mon","tue","wed","thu","fri","sat"];function NU(e){const[t,n]=p.useState(e.defaultValue),[r,o]=p.useState(!e.disabled&&(e.defaultModalOpen??!1)),i=p.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:fk(i.current)||"No repeat"}),s.jsx(ae,{disabled:e.disabled,onClick:()=>o(!0),children:"Edit"})]}),!e.disabled&&s.jsx(MU,{path:e.path,visible:r,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),n(a),o(!1)},onCancel:()=>o(!1)})]})}const Fw={repeat:{period:1,periodUnit:"d"}};function MU(e){const[t,n]=p.useState(e.defaultValue||Fw),{getExtendedProps:r}=p.useContext(wt),[o,i,a,l,c]=p.useMemo(()=>["event","repeat","repeat.period","repeat.periodUnit","repeat.dayOfWeek"].map(v=>r(e.path+"."+v)),[r,e.path]),u=p.useRef();u.current=t;function d(v){n({...u.current,event:[v]})}function f(v){n({...u.current,repeat:v})}function h(v){var S;f({...(S=u.current)==null?void 0:S.repeat,period:v})}function m(v){var S;f({...(S=u.current)==null?void 0:S.repeat,periodUnit:v})}function g(v){var S;f({...(S=u.current)==null?void 0:S.repeat,dayOfWeek:v})}return s.jsx(jn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs($e,{children:[s.jsx(yt,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(As,{disabled:o==null?void 0:o.readonly,name:"timing-dialog-start",onChange:v=>d(v)})}),s.jsx(uu,{disabled:i==null?void 0:i.readonly,label:"Repeat",checked:!!t.repeat,onChange:v=>f(v.currentTarget.checked?Fw.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(yt,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ye,{disabled:a==null?void 0:a.readonly,type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:v=>h(parseInt(v.currentTarget.value,10)||1)}),s.jsx(It,{disabled:l==null?void 0:l.readonly,id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:v=>m(v.currentTarget.value),data:[{label:"second",value:"s"},{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"&&s.jsx(yt,{title:"Repeat on",children:s.jsx(Dc.Group,{multiple:!0,onChange:g,children:s.jsx(te,{justify:"space-between",mt:"md",gap:"xs",children:AU.map(v=>s.jsx(Dc,{value:v,size:"xs",radius:"xl",disabled:c==null?void 0:c.readonly,children:v.charAt(0).toUpperCase()},v))})})})]}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function Tl(e){var l;const{property:t,name:n,onChange:r,defaultValue:o}=e,i=e.defaultPropertyType&&e.defaultPropertyType!=="undefined"?e.defaultPropertyType:t.type[0].code,a=t.type;if((t.isArray||t.max>1)&&!e.arrayElement){if(i===W.Attachment)return s.jsx(VB,{name:n,defaultValue:o,onChange:r,disabled:t.readonly});const c=((l=a[0])==null?void 0:l.code)!==W.Extension;return s.jsx(_U,{property:t,name:n,path:e.path,valuePath:e.valuePath,defaultValue:o,indent:c,onChange:r,outcome:e.outcome})}else return a.length>1?s.jsx(OU,{elementDefinitionTypes:a,...e}):s.jsx(c0,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",tn(a[0].code));e.onChange(c,u)}},outcome:e.outcome,elementDefinitionType:a[0],min:t.min,max:t.min,binding:t.binding,path:e.path,valuePath:e.valuePath,readOnly:t.readonly})}function OU(e){const t=e.elementDefinitionTypes;let n;e.defaultPropertyType&&(n=t.find(i=>i.code===e.defaultPropertyType)),n||(n=t[0]);const[r,o]=p.useState(n);return s.jsxs(te,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(It,{disabled:e.property.readonly,style:{width:"200px"},defaultValue:r.code,"data-testid":e.name&&e.name+"-selector",onChange:i=>{o(t.find(a=>a.code===i.currentTarget.value))},data:t.map(i=>({value:i.code,label:i.code}))}),s.jsx(c0,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",tn(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 c0(e){const{name:t,onChange:n,outcome:r,binding:o,path:i,valuePath:a,readOnly:l}=e,c=e.min!==void 0&&e.min>0,u=e.elementDefinitionType.code,d=p.useContext(wt),f=p.useMemo(()=>{if(!Ox(u)||!qt(e.defaultValue))return e.defaultValue;const g=Object.create(null);if(d.path===e.path)Ew(g,d.elements);else{const v=Mc(d.path,e.path);if(v===void 0)return e.defaultValue;Ew(g,d.elements,v)}return $t(g)?g:e.defaultValue},[u,d.path,d.elements,e.path,e.defaultValue]);if(!u)return s.jsx("div",{children:"Property type not specified "});function h(){return{name:t,defaultValue:f,onChange:n,outcome:r,path:i,valuePath:a,disabled:l}}function m(){const g=Qe(e.outcome,a??i);return{id:t,name:t,"data-testid":t,defaultValue:f,required:c,error:g,disabled:l}}switch(u){case W.SystemString:case W.canonical:case W.string:case W.time:case W.uri:case W.url:return e.path==="Project.secret.value[x]"?s.jsx(IU,{...m(),onChange:g=>{e.onChange&&e.onChange(g.currentTarget.value)}}):s.jsx(ye,{...m(),onChange:g=>{n&&n(g.currentTarget.value)}});case W.date:return s.jsx(ye,{...m(),type:"date",onChange:g=>{n&&n(g.currentTarget.value)}});case W.dateTime:case W.instant:return s.jsx(As,{...m(),onChange:n,outcome:r});case W.decimal:case W.integer:case W.positiveInt:case W.unsignedInt:return s.jsx(ye,{...m(),type:"number",step:u===W.decimal?"any":"1",onChange:g=>{if(n){const v=g.currentTarget.valueAsNumber;n(Number.isNaN(v)?void 0:v)}}});case W.code:return s.jsx(qk,{...m(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case W.boolean:return s.jsx(Dn,{...m(),defaultChecked:!!f,onChange:g=>{n&&n(g.currentTarget.checked)}});case W.base64Binary:case W.markdown:return s.jsx(Hs,{...m(),spellCheck:u!==W.base64Binary,onChange:g=>{n&&n(g.currentTarget.value)}});case W.Address:return s.jsx(tz,{...h()});case W.Annotation:return s.jsx(nz,{...h()});case W.Attachment:return s.jsx(Gk,{...h()});case W.CodeableConcept:return s.jsx(nU,{binding:o==null?void 0:o.valueSet,...h()});case W.Coding:return s.jsx(oR,{binding:o==null?void 0:o.valueSet,...h()});case W.ContactDetail:return s.jsx(aU,{...h()});case W.ContactPoint:return s.jsx(iR,{...h()});case W.Extension:return s.jsx(uU,{...h(),propertyType:e.elementDefinitionType});case W.HumanName:return s.jsx(dU,{...h()});case W.Identifier:return s.jsx(fU,{...h()});case W.Money:return s.jsx(pU,{...h()});case W.Period:return s.jsx(mU,{...h()});case W.Duration:case W.Quantity:return s.jsx(Ns,{...h()});case W.Range:return s.jsx(l0,{...h()});case W.Ratio:return s.jsx(vU,{...h()});case W.Reference:return s.jsx(Gh,{...h(),targetTypes:$U(e.elementDefinitionType)});case W.Timing:return s.jsx(NU,{...h()});case W.Dosage:case W.UsageContext:default:return s.jsx(u0,{...h(),typeName:u})}}const LU=[`${F$}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function $U(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=LU.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function FU(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useContext(wt),o=p.useMemo(()=>ez(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const a={type:e.type,value:t};return s.jsx($e,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=XB(a,l,c),f=c.min!==void 0&&c.min>0,h=e.valuePath?e.valuePath+"."+l:void 0,m=s.jsx(Tl,{property:c,name:l,path:e.path+"."+l,valuePath:h,defaultValue:u,defaultPropertyType:d,onChange:(g,v)=>{i(rR({...t},l,v??l,c,g))},outcome:e.outcome},l);return e.type==="Extension"||Kx.includes(l)?m:c.type.length===1&&c.type[0].code==="boolean"?s.jsx(tR,{title:Is(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,readonly:c.readonly,children:m},l):s.jsx(yt,{title:Is(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,errorExpression:h,readonly:c.readonly,children:m},l)})})}function u0(e){const[t]=p.useState(()=>e.defaultValue??{}),n=p.useContext(wt),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=p.useMemo(()=>$h(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,a=p.useMemo(()=>{if(o)return sl({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url,accessPolicyResource:e.accessPolicyResource})},[o,n,e.path,e.accessPolicyResource]);return o?qh(wt.Provider,a,s.jsx(FU,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[i," not implemented"]})}const zU="_root_1vii2_1",BU={root:zU};function bu(e){const{children:t,...n}=e;return s.jsx(Qy,{className:BU.root,...n,children:t})}const UU="_noteBody_10swh_1",VU="_noteCite_10swh_5",WU="_noteRoot_10swh_10",zw={noteBody:UU,noteCite:VU,noteRoot:WU};function uR({value:e}){return e?s.jsx($e,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(Hy,{classNames:{cite:zw.noteCite,root:zw.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function Pl(e){const{value:t,link:n,...r}=e,[o,i]=p.useState(),a=St(t,i);let l;if(o&&!QP(o))l=`[${Ae(o)}]`;else if(a)l=qo(a);else return null;return n?s.jsx(We,{to:t,...r,children:l}):s.jsx(me,{component:"span",...r,children:l})}function Ha(e){return s.jsxs(te,{gap:"xs",children:[s.jsx(Ji,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(Pl,{value:e.value,link:e.link})]})}const HU={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"};function d0(e){return s.jsx(iu,{color:HU[e.status],children:e.status})}const qU="_table_pe9td_1",GU="_criticalRow_pe9td_12",QU="_noteBody_pe9td_23",KU="_noteCite_pe9td_27",YU="_noteRoot_pe9td_32",dR={table:qU,criticalRow:GU,noteBody:QU,noteCite:KU,noteRoot:YU};f0.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function f0(e){var a;const t=le(),n=St(e.value),[r,o]=p.useState();if(p.useEffect(()=>{n!=null&&n.specimen&&Promise.allSettled(n.specimen.map(l=>t.readReference(l))).then(l=>l.filter(c=>c.status==="fulfilled").map(c=>c.value)).then(o).catch(console.error)},[t,n]),!n)return null;const i=(r==null?void 0:r.flatMap(l=>l.note||[]))||[];if(n.presentedForm&&n.presentedForm.length>0){const l=n.presentedForm[0];(a=l.contentType)!=null&&a.startsWith("text/plain")&&l.data&&i.push({text:window.atob(l.data)})}return s.jsxs($e,{children:[s.jsx(ve,{children:"Diagnostic Report"}),s.jsx(XU,{value:n}),r&&!e.hideSpecimenInfo&&JU(r),n.result&&s.jsx(ZU,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&s.jsx(uR,{value:i})]})}function XU({value:e}){var t,n;return s.jsxs(te,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(me,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(Ha,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(me,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(Ha,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(me,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(Ha,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(me,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(me,{children:zn(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(me,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(me,{children:tn(e.status)})]})]})}function JU(e){return s.jsxs($e,{gap:"xs",children:[s.jsx(ve,{order:2,size:"h6",children:"Specimens"}),s.jsx($n,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx($n.Item,{ml:"sm",children:s.jsxs(te,{gap:20,children:[s.jsxs(te,{gap:5,children:[s.jsx(me,{fw:500,children:"Collected:"})," ",zn((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(te,{gap:5,children:[s.jsx(me,{fw:500,children:"Received:"})," ",zn(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function ZU(e){return s.jsxs("table",{className:dR.table,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Test"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Reference Range"}),s.jsx("th",{children:"Interpretation"}),s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Performer"}),s.jsx("th",{children:"Status"})]})}),s.jsx("tbody",{children:s.jsx(fR,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function fR(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(eV,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Xs(n)?n.reference:n.id}`))})}function eV(e){var o,i;const t=St(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=rV(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:tt({[dR.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(We,{to:t,children:s.jsx(mo,{value:t.code})})}),s.jsx("td",{children:s.jsx(tV,{value:t})}),s.jsx("td",{children:s.jsx(nV,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(mo,{value:t.interpretation[0]})}),s.jsx("td",{children:t.category&&t.category.length>0&&s.jsx(s.Fragment,{children:t.category.map(a=>s.jsx("div",{children:s.jsx(mo,{value:a})},`category-${Vi(a)}`))})}),s.jsx("td",{children:(i=t.performer)==null?void 0:i.map(a=>s.jsx(Tf,{value:a},a.reference))}),s.jsx("td",{children:t.status&&s.jsx(d0,{status:t.status})})]}),t.hasMember&&s.jsx(fR,{value:t.hasMember,ancestorIds:e.ancestorIds?[...e.ancestorIds,t.id]:[t.id],hideObservationNotes:e.hideObservationNotes}),n&&s.jsx("tr",{children:s.jsx("td",{colSpan:6,children:s.jsx(uR,{value:t.note})})})]})}function tV(e){const t=e.value;return s.jsx(s.Fragment,{children:hk(t)})}function nV(e){const t=e.value&&e.value.length>0&&e.value[0];return t?t.text?s.jsx(s.Fragment,{children:t.text}):s.jsx(a0,{value:t}):null}function rV(e){var n,r,o,i;const t=(i=(o=(r=(n=e.interpretation)==null?void 0:n[0])==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code;return t==="AA"||t==="LL"||t==="HH"||t==="A"}const oV="_paper_1igaj_1",iV="_fill_1igaj_20",Bw={paper:oV,fill:iV};function h0(e){const{width:t,fill:n,className:r,children:o,...i}=e,a=t?{maxWidth:t}:void 0;return s.jsx(Xn,{className:tt(Bw.paper,n&&Bw.fill,r),style:a,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var p0={},wu={};Object.defineProperty(wu,"__esModule",{value:!0});wu.Pointer=void 0;function sV(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function aV(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var lV=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(sV);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(aV).join("/")},e.prototype.evaluate=function(t){for(var n=null,r="",o=t,i=1,a=this.tokens.length;i<a;i++)n=o,r=this.tokens[i],!(r=="__proto__"||r=="constructor"||r=="prototype")&&(o=(n||{})[r]);return{parent:n,key:r,value:o}},e.prototype.get=function(t){return this.evaluate(t).value},e.prototype.set=function(t,n){var r=this.evaluate(t);r.parent&&(r.parent[r.key]=n)},e.prototype.push=function(t){this.tokens.push(t)},e.prototype.add=function(t){var n=this.tokens.concat(String(t));return new e(n)},e}();wu.Pointer=lV;var Wt={},m0={};(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 i=o.length,a=new Array(i),l=0;l<i;l++)a[l]=r(o[l]);return a}if(o.constructor==Date){var c=new Date(+o);return c}var u={};for(var d in o)e.hasOwnProperty.call(o,d)&&(u[d]=r(o[d]));return u}e.clone=r})(m0);var Ln={};Object.defineProperty(Ln,"__esModule",{value:!0});Ln.diffAny=Ln.diffObjects=Ln.diffArrays=Ln.intersection=Ln.subtract=Ln.isDestructive=void 0;var Bc=m0;function cV(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}Ln.isDestructive=cV;function Og(e,t){var n={};for(var r in e)Bc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)Bc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}Ln.subtract=Og;function hR(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)Bc.hasOwnProperty.call(o,i)&&o[i]!==void 0&&(n[i]=(n[i]||0)+1)}for(var i in n)n[i]<t&&delete n[i];return Object.keys(n)}Ln.intersection=hR;function uV(e){return e.op==="add"}function dV(e){return e.op==="remove"}function tm(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function pR(e,t,n,r){r===void 0&&(r=Qh);var o={"0,0":{operations:[],cost:0}};function i(d,f){var h="".concat(d,",").concat(f),m=o[h];if(m===void 0){if(d>0&&f>0&&!r(e[d-1],t[f-1],n.add(String(d-1))).length)m=i(d-1,f-1);else{var g=[];if(d>0){var v=i(d-1,f),S={op:"remove",index:d-1};g.push(tm(v,S))}if(f>0){var b=i(d,f-1),w={op:"add",index:d-1,value:t[f-1]};g.push(tm(b,w))}if(d>0&&f>0){var y=i(d-1,f-1),x={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(tm(y,x))}var C=g.sort(function(E,T){return E.cost-T.cost})[0];m=C}o[h]=m}return m}var a=isNaN(e.length)||e.length<=0?0:e.length,l=isNaN(t.length)||t.length<=0?0:t.length,c=i(a,l).operations,u=c.reduce(function(d,f){var h=d[0],m=d[1];if(uV(f)){var g=f.index+1+m,v=g<a+m?String(g):"-",S={op:f.op,path:n.add(v).toString(),value:f.value};return[h.concat(S),m+1]}else if(dV(f)){var S={op:f.op,path:n.add(String(f.index+m)).toString()};return[h.concat(S),m-1]}else{var b=n.add(String(f.index+m)),w=r(f.original,f.value,b);return[h.concat.apply(h,w),m]}},[[],0])[0];return u}Ln.diffArrays=pR;function mR(e,t,n,r){r===void 0&&(r=Qh);var o=[];return Og(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),Og(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),hR([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}Ln.diffObjects=mR;function Qh(e,t,n,r){if(r===void 0&&(r=Qh),e===t)return[];var o=(0,Bc.objectType)(e),i=(0,Bc.objectType)(t);return o=="array"&&i=="array"?pR(e,t,n,r):o=="object"&&i=="object"?mR(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}Ln.diffAny=Qh;var g0=L0&&L0.__extends||function(){var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,o){r.__proto__=o}||function(r,o){for(var i in o)Object.prototype.hasOwnProperty.call(o,i)&&(r[i]=o[i])},e(t,n)};return function(t,n){if(typeof n!="function"&&n!==null)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");e(t,n);function r(){this.constructor=t}t.prototype=n===null?Object.create(n):(r.prototype=n.prototype,new r)}}();Object.defineProperty(Wt,"__esModule",{value:!0});Wt.apply=Wt.InvalidOperationError=Wt.test=Wt.copy=Wt.move=Wt.replace=Wt.remove=Wt.add=Wt.TestError=Wt.MissingError=void 0;var Go=wu,v0=m0,fV=Ln,go=function(e){g0(t,e);function t(n){var r=e.call(this,"Value required at path: ".concat(n))||this;return r.path=n,r.name="MissingError",r}return t}(Error);Wt.MissingError=go;var gR=function(e){g0(t,e);function t(n,r){var o=e.call(this,"Test failed: ".concat(n," != ").concat(r))||this;return o.actual=n,o.expected=r,o.name="TestError",o}return t}(Error);Wt.TestError=gR;function y0(e,t,n){if(Array.isArray(e))if(t=="-")e.push(n);else{var r=parseInt(t,10);e.splice(r,0,n)}else e[t]=n}function vR(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function yR(e,t){var n=Go.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new go(t.path):(y0(n.parent,n.key,(0,v0.clone)(t.value)),null)}Wt.add=yR;function xR(e,t){var n=Go.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new go(t.path):(vR(n.parent,n.key),null)}Wt.remove=xR;function bR(e,t){var n=Go.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new go(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new go(t.path)}else if(n.value===void 0)return new go(t.path);return n.parent[n.key]=(0,v0.clone)(t.value),null}Wt.replace=bR;function wR(e,t){var n=Go.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new go(t.from);var r=Go.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new go(t.path):(vR(n.parent,n.key),y0(r.parent,r.key,n.value),null)}Wt.move=wR;function SR(e,t){var n=Go.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new go(t.from);var r=Go.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new go(t.path):(y0(r.parent,r.key,(0,v0.clone)(n.value)),null)}Wt.copy=SR;function jR(e,t){var n=Go.Pointer.fromJSON(t.path).evaluate(e);return(0,fV.diffAny)(n.value,t.value,new Go.Pointer).length?new gR(n.value,t.value):null}Wt.test=jR;var CR=function(e){g0(t,e);function t(n){var r=e.call(this,"Invalid operation: ".concat(n.op))||this;return r.operation=n,r.name="InvalidOperationError",r}return t}(Error);Wt.InvalidOperationError=CR;function hV(e,t){switch(t.op){case"add":return yR(e,t);case"remove":return xR(e,t);case"replace":return bR(e,t);case"move":return wR(e,t);case"copy":return SR(e,t);case"test":return jR(e,t)}return new CR(t)}Wt.apply=hV;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=wu;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=Wt,r=Ln;function o(u,d){return d.map(function(f){return(0,n.apply)(u,f)})}e.applyPatch=o;function i(u){function d(f,h,m){var g=u(f,h,m);return Array.isArray(g)?g:(0,r.diffAny)(f,h,m,d)}return d}function a(u,d,f){var h=new t.Pointer;return(f?i(f):r.diffAny)(u,d,h)}e.createPatch=a;function l(u,d){var f=t.Pointer.fromJSON(d).evaluate(u);if(f!==void 0)return{op:"test",path:d,value:f.value}}function c(u,d){var f=new Array;return d.filter(r.isDestructive).forEach(function(h){var m=l(u,h.path);if(m&&f.push(m),"from"in h){var g=l(u,h.from);g&&f.push(g)}}),f}e.createTests=c})(p0);const pV="_root_w6lfx_1",mV="_removed_w6lfx_16",gV="_added_w6lfx_21",nm={root:pV,removed:mV,added:gV};function vV(e){const t=le(),{original:n,revised:r}=e,[o,i]=p.useState(!1);p.useEffect(()=>{t.requestSchema(e.original.resourceType).then(()=>i(!0)).catch(console.log)},[t,e.original.resourceType]);const a=p.useMemo(()=>{if(!o)return null;const l=[vo(n)],c=[vo(r)],u=[],d=yV(p0.createPatch(n,r));for(const f of d){const h=f.path,m=xV(h),g=bV(n.resourceType,m),v=f.op==="add"?void 0:Fc(m,l),S=f.op==="remove"?void 0:Fc(m,c);u.push({key:`op-${f.op}-${f.path}`,name:`${tn(f.op)} ${m}`,path:(g==null?void 0:g.path)??n.resourceType+"."+m,property:g,originalValue:Uw(g,v),revisedValue:Uw(g,S)})}return u},[o,n,r]);return a?s.jsxs(pe,{className:nm.root,children:[s.jsx(pe.Thead,{children:s.jsxs(pe.Tr,{children:[s.jsx(pe.Th,{}),s.jsx(pe.Th,{children:"Before"}),s.jsx(pe.Th,{children:"After"})]})}),s.jsx(pe.Tbody,{children:a.map(l=>s.jsxs(pe.Tr,{children:[s.jsx(pe.Td,{children:l.name}),s.jsx(pe.Td,{className:nm.removed,children:l.originalValue&&s.jsx(Xr,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),s.jsx(pe.Td,{className:nm.added,children:l.revisedValue&&s.jsx(Xr,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function yV(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 i=e.filter(l=>l.op===r&&l.path===o).length,a={op:r,path:o};i>1&&(r==="add"||r==="remove")&&/\/[0-9-]+$/.test(o)&&(a.op="replace",a.path=o.replace(/\/[^/]+$/,"")),t.some(l=>l.op===a.op&&l.path===a.path)||t.push(a)}return t}function xV(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 bV(e,t){var r;const n=Cl(e,{resourceType:"SearchParameter",base:[e],code:e+"."+t,expression:e+"."+t});return(r=n==null?void 0:n.elementDefinitions)==null?void 0:r[0]}function Uw(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:wV(t,!!(e!=null&&e.isArray))}}function wV(e,t){const n=T6(e).flatMap(r=>r.value);return t?n:n[0]}function x0(e){const{profileUrl:t}=e,n=le(),r=n.getAccessPolicy(),o=St(e.value),[i,a]=p.useState(!1);p.useEffect(()=>{if(o)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{wl(t)?a(!0):console.error(`Schema not found for ${t}`)}).catch(c=>{console.error("Error in requestProfileSchema",c)});else{const c=o.resourceType;n.requestSchema(c).then(()=>{a(!0)}).catch(console.error)}},[n,t,o]);const l=p.useMemo(()=>o&&Sk(o,Hx.READ,r),[r,o]);return!i||!o?null:s.jsx(Pf,{path:o.resourceType,value:{type:o.resourceType,value:e.forceUseInput?e.value:o},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues,accessPolicyResource:l})}const SV="_item_5q6yx_1",jV="_itemPadding_5q6yx_5",Vw={item:SV,itemPadding:jV};function CV(e){return s.jsx(bu,{children:e.children})}function Ms(e){var c,u;const{resource:t,profile:n,padding:r,popupMenuItems:o,...i}=e,a=n??((c=t.meta)==null?void 0:c.author),l=e.dateTime??((u=t.meta)==null?void 0:u.lastUpdated);return s.jsxs(h0,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(te,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Ji,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(me,{size:"sm",children:s.jsx(Pl,{c:"dark",fw:500,value:a,link:!0})}),s.jsxs(me,{size:"xs",children:[s.jsx(We,{c:"dimmed",to:e.resource,children:zn(l)}),s.jsx(me,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(We,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(Z,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(Z.Target,{children:s.jsx(en,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${rt(e.resource)}`,children:s.jsx(xz,{})})}),o]})]}),s.jsx(Vk,{children:s.jsx("div",{className:tt(Vw.item,{[Vw.itemPadding]:r}),children:e.children})})]})}function ER(e,t){e.sort((n,r)=>{const o=Ww(n,t),i=Ww(r,t);return o>i?1:o<i?-1:Hw(n,t)-Hw(r,t)})}function Ww(e,t){if(!TR(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function Hw(e,t){var r;if(!TR(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=(r=e.meta)==null?void 0:r.lastUpdated;return n?new Date(n).getTime():0}function TR(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const EV="_pinnedComment_5uxzi_2",TV={pinnedComment:EV};function Kh(e){const t=le(),n=t.getProfile(),r=p.useRef(null),o=St(e.value),[i,a]=p.useState(),[l,c]=p.useState([]),u=e.loadTimelineResources,d=p.useRef(l);d.current=l;const f=p.useCallback(x=>{ER(x,o),x.reverse(),c(x)},[o]),h=p.useCallback(x=>{const C=[];for(const E of x){if(E.status!=="fulfilled")continue;const T=E.value;if(T.type==="history"&&a(T),T.entry)for(const j of T.entry)C.push(j.resource)}f(C)},[f]),m=p.useCallback(x=>f([...d.current,x]),[f]),g=p.useCallback(()=>{var E;let x,C;"resourceType"in e.value?(x=e.value.resourceType,C=e.value.id):[x,C]=(E=e.value.reference)==null?void 0:E.split("/"),u(t,x,C).then(h).catch(console.error)},[t,e.value,u,h]);p.useEffect(()=>g(),[g]);function v(x){!o||!e.createCommunication||t.createResource(e.createCommunication(o,n,x)).then(C=>m(C)).catch(console.error)}function S(x){!o||!e.createMedia||t.createResource(e.createMedia(o,n,x)).then(C=>m(C)).then(()=>Yl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(Js,{size:16}),autoClose:2e3})).catch(C=>Yl({id:"upload-notification",color:"red",title:"Upload error",message:Ae(C),icon:s.jsx(Dw,{size:16}),autoClose:2e3}))}function b(){ge({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function w(x){Yl({id:"upload-notification",loading:!0,title:"Uploading...",message:AV(x),autoClose:!1,withCloseButton:!1})}function y(x){Yl({id:"upload-notification",color:"red",title:"Upload error",message:Ae(x),icon:s.jsx(Dw,{size:16}),autoClose:2e3})}return o?s.jsxs(CV,{children:[e.createCommunication&&s.jsx(h0,{children:s.jsx(qe,{testid:"timeline-form",onSubmit:x=>{v(x.text);const C=r.current;C&&(C.value="",C.focus())},children:s.jsxs(te,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Ji,{value:n}),s.jsx(ye,{name:"text",ref:r,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(en,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(Pz,{size:16})}),s.jsx(s0,{securityContext:Tt(o),onUpload:S,onUploadStart:b,onUploadProgress:w,onUploadError:y,children:x=>s.jsx(en,{...x,radius:"xl",color:"blue",variant:"filled",children:s.jsx(Xx,{size:16})})})]})})}),l.map(x=>{var T;if(!x)return null;const C=`${x.resourceType}/${x.id}/${(T=x.meta)==null?void 0:T.versionId}`,E=e.getMenu?e.getMenu({primaryResource:o,currentResource:x,reloadTimeline:g}):void 0;if(x.resourceType===o.resourceType&&x.id===o.id)return s.jsx(PV,{history:i,resource:x,popupMenuItems:E},C);switch(x.resourceType){case"AuditEvent":return s.jsx(DV,{resource:x,popupMenuItems:E},C);case"Communication":return s.jsx(RV,{resource:x,popupMenuItems:E},C);case"DiagnosticReport":return s.jsx(IV,{resource:x,popupMenuItems:E},C);case"Media":return s.jsx(_V,{resource:x,popupMenuItems:E},C);default:return s.jsx(Ms,{resource:x,padding:!0,children:s.jsx(x0,{value:x,ignoreMissingValues:!0})},C)}})]}):s.jsx(vn,{style:{width:"100%",height:"100%"},children:s.jsx(er,{})})}function PV(e){const{history:t,resource:n,...r}=e,o=kV(t,n);return o?s.jsx(Ms,{resource:n,padding:!0,...r,children:s.jsx(vV,{original:o,revised:e.resource})}):s.jsxs(Ms,{resource:n,padding:!0,...r,children:[s.jsx("h3",{children:"Created"}),s.jsx(x0,{value:n,ignoreMissingValues:!0,forceUseInput:!0})]})}function kV(e,t){const n=e.entry,r=n.findIndex(o=>{var i,a,l;return((a=(i=o.resource)==null?void 0:i.meta)==null?void 0:a.versionId)===((l=t.meta)==null?void 0:l.versionId)});if(!(r>=n.length-1))return n[r+1].resource}function RV(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:TV.pinnedComment;return s.jsx(Ms,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:e.popupMenuItems,children:s.jsx("p",{children:(o=(r=e.resource.payload)==null?void 0:r[0])==null?void 0:o.contentString})})}function _V(e){var r;const t=(r=e.resource.content)==null?void 0:r.contentType,n=t&&!t.startsWith("image/")&&!t.startsWith("video/")&&t!=="application/pdf";return s.jsx(Ms,{resource:e.resource,padding:!!n,popupMenuItems:e.popupMenuItems,children:s.jsx(vu,{value:e.resource.content})})}function DV(e){return s.jsx(Ms,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(_r,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function IV(e){return s.jsx(Ms,{resource:e.resource,padding:!0,popupMenuItems:e.popupMenuItems,children:s.jsx(f0,{value:e.resource})})}function AV(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${rm(e.loaded)} / ${rm(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${rm(e.loaded)}`}function rm(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 NV(e){const{resource:t,...n}=e;return s.jsx(Kh,{value:t,loadTimelineResources:async(r,o,i)=>{const a=`${o}/${i}`;return Promise.allSettled([r.readHistory(o,i),r.search("Task",{_filter:`based-on eq ${a} or focus eq ${a} or subject eq ${a}`,_count:100})])},...n})}function Me(e){const{children:t,...n}=e;return s.jsx(bu,{children:s.jsx(h0,{...n,children:t})})}function MV(e){const{encounter:t,...n}=e;return s.jsx(Kh,{value:t,loadTimelineResources:async(r,o,i)=>Promise.allSettled([r.readHistory("Encounter",i),r.search("Communication","encounter=Encounter/"+i),r.search("Media","encounter=Encounter/"+i)]),createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",encounter:Tt(r),subject:r.subject,sender:Tt(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",encounter:Tt(r),subject:r.subject,operator:Tt(o),issued:new Date().toISOString(),content:i}),...n})}function OV(e){let t;try{t=jl(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 s.jsx(Xr,{value:t[0]||"",propertyType:e.propertyType})}function Ar(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Yi,{icon:s.jsx(El,{size:16}),color:"red",children:t.map(r=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:YP(r)},(o=r.details)==null?void 0:o.text)})})}function LV(e){return s.jsxs(jn,{title:"Export",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:[s.jsxs(q,{display:"flex",style:{justifyContent:"space-between"},children:[e.exportCsv&&s.jsx(qw,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(qw,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(me,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function qw(e){return s.jsx(ae,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const $V={string:[re.EQUALS,re.NOT,re.CONTAINS,re.EXACT],fulltext:[re.EQUALS,re.NOT,re.CONTAINS,re.EXACT],token:[re.EQUALS,re.NOT],reference:[re.EQUALS,re.NOT],numeric:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS],quantity:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS],date:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS,re.STARTS_AFTER,re.ENDS_BEFORE,re.APPROXIMATELY],datetime:[re.EQUALS,re.NOT_EQUALS,re.GREATER_THAN,re.LESS_THAN,re.GREATER_THAN_OR_EQUALS,re.LESS_THAN_OR_EQUALS,re.STARTS_AFTER,re.ENDS_BEFORE,re.APPROXIMATELY]},FV={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",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 b0(e,t){return{...e,filters:t,offset:0,name:void 0}}function PR(e,t){return b0(e,(e.filters??[]).filter(n=>n.code!==t))}function Yh(e,t,n,r,o){const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),b0(e,i)}function zV(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function BV(e,t){return w0(e,t,-1)}function UV(e,t){return w0(e,t,0)}function VV(e,t){return w0(e,t,1)}function w0(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),j0(e,t,r,o)}function WV(e,t){return S0(e,t,-1)}function HV(e,t){return S0(e,t,0)}function qV(e,t){return S0(e,t,1)}function S0(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),j0(e,t,r,o)}function GV(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),j0(e,t,n,new Date)}function j0(e,t,n,r){return e=PR(e,t),e=Gw(e,t,re.GREATER_THAN_OR_EQUALS,n),e=Gw(e,t,re.LESS_THAN_OR_EQUALS,r),e}function Gw(e,t,n,r){return Yh(e,t,n,r.toISOString())}function Qw(e,t,n=!0){return Yh(e,t,re.MISSING,n.toString())}function QV(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function KV(e,t){const n=e.count??zh,r=(t-1)*n;return QV(e,r)}function YV(e,t,n){return t===XV(e)&&n!==void 0&&n===JV(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function XV(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function JV(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function ZV(e){return $V[e.type]}function C0(e){return FV[e]??""}function Wi(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(tn).join(" "))}function eW(e,t){var r,o;const n=t.name;return n==="id"?e.id:n==="meta.versionId"?(r=e.meta)==null?void 0:r.versionId:n==="_lastUpdated"?zn((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?tW(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?nW(e,t.searchParams[0]):null}function tW(e,t){var i,a,l;const n=((l=(a=(i=t.path)==null?void 0:i.split("."))==null?void 0:a.pop())==null?void 0:l.replaceAll("[x]",""))??"",[r,o]=yu({type:e.resourceType,value:e},n);return r?s.jsx(Xr,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function nW(e,t){const n=Fc(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,o)=>s.jsx(Xr,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function rW(e){const t=p.useRef(!1),[n,r]=p.useState({search:JSON.parse(hr(e.search))}),[o,i]=p.useState(!1);p.useEffect(()=>{r({search:e.search})},[e.search]);const a=p.useMemo(()=>{if(!e.visible)return[];const c=e.search.resourceType,u=ek(c),d=Lx(c);return Oc(oW(u,d)).map(f=>({value:f,label:Wi(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return s.jsx(jn,{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:s.jsx("div",{"data-testid":"overlay-child"})},children:s.jsxs($e,{children:[s.jsx(kh,{style:{width:550},placeholder:"Select fields to display",data:a,value:n.search.fields??[],onChange:l,onDropdownOpen:()=>i(!0),onDropdownClose:()=>i(!1),maxDropdownHeight:"250px",clearButtonProps:{"aria-label":"Clear selection"},clearable:!0,searchable:!0}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function oW(e,t){const n=[],r=new Set,o=new Set;for(const i of Object.keys(e.elements))n.push(i),r.add(i.toLowerCase()),o.add(Wi(i));if(t)for(const i of Object.keys(t)){const a=Wi(i);!r.has(i)&&!o.has(a)&&(n.push(i),r.add(i),o.add(a))}return n}function kR(e){var o;const{resourceType:t,filter:n}=e,r=(o=yo.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===re.EQUALS||n.operator===re.NOT_EQUALS))return s.jsx(Pl,{value:{reference:n.value}});const i=Cl(t,r);if(n.code==="_lastUpdated"||i.type===_o.DATETIME)return s.jsx(s.Fragment,{children:zn(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function RR(e){const t=Cl(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case _o.REFERENCE:return s.jsx(Gh,{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 _o.BOOLEAN:return s.jsx(Dn,{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 _o.DATE:return s.jsx(ye,{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 _o.DATETIME:return s.jsx(As,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case _o.NUMBER:return s.jsx(ye,{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 _o.QUANTITY:return s.jsx(Ns,{name:n,path:"",defaultValue:iW(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(ye,{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 iW(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function sW(e){const[t,n]=p.useState(JSON.parse(hr(e.search))),[r,o]=p.useState(-1),i=p.useRef(t);i.current=t,p.useEffect(()=>{n(JSON.parse(hr(e.search)))},[e.search]);function a(d){n(Yh(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=Lx(l)??{},u=t.filters||[];return s.jsxs(jn,{title:"Filters",closeButtonProps:{"aria-label":"Close"},size:900,opened:e.visible,onClose:e.onCancel,children:[s.jsx("div",{children:s.jsxs("table",{children:[s.jsxs("colgroup",{children:[s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:200}}),s.jsx("col",{style:{width:380}}),s.jsx("col",{style:{width:120}})]}),s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Field"}),s.jsx("th",{children:"Operation"}),s.jsx("th",{children:"Value"}),s.jsx("th",{children:"Actions"})]})}),s.jsxs("tbody",{children:[u.map((d,f)=>f===r?s.jsx(Kw,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[f]=h,n(b0(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(aW,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(zV(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(Kw,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ae,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function aW(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:Wi(t.code)}),s.jsx("td",{children:C0(t.operator)}),s.jsx("td",{children:s.jsx(kR,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(ae,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(ae,{size:"compact-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function Kw(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useRef(t);r.current=t;function o(u){n({...r.current,code:u})}function i(u){n({...r.current,operator:u})}function a(u){n({...r.current,value:u})}const l=e.searchParams[t.code],c=l&&ZV(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(It,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:Wi(u)}))]})}),s.jsx("td",{children:c&&s.jsx(It,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:C0(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(RR,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(ae,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&s.jsx(ae,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function lW(e){const[t,n]=p.useState(e.defaultValue??"");if(!e.visible||!e.searchParam||!e.filter)return null;function r(){e.onOk({...e.filter,value:t})}return s.jsx(jn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(qe,{onSubmit:r,children:s.jsxs(cr,{children:[s.jsx(cr.Col,{span:10,children:s.jsx(RR,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(cr.Col,{span:2,children:s.jsx(ae,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function cW(e){if(!e.searchParams)return null;function t(i,a){o(YV(e.search,i.code,a))}function n(i){o(PR(e.search,i.code))}function r(i,a){e.onPrompt(i,{code:i.code,operator:a,value:""})}function o(i){e.onChange(i)}return e.searchParams.length===1?s.jsx(uW,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):s.jsx(Z.Dropdown,{children:e.searchParams.map(i=>s.jsx(Z.Item,{children:Wi(i.code)},i.code))})}function uW(e){switch(e.searchParam.type){case"date":return s.jsx(dW,{...e});case"number":case"quantity":return s.jsx(fW,{...e});case"reference":return s.jsx(hW,{...e});case"string":return s.jsx(pW,{...e});case"token":case"uri":return s.jsx(mW,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function dW(e){const{searchParam:t}=e,n=t.code;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(Jx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(Z.Item,{leftSection:s.jsx(Zx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(mu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(Uk,{size:14}),onClick:()=>e.onPrompt(t,re.ENDS_BEFORE),children:"Before..."}),s.jsx(Z.Item,{leftSection:s.jsx(Bk,{size:14}),onClick:()=>e.onPrompt(t,re.STARTS_AFTER),children:"After..."}),s.jsx(Z.Item,{leftSection:s.jsx(uz,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Between..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(os,{size:14}),onClick:()=>e.onChange(VV(e.search,n)),children:"Tomorrow"}),s.jsx(Z.Item,{leftSection:s.jsx(os,{size:14}),onClick:()=>e.onChange(UV(e.search,n)),children:"Today"}),s.jsx(Z.Item,{leftSection:s.jsx(os,{size:14}),onClick:()=>e.onChange(BV(e.search,n)),children:"Yesterday"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(os,{size:14}),onClick:()=>e.onChange(qV(e.search,n)),children:"Next Month"}),s.jsx(Z.Item,{leftSection:s.jsx(os,{size:14}),onClick:()=>e.onChange(HV(e.search,n)),children:"This Month"}),s.jsx(Z.Item,{leftSection:s.jsx(os,{size:14}),onClick:()=>e.onChange(WV(e.search,n)),children:"Last Month"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(os,{size:14}),onClick:()=>e.onChange(GV(e.search,n)),children:"Year to date"}),s.jsx(Su,{...e})]})}function fW(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(Jx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(Z.Item,{leftSection:s.jsx(Zx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(mu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT_EQUALS),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(Bk,{size:14}),onClick:()=>e.onPrompt(t,re.GREATER_THAN),children:"Greater than..."}),s.jsx(Z.Item,{leftSection:s.jsx(Ng,{size:14}),onClick:()=>e.onPrompt(t,re.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(Z.Item,{leftSection:s.jsx(Uk,{size:14}),onClick:()=>e.onPrompt(t,re.LESS_THAN),children:"Less than..."}),s.jsx(Z.Item,{leftSection:s.jsx(Ng,{size:14}),onClick:()=>e.onPrompt(t,re.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(Su,{...e})]})}function hW(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(mu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT),children:"Does not equal..."}),s.jsx(Su,{...e})]})}function pW(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(Jx,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(Z.Item,{leftSection:s.jsx(Zx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(mu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT),children:"Does not equal..."}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(hz,{size:14}),onClick:()=>e.onPrompt(t,re.CONTAINS),children:"Contains..."}),s.jsx(Z.Item,{leftSection:s.jsx(fz,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Does not contain..."}),s.jsx(Su,{...e})]})}function mW(e){const{searchParam:t}=e;return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Item,{leftSection:s.jsx(gu,{size:14}),onClick:()=>e.onPrompt(t,re.EQUALS),children:"Equals..."}),s.jsx(Z.Item,{leftSection:s.jsx(mu,{size:14}),onClick:()=>e.onPrompt(t,re.NOT),children:"Does not equal..."}),s.jsx(Su,{...e})]})}function Su(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(lz,{size:14}),onClick:()=>e.onChange(Qw(e.search,n)),children:"Missing"}),s.jsx(Z.Item,{leftSection:s.jsx(az,{size:14}),onClick:()=>e.onChange(Qw(e.search,n,!1)),children:"Not missing"}),s.jsx(Z.Divider,{}),s.jsx(Z.Item,{leftSection:s.jsx(Ef,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const gW="_root_vlout_1",vW="_table_vlout_8",yW="_tr_vlout_12",xW="_th_vlout_18",bW="_control_vlout_22",wW="_icon_vlout_31",Ul={root:gW,table:vW,tr:yW,th:xW,control:bW,icon:wW};function SW(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(jW(t,r));return n}function jW(e,t){var o;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=Ys(e,t),r=W6(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=Lx(e);let a;if(i){const l=new RegExp(`${e}\\.${t.replaceAll("[x]","")}([^\\w-]|$)`);a=Object.values(i).filter(c=>!!c.expression&&l.test(c==null?void 0:c.expression)),a.length===0&&(a=void 0)}return{name:t,elementDefinition:n,searchParams:a}}if(r){const i=Cl(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class CW extends Event{constructor(t){super("change"),this.definition=t}}class EW extends Event{constructor(t){super("load"),this.response=t}}class kf extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function ju(e){var L,B,D;const t=le(),[n,r]=p.useState(),{search:o,onLoad:i}=e,[a,l]=p.useState(o);Ui(o,a)||l(o);const[c,u]=p.useState({selected:{},fieldEditorVisible:!1,filterEditorVisible:!1,exportDialogVisible:!1,filterDialogVisible:!1}),d=p.useRef(c);d.current=c;const f=a.total??"accurate",h=p.useCallback(_=>{r(void 0),t.requestSchema(a.resourceType).then(()=>t.search(a.resourceType,Ia({...a,total:f,fields:void 0}),_)).then(P=>{u({...d.current,searchResponse:P}),i&&i(new EW(P))}).catch(P=>{u({...d.current,searchResponse:void 0}),r(ft(P))})},[t,a,f,i]),m=p.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);p.useEffect(()=>{h()},[h]);function g(_,P){_.stopPropagation();const $=_.target.checked,H={...d.current.selected};$?H[P]=!0:delete H[P],u({...d.current,selected:H})}function v(_){_.stopPropagation();const N=_.target.checked,$={},H=d.current.searchResponse;N&&(H!=null&&H.entry)&&H.entry.forEach(X=>{var ce;(ce=X.resource)!=null&&ce.id&&($[X.resource.id]=!0)}),u({...d.current,selected:$})}function S(){var P,N;const _=d.current;if(!((P=_.searchResponse)!=null&&P.entry)||_.searchResponse.entry.length===0)return!1;for(const $ of _.searchResponse.entry)if((N=$.resource)!=null&&N.id&&!_.selected[$.resource.id])return!1;return!0}function b(_){e.onChange&&e.onChange(new CW(_))}function w(_,P){if(Wk(_.target)||_.button===2)return;xt(_);const N=_.button===1||_.ctrlKey||_.metaKey;!N&&e.onClick&&e.onClick(new kf(P,_)),N&&e.onAuxClick&&e.onAuxClick(new kf(P,_))}function y(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(n)return s.jsx(Ar,{outcome:n});if(!ZP(a.resourceType))return s.jsx(vn,{style:{width:"100%",height:"100%"},children:s.jsx(er,{})});const x=e.checkboxesEnabled,C=SW(a),E=a.resourceType,T=c.searchResponse,j=T==null?void 0:T.entry,R=j==null?void 0:j.map(_=>_.resource),k="subtle",I="gray",O=16,F=window.innerWidth<768;return s.jsxs("div",{className:Ul.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(te,{justify:"space-between",mb:"xl",children:[s.jsxs(te,{gap:2,children:[s.jsx(ae,{size:"compact-md",variant:k,color:I,leftSection:s.jsx(gz,{size:O}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(ae,{size:"compact-md",variant:k,color:I,leftSection:s.jsx(wz,{size:O}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(ae,{size:"compact-md",variant:k,color:I,leftSection:s.jsx(bz,{size:O}),onClick:e.onNew,children:"New..."}),!F&&y()&&s.jsx(ae,{size:"compact-md",variant:k,color:I,leftSection:s.jsx(Vz,{size:O}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!F&&e.onDelete&&s.jsx(ae,{size:"compact-md",variant:k,color:I,leftSection:s.jsx(e0,{size:O}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!F&&e.onBulk&&s.jsx(ae,{size:"compact-md",variant:k,color:I,leftSection:s.jsx(cz,{size:O}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),s.jsxs(te,{gap:2,children:[T&&s.jsxs(me,{size:"xs",c:"dimmed","data-testid":"count-display",children:[_R(a,T).toLocaleString(),"-",_W(a,T).toLocaleString(),T.total!==void 0&&` of ${a.total==="estimate"?"~":""}${(L=T.total)==null?void 0:L.toLocaleString()}`]}),s.jsx(en,{variant:k,color:I,title:"Refresh",onClick:m,children:s.jsx(Mz,{size:O})})]})]}),s.jsxs(pe,{className:Ul.table,children:[s.jsxs(pe.Thead,{children:[s.jsxs(pe.Tr,{children:[x&&s.jsx(pe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:_=>v(_)})}),C.map(_=>s.jsx(pe.Th,{children:s.jsxs(Z,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(Z.Target,{children:s.jsx(Sn,{className:Ul.control,p:2,children:s.jsxs(te,{justify:"space-between",wrap:"nowrap",children:[s.jsx(me,{fw:500,children:Wi(_.name)}),s.jsx(vn,{className:Ul.icon,children:s.jsx(oz,{size:14,stroke:1.5})})]})})}),s.jsx(cW,{search:a,searchParams:_.searchParams,onPrompt:(P,N)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:P,filterDialogFilter:N})},onChange:P=>{b(P)}})]})},_.name))]}),!e.hideFilters&&s.jsxs(pe.Tr,{children:[x&&s.jsx(pe.Th,{}),C.map(_=>s.jsx(pe.Th,{children:_.searchParams&&s.jsx(PW,{resourceType:E,searchParams:_.searchParams,filters:a.filters})},_.name))]})]}),s.jsx(pe.Tbody,{children:R==null?void 0:R.map(_=>_&&s.jsxs(pe.Tr,{className:Ul.tr,"data-testid":"search-control-row",onClick:P=>w(P,_),onAuxClick:P=>w(P,_),children:[x&&s.jsx(pe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${_.id}`,checked:!!c.selected[_.id],onChange:P=>g(P,_.id)})}),C.map(P=>s.jsx(pe.Td,{children:eW(_,P)},P.name))]},_.id))})]}),(R==null?void 0:R.length)===0&&s.jsx(bu,{children:s.jsx(vn,{style:{height:150},children:s.jsx(me,{size:"xl",c:"dimmed",children:"No results"})})}),T&&s.jsx(vn,{m:"md",p:"md",children:s.jsx(eo,{value:kW(a),total:RW(a,T),onChange:_=>b(KV(a,_)),getControlProps:_=>{switch(_){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),s.jsx(rW,{search:a,visible:d.current.fieldEditorVisible,onOk:_=>{b(_),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),s.jsx(sW,{search:a,visible:d.current.filterEditorVisible,onOk:_=>{b(_),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),s.jsx(LV,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),s.jsx(lW,{visible:d.current.filterDialogVisible,title:(B=c.filterDialogSearchParam)!=null&&B.code?Wi(c.filterDialogSearchParam.code):"",resourceType:E,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:_=>{b(Yh(a,_.code,_.operator,_.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(D=c.filterDialogSearchParam)==null?void 0:D.code)]})}const TW=ju;function PW(e){const t=(e.filters??[]).filter(n=>e.searchParams.find(r=>r.code===n.code));return t.length===0?s.jsx("span",{children:"no filters"}):s.jsx(s.Fragment,{children:t.map(n=>s.jsxs("div",{children:[C0(n.operator)," ",s.jsx(kR,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function kW(e){return Math.floor((e.offset??0)/(e.count??zh))+1}function RW(e,t){const n=e.count??zh,r=DR(e,t);return Math.ceil(r/n)}function _R(e,t){return Math.min(DR(e,t),(e.offset??0)+1)}function _W(e,t){var n;return Math.max(_R(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function DR(e,t){var r,o;let n=t.total;return n===void 0&&(n=(e.offset??0)+(((r=t.entry)==null?void 0:r.length)??0)+((o=t.link)!=null&&o.some(i=>i.relation==="next")?1:0)),n}function DW(e){const t=le(),[n,r]=p.useState(!1),[o,i]=p.useState(),{query:a,fields:l}=e,[c,u]=p.useState(),[d,f]=p.useState({}),h=p.useRef();h.current=c;const m=p.useRef({});m.current=d,p.useEffect(()=>{i(void 0),t.graphql(a).then(u).catch(y=>i(ft(y)))},[t,a]);function g(y,x){y.stopPropagation();const E=y.target.checked,T={...m.current};E?T[x]=!0:delete T[x],f(T)}function v(y){var j;y.stopPropagation();const C=y.target.checked,E={},T=(j=h.current)==null?void 0:j.data.ResourceList;C&&T&&T.forEach(R=>{R.id&&(E[R.id]=!0)}),f(E)}function S(){var x;const y=(x=h.current)==null?void 0:x.data.ResourceList;if(!y||y.length===0)return!1;for(const C of y)if(C.id&&!m.current[C.id])return!1;return!0}function b(y,x){Wk(y.target)||(xt(y),y.button!==1&&e.onClick&&e.onClick(new kf(x,y)),y.button===1&&e.onAuxClick&&e.onAuxClick(new kf(x,y)))}if(p.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(er,{});const w=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:y=>xt(y),"data-testid":"search-control",children:[s.jsxs(pe,{children:[s.jsx(pe.Thead,{children:s.jsxs(pe.Tr,{children:[w&&s.jsx(pe.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:y=>v(y)})}),l.map(y=>s.jsx(pe.Th,{children:y.name},y.name))]})}),s.jsx(pe.Tbody,{children:c==null?void 0:c.data.ResourceList.map(y=>y&&s.jsxs(pe.Tr,{"data-testid":"search-control-row",onClick:x=>b(x,y),onAuxClick:x=>b(x,y),children:[w&&s.jsx(pe.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${y.id}`,checked:!!d[y.id],onChange:x=>g(x,y.id)})}),l.map(x=>s.jsx(pe.Td,{children:s.jsx(OV,{propertyType:x.propertyType,path:x.fhirPath,resource:y})},x.name))]},y.id))})]}),(c==null?void 0:c.data.ResourceList.length)===0&&s.jsx("div",{"data-testid":"empty-search",children:"No results"}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),e.onBulk&&s.jsx(ae,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const IW=p.memo(DW);function to(e){return s.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 491 491",style:{width:e.size,height:e.size},children:[s.jsx("title",{children:"Medplum Logo"}),s.jsx("path",{fill:e.fill??"#ad7136",d:"M282 67c6-16 16-29 29-40L289 0c-22 17-37 41-43 68l17 23 19-24z"}),s.jsx("path",{fill:e.fill??"#946af9",d:"M311 63c-17 0-33 4-48 11-16-7-32-11-49-11-87 0-158 96-158 214s71 214 158 214c17 0 33-4 49-11 15 7 31 11 48 11 87 0 158-96 158-214S398 63 311 63z"}),s.jsx("path",{fill:e.fill??"#7857c5",d:"M231 489l-17 2c-87 0-158-96-158-214S127 63 214 63l17 1c-39 12-70 102-70 213s31 201 70 212z"}),s.jsx("path",{fill:e.fill??"#40bc26",d:"M207 220a176 176 0 01-177 43A176 176 0 01251 43l1 5c17 59 2 125-45 172z"}),s.jsx("path",{fill:e.fill??"#33961e",d:"M252 48A421 421 0 0057 270l-27-7A176 176 0 01251 43l1 5z"})]})}function AW(e){const{group:t}=e;return s.jsx(Xn,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(te,{children:[t.measureScore&&s.jsx(OW,{group:t}),!t.measureScore&&s.jsx(MW,{group:t})]})})}function NW(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(me,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(me,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function MW(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>Vi(c.code)==="numerator"),o=n==null?void 0:n.find(c=>Vi(c.code)==="denominator"),i=r==null?void 0:r.count,a=o==null?void 0:o.count;if(a===0)return s.jsxs(q,{children:[s.jsx(ve,{order:3,children:"Not Applicable"}),s.jsx(me,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(q,{children:[s.jsx(ve,{order:3,children:"Insufficient Data"}),s.jsx(me,{children:`Numerator: ${i}`}),s.jsx(me,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(Mh,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:IR(l)}],label:s.jsx(ks,{justify:"center",children:s.jsxs(me,{fw:700,fz:18,children:[i," / ",a]})})})}function OW(e){var r,o,i;const{group:t}=e,n=((r=t.measureScore)==null?void 0:r.unit)??((o=t.measureScore)==null?void 0:o.code);return s.jsx(s.Fragment,{children:n==="%"?s.jsx(Mh,{size:120,thickness:12,roundCaps:!0,sections:[{value:LW(t),color:IR(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(ks,{justify:"center",children:s.jsx(me,{fw:700,fz:18,children:s.jsx(zc,{value:t.measureScore})})})}):s.jsx(ks,{h:120,align:"center",children:s.jsx(ve,{order:3,children:s.jsx(zc,{value:t.measureScore})})})})}function LW(e){var r,o;const t=(r=e.measureScore)==null?void 0:r.value,n=(o=e.measureScore)==null?void 0:o.unit;return t?t<=1&&n==="%"?t*100:t:0}function IR(e){return e<=33?"red":e<=67?"yellow":"green"}function $W(e){var r;const t=St(e.measureReport),[n]=X8("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(q,{children:[n&&s.jsx(NW,{measure:n}),s.jsx(xx,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>s.jsx(AW,{group:o},o.id??i))})]}):null}function FW(e){const{patient:t,...n}=e,r=p.useCallback((o,i,a)=>{const l=`${i}/${a}`,c=100;return Promise.allSettled([o.readHistory("Patient",a),o.search("Communication",{subject:l,_count:c}),o.search("Device",{patient:l,_count:c}),o.search("DeviceRequest",{patient:l,_count:c}),o.search("DiagnosticReport",{subject:l,_count:c}),o.search("Media",{subject:l,_count:c}),o.search("ServiceRequest",{subject:l,_count:c}),o.search("Task",{subject:l,_count:c})])},[]);return s.jsx(Kh,{value:t,loadTimelineResources:r,createCommunication:(o,i,a)=>({resourceType:"Communication",status:"completed",subject:Tt(o),sender:Tt(i),sent:new Date().toISOString(),payload:[{contentString:a}]}),createMedia:(o,i,a)=>({resourceType:"Media",status:"completed",subject:Tt(o),operator:Tt(i),issued:new Date().toISOString(),content:a}),...n})}const zW="_section_14dzq_2",BW="_hovering_14dzq_11",UW="_editing_14dzq_15",VW="_bottomActions_14dzq_20",Aa={section:zW,hovering:BW,editing:UW,bottomActions:VW};function WW(e){const t=le(),n=St(e.value),[r,o]=p.useState(!1),[i,a]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){c(void 0)}function h(){a(void 0)}const m=p.useRef();if(m.current=u,p.useEffect(()=>{t.requestSchema("PlanDefinition").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(d(YW(n??{resourceType:"PlanDefinition",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]),!r||!u)return null;function g(v,S){d({...m.current,[v]:S})}return s.jsx("div",{children:s.jsxs(qe,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(u),children:[s.jsx(ye,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),s.jsx(AR,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),s.jsx(ae,{type:"submit",children:"Save"})]})})}function AR(e){const t=p.useRef();t.current=e.actions;function n(i){e.onChange(t.current.map(a=>a.id===i.id?i:a))}function r(i){e.onChange([...t.current,i]),e.setSelectedKey(i.id)}function o(i){e.onChange(t.current.filter(a=>a!==i))}return s.jsxs("div",{className:Aa.section,children:[e.actions.map(i=>s.jsx("div",{children:s.jsx(HW,{action:i,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:n,onRemove:()=>o(i)})},i.id)),s.jsx("div",{className:Aa.bottomActions,children:s.jsx(Ke,{href:"#",onClick:i=>{xt(i),r({id:MR()})},children:"Add action"})})]})}function HW(e){const{action:t}=e,n=KW(t),r=e.selectedKey===e.action.id,o=e.hoverKey===e.action.id;function i(c){c.stopPropagation(),e.setSelectedKey(e.action.id)}function a(c){xt(c),e.setHoverKey(e.action.id)}const l=tt(Aa.section,{[Aa.editing]:r,[Aa.hovering]:o&&!r});return s.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:a,onFocus:a,children:[r?s.jsx(GW,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(qW,{action:t,actionType:n}),s.jsx("div",{className:Aa.bottomActions,children:s.jsx(Ke,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const Lg={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function qW(e){const{action:t,actionType:n}=e,[r,o]=NR(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(Tf,{value:{reference:t.definitionCanonical}})}),r&&s.jsx("div",{children:s.jsx(Xr,{property:Lg,propertyType:o,value:r})})]})}function GW(e){const{action:t}=e,[n,r]=p.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs($e,{gap:"xl",children:[s.jsx(ye,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(ye,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(It,{label:"Type of Action",description:"The type of the action to be performed.",name:`actionType-${t.id}`,defaultValue:n,onChange:i=>r(i.currentTarget.value),data:["","appointment","lab","questionnaire","task"]}),t.action&&t.action.length>0&&s.jsx(AR,{actions:t.action,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onChange:i=>o("action",i)}),(()=>{switch(n){case"appointment":return s.jsx(hd,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(hd,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(hd,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(hd,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(yt,{title:"Timing",description:"When the action should take place.",children:s.jsx(QW,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function hd(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(Zs,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:rt(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function QW(e){const t=e.action,n="timing",[r,o]=NR(t);return s.jsx(Tl,{property:Lg,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(rR(t,n,a??n,Lg,i))},outcome:void 0})}function KW(e){var t,n,r;if((t=e.definitionCanonical)!=null&&t.startsWith("Schedule"))return"appointment";if((n=e.definitionCanonical)!=null&&n.startsWith("Questionnaire/"))return"questionnaire";if((r=e.definitionCanonical)!=null&&r.startsWith("ActivityDefinition/"))return"task"}function NR(e){return yu({type:"PlanDefinitionAction",value:e},"timing")}let om=1;function MR(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(om=Math.max(om,t+1))}return e}return"id-"+om++}function YW(e){return{...e,action:OR(e.action)}}function OR(e){if(e)return e.map(t=>({...t,id:MR(t.id),action:OR(t.action)}))}var Ct=(e=>(e.group="group",e.display="display",e.question="question",e.boolean="boolean",e.decimal="decimal",e.integer="integer",e.date="date",e.dateTime="dateTime",e.time="time",e.string="string",e.text="text",e.url="url",e.choice="choice",e.openChoice="open-choice",e.attachment="attachment",e.reference="reference",e.quantity="quantity",e))(Ct||{});function XW(e){return e.type==="choice"||e.type==="open-choice"}function JW(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=LR(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:a}=tH(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!a)return!1}return n!=="any"}function ZW(e,t,n){return e.map(r=>{var a;const o=(a=n.answerOption)==null?void 0:a.find(l=>Ks(l.valueCoding)===r||l[t]===r),i=xn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function LR(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=LR(n.item,t);if(r)return r}}}function eH(e,t,n){if(n==="exists")return!!e===t.value;if(e){const r=n==="="||n==="!="?n==null?void 0:n.replace("=","~"):n,[{value:o}]=Fc(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function tH(e,t,n){const r=t||[],o=xn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of r){const c=xn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(eH(c,o,u)?i=!0:a=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:a}}function $R(e){var n,r;const t=Sl(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");if(t){if(t.valueCode!==void 0)return[t.valueCode];if(t.valueCodeableConcept)return(r=(n=t.valueCodeableConcept)==null?void 0:n.coding)==null?void 0:r.map(o=>o.code)}}function im(e,t){var o;const n=Kr(e);let r=Sl(n,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource");return!t||t.length===0?(r&&(n.extension=(o=n.extension)==null?void 0:o.filter(i=>i!==r)),n):(r||(n.extension||(n.extension=[]),r={url:"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceResource"},n.extension.push(r)),t.length===1?(r.valueCode=t[0],delete r.valueCodeableConcept):(r.valueCodeableConcept={coding:t.map(i=>({code:i}))},delete r.valueCode),n)}function nH(e,t,n){const r=Sl(e,"http://hl7.org/fhir/StructureDefinition/questionnaire-referenceFilter");if(!(r!=null&&r.valueString))return;let o=r.valueString;t!=null&&t.reference&&(o=o.replaceAll("$subj",t.reference)),n!=null&&n.reference&&(o=o.replaceAll("$encounter",n.reference));const i={},a=o.split("&");for(const l of a){const[c,u]=Pg(l,"=",2);i[c]=u}return i}function rH(e){return{resourceType:"QuestionnaireResponse",questionnaire:rt(e),item:FR(e.item),status:"in-progress"}}function FR(e){return(e==null?void 0:e.map(zR))??[]}function zR(e){var t;return{id:iH(),linkId:e.linkId,text:e.text,item:FR(e.item),answer:((t=e.initial)==null?void 0:t.map(sH))??[]}}let oH=1;function iH(){return"id-"+oH++}function sH(e){return{...e}}function aH(e){return e.value.display||e.value.reference||hr(e.value)}function lH(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const a=Sl(t,"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl");if(((i=(o=(r=a==null?void 0:a.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="page")return e.item.length}return 1}const BR=p.createContext({});function $g(e){const t=p.useContext(BR),n=e.item,r=e.response;function o(u){var f,h,m,g;let d;Array.isArray(u)?d=u:e.index>=(((h=(f=e.response)==null?void 0:f.answer)==null?void 0:h.length)??0)?d=(((m=e.response)==null?void 0:m.answer)??[]).concat([u]):d=(((g=e.response)==null?void 0:g.answer)??[]).map((S,b)=>b===e.index?u:S)??[],e.onChange({id:r==null?void 0:r.id,linkId:r==null?void 0:r.linkId,text:n.text,answer:d})}const i=n.type;if(!i)return null;const a=n.linkId;if(!a)return null;const l=n.initial&&n.initial.length>0?n.initial[0]:void 0,c=E0(r,e.index)??xn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case Ct.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case Ct.boolean:return s.jsx(tR,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Dn,{id:e.item.linkId,name:e.item.linkId,defaultChecked:c==null?void 0:c.value,onChange:u=>o({valueBoolean:u.currentTarget.checked})})},e.item.linkId);case Ct.decimal:return s.jsx(ye,{type:"number",step:"any",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDecimal:u.currentTarget.valueAsNumber})});case Ct.integer:return s.jsx(ye,{type:"number",step:1,id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueInteger:u.currentTarget.valueAsNumber})});case Ct.date:return s.jsx(ye,{type:"date",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case Ct.dateTime:return s.jsx(As,{name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case Ct.time:return s.jsx(ye,{type:"time",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case Ct.string:case Ct.url:return s.jsx(ye,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case Ct.text:return s.jsx(Hs,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case Ct.attachment:return s.jsx(te,{py:4,children:s.jsx(Gk,{path:"",name:a,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case Ct.reference:return s.jsx(Gh,{name:a,required:n.required,targetTypes:$R(n),searchCriteria:nH(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case Ct.quantity:return s.jsx(Ns,{path:"",name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case Ct.choice:case Ct.openChoice:return pH(n)&&!n.answerValueSet?s.jsx(cH,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):s.jsx(uH,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function cH(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return s.jsx(UR,{});const i=xn({type:"QuestionnaireItemInitial",value:r},"value"),a=[""];for(const u of n.answerOption){const d=xn({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(Yw(d))}const l=E0(o)??i;if(n.repeats){const{propertyName:u,data:d}=mH(e.item),f=fH(o);return s.jsx(kh,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[Yw(i)],onChange:h=>{const m=ZW(h,u,n);e.onChangeAnswer(m)}})}return s.jsx(It,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=xn({type:"QuestionnaireItemAnswerOption",value:f},"value"),m="value"+tn(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:Ks(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function uH(e){var a;const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e;return!((a=n.answerOption)!=null&&a.length)&&!n.answerValueSet?s.jsx(UR,{}):n.answerValueSet?s.jsx(oR,{path:"",name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===Ct.openChoice}):s.jsx(dH,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function dH(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,a=Ys("QuestionnaireItemAnswerOption","value[x]"),l=xn({type:"QuestionnaireItemInitial",value:r},"value"),c=[];let u;if(n.answerOption)for(let h=0;h<n.answerOption.length;h++){const m=n.answerOption[h],g=`${t}-option-${h}`,v=xn({type:"QuestionnaireItemAnswerOption",value:m},"value");v!=null&&v.value&&(l&&hr(v)===hr(l)&&(u=g),c.push([g,v]))}const d=E0(i),f=hH(c,d);return s.jsx(Ds.Group,{name:t,value:f??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],v="value"+tn(g.type);o({[v]:g.value})}},children:c.map(([h,m])=>s.jsx(Ds,{id:h,value:h,py:4,label:s.jsx(Xr,{property:a,propertyType:m.type,value:m.value})},h))})}function UR(){return s.jsx(ye,{disabled:!0,placeholder:"No Answers Defined"})}function VR(e){return xn({type:"QuestionnaireItemAnswer",value:e},"value")}function E0(e,t=0){const n=e.answer;return VR((n==null?void 0:n[t])??{})}function fH(e){const t=e.answer;return t?t.map(r=>VR(r)).map(r=>Ks(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function hH(e,t){var n;return(n=e.find(r=>Ui(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function Yw(e){if(e)return e.type==="CodeableConcept"?Vi(e.value):e.type==="Coding"?Ks(e.value):e.type==="Reference"?aH(e):e.value.toString()}function pH(e){var t;return!!((t=e.extension)!=null&&t.some(n=>{var r,o,i;return n.url==="http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl"&&((i=(o=(r=n.valueCodeableConcept)==null?void 0:r.coding)==null?void 0:o[0])==null?void 0:i.code)==="drop-down"}))}function mH(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=xn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+tn(n.type),o=(e.answerOption??[]).map(a=>({value:Xw(a,r),label:Xw(a,r)}));return{propertyName:r,data:o}}function Xw(e,t){var n;return Ks(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const gH="_section_cpwxo_1",vH="_hovering_cpwxo_10",yH="_editing_cpwxo_14",xH="_questionBody_cpwxo_19",bH="_topActions_cpwxo_23",wH="_bottomActions_cpwxo_32",SH="_movementActions_cpwxo_43",jH="_movementIcons_cpwxo_55",CH="_columnAlignment_cpwxo_59",EH="_linkIdInput_cpwxo_64",TH="_typeSelect_cpwxo_69",yr={section:gH,hovering:vH,editing:yH,questionBody:xH,topActions:bH,bottomActions:wH,movementActions:SH,movementIcons:jH,columnAlignment:CH,linkIdInput:EH,typeSelect:TH};function PH(e){const t=le(),n=St(e.questionnaire),[r,o]=p.useState(!1),[i,a]=p.useState(),[l,c]=p.useState(),[u,d]=p.useState();function f(){d(void 0)}function h(){c(void 0)}p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>(a(DH(n??{resourceType:"Questionnaire",status:"active"})),document.addEventListener("mouseover",f),document.addEventListener("click",h),()=>{document.removeEventListener("mouseover",f),document.removeEventListener("click",h)}),[n]);const m=(g,v)=>{a(g),e.autoSave&&!v&&e.onSubmit&&e.onSubmit(g)};return!r||!i?null:s.jsx("div",{children:s.jsxs(qe,{testid:"questionnaire-form",onSubmit:()=>e.onSubmit(i),children:[s.jsx(WR,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),s.jsx(ae,{type:"submit",children:"Save"})]})})}function WR(e){var y;const t=e.item,n=e.item,r=ri(e.item),o=r||n.type===Ct.group,i=n.linkId??"[untitled]",a=e.selectedKey===e.item.id,l=e.hoverKey===e.item.id,c=p.useRef();c.current=e.item;function u(x){xt(x),e.setSelectedKey(e.item.id)}function d(x){xt(x),e.setHoverKey(e.item.id)}function f(x){var E;const C=c.current;e.onChange({...C,item:(E=C.item)==null?void 0:E.map(T=>T.id===x.id?x:T)})}function h(x,C){e.onChange({...e.item,item:[...e.item.item??[],x]},C)}function m(x){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.filter(E=>E!==x)})}function g(x,C){e.onChange({...c.current,[x]:C})}function v(x){e.onChange({...e.item,...x})}function S(x){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.map(E=>E===x?{...E,repeats:!E.repeats}:E)})}function b(x,C){const E=NH(e.item.item,x,C);e.onChange({...e.item,item:E})}const w=tt(yr.section,{[yr.editing]:a,[yr.hovering]:l&&!a});return s.jsxs("div",{"data-testid":n.linkId,className:w,onClick:u,onMouseOver:d,onFocus:d,children:[s.jsx("div",{className:yr.questionBody,children:a?s.jsxs(s.Fragment,{children:[r&&s.jsx(ye,{size:"xl",defaultValue:t.title,onBlur:x=>g("title",x.currentTarget.value)}),!r&&s.jsx(Hs,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:x=>g("text",x.currentTarget.value)}),n.type==="reference"&&s.jsx(_H,{item:n,onChange:v}),XW(n)&&s.jsx(kH,{item:n,onChange:x=>v(x)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(ve,{children:t.title}),n.text&&s.jsx("div",{children:n.text}),!o&&s.jsx($g,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(y=n.item)==null?void 0:y.map((x,C)=>s.jsx("div",{children:s.jsx(WR,{item:x,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,isFirst:C===0,isLast:C===(e.item.item??[]).length-1,setHoverKey:e.setHoverKey,onChange:f,onRemove:()=>m(x),onRepeatable:S,onMoveUp:()=>b(C,-1),onMoveDown:()=>b(C,1)})},x.id)),!o&&s.jsx("div",{className:yr.topActions,children:a?s.jsxs(s.Fragment,{children:[s.jsx(ye,{size:"xs",className:yr.linkIdInput,defaultValue:n.linkId,onBlur:x=>g("linkId",x.currentTarget.value)}),!o&&s.jsx(It,{size:"xs",className:yr.typeSelect,defaultValue:n.type,onChange:x=>g("type",x.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"}]})]}):s.jsx("div",{children:i})}),!r&&s.jsx(q,{className:yr.movementActions,children:s.jsxs(q,{className:yr.columnAlignment,children:[!e.isFirst&&s.jsx(Ke,{href:"#",onClick:x=>{x.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(sz,{"data-testid":"up-button",size:15,className:yr.movementIcons})}),!e.isLast&&s.jsx(Ke,{href:"#",onClick:x=>{x.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(iz,{"data-testid":"down-button",size:15,className:yr.movementIcons})})]})}),s.jsxs("div",{className:yr.bottomActions,children:[o&&s.jsxs(s.Fragment,{children:[s.jsx(Ke,{href:"#",onClick:x=>{x.preventDefault(),h({id:Os(),linkId:Bg("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Ke,{href:"#",onClick:x=>{x.preventDefault(),h({id:Os(),linkId:Bg("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Ke,{href:"#",onClick:x=>{x.preventDefault(),h(AH(),!0)},children:"Add Page"}),a&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Ke,{href:"#",onClick:x=>{x.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Ke,{href:"#",onClick:x=>{x.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function kH(e){const t=Ys("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(ye,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(RH,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(q,{display:"flex",children:[s.jsx(Ke,{href:"#",onClick:r=>{xt(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:Os()}]})},children:"Add choice"}),s.jsx(Oh,{w:"lg"}),s.jsx(Ke,{href:"#",onClick:r=>{xt(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function RH(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=yu({type:"QuestionnaireItemAnswerOption",value:t},"value");return s.jsxs("div",{style:{display:"flex",flexDirection:"row",justifyContent:"space-between",alignItems:"center",width:"80%"},children:[s.jsx("div",{children:s.jsx(Tl,{name:"value[x]",path:"Questionnaire.answerOption.value[x]",property:e.property,defaultPropertyType:r,defaultValue:n,onChange:(o,i)=>{const a=[...e.options],l=a.findIndex(c=>c.id===t.id);a[l]={id:t.id,[i]:o},e.onChange({...e.item,answerOption:a})},outcome:void 0},t.id)}),s.jsx("div",{children:s.jsx(Ke,{href:"#",onClick:o=>{xt(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function _H(e){const t=$R(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(te,{children:[s.jsx(o0,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(im(e.item,t.map(i=>i===n?o:i)))}}),s.jsx(Ke,{href:"#",onClick:o=>{xt(o),e.onChange(im(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Ke,{href:"#",onClick:n=>{xt(n),e.onChange(im(e.item,[...t,""]))},children:"Add Resource Type"})]})}let Fg=1,zg=1;function Bg(e){return e+Fg++}function Os(){return"id-"+zg++}function DH(e){return{...e,id:e.id||Os(),item:HR(e.item)}}function HR(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(zg=Math.max(zg,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(Fg=Math.max(Fg,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||Os(),item:HR(t.item),answerOption:IH(t.answerOption)}))}function IH(e){if(e)return e.map(t=>({...t,id:t.id||Os()}))}function AH(){return{id:Os(),linkId:Bg("s"),type:"group",text:"New Page",extension:[{url:"http://hl7.org/fhir/StructureDefinition/questionnaire-itemControl",valueCodeableConcept:{coding:[{system:"http://hl7.org/fhir/questionnaire-item-control",code:"page"}]}}]}}function NH(e,t,n){const r=e??[],o=t+n;if(o<0||o>=r.length)return r;const i=[...r];return[i[t],i[o]]=[i[o],i[t]],i}function qR(e){const{item:t,response:n,onChange:r}=e,[o,i]=p.useState(MH(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===Ct.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==Ct.choice&&t.type!==Ct.openChoice;return t.type===Ct.boolean?s.jsx($g,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):s.jsxs(yt,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx($g,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Ke,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function MH(e,t){if(e.type===Ct.choice||e.type===Ct.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function GR(e){const[t,n]=p.useState(e.response);if(t.length===0)return null;function r(i,a){const l=t.map((c,u)=>u===a?i[0]:c);n(l),e.onChange(l)}function o(){const i=zR(e.item);n([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx(QR,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,a)},i.id)),e.item.repeats&&s.jsx(Ke,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function QR(e){var i;const{response:t,checkForQuestionEnabled:n,onChange:r}=e;function o(a){var d;const l=(d=t.item)==null?void 0:d.map(f=>a.find(m=>m.id===f.id)??f),c=l==null?void 0:l.concat(a.slice(1)),u={...t,item:c};r([u])}return e.checkForQuestionEnabled(e.item)?s.jsxs("div",{children:[e.item.text&&s.jsx(ve,{order:3,mb:"md",children:e.item.text}),s.jsx($e,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===Ct.group?a.repeats?s.jsx(GR,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:n,onChange:o},a.linkId):s.jsx(QR,{item:a,checkForQuestionEnabled:n,response:((c=t.item)==null?void 0:c.find(d=>d.linkId===a.linkId))??{linkId:a.linkId},onChange:o},a.linkId):s.jsx(qR,{item:a,response:(u=t.item)==null?void 0:u.find(d=>d.linkId===a.linkId),onChange:o,checkForQuestionEnabled:n},a.linkId)})})]},e.item.linkId):null}function OH(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,excludeButtons:d,checkForQuestionEnabled:f}=e,h=t.map(m=>{var S;const g=((S=n==null?void 0:n.item)==null?void 0:S.filter(b=>b.linkId===m.linkId))??[],v=m.type===Ct.group?s.jsx(GR,{item:m,response:g,onChange:o,checkForQuestionEnabled:f},m.linkId):s.jsx(qR,{item:m,response:g==null?void 0:g[0],onChange:o,checkForQuestionEnabled:f},m.linkId);return c?s.jsx(ol.Step,{label:m.text,children:v},m.linkId):v});return s.jsxs(s.Fragment,{children:[c&&s.jsx(ol,{active:r??0,allowNextStepsSelect:!1,p:6,children:h}),!c&&s.jsx($e,{children:h}),!d&&s.jsx(LH,{activePage:r??0,numberOfPages:l,nextStep:c?i:void 0,prevStep:c?a:void 0,renderPages:c,submitButtonText:u})]})}function LH(e){const t=e.renderPages&&e.activePage>0,n=e.renderPages&&e.activePage<e.numberOfPages-1,r=!e.renderPages||e.activePage===e.numberOfPages-1;return s.jsxs(te,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(ae,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(ae,{onClick:o=>{const i=o.currentTarget.closest("form");e.nextStep&&i.reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(ae,{type:"submit",children:e.submitButtonText??"Submit"})]})}function KR(e){const t=le(),n=t.getProfile(),[r,o]=p.useState(!1),i=St(e.questionnaire),[a,l]=p.useState(),[c,u]=p.useState(0),{onChange:d}=e;p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>{l(i?rH(i):void 0)},[i]);const f=p.useCallback(S=>{l(b=>{const w=(b==null?void 0:b.item)??[],x={resourceType:"QuestionnaireResponse",status:"in-progress",item:YR(w,Array.isArray(S)?S:[S])};if(d)try{d(x)}catch(C){console.error("Error invoking QuestionnaireForm.onChange callback",C)}return x})},[d]);function h(S){return JW(S,(a==null?void 0:a.item)??[])}if(!r||!i||!a)return null;const m=lH(i),g=()=>u(S=>S+1),v=()=>u(S=>S-1);return s.jsx(BR.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(qe,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:rt(i),subject:e.subject,source:Tt(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(ve,{children:i.title}),s.jsx(OH,{items:i.item??[],response:a,onChange:f,renderPages:!e.disablePagination&&m>1,activePage:c,numberOfPages:m,excludeButtons:e.excludeButtons,submitButtonText:e.submitButtonText,checkForQuestionEnabled:h,nextStep:g,prevStep:v})]})})}function $H(e,t){const n=YR(e.item??[],t.item??[]);return{...t,item:n.length>0?n:void 0,answer:t.answer&&t.answer.length>0?t.answer:e.answer}}function YR(e,t){const n=[],r=new Set;for(const o of e){const i=o.id,a=t.find(l=>l.id===i);a?(n.push($H(o,a)),r.add(a.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const FH="_section_4m5it_1",zH={section:FH},BH=["gender","age","gestationalAge","context","appliesTo","category"],UH={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function VH(e){e=Object.assign(UH,e);const t=e.definition,[n,r]=p.useState([]),[o,i]=p.useState(1),[a,l]=p.useState(1);return p.useEffect(()=>{const g=qH(t,l);r(GH(g.qualifiedInterval||[],i))},[t]),s.jsxs(qe,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx($e,{children:n.map(g=>{var v;return s.jsx(WH,{unit:KH((v=t.quantitativeDetails)==null?void 0:v.unit),onChange:f,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),s.jsx(en,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{xt(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:s.jsx(Cf,{})}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(v=>v.intervals).filter(v=>!YH(v));e.onSubmit({...t,qualifiedInterval:g})}function u(g){r(v=>[...v,g])}function d(g){r(v=>v.filter(S=>S.id!==g.id))}function f(g,v){r(S=>{S=[...S];const b=S.find(y=>y.id===g),w=b==null?void 0:b.intervals.findIndex(y=>y.id===v.id);return w!==void 0&&(b!=null&&b.intervals[w])&&(b.intervals[w]=v),S})}function h(g,v){v.id===void 0&&(v.id=`id-${a}`,l(S=>S+1)),r(S=>{S=[...S];const b=S.findIndex(w=>w.id===g);if(b!==-1){const w={...S[b]};v={...v,...w.filters},w.intervals=[...w.intervals,v],S[b]=w}return S})}function m(g,v){r(S=>{S=[...S];const b=S.find(w=>w.id===g);return b&&(b.intervals=b.intervals.filter(w=>w.id!==v.id)),S})}}function WH(e){const{intervalGroup:t,unit:n}=e;return s.jsx(bu,{"data-testid":t.id,className:zH.section,children:s.jsxs($e,{gap:"lg",children:[s.jsx(te,{justify:"flex-end",children:s.jsx(en,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{xt(r),e.onRemoveGroup(t)},children:s.jsx(jf,{})},`remove-group-button-${t.id}`)}),s.jsx(HH,{intervalGroup:t,onChange:e.onChange}),s.jsx(dn,{}),t.intervals.map(r=>s.jsxs($e,{gap:"xs",children:[s.jsxs(te,{children:[s.jsx(ye,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{xt(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(en,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{xt(o),e.onRemove(t.id,r)},children:s.jsx(jf,{})},`remove-interval-${r.id}`)]}),s.jsx(l0,{path:"",onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(en,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{xt(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Cf,{})})]})})}function HH(e){var r,o;const{intervalGroup:t,onChange:n}=e;t.filters.age||(t.filters.age={});for(const i of["low","high"])(r=t.filters.age[i])!=null&&r.unit||(t.filters.age[i]={...t.filters.age[i],unit:"years",system:"http://unitsofmeasure.org"});return s.jsxs($e,{style:{maxWidth:"50%"},children:[s.jsx(te,{children:s.jsx(It,{data:["","male","female"],label:"Gender:",defaultValue:t.filters.gender||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""&&(l=void 0),n(t.id,{...a,gender:l})}}})}),s.jsxs(te,{gap:"xs",children:[s.jsx(me,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(l0,{path:"",name:`age-${t.id}`,defaultValue:t.filters.age,onChange:i=>{for(const a of t.intervals)n(t.id,{...a,age:i})}},`age-${t.id}`)})]}),s.jsx(It,{data:["","pre-puberty","follicular","midcycle","luteal","postmenopausal"],label:"Endocrine:",defaultValue:((o=t.filters.context)==null?void 0:o.text)||"",onChange:i=>{for(const a of t.intervals){let l=i.currentTarget.value;l===""?(l=void 0,n(t.id,{...a,context:void 0})):n(t.id,{...a,context:{text:l,coding:[{code:l,system:"http://terminology.hl7.org/CodeSystem/referencerange-meaning"}]}})}}}),s.jsx(It,{data:["","reference","critical","absolute"],label:"Category: ",defaultValue:t.filters.category,onChange:i=>{for(const a of t.intervals){const l=i.currentTarget.value;l===""?n(t.id,{...a,category:void 0}):n(t.id,{...a,category:l})}}})]})}function qH(e,t){const n=e.qualifiedInterval||[];let r=Math.max(...n.map(o=>{var a;const i=parseInt(((a=o.id)==null?void 0:a.substring(3))||"",10);return isNaN(i)?Number.NEGATIVE_INFINITY:i}))+1;return Number.isFinite(r)||(r=1),e={...e,qualifiedInterval:n.map(o=>({...o,id:o.id||`id-${r++}`}))},t(r),e}function GH(e,t){let n=1;const r={};for(const o of e){const i=QH(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(BH.map(a=>[a,o[a]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function QH(e){var n,r;return[`gender=${e.gender}`,`age=${Lc(e.age)}`,`gestationalAge=${Lc(e.gestationalAge)}`,`context=${(n=e.context)==null?void 0:n.text}`,`appliesTo=${(r=e.appliesTo)==null?void 0:r.map(o=>o.text).join("+")}`,`category=${e.category}`].join(":")}function KH(e){return e&&(E6(e,"http://unitsofmeasure.org")||e.text)}function YH(e){var t,n,r,o;return((n=(t=e.range)==null?void 0:t.low)==null?void 0:n.value)===void 0&&((o=(r=e.range)==null?void 0:r.high)==null?void 0:o.value)===void 0}function XH(e){var u;const t=le(),n=St(e.value),[r,o]=p.useState(!1),[i,a]=p.useState();if(p.useEffect(()=>{n&&!r&&(t.executeBatch(l(n)).then(a).catch(console.log),o(!0))},[t,n,r]),!n||!i)return null;return s.jsx(cr,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var v,S,b,w,y,x;const h=d.resource&&c(d.resource),m=(S=(v=h==null?void 0:h.input)==null?void 0:v[0])==null?void 0:S.valueReference,g=(w=(b=h==null?void 0:h.output)==null?void 0:b[0])==null?void 0:w.valueReference;return s.jsxs(p.Fragment,{children:[s.jsx(cr.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(mz,{}):s.jsx(zz,{color:"gray"})}),s.jsxs(cr.Col,{span:9,p:"xs",children:[s.jsx(me,{fw:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(Pl,{value:(y=h==null?void 0:h.meta)==null?void 0:y.author})," on ",zn((x=h==null?void 0:h.meta)==null?void 0:x.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(d0,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(cr.Col,{span:2,p:"md",children:[m&&!g&&s.jsx(ae,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&g&&s.jsx(ae,{onClick:()=>e.onEdit(h,m,g),children:"Edit"})]})]},`action-${f}`)})});function l(d){var h;const f=[];if(d.action)for(const m of d.action)(h=m.resource)!=null&&h.reference&&f.push({request:{method:"GET",url:m.resource.reference}});return{resourceType:"Bundle",type:"batch",entry:f}}function c(d){for(const f of i==null?void 0:i.entry)if(f.resource&&d.reference===rt(f.resource))return f.resource}}function XR(e,t){const n=JH(e,t);return ZH(n,e,t)}function JH(e,t){const n=e.length,r=t.length,o=n+r+1,i=1+2*o,a=i/2|0,l=new Array(i);l[a+1]={i:0,j:-1,prev:void 0,snake:!0};for(let c=0;c<o;c++){for(let u=-c;u<=c;u+=2){const d=a+u,f=d+1,h=d-1,m=l[f],g=l[h];let v,S=0;u===-c||u!==c&&g.i<m.i?(S=m.i,v=m):(S=g.i+1,v=g),l[h]=void 0;let b=S-u,w={i:S,j:b,prev:eq(v),snake:!1};for(;S<n&&b<r&&e[S]===t[b];)S++,b++;if(S>w.i&&(w={i:S,j:b,prev:w,snake:!0}),l[d]=w,S>=n&&b>=r)return l[d]}l[a+c-1]=void 0}}function ZH(e,t,n){const r=[];let o=e;for(o.snake&&(o=o.prev);o!=null&&o.prev&&o.prev.j>=0;){const i=o.i,a=o.j;o=o.prev;const l=o.i,c=o.j,u={position:l,lines:t.slice(l,i)},d={position:c,lines:n.slice(c,a)};let f;u.lines.length===0&&d.lines.length>0?f="insert":u.lines.length>0&&d.lines.length===0?f="delete":f="change",r.push({original:u,revised:d,type:f}),o.snake&&(o=o.prev)}return r}function eq(e){return e&&!e.snake&&e.prev?e.prev:e}function tq(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:hr(r.resource,!0).match(/[^\r\n]+/g)}}).sort((r,o)=>r.meta.lastUpdated.localeCompare(o.meta.lastUpdated)),n=t[0].lines.map(r=>({id:t[0].meta.versionId,meta:t[0].meta,value:r,span:1}));return nq(n,t),rq(n),n}function nq(e,t){for(let n=1;n<t.length;n++){const r=XR(t[n-1].lines,t[n].lines);for(const o of r){const i=o.original.position,a=o.original.lines,l=o.revised.lines;if((o.type==="delete"||o.type==="change")&&e.splice(i,a.length),o.type==="insert"||o.type==="change")for(let c=0;c<o.revised.lines.length;c++)e.splice(i+c,0,{id:t[n].meta.versionId,meta:t[n].meta,value:l[c],span:1})}}}function rq(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 oq="_container_1oj0p_1",iq="_root_1oj0p_5",sq="_startRow_1oj0p_20",aq="_normalRow_1oj0p_24",lq="_author_1oj0p_28",cq="_dateTime_1oj0p_32",uq="_lineNumber_1oj0p_37",dq="_line_1oj0p_37",fq="_pre_1oj0p_52",To={container:oq,root:iq,startRow:sq,normalRow:aq,author:lq,dateTime:cq,lineNumber:uq,line:dq,pre:fq};function hq(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function pq(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return ma(n,"year");const r=Math.floor(t/2592e3);if(r>0)return ma(r,"month");const o=Math.floor(t/86400);if(o>0)return ma(o,"day");const i=Math.floor(t/3600);if(i>0)return ma(i,"hour");const a=Math.floor(t/60);return a>0?ma(a,"minute"):ma(t,"second")}function ma(e,t){return`${e} ${e===1?t:t+"s"} ago`}function mq(e){var a,l;const t=le(),[n,r]=p.useState(e.history);if(p.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 s.jsx("div",{children:"Loading..."});const o=(l=(a=n.entry)==null?void 0:a[0])==null?void 0:l.resource;if(!o)return null;const i=tq(n);return s.jsx("div",{className:To.container,children:s.jsx("table",{className:To.root,children:s.jsx("tbody",{children:i.map((c,u)=>s.jsxs("tr",{className:c.span>0?To.startRow:To.normalRow,children:[c.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:To.author,rowSpan:c.span,children:s.jsx(Ha,{value:c.meta.author,link:!0})}),s.jsx("td",{className:To.dateTime,rowSpan:c.span,children:s.jsx(We,{to:hq(o,c.meta.versionId),children:pq(c.meta.lastUpdated)})})]}),s.jsx("td",{className:To.lineNumber,children:u+1}),s.jsx("td",{className:To.line,children:s.jsx("pre",{className:To.pre,children:c.value})})]},"row-"+u))})})})}const gq="_removed_mgz0k_2",vq="_added_mgz0k_7",Jw={removed:gq,added:vq};function yq(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=hr(t,!0).match(/[^\r\n]+/g),o=hr(n,!0).match(/[^\r\n]+/g),i=XR(r,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(xq,{delta:a},"delta"+l))})}function xq(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:Jw.removed,children:e.delta.original.lines.join(`
|
|
542
|
-
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:Jw.added,children:e.delta.revised.lines.join(`
|
|
543
|
-
`)}),"...",s.jsx("br",{})]})}const bq="_splitButton_1i0gi_1",wq="_menuControl_1i0gi_6",Zw={splitButton:bq,menuControl:wq};function Rf(e){const{outcome:t}=e,n=le(),r=St(e.defaultValue),o=r==null?void 0:r.resourceType,[i,a]=p.useState(!1),[l,c]=p.useState(),u=n.getAccessPolicy(),d=At();p.useEffect(()=>{if(r)if(e.profileUrl){const m=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const g=wl(m);if(g){a(!0);const v=q8(r,g);c(v)}else console.error(`Schema not found for ${m}`)}).catch(g=>{console.error("Error in requestProfileSchema",g)})}else n.requestSchema(o).then(()=>{c(r),a(!0)}).catch(console.log)},[n,r,o,e.profileUrl]);const f=p.useMemo(()=>r&&Sk(r,Hx.READ,u),[u,r]),h=p.useMemo(()=>n.isSuperAdmin()||!u||!$t(l==null?void 0:l.resourceType)?!0:JF(u,l==null?void 0:l.resourceType),[n,u,l==null?void 0:l.resourceType]);return!i||!l?s.jsx("div",{children:"Loading..."}):h?s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:m=>{m.preventDefault(),e.onSubmit&&e.onSubmit(l)},children:[s.jsxs($e,{mb:"xl",children:[s.jsx(yt,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(ye,{name:"resourceType",defaultValue:l.resourceType,disabled:!0})}),s.jsx(yt,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(ye,{name:"id",defaultValue:l.id,disabled:!0})})]}),s.jsx(u0,{path:l.resourceType,valuePath:l.resourceType,typeName:o,defaultValue:l,outcome:t,onChange:c,profileUrl:e.profileUrl,accessPolicyResource:f}),s.jsxs(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",gap:0,children:[s.jsx(ae,{type:"submit",className:tt((e.onPatch||e.onDelete)&&Zw.splitButton),children:r!=null&&r.id?"Update":"Create"}),(e.onPatch||e.onDelete)&&s.jsxs(Z,{transitionProps:{transition:"pop"},position:"bottom-end",withinPortal:!0,children:[s.jsx(Z.Target,{children:s.jsx(en,{variant:"filled",color:d.primaryColor,size:36,className:Zw.menuControl,"aria-label":"More actions",children:s.jsx(Yx,{size:14,stroke:1.5})})}),s.jsxs(Z.Dropdown,{children:[e.onPatch&&s.jsx(Z.Item,{leftSection:s.jsx(zk,{size:14,stroke:1.5}),onClick:()=>{e.onPatch(l)},children:"Patch"}),e.onDelete&&s.jsx(Z.Item,{color:"red",leftSection:s.jsx(e0,{size:14,stroke:1.5,color:"red"}),onClick:()=>{e.onDelete(l)},children:"Delete"})]})]})]})]}):s.jsxs(Yi,{color:"red",title:"Permission denied",icon:s.jsx(El,{}),children:["Your access level prevents you from editing and creating ",l.resourceType," resources."]})}function Sq(e){var o;const t=le(),[n,r]=p.useState(e.history);return p.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?s.jsxs(pe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(pe.Thead,{children:s.jsxs(pe.Tr,{children:[s.jsx(pe.Th,{children:"Author"}),s.jsx(pe.Th,{children:"Date"}),s.jsx(pe.Th,{children:"Version"})]})}),s.jsx(pe.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,a)=>s.jsx(jq,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function jq(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?s.jsxs(pe.Tr,{children:[s.jsx(pe.Td,{children:s.jsx(Ha,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(pe.Td,{children:zn((o=n.meta)==null?void 0:o.lastUpdated)}),s.jsx(pe.Td,{children:s.jsx(We,{to:Cq(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):s.jsx(pe.Tr,{children:s.jsx(pe.Td,{colSpan:3,children:Ae(t==null?void 0:t.outcome)})})}function Cq(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function Eq(e){const{serviceRequest:t,...n}=e;return s.jsx(Kh,{value:t,loadTimelineResources:async(r,o,i)=>{const a=`${o}/${i}`,l=100;return Promise.allSettled([r.readHistory("ServiceRequest",i),r.search("Communication",{"based-on":a,_count:l}),r.search("DiagnosticReport",{"based-on":a,_count:l}),r.search("Media",{"based-on":a,_count:l}),r.search("DocumentReference",{related:a,_count:l}),r.search("Task",{_filter:`based-on eq ${a} or focus eq ${a} or subject eq ${a}`,_count:l})])},createCommunication:(r,o,i)=>({resourceType:"Communication",status:"completed",basedOn:[Tt(r)],subject:r.subject,sender:Tt(o),sent:new Date().toISOString(),payload:[{contentString:i}]}),createMedia:(r,o,i)=>({resourceType:"Media",status:"completed",basedOn:[Tt(r)],subject:r.subject,operator:Tt(o),issued:new Date().toISOString(),content:i}),...n})}function Tq(e){const t=le(),{client:n,patient:r,encounter:o,children:i,...a}=e;function l(){t.createResource({resourceType:"SmartAppLaunch",patient:r,encounter:o}).then(c=>{const u=new URL(n.launchUri);u.searchParams.set("iss",t.getBaseUrl()+"fhir/R4"),u.searchParams.set("launch",c.id),window.location.assign(u.toString())}).catch(c=>ge({color:"red",message:Ae(c),autoClose:!1}))}return s.jsx(Ke,{onClick:()=>l(),...a,children:i})}function JR(e){const t=le(),[n,r]=p.useState();return s.jsxs(qe,{onSubmit:async o=>{try{e.handleAuthResponse(await t.startNewProject({login:e.login,projectName:o.projectName}))}catch(i){r(ft(i))}},children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Create project"})]}),s.jsxs($e,{gap:"xl",children:[s.jsx(ye,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Qe(n,"projectName")}),s.jsxs(me,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Ke,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Ke,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ae,{type:"submit",children:"Create project"})})]})}function ZR(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 e2(e){const t=le(),{googleClientId:n,handleGoogleCredential:r}=e,o=p.useRef(null),[i,a]=p.useState(typeof google<"u"),[l,c]=p.useState(!1),[u,d]=p.useState(!1);return p.useEffect(()=>{if(typeof google>"u"){ZR("https://accounts.google.com/gsi/client",()=>a(!0));return}l||(google.accounts.id.initialize({client_id:n,callback:r}),c(!0)),o.current&&!u&&(google.accounts.id.renderButton(o.current,{}),d(!0))},[t,n,l,i,o,u,r]),n?s.jsx("div",{ref:o}):null}function t2(e){if(e)return e;if(typeof window<"u"){const t=window.location.protocol+"//"+window.location.host;if([].includes(t))return"__GOOGLE_CLIENT_ID__"}}function n2(e){typeof grecaptcha>"u"&&ZR("https://www.google.com/recaptcha/api.js?render="+e)}function r2(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function Pq(e){const t=t2(e.googleClientId),n=e.recaptchaSiteKey,r=le(),[o,i]=p.useState(),a=xu(o,void 0);return p.useEffect(()=>{n&&n2(n)},[n]),s.jsxs(qe,{onSubmit:async l=>{try{let c="";n&&(c=await r2(n)),e.handleAuthResponse(await r.startNewUser({projectId:e.projectId,clientId:e.clientId,firstName:l.firstName,lastName:l.lastName,email:l.email,password:l.password,remember:l.remember==="true",recaptchaSiteKey:n,recaptchaToken:c}))}catch(c){i(ft(c))}},children:[s.jsx(vn,{style:{flexDirection:"column"},children:e.children}),s.jsx(Ar,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(te,{justify:"center",p:"xl",style:{height:70},children:s.jsx(e2,{googleClientId:t,handleGoogleCredential:async l=>{try{e.handleAuthResponse(await r.startGoogleLogin({googleClientId:l.clientId,googleCredential:l.credential,projectId:e.projectId,createUser:!0}))}catch(c){i(ft(c))}}})}),s.jsx(dn,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs($e,{gap:"xl",children:[s.jsx(ye,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Qe(o,"firstName")}),s.jsx(ye,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Qe(o,"lastName")}),s.jsx(ye,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Qe(o,"email")}),s.jsx(Hr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Qe(o,"password")}),s.jsxs(me,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Ke,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Ke,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(me,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Ke,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Ke,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(te,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Dn,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(ae,{type:"submit",children:"Create account"})]})]})}function kq(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=le(),[c,u]=p.useState(),[d,f]=p.useState();p.useEffect(()=>{t==="patient"&&c&&l.startNewPatient({login:c,projectId:n}).then(m=>l.processCode(m.code)).then(()=>a()).catch(m=>f(ft(m)))},[l,t,n,c,a]);function h(m){m.code?l.processCode(m.code).then(()=>a()).catch(console.log):m.login&&u(m.login)}return s.jsxs(Me,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(Pq,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(JR,{login:c,handleAuthResponse:h})]})}function Rq(e){const[t,n]=p.useState();return t?s.jsx(Dq,{email:t,...e}):s.jsx(_q,{setEmail:n,...e})}function _q(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...a}=e,l=le(),c=!e.disableGoogleAuth&&t2(e.googleClientId),[u,d]=p.useState(),f=xu(u,void 0),h=p.useCallback(async v=>{if(!v.authorizeUrl)return!1;const S=JSON.stringify({...await l.ensureCodeChallenge(a),domain:v.domain}),b=new URL(v.authorizeUrl);return b.searchParams.set("state",S),window.location.assign(b.toString()),!0},[l,a]),m=p.useCallback(async v=>{const S=await l.post("auth/method",{email:v.email});await h(S)||t(v.email)},[l,h,t]),g=p.useCallback(async v=>{try{const S=await l.startGoogleLogin({...a,googleCredential:v.credential});await h(S)||r(S)}catch(S){d(ft(S))}},[l,a,h,r]);return s.jsxs(qe,{onSubmit:m,children:[s.jsx(vn,{style:{flexDirection:"column"},children:o}),s.jsx(Ar,{issues:f}),c&&s.jsxs(s.Fragment,{children:[s.jsx(te,{justify:"center",p:"xl",style:{height:70},children:s.jsx(e2,{googleClientId:c,handleGoogleCredential:g})}),!i&&s.jsx(dn,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(ye,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Qe(u,"email")}),s.jsxs(te,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Ke,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&s.jsx(ae,{type:"submit",children:"Next"})]})]})}function Dq(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=le(),[a,l]=p.useState(),c=xu(a,void 0),u=p.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(ft(f)))},[i,o,n]);return s.jsxs(qe,{onSubmit:u,children:[s.jsx(vn,{style:{flexDirection:"column"},children:r}),s.jsx(Ar,{issues:c}),s.jsx($e,{gap:"xl",children:s.jsx(Hr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Qe(a,"password")})}),s.jsxs(te,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Ke,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Dn,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(ae,{type:"submit",children:"Sign in"})]})]})}function Iq(e){const t=le(),n=ou(),[r,o]=p.useState(""),[i,a]=p.useState();function l(f){var h;return!!((h=f==null?void 0:f.toLowerCase())!=null&&h.includes(r.toLowerCase()))}function c(f){var h,m;return l((h=f.profile)==null?void 0:h.display)||l((m=f.project)==null?void 0:m.display)}function u(f){t.post("auth/profile",{login:e.login,profile:f}).then(e.handleAuthResponse).catch(h=>a(ft(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>s.jsx(Le.Option,{value:f.id,children:s.jsx(Aq,{...f})},f.id));return s.jsxs($e,{children:[s.jsxs(ks,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(to,{size:32}),s.jsx(ve,{order:3,children:"Choose profile"})]}),s.jsx(Ar,{outcome:i}),s.jsxs(Le,{store:n,onOptionSubmit:u,children:[s.jsx(Le.EventsTarget,{children:s.jsx(ye,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(Le.Options,{children:d.length>0?d:s.jsx(Le.Empty,{children:"Nothing found..."})})})]})]})}function Aq(e){var t,n;return s.jsxs(te,{children:[s.jsx(Rs,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(me,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(me,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function Nq(e){const t=le();return s.jsx(qe,{onSubmit:n=>{t.post("auth/scope",{login:e.login,scope:Object.keys(n).join(" ")}).then(e.handleAuthResponse).catch(console.log)},children:s.jsxs($e,{children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Choose scope"})]}),s.jsx($e,{children:(e.scope??"openid").split(" ").map(n=>s.jsx(Dn,{id:n,name:n,label:n,defaultChecked:!0},n))}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ae,{type:"submit",children:"Set scope"})})]})})}function Mq(e){const t=le(),[n,r]=p.useState();return s.jsx(qe,{onSubmit:o=>{r(void 0),t.post("auth/mfa/verify",{login:e.login,token:o.token}).then(e.handleAuthResponse).catch(i=>r(Ae(i)))},children:s.jsxs($e,{children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Enter MFA code"})]}),n&&s.jsx(Yi,{icon:s.jsx(El,{size:16}),title:"Error",color:"red",children:n}),s.jsx($e,{children:s.jsx(ye,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ae,{type:"submit",children:"Submit code"})})]})})}function o2(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=le(),[u,d]=p.useState(),f=p.useRef(!1),[h,m]=p.useState(!1),[g,v]=p.useState(),S=p.useCallback(y=>{a?a(y):c.processCode(y).then(()=>{r&&r()}).catch(x=>ge({color:"red",message:Ae(x)}))},[c,a,r]),b=p.useCallback(y=>{m(!!y.mfaRequired),y.login&&d(y.login),y.memberships&&v(y.memberships),y.code&&(n?v(void 0):S(y.code))},[n,S]),w=p.useCallback(y=>{S(y.code)},[S]);return p.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(b).catch(y=>ge({color:"red",message:Ae(y)})))},[c,t,f,u,b]),s.jsx(Me,{width:450,px:"sm",py:"md",children:u?h?s.jsx(Mq,{login:u,handleAuthResponse:b}):g?s.jsx(Iq,{login:u,memberships:g,handleAuthResponse:b}):e.projectId==="new"?s.jsx(JR,{login:u,handleAuthResponse:b}):e.chooseScopes?s.jsx(Nq,{login:u,scope:e.scope,handleAuthResponse:w}):s.jsx("div",{children:"Success"}):s.jsx(Rq,{onForgotPassword:o,onRegister:i,handleAuthResponse:b,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var i2,eS=Zc;i2=eS.createRoot,eS.hydrateRoot;/**
|
|
544
|
-
* @remix-run/router v1.19.2
|
|
545
|
-
*
|
|
546
|
-
* Copyright (c) Remix Software Inc.
|
|
547
|
-
*
|
|
548
|
-
* This source code is licensed under the MIT license found in the
|
|
549
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
550
|
-
*
|
|
551
|
-
* @license MIT
|
|
552
|
-
*/function Ot(){return Ot=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ot.apply(this,arguments)}var Qt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Qt||(Qt={}));const tS="popstate";function Oq(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return Uc("",{pathname:i,search:a,hash:l},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function n(r,o){return typeof o=="string"?o:Cu(o)}return $q(t,n,null,e)}function Ve(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function ll(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function Lq(){return Math.random().toString(36).substr(2,8)}function nS(e,t){return{usr:e.state,key:e.key,idx:t}}function Uc(e,t,n,r){return n===void 0&&(n=null),Ot({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?oi(t):t,{state:n,key:t&&t.key||r||Lq()})}function Cu(e){let{pathname:t="/",search:n="",hash:r=""}=e;return n&&n!=="?"&&(t+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(t+=r.charAt(0)==="#"?r:"#"+r),t}function oi(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substr(n),e=e.substr(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substr(r),e=e.substr(0,r)),e&&(t.pathname=e)}return t}function $q(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Qt.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(Ot({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=Qt.Pop;let S=d(),b=S==null?null:S-u;u=S,c&&c({action:l,location:v.location,delta:b})}function h(S,b){l=Qt.Push;let w=Uc(v.location,S,b);u=d()+1;let y=nS(w,u),x=v.createHref(w);try{a.pushState(y,"",x)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(x)}i&&c&&c({action:l,location:v.location,delta:1})}function m(S,b){l=Qt.Replace;let w=Uc(v.location,S,b);u=d();let y=nS(w,u),x=v.createHref(w);a.replaceState(y,"",x),i&&c&&c({action:l,location:v.location,delta:0})}function g(S){let b=o.location.origin!=="null"?o.location.origin:o.location.href,w=typeof S=="string"?S:Cu(S);return w=w.replace(/ $/,"%20"),Ve(b,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,b)}let v={get action(){return l},get location(){return e(o,a)},listen(S){if(c)throw new Error("A history only accepts one active listener");return o.addEventListener(tS,f),c=S,()=>{o.removeEventListener(tS,f),c=null}},createHref(S){return t(o,S)},createURL:g,encodeLocation(S){let b=g(S);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:h,replace:m,go(S){return a.go(S)}};return v}var pt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(pt||(pt={}));const Fq=new Set(["lazy","caseSensitive","path","id","index","children"]);function zq(e){return e.index===!0}function Vc(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,String(i)],l=typeof o.id=="string"?o.id:a.join("-");if(Ve(o.index!==!0||!o.children,"Cannot specify children on an index route"),Ve(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),zq(o)){let c=Ot({},o,t(o),{id:l});return r[l]=c,c}else{let c=Ot({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=Vc(o.children,t,a,r)),c}})}function ds(e,t,n){return n===void 0&&(n="/"),Od(e,t,n,!1)}function Od(e,t,n,r){let o=typeof t=="string"?oi(t):t,i=Eu(o.pathname||"/",n);if(i==null)return null;let a=s2(e);Uq(a);let l=null;for(let c=0;l==null&&c<a.length;++c){let u=Zq(i);l=Xq(a[c],u,r)}return l}function Bq(e,t){let{route:n,pathname:r,params:o}=e;return{id:n.id,pathname:r,params:o,data:t[n.id],handle:n.handle}}function s2(e,t,n,r){t===void 0&&(t=[]),n===void 0&&(n=[]),r===void 0&&(r="");let o=(i,a,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};c.relativePath.startsWith("/")&&(Ve(c.relativePath.startsWith(r),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(r.length));let u=Li([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Ve(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),s2(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:Kq(u,i.index),routesMeta:d})};return e.forEach((i,a)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))o(i,a);else for(let c of a2(i.path))o(i,a,c)}),t}function a2(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,o=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return o?[i,""]:[i];let a=a2(r.join("/")),l=[];return l.push(...a.map(c=>c===""?i:[i,c].join("/"))),o&&l.push(...a),l.map(c=>e.startsWith("/")&&c===""?"/":c)}function Uq(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:Yq(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const Vq=/^:[\w-]+$/,Wq=3,Hq=2,qq=1,Gq=10,Qq=-2,rS=e=>e==="*";function Kq(e,t){let n=e.split("/"),r=n.length;return n.some(rS)&&(r+=Qq),t&&(r+=Hq),n.filter(o=>!rS(o)).reduce((o,i)=>o+(Vq.test(i)?Wq:i===""?qq:Gq),r)}function Yq(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 Xq(e,t,n){n===void 0&&(n=!1);let{routesMeta:r}=e,o={},i="/",a=[];for(let l=0;l<r.length;++l){let c=r[l],u=l===r.length-1,d=i==="/"?t:t.slice(i.length)||"/",f=oS({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),h=c.route;if(!f&&u&&n&&!r[r.length-1].route.index&&(f=oS({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},d)),!f)return null;Object.assign(o,f.params),a.push({params:o,pathname:Li([i,f.pathname]),pathnameBase:nG(Li([i,f.pathnameBase])),route:h}),f.pathnameBase!=="/"&&(i=Li([i,f.pathnameBase]))}return a}function oS(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Jq(e.path,e.caseSensitive,e.end),o=t.match(n);if(!o)return null;let i=o[0],a=i.replace(/(.)\/+$/,"$1"),l=o.slice(1);return{params:r.reduce((u,d,f)=>{let{paramName:h,isOptional:m}=d;if(h==="*"){let v=l[f]||"";a=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const g=l[f];return m&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:e}}function Jq(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),ll(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,(a,l,c)=>(r.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),r]}function Zq(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return ll(!1,'The URL path "'+e+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+t+").")),e}}function Eu(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 eG(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?oi(e):e;return{pathname:n?n.startsWith("/")?n:tG(n,t):t,search:rG(r),hash:oG(o)}}function tG(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 sm(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 l2(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function c2(e,t){let n=l2(e);return t?n.map((r,o)=>o===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function u2(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=oi(e):(o=Ot({},e),Ve(!o.pathname||!o.pathname.includes("?"),sm("?","pathname","search",o)),Ve(!o.pathname||!o.pathname.includes("#"),sm("#","pathname","hash",o)),Ve(!o.search||!o.search.includes("#"),sm("#","search","hash",o)));let i=e===""||o.pathname==="",a=i?"/":o.pathname,l;if(a==null)l=n;else{let f=t.length-1;if(!r&&a.startsWith("..")){let h=a.split("/");for(;h[0]==="..";)h.shift(),f-=1;o.pathname=h.join("/")}l=f>=0?t[f]:"/"}let c=eG(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Li=e=>e.join("/").replace(/\/\/+/g,"/"),nG=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),rG=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oG=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class _f{constructor(t,n,r,o){o===void 0&&(o=!1),this.status=t,this.statusText=n||"",this.internal=o,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}}function Xh(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const d2=["post","put","patch","delete"],iG=new Set(d2),sG=["get",...d2],aG=new Set(sG),lG=new Set([301,302,303,307,308]),cG=new Set([307,308]),am={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},uG={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},Vl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},T0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,dG=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),f2="remix-router-transitions";function fG(e){const t=e.window?e.window:typeof window<"u"?window:void 0,n=typeof t<"u"&&typeof t.document<"u"&&typeof t.document.createElement<"u",r=!n;Ve(e.routes.length>0,"You must provide a non-empty routes array to createRouter");let o;if(e.mapRouteProperties)o=e.mapRouteProperties;else if(e.detectErrorBoundary){let A=e.detectErrorBoundary;o=M=>({hasErrorBoundary:A(M)})}else o=dG;let i={},a=Vc(e.routes,o,void 0,i),l,c=e.basename||"/",u=e.unstable_dataStrategy||yG,d=e.unstable_patchRoutesOnNavigation,f=Ot({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,v7_skipActionErrorRevalidation:!1},e.future),h=null,m=new Set,g=1e3,v=new Set,S=null,b=null,w=null,y=e.hydrationData!=null,x=ds(a,e.history.location,c),C=null;if(x==null&&!d){let A=Nn(404,{pathname:e.history.location.pathname}),{matches:M,route:z}=hS(a);x=M,C={[z.id]:A}}x&&!e.hydrationData&&ui(x,a,e.history.location.pathname).active&&(x=null);let E;if(x)if(x.some(A=>A.route.lazy))E=!1;else if(!x.some(A=>A.route.loader))E=!0;else if(f.v7_partialHydration){let A=e.hydrationData?e.hydrationData.loaderData:null,M=e.hydrationData?e.hydrationData.errors:null,z=K=>K.route.loader?typeof K.route.loader=="function"&&K.route.loader.hydrate===!0?!1:A&&A[K.route.id]!==void 0||M&&M[K.route.id]!==void 0:!0;if(M){let K=x.findIndex(ne=>M[ne.route.id]!==void 0);E=x.slice(0,K+1).every(z)}else E=x.every(z)}else E=e.hydrationData!=null;else if(E=!1,x=[],f.v7_partialHydration){let A=ui(null,a,e.history.location.pathname);A.active&&A.matches&&(x=A.matches)}let T,j={historyAction:e.history.action,location:e.history.location,matches:x,initialized:E,navigation:am,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||C,fetchers:new Map,blockers:new Map},R=Qt.Pop,k=!1,I,O=!1,F=new Map,L=null,B=!1,D=!1,_=[],P=new Set,N=new Map,$=0,H=-1,X=new Map,ce=new Set,Ie=new Map,ue=new Map,xe=new Set,_e=new Map,de=new Map,Oe=new Map,Ye;function jt(){if(h=e.history.listen(A=>{let{action:M,location:z,delta:K}=A;if(Ye){Ye(),Ye=void 0;return}ll(de.size===0||K!=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 ne=bo({currentLocation:j.location,nextLocation:z,historyAction:M});if(ne&&K!=null){let Ee=new Promise(Fe=>{Ye=Fe});e.history.go(K*-1),li(ne,{state:"blocked",location:z,proceed(){li(ne,{state:"proceeding",proceed:void 0,reset:void 0,location:z}),Ee.then(()=>e.history.go(K))},reset(){let Fe=new Map(j.blockers);Fe.set(ne,Vl),Re({blockers:Fe})}});return}return Q(M,z)}),n){AG(t,F);let A=()=>NG(t,F);t.addEventListener("pagehide",A),L=()=>t.removeEventListener("pagehide",A)}return j.initialized||Q(Qt.Pop,j.location,{initialHydration:!0}),T}function mt(){h&&h(),L&&L(),m.clear(),I&&I.abort(),j.fetchers.forEach((A,M)=>ai(M)),j.blockers.forEach((A,M)=>na(M))}function at(A){return m.add(A),()=>m.delete(A)}function Re(A,M){M===void 0&&(M={}),j=Ot({},j,A);let z=[],K=[];f.v7_fetcherPersist&&j.fetchers.forEach((ne,Ee)=>{ne.state==="idle"&&(xe.has(Ee)?K.push(Ee):z.push(Ee))}),[...m].forEach(ne=>ne(j,{deletedFetchers:K,unstable_viewTransitionOpts:M.viewTransitionOpts,unstable_flushSync:M.flushSync===!0})),f.v7_fetcherPersist&&(z.forEach(ne=>j.fetchers.delete(ne)),K.forEach(ne=>ai(ne)))}function et(A,M,z){var K,ne;let{flushSync:Ee}=z===void 0?{}:z,Fe=j.actionData!=null&&j.navigation.formMethod!=null&&Fr(j.navigation.formMethod)&&j.navigation.state==="loading"&&((K=A.state)==null?void 0:K._isRedirect)!==!0,se;M.actionData?Object.keys(M.actionData).length>0?se=M.actionData:se=null:Fe?se=j.actionData:se=null;let De=M.loaderData?dS(j.loaderData,M.loaderData,M.matches||[],M.errors):j.loaderData,Te=j.blockers;Te.size>0&&(Te=new Map(Te),Te.forEach((ct,Pt)=>Te.set(Pt,Vl)));let ke=k===!0||j.navigation.formMethod!=null&&Fr(j.navigation.formMethod)&&((ne=A.state)==null?void 0:ne._isRedirect)!==!0;l&&(a=l,l=void 0),B||R===Qt.Pop||(R===Qt.Push?e.history.push(A,A.state):R===Qt.Replace&&e.history.replace(A,A.state));let nt;if(R===Qt.Pop){let ct=F.get(j.location.pathname);ct&&ct.has(A.pathname)?nt={currentLocation:j.location,nextLocation:A}:F.has(A.pathname)&&(nt={currentLocation:A,nextLocation:j.location})}else if(O){let ct=F.get(j.location.pathname);ct?ct.add(A.pathname):(ct=new Set([A.pathname]),F.set(j.location.pathname,ct)),nt={currentLocation:j.location,nextLocation:A}}Re(Ot({},M,{actionData:se,loaderData:De,historyAction:R,location:A,initialized:!0,navigation:am,revalidation:"idle",restoreScrollPosition:ci(A,M.matches||j.matches),preventScrollReset:ke,blockers:Te}),{viewTransitionOpts:nt,flushSync:Ee===!0}),R=Qt.Pop,k=!1,O=!1,B=!1,D=!1,_=[]}async function ht(A,M){if(typeof A=="number"){e.history.go(A);return}let z=Ug(j.location,j.matches,c,f.v7_prependBasename,A,f.v7_relativeSplatPath,M==null?void 0:M.fromRouteId,M==null?void 0:M.relative),{path:K,submission:ne,error:Ee}=iS(f.v7_normalizeFormMethod,!1,z,M),Fe=j.location,se=Uc(j.location,K,M&&M.state);se=Ot({},se,e.history.encodeLocation(se));let De=M&&M.replace!=null?M.replace:void 0,Te=Qt.Push;De===!0?Te=Qt.Replace:De===!1||ne!=null&&Fr(ne.formMethod)&&ne.formAction===j.location.pathname+j.location.search&&(Te=Qt.Replace);let ke=M&&"preventScrollReset"in M?M.preventScrollReset===!0:void 0,nt=(M&&M.unstable_flushSync)===!0,ct=bo({currentLocation:Fe,nextLocation:se,historyAction:Te});if(ct){li(ct,{state:"blocked",location:se,proceed(){li(ct,{state:"proceeding",proceed:void 0,reset:void 0,location:se}),ht(A,M)},reset(){let Pt=new Map(j.blockers);Pt.set(ct,Vl),Re({blockers:Pt})}});return}return await Q(Te,se,{submission:ne,pendingError:Ee,preventScrollReset:ke,replace:M&&M.replace,enableViewTransition:M&&M.unstable_viewTransition,flushSync:nt})}function oe(){if(Xt(),Re({revalidation:"loading"}),j.navigation.state!=="submitting"){if(j.navigation.state==="idle"){Q(j.historyAction,j.location,{startUninterruptedRevalidation:!0});return}Q(R||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation,enableViewTransition:O===!0})}}async function Q(A,M,z){I&&I.abort(),I=null,R=A,B=(z&&z.startUninterruptedRevalidation)===!0,ln(j.location,j.matches),k=(z&&z.preventScrollReset)===!0,O=(z&&z.enableViewTransition)===!0;let K=l||a,ne=z&&z.overrideNavigation,Ee=ds(K,M,c),Fe=(z&&z.flushSync)===!0,se=ui(Ee,K,M.pathname);if(se.active&&se.matches&&(Ee=se.matches),!Ee){let{error:Xe,notFoundMatches:cn,route:Jt}=Cn(M.pathname);et(M,{matches:cn,loaderData:{},errors:{[Jt.id]:Xe}},{flushSync:Fe});return}if(j.initialized&&!D&&CG(j.location,M)&&!(z&&z.submission&&Fr(z.submission.formMethod))){et(M,{matches:Ee},{flushSync:Fe});return}I=new AbortController;let De=ga(e.history,M,I.signal,z&&z.submission),Te;if(z&&z.pendingError)Te=[Na(Ee).route.id,{type:pt.error,error:z.pendingError}];else if(z&&z.submission&&Fr(z.submission.formMethod)){let Xe=await fe(De,M,z.submission,Ee,se.active,{replace:z.replace,flushSync:Fe});if(Xe.shortCircuited)return;if(Xe.pendingActionResult){let[cn,Jt]=Xe.pendingActionResult;if(sr(Jt)&&Xh(Jt.error)&&Jt.error.status===404){I=null,et(M,{matches:Xe.matches,loaderData:{},errors:{[cn]:Jt.error}});return}}Ee=Xe.matches||Ee,Te=Xe.pendingActionResult,ne=lm(M,z.submission),Fe=!1,se.active=!1,De=ga(e.history,De.url,De.signal)}let{shortCircuited:ke,matches:nt,loaderData:ct,errors:Pt}=await Pe(De,M,Ee,se.active,ne,z&&z.submission,z&&z.fetcherSubmission,z&&z.replace,z&&z.initialHydration===!0,Fe,Te);ke||(I=null,et(M,Ot({matches:nt||Ee},fS(Te),{loaderData:ct,errors:Pt})))}async function fe(A,M,z,K,ne,Ee){Ee===void 0&&(Ee={}),Xt();let Fe=DG(M,z);if(Re({navigation:Fe},{flushSync:Ee.flushSync===!0}),ne){let Te=await wo(K,M.pathname,A.signal);if(Te.type==="aborted")return{shortCircuited:!0};if(Te.type==="error"){let{boundaryId:ke,error:nt}=ra(M.pathname,Te);return{matches:Te.partialMatches,pendingActionResult:[ke,{type:pt.error,error:nt}]}}else if(Te.matches)K=Te.matches;else{let{notFoundMatches:ke,error:nt,route:ct}=Cn(M.pathname);return{matches:ke,pendingActionResult:[ct.id,{type:pt.error,error:nt}]}}}let se,De=Jl(K,M);if(!De.route.action&&!De.route.lazy)se={type:pt.error,error:Nn(405,{method:A.method,pathname:M.pathname,routeId:De.route.id})};else if(se=(await gt("action",j,A,[De],K,null))[De.route.id],A.signal.aborted)return{shortCircuited:!0};if(ys(se)){let Te;return Ee&&Ee.replace!=null?Te=Ee.replace:Te=lS(se.response.headers.get("Location"),new URL(A.url),c)===j.location.pathname+j.location.search,await lt(A,se,!0,{submission:z,replace:Te}),{shortCircuited:!0}}if(Pi(se))throw Nn(400,{type:"defer-action"});if(sr(se)){let Te=Na(K,De.route.id);return(Ee&&Ee.replace)!==!0&&(R=Qt.Push),{matches:K,pendingActionResult:[Te.route.id,se]}}return{matches:K,pendingActionResult:[De.route.id,se]}}async function Pe(A,M,z,K,ne,Ee,Fe,se,De,Te,ke){let nt=ne||lm(M,Ee),ct=Ee||Fe||mS(nt),Pt=!B&&(!f.v7_partialHydration||!De);if(K){if(Pt){let Ut=J(ke);Re(Ot({navigation:nt},Ut!==void 0?{actionData:Ut}:{}),{flushSync:Te})}let Ue=await wo(z,M.pathname,A.signal);if(Ue.type==="aborted")return{shortCircuited:!0};if(Ue.type==="error"){let{boundaryId:Ut,error:or}=ra(M.pathname,Ue);return{matches:Ue.partialMatches,loaderData:{},errors:{[Ut]:or}}}else if(Ue.matches)z=Ue.matches;else{let{error:Ut,notFoundMatches:or,route:Vt}=Cn(M.pathname);return{matches:or,loaderData:{},errors:{[Vt.id]:Ut}}}}let Xe=l||a,[cn,Jt]=sS(e.history,j,z,ct,M,f.v7_partialHydration&&De===!0,f.v7_skipActionErrorRevalidation,D,_,P,xe,Ie,ce,Xe,c,ke);if(_u(Ue=>!(z&&z.some(Ut=>Ut.route.id===Ue))||cn&&cn.some(Ut=>Ut.route.id===Ue)),H=++$,cn.length===0&&Jt.length===0){let Ue=ta();return et(M,Ot({matches:z,loaderData:{},errors:ke&&sr(ke[1])?{[ke[0]]:ke[1].error}:null},fS(ke),Ue?{fetchers:new Map(j.fetchers)}:{}),{flushSync:Te}),{shortCircuited:!0}}if(Pt){let Ue={};if(!K){Ue.navigation=nt;let Ut=J(ke);Ut!==void 0&&(Ue.actionData=Ut)}Jt.length>0&&(Ue.fetchers=ie(Jt)),Re(Ue,{flushSync:Te})}Jt.forEach(Ue=>{N.has(Ue.key)&&no(Ue.key),Ue.controller&&N.set(Ue.key,Ue.controller)});let Rl=()=>Jt.forEach(Ue=>no(Ue.key));I&&I.signal.addEventListener("abort",Rl);let{loaderResults:So,fetcherResults:ia}=await mn(j,z,cn,Jt,A);if(A.signal.aborted)return{shortCircuited:!0};I&&I.signal.removeEventListener("abort",Rl),Jt.forEach(Ue=>N.delete(Ue.key));let di=pd(So);if(di)return await lt(A,di.result,!0,{replace:se}),{shortCircuited:!0};if(di=pd(ia),di)return ce.add(di.key),await lt(A,di.result,!0,{replace:se}),{shortCircuited:!0};let{loaderData:Nu,errors:jo}=uS(j,z,cn,So,ke,Jt,ia,_e);_e.forEach((Ue,Ut)=>{Ue.subscribe(or=>{(or||Ue.done)&&_e.delete(Ut)})}),f.v7_partialHydration&&De&&j.errors&&Object.entries(j.errors).filter(Ue=>{let[Ut]=Ue;return!cn.some(or=>or.route.id===Ut)}).forEach(Ue=>{let[Ut,or]=Ue;jo=Object.assign(jo||{},{[Ut]:or})});let Mu=ta(),Ou=ku(H),Lu=Mu||Ou||Jt.length>0;return Ot({matches:z,loaderData:Nu,errors:jo},Lu?{fetchers:new Map(j.fetchers)}:{})}function J(A){if(A&&!sr(A[1]))return{[A[0]]:A[1].data};if(j.actionData)return Object.keys(j.actionData).length===0?null:j.actionData}function ie(A){return A.forEach(M=>{let z=j.fetchers.get(M.key),K=Wl(void 0,z?z.data:void 0);j.fetchers.set(M.key,K)}),new Map(j.fetchers)}function G(A,M,z,K){if(r)throw new Error("router.fetch() was called during the server render, but it shouldn't be. You are likely calling a useFetcher() method in the body of your component. Try moving it to a useEffect or a callback.");N.has(A)&&no(A);let ne=(K&&K.unstable_flushSync)===!0,Ee=l||a,Fe=Ug(j.location,j.matches,c,f.v7_prependBasename,z,f.v7_relativeSplatPath,M,K==null?void 0:K.relative),se=ds(Ee,Fe,c),De=ui(se,Ee,Fe);if(De.active&&De.matches&&(se=De.matches),!se){an(A,M,Nn(404,{pathname:Fe}),{flushSync:ne});return}let{path:Te,submission:ke,error:nt}=iS(f.v7_normalizeFormMethod,!0,Fe,K);if(nt){an(A,M,nt,{flushSync:ne});return}let ct=Jl(se,Te);if(k=(K&&K.preventScrollReset)===!0,ke&&Fr(ke.formMethod)){Ce(A,M,Te,ct,se,De.active,ne,ke);return}Ie.set(A,{routeId:M,path:Te}),He(A,M,Te,ct,se,De.active,ne,ke)}async function Ce(A,M,z,K,ne,Ee,Fe,se){Xt(),Ie.delete(A);function De(Vt){if(!Vt.route.action&&!Vt.route.lazy){let Co=Nn(405,{method:se.formMethod,pathname:z,routeId:M});return an(A,M,Co,{flushSync:Fe}),!0}return!1}if(!Ee&&De(K))return;let Te=j.fetchers.get(A);Bt(A,IG(se,Te),{flushSync:Fe});let ke=new AbortController,nt=ga(e.history,z,ke.signal,se);if(Ee){let Vt=await wo(ne,z,nt.signal);if(Vt.type==="aborted")return;if(Vt.type==="error"){let{error:Co}=ra(z,Vt);an(A,M,Co,{flushSync:Fe});return}else if(Vt.matches){if(ne=Vt.matches,K=Jl(ne,z),De(K))return}else{an(A,M,Nn(404,{pathname:z}),{flushSync:Fe});return}}N.set(A,ke);let ct=$,Xe=(await gt("action",j,nt,[K],ne,A))[K.route.id];if(nt.signal.aborted){N.get(A)===ke&&N.delete(A);return}if(f.v7_fetcherPersist&&xe.has(A)){if(ys(Xe)||sr(Xe)){Bt(A,pi(void 0));return}}else{if(ys(Xe))if(N.delete(A),H>ct){Bt(A,pi(void 0));return}else return ce.add(A),Bt(A,Wl(se)),lt(nt,Xe,!1,{fetcherSubmission:se});if(sr(Xe)){an(A,M,Xe.error);return}}if(Pi(Xe))throw Nn(400,{type:"defer-action"});let cn=j.navigation.location||j.location,Jt=ga(e.history,cn,ke.signal),Rl=l||a,So=j.navigation.state!=="idle"?ds(Rl,j.navigation.location,c):j.matches;Ve(So,"Didn't find any matches after fetcher action");let ia=++$;X.set(A,ia);let di=Wl(se,Xe.data);j.fetchers.set(A,di);let[Nu,jo]=sS(e.history,j,So,se,cn,!1,f.v7_skipActionErrorRevalidation,D,_,P,xe,Ie,ce,Rl,c,[K.route.id,Xe]);jo.filter(Vt=>Vt.key!==A).forEach(Vt=>{let Co=Vt.key,O0=j.fetchers.get(Co),U2=Wl(void 0,O0?O0.data:void 0);j.fetchers.set(Co,U2),N.has(Co)&&no(Co),Vt.controller&&N.set(Co,Vt.controller)}),Re({fetchers:new Map(j.fetchers)});let Mu=()=>jo.forEach(Vt=>no(Vt.key));ke.signal.addEventListener("abort",Mu);let{loaderResults:Ou,fetcherResults:Lu}=await mn(j,So,Nu,jo,Jt);if(ke.signal.aborted)return;ke.signal.removeEventListener("abort",Mu),X.delete(A),N.delete(A),jo.forEach(Vt=>N.delete(Vt.key));let Ue=pd(Ou);if(Ue)return lt(Jt,Ue.result,!1);if(Ue=pd(Lu),Ue)return ce.add(Ue.key),lt(Jt,Ue.result,!1);let{loaderData:Ut,errors:or}=uS(j,So,Nu,Ou,void 0,jo,Lu,_e);if(j.fetchers.has(A)){let Vt=pi(Xe.data);j.fetchers.set(A,Vt)}ku(ia),j.navigation.state==="loading"&&ia>H?(Ve(R,"Expected pending action"),I&&I.abort(),et(j.navigation.location,{matches:So,loaderData:Ut,errors:or,fetchers:new Map(j.fetchers)})):(Re({errors:or,loaderData:dS(j.loaderData,Ut,So,or),fetchers:new Map(j.fetchers)}),D=!1)}async function He(A,M,z,K,ne,Ee,Fe,se){let De=j.fetchers.get(A);Bt(A,Wl(se,De?De.data:void 0),{flushSync:Fe});let Te=new AbortController,ke=ga(e.history,z,Te.signal);if(Ee){let Xe=await wo(ne,z,ke.signal);if(Xe.type==="aborted")return;if(Xe.type==="error"){let{error:cn}=ra(z,Xe);an(A,M,cn,{flushSync:Fe});return}else if(Xe.matches)ne=Xe.matches,K=Jl(ne,z);else{an(A,M,Nn(404,{pathname:z}),{flushSync:Fe});return}}N.set(A,Te);let nt=$,Pt=(await gt("loader",j,ke,[K],ne,A))[K.route.id];if(Pi(Pt)&&(Pt=await P0(Pt,ke.signal,!0)||Pt),N.get(A)===Te&&N.delete(A),!ke.signal.aborted){if(xe.has(A)){Bt(A,pi(void 0));return}if(ys(Pt))if(H>nt){Bt(A,pi(void 0));return}else{ce.add(A),await lt(ke,Pt,!1);return}if(sr(Pt)){an(A,M,Pt.error);return}Ve(!Pi(Pt),"Unhandled fetcher deferred data"),Bt(A,pi(Pt.data))}}async function lt(A,M,z,K){let{submission:ne,fetcherSubmission:Ee,replace:Fe}=K===void 0?{}:K;M.response.headers.has("X-Remix-Revalidate")&&(D=!0);let se=M.response.headers.get("Location");Ve(se,"Expected a Location header on the redirect Response"),se=lS(se,new URL(A.url),c);let De=Uc(j.location,se,{_isRedirect:!0});if(n){let Xe=!1;if(M.response.headers.has("X-Remix-Reload-Document"))Xe=!0;else if(T0.test(se)){const cn=e.history.createURL(se);Xe=cn.origin!==t.location.origin||Eu(cn.pathname,c)==null}if(Xe){Fe?t.location.replace(se):t.location.assign(se);return}}I=null;let Te=Fe===!0||M.response.headers.has("X-Remix-Replace")?Qt.Replace:Qt.Push,{formMethod:ke,formAction:nt,formEncType:ct}=j.navigation;!ne&&!Ee&&ke&&nt&&ct&&(ne=mS(j.navigation));let Pt=ne||Ee;if(cG.has(M.response.status)&&Pt&&Fr(Pt.formMethod))await Q(Te,De,{submission:Ot({},Pt,{formAction:se}),preventScrollReset:k,enableViewTransition:z?O:void 0});else{let Xe=lm(De,ne);await Q(Te,De,{overrideNavigation:Xe,fetcherSubmission:Ee,preventScrollReset:k,enableViewTransition:z?O:void 0})}}async function gt(A,M,z,K,ne,Ee){let Fe,se={};try{Fe=await xG(u,A,M,z,K,ne,Ee,i,o)}catch(De){return K.forEach(Te=>{se[Te.route.id]={type:pt.error,error:De}}),se}for(let[De,Te]of Object.entries(Fe))if(TG(Te)){let ke=Te.result;se[De]={type:pt.redirect,response:SG(ke,z,De,ne,c,f.v7_relativeSplatPath)}}else se[De]=await wG(Te);return se}async function mn(A,M,z,K,ne){let Ee=A.matches,Fe=gt("loader",A,ne,z,M,null),se=Promise.all(K.map(async ke=>{if(ke.matches&&ke.match&&ke.controller){let ct=(await gt("loader",A,ga(e.history,ke.path,ke.controller.signal),[ke.match],ke.matches,ke.key))[ke.match.route.id];return{[ke.key]:ct}}else return Promise.resolve({[ke.key]:{type:pt.error,error:Nn(404,{pathname:ke.path})}})})),De=await Fe,Te=(await se).reduce((ke,nt)=>Object.assign(ke,nt),{});return await Promise.all([RG(M,De,ne.signal,Ee,A.loaderData),_G(M,Te,K)]),{loaderResults:De,fetcherResults:Te}}function Xt(){D=!0,_.push(..._u()),Ie.forEach((A,M)=>{N.has(M)&&(P.add(M),no(M))})}function Bt(A,M,z){z===void 0&&(z={}),j.fetchers.set(A,M),Re({fetchers:new Map(j.fetchers)},{flushSync:(z&&z.flushSync)===!0})}function an(A,M,z,K){K===void 0&&(K={});let ne=Na(j.matches,M);ai(A),Re({errors:{[ne.route.id]:z},fetchers:new Map(j.fetchers)},{flushSync:(K&&K.flushSync)===!0})}function si(A){return f.v7_fetcherPersist&&(ue.set(A,(ue.get(A)||0)+1),xe.has(A)&&xe.delete(A)),j.fetchers.get(A)||uG}function ai(A){let M=j.fetchers.get(A);N.has(A)&&!(M&&M.state==="loading"&&X.has(A))&&no(A),Ie.delete(A),X.delete(A),ce.delete(A),xe.delete(A),P.delete(A),j.fetchers.delete(A)}function ip(A){if(f.v7_fetcherPersist){let M=(ue.get(A)||0)-1;M<=0?(ue.delete(A),xe.add(A)):ue.set(A,M)}else ai(A);Re({fetchers:new Map(j.fetchers)})}function no(A){let M=N.get(A);Ve(M,"Expected fetch controller: "+A),M.abort(),N.delete(A)}function gr(A){for(let M of A){let z=si(M),K=pi(z.data);j.fetchers.set(M,K)}}function ta(){let A=[],M=!1;for(let z of ce){let K=j.fetchers.get(z);Ve(K,"Expected fetcher: "+z),K.state==="loading"&&(ce.delete(z),A.push(z),M=!0)}return gr(A),M}function ku(A){let M=[];for(let[z,K]of X)if(K<A){let ne=j.fetchers.get(z);Ve(ne,"Expected fetcher: "+z),ne.state==="loading"&&(no(z),X.delete(z),M.push(z))}return gr(M),M.length>0}function Ru(A,M){let z=j.blockers.get(A)||Vl;return de.get(A)!==M&&de.set(A,M),z}function na(A){j.blockers.delete(A),de.delete(A)}function li(A,M){let z=j.blockers.get(A)||Vl;Ve(z.state==="unblocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="blocked"||z.state==="blocked"&&M.state==="proceeding"||z.state==="blocked"&&M.state==="unblocked"||z.state==="proceeding"&&M.state==="unblocked","Invalid blocker state transition: "+z.state+" -> "+M.state);let K=new Map(j.blockers);K.set(A,M),Re({blockers:K})}function bo(A){let{currentLocation:M,nextLocation:z,historyAction:K}=A;if(de.size===0)return;de.size>1&&ll(!1,"A router only supports one blocker at a time");let ne=Array.from(de.entries()),[Ee,Fe]=ne[ne.length-1],se=j.blockers.get(Ee);if(!(se&&se.state==="proceeding")&&Fe({currentLocation:M,nextLocation:z,historyAction:K}))return Ee}function Cn(A){let M=Nn(404,{pathname:A}),z=l||a,{matches:K,route:ne}=hS(z);return _u(),{notFoundMatches:K,route:ne,error:M}}function ra(A,M){return{boundaryId:Na(M.partialMatches).route.id,error:Nn(400,{type:"route-discovery",pathname:A,message:M.error!=null&&"message"in M.error?M.error:String(M.error)})}}function _u(A){let M=[];return _e.forEach((z,K)=>{(!A||A(K))&&(z.cancel(),M.push(K),_e.delete(K))}),M}function sp(A,M,z){if(S=A,w=M,b=z||null,!y&&j.navigation===am){y=!0;let K=ci(j.location,j.matches);K!=null&&Re({restoreScrollPosition:K})}return()=>{S=null,w=null,b=null}}function Du(A,M){return b&&b(A,M.map(K=>Bq(K,j.loaderData)))||A.key}function ln(A,M){if(S&&w){let z=Du(A,M);S[z]=w()}}function ci(A,M){if(S){let z=Du(A,M),K=S[z];if(typeof K=="number")return K}return null}function ui(A,M,z){if(d){if(v.has(z))return{active:!1,matches:A};if(A){if(Object.keys(A[0].params).length>0)return{active:!0,matches:Od(M,z,c,!0)}}else return{active:!0,matches:Od(M,z,c,!0)||[]}}return{active:!1,matches:null}}async function wo(A,M,z){let K=A;for(;;){let ne=l==null,Ee=l||a;try{await gG(d,M,K,Ee,i,o,Oe,z)}catch(De){return{type:"error",error:De,partialMatches:K}}finally{ne&&(a=[...a])}if(z.aborted)return{type:"aborted"};let Fe=ds(Ee,M,c);if(Fe)return oa(M,v),{type:"success",matches:Fe};let se=Od(Ee,M,c,!0);if(!se||K.length===se.length&&K.every((De,Te)=>De.route.id===se[Te].route.id))return oa(M,v),{type:"success",matches:null};K=se}}function oa(A,M){if(M.size>=g){let z=M.values().next().value;M.delete(z)}M.add(A)}function Iu(A){i={},l=Vc(A,o,void 0,i)}function Au(A,M){let z=l==null;p2(A,M,l||a,i,o),z&&(a=[...a],Re({}))}return T={get basename(){return c},get future(){return f},get state(){return j},get routes(){return a},get window(){return t},initialize:jt,subscribe:at,enableScrollRestoration:sp,navigate:ht,fetch:G,revalidate:oe,createHref:A=>e.history.createHref(A),encodeLocation:A=>e.history.encodeLocation(A),getFetcher:si,deleteFetcher:ip,dispose:mt,getBlocker:Ru,deleteBlocker:na,patchRoutes:Au,_internalFetchControllers:N,_internalActiveDeferreds:_e,_internalSetRoutes:Iu},T}function hG(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function Ug(e,t,n,r,o,i,a,l){let c,u;if(a){c=[];for(let f of t)if(c.push(f),f.route.id===a){u=f;break}}else c=t,u=t[t.length-1];let d=u2(o||".",c2(c,i),Eu(e.pathname,n)||e.pathname,l==="path");return o==null&&(d.search=e.search,d.hash=e.hash),(o==null||o===""||o===".")&&u&&u.route.index&&!k0(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Li([n,d.pathname])),Cu(d)}function iS(e,t,n,r){if(!r||!hG(r))return{path:n};if(r.formMethod&&!kG(r.formMethod))return{path:n,error:Nn(405,{method:r.formMethod})};let o=()=>({path:n,error:Nn(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=m2(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Fr(a))return o();let h=typeof r.body=="string"?r.body:r.body instanceof FormData||r.body instanceof URLSearchParams?Array.from(r.body.entries()).reduce((m,g)=>{let[v,S]=g;return""+m+v+"="+S+`
|
|
553
|
-
`},""):String(r.body);return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:void 0,text:h}}}else if(r.formEncType==="application/json"){if(!Fr(a))return o();try{let h=typeof r.body=="string"?JSON.parse(r.body):r.body;return{path:n,submission:{formMethod:a,formAction:l,formEncType:r.formEncType,formData:void 0,json:h,text:void 0}}}catch{return o()}}}Ve(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=Vg(r.formData),u=r.formData;else if(r.body instanceof FormData)c=Vg(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=cS(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=cS(c)}catch{return o()}let d={formMethod:a,formAction:l,formEncType:r&&r.formEncType||"application/x-www-form-urlencoded",formData:u,json:void 0,text:void 0};if(Fr(d.formMethod))return{path:n,submission:d};let f=oi(n);return t&&f.search&&k0(f.search)&&c.append("index",""),f.search="?"+c,{path:Cu(f),submission:d}}function pG(e,t){let n=e;if(t){let r=e.findIndex(o=>o.route.id===t);r>=0&&(n=e.slice(0,r))}return n}function sS(e,t,n,r,o,i,a,l,c,u,d,f,h,m,g,v){let S=v?sr(v[1])?v[1].error:v[1].data:void 0,b=e.createURL(t.location),w=e.createURL(o),y=v&&sr(v[1])?v[0]:void 0,x=y?pG(n,y):n,C=v?v[1].statusCode:void 0,E=a&&C&&C>=400,T=x.filter((R,k)=>{let{route:I}=R;if(I.lazy)return!0;if(I.loader==null)return!1;if(i)return typeof I.loader!="function"||I.loader.hydrate?!0:t.loaderData[I.id]===void 0&&(!t.errors||t.errors[I.id]===void 0);if(mG(t.loaderData,t.matches[k],R)||c.some(L=>L===R.route.id))return!0;let O=t.matches[k],F=R;return aS(R,Ot({currentUrl:b,currentParams:O.params,nextUrl:w,nextParams:F.params},r,{actionResult:S,actionStatus:C,defaultShouldRevalidate:E?!1:l||b.pathname+b.search===w.pathname+w.search||b.search!==w.search||h2(O,F)}))}),j=[];return f.forEach((R,k)=>{if(i||!n.some(B=>B.route.id===R.routeId)||d.has(k))return;let I=ds(m,R.path,g);if(!I){j.push({key:k,routeId:R.routeId,path:R.path,matches:null,match:null,controller:null});return}let O=t.fetchers.get(k),F=Jl(I,R.path),L=!1;h.has(k)?L=!1:u.has(k)?(u.delete(k),L=!0):O&&O.state!=="idle"&&O.data===void 0?L=l:L=aS(F,Ot({currentUrl:b,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:n[n.length-1].params},r,{actionResult:S,actionStatus:C,defaultShouldRevalidate:E?!1:l})),L&&j.push({key:k,routeId:R.routeId,path:R.path,matches:I,match:F,controller:new AbortController})}),[T,j]}function mG(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function h2(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function aS(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function gG(e,t,n,r,o,i,a,l){let c=[t,...n.map(u=>u.route.id)].join("-");try{let u=a.get(c);u||(u=e({path:t,matches:n,patch:(d,f)=>{l.aborted||p2(d,f,r,o,i)}}),a.set(c,u)),u&&EG(u)&&await u}finally{a.delete(c)}}function p2(e,t,n,r,o){if(e){var i;let a=r[e];Ve(a,"No route found to patch children into: routeId = "+e);let l=Vc(t,o,[e,"patch",String(((i=a.children)==null?void 0:i.length)||"0")],r);a.children?a.children.push(...l):a.children=l}else{let a=Vc(t,o,["patch",String(n.length||"0")],r);n.push(...a)}}async function vG(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Ve(o,"No route found in manifest");let i={};for(let a in r){let c=o[a]!==void 0&&a!=="hasErrorBoundary";ll(!c,'Route "'+o.id+'" has a static property "'+a+'" defined but its lazy function is also returning a value for this property. '+('The lazy route property "'+a+'" will be ignored.')),!c&&!Fq.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,Ot({},t(o),{lazy:void 0}))}async function yG(e){let{matches:t}=e,n=t.filter(o=>o.shouldLoad);return(await Promise.all(n.map(o=>o.resolve()))).reduce((o,i,a)=>Object.assign(o,{[n[a].route.id]:i}),{})}async function xG(e,t,n,r,o,i,a,l,c,u){let d=i.map(m=>m.route.lazy?vG(m.route,c,l):void 0),f=i.map((m,g)=>{let v=d[g],S=o.some(w=>w.route.id===m.route.id);return Ot({},m,{shouldLoad:S,resolve:async w=>(w&&r.method==="GET"&&(m.route.lazy||m.route.loader)&&(S=!0),S?bG(t,r,m,v,w,u):Promise.resolve({type:pt.data,result:void 0}))})}),h=await e({matches:f,request:r,params:i[0].params,fetcherKey:a,context:u});try{await Promise.all(d)}catch{}return h}async function bG(e,t,n,r,o,i){let a,l,c=u=>{let d,f=new Promise((g,v)=>d=v);l=()=>d(),t.signal.addEventListener("abort",l);let h=g=>typeof u!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):u({request:t,params:n.params,context:i},...g!==void 0?[g]:[]),m=(async()=>{try{return{type:"data",result:await(o?o(v=>h(v)):h())}}catch(g){return{type:"error",result:g}}})();return Promise.race([m,f])};try{let u=n.route[e];if(r)if(u){let d,[f]=await Promise.all([c(u).catch(h=>{d=h}),r]);if(d!==void 0)throw d;a=f}else if(await r,u=n.route[e],u)a=await c(u);else if(e==="action"){let d=new URL(t.url),f=d.pathname+d.search;throw Nn(405,{method:t.method,pathname:f,routeId:n.route.id})}else return{type:pt.data,result:void 0};else if(u)a=await c(u);else{let d=new URL(t.url),f=d.pathname+d.search;throw Nn(404,{pathname:f})}Ve(a.result!==void 0,"You defined "+(e==="action"?"an action":"a loader")+" for route "+('"'+n.route.id+"\" but didn't return anything from your `"+e+"` ")+"function. Please return a value or `null`.")}catch(u){return{type:pt.error,result:u}}finally{l&&t.signal.removeEventListener("abort",l)}return a}async function wG(e){let{result:t,type:n}=e;if(g2(t)){let u;try{let d=t.headers.get("Content-Type");d&&/\bapplication\/json\b/.test(d)?t.body==null?u=null:u=await t.json():u=await t.text()}catch(d){return{type:pt.error,error:d}}return n===pt.error?{type:pt.error,error:new _f(t.status,t.statusText,u),statusCode:t.status,headers:t.headers}:{type:pt.data,data:u,statusCode:t.status,headers:t.headers}}if(n===pt.error){if(pS(t)){var r;if(t.data instanceof Error){var o;return{type:pt.error,error:t.data,statusCode:(o=t.init)==null?void 0:o.status}}t=new _f(((r=t.init)==null?void 0:r.status)||500,void 0,t.data)}return{type:pt.error,error:t,statusCode:Xh(t)?t.status:void 0}}if(PG(t)){var i,a;return{type:pt.deferred,deferredData:t,statusCode:(i=t.init)==null?void 0:i.status,headers:((a=t.init)==null?void 0:a.headers)&&new Headers(t.init.headers)}}if(pS(t)){var l,c;return{type:pt.data,data:t.data,statusCode:(l=t.init)==null?void 0:l.status,headers:(c=t.init)!=null&&c.headers?new Headers(t.init.headers):void 0}}return{type:pt.data,data:t}}function SG(e,t,n,r,o,i){let a=e.headers.get("Location");if(Ve(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!T0.test(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=Ug(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function lS(e,t,n){if(T0.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=Eu(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function ga(e,t,n,r){let o=e.createURL(m2(t)).toString(),i={signal:n};if(r&&Fr(r.formMethod)){let{formMethod:a,formEncType:l}=r;i.method=a.toUpperCase(),l==="application/json"?(i.headers=new Headers({"Content-Type":l}),i.body=JSON.stringify(r.json)):l==="text/plain"?i.body=r.text:l==="application/x-www-form-urlencoded"&&r.formData?i.body=Vg(r.formData):i.body=r.formData}return new Request(o,i)}function Vg(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function cS(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function jG(e,t,n,r,o){let i={},a=null,l,c=!1,u={},d=n&&sr(n[1])?n[1].error:void 0;return e.forEach(f=>{if(!(f.route.id in t))return;let h=f.route.id,m=t[h];if(Ve(!ys(m),"Cannot handle redirect results in processLoaderData"),sr(m)){let g=m.error;d!==void 0&&(g=d,d=void 0),a=a||{};{let v=Na(e,h);a[v.route.id]==null&&(a[v.route.id]=g)}i[h]=void 0,c||(c=!0,l=Xh(m.error)?m.error.status:500),m.headers&&(u[h]=m.headers)}else Pi(m)?(r.set(h,m.deferredData),i[h]=m.deferredData.data,m.statusCode!=null&&m.statusCode!==200&&!c&&(l=m.statusCode),m.headers&&(u[h]=m.headers)):(i[h]=m.data,m.statusCode&&m.statusCode!==200&&!c&&(l=m.statusCode),m.headers&&(u[h]=m.headers))}),d!==void 0&&n&&(a={[n[0]]:d},i[n[0]]=void 0),{loaderData:i,errors:a,statusCode:l||200,loaderHeaders:u}}function uS(e,t,n,r,o,i,a,l){let{loaderData:c,errors:u}=jG(t,r,o,l);return i.forEach(d=>{let{key:f,match:h,controller:m}=d,g=a[f];if(Ve(g,"Did not find corresponding fetcher result"),!(m&&m.signal.aborted))if(sr(g)){let v=Na(e.matches,h==null?void 0:h.route.id);u&&u[v.route.id]||(u=Ot({},u,{[v.route.id]:g.error})),e.fetchers.delete(f)}else if(ys(g))Ve(!1,"Unhandled fetcher revalidation redirect");else if(Pi(g))Ve(!1,"Unhandled fetcher deferred data");else{let v=pi(g.data);e.fetchers.set(f,v)}}),{loaderData:c,errors:u}}function dS(e,t,n,r){let o=Ot({},t);for(let i of n){let a=i.route.id;if(t.hasOwnProperty(a)?t[a]!==void 0&&(o[a]=t[a]):e[a]!==void 0&&i.route.loader&&(o[a]=e[a]),r&&r.hasOwnProperty(a))break}return o}function fS(e){return e?sr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function Na(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 hS(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 Nn(e,t){let{pathname:n,routeId:r,method:o,type:i,message:a}=t===void 0?{}:t,l="Unknown Server Error",c="Unknown @remix-run/router error";return e===400?(l="Bad Request",i==="route-discovery"?c='Unable to match URL "'+n+'" - the `unstable_patchRoutesOnNavigation()` '+(`function threw the following error:
|
|
554
|
-
`+a):o&&n&&r?c="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?c="defer() is not supported in actions":i==="invalid-body"&&(c="Unable to encode submission body")):e===403?(l="Forbidden",c='Route "'+r+'" does not match URL "'+n+'"'):e===404?(l="Not Found",c='No route matches URL "'+n+'"'):e===405&&(l="Method Not Allowed",o&&n&&r?c="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(c='Invalid request method "'+o.toUpperCase()+'"')),new _f(e||500,l,new Error(c),!0)}function pd(e){let t=Object.entries(e);for(let n=t.length-1;n>=0;n--){let[r,o]=t[n];if(ys(o))return{key:r,result:o}}}function m2(e){let t=typeof e=="string"?oi(e):e;return Cu(Ot({},t,{hash:""}))}function CG(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function EG(e){return typeof e=="object"&&e!=null&&"then"in e}function TG(e){return g2(e.result)&&lG.has(e.result.status)}function Pi(e){return e.type===pt.deferred}function sr(e){return e.type===pt.error}function ys(e){return(e&&e.type)===pt.redirect}function pS(e){return typeof e=="object"&&e!=null&&"type"in e&&"data"in e&&"init"in e&&e.type==="DataWithResponseInit"}function PG(e){let t=e;return t&&typeof t=="object"&&typeof t.data=="object"&&typeof t.subscribe=="function"&&typeof t.cancel=="function"&&typeof t.resolveData=="function"}function g2(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function kG(e){return aG.has(e.toLowerCase())}function Fr(e){return iG.has(e.toLowerCase())}async function RG(e,t,n,r,o){let i=Object.entries(t);for(let a=0;a<i.length;a++){let[l,c]=i[a],u=e.find(h=>(h==null?void 0:h.route.id)===l);if(!u)continue;let d=r.find(h=>h.route.id===u.route.id),f=d!=null&&!h2(d,u)&&(o&&o[u.route.id])!==void 0;Pi(c)&&f&&await P0(c,n,!1).then(h=>{h&&(t[l]=h)})}}async function _G(e,t,n){for(let r=0;r<n.length;r++){let{key:o,routeId:i,controller:a}=n[r],l=t[o];e.find(u=>(u==null?void 0:u.route.id)===i)&&Pi(l)&&(Ve(a,"Expected an AbortController for revalidating fetcher deferred result"),await P0(l,a.signal,!0).then(u=>{u&&(t[o]=u)}))}}async function P0(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:pt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:pt.error,error:o}}return{type:pt.data,data:e.deferredData.data}}}function k0(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function Jl(e,t){let n=typeof t=="string"?oi(t).search:t.search;if(e[e.length-1].route.index&&k0(n||""))return e[e.length-1];let r=l2(e);return r[r.length-1]}function mS(e){let{formMethod:t,formAction:n,formEncType:r,text:o,formData:i,json:a}=e;if(!(!t||!n||!r)){if(o!=null)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:void 0,text:o};if(i!=null)return{formMethod:t,formAction:n,formEncType:r,formData:i,json:void 0,text:void 0};if(a!==void 0)return{formMethod:t,formAction:n,formEncType:r,formData:void 0,json:a,text:void 0}}}function lm(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 DG(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 Wl(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 IG(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 pi(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 AG(e,t){try{let n=e.sessionStorage.getItem(f2);if(n){let r=JSON.parse(n);for(let[o,i]of Object.entries(r||{}))i&&Array.isArray(i)&&t.set(o,new Set(i||[]))}}catch{}}function NG(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(f2,JSON.stringify(n))}catch(r){ll(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
555
|
-
* React Router v6.26.2
|
|
556
|
-
*
|
|
557
|
-
* Copyright (c) Remix Software Inc.
|
|
558
|
-
*
|
|
559
|
-
* This source code is licensed under the MIT license found in the
|
|
560
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
561
|
-
*
|
|
562
|
-
* @license MIT
|
|
563
|
-
*/function Wc(){return Wc=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wc.apply(this,arguments)}const Jh=p.createContext(null),v2=p.createContext(null),Zh=p.createContext(null),ep=p.createContext(null),Zi=p.createContext({outlet:null,matches:[],isDataRoute:!1}),y2=p.createContext(null);function tp(){return p.useContext(ep)!=null}function ii(){return tp()||Ve(!1),p.useContext(ep).location}function x2(e){p.useContext(Zh).static||p.useLayoutEffect(e)}function Gt(){let{isDataRoute:e}=p.useContext(Zi);return e?QG():MG()}function MG(){tp()||Ve(!1);let e=p.useContext(Jh),{basename:t,future:n,navigator:r}=p.useContext(Zh),{matches:o}=p.useContext(Zi),{pathname:i}=ii(),a=JSON.stringify(c2(o,n.v7_relativeSplatPath)),l=p.useRef(!1);return x2(()=>{l.current=!0}),p.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){r.go(u);return}let f=u2(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Li([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const OG=p.createContext(null);function LG(e){let t=p.useContext(Zi).outlet;return t&&p.createElement(OG.Provider,{value:e},t)}function st(){let{matches:e}=p.useContext(Zi),t=e[e.length-1];return t?t.params:{}}function $G(e,t){return b2(e,t)}function b2(e,t,n,r){tp()||Ve(!1);let{navigator:o}=p.useContext(Zh),{matches:i}=p.useContext(Zi),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=ii(),d;if(t){var f;let S=typeof t=="string"?oi(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||Ve(!1),d=S}else d=u;let h=d.pathname||"/",m=h;if(c!=="/"){let S=c.replace(/^\//,"").split("/");m="/"+h.replace(/^\//,"").split("/").slice(S.length).join("/")}let g=ds(e,{pathname:m}),v=VG(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Li([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:Li([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?p.createElement(ep.Provider,{value:{location:Wc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Qt.Pop}},v):v}function FG(){let e=GG(),t=Xh(e)?e.status+" "+e.statusText:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,o={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return p.createElement(p.Fragment,null,p.createElement("h2",null,"Unexpected Application Error!"),p.createElement("h3",{style:{fontStyle:"italic"}},t),n?p.createElement("pre",{style:o},n):null,null)}const zG=p.createElement(FG,null);class BG extends p.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,n){return n.location!==t.location||n.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:n.error,location:n.location,revalidation:t.revalidation||n.revalidation}}componentDidCatch(t,n){console.error("React Router caught the following error during render",t,n)}render(){return this.state.error!==void 0?p.createElement(Zi.Provider,{value:this.props.routeContext},p.createElement(y2.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function UG(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(Jh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement(Zi.Provider,{value:t},r)}function VG(e,t,n,r){var o;if(t===void 0&&(t=[]),n===void 0&&(n=null),r===void 0&&(r=null),e==null){var i;if(!n)return null;if(n.errors)e=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let a=e,l=(o=n)==null?void 0:o.errors;if(l!=null){let d=a.findIndex(f=>f.route.id&&(l==null?void 0:l[f.route.id])!==void 0);d>=0||Ve(!1),a=a.slice(0,Math.min(a.length,d+1))}let c=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d<a.length;d++){let f=a[d];if((f.route.HydrateFallback||f.route.hydrateFallbackElement)&&(u=d),f.route.id){let{loaderData:h,errors:m}=n,g=f.route.loader&&h[f.route.id]===void 0&&(!m||m[f.route.id]===void 0);if(f.route.lazy||g){c=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((d,f,h)=>{let m,g=!1,v=null,S=null;n&&(m=l&&f.route.id?l[f.route.id]:void 0,v=f.route.errorElement||zG,c&&(u<0&&h===0?(KG("route-fallback"),g=!0,S=null):u===h&&(g=!0,S=f.route.hydrateFallbackElement||null)));let b=t.concat(a.slice(0,h+1)),w=()=>{let y;return m?y=v:g?y=S:f.route.Component?y=p.createElement(f.route.Component,null):f.route.element?y=f.route.element:y=d,p.createElement(UG,{match:f,routeContext:{outlet:d,matches:b,isDataRoute:n!=null},children:y})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(BG,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:w(),routeContext:{outlet:null,matches:b,isDataRoute:!0}}):w()},null)}var w2=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(w2||{}),Df=function(e){return e.UseBlocker="useBlocker",e.UseLoaderData="useLoaderData",e.UseActionData="useActionData",e.UseRouteError="useRouteError",e.UseNavigation="useNavigation",e.UseRouteLoaderData="useRouteLoaderData",e.UseMatches="useMatches",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e.UseRouteId="useRouteId",e}(Df||{});function WG(e){let t=p.useContext(Jh);return t||Ve(!1),t}function HG(e){let t=p.useContext(v2);return t||Ve(!1),t}function qG(e){let t=p.useContext(Zi);return t||Ve(!1),t}function S2(e){let t=qG(),n=t.matches[t.matches.length-1];return n.route.id||Ve(!1),n.route.id}function GG(){var e;let t=p.useContext(y2),n=HG(Df.UseRouteError),r=S2(Df.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function QG(){let{router:e}=WG(w2.UseNavigateStable),t=S2(Df.UseNavigateStable),n=p.useRef(!1);return x2(()=>{n.current=!0}),p.useCallback(function(o,i){i===void 0&&(i={}),n.current&&(typeof o=="number"?e.navigate(o):e.navigate(o,Wc({fromRouteId:t},i)))},[e,t])}const gS={};function KG(e,t,n){gS[e]||(gS[e]=!0)}function R0(e){return LG(e.context)}function Se(e){Ve(!1)}function YG(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Qt.Pop,navigator:i,static:a=!1,future:l}=e;tp()&&Ve(!1);let c=t.replace(/^\/*/,"/"),u=p.useMemo(()=>({basename:c,navigator:i,static:a,future:Wc({v7_relativeSplatPath:!1},l)}),[c,l,i,a]);typeof r=="string"&&(r=oi(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=r,v=p.useMemo(()=>{let S=Eu(d,c);return S==null?null:{location:{pathname:S,search:f,hash:h,state:m,key:g},navigationType:o}},[c,d,f,h,m,g,o]);return v==null?null:p.createElement(Zh.Provider,{value:u},p.createElement(ep.Provider,{children:n,value:v}))}function XG(e){let{children:t,location:n}=e;return $G(Wg(t),n)}new Promise(()=>{});function Wg(e,t){t===void 0&&(t=[]);let n=[];return p.Children.forEach(e,(r,o)=>{if(!p.isValidElement(r))return;let i=[...t,o];if(r.type===p.Fragment){n.push.apply(n,Wg(r.props.children,i));return}r.type!==Se&&Ve(!1),!r.props.index||!r.props.children||Ve(!1);let a={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(a.children=Wg(r.props.children,i)),n.push(a)}),n}function JG(e){let t={hasErrorBoundary:e.ErrorBoundary!=null||e.errorElement!=null};return e.Component&&Object.assign(t,{element:p.createElement(e.Component),Component:void 0}),e.HydrateFallback&&Object.assign(t,{hydrateFallbackElement:p.createElement(e.HydrateFallback),HydrateFallback:void 0}),e.ErrorBoundary&&Object.assign(t,{errorElement:p.createElement(e.ErrorBoundary),ErrorBoundary:void 0}),t}/**
|
|
564
|
-
* React Router DOM v6.26.2
|
|
565
|
-
*
|
|
566
|
-
* Copyright (c) Remix Software Inc.
|
|
567
|
-
*
|
|
568
|
-
* This source code is licensed under the MIT license found in the
|
|
569
|
-
* LICENSE.md file in the root directory of this source tree.
|
|
570
|
-
*
|
|
571
|
-
* @license MIT
|
|
572
|
-
*/function If(){return If=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},If.apply(this,arguments)}function Hg(e){return e===void 0&&(e=""),new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(o=>[n,o]):[[n,r]])},[]))}function ZG(e,t){let n=Hg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const eQ="6";try{window.__reactRouterVersion=eQ}catch{}function tQ(e,t){return fG({basename:void 0,future:If({},void 0,{v7_prependBasename:!0}),history:Oq({window:void 0}),hydrationData:nQ(),routes:e,mapRouteProperties:JG,unstable_dataStrategy:void 0,unstable_patchRoutesOnNavigation:void 0,window:void 0}).initialize()}function nQ(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=If({},t,{errors:rQ(t.errors)})),t}function rQ(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 _f(o.status,o.statusText,o.data,o.internal===!0);else if(o&&o.__type==="Error"){if(o.__subType){let i=window[o.__subType];if(typeof i=="function")try{let a=new i(o.message);a.stack="",n[r]=a}catch{}}if(n[r]==null){let i=new Error(o.message);i.stack="",n[r]=i}}else n[r]=o;return n}const oQ=p.createContext({isTransitioning:!1}),iQ=p.createContext(new Map),sQ="startTransition",vS=QS[sQ],aQ="flushSync",yS=ON[aQ];function lQ(e){vS?vS(e):e()}function Hl(e){yS?yS(e):e()}class cQ{constructor(){this.status="pending",this.promise=new Promise((t,n)=>{this.resolve=r=>{this.status==="pending"&&(this.status="resolved",t(r))},this.reject=r=>{this.status==="pending"&&(this.status="rejected",n(r))}})}}function uQ(e){let{fallbackElement:t,router:n,future:r}=e,[o,i]=p.useState(n.state),[a,l]=p.useState(),[c,u]=p.useState({isTransitioning:!1}),[d,f]=p.useState(),[h,m]=p.useState(),[g,v]=p.useState(),S=p.useRef(new Map),{v7_startTransition:b}=r||{},w=p.useCallback(j=>{b?lQ(j):j()},[b]),y=p.useCallback((j,R)=>{let{deletedFetchers:k,unstable_flushSync:I,unstable_viewTransitionOpts:O}=R;k.forEach(L=>S.current.delete(L)),j.fetchers.forEach((L,B)=>{L.data!==void 0&&S.current.set(B,L.data)});let F=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!O||F){I?Hl(()=>i(j)):w(()=>i(j));return}if(I){Hl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:O.currentLocation,nextLocation:O.nextLocation})});let L=n.window.document.startViewTransition(()=>{Hl(()=>i(j))});L.finished.finally(()=>{Hl(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),Hl(()=>m(L));return}h?(d&&d.resolve(),h.skipTransition(),v({state:j,currentLocation:O.currentLocation,nextLocation:O.nextLocation})):(l(j),u({isTransitioning:!0,flushSync:!1,currentLocation:O.currentLocation,nextLocation:O.nextLocation}))},[n.window,h,d,S,w]);p.useLayoutEffect(()=>n.subscribe(y),[n,y]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new cQ)},[c]),p.useEffect(()=>{if(d&&a&&n.window){let j=a,R=d.promise,k=n.window.document.startViewTransition(async()=>{w(()=>i(j)),await R});k.finished.finally(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(k)}},[w,a,d,n.window]),p.useEffect(()=>{d&&a&&o.location.key===a.location.key&&d.resolve()},[d,h,o.location,a]),p.useEffect(()=>{!c.isTransitioning&&g&&(l(g.state),u({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),v(void 0))},[c.isTransitioning,g]),p.useEffect(()=>{},[]);let x=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,R,k)=>n.navigate(j,{state:R,preventScrollReset:k==null?void 0:k.preventScrollReset}),replace:(j,R,k)=>n.navigate(j,{replace:!0,state:R,preventScrollReset:k==null?void 0:k.preventScrollReset})}),[n]),C=n.basename||"/",E=p.useMemo(()=>({router:n,navigator:x,static:!1,basename:C}),[n,x,C]),T=p.useMemo(()=>({v7_relativeSplatPath:n.future.v7_relativeSplatPath}),[n.future.v7_relativeSplatPath]);return p.createElement(p.Fragment,null,p.createElement(Jh.Provider,{value:E},p.createElement(v2.Provider,{value:o},p.createElement(iQ.Provider,{value:S.current},p.createElement(oQ.Provider,{value:c},p.createElement(YG,{basename:C,location:o.location,navigationType:o.historyAction,navigator:x,future:T},o.initialized||n.future.v7_partialHydration?p.createElement(dQ,{routes:n.routes,future:n.future,state:o}):t))))),null)}const dQ=p.memo(fQ);function fQ(e){let{routes:t,future:n,state:r}=e;return b2(t,void 0,r,n)}var xS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(xS||(xS={}));var bS;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(bS||(bS={}));function _0(e){let t=p.useRef(Hg(e)),n=p.useRef(!1),r=ii(),o=p.useMemo(()=>ZG(r.search,n.current?null:t.current),[r.search]),i=Gt(),a=p.useCallback((l,c)=>{const u=Hg(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,a]}const hQ=new Map([["aac","audio/aac"],["abw","application/x-abiword"],["arc","application/x-freearc"],["avif","image/avif"],["avi","video/x-msvideo"],["azw","application/vnd.amazon.ebook"],["bin","application/octet-stream"],["bmp","image/bmp"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["cda","application/x-cdf"],["csh","application/x-csh"],["css","text/css"],["csv","text/csv"],["doc","application/msword"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["eot","application/vnd.ms-fontobject"],["epub","application/epub+zip"],["gz","application/gzip"],["gif","image/gif"],["heic","image/heic"],["heif","image/heif"],["htm","text/html"],["html","text/html"],["ico","image/vnd.microsoft.icon"],["ics","text/calendar"],["jar","application/java-archive"],["jpeg","image/jpeg"],["jpg","image/jpeg"],["js","text/javascript"],["json","application/json"],["jsonld","application/ld+json"],["mid","audio/midi"],["midi","audio/midi"],["mjs","text/javascript"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mpeg","video/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["opus","audio/opus"],["otf","font/otf"],["png","image/png"],["pdf","application/pdf"],["php","application/x-httpd-php"],["ppt","application/vnd.ms-powerpoint"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["rar","application/vnd.rar"],["rtf","application/rtf"],["sh","application/x-sh"],["svg","image/svg+xml"],["swf","application/x-shockwave-flash"],["tar","application/x-tar"],["tif","image/tiff"],["tiff","image/tiff"],["ts","video/mp2t"],["ttf","font/ttf"],["txt","text/plain"],["vsd","application/vnd.visio"],["wav","audio/wav"],["weba","audio/webm"],["webm","video/webm"],["webp","image/webp"],["woff","font/woff"],["woff2","font/woff2"],["xhtml","application/xhtml+xml"],["xls","application/vnd.ms-excel"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xml","application/xml"],["xul","application/vnd.mozilla.xul+xml"],["zip","application/zip"],["7z","application/x-7z-compressed"],["mkv","video/x-matroska"],["mov","video/quicktime"],["msg","application/vnd.ms-outlook"]]);function Tu(e,t){const n=pQ(e);if(typeof n.path!="string"){const{webkitRelativePath:r}=e;Object.defineProperty(n,"path",{value:typeof t=="string"?t:typeof r=="string"&&r.length>0?r:e.name,writable:!1,configurable:!1,enumerable:!0})}return n}function pQ(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=hQ.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var kl=(e,t,n)=>new Promise((r,o)=>{var i=c=>{try{l(n.next(c))}catch(u){o(u)}},a=c=>{try{l(n.throw(c))}catch(u){o(u)}},l=c=>c.done?r(c.value):Promise.resolve(c.value).then(i,a);l((n=n.apply(e,t)).next())});const mQ=[".DS_Store","Thumbs.db"];function gQ(e){return kl(this,null,function*(){return Af(e)&&vQ(e.dataTransfer)?wQ(e.dataTransfer,e.type):yQ(e)?xQ(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?bQ(e):[]})}function vQ(e){return Af(e)}function yQ(e){return Af(e)&&Af(e.target)}function Af(e){return typeof e=="object"&&e!==null}function xQ(e){return qg(e.target.files).map(t=>Tu(t))}function bQ(e){return kl(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>Tu(n))})}function wQ(e,t){return kl(this,null,function*(){if(e.items){const n=qg(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(SQ));return wS(j2(r))}return wS(qg(e.files).map(n=>Tu(n)))})}function wS(e){return e.filter(t=>mQ.indexOf(t.name)===-1)}function qg(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 SQ(e){if(typeof e.webkitGetAsEntry!="function")return SS(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?C2(t):SS(e)}function j2(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?j2(n):[n]],[])}function SS(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=Tu(t);return Promise.resolve(n)}function jQ(e){return kl(this,null,function*(){return e.isDirectory?C2(e):CQ(e)})}function C2(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(a=>kl(this,null,function*(){if(a.length){const l=Promise.all(a.map(jQ));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),a=>{r(a)})}i()})}function CQ(e){return kl(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=Tu(r,e.fullPath);t(o)},r=>{n(r)})})})}function EQ(e,t){if(e&&t){const n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=(e.type||"").toLowerCase(),i=o.replace(/\/.*$/,"");return n.some(a=>{const l=a.trim().toLowerCase();return l.charAt(0)==="."?r.toLowerCase().endsWith(l):l.endsWith("/*")?i===l.replace(/\/.*$/,""):o===l})}return!0}var TQ=Object.defineProperty,PQ=Object.defineProperties,kQ=Object.getOwnPropertyDescriptors,jS=Object.getOwnPropertySymbols,RQ=Object.prototype.hasOwnProperty,_Q=Object.prototype.propertyIsEnumerable,CS=(e,t,n)=>t in e?TQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,DQ=(e,t)=>{for(var n in t||(t={}))RQ.call(t,n)&&CS(e,n,t[n]);if(jS)for(var n of jS(t))_Q.call(t,n)&&CS(e,n,t[n]);return e},IQ=(e,t)=>PQ(e,kQ(t));const AQ="file-invalid-type",NQ="file-too-large",MQ="file-too-small",OQ="too-many-files",LQ=e=>{e=Array.isArray(e)&&e.length===1?e[0]:e;const t=Array.isArray(e)?`one of ${e.join(", ")}`:e;return{code:AQ,message:`File type must be ${t}`}},ES=e=>({code:NQ,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),TS=e=>({code:MQ,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),$Q={code:OQ,message:"Too many files"};function E2(e,t){const n=e.type==="application/x-moz-file"||EQ(e,t);return[n,n?null:LQ(t)]}function T2(e,t,n){if(fs(e.size))if(fs(t)&&fs(n)){if(e.size>n)return[!1,ES(n)];if(e.size<t)return[!1,TS(t)]}else{if(fs(t)&&e.size<t)return[!1,TS(t)];if(fs(n)&&e.size>n)return[!1,ES(n)]}return[!0,null]}function fs(e){return e!=null}function FQ({files:e,accept:t,minSize:n,maxSize:r,multiple:o,maxFiles:i,validator:a}){return!o&&e.length>1||o&&i>=1&&e.length>i?!1:e.every(l=>{const[c]=E2(l,t),[u]=T2(l,n,r),d=a?a(l):null;return c&&u&&!d})}function Nf(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function md(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,t=>t==="Files"||t==="application/x-moz-file"):!!e.target&&!!e.target.files}function PS(e){e.preventDefault()}function zQ(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function BQ(e){return e.indexOf("Edge/")!==-1}function UQ(e=window.navigator.userAgent){return zQ(e)||BQ(e)}function io(...e){return(t,...n)=>e.some(r=>(!Nf(t)&&r&&r(t,...n),Nf(t)))}function VQ(){return"showOpenFilePicker"in window}function WQ(e){return fs(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return P2(n)||(console.warn(`Skipped "${n}" 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.`),o=!1),(!Array.isArray(r)||!r.every(k2))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>IQ(DQ({},n),{[r]:o}),{})}]:e}function HQ(e){if(fs(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>P2(t)||k2(t)).join(",")}function qQ(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function GQ(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function P2(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function k2(e){return/^.*\.[\w]+$/.test(e)}var QQ=Object.defineProperty,KQ=Object.defineProperties,YQ=Object.getOwnPropertyDescriptors,Mf=Object.getOwnPropertySymbols,R2=Object.prototype.hasOwnProperty,_2=Object.prototype.propertyIsEnumerable,kS=(e,t,n)=>t in e?QQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,On=(e,t)=>{for(var n in t||(t={}))R2.call(t,n)&&kS(e,n,t[n]);if(Mf)for(var n of Mf(t))_2.call(t,n)&&kS(e,n,t[n]);return e},bi=(e,t)=>KQ(e,YQ(t)),Of=(e,t)=>{var n={};for(var r in e)R2.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&Mf)for(var r of Mf(e))t.indexOf(r)<0&&_2.call(e,r)&&(n[r]=e[r]);return n};const D0=p.forwardRef((e,t)=>{var n=e,{children:r}=n,o=Of(n,["children"]);const i=I2(o),{open:a}=i,l=Of(i,["open"]);return p.useImperativeHandle(t,()=>({open:a}),[a]),fn.createElement(p.Fragment,null,r(bi(On({},l),{open:a})))});D0.displayName="Dropzone";const D2={disabled:!1,getFilesFromEvent:gQ,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!0,autoFocus:!1};D0.defaultProps=D2;D0.propTypes={children:vt.func,accept:vt.objectOf(vt.arrayOf(vt.string)),multiple:vt.bool,preventDropOnDocument:vt.bool,noClick:vt.bool,noKeyboard:vt.bool,noDrag:vt.bool,noDragEventsBubbling:vt.bool,minSize:vt.number,maxSize:vt.number,maxFiles:vt.number,disabled:vt.bool,getFilesFromEvent:vt.func,onFileDialogCancel:vt.func,onFileDialogOpen:vt.func,useFsAccessApi:vt.bool,autoFocus:vt.bool,onDragEnter:vt.func,onDragLeave:vt.func,onDragOver:vt.func,onDrop:vt.func,onDropAccepted:vt.func,onDropRejected:vt.func,onError:vt.func,validator:vt.func};const Gg={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function I2(e={}){const{accept:t,disabled:n,getFilesFromEvent:r,maxSize:o,minSize:i,multiple:a,maxFiles:l,onDragEnter:c,onDragLeave:u,onDragOver:d,onDrop:f,onDropAccepted:h,onDropRejected:m,onFileDialogCancel:g,onFileDialogOpen:v,useFsAccessApi:S,autoFocus:b,preventDropOnDocument:w,noClick:y,noKeyboard:x,noDrag:C,noDragEventsBubbling:E,onError:T,validator:j}=On(On({},D2),e),R=p.useMemo(()=>HQ(t),[t]),k=p.useMemo(()=>WQ(t),[t]),I=p.useMemo(()=>typeof v=="function"?v:RS,[v]),O=p.useMemo(()=>typeof g=="function"?g:RS,[g]),F=p.useRef(null),L=p.useRef(null),[B,D]=p.useReducer(XQ,Gg),{isFocused:_,isFileDialogActive:P}=B,N=p.useRef(typeof window<"u"&&window.isSecureContext&&S&&VQ()),$=()=>{!N.current&&P&&setTimeout(()=>{if(L.current){const{files:J}=L.current;J.length||(D({type:"closeDialog"}),O())}},300)};p.useEffect(()=>(window.addEventListener("focus",$,!1),()=>{window.removeEventListener("focus",$,!1)}),[L,P,O,N]);const H=p.useRef([]),X=J=>{F.current&&F.current.contains(J.target)||(J.preventDefault(),H.current=[])};p.useEffect(()=>(w&&(document.addEventListener("dragover",PS,!1),document.addEventListener("drop",X,!1)),()=>{w&&(document.removeEventListener("dragover",PS),document.removeEventListener("drop",X))}),[F,w]),p.useEffect(()=>(!n&&b&&F.current&&F.current.focus(),()=>{}),[F,b,n]);const ce=p.useCallback(J=>{T?T(J):console.error(J)},[T]),Ie=p.useCallback(J=>{J.preventDefault(),J.persist(),oe(J),H.current=[...H.current,J.target],md(J)&&Promise.resolve(r(J)).then(ie=>{if(Nf(J)&&!E)return;const G=ie.length,Ce=G>0&&FQ({files:ie,accept:R,minSize:i,maxSize:o,multiple:a,maxFiles:l,validator:j}),He=G>0&&!Ce;D({isDragAccept:Ce,isDragReject:He,isDragActive:!0,type:"setDraggedFiles"}),c&&c(J)}).catch(ie=>ce(ie))},[r,c,ce,E,R,i,o,a,l,j]),ue=p.useCallback(J=>{J.preventDefault(),J.persist(),oe(J);const ie=md(J);if(ie&&J.dataTransfer)try{J.dataTransfer.dropEffect="copy"}catch{}return ie&&d&&d(J),!1},[d,E]),xe=p.useCallback(J=>{J.preventDefault(),J.persist(),oe(J);const ie=H.current.filter(Ce=>F.current&&F.current.contains(Ce)),G=ie.indexOf(J.target);G!==-1&&ie.splice(G,1),H.current=ie,!(ie.length>0)&&(D({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),md(J)&&u&&u(J))},[F,u,E]),_e=p.useCallback((J,ie)=>{const G=[],Ce=[];J.forEach(He=>{const[lt,gt]=E2(He,R),[mn,Xt]=T2(He,i,o),Bt=j?j(He):null;if(lt&&mn&&!Bt)G.push(He);else{let an=[gt,Xt];Bt&&(an=an.concat(Bt)),Ce.push({file:He,errors:an.filter(si=>si)})}}),(!a&&G.length>1||a&&l>=1&&G.length>l)&&(G.forEach(He=>{Ce.push({file:He,errors:[$Q]})}),G.splice(0)),D({acceptedFiles:G,fileRejections:Ce,type:"setFiles"}),f&&f(G,Ce,ie),Ce.length>0&&m&&m(Ce,ie),G.length>0&&h&&h(G,ie)},[D,a,R,i,o,l,f,h,m,j]),de=p.useCallback(J=>{J.preventDefault(),J.persist(),oe(J),H.current=[],md(J)&&Promise.resolve(r(J)).then(ie=>{Nf(J)&&!E||_e(ie,J)}).catch(ie=>ce(ie)),D({type:"reset"})},[r,_e,ce,E]),Oe=p.useCallback(()=>{if(N.current){D({type:"openDialog"}),I();const J={multiple:a,types:k};window.showOpenFilePicker(J).then(ie=>r(ie)).then(ie=>{_e(ie,null),D({type:"closeDialog"})}).catch(ie=>{qQ(ie)?(O(ie),D({type:"closeDialog"})):GQ(ie)?(N.current=!1,L.current?(L.current.value=null,L.current.click()):ce(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."))):ce(ie)});return}L.current&&(D({type:"openDialog"}),I(),L.current.value=null,L.current.click())},[D,I,O,S,_e,ce,k,a]),Ye=p.useCallback(J=>{!F.current||!F.current.isEqualNode(J.target)||(J.key===" "||J.key==="Enter"||J.keyCode===32||J.keyCode===13)&&(J.preventDefault(),Oe())},[F,Oe]),jt=p.useCallback(()=>{D({type:"focus"})},[]),mt=p.useCallback(()=>{D({type:"blur"})},[]),at=p.useCallback(()=>{y||(UQ()?setTimeout(Oe,0):Oe())},[y,Oe]),Re=J=>n?null:J,et=J=>x?null:Re(J),ht=J=>C?null:Re(J),oe=J=>{E&&J.stopPropagation()},Q=p.useMemo(()=>(J={})=>{var ie=J,{refKey:G="ref",role:Ce,onKeyDown:He,onFocus:lt,onBlur:gt,onClick:mn,onDragEnter:Xt,onDragOver:Bt,onDragLeave:an,onDrop:si}=ie,ai=Of(ie,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return On(On({onKeyDown:et(io(He,Ye)),onFocus:et(io(lt,jt)),onBlur:et(io(gt,mt)),onClick:Re(io(mn,at)),onDragEnter:ht(io(Xt,Ie)),onDragOver:ht(io(Bt,ue)),onDragLeave:ht(io(an,xe)),onDrop:ht(io(si,de)),role:typeof Ce=="string"&&Ce!==""?Ce:"presentation",[G]:F},!n&&!x?{tabIndex:0}:{}),ai)},[F,Ye,jt,mt,at,Ie,ue,xe,de,x,C,n]),fe=p.useCallback(J=>{J.stopPropagation()},[]),Pe=p.useMemo(()=>(J={})=>{var ie=J,{refKey:G="ref",onChange:Ce,onClick:He}=ie,lt=Of(ie,["refKey","onChange","onClick"]);const gt={accept:R,multiple:a,type:"file",style:{display:"none"},onChange:Re(io(Ce,de)),onClick:Re(io(He,fe)),tabIndex:-1,[G]:L};return On(On({},gt),lt)},[L,t,a,de,n]);return bi(On({},B),{isFocused:_&&!n,getRootProps:Q,getInputProps:Pe,rootRef:F,inputRef:L,open:Re(Oe)})}function XQ(e,t){switch(t.type){case"focus":return bi(On({},e),{isFocused:!0});case"blur":return bi(On({},e),{isFocused:!1});case"openDialog":return bi(On({},Gg),{isFileDialogActive:!0});case"closeDialog":return bi(On({},e),{isFileDialogActive:!1});case"setDraggedFiles":return bi(On({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return bi(On({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return On({},Gg);default:return e}}function RS(){}const[JQ,ZQ]=Un("Dropzone component was not found in tree");function I0(e){const t=n=>{const{children:r,...o}=V(`Dropzone${G0(e)}`,{},n),i=ZQ(),a=Qo(r)?r:s.jsx("span",{children:r});return i[e]?p.cloneElement(a,o):null};return t.displayName=`@mantine/dropzone/${G0(e)}`,t}const eK=I0("accept"),tK=I0("reject"),nK=I0("idle");var Hc={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const rK={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},oK=(e,{radius:t,variant:n,acceptColor:r,rejectColor:o})=>{const i=e.variantColorResolver({color:r||e.primaryColor,theme:e,variant:n}),a=e.variantColorResolver({color:o||"red",theme:e,variant:n});return{root:{"--dropzone-radius":it(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":a.color,"--dropzone-reject-bg":a.background}}},es=Y((e,t)=>{const n=V("Dropzone",rK,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,radius:u,disabled:d,loading:f,multiple:h,maxSize:m,accept:g,children:v,onDropAny:S,onDrop:b,onReject:w,openRef:y,name:x,maxFiles:C,autoFocus:E,activateOnClick:T,activateOnDrag:j,dragEventsBubbling:R,activateOnKeyboard:k,onDragEnter:I,onDragLeave:O,onDragOver:F,onFileDialogCancel:L,onFileDialogOpen:B,preventDropOnDocument:D,useFsAccessApi:_,getFilesFromEvent:P,validator:N,rejectColor:$,acceptColor:H,enablePointerEvents:X,loaderProps:ce,inputProps:Ie,mod:ue,...xe}=n,_e=he({name:"Dropzone",classes:Hc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:oK}),{getRootProps:de,getInputProps:Oe,isDragAccept:Ye,isDragReject:jt,open:mt}=I2({onDrop:S,onDropAccepted:b,onDropRejected:w,disabled:d||f,accept:Array.isArray(g)?g.reduce((Re,et)=>({...Re,[et]:[]}),{}):g,multiple:h,maxSize:m,maxFiles:C,autoFocus:E,noClick:!T,noDrag:!j,noDragEventsBubbling:!R,noKeyboard:!k,onDragEnter:I,onDragLeave:O,onDragOver:F,onFileDialogCancel:L,onFileDialogOpen:B,preventDropOnDocument:D,useFsAccessApi:_,validator:N,...P?{getFilesFromEvent:P}:null});Bf(y,mt);const at=!Ye&&!jt;return s.jsx(JQ,{value:{accept:Ye,reject:jt,idle:at},children:s.jsxs(q,{...de(),..._e("root",{focusable:!0}),...xe,mod:[{accept:Ye,reject:jt,idle:at,loading:f,"activate-on-click":T},ue],children:[s.jsx(ex,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:ce}),s.jsx("input",{...Oe(Ie),name:x}),s.jsx("div",{..._e("inner"),ref:t,"data-enable-pointer-events":X||void 0,children:v})]})})});es.classes=Hc;es.displayName="@mantine/dropzone/Dropzone";es.Accept=eK;es.Idle=nK;es.Reject=tK;const iK={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Jr("max"),withinPortal:!0},A0=Y((e,t)=>{const n=V("DropzoneFullScreen",iK,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,active:u,onDrop:d,onReject:f,zIndex:h,withinPortal:m,portalProps:g,...v}=n,S=he({name:"DropzoneFullScreen",classes:Hc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:b,resolvedStyles:w}=Gc({classNames:r,styles:a,props:n}),[y,x]=p.useState(0),[C,{open:E,close:T}]=av(!1),j=k=>{var I;(I=k.dataTransfer)!=null&&I.types.includes("Files")&&(x(O=>O+1),E())},R=()=>{x(k=>k-1)};return p.useEffect(()=>{y===0&&T()},[y]),p.useEffect(()=>{if(u)return document.addEventListener("dragenter",j,!1),document.addEventListener("dragleave",R,!1),()=>{document.removeEventListener("dragenter",j,!1),document.removeEventListener("dragleave",R,!1)}},[u]),s.jsx(Vs,{...g,withinPortal:m,children:s.jsx(q,{...S("fullScreen",{style:{opacity:C?1:0,pointerEvents:C?"all":"none",zIndex:h}}),ref:t,children:s.jsx(es,{...v,classNames:b,styles:w,unstyled:l,className:Hc.dropzone,onDrop:k=>{d==null||d(k),T(),x(0)},onReject:k=>{f==null||f(k),T(),x(0)}})})})});A0.classes=Hc;A0.displayName="@mantine/dropzone/DropzoneFullScreen";es.FullScreen=A0;const gd=es,sK='{"resourceType": "Bundle"}';function cm({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:a="show",loading:l}){po[a]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function aK(){const e=At(),t=le(),[n,r]=p.useState({}),o=p.useCallback(async(l,c)=>{const u="batch-upload";cm({id:u,title:"Batch Upload in Progress",message:"Your batch data is being uploaded. This may take a moment...",method:"show",loading:!0});try{r({});let d=JSON.parse(l);d.type!=="batch"&&d.type!=="transaction"&&(d=Ek(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),cm({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(Js,{size:"1rem"}),withCloseButton:!0})}catch(d){cm({id:u,title:"Batch Upload Failed",color:"red",message:Ae(d),method:"update",icon:s.jsx(Ef,{size:"1rem"}),withCloseButton:!0})}},[t]),i=p.useCallback(async l=>{for(const c of l){const u=new FileReader;u.onload=d=>{var f;return o((f=d.target)==null?void 0:f.result,c.name)},u.readAsText(c)}},[o]),a=p.useCallback(async l=>{await o(l.input,"JSON Data")},[o]);return s.jsxs(Me,{children:[s.jsx(ve,{children:"Batch Create"}),s.jsxs("p",{children:["Use this page to create, read, or update multiple resources. For more details, see ",s.jsx("a",{href:"https://www.hl7.org/fhir/http.html#transaction",children:"FHIR Batch and Transaction"}),"."]}),Object.keys(n).length===0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Input"}),s.jsxs(Je,{defaultValue:"upload",children:[s.jsxs(Je.List,{children:[s.jsx(Je.Tab,{value:"upload",children:"File Upload"}),s.jsx(Je.Tab,{value:"json",children:"JSON"})]}),s.jsx(Je.Panel,{value:"upload",pt:"xs",children:s.jsx(gd,{onDrop:i,accept:["application/json"],children:s.jsxs(te,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(gd.Accept,{children:s.jsx(Aw,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(gd.Reject,{children:s.jsx(Ef,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(gd.Idle,{children:s.jsx(Aw,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(me,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(me,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(Je.Panel,{value:"json",pt:"xs",children:s.jsxs(qe,{onSubmit:a,children:[s.jsx(vl,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:sK,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ae,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(Je,{defaultValue:Object.keys(n)[0],children:[s.jsx(Je.List,{children:Object.keys(n).map(l=>s.jsx(Je.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>s.jsx(Je.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ae,{onClick:()=>r({}),children:"Start over"})})]})]})}function lK(){const{resourceType:e}=st(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=al("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(Me,{children:[s.jsxs(ve,{children:["No apps for ",e]}),s.jsx(We,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(Me,{children:s.jsx("div",{children:r.map(o=>s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(We,{to:`/forms/${o.id}?subject=`+n.map(i=>`${e}/${i}`).join(","),children:o.name})}),s.jsx("p",{children:o.description})]},o.id))})}):s.jsx(Yr,{})}function cK(){const e=le(),[t,n]=p.useState(),[r,o]=p.useState(!1);return s.jsx(Me,{width:450,children:s.jsxs(qe,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(a=>n(ft(a)))},children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Change password"})]}),!r&&s.jsxs($e,{gap:"xl",mt:"xl",children:[s.jsx(Hr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Qe(t,"oldPassword")}),s.jsx(Hr,{name:"newPassword",label:"New password",required:!0,error:Qe(t,"newPassword")}),s.jsx(Hr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Qe(t,"confirmPassword")}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ae,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const Qg=["Form","JSON","Profiles"],uK=["Profiles"],um=Qg[0].toLowerCase();function dK(){const e=Gt(),t=At(),{resourceType:n}=st(),[r,o]=p.useState(()=>{const a=window.location.pathname.split("/").pop();return a&&Qg.map(l=>l.toLowerCase()).includes(a)?a:um});function i(a){a||(a=um),o(a),e(`/${n}/new/${a}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Xn,{children:[s.jsxs(me,{p:"md",fw:500,children:["New ",n]}),s.jsx(_r,{children:s.jsx(Je,{defaultValue:um,value:r,onChange:i,children:s.jsx(Je.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:Qg.map(a=>s.jsx(Je.Tab,{value:a.toLowerCase(),px:"md",children:uK.includes(a)?s.jsxs(te,{gap:"xs",wrap:"nowrap",children:[a,s.jsx(iu,{color:t.primaryColor,size:"sm",children:"Beta"})]}):a},a))})})})]}),s.jsx(R0,{})]})}function fK(){return s.jsx(Me,{children:s.jsxs($e,{children:[s.jsx(ve,{order:1,children:"Unexpected Error"}),s.jsx(me,{children:"We're sorry, something went wrong."}),s.jsxs(me,{children:["Please contact ",s.jsx(Ke,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const hK="_root_1fbwr_1",pK="_entry_1fbwr_8",mK="_key_1fbwr_13",gK="_value_1fbwr_20",np={root:hK,entry:pK,key:mK,value:gK};function ze(e){return s.jsx(_r,{children:s.jsx("div",{className:np.root,children:e.children})})}ze.Entry=function(t){return s.jsx("div",{className:np.entry,children:t.children})};ze.Key=function(t){return s.jsx("div",{className:np.key,children:t.children})};ze.Value=function(t){return s.jsx("div",{className:np.value,children:t.children})};function vK(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function A2(e){var n,r;const t=St(e.patient);return t?s.jsxs(ze,{children:[s.jsx(Ji,{value:t,size:"lg",color:vK(t)}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Name"}),s.jsx(ze.Value,{children:s.jsx(We,{to:t,fw:500,children:t.name?s.jsx(t0,{value:t.name[0],options:{use:!1}}):"[blank]"})})]}),t.birthDate&&s.jsxs(s.Fragment,{children:[s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"DoB"}),s.jsx(ze.Value,{children:t.birthDate})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Age"}),s.jsx(ze.Value,{children:h6(t.birthDate)})]})]}),t.gender&&s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Gender"}),s.jsx(ze.Value,{children:t.gender})]}),t.address&&s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"State"}),s.jsx(ze.Value,{children:(n=t.address[0])==null?void 0:n.state})]}),(r=t.identifier)==null?void 0:r.map(o=>s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:o==null?void 0:o.system}),s.jsx(ze.Value,{children:o==null?void 0:o.value})]},`${o==null?void 0:o.system}-${o==null?void 0:o.value}`))]}):null}function N2(e){const t=St(e.resource);if(!t)return null;const n=[{key:"Type",value:s.jsx(We,{to:`/${t.resourceType}`,children:t.resourceType})}];function r(a,l){a&&l&&n.push({key:a,value:l})}function o(a){a&&r(a.system,a.value)}function i(a,l){Array.isArray(l)?l.forEach(c=>i(a,c)):typeof l=="string"?r(a,l):l&&(Array.isArray(l.coding)?r(a,l.coding.map(c=>c.display||c.code).join(", ")):r(a,l.text))}if("name"in t){const a=qo(t);a!==rt(t)&&r("Name",a)}return"category"in t&&i("Category",t.category),t.resourceType!=="Bot"&&"code"in t&&i("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}),s.jsx(ze,{children:n.map(a=>s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:a.key}),s.jsx(ze.Value,{children:a.value})]},`${a.key}-${a.value}`))})}function N0(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function yK(e){var t;if(e.resourceType==="Specimen")return e;if(e.resourceType==="Observation")return e.specimen;if(e.resourceType==="DiagnosticReport"||e.resourceType==="ServiceRequest")return(t=e.specimen)==null?void 0:t[0]}function Ld(e,t){return new Promise((n,r)=>{var i;const o=new MessageChannel;o.port1.onmessage=({data:a})=>{o.port1.close(),a.error?r(a.error):n(a.result)},(i=e.contentWindow)==null||i.postMessage(t,"https://codeeditor.medplum.com",[o.port2])})}function ts(e){var t;return il((t=e.getActiveLogin())==null?void 0:t.project)}function xK(e,t){const n=new Blob([e],{type:rn.JSON}),r=URL.createObjectURL(n),o=document.createElement("a");o.href=r;const i=new Date().toISOString().replace(/\D/g,"");o.download=`${i}.json`,document.body.appendChild(o),o.click(),URL.revokeObjectURL(r)}function bK(){const{id:e}=st(),t=ii(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=le(),[i,a]=p.useState(!0),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,S]=p.useState();if(p.useEffect(()=>{const y={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const x=r.split(",").filter(C=>!!C);x.length===1&&y.entry.push({request:{method:"GET",url:x[0]}}),d(x)}o.executeBatch(y).then(x=>{var C,E,T,j,R,k,I,O;((T=(E=(C=x.entry)==null?void 0:C[0])==null?void 0:E.response)==null?void 0:T.status)!=="200"?g((k=(R=(j=x.entry)==null?void 0:j[0])==null?void 0:R.response)==null?void 0:k.outcome):(c((I=x.entry[0])==null?void 0:I.resource),h((O=x.entry[1])==null?void 0:O.resource)),a(!1)}).catch(x=>{g(x),a(!1)})},[o,e,r]),m)return s.jsx(Me,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(v)return s.jsxs(Me,{children:[s.jsx(ve,{children:l==null?void 0:l.title}),s.jsx("p",{children:"Your response has been recorded."}),s.jsxs("ul",{children:[v.length===1&&s.jsx("li",{children:s.jsx(We,{to:v[0],children:"Review your answers"})}),v.length>1&&s.jsxs("li",{children:["Review your answers:",s.jsx("ul",{children:v.map(y=>s.jsx("li",{children:s.jsx(We,{to:y,children:rt(y)})},y.id))})]}),f&&s.jsx("li",{children:s.jsxs(We,{to:f,children:["Back to ",qo(f)]})}),s.jsx("li",{children:s.jsx(We,{to:"/",children:"Go back home"})})]})]});if(i||!l)return s.jsx(Yr,{});const b=f&&N0(f);return s.jsxs(s.Fragment,{children:[s.jsxs(Xn,{shadow:"xs",radius:0,children:[b&&s.jsx(A2,{patient:b}),f&&f.resourceType!=="Patient"&&s.jsx(N2,{resource:f}),s.jsx(q,{px:"xl",py:"md",children:s.jsxs(me,{children:[qo(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),s.jsx(Me,{children:s.jsx(KR,{questionnaire:l,subject:f&&Tt(f),onSubmit:w})})]});async function w(y){const x=[];if(!u||u.length===0)x.push(await o.createResource(y));else for(const C of u)x.push(await o.createResource({...y,subject:{reference:C}}));S(x)}}const wK="_paper_unw9o_1",SK={paper:wK},jK={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function M2(e,t){const n=e.resourceType||CK(t),r=e.fields??EK(n),o=e.filters??(e.resourceType?void 0:TK(n)),i=e.sortRules??PK(n),a=e.offset??0,l=e.count??zh;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:a,count:l}}function CK(e){var t,n;return localStorage.getItem("defaultResourceType")??((n=(t=e==null?void 0:e.option)==null?void 0:t.find(r=>r.id==="defaultResourceType"))==null?void 0:n.valueString)??"Patient"}function EK(e){const t=M0(e);if(t!=null&&t.fields)return t.fields;const n=["id","_lastUpdated"];switch(e){case"Patient":n.push("name","birthDate","gender");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 TK(e){var t;return(t=M0(e))==null?void 0:t.filters}function PK(e){const t=M0(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function M0(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function kK(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function RK(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=M2(n,t.getUserConfiguration()),o=await t.search(r.resourceType,Ia({...r,total:"accurate",fields:void 0}));return Ek(o)}function _S(){const e=le(),t=Gt(),n=ii(),[r,o]=p.useState();return p.useEffect(()=>{const i=bk(n.pathname+n.search),a=M2(i,e.getUserConfiguration());n.pathname===`/${a.resourceType}`&&n.search===Ia(a)?(kK(a),o(a)):t(`/${a.resourceType}${Ia(a)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(Yr,{}):s.jsx(Xn,{shadow:"xs",m:"md",p:"xs",className:SK.paper,children:s.jsx(ju,{checkboxesEnabled:!0,search:r,onClick:i=>t(`/${i.resource.resourceType}/${i.resource.id}`),onAuxClick:i=>window.open(`/${i.resource.resourceType}/${i.resource.id}`,"_blank"),onChange:i=>{t(`/${r.resourceType}${Ia(i.definition)}`)},onNew:()=>{t(jK[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+Ia(r);e.download(i).then(a=>{window.open(window.URL.createObjectURL(a),"_blank")}).catch(a=>ge({color:"red",message:Ae(a),autoClose:!1}))},onExportTransactionBundle:async()=>{RK(r,e).then(i=>xK(JSON.stringify(i,void 0,2))).catch(i=>ge({color:"red",message:Ae(i),autoClose:!1}))},onDelete:i=>{window.confirm("Are you sure you want to delete these resources?")&&(e.invalidateSearches(r.resourceType),e.executeBatch({resourceType:"Bundle",type:"batch",entry:i.map(a=>({request:{method:"DELETE",url:`${r.resourceType}/${a}`}}))}).then(()=>o({...r})).catch(a=>ge({color:"red",message:Ae(a),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function _K(){const e=le(),[t,n]=p.useState(),[r,o]=p.useState(void 0);p.useEffect(()=>{e.get("auth/mfa/status").then(l=>{n(l.enrollQrCode),o(l.enrolled)}).catch(l=>ge({color:"red",message:Ae(l),autoClose:!1}))},[e]);const i=p.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),ge({color:"green",message:"Success"})}).catch(c=>ge({color:"red",message:Ae(c),autoClose:!1}))},[e]),a=p.useCallback(()=>{e.post("auth/mfa/disable",{}).catch(console.log)},[e]);return r===void 0?null:r?s.jsx(Me,{children:s.jsxs(te,{children:[s.jsx(ve,{children:"MFA is enabled"}),s.jsx(ae,{onClick:a,children:"Disable MFA"})]})}):s.jsx(Me,{width:400,children:s.jsxs(qe,{onSubmit:i,children:[s.jsx(ve,{children:"Multi Factor Auth Setup"}),s.jsx(vn,{children:s.jsx("img",{src:t})}),s.jsx(ye,{name:"token",label:"Code"}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ae,{type:"submit",children:"Enroll"})})]})})}const dm={BASE_URL:"/",DEV:!1,GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.2.16-a2ededb30",MODE:"production",PROD:!0,RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",SSR:!1},Kg={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__",awsTextractEnabled:dm==null?void 0:dm.MEDPLUM_AWS_TEXTRACT_ENABLED};function Pu(){return Kg}function O2(){return L2("registerEnabled")}function DK(){return L2("awsTextractEnabled")}function L2(e){try{return Kg[e]!==!1&&Kg[e]!=="false"}catch{return!0}}function IK(){const e=Gt(),[t]=_0(),n=t.get("client_id");if(!n)return null;const r=t.get("scope")||"openid";function o(i){const a=new URL(t.get("redirect_uri"));for(const l of["scope","state","nonce"])t.has(l)&&a.searchParams.set(l,t.get(l));a.searchParams.set("code",i),window.location.assign(a.toString())}return s.jsxs(o2,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:Pu().googleClientId,clientId:n||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",children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Sign in to Medplum"})]})}function AK(){const e=le(),t=Gt(),n=Pu();return p.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),O2()?s.jsxs(kq,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Create a new account"})]}):s.jsx(Me,{width:450,children:s.jsx(Yi,{icon:s.jsx(El,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function NK(){const e=Gt(),t=le(),[n,r]=p.useState(),[o,i]=p.useState(!1),a=Pu().recaptchaSiteKey;return p.useEffect(()=>{a&&n2(a)},[a]),s.jsx(Me,{width:450,children:s.jsxs(qe,{onSubmit:async l=>{let c="";a&&(c=await r2(a)),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(ft(u)))},children:[s.jsxs($e,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Medplum Password Reset"})]}),s.jsxs($e,{gap:"xl",children:[s.jsx(Ar,{issues:xu(n,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(ye,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Qe(n,"email")}),s.jsxs(te,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Ke,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),s.jsx(ae,{type:"submit",children:"Reset password"})]})]}),o&&s.jsx("div",{children:"If the account exists on our system, a password reset email will be sent."})]})]})})}function MK(){var i;const e=Gt(),t=le(),[n,r]=p.useState();p.useEffect(()=>{t.get("auth/me",{cache:"no-cache"}).then(r).catch(a=>ge({color:"red",message:Ae(a),autoClose:!1}))},[t]);function o(a){t.post("auth/revoke",{loginId:a}).then(()=>t.get("auth/me",{cache:"no-cache"})).then(r).then(()=>ge({color:"green",message:"Login revoked"})).catch(l=>ge({color:"red",message:Ae(l),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(Me,{children:[s.jsx(ve,{children:"Security"}),s.jsxs(i0,{children:[s.jsx(Oo,{term:"ID",children:s.jsx(Ke,{href:`/${rt(n.profile)}`,children:n.profile.id})}),s.jsx(Oo,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(Oo,{term:"Name",children:pu((i=n.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(Me,{children:[s.jsx(ve,{children:"Sessions"}),s.jsxs(pe,{children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"OS"}),s.jsx("th",{children:"Browser"}),s.jsx("th",{children:"IP Address"}),s.jsx("th",{children:"Auth Method"}),s.jsx("th",{children:"Last Updated"}),s.jsx("th",{})]})}),s.jsx("tbody",{children:n.security.sessions.map(a=>s.jsxs("tr",{children:[s.jsx("td",{children:a.os}),s.jsx("td",{children:a.browser}),s.jsx("td",{children:a.remoteAddress}),s.jsx("td",{children:a.authMethod}),s.jsx("td",{children:zn(a.lastUpdated)}),s.jsx("td",{children:s.jsx(Ke,{href:"#",onClick:()=>o(a.id),children:"Revoke"})})]},a.id))})]})]}),s.jsxs(Me,{children:[s.jsx(ve,{children:"Password"}),s.jsx(ae,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(Me,{children:[s.jsx(ve,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(ae,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function OK(){const{id:e,secret:t}=st(),n=le(),[r,o]=p.useState(),[i,a]=p.useState(!1),l=xu(r,void 0);return s.jsxs(Me,{width:450,children:[s.jsx(Ar,{issues:l}),s.jsxs(qe,{onSubmit:c=>{if(c.password!==c.confirmPassword){o(Oi("Passwords do not match","confirmPassword"));return}o(void 0);const u={id:e,secret:t,password:c.password};n.post("auth/setpassword",u).then(()=>a(!0)).catch(d=>o(ft(d)))},children:[s.jsxs(vn,{style:{flexDirection:"column"},children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Set password"})]}),!i&&s.jsxs($e,{children:[s.jsx(Hr,{name:"password",label:"New password",required:!0,error:Qe(r,"password")}),s.jsx(Hr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Qe(r,"confirmPassword")}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ae,{type:"submit",children:"Set password"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:["Password set. You can now ",s.jsx(We,{to:"/signin",children:"sign in"}),"."]})]})]})}function LK(){const e=Hh(),t=Gt(),[n]=_0(),r=Pu(),o=p.useCallback(()=>{const i=n.get("next");t(i!=null&&i.startsWith("/")?i:"/")},[n,t]);return p.useEffect(()=>{e&&n.has("next")&&o()},[e,n,o]),s.jsxs(o2,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:O2()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(to,{size:32}),s.jsx(ve,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function $K(){const e=Gt(),t=ii(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState();return p.useEffect(()=>{const c=Object.fromEntries(new URLSearchParams(t.search).entries());r(c.resourceType),i(c.query),l(JSON.parse(c.fields))},[t]),!n||!o||!a?null:s.jsx(IW,{resourceType:n,checkboxesEnabled:!0,query:o,fields:a,onClick:c=>e(`/${n}/${c.resource.id}`),onAuxClick:c=>window.open(`/${n}/${c.resource.id}`,"_blank"),onBulk:c=>{e(`/bulk/${n}?ids=${c.join(",")}`)}})}function rp(e){const t=le(),n=ts(t),r=Gt(),[o,i]=p.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:re.EQUALS,value:"Project/"+n},{code:"profile-type",operator:re.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(ju,{search:o,onClick:a=>r(`/admin/members/${a.resource.id}`),onChange:a=>i(a.definition),hideFilters:!0,hideToolbar:!0})}function FK(){return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Bots"}),s.jsx(rp,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(We,{to:"/admin/bots/new",children:"Create new bot"})})]})}function zK(){return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Clients"}),s.jsx(rp,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(We,{to:"/admin/clients/new",children:"Create new client"})})]})}function op(e){return s.jsx(Zs,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{ri(t)?e.onChange(Tt(t)):e.onChange(void 0)}})}function BK(){const e=le(),t=ts(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[a,l]=p.useState(),[c,u]=p.useState(),[d,f]=p.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Create new Bot"}),s.jsxs(qe,{onSubmit:()=>{const h={name:n,description:o,accessPolicy:a};e.post("admin/projects/"+t+"/bot",h).then(m=>{e.invalidateSearches("Bot"),e.invalidateSearches("ProjectMembership"),f(m),ge({color:"green",message:"Bot created"})}).catch(m=>{ge({color:"red",message:Ae(m),autoClose:!1}),u(ft(m))})},children:[!d&&s.jsxs($e,{children:[s.jsx(yt,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(ye,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Qe(c,"name")})}),s.jsx(yt,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(ye,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Qe(c,"description")})}),s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(op,{name:"accessPolicy",onChange:l})}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(me,{children:"Bot created"}),s.jsxs($n,{children:[s.jsx($n.Item,{children:s.jsx(We,{to:d,children:"Go to new bot"})}),s.jsx($n.Item,{children:s.jsx(We,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function UK(){const e=le(),t=ts(e),[n,r]=p.useState(""),[o,i]=p.useState(""),[a,l]=p.useState(""),[c,u]=p.useState(),[d,f]=p.useState(),[h,m]=p.useState(void 0);return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Create new Client"}),s.jsxs(qe,{onSubmit:()=>{const g={name:n,description:o,redirectUri:a,accessPolicy:c};e.post("admin/projects/"+t+"/client",g).then(v=>{e.invalidateSearches("ClientApplication"),e.invalidateSearches("ProjectMembership"),m(v),ge({color:"green",message:"Client created"})}).catch(v=>{ge({color:"red",message:Ae(v),autoClose:!1}),f(ft(v))})},children:[!h&&s.jsxs($e,{children:[s.jsx(yt,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(ye,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Qe(d,"name")})}),s.jsx(yt,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(ye,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Qe(d,"description")})}),s.jsx(yt,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(ye,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Qe(d,"redirectUri")})}),s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(op,{name:"accessPolicy",onChange:u})}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(me,{children:"Client created"}),s.jsxs($n,{children:[s.jsx($n.Item,{children:s.jsx(We,{to:h,children:"Go to new client"})}),s.jsx($n.Item,{children:s.jsx(We,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function VK(e){return s.jsx(Zs,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{ri(t)?e.onChange(Tt(t)):e.onChange(void 0)}})}function WK(){const{membershipId:e}=st(),t=le(),n=ts(t),r=Gt(),o=t.get(`admin/projects/${n}/members/${e}`).read(),[i,a]=p.useState(o.accessPolicy),[l,c]=p.useState(o.userConfiguration),[u,d]=p.useState(o.admin),[f,h]=p.useState(),[m,g]=p.useState(!1);function v(){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(S=>h(ft(S)))}return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(Ha,{value:o.profile,link:!0})}),s.jsxs(qe,{onSubmit:()=>{const S={...o,accessPolicy:i,userConfiguration:l,admin:u};t.post(`admin/projects/${n}/members/${e}`,S).then(()=>g(!0)).catch(b=>h(ft(b)))},children:[!m&&s.jsxs($e,{children:[s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(op,{name:"accessPolicy",defaultValue:i,onChange:a})}),s.jsx(yt,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:s.jsx(VK,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(yt,{title:"Admin",htmlFor:"admin",outcome:f,children:s.jsx(Dn,{id:"admin",name:"admin",defaultChecked:u,onChange:S=>d(S.currentTarget.checked)})}),s.jsxs(te,{justify:"flex-end",mt:"xl",children:[s.jsx(ae,{type:"submit",children:"Save"}),s.jsx(ae,{type:"button",color:"red",variant:"outline",onClick:v,children:"Remove user"})]})]}),m&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User updated"}),s.jsx("pre",{children:JSON.stringify(f,void 0,2)}),s.jsxs("p",{children:["Click ",s.jsx(We,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]})]})]})}function HK(){const e=le(),[t,n]=p.useState(e.getProject()),[r,o]=p.useState(),[i,a]=p.useState(),[l,c]=p.useState(!1),[u,d]=p.useState(void 0),f=p.useCallback(h=>{const m={resourceType:h.resourceType,firstName:h.firstName,lastName:h.lastName,email:h.email,sendEmail:h.sendEmail==="on",accessPolicy:r,admin:h.isAdmin==="on"};e.invite(t==null?void 0:t.id,m).then(g=>{e.invalidateSearches("Patient"),e.invalidateSearches("Practitioner"),e.invalidateSearches("ProjectMembership"),Lh(g)?a(g):d(g),c(m.sendEmail??!1),ge({color:"green",message:"Invite success"})}).catch(g=>{ge({color:"red",message:Ae(g),autoClose:!1}),a(ft(g))})},[e,t,r]);return s.jsxs(qe,{onSubmit:f,children:[!u&&!i&&s.jsxs($e,{children:[s.jsx(ve,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(yt,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(Zs,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(It,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Qe(i,"resourceType")}),s.jsx(ye,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Qe(i,"firstName")}),s.jsx(ye,{name:"lastName",label:"Last Name",required:!0,error:Qe(i,"lastName")}),s.jsx(ye,{name:"email",type:"email",label:"Email",required:!0,error:Qe(i,"email")}),s.jsx(yt,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(op,{name:"accessPolicy",onChange:o})}),s.jsx(Dn,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Dn,{name:"isAdmin",label:"Admin"}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{type:"submit",children:"Invite"})})]}),i&&s.jsxs("div",{"data-testid":"success",children:[s.jsx("p",{children:"User created, email couldn't be sent"}),s.jsx("p",{children:"Could not send email. Make sure you have AWS SES set up."}),s.jsxs("p",{children:["Click ",s.jsx(We,{to:"/admin/project",children:"here"})," to return to the project admin page."]})]}),u&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(me,{children:"User created"}),l&&s.jsx(me,{children:"Email sent"}),s.jsxs($n,{children:[s.jsx($n.Item,{children:s.jsx(We,{to:u,children:"Go to new membership"})}),s.jsx($n.Item,{children:s.jsx(We,{to:u.profile,children:"Go to new profile"})}),s.jsx($n.Item,{children:s.jsx(We,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function qK(){return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Patients"}),s.jsx(rp,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(We,{to:"/admin/invite",children:"Invite new patient"})})]})}function GK(){const e=le();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(Ar,{outcome:GP});function t(n){e.post("admin/projects/setpassword",n).then(()=>ge({color:"green",message:"Done"})).catch(r=>ge({color:"red",message:Ae(r),autoClose:!1}))}return s.jsxs(Me,{width:600,children:[s.jsx(ve,{order:1,children:"Project Admin"}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Force Set Password"}),s.jsx(me,{children:"Sets the password for the specified user in this project."}),s.jsx(me,{children:"This action can only be performed by project administrators. Passwords can only be set for users scoped in this project."}),s.jsx(qe,{onSubmit:t,children:s.jsxs($e,{children:[s.jsx(ye,{name:"email",label:"Email",required:!0}),s.jsx(Hr,{name:"password",label:"Password",required:!0}),s.jsx(ae,{type:"submit",children:"Force Set Password"})]})})]})}function DS(){const e=le(),t=ts(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Details"}),s.jsxs(i0,{children:[s.jsx(Oo,{term:"ID",children:n.project.id}),s.jsx(Oo,{term:"Name",children:n.project.name})]})]})}const IS=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function QK(){const e=Gt(),n=ii().pathname.replace("/admin/","")||IS[0],r=le(),o=ts(r),i=p.useMemo(()=>r.get("admin/projects/"+o).read(),[r,o]);function a(l){e(`/admin/${l}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Xn,{children:[s.jsx(ze,{children:s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Project"}),s.jsx(ze.Value,{children:i.project.name})]})}),s.jsx(_r,{children:s.jsx(Je,{value:n.toLowerCase(),onChange:a,children:s.jsx(Je.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:IS.map(l=>s.jsx(Je.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(Me,{children:s.jsx(R0,{})})]})}function KK(){const e=le(),t=ts(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,a]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&a(Kr(n.project.secret||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/secrets`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>ge({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(ve,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(Tl,{property:Ys("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(ae,{type:"submit",children:"Save"})]})}function YK(){const e=le(),t=ts(e),n=e.get(`admin/projects/${t}`).read(),[r,o]=p.useState(!1),[i,a]=p.useState();return p.useEffect(()=>{e.requestSchema("Project").then(()=>o(!0)).catch(console.log)},[e]),p.useEffect(()=>{n&&a(Kr(n.project.site||[]))},[e,n]),!r||!i?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:l=>{l.preventDefault(),e.post(`admin/projects/${t}/sites`,i).then(()=>e.get(`admin/projects/${t}`,{cache:"reload"})).then(()=>ge({color:"green",message:"Saved"})).catch(c=>{var d,f,h,m;const u=ft(c);ge({color:"red",message:`Error ${(f=(d=u.issue)==null?void 0:d[0].details)==null?void 0:f.text} ${(m=(h=u.issue)==null?void 0:h[0].expression)==null?void 0:m[0]}`,autoClose:!1})})},children:[s.jsx(ve,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(Tl,{property:Ys("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(ae,{type:"submit",children:"Save"})]})}function XK(){const e=le(),[t,{open:n,close:r}]=av(!1),[o,i]=p.useState(""),[a,l]=p.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(Ar,{outcome:GP});function c(){vd(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function u(){vd(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function d(){vd(e,"Rebuilding Value Sets","admin/super/valuesets")}function f(S){vd(e,"Reindexing Resources","admin/super/reindex",S)}function h(S){e.post("admin/super/removebotidjobsfromqueue",S).then(()=>ge({color:"green",message:"Done"})).catch(b=>ge({color:"red",message:Ae(b),autoClose:!1}))}function m(S){e.post("admin/super/purge",{...S,before:sR(S.before)}).then(()=>ge({color:"green",message:"Done"})).catch(b=>ge({color:"red",message:Ae(b),autoClose:!1}))}function g(S){e.post("admin/super/setpassword",S).then(()=>ge({color:"green",message:"Done"})).catch(b=>ge({color:"red",message:Ae(b),autoClose:!1}))}function v(){e.post("fhir/R4/$db-stats",{}).then(S=>{var b,w;i("Database Stats"),l(s.jsx("pre",{children:(w=(b=S.parameter)==null?void 0:b.find(y=>y.name==="tableString"))==null?void 0:w.valueString})),n()}).catch(S=>ge({color:"red",message:Ae(S),autoClose:!1}))}return s.jsxs(Me,{width:600,children:[s.jsx(ve,{order:1,children:"Super Admin"}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Structure Definitions"}),s.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."}),s.jsx(qe,{children:s.jsx(ae,{onClick:c,children:"Rebuild StructureDefinitions"})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Search Parameters"}),s.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."}),s.jsx(qe,{children:s.jsx(ae,{onClick:u,children:"Rebuild SearchParameters"})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Value Sets"}),s.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."}),s.jsx(qe,{children:s.jsx(ae,{onClick:d,children:"Rebuild ValueSets"})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Reindex Resources"}),s.jsx("p",{children:"When Medplum changes how resources are indexed, the system may require a reindex for old resources to be indexed properly."}),s.jsx(qe,{onSubmit:f,children:s.jsxs($e,{children:[s.jsx(yt,{title:"Resource Type",htmlFor:"resourceType",children:s.jsx(ye,{id:"resourceType",name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(yt,{title:"Search Filter",htmlFor:"filter",children:s.jsx(ye,{id:"filter",name:"filter",placeholder:"e.g. name=Sam&birthdate=lt2000-01-01"})}),s.jsx(ae,{type:"submit",children:"Reindex"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Purge Resources"}),s.jsx("p",{children:"As system generated resources accumulate, the system may require a purge to remove old resources."}),s.jsx(qe,{onSubmit:m,children:s.jsxs($e,{children:[s.jsx(yt,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(It,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(yt,{title:"Purge Before",htmlFor:"before",children:s.jsx(As,{name:"before",placeholder:"Before Date"})}),s.jsx(ae,{type:"submit",children:"Purge"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Remove Bot ID Jobs from Queue"}),s.jsx("p",{children:"Remove all queued jobs for a Bot ID"}),s.jsx(qe,{onSubmit:h,children:s.jsxs($e,{children:[s.jsx(yt,{title:"Bot ID",children:s.jsx(ye,{name:"botId",placeholder:"Bot Id"})}),s.jsx(ae,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Force Set Password"}),s.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.'}),s.jsx(qe,{onSubmit:g,children:s.jsxs($e,{children:[s.jsx(ye,{name:"email",label:"Email",required:!0}),s.jsx(Hr,{name:"password",label:"Password",required:!0}),s.jsx(ye,{name:"projectId",label:"Project ID"}),s.jsx(ae,{type:"submit",children:"Force Set Password"})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(qe,{onSubmit:v,children:s.jsx(ae,{type:"submit",children:"Get Database Stats"})}),s.jsx(jn,{opened:t,onClose:r,title:o,centered:!0,children:a})]})}function vd(e,t,n,r){po.show({id:n,loading:!0,title:t,message:"Running...",autoClose:!1,withCloseButton:!1});const o={method:"POST",pollStatusOnAccepted:!0};r&&(o.body=JSON.stringify(r)),e.startAsyncRequest(n,o).then(()=>{po.update({id:n,color:"green",title:t,message:"Done",icon:s.jsx(Js,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{po.update({id:n,color:"red",title:t,message:Ae(i),icon:s.jsx(Ef,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function JK(){return s.jsxs(s.Fragment,{children:[s.jsx(ve,{children:"Users"}),s.jsx(rp,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(te,{justify:"flex-end",children:s.jsx(We,{to:"/admin/invite",children:"Invite new user"})})]})}function ZK(){const[e]=al("ObservationDefinition","_count=100");return e?s.jsxs(pe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Code"}),s.jsx("th",{children:"Method"}),s.jsx("th",{children:"Unit"}),s.jsx("th",{children:"Precision"}),s.jsx("th",{children:"Ranges"})]})}),s.jsx("tbody",{children:e.map(t=>{var n,r,o,i;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(mo,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(mo,{value:t.code})}),s.jsx("td",{children:s.jsx(mo,{value:t.method})}),s.jsx("td",{children:(o=(r=t.quantitativeDetails)==null?void 0:r.unit)==null?void 0:o.text}),s.jsx("td",{children:(i=t.quantitativeDetails)==null?void 0:i.decimalPrecision}),s.jsx("td",{children:s.jsx(Yg,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(Yr,{})}function Yg(e){const{ranges:t}=e;if(!t)return null;const n=AS(t.map(o=>o.gender));if(n.length>1)return Oc(n),s.jsx(s.Fragment,{children:n.map(o=>{var i;return s.jsxs(p.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:tn(o)})}),s.jsx(Yg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>a.gender===o)})]},o)})});const r=AS(t.map(o=>o.age&&Lc(o.age)));return r.length>1?(Oc(r),s.jsx(s.Fragment,{children:r.map(o=>{var i;return s.jsxs(p.Fragment,{children:[s.jsx("div",{children:s.jsx("strong",{children:tn(o)})}),s.jsx(Yg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>Lc(a.age)===o)})]},o)})})):s.jsx(s.Fragment,{children:t.map(o=>s.jsx("table",{children:s.jsx("tbody",{children:s.jsxs("tr",{children:[s.jsx("td",{children:o.condition}),s.jsx("td",{children:s.jsx(a0,{value:o.range})})]})})},`range-${o.condition}`))})}function AS(e){return[...new Set(e.filter(t=>!!t))]}function eY(){const[e]=al("ActivityDefinition","_count=100"),[t]=al("ObservationDefinition","_count=100");return!e||!t?s.jsx(Yr,{}):s.jsxs(pe,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx("thead",{children:s.jsxs("tr",{children:[s.jsx("th",{children:"Category"}),s.jsx("th",{children:"Assay"}),e.map(n=>s.jsx("th",{children:n.name},n.id))]})}),s.jsx("tbody",{children:t.map(n=>{var r;return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(mo,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(mo,{value:n.code})}),e.map(o=>{var i;return s.jsx("td",{children:(i=o.observationResultRequirement)!=null&&i.find(a=>{var l;return(l=a.reference)==null?void 0:l.includes(n.id)})?"✅":""},o.id)})]},n.id)})})]})}function tY(e){var a;const t=le(),[n,r]=p.useState(),[o,i]=p.useState();return o?s.jsxs(s.Fragment,{children:[s.jsx("p",{children:"Request group created successfully."}),s.jsxs("ul",{children:[s.jsxs("li",{children:["Go to the"," ",s.jsx(We,{to:o,suffix:"checklist",children:"Request Group"})]}),s.jsxs("li",{children:["Back to the ",s.jsx(We,{to:e.planDefinition,children:"Plan Definition"})]})]})]}):s.jsx(qe,{onSubmit:()=>{t.post(t.fhirUrl("PlanDefinition",e.planDefinition.id,"$apply"),{resourceType:"Parameters",parameter:[{name:"subject",valueString:n==null?void 0:n.reference}]}).then(i).catch(console.log)},children:s.jsxs($e,{children:[s.jsxs(ve,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(me,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(me,{children:"The following tasks will be created:"}),s.jsx("ul",{children:(a=e.planDefinition.action)==null?void 0:a.map((l,c)=>{var u;return s.jsxs("li",{children:[((u=l.definitionCanonical)==null?void 0:u.startsWith("Questionnaire/"))&&"Questionnaire request: ",l.title&&s.jsx(s.Fragment,{children:l.title}),l.code&&s.jsx(mo,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(yt,{title:"Subject",children:s.jsx(Gh,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ae,{type:"submit",children:"Go"})})]})})}function nY(){const{resourceType:e,id:t}=st(),n=St({reference:e+"/"+t});return n?s.jsx(Me,{children:s.jsx(tY,{planDefinition:n})}):null}function rY(){const{resourceType:e,id:t}=st(),n=St({reference:e+"/"+t}),[r,o]=al("Questionnaire","subject-type="+e),[i,a]=al("ClientApplication",{_count:1e3});if(!n||o||a)return s.jsx(Yr,{});const l=i==null?void 0:i.filter(d=>oY(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return s.jsxs(Me,{children:[s.jsx(ve,{children:"Apps"}),s.jsxs("p",{children:["No apps found. Contact your administrator or ",s.jsx("a",{href:"mailto:support@medplum.com",children:"Medplum Support"})," to add automation here."]})]});let c,u;return n.resourceType==="Patient"?c=Tt(n):n.resourceType==="Encounter"&&(c=n.subject,u=Tt(n)),s.jsxs(Me,{children:[r==null?void 0:r.map(d=>s.jsxs("div",{children:[s.jsx(ve,{order:3,children:s.jsx(We,{to:`/forms/${d.id}?subject=${rt(n)}`,children:d.title||d.name})}),s.jsx(me,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>s.jsxs("div",{children:[s.jsx(ve,{order:3,children:s.jsx(Tq,{client:d,patient:c,encounter:u,children:d.name})}),s.jsx(me,{children:d.description})]},d.id))]})}function oY(e){return e==="Patient"||e==="Encounter"}function iY(){const{resourceType:e,id:t}=st(),n=Gt(),[r,o]=p.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:re.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(Me,{children:s.jsx(ju,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function sY(){const e=le(),{resourceType:t,id:n}=st(),r=e.readHistory(t,n).read();return s.jsx(Me,{children:s.jsx(mq,{history:r})})}const aY="_hl7Input_k5xm3_1",lY={hl7Input:aY};function cY(e){return s.jsx("iframe",{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 uY(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),s.jsx("iframe",{frameBorder:"0",src:n.toString(),style:{width:"100%",height:"100%",minHeight:e.minHeight},ref:e.iframeRef,"data-testid":e.testId,onLoad:r=>{Ld(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const dY=`{
|
|
573
|
-
"resourceType": "Patient",
|
|
574
|
-
"name": [
|
|
575
|
-
{
|
|
576
|
-
"given": [
|
|
577
|
-
"Alice"
|
|
578
|
-
],
|
|
579
|
-
"family": "Smith"
|
|
580
|
-
}
|
|
581
|
-
]
|
|
582
|
-
}`,fY="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 hY(){const e=le(),{id:t}=st(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState(dY),[c,u]=p.useState(fY),[d,f]=p.useState(rn.FHIR_JSON),h=p.useRef(null),m=p.useRef(null),[g,v]=p.useState(!1);p.useEffect(()=>{e.readResource("Bot",t).then(async E=>{r(E),i(await pY(e,E))}).catch(E=>ge({color:"red",message:Ae(E),autoClose:!1}))},[e,t]);const S=p.useCallback(()=>Ld(h.current,{command:"getValue"}),[]),b=p.useCallback(()=>Ld(h.current,{command:"getOutput"}),[]),w=p.useCallback(async()=>d===rn.FHIR_JSON?JSON.parse(a):c,[d,a,c]),y=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const T=await S(),j=await e.createAttachment(T,"index.ts","text/typescript"),R=[];n!=null&&n.sourceCode?R.push({op:"replace",path:"/sourceCode",value:j}):R.push({op:"add",path:"/sourceCode",value:j}),await e.patchResource("Bot",t,R),ge({color:"green",message:"Saved"})}catch(T){ge({color:"red",message:Ae(T),autoClose:!1})}finally{v(!1)}},[e,t,n,S]),x=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const T=await b();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:T}),ge({color:"green",message:"Deployed"})}catch(T){ge({color:"red",message:Ae(T),autoClose:!1})}finally{v(!1)}},[e,t,b]),C=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const T=await w(),j=await e.post(e.fhirUrl("Bot",t,"$execute"),T,d);await Ld(m.current,{command:"setValue",value:j}),ge({color:"green",message:"Success"})}catch(T){ge({color:"red",message:Ae(T),autoClose:!1})}finally{v(!1)}},[e,t,w,d]);return!n||o===void 0?null:s.jsxs(cr,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(cr.Col,{span:8,children:s.jsxs(Xn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(uY,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(te,{justify:"flex-end",gap:"xs",children:[s.jsx(ae,{type:"button",onClick:y,loading:g,leftSection:s.jsx(yz,{size:"1rem"}),children:"Save"}),s.jsx(ae,{type:"button",onClick:x,loading:g,leftSection:s.jsx(Xx,{size:"1rem"}),children:"Deploy"}),s.jsx(ae,{type:"button",onClick:C,loading:g,leftSection:s.jsx(Iz,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(cr.Col,{span:4,children:[s.jsxs(Xn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(It,{data:[{label:"FHIR",value:rn.FHIR_JSON},{label:"HL7",value:rn.HL7_V2}],onChange:E=>f(E.currentTarget.value)}),d===rn.FHIR_JSON?s.jsx(vl,{value:a,onChange:E=>l(E),autosize:!0,minRows:15}):s.jsx("textarea",{className:lY.hl7Input,value:c,onChange:E=>u(E.currentTarget.value),rows:15})]}),s.jsx(Xn,{m:2,p:"xs",shadow:"md",children:s.jsx(cY,{iframeRef:m,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function pY(e,t){var n,r,o;if((n=t.sourceCode)!=null&&n.url){const i=(o=(r=t.sourceCode.url)==null?void 0:r.split("/"))==null?void 0:o.find(lk);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function ea(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function mY(){const e=le(),{resourceType:t,id:n}=st(),r={reference:t+"/"+n},o=p.useCallback(i=>{e.updateResource(ea(i)).then(()=>{ge({color:"green",message:"Success"})}).catch(a=>{ge({color:"red",message:Ae(a),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(Me,{children:s.jsx(WW,{value:r,onSubmit:o})});case"Questionnaire":return s.jsx(Me,{children:s.jsx(PH,{questionnaire:r,onSubmit:o})});default:return null}}function gY(){const{resourceType:e,id:t}=st(),n=St({reference:e+"/"+t}),r=Gt();return n?s.jsx(Me,{children:s.jsx(XH,{value:n,onStart:(o,i)=>r(`/forms/${il(i)}`),onEdit:(o,i,a)=>r(`/${a.reference}}`)})}):null}function vY(){const e=le(),{resourceType:t,id:n}=st(),r=Gt();return s.jsxs(Me,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(ae,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>ge({color:"red",message:Ae(o),autoClose:!1}))},children:"Delete"})]})}const yY="_selectProfileBtn_tbaz6_1",xY="_chevron_tbaz6_13",NS={selectProfileBtn:yY,chevron:xY};function bY(){var c,u;const{resourceType:e,id:t}=st(),n=St({reference:e+"/"+t}),[r,o]=p.useState(),i=ou({onDropdownClose:()=>i.resetSelectedOption()}),a=p.useMemo(()=>{var d;if($t((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[s.jsx(Le.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>s.jsx(Le.Option,{value:f,children:f},f))]},[(c=n==null?void 0:n.meta)==null?void 0:c.profile]);if(p.useEffect(()=>{var d,f;((f=(d=n==null?void 0:n.meta)==null?void 0:d.profile)==null?void 0:f.length)===1&&o(n.meta.profile[0])},[(u=n==null?void 0:n.meta)==null?void 0:u.profile]),!n)return null;let l;return $t(a)&&(l=s.jsx(te,{justify:"flex-end",children:s.jsxs($e,{align:"flex-end",gap:"xs",children:[s.jsxs(Le,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[s.jsx(Le.Target,{children:s.jsx(Sn,{onClick:()=>i.toggleDropdown(),children:s.jsxs(Gy,{fw:"bold",fs:"sm",className:NS.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(Yx,{stroke:1.5,className:NS.chevron})]})})}),s.jsx(Le.Dropdown,{w:"max-content",children:s.jsx(Le.Options,{children:a})})]}),s.jsx(q,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(me,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(me,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(me,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(Me,{children:s.jsxs($e,{gap:"xl",children:[l,s.jsx(x0,{value:n,profileUrl:r})]})})}function wY(){const e=le(),{resourceType:t,id:n}=st(),[r,o]=p.useState(),[i,a]=p.useState(),l=Gt(),[c,u]=p.useState();p.useEffect(()=>{e.readResource(t,n).then(m=>{o(Kr(m)),a(Kr(m))}).catch(m=>{u(ft(m)),ge({color:"red",message:Ae(m),autoClose:!1})})},[e,t,n]);const d=p.useCallback(m=>{u(void 0),e.updateResource(ea(m)).then(()=>{l(`/${t}/${n}/details`),ge({id:"succes",color:"green",message:"Success"})}).catch(g=>{u(ft(g)),ge({color:"red",message:Ae(g),autoClose:!1})})},[e,t,n,l]),f=p.useCallback(m=>{u(void 0);const g=p0.createPatch(r,m);e.patchResource(t,n,g).then(()=>{l(`/${t}/${n}/details`),ge({id:"succes",color:"green",message:"Success"})}).catch(v=>{u(ft(v)),ge({color:"red",message:Ae(v),autoClose:!1})})},[e,t,n,r,l]),h=p.useCallback(()=>l(`/${t}/${n}/delete`),[l,t,n]);return i?s.jsx(Me,{children:s.jsx(Rf,{defaultValue:i,onSubmit:d,onPatch:f,onDelete:h,outcome:c})}):null}function $2({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=le(),[i,a]=p.useState();return p.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{a(l.filter(tU))}).catch(console.error)},[o,n,r]),s.jsx(Je,{value:t==null?void 0:t.url,onChange:l=>{const c=i==null?void 0:i.find(u=>u.url===l);c&&n(c)},children:s.jsx(Je.List,{children:i==null?void 0:i.map(l=>{var d,f;const c=(f=(d=e.meta)==null?void 0:d.profile)==null?void 0:f.includes(l.url),u=c?"This profile is present in this resource's meta.profile property.":"This profile is not included in this resource's meta.profile property.";return s.jsx(Je.Tab,{value:l.url,title:u,rightSection:c&&s.jsx(Rx,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(qz,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function F2(e,t){const n=le(),r=Gt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),n.createResource(a).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(ft(l)),ge({color:"red",message:Ae(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function fm(){const{resourceType:e}=st(),t=ii(),[n,r]=p.useState(),{defaultValue:o,handleSubmit:i}=F2(e,r),[a,l]=p.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=p.useCallback(d=>{const f=ea(d);a&&dk(f,a.url),i(f)},[a,i]);return c?s.jsx(Me,{children:s.jsxs($e,{children:[s.jsx($2,{resource:o,currentProfile:a,onChange:l}),a?s.jsx(Rf,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:a.url},a.url):s.jsx(me,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(Me,{children:s.jsx(Rf,{defaultValue:o,onSubmit:i,outcome:n})})}function SY(){const e=le(),{resourceType:t,id:n}=st(),r=e.readHistory(t,n).read();return s.jsx(Me,{children:s.jsx(Sq,{history:r})})}function jY(){const{resourceType:e}=st(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=F2(e,n),i=p.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(Me,{children:[t&&s.jsx(Ar,{outcome:t}),s.jsxs(qe,{onSubmit:i,children:[s.jsx(vl,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:hr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ae,{type:"submit",children:"OK"})})]})]})}function CY(){const e=le(),{resourceType:t,id:n}=st(),r=St({reference:t+"/"+n}),o=Gt(),[i,a]=p.useState(),l=p.useCallback(c=>{e.updateResource(ea(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${n}/details`),ge({color:"green",message:"Success"})}).catch(u=>{ge({color:"red",message:Ae(u),autoClose:!1})})},[e,t,n,o]);return r?s.jsxs(Me,{children:[i&&s.jsx(Ar,{outcome:i}),s.jsxs(qe,{onSubmit:l,children:[s.jsx(vl,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:hr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(te,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(ae,{type:"submit",children:"OK"})})]})]}):null}function EY(){const{resourceType:e,id:t}=st();return St({reference:e+"/"+t})?s.jsxs(Me,{children:[s.jsxs(Yi,{icon:s.jsx(El,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Ke,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(KR,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function TY(){const e=le(),{resourceType:t,id:n}=st(),[r,o]=p.useState(),[i,a]=p.useState();return p.useEffect(()=>{e.readResource(t,n).then(l=>o(Kr(l))).catch(l=>{ge({color:"red",message:Ae(l)})})},[e,t,n]),r?s.jsxs(Me,{children:[s.jsxs(ve,{order:2,children:["Available ",t," profiles"]}),s.jsx($e,{children:s.jsxs(s.Fragment,{children:[s.jsx($2,{resource:r,currentProfile:i,onChange:a}),i?s.jsx(PY,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):s.jsx(me,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const PY=({profile:e,resource:t,onResourceUpdated:n})=>{const r=le(),[o,i]=p.useState(),[a,l]=p.useState(()=>{var u,d;return(d=(u=t.meta)==null?void 0:u.profile)==null?void 0:d.includes(e.url)}),c=p.useCallback(u=>{i(void 0);const d=ea(u);a?dk(d,e.url):D6(d,e.url),r.updateResource(d).then(f=>{n(f),ge({color:"green",message:"Success"})}).catch(f=>{i(ft(f)),ge({color:"red",message:Ae(f),autoClose:!1})})},[r,e.url,n,a]);return s.jsxs($e,{children:[s.jsx(uu,{size:"md",checked:a,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),a?s.jsx(Rf,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):s.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:s.jsx(te,{justify:"flex-end",mt:"xl",children:s.jsx(ae,{type:"submit",children:"OK"})})})]})};function kY(){const e=le(),{id:t}=st(),[n,r]=p.useState(),[o,i]=p.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>RY(c,t));function l(){n&&e.createResource({resourceType:"Subscription",status:"active",reason:`Connect bot ${n.name} to questionnaire responses`,criteria:"QuestionnaireResponse?questionnaire=Questionnaire/"+t,channel:{type:"rest-hook",endpoint:rt(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),ge({color:"green",message:"Success"})}).catch(c=>ge({color:"red",message:Ae(c),autoClose:!1}))}return s.jsxs(Me,{children:[s.jsx(ve,{children:"Bots"}),a.length===0&&s.jsx("p",{children:"No bots found."}),a.map(c=>{var u;return s.jsxs("div",{children:[s.jsx("h3",{children:s.jsx(Pl,{value:{reference:(u=c.channel)==null?void 0:u.endpoint},link:!0})}),s.jsxs("p",{children:["Criteria: ",c.criteria]})]},c.id)}),s.jsx("hr",{}),s.jsx(ve,{children:"Connect to bot"}),s.jsxs(te,{children:[s.jsx(Zs,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),s.jsx(ae,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function RY(e,t){var o;const n=e.criteria||"",r=((o=e.channel)==null?void 0:o.endpoint)||"";return n.startsWith("QuestionnaireResponse?")&&n.includes(t)&&r.startsWith("Bot/")}function _Y(){const{id:e}=st(),t=Gt(),[n,r]=p.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:re.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(Me,{children:s.jsx(ju,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function DY(){const e=le(),{resourceType:t,id:n}=st(),r=St({reference:t+"/"+n}),o=p.useCallback(i=>{e.updateResource(ea(i)).then(()=>{ge({color:"green",message:"Success"})}).catch(a=>{ge({color:"red",message:Ae(a),autoClose:!1})})},[e]);return r?s.jsx(Me,{children:s.jsx(VH,{onSubmit:o,definition:r})}):null}function IY(){const{resourceType:e,id:t}=st(),n=St({reference:e+"/"+t});return n?s.jsx(Me,{children:e==="MeasureReport"?s.jsx($W,{measureReport:n}):s.jsx(f0,{value:n})}):null}const AY="_container_1ue98_1",NY="_entry_1ue98_14",MY="_active_1ue98_21",hm={container:AY,entry:NY,active:MY};function OY(e){const t=le(),n=St(e.value),[r,o]=p.useState();return p.useEffect(()=>{if(!n)return;const i=N0(n);if(!i)return;const a="reference"in i?i.reference:rt(i);t.search("ServiceRequest","subject="+a).then(l=>{const u=l.entry.map(d=>d.resource);ER(u),u.reverse(),o(u)}).catch(l=>ge({color:"red",message:Ae(l),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:hm.container,children:r.map(i=>{var a,l,c,u,d,f,h;return s.jsxs("div",{className:tt(hm.entry,{[hm.active]:i.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(We,{to:i,children:LY(i)})}),((l=(a=i.category)==null?void 0:a[0])==null?void 0:l.text)&&s.jsx("p",{children:(c=i.category[0])==null?void 0:c.text}),((f=(d=(u=i.code)==null?void 0:u.coding)==null?void 0:d[0])==null?void 0:f.code)&&s.jsx("p",{children:(h=i.code.coding[0])==null?void 0:h.code}),s.jsx("p",{children:$Y(i)})]},i.id)})}):null}function LY(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function $Y(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const FY="_container_1l2dh_1",zY={container:FY};function BY(e){var o,i,a,l;const t=St(e.valueSet);if(!t)return null;const n=[""],r=(l=(a=(i=(o=t.compose)==null?void 0:o.include)==null?void 0:i[0])==null?void 0:a.concept)==null?void 0:l.map(c=>c.code);return r&&n.push(...r),e.defaultValue&&!n.includes(e.defaultValue)&&n.push(e.defaultValue),s.jsx("div",{className:zY.container,children:s.jsx(It,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function UY(e){var n,r;const t=St(e.specimen);return t?s.jsxs(ze,{children:[s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Type"}),s.jsx(ze.Value,{children:"Specimen"})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Collected"}),s.jsx(ze.Value,{children:zn((n=t.collection)==null?void 0:n.collectedDateTime)})]}),s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Specimen Age"}),s.jsx(ze.Value,{children:VY(t)})]}),(r=t.collection)!=null&&r.collectedDateTime&&t.receivedTime?s.jsxs(ze.Entry,{children:[s.jsx(ze.Key,{children:"Specimen Stability"}),s.jsx(ze.Value,{children:WY(t)})]}):s.jsx(s.Fragment,{})]}):null}function VY(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return z2(B2(n,new Date))}function WY(e){var r;if(!((r=e.collection)!=null&&r.collectedDateTime)||!e.receivedTime)return;const t=new Date(e.collection.collectedDateTime),n=new Date(e.receivedTime);return z2(B2(t,n))}function z2(e){return e.toString().padStart(3,"0")+"D"}function B2(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function HY(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"),t}const qY=[];function GY(){var y,x,C,E,T,j,R;const e=le(),{resourceType:t,id:n}=st(),r={reference:t+"/"+n},o=Gt(),[i,a]=p.useState(),l=St(r,a),c=HY(t),[u,d]=p.useState(()=>{const k=window.location.pathname.split("/").pop();return k&&c.map(I=>I.toLowerCase()).includes(k)?k:c[0].toLowerCase()}),f=At();async function h(){var O,F;const I=(F=(O=(await e.readHistory(t,n)).entry)==null?void 0:O.find(L=>!!L.resource))==null?void 0:F.resource;I?m(I):ge({color:"red",message:"No history to restore",autoClose:!1})}function m(k){e.updateResource(ea(k)).then(()=>{a(void 0),ge({color:"green",message:"Success"})}).catch(I=>{ge({color:"red",message:Ae(I),autoClose:!1})})}if(i)return X$(i)?s.jsxs(Me,{children:[s.jsx(ve,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(ae,{color:"red",onClick:h,children:"Restore"})]}):s.jsx(Ar,{outcome:i});function g(k){k||(k=c[0].toLowerCase()),d(k),o(`/${t}/${n}/${k}`)}function v(k){const I=l,O=I.orderDetail||[];O.length===0&&O.push({}),O[0].text!==k&&(O[0].text=k,m({...I,orderDetail:O}))}const S=l&&N0(l),b=l&&yK(l),w=(C=(x=(y=e.getUserConfiguration())==null?void 0:y.option)==null?void 0:x.find(k=>k.id==="statusValueSet"))==null?void 0:C.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&w&&s.jsx(BY,{valueSet:{reference:w},defaultValue:(T=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:T.text,onChange:v},rt(l)+"-"+((R=(j=l.orderDetail)==null?void 0:j[0])==null?void 0:R.text)),l&&s.jsx(OY,{value:l}),l&&s.jsxs(Xn,{children:[S&&s.jsx(A2,{patient:S}),b&&s.jsx(UY,{specimen:b}),t!=="Patient"&&s.jsx(N2,{resource:r}),s.jsx(_r,{children:s.jsx(Je,{value:u.toLowerCase(),onChange:g,children:s.jsx(Je.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(k=>s.jsx(Je.Tab,{value:k.toLowerCase(),children:qY.includes(k)?s.jsxs(te,{gap:"xs",wrap:"nowrap",children:[k,s.jsx(iu,{color:f.primaryColor,size:"sm",children:"Beta"})]}):k},k))})})})]}),s.jsx(R0,{})]})}function MS(){var b,w,y,x;const e=Gt(),{resourceType:t,id:n,versionId:r,tab:o}=st(),i=le(),[a,l]=p.useState(!0),[c,u]=p.useState(),[d,f]=p.useState();if(p.useEffect(()=>{f(void 0),l(!0),i.readHistory(t,n).then(C=>u(C)).then(()=>l(!1)).catch(C=>{f(C),l(!1)})},[i,t,n]),a)return s.jsx(Yr,{});if(!c)return s.jsxs(Me,{children:[s.jsx(ve,{children:"Resource not found"}),s.jsx(We,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(C=>{var E,T;return((T=(E=C.resource)==null?void 0:E.meta)==null?void 0:T.versionId)===r});if(m===-1)return s.jsxs(Me,{children:[s.jsx(ve,{children:"Version not found"}),s.jsx(We,{to:`/${t}/${n}`,children:"Return to resource"})]});const g=h[m].resource,v=m<h.length-1?h[m+1].resource:void 0,S="diff";return s.jsxs(Je,{value:o||S,onChange:C=>e(`/${t}/${n}/_history/${r}/${C||S}`),children:[s.jsxs(Xn,{children:[s.jsx(bu,{fluid:!0,p:"md",children:s.jsx(me,{children:`${t} ${n}`})}),s.jsxs(Je.List,{children:[s.jsx(Je.Tab,{value:"diff",children:"Diff"}),s.jsx(Je.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(Me,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(Je.Panel,{value:"diff",children:v?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(b=g.meta)==null?void 0:b.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(We,{to:`/${t}/${n}/_history/${(w=v.meta)==null?void 0:w.versionId}`,children:(y=v.meta)==null?void 0:y.versionId})]})]}),s.jsx(yq,{original:v,revised:g})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(x=g.meta)==null?void 0:x.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),s.jsx(Je.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})}function QY(){const{resourceType:e,id:t}=st(),n=Gt(),[r,o]=p.useState({resourceType:"Subscription",filters:[{code:"url",operator:re.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(Me,{children:s.jsx(TW,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function KY(e){const t=le(),{resource:n,opened:r,onClose:o}=e,[i,a]=p.useState(!1),[l,c]=p.useState(),[u,d]=p.useState(!1),f=p.useCallback(async()=>{if(n!=null&&n.id)try{await t.post(t.fhirUrl(n.resourceType,n.id,"$resend"),{subscription:i&&l?rt(l):void 0,verbose:u}),ge({color:"green",message:"Done"}),o()}catch(h){ge({color:"red",message:Ae(h),autoClose:!1})}},[t,n,o,i,l,u]);return s.jsx(jn,{opened:r,onClose:o,title:"Resend Subscriptions",children:s.jsx(qe,{onSubmit:f,children:s.jsxs($e,{children:[s.jsx(Dn,{label:"Choose subscription (all subscriptions by default)",onChange:h=>a(h.currentTarget.checked)}),i&&s.jsx(Zs,{name:"subscription",resourceType:"Subscription",placeholder:"Subscription",onChange:c}),s.jsx(Dn,{label:"Verbose mode",onChange:h=>d(h.currentTarget.checked)}),s.jsx(te,{justify:"flex-end",children:s.jsx(ae,{type:"submit",children:"Resend"})})]})})})}function OS(){const e=le(),t=Wh(),{resourceType:n,id:r}=st(),o={reference:n+"/"+r},[i,a]=p.useState(),l=av(!1);function c(w,y){return e.updateResource({...w,priority:y})}function u(w,y){c(w,"stat").then(y).catch(console.error)}function d(w,y){c(w,"routine").then(y).catch(console.error)}function f(w){t(`/${w.resourceType}/${w.id}`)}function h(w){t(`/${w.resourceType}/${w.id}/edit`)}function m(w){t(`/${w.resourceType}/${w.id}/delete`)}function g(w){a(w),l[1].open()}function v(w){var y;t(`/${w.resourceType}/${w.id}/_history/${(y=w.meta)==null?void 0:y.versionId}`)}function S(w,y){e.post(e.fhirUrl(w.resourceType,w.id,"$aws-textract"),{}).then(y).catch(console.error)}function b(w){var D;const{primaryResource:y,currentResource:x,reloadTimeline:C}=w,E=x.resourceType===y.resourceType&&x.id===y.id,T=x.resourceType==="Communication"&&x.priority!=="stat",j=x.resourceType==="Communication"&&x.priority==="stat",R=E,k=!E,I=!E,O=!E,F=(D=e.getProjectMembership())==null?void 0:D.admin,L=F,B=DK()&&(x.resourceType==="DocumentReference"||x.resourceType==="Media");return s.jsxs(Z.Dropdown,{children:[s.jsx(Z.Label,{children:"Resource"}),T&&s.jsx(Z.Item,{leftSection:s.jsx(_z,{size:14}),onClick:()=>u(x,C),"aria-label":`Pin ${rt(x)}`,children:"Pin"}),j&&s.jsx(Z.Item,{leftSection:s.jsx(Dz,{size:14}),onClick:()=>d(x,C),"aria-label":`Unpin ${rt(x)}`,children:"Unpin"}),k&&s.jsx(Z.Item,{leftSection:s.jsx(Iw,{size:14}),onClick:()=>f(x),"aria-label":`Details ${rt(x)}`,children:"Details"}),R&&s.jsx(Z.Item,{leftSection:s.jsx(Iw,{size:14}),onClick:()=>v(x),"aria-label":`Details ${rt(x)}`,children:"Details"}),I&&s.jsx(Z.Item,{leftSection:s.jsx(zk,{size:14}),onClick:()=>h(x),"aria-label":`Edit ${rt(x)}`,children:"Edit"}),F&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Label,{children:"Admin"}),L&&s.jsx(Z.Item,{leftSection:s.jsx(Oz,{size:14}),onClick:()=>g(x),"aria-label":`Resend Subscriptions ${rt(x)}`,children:"Resend Subscriptions"})]}),B&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Label,{children:"AWS AI"}),s.jsx(Z.Item,{leftSection:s.jsx(Wz,{size:14}),onClick:()=>S(x,C),"aria-label":`AWS Textract ${rt(x)}`,children:"AWS Textract"})]}),O&&s.jsxs(s.Fragment,{children:[s.jsx(Z.Divider,{}),s.jsx(Z.Label,{children:"Danger zone"}),s.jsx(Z.Item,{color:"red",leftSection:s.jsx(e0,{size:14}),onClick:()=>m(x),"aria-label":`Delete ${rt(x)}`,children:"Delete"})]})]})}return s.jsxs(s.Fragment,{children:[n==="Encounter"&&s.jsx(MV,{encounter:o,getMenu:b}),n==="Patient"&&s.jsx(FW,{patient:o,getMenu:b}),n==="ServiceRequest"&&s.jsx(Eq,{serviceRequest:o,getMenu:b}),n!=="Encounter"&&n!=="Patient"&&n!=="ServiceRequest"&&s.jsx(NV,{resource:o,getMenu:b}),s.jsx(KY,{resource:i,opened:l[0],onClose:l[1].close},`resend-subscriptions-${i==null?void 0:i.id}`)]})}function YY(){const e=le(),{id:t}=st(),n=p.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=p.useState(!1),[i,a]=p.useState(!1),[l,c]=p.useState(!1),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,S]=p.useState(),[b,w]=p.useState(!1),[y,x]=p.useState(!1);p.useEffect(()=>{if(r||i||l||b){x(!0);return}x(!1)},[r,i,l,b]);const C=p.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(I=>{var O,F,L,B,D,_;d((F=(O=I.parameter)==null?void 0:O.find(P=>P.name==="status"))==null?void 0:F.valueCode),h((B=(L=I.parameter)==null?void 0:L.find(P=>P.name==="version"))==null?void 0:B.valueString),g((_=(D=I.parameter)==null?void 0:D.find(P=>P.name==="lastUpdated"))==null?void 0:_.valueInstant)}).catch(I=>k(Ae(I))).finally(()=>o(!1))},[e,t]),E=p.useCallback(I=>{const O=I.host,F=I.pingCount||1;O&&(w(!0),e.pushToAgent(n,O,`PING ${F}`,rn.PING,!0).then(L=>S(L)).catch(L=>k(Ae(L))).finally(()=>w(!1)))},[e,n]),T=p.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(I=>{R("Agent config reloaded successfully.")}).catch(I=>k(Ae(I))).finally(()=>a(!1))},[e,t]),j=p.useCallback(()=>{c(!0),e.get(e.fhirUrl("Agent",t,"$upgrade"),{cache:"reload"}).then(I=>{R("Agent upgraded successfully.")}).catch(I=>k(Ae(I))).finally(()=>c(!1))},[e,t]);function R(I){ge({color:"green",title:"Success",icon:s.jsx(Js,{size:"1rem"}),message:I})}function k(I){ge({color:"red",title:"Error",message:I,autoClose:!1})}return s.jsxs(Me,{children:[s.jsx(ve,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(Pl,{value:n,link:!0})]}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Agent Status"}),s.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."}),s.jsx(ae,{onClick:C,loading:r,disabled:y&&!r,children:"Get Status"}),!r&&u&&s.jsx(pe,{children:s.jsxs(pe.Tbody,{children:[s.jsxs(pe.Tr,{children:[s.jsx(pe.Td,{children:"Status"}),s.jsx(pe.Td,{children:s.jsx(d0,{status:u})})]}),s.jsxs(pe.Tr,{children:[s.jsx(pe.Td,{children:"Version"}),s.jsx(pe.Td,{children:f})]}),s.jsxs(pe.Tr,{children:[s.jsx(pe.Td,{children:"Last Updated"}),s.jsx(pe.Td,{children:zn(m,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Reload Config"}),s.jsx("p",{children:"Reload the configuration of this agent, syncing it with the current version of the Agent resource on the Medplum server."}),s.jsx(ae,{onClick:T,loading:i,disabled:y&&!i,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Upgrade Agent"}),s.jsx("p",{children:"Upgrade the version of this agent, to either the latest (default) or a specified version."}),s.jsx(ae,{onClick:j,loading:l,disabled:y&&!l,"aria-label":"Upgrade agent",children:"Upgrade"}),s.jsx(dn,{my:"lg"}),s.jsx(ve,{order:2,children:"Ping from Agent"}),s.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."}),s.jsx(qe,{onSubmit:E,children:s.jsxs(te,{children:[s.jsx(ye,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(en,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:b,disabled:y&&!b,children:s.jsx($z,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(dx,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!b&&v&&s.jsxs(s.Fragment,{children:[s.jsx(ve,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:v})]})]})}function XY(){return s.jsx(XG,{children:s.jsxs(Se,{errorElement:s.jsx(fK,{}),children:[s.jsx(Se,{path:"/signin",element:s.jsx(LK,{})}),s.jsx(Se,{path:"/oauth",element:s.jsx(IK,{})}),s.jsx(Se,{path:"/resetpassword",element:s.jsx(NK,{})}),s.jsx(Se,{path:"/setpassword/:id/:secret",element:s.jsx(OK,{})}),s.jsx(Se,{path:"/register",element:s.jsx(AK,{})}),s.jsx(Se,{path:"/changepassword",element:s.jsx(cK,{})}),s.jsx(Se,{path:"/security",element:s.jsx(MK,{})}),s.jsx(Se,{path:"/mfa",element:s.jsx(_K,{})}),s.jsx(Se,{path:"/batch",element:s.jsx(aK,{})}),s.jsx(Se,{path:"/bulk/:resourceType",element:s.jsx(lK,{})}),s.jsx(Se,{path:"/smart",element:s.jsx($K,{})}),s.jsx(Se,{path:"/forms/:id",element:s.jsx(bK,{})}),s.jsx(Se,{path:"/admin/super",element:s.jsx(XK,{})}),s.jsx(Se,{path:"/admin/config",element:s.jsx(GK,{})}),s.jsxs(Se,{path:"/admin",element:s.jsx(QK,{}),children:[s.jsx(Se,{path:"patients",element:s.jsx(qK,{})}),s.jsx(Se,{path:"bots/new",element:s.jsx(BK,{})}),s.jsx(Se,{path:"bots",element:s.jsx(FK,{})}),s.jsx(Se,{path:"clients/new",element:s.jsx(UK,{})}),s.jsx(Se,{path:"clients",element:s.jsx(zK,{})}),s.jsx(Se,{path:"details",element:s.jsx(DS,{})}),s.jsx(Se,{path:"invite",element:s.jsx(HK,{})}),s.jsx(Se,{path:"users",element:s.jsx(JK,{})}),s.jsx(Se,{path:"project",element:s.jsx(DS,{})}),s.jsx(Se,{path:"secrets",element:s.jsx(KK,{})}),s.jsx(Se,{path:"sites",element:s.jsx(YK,{})}),s.jsx(Se,{path:"members/:membershipId",element:s.jsx(WK,{})})]}),s.jsx(Se,{path:"/lab/assays",element:s.jsx(ZK,{})}),s.jsx(Se,{path:"/lab/panels",element:s.jsx(eY,{})}),s.jsx(Se,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(MS,{})}),s.jsx(Se,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(MS,{})}),s.jsxs(Se,{path:"/:resourceType/new",element:s.jsx(dK,{}),children:[s.jsx(Se,{index:!0,element:s.jsx(fm,{})}),s.jsx(Se,{path:"form",element:s.jsx(fm,{})}),s.jsx(Se,{path:"json",element:s.jsx(jY,{})}),s.jsx(Se,{path:"profiles",element:s.jsx(fm,{})})]}),s.jsxs(Se,{path:"/:resourceType/:id",element:s.jsx(GY,{}),children:[s.jsx(Se,{index:!0,element:s.jsx(OS,{})}),s.jsx(Se,{path:"apply",element:s.jsx(nY,{})}),s.jsx(Se,{path:"apps",element:s.jsx(rY,{})}),s.jsx(Se,{path:"event",element:s.jsx(iY,{})}),s.jsx(Se,{path:"blame",element:s.jsx(sY,{})}),s.jsx(Se,{path:"bots",element:s.jsx(kY,{})}),s.jsx(Se,{path:"builder",element:s.jsx(mY,{})}),s.jsx(Se,{path:"checklist",element:s.jsx(gY,{})}),s.jsx(Se,{path:"delete",element:s.jsx(vY,{})}),s.jsx(Se,{path:"details",element:s.jsx(bY,{})}),s.jsx(Se,{path:"edit",element:s.jsx(wY,{})}),s.jsx(Se,{path:"editor",element:s.jsx(hY,{})}),s.jsx(Se,{path:"history",element:s.jsx(SY,{})}),s.jsx(Se,{path:"json",element:s.jsx(CY,{})}),s.jsx(Se,{path:"preview",element:s.jsx(EY,{})}),s.jsx(Se,{path:"responses",element:s.jsx(_Y,{})}),s.jsx(Se,{path:"report",element:s.jsx(IY,{})}),s.jsx(Se,{path:"ranges",element:s.jsx(DY,{})}),s.jsx(Se,{path:"subscriptions",element:s.jsx(QY,{})}),s.jsx(Se,{path:"timeline",element:s.jsx(OS,{})}),s.jsx(Se,{path:"tools",element:s.jsx(YY,{})}),s.jsx(Se,{path:"profiles",element:s.jsx(TY,{})})]}),s.jsx(Se,{path:"/:resourceType",element:s.jsx(_S,{})}),s.jsx(Se,{path:"/",element:s.jsx(_S,{})})]})})}function JY(){const e=le(),t=e.getUserConfiguration(),n=ii(),[r]=_0();return e.isLoading()?s.jsx(Yr,{}):s.jsx($B,{logo:s.jsx(to,{size:24}),pathname:n.pathname,searchParams:r,version:k8,menus:ZY(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(p.Suspense,{fallback:s.jsx(Yr,{}),children:s.jsx(XY,{})})})}function ZY(e){var n;const t=((n=e==null?void 0:e.menu)==null?void 0:n.map(r=>{var o;return{title:r.title,links:((o=r.link)==null?void 0:o.map(i=>({label:i.name,href:i.target,icon:eX(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(Ez,{})}]}),t}const LS={Patient:Bz,Practitioner:jz,Organization:pz,ServiceRequest:Nz,DiagnosticReport:Lz,Questionnaire:Sz,admin:dz,AccessPolicy:Cz,Subscription:Hz,batch:Rz,Observation:kz};function eX(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in LS){const n=LS[t];return s.jsx(n,{})}}catch{}return s.jsx(Oh,{w:30})}"serviceWorker"in navigator&&window.addEventListener("load",()=>{navigator.serviceWorker.getRegistrations().then(e=>Promise.all(e.map(t=>t.unregister()))).catch(e=>console.error("SW registration failed: ",e))});async function tX(){const e=Pu(),t=new _k({baseUrl:e.baseUrl,clientId:e.clientId,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=tQ([{path:"*",element:s.jsx(JY,{})}]),o=a=>r.navigate(a);i2(document.getElementById("root")).render(s.jsx(p.StrictMode,{children:s.jsx(K8,{medplum:t,navigate:o,children:s.jsxs(xj,{theme:n,children:[s.jsx(ni,{position:"bottom-right"}),s.jsx(uQ,{router:r})]})})}))}tX().catch(console.error);
|
|
583
|
-
//# sourceMappingURL=index-DiO5UUQN.js.map
|