@medplum/app 3.1.4 → 3.1.6
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-CCxkjo1T.css +1 -0
- package/dist/assets/index-D9zfKRAQ.js +563 -0
- package/dist/assets/index-D9zfKRAQ.js.map +1 -0
- package/dist/index.html +3 -3
- package/package.json +18 -18
- package/dist/assets/index-CBraEhHZ.js +0 -563
- package/dist/assets/index-CBraEhHZ.js.map +0 -1
- package/dist/assets/index-P85yRkCj.css +0 -1
|
@@ -0,0 +1,563 @@
|
|
|
1
|
+
function US(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 qx=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function pg(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var HS={exports:{}},sf={},WS={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 bc=Symbol.for("react.element"),zR=Symbol.for("react.portal"),VR=Symbol.for("react.fragment"),BR=Symbol.for("react.strict_mode"),UR=Symbol.for("react.profiler"),HR=Symbol.for("react.provider"),WR=Symbol.for("react.context"),qR=Symbol.for("react.forward_ref"),GR=Symbol.for("react.suspense"),QR=Symbol.for("react.memo"),KR=Symbol.for("react.lazy"),Gx=Symbol.iterator;function YR(e){return e===null||typeof e!="object"?null:(e=Gx&&e[Gx]||e["@@iterator"],typeof e=="function"?e:null)}var qS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},GS=Object.assign,QS={};function za(e,t,n){this.props=e,this.context=t,this.refs=QS,this.updater=n||qS}za.prototype.isReactComponent={};za.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")};za.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function KS(){}KS.prototype=za.prototype;function mg(e,t,n){this.props=e,this.context=t,this.refs=QS,this.updater=n||qS}var gg=mg.prototype=new KS;gg.constructor=mg;GS(gg,za.prototype);gg.isPureReactComponent=!0;var Qx=Array.isArray,YS=Object.prototype.hasOwnProperty,vg={current:null},XS={key:!0,ref:!0,__self:!0,__source:!0};function JS(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)YS.call(t,r)&&!XS.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:bc,type:e,key:i,ref:a,props:o,_owner:vg.current}}function XR(e,t){return{$$typeof:bc,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function yg(e){return typeof e=="object"&&e!==null&&e.$$typeof===bc}function JR(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Kx=/\/+/g;function Th(e,t){return typeof e=="object"&&e!==null&&e.key!=null?JR(""+e.key):t.toString(36)}function qu(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 bc:case zR:a=!0}}if(a)return a=e,o=o(a),e=r===""?"."+Th(a,0):r,Qx(o)?(n="",e!=null&&(n=e.replace(Kx,"$&/")+"/"),qu(o,t,n,"",function(u){return u})):o!=null&&(yg(o)&&(o=XR(o,n+(!o.key||a&&a.key===o.key?"":(""+o.key).replace(Kx,"$&/")+"/")+e)),t.push(o)),1;if(a=0,r=r===""?".":r+":",Qx(e))for(var l=0;l<e.length;l++){i=e[l];var c=r+Th(i,l);a+=qu(i,t,n,c,o)}else if(c=YR(e),typeof c=="function")for(e=c.call(e),l=0;!(i=e.next()).done;)i=i.value,c=r+Th(i,l++),a+=qu(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 mu(e,t,n){if(e==null)return e;var r=[],o=0;return qu(e,r,"","",function(i){return t.call(n,i,o++)}),r}function ZR(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 Mn={current:null},Gu={transition:null},e2={ReactCurrentDispatcher:Mn,ReactCurrentBatchConfig:Gu,ReactCurrentOwner:vg};Ge.Children={map:mu,forEach:function(e,t,n){mu(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return mu(e,function(){t++}),t},toArray:function(e){return mu(e,function(t){return t})||[]},only:function(e){if(!yg(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};Ge.Component=za;Ge.Fragment=VR;Ge.Profiler=UR;Ge.PureComponent=mg;Ge.StrictMode=BR;Ge.Suspense=GR;Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=e2;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=GS({},e.props),o=e.key,i=e.ref,a=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,a=vg.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(c in t)YS.call(t,c)&&!XS.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:bc,type:e.type,key:o,ref:i,props:r,_owner:a}};Ge.createContext=function(e){return e={$$typeof:WR,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:HR,_context:e},e.Consumer=e};Ge.createElement=JS;Ge.createFactory=function(e){var t=JS.bind(null,e);return t.type=e,t};Ge.createRef=function(){return{current:null}};Ge.forwardRef=function(e){return{$$typeof:qR,render:e}};Ge.isValidElement=yg;Ge.lazy=function(e){return{$$typeof:KR,_payload:{_status:-1,_result:e},_init:ZR}};Ge.memo=function(e,t){return{$$typeof:QR,type:e,compare:t===void 0?null:t}};Ge.startTransition=function(e){var t=Gu.transition;Gu.transition={};try{e()}finally{Gu.transition=t}};Ge.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")};Ge.useCallback=function(e,t){return Mn.current.useCallback(e,t)};Ge.useContext=function(e){return Mn.current.useContext(e)};Ge.useDebugValue=function(){};Ge.useDeferredValue=function(e){return Mn.current.useDeferredValue(e)};Ge.useEffect=function(e,t){return Mn.current.useEffect(e,t)};Ge.useId=function(){return Mn.current.useId()};Ge.useImperativeHandle=function(e,t,n){return Mn.current.useImperativeHandle(e,t,n)};Ge.useInsertionEffect=function(e,t){return Mn.current.useInsertionEffect(e,t)};Ge.useLayoutEffect=function(e,t){return Mn.current.useLayoutEffect(e,t)};Ge.useMemo=function(e,t){return Mn.current.useMemo(e,t)};Ge.useReducer=function(e,t,n){return Mn.current.useReducer(e,t,n)};Ge.useRef=function(e){return Mn.current.useRef(e)};Ge.useState=function(e){return Mn.current.useState(e)};Ge.useSyncExternalStore=function(e,t,n){return Mn.current.useSyncExternalStore(e,t,n)};Ge.useTransition=function(){return Mn.current.useTransition()};Ge.version="18.2.0";WS.exports=Ge;var p=WS.exports;const nn=pg(p),ZS=US({__proto__:null,default:nn},[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 t2=p,n2=Symbol.for("react.element"),r2=Symbol.for("react.fragment"),o2=Object.prototype.hasOwnProperty,i2=t2.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,s2={key:!0,ref:!0,__self:!0,__source:!0};function eb(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)o2.call(t,r)&&!s2.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:n2,type:e,key:i,ref:a,props:o,_owner:i2.current}}sf.Fragment=r2;sf.jsx=eb;sf.jsxs=eb;HS.exports=sf;var s=HS.exports,no=function(){return no=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},no.apply(this,arguments)};function tb(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 a2(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 Qu="right-scroll-bar-position",Ku="width-before-scroll-bar",l2="with-scroll-bars-hidden",c2="--removed-body-scroll-bar-size";function kh(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function u2(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 d2=typeof window<"u"?p.useLayoutEffect:p.useEffect,Yx=new WeakMap;function f2(e,t){var n=u2(null,function(r){return e.forEach(function(o){return kh(o,r)})});return d2(function(){var r=Yx.get(n);if(r){var o=new Set(r),i=new Set(e),a=n.current;o.forEach(function(l){i.has(l)||kh(l,null)}),i.forEach(function(l){o.has(l)||kh(l,a)})}Yx.set(n,e)},[e]),n}function h2(e){return e}function p2(e,t){t===void 0&&(t=h2);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 m2(e){e===void 0&&(e={});var t=p2(null);return t.options=no({async:!0,ssr:!1},e),t}var nb=function(e){var t=e.sideCar,n=tb(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,no({},n))};nb.isSideCarExport=!0;function g2(e,t){return e.useMedium(t),nb}var rb=m2(),Rh=function(){},af=p.forwardRef(function(e,t){var n=p.useRef(null),r=p.useState({onScrollCapture:Rh,onWheelCapture:Rh,onTouchMoveCapture:Rh}),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,y=S===void 0?"div":S,w=e.gapMode,x=tb(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),b=h,C=f2([n,t]),E=no(no({},x),o);return p.createElement(p.Fragment,null,d&&p.createElement(b,{sideCar:rb,removeScrollBar:u,shards:f,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!v,lockRef:n,gapMode:w}),a?p.cloneElement(p.Children.only(l),no(no({},E),{ref:C})):p.createElement(y,no({},E,{className:c,ref:C}),l))});af.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};af.classNames={fullWidth:Ku,zeroRight:Qu};var v2=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function y2(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=v2();return t&&e.setAttribute("nonce",t),e}function x2(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function w2(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var S2=function(){var e=0,t=null;return{add:function(n){e==0&&(t=y2())&&(x2(t,n),w2(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},b2=function(){var e=S2();return function(t,n){p.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},ob=function(){var e=b2(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},j2={left:0,top:0,right:0,gap:0},_h=function(e){return parseInt(e||"",10)||0},C2=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[_h(n),_h(r),_h(o)]},E2=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return j2;var t=C2(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])}},P2=ob(),ha="data-scroll-locked",T2=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(l2,` {
|
|
19
|
+
overflow: hidden `).concat(r,`;
|
|
20
|
+
padding-right: `).concat(l,"px ").concat(r,`;
|
|
21
|
+
}
|
|
22
|
+
body[`).concat(ha,`] {
|
|
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(Qu,` {
|
|
36
|
+
right: `).concat(l,"px ").concat(r,`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.`).concat(Ku,` {
|
|
40
|
+
margin-right: `).concat(l,"px ").concat(r,`;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.`).concat(Qu," .").concat(Qu,` {
|
|
44
|
+
right: 0 `).concat(r,`;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.`).concat(Ku," .").concat(Ku,` {
|
|
48
|
+
margin-right: 0 `).concat(r,`;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
body[`).concat(ha,`] {
|
|
52
|
+
`).concat(c2,": ").concat(l,`px;
|
|
53
|
+
}
|
|
54
|
+
`)},Xx=function(){var e=parseInt(document.body.getAttribute(ha)||"0",10);return isFinite(e)?e:0},k2=function(){p.useEffect(function(){return document.body.setAttribute(ha,(Xx()+1).toString()),function(){var e=Xx()-1;e<=0?document.body.removeAttribute(ha):document.body.setAttribute(ha,e.toString())}},[])},R2=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,o=r===void 0?"margin":r;k2();var i=p.useMemo(function(){return E2(o)},[o]);return p.createElement(P2,{styles:T2(i,!t,o,n?"":"!important")})},Dp=!1;if(typeof window<"u")try{var gu=Object.defineProperty({},"passive",{get:function(){return Dp=!0,!0}});window.addEventListener("test",gu,gu),window.removeEventListener("test",gu,gu)}catch{Dp=!1}var Ls=Dp?{passive:!1}:!1,_2=function(e){return e.tagName==="TEXTAREA"},ib=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!_2(e)&&n[t]==="visible")},D2=function(e){return ib(e,"overflowY")},I2=function(e){return ib(e,"overflowX")},Jx=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var o=sb(e,r);if(o){var i=ab(e,r),a=i[1],l=i[2];if(a>l)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},A2=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},N2=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},sb=function(e,t){return e==="v"?D2(t):I2(t)},ab=function(e,t){return e==="v"?A2(t):N2(t)},M2=function(e,t){return e==="h"&&t==="rtl"?-1:1},O2=function(e,t,n,r,o){var i=M2(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=ab(e,l),g=m[0],v=m[1],S=m[2],y=v-S-i*g;(g||y)&&sb(e,l)&&(f+=y,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},vu=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},Zx=function(e){return[e.deltaX,e.deltaY]},e0=function(e){return e&&"current"in e?e.current:e},$2=function(e,t){return e[0]===t[0]&&e[1]===t[1]},L2=function(e){return`
|
|
55
|
+
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
56
|
+
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
57
|
+
`)},F2=0,Fs=[];function z2(e){var t=p.useRef([]),n=p.useRef([0,0]),r=p.useRef(),o=p.useState(F2++)[0],i=p.useState(ob)[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=a2([e.lockRef.current],(e.shards||[]).map(e0),!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)return!a.current.allowPinchZoom;var y=vu(v),w=n.current,x="deltaX"in v?v.deltaX:w[0]-y[0],b="deltaY"in v?v.deltaY:w[1]-y[1],C,E=v.target,j=Math.abs(x)>Math.abs(b)?"h":"v";if("touches"in v&&j==="h"&&E.type==="range")return!1;var P=Jx(j,E);if(!P)return!0;if(P?C=j:(C=j==="v"?"h":"v",P=Jx(j,E)),!P)return!1;if(!r.current&&"changedTouches"in v&&(x||b)&&(r.current=C),!C)return!0;var _=r.current||C;return O2(_,S,v,_==="h"?x:b,!0)},[]),c=p.useCallback(function(v){var S=v;if(!(!Fs.length||Fs[Fs.length-1]!==i)){var y="deltaY"in S?Zx(S):vu(S),w=t.current.filter(function(C){return C.name===S.type&&(C.target===S.target||S.target===C.shadowParent)&&$2(C.delta,y)})[0];if(w&&w.should){S.cancelable&&S.preventDefault();return}if(!w){var x=(a.current.shards||[]).map(e0).filter(Boolean).filter(function(C){return C.contains(S.target)}),b=x.length>0?l(S,x[0]):!a.current.noIsolation;b&&S.cancelable&&S.preventDefault()}}},[]),u=p.useCallback(function(v,S,y,w){var x={name:v,delta:S,target:y,should:w,shadowParent:V2(y)};t.current.push(x),setTimeout(function(){t.current=t.current.filter(function(b){return b!==x})},1)},[]),d=p.useCallback(function(v){n.current=vu(v),r.current=void 0},[]),f=p.useCallback(function(v){u(v.type,Zx(v),v.target,l(v,e.lockRef.current))},[]),h=p.useCallback(function(v){u(v.type,vu(v),v.target,l(v,e.lockRef.current))},[]);p.useEffect(function(){return Fs.push(i),e.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:h}),document.addEventListener("wheel",c,Ls),document.addEventListener("touchmove",c,Ls),document.addEventListener("touchstart",d,Ls),function(){Fs=Fs.filter(function(v){return v!==i}),document.removeEventListener("wheel",c,Ls),document.removeEventListener("touchmove",c,Ls),document.removeEventListener("touchstart",d,Ls)}},[]);var m=e.removeScrollBar,g=e.inert;return p.createElement(p.Fragment,null,g?p.createElement(i,{styles:L2(o)}):null,m?p.createElement(R2,{gapMode:e.gapMode}):null)}function V2(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const B2=g2(rb,z2);var lf=p.forwardRef(function(e,t){return p.createElement(af,no({},e,{ref:t,sideCar:B2}))});lf.classNames=af.classNames;function yt(e){return Object.keys(e)}function Dh(e){return e&&typeof e=="object"&&!Array.isArray(e)}function xg(e,t){const n={...e},r=t;return Dh(e)&&Dh(t)&&Object.keys(t).forEach(o=>{Dh(r[o])&&o in e?n[o]=xg(n[o],r[o]):n[o]=r[o]}),n}function U2(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function H2(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 Ip(e){const t=H2(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 Ih(e){return e==="0rem"?"0rem":`calc(${e} * var(--mantine-scale))`}function lb(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?Ih(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?Ih(r):r;const o=r.replace("px","");if(!Number.isNaN(Number(o))){const i=`${Number(o)/16}${e}`;return t?Ih(i):i}}return r}return n}const z=lb("rem",{shouldScale:!0}),dd=lb("em");function ys(e){return Object.keys(e).reduce((t,n)=>(e[n]!==void 0&&(t[n]=e[n]),t),{})}function cb(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 $o(e){return Array.isArray(e)||e===null?!1:typeof e=="object"?e.type!==p.Fragment:!1}function On(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 jc(e=null){const t=p.createContext(e);return[({children:o,value:i})=>s.jsx(t.Provider,{value:i,children:o}),()=>p.useContext(t)]}function t0(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 W2(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 q2(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 G2(e,t,n){return fd(e,n)===fd(t,n)}function ub({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=>G2(l.currentTarget,v,e)),u=c.findIndex(v=>l.currentTarget===v),d=q2(u,c,r),f=W2(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 Q2={app:100,modal:200,popover:300,overlay:400,max:9999};function Wr(e){return Q2[e]}const K2=()=>{};function Y2(e,t={active:!0}){return typeof e!="function"||!t.active?t.onKeyDown||K2:n=>{var r;n.key==="Escape"&&(e(n),(r=t.onTrigger)==null||r.call(t))}}function Oe(e,t="size",n=!0){if(e!==void 0)return cb(e)?n?z(e):e:`var(--${t}-${e})`}function un(e){return Oe(e,"mantine-spacing")}function wt(e){return e===void 0?"var(--mantine-radius-default)":Oe(e,"mantine-radius")}function rn(e){return Oe(e,"mantine-font-size")}function db(e){return Oe(e,"mantine-line-height",!1)}function wg(e){if(e)return Oe(e,"mantine-shadow",!1)}function Zn(e,t){return n=>{e==null||e(n),t==null||t(n)}}function Sg(e,t){return e in t.breakpoints?Ip(t.breakpoints[e]):Ip(e)}function Vl(e,t){const n=e.map(r=>({value:r,px:Sg(r,t)}));return n.sort((r,o)=>r.px-o.px),n}function di(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function X2(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 J2(){const[e,t]=p.useState(-1);return[e,{setHovered:t,resetHovered:()=>t(-1)}]}function yu(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 bg(){return`mantine-${Math.random().toString(36).slice(2,11)}`}function n0(e){return typeof e!="string"?"":e.charAt(0).toUpperCase()+e.slice(1)}function Wi(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 cf(e,t){const n=Wi(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 r0=["mousedown","touchstart"];function Z2(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||r0).forEach(i=>document.addEventListener(i,o)),()=>{(t||r0).forEach(i=>document.removeEventListener(i,o))}},[r,e,n]),r}function fb({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 e_(e,t){try{return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}catch{return e.addListener(t),()=>e.removeListener(t)}}function t_(e,t){return typeof window<"u"&&"matchMedia"in window?window.matchMedia(e).matches:!1}function hb(e,t,{getInitialValueInEffect:n}={getInitialValueInEffect:!0}){const[r,o]=p.useState(n?t:t_(e)),i=p.useRef();return p.useEffect(()=>{if("matchMedia"in window)return i.current=window.matchMedia(e),o(i.current.matches),e_(i.current,a=>o(a.matches))},[e]),r}function n_(e,t){return hb("(prefers-color-scheme: dark)",e==="dark",t)?"dark":"light"}const Va=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Po(e,t){const n=p.useRef(!1);p.useEffect(()=>()=>{n.current=!1},[]),p.useEffect(()=>{if(n.current)return e();n.current=!0},t)}function pb({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 Po(()=>{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 r_(e,t="body > :not(script)"){const n=bg(),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 o_=/input|select|textarea|button|object/,mb="a, input, select, textarea, button, object, [tabindex]";function i_(e){return e.style.display==="none"}function s_(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(i_(n))return!1;n=n.parentNode}return!0}function gb(e){let t=e.getAttribute("tabindex");return t===null&&(t=void 0),parseInt(t,10)}function Ap(e){const t=e.nodeName.toLowerCase(),n=!Number.isNaN(gb(e));return(o_.test(t)&&!e.disabled||e instanceof HTMLAnchorElement&&e.href||n)&&s_(e)}function vb(e){const t=gb(e);return(Number.isNaN(t)||t>=0)&&Ap(e)}function a_(e){return Array.from(e.querySelectorAll(mb)).filter(vb)}function l_(e,t){const n=a_(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 c_(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(mb));a=l.find(vb)||l.find(Ap)||null,!a&&Ap(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=r_(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&&l_(t.current,a)};return document.addEventListener("keydown",i),()=>{document.removeEventListener("keydown",i),n.current&&n.current()}},[e]),o}const u_=e=>(e+1)%1e6;function d_(){const[,e]=p.useReducer(u_,0);return e}const f_=nn.useId||(()=>{});function h_(){const e=f_();return e?`mantine-${e.replace(/:/g,"")}`:""}function $n(e){const t=h_(),[n,r]=p.useState(t);return Va(()=>{r(bg())},[]),typeof e=="string"?e:typeof window>"u"?t:n}function yb(e,t,n){p.useEffect(()=>(window.addEventListener(e,t,n),()=>window.removeEventListener(e,t,n)),[e,t])}function uf(e,t){typeof e=="function"?e(t):typeof e=="object"&&e!==null&&"current"in e&&(e.current=t)}function p_(...e){return t=>{e.forEach(n=>uf(n,t))}}function qt(...e){return p.useCallback(p_(...e),e)}function pn({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 Zo(e,t){const n=t-e+1;return Array.from({length:n},(r,o)=>o+e)}const xu="dots";function m_({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]=pn({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 Zo(1,a);const S=Math.max(l-t,n),y=Math.min(l+t,a-n),w=S>n+2,x=y<a-(n+1);if(!w&&x){const b=t*2+n+2;return[...Zo(1,b),xu,...Zo(a-(n-1),a)]}if(w&&!x){const b=n+1+2*t;return[...Zo(1,n),xu,...Zo(a-b,a)]}return[...Zo(1,n),xu,...Zo(S,y),xu,...Zo(a-n+1,a)]},[a,t,l]),active:l,setPage:u,next:d,previous:f,first:h,last:m}}function jg(e,t){return hb("(prefers-reduced-motion: reduce)",e,t)}function xb(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 g_(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 v_(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 y_(){const[e,t]=p.useState(!1);return p.useEffect(()=>t(!0),[]),e}var x_={};function wb(){return typeof process<"u"&&x_?"production":"development"}function Sb(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=Sb(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function nt(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Sb(e))&&(r&&(r+=" "),r+=t);return r}const w_={};function S_(e){const t={};return e.forEach(n=>{Object.entries(n).forEach(([r,o])=>{t[r]?t[r]=nt(t[r],o):t[r]=o})}),t}function df({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||w_);return S_(i)}function hd({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 Cg=p.createContext(null);function Di(){const e=p.useContext(Cg);if(!e)throw new Error("[@mantine/core] MantineProvider was not found in tree");return e}function b_(){return Di().cssVariablesResolver}function j_(){return Di().classNamesPrefix}function ff(){return Di().getStyleNonce}function C_(){return Di().withStaticClasses}function E_(){return Di().headless}function P_(){var e;return(e=Di().stylesTransform)==null?void 0:e.sx}function T_(){var e;return(e=Di().stylesTransform)==null?void 0:e.styles}function k_(e){return/^#?([0-9A-F]{3}){1,2}([0-9A-F]{2})?$/i.test(e)}function R_(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 __(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 D_(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 Eg(e){return k_(e)?R_(e):e.startsWith("rgb")?__(e):e.startsWith("hsl")?D_(e):{r:0,g:0,b:0,a:1}}function wu(e,t){if(e.startsWith("var("))return`color-mix(in srgb, ${e}, black ${t*100}%)`;const{r:n,g:r,b:o,a:i}=Eg(e),a=1-t,l=c=>Math.round(c*a);return`rgba(${l(n)}, ${l(r)}, ${l(o)}, ${i})`}function Bl(e,t){return typeof e.primaryShade=="number"?e.primaryShade:t==="dark"?e.primaryShade.dark:e.primaryShade.light}function Ah(e){return e<=.03928?e/12.92:((e+.055)/1.055)**2.4}function I_(e){const t=e.match(/oklch\((.*?)%\s/);return t?parseFloat(t[1]):null}function A_(e){if(e.startsWith("oklch("))return(I_(e)||0)/100;const{r:t,g:n,b:r}=Eg(e),o=t/255,i=n/255,a=r/255,l=Ah(o),c=Ah(i),u=Ah(a);return .2126*l+.7152*c+.0722*u}function al(e,t=.179){return e.startsWith("var(")?!1:A_(e)>t}function uo({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:al(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:al(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:al(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][Bl(t,n||"light")];return{color:r,value:l,shade:i,isThemeColor:a,isLight:al(l,t.luminanceThreshold),variable:o?`--mantine-color-${r}-${i}`:`--mantine-color-${r}-filled`}}return{color:e,value:e,isThemeColor:a,isLight:al(e,t.luminanceThreshold),shade:i,variable:void 0}}function xt(e,t){const n=uo({color:e||t.primaryColor,theme:t});return n.variable?`var(${n.variable})`:e}function Np(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=xt(n.from,t),o=xt(n.to,t);return`linear-gradient(${n.deg}deg, ${r} 0%, ${o} 100%)`}function hr(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}=Eg(e);return`rgba(${n}, ${r}, ${o}, ${t})`}const zs=hr,N_=({color:e,theme:t,variant:n,gradient:r,autoContrast:o})=>{const i=uo({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:`${z(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:`${z(1)} solid transparent`}:{background:e,hover:wu(e,.1),color:l,border:`${z(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:`${z(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:hr(l,.1),hover:hr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${z(1)} solid transparent`}}return{background:hr(e,.1),hover:hr(e,.12),color:e,border:`${z(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:`${z(1)} solid var(--mantine-color-${e}-outline)`}:{background:"transparent",hover:hr(t.colors[i.color][i.shade],.05),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${z(1)} solid var(--mantine-color-${i.color}-${i.shade})`}:{background:"transparent",hover:hr(e,.05),color:e,border:`${z(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:`${z(1)} solid transparent`};const l=t.colors[i.color][i.shade];return{background:"transparent",hover:hr(l,.12),color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${z(1)} solid transparent`}}return{background:"transparent",hover:hr(e,.12),color:e,border:`${z(1)} solid transparent`}}return n==="transparent"?i.isThemeColor?i.shade===void 0?{background:"transparent",hover:"transparent",color:`var(--mantine-color-${e}-light-color)`,border:`${z(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:`var(--mantine-color-${i.color}-${Math.min(i.shade,6)})`,border:`${z(1)} solid transparent`}:{background:"transparent",hover:"transparent",color:e,border:`${z(1)} solid transparent`}:n==="white"?i.isThemeColor?i.shade===void 0?{background:"var(--mantine-color-white)",hover:wu(t.white,.01),color:`var(--mantine-color-${e}-filled)`,border:`${z(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:wu(t.white,.01),color:`var(--mantine-color-${i.color}-${i.shade})`,border:`${z(1)} solid transparent`}:{background:"var(--mantine-color-white)",hover:wu(t.white,.01),color:e,border:`${z(1)} solid transparent`}:n==="gradient"?{background:Np(r,t),hover:Np(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:`${z(1)} solid var(--mantine-color-default-border)`}:{}},M_={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"]},o0="-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji",Pg={scale:1,fontSmoothing:!0,focusRing:"auto",white:"#fff",black:"#000",colors:M_,primaryShade:{light:6,dark:8},primaryColor:"blue",variantColorResolver:N_,autoContrast:!1,luminanceThreshold:.3,fontFamily:o0,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:o0,fontWeight:"700",textWrap:"wrap",sizes:{h1:{fontSize:z(34),lineHeight:"1.3"},h2:{fontSize:z(26),lineHeight:"1.35"},h3:{fontSize:z(22),lineHeight:"1.4"},h4:{fontSize:z(18),lineHeight:"1.45"},h5:{fontSize:z(16),lineHeight:"1.5"},h6:{fontSize:z(14),lineHeight:"1.5"}}},fontSizes:{xs:z(12),sm:z(14),md:z(16),lg:z(18),xl:z(20)},lineHeights:{xs:"1.4",sm:"1.45",md:"1.55",lg:"1.6",xl:"1.65"},radius:{xs:z(2),sm:z(4),md:z(8),lg:z(16),xl:z(32)},spacing:{xs:z(10),sm:z(12),md:z(16),lg:z(20),xl:z(32)},breakpoints:{xs:"36em",sm:"48em",md:"62em",lg:"75em",xl:"88em"},shadows:{xs:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), 0 ${z(1)} ${z(2)} rgba(0, 0, 0, 0.1)`,sm:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(10)} ${z(15)} ${z(-5)}, rgba(0, 0, 0, 0.04) 0 ${z(7)} ${z(7)} ${z(-5)}`,md:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(20)} ${z(25)} ${z(-5)}, rgba(0, 0, 0, 0.04) 0 ${z(10)} ${z(10)} ${z(-5)}`,lg:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(28)} ${z(23)} ${z(-7)}, rgba(0, 0, 0, 0.04) 0 ${z(12)} ${z(12)} ${z(-7)}`,xl:`0 ${z(1)} ${z(3)} rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 ${z(36)} ${z(28)} ${z(-7)}, rgba(0, 0, 0, 0.04) 0 ${z(17)} ${z(17)} ${z(-7)}`},other:{},components:{}};function i0(e){return e==="auto"||e==="dark"||e==="light"}function O_({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 i0(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&&i0(r.newValue)&&n(r.newValue)},window.addEventListener("storage",t)},unsubscribe:()=>{window.removeEventListener("storage",t)},clear:()=>{window.localStorage.removeItem(e)}}}const $_="[@mantine/core] MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more – https://mantine.dev/theming/colors/#primary-color",s0="[@mantine/core] MantineProvider: Invalid theme.primaryShade, it accepts only 0-9 integers or an object { light: 0-9, dark: 0-9 }";function Nh(e){return e<0||e>9?!1:parseInt(e.toString(),10)===e}function a0(e){if(!(e.primaryColor in e.colors))throw new Error($_);if(typeof e.primaryShade=="object"&&(!Nh(e.primaryShade.dark)||!Nh(e.primaryShade.light)))throw new Error(s0);if(typeof e.primaryShade=="number"&&!Nh(e.primaryShade))throw new Error(s0)}function L_(e,t){var r;if(!t)return a0(e),e;const n=xg(e,t);return t.fontFamily&&!((r=t.headings)!=null&&r.fontFamily)&&(n.headings.fontFamily=t.fontFamily),a0(n),n}const Tg=p.createContext(null),F_=()=>p.useContext(Tg)||Pg;function Dt(){const e=p.useContext(Tg);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 bb({theme:e,children:t,inherit:n=!0}){const r=F_(),o=p.useMemo(()=>L_(n?r:Pg,e),[e,r,n]);return s.jsx(Tg.Provider,{value:o,children:t})}bb.displayName="@mantine/core/MantineThemeProvider";function z_(){const e=Dt(),t=ff(),n=yt(e.breakpoints).reduce((r,o)=>{const i=e.breakpoints[o].includes("px"),a=Ip(e.breakpoints[o]),l=i?`${a-.1}px`:dd(a-.1),c=i?`${a}px`:dd(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 Mh(e){return Object.entries(e).map(([t,n])=>`${t}: ${n};`).join("")}function Oh(e,t){return(Array.isArray(e)?e:[e]).reduce((r,o)=>`${o}{${r}}`,t)}function V_(e,t){const n=Mh(e.variables),r=n?Oh(t,n):"",o=Mh(e.dark),i=o?Oh(`${t}[data-mantine-color-scheme="dark"]`,o):"",a=Mh(e.light),l=a?Oh(`${t}[data-mantine-color-scheme="light"]`,a):"";return`${r}${i}${l}`}function xs({color:e,theme:t,autoContrast:n}){return(typeof n=="boolean"?n:t.autoContrast)&&uo({color:e||t.primaryColor,theme:t}).isLight?"var(--mantine-color-black)":"var(--mantine-color-white)"}function l0(e,t){return xs({color:e.colors[e.primaryColor][Bl(e,t)],theme:e,autoContrast:null})}function Su({theme:e,color:t,colorScheme:n,name:r=t,withColorValues:o=!0}){if(!e.colors[t])return{};if(n==="light"){const l=Bl(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`]:zs(e.colors[t][l],.1),[`--mantine-color-${r}-light-hover`]:zs(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`]:zs(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=Bl(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`]:zs(e.colors[t][Math.max(0,i-2)],.15),[`--mantine-color-${r}-light-hover`]:zs(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`]:zs(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 B_(e){return!!e&&typeof e=="object"&&"mantine-virtual-color"in e}function Vs(e,t,n){yt(t).forEach(r=>Object.assign(e,{[`--mantine-${n}-${r}`]:t[r]}))}const jb=e=>{const t=Bl(e,"light"),n=e.defaultRadius in e.radius?e.radius[e.defaultRadius]:z(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":l0(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":l0(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)"}};Vs(r.variables,e.breakpoints,"breakpoint"),Vs(r.variables,e.spacing,"spacing"),Vs(r.variables,e.fontSizes,"font-size"),Vs(r.variables,e.lineHeights,"line-height"),Vs(r.variables,e.shadows,"shadow"),Vs(r.variables,e.radius,"radius"),e.colors[e.primaryColor].forEach((i,a)=>{r.variables[`--mantine-primary-color-${a}`]=`var(--mantine-color-${e.primaryColor}-${a})`}),yt(e.colors).forEach(i=>{const a=e.colors[i];if(B_(a)){Object.assign(r.light,Su({theme:e,name:a.name,color:a.light,colorScheme:"light",withColorValues:!0})),Object.assign(r.dark,Su({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,Su({theme:e,color:i,colorScheme:"light",withColorValues:!1})),Object.assign(r.dark,Su({theme:e,color:i,colorScheme:"dark",withColorValues:!1}))});const o=e.headings.sizes;return yt(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 U_({theme:e,generator:t}){const n=jb(e),r=t==null?void 0:t(e);return r?xg(n,r):n}const $h=jb(Pg);function H_(e){const t={variables:{},light:{},dark:{}};return yt(e.variables).forEach(n=>{$h.variables[n]!==e.variables[n]&&(t.variables[n]=e.variables[n])}),yt(e.light).forEach(n=>{$h.light[n]!==e.light[n]&&(t.light[n]=e.light[n])}),yt(e.dark).forEach(n=>{$h.dark[n]!==e.dark[n]&&(t.dark[n]=e.dark[n])}),t}function W_(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 Cb({cssVariablesSelector:e,deduplicateCssVariables:t}){const n=Dt(),r=ff(),o=b_(),i=U_({theme:n,generator:o}),a=e===":root"&&t,l=a?H_(i):i,c=V_(l,e);return c?s.jsx("style",{"data-mantine-styles":!0,nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:`${c}${a?"":W_(e)}`}}):null}Cb.displayName="@mantine/CssVariables";function q_(){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 Bs(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 G_({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||(Bs(d,n),a(d),e.set(d))},[e.set,l,r]),u=p.useCallback(()=>{a(t),Bs(t,n),e.clear()},[e.clear,t]);return p.useEffect(()=>(e.subscribe(c),e.unsubscribe),[e.subscribe,e.unsubscribe]),Va(()=>{Bs(e.get(t),n)},[]),p.useEffect(()=>{var f;if(r)return Bs(r,n),()=>{};r===void 0&&Bs(i,n),o.current=window.matchMedia("(prefers-color-scheme: dark)");const d=h=>{i==="auto"&&Bs(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 Q_({respectReducedMotion:e,getRootElement:t}){Va(()=>{var n;e&&((n=t())==null||n.setAttribute("data-respect-reduced-motion","true"))},[e])}q_();function Eb({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=O_(),defaultColorScheme:d="light",getRootElement:f=()=>document.documentElement,cssVariablesResolver:h,forceColorScheme:m,stylesTransform:g}){const{colorScheme:v,setColorScheme:S,clearColorScheme:y}=G_({defaultColorScheme:d,forceColorScheme:m,manager:u,getRootElement:f});return Q_({respectReducedMotion:(e==null?void 0:e.respectReducedMotion)||!1,getRootElement:f}),s.jsx(Cg.Provider,{value:{colorScheme:v,setColorScheme:S,clearColorScheme:y,getRootElement:f,classNamesPrefix:c,getStyleNonce:n,cssVariablesResolver:h,cssVariablesSelector:l,withStaticClasses:r,stylesTransform:g},children:s.jsxs(bb,{theme:e,children:[a&&s.jsx(Cb,{cssVariablesSelector:l,deduplicateCssVariables:i}),o&&s.jsx(z_,{}),t]})})}Eb.displayName="@mantine/core/MantineProvider";function Cc({classNames:e,styles:t,props:n,stylesCtx:r}){const o=Dt();return{resolvedClassNames:df({theme:o,classNames:e,props:n,stylesCtx:r||void 0}),resolvedStyles:hd({theme:o,styles:t,props:n,stylesCtx:r||void 0})}}const K_={always:"mantine-focus-always",auto:"mantine-focus-auto",never:"mantine-focus-never"};function Y_({theme:e,options:t,unstyled:n}){return nt((t==null?void 0:t.focusable)&&!n&&(e.focusClassName||K_[e.focusRing]),(t==null?void 0:t.active)&&!n&&e.activeClassName)}function X_({selector:e,stylesCtx:t,options:n,props:r,theme:o}){return df({theme:o,classNames:n==null?void 0:n.classNames,props:(n==null?void 0:n.props)||r,stylesCtx:t})[e]}function c0({selector:e,stylesCtx:t,theme:n,classNames:r,props:o}){return df({theme:n,classNames:r,props:o,stylesCtx:t})[e]}function J_({rootSelector:e,selector:t,className:n}){return e===t?n:void 0}function Z_({selector:e,classes:t,unstyled:n}){return n?void 0:t[e]}function eD({themeName:e,classNamesPrefix:t,selector:n,withStaticClass:r}){return r===!1?[]:e.map(o=>`${t}-${o}-${n}`)}function tD({themeName:e,theme:t,selector:n,props:r,stylesCtx:o}){return e.map(i=>{var a,l;return(l=df({theme:t,classNames:(a=t.components[i])==null?void 0:a.classNames,props:r,stylesCtx:o}))==null?void 0:l[n]})}function nD({options:e,classes:t,selector:n,unstyled:r}){return e!=null&&e.variant&&!r?t[`${n}--${e.variant}`]:void 0}function rD({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 nt(Y_({theme:e,options:t,unstyled:l||m}),tD({theme:e,themeName:n,selector:r,props:d,stylesCtx:f}),nD({options:t,classes:a,selector:r,unstyled:l}),c0({selector:r,stylesCtx:f,theme:e,classNames:i,props:d}),c0({selector:r,stylesCtx:f,theme:e,classNames:g,props:d}),X_({selector:r,stylesCtx:f,options:t,props:d,theme:e}),J_({rootSelector:u,selector:r,className:c}),Z_({selector:r,classes:a,unstyled:l||m}),h&&!m&&eD({themeName:n,classNamesPrefix:o,selector:r,withStaticClass:t==null?void 0:t.withStaticClass}),t==null?void 0:t.className)}function oD({theme:e,themeName:t,props:n,stylesCtx:r,selector:o}){return t.map(i=>{var a;return hd({theme:e,styles:(a=e.components[i])==null?void 0:a.styles,props:n,stylesCtx:r})[o]}).reduce((i,a)=>({...i,...a}),{})}function Mp({style:e,theme:t}){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Mp({style:r,theme:t})}),{}):typeof e=="function"?e(t):e??{}}function iD(e){return e.reduce((t,n)=>(n&&Object.keys(n).forEach(r=>{t[r]={...t[r],...ys(n[r])}}),t),{})}function sD({vars:e,varsResolver:t,theme:n,props:r,stylesCtx:o,selector:i,themeName:a,headless:l}){var c;return(c=iD([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 aD({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&&oD({theme:e,themeName:t,props:o,stylesCtx:i,selector:n}),...!h&&hd({theme:e,styles:l,props:o,stylesCtx:i})[n],...!h&&hd({theme:e,styles:r==null?void 0:r.styles,props:(r==null?void 0:r.props)||o,stylesCtx:i})[n],...sD({theme:e,props:o,stylesCtx:i,vars:u,varsResolver:d,selector:n,themeName:t,headless:f}),...a===n?Mp({style:c,theme:e}):null,...Mp({style:r==null?void 0:r.style,theme:e})}}function lD({props:e,stylesCtx:t,themeName:n}){var a;const r=Dt(),o=(a=T_())==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 pe({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=Dt(),m=j_(),g=C_(),v=E_(),S=(Array.isArray(e)?e:[e]).filter(x=>x),{withStylesTransform:y,getTransformedStyles:w}=lD({props:n,stylesCtx:r,themeName:S});return(x,b)=>({className:rD({theme:h,options:b,themeName:S,selector:x,classNamesPrefix:m,classNames:c,classes:t,unstyled:l,className:o,rootSelector:a,props:n,stylesCtx:r,withStaticClasses:g,headless:v,transformedStyles:w([b==null?void 0:b.styles,u])}),style:aD({theme:h,themeName:S,selector:x,options:b,props:n,stylesCtx:r,rootSelector:a,styles:u,style:i,vars:d,varsResolver:f,headless:v,withStylesTransform:y})})}function Ec(e,t){return typeof e=="boolean"?e:t.autoContrast}function u0(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 cD({keepTransitions:e}={}){const t=p.useRef(),n=p.useRef(),r=p.useContext(Cg),o=ff(),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?()=>{}:u0(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?()=>{}:u0(i.current),window.clearTimeout(n.current),n.current=window.setTimeout(()=>{var f;(f=t.current)==null||f.call(t)},10)},c=n_("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 B(e,t,n){var a;const r=Dt(),o=(a=r.components[e])==null?void 0:a.defaultProps,i=typeof o=="function"?o(r):o;return{...t,...i,...ys(n)}}function d0(e){return yt(e).reduce((t,n)=>e[n]!==void 0?`${t}${U2(n)}:${e[n]};`:t,"").trim()}function uD({selector:e,styles:t,media:n}){const r=t?d0(t):"",o=Array.isArray(n)?n.map(i=>`@media${i.query}{${e}{${d0(i.styles)}}}`):[];return`${r?`${e}{${r}}`:""}${o.join("")}`.trim()}function Ba({selector:e,styles:t,media:n}){const r=ff();return s.jsx("style",{"data-mantine-styles":"inline",nonce:r==null?void 0:r(),dangerouslySetInnerHTML:{__html:uD({selector:e,styles:t,media:n})}})}function Lo(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:y,ps:w,bg:x,c:b,opacity:C,ff:E,fz:j,fw:P,lts:_,ta:R,lh:M,fs:D,tt:N,td:A,w:L,miw:I,maw:k,h:T,mih:$,mah:V,bgsz:U,bgp:X,bgr:Se,bga:me,pos:xe,top:Te,left:je,bottom:ae,right:Be,inset:St,display:st,flex:ye,hiddenFrom:$e,visibleFrom:Ie,lightHidden:ee,darkHidden:te,sx:Ee,...Qe}=e;return{styleProps:ys({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:y,ps:w,bg:x,c:b,opacity:C,ff:E,fz:j,fw:P,lts:_,ta:R,lh:M,fs:D,tt:N,td:A,w:L,miw:I,maw:k,h:T,mih:$,mah:V,bgsz:U,bgp:X,bgr:Se,bga:me,pos:xe,top:Te,left:je,bottom:ae,right:Be,inset:St,display:st,flex:ye,hiddenFrom:$e,visibleFrom:Ie,lightHidden:ee,darkHidden:te,sx:Ee}),rest:Qe}}const dD={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"},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 Pb(e,t){const n=uo({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 fD(e,t){const n=uo({color:e,theme:t});return n.isThemeColor&&n.shade===void 0?`var(--mantine-color-${n.color}-text)`:Pb(e,t)}const f0={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 hD(e){return typeof e=="string"&&e in f0?f0[e]:e}const pD=["h1","h2","h3","h4","h5","h6"];function mD(e,t){return typeof e=="string"&&e in t.fontSizes?`var(--mantine-font-size-${e})`:typeof e=="string"&&pD.includes(e)?`var(--mantine-${e}-font-size)`:typeof e=="number"||typeof e=="string"?z(e):e}function gD(e){return e}const vD=["h1","h2","h3","h4","h5","h6"];function yD(e,t){return typeof e=="string"&&e in t.lineHeights?`var(--mantine-line-height-${e})`:typeof e=="string"&&vD.includes(e)?`var(--mantine-${e}-line-height)`:e}function xD(e){return typeof e=="number"?z(e):e}function wD(e,t){if(typeof e=="number")return z(e);if(typeof e=="string"){const n=e.replace("-","");if(!(n in t.spacing))return z(e);const r=`--mantine-spacing-${n}`;return e.startsWith("-")?`calc(var(${r}) * -1)`:`var(${r})`}return e}const Lh={color:Pb,textColor:fD,fontSize:mD,spacing:wD,identity:gD,size:xD,lineHeight:yD,fontFamily:hD};function h0(e){return e.replace("(min-width: ","").replace("em)","")}function SD({media:e,...t}){const r=Object.keys(e).sort((o,i)=>Number(h0(o))-Number(h0(i))).map(o=>({query:o,styles:e[o]}));return{...t,media:r}}function bD(e){if(typeof e!="object"||e===null)return!1;const t=Object.keys(e);return!(t.length===1&&t[0]==="base")}function jD(e){return typeof e=="object"&&e!==null?"base"in e?e.base:void 0:e}function CD(e){return typeof e=="object"&&e!==null?yt(e).filter(t=>t!=="base"):[]}function ED(e,t){return typeof e=="object"&&e!==null&&t in e?e[t]:e}function Tb({styleProps:e,data:t,theme:n}){return SD(yt(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=jD(e[o]);if(!bD(e[o]))return a.forEach(u=>{r.inlineStyles[u]=Lh[i.type](l,n)}),r;r.hasResponsiveStyles=!0;const c=CD(e[o]);return a.forEach(u=>{l&&(r.styles[u]=Lh[i.type](l,n)),c.forEach(d=>{const f=`(min-width: ${n.breakpoints[d]})`;r.media[f]={...r.media[f],[u]:Lh[i.type](ED(e[o],d),n)}})}),r},{hasResponsiveStyles:!1,styles:{},inlineStyles:{},media:{}}))}function Pc(){return`__m__-${p.useId().replace(/:/g,"")}`}function kb(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...kb(r,t)}),{}):typeof e=="function"?e(t):e??{}}function Rb(e){return e.startsWith("data-")?e:`data-${e}`}function PD(e){return Object.keys(e).reduce((t,n)=>{const r=e[n];return r===void 0||r===""||r===!1||r===null||(t[Rb(n)]=e[n]),t},{})}function _b(e){return e?typeof e=="string"?{[Rb(e)]:!0}:Array.isArray(e)?[...e].reduce((t,n)=>({...t,..._b(n)}),{}):PD(e):null}function Op(e,t){return Array.isArray(e)?[...e].reduce((n,r)=>({...n,...Op(r,t)}),{}):typeof e=="function"?e(t):e??{}}function TD({theme:e,style:t,vars:n,styleProps:r}){const o=Op(t,e),i=Op(n,e);return{...o,...i,...r}}const Db=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,...h},m)=>{var j;const g=Dt(),v=e||"div",{styleProps:S,rest:y}=Lo(h),w=P_(),x=(j=w==null?void 0:w())==null?void 0:j(S.sx),b=Pc(),C=Tb({styleProps:S,theme:g,data:dD}),E={ref:m,style:TD({theme:g,style:t,vars:n,styleProps:C.inlineStyles}),className:nt(r,x,{[b]:C.hasResponsiveStyles,"mantine-light-hidden":u,"mantine-dark-hidden":d,[`mantine-hidden-from-${l}`]:l,[`mantine-visible-from-${c}`]:c}),"data-variant":o,"data-size":cb(a)?void 0:a||void 0,..._b(i),...y};return s.jsxs(s.Fragment,{children:[C.hasResponsiveStyles&&s.jsx(Ba,{selector:`.${b}`,styles:C.styles,media:C.media}),typeof f=="function"?f(E):s.jsx(v,{...E})]})});Db.displayName="@mantine/core/Box";const q=Db;function Ib(e){return e}function Y(e){const t=p.forwardRef(e);return t.extend=Ib,t}function jn(e){const t=p.forwardRef(e);return t.extend=Ib,t}const kD=p.createContext({dir:"ltr",toggleDirection:()=>{},setDirection:()=>{}});function Ua(){return p.useContext(kD)}var Ab={exports:{}},ar={},Nb={exports:{}},Mb={};/**
|
|
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(T,$){var V=T.length;T.push($);e:for(;0<V;){var U=V-1>>>1,X=T[U];if(0<o(X,$))T[U]=$,T[V]=X,V=U;else break e}}function n(T){return T.length===0?null:T[0]}function r(T){if(T.length===0)return null;var $=T[0],V=T.pop();if(V!==$){T[0]=V;e:for(var U=0,X=T.length,Se=X>>>1;U<Se;){var me=2*(U+1)-1,xe=T[me],Te=me+1,je=T[Te];if(0>o(xe,V))Te<X&&0>o(je,xe)?(T[U]=je,T[Te]=V,U=Te):(T[U]=xe,T[me]=V,U=me);else if(Te<X&&0>o(je,V))T[U]=je,T[Te]=V,U=Te;else break e}}return $}function o(T,$){var V=T.sortIndex-$.sortIndex;return V!==0?V:T.id-$.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,y=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 x(T){for(var $=n(u);$!==null;){if($.callback===null)r(u);else if($.startTime<=T)r(u),$.sortIndex=$.expirationTime,t(c,$);else break;$=n(u)}}function b(T){if(v=!1,x(T),!g)if(n(c)!==null)g=!0,I(C);else{var $=n(u);$!==null&&k(b,$.startTime-T)}}function C(T,$){g=!1,v&&(v=!1,y(P),P=-1),m=!0;var V=h;try{for(x($),f=n(c);f!==null&&(!(f.expirationTime>$)||T&&!M());){var U=f.callback;if(typeof U=="function"){f.callback=null,h=f.priorityLevel;var X=U(f.expirationTime<=$);$=e.unstable_now(),typeof X=="function"?f.callback=X:f===n(c)&&r(c),x($)}else r(c);f=n(c)}if(f!==null)var Se=!0;else{var me=n(u);me!==null&&k(b,me.startTime-$),Se=!1}return Se}finally{f=null,h=V,m=!1}}var E=!1,j=null,P=-1,_=5,R=-1;function M(){return!(e.unstable_now()-R<_)}function D(){if(j!==null){var T=e.unstable_now();R=T;var $=!0;try{$=j(!0,T)}finally{$?N():(E=!1,j=null)}}else E=!1}var N;if(typeof w=="function")N=function(){w(D)};else if(typeof MessageChannel<"u"){var A=new MessageChannel,L=A.port2;A.port1.onmessage=D,N=function(){L.postMessage(null)}}else N=function(){S(D,0)};function I(T){j=T,E||(E=!0,N())}function k(T,$){P=S(function(){T(e.unstable_now())},$)}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(T){T.callback=null},e.unstable_continueExecution=function(){g||m||(g=!0,I(C))},e.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<T?Math.floor(1e3/T):5},e.unstable_getCurrentPriorityLevel=function(){return h},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(T){switch(h){case 1:case 2:case 3:var $=3;break;default:$=h}var V=h;h=$;try{return T()}finally{h=V}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(T,$){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var V=h;h=T;try{return $()}finally{h=V}},e.unstable_scheduleCallback=function(T,$,V){var U=e.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?U+V:U):V=U,T){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=V+X,T={id:d++,callback:$,priorityLevel:T,startTime:V,expirationTime:X,sortIndex:-1},V>U?(T.sortIndex=V,t(u,T),n(c)===null&&T===n(u)&&(v?(y(P),P=-1):v=!0,k(b,V-U))):(T.sortIndex=X,t(c,T),g||m||(g=!0,I(C))),T},e.unstable_shouldYield=M,e.unstable_wrapCallback=function(T){var $=h;return function(){var V=h;h=$;try{return T.apply(this,arguments)}finally{h=V}}}})(Mb);Nb.exports=Mb;var RD=Nb.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 Ob=p,or=RD;function J(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 $b=new Set,Ul={};function ws(e,t){ja(e,t),ja(e+"Capture",t)}function ja(e,t){for(Ul[e]=t,e=0;e<t.length;e++)$b.add(t[e])}var To=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$p=Object.prototype.hasOwnProperty,_D=/^[: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]*$/,p0={},m0={};function DD(e){return $p.call(m0,e)?!0:$p.call(p0,e)?!1:_D.test(e)?m0[e]=!0:(p0[e]=!0,!1)}function ID(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 AD(e,t,n,r){if(t===null||typeof t>"u"||ID(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 Ln(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 mn={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){mn[e]=new Ln(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];mn[t]=new Ln(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){mn[e]=new Ln(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){mn[e]=new Ln(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){mn[e]=new Ln(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){mn[e]=new Ln(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){mn[e]=new Ln(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){mn[e]=new Ln(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){mn[e]=new Ln(e,5,!1,e.toLowerCase(),null,!1,!1)});var kg=/[\-:]([a-z])/g;function Rg(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(kg,Rg);mn[t]=new Ln(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(kg,Rg);mn[t]=new Ln(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(kg,Rg);mn[t]=new Ln(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){mn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!1,!1)});mn.xlinkHref=new Ln("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){mn[e]=new Ln(e,1,!1,e.toLowerCase(),null,!0,!0)});function _g(e,t,n,r){var o=mn.hasOwnProperty(t)?mn[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(AD(t,n,o,r)&&(n=null),r||o===null?DD(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 Fo=Ob.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,bu=Symbol.for("react.element"),Xs=Symbol.for("react.portal"),Js=Symbol.for("react.fragment"),Dg=Symbol.for("react.strict_mode"),Lp=Symbol.for("react.profiler"),Lb=Symbol.for("react.provider"),Fb=Symbol.for("react.context"),Ig=Symbol.for("react.forward_ref"),Fp=Symbol.for("react.suspense"),zp=Symbol.for("react.suspense_list"),Ag=Symbol.for("react.memo"),ni=Symbol.for("react.lazy"),zb=Symbol.for("react.offscreen"),g0=Symbol.iterator;function ll(e){return e===null||typeof e!="object"?null:(e=g0&&e[g0]||e["@@iterator"],typeof e=="function"?e:null)}var Mt=Object.assign,Fh;function Cl(e){if(Fh===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Fh=t&&t[1]||""}return`
|
|
77
|
+
`+Fh+e}var zh=!1;function Vh(e,t){if(!e||zh)return"";zh=!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{zh=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Cl(e):""}function ND(e){switch(e.tag){case 5:return Cl(e.type);case 16:return Cl("Lazy");case 13:return Cl("Suspense");case 19:return Cl("SuspenseList");case 0:case 2:case 15:return e=Vh(e.type,!1),e;case 11:return e=Vh(e.type.render,!1),e;case 1:return e=Vh(e.type,!0),e;default:return""}}function Vp(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 Js:return"Fragment";case Xs:return"Portal";case Lp:return"Profiler";case Dg:return"StrictMode";case Fp:return"Suspense";case zp:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Fb:return(e.displayName||"Context")+".Consumer";case Lb:return(e._context.displayName||"Context")+".Provider";case Ig:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ag:return t=e.displayName||null,t!==null?t:Vp(e.type)||"Memo";case ni:t=e._payload,e=e._init;try{return Vp(e(t))}catch{}}return null}function MD(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 Vp(t);case 8:return t===Dg?"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 Ei(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Vb(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function OD(e){var t=Vb(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 ju(e){e._valueTracker||(e._valueTracker=OD(e))}function Bb(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Vb(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function pd(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 Bp(e,t){var n=t.checked;return Mt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function v0(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Ei(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 Ub(e,t){t=t.checked,t!=null&&_g(e,"checked",t,!1)}function Up(e,t){Ub(e,t);var n=Ei(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")?Hp(e,t.type,n):t.hasOwnProperty("defaultValue")&&Hp(e,t.type,Ei(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function y0(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 Hp(e,t,n){(t!=="number"||pd(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var El=Array.isArray;function pa(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=""+Ei(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 Wp(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(J(91));return Mt({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function x0(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(J(92));if(El(n)){if(1<n.length)throw Error(J(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Ei(n)}}function Hb(e,t){var n=Ei(t.value),r=Ei(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 w0(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Wb(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 qp(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Wb(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Cu,qb=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(Cu=Cu||document.createElement("div"),Cu.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Cu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Hl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var _l={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},$D=["Webkit","ms","Moz","O"];Object.keys(_l).forEach(function(e){$D.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),_l[t]=_l[e]})});function Gb(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||_l.hasOwnProperty(e)&&_l[e]?(""+t).trim():t+"px"}function Qb(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Gb(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var LD=Mt({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 Gp(e,t){if(t){if(LD[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(J(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(J(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(J(61))}if(t.style!=null&&typeof t.style!="object")throw Error(J(62))}}function Qp(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 Kp=null;function Ng(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yp=null,ma=null,ga=null;function S0(e){if(e=Rc(e)){if(typeof Yp!="function")throw Error(J(280));var t=e.stateNode;t&&(t=vf(t),Yp(e.stateNode,e.type,t))}}function Kb(e){ma?ga?ga.push(e):ga=[e]:ma=e}function Yb(){if(ma){var e=ma,t=ga;if(ga=ma=null,S0(e),t)for(e=0;e<t.length;e++)S0(t[e])}}function Xb(e,t){return e(t)}function Jb(){}var Bh=!1;function Zb(e,t,n){if(Bh)return e(t,n);Bh=!0;try{return Xb(e,t,n)}finally{Bh=!1,(ma!==null||ga!==null)&&(Jb(),Yb())}}function Wl(e,t){var n=e.stateNode;if(n===null)return null;var r=vf(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(J(231,t,typeof n));return n}var Xp=!1;if(To)try{var cl={};Object.defineProperty(cl,"passive",{get:function(){Xp=!0}}),window.addEventListener("test",cl,cl),window.removeEventListener("test",cl,cl)}catch{Xp=!1}function FD(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 Dl=!1,md=null,gd=!1,Jp=null,zD={onError:function(e){Dl=!0,md=e}};function VD(e,t,n,r,o,i,a,l,c){Dl=!1,md=null,FD.apply(zD,arguments)}function BD(e,t,n,r,o,i,a,l,c){if(VD.apply(this,arguments),Dl){if(Dl){var u=md;Dl=!1,md=null}else throw Error(J(198));gd||(gd=!0,Jp=u)}}function Ss(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 ej(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 b0(e){if(Ss(e)!==e)throw Error(J(188))}function UD(e){var t=e.alternate;if(!t){if(t=Ss(e),t===null)throw Error(J(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 b0(o),e;if(i===r)return b0(o),t;i=i.sibling}throw Error(J(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(J(189))}}if(n.alternate!==r)throw Error(J(190))}if(n.tag!==3)throw Error(J(188));return n.stateNode.current===n?e:t}function tj(e){return e=UD(e),e!==null?nj(e):null}function nj(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=nj(e);if(t!==null)return t;e=e.sibling}return null}var rj=or.unstable_scheduleCallback,j0=or.unstable_cancelCallback,HD=or.unstable_shouldYield,WD=or.unstable_requestPaint,Ut=or.unstable_now,qD=or.unstable_getCurrentPriorityLevel,Mg=or.unstable_ImmediatePriority,oj=or.unstable_UserBlockingPriority,vd=or.unstable_NormalPriority,GD=or.unstable_LowPriority,ij=or.unstable_IdlePriority,hf=null,oo=null;function QD(e){if(oo&&typeof oo.onCommitFiberRoot=="function")try{oo.onCommitFiberRoot(hf,e,void 0,(e.current.flags&128)===128)}catch{}}var Lr=Math.clz32?Math.clz32:XD,KD=Math.log,YD=Math.LN2;function XD(e){return e>>>=0,e===0?32:31-(KD(e)/YD|0)|0}var Eu=64,Pu=4194304;function Pl(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 yd(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=Pl(l):(i&=a,i!==0&&(r=Pl(i)))}else a=n&~o,a!==0?r=Pl(a):i!==0&&(r=Pl(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-Lr(t),o=1<<n,r|=e[n],t&=~o;return r}function JD(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 ZD(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var a=31-Lr(i),l=1<<a,c=o[a];c===-1?(!(l&n)||l&r)&&(o[a]=JD(l,t)):c<=t&&(e.expiredLanes|=l),i&=~l}}function Zp(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function sj(){var e=Eu;return Eu<<=1,!(Eu&4194240)&&(Eu=64),e}function Uh(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Tc(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-Lr(t),e[t]=n}function eI(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-Lr(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function Og(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Lr(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var it=0;function aj(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var lj,$g,cj,uj,dj,em=!1,Tu=[],mi=null,gi=null,vi=null,ql=new Map,Gl=new Map,ai=[],tI="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 C0(e,t){switch(e){case"focusin":case"focusout":mi=null;break;case"dragenter":case"dragleave":gi=null;break;case"mouseover":case"mouseout":vi=null;break;case"pointerover":case"pointerout":ql.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Gl.delete(t.pointerId)}}function ul(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=Rc(t),t!==null&&$g(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function nI(e,t,n,r,o){switch(t){case"focusin":return mi=ul(mi,e,t,n,r,o),!0;case"dragenter":return gi=ul(gi,e,t,n,r,o),!0;case"mouseover":return vi=ul(vi,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return ql.set(i,ul(ql.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Gl.set(i,ul(Gl.get(i)||null,e,t,n,r,o)),!0}return!1}function fj(e){var t=Qi(e.target);if(t!==null){var n=Ss(t);if(n!==null){if(t=n.tag,t===13){if(t=ej(n),t!==null){e.blockedOn=t,dj(e.priority,function(){cj(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 Yu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=tm(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Kp=r,n.target.dispatchEvent(r),Kp=null}else return t=Rc(n),t!==null&&$g(t),e.blockedOn=n,!1;t.shift()}return!0}function E0(e,t,n){Yu(e)&&n.delete(t)}function rI(){em=!1,mi!==null&&Yu(mi)&&(mi=null),gi!==null&&Yu(gi)&&(gi=null),vi!==null&&Yu(vi)&&(vi=null),ql.forEach(E0),Gl.forEach(E0)}function dl(e,t){e.blockedOn===t&&(e.blockedOn=null,em||(em=!0,or.unstable_scheduleCallback(or.unstable_NormalPriority,rI)))}function Ql(e){function t(o){return dl(o,e)}if(0<Tu.length){dl(Tu[0],e);for(var n=1;n<Tu.length;n++){var r=Tu[n];r.blockedOn===e&&(r.blockedOn=null)}}for(mi!==null&&dl(mi,e),gi!==null&&dl(gi,e),vi!==null&&dl(vi,e),ql.forEach(t),Gl.forEach(t),n=0;n<ai.length;n++)r=ai[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<ai.length&&(n=ai[0],n.blockedOn===null);)fj(n),n.blockedOn===null&&ai.shift()}var va=Fo.ReactCurrentBatchConfig,xd=!0;function oI(e,t,n,r){var o=it,i=va.transition;va.transition=null;try{it=1,Lg(e,t,n,r)}finally{it=o,va.transition=i}}function iI(e,t,n,r){var o=it,i=va.transition;va.transition=null;try{it=4,Lg(e,t,n,r)}finally{it=o,va.transition=i}}function Lg(e,t,n,r){if(xd){var o=tm(e,t,n,r);if(o===null)Zh(e,t,r,wd,n),C0(e,r);else if(nI(o,e,t,n,r))r.stopPropagation();else if(C0(e,r),t&4&&-1<tI.indexOf(e)){for(;o!==null;){var i=Rc(o);if(i!==null&&lj(i),i=tm(e,t,n,r),i===null&&Zh(e,t,r,wd,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else Zh(e,t,r,null,n)}}var wd=null;function tm(e,t,n,r){if(wd=null,e=Ng(r),e=Qi(e),e!==null)if(t=Ss(e),t===null)e=null;else if(n=t.tag,n===13){if(e=ej(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 wd=e,null}function hj(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(qD()){case Mg:return 1;case oj:return 4;case vd:case GD:return 16;case ij:return 536870912;default:return 16}default:return 16}}var fi=null,Fg=null,Xu=null;function pj(){if(Xu)return Xu;var e,t=Fg,n=t.length,r,o="value"in fi?fi.value:fi.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 Xu=o.slice(e,1<r?1-r:void 0)}function Ju(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 ku(){return!0}function P0(){return!1}function lr(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)?ku:P0,this.isPropagationStopped=P0,this}return Mt(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=ku)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ku)},persist:function(){},isPersistent:ku}),t}var Ha={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zg=lr(Ha),kc=Mt({},Ha,{view:0,detail:0}),sI=lr(kc),Hh,Wh,fl,pf=Mt({},kc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Vg,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!==fl&&(fl&&e.type==="mousemove"?(Hh=e.screenX-fl.screenX,Wh=e.screenY-fl.screenY):Wh=Hh=0,fl=e),Hh)},movementY:function(e){return"movementY"in e?e.movementY:Wh}}),T0=lr(pf),aI=Mt({},pf,{dataTransfer:0}),lI=lr(aI),cI=Mt({},kc,{relatedTarget:0}),qh=lr(cI),uI=Mt({},Ha,{animationName:0,elapsedTime:0,pseudoElement:0}),dI=lr(uI),fI=Mt({},Ha,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),hI=lr(fI),pI=Mt({},Ha,{data:0}),k0=lr(pI),mI={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},gI={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"},vI={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function yI(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vI[e])?!!t[e]:!1}function Vg(){return yI}var xI=Mt({},kc,{key:function(e){if(e.key){var t=mI[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ju(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?gI[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Vg,charCode:function(e){return e.type==="keypress"?Ju(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ju(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wI=lr(xI),SI=Mt({},pf,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),R0=lr(SI),bI=Mt({},kc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Vg}),jI=lr(bI),CI=Mt({},Ha,{propertyName:0,elapsedTime:0,pseudoElement:0}),EI=lr(CI),PI=Mt({},pf,{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}),TI=lr(PI),kI=[9,13,27,32],Bg=To&&"CompositionEvent"in window,Il=null;To&&"documentMode"in document&&(Il=document.documentMode);var RI=To&&"TextEvent"in window&&!Il,mj=To&&(!Bg||Il&&8<Il&&11>=Il),_0=" ",D0=!1;function gj(e,t){switch(e){case"keyup":return kI.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vj(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Zs=!1;function _I(e,t){switch(e){case"compositionend":return vj(t);case"keypress":return t.which!==32?null:(D0=!0,_0);case"textInput":return e=t.data,e===_0&&D0?null:e;default:return null}}function DI(e,t){if(Zs)return e==="compositionend"||!Bg&&gj(e,t)?(e=pj(),Xu=Fg=fi=null,Zs=!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 mj&&t.locale!=="ko"?null:t.data;default:return null}}var II={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 I0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!II[e.type]:t==="textarea"}function yj(e,t,n,r){Kb(r),t=Sd(t,"onChange"),0<t.length&&(n=new zg("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Al=null,Kl=null;function AI(e){Rj(e,0)}function mf(e){var t=na(e);if(Bb(t))return e}function NI(e,t){if(e==="change")return t}var xj=!1;if(To){var Gh;if(To){var Qh="oninput"in document;if(!Qh){var A0=document.createElement("div");A0.setAttribute("oninput","return;"),Qh=typeof A0.oninput=="function"}Gh=Qh}else Gh=!1;xj=Gh&&(!document.documentMode||9<document.documentMode)}function N0(){Al&&(Al.detachEvent("onpropertychange",wj),Kl=Al=null)}function wj(e){if(e.propertyName==="value"&&mf(Kl)){var t=[];yj(t,Kl,e,Ng(e)),Zb(AI,t)}}function MI(e,t,n){e==="focusin"?(N0(),Al=t,Kl=n,Al.attachEvent("onpropertychange",wj)):e==="focusout"&&N0()}function OI(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return mf(Kl)}function $I(e,t){if(e==="click")return mf(t)}function LI(e,t){if(e==="input"||e==="change")return mf(t)}function FI(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Vr=typeof Object.is=="function"?Object.is:FI;function Yl(e,t){if(Vr(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(!$p.call(t,o)||!Vr(e[o],t[o]))return!1}return!0}function M0(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function O0(e,t){var n=M0(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=M0(n)}}function Sj(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Sj(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bj(){for(var e=window,t=pd();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pd(e.document)}return t}function Ug(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 zI(e){var t=bj(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Sj(n.ownerDocument.documentElement,n)){if(r!==null&&Ug(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=O0(n,i);var a=O0(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 VI=To&&"documentMode"in document&&11>=document.documentMode,ea=null,nm=null,Nl=null,rm=!1;function $0(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;rm||ea==null||ea!==pd(r)||(r=ea,"selectionStart"in r&&Ug(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}),Nl&&Yl(Nl,r)||(Nl=r,r=Sd(nm,"onSelect"),0<r.length&&(t=new zg("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=ea)))}function Ru(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var ta={animationend:Ru("Animation","AnimationEnd"),animationiteration:Ru("Animation","AnimationIteration"),animationstart:Ru("Animation","AnimationStart"),transitionend:Ru("Transition","TransitionEnd")},Kh={},jj={};To&&(jj=document.createElement("div").style,"AnimationEvent"in window||(delete ta.animationend.animation,delete ta.animationiteration.animation,delete ta.animationstart.animation),"TransitionEvent"in window||delete ta.transitionend.transition);function gf(e){if(Kh[e])return Kh[e];if(!ta[e])return e;var t=ta[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in jj)return Kh[e]=t[n];return e}var Cj=gf("animationend"),Ej=gf("animationiteration"),Pj=gf("animationstart"),Tj=gf("transitionend"),kj=new Map,L0="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 Ii(e,t){kj.set(e,t),ws(t,[e])}for(var Yh=0;Yh<L0.length;Yh++){var Xh=L0[Yh],BI=Xh.toLowerCase(),UI=Xh[0].toUpperCase()+Xh.slice(1);Ii(BI,"on"+UI)}Ii(Cj,"onAnimationEnd");Ii(Ej,"onAnimationIteration");Ii(Pj,"onAnimationStart");Ii("dblclick","onDoubleClick");Ii("focusin","onFocus");Ii("focusout","onBlur");Ii(Tj,"onTransitionEnd");ja("onMouseEnter",["mouseout","mouseover"]);ja("onMouseLeave",["mouseout","mouseover"]);ja("onPointerEnter",["pointerout","pointerover"]);ja("onPointerLeave",["pointerout","pointerover"]);ws("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));ws("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));ws("onBeforeInput",["compositionend","keypress","textInput","paste"]);ws("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));ws("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));ws("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Tl="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(" "),HI=new Set("cancel close invalid load scroll toggle".split(" ").concat(Tl));function F0(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,BD(r,t,void 0,e),e.currentTarget=null}function Rj(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;F0(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;F0(o,l,u),i=c}}}if(gd)throw e=Jp,gd=!1,Jp=null,e}function bt(e,t){var n=t[lm];n===void 0&&(n=t[lm]=new Set);var r=e+"__bubble";n.has(r)||(_j(t,e,2,!1),n.add(r))}function Jh(e,t,n){var r=0;t&&(r|=4),_j(n,e,r,t)}var _u="_reactListening"+Math.random().toString(36).slice(2);function Xl(e){if(!e[_u]){e[_u]=!0,$b.forEach(function(n){n!=="selectionchange"&&(HI.has(n)||Jh(n,!1,e),Jh(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_u]||(t[_u]=!0,Jh("selectionchange",!1,t))}}function _j(e,t,n,r){switch(hj(t)){case 1:var o=oI;break;case 4:o=iI;break;default:o=Lg}n=o.bind(null,t,n,e),o=void 0,!Xp||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 Zh(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=Qi(l),a===null)return;if(c=a.tag,c===5||c===6){r=i=a;continue e}l=l.parentNode}}r=r.return}Zb(function(){var u=i,d=Ng(n),f=[];e:{var h=kj.get(e);if(h!==void 0){var m=zg,g=e;switch(e){case"keypress":if(Ju(n)===0)break e;case"keydown":case"keyup":m=wI;break;case"focusin":g="focus",m=qh;break;case"focusout":g="blur",m=qh;break;case"beforeblur":case"afterblur":m=qh;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=T0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=lI;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=jI;break;case Cj:case Ej:case Pj:m=dI;break;case Tj:m=EI;break;case"scroll":m=sI;break;case"wheel":m=TI;break;case"copy":case"cut":case"paste":m=hI;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=R0}var v=(t&4)!==0,S=!v&&e==="scroll",y=v?h!==null?h+"Capture":null:h;v=[];for(var w=u,x;w!==null;){x=w;var b=x.stateNode;if(x.tag===5&&b!==null&&(x=b,y!==null&&(b=Wl(w,y),b!=null&&v.push(Jl(w,b,x)))),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!==Kp&&(g=n.relatedTarget||n.fromElement)&&(Qi(g)||g[ko]))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?Qi(g):null,g!==null&&(S=Ss(g),g!==S||g.tag!==5&&g.tag!==6)&&(g=null)):(m=null,g=u),m!==g)){if(v=T0,b="onMouseLeave",y="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(v=R0,b="onPointerLeave",y="onPointerEnter",w="pointer"),S=m==null?h:na(m),x=g==null?h:na(g),h=new v(b,w+"leave",m,n,d),h.target=S,h.relatedTarget=x,b=null,Qi(d)===u&&(v=new v(y,w+"enter",g,n,d),v.target=x,v.relatedTarget=S,b=v),S=b,m&&g)t:{for(v=m,y=g,w=0,x=v;x;x=Us(x))w++;for(x=0,b=y;b;b=Us(b))x++;for(;0<w-x;)v=Us(v),w--;for(;0<x-w;)y=Us(y),x--;for(;w--;){if(v===y||y!==null&&v===y.alternate)break t;v=Us(v),y=Us(y)}v=null}else v=null;m!==null&&z0(f,h,m,v,!1),g!==null&&S!==null&&z0(f,S,g,v,!0)}}e:{if(h=u?na(u):window,m=h.nodeName&&h.nodeName.toLowerCase(),m==="select"||m==="input"&&h.type==="file")var C=NI;else if(I0(h))if(xj)C=LI;else{C=OI;var E=MI}else(m=h.nodeName)&&m.toLowerCase()==="input"&&(h.type==="checkbox"||h.type==="radio")&&(C=$I);if(C&&(C=C(e,u))){yj(f,C,n,d);break e}E&&E(e,h,u),e==="focusout"&&(E=h._wrapperState)&&E.controlled&&h.type==="number"&&Hp(h,"number",h.value)}switch(E=u?na(u):window,e){case"focusin":(I0(E)||E.contentEditable==="true")&&(ea=E,nm=u,Nl=null);break;case"focusout":Nl=nm=ea=null;break;case"mousedown":rm=!0;break;case"contextmenu":case"mouseup":case"dragend":rm=!1,$0(f,n,d);break;case"selectionchange":if(VI)break;case"keydown":case"keyup":$0(f,n,d)}var j;if(Bg)e:{switch(e){case"compositionstart":var P="onCompositionStart";break e;case"compositionend":P="onCompositionEnd";break e;case"compositionupdate":P="onCompositionUpdate";break e}P=void 0}else Zs?gj(e,n)&&(P="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(P="onCompositionStart");P&&(mj&&n.locale!=="ko"&&(Zs||P!=="onCompositionStart"?P==="onCompositionEnd"&&Zs&&(j=pj()):(fi=d,Fg="value"in fi?fi.value:fi.textContent,Zs=!0)),E=Sd(u,P),0<E.length&&(P=new k0(P,e,null,n,d),f.push({event:P,listeners:E}),j?P.data=j:(j=vj(n),j!==null&&(P.data=j)))),(j=RI?_I(e,n):DI(e,n))&&(u=Sd(u,"onBeforeInput"),0<u.length&&(d=new k0("onBeforeInput","beforeinput",null,n,d),f.push({event:d,listeners:u}),d.data=j))}Rj(f,t)})}function Jl(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Sd(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Wl(e,n),i!=null&&r.unshift(Jl(e,i,o)),i=Wl(e,t),i!=null&&r.push(Jl(e,i,o))),e=e.return}return r}function Us(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function z0(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=Wl(n,i),c!=null&&a.unshift(Jl(n,c,l))):o||(c=Wl(n,i),c!=null&&a.push(Jl(n,c,l)))),n=n.return}a.length!==0&&e.push({event:t,listeners:a})}var WI=/\r\n?/g,qI=/\u0000|\uFFFD/g;function V0(e){return(typeof e=="string"?e:""+e).replace(WI,`
|
|
81
|
+
`).replace(qI,"")}function Du(e,t,n){if(t=V0(t),V0(e)!==t&&n)throw Error(J(425))}function bd(){}var om=null,im=null;function sm(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 am=typeof setTimeout=="function"?setTimeout:void 0,GI=typeof clearTimeout=="function"?clearTimeout:void 0,B0=typeof Promise=="function"?Promise:void 0,QI=typeof queueMicrotask=="function"?queueMicrotask:typeof B0<"u"?function(e){return B0.resolve(null).then(e).catch(KI)}:am;function KI(e){setTimeout(function(){throw e})}function ep(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),Ql(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ql(t)}function yi(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 U0(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 Wa=Math.random().toString(36).slice(2),ro="__reactFiber$"+Wa,Zl="__reactProps$"+Wa,ko="__reactContainer$"+Wa,lm="__reactEvents$"+Wa,YI="__reactListeners$"+Wa,XI="__reactHandles$"+Wa;function Qi(e){var t=e[ro];if(t)return t;for(var n=e.parentNode;n;){if(t=n[ko]||n[ro]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=U0(e);e!==null;){if(n=e[ro])return n;e=U0(e)}return t}e=n,n=e.parentNode}return null}function Rc(e){return e=e[ro]||e[ko],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function na(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(J(33))}function vf(e){return e[Zl]||null}var cm=[],ra=-1;function Ai(e){return{current:e}}function Ct(e){0>ra||(e.current=cm[ra],cm[ra]=null,ra--)}function mt(e,t){ra++,cm[ra]=e.current,e.current=t}var Pi={},bn=Ai(Pi),Bn=Ai(!1),os=Pi;function Ca(e,t){var n=e.type.contextTypes;if(!n)return Pi;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 Un(e){return e=e.childContextTypes,e!=null}function jd(){Ct(Bn),Ct(bn)}function H0(e,t,n){if(bn.current!==Pi)throw Error(J(168));mt(bn,t),mt(Bn,n)}function Dj(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(J(108,MD(e)||"Unknown",o));return Mt({},n,r)}function Cd(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Pi,os=bn.current,mt(bn,e),mt(Bn,Bn.current),!0}function W0(e,t,n){var r=e.stateNode;if(!r)throw Error(J(169));n?(e=Dj(e,t,os),r.__reactInternalMemoizedMergedChildContext=e,Ct(Bn),Ct(bn),mt(bn,e)):Ct(Bn),mt(Bn,n)}var wo=null,yf=!1,tp=!1;function Ij(e){wo===null?wo=[e]:wo.push(e)}function JI(e){yf=!0,Ij(e)}function Ni(){if(!tp&&wo!==null){tp=!0;var e=0,t=it;try{var n=wo;for(it=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}wo=null,yf=!1}catch(o){throw wo!==null&&(wo=wo.slice(e+1)),rj(Mg,Ni),o}finally{it=t,tp=!1}}return null}var oa=[],ia=0,Ed=null,Pd=0,mr=[],gr=0,is=null,So=1,bo="";function Vi(e,t){oa[ia++]=Pd,oa[ia++]=Ed,Ed=e,Pd=t}function Aj(e,t,n){mr[gr++]=So,mr[gr++]=bo,mr[gr++]=is,is=e;var r=So;e=bo;var o=32-Lr(r)-1;r&=~(1<<o),n+=1;var i=32-Lr(t)+o;if(30<i){var a=o-o%5;i=(r&(1<<a)-1).toString(32),r>>=a,o-=a,So=1<<32-Lr(t)+o|n<<o|r,bo=i+e}else So=1<<i|n<<o|r,bo=e}function Hg(e){e.return!==null&&(Vi(e,1),Aj(e,1,0))}function Wg(e){for(;e===Ed;)Ed=oa[--ia],oa[ia]=null,Pd=oa[--ia],oa[ia]=null;for(;e===is;)is=mr[--gr],mr[gr]=null,bo=mr[--gr],mr[gr]=null,So=mr[--gr],mr[gr]=null}var rr=null,er=null,kt=!1,Or=null;function Nj(e,t){var n=yr(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 q0(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,rr=e,er=yi(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,rr=e,er=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=is!==null?{id:So,overflow:bo}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=yr(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,rr=e,er=null,!0):!1;default:return!1}}function um(e){return(e.mode&1)!==0&&(e.flags&128)===0}function dm(e){if(kt){var t=er;if(t){var n=t;if(!q0(e,t)){if(um(e))throw Error(J(418));t=yi(n.nextSibling);var r=rr;t&&q0(e,t)?Nj(r,n):(e.flags=e.flags&-4097|2,kt=!1,rr=e)}}else{if(um(e))throw Error(J(418));e.flags=e.flags&-4097|2,kt=!1,rr=e}}}function G0(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;rr=e}function Iu(e){if(e!==rr)return!1;if(!kt)return G0(e),kt=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!sm(e.type,e.memoizedProps)),t&&(t=er)){if(um(e))throw Mj(),Error(J(418));for(;t;)Nj(e,t),t=yi(t.nextSibling)}if(G0(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(J(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){er=yi(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}er=null}}else er=rr?yi(e.stateNode.nextSibling):null;return!0}function Mj(){for(var e=er;e;)e=yi(e.nextSibling)}function Ea(){er=rr=null,kt=!1}function qg(e){Or===null?Or=[e]:Or.push(e)}var ZI=Fo.ReactCurrentBatchConfig;function Ar(e,t){if(e&&e.defaultProps){t=Mt({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}var Td=Ai(null),kd=null,sa=null,Gg=null;function Qg(){Gg=sa=kd=null}function Kg(e){var t=Td.current;Ct(Td),e._currentValue=t}function fm(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 ya(e,t){kd=e,Gg=sa=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Vn=!0),e.firstContext=null)}function Sr(e){var t=e._currentValue;if(Gg!==e)if(e={context:e,memoizedValue:t,next:null},sa===null){if(kd===null)throw Error(J(308));sa=e,kd.dependencies={lanes:0,firstContext:e}}else sa=sa.next=e;return t}var Ki=null;function Yg(e){Ki===null?Ki=[e]:Ki.push(e)}function Oj(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Yg(t)):(n.next=o.next,o.next=n),t.interleaved=n,Ro(e,r)}function Ro(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 ri=!1;function Xg(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function $j(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 jo(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function xi(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,et&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,Ro(e,n)}return o=r.interleaved,o===null?(t.next=t,Yg(r)):(t.next=o.next,o.next=t),r.interleaved=t,Ro(e,n)}function Zu(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,Og(e,n)}}function Q0(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 Rd(e,t,n,r){var o=e.updateQueue;ri=!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=Mt({},f,h);break e;case 2:ri=!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);as|=a,e.lanes=a,e.memoizedState=f}}function K0(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(J(191,o));o.call(r)}}}var Lj=new Ob.Component().refs;function hm(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:Mt({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xf={isMounted:function(e){return(e=e._reactInternals)?Ss(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=In(),o=Si(e),i=jo(r,o);i.payload=t,n!=null&&(i.callback=n),t=xi(e,i,o),t!==null&&(Fr(t,e,o,r),Zu(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=In(),o=Si(e),i=jo(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xi(e,i,o),t!==null&&(Fr(t,e,o,r),Zu(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=In(),r=Si(e),o=jo(n,r);o.tag=2,t!=null&&(o.callback=t),t=xi(e,o,r),t!==null&&(Fr(t,e,r,n),Zu(t,e,r))}};function Y0(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?!Yl(n,r)||!Yl(o,i):!0}function Fj(e,t,n){var r=!1,o=Pi,i=t.contextType;return typeof i=="object"&&i!==null?i=Sr(i):(o=Un(t)?os:bn.current,r=t.contextTypes,i=(r=r!=null)?Ca(e,o):Pi),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=xf,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function X0(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&&xf.enqueueReplaceState(t,t.state,null)}function pm(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs=Lj,Xg(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Sr(i):(i=Un(t)?os:bn.current,o.context=Ca(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(hm(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&&xf.enqueueReplaceState(o,o.state,null),Rd(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function hl(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(J(309));var r=n.stateNode}if(!r)throw Error(J(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===Lj&&(l=o.refs={}),a===null?delete l[i]:l[i]=a},t._stringRef=i,t)}if(typeof e!="string")throw Error(J(284));if(!n._owner)throw Error(J(290,e))}return e}function Au(e,t){throw e=Object.prototype.toString.call(t),Error(J(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function J0(e){var t=e._init;return t(e._payload)}function zj(e){function t(y,w){if(e){var x=y.deletions;x===null?(y.deletions=[w],y.flags|=16):x.push(w)}}function n(y,w){if(!e)return null;for(;w!==null;)t(y,w),w=w.sibling;return null}function r(y,w){for(y=new Map;w!==null;)w.key!==null?y.set(w.key,w):y.set(w.index,w),w=w.sibling;return y}function o(y,w){return y=bi(y,w),y.index=0,y.sibling=null,y}function i(y,w,x){return y.index=x,e?(x=y.alternate,x!==null?(x=x.index,x<w?(y.flags|=2,w):x):(y.flags|=2,w)):(y.flags|=1048576,w)}function a(y){return e&&y.alternate===null&&(y.flags|=2),y}function l(y,w,x,b){return w===null||w.tag!==6?(w=lp(x,y.mode,b),w.return=y,w):(w=o(w,x),w.return=y,w)}function c(y,w,x,b){var C=x.type;return C===Js?d(y,w,x.props.children,b,x.key):w!==null&&(w.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ni&&J0(C)===w.type)?(b=o(w,x.props),b.ref=hl(y,w,x),b.return=y,b):(b=id(x.type,x.key,x.props,null,y.mode,b),b.ref=hl(y,w,x),b.return=y,b)}function u(y,w,x,b){return w===null||w.tag!==4||w.stateNode.containerInfo!==x.containerInfo||w.stateNode.implementation!==x.implementation?(w=cp(x,y.mode,b),w.return=y,w):(w=o(w,x.children||[]),w.return=y,w)}function d(y,w,x,b,C){return w===null||w.tag!==7?(w=ns(x,y.mode,b,C),w.return=y,w):(w=o(w,x),w.return=y,w)}function f(y,w,x){if(typeof w=="string"&&w!==""||typeof w=="number")return w=lp(""+w,y.mode,x),w.return=y,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case bu:return x=id(w.type,w.key,w.props,null,y.mode,x),x.ref=hl(y,null,w),x.return=y,x;case Xs:return w=cp(w,y.mode,x),w.return=y,w;case ni:var b=w._init;return f(y,b(w._payload),x)}if(El(w)||ll(w))return w=ns(w,y.mode,x,null),w.return=y,w;Au(y,w)}return null}function h(y,w,x,b){var C=w!==null?w.key:null;if(typeof x=="string"&&x!==""||typeof x=="number")return C!==null?null:l(y,w,""+x,b);if(typeof x=="object"&&x!==null){switch(x.$$typeof){case bu:return x.key===C?c(y,w,x,b):null;case Xs:return x.key===C?u(y,w,x,b):null;case ni:return C=x._init,h(y,w,C(x._payload),b)}if(El(x)||ll(x))return C!==null?null:d(y,w,x,b,null);Au(y,x)}return null}function m(y,w,x,b,C){if(typeof b=="string"&&b!==""||typeof b=="number")return y=y.get(x)||null,l(w,y,""+b,C);if(typeof b=="object"&&b!==null){switch(b.$$typeof){case bu:return y=y.get(b.key===null?x:b.key)||null,c(w,y,b,C);case Xs:return y=y.get(b.key===null?x:b.key)||null,u(w,y,b,C);case ni:var E=b._init;return m(y,w,x,E(b._payload),C)}if(El(b)||ll(b))return y=y.get(x)||null,d(w,y,b,C,null);Au(w,b)}return null}function g(y,w,x,b){for(var C=null,E=null,j=w,P=w=0,_=null;j!==null&&P<x.length;P++){j.index>P?(_=j,j=null):_=j.sibling;var R=h(y,j,x[P],b);if(R===null){j===null&&(j=_);break}e&&j&&R.alternate===null&&t(y,j),w=i(R,w,P),E===null?C=R:E.sibling=R,E=R,j=_}if(P===x.length)return n(y,j),kt&&Vi(y,P),C;if(j===null){for(;P<x.length;P++)j=f(y,x[P],b),j!==null&&(w=i(j,w,P),E===null?C=j:E.sibling=j,E=j);return kt&&Vi(y,P),C}for(j=r(y,j);P<x.length;P++)_=m(j,y,P,x[P],b),_!==null&&(e&&_.alternate!==null&&j.delete(_.key===null?P:_.key),w=i(_,w,P),E===null?C=_:E.sibling=_,E=_);return e&&j.forEach(function(M){return t(y,M)}),kt&&Vi(y,P),C}function v(y,w,x,b){var C=ll(x);if(typeof C!="function")throw Error(J(150));if(x=C.call(x),x==null)throw Error(J(151));for(var E=C=null,j=w,P=w=0,_=null,R=x.next();j!==null&&!R.done;P++,R=x.next()){j.index>P?(_=j,j=null):_=j.sibling;var M=h(y,j,R.value,b);if(M===null){j===null&&(j=_);break}e&&j&&M.alternate===null&&t(y,j),w=i(M,w,P),E===null?C=M:E.sibling=M,E=M,j=_}if(R.done)return n(y,j),kt&&Vi(y,P),C;if(j===null){for(;!R.done;P++,R=x.next())R=f(y,R.value,b),R!==null&&(w=i(R,w,P),E===null?C=R:E.sibling=R,E=R);return kt&&Vi(y,P),C}for(j=r(y,j);!R.done;P++,R=x.next())R=m(j,y,P,R.value,b),R!==null&&(e&&R.alternate!==null&&j.delete(R.key===null?P:R.key),w=i(R,w,P),E===null?C=R:E.sibling=R,E=R);return e&&j.forEach(function(D){return t(y,D)}),kt&&Vi(y,P),C}function S(y,w,x,b){if(typeof x=="object"&&x!==null&&x.type===Js&&x.key===null&&(x=x.props.children),typeof x=="object"&&x!==null){switch(x.$$typeof){case bu:e:{for(var C=x.key,E=w;E!==null;){if(E.key===C){if(C=x.type,C===Js){if(E.tag===7){n(y,E.sibling),w=o(E,x.props.children),w.return=y,y=w;break e}}else if(E.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===ni&&J0(C)===E.type){n(y,E.sibling),w=o(E,x.props),w.ref=hl(y,E,x),w.return=y,y=w;break e}n(y,E);break}else t(y,E);E=E.sibling}x.type===Js?(w=ns(x.props.children,y.mode,b,x.key),w.return=y,y=w):(b=id(x.type,x.key,x.props,null,y.mode,b),b.ref=hl(y,w,x),b.return=y,y=b)}return a(y);case Xs:e:{for(E=x.key;w!==null;){if(w.key===E)if(w.tag===4&&w.stateNode.containerInfo===x.containerInfo&&w.stateNode.implementation===x.implementation){n(y,w.sibling),w=o(w,x.children||[]),w.return=y,y=w;break e}else{n(y,w);break}else t(y,w);w=w.sibling}w=cp(x,y.mode,b),w.return=y,y=w}return a(y);case ni:return E=x._init,S(y,w,E(x._payload),b)}if(El(x))return g(y,w,x,b);if(ll(x))return v(y,w,x,b);Au(y,x)}return typeof x=="string"&&x!==""||typeof x=="number"?(x=""+x,w!==null&&w.tag===6?(n(y,w.sibling),w=o(w,x),w.return=y,y=w):(n(y,w),w=lp(x,y.mode,b),w.return=y,y=w),a(y)):n(y,w)}return S}var Pa=zj(!0),Vj=zj(!1),_c={},io=Ai(_c),ec=Ai(_c),tc=Ai(_c);function Yi(e){if(e===_c)throw Error(J(174));return e}function Jg(e,t){switch(mt(tc,t),mt(ec,e),mt(io,_c),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:qp(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=qp(t,e)}Ct(io),mt(io,t)}function Ta(){Ct(io),Ct(ec),Ct(tc)}function Bj(e){Yi(tc.current);var t=Yi(io.current),n=qp(t,e.type);t!==n&&(mt(ec,e),mt(io,n))}function Zg(e){ec.current===e&&(Ct(io),Ct(ec))}var At=Ai(0);function _d(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 np=[];function ev(){for(var e=0;e<np.length;e++)np[e]._workInProgressVersionPrimary=null;np.length=0}var ed=Fo.ReactCurrentDispatcher,rp=Fo.ReactCurrentBatchConfig,ss=0,Nt=null,Xt=null,tn=null,Dd=!1,Ml=!1,nc=0,eA=0;function vn(){throw Error(J(321))}function tv(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Vr(e[n],t[n]))return!1;return!0}function nv(e,t,n,r,o,i){if(ss=i,Nt=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ed.current=e===null||e.memoizedState===null?oA:iA,e=n(r,o),Ml){i=0;do{if(Ml=!1,nc=0,25<=i)throw Error(J(301));i+=1,tn=Xt=null,t.updateQueue=null,ed.current=sA,e=n(r,o)}while(Ml)}if(ed.current=Id,t=Xt!==null&&Xt.next!==null,ss=0,tn=Xt=Nt=null,Dd=!1,t)throw Error(J(300));return e}function rv(){var e=nc!==0;return nc=0,e}function eo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tn===null?Nt.memoizedState=tn=e:tn=tn.next=e,tn}function br(){if(Xt===null){var e=Nt.alternate;e=e!==null?e.memoizedState:null}else e=Xt.next;var t=tn===null?Nt.memoizedState:tn.next;if(t!==null)tn=t,Xt=e;else{if(e===null)throw Error(J(310));Xt=e,e={memoizedState:Xt.memoizedState,baseState:Xt.baseState,baseQueue:Xt.baseQueue,queue:Xt.queue,next:null},tn===null?Nt.memoizedState=tn=e:tn=tn.next=e}return tn}function rc(e,t){return typeof t=="function"?t(e):t}function op(e){var t=br(),n=t.queue;if(n===null)throw Error(J(311));n.lastRenderedReducer=e;var r=Xt,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((ss&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,Nt.lanes|=d,as|=d}u=u.next}while(u!==null&&u!==i);c===null?a=r:c.next=l,Vr(r,t.memoizedState)||(Vn=!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,Nt.lanes|=i,as|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function ip(e){var t=br(),n=t.queue;if(n===null)throw Error(J(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);Vr(i,t.memoizedState)||(Vn=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Uj(){}function Hj(e,t){var n=Nt,r=br(),o=t(),i=!Vr(r.memoizedState,o);if(i&&(r.memoizedState=o,Vn=!0),r=r.queue,ov(Gj.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||tn!==null&&tn.memoizedState.tag&1){if(n.flags|=2048,oc(9,qj.bind(null,n,r,o,t),void 0,null),on===null)throw Error(J(349));ss&30||Wj(n,t,o)}return o}function Wj(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=Nt.updateQueue,t===null?(t={lastEffect:null,stores:null},Nt.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function qj(e,t,n,r){t.value=n,t.getSnapshot=r,Qj(t)&&Kj(e)}function Gj(e,t,n){return n(function(){Qj(t)&&Kj(e)})}function Qj(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Vr(e,n)}catch{return!0}}function Kj(e){var t=Ro(e,1);t!==null&&Fr(t,e,1,-1)}function Z0(e){var t=eo();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:rc,lastRenderedState:e},t.queue=e,e=e.dispatch=rA.bind(null,Nt,e),[t.memoizedState,e]}function oc(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=Nt.updateQueue,t===null?(t={lastEffect:null,stores:null},Nt.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 Yj(){return br().memoizedState}function td(e,t,n,r){var o=eo();Nt.flags|=e,o.memoizedState=oc(1|t,n,void 0,r===void 0?null:r)}function wf(e,t,n,r){var o=br();r=r===void 0?null:r;var i=void 0;if(Xt!==null){var a=Xt.memoizedState;if(i=a.destroy,r!==null&&tv(r,a.deps)){o.memoizedState=oc(t,n,i,r);return}}Nt.flags|=e,o.memoizedState=oc(1|t,n,i,r)}function e1(e,t){return td(8390656,8,e,t)}function ov(e,t){return wf(2048,8,e,t)}function Xj(e,t){return wf(4,2,e,t)}function Jj(e,t){return wf(4,4,e,t)}function Zj(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 eC(e,t,n){return n=n!=null?n.concat([e]):null,wf(4,4,Zj.bind(null,t,e),n)}function iv(){}function tC(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tv(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function nC(e,t){var n=br();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&tv(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function rC(e,t,n){return ss&21?(Vr(n,t)||(n=sj(),Nt.lanes|=n,as|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Vn=!0),e.memoizedState=n)}function tA(e,t){var n=it;it=n!==0&&4>n?n:4,e(!0);var r=rp.transition;rp.transition={};try{e(!1),t()}finally{it=n,rp.transition=r}}function oC(){return br().memoizedState}function nA(e,t,n){var r=Si(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},iC(e))sC(t,n);else if(n=Oj(e,t,n,r),n!==null){var o=In();Fr(n,e,r,o),aC(n,t,r)}}function rA(e,t,n){var r=Si(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(iC(e))sC(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,Vr(l,a)){var c=t.interleaved;c===null?(o.next=o,Yg(t)):(o.next=c.next,c.next=o),t.interleaved=o;return}}catch{}finally{}n=Oj(e,t,o,r),n!==null&&(o=In(),Fr(n,e,r,o),aC(n,t,r))}}function iC(e){var t=e.alternate;return e===Nt||t!==null&&t===Nt}function sC(e,t){Ml=Dd=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function aC(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Og(e,n)}}var Id={readContext:Sr,useCallback:vn,useContext:vn,useEffect:vn,useImperativeHandle:vn,useInsertionEffect:vn,useLayoutEffect:vn,useMemo:vn,useReducer:vn,useRef:vn,useState:vn,useDebugValue:vn,useDeferredValue:vn,useTransition:vn,useMutableSource:vn,useSyncExternalStore:vn,useId:vn,unstable_isNewReconciler:!1},oA={readContext:Sr,useCallback:function(e,t){return eo().memoizedState=[e,t===void 0?null:t],e},useContext:Sr,useEffect:e1,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,td(4194308,4,Zj.bind(null,t,e),n)},useLayoutEffect:function(e,t){return td(4194308,4,e,t)},useInsertionEffect:function(e,t){return td(4,2,e,t)},useMemo:function(e,t){var n=eo();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=eo();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=nA.bind(null,Nt,e),[r.memoizedState,e]},useRef:function(e){var t=eo();return e={current:e},t.memoizedState=e},useState:Z0,useDebugValue:iv,useDeferredValue:function(e){return eo().memoizedState=e},useTransition:function(){var e=Z0(!1),t=e[0];return e=tA.bind(null,e[1]),eo().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=Nt,o=eo();if(kt){if(n===void 0)throw Error(J(407));n=n()}else{if(n=t(),on===null)throw Error(J(349));ss&30||Wj(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,e1(Gj.bind(null,r,i,e),[e]),r.flags|=2048,oc(9,qj.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=eo(),t=on.identifierPrefix;if(kt){var n=bo,r=So;n=(r&~(1<<32-Lr(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=nc++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=eA++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},iA={readContext:Sr,useCallback:tC,useContext:Sr,useEffect:ov,useImperativeHandle:eC,useInsertionEffect:Xj,useLayoutEffect:Jj,useMemo:nC,useReducer:op,useRef:Yj,useState:function(){return op(rc)},useDebugValue:iv,useDeferredValue:function(e){var t=br();return rC(t,Xt.memoizedState,e)},useTransition:function(){var e=op(rc)[0],t=br().memoizedState;return[e,t]},useMutableSource:Uj,useSyncExternalStore:Hj,useId:oC,unstable_isNewReconciler:!1},sA={readContext:Sr,useCallback:tC,useContext:Sr,useEffect:ov,useImperativeHandle:eC,useInsertionEffect:Xj,useLayoutEffect:Jj,useMemo:nC,useReducer:ip,useRef:Yj,useState:function(){return ip(rc)},useDebugValue:iv,useDeferredValue:function(e){var t=br();return Xt===null?t.memoizedState=e:rC(t,Xt.memoizedState,e)},useTransition:function(){var e=ip(rc)[0],t=br().memoizedState;return[e,t]},useMutableSource:Uj,useSyncExternalStore:Hj,useId:oC,unstable_isNewReconciler:!1};function ka(e,t){try{var n="",r=t;do n+=ND(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 sp(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function mm(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var aA=typeof WeakMap=="function"?WeakMap:Map;function lC(e,t,n){n=jo(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Nd||(Nd=!0,Em=r),mm(e,t)},n}function cC(e,t,n){n=jo(-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(){mm(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){mm(e,t),typeof r!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var a=t.stack;this.componentDidCatch(t.value,{componentStack:a!==null?a:""})}),n}function t1(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new aA;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=SA.bind(null,e,t,n),t.then(e,e))}function n1(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 r1(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=jo(-1,1),t.tag=2,xi(n,t,1))),n.lanes|=1),e)}var lA=Fo.ReactCurrentOwner,Vn=!1;function kn(e,t,n,r){t.child=e===null?Vj(t,null,n,r):Pa(t,e.child,n,r)}function o1(e,t,n,r,o){n=n.render;var i=t.ref;return ya(t,o),r=nv(e,t,n,r,i,o),n=rv(),e!==null&&!Vn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,_o(e,t,o)):(kt&&n&&Hg(t),t.flags|=1,kn(e,t,r,o),t.child)}function i1(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!hv(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,uC(e,t,i,r,o)):(e=id(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:Yl,n(a,r)&&e.ref===t.ref)return _o(e,t,o)}return t.flags|=1,e=bi(i,r),e.ref=t.ref,e.return=t,t.child=e}function uC(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Yl(i,r)&&e.ref===t.ref)if(Vn=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(Vn=!0);else return t.lanes=e.lanes,_o(e,t,o)}return gm(e,t,n,r,o)}function dC(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},mt(la,Jn),Jn|=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,mt(la,Jn),Jn|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,mt(la,Jn),Jn|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,mt(la,Jn),Jn|=r;return kn(e,t,o,n),t.child}function fC(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function gm(e,t,n,r,o){var i=Un(n)?os:bn.current;return i=Ca(t,i),ya(t,o),n=nv(e,t,n,r,i,o),r=rv(),e!==null&&!Vn?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,_o(e,t,o)):(kt&&r&&Hg(t),t.flags|=1,kn(e,t,n,o),t.child)}function s1(e,t,n,r,o){if(Un(n)){var i=!0;Cd(t)}else i=!1;if(ya(t,o),t.stateNode===null)nd(e,t),Fj(t,n,r),pm(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=Sr(u):(u=Un(n)?os:bn.current,u=Ca(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)&&X0(t,a,r,u),ri=!1;var h=t.memoizedState;a.state=h,Rd(t,r,a,o),c=t.memoizedState,l!==r||h!==c||Bn.current||ri?(typeof d=="function"&&(hm(t,n,d,r),c=t.memoizedState),(l=ri||Y0(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,$j(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:Ar(t.type,l),a.props=u,f=t.pendingProps,h=a.context,c=n.contextType,typeof c=="object"&&c!==null?c=Sr(c):(c=Un(n)?os:bn.current,c=Ca(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)&&X0(t,a,r,c),ri=!1,h=t.memoizedState,a.state=h,Rd(t,r,a,o);var g=t.memoizedState;l!==f||h!==g||Bn.current||ri?(typeof m=="function"&&(hm(t,n,m,r),g=t.memoizedState),(u=ri||Y0(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 vm(e,t,n,r,i,o)}function vm(e,t,n,r,o,i){fC(e,t);var a=(t.flags&128)!==0;if(!r&&!a)return o&&W0(t,n,!1),_o(e,t,i);r=t.stateNode,lA.current=t;var l=a&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&a?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,l,i)):kn(e,t,l,i),t.memoizedState=r.state,o&&W0(t,n,!0),t.child}function hC(e){var t=e.stateNode;t.pendingContext?H0(e,t.pendingContext,t.pendingContext!==t.context):t.context&&H0(e,t.context,!1),Jg(e,t.containerInfo)}function a1(e,t,n,r,o){return Ea(),qg(o),t.flags|=256,kn(e,t,n,r),t.child}var ym={dehydrated:null,treeContext:null,retryLane:0};function xm(e){return{baseLanes:e,cachePool:null,transitions:null}}function pC(e,t,n){var r=t.pendingProps,o=At.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),mt(At,o&1),e===null)return dm(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=jf(a,r,0,null),e=ns(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=xm(n),t.memoizedState=ym,e):sv(t,a));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return cA(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=bi(o,c),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=bi(l,i):(i=ns(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?xm(n):{baseLanes:a.baseLanes|n,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=e.childLanes&~n,t.memoizedState=ym,r}return i=e.child,e=i.sibling,r=bi(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 sv(e,t){return t=jf({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Nu(e,t,n,r){return r!==null&&qg(r),Pa(t,e.child,null,n),e=sv(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function cA(e,t,n,r,o,i,a){if(n)return t.flags&256?(t.flags&=-257,r=sp(Error(J(422))),Nu(e,t,a,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=jf({mode:"visible",children:r.children},o,0,null),i=ns(i,o,a,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Pa(t,e.child,null,a),t.child.memoizedState=xm(a),t.memoizedState=ym,i);if(!(t.mode&1))return Nu(e,t,a,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(J(419)),r=sp(i,r,void 0),Nu(e,t,a,r)}if(l=(a&e.childLanes)!==0,Vn||l){if(r=on,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,Ro(e,o),Fr(r,e,o,-1))}return fv(),r=sp(Error(J(421))),Nu(e,t,a,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=bA.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,er=yi(o.nextSibling),rr=t,kt=!0,Or=null,e!==null&&(mr[gr++]=So,mr[gr++]=bo,mr[gr++]=is,So=e.id,bo=e.overflow,is=t),t=sv(t,r.children),t.flags|=4096,t)}function l1(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fm(e.return,t,n)}function ap(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 mC(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(kn(e,t,r.children,n),r=At.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&&l1(e,n,t);else if(e.tag===19)l1(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(mt(At,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&&_d(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),ap(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&&_d(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}ap(t,!0,n,null,i);break;case"together":ap(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function nd(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function _o(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),as|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(J(153));if(t.child!==null){for(e=t.child,n=bi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=bi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function uA(e,t,n){switch(t.tag){case 3:hC(t),Ea();break;case 5:Bj(t);break;case 1:Un(t.type)&&Cd(t);break;case 4:Jg(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;mt(Td,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(mt(At,At.current&1),t.flags|=128,null):n&t.child.childLanes?pC(e,t,n):(mt(At,At.current&1),e=_o(e,t,n),e!==null?e.sibling:null);mt(At,At.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return mC(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),mt(At,At.current),r)break;return null;case 22:case 23:return t.lanes=0,dC(e,t,n)}return _o(e,t,n)}var gC,wm,vC,yC;gC=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}};wm=function(){};vC=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Yi(io.current);var i=null;switch(n){case"input":o=Bp(e,o),r=Bp(e,r),i=[];break;case"select":o=Mt({},o,{value:void 0}),r=Mt({},r,{value:void 0}),i=[];break;case"textarea":o=Wp(e,o),r=Wp(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=bd)}Gp(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"&&(Ul.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"&&(Ul.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&bt("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)}};yC=function(e,t,n,r){n!==r&&(t.flags|=4)};function pl(e,t){if(!kt)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 yn(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 dA(e,t,n){var r=t.pendingProps;switch(Wg(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return yn(t),null;case 1:return Un(t.type)&&jd(),yn(t),null;case 3:return r=t.stateNode,Ta(),Ct(Bn),Ct(bn),ev(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Iu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Or!==null&&(km(Or),Or=null))),wm(e,t),yn(t),null;case 5:Zg(t);var o=Yi(tc.current);if(n=t.type,e!==null&&t.stateNode!=null)vC(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(J(166));return yn(t),null}if(e=Yi(io.current),Iu(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[ro]=t,r[Zl]=i,e=(t.mode&1)!==0,n){case"dialog":bt("cancel",r),bt("close",r);break;case"iframe":case"object":case"embed":bt("load",r);break;case"video":case"audio":for(o=0;o<Tl.length;o++)bt(Tl[o],r);break;case"source":bt("error",r);break;case"img":case"image":case"link":bt("error",r),bt("load",r);break;case"details":bt("toggle",r);break;case"input":v0(r,i),bt("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},bt("invalid",r);break;case"textarea":x0(r,i),bt("invalid",r)}Gp(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&&Du(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Du(r.textContent,l,e),o=["children",""+l]):Ul.hasOwnProperty(a)&&l!=null&&a==="onScroll"&&bt("scroll",r)}switch(n){case"input":ju(r),y0(r,i,!0);break;case"textarea":ju(r),w0(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=bd)}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=Wb(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[ro]=t,e[Zl]=r,gC(e,t,!1,!1),t.stateNode=e;e:{switch(a=Qp(n,r),n){case"dialog":bt("cancel",e),bt("close",e),o=r;break;case"iframe":case"object":case"embed":bt("load",e),o=r;break;case"video":case"audio":for(o=0;o<Tl.length;o++)bt(Tl[o],e);o=r;break;case"source":bt("error",e),o=r;break;case"img":case"image":case"link":bt("error",e),bt("load",e),o=r;break;case"details":bt("toggle",e),o=r;break;case"input":v0(e,r),o=Bp(e,r),bt("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=Mt({},r,{value:void 0}),bt("invalid",e);break;case"textarea":x0(e,r),o=Wp(e,r),bt("invalid",e);break;default:o=r}Gp(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?Qb(e,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&qb(e,c)):i==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&Hl(e,c):typeof c=="number"&&Hl(e,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Ul.hasOwnProperty(i)?c!=null&&i==="onScroll"&&bt("scroll",e):c!=null&&_g(e,i,c,a))}switch(n){case"input":ju(e),y0(e,r,!1);break;case"textarea":ju(e),w0(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Ei(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?pa(e,!!r.multiple,i,!1):r.defaultValue!=null&&pa(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=bd)}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 yn(t),null;case 6:if(e&&t.stateNode!=null)yC(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(J(166));if(n=Yi(tc.current),Yi(io.current),Iu(t)){if(r=t.stateNode,n=t.memoizedProps,r[ro]=t,(i=r.nodeValue!==n)&&(e=rr,e!==null))switch(e.tag){case 3:Du(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Du(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ro]=t,t.stateNode=r}return yn(t),null;case 13:if(Ct(At),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(kt&&er!==null&&t.mode&1&&!(t.flags&128))Mj(),Ea(),t.flags|=98560,i=!1;else if(i=Iu(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(J(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(J(317));i[ro]=t}else Ea(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;yn(t),i=!1}else Or!==null&&(km(Or),Or=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||At.current&1?Jt===0&&(Jt=3):fv())),t.updateQueue!==null&&(t.flags|=4),yn(t),null);case 4:return Ta(),wm(e,t),e===null&&Xl(t.stateNode.containerInfo),yn(t),null;case 10:return Kg(t.type._context),yn(t),null;case 17:return Un(t.type)&&jd(),yn(t),null;case 19:if(Ct(At),i=t.memoizedState,i===null)return yn(t),null;if(r=(t.flags&128)!==0,a=i.rendering,a===null)if(r)pl(i,!1);else{if(Jt!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(a=_d(e),a!==null){for(t.flags|=128,pl(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 mt(At,At.current&1|2),t.child}e=e.sibling}i.tail!==null&&Ut()>Ra&&(t.flags|=128,r=!0,pl(i,!1),t.lanes=4194304)}else{if(!r)if(e=_d(a),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),pl(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!kt)return yn(t),null}else 2*Ut()-i.renderingStartTime>Ra&&n!==1073741824&&(t.flags|=128,r=!0,pl(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=Ut(),t.sibling=null,n=At.current,mt(At,r?n&1|2:n&1),t):(yn(t),null);case 22:case 23:return dv(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Jn&1073741824&&(yn(t),t.subtreeFlags&6&&(t.flags|=8192)):yn(t),null;case 24:return null;case 25:return null}throw Error(J(156,t.tag))}function fA(e,t){switch(Wg(t),t.tag){case 1:return Un(t.type)&&jd(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ta(),Ct(Bn),Ct(bn),ev(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Zg(t),null;case 13:if(Ct(At),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(J(340));Ea()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Ct(At),null;case 4:return Ta(),null;case 10:return Kg(t.type._context),null;case 22:case 23:return dv(),null;case 24:return null;default:return null}}var Mu=!1,xn=!1,hA=typeof WeakSet=="function"?WeakSet:Set,ge=null;function aa(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){Lt(e,t,r)}else n.current=null}function Sm(e,t,n){try{n()}catch(r){Lt(e,t,r)}}var c1=!1;function pA(e,t){if(om=xd,e=bj(),Ug(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(im={focusedElem:e,selectionRange:n},xd=!1,ge=t;ge!==null;)if(t=ge,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ge=e;else for(;ge!==null;){t=ge;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,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?v:Ar(t.type,v),S);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var x=t.stateNode.containerInfo;x.nodeType===1?x.textContent="":x.nodeType===9&&x.documentElement&&x.removeChild(x.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(J(163))}}catch(b){Lt(t,t.return,b)}if(e=t.sibling,e!==null){e.return=t.return,ge=e;break}ge=t.return}return g=c1,c1=!1,g}function Ol(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&&Sm(t,n,i)}o=o.next}while(o!==r)}}function Sf(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 bm(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 xC(e){var t=e.alternate;t!==null&&(e.alternate=null,xC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ro],delete t[Zl],delete t[lm],delete t[YI],delete t[XI])),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 wC(e){return e.tag===5||e.tag===3||e.tag===4}function u1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wC(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 jm(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=bd));else if(r!==4&&(e=e.child,e!==null))for(jm(e,t,n),e=e.sibling;e!==null;)jm(e,t,n),e=e.sibling}function Cm(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(Cm(e,t,n),e=e.sibling;e!==null;)Cm(e,t,n),e=e.sibling}var cn=null,Nr=!1;function ei(e,t,n){for(n=n.child;n!==null;)SC(e,t,n),n=n.sibling}function SC(e,t,n){if(oo&&typeof oo.onCommitFiberUnmount=="function")try{oo.onCommitFiberUnmount(hf,n)}catch{}switch(n.tag){case 5:xn||aa(n,t);case 6:var r=cn,o=Nr;cn=null,ei(e,t,n),cn=r,Nr=o,cn!==null&&(Nr?(e=cn,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):cn.removeChild(n.stateNode));break;case 18:cn!==null&&(Nr?(e=cn,n=n.stateNode,e.nodeType===8?ep(e.parentNode,n):e.nodeType===1&&ep(e,n),Ql(e)):ep(cn,n.stateNode));break;case 4:r=cn,o=Nr,cn=n.stateNode.containerInfo,Nr=!0,ei(e,t,n),cn=r,Nr=o;break;case 0:case 11:case 14:case 15:if(!xn&&(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)&&Sm(n,t,a),o=o.next}while(o!==r)}ei(e,t,n);break;case 1:if(!xn&&(aa(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){Lt(n,t,l)}ei(e,t,n);break;case 21:ei(e,t,n);break;case 22:n.mode&1?(xn=(r=xn)||n.memoizedState!==null,ei(e,t,n),xn=r):ei(e,t,n);break;default:ei(e,t,n)}}function d1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new hA),t.forEach(function(r){var o=jA.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function _r(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:cn=l.stateNode,Nr=!1;break e;case 3:cn=l.stateNode.containerInfo,Nr=!0;break e;case 4:cn=l.stateNode.containerInfo,Nr=!0;break e}l=l.return}if(cn===null)throw Error(J(160));SC(i,a,o),cn=null,Nr=!1;var c=o.alternate;c!==null&&(c.return=null),o.return=null}catch(u){Lt(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)bC(t,e),t=t.sibling}function bC(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(_r(t,e),Xr(e),r&4){try{Ol(3,e,e.return),Sf(3,e)}catch(v){Lt(e,e.return,v)}try{Ol(5,e,e.return)}catch(v){Lt(e,e.return,v)}}break;case 1:_r(t,e),Xr(e),r&512&&n!==null&&aa(n,n.return);break;case 5:if(_r(t,e),Xr(e),r&512&&n!==null&&aa(n,n.return),e.flags&32){var o=e.stateNode;try{Hl(o,"")}catch(v){Lt(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&&Ub(o,i),Qp(l,a);var u=Qp(l,i);for(a=0;a<c.length;a+=2){var d=c[a],f=c[a+1];d==="style"?Qb(o,f):d==="dangerouslySetInnerHTML"?qb(o,f):d==="children"?Hl(o,f):_g(o,d,f,u)}switch(l){case"input":Up(o,i);break;case"textarea":Hb(o,i);break;case"select":var h=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?pa(o,!!i.multiple,m,!1):h!==!!i.multiple&&(i.defaultValue!=null?pa(o,!!i.multiple,i.defaultValue,!0):pa(o,!!i.multiple,i.multiple?[]:"",!1))}o[Zl]=i}catch(v){Lt(e,e.return,v)}}break;case 6:if(_r(t,e),Xr(e),r&4){if(e.stateNode===null)throw Error(J(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){Lt(e,e.return,v)}}break;case 3:if(_r(t,e),Xr(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ql(t.containerInfo)}catch(v){Lt(e,e.return,v)}break;case 4:_r(t,e),Xr(e);break;case 13:_r(t,e),Xr(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(cv=Ut())),r&4&&d1(e);break;case 22:if(d=n!==null&&n.memoizedState!==null,e.mode&1?(xn=(u=xn)||d,_r(t,e),xn=u):_r(t,e),Xr(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!d&&e.mode&1)for(ge=e,d=e.child;d!==null;){for(f=ge=d;ge!==null;){switch(h=ge,m=h.child,h.tag){case 0:case 11:case 14:case 15:Ol(4,h,h.return);break;case 1:aa(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){Lt(r,n,v)}}break;case 5:aa(h,h.return);break;case 22:if(h.memoizedState!==null){h1(f);continue}}m!==null?(m.return=h,ge=m):h1(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=Gb("display",a))}catch(v){Lt(e,e.return,v)}}}else if(f.tag===6){if(d===null)try{f.stateNode.nodeValue=u?"":f.memoizedProps}catch(v){Lt(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:_r(t,e),Xr(e),r&4&&d1(e);break;case 21:break;default:_r(t,e),Xr(e)}}function Xr(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(wC(n)){var r=n;break e}n=n.return}throw Error(J(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Hl(o,""),r.flags&=-33);var i=u1(e);Cm(e,i,o);break;case 3:case 4:var a=r.stateNode.containerInfo,l=u1(e);jm(e,l,a);break;default:throw Error(J(161))}}catch(c){Lt(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function mA(e,t,n){ge=e,jC(e)}function jC(e,t,n){for(var r=(e.mode&1)!==0;ge!==null;){var o=ge,i=o.child;if(o.tag===22&&r){var a=o.memoizedState!==null||Mu;if(!a){var l=o.alternate,c=l!==null&&l.memoizedState!==null||xn;l=Mu;var u=xn;if(Mu=a,(xn=c)&&!u)for(ge=o;ge!==null;)a=ge,c=a.child,a.tag===22&&a.memoizedState!==null?p1(o):c!==null?(c.return=a,ge=c):p1(o);for(;i!==null;)ge=i,jC(i),i=i.sibling;ge=o,Mu=l,xn=u}f1(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,ge=i):f1(e)}}function f1(e){for(;ge!==null;){var t=ge;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:xn||Sf(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!xn)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:Ar(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&K0(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}K0(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&&Ql(f)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(J(163))}xn||t.flags&512&&bm(t)}catch(h){Lt(t,t.return,h)}}if(t===e){ge=null;break}if(n=t.sibling,n!==null){n.return=t.return,ge=n;break}ge=t.return}}function h1(e){for(;ge!==null;){var t=ge;if(t===e){ge=null;break}var n=t.sibling;if(n!==null){n.return=t.return,ge=n;break}ge=t.return}}function p1(e){for(;ge!==null;){var t=ge;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{Sf(4,t)}catch(c){Lt(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(c){Lt(t,o,c)}}var i=t.return;try{bm(t)}catch(c){Lt(t,i,c)}break;case 5:var a=t.return;try{bm(t)}catch(c){Lt(t,a,c)}}}catch(c){Lt(t,t.return,c)}if(t===e){ge=null;break}var l=t.sibling;if(l!==null){l.return=t.return,ge=l;break}ge=t.return}}var gA=Math.ceil,Ad=Fo.ReactCurrentDispatcher,av=Fo.ReactCurrentOwner,xr=Fo.ReactCurrentBatchConfig,et=0,on=null,Ht=null,fn=0,Jn=0,la=Ai(0),Jt=0,ic=null,as=0,bf=0,lv=0,$l=null,zn=null,cv=0,Ra=1/0,xo=null,Nd=!1,Em=null,wi=null,Ou=!1,hi=null,Md=0,Ll=0,Pm=null,rd=-1,od=0;function In(){return et&6?Ut():rd!==-1?rd:rd=Ut()}function Si(e){return e.mode&1?et&2&&fn!==0?fn&-fn:ZI.transition!==null?(od===0&&(od=sj()),od):(e=it,e!==0||(e=window.event,e=e===void 0?16:hj(e.type)),e):1}function Fr(e,t,n,r){if(50<Ll)throw Ll=0,Pm=null,Error(J(185));Tc(e,n,r),(!(et&2)||e!==on)&&(e===on&&(!(et&2)&&(bf|=n),Jt===4&&li(e,fn)),Hn(e,r),n===1&&et===0&&!(t.mode&1)&&(Ra=Ut()+500,yf&&Ni()))}function Hn(e,t){var n=e.callbackNode;ZD(e,t);var r=yd(e,e===on?fn:0);if(r===0)n!==null&&j0(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&j0(n),t===1)e.tag===0?JI(m1.bind(null,e)):Ij(m1.bind(null,e)),QI(function(){!(et&6)&&Ni()}),n=null;else{switch(aj(r)){case 1:n=Mg;break;case 4:n=oj;break;case 16:n=vd;break;case 536870912:n=ij;break;default:n=vd}n=DC(n,CC.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function CC(e,t){if(rd=-1,od=0,et&6)throw Error(J(327));var n=e.callbackNode;if(xa()&&e.callbackNode!==n)return null;var r=yd(e,e===on?fn:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Od(e,r);else{t=r;var o=et;et|=2;var i=PC();(on!==e||fn!==t)&&(xo=null,Ra=Ut()+500,ts(e,t));do try{xA();break}catch(l){EC(e,l)}while(!0);Qg(),Ad.current=i,et=o,Ht!==null?t=0:(on=null,fn=0,t=Jt)}if(t!==0){if(t===2&&(o=Zp(e),o!==0&&(r=o,t=Tm(e,o))),t===1)throw n=ic,ts(e,0),li(e,r),Hn(e,Ut()),n;if(t===6)li(e,r);else{if(o=e.current.alternate,!(r&30)&&!vA(o)&&(t=Od(e,r),t===2&&(i=Zp(e),i!==0&&(r=i,t=Tm(e,i))),t===1))throw n=ic,ts(e,0),li(e,r),Hn(e,Ut()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(J(345));case 2:Bi(e,zn,xo);break;case 3:if(li(e,r),(r&130023424)===r&&(t=cv+500-Ut(),10<t)){if(yd(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){In(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=am(Bi.bind(null,e,zn,xo),t);break}Bi(e,zn,xo);break;case 4:if(li(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var a=31-Lr(r);i=1<<a,a=t[a],a>o&&(o=a),r&=~i}if(r=o,r=Ut()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*gA(r/1960))-r,10<r){e.timeoutHandle=am(Bi.bind(null,e,zn,xo),r);break}Bi(e,zn,xo);break;case 5:Bi(e,zn,xo);break;default:throw Error(J(329))}}}return Hn(e,Ut()),e.callbackNode===n?CC.bind(null,e):null}function Tm(e,t){var n=$l;return e.current.memoizedState.isDehydrated&&(ts(e,t).flags|=256),e=Od(e,t),e!==2&&(t=zn,zn=n,t!==null&&km(t)),e}function km(e){zn===null?zn=e:zn.push.apply(zn,e)}function vA(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(!Vr(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 li(e,t){for(t&=~lv,t&=~bf,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-Lr(t),r=1<<n;e[n]=-1,t&=~r}}function m1(e){if(et&6)throw Error(J(327));xa();var t=yd(e,0);if(!(t&1))return Hn(e,Ut()),null;var n=Od(e,t);if(e.tag!==0&&n===2){var r=Zp(e);r!==0&&(t=r,n=Tm(e,r))}if(n===1)throw n=ic,ts(e,0),li(e,t),Hn(e,Ut()),n;if(n===6)throw Error(J(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Bi(e,zn,xo),Hn(e,Ut()),null}function uv(e,t){var n=et;et|=1;try{return e(t)}finally{et=n,et===0&&(Ra=Ut()+500,yf&&Ni())}}function ls(e){hi!==null&&hi.tag===0&&!(et&6)&&xa();var t=et;et|=1;var n=xr.transition,r=it;try{if(xr.transition=null,it=1,e)return e()}finally{it=r,xr.transition=n,et=t,!(et&6)&&Ni()}}function dv(){Jn=la.current,Ct(la)}function ts(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,GI(n)),Ht!==null)for(n=Ht.return;n!==null;){var r=n;switch(Wg(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&jd();break;case 3:Ta(),Ct(Bn),Ct(bn),ev();break;case 5:Zg(r);break;case 4:Ta();break;case 13:Ct(At);break;case 19:Ct(At);break;case 10:Kg(r.type._context);break;case 22:case 23:dv()}n=n.return}if(on=e,Ht=e=bi(e.current,null),fn=Jn=t,Jt=0,ic=null,lv=bf=as=0,zn=$l=null,Ki!==null){for(t=0;t<Ki.length;t++)if(n=Ki[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}Ki=null}return e}function EC(e,t){do{var n=Ht;try{if(Qg(),ed.current=Id,Dd){for(var r=Nt.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Dd=!1}if(ss=0,tn=Xt=Nt=null,Ml=!1,nc=0,av.current=null,n===null||n.return===null){Jt=1,ic=t,Ht=null;break}e:{var i=e,a=n.return,l=n,c=t;if(t=fn,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=n1(a);if(m!==null){m.flags&=-257,r1(m,a,l,i,t),m.mode&1&&t1(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)){t1(i,u,t),fv();break e}c=Error(J(426))}}else if(kt&&l.mode&1){var S=n1(a);if(S!==null){!(S.flags&65536)&&(S.flags|=256),r1(S,a,l,i,t),qg(ka(c,l));break e}}i=c=ka(c,l),Jt!==4&&(Jt=2),$l===null?$l=[i]:$l.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var y=lC(i,c,t);Q0(i,y);break e;case 1:l=c;var w=i.type,x=i.stateNode;if(!(i.flags&128)&&(typeof w.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(wi===null||!wi.has(x)))){i.flags|=65536,t&=-t,i.lanes|=t;var b=cC(i,l,t);Q0(i,b);break e}}i=i.return}while(i!==null)}kC(n)}catch(C){t=C,Ht===n&&n!==null&&(Ht=n=n.return);continue}break}while(!0)}function PC(){var e=Ad.current;return Ad.current=Id,e===null?Id:e}function fv(){(Jt===0||Jt===3||Jt===2)&&(Jt=4),on===null||!(as&268435455)&&!(bf&268435455)||li(on,fn)}function Od(e,t){var n=et;et|=2;var r=PC();(on!==e||fn!==t)&&(xo=null,ts(e,t));do try{yA();break}catch(o){EC(e,o)}while(!0);if(Qg(),et=n,Ad.current=r,Ht!==null)throw Error(J(261));return on=null,fn=0,Jt}function yA(){for(;Ht!==null;)TC(Ht)}function xA(){for(;Ht!==null&&!HD();)TC(Ht)}function TC(e){var t=_C(e.alternate,e,Jn);e.memoizedProps=e.pendingProps,t===null?kC(e):Ht=t,av.current=null}function kC(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=fA(n,t),n!==null){n.flags&=32767,Ht=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Jt=6,Ht=null;return}}else if(n=dA(n,t,Jn),n!==null){Ht=n;return}if(t=t.sibling,t!==null){Ht=t;return}Ht=t=e}while(t!==null);Jt===0&&(Jt=5)}function Bi(e,t,n){var r=it,o=xr.transition;try{xr.transition=null,it=1,wA(e,t,n,r)}finally{xr.transition=o,it=r}return null}function wA(e,t,n,r){do xa();while(hi!==null);if(et&6)throw Error(J(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(J(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(eI(e,i),e===on&&(Ht=on=null,fn=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||Ou||(Ou=!0,DC(vd,function(){return xa(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=xr.transition,xr.transition=null;var a=it;it=1;var l=et;et|=4,av.current=null,pA(e,n),bC(n,e),zI(im),xd=!!om,im=om=null,e.current=n,mA(n),WD(),et=l,it=a,xr.transition=i}else e.current=n;if(Ou&&(Ou=!1,hi=e,Md=o),i=e.pendingLanes,i===0&&(wi=null),QD(n.stateNode),Hn(e,Ut()),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(Nd)throw Nd=!1,e=Em,Em=null,e;return Md&1&&e.tag!==0&&xa(),i=e.pendingLanes,i&1?e===Pm?Ll++:(Ll=0,Pm=e):Ll=0,Ni(),null}function xa(){if(hi!==null){var e=aj(Md),t=xr.transition,n=it;try{if(xr.transition=null,it=16>e?16:e,hi===null)var r=!1;else{if(e=hi,hi=null,Md=0,et&6)throw Error(J(331));var o=et;for(et|=4,ge=e.current;ge!==null;){var i=ge,a=i.child;if(ge.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ge=u;ge!==null;){var d=ge;switch(d.tag){case 0:case 11:case 15:Ol(8,d,i)}var f=d.child;if(f!==null)f.return=d,ge=f;else for(;ge!==null;){d=ge;var h=d.sibling,m=d.return;if(xC(d),d===u){ge=null;break}if(h!==null){h.return=m,ge=h;break}ge=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)}}ge=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,ge=a;else e:for(;ge!==null;){if(i=ge,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ol(9,i,i.return)}var y=i.sibling;if(y!==null){y.return=i.return,ge=y;break e}ge=i.return}}var w=e.current;for(ge=w;ge!==null;){a=ge;var x=a.child;if(a.subtreeFlags&2064&&x!==null)x.return=a,ge=x;else e:for(a=w;ge!==null;){if(l=ge,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Sf(9,l)}}catch(C){Lt(l,l.return,C)}if(l===a){ge=null;break e}var b=l.sibling;if(b!==null){b.return=l.return,ge=b;break e}ge=l.return}}if(et=o,Ni(),oo&&typeof oo.onPostCommitFiberRoot=="function")try{oo.onPostCommitFiberRoot(hf,e)}catch{}r=!0}return r}finally{it=n,xr.transition=t}}return!1}function g1(e,t,n){t=ka(n,t),t=lC(e,t,1),e=xi(e,t,1),t=In(),e!==null&&(Tc(e,1,t),Hn(e,t))}function Lt(e,t,n){if(e.tag===3)g1(e,e,n);else for(;t!==null;){if(t.tag===3){g1(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(wi===null||!wi.has(r))){e=ka(n,e),e=cC(t,e,1),t=xi(t,e,1),e=In(),t!==null&&(Tc(t,1,e),Hn(t,e));break}}t=t.return}}function SA(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=In(),e.pingedLanes|=e.suspendedLanes&n,on===e&&(fn&n)===n&&(Jt===4||Jt===3&&(fn&130023424)===fn&&500>Ut()-cv?ts(e,0):lv|=n),Hn(e,t)}function RC(e,t){t===0&&(e.mode&1?(t=Pu,Pu<<=1,!(Pu&130023424)&&(Pu=4194304)):t=1);var n=In();e=Ro(e,t),e!==null&&(Tc(e,t,n),Hn(e,n))}function bA(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),RC(e,n)}function jA(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(J(314))}r!==null&&r.delete(t),RC(e,n)}var _C;_C=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Bn.current)Vn=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Vn=!1,uA(e,t,n);Vn=!!(e.flags&131072)}else Vn=!1,kt&&t.flags&1048576&&Aj(t,Pd,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;nd(e,t),e=t.pendingProps;var o=Ca(t,bn.current);ya(t,n),o=nv(null,t,r,e,o,n);var i=rv();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,Un(r)?(i=!0,Cd(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,Xg(t),o.updater=xf,t.stateNode=o,o._reactInternals=t,pm(t,r,e,n),t=vm(null,t,r,!0,i,n)):(t.tag=0,kt&&i&&Hg(t),kn(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(nd(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=EA(r),e=Ar(r,e),o){case 0:t=gm(null,t,r,e,n);break e;case 1:t=s1(null,t,r,e,n);break e;case 11:t=o1(null,t,r,e,n);break e;case 14:t=i1(null,t,r,Ar(r.type,e),n);break e}throw Error(J(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ar(r,o),gm(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ar(r,o),s1(e,t,r,o,n);case 3:e:{if(hC(t),e===null)throw Error(J(387));r=t.pendingProps,i=t.memoizedState,o=i.element,$j(e,t),Rd(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=ka(Error(J(423)),t),t=a1(e,t,r,n,o);break e}else if(r!==o){o=ka(Error(J(424)),t),t=a1(e,t,r,n,o);break e}else for(er=yi(t.stateNode.containerInfo.firstChild),rr=t,kt=!0,Or=null,n=Vj(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Ea(),r===o){t=_o(e,t,n);break e}kn(e,t,r,n)}t=t.child}return t;case 5:return Bj(t),e===null&&dm(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,sm(r,o)?a=null:i!==null&&sm(r,i)&&(t.flags|=32),fC(e,t),kn(e,t,a,n),t.child;case 6:return e===null&&dm(t),null;case 13:return pC(e,t,n);case 4:return Jg(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Pa(t,null,r,n):kn(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ar(r,o),o1(e,t,r,o,n);case 7:return kn(e,t,t.pendingProps,n),t.child;case 8:return kn(e,t,t.pendingProps.children,n),t.child;case 12:return kn(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,mt(Td,r._currentValue),r._currentValue=a,i!==null)if(Vr(i.value,a)){if(i.children===o.children&&!Bn.current){t=_o(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=jo(-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),fm(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(J(341));a.lanes|=n,l=a.alternate,l!==null&&(l.lanes|=n),fm(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}kn(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,ya(t,n),o=Sr(o),r=r(o),t.flags|=1,kn(e,t,r,n),t.child;case 14:return r=t.type,o=Ar(r,t.pendingProps),o=Ar(r.type,o),i1(e,t,r,o,n);case 15:return uC(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:Ar(r,o),nd(e,t),t.tag=1,Un(r)?(e=!0,Cd(t)):e=!1,ya(t,n),Fj(t,r,o),pm(t,r,o,n),vm(null,t,r,!0,e,n);case 19:return mC(e,t,n);case 22:return dC(e,t,n)}throw Error(J(156,t.tag))};function DC(e,t){return rj(e,t)}function CA(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 yr(e,t,n,r){return new CA(e,t,n,r)}function hv(e){return e=e.prototype,!(!e||!e.isReactComponent)}function EA(e){if(typeof e=="function")return hv(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Ig)return 11;if(e===Ag)return 14}return 2}function bi(e,t){var n=e.alternate;return n===null?(n=yr(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 id(e,t,n,r,o,i){var a=2;if(r=e,typeof e=="function")hv(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case Js:return ns(n.children,o,i,t);case Dg:a=8,o|=8;break;case Lp:return e=yr(12,n,t,o|2),e.elementType=Lp,e.lanes=i,e;case Fp:return e=yr(13,n,t,o),e.elementType=Fp,e.lanes=i,e;case zp:return e=yr(19,n,t,o),e.elementType=zp,e.lanes=i,e;case zb:return jf(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Lb:a=10;break e;case Fb:a=9;break e;case Ig:a=11;break e;case Ag:a=14;break e;case ni:a=16,r=null;break e}throw Error(J(130,e==null?e:typeof e,""))}return t=yr(a,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function ns(e,t,n,r){return e=yr(7,e,r,t),e.lanes=n,e}function jf(e,t,n,r){return e=yr(22,e,r,t),e.elementType=zb,e.lanes=n,e.stateNode={isHidden:!1},e}function lp(e,t,n){return e=yr(6,e,null,t),e.lanes=n,e}function cp(e,t,n){return t=yr(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function PA(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=Uh(0),this.expirationTimes=Uh(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Uh(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function pv(e,t,n,r,o,i,a,l,c){return e=new PA(e,t,n,l,c),t===1?(t=1,i===!0&&(t|=8)):t=0,i=yr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xg(i),e}function TA(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Xs,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function IC(e){if(!e)return Pi;e=e._reactInternals;e:{if(Ss(e)!==e||e.tag!==1)throw Error(J(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Un(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(J(171))}if(e.tag===1){var n=e.type;if(Un(n))return Dj(e,n,t)}return t}function AC(e,t,n,r,o,i,a,l,c){return e=pv(n,r,!0,e,o,i,a,l,c),e.context=IC(null),n=e.current,r=In(),o=Si(n),i=jo(r,o),i.callback=t??null,xi(n,i,o),e.current.lanes=o,Tc(e,o,r),Hn(e,r),e}function Cf(e,t,n,r){var o=t.current,i=In(),a=Si(o);return n=IC(n),t.context===null?t.context=n:t.pendingContext=n,t=jo(i,a),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=xi(o,t,a),e!==null&&(Fr(e,o,a,i),Zu(e,o,a)),a}function $d(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 v1(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function mv(e,t){v1(e,t),(e=e.alternate)&&v1(e,t)}function kA(){return null}var NC=typeof reportError=="function"?reportError:function(e){console.error(e)};function gv(e){this._internalRoot=e}Ef.prototype.render=gv.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(J(409));Cf(e,t,null,null)};Ef.prototype.unmount=gv.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ls(function(){Cf(null,e,null,null)}),t[ko]=null}};function Ef(e){this._internalRoot=e}Ef.prototype.unstable_scheduleHydration=function(e){if(e){var t=uj();e={blockedOn:null,target:e,priority:t};for(var n=0;n<ai.length&&t!==0&&t<ai[n].priority;n++);ai.splice(n,0,e),n===0&&fj(e)}};function vv(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Pf(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function y1(){}function RA(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=$d(a);i.call(u)}}var a=AC(t,r,e,0,null,!1,!1,"",y1);return e._reactRootContainer=a,e[ko]=a.current,Xl(e.nodeType===8?e.parentNode:e),ls(),a}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=$d(c);l.call(u)}}var c=pv(e,0,!1,null,null,!1,!1,"",y1);return e._reactRootContainer=c,e[ko]=c.current,Xl(e.nodeType===8?e.parentNode:e),ls(function(){Cf(t,c,n,r)}),c}function Tf(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=$d(a);l.call(c)}}Cf(t,a,e,o)}else a=RA(n,t,e,o,r);return $d(a)}lj=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=Pl(t.pendingLanes);n!==0&&(Og(t,n|1),Hn(t,Ut()),!(et&6)&&(Ra=Ut()+500,Ni()))}break;case 13:ls(function(){var r=Ro(e,1);if(r!==null){var o=In();Fr(r,e,1,o)}}),mv(e,1)}};$g=function(e){if(e.tag===13){var t=Ro(e,134217728);if(t!==null){var n=In();Fr(t,e,134217728,n)}mv(e,134217728)}};cj=function(e){if(e.tag===13){var t=Si(e),n=Ro(e,t);if(n!==null){var r=In();Fr(n,e,t,r)}mv(e,t)}};uj=function(){return it};dj=function(e,t){var n=it;try{return it=e,t()}finally{it=n}};Yp=function(e,t,n){switch(t){case"input":if(Up(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=vf(r);if(!o)throw Error(J(90));Bb(r),Up(r,o)}}}break;case"textarea":Hb(e,n);break;case"select":t=n.value,t!=null&&pa(e,!!n.multiple,t,!1)}};Xb=uv;Jb=ls;var _A={usingClientEntryPoint:!1,Events:[Rc,na,vf,Kb,Yb,uv]},ml={findFiberByHostInstance:Qi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},DA={bundleType:ml.bundleType,version:ml.version,rendererPackageName:ml.rendererPackageName,rendererConfig:ml.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Fo.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=tj(e),e===null?null:e.stateNode},findFiberByHostInstance:ml.findFiberByHostInstance||kA,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 $u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!$u.isDisabled&&$u.supportsFiber)try{hf=$u.inject(DA),oo=$u}catch{}}ar.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=_A;ar.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!vv(t))throw Error(J(200));return TA(e,t,null,n)};ar.createRoot=function(e,t){if(!vv(e))throw Error(J(299));var n=!1,r="",o=NC;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=pv(e,1,!1,null,null,n,!1,r,o),e[ko]=t.current,Xl(e.nodeType===8?e.parentNode:e),new gv(t)};ar.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(J(188)):(e=Object.keys(e).join(","),Error(J(268,e)));return e=tj(t),e=e===null?null:e.stateNode,e};ar.flushSync=function(e){return ls(e)};ar.hydrate=function(e,t,n){if(!Pf(t))throw Error(J(200));return Tf(null,e,t,!0,n)};ar.hydrateRoot=function(e,t,n){if(!vv(e))throw Error(J(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",a=NC;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(a=n.onRecoverableError)),t=AC(t,null,e,1,n??null,o,!1,i,a),e[ko]=t.current,Xl(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 Ef(t)};ar.render=function(e,t,n){if(!Pf(t))throw Error(J(200));return Tf(null,e,t,!1,n)};ar.unmountComponentAtNode=function(e){if(!Pf(e))throw Error(J(40));return e._reactRootContainer?(ls(function(){Tf(null,null,e,!1,function(){e._reactRootContainer=null,e[ko]=null})}),!0):!1};ar.unstable_batchedUpdates=uv;ar.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Pf(n))throw Error(J(200));if(e==null||e._reactInternals===void 0)throw Error(J(38));return Tf(e,t,n,!1,r)};ar.version="18.2.0-next-9e3b772b8-20220608";function MC(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(MC)}catch(e){console.error(e)}}MC(),Ab.exports=ar;var Dc=Ab.exports;const ca=pg(Dc),IA=US({__proto__:null,default:ca},[Dc]),[AA,Er]=On("ScrollArea.Root component was not found in tree");function _a(e,t){const n=Wi(t);Va(()=>{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 NA=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Er(),[i,a]=p.useState(0),[l,c]=p.useState(0),u=!!(i&&l);return _a(o.scrollbarX,()=>{var f;const d=((f=o.scrollbarX)==null?void 0:f.offsetHeight)||0;o.onCornerHeightChange(d),c(d)}),_a(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}),MA=p.forwardRef((e,t)=>{const n=Er(),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?s.jsx(NA,{...e,ref:t}):null}),OA={scrollHideDelay:1e3,type:"hover"},OC=p.forwardRef((e,t)=>{const n=B("ScrollAreaRoot",OA,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),[y,w]=p.useState(0),[x,b]=p.useState(0),[C,E]=p.useState(!1),[j,P]=p.useState(!1),_=qt(t,R=>c(R));return s.jsx(AA,{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:j,onScrollbarYEnabledChange:P,onCornerWidthChange:w,onCornerHeightChange:b},children:s.jsx(q,{...a,ref:_,__vars:{"--sa-corner-width":i!=="xy"?"0px":`${y}px`,"--sa-corner-height":i!=="xy"?"0px":`${x}px`}})})});OC.displayName="@mantine/core/ScrollAreaRoot";function $C(e,t){const n=e/t;return Number.isNaN(n)?0:n}function kf(e){const t=$C(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function LC(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 $A(e,[t,n]){return Math.min(n,Math.max(t,e))}function x1(e,t,n="ltr"){const r=kf(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=$A(e,c);return LC([0,a],[0,l])(u)}function LA(e,t,n,r="ltr"){const o=kf(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 LC([c,u],f)(e)}function FC(e,t){return e>0&&e<t}function Ld(e){return e?parseInt(e,10):0}function rs(e,t,{checkForDefaultPrevented:n=!0}={}){return r=>{e==null||e(r),(n===!1||!r.defaultPrevented)&&(t==null||t(r))}}const[FA,zC]=On("ScrollAreaScrollbar was not found in tree"),VC=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=Er(),[m,g]=p.useState(null),v=qt(t,P=>g(P)),S=p.useRef(null),y=p.useRef(""),{viewport:w}=h,x=n.content-n.viewport,b=Wi(u),C=Wi(l),E=cf(d,10),j=P=>{if(S.current){const _=P.clientX-S.current.left,R=P.clientY-S.current.top;c({x:_,y:R})}};return p.useEffect(()=>{const P=_=>{const R=_.target;(m==null?void 0:m.contains(R))&&b(_,x)};return document.addEventListener("wheel",P,{passive:!1}),()=>document.removeEventListener("wheel",P,{passive:!1})},[w,m,x,b]),p.useEffect(C,[n,C]),_a(m,E),_a(h.content,E),s.jsx(FA,{value:{scrollbar:m,hasThumb:r,onThumbChange:Wi(o),onThumbPointerUp:Wi(i),onThumbPositionChange:C,onThumbPointerDown:Wi(a)},children:s.jsx("div",{...f,ref:v,style:{position:"absolute",...f.style},onPointerDown:rs(e.onPointerDown,P=>{P.button===0&&(P.target.setPointerCapture(P.pointerId),S.current=m.getBoundingClientRect(),y.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",j(P))}),onPointerMove:rs(e.onPointerMove,j),onPointerUp:rs(e.onPointerUp,P=>{const _=P.target;_.hasPointerCapture(P.pointerId)&&_.releasePointerCapture(P.pointerId),document.body.style.webkitUserSelect=y.current,S.current=null})})})}),zA=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Er(),[l,c]=p.useState(),u=p.useRef(null),d=qt(t,u,a.onScrollbarXChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),s.jsx(VC,{"data-orientation":"horizontal",...i,ref:d,sizes:n,style:{...o,"--sa-thumb-width":`${kf(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),FC(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:Ld(l.paddingLeft),paddingEnd:Ld(l.paddingRight)}})}})}),VA=p.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,style:o,...i}=e,a=Er(),[l,c]=p.useState(),u=p.useRef(null),d=qt(t,u,a.onScrollbarYChange);return p.useEffect(()=>{u.current&&c(getComputedStyle(u.current))},[u]),s.jsx(VC,{...i,"data-orientation":"vertical",ref:d,sizes:n,style:{"--sa-thumb-height":`${kf(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),FC(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:Ld(l.paddingTop),paddingEnd:Ld(l.paddingBottom)}})}})}),yv=p.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,{dir:o}=Ua(),i=Er(),a=p.useRef(null),l=p.useRef(0),[c,u]=p.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),d=$C(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)=>LA(m,l.current,c,g);return n==="horizontal"?s.jsx(zA,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollLeft,g=x1(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(VA,{...f,ref:t,onThumbPositionChange:()=>{if(i.viewport&&a.current){const m=i.viewport.scrollTop,g=x1(m,c);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}),BC=p.forwardRef((e,t)=>{const n=Er(),{forceMount:r,...o}=e,[i,a]=p.useState(!1),l=e.orientation==="horizontal",c=cf(()=>{if(n.viewport){const u=n.viewport.offsetWidth<n.viewport.scrollWidth,d=n.viewport.offsetHeight<n.viewport.scrollHeight;a(l?u:d)}},10);return _a(n.viewport,c),_a(n.content,c),r||i?s.jsx(yv,{"data-state":i?"visible":"hidden",...o,ref:t}):null}),BA=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Er(),[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(BC,{"data-state":i?"visible":"hidden",...r,ref:t}):null}),UA=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Er(),i=e.orientation==="horizontal",[a,l]=p.useState("hidden"),c=cf(()=>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(yv,{"data-state":a==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:rs(e.onPointerEnter,()=>l("interacting")),onPointerLeave:rs(e.onPointerLeave,()=>l("idle"))}):null}),w1=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=Er(),{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(BA,{...r,ref:t,forceMount:n}):o.type==="scroll"?s.jsx(UA,{...r,ref:t,forceMount:n}):o.type==="auto"?s.jsx(BC,{...r,ref:t,forceMount:n}):o.type==="always"?s.jsx(yv,{...r,ref:t}):null});function HA(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 WA=p.forwardRef((e,t)=>{const{style:n,...r}=e,o=Er(),i=zC(),{onThumbPositionChange:a}=i,l=qt(t,d=>i.onThumbChange(d)),c=p.useRef(),u=cf(()=>{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=HA(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:rs(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:rs(e.onPointerUp,i.onThumbPointerUp)})}),S1=p.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=zC();return n||o.hasThumb?s.jsx(WA,{ref:t,...r}):null}),UC=p.forwardRef(({children:e,style:t,...n},r)=>{const o=Er(),i=qt(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})})});UC.displayName="@mantine/core/ScrollAreaViewport";var xv={root:"m_d57069b5",viewport:"m_c0783ff9",viewportInner:"m_f8f631dd",scrollbar:"m_c44ba933",thumb:"m_d8b5e363",corner:"m_21657268"};const HC={scrollHideDelay:1e3,type:"hover",scrollbars:"xy"},qA=(e,{scrollbarSize:t})=>({root:{"--scrollarea-scrollbar-size":z(t)}}),Pr=Y((e,t)=>{const n=B("ScrollArea",HC,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:y,...w}=n,[x,b]=p.useState(!1),C=pe({name:"ScrollArea",props:n,classes:xv,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:qA});return s.jsxs(OC,{type:d==="never"?"always":d,scrollHideDelay:f,ref:t,scrollbars:y,...C("root"),...w,children:[s.jsx(UC,{...h,...C("viewport",{style:h==null?void 0:h.style}),ref:m,"data-offset-scrollbars":S===!0?"xy":S||void 0,"data-scrollbars":y||void 0,onScroll:E=>{var j;(j=h==null?void 0:h.onScroll)==null||j.call(h,E),g==null||g({x:E.currentTarget.scrollLeft,y:E.currentTarget.scrollTop})},children:v}),(y==="xy"||y==="x")&&s.jsx(w1,{...C("scrollbar"),orientation:"horizontal","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:s.jsx(S1,{...C("thumb")})}),(y==="xy"||y==="y")&&s.jsx(w1,{...C("scrollbar"),orientation:"vertical","data-hidden":d==="never"||void 0,forceMount:!0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),children:s.jsx(S1,{...C("thumb")})}),s.jsx(MA,{...C("corner"),"data-hovered":x||void 0,"data-hidden":d==="never"||void 0})]})});Pr.displayName="@mantine/core/ScrollArea";const Rf=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:y,...w}=B("ScrollAreaAutosize",HC,e);return s.jsx(q,{...w,ref:t,style:[{display:"flex",overflow:"auto"},S],children:s.jsx(q,{style:{display:"flex",flexDirection:"column",flex:1},children:s.jsx(Pr,{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:y,scrollbars:v,children:n})})})});Pr.classes=xv;Rf.displayName="@mantine/core/ScrollAreaAutosize";Rf.classes=xv;Pr.Autosize=Rf;var WC={root:"m_87cf2631"};const GA={__staticSelector:"UnstyledButton"},An=jn((e,t)=>{const n=B("UnstyledButton",GA,e),{className:r,component:o="button",__staticSelector:i,unstyled:a,classNames:l,styles:c,style:u,...d}=n,f=pe({name:i,props:n,classes:WC,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})});An.classes=WC;An.displayName="@mantine/core/UnstyledButton";var qC={root:"m_515a97f8"};const QA={},wv=Y((e,t)=>{const n=B("VisuallyHidden",QA,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,...u}=n,d=pe({name:"VisuallyHidden",classes:qC,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l});return s.jsx(q,{component:"span",ref:t,...d("root"),...u})});wv.classes=qC;wv.displayName="@mantine/core/VisuallyHidden";var GC={root:"m_1b7284a3"};const KA={},YA=(e,{radius:t,shadow:n})=>({root:{"--paper-radius":t===void 0?void 0:wt(t),"--paper-shadow":wg(n)}}),Wn=jn((e,t)=>{const n=B("Paper",KA,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=pe({name:"Paper",props:n,classes:GC,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:YA});return s.jsx(q,{ref:t,mod:[{"data-with-border":c},m],...v("root"),variant:h,...g})});Wn.classes=GC;Wn.displayName="@mantine/core/Paper";function qa(e){return QC(e)?(e.nodeName||"").toLowerCase():"#document"}function qn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function zo(e){var t;return(t=(QC(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function QC(e){return e instanceof Node||e instanceof qn(e).Node}function Rt(e){return e instanceof Element||e instanceof qn(e).Element}function ir(e){return e instanceof HTMLElement||e instanceof qn(e).HTMLElement}function Rm(e){return typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof qn(e).ShadowRoot}function Ic(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=jr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function XA(e){return["table","td","th"].includes(qa(e))}function Sv(e){const t=bv(),n=jr(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 JA(e){let t=Do(e);for(;ir(t)&&!Ti(t);){if(Sv(t))return t;t=Do(t)}return null}function bv(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ti(e){return["html","body","#document"].includes(qa(e))}function jr(e){return qn(e).getComputedStyle(e)}function _f(e){return Rt(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function Do(e){if(qa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Rm(e)&&e.host||zo(e);return Rm(t)?t.host:t}function KC(e){const t=Do(e);return Ti(t)?e.ownerDocument?e.ownerDocument.body:e.body:ir(t)&&Ic(t)?t:KC(t)}function Co(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const o=KC(e),i=o===((r=e.ownerDocument)==null?void 0:r.body),a=qn(o);return i?t.concat(a,a.visualViewport||[],Ic(o)?o:[],a.frameElement&&n?Co(a.frameElement):[]):t.concat(o,Co(o,[],n))}function b1(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 sc(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Rm(n)){let r=t;for(;r;){if(e===r)return!0;r=r.parentNode||r.host}}return!1}function YC(){const e=navigator.userAgentData;return e!=null&&e.platform?e.platform:navigator.platform}function XC(){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 ZA(e){return nN()?!1:!j1()&&e.width===0&&e.height===0||j1()&&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 eN(){return/apple/i.test(navigator.vendor)}function j1(){const e=/android/i;return e.test(YC())||e.test(XC())}function tN(){return YC().toLowerCase().startsWith("mac")&&!navigator.maxTouchPoints}function nN(){return XC().includes("jsdom/")}function _m(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}function rN(e){return"nativeEvent"in e}function oN(e){return e.matches("html,body")}function Xi(e){return(e==null?void 0:e.ownerDocument)||document}function up(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 Ks(e){return"composedPath"in e?e.composedPath()[0]:e.target}const iN="input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])";function sN(e){return ir(e)&&e.matches(iN)}const tr=Math.min,wn=Math.max,Fd=Math.round,Lu=Math.floor,ki=e=>({x:e,y:e}),aN={left:"right",right:"left",bottom:"top",top:"bottom"},lN={start:"end",end:"start"};function Dm(e,t,n){return wn(e,tr(t,n))}function Io(e,t){return typeof e=="function"?e(t):e}function Br(e){return e.split("-")[0]}function Ga(e){return e.split("-")[1]}function jv(e){return e==="x"?"y":"x"}function Cv(e){return e==="y"?"height":"width"}function bs(e){return["top","bottom"].includes(Br(e))?"y":"x"}function Ev(e){return jv(bs(e))}function cN(e,t,n){n===void 0&&(n=!1);const r=Ga(e),o=Ev(e),i=Cv(o);let a=o==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=zd(a)),[a,zd(a)]}function uN(e){const t=zd(e);return[Im(e),t,Im(t)]}function Im(e){return e.replace(/start|end/g,t=>lN[t])}function dN(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 fN(e,t,n,r){const o=Ga(e);let i=dN(Br(e),n==="start",r);return o&&(i=i.map(a=>a+"-"+o),t&&(i=i.concat(i.map(Im)))),i}function zd(e){return e.replace(/left|right|bottom|top/g,t=>aN[t])}function hN(e){return{top:0,right:0,bottom:0,left:0,...e}}function Pv(e){return typeof e!="number"?hN(e):{top:e,right:e,bottom:e,left:e}}function Da(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 C1(e,t,n){let{reference:r,floating:o}=e;const i=bs(t),a=Ev(t),l=Cv(a),c=Br(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(Ga(t)){case"start":m[a]-=h*(n&&u?-1:1);break;case"end":m[a]+=h*(n&&u?-1:1);break}return m}const pN=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}=C1(u,r,c),h=r,m={},g=0;for(let v=0;v<l.length;v++){const{name:S,fn:y}=l[v],{x:w,y:x,data:b,reset:C}=await y({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=x??f,m={...m,[S]:{...m[S],...b}},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}=C1(u,h,c)),v=-1)}return{x:d,y:f,placement:h,strategy:o,middlewareData:m}};async function Tv(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}=Io(t,e),g=Pv(m),S=l[h?f==="floating"?"reference":"floating":f],y=Da(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,x=await(i.getOffsetParent==null?void 0:i.getOffsetParent(l.floating)),b=await(i.isElement==null?void 0:i.isElement(x))?await(i.getScale==null?void 0:i.getScale(x))||{x:1,y:1}:{x:1,y:1},C=Da(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:w,offsetParent:x,strategy:c}):w);return{top:(y.top-C.top+g.top)/b.y,bottom:(C.bottom-y.bottom+g.bottom)/b.y,left:(y.left-C.left+g.left)/b.x,right:(C.right-y.right+g.right)/b.x}}const mN=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}=Io(e,t)||{};if(u==null)return{};const f=Pv(d),h={x:n,y:r},m=Ev(o),g=Cv(m),v=await a.getDimensions(u),S=m==="y",y=S?"top":"left",w=S?"bottom":"right",x=S?"clientHeight":"clientWidth",b=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 j=E?E[x]:0;(!j||!await(a.isElement==null?void 0:a.isElement(E)))&&(j=l.floating[x]||i.floating[g]);const P=b/2-C/2,_=j/2-v[g]/2-1,R=tr(f[y],_),M=tr(f[w],_),D=R,N=j-v[g]-M,A=j/2-v[g]/2+P,L=Dm(D,A,N),I=!c.arrow&&Ga(o)!=null&&A!==L&&i.reference[g]/2-(A<D?R:M)-v[g]/2<0,k=I?A<D?A-D:A-N:0;return{[m]:h[m]+k,data:{[m]:L,centerOffset:A-L-k,...I&&{alignmentOffset:k}},reset:I}}}),gN=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}=Io(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const y=Br(o),w=Br(l)===l,x=await(c.isRTL==null?void 0:c.isRTL(u.floating)),b=h||(w||!v?[zd(l)]:uN(l));!h&&g!=="none"&&b.push(...fN(l,v,g,x));const C=[l,...b],E=await Tv(t,S),j=[];let P=((r=i.flip)==null?void 0:r.overflows)||[];if(d&&j.push(E[y]),f){const D=cN(o,a,x);j.push(E[D[0]],E[D[1]])}if(P=[...P,{placement:o,overflows:j}],!j.every(D=>D<=0)){var _,R;const D=(((_=i.flip)==null?void 0:_.index)||0)+1,N=C[D];if(N)return{data:{index:D,overflows:P},reset:{placement:N}};let A=(R=P.filter(L=>L.overflows[0]<=0).sort((L,I)=>L.overflows[1]-I.overflows[1])[0])==null?void 0:R.placement;if(!A)switch(m){case"bestFit":{var M;const L=(M=P.map(I=>[I.placement,I.overflows.filter(k=>k>0).reduce((k,T)=>k+T,0)]).sort((I,k)=>I[1]-k[1])[0])==null?void 0:M[0];L&&(A=L);break}case"initialPlacement":A=l;break}if(o!==A)return{reset:{placement:A}}}return{}}}};function JC(e){const t=tr(...e.map(i=>i.left)),n=tr(...e.map(i=>i.top)),r=wn(...e.map(i=>i.right)),o=wn(...e.map(i=>i.bottom));return{x:t,y:n,width:r-t,height:o-n}}function vN(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=>Da(JC(o)))}const yN=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}=Io(e,t),d=Array.from(await(i.getClientRects==null?void 0:i.getClientRects(r.reference))||[]),f=vN(d),h=Da(JC(d)),m=Pv(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(bs(n)==="y"){const R=f[0],M=f[f.length-1],D=Br(n)==="top",N=R.top,A=M.bottom,L=D?R.left:M.left,I=D?R.right:M.right,k=I-L,T=A-N;return{top:N,bottom:A,left:L,right:I,width:k,height:T,x:L,y:N}}const S=Br(n)==="left",y=wn(...f.map(R=>R.right)),w=tr(...f.map(R=>R.left)),x=f.filter(R=>S?R.left===w:R.right===y),b=x[0].top,C=x[x.length-1].bottom,E=w,j=y,P=j-E,_=C-b;return{top:b,bottom:C,left:E,right:j,width:P,height:_,x:E,y:b}}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 xN(e,t){const{placement:n,platform:r,elements:o}=e,i=await(r.isRTL==null?void 0:r.isRTL(o.floating)),a=Br(n),l=Ga(n),c=bs(n)==="y",u=["left","top"].includes(a)?-1:1,d=i&&c?-1:1,f=Io(t,e);let{mainAxis:h,crossAxis:m,alignmentAxis:g}=typeof f=="number"?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};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 wN=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 xN(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}}}}},SN=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:y,y:w}=S;return{x:y,y:w}}},...c}=Io(e,t),u={x:n,y:r},d=await Tv(t,c),f=bs(Br(o)),h=jv(f);let m=u[h],g=u[f];if(i){const S=h==="y"?"top":"left",y=h==="y"?"bottom":"right",w=m+d[S],x=m-d[y];m=Dm(w,m,x)}if(a){const S=f==="y"?"top":"left",y=f==="y"?"bottom":"right",w=g+d[S],x=g-d[y];g=Dm(w,g,x)}const v=l.fn({...t,[h]:m,[f]:g});return{...v,data:{x:v.x-n,y:v.y-r}}}}},bN=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}=Io(e,t),d={x:n,y:r},f=bs(o),h=jv(f);let m=d[h],g=d[f];const v=Io(l,t),S=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(c){const x=h==="y"?"height":"width",b=i.reference[h]-i.floating[x]+S.mainAxis,C=i.reference[h]+i.reference[x]-S.mainAxis;m<b?m=b:m>C&&(m=C)}if(u){var y,w;const x=h==="y"?"width":"height",b=["top","left"].includes(Br(o)),C=i.reference[f]-i.floating[x]+(b&&((y=a.offset)==null?void 0:y[f])||0)+(b?0:S.crossAxis),E=i.reference[f]+i.reference[x]+(b?0:((w=a.offset)==null?void 0:w[f])||0)-(b?S.crossAxis:0);g<C?g=C:g>E&&(g=E)}return{[h]:m,[f]:g}}}},jN=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:a=()=>{},...l}=Io(e,t),c=await Tv(t,l),u=Br(n),d=Ga(n),f=bs(n)==="y",{width:h,height:m}=r.floating;let g,v;u==="top"||u==="bottom"?(g=u,v=d===(await(o.isRTL==null?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(v=u,g=d==="end"?"top":"bottom");const S=m-c.top-c.bottom,y=h-c.left-c.right,w=tr(m-c[g],S),x=tr(h-c[v],y),b=!t.middlewareData.shift;let C=w,E=x;if(f?E=d||b?tr(x,y):y:C=d||b?tr(w,S):S,b&&!d){const P=wn(c.left,0),_=wn(c.right,0),R=wn(c.top,0),M=wn(c.bottom,0);f?E=h-2*(P!==0||_!==0?P+_:wn(c.left,c.right)):C=m-2*(R!==0||M!==0?R+M:wn(c.top,c.bottom))}await a({...t,availableWidth:E,availableHeight:C});const j=await o.getDimensions(i.floating);return h!==j.width||m!==j.height?{reset:{rects:!0}}:{}}}};function ZC(e){const t=jr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=ir(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,l=Fd(n)!==i||Fd(r)!==a;return l&&(n=i,r=a),{width:n,height:r,$:l}}function kv(e){return Rt(e)?e:e.contextElement}function wa(e){const t=kv(e);if(!ir(t))return ki(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=ZC(t);let a=(i?Fd(n.width):n.width)/r,l=(i?Fd(n.height):n.height)/o;return(!a||!Number.isFinite(a))&&(a=1),(!l||!Number.isFinite(l))&&(l=1),{x:a,y:l}}const CN=ki(0);function eE(e){const t=qn(e);return!bv()||!t.visualViewport?CN:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function EN(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==qn(e)?!1:t}function cs(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const o=e.getBoundingClientRect(),i=kv(e);let a=ki(1);t&&(r?Rt(r)&&(a=wa(r)):a=wa(e));const l=EN(i,n,r)?eE(i):ki(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=qn(i),m=r&&Rt(r)?qn(r):r;let g=h,v=g.frameElement;for(;v&&r&&m!==g;){const S=wa(v),y=v.getBoundingClientRect(),w=jr(v),x=y.left+(v.clientLeft+parseFloat(w.paddingLeft))*S.x,b=y.top+(v.clientTop+parseFloat(w.paddingTop))*S.y;c*=S.x,u*=S.y,d*=S.x,f*=S.y,c+=x,u+=b,g=qn(v),v=g.frameElement}}return Da({width:d,height:f,x:c,y:u})}const PN=[":popover-open",":modal"];function Rv(e){return PN.some(t=>{try{return e.matches(t)}catch{return!1}})}function TN(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i=o==="fixed",a=zo(r),l=t?Rv(t.floating):!1;if(r===a||l&&i)return n;let c={scrollLeft:0,scrollTop:0},u=ki(1);const d=ki(0),f=ir(r);if((f||!f&&!i)&&((qa(r)!=="body"||Ic(a))&&(c=_f(r)),ir(r))){const h=cs(r);u=wa(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 kN(e){return Array.from(e.getClientRects())}function tE(e){return cs(zo(e)).left+_f(e).scrollLeft}function RN(e){const t=zo(e),n=_f(e),r=e.ownerDocument.body,o=wn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=wn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+tE(e);const l=-n.scrollTop;return jr(r).direction==="rtl"&&(a+=wn(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:l}}function _N(e,t){const n=qn(e),r=zo(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=bv();(!u||u&&t==="fixed")&&(l=o.offsetLeft,c=o.offsetTop)}return{width:i,height:a,x:l,y:c}}function DN(e,t){const n=cs(e,!0,t==="fixed"),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=ir(e)?wa(e):ki(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 E1(e,t,n){let r;if(t==="viewport")r=_N(e,n);else if(t==="document")r=RN(zo(e));else if(Rt(t))r=DN(t,n);else{const o=eE(e);r={...t,x:t.x-o.x,y:t.y-o.y}}return Da(r)}function nE(e,t){const n=Do(e);return n===t||!Rt(n)||Ti(n)?!1:jr(n).position==="fixed"||nE(n,t)}function IN(e,t){const n=t.get(e);if(n)return n;let r=Co(e,[],!1).filter(l=>Rt(l)&&qa(l)!=="body"),o=null;const i=jr(e).position==="fixed";let a=i?Do(e):e;for(;Rt(a)&&!Ti(a);){const l=jr(a),c=Sv(a);!c&&l.position==="fixed"&&(o=null),(i?!c&&!o:!c&&l.position==="static"&&!!o&&["absolute","fixed"].includes(o.position)||Ic(a)&&!c&&nE(e,a))?r=r.filter(d=>d!==a):o=l,a=Do(a)}return t.set(e,r),r}function AN(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a=[...n==="clippingAncestors"?Rv(t)?[]:IN(t,this._c):[].concat(n),r],l=a[0],c=a.reduce((u,d)=>{const f=E1(t,d,o);return u.top=wn(f.top,u.top),u.right=tr(f.right,u.right),u.bottom=tr(f.bottom,u.bottom),u.left=wn(f.left,u.left),u},E1(t,l,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function NN(e){const{width:t,height:n}=ZC(e);return{width:t,height:n}}function MN(e,t,n){const r=ir(t),o=zo(t),i=n==="fixed",a=cs(e,!0,i,t);let l={scrollLeft:0,scrollTop:0};const c=ki(0);if(r||!r&&!i)if((qa(t)!=="body"||Ic(o))&&(l=_f(t)),r){const f=cs(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else o&&(c.x=tE(o));const u=a.left+l.scrollLeft-c.x,d=a.top+l.scrollTop-c.y;return{x:u,y:d,width:a.width,height:a.height}}function dp(e){return jr(e).position==="static"}function P1(e,t){return!ir(e)||jr(e).position==="fixed"?null:t?t(e):e.offsetParent}function rE(e,t){const n=qn(e);if(Rv(e))return n;if(!ir(e)){let o=Do(e);for(;o&&!Ti(o);){if(Rt(o)&&!dp(o))return o;o=Do(o)}return n}let r=P1(e,t);for(;r&&XA(r)&&dp(r);)r=P1(r,t);return r&&Ti(r)&&dp(r)&&!Sv(r)?n:r||JA(e)||n}const ON=async function(e){const t=this.getOffsetParent||rE,n=this.getDimensions,r=await n(e.floating);return{reference:MN(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function $N(e){return jr(e).direction==="rtl"}const LN={convertOffsetParentRelativeRectToViewportRelativeRect:TN,getDocumentElement:zo,getClippingRect:AN,getOffsetParent:rE,getElementRects:ON,getClientRects:kN,getDimensions:NN,getScale:wa,isElement:Rt,isRTL:$N};function FN(e,t){let n=null,r;const o=zo(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=Lu(d),g=Lu(o.clientWidth-(u+f)),v=Lu(o.clientHeight-(d+h)),S=Lu(u),w={rootMargin:-m+"px "+-g+"px "+-v+"px "+-S+"px",threshold:wn(0,tr(1,c))||1};let x=!0;function b(C){const E=C[0].intersectionRatio;if(E!==c){if(!x)return a();E?a(!1,E):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(b,{...w,root:o.ownerDocument})}catch{n=new IntersectionObserver(b,w)}n.observe(e)}return a(!0),i}function zN(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=kv(e),d=o||i?[...u?Co(u):[],...Co(t)]:[];d.forEach(y=>{o&&y.addEventListener("scroll",n,{passive:!0}),i&&y.addEventListener("resize",n)});const f=u&&l?FN(u,n):null;let h=-1,m=null;a&&(m=new ResizeObserver(y=>{let[w]=y;w&&w.target===u&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=m)==null||x.observe(t)})),n()}),u&&!c&&m.observe(u),m.observe(t));let g,v=c?cs(e):null;c&&S();function S(){const y=cs(e);v&&(y.x!==v.x||y.y!==v.y||y.width!==v.width||y.height!==v.height)&&n(),v=y,g=requestAnimationFrame(S)}return n(),()=>{var y;d.forEach(w=>{o&&w.removeEventListener("scroll",n),i&&w.removeEventListener("resize",n)}),f==null||f(),(y=m)==null||y.disconnect(),m=null,c&&cancelAnimationFrame(g)}}const VN=wN,BN=SN,UN=gN,HN=jN,T1=mN,WN=yN,qN=bN,GN=(e,t,n)=>{const r=new Map,o={platform:LN,...n},i={...o.platform,_c:r};return pN(e,t,{...o,platform:i})};var sd=typeof document<"u"?p.useLayoutEffect:p.useEffect;function Vd(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(!Vd(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)&&!Vd(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function oE(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function k1(e,t){const n=oE(e);return Math.round(t*n)/n}function R1(e){const t=p.useRef(e);return sd(()=>{t.current=e}),t}function QN(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);Vd(h,r)||m(r);const[g,v]=p.useState(null),[S,y]=p.useState(null),w=p.useCallback(k=>{k!==E.current&&(E.current=k,v(k))},[]),x=p.useCallback(k=>{k!==j.current&&(j.current=k,y(k))},[]),b=i||g,C=a||S,E=p.useRef(null),j=p.useRef(null),P=p.useRef(d),_=c!=null,R=R1(c),M=R1(o),D=p.useCallback(()=>{if(!E.current||!j.current)return;const k={placement:t,strategy:n,middleware:h};M.current&&(k.platform=M.current),GN(E.current,j.current,k).then(T=>{const $={...T,isPositioned:!0};N.current&&!Vd(P.current,$)&&(P.current=$,Dc.flushSync(()=>{f($)}))})},[h,t,n,M]);sd(()=>{u===!1&&P.current.isPositioned&&(P.current.isPositioned=!1,f(k=>({...k,isPositioned:!1})))},[u]);const N=p.useRef(!1);sd(()=>(N.current=!0,()=>{N.current=!1}),[]),sd(()=>{if(b&&(E.current=b),C&&(j.current=C),b&&C){if(R.current)return R.current(b,C,D);D()}},[b,C,D,R,_]);const A=p.useMemo(()=>({reference:E,floating:j,setReference:w,setFloating:x}),[w,x]),L=p.useMemo(()=>({reference:b,floating:C}),[b,C]),I=p.useMemo(()=>{const k={position:n,left:0,top:0};if(!L.floating)return k;const T=k1(L.floating,d.x),$=k1(L.floating,d.y);return l?{...k,transform:"translate("+T+"px, "+$+"px)",...oE(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:T,top:$}},[n,l,L.floating,d.x,d.y]);return p.useMemo(()=>({...d,update:D,refs:A,elements:L,floatingStyles:I}),[d,D,A,L,I])}const KN=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?T1({element:r.current,padding:o}).fn(n):{}:r?T1({element:r,padding:o}).fn(n):{}}}},iE=(e,t)=>({...VN(e),options:[e,t]}),_v=(e,t)=>({...BN(e),options:[e,t]}),_1=(e,t)=>({...qN(e),options:[e,t]}),Am=(e,t)=>({...UN(e),options:[e,t]}),YN=(e,t)=>({...HN(e),options:[e,t]}),Nm=(e,t)=>({...WN(e),options:[e,t]}),sE=(e,t)=>({...KN(e),options:[e,t]}),aE={...ZS},XN=aE.useInsertionEffect,JN=XN||(e=>e());function ci(e){const t=p.useRef(()=>{});return JN(()=>{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 so=typeof document<"u"?p.useLayoutEffect:p.useEffect;let D1=!1,ZN=0;const I1=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+ZN++;function e4(){const[e,t]=p.useState(()=>D1?I1():void 0);return so(()=>{e==null&&t(I1())},[]),p.useEffect(()=>{D1=!0},[]),e}const t4=aE.useId,lE=t4||e4;function n4(){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 r4=p.createContext(null),o4=p.createContext(null),Dv=()=>{var e;return((e=p.useContext(r4))==null?void 0:e.id)||null},Iv=()=>p.useContext(o4);function Av(e){return"data-floating-ui-"+e}function A1(e){const t=p.useRef(e);return so(()=>{t.current=e}),t}const N1=Av("safe-polygon");function ad(e,t,n){return n&&!_m(n)?0:typeof e=="number"?e:e==null?void 0:e[t]}function i4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,dataRef:o,events:i,elements:{domReference:a,floating:l}}=e,{enabled:c=!0,delay:u=0,handleClose:d=null,mouseOnly:f=!1,restMs:h=0,move:m=!0}=t,g=Iv(),v=Dv(),S=A1(d),y=A1(u),w=p.useRef(),x=p.useRef(-1),b=p.useRef(),C=p.useRef(-1),E=p.useRef(!0),j=p.useRef(!1),P=p.useRef(()=>{}),_=p.useCallback(()=>{var N;const A=(N=o.current.openEvent)==null?void 0:N.type;return(A==null?void 0:A.includes("mouse"))&&A!=="mousedown"},[o]);p.useEffect(()=>{if(!c)return;function N(A){let{open:L}=A;L||(clearTimeout(x.current),clearTimeout(C.current),E.current=!0)}return i.on("openchange",N),()=>{i.off("openchange",N)}},[c,i]),p.useEffect(()=>{if(!c||!S.current||!n)return;function N(L){_()&&r(!1,L,"hover")}const A=Xi(l).documentElement;return A.addEventListener("mouseleave",N),()=>{A.removeEventListener("mouseleave",N)}},[l,n,r,c,S,_]);const R=p.useCallback(function(N,A,L){A===void 0&&(A=!0),L===void 0&&(L="hover");const I=ad(y.current,"close",w.current);I&&!b.current?(clearTimeout(x.current),x.current=window.setTimeout(()=>r(!1,N,L),I)):A&&(clearTimeout(x.current),r(!1,N,L))},[y,r]),M=ci(()=>{P.current(),b.current=void 0}),D=ci(()=>{if(j.current){const N=Xi(l).body;N.style.pointerEvents="",N.removeAttribute(N1),j.current=!1}});return p.useEffect(()=>{if(!c)return;function N(){return o.current.openEvent?["click","mousedown"].includes(o.current.openEvent.type):!1}function A(k){if(clearTimeout(x.current),E.current=!1,f&&!_m(w.current)||h>0&&!ad(y.current,"open"))return;const T=ad(y.current,"open",w.current);T?x.current=window.setTimeout(()=>{r(!0,k,"hover")},T):r(!0,k,"hover")}function L(k){if(N())return;P.current();const T=Xi(l);if(clearTimeout(C.current),S.current&&o.current.floatingContext){n||clearTimeout(x.current),b.current=S.current({...o.current.floatingContext,tree:g,x:k.clientX,y:k.clientY,onClose(){D(),M(),R(k,!0,"safe-polygon")}});const V=b.current;T.addEventListener("mousemove",V),P.current=()=>{T.removeEventListener("mousemove",V)};return}(w.current==="touch"?!sc(l,k.relatedTarget):!0)&&R(k)}function I(k){N()||o.current.floatingContext&&(S.current==null||S.current({...o.current.floatingContext,tree:g,x:k.clientX,y:k.clientY,onClose(){D(),M(),R(k)}})(k))}if(Rt(a)){const k=a;return n&&k.addEventListener("mouseleave",I),l==null||l.addEventListener("mouseleave",I),m&&k.addEventListener("mousemove",A,{once:!0}),k.addEventListener("mouseenter",A),k.addEventListener("mouseleave",L),()=>{n&&k.removeEventListener("mouseleave",I),l==null||l.removeEventListener("mouseleave",I),m&&k.removeEventListener("mousemove",A),k.removeEventListener("mouseenter",A),k.removeEventListener("mouseleave",L)}}},[a,l,c,e,f,h,m,R,M,D,r,n,g,y,S,o]),so(()=>{var N;if(c&&n&&(N=S.current)!=null&&N.__options.blockPointerEvents&&_()){const L=Xi(l).body;if(L.setAttribute(N1,""),L.style.pointerEvents="none",j.current=!0,Rt(a)&&l){var A;const I=a,k=g==null||(A=g.nodesRef.current.find(T=>T.id===v))==null||(A=A.context)==null?void 0:A.elements.floating;return k&&(k.style.pointerEvents=""),I.style.pointerEvents="auto",l.style.pointerEvents="auto",()=>{I.style.pointerEvents="",l.style.pointerEvents=""}}}},[c,n,v,l,a,g,S,_]),so(()=>{n||(w.current=void 0,M(),D())},[n,M,D]),p.useEffect(()=>()=>{M(),clearTimeout(x.current),clearTimeout(C.current),D()},[c,a,M,D]),p.useMemo(()=>{if(!c)return{};function N(A){w.current=A.pointerType}return{reference:{onPointerDown:N,onPointerEnter:N,onMouseMove(A){function L(){E.current||r(!0,A.nativeEvent,"hover")}f&&!_m(w.current)||n||h===0||(clearTimeout(C.current),w.current==="touch"?L():C.current=window.setTimeout(L,h))}},floating:{onMouseEnter(){clearTimeout(x.current)},onMouseLeave(A){R(A.nativeEvent,!1)}}}},[c,f,n,h,r,R])}const Mm=()=>{},cE=p.createContext({delay:0,initialDelay:0,timeoutMs:0,currentId:null,setCurrentId:Mm,setState:Mm,isInstantPhase:!1}),uE=()=>p.useContext(cE);function s4(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 so(()=>{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(cE.Provider,{value:p.useMemo(()=>({...o,setState:i,setCurrentId:l}),[o,l])},t)}function a4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,floatingId:o}=e,{id:i}=t,a=i??o,l=uE(),{currentId:c,setCurrentId:u,initialDelay:d,setState:f,timeoutMs:h}=l;return so(()=>{c&&(f({delay:{open:1,close:ad(d,"close")}}),c!==a&&r(!1))},[a,r,f,c,d]),so(()=>{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]),so(()=>{u===Mm||!n||u(a)},[n,u,a]),l}function fp(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 l4={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},c4={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},M1=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 u4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,elements:{reference:o,domReference:i,floating:a},dataRef:l}=e,{enabled:c=!0,escapeKey:u=!0,outsidePress:d=!0,outsidePressEvent:f="pointerdown",referencePress:h=!1,referencePressEvent:m="pointerdown",ancestorScroll:g=!1,bubbles:v,capture:S}=t,y=Iv(),w=ci(typeof d=="function"?d:()=>!1),x=typeof d=="function"?w:d,b=p.useRef(!1),C=p.useRef(!1),{escapeKey:E,outsidePress:j}=M1(v),{escapeKey:P,outsidePress:_}=M1(S),R=ci(A=>{var L;if(!n||!c||!u||A.key!=="Escape")return;const I=(L=l.current.floatingContext)==null?void 0:L.nodeId,k=y?fp(y.nodesRef.current,I):[];if(!E&&(A.stopPropagation(),k.length>0)){let T=!0;if(k.forEach($=>{var V;if((V=$.context)!=null&&V.open&&!$.context.dataRef.current.__escapeKeyBubbles){T=!1;return}}),!T)return}r(!1,rN(A)?A.nativeEvent:A,"escape-key")}),M=ci(A=>{var L;const I=()=>{var k;R(A),(k=Ks(A))==null||k.removeEventListener("keydown",I)};(L=Ks(A))==null||L.addEventListener("keydown",I)}),D=ci(A=>{var L;const I=b.current;b.current=!1;const k=C.current;if(C.current=!1,f==="click"&&k||I||typeof x=="function"&&!x(A))return;const T=Ks(A),$="["+Av("inert")+"]",V=Xi(a).querySelectorAll($);let U=Rt(T)?T:null;for(;U&&!Ti(U);){const xe=Do(U);if(Ti(xe)||!Rt(xe))break;U=xe}if(V.length&&Rt(T)&&!oN(T)&&!sc(T,a)&&Array.from(V).every(xe=>!sc(U,xe)))return;if(ir(T)&&a){const xe=T.clientWidth>0&&T.scrollWidth>T.clientWidth,Te=T.clientHeight>0&&T.scrollHeight>T.clientHeight;let je=Te&&A.offsetX>T.clientWidth;if(Te&&jr(T).direction==="rtl"&&(je=A.offsetX<=T.offsetWidth-T.clientWidth),je||xe&&A.offsetY>T.clientHeight)return}const X=(L=l.current.floatingContext)==null?void 0:L.nodeId,Se=y&&fp(y.nodesRef.current,X).some(xe=>{var Te;return up(A,(Te=xe.context)==null?void 0:Te.elements.floating)});if(up(A,a)||up(A,i)||Se)return;const me=y?fp(y.nodesRef.current,X):[];if(me.length>0){let xe=!0;if(me.forEach(Te=>{var je;if((je=Te.context)!=null&&je.open&&!Te.context.dataRef.current.__outsidePressBubbles){xe=!1;return}}),!xe)return}r(!1,A,"outside-press")}),N=ci(A=>{var L;const I=()=>{var k;D(A),(k=Ks(A))==null||k.removeEventListener(f,I)};(L=Ks(A))==null||L.addEventListener(f,I)});return p.useEffect(()=>{if(!n||!c)return;l.current.__escapeKeyBubbles=E,l.current.__outsidePressBubbles=j;function A(k){r(!1,k,"ancestor-scroll")}const L=Xi(a);u&&L.addEventListener("keydown",P?M:R,P),x&&L.addEventListener(f,_?N:D,_);let I=[];return g&&(Rt(i)&&(I=Co(i)),Rt(a)&&(I=I.concat(Co(a))),!Rt(o)&&o&&o.contextElement&&(I=I.concat(Co(o.contextElement)))),I=I.filter(k=>{var T;return k!==((T=L.defaultView)==null?void 0:T.visualViewport)}),I.forEach(k=>{k.addEventListener("scroll",A,{passive:!0})}),()=>{u&&L.removeEventListener("keydown",P?M:R,P),x&&L.removeEventListener(f,_?N:D,_),I.forEach(k=>{k.removeEventListener("scroll",A)})}},[l,a,i,o,u,x,f,n,r,g,c,E,j,R,P,M,D,_,N]),p.useEffect(()=>{b.current=!1},[x,f]),p.useMemo(()=>c?{reference:{onKeyDown:R,[l4[m]]:A=>{h&&r(!1,A.nativeEvent,"reference-press")}},floating:{onKeyDown:R,onMouseDown(){C.current=!0},onMouseUp(){C.current=!0},[c4[f]]:()=>{b.current=!0}}}:{},[c,h,f,m,r,R])}function d4(e){const{open:t=!1,onOpenChange:n,elements:r}=e,o=lE(),i=p.useRef({}),[a]=p.useState(()=>n4()),l=Dv()!=null,[c,u]=p.useState(r.reference),d=ci((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 Nv(e){e===void 0&&(e={});const{nodeId:t}=e,n=d4({...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=Iv();so(()=>{d&&(f.current=d)},[d]);const m=QN({...e,elements:{...o,...l&&{reference:l}}}),g=p.useCallback(x=>{const b=Rt(x)?{getBoundingClientRect:()=>x.getBoundingClientRect(),contextElement:x}:x;c(b),m.refs.setReference(b)},[m.refs]),v=p.useCallback(x=>{(Rt(x)||x===null)&&(f.current=x,a(x)),(Rt(m.refs.reference.current)||m.refs.reference.current===null||x!==null&&!Rt(x))&&m.refs.setReference(x)},[m.refs]),S=p.useMemo(()=>({...m.refs,setReference:v,setPositionReference:g,domReference:f}),[m.refs,v,g]),y=p.useMemo(()=>({...m.elements,domReference:d}),[m.elements,d]),w=p.useMemo(()=>({...m,...r,refs:S,elements:y,nodeId:t}),[m,S,y,t,r]);return so(()=>{r.dataRef.current.floatingContext=w;const x=h==null?void 0:h.nodesRef.current.find(b=>b.id===t);x&&(x.context=w)}),p.useMemo(()=>({...m,context:w,refs:S,elements:y}),[m,S,y,w])}function f4(e,t){t===void 0&&(t={});const{open:n,onOpenChange:r,events:o,dataRef:i,elements:{domReference:a}}=e,{enabled:l=!0,visibleOnly:c=!0}=t,u=p.useRef(!1),d=p.useRef(),f=p.useRef(!0);return p.useEffect(()=>{if(!l)return;const h=qn(a);function m(){!n&&ir(a)&&a===b1(Xi(a))&&(u.current=!0)}function g(){f.current=!0}return h.addEventListener("blur",m),h.addEventListener("keydown",g,!0),()=>{h.removeEventListener("blur",m),h.removeEventListener("keydown",g,!0)}},[a,n,l]),p.useEffect(()=>{if(!l)return;function h(m){let{reason:g}=m;(g==="reference-press"||g==="escape-key")&&(u.current=!0)}return o.on("openchange",h),()=>{o.off("openchange",h)}},[o,l]),p.useEffect(()=>()=>{clearTimeout(d.current)},[]),p.useMemo(()=>l?{reference:{onPointerDown(h){ZA(h.nativeEvent)||(f.current=!1)},onMouseLeave(){u.current=!1},onFocus(h){if(u.current)return;const m=Ks(h.nativeEvent);if(c&&Rt(m))try{if(eN()&&tN())throw Error();if(!m.matches(":focus-visible"))return}catch{if(!f.current&&!sN(m))return}r(!0,h.nativeEvent,"focus")},onBlur(h){u.current=!1;const m=h.relatedTarget,g=Rt(m)&&m.hasAttribute(Av("focus-guard"))&&m.getAttribute("data-type")==="outside";d.current=window.setTimeout(()=>{var v;const S=b1(a?a.ownerDocument:document);!m&&S===a||sc((v=i.current.floatingContext)==null?void 0:v.refs.floating.current,S)||sc(a,S)||g||r(!1,h.nativeEvent,"focus")})}}}:{},[l,c,i,a,r])}const O1="active",$1="selected";function hp(e,t,n){const r=new Map,o=n==="item";let i=e;if(o&&e){const{[O1]:a,[$1]:l,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1},...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&&[O1,$1].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 h4(e){e===void 0&&(e=[]);const t=e,n=p.useCallback(i=>hp(i,e,"reference"),t),r=p.useCallback(i=>hp(i,e,"floating"),t),o=p.useCallback(i=>hp(i,e,"item"),e.map(i=>i==null?void 0:i.item));return p.useMemo(()=>({getReferenceProps:n,getFloatingProps:r,getItemProps:o}),[n,r,o])}const p4=new Map([["select","listbox"],["combobox","listbox"],["label",!1]]);function m4(e,t){var n;t===void 0&&(t={});const{open:r,floatingId:o}=e,{enabled:i=!0,role:a="dialog"}=t,l=(n=p4.get(a))!=null?n:a,c=lE(),d=Dv()!=null;return p.useMemo(()=>{if(!i)return{};const f={id:o,...l&&{role:l}};return l==="tooltip"||a==="label"?{reference:{["aria-"+(a==="label"?"labelledby":"describedby")]:r?o:void 0},floating:f}:{reference:{"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"}},floating:{...f,...l==="menu"&&{"aria-labelledby":c}},item(h){let{active:m,selected:g}=h;const v={role:"option",...m&&{id:o+"-option"}};switch(a){case"select":return{...v,"aria-selected":m&&g};case"combobox":return{...v,...m&&{"aria-selected":!0}}}return{}}}},[i,a,l,r,o,c,d])}function dE(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 L1(e,t,n,r){return e==="center"||r==="center"?{top:t}:e==="end"?{bottom:n}:e==="start"?{top:n}:{}}function F1(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 g4={bottom:"borderTopLeftRadius",left:"borderTopRightRadius",right:"borderBottomLeftRadius",top:"borderBottomRightRadius"};function v4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,arrowX:i,arrowY:a,dir:l}){const[c,u="center"]=e.split("-"),d={width:z(t),height:z(t),transform:"rotate(45deg)",position:"absolute",[g4[c]]:z(r)},f=z(-t/2);return c==="left"?{...d,...L1(u,a,n,o),right:f,borderLeftColor:"transparent",borderBottomColor:"transparent"}:c==="right"?{...d,...L1(u,a,n,o),left:f,borderRightColor:"transparent",borderTopColor:"transparent"}:c==="top"?{...d,...F1(u,i,n,o,l),bottom:f,borderTopColor:"transparent",borderLeftColor:"transparent"}:c==="bottom"?{...d,...F1(u,i,n,o,l),top:f,borderBottomColor:"transparent",borderRightColor:"transparent"}:{}}const Mv=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}=Ua();return i?s.jsx("div",{...u,ref:d,style:{...c,...v4({position:e,arrowSize:t,arrowOffset:n,arrowRadius:r,arrowPosition:o,dir:f,arrowX:a,arrowY:l})}}):null});Mv.displayName="@mantine/core/FloatingArrow";const[y4,fE]=On("Popover component was not found in the tree");function Df({children:e,active:t=!0,refProp:n="ref"}){const r=c_(t),o=qt(r,e==null?void 0:e.ref);return $o(e)?p.cloneElement(e,{[n]:o}):e}function hE(e){return s.jsx(wv,{tabIndex:-1,"data-autofocus":!0,...e})}Df.displayName="@mantine/core/FocusTrap";hE.displayName="@mantine/core/FocusTrapInitialFocus";Df.InitialFocus=hE;function x4(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 w4={},pE=p.forwardRef((e,t)=>{const{children:n,target:r,...o}=B("Portal",w4,e),[i,a]=p.useState(!1),l=p.useRef(null);return Va(()=>(a(!0),l.current=r?typeof r=="string"?document.querySelector(r):r:x4(o),uf(t,l.current),!r&&l.current&&document.body.appendChild(l.current),()=>{!r&&l.current&&document.body.removeChild(l.current)}),[r]),!i||!l.current?null:Dc.createPortal(s.jsx(s.Fragment,{children:n}),l.current)});pE.displayName="@mantine/core/Portal";function js({withinPortal:e=!0,children:t,...n}){return e?s.jsx(pE,{...n,children:t}):s.jsx(s.Fragment,{children:t})}js.displayName="@mantine/core/OptionalPortal";const gl=e=>({in:{opacity:1,transform:"scale(1)"},out:{opacity:0,transform:`scale(.9) translateY(${z(e==="bottom"?10:-10)})`},transitionProperty:"transform, opacity"}),Fu={fade:{in:{opacity:1},out:{opacity:0},transitionProperty:"opacity"},"fade-up":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${z(30)}`},transitionProperty:"opacity, transform"},"fade-down":{in:{opacity:1,transform:"translateY(0)"},out:{opacity:0,transform:`translateY(${z(-30)}`},transitionProperty:"opacity, transform"},"fade-left":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${z(30)}`},transitionProperty:"opacity, transform"},"fade-right":{in:{opacity:1,transform:"translateX(0)"},out:{opacity:0,transform:`translateX(${z(-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(${z(-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(${z(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(${z(20)}) rotate(-5deg)`},common:{transformOrigin:"bottom"},transitionProperty:"transform, opacity"},"rotate-right":{in:{opacity:1,transform:"translateY(0) rotate(0deg)"},out:{opacity:0,transform:`translateY(${z(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:{...gl("bottom"),common:{transformOrigin:"center center"}},"pop-bottom-left":{...gl("bottom"),common:{transformOrigin:"bottom left"}},"pop-bottom-right":{...gl("bottom"),common:{transformOrigin:"bottom right"}},"pop-top-left":{...gl("top"),common:{transformOrigin:"top left"}},"pop-top-right":{...gl("top"),common:{transformOrigin:"top right"}}},z1={entering:"in",entered:"in",exiting:"out",exited:"out","pre-exiting":"out","pre-entering":"out"};function S4({transition:e,state:t,duration:n,timingFunction:r}){const o={transitionDuration:`${n}ms`,transitionTimingFunction:r};return typeof e=="string"?e in Fu?{transitionProperty:Fu[e].transitionProperty,...o,...Fu[e].common,...Fu[e][z1[t]]}:{}:{transitionProperty:e.transitionProperty,...o,...e.common,...e[z1[t]]}}function b4({duration:e,exitDuration:t,timingFunction:n,mounted:r,onEnter:o,onExit:i,onEntered:a,onExited:l}){const c=Dt(),u=jg(),d=c.respectReducedMotion?u:!1,[f,h]=p.useState(d?0:e),[m,g]=p.useState(r?"entered":"exited"),v=p.useRef(-1),S=p.useRef(-1),y=w=>{const x=w?o:i,b=w?a:l;window.clearTimeout(v.current);const C=d?0:w?e:t;h(C),C===0?(typeof x=="function"&&x(),typeof b=="function"&&b(),g(w?"entered":"exited")):S.current=requestAnimationFrame(()=>{ca.flushSync(()=>{g(w?"pre-entering":"pre-exiting")}),S.current=requestAnimationFrame(()=>{typeof x=="function"&&x(),g(w?"entering":"exiting"),v.current=window.setTimeout(()=>{typeof b=="function"&&b(),g(w?"entered":"exited")},C)})})};return Po(()=>{y(r)},[r]),p.useEffect(()=>()=>{window.clearTimeout(v.current),cancelAnimationFrame(S.current)},[]),{transitionDuration:f,transitionStatus:m,transitionTimingFunction:n||"ease"}}function Vo({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}){const{transitionDuration:f,transitionStatus:h,transitionTimingFunction:m}=b4({mounted:o,exitDuration:r,duration:n,timingFunction:a,onExit:l,onEntered:c,onEnter:u,onExited:d});return f===0?o?s.jsx(s.Fragment,{children:i({})}):e?i({display:"none"}):null:h==="exited"?e?i({display:"none"}):null:s.jsx(s.Fragment,{children:i(S4({transition:t,duration:f,state:h,timingFunction:m}))})}Vo.displayName="@mantine/core/Transition";var mE={dropdown:"m_38a85659",arrow:"m_a31dc6c1"};const j4={},Ov=Y((e,t)=>{var S,y,w,x;const n=B("PopoverDropdown",j4,e),{className:r,style:o,vars:i,children:a,onKeyDownCapture:l,variant:c,classNames:u,styles:d,...f}=n,h=fE(),m=pb({opened:h.opened,shouldReturnFocus:h.returnFocus}),g=h.withRoles?{"aria-labelledby":h.getTargetId(),id:h.getDropdownId(),role:"dialog",tabIndex:-1}:{},v=qt(t,h.floating);return h.disabled?null:s.jsx(js,{...h.portalProps,withinPortal:h.withinPortal,children:s.jsx(Vo,{mounted:h.opened,...h.transitionProps,transition:((S=h.transitionProps)==null?void 0:S.transition)||"fade",duration:((y=h.transitionProps)==null?void 0:y.duration)??150,keepMounted:h.keepMounted,exitDuration:typeof((w=h.transitionProps)==null?void 0:w.exitDuration)=="number"?h.transitionProps.exitDuration:(x=h.transitionProps)==null?void 0:x.duration,children:b=>s.jsx(Df,{active:h.trapFocus,children:s.jsxs(q,{...g,...f,variant:c,ref:v,onKeyDownCapture:Y2(h.onClose,{active:h.closeOnEscape,onTrigger:m,onKeyDown:l}),"data-position":h.placement,...h.getStyles("dropdown",{className:r,props:n,classNames:u,styles:d,style:[{...b,zIndex:h.zIndex,top:h.y??0,left:h.x??0,width:h.width==="target"?void 0:z(h.width)},o]}),children:[a,s.jsx(Mv,{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})})]})})})})});Ov.classes=mE;Ov.displayName="@mantine/core/PopoverDropdown";const C4={refProp:"ref",popupType:"dialog"},gE=Y((e,t)=>{const{children:n,refProp:r,popupType:o,...i}=B("PopoverTarget",C4,e);if(!$o(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=fE(),c=qt(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:nt(l.targetProps.className,a.className,n.props.className),[r]:c,...l.controlled?null:{onClick:l.onToggle}})});gE.displayName="@mantine/core/PopoverTarget";function vE({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 zN(t.refs.reference.current,t.refs.floating.current,t.update)},[t.refs.reference.current,t.refs.floating.current,e,o,n]),Po(()=>{t.update()},r),Po(()=>{i(a=>a+1)},[e])}function E4(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 P4(e,t){const n=E4(e.middlewares),r=[iE(e.offset)];return n.shift&&r.push(_v(typeof n.shift=="boolean"?{limiter:_1(),padding:5}:{limiter:_1(),padding:5,...n.shift})),n.flip&&r.push(typeof n.flip=="boolean"?Am():Am(n.flip)),n.inline&&r.push(typeof n.inline=="boolean"?Nm():Nm(n.inline)),r.push(sE({element:e.arrowRef,padding:e.arrowOffset})),(n.size||e.width==="target")&&r.push(YN({...typeof n.size=="boolean"?{}:n.size,apply({rects:o,availableWidth:i,availableHeight:a}){var u;const c=((u=t().refs.floating.current)==null?void 0:u.style)??{};n.size&&Object.assign(c,{maxWidth:`${i}px`,maxHeight:`${a}px`}),e.width==="target"&&Object.assign(c,{width:`${o.reference.width}px`})}})),r}function T4(e){const[t,n]=pn({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=Nv({strategy:e.strategy,placement:e.position,middleware:P4(e,()=>i)});return vE({opened:e.opened,position:e.position,positionDependencies:e.positionDependencies||[],floating:i}),Po(()=>{var a;(a=e.onPositionChange)==null||a.call(e,i.placement)},[i.placement]),Po(()=>{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 k4={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:Wr("popover"),__staticSelector:"Popover",width:"max-content"},R4=(e,{radius:t,shadow:n})=>({dropdown:{"--popover-radius":t===void 0?void 0:wt(t),"--popover-shadow":wg(n)}});function qr(e){var Ee,Qe,Ke,Fe,K,G;const t=B("Popover",k4,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:y,styles:w,closeOnClickOutside:x,withinPortal:b,portalProps:C,closeOnEscape:E,clickOutsideEvents:j,trapFocus:P,onClose:_,onOpen:R,onChange:M,zIndex:D,radius:N,shadow:A,id:L,defaultOpened:I,__staticSelector:k,withRoles:T,disabled:$,returnFocus:V,variant:U,keepMounted:X,vars:Se,floatingStrategy:me,...xe}=t,Te=pe({name:k,props:t,classes:mE,classNames:y,styles:w,unstyled:S,rootSelector:"dropdown",vars:Se,varsResolver:R4}),je=p.useRef(null),[ae,Be]=p.useState(null),[St,st]=p.useState(null),{dir:ye}=Ua(),$e=$n(L),Ie=T4({middlewares:d,width:u,position:dE(ye,r),offset:typeof o=="number"?o+(f?h/2:0):o,arrowRef:je,arrowOffset:m,onPositionChange:i,positionDependencies:a,opened:l,defaultOpened:I,onChange:M,onOpen:R,onClose:_,strategy:me});Z2(()=>x&&Ie.onClose(),j,[ae,St]);const ee=p.useCallback(fe=>{Be(fe),Ie.floating.refs.setReference(fe)},[Ie.floating.refs.setReference]),te=p.useCallback(fe=>{st(fe),Ie.floating.refs.setFloating(fe)},[Ie.floating.refs.setFloating]);return s.jsx(y4,{value:{returnFocus:V,disabled:$,controlled:Ie.controlled,reference:ee,floating:te,x:Ie.floating.x,y:Ie.floating.y,arrowX:(Ke=(Qe=(Ee=Ie.floating)==null?void 0:Ee.middlewareData)==null?void 0:Qe.arrow)==null?void 0:Ke.x,arrowY:(G=(K=(Fe=Ie.floating)==null?void 0:Fe.middlewareData)==null?void 0:K.arrow)==null?void 0:G.y,opened:Ie.opened,arrowRef:je,transitionProps:c,width:u,withArrow:f,arrowSize:h,arrowOffset:m,arrowRadius:g,arrowPosition:v,placement:Ie.floating.placement,trapFocus:P,withinPortal:b,portalProps:C,zIndex:D,radius:N,shadow:A,closeOnEscape:E,onClose:Ie.onClose,onToggle:Ie.onToggle,getTargetId:()=>`${$e}-target`,getDropdownId:()=>`${$e}-dropdown`,withRoles:T,targetProps:xe,__staticSelector:k,classNames:y,styles:w,unstyled:S,variant:U,keepMounted:X,getStyles:Te},children:n})}qr.Target=gE;qr.Dropdown=Ov;qr.displayName="@mantine/core/Popover";qr.extend=e=>e;var $r={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 _4=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:nt($r.barsLoader,e),...t,ref:n,children:[s.jsx("span",{className:$r.bar}),s.jsx("span",{className:$r.bar}),s.jsx("span",{className:$r.bar})]})),D4=p.forwardRef(({className:e,...t},n)=>s.jsxs(q,{component:"span",className:nt($r.dotsLoader,e),...t,ref:n,children:[s.jsx("span",{className:$r.dot}),s.jsx("span",{className:$r.dot}),s.jsx("span",{className:$r.dot})]})),I4=p.forwardRef(({className:e,...t},n)=>s.jsx(q,{component:"span",className:nt($r.ovalLoader,e),...t,ref:n})),yE={bars:_4,oval:I4,dots:D4},A4={loaders:yE,type:"oval"},N4=(e,{size:t,color:n})=>({root:{"--loader-size":Oe(t,"loader-size"),"--loader-color":n?xt(n,e):void 0}}),Qn=Y((e,t)=>{const n=B("Loader",A4,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=pe({name:"Loader",props:n,classes:$r,className:l,style:c,classNames:u,styles:d,unstyled:f,vars:a,varsResolver:N4});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})});Qn.defaultLoaders=yE;Qn.classes=$r;Qn.displayName="@mantine/core/Loader";var If={root:"m_8d3f4000",icon:"m_8d3afb97",loader:"m_302b9fb1",group:"m_1a0f1b21"};const V1={orientation:"horizontal"},M4=(e,{borderWidth:t})=>({group:{"--ai-border-width":z(t)}}),$v=Y((e,t)=>{const n=B("ActionIconGroup",V1,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=B("ActionIconGroup",V1,e),g=pe({name:"ActionIconGroup",props:n,classes:If,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:M4,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});$v.classes=If;$v.displayName="@mantine/core/ActionIconGroup";const O4={},$4=(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":Oe(t,"ai-size"),"--ai-radius":n===void 0?void 0:wt(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}}},Zt=jn((e,t)=>{const n=B("ActionIcon",O4,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:y,disabled:w,"data-disabled":x,autoContrast:b,mod:C,...E}=n,j=pe({name:["ActionIcon",g],props:n,className:r,style:c,classes:If,classNames:a,styles:l,unstyled:o,vars:S,varsResolver:$4});return s.jsxs(An,{...j("root",{active:!w&&!u&&!x}),...E,unstyled:o,variant:i,size:f,disabled:w||u,ref:t,mod:[{loading:u,disabled:w||x},C],children:[s.jsx(Vo,{mounted:!!u,transition:"slide-down",duration:150,children:P=>s.jsx(q,{component:"span",...j("loader",{style:P}),"aria-hidden":!0,children:s.jsx(Qn,{color:"var(--ai-color)",size:"calc(var(--ai-size) * 0.55)",...d})})}),s.jsx(q,{component:"span",mod:{loading:u},...j("icon"),children:y})]})});Zt.classes=If;Zt.displayName="@mantine/core/ActionIcon";Zt.Group=$v;const xE=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"})}));xE.displayName="@mantine/core/CloseIcon";var wE={root:"m_86a44da5","root--subtle":"m_220c80f2"};const L4={variant:"subtle"},F4=(e,{size:t,radius:n,iconSize:r})=>({root:{"--cb-size":Oe(t,"cb-size"),"--cb-radius":n===void 0?void 0:wt(n),"--cb-icon-size":z(r)}}),Cs=jn((e,t)=>{const n=B("CloseButton",L4,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,...y}=n,w=pe({name:"CloseButton",props:n,className:l,style:u,classes:wE,classNames:c,styles:d,unstyled:f,vars:i,varsResolver:F4});return s.jsxs(An,{ref:t,...y,unstyled:f,variant:g,disabled:m,mod:[{disabled:m||h},S],...w("root",{variant:g,active:!m&&!h}),children:[v||s.jsx(xE,{}),o]})});Cs.classes=wE;Cs.displayName="@mantine/core/CloseButton";function z4(e){return p.Children.toArray(e).filter(Boolean)}var SE={root:"m_4081bf90"};const V4={preventGrowOverflow:!0,gap:"md",align:"center",justify:"flex-start",wrap:"wrap"},B4=(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":un(r),"--group-align":o,"--group-justify":i,"--group-wrap":a}}),Z=Y((e,t)=>{const n=B("Group",V4,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:y,mod:w,...x}=n,b=z4(c),C=b.length,E=un(u??"md"),P={childWidth:`calc(${100/C}% - (${E} - ${E} / ${C}))`},_=pe({name:"Group",props:n,stylesCtx:P,className:o,style:i,classes:SE,classNames:r,styles:a,unstyled:l,vars:v,varsResolver:B4});return s.jsx(q,{..._("root"),ref:t,variant:S,mod:[{grow:m},w],size:y,...x,children:b})});Z.classes=SE;Z.displayName="@mantine/core/Group";var bE={root:"m_9814e45f"};const U4={zIndex:Wr("modal")},H4=(e,{gradient:t,color:n,backgroundOpacity:r,blur:o,radius:i,zIndex:a})=>({root:{"--overlay-bg":t||(n!==void 0||r!==void 0)&&hr(n||"#000",r??.6)||void 0,"--overlay-filter":o?`blur(${z(o)})`:void 0,"--overlay-radius":i===void 0?void 0:wt(i),"--overlay-z-index":a==null?void 0:a.toString()}}),ac=jn((e,t)=>{const n=B("Overlay",U4,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:y,mod:w,...x}=n,b=pe({name:"Overlay",props:n,classes:bE,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:H4});return s.jsx(q,{ref:t,...b("root"),mod:[{center:d,fixed:u},w],...x,children:f})});ac.classes=bE;ac.displayName="@mantine/core/Overlay";const[W4,Bo]=On("ModalBase component was not found in tree");function q4({opened:e,transitionDuration:t}){const[n,r]=p.useState(e),o=p.useRef(),a=jg()?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 G4({id:e,transitionProps:t,opened:n,trapFocus:r,closeOnEscape:o,onClose:i,returnFocus:a}){const l=$n(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=q4({opened:n,transitionDuration:h});return yb("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}),pb({opened:n,shouldReturnFocus:r&&a}),{_id:l,titleMounted:c,bodyMounted:d,shouldLockScroll:m,setTitleMounted:u,setBodyMounted:f}}const Q4=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:y,removeScrollProps:w,...x},b)=>{const{_id:C,titleMounted:E,bodyMounted:j,shouldLockScroll:P,setTitleMounted:_,setBodyMounted:R}=G4({id:r,transitionProps:o,opened:t,trapFocus:i,closeOnEscape:a,onClose:n,returnFocus:l});return s.jsx(js,{...d,withinPortal:u,children:s.jsx(W4,{value:{opened:t,onClose:n,closeOnClickOutside:c,transitionProps:{...o,keepMounted:e},getTitleId:()=>`${C}-title`,getBodyId:()=>`${C}-body`,titleMounted:E,bodyMounted:j,setTitleMounted:_,setBodyMounted:R,trapFocus:i,closeOnEscape:a,zIndex:m,unstyled:y},children:s.jsx(lf,{enabled:P&&f,...w,children:s.jsx(q,{ref:b,...x,__vars:{...S,"--mb-z-index":(m||Wr("modal")).toString(),"--mb-shadow":wg(g),"--mb-padding":un(v)},children:h})})})})});function K4(){const e=Bo();return p.useEffect(()=>(e.setBodyMounted(!0),()=>e.setBodyMounted(!1)),[]),e.getBodyId()}var Ia={title:"m_615af6c9",header:"m_b5489c3c",inner:"m_60c222c7",content:"m_fd1ab0aa",close:"m_606cb269",body:"m_5df29311"};const jE=p.forwardRef(({className:e,...t},n)=>{const r=K4(),o=Bo();return s.jsx(q,{ref:n,...t,id:r,className:nt({[Ia.body]:!o.unstyled},e)})});jE.displayName="@mantine/core/ModalBaseBody";const CE=p.forwardRef(({className:e,onClick:t,...n},r)=>{const o=Bo();return s.jsx(Cs,{ref:r,...n,onClick:i=>{o.onClose(),t==null||t(i)},className:nt({[Ia.close]:!o.unstyled},e),unstyled:o.unstyled})});CE.displayName="@mantine/core/ModalBaseCloseButton";const Y4=p.forwardRef(({transitionProps:e,className:t,innerProps:n,onKeyDown:r,style:o,...i},a)=>{const l=Bo();return s.jsx(Vo,{mounted:l.opened,transition:"pop",...l.transitionProps,...e,children:c=>s.jsx("div",{...n,className:nt({[Ia.inner]:!l.unstyled},n.className),children:s.jsx(Df,{active:l.opened&&l.trapFocus,children:s.jsx(Wn,{...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,ref:a,style:[o,c],className:nt({[Ia.content]:!l.unstyled},t),unstyled:l.unstyled,children:i.children})})})})}),EE=p.forwardRef(({className:e,...t},n)=>{const r=Bo();return s.jsx(q,{component:"header",ref:n,className:nt({[Ia.header]:!r.unstyled},e),...t})});EE.displayName="@mantine/core/ModalBaseHeader";const X4={duration:200,timingFunction:"ease",transition:"fade"};function J4(e){const t=Bo();return{...X4,...t.transitionProps,...e}}const PE=p.forwardRef(({onClick:e,transitionProps:t,style:n,...r},o)=>{const i=Bo(),a=J4(t);return s.jsx(Vo,{mounted:i.opened,...a,transition:"fade",children:l=>s.jsx(ac,{ref:o,fixed:!0,style:[n,l],zIndex:i.zIndex,unstyled:i.unstyled,onClick:c=>{e==null||e(c),i.closeOnClickOutside&&i.onClose()},...r})})});PE.displayName="@mantine/core/ModalBaseOverlay";function Z4(){const e=Bo();return p.useEffect(()=>(e.setTitleMounted(!0),()=>e.setTitleMounted(!1)),[]),e.getTitleId()}const TE=p.forwardRef(({className:e,...t},n)=>{const r=Z4(),o=Bo();return s.jsx(q,{component:"h2",ref:n,className:nt({[Ia.title]:!o.unstyled},e),...t,id:r})});TE.displayName="@mantine/core/ModalBaseTitle";function e3({children:e}){return s.jsx(s.Fragment,{children:e})}const[t3,Qa]=jc({offsetBottom:!1,offsetTop:!1,describedBy:void 0,getStyles:null,inputId:void 0,labelId:void 0});var Tr={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 B1={},n3=(e,{size:t})=>({description:{"--input-description-size":t===void 0?void 0:`calc(${rn(t)} - ${z(2)})`}}),Af=Y((e,t)=>{const n=B("InputDescription",B1,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,__staticSelector:d,__inheritStyles:f=!0,variant:h,...m}=B("InputDescription",B1,n),g=Qa(),v=pe({name:["InputWrapper",d],props:n,classes:Tr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"description",vars:c,varsResolver:n3}),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})});Af.classes=Tr;Af.displayName="@mantine/core/InputDescription";const r3={},o3=(e,{size:t})=>({error:{"--input-error-size":t===void 0?void 0:`calc(${rn(t)} - ${z(2)})`}}),Nf=Y((e,t)=>{const n=B("InputError",r3,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=pe({name:["InputWrapper",d],props:n,classes:Tr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"error",vars:c,varsResolver:o3}),v=Qa(),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})});Nf.classes=Tr;Nf.displayName="@mantine/core/InputError";const U1={labelElement:"label"},i3=(e,{size:t})=>({label:{"--input-label-size":rn(t),"--input-asterisk-color":void 0}}),Mf=Y((e,t)=>{const n=B("InputLabel",U1,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:y,...w}=B("InputLabel",U1,n),x=pe({name:["InputWrapper",v],props:n,classes:Tr,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"label",vars:c,varsResolver:i3}),b=Qa(),C=(b==null?void 0:b.getStyles)||x;return s.jsxs(q,{...C("label",b!=null&&b.getStyles?{className:o,style:i}:void 0),component:u,variant:S,size:d,ref:t,htmlFor:u==="label"?h:void 0,mod:[{required:f},y],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:" *"})]})});Mf.classes=Tr;Mf.displayName="@mantine/core/InputLabel";const H1={},Lv=Y((e,t)=>{const n=B("InputPlaceholder",H1,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,__staticSelector:u,variant:d,error:f,mod:h,...m}=B("InputPlaceholder",H1,n),g=pe({name:["InputPlaceholder",u],props:n,classes:Tr,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})});Lv.classes=Tr;Lv.displayName="@mantine/core/InputPlaceholder";function s3(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 a3={labelElement:"label",inputContainer:e=>e,inputWrapperOrder:["label","description","input","error"]},l3=(e,{size:t})=>({label:{"--input-label-size":rn(t),"--input-asterisk-color":void 0},error:{"--input-error-size":t===void 0?void 0:`calc(${rn(t)} - ${z(2)})`},description:{"--input-description-size":t===void 0?void 0:`calc(${rn(t)} - ${z(2)})`}}),Fv=Y((e,t)=>{const n=B("InputWrapper",a3,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:y,descriptionProps:w,errorProps:x,labelElement:b,children:C,withAsterisk:E,id:j,required:P,__stylesApiProps:_,mod:R,...M}=n,D=pe({name:["InputWrapper",f],props:_||n,classes:Tr,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:l3}),N={size:u,variant:d,__staticSelector:f},A=$n(j),L=typeof E=="boolean"?E:P,I=(x==null?void 0:x.id)||`${A}-error`,k=(w==null?void 0:w.id)||`${A}-description`,T=A,$=!!v&&typeof v!="boolean",V=!!S,U=`${$?I:""} ${V?k:""}`,X=U.trim().length>0?U.trim():void 0,Se=(y==null?void 0:y.id)||`${A}-label`,me=g&&s.jsx(Mf,{labelElement:b,id:Se,htmlFor:T,required:L,...N,...y,children:g},"label"),xe=V&&s.jsx(Af,{...w,...N,size:(w==null?void 0:w.size)||N.size,id:(w==null?void 0:w.id)||k,children:S},"description"),Te=s.jsx(p.Fragment,{children:h(C)},"input"),je=$&&p.createElement(Nf,{...x,...N,size:(x==null?void 0:x.size)||N.size,key:"error",id:(x==null?void 0:x.id)||I},v),ae=m.map(Be=>{switch(Be){case"label":return me;case"input":return Te;case"description":return xe;case"error":return je;default:return null}});return s.jsx(t3,{value:{getStyles:D,describedBy:X,inputId:T,labelId:Se,...s3(m,{hasDescription:V,hasError:$})},children:s.jsx(q,{ref:t,variant:d,size:u,mod:[{error:!!v},R],...D("root"),...M,children:ae})})});Fv.classes=Tr;Fv.displayName="@mantine/core/InputWrapper";const c3={variant:"default",leftSectionPointerEvents:"none",rightSectionPointerEvents:"none",withAria:!0,withErrorStyles:!0},u3=(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":Oe(t.size,"input-height"),"--input-fz":rn(t.size),"--input-radius":t.radius===void 0?void 0:wt(t.radius),"--input-left-section-width":t.leftSectionWidth!==void 0?z(t.leftSectionWidth):void 0,"--input-right-section-width":t.rightSectionWidth!==void 0?z(t.rightSectionWidth):void 0,"--input-padding-y":t.multiline?Oe(t.size,"input-padding-y"):void 0,"--input-left-section-pointer-events":t.leftSectionPointerEvents,"--input-right-section-pointer-events":t.rightSectionPointerEvents}}),_t=jn((e,t)=>{const n=B("Input",c3,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:y,rightSection:w,rightSectionProps:x,rightSectionWidth:b,rightSectionPointerEvents:C,leftSectionPointerEvents:E,variant:j,vars:P,pointer:_,multiline:R,radius:M,id:D,withAria:N,withErrorStyles:A,mod:L,...I}=n,{styleProps:k,rest:T}=Lo(I),$=Qa(),V={offsetBottom:$==null?void 0:$.offsetBottom,offsetTop:$==null?void 0:$.offsetTop},U=pe({name:["Input",u],props:d||n,classes:Tr,className:o,style:i,classNames:r,styles:a,unstyled:l,stylesCtx:V,rootSelector:"wrapper",vars:P,varsResolver:u3}),X=N?{required:c,disabled:g,"aria-invalid":!!m,"aria-describedby":$==null?void 0:$.describedBy,id:($==null?void 0:$.inputId)||D}:{};return s.jsxs(q,{...U("wrapper"),...k,...h,mod:[{error:!!m&&A,pointer:_,disabled:g,multiline:R,"data-with-right-section":!!w,"data-with-left-section":!!v},L],variant:j,size:f,children:[v&&s.jsx("div",{...S,"data-position":"left",...U("section",{className:S==null?void 0:S.className,style:S==null?void 0:S.style}),children:v}),s.jsx(q,{component:"input",...T,...X,ref:t,required:c,mod:{disabled:g,error:!!m&&A},variant:j,...U("input")}),w&&s.jsx("div",{...x,"data-position":"right",...U("section",{className:x==null?void 0:x.className,style:x==null?void 0:x.style}),children:w})]})});_t.classes=Tr;_t.Wrapper=Fv;_t.Label=Mf;_t.Error=Nf;_t.Description=Af;_t.Placeholder=Lv;_t.displayName="@mantine/core/Input";function d3(e,t,n){const r=B(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:y,id:w,size:x,style:b,inputContainer:C,inputWrapperOrder:E,withAsterisk:j,variant:P,vars:_,mod:R,...M}=r,{styleProps:D,rest:N}=Lo(M),A={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:x,style:b,inputContainer:C,inputWrapperOrder:E,withAsterisk:j,variant:P,id:w,mod:R,...y};return{...N,classNames:c,styles:u,unstyled:f,wrapperProps:{...A,...D},inputProps:{required:l,classNames:c,styles:u,unstyled:f,size:x,__staticSelector:h,__stylesApiProps:m||r,error:a,variant:P,id:w}}}const f3={__staticSelector:"InputBase",withAria:!0},Yn=jn((e,t)=>{const{inputProps:n,wrapperProps:r,...o}=d3("InputBase",f3,e);return s.jsx(_t.Wrapper,{...r,children:s.jsx(_t,{...n,...o,ref:t})})});Yn.classes={..._t.classes,..._t.Wrapper.classes};Yn.displayName="@mantine/core/InputBase";const h3={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 kE={root:"m_8bffd616"};const p3={},us=jn((e,t)=>{const n=B("Flex",p3,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,y=pe({name:"Flex",classes:kE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),w=Dt(),x=Pc(),b=Tb({styleProps:{gap:u,rowGap:d,columnGap:f,align:h,justify:m,wrap:g,direction:v},theme:w,data:h3});return s.jsxs(s.Fragment,{children:[b.hasResponsiveStyles&&s.jsx(Ba,{selector:`.${x}`,styles:b.styles,media:b.media}),s.jsx(q,{ref:t,...y("root",{className:x,style:ys(b.inlineStyles)}),...S})]})});us.classes=kE;us.displayName="@mantine/core/Flex";function m3(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 g3({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=>{m3(g.target,t)&&(d(),c(!1))};return document.addEventListener("transitionend",m),()=>{document.removeEventListener("transitionend",m)}}},[t]),g_(()=>{wb()!=="test"&&a(!0)},20,{autoInvoke:!0}),v_(m=>{m.forEach(g=>{g.type==="attributes"&&g.attributeName==="dir"&&d()})},{attributes:!0,attributeFilter:["dir"]},()=>document.documentElement),{initialized:i,hidden:l}}var RE={root:"m_96b553a6"};const v3={},y3=(e,{transitionDuration:t})=>({root:{"--transition-duration":typeof t=="number"?`${t}ms`:t}}),zv=Y((e,t)=>{const n=B("FloatingIndicator",v3,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=pe({name:"FloatingIndicator",classes:RE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:y3}),S=p.useRef(null),{initialized:y,hidden:w}=g3({target:u,parent:d,ref:S,displayAfterTransitionEnd:m}),x=qt(t,S);return!u||!d?null:s.jsx(q,{ref:x,mod:[{initialized:y,hidden:w},h],...v("root"),...g})});zv.displayName="@mantine/core/FloatingIndicator";zv.classes=RE;var _E={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 x3={},w3=(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:wt(t),"--alert-bg":n||r?i.background:void 0,"--alert-color":i.color,"--alert-bd":n||r?i.border:void 0}}},Es=Y((e,t)=>{const n=B("Alert",x3,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:y,variant:w,autoContrast:x,...b}=n,C=pe({name:"Alert",classes:_E,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:w3}),E=$n(m),j=f&&`${E}-title`||void 0,P=`${E}-body`;return s.jsx(q,{id:E,...C("root",{variant:w}),variant:w,ref:t,...b,role:"alert","aria-describedby":P,"aria-labelledby":j,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:j,...C("label"),children:f})}),h&&s.jsx("div",{id:P,...C("message"),"data-variant":w,children:h})]}),v&&s.jsx(Cs,{...C("closeButton"),onClick:S,variant:"transparent",size:16,iconSize:16,"aria-label":y,unstyled:l})]})})});Es.classes=_E;Es.displayName="@mantine/core/Alert";var DE={root:"m_b6d8b162"};function S3(e){if(e==="start")return"start";if(e==="end"||e)return"end"}const b3={inherit:!1},j3=(e,{variant:t,lineClamp:n,gradient:r,size:o,color:i})=>({root:{"--text-fz":rn(o),"--text-lh":db(o),"--text-gradient":t==="gradient"?Np(r,e):void 0,"--text-line-clamp":typeof n=="number"?n.toString():void 0,"--text-color":i?xt(i,e):void 0}}),ue=jn((e,t)=>{const n=B("Text",b3,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:y,size:w,...x}=n,b=pe({name:["Text",u],props:n,classes:DE,className:f,style:h,classNames:m,styles:g,unstyled:v,vars:d,varsResolver:j3});return s.jsx(q,{...b("root",{focusable:!0}),ref:t,component:c?"span":"p",variant:S,mod:[{"data-truncate":S3(o),"data-line-clamp":typeof r=="number","data-inline":i,"data-inherit":a},y],size:w,...x})});ue.classes=DE;ue.displayName="@mantine/core/Text";var IE={root:"m_849cf0da"};const C3={underline:"hover"},Je=jn((e,t)=>{const{underline:n,className:r,unstyled:o,mod:i,...a}=B("Anchor",C3,e);return s.jsx(ue,{component:"a",ref:t,className:nt({[IE.root]:!o},r),...a,mod:[{underline:n},i],__staticSelector:"Anchor",unstyled:o})});Je.classes=IE;Je.displayName="@mantine/core/Anchor";const[E3,Ka]=On("AppShell was not found in tree");var Mi={root:"m_89ab340",navbar:"m_45252eee",aside:"m_9cdde9a",header:"m_3b16f56b",main:"m_8983817",footer:"m_3840c879",section:"m_6dcfc7c7"};const P3={},Vv=Y((e,t)=>{const n=B("AppShellAside",P3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ka();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)`}})});Vv.classes=Mi;Vv.displayName="@mantine/core/AppShellAside";const T3={},Bv=Y((e,t)=>{var g;const n=B("AppShellFooter",T3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ka();return m.disabled?null:s.jsx(q,{component:"footer",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("footer",{className:nt({[lf.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()}})});Bv.classes=Mi;Bv.displayName="@mantine/core/AppShellFooter";const k3={},Uv=Y((e,t)=>{var g;const n=B("AppShellHeader",k3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ka();return m.disabled?null:s.jsx(q,{component:"header",ref:t,mod:[{"with-border":u??m.withBorder},f],...m.getStyles("header",{className:nt({[lf.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()}})});Uv.classes=Mi;Uv.displayName="@mantine/core/AppShellHeader";const R3={},Hv=Y((e,t)=>{const n=B("AppShellMain",R3,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=Ka();return s.jsx(q,{component:"main",ref:t,...u.getStyles("main",{className:o,style:i,classNames:r,styles:a}),...c})});Hv.classes=Mi;Hv.displayName="@mantine/core/AppShellMain";function Ac(e){return typeof e=="object"?e.base:e}function Nc(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 Mc(e){return!(typeof e!="object"||e===null||Object.keys(e).length===1&&"base"in e)}function _3({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"),Nc(i)){const f=z(Ac(i));e["--app-shell-aside-width"]=f,e["--app-shell-aside-offset"]=f}if(Mc(i)&&(typeof i.base<"u"&&(e["--app-shell-aside-width"]=z(i.base),e["--app-shell-aside-offset"]=z(i.base)),yt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-aside-width"]=z(i[f]),t[f]["--app-shell-aside-offset"]=z(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=Sg(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 D3({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(Nc(r)){const a=z(Ac(r));e["--app-shell-footer-height"]=a,i&&(e["--app-shell-footer-offset"]=a)}Mc(r)&&(typeof r.base<"u"&&(e["--app-shell-footer-height"]=z(r.base),i&&(e["--app-shell-footer-offset"]=z(r.base))),yt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-footer-height"]=z(r[a]),i&&(t[a]["--app-shell-footer-offset"]=z(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-footer-transform"]=o,e["--app-shell-footer-offset"]="0px !important")}function I3({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(Nc(r)){const a=z(Ac(r));e["--app-shell-header-height"]=a,i&&(e["--app-shell-header-offset"]=a)}Mc(r)&&(typeof r.base<"u"&&(e["--app-shell-header-height"]=z(r.base),i&&(e["--app-shell-header-offset"]=z(r.base))),yt(r).forEach(a=>{a!=="base"&&(t[a]=t[a]||{},t[a]["--app-shell-header-height"]=z(r[a]),i&&(t[a]["--app-shell-header-offset"]=z(r[a])))})),n!=null&&n.collapsed&&(e["--app-shell-header-transform"]=o,e["--app-shell-header-offset"]="0px !important")}function A3({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"),Nc(i)){const f=z(Ac(i));e["--app-shell-navbar-width"]=f,e["--app-shell-navbar-offset"]=f}if(Mc(i)&&(typeof i.base<"u"&&(e["--app-shell-navbar-width"]=z(i.base),e["--app-shell-navbar-offset"]=z(i.base)),yt(i).forEach(f=>{f!=="base"&&(t[f]=t[f]||{},t[f]["--app-shell-navbar-width"]=z(i[f]),t[f]["--app-shell-navbar-offset"]=z(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=Sg(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 pp(e){return Number(e)===0?"0px":un(e)}function N3({padding:e,baseStyles:t,minMediaStyles:n}){Nc(e)&&(t["--app-shell-padding"]=pp(Ac(e))),Mc(e)&&(e.base&&(t["--app-shell-padding"]=pp(e.base)),yt(e).forEach(r=>{r!=="base"&&(n[r]=n[r]||{},n[r]["--app-shell-padding"]=pp(e[r]))}))}function M3({navbar:e,header:t,footer:n,aside:r,padding:o,theme:i}){const a={},l={},c={};A3({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,navbar:e,theme:i}),_3({baseStyles:c,minMediaStyles:a,maxMediaStyles:l,aside:r,theme:i}),I3({baseStyles:c,minMediaStyles:a,header:t}),D3({baseStyles:c,minMediaStyles:a,footer:n}),N3({baseStyles:c,minMediaStyles:a,padding:o});const u=Vl(yt(a),i).map(h=>({query:`(min-width: ${dd(h.px)})`,styles:a[h.value]})),d=Vl(yt(l),i).map(h=>({query:`(max-width: ${dd(h.px)})`,styles:l[h.value]})),f=[...u,...d];return{baseStyles:c,media:f}}function O3({navbar:e,header:t,aside:n,footer:r,padding:o}){const i=Dt(),a=Di(),{media:l,baseStyles:c}=M3({navbar:e,header:t,footer:r,aside:n,padding:o,theme:i});return s.jsx(Ba,{media:l,styles:c,selector:a.cssVariablesSelector})}const $3={},Wv=Y((e,t)=>{const n=B("AppShellNavbar",$3,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,withBorder:u,zIndex:d,mod:f,...h}=n,m=Ka();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)`}})});Wv.classes=Mi;Wv.displayName="@mantine/core/AppShellNavbar";const L3={},qv=jn((e,t)=>{const n=B("AppShellSection",L3,e),{classNames:r,className:o,style:i,styles:a,vars:l,grow:c,mod:u,...d}=n,f=Ka();return s.jsx(q,{ref:t,mod:[{grow:c},u],...f.getStyles("section",{className:o,style:i,classNames:r,styles:a}),...d})});qv.classes=Mi;qv.displayName="@mantine/core/AppShellSection";function F3({transitionDuration:e,disabled:t}){const[n,r]=p.useState(!0),o=p.useRef(),i=p.useRef();return yb("resize",()=>{r(!0),clearTimeout(o.current),o.current=window.setTimeout(()=>r(!1),200)}),Va(()=>{p.startTransition(()=>{r(!0),clearTimeout(i.current),i.current=window.setTimeout(()=>r(!1),e||0)})},[t,e]),n}const z3={withBorder:!0,offsetScrollbars:!0,padding:0,transitionDuration:200,transitionTimingFunction:"ease",zIndex:Wr("app")},V3=(e,{transitionDuration:t,transitionTimingFunction:n})=>({root:{"--app-shell-transition-duration":`${t}ms`,"--app-shell-transition-timing-function":n}}),Gn=Y((e,t)=>{const n=B("AppShell",z3,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:y,aside:w,footer:x,offsetScrollbars:b,mod:C,...E}=n,j=pe({name:"AppShell",classes:Mi,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:V3}),P=F3({disabled:y,transitionDuration:h});return s.jsxs(E3,{value:{getStyles:j,withBorder:d,zIndex:v,disabled:y,offsetScrollbars:b},children:[s.jsx(O3,{navbar:u,header:g,aside:w,footer:x,padding:f}),s.jsx(q,{ref:t,...j("root"),mod:[{resizing:P,layout:S,disabled:y},C],...E})]})});Gn.classes=Mi;Gn.displayName="@mantine/core/AppShell";Gn.Navbar=Wv;Gn.Header=Uv;Gn.Main=Hv;Gn.Aside=Vv;Gn.Footer=Bv;Gn.Section=qv;function AE(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=>AE(t))}:e}function NE(e){return e?e.map(t=>AE(t)):[]}function ME(e){return e.reduce((t,n)=>"group"in n?{...t,...ME(n.items)}:(t[n.value]=n,t),{})}var Kn={dropdown:"m_88b62a41",options:"m_b2821a6e",option:"m_92253aa5",search:"m_985517d8",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 B3={error:null},U3=(e,{size:t})=>({chevron:{"--combobox-chevron-size":Oe(t,"combobox-chevron-size")}}),Of=Y((e,t)=>{const n=B("ComboboxChevron",B3,e),{size:r,error:o,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,mod:f,...h}=n,m=pe({name:"ComboboxChevron",classes:Kn,props:n,style:i,className:a,classNames:l,styles:c,unstyled:u,vars:d,varsResolver:U3,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"})})});Of.classes=Kn;Of.displayName="@mantine/core/ComboboxChevron";const[H3,kr]=On("Combobox component was not found in tree"),OE=p.forwardRef(({size:e,onMouseDown:t,onClick:n,onClear:r,...o},i)=>s.jsx(Cs,{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)}}));OE.displayName="@mantine/core/ComboboxClearButton";const W3={},Gv=Y((e,t)=>{const{classNames:n,styles:r,className:o,style:i,hidden:a,...l}=B("ComboboxDropdown",W3,e),c=kr();return s.jsx(qr.Dropdown,{...l,ref:t,role:"presentation","data-hidden":a||void 0,...c.getStyles("dropdown",{className:o,style:i,classNames:n,styles:r})})});Gv.classes=Kn;Gv.displayName="@mantine/core/ComboboxDropdown";const q3={refProp:"ref"},$E=Y((e,t)=>{const{children:n,refProp:r}=B("ComboboxDropdownTarget",q3,e);if(kr(),!$o(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(qr.Target,{ref:t,refProp:r,children:n})});$E.displayName="@mantine/core/ComboboxDropdownTarget";const G3={},Qv=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=B("ComboboxEmpty",G3,e),c=kr();return s.jsx(q,{ref:t,...c.getStyles("empty",{className:r,classNames:n,styles:i,style:o}),...l})});Qv.classes=Kn;Qv.displayName="@mantine/core/ComboboxEmpty";function Kv({onKeyDown:e,withKeyboardNavigation:t,withAriaAttributes:n,withExpandedAttribute:r,targetType:o,autoComplete:i}){const a=kr(),[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 Q3={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},LE=Y((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=B("ComboboxEventsTarget",Q3,e);if(!$o(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=kr(),f=Kv({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c});return p.cloneElement(n,{...f,...u,[r]:qt(t,d.store.targetRef,n==null?void 0:n.ref)})});LE.displayName="@mantine/core/ComboboxEventsTarget";const K3={},Yv=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=B("ComboboxFooter",K3,e),c=kr();return s.jsx(q,{ref:t,...c.getStyles("footer",{className:r,classNames:n,style:o,styles:i}),...l})});Yv.classes=Kn;Yv.displayName="@mantine/core/ComboboxFooter";const Y3={},Xv=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,children:l,label:c,...u}=B("ComboboxGroup",Y3,e),d=kr();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]})});Xv.classes=Kn;Xv.displayName="@mantine/core/ComboboxGroup";const X3={},Jv=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=B("ComboboxHeader",X3,e),c=kr();return s.jsx(q,{ref:t,...c.getStyles("header",{className:r,classNames:n,style:o,styles:i}),...l})});Jv.classes=Kn;Jv.displayName="@mantine/core/ComboboxHeader";function FE({value:e,valuesDivider:t=",",...n}){return s.jsx("input",{type:"hidden",value:Array.isArray(e)?e.join(t):e||"",...n})}FE.displayName="@mantine/core/ComboboxHiddenInput";const J3={},Zv=Y((e,t)=>{const n=B("ComboboxOption",J3,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,y=kr(),w=p.useId(),x=u||w;return s.jsx(q,{...y.getStyles("option",{className:o,classNames:r,styles:a,style:i}),...S,ref:t,id:x,mod:["combobox-option",{"combobox-active":d,"combobox-disabled":m,"combobox-selected":g},v],role:"option",onClick:b=>{var C;m?b.preventDefault():((C=y.onOptionSubmit)==null||C.call(y,n.value,n),c==null||c(b))},onMouseDown:b=>{b.preventDefault(),f==null||f(b)},onMouseOver:b=>{y.resetSelectionOnOptionHover&&y.store.resetSelectedOption(),h==null||h(b)}})});Zv.classes=Kn;Zv.displayName="@mantine/core/ComboboxOption";const Z3={},ey=Y((e,t)=>{const n=B("ComboboxOptions",Z3,e),{classNames:r,className:o,style:i,styles:a,id:l,onMouseDown:c,labelledBy:u,...d}=n,f=kr(),h=$n(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)}})});ey.classes=Kn;ey.displayName="@mantine/core/ComboboxOptions";const e5={withAriaAttributes:!0,withKeyboardNavigation:!0},ty=Y((e,t)=>{const n=B("ComboboxSearch",e5,e),{classNames:r,styles:o,unstyled:i,vars:a,withAriaAttributes:l,onKeyDown:c,withKeyboardNavigation:u,size:d,...f}=n,h=kr(),m=h.getStyles("search"),g=Kv({targetType:"input",withAriaAttributes:l,withKeyboardNavigation:u,withExpandedAttribute:!1,onKeyDown:c,autoComplete:"off"});return s.jsx(_t,{ref:qt(t,h.store.searchRef),classNames:[{input:m.className},r],styles:[{input:m.style},o],size:d||h.size,...g,...f,__staticSelector:"Combobox"})});ty.classes=Kn;ty.displayName="@mantine/core/ComboboxSearch";const t5={refProp:"ref",targetType:"input",withKeyboardNavigation:!0,withAriaAttributes:!0,withExpandedAttribute:!1,autoComplete:"off"},zE=Y((e,t)=>{const{children:n,refProp:r,withKeyboardNavigation:o,withAriaAttributes:i,withExpandedAttribute:a,targetType:l,autoComplete:c,...u}=B("ComboboxTarget",t5,e);if(!$o(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=kr(),f=Kv({targetType:l,withAriaAttributes:i,withKeyboardNavigation:o,withExpandedAttribute:a,onKeyDown:n.props.onKeyDown,autoComplete:c}),h=p.cloneElement(n,{...f,...u});return s.jsx(qr.Target,{ref:qt(t,d.store.targetRef),children:h})});zE.displayName="@mantine/core/ComboboxTarget";function n5(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 r5(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 o5(e){for(let t=0;t<e.length;t+=1)if(!e[t].hasAttribute("data-combobox-disabled"))return t;return-1}function Oc({defaultOpened:e,opened:t,onOpenedChange:n,onDropdownClose:r,onDropdownOpen:o,loop:i=!0,scrollBehavior:a="instant"}={}){const[l,c]=pn({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((I="unknown")=>{l||(c(!0),o==null||o(I))},[c,o,l]),y=p.useCallback((I="unknown")=>{l&&(c(!1),r==null||r(I))},[c,r,l]),w=p.useCallback((I="unknown")=>{l?y(I):S(I)},[y,S,l]),x=p.useCallback(()=>{const I=document.querySelector(`#${u.current} [data-combobox-selected]`);I==null||I.removeAttribute("data-combobox-selected"),I==null||I.removeAttribute("aria-selected")},[]),b=p.useCallback(I=>{const k=document.getElementById(u.current),T=k==null?void 0:k.querySelectorAll("[data-combobox-option]");if(!T)return null;const $=I>=T.length?0:I<0?T.length-1:I;return d.current=$,T!=null&&T[$]&&!T[$].hasAttribute("data-combobox-disabled")?(x(),T[$].setAttribute("data-combobox-selected","true"),T[$].setAttribute("aria-selected","true"),T[$].scrollIntoView({block:"nearest",behavior:a}),T[$].id):null},[a,x]),C=p.useCallback(()=>{const I=document.querySelector(`#${u.current} [data-combobox-active]`);if(I){const k=document.querySelectorAll(`#${u.current} [data-combobox-option]`),T=Array.from(k).findIndex($=>$===I);return b(T)}return b(0)},[b]),E=p.useCallback(()=>b(r5(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),j=p.useCallback(()=>b(n5(d.current,document.querySelectorAll(`#${u.current} [data-combobox-option]`),i)),[b,i]),P=p.useCallback(()=>b(o5(document.querySelectorAll(`#${u.current} [data-combobox-option]`))),[b]),_=p.useCallback((I="selected",k)=>{v.current=window.setTimeout(()=>{var V;const T=document.querySelectorAll(`#${u.current} [data-combobox-option]`),$=Array.from(T).findIndex(U=>U.hasAttribute(`data-combobox-${I}`));d.current=$,k!=null&&k.scrollIntoView&&((V=T[$])==null||V.scrollIntoView({block:"nearest",behavior:a}))},0)},[]),R=p.useCallback(()=>{d.current=-1,x()},[x]),M=p.useCallback(()=>{const I=document.querySelectorAll(`#${u.current} [data-combobox-option]`),k=I==null?void 0:I[d.current];k==null||k.click()},[]),D=p.useCallback(I=>{u.current=I},[]),N=p.useCallback(()=>{m.current=window.setTimeout(()=>f.current.focus(),0)},[]),A=p.useCallback(()=>{g.current=window.setTimeout(()=>h.current.focus(),0)},[]),L=p.useCallback(()=>d.current,[]);return p.useEffect(()=>()=>{window.clearTimeout(m.current),window.clearTimeout(g.current),window.clearTimeout(v.current)},[]),{dropdownOpened:l,openDropdown:S,closeDropdown:y,toggleDropdown:w,selectedOptionIndex:d.current,getSelectedOptionIndex:L,selectOption:b,selectFirstOption:P,selectActiveOption:C,selectNextOption:E,selectPreviousOption:j,resetSelectedOption:R,updateSelectedOptionIndex:_,listId:u.current,setListId:D,clickSelectedOption:M,searchRef:f,focusSearchInput:N,targetRef:h,focusTarget:A}}const i5={keepMounted:!0,withinPortal:!0,resetSelectionOnOptionHover:!1,width:"target",transitionProps:{transition:"fade",duration:0}},s5=(e,{size:t,dropdownPadding:n})=>({options:{"--combobox-option-fz":rn(t),"--combobox-option-padding":Oe(t,"combobox-option-padding")},dropdown:{"--combobox-padding":n===void 0?void 0:z(n),"--combobox-option-fz":rn(t),"--combobox-option-padding":Oe(t,"combobox-option-padding")}});function _e(e){const t=B("Combobox",i5,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=Oc(),y=a||S,w=pe({name:m||"Combobox",classes:Kn,props:t,classNames:n,styles:r,unstyled:o,vars:l,varsResolver:s5}),x=()=>{u==null||u(),y.closeDropdown()};return s.jsx(H3,{value:{getStyles:w,store:y,onOptionSubmit:c,size:d,resetSelectionOnOptionHover:h,readOnly:g},children:s.jsx(qr,{opened:y.dropdownOpened,...v,onClose:x,withRoles:!1,unstyled:o,children:i})})}const a5=e=>e;_e.extend=a5;_e.classes=Kn;_e.displayName="@mantine/core/Combobox";_e.Target=zE;_e.Dropdown=Gv;_e.Options=ey;_e.Option=Zv;_e.Search=ty;_e.Empty=Qv;_e.Chevron=Of;_e.Footer=Yv;_e.Header=Jv;_e.EventsTarget=LE;_e.DropdownTarget=$E;_e.Group=Xv;_e.ClearButton=OE;_e.HiddenInput=FE;var VE={root:"m_5f75b09e",body:"m_5f6e695e",labelWrapper:"m_d3ea56bb",label:"m_8ee546b8",description:"m_328f68c0",error:"m_8e8a99cc"};const BE=VE,$f=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:y,vars:w,mod:x,...b},C)=>{const E=pe({name:e,props:t,className:n,style:y,classes:VE,classNames:r,styles:o,unstyled:i});return s.jsx(q,{...E("root"),ref:C,__vars:{"--label-fz":rn(h),"--label-lh":Oe(h,"label-lh")},mod:[{"label-position":m},x],variant:S,size:h,...b,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(_t.Description,{size:h,__inheritStyles:!1,...E("description"),children:c}),f&&typeof f!="boolean"&&s.jsx(_t.Error,{size:h,__inheritStyles:!1,...E("error"),children:f})]})]})})});$f.displayName="@mantine/core/InlineInput";const UE=p.createContext(null),l5=UE.Provider,c5=()=>p.useContext(UE);function ny({children:e,role:t}){const n=Qa();return n?s.jsx("div",{role:t,"aria-labelledby":n.labelId,"aria-describedby":n.describedBy,children:e}):s.jsx(s.Fragment,{children:e})}const u5={},ry=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=B("CheckboxGroup",u5,e),[d,f]=pn({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(l5,{value:{value:d,onChange:h,size:i},children:s.jsx(_t.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"CheckboxGroup",children:s.jsx(ny,{role:"group",children:l})})})});ry.classes=_t.Wrapper.classes;ry.displayName="@mantine/core/CheckboxGroup";function Lf({size:e,style:t,...n}){const r=e!==void 0?{width:z(e),height:z(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 d5({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(Lf,{...t})}var HE={root:"m_bf2d988c",inner:"m_26062bec",input:"m_26063560",icon:"m_bf295423","input--outline":"m_215c4542"};const f5={labelPosition:"right",icon:d5},h5=(e,{radius:t,color:n,size:r,iconColor:o,variant:i,autoContrast:a})=>{const l=uo({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":Oe(r,"checkbox-size"),"--checkbox-radius":t===void 0?void 0:wt(t),"--checkbox-color":i==="outline"?c:xt(n,e),"--checkbox-icon-color":o?xt(o,e):Ec(a,e)?xs({color:n,theme:e}):void 0}}},Cr=Y((e,t)=>{const n=B("Checkbox",f5,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,children:v,checked:S,labelPosition:y,description:w,error:x,disabled:b,variant:C,indeterminate:E,icon:j,rootRef:P,iconColor:_,onChange:R,autoContrast:M,mod:D,...N}=n,A=c5(),L=h||(A==null?void 0:A.size),I=j,k=pe({name:"Checkbox",props:n,classes:HE,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:h5}),{styleProps:T,rest:$}=Lo(N),V=$n(f),U=A?{checked:A.value.includes($.value),onChange:X=>{A.onChange(X),R==null||R(X)}}:{};return s.jsx($f,{...k("root"),__staticSelector:"Checkbox",__stylesApiProps:n,id:V,size:L,labelPosition:y,label:d,description:w,error:x,disabled:b,classNames:r,styles:a,unstyled:l,"data-checked":U.checked||S||void 0,variant:C,ref:P,mod:D,...T,...g,children:s.jsxs(q,{...k("inner"),mod:{"data-label-position":y},children:[s.jsx(q,{component:"input",id:V,ref:t,checked:S,disabled:b,mod:{error:!!x,indeterminate:E},...k("input",{focusable:!0,variant:C}),onChange:R,...$,...U,type:"checkbox"}),s.jsx(I,{indeterminate:E,...k("icon")})]})})});Cr.classes={...HE,...BE};Cr.displayName="@mantine/core/Checkbox";Cr.Group=ry;function Aa(e){return"group"in e}function WE({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;Aa(a)&&o.push({group:a.group,items:WE({options:a.items,search:t,limit:n-o.length})}),Aa(a)||a.label.toLowerCase().includes(r)&&o.push(a)}return o}function p5(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 qE(e,t=new Set){if(Array.isArray(e))for(const n of e)if(Aa(n))qE(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 m5(e,t){return Array.isArray(e)?e.includes(t):e===t}function GE({data:e,withCheckIcon:t,value:n,checkIconPosition:r,unstyled:o,renderOption:i}){if(!Aa(e)){const l=m5(n,e.value),c=t&&l&&s.jsx(Lf,{className:Kn.optionsDropdownCheckIcon}),u=s.jsxs(s.Fragment,{children:[r==="left"&&c,s.jsx("span",{children:e.label}),r==="right"&&c]});return s.jsx(_e.Option,{value:e.value,disabled:e.disabled,className:nt({[Kn.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(GE,{data:l,value:n,unstyled:o,withCheckIcon:t,checkIconPosition:r,renderOption:i},l.value));return s.jsx(_e.Group,{label:e.group,children:a})}function g5({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":y}){qE(e);const x=typeof o=="string"?(r||WE)({options:e,search:c?o:"",limit:i??1/0}):e,b=p5(x),C=x.map(E=>s.jsx(GE,{data:E,withCheckIcon:u,value:d,checkIconPosition:f,unstyled:m,renderOption:v},Aa(E)?E.group:E.value));return s.jsx(_e.Dropdown,{hidden:t||n&&b,children:s.jsxs(_e.Options,{labelledBy:g,"aria-label":y,children:[l?s.jsx(Pr.Autosize,{mah:a??220,type:"scroll",scrollbarSize:"var(--combobox-padding)",offsetScrollbars:"y",...S,children:C}):C,b&&h&&s.jsx(_e.Empty,{children:h})]})})}const QE=p.createContext(null),v5=QE.Provider;function y5(){return{withinGroup:!!p.useContext(QE)}}var Ff={group:"m_11def92b",root:"m_f85678b6",image:"m_11f8ac07",placeholder:"m_104cd71f"};const x5={},w5=(e,{spacing:t})=>({group:{"--ag-spacing":un(t)}}),oy=Y((e,t)=>{const n=B("AvatarGroup",x5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,spacing:u,...d}=n,f=pe({name:"AvatarGroup",classes:Ff,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:w5,rootSelector:"group"});return s.jsx(v5,{value:!0,children:s.jsx(q,{ref:t,...f("group"),...d})})});oy.classes=Ff;oy.displayName="@mantine/core/AvatarGroup";function S5(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"})})}const b5={},j5=(e,{size:t,radius:n,variant:r,gradient:o,color:i,autoContrast:a})=>{const l=e.variantColorResolver({color:i||"gray",theme:e,gradient:o,variant:r||"light",autoContrast:a});return{root:{"--avatar-size":Oe(t,"avatar-size"),"--avatar-radius":n===void 0?void 0:wt(n),"--avatar-bg":i||r?l.background:void 0,"--avatar-color":i||r?l.color:void 0,"--avatar-bd":i||r?l.border:void 0}}},ds=jn((e,t)=>{const n=B("Avatar",b5,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:y,...w}=n,x=y5(),[b,C]=p.useState(!u),E=pe({name:"Avatar",props:n,classes:Ff,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:j5});return p.useEffect(()=>C(!u),[u]),s.jsx(q,{...E("root"),mod:[{"within-group":x.withinGroup},y],ref:t,...w,children:b?s.jsx("span",{...E("placeholder"),title:d,children:v||s.jsx(S5,{})}):s.jsx("img",{...g,...E("image"),src:u,alt:d,onError:j=>{var P;C(!0),(P=g==null?void 0:g.onError)==null||P.call(g,j)}})})});ds.classes=Ff;ds.displayName="@mantine/core/Avatar";ds.Group=oy;var KE={root:"m_347db0ec","root--dot":"m_fbd81e3d",label:"m_5add502a",section:"m_91fdda9b"};const C5={},E5=(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":Oe(i,"badge-height"),"--badge-padding-x":Oe(i,"badge-padding-x"),"--badge-fz":Oe(i,"badge-fz"),"--badge-radius":t===void 0?void 0:wt(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"?xt(n,e):void 0}}},$c=jn((e,t)=>{const n=B("Badge",C5,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:y,circle:w,mod:x,...b}=n,C=pe({name:"Badge",props:n,classes:KE,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:E5});return s.jsxs(q,{variant:v,mod:[{block:S,circle:w},x],...C("root",{variant:v}),ref:t,...b,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})]})});$c.classes=KE;$c.displayName="@mantine/core/Badge";var YE={root:"m_ddec01c0",icon:"m_dde7bd57",cite:"m_dde51a35"};const P5={iconSize:48},T5=(e,{color:t,iconSize:n,radius:r})=>{const o=uo({color:t||e.primaryColor,theme:e,colorScheme:"dark"}),i=uo({color:t||e.primaryColor,theme:e,colorScheme:"light"});return{root:{"--bq-bg-light":hr(i.value,.07),"--bq-bg-dark":hr(o.value,.06),"--bq-bd":xt(t,e),"--bq-icon-size":z(n),"--bq-radius":wt(r)}}},iy=Y((e,t)=>{const n=B("Blockquote",P5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,icon:d,iconSize:f,cite:h,...m}=n,g=pe({name:"Blockquote",classes:YE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:T5});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})]})});iy.classes=YE;iy.displayName="@mantine/core/Blockquote";var zf={root:"m_77c9d27d",inner:"m_80f1301b",label:"m_811560b9",section:"m_a74036a",loader:"m_a25b86ee",group:"m_80d6d844"};const W1={orientation:"horizontal"},k5=(e,{borderWidth:t})=>({group:{"--button-border-width":z(t)}}),sy=Y((e,t)=>{const n=B("ButtonGroup",W1,e),{className:r,style:o,classNames:i,styles:a,unstyled:l,orientation:c,vars:u,borderWidth:d,variant:f,mod:h,...m}=B("ButtonGroup",W1,e),g=pe({name:"ButtonGroup",props:n,classes:zf,className:r,style:o,classNames:i,styles:a,unstyled:l,vars:u,varsResolver:k5,rootSelector:"group"});return s.jsx(q,{...g("group"),ref:t,variant:f,mod:[{"data-orientation":c},h],role:"group",...m})});sy.classes=zf;sy.displayName="@mantine/core/ButtonGroup";const R5={in:{opacity:1,transform:`translate(-50%, calc(-50% + ${z(1)}))`},out:{opacity:0,transform:"translate(-50%, -200%)"},common:{transformOrigin:"center"},transitionProperty:"transform, opacity"},_5={},D5=(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":Oe(i,"button-height"),"--button-padding-x":Oe(i,"button-padding-x"),"--button-fz":i!=null&&i.includes("compact")?rn(i.replace("compact-","")):rn(i),"--button-radius":t===void 0?void 0:wt(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}}},re=jn((e,t)=>{const n=B("Button",_5,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:y,styles:w,unstyled:x,"data-disabled":b,autoContrast:C,mod:E,...j}=n,P=pe({name:"Button",props:n,classes:zf,className:i,style:r,classNames:y,styles:w,unstyled:x,vars:o,varsResolver:D5}),_=!!u,R=!!d;return s.jsxs(An,{ref:t,...P("root",{active:!l&&!g&&!b}),unstyled:x,variant:h,disabled:l||g,mod:[{disabled:l||b,loading:g,block:f,"with-left-section":_,"with-right-section":R},E],...j,children:[s.jsx(Vo,{mounted:!!g,transition:R5,duration:150,children:M=>s.jsx(q,{component:"span",...P("loader",{style:M}),"aria-hidden":!0,children:s.jsx(Qn,{color:"var(--button-color)",size:"calc(var(--button-height) / 1.8)",...v})})}),s.jsxs("span",{...P("inner"),children:[u&&s.jsx(q,{component:"span",...P("section"),mod:{position:"left"},children:u}),s.jsx(q,{component:"span",mod:{loading:g},...P("label"),children:c}),d&&s.jsx(q,{component:"span",...P("section"),mod:{position:"right"},children:d})]})]})});re.classes=zf;re.displayName="@mantine/core/Button";re.Group=sy;var XE={root:"m_4451eb3a"};const I5={},dn=jn((e,t)=>{const n=B("Center",I5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,inline:u,mod:d,...f}=n,h=pe({name:"Center",props:n,classes:XE,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})});dn.classes=XE;dn.displayName="@mantine/core/Center";const[A5,N5]=jc(),M5={};function JE(e){const{value:t,defaultValue:n,onChange:r,multiple:o,children:i}=B("ChipGroup",M5,e),[a,l]=pn({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(A5,{value:{isChipSelected:c,onChange:u,multiple:o},children:i})}JE.displayName="@mantine/core/ChipGroup";var ZE={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 O5={type:"checkbox"},$5=(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":rn(t),"--chip-size":Oe(t,"chip-size"),"--chip-radius":n===void 0?void 0:wt(n),"--chip-checked-padding":Oe(t,"chip-checked-padding"),"--chip-padding":Oe(t,"chip-padding"),"--chip-icon-size":Oe(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":Oe(t,"chip-spacing")}}},lc=Y((e,t)=>{const n=B("Chip",O5,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:y,size:w,variant:x,icon:b,rootRef:C,autoContrast:E,mod:j,...P}=n,_=pe({name:"Chip",classes:ZE,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:$5}),R=N5(),M=$n(u),{styleProps:D,rest:N}=Lo(P),[A,L]=pn({value:d,defaultValue:f,finalValue:!1,onChange:h}),I=R?{checked:R.isChipSelected(m),onChange:T=>{R.onChange(T),h==null||h(T.currentTarget.checked)},type:R.multiple?"checkbox":"radio"}:{},k=I.checked||A;return s.jsxs(q,{size:w,variant:x,ref:C,mod:j,..._("root"),...D,...g,children:[s.jsx("input",{type:v,..._("input"),checked:k,onChange:T=>L(T.currentTarget.checked),id:M,disabled:S,ref:t,value:m,...I,...N}),s.jsxs("label",{htmlFor:M,"data-checked":k||void 0,"data-disabled":S||void 0,..._("label",{variant:x||"filled"}),children:[k&&s.jsx("span",{..._("iconWrapper"),children:b||s.jsx(Lf,{..._("checkIcon")})}),s.jsx("span",{children:y})]})]})});lc.classes=ZE;lc.displayName="@mantine/core/Chip";lc.Group=JE;var eP={root:"m_b183c0a2"};const L5={},F5=(e,{color:t})=>({root:{"--code-bg":t?xt(t,e):void 0}}),ay=Y((e,t)=>{const n=B("Code",L5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,color:u,block:d,variant:f,mod:h,...m}=n,g=pe({name:"Code",props:n,classes:eP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:F5});return s.jsx(q,{component:d?"pre":"code",variant:f,ref:t,mod:[{block:d},h],...g("root"),...m,dir:"ltr"})});ay.classes=eP;ay.displayName="@mantine/core/Code";var tP={root:"m_7485cace"};const z5={},V5=(e,{size:t,fluid:n})=>({root:{"--container-size":n?void 0:Oe(t,"container-size")}}),ly=Y((e,t)=>{const n=B("Container",z5,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,fluid:u,mod:d,...f}=n,h=pe({name:"Container",classes:tP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:V5});return s.jsx(q,{ref:t,mod:[{fluid:u},d],...h("root"),...f})});ly.classes=tP;ly.displayName="@mantine/core/Container";const B5={timeout:1e3};function nP(e){const{children:t,timeout:n,value:r,...o}=B("CopyButton",B5,e),i=fb({timeout:n}),a=()=>i.copy(r);return s.jsx(s.Fragment,{children:t({copy:a,copied:i.copied,...o})})}nP.displayName="@mantine/core/CopyButton";var rP={root:"m_3eebeb36",label:"m_9e365f20"};const U5={orientation:"horizontal"},H5=(e,{color:t,variant:n,size:r})=>({root:{"--divider-color":t?xt(t,e):void 0,"--divider-border-style":n,"--divider-size":Oe(r,"divider-size")}}),en=Y((e,t)=>{const n=B("Divider",U5,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=pe({name:"Divider",classes:rP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:H5});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})})});en.classes=rP;en.displayName="@mantine/core/Divider";function W5({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[q5,oP]=On("Grid component was not found in tree"),Om=(e,t)=>e==="content"?"auto":e==="auto"?"0rem":e?`${100/(t/e)}%`:void 0,q1=(e,t,n)=>n||e==="auto"?"100%":e==="content"?"unset":Om(e,t),G1=(e,t)=>{if(e)return e==="auto"||t?"1":"auto"},Q1=(e,t)=>e===0?"0":e?`${100/(t/e)}%`:void 0;function G5({span:e,order:t,offset:n,selector:r}){var h;const o=Dt(),i=oP(),l=di(e)===void 0?12:di(e),c=ys({"--col-order":(h=di(t))==null?void 0:h.toString(),"--col-flex-grow":G1(l,i.grow),"--col-flex-basis":Om(l,i.columns),"--col-width":l==="content"?"auto":void 0,"--col-max-width":q1(l,i.columns,i.grow),"--col-offset":Q1(di(n),i.columns)}),u=yt(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"]=G1(e[g],i.grow),m[g]["--col-flex-basis"]=Om(e[g],i.columns),m[g]["--col-width"]=e[g]==="content"?"auto":void 0,m[g]["--col-max-width"]=q1(e[g],i.columns,i.grow)),typeof n=="object"&&n[g]!==void 0&&(m[g]["--col-offset"]=Q1(n[g],i.columns)),m},{}),f=Vl(yt(u),o).filter(m=>yt(u[m.value]).length>0).map(m=>({query:`(min-width: ${o.breakpoints[m.value]})`,styles:u[m.value]}));return s.jsx(Ba,{styles:c,media:f,selector:r})}var cy={root:"m_410352e9",inner:"m_dee7bd2f",col:"m_96bdd299"};const Q5={span:12},uy=Y((e,t)=>{const n=B("GridCol",Q5,e),{classNames:r,className:o,style:i,styles:a,vars:l,span:c,order:u,offset:d,...f}=n,h=oP(),m=Pc();return s.jsxs(s.Fragment,{children:[s.jsx(G5,{selector:`.${m}`,span:c,order:u,offset:d}),s.jsx(q,{ref:t,...h.getStyles("col",{className:nt(o,m),style:i,classNames:r,styles:a}),...f})]})});uy.classes=cy;uy.displayName="@mantine/core/GridCol";function K5({gutter:e,selector:t}){const n=Dt(),r=ys({"--grid-gutter":un(di(e))}),o=yt(n.breakpoints).reduce((l,c)=>(l[c]||(l[c]={}),typeof e=="object"&&e[c]!==void 0&&(l[c]["--grid-gutter"]=un(e[c])),l),{}),a=Vl(yt(o),n).filter(l=>yt(o[l.value]).length>0).map(l=>({query:`(min-width: ${n.breakpoints[l.value]})`,styles:o[l.value]}));return s.jsx(Ba,{styles:r,media:a,selector:t})}const Y5={gutter:"md",grow:!1,columns:12},X5=(e,{justify:t,align:n,overflow:r})=>({root:{"--grid-justify":t,"--grid-align":n,"--grid-overflow":r}}),nr=Y((e,t)=>{const n=B("Grid",Y5,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=pe({name:"Grid",classes:cy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:X5}),y=Pc();return s.jsxs(q5,{value:{getStyles:S,grow:u,columns:f},children:[s.jsx(K5,{selector:`.${y}`,...n}),s.jsx(q,{ref:t,...S("root",{className:y}),...v,children:s.jsx("div",{...S("inner"),children:g})})]})});nr.classes=cy;nr.displayName="@mantine/core/Grid";nr.Col=uy;function Bd(){return Bd=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},Bd.apply(this,arguments)}function dy(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var J5=p.useLayoutEffect,Z5=function(t){var n=p.useRef(t);return J5(function(){n.current=t}),n},K1=function(t,n){if(typeof t=="function"){t(n);return}t.current=n},e9=function(t,n){var r=p.useRef();return p.useCallback(function(o){t.current=o,r.current&&K1(r.current,null),r.current=n,n&&K1(n,o)},[n])},Y1={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0"},t9=function(t){Object.keys(Y1).forEach(function(n){t.style.setProperty(n,Y1[n],"important")})},X1=t9,Tn=null,J1=function(t,n){var r=t.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?r+n.borderSize:r-n.paddingSize};function n9(e,t,n,r){n===void 0&&(n=1),r===void 0&&(r=1/0),Tn||(Tn=document.createElement("textarea"),Tn.setAttribute("tabindex","-1"),Tn.setAttribute("aria-hidden","true"),X1(Tn)),Tn.parentNode===null&&document.body.appendChild(Tn);var o=e.paddingSize,i=e.borderSize,a=e.sizingStyle,l=a.boxSizing;Object.keys(a).forEach(function(h){var m=h;Tn.style[m]=a[m]}),X1(Tn),Tn.value=t;var c=J1(Tn,e);Tn.value=t,c=J1(Tn,e),Tn.value="x";var u=Tn.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 Z1=function(){},r9=function(t,n){return t.reduce(function(r,o){return r[o]=n[o],r},{})},o9=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak"],i9=!!document.documentElement.currentStyle,s9=function(t){var n=window.getComputedStyle(t);if(n===null)return null;var r=r9(o9,n),o=r.boxSizing;if(o==="")return null;i9&&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}},a9=s9;function iP(e,t,n){var r=Z5(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 l9=function(t){iP(window,"resize",t)},c9=function(t){iP(document.fonts,"loadingdone",t)},u9=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],d9=function(t,n){var r=t.cacheMeasurements,o=t.maxRows,i=t.minRows,a=t.onChange,l=a===void 0?Z1:a,c=t.onHeightChange,u=c===void 0?Z1:c,d=dy(t,u9),f=d.value!==void 0,h=p.useRef(null),m=e9(h,n),g=p.useRef(0),v=p.useRef(),S=function(){var x=h.current,b=r&&v.current?v.current:a9(x);if(b){v.current=b;var C=n9(b,x.value||x.placeholder||"x",i,o),E=C[0],j=C[1];g.current!==E&&(g.current=E,x.style.setProperty("height",E+"px","important"),u(E,{rowHeight:j}))}},y=function(x){f||S(),l(x)};return p.useLayoutEffect(S),l9(S),c9(S),p.createElement("textarea",Bd({},d,{onChange:y,ref:m}))},f9=p.forwardRef(d9);const h9={},Ps=Y((e,t)=>{const{autosize:n,maxRows:r,minRows:o,__staticSelector:i,resize:a,...l}=B("Textarea",h9,e),c=n&&wb()!=="test",u=c?{maxRows:r,minRows:o}:{};return s.jsx(Yn,{component:c?f9:"textarea",ref:t,...l,__staticSelector:i||"Textarea",multiline:!0,"data-no-overflow":n&&r===void 0||void 0,__vars:{"--input-resize":a},...u})});Ps.classes=Yn.classes;Ps.displayName="@mantine/core/Textarea";function ew(e,t){if(typeof e=="string"&&e.trim().length===0)return!0;try{return t(e),!0}catch{return!1}}const p9={serialize:JSON.stringify,deserialize:JSON.parse},Ya=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}=B("JsonInput",p9,e),[g,v]=pn({value:n,defaultValue:r,finalValue:"",onChange:o}),[S,y]=p.useState(ew(g,c)),w=b=>{u==null||u(b),y(!0)},x=b=>{typeof d=="function"&&d(b);const C=ew(b.currentTarget.value,c);i&&!f&&C&&b.currentTarget.value.trim()!==""&&v(l(c(b.currentTarget.value),null,2)),y(C)};return s.jsx(Ps,{value:g,onChange:b=>v(b.currentTarget.value),onFocus:w,onBlur:x,ref:t,readOnly:f,...m,autoComplete:"off",__staticSelector:"JsonInput",error:S?h:a||!0,"data-monospace":!0})});Ya.classes=Yn.classes;Ya.displayName="@mantine/core/JsonInput";const[m9,g9]=On("List component was not found in tree");var fy={root:"m_abbac491",item:"m_abb6bec2",itemWrapper:"m_75cd9f71",itemIcon:"m_60f83e5b"};const v9={},hy=Y((e,t)=>{const n=B("ListItem",v9,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,children:u,mod:d,...f}=n,h=g9(),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})]})})});hy.classes=fy;hy.displayName="@mantine/core/ListItem";const y9={type:"unordered"},x9=(e,{size:t,spacing:n})=>({root:{"--list-fz":rn(t),"--list-lh":db(t),"--list-spacing":un(n)}}),Dn=Y((e,t)=>{const n=B("List",y9,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,...y}=n,w=pe({name:"List",classes:fy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:x9});return s.jsx(m9,{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,...y,children:u})})});Dn.classes=fy;Dn.displayName="@mantine/core/List";Dn.Item=hy;var sP={root:"m_6e45937b",loader:"m_e8eb006c",overlay:"m_df587f17"};const tw={transitionProps:{transition:"fade",duration:0},overlayProps:{backgroundOpacity:.75},zIndex:Wr("overlay")},w9=(e,{zIndex:t})=>({root:{"--lo-z-index":t==null?void 0:t.toString()}}),py=Y((e,t)=>{const n=B("LoadingOverlay",tw,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=Dt(),S=pe({name:"LoadingOverlay",classes:sP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:w9}),y={...tw.overlayProps,...f};return s.jsx(Vo,{transition:"fade",...u,mounted:!!h,children:w=>s.jsxs(q,{...S("root",{style:w}),ref:t,...g,children:[s.jsx(Qn,{...S("loader"),unstyled:l,...d}),s.jsx(ac,{...y,...S("overlay"),darkHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.white}),s.jsx(ac,{...y,...S("overlay"),lightHidden:!0,unstyled:l,color:(f==null?void 0:f.color)||v.colors.dark[5]})]})})});py.classes=sP;py.displayName="@mantine/core/LoadingOverlay";const[S9,Lc]=On("Menu component was not found in the tree");var Xa={dropdown:"m_dc9b7c9f",label:"m_9bfac126",divider:"m_efdf90cb",item:"m_99ac2aa1",itemLabel:"m_5476e0d3",itemSection:"m_8b75e504"};const b9={},my=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=B("MenuDivider",b9,e),c=Lc();return s.jsx(q,{ref:t,...c.getStyles("divider",{className:r,style:o,styles:i,classNames:n}),...l})});my.classes=Xa;my.displayName="@mantine/core/MenuDivider";const j9={},gy=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,onMouseEnter:l,onMouseLeave:c,children:u,...d}=B("MenuDropdown",j9,e),f=p.useRef(null),h=Lc(),m=S=>{var y,w;(S.key==="ArrowUp"||S.key==="ArrowDown")&&(S.preventDefault(),(w=(y=f.current)==null?void 0:y.querySelectorAll("[data-menu-item]:not(:disabled)")[0])==null||w.focus())},g=Zn(l,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.openDropdown()),v=Zn(c,()=>(h.trigger==="hover"||h.trigger==="click-hover")&&h.closeDropdown());return s.jsxs(qr.Dropdown,{...d,onMouseEnter:g,onMouseLeave:v,role:"menu","aria-orientation":"vertical",ref:qt(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,"aria-hidden":!0,style:{outline:0}}),u]})});gy.classes=Xa;gy.displayName="@mantine/core/MenuDropdown";const C9={},vy=jn((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}=B("MenuItem",C9,e),g=Lc(),v=Dt(),{dir:S}=Ua(),y=p.useRef(),w=g.getItemIndex(y.current),x=m,b=Zn(x.onMouseLeave,()=>g.setHovered(-1)),C=Zn(x.onMouseEnter,()=>g.setHovered(g.getItemIndex(y.current))),E=Zn(x.onClick,()=>{typeof c=="boolean"?c&&g.closeDropdownImmediately():g.closeOnItemClick&&g.closeDropdownImmediately()}),j=Zn(x.onFocus,()=>g.setHovered(g.getItemIndex(y.current))),P=l?v.variantColorResolver({color:l,theme:v,variant:"light"}):void 0,_=l?uo({color:l,theme:v}):null;return s.jsxs(An,{...m,unstyled:g.unstyled,tabIndex:g.menuItemTabIndex,onFocus:j,...g.getStyles("item",{className:r,style:o,styles:i,classNames:n}),ref:qt(y,t),role:"menuitem",disabled:h,"data-menu-item":!0,"data-disabled":h||void 0,"data-hovered":g.hovered===w?!0:void 0,onMouseEnter:C,onMouseLeave:b,onClick:E,onKeyDown:ub({siblingSelector:"[data-menu-item]",parentSelector:"[data-menu-dropdown]",activateOnFocus:!1,loop:g.loop,dir:S,orientation:"vertical",onKeyDown:x.onKeydown}),__vars:{"--menu-item-color":_!=null&&_.isThemeColor&&(_==null?void 0:_.shade)===void 0?`var(--mantine-color-${_.color}-6)`:P==null?void 0:P.color,"--menu-item-hover":P==null?void 0:P.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})]})});vy.classes=Xa;vy.displayName="@mantine/core/MenuItem";const E9={},yy=Y((e,t)=>{const{classNames:n,className:r,style:o,styles:i,vars:a,...l}=B("MenuLabel",E9,e),c=Lc();return s.jsx(q,{ref:t,...c.getStyles("label",{className:r,style:o,styles:i,classNames:n}),...l})});yy.classes=Xa;yy.displayName="@mantine/core/MenuLabel";const P9={refProp:"ref"},aP=p.forwardRef((e,t)=>{const{children:n,refProp:r,...o}=B("MenuTarget",P9,e);if(!$o(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=Lc(),a=Zn(n.props.onClick,()=>{i.trigger==="click"?i.toggleDropdown():i.trigger==="click-hover"&&(i.setOpenedViaClick(!0),i.opened||i.openDropdown())}),l=Zn(n.props.onMouseEnter,()=>(i.trigger==="hover"||i.trigger==="click-hover")&&i.openDropdown()),c=Zn(n.props.onMouseLeave,()=>{(i.trigger==="hover"||i.trigger==="click-hover"&&!i.openedViaClick)&&i.closeDropdown()});return s.jsx(qr.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})})});aP.displayName="@mantine/core/MenuTarget";const T9={trapFocus:!0,closeOnItemClick:!0,clickOutsideEvents:["mousedown","touchstart","keydown"],loop:!0,trigger:"click",openDelay:0,closeDelay:100,menuItemTabIndex:-1};function ne(e){const t=B("Menu",T9,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:y,variant:w,vars:x,menuItemTabIndex:b,keepMounted:C,...E}=t,j=pe({name:"Menu",classes:Xa,props:t,classNames:v,styles:S,unstyled:y}),[P,{setHovered:_,resetHovered:R}]=J2(),[M,D]=pn({value:i,defaultValue:a,finalValue:!1,onChange:c}),[N,A]=p.useState(!1),L=()=>{D(!1),A(!1),M&&(o==null||o())},I=()=>{D(!0),!M&&(r==null||r())},k=()=>{M?L():I()},{openDropdown:T,closeDropdown:$}=W5({open:I,close:L,closeDelay:g,openDelay:m}),V=Se=>X2("[data-menu-item]","[data-menu-dropdown]",Se),{resolvedClassNames:U,resolvedStyles:X}=Cc({classNames:v,styles:S,props:t});return Po(()=>{R()},[M]),s.jsx(S9,{value:{getStyles:j,opened:M,toggleDropdown:k,getItemIndex:V,hovered:P,setHovered:_,openedViaClick:N,setOpenedViaClick:A,closeOnItemClick:u,closeDropdown:h==="click"?L:$,openDropdown:h==="click"?I:T,closeDropdownImmediately:L,loop:d,trigger:h,unstyled:y,menuItemTabIndex:b},children:s.jsx(qr,{...E,opened:M,onChange:k,defaultOpened:a,trapFocus:C?!1:l,closeOnEscape:f,__staticSelector:"Menu",classNames:U,styles:X,unstyled:y,variant:w,keepMounted:C,children:n})})}ne.extend=e=>e;ne.classes=Xa;ne.displayName="@mantine/core/Menu";ne.Item=vy;ne.Label=yy;ne.Dropdown=gy;ne.Target=aP;ne.Divider=my;const[k9,Ja]=On("Modal component was not found in tree");var Uo={root:"m_9df02822",content:"m_54c44539",inner:"m_1f958f16",header:"m_d0e2b9cd"};const R9={},Vf=Y((e,t)=>{const n=B("ModalBody",R9,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=Ja();return s.jsx(jE,{ref:t,...u.getStyles("body",{classNames:r,style:i,styles:a,className:o}),...c})});Vf.classes=Uo;Vf.displayName="@mantine/core/ModalBody";const _9={},Bf=Y((e,t)=>{const n=B("ModalCloseButton",_9,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=Ja();return s.jsx(CE,{ref:t,...u.getStyles("close",{classNames:r,style:i,styles:a,className:o}),...c})});Bf.classes=Uo;Bf.displayName="@mantine/core/ModalCloseButton";const D9={},Uf=Y((e,t)=>{const n=B("ModalContent",D9,e),{classNames:r,className:o,style:i,styles:a,vars:l,children:c,...u}=n,d=Ja(),f=d.scrollAreaComponent||e3;return s.jsx(Y4,{...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 - (${z(d.yOffset)} * 2))`},children:c})})});Uf.classes=Uo;Uf.displayName="@mantine/core/ModalContent";const I9={},Hf=Y((e,t)=>{const n=B("ModalHeader",I9,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=Ja();return s.jsx(EE,{ref:t,...u.getStyles("header",{classNames:r,style:i,styles:a,className:o}),...c})});Hf.classes=Uo;Hf.displayName="@mantine/core/ModalHeader";const A9={},Wf=Y((e,t)=>{const n=B("ModalOverlay",A9,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=Ja();return s.jsx(PE,{ref:t,...u.getStyles("overlay",{classNames:r,style:i,styles:a,className:o}),...c})});Wf.classes=Uo;Wf.displayName="@mantine/core/ModalOverlay";const N9={__staticSelector:"Modal",closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"pop"},yOffset:"5dvh"},M9=(e,{radius:t,size:n,yOffset:r,xOffset:o})=>({root:{"--modal-radius":t===void 0?void 0:wt(t),"--modal-size":Oe(n,"modal-size"),"--modal-y-offset":z(r),"--modal-x-offset":z(o)}}),qf=Y((e,t)=>{const n=B("ModalRoot",N9,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,y=pe({name:v,classes:Uo,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:M9});return s.jsx(k9,{value:{yOffset:u,scrollAreaComponent:d,getStyles:y,fullScreen:h},children:s.jsx(Q4,{ref:t,...y("root"),"data-full-screen":h||void 0,"data-centered":m||void 0,unstyled:l,...S})})});qf.classes=Uo;qf.displayName="@mantine/core/ModalRoot";const O9={},Gf=Y((e,t)=>{const n=B("ModalTitle",O9,e),{classNames:r,className:o,style:i,styles:a,vars:l,...c}=n,u=Ja();return s.jsx(TE,{ref:t,...u.getStyles("title",{classNames:r,style:i,styles:a,className:o}),...c})});Gf.classes=Uo;Gf.displayName="@mantine/core/ModalTitle";const $9={closeOnClickOutside:!0,withinPortal:!0,lockScroll:!0,trapFocus:!0,returnFocus:!0,closeOnEscape:!0,keepMounted:!1,zIndex:Wr("modal"),transitionProps:{duration:200,transition:"fade-down"},withOverlay:!0,withCloseButton:!0},Cn=Y((e,t)=>{const{title:n,withOverlay:r,overlayProps:o,withCloseButton:i,closeButtonProps:a,children:l,radius:c,...u}=B("Modal",$9,e),d=!!n||i;return s.jsxs(qf,{ref:t,radius:c,...u,children:[r&&s.jsx(Wf,{...o}),s.jsxs(Uf,{radius:c,children:[d&&s.jsxs(Hf,{children:[n&&s.jsx(Gf,{children:n}),i&&s.jsx(Bf,{...a})]}),s.jsx(Vf,{children:l})]})]})});Cn.classes=Uo;Cn.displayName="@mantine/core/Modal";Cn.Root=qf;Cn.Overlay=Wf;Cn.Content=Uf;Cn.Body=Vf;Cn.Header=Hf;Cn.Title=Gf;Cn.CloseButton=Bf;const[L9,xy]=jc(),[F9,z9]=jc();var Qf={root:"m_7cda1cd6","root--default":"m_44da308b","root--contrast":"m_e3a01f8",label:"m_1e0e6180",remove:"m_ae386778",group:"m_1dcfd90b"};const V9={},B9=(e,{gap:t},{size:n})=>({group:{"--pg-gap":t!==void 0?Oe(t):Oe(n,"pg-gap")}}),wy=Y((e,t)=>{const n=B("PillGroup",V9,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,size:u,disabled:d,...f}=n,h=xy(),m=(h==null?void 0:h.size)||u||void 0,g=pe({name:"PillGroup",classes:Qf,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:B9,stylesCtx:{size:m},rootSelector:"group"});return s.jsx(F9,{value:{size:m,disabled:d},children:s.jsx(q,{ref:t,size:m,...g("group"),...f})})});wy.classes=Qf;wy.displayName="@mantine/core/PillGroup";const U9={variant:"default"},H9=(e,{radius:t},{size:n})=>({root:{"--pill-fz":Oe(n,"pill-fz"),"--pill-height":Oe(n,"pill-height"),"--pill-radius":t===void 0?void 0:wt(t)}}),fs=Y((e,t)=>{const n=B("Pill",U9,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:y,...w}=n,x=z9(),b=xy(),C=v||(x==null?void 0:x.size)||void 0,E=(b==null?void 0:b.variant)==="filled"?"contrast":u||"default",j=pe({name:"Pill",classes:Qf,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:H9,stylesCtx:{size:C}});return s.jsxs(q,{component:"span",ref:t,variant:E,size:C,...j("root",{variant:E}),mod:[{"with-remove":f&&!S,disabled:S||(x==null?void 0:x.disabled)},y],...w,children:[s.jsx("span",{...j("label"),children:d}),f&&s.jsx(Cs,{variant:"transparent",radius:g,tabIndex:-1,"aria-hidden":!0,unstyled:l,...m,...j("remove",{className:m==null?void 0:m.className,style:m==null?void 0:m.style}),onMouseDown:P=>{var _;P.preventDefault(),P.stopPropagation(),(_=m==null?void 0:m.onMouseDown)==null||_.call(m,P)},onClick:P=>{var _;P.stopPropagation(),h==null||h(),(_=m==null?void 0:m.onClick)==null||_.call(m,P)}})]})});fs.classes=Qf;fs.displayName="@mantine/core/Pill";fs.Group=wy;var lP={field:"m_45c4369d"};const W9={type:"visible"},Sy=Y((e,t)=>{const n=B("PillsInputField",W9,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=xy(),S=Qa(),y=pe({name:"PillsInputField",classes:lP,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:qt(t,v==null?void 0:v.fieldRef),"data-type":u,disabled:w,mod:[{disabled:w,pointer:h},m],...y("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:x=>!h&&x.stopPropagation()})});Sy.classes=lP;Sy.displayName="@mantine/core/PillsInputField";const q9={},Na=Y((e,t)=>{const n=B("PillsInput",q9,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(L9,{value:{fieldRef:h,size:a,disabled:l,hasError:!!u,variant:d},children:s.jsx(Yn,{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})})});Na.displayName="@mantine/core/PillsInput";Na.Field=Sy;function G9({data:e,value:t}){const n=t.map(o=>o.trim().toLowerCase());return e.reduce((o,i)=>(Aa(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 Q9={maxValues:1/0,withCheckIcon:!0,checkIconPosition:"left",hiddenInputValuesDivider:","},Kf=Y((e,t)=>{const n=B("MultiSelect",Q9,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:y,onDropdownOpen:w,onDropdownClose:x,selectFirstOptionOnChange:b,onOptionSubmit:C,comboboxProps:E,filter:j,limit:P,withScrollArea:_,maxDropdownHeight:R,searchValue:M,defaultSearchValue:D,onSearchChange:N,readOnly:A,disabled:L,onFocus:I,onBlur:k,onPaste:T,radius:$,rightSection:V,rightSectionWidth:U,rightSectionPointerEvents:X,rightSectionProps:Se,leftSection:me,leftSectionWidth:xe,leftSectionPointerEvents:Te,leftSectionProps:je,inputContainer:ae,inputWrapperOrder:Be,withAsterisk:St,labelProps:st,descriptionProps:ye,errorProps:$e,wrapperProps:Ie,description:ee,label:te,error:Ee,maxValues:Qe,searchable:Ke,nothingFoundMessage:Fe,withCheckIcon:K,checkIconPosition:G,hidePickedOptions:fe,withErrorStyles:tt,name:Pt,form:ht,id:Ot,clearable:Gt,clearButtonProps:gn,hiddenInputProps:po,placeholder:an,hiddenInputValuesDivider:Ko,required:Ns,mod:uu,renderOption:Eh,onRemove:cr,onClear:Yo,scrollAreaProps:du,...Ms}=n,il=$n(Ot),Os=NE(v),Xo=ME(Os),En=Oc({opened:S,defaultOpened:y,onDropdownOpen:w,onDropdownClose:()=>{x==null||x(),En.resetSelectedOption()}}),{styleProps:Ph,rest:{type:O,autoComplete:F,...W}}=Lo(Ms),[Q,se]=pn({value:d,defaultValue:f,finalValue:[],onChange:h}),[Ne,Ce]=pn({value:M,defaultValue:D,finalValue:"",onChange:N}),he=pe({name:"MultiSelect",classes:{},props:n,classNames:r,styles:a,unstyled:l}),{resolvedClassNames:Le,resolvedStyles:Me}=Cc({props:n,styles:a,classNames:r}),Qt=Ve=>{m==null||m(Ve),Ve.key===" "&&!Ke&&(Ve.preventDefault(),En.toggleDropdown()),Ve.key==="Backspace"&&Ne.length===0&&Q.length>0&&(cr==null||cr(Q[Q.length-1]),se(Q.slice(0,Q.length-1)))},Kt=Q.map((Ve,mo)=>{var Rr,go;return s.jsx(fs,{withRemoveButton:!A&&!((Rr=Xo[Ve])!=null&&Rr.disabled),onRemove:()=>{se(Q.filter(Jo=>Ve!==Jo)),cr==null||cr(Ve)},unstyled:l,disabled:L,...he("pill"),children:((go=Xo[Ve])==null?void 0:go.label)||Ve},`${Ve}-${mo}`)});p.useEffect(()=>{b&&En.selectFirstOption()},[b,Q]);const ke=Gt&&Q.length>0&&!L&&!A&&s.jsx(_e.ClearButton,{size:u,...gn,onClear:()=>{Yo==null||Yo(),se([]),Ce("")}}),lt=G9({data:Os,value:Q});return s.jsxs(s.Fragment,{children:[s.jsxs(_e,{store:En,classNames:Le,styles:Me,unstyled:l,size:u,readOnly:A,__staticSelector:"MultiSelect",onOptionSubmit:Ve=>{C==null||C(Ve),Ce(""),En.updateSelectedOptionIndex("selected"),Q.includes(Xo[Ve].value)?(se(Q.filter(mo=>mo!==Xo[Ve].value)),cr==null||cr(Xo[Ve].value)):Q.length<Qe&&se([...Q,Xo[Ve].value])},...E,children:[s.jsx(_e.DropdownTarget,{children:s.jsx(Na,{...Ph,__staticSelector:"MultiSelect",classNames:Le,styles:Me,unstyled:l,size:u,className:o,style:i,variant:g,disabled:L,radius:$,rightSection:V||ke||s.jsx(_e.Chevron,{size:u,error:Ee,unstyled:l}),rightSectionPointerEvents:X||(ke?"all":"none"),rightSectionWidth:U,rightSectionProps:Se,leftSection:me,leftSectionWidth:xe,leftSectionPointerEvents:Te,leftSectionProps:je,inputContainer:ae,inputWrapperOrder:Be,withAsterisk:St,labelProps:st,descriptionProps:ye,errorProps:$e,wrapperProps:Ie,description:ee,label:te,error:Ee,multiline:!0,withErrorStyles:tt,__stylesApiProps:{...n,rightSectionPointerEvents:X||(ke?"all":"none"),multiline:!0},pointer:!Ke,onClick:()=>Ke?En.openDropdown():En.toggleDropdown(),"data-expanded":En.dropdownOpened||void 0,id:il,required:Ns,mod:uu,children:s.jsxs(fs.Group,{disabled:L,unstyled:l,...he("pillsList"),children:[Kt,s.jsx(_e.EventsTarget,{autoComplete:F,children:s.jsx(Na.Field,{...W,ref:t,id:il,placeholder:an,type:!Ke&&!an?"hidden":"visible",...he("inputField"),unstyled:l,onFocus:Ve=>{I==null||I(Ve),Ke&&En.openDropdown()},onBlur:Ve=>{k==null||k(Ve),En.closeDropdown(),Ce("")},onKeyDown:Qt,value:Ne,onChange:Ve=>{Ce(Ve.currentTarget.value),Ke&&En.openDropdown(),b&&En.selectFirstOption()},disabled:L,readOnly:A||!Ke,pointer:!Ke})})]})})}),s.jsx(g5,{data:fe?lt:Os,hidden:A||L,filter:j,search:Ne,limit:P,hiddenWhenEmpty:!Ke||!Fe||fe&<.length===0&&Ne.trim().length===0,withScrollArea:_,maxDropdownHeight:R,filterOptions:Ke,value:Q,checkIconPosition:G,withCheckIcon:K,nothingFoundMessage:Fe,unstyled:l,labelId:te?`${il}-label`:void 0,"aria-label":te?void 0:Ms["aria-label"],renderOption:Eh,scrollAreaProps:du})]}),s.jsx(_e.HiddenInput,{name:Pt,valuesDivider:Ko,value:Q,form:ht,disabled:L,...po})]})});Kf.classes={...Yn.classes,..._e.classes};Kf.displayName="@mantine/core/MultiSelect";function K9(e){return"group"in e}function by({data:e}){if(K9(e)){const o=e.items.map(i=>s.jsx(by,{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)}by.displayName="@mantine/core/NativeSelectOption";const Y9={rightSectionPointerEvents:"none"},Et=Y((e,t)=>{const{data:n,children:r,size:o,error:i,rightSection:a,unstyled:l,...c}=B("NativeSelect",Y9,e),u=NE(n).map((d,f)=>s.jsx(by,{data:d},f));return s.jsx(Yn,{component:"select",ref:t,...c,__staticSelector:"NativeSelect",size:o,pointer:!0,error:i,unstyled:l,rightSection:a||s.jsx(Of,{size:o,error:i,unstyled:l}),children:r||u})});Et.classes=Yn.classes;Et.displayName="@mantine/core/NativeSelect";var cP={root:"m_a513464",icon:"m_a4ceffb",loader:"m_b0920b15",body:"m_a49ed24",title:"m_3feedf16",description:"m_3d733a3a",closeButton:"m_919a4d88"};const X9={withCloseButton:!0},J9=(e,{radius:t,color:n})=>({root:{"--notification-radius":t===void 0?void 0:wt(t),"--notification-color":n?xt(n,e):void 0}}),jy=Y((e,t)=>{const n=B("Notification",X9,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:y,variant:w,vars:x,mod:b,...C}=n,E=pe({name:"Notification",classes:cP,props:n,className:r,style:v,classNames:g,styles:S,unstyled:y,vars:x,varsResolver:J9});return s.jsxs(q,{...E("root"),mod:[{"data-with-icon":!!d||a,"data-with-border":c},b],ref:t,variant:w,...C,role:"alert",children:[d&&!a&&s.jsx("div",{...E("icon"),children:d}),a&&s.jsx(Qn,{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(Cs,{iconSize:16,color:"gray",...m,unstyled:y,onClick:h,...E("closeButton")})]})});jy.classes=cP;jy.displayName="@mantine/core/Notification";function uP(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 cc;(function(e){e.event="event",e.props="prop"})(cc||(cc={}));function ui(){}function Z9(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 uc(e){return!!(e||"").match(/\d/)}function Sa(e){return e==null}function eM(e){return typeof e=="number"&&isNaN(e)}function dP(e){return Sa(e)||eM(e)||typeof e=="number"&&!isFinite(e)}function fP(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function tM(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 nM(e,t,n){var r=tM(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 rM(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 Cy(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 oM(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 hP(e,t,n){for(var r="",o=n?"0":"",i=0;i<=t-1;i++)r+=e[i]||o;return r}function nw(e,t){return Array(t+1).join(e)}function pP(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."+nw("0",Math.abs(a))+o:a>=l?o=o+nw("0",a-l):o=(o.substring(0,a)||"0")+"."+o.substring(a),n+o}function rw(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,o=Cy(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,y){return v.length>y?(Number(v[0])+Number(S)).toString()+v.substring(1,v.length):S+v},d[0]));var h=hP(d[1]||"",t,n),m=l?"-":"",g=r?".":"";return""+m+f+g+h}function qi(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 mP=Z9(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}}});function iM(e,t,n){return Math.min(Math.max(e,t),n)}function mp(e){return Math.max(e.selectionStart,e.selectionEnd)}function sM(){return typeof navigator<"u"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function aM(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function lM(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,o=e.formattedValueIndex;return t[r]===n[o]}function cM(e,t,n,r,o,i,a){a===void 0&&(a=lM);var l=o.findIndex(function(b){return b}),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 y=r;y<u&&(h[y]===-1||!i(n[y]));)y++;var w=y===u||h[y]===-1?d:h[y];for(y=r-1;y>0&&h[y]===-1;)y--;var x=y===-1||h[y]===-1?0:h[y]+1;return x>w?w:r-x<w-r?x:w}function ow(e,t,n,r){var o=e.length;if(t=iM(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 uM(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(uc(e[n])||uc(e[n-1]));return t}function gP(e,t,n,r,o,i){i===void 0&&(i=ui);var a=rM(function(g,v){var S,y;return dP(g)?(y="",S=""):typeof g=="number"||v?(y=typeof g=="number"?pP(g):g,S=r(y)):(y=o(g,void 0),S=r(y)),{formattedValue:S,numAsString:y}}),l=p.useState(function(){return a(Sa(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;Sa(e)&&(f=c.numAsString,h=!0);var m=a(f,h);return p.useMemo(function(){u(m)},[m.formattedValue]),[c,d]}function dM(e){return e.replace(/[^0-9]/g,"")}function fM(e){return e}function hM(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=fM);var l=e.removeFormatting;l===void 0&&(l=dM);var c=e.defaultValue,u=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=ui);var m=e.onKeyDown;m===void 0&&(m=ui);var g=e.onMouseUp;g===void 0&&(g=ui);var v=e.onFocus;v===void 0&&(v=ui);var S=e.onBlur;S===void 0&&(S=ui);var y=e.value,w=e.getCaretBoundary;w===void 0&&(w=uM);var x=e.isValidInputCharacter;x===void 0&&(x=uc);var b=e.isCharacterSame,C=uP(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),E=gP(y,c,!!u,a,l,d),j=E[0],P=j.formattedValue,_=j.numAsString,R=E[1],M=p.useRef({formattedValue:P,numAsString:_}),D=function(ee,te){M.current={formattedValue:ee.formattedValue,numAsString:ee.value},R(ee,te)},N=p.useState(!1),A=N[0],L=N[1],I=p.useRef(null),k=p.useRef({setCaretTimeout:null,focusTimeout:null});p.useEffect(function(){return L(!0),function(){clearTimeout(k.current.setCaretTimeout),clearTimeout(k.current.focusTimeout)}},[]);var T=a,$=function(ee,te){var Ee=parseFloat(te);return{formattedValue:ee,value:te,floatValue:isNaN(Ee)?void 0:Ee}},V=function(ee,te,Ee){ee.selectionStart===0&&ee.selectionEnd===ee.value.length||(qi(ee,te),k.current.setCaretTimeout=setTimeout(function(){ee.value===Ee&&ee.selectionStart!==te&&qi(ee,te)},0))},U=function(ee,te,Ee){return ow(ee,te,w(ee),Ee)},X=function(ee,te,Ee){var Qe=w(te),Ke=cM(te,P,ee,Ee,Qe,x,b);return Ke=ow(te,Ke,Qe),Ke},Se=function(ee){var te=ee.formattedValue;te===void 0&&(te="");var Ee=ee.input,Qe=ee.source,Ke=ee.event,Fe=ee.numAsString,K;if(Ee){var G=ee.inputValue||Ee.value,fe=mp(Ee);Ee.value=te,K=X(G,te,fe),K!==void 0&&V(Ee,K,te)}te!==P&&D($(te,Fe),{event:Ke,source:Qe})};p.useEffect(function(){var ee=M.current,te=ee.formattedValue,Ee=ee.numAsString;P!==te&&(P!==_||te!==Ee)&&D($(P,_),{event:void 0,source:cc.props})},[P,_]);var me=I.current?mp(I.current):void 0,xe=typeof window<"u"?p.useLayoutEffect:p.useEffect;xe(function(){var ee=I.current;if(P!==M.current.formattedValue&&ee){var te=X(M.current.formattedValue,P,me);ee.value=P,V(ee,te,P)}},[P]);var Te=function(ee,te,Ee){var Qe=mP(P,ee),Ke=Object.assign(Object.assign({},Qe),{lastValue:P}),Fe=l(ee,Ke),K=T(Fe);if(Fe=l(K,void 0),f&&!f($(K,Fe))){var G=te.target,fe=mp(G),tt=X(ee,P,fe);return G.value=P,V(G,tt,P),!1}return Se({formattedValue:K,numAsString:Fe,inputValue:ee,event:te,source:Ee,input:te.target}),!0},je=function(ee){var te=ee.target,Ee=te.value,Qe=Te(Ee,ee,cc.event);Qe&&h(ee)},ae=function(ee){var te=ee.target,Ee=ee.key,Qe=te.selectionStart,Ke=te.selectionEnd,Fe=te.value;Fe===void 0&&(Fe="");var K;if(Ee==="ArrowLeft"||Ee==="Backspace"?K=Math.max(Qe-1,0):Ee==="ArrowRight"?K=Math.min(Qe+1,Fe.length):Ee==="Delete"&&(K=Qe),K===void 0||Qe!==Ke){m(ee);return}var G=K;if(Ee==="ArrowLeft"||Ee==="ArrowRight"){var fe=Ee==="ArrowLeft"?"left":"right";G=U(Fe,K,fe),G!==K&&ee.preventDefault()}else Ee==="Delete"&&!x(Fe[K])?G=U(Fe,K,"right"):Ee==="Backspace"&&!x(Fe[K])&&(G=U(Fe,K,"left"));G!==K&&V(te,G,Fe),ee.isUnitTestRun&&V(te,G,Fe),m(ee)},Be=function(ee){var te=ee.target,Ee=function(){var Qe=te.selectionStart,Ke=te.selectionEnd,Fe=te.value;if(Fe===void 0&&(Fe=""),Qe===Ke){var K=U(Fe,Qe);K!==Qe&&V(te,K,Fe)}};Ee(),requestAnimationFrame(function(){Ee()}),g(ee)},St=function(ee){ee.persist&&ee.persist();var te=ee.target,Ee=ee.currentTarget;I.current=te,k.current.focusTimeout=setTimeout(function(){var Qe=te.selectionStart,Ke=te.selectionEnd,Fe=te.value;Fe===void 0&&(Fe="");var K=U(Fe,Qe);K!==Qe&&!(Qe===0&&Ke===Fe.length)&&V(te,K,Fe),v(Object.assign(Object.assign({},ee),{currentTarget:Ee}))},0)},st=function(ee){I.current=null,clearTimeout(k.current.focusTimeout),clearTimeout(k.current.setCaretTimeout),S(ee)},ye=A&&sM()?"numeric":void 0,$e=Object.assign({inputMode:ye},C,{type:t,value:P,onChange:je,onKeyDown:ae,onMouseUp:Be,onFocus:St,onBlur:st});if(n==="text")return o?nn.createElement(nn.Fragment,null,o(P,C)||null):nn.createElement("span",Object.assign({},C,{ref:i}),P);if(r){var Ie=r;return nn.createElement(Ie,Object.assign({},$e,{ref:i}))}return nn.createElement("input",Object.assign({},$e,{ref:i}))}function iw(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=Yf(t),u=c.thousandSeparator,d=c.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=Cy(e,a),m=h.beforeDecimal,g=h.afterDecimal,v=h.addNegation;return n!==void 0&&(g=hP(g,n,!!r)),u&&(m=nM(m,u,l)),o&&(m=o+m),i&&(g=g+i),v&&(m="-"+m),e=m+(f&&d||"")+g,e}function Yf(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 pM(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 mM(e,t){return new RegExp("(^-)|[0-9]|"+fP(e),"g")}function gM(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function vM(e,t,n){var r;t===void 0&&(t=aM(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=Yf(n),m=h.allowedDecimalSeparators,g=h.decimalSeparator,v=e[f]===g;if(uc(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 y=function(k,T,$){var V=!1,U=!1;i.startsWith("-")?V=!1:k.startsWith("--")?(V=!1,U=!0):a.startsWith("-")&&k.length===a.length?V=!1:k[0]==="-"&&(V=!0);var X=V?1:0;return U&&(X=2),X&&(k=k.substring(X),T-=X,$-=X),{value:k,start:T,end:$,hasNegation:V}},w=y(e,d,f),x=w.hasNegation;r=w,e=r.value,d=r.start,f=r.end;var b=y(t.lastValue,c.start,c.end),C=b.start,E=b.end,j=b.value,P=e.substring(d,f);e.length&&j.length&&(C>j.length-a.length||E<i.length)&&!(P&&a.startsWith(P))&&(e=j);var _=0;e.startsWith(i)?_+=i.length:d<i.length&&(_=d),e=e.substring(_),f-=_;var R=e.length,M=e.length-a.length;e.endsWith(a)?R=M:(f>M||f>e.length-a.length)&&(R=f),e=e.substring(0,R),e=pM(x?"-"+e:e,o),e=(e.match(mM(g))||[]).join("");var D=e.indexOf(g);e=e.replace(new RegExp(fP(g),"g"),function(k,T){return T===D?".":""});var N=Cy(e,o),A=N.beforeDecimal,L=N.afterDecimal,I=N.addNegation;return u.end-u.start<c.end-c.start&&A===""&&v&&!parseFloat(L)&&(e=I?"-":""),e}function yM(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 xM(e){var t=Yf(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 wM(e){e=xM(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,o=e.onKeyDown;o===void 0&&(o=ui);var i=e.onBlur;i===void 0&&(i=ui);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=uP(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),v=Yf(e),S=v.decimalSeparator,y=v.allowedDecimalSeparators,w=function(I){return iw(I,e)},x=function(I,k){return vM(I,k,e)},b=Sa(f)?d:f,C=h??gM(b,u,t);Sa(f)?Sa(d)||(C=C||typeof d=="number"):C=C||typeof f=="number";var E=function(I){return dP(I)?I:(typeof I=="number"&&(I=pP(I)),C&&typeof l=="number"?rw(I,l,!!c):I)},j=gP(E(f),E(d),!!C,w,x,m),P=j[0],_=P.numAsString,R=P.formattedValue,M=j[1],D=function(I){var k=I.target,T=I.key,$=k.selectionStart,V=k.selectionEnd,U=k.value;if(U===void 0&&(U=""),$!==V){o(I);return}T==="Backspace"&&U[0]==="-"&&$===u.length+1&&n&&qi(k,1),l&&c&&(T==="Backspace"&&U[$-1]===S?(qi(k,$-1),I.preventDefault()):T==="Delete"&&U[$]===S&&I.preventDefault()),y!=null&&y.includes(T)&&U[$]===S&&qi(k,$+1);var X=a===!0?",":a;T==="Backspace"&&U[$-1]===X&&qi(k,$-1),T==="Delete"&&U[$]===X&&qi(k,$+1),o(I)},N=function(I){var k=_;if(k.match(/\d/g)||(k=""),r||(k=oM(k)),c&&l&&(k=rw(k,l,c)),k!==_){var T=iw(k,e);M({formattedValue:T,value:k,floatValue:parseFloat(k)},{event:I,source:cc.event})}i(I)},A=function(I){return I===S?!0:uc(I)},L=function(I){var k=I.currentValue,T=I.lastValue,$=I.formattedValue,V=I.currentValueIndex,U=I.formattedValueIndex,X=k[V],Se=$[U],me=mP(T,k),xe=me.to;return V>=xe.start&&V<xe.end&&y&&y.includes(X)&&Se===S?!0:X===Se};return Object.assign(Object.assign({},g),{value:R,valueIsNumericString:!1,isValidInputCharacter:A,isCharacterSame:L,onValueChange:M,format:w,removeFormatting:x,getCaretBoundary:function(I){return yM(I,e)},onKeyDown:D,onBlur:N})}function SM(e){var t=wM(e);return nn.createElement(hM,Object.assign({},t))}function sw({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 $m={root:"m_e2f5cd4e",controls:"m_95e17d22",control:"m_80b4b171"};const bM=/^-0(\.0*)?$/,jM=/^-?0\d+$/;function CM(e){return(typeof e=="number"?e<Number.MAX_SAFE_INTEGER:!Number.isNaN(Number(e)))&&!Number.isNaN(e)}function aw(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 EM={step:1,clampBehavior:"blur",allowDecimal:!0,allowNegative:!0,withKeyboardEvents:!0,startValue:0},PM=(e,{size:t})=>({controls:{"--ni-chevron-size":Oe(t,"ni-chevron-size")}}),Ey=Y((e,t)=>{const n=B("NumberInput",EM,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:y,clampBehavior:w,onBlur:x,allowDecimal:b,decimalScale:C,onKeyDown:E,onKeyDownCapture:j,handlersRef:P,startValue:_,disabled:R,rightSectionPointerEvents:M,allowNegative:D,readOnly:N,size:A,rightSectionWidth:L,stepHoldInterval:I,stepHoldDelay:k,allowLeadingZeros:T,withKeyboardEvents:$,...V}=n,U=pe({name:"NumberInput",classes:$m,props:n,classNames:o,styles:i,unstyled:a,vars:l,varsResolver:PM}),{resolvedClassNames:X,resolvedStyles:Se}=Cc({classNames:o,styles:i,props:n}),[me,xe]=pn({value:d,defaultValue:f,onChange:c}),Te=k!==void 0&&I!==void 0,je=p.useRef(null),ae=p.useRef(null),Be=p.useRef(0),St=(G,fe)=>{fe.source==="event"&&xe(CM(G.floatValue)&&!bM.test(G.value)&&!(T&&jM.test(G.value))?G.floatValue:G.value),u==null||u(G,fe)},st=G=>{const fe=String(G).match(/(?:\.(\d+))?(?:[eE]([+-]?\d+))?$/);return fe?Math.max(0,(fe[1]?fe[1].length:0)-(fe[2]?+fe[2]:0)):0},ye=G=>{je.current&&typeof G<"u"&&je.current.setSelectionRange(G,G)},$e=p.useRef();$e.current=()=>{let G;const fe=st(me),tt=st(g),Pt=Math.max(fe,tt),ht=10**Pt;if(typeof me!="number"||Number.isNaN(me))G=yu(_,m,h);else if(h!==void 0){const Gt=(Math.round(me*ht)+Math.round(g*ht))/ht;G=Gt<=h?Gt:h}else G=(Math.round(me*ht)+Math.round(g*ht))/ht;const Ot=G.toFixed(Pt);xe(parseFloat(Ot)),u==null||u({floatValue:parseFloat(Ot),formattedValue:Ot,value:Ot},{source:"increment"}),setTimeout(()=>{var Gt;return ye((Gt=je.current)==null?void 0:Gt.value.length)},0)};const Ie=p.useRef();Ie.current=()=>{let G;const fe=m!==void 0?m:D?Number.MIN_SAFE_INTEGER:0,tt=st(me),Pt=st(g),ht=Math.max(tt,Pt),Ot=10**ht;if(typeof me!="number"||Number.isNaN(me))G=yu(_,fe,h);else{const gn=(Math.round(me*Ot)-Math.round(g*Ot))/Ot;G=fe!==void 0&&gn<fe?fe:gn}const Gt=G.toFixed(ht);xe(parseFloat(Gt)),u==null||u({floatValue:parseFloat(Gt),formattedValue:Gt,value:Gt},{source:"decrement"}),setTimeout(()=>{var gn;return ye((gn=je.current)==null?void 0:gn.value.length)},0)};const ee=G=>{E==null||E(G),!(N||!$)&&(G.key==="ArrowUp"&&(G.preventDefault(),$e.current()),G.key==="ArrowDown"&&(G.preventDefault(),Ie.current()))},te=G=>{if(j==null||j(G),G.key==="Backspace"){const fe=je.current;fe.selectionStart===0&&fe.selectionStart===fe.selectionEnd&&(G.preventDefault(),window.setTimeout(()=>ye(0),0))}};uf(P,{increment:$e.current,decrement:Ie.current});const Ee=G=>{G?$e.current():Ie.current(),Be.current+=1},Qe=G=>{if(Ee(G),Te){const fe=typeof I=="number"?I:I(Be.current);ae.current=window.setTimeout(()=>Qe(G),fe)}},Ke=(G,fe)=>{var tt;G.preventDefault(),(tt=je.current)==null||tt.focus(),Ee(fe),Te&&(ae.current=window.setTimeout(()=>Qe(fe),k))},Fe=()=>{ae.current&&window.clearTimeout(ae.current),ae.current=null,Be.current=0},K=s.jsxs("div",{...U("controls"),children:[s.jsx(An,{...U("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof me=="number"&&h!==void 0&&me>=h,mod:{direction:"up"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{Ke(G,!0)},onPointerUp:Fe,onPointerLeave:Fe,children:s.jsx(sw,{direction:"up"})}),s.jsx(An,{...U("control"),tabIndex:-1,"aria-hidden":!0,disabled:R||typeof me=="number"&&m!==void 0&&me<=m,mod:{direction:"down"},onMouseDown:G=>G.preventDefault(),onPointerDown:G=>{Ke(G,!1)},onPointerUp:Fe,onPointerLeave:Fe,children:s.jsx(sw,{direction:"down"})})]});return s.jsx(Yn,{component:SM,allowNegative:D,className:nt($m.root,r),size:A,...V,readOnly:N,disabled:R,value:me,getInputRef:qt(t,je),onValueChange:St,rightSection:v||N?S:S||K,classNames:X,styles:Se,unstyled:a,__staticSelector:"NumberInput",decimalScale:b?C:0,onKeyDown:ee,onKeyDownCapture:te,rightSectionPointerEvents:M??(R?"none":void 0),rightSectionWidth:L??`var(--ni-right-section-width-${A||"sm"})`,allowLeadingZeros:T,onBlur:G=>{x==null||x(G),w==="blur"&&typeof me=="number"&&yu(me,m,h)!==me&&xe(yu(me,m,h))},isAllowed:G=>w==="strict"?y?y(G)&&aw(G.floatValue,m,h):aw(G.floatValue,m,h):y?y(G):!0})});Ey.classes={...Yn.classes,...$m};Ey.displayName="@mantine/core/NumberInput";const[TM,Xf]=On("Pagination.Root component was not found in tree");var Fc={root:"m_4addd315",control:"m_326d024a",dots:"m_4ad7767d"};const kM={withPadding:!0},zc=Y((e,t)=>{const n=B("PaginationControl",kM,e),{classNames:r,className:o,style:i,styles:a,vars:l,active:c,disabled:u,withPadding:d,mod:f,...h}=n,m=Xf(),g=u||m.disabled;return s.jsx(An,{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})});zc.classes=Fc;zc.displayName="@mantine/core/PaginationControl";function Vc({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 RM=e=>s.jsx(Vc,{...e,path:"M8.781 8l-3.3-3.3.943-.943L10.667 8l-4.243 4.243-.943-.943 3.3-3.3z"}),_M=e=>s.jsx(Vc,{...e,path:"M7.219 8l3.3 3.3-.943.943L5.333 8l4.243-4.243.943.943-3.3 3.3z"}),DM=e=>s.jsx(Vc,{...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"}),IM=e=>s.jsx(Vc,{...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"}),AM=e=>s.jsx(Vc,{...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"}),NM={icon:AM},Jf=Y((e,t)=>{const n=B("PaginationDots",NM,e),{classNames:r,className:o,style:i,styles:a,vars:l,icon:c,...u}=n,d=Xf(),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)"}})})});Jf.classes=Fc;Jf.displayName="@mantine/core/PaginationDots";function Zf({icon:e,name:t,action:n,type:r}){const o={icon:e},i=p.forwardRef((a,l)=>{const{icon:c,...u}=B(t,o,a),d=c,f=Xf(),h=r==="next"?f.active===f.total:f.active===1;return s.jsx(zc,{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 vP=Zf({icon:RM,name:"PaginationNext",action:"onNext",type:"next"}),yP=Zf({icon:_M,name:"PaginationPrevious",action:"onPrevious",type:"previous"}),xP=Zf({icon:DM,name:"PaginationFirst",action:"onFirst",type:"previous"}),wP=Zf({icon:IM,name:"PaginationLast",action:"onLast",type:"next"});function Py({dotsIcon:e}){const t=Xf(),n=t.range.map((r,o)=>{var i;return r==="dots"?s.jsx(Jf,{icon:e},o):s.jsx(zc,{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})}Py.displayName="@mantine/core/PaginationItems";const MM={siblings:1,boundaries:1},OM=(e,{size:t,radius:n,color:r,autoContrast:o})=>({root:{"--pagination-control-radius":n===void 0?void 0:wt(n),"--pagination-control-size":Oe(t,"pagination-control-size"),"--pagination-control-fz":rn(t),"--pagination-active-bg":r?xt(r,e):void 0,"--pagination-active-color":Ec(o,e)?xs({color:r,theme:e}):void 0}}),eh=Y((e,t)=>{const n=B("PaginationRoot",MM,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:y,onNextPage:w,onPreviousPage:x,onFirstPage:b,onLastPage:C,getItemProps:E,autoContrast:j,...P}=n,_=pe({name:"Pagination",classes:Fc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:OM}),{range:R,setPage:M,next:D,previous:N,active:A,first:L,last:I}=m_({page:d,initialPage:f,onChange:h,total:u,siblings:g,boundaries:v}),k=Zn(w,D),T=Zn(x,N),$=Zn(b,L),V=Zn(C,I);return s.jsx(TM,{value:{total:u,range:R,active:A,disabled:m,getItemProps:E,onChange:M,onNext:k,onPrevious:T,onFirst:$,onLast:V,getStyles:_},children:s.jsx(q,{ref:t,..._("root"),...P})})});eh.classes=Fc;eh.displayName="@mantine/core/PaginationRoot";const $M={withControls:!0,siblings:1,boundaries:1,gap:8},Gr=Y((e,t)=>{const n=B("Pagination",$M,e),{withEdges:r,withControls:o,getControlProps:i,nextIcon:a,previousIcon:l,lastIcon:c,firstIcon:u,dotsIcon:d,total:f,gap:h,...m}=n;return f<=0?null:s.jsx(eh,{ref:t,total:f,...m,children:s.jsxs(Z,{gap:h,children:[r&&s.jsx(xP,{icon:u,...i==null?void 0:i("first")}),o&&s.jsx(yP,{icon:l,...i==null?void 0:i("previous")}),s.jsx(Py,{dotsIcon:d}),o&&s.jsx(vP,{icon:a,...i==null?void 0:i("next")}),r&&s.jsx(wP,{icon:c,...i==null?void 0:i("last")})]})})});Gr.classes=Fc;Gr.displayName="@mantine/core/Pagination";Gr.Root=eh;Gr.Control=zc;Gr.Dots=Jf;Gr.First=xP;Gr.Last=wP;Gr.Next=vP;Gr.Previous=yP;Gr.Items=Py;const LM=({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 Lm={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const FM={visibilityToggleIcon:LM},zM=(e,{size:t})=>({root:{"--psi-icon-size":Oe(t,"psi-icon-size"),"--psi-button-size":Oe(t,"psi-button-size")}}),zr=Y((e,t)=>{const n=B("PasswordInput",FM,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:y,size:w,errorProps:x,descriptionProps:b,labelProps:C,withAsterisk:E,inputWrapperOrder:j,wrapperProps:P,radius:_,rightSection:R,rightSectionWidth:M,rightSectionPointerEvents:D,leftSectionWidth:N,visible:A,defaultVisible:L,onVisibilityChange:I,visibilityToggleIcon:k,visibilityToggleButtonProps:T,rightSectionProps:$,leftSectionProps:V,leftSectionPointerEvents:U,mod:X,...Se}=n,me=$n(m),[xe,Te]=pn({value:A,defaultValue:L,finalValue:!1,onChange:I}),je=()=>Te(!xe),ae=pe({name:"PasswordInput",classes:Lm,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:zM}),{resolvedClassNames:Be,resolvedStyles:St}=Cc({classNames:r,styles:a,props:n}),{styleProps:st,rest:ye}=Lo(Se),$e=k,Ie=s.jsx(Zt,{...ae("visibilityToggle"),disabled:h,radius:_,"aria-hidden":!T,tabIndex:-1,...T,variant:"subtle",color:"gray",unstyled:l,onMouseDown:ee=>{var te;ee.preventDefault(),(te=T==null?void 0:T.onMouseDown)==null||te.call(T,ee),je()},onKeyDown:ee=>{var te;(te=T==null?void 0:T.onKeyDown)==null||te.call(T,ee),ee.key===" "&&(ee.preventDefault(),je())},children:s.jsx($e,{reveal:xe})});return s.jsx(_t.Wrapper,{required:u,id:me,label:y,error:d,description:S,size:w,classNames:Be,styles:St,__staticSelector:"PasswordInput",errorProps:x,descriptionProps:b,unstyled:l,withAsterisk:E,inputWrapperOrder:j,inputContainer:v,variant:g,labelProps:{...C,htmlFor:me},mod:X,...ae("root"),...st,...P,children:s.jsx(_t,{component:"div",error:d,leftSection:f,size:w,classNames:{...Be,input:nt(Lm.input,Be.input)},styles:St,radius:_,disabled:h,__staticSelector:"PasswordInput",rightSectionWidth:M,rightSection:R??Ie,variant:g,unstyled:l,leftSectionWidth:N,rightSectionPointerEvents:D||"all",rightSectionProps:$,leftSectionProps:V,leftSectionPointerEvents:U,withAria:!1,children:s.jsx("input",{required:u,"data-invalid":!!d||void 0,"data-with-left-section":!!f||void 0,...ae("innerInput"),disabled:h,id:me,ref:t,...ye,autoComplete:ye.autoComplete||"off",type:xe?"text":"password"})})})});zr.classes={...Yn.classes,...Lm};zr.displayName="@mantine/core/PasswordInput";const[VM,BM]=jc(),UM={},Ty=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,name:c,readOnly:u,...d}=B("RadioGroup",UM,e),f=$n(c),[h,m]=pn({value:n,defaultValue:r,finalValue:"",onChange:o}),g=v=>!u&&m(v.currentTarget.value);return s.jsx(VM,{value:{value:h,onChange:g,size:i,name:f},children:s.jsx(_t.Wrapper,{size:i,ref:t,...a,...d,labelElement:"div",__staticSelector:"RadioGroup",children:s.jsx(ny,{role:"radiogroup",children:l})})})});Ty.classes=_t.Wrapper.classes;Ty.displayName="@mantine/core/RadioGroup";function HM({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:z(e),height:z(e),...t},"aria-hidden":!0,...n,children:s.jsx("circle",{cx:"2.5",cy:"2.5",r:"2.5",fill:"currentColor"})})}var SP={root:"m_f3f1af94",inner:"m_89c4f5e4",icon:"m_f3ed6b2b",radio:"m_8a3dbb89","radio--outline":"m_1bfe9d39"};const WM={labelPosition:"right"},qM=(e,{size:t,radius:n,color:r,iconColor:o,variant:i,autoContrast:a})=>{const l=uo({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":Oe(t,"radio-size"),"--radio-radius":n===void 0?void 0:wt(n),"--radio-color":i==="outline"?c:xt(r,e),"--radio-icon-color":o?xt(o,e):Ec(a,e)?xs({color:r,theme:e}):void 0,"--radio-icon-size":Oe(t,"radio-icon-size")}}},dc=Y((e,t)=>{const n=B("Radio",WM,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:y,disabled:w,wrapperProps:x,icon:b=HM,rootRef:C,iconColor:E,onChange:j,mod:P,..._}=n,R=pe({name:"Radio",classes:SP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:qM}),M=BM(),D=(M==null?void 0:M.size)??d,N=n.size?d:D,{styleProps:A,rest:L}=Lo(_),I=$n(u),k=M?{checked:M.value===L.value,name:L.name??M.name,onChange:T=>{M.onChange(T),j==null||j(T)}}:{};return s.jsx($f,{...R("root"),__staticSelector:"Radio",__stylesApiProps:n,id:I,size:N,labelPosition:h,label:f,description:m,error:g,disabled:w,classNames:r,styles:a,unstyled:l,"data-checked":k.checked||void 0,variant:y,ref:C,mod:P,...A,...x,children:s.jsxs(q,{...R("inner"),mod:{"label-position":h},children:[s.jsx(q,{...R("radio",{focusable:!0,variant:y}),onChange:j,...L,...k,component:"input",mod:{error:!!g},ref:t,id:I,disabled:w,type:"radio"}),s.jsx(b,{...R("icon"),"aria-hidden":!0})]})})});dc.classes=SP;dc.displayName="@mantine/core/Radio";dc.Group=Ty;const GM={duration:100,transition:"fade"};function QM(e,t){return{...GM,...t,...e}}function KM({offset:e,position:t}){const[n,r]=p.useState(!1),o=p.useRef(),{x:i,y:a,elements:l,refs:c,update:u,placement:d}=Nv({placement:t,middleware:[_v({crossAxis:!0,padding:5,rootBoundary:"document"})]}),f=d.includes("right")?e:t.includes("left")?e*-1:0,h=d.includes("bottom")?e:t.includes("top")?e*-1:0,m=p.useCallback(({clientX:g,clientY:v})=>{c.setPositionReference({getBoundingClientRect(){return{width:0,height:0,x:g,y:v,left:g+f,top:v+h,right:g,bottom:v}}})},[l.reference]);return p.useEffect(()=>{if(c.floating.current){const g=o.current;g.addEventListener("mousemove",m);const v=Co(c.floating.current);return v.forEach(S=>{S.addEventListener("scroll",u)}),()=>{g.removeEventListener("mousemove",m),v.forEach(S=>{S.removeEventListener("scroll",u)})}}},[l.reference,c.floating.current,u,m,n]),{handleMouseMove:m,x:i,y:a,opened:n,setOpened:r,boundaryRef:o,floating:c.setFloating}}var th={tooltip:"m_1b3c8819",arrow:"m_f898399f"};const YM={refProp:"ref",withinPortal:!0,offset:10,position:"right",zIndex:Wr("popover")},XM=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:wt(t),"--tooltip-bg":n?xt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),ky=Y((e,t)=>{const n=B("TooltipFloating",YM,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:y,disabled:w,variant:x,vars:b,portalProps:C,...E}=n,j=Dt(),P=pe({name:"TooltipFloating",props:n,classes:th,className:l,style:a,classNames:c,styles:u,unstyled:d,rootSelector:"tooltip",vars:b,varsResolver:XM}),{handleMouseMove:_,x:R,y:M,opened:D,boundaryRef:N,floating:A,setOpened:L}=KM({offset:g,position:v});if(!$o(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 I=qt(N,r.ref,t),k=$=>{var V,U;(U=(V=r.props).onMouseEnter)==null||U.call(V,$),_($),L(!0)},T=$=>{var V,U;(U=(V=r.props).onMouseLeave)==null||U.call(V,$),L(!1)};return s.jsxs(s.Fragment,{children:[s.jsx(js,{...C,withinPortal:i,children:s.jsx(q,{...E,...P("tooltip",{style:{...kb(a,j),zIndex:y,display:!w&&D?"block":"none",top:(M&&Math.round(M))??"",left:(R&&Math.round(R))??""}}),variant:x,ref:A,mod:{multiline:S},children:m})}),p.cloneElement(r,{...r.props,[o]:I,onMouseEnter:k,onMouseLeave:T})]})});ky.classes=th;ky.displayName="@mantine/core/TooltipFloating";const bP=p.createContext(!1),JM=bP.Provider,ZM=()=>p.useContext(bP),eO={openDelay:0,closeDelay:0};function jP(e){const{openDelay:t,closeDelay:n,children:r}=B("TooltipGroup",eO,e);return s.jsx(JM,{value:!0,children:s.jsx(s4,{delay:{open:t,close:n},children:r})})}jP.displayName="@mantine/core/TooltipGroup";function tO(e){var E,j,P;const[t,n]=p.useState(!1),o=typeof e.opened=="boolean"?e.opened:t,i=ZM(),a=$n(),{delay:l,currentId:c,setCurrentId:u}=uE(),d=p.useCallback(_=>{n(_),_&&u(a)},[u,a]),{x:f,y:h,context:m,refs:g,update:v,placement:S,middlewareData:{arrow:{x:y,y:w}={}}}=Nv({strategy:e.strategy,placement:e.position,open:o,onOpenChange:d,middleware:[iE(e.offset),_v({padding:8}),Am(),sE({element:e.arrowRef,padding:e.arrowOffset}),...e.inline?[Nm()]:[]]}),{getReferenceProps:x,getFloatingProps:b}=h4([i4(m,{enabled:(E=e.events)==null?void 0:E.hover,delay:i?l:{open:e.openDelay,close:e.closeDelay},mouseOnly:!((j=e.events)!=null&&j.touch)}),f4(m,{enabled:(P=e.events)==null?void 0:P.focus,visibleOnly:!0}),m4(m,{role:"tooltip"}),u4(m,{enabled:typeof e.opened>"u"}),a4(m,{id:a})]);vE({opened:o,position:e.position,positionDependencies:e.positionDependencies,floating:{refs:g,update:v}}),Po(()=>{var _;(_=e.onPositionChange)==null||_.call(e,S)},[S]);const C=o&&c&&c!==a;return{x:f,y:h,arrowX:y,arrowY:w,reference:g.setReference,floating:g.setFloating,getFloatingProps:b,getReferenceProps:x,isGroupPhase:C,opened:o,placement:S}}const lw={position:"top",refProp:"ref",withinPortal:!0,inline:!1,arrowSize:4,arrowOffset:5,arrowRadius:0,arrowPosition:"side",offset:5,transitionProps:{duration:100,transition:"fade"},events:{hover:!0,focus:!1,touch:!1},zIndex:Wr("popover"),positionDependencies:[]},nO=(e,{radius:t,color:n})=>({tooltip:{"--tooltip-radius":t===void 0?void 0:wt(t),"--tooltip-bg":n?xt(n,e):void 0,"--tooltip-color":n?"var(--mantine-color-white)":void 0}}),Za=Y((e,t)=>{const n=B("Tooltip",lw,e),{children:r,position:o,refProp:i,label:a,openDelay:l,closeDelay:c,onPositionChange:u,opened:d,withinPortal:f,radius:h,color:m,classNames:g,styles:v,unstyled:S,style:y,className:w,withArrow:x,arrowSize:b,arrowOffset:C,arrowRadius:E,arrowPosition:j,offset:P,transitionProps:_,multiline:R,events:M,zIndex:D,disabled:N,positionDependencies:A,onClick:L,onMouseEnter:I,onMouseLeave:k,inline:T,variant:$,keepMounted:V,vars:U,portalProps:X,mod:Se,floatingStrategy:me,...xe}=B("Tooltip",lw,n),{dir:Te}=Ua(),je=p.useRef(null),ae=tO({position:dE(Te,o),closeDelay:c,openDelay:l,onPositionChange:u,opened:d,events:M,arrowRef:je,arrowOffset:C,offset:typeof P=="number"?P+(x?b/2:0):P,positionDependencies:[...A,r],inline:T,strategy:me}),Be=pe({name:"Tooltip",props:n,classes:th,className:w,style:y,classNames:g,styles:v,unstyled:S,rootSelector:"tooltip",vars:U,varsResolver:nO});if(!$o(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 St=qt(ae.reference,r.ref,t),st=QM(_,{duration:100,transition:"fade"});return s.jsxs(s.Fragment,{children:[s.jsx(js,{...X,withinPortal:f,children:s.jsx(Vo,{...st,keepMounted:V,mounted:!N&&!!ae.opened,duration:ae.isGroupPhase?10:st.duration,children:ye=>s.jsxs(q,{...xe,variant:$,mod:[{multiline:R},Se],...ae.getFloatingProps({ref:ae.floating,className:Be("tooltip").className,style:{...Be("tooltip").style,...ye,zIndex:D,top:ae.y??0,left:ae.x??0}}),children:[a,s.jsx(Mv,{ref:je,arrowX:ae.arrowX,arrowY:ae.arrowY,visible:x,position:ae.placement,arrowSize:b,arrowOffset:C,arrowRadius:E,arrowPosition:j,...Be("arrow")})]})})}),p.cloneElement(r,ae.getReferenceProps({onClick:L,onMouseEnter:I,onMouseLeave:k,onMouseMove:n.onMouseMove,onPointerDown:n.onPointerDown,onPointerEnter:n.onPointerEnter,[i]:St,className:nt(w,r.props.className),...r.props}))]})});Za.classes=th;Za.displayName="@mantine/core/Tooltip";Za.Floating=ky;Za.Group=jP;function rO({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=Dt();return s.jsx(Za.Floating,{disabled:!c,label:c,children:s.jsx(q,{component:"circle",...f,...u("curve"),__vars:{"--curve-color":a?xt(a,h):void 0},fill:"none",strokeLinecap:l?"round":"butt",...rO({sum:r,size:e,thickness:o,value:t,offset:n,root:i})})})}CP.displayName="@mantine/core/Curve";function oO({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 iO(e,t){return Math.min(e||12,(t||120)/4)}const sO={size:120,thickness:12},aO=(e,{size:t,thickness:n})=>({root:{"--rp-size":z(t),"--rp-label-offset":z(n*2)}}),nh=Y((e,t)=>{const n=B("RingProgress",sO,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=pe({name:"RingProgress",classes:EP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:aO}),y=iO(h,f),w=oO({size:f,thickness:y,sections:d,renderRoundedLineCaps:m,rootColor:g}).map(({data:x,sum:b,root:C,lineRoundCaps:E,offset:j},P)=>p.createElement(CP,{...x,key:P,size:f,thickness:y,sum:b,offset:j,color:x==null?void 0:x.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})]})});nh.classes=EP;nh.displayName="@mantine/core/RingProgress";var PP={root:"m_cf365364",indicator:"m_9e182ccd",label:"m_1738fcb2",input:"m_1714d588",control:"m_69686b9b",innerLabel:"m_78882f40"};const lO={withItemsBorders:!0},cO=(e,{radius:t,color:n,transitionDuration:r,size:o,transitionTimingFunction:i})=>({root:{"--sc-radius":t===void 0?void 0:wt(t),"--sc-color":n?xt(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":Oe(o,"sc-padding"),"--sc-font-size":rn(o)}}),Ry=Y((e,t)=>{var Te,je;const n=B("SegmentedControl",lO,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:y,orientation:w,radius:x,color:b,transitionDuration:C,transitionTimingFunction:E,variant:j,autoContrast:P,withItemsBorders:_,mod:R,...M}=n,D=pe({name:"SegmentedControl",props:n,classes:PP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:cO}),N=Dt(),A=u.map(ae=>typeof ae=="string"?{label:ae,value:ae}:ae),L=y_(),[I,k]=p.useState(null),[T,$]=p.useState({}),V=(ae,Be)=>{T[Be]=ae,$(T)},[U,X]=pn({value:d,defaultValue:f,finalValue:Array.isArray(u)?((Te=A.find(ae=>!ae.disabled))==null?void 0:Te.value)??((je=u[0])==null?void 0:je.value)??null:null,onChange:h}),Se=$n(g),me=A.map(ae=>p.createElement(q,{...D("control"),mod:{active:U===ae.value,orientation:w},key:ae.value},s.jsx("input",{...D("input"),disabled:v||ae.disabled,type:"radio",name:Se,value:ae.value,id:`${Se}-${ae.value}`,checked:U===ae.value,onChange:()=>!S&&X(ae.value),"data-focus-ring":N.focusRing}),s.jsx(q,{component:"label",...D("label"),mod:{active:U===ae.value&&!(v||ae.disabled),disabled:v||ae.disabled,"read-only":S},htmlFor:`${Se}-${ae.value}`,ref:Be=>V(Be,ae.value),__vars:{"--sc-label-color":b!==void 0?xs({color:b,theme:N,autoContrast:P}):void 0},children:s.jsx("span",{...D("innerLabel"),children:ae.label})}))),xe=qt(t,ae=>k(ae));return u.length===0?null:s.jsxs(q,{...D("root"),variant:j,size:m,ref:xe,mod:[{"full-width":y,orientation:w,initialized:L,"with-items-borders":_},R],...M,role:"radiogroup",children:[typeof U=="string"&&s.jsx(zv,{target:T[U],parent:I,component:"span",transitionDuration:"var(--sc-transition-duration)",...D("indicator")}),me]})});Ry.classes=PP;Ry.displayName="@mantine/core/SegmentedControl";function uO({spacing:e,verticalSpacing:t,cols:n,selector:r}){var d;const o=Dt(),i=t===void 0?e:t,a=ys({"--sg-spacing-x":un(di(e)),"--sg-spacing-y":un(di(i)),"--sg-cols":(d=di(n))==null?void 0:d.toString()}),l=yt(o.breakpoints).reduce((f,h)=>(f[h]||(f[h]={}),typeof e=="object"&&e[h]!==void 0&&(f[h]["--sg-spacing-x"]=un(e[h])),typeof i=="object"&&i[h]!==void 0&&(f[h]["--sg-spacing-y"]=un(i[h])),typeof n=="object"&&n[h]!==void 0&&(f[h]["--sg-cols"]=n[h]),f),{}),u=Vl(yt(l),o).filter(f=>yt(l[f.value]).length>0).map(f=>({query:`(min-width: ${o.breakpoints[f.value]})`,styles:l[f.value]}));return s.jsx(Ba,{styles:a,media:u,selector:r})}var TP={root:"m_2415a157"};const dO={cols:1,spacing:"md"},_y=Y((e,t)=>{const n=B("SimpleGrid",dO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,cols:u,verticalSpacing:d,spacing:f,...h}=n,m=pe({name:"SimpleGrid",classes:TP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c}),g=Pc();return s.jsxs(s.Fragment,{children:[s.jsx(uO,{...n,selector:`.${g}`}),s.jsx(q,{ref:t,...m("root",{className:g}),...h})]})});_y.classes=TP;_y.displayName="@mantine/core/SimpleGrid";const fO={},rh=Y((e,t)=>{const{w:n,h:r,miw:o,mih:i,...a}=B("Space",fO,e);return s.jsx(q,{ref:t,...a,w:n,miw:o??n,h:r,mih:i??r})});rh.displayName="@mantine/core/Space";var kP={root:"m_6d731127"};const hO={gap:"md",align:"stretch",justify:"flex-start"},pO=(e,{gap:t,align:n,justify:r})=>({root:{"--stack-gap":un(t),"--stack-align":n,"--stack-justify":r}}),De=Y((e,t)=>{const n=B("Stack",hO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,align:u,justify:d,gap:f,variant:h,...m}=n,g=pe({name:"Stack",props:n,classes:kP,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:pO});return s.jsx(q,{ref:t,...g("root"),variant:h,...m})});De.classes=kP;De.displayName="@mantine/core/Stack";const[mO,gO]=On("Stepper component was not found in tree"),Ud=()=>null;Ud.displayName="@mantine/core/StepperCompleted";var Dy={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 zu=(e,t)=>typeof e=="function"?s.jsx(e,{step:t||0}):e,vO={withIcon:!0,allowStepClick:!0,iconPosition:"left"},Iy=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:y,allowStepClick:w,allowStepSelect:x,iconPosition:b,orientation:C,mod:E,...j}=B("StepperStep",vO,e),P=gO(),_=Dt(),R={classNames:n,styles:i},M=c==="stepCompleted"?null:c==="stepProgress"?h:d,D={"data-progress":c==="stepProgress"||void 0,"data-completed":c==="stepCompleted"||void 0};return s.jsxs(An,{...P.getStyles("step",{className:r,style:o,variant:P.orientation,...R}),mod:[{"icon-position":b||P.iconPosition,"allow-click":w},E],ref:t,...D,...j,__vars:{"--step-color":u?xt(u,_):void 0},tabIndex:w?0:-1,children:[v&&s.jsxs("span",{...P.getStyles("stepWrapper",R),children:[s.jsxs("span",{...P.getStyles("stepIcon",R),...D,children:[s.jsx(Vo,{mounted:c==="stepCompleted",transition:"pop",duration:200,children:N=>s.jsx("span",{...P.getStyles("stepCompletedIcon",{style:N,...R}),children:y?s.jsx(Qn,{color:"var(--mantine-color-white)",size:"calc(var(--stepper-icon-size) / 2)",...P.getStyles("stepLoader",R)}):zu(f,l)||s.jsx(Lf,{size:"60%"})})}),c!=="stepCompleted"?y?s.jsx(Qn,{...P.getStyles("stepLoader",R),size:"calc(var(--stepper-icon-size) / 2)",color:u}):zu(M||d,l):null]}),C==="vertical"&&s.jsx("span",{...P.getStyles("verticalSeparator",R),"data-active":c==="stepCompleted"||void 0})]}),(m||g)&&s.jsxs("span",{...P.getStyles("stepBody",R),"data-orientation":P.orientation,"data-icon-position":b||P.iconPosition,children:[m&&s.jsx("span",{...P.getStyles("stepLabel",R),children:zu(m,l)}),g&&s.jsx("span",{...P.getStyles("stepDescription",R),children:zu(g,l)})]})]})});Iy.classes=Dy;Iy.displayName="@mantine/core/StepperStep";const yO={orientation:"horizontal",iconPosition:"left",allowNextStepsSelect:!0,wrap:!0},xO=(e,{color:t,iconSize:n,size:r,contentPadding:o,radius:i,autoContrast:a})=>({root:{"--stepper-color":t?xt(t,e):void 0,"--stepper-icon-color":Ec(a,e)?xs({color:t,theme:e}):void 0,"--stepper-icon-size":n===void 0?Oe(r,"stepper-icon-size"):z(n),"--stepper-content-padding":un(o),"--stepper-radius":i===void 0?void 0:wt(i),"--stepper-fz":rn(r),"--stepper-spacing":un(r)}}),Ma=Y((e,t)=>{var k,T,$;const n=B("Stepper",yO,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:y,orientation:w,iconPosition:x,size:b,radius:C,allowNextStepsSelect:E,wrap:j,...P}=n,_=pe({name:"Stepper",classes:Dy,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:xO}),R=p.Children.toArray(u),M=R.filter(V=>V.type!==Ud),D=R.find(V=>V.type===Ud),N=M.reduce((V,U,X)=>{const Se=f===X?"stepProgress":f>X?"stepCompleted":"stepInactive",xe=typeof d!="function"?!1:typeof U.props.allowStepSelect=="boolean"?U.props.allowStepSelect:Se==="stepCompleted"||E;return V.push(p.cloneElement(U,{icon:U.props.icon||h||X+1,key:X,step:X,state:Se,onClick:()=>xe&&(d==null?void 0:d(X)),allowStepClick:xe,completedIcon:U.props.completedIcon||m,progressIcon:U.props.progressIcon||g,color:U.props.color||v,iconSize:S,radius:C,iconPosition:U.props.iconPosition||x,orientation:w,unstyled:l})),w==="horizontal"&&X!==M.length-1&&V.push(p.createElement("div",{..._("separator"),"data-active":X<f||void 0,"data-orientation":w,key:`separator-${X}`})),V},[]),A=(T=(k=M[f])==null?void 0:k.props)==null?void 0:T.children,L=($=D==null?void 0:D.props)==null?void 0:$.children,I=f>M.length-1?L:A;return s.jsx(mO,{value:{getStyles:_,orientation:w,iconPosition:x},children:s.jsxs(q,{..._("root"),ref:t,size:b,...P,children:[s.jsx(q,{..._("steps"),mod:{orientation:w,"icon-position":x,wrap:j&&w!=="vertical"},children:N}),I&&s.jsx("div",{..._("content"),children:I})]})})});Ma.classes=Dy;Ma.displayName="@mantine/core/Stepper";Ma.Completed=Ud;Ma.Step=Iy;const RP=p.createContext(null),wO=RP.Provider,SO=()=>p.useContext(RP),bO={},Ay=Y((e,t)=>{const{value:n,defaultValue:r,onChange:o,size:i,wrapperProps:a,children:l,readOnly:c,...u}=B("SwitchGroup",bO,e),[d,f]=pn({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(wO,{value:{value:d,onChange:h,size:i},children:s.jsx(_t.Wrapper,{size:i,ref:t,...a,...u,labelElement:"div",__staticSelector:"SwitchGroup",children:s.jsx(ny,{role:"group",children:l})})})});Ay.classes=_t.Wrapper.classes;Ay.displayName="@mantine/core/SwitchGroup";var _P={root:"m_5f93f3bb",input:"m_926b4011",track:"m_9307d992",thumb:"m_93039a1d",trackLabel:"m_8277e082"};const jO={labelPosition:"right"},CO=(e,{radius:t,color:n,size:r})=>({root:{"--switch-radius":t===void 0?void 0:wt(t),"--switch-height":Oe(r,"switch-height"),"--switch-width":Oe(r,"switch-width"),"--switch-thumb-size":Oe(r,"switch-thumb-size"),"--switch-label-font-size":Oe(r,"switch-label-font-size"),"--switch-track-label-padding":Oe(r,"switch-track-label-padding"),"--switch-color":n?xt(n,e):void 0}}),Bc=Y((e,t)=>{const n=B("Switch",jO,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,children:y,thumbIcon:w,checked:x,defaultChecked:b,onChange:C,labelPosition:E,description:j,error:P,disabled:_,variant:R,rootRef:M,mod:D,...N}=n,A=SO(),L=g||(A==null?void 0:A.size),I=pe({name:"Switch",props:n,classes:_P,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:CO}),{styleProps:k,rest:T}=Lo(N),$=$n(m),V=A?{checked:A.value.includes(T.value),onChange:A.onChange}:{},[U,X]=pn({value:V.checked??x,defaultValue:b,finalValue:!1});return s.jsxs($f,{...I("root"),__staticSelector:"Switch",__stylesApiProps:n,id:$,size:L,labelPosition:E,label:d,description:j,error:P,disabled:_,bodyElement:"label",labelElement:"span",classNames:r,styles:a,unstyled:l,"data-checked":V.checked||void 0,variant:R,ref:M,mod:D,...k,...S,children:[s.jsx("input",{...T,disabled:_,checked:U,onChange:Se=>{var me;A?(me=V.onChange)==null||me.call(V,Se):C==null||C(Se),X(Se.currentTarget.checked)},id:$,ref:t,type:"checkbox",role:"switch",...I("input")}),s.jsxs(q,{"aria-hidden":"true",mod:{error:P,"label-position":E},...I("track"),children:[s.jsx(q,{component:"span",mod:"reduce-motion",...I("thumb"),children:w}),s.jsx("span",{...I("trackLabel"),children:U?h:f})]})]})});Bc.classes={..._P,...BE};Bc.displayName="@mantine/core/Switch";Bc.Group=Ay;const[EO,PO]=On("Table component was not found in the tree");var Uc={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 TO(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 Ts(e,t){const n=`Table${e.charAt(0).toUpperCase()}${e.slice(1)}`,r=Y((o,i)=>{const a=B(n,{},o),{classNames:l,className:c,style:u,styles:d,...f}=a,h=PO();return s.jsx(q,{component:e,ref:i,...TO(h,t),...h.getStyles(e,{className:c,classNames:l,style:u,styles:d,props:a}),...f})});return r.displayName=`@mantine/core/${n}`,r.classes=Uc,r}const Fm=Ts("th",{columnBorder:!0}),DP=Ts("td",{columnBorder:!0}),ld=Ts("tr",{rowBorder:!0,striped:!0,highlightOnHover:!0}),IP=Ts("thead",{stickyHeader:!0}),AP=Ts("tbody"),NP=Ts("tfoot"),MP=Ts("caption",{captionSide:!0});function Ny({data:e}){return s.jsxs(s.Fragment,{children:[e.caption&&s.jsx(MP,{children:e.caption}),e.head&&s.jsx(IP,{children:s.jsx(ld,{children:e.head.map((t,n)=>s.jsx(Fm,{children:t},n))})}),e.body&&s.jsx(AP,{children:e.body.map((t,n)=>s.jsx(ld,{children:t.map((r,o)=>s.jsx(DP,{children:r},o))},n))}),e.foot&&s.jsx(NP,{children:s.jsx(ld,{children:e.foot.map((t,n)=>s.jsx(Fm,{children:t},n))})})]})}Ny.displayName="@mantine/core/TableDataRenderer";const kO={type:"scrollarea"},RO=(e,{minWidth:t,type:n})=>({scrollContainer:{"--table-min-width":z(t),"--table-overflow":n==="native"?"auto":void 0}}),My=Y((e,t)=>{const n=B("TableScrollContainer",kO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,children:u,minWidth:d,type:f,...h}=n,m=pe({name:"TableScrollContainer",classes:Uc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:RO,rootSelector:"scrollContainer"});return s.jsx(q,{component:f==="scrollarea"?Pr:"div",...f==="scrollarea"?{offsetScrollbars:"x"}:{},ref:t,...m("scrollContainer"),...h,children:s.jsx("div",{...m("scrollContainerInner"),children:u})})});My.classes=Uc;My.displayName="@mantine/core/TableScrollContainer";const _O={withRowBorders:!0,verticalSpacing:7},DO=(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":un(r),"--table-vertical-spacing":un(o),"--table-border-color":i?xt(i,e):void 0,"--table-striped-color":c&&a?xt(a,e):void 0,"--table-highlight-on-hover-color":u&&l?xt(l,e):void 0,"--table-sticky-header-offset":f?z(d):void 0}}),le=Y((e,t)=>{const n=B("Table",_O,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:y,withTableBorder:w,borderColor:x,layout:b,variant:C,data:E,children:j,stickyHeader:P,stickyHeaderOffset:_,mod:R,...M}=n,D=pe({name:"Table",props:n,className:o,style:i,classes:Uc,classNames:r,styles:a,unstyled:l,rootSelector:"table",vars:c,varsResolver:DO});return s.jsx(EO,{value:{getStyles:D,stickyHeader:P,striped:g===!0?"odd":g||void 0,highlightOnHover:v,withColumnBorders:S,withRowBorders:y,captionSide:f||"bottom"},children:s.jsx(q,{component:"table",variant:C,ref:t,mod:[{"data-with-table-border":w},R],...D("table"),...M,children:j||!!E&&s.jsx(Ny,{data:E})})})});le.classes=Uc;le.displayName="@mantine/core/Table";le.Td=DP;le.Th=Fm;le.Tr=ld;le.Thead=IP;le.Tbody=AP;le.Tfoot=NP;le.Caption=MP;le.ScrollContainer=My;le.DataRenderer=Ny;const[IO,Oy]=On("Tabs component was not found in the tree");var Hc={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 AO={},$y=Y((e,t)=>{const n=B("TabsList",AO,e),{children:r,className:o,grow:i,justify:a,classNames:l,styles:c,style:u,mod:d,...f}=n,h=Oy();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})});$y.classes=Hc;$y.displayName="@mantine/core/TabsList";const NO={},Ly=Y((e,t)=>{const n=B("TabsPanel",NO,e),{children:r,className:o,value:i,classNames:a,styles:l,style:c,mod:u,...d}=n,f=Oy(),h=f.value===i,m=f.keepMounted||n.keepMounted||h?r:null;return s.jsx(q,{...d,...f.getStyles("panel",{className:o,classNames:a,styles:l,style:[c,h?void 0:{display:"none"}],props:n}),ref:t,mod:[{orientation:f.orientation},u],role:"tabpanel",id:f.getPanelId(i),"aria-labelledby":f.getTabId(i),children:m})});Ly.classes=Hc;Ly.displayName="@mantine/core/TabsPanel";const MO={},Fy=Y((e,t)=>{const n=B("TabsTab",MO,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,...y}=n,w=Dt(),{dir:x}=Ua(),b=Oy(),C=l===b.value,E=P=>{b.onChange(b.allowTabDeactivation&&l===b.value?null:l),c==null||c(P)},j={classNames:m,styles:g,props:n};return s.jsxs(An,{...y,...b.getStyles("tab",{className:r,style:h,variant:b.variant,...j}),disabled:d,unstyled:b.unstyled,variant:b.variant,mod:[{active:C,disabled:d,orientation:b.orientation,inverted:b.inverted,placement:b.orientation==="vertical"&&b.placement},S],ref:t,role:"tab",id:b.getTabId(l),"aria-selected":C,tabIndex:C||b.value===null?0:-1,"aria-controls":b.getPanelId(l),onClick:E,__vars:{"--tabs-color":f?xt(f,w):void 0},onKeyDown:ub({siblingSelector:'[role="tab"]',parentSelector:'[role="tablist"]',activateOnFocus:b.activateTabWithKeyboard,loop:b.loop,orientation:b.orientation||"horizontal",dir:x,onKeyDown:u}),children:[a&&s.jsx("span",{...b.getStyles("tabSection",j),"data-position":"left",children:a}),o&&s.jsx("span",{...b.getStyles("tabLabel",j),children:o}),i&&s.jsx("span",{...b.getStyles("tabSection",j),"data-position":"right",children:i})]})});Fy.classes=Hc;Fy.displayName="@mantine/core/TabsTab";const cw="Tabs.Tab or Tabs.Panel component was rendered with invalid value or without value",OO={keepMounted:!0,orientation:"horizontal",loop:!0,activateTabWithKeyboard:!0,allowTabDeactivation:!1,unstyled:!1,inverted:!1,variant:"default",placement:"left"},$O=(e,{radius:t,color:n,autoContrast:r})=>({root:{"--tabs-radius":wt(t),"--tabs-color":xt(n,e),"--tabs-text-color":Ec(r,e)?xs({color:n,theme:e}):void 0}}),Ze=Y((e,t)=>{const n=B("Tabs",OO,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:y,classNames:w,styles:x,unstyled:b,className:C,style:E,vars:j,autoContrast:P,mod:_,...R}=n,M=$n(u),[D,N]=pn({value:o,defaultValue:r,finalValue:null,onChange:i}),A=pe({name:"Tabs",props:n,classes:Hc,className:C,style:E,classNames:w,styles:x,unstyled:b,vars:j,varsResolver:$O});return s.jsx(IO,{value:{placement:S,value:D,orientation:a,id:M,loop:c,activateTabWithKeyboard:d,getTabId:t0(`${M}-tab`,cw),getPanelId:t0(`${M}-panel`,cw),onChange:N,allowTabDeactivation:f,variant:h,color:m,radius:g,inverted:v,keepMounted:y,unstyled:b,getStyles:A},children:s.jsx(q,{ref:t,id:M,variant:h,mod:[{orientation:a,inverted:a==="horizontal"&&v,placement:a==="vertical"&&S},_],...A("root"),...R,children:l})})});Ze.classes=Hc;Ze.displayName="@mantine/core/Tabs";Ze.Tab=Fy;Ze.Panel=Ly;Ze.List=$y;const LO={},de=Y((e,t)=>{const n=B("TextInput",LO,e);return s.jsx(Yn,{component:"input",ref:t,...n,__staticSelector:"TextInput"})});de.classes=Yn.classes;de.displayName="@mantine/core/TextInput";var OP={root:"m_7341320d"};const FO={},zO=(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":Oe(t,"ti-size"),"--ti-radius":n===void 0?void 0:wt(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}}},zy=Y((e,t)=>{const n=B("ThemeIcon",FO,e),{classNames:r,className:o,style:i,styles:a,unstyled:l,vars:c,autoContrast:u,...d}=n,f=pe({name:"ThemeIcon",classes:OP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:zO});return s.jsx(q,{ref:t,...f("root"),...d})});zy.classes=OP;zy.displayName="@mantine/core/ThemeIcon";const VO=["h1","h2","h3","h4","h5","h6"];function BO(e,t){const n=t!==void 0?t:`h${e}`;return VO.includes(n)?{fontSize:`var(--mantine-${n}-font-size)`,fontWeight:`var(--mantine-${n}-font-weight)`,lineHeight:`var(--mantine-${n}-line-height)`}:{fontSize:z(n),fontWeight:`var(--mantine-h${e}-font-weight)`,lineHeight:`var(--mantine-h${e}-line-height)`}}var $P={root:"m_8a5d1357"};const UO={order:1},HO=(e,{order:t,size:n,lineClamp:r,textWrap:o})=>{const i=BO(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}}},ce=Y((e,t)=>{const n=B("Title",UO,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=pe({name:"Title",props:n,classes:$P,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:u,varsResolver:HO});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});ce.classes=$P;ce.displayName="@mantine/core/Title";function WO(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 qO(e){return p.useSyncExternalStore(e.subscribe,()=>e.getState(),()=>e.getState())}const GO=()=>WO({notifications:[],queue:[],limit:5}),ks=GO(),QO=(e=ks)=>qO(e);function el(e,t){const n=e.getState(),r=t([...n.notifications,...n.queue]);e.setState({notifications:r.slice(0,n.limit),queue:r.slice(n.limit),limit:n.limit})}function ve(e,t=ks){const n=e.id||bg();return el(t,r=>e.id&&r.some(o=>o.id===e.id)?r:[...r,{...e,id:n}]),n}function LP(e,t=ks){return el(t,n=>n.filter(r=>{var o;return r.id===e?((o=r.onClose)==null||o.call(r,r),!1):!0})),e}function kl(e,t=ks){return el(t,n=>n.map(r=>r.id===e.id?{...r,...e}:r)),e.id}function KO(e=ks){el(e,()=>[])}function YO(e=ks){el(e,t=>t.slice(0,e.getState().limit))}const ao={show:ve,hide:LP,update:kl,clean:KO,cleanQueue:YO,updateState:el};function zm(e,t){return zm=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,o){return r.__proto__=o,r},zm(e,t)}function FP(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,zm(e,t)}var zP={exports:{}},XO="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",JO=XO,ZO=JO;function VP(){}function BP(){}BP.resetWarningCache=VP;var e$=function(){function e(r,o,i,a,l,c){if(c!==ZO){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:BP,resetWarningCache:VP};return n.PropTypes=n,n};zP.exports=e$();var t$=zP.exports;const ct=pg(t$),uw={disabled:!1},Hd=nn.createContext(null);var n$=function(t){return t.scrollTop},Rl="unmounted",Ui="exited",Hi="entering",Ys="entered",Vm="exiting",Ho=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=Ui,i.appearStatus=Hi):c=Ys:r.unmountOnExit||r.mountOnEnter?c=Rl:c=Ui,i.state={status:c},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===Rl?{status:Ui}: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!==Hi&&a!==Ys&&(i=Hi):(a===Hi||a===Ys)&&(i=Vm)}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===Hi){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:ca.findDOMNode(this);a&&n$(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ui&&this.setState({status:Rl})},n.performEnter=function(o){var i=this,a=this.props.enter,l=this.context?this.context.isMounting:o,c=this.props.nodeRef?[l]:[ca.findDOMNode(this),l],u=c[0],d=c[1],f=this.getTimeouts(),h=l?f.appear:f.enter;if(!o&&!a||uw.disabled){this.safeSetState({status:Ys},function(){i.props.onEntered(u)});return}this.props.onEnter(u,d),this.safeSetState({status:Hi},function(){i.props.onEntering(u,d),i.onTransitionEnd(h,function(){i.safeSetState({status:Ys},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:ca.findDOMNode(this);if(!i||uw.disabled){this.safeSetState({status:Ui},function(){o.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Vm},function(){o.props.onExiting(l),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:Ui},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:ca.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===Rl)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=dy(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return nn.createElement(Hd.Provider,{value:null},typeof a=="function"?a(o,l):nn.cloneElement(nn.Children.only(a),l))},t}(nn.Component);Ho.contextType=Hd;Ho.propTypes={};function Hs(){}Ho.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Hs,onEntering:Hs,onEntered:Hs,onExit:Hs,onExiting:Hs,onExited:Hs};Ho.UNMOUNTED=Rl;Ho.EXITED=Ui;Ho.ENTERING=Hi;Ho.ENTERED=Ys;Ho.EXITING=Vm;function r$(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Vy(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 o$(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 Ji(e,t,n){return n[t]!=null?n[t]:e.props[t]}function i$(e,t){return Vy(e.children,function(n){return p.cloneElement(n,{onExited:t.bind(null,n),in:!0,appear:Ji(n,"appear",e),enter:Ji(n,"enter",e),exit:Ji(n,"exit",e)})})}function s$(e,t,n){var r=Vy(e.children),o=o$(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:Ji(a,"exit",e),enter:Ji(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:Ji(a,"exit",e),enter:Ji(a,"enter",e)}))}}),o}var a$=Object.values||function(e){return Object.keys(e).map(function(t){return e[t]})},l$={component:"div",childFactory:function(t){return t}},By=function(e){FP(t,e);function t(r,o){var i;i=e.call(this,r,o)||this;var a=i.handleExited.bind(r$(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?i$(o,l):s$(o,a,l),firstRender:!1}},n.handleExited=function(o,i){var a=Vy(this.props.children);o.key in a||(o.props.onExited&&o.props.onExited(i),this.mounted&&this.setState(function(l){var c=Bd({},l.children);return delete c[o.key],{children:c}}))},n.render=function(){var o=this.props,i=o.component,a=o.childFactory,l=dy(o,["component","childFactory"]),c=this.state.contextValue,u=a$(this.state.children).map(a);return delete l.appear,delete l.enter,delete l.exit,i===null?nn.createElement(Hd.Provider,{value:c},u):nn.createElement(Hd.Provider,{value:c},nn.createElement(i,l,u))},t}(nn.Component);By.propTypes={};By.defaultProps=l$;const dw={left:"translateX(-100%)",right:"translateX(100%)","top-center":"translateY(-100%)","bottom-center":"translateY(100%)"},c$={left:"translateX(0)",right:"translateX(0)","top-center":"translateY(0)","bottom-center":"translateY(0)"};function u$({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:dw[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:c$[a]},u={opacity:0,maxHeight:0,transform:dw[a]};return{...l,...{entering:c,entered:c,exiting:u,exited:u}[e]}}function d$(e,t){return typeof t=="number"?t:t===!1||e===!1?!1:e}const UP=p.forwardRef(({data:e,onHide:t,autoClose:n,...r},o)=>{const{autoClose:i,message:a,...l}=e,c=d$(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(jy,{...r,...l,onClose:f,ref:o,onMouseEnter:d,onMouseLeave:h,children:a})});UP.displayName="@mantine/notifications/NotificationContainer";var HP={root:"m_b37d9ac7",notification:"m_5ed0edd0"};const f$=Ho,h$={position:"bottom-right",autoClose:4e3,transitionDuration:250,containerWidth:440,notificationMaxHeight:200,limit:5,zIndex:Wr("overlay"),store:ks,withinPortal:!0},p$=(e,{zIndex:t,position:n,containerWidth:r})=>{const[o,i]=n.split("-");return{root:{"--notifications-z-index":t==null?void 0:t.toString(),"--notifications-top":o==="top"?"var(--mantine-spacing-md)":void 0,"--notifications-bottom":o==="bottom"?"var(--mantine-spacing-md)":void 0,"--notifications-left":i==="left"?"var(--mantine-spacing-md)":i==="center"?"50%":void 0,"--notifications-right":i==="right"?"var(--mantine-spacing-md)":void 0,"--notifications-transform":i==="center"?"translateX(-50%)":void 0,"--notifications-container-width":z(r)}}},Wo=Y((e,t)=>{const n=B("Notifications",h$,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:y,withinPortal:w,...x}=n,b=Dt(),C=QO(S),E=d_(),j=jg(),P=p.useRef({}),_=p.useRef(0),M=(b.respectReducedMotion?j:!1)?1:f,D=pe({name:"Notifications",classes:HP,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:p$});p.useEffect(()=>{S==null||S.updateState(A=>({...A,limit:g||5}))},[g]),Po(()=>{C.notifications.length>_.current&&setTimeout(()=>E(),0),_.current=C.notifications.length},[C.notifications]);const N=C.notifications.map(({style:A,...L})=>s.jsx(f$,{timeout:M,onEnter:()=>P.current[L.id].offsetHeight,nodeRef:{current:P.current[L.id]},children:I=>s.jsx(UP,{ref:k=>{P.current[L.id]=k},data:L,onHide:k=>LP(k,S),autoClose:d,...D("notification",{style:{...u$({state:I,position:u,transitionDuration:M,maxHeight:m}),...A}})})},L.id));return s.jsx(js,{withinPortal:w,...y,children:s.jsx(q,{...D("root"),ref:t,...x,children:s.jsx(By,{children:N})})})});Wo.classes=HP;Wo.displayName="@mantine/notifications/Notifications";Wo.show=ao.show;Wo.hide=ao.hide;Wo.update=ao.update;Wo.clean=ao.clean;Wo.cleanQueue=ao.cleanQueue;Wo.updateState=ao.updateState;class m${constructor(t,n){this.operator=t,this.child=n}toString(){return`${this.operator}(${this.child.toString()})`}}class Wc{constructor(t,n,r){this.operator=t,this.left=n,this.right=r}toString(){return`${this.left.toString()} ${this.operator} ${this.right.toString()}`}}class g${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 v$(t,this.prefixParselets,this.infixParselets)}}class v${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 y$="http://hl7.org",WP="ok",x$="created",w$="gone",S$="not-modified",b$="not-found",j$="forbidden",C$="accepted",E$={resourceType:"OperationOutcome",id:WP,issue:[{severity:"information",code:"informational",details:{text:"All OK"}}]},P$={resourceType:"OperationOutcome",id:b$,issue:[{severity:"error",code:"not-found",details:{text:"Not found"}}]},qP={resourceType:"OperationOutcome",id:j$,issue:[{severity:"error",code:"forbidden",details:{text:"Forbidden"}}]};function ji(e,t){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"invalid",details:{text:e},...t?{expression:[t]}:void 0}]}}function jt(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"structure",details:{text:e}}]}}function T$(e){return{resourceType:"OperationOutcome",issue:[{severity:"error",code:"exception",details:{text:"Internal server error"},diagnostics:e.toString()}]}}function oh(e){return typeof e=="object"&&e!==null&&e.resourceType==="OperationOutcome"}function GP(e){return e.id===WP||e.id===x$||e.id===S$||e.id===C$}function k$(e){return e.id===w$}class He extends Error{constructor(t,n){super(QP(t)),this.outcome=t,this.cause=n}}function dt(e){return e instanceof He?e.outcome:oh(e)?e:ji(Ae(e))}function Ae(e){return e?typeof e=="string"?e:e instanceof Error?e.message:oh(e)?QP(e):typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:JSON.stringify(e):"Unknown error"}function QP(e){var n;const t=((n=e.issue)==null?void 0:n.map(KP))??[];return t.length>0?t.join("; "):"Unknown error"}function KP(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 R$(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 _$(e){const t=Object.create(null);for(const[n,r]of Object.entries(e))t[n]={name:n,elements:Object.fromEntries(Object.entries(r.elements).map(([o,i])=>[o,R$(o,i)])),constraints:[],innerTypes:[]};return t}const D$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]}}},I$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]}}},A$={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"}]}}},N$={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"}]}}},M$={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"}]}}},O$={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"}]}}},$$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},coding:{max:9007199254740991,type:[{code:"Coding"}]},text:{type:[{code:"string"}]}}},L$={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"}]}}},F$={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},name:{type:[{code:"string"}]},telecom:{max:9007199254740991,type:[{code:"ContactPoint"}]}}},z$={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"}]}}},V$={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"}]}}},B$={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"}]}}},U$={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"}]}}},H$={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"}]}}},W$={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"]}]}}},q$={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"}]}}},G$={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"}]}}},Q$={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"}]}}},K$={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"}]}}},Y$={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"}]}}},X$={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"]}]}}},J$={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"}]}}},Z$={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"}]},account:{type:[{code:"Reference"}]},compartment:{max:9007199254740991,type:[{code:"Reference"}]}}},eL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},value:{type:[{code:"decimal"}]},currency:{type:[{code:"code"}]}}},tL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},status:{min:1,type:[{code:"code"}]},div:{min:1,type:[{code:"xhtml"}]}}},nL={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"]}]}}},rL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},start:{type:[{code:"dateTime"}]},end:{type:[{code:"dateTime"}]}}},oL={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"}]}}},iL={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"}]}}},sL={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"}]}}},aL={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"}]}}},lL={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"]}]}}},cL={elements:{id:{type:[{code:"string"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},numerator:{type:[{code:"Quantity"}]},denominator:{type:[{code:"Quantity"}]}}},uL={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"}]}}},dL={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"]}]}}},fL={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"}]}}},hL={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"}]}}},pL={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"}]}}},mL={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"}]}}},gL={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"}]}}},vL={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"]}]}}},yL={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"}]}}},xL={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"}]}}},wL={elements:{id:{type:[{code:"string"}]},meta:{type:[{code:"Meta"}]},implicitRules:{type:[{code:"uri"}]},language:{type:[{code:"code"}]},text:{type:[{code:"Narrative"}]},contained:{max:9007199254740991,type:[{code:"Resource"}]},extension:{max:9007199254740991,type:[{code:"Extension"}]},modifierExtension:{max:9007199254740991,type:[{code:"Extension"}]},url:{type:[{code:"uri"}]},version:{type:[{code:"string"}]},name:{type:[{code:"string"}]},title:{type:[{code:"string"}]},status:{min:1,type:[{code:"code"}]},experimental:{type:[{code:"boolean"}]},date:{type:[{code:"dateTime"}]},publisher:{type:[{code:"string"}]},contact:{max:9007199254740991,type:[{code:"ContactDetail"}]},description:{type:[{code:"markdown"}]},useContext:{max:9007199254740991,type:[{code:"UsageContext"}]},jurisdiction:{max:9007199254740991,type:[{code:"CodeableConcept"}]}}},SL={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"}]}}},bL={Element:D$,BackboneElement:I$,Address:A$,Age:N$,Annotation:M$,Attachment:O$,CodeableConcept:$$,Coding:L$,ContactDetail:F$,ContactPoint:z$,Contributor:V$,Count:B$,DataRequirement:U$,Distance:H$,Dosage:W$,Duration:q$,ElementDefinition:G$,Expression:Q$,Extension:K$,HumanName:Y$,Identifier:X$,MarketingStatus:J$,Meta:Z$,Money:eL,Narrative:tL,ParameterDefinition:nL,Period:rL,Population:oL,ProdCharacteristic:iL,ProductShelfLife:sL,Quantity:aL,Range:lL,Ratio:cL,Reference:uL,RelatedArtifact:dL,SampledData:fL,Signature:hL,SubstanceAmount:pL,Timing:mL,TriggerDefinition:gL,UsageContext:vL,MoneyQuantity:yL,SimpleQuantity:xL,MetadataResource:wL,IdentityProvider:SL};function jL(e){return new CL(e).parse()}const YP=_$(bL),Uy=Object.create(null),fw=Object.create(null);function Bm(e){let t;return e?(t=fw[e],t||(t=fw[e]=Object.create(null))):t=YP,t}function hw(e,t){var r;const n=Array.isArray(e)?e:((r=e.entry)==null?void 0:r.map(o=>o.resource))??[];for(const o of n)XP(o,t)}function XP(e,t){if(!(e!=null&&e.name))throw new Error("Failed loading StructureDefinition from bundle");if(e.resourceType!=="StructureDefinition")return;const n=jL(e),r=Bm(t);r[e.name]=n,t&&e.url===t&&(Uy[t]=n);for(const o of n.innerTypes)o.parentType=n,r[o.name]=o}function JP(e){return!!YP[e]}function ih(e,t){let n=Bm(t)[e];return!n&&t&&(n=Bm()[e]),n}function ZP(e,t){const n=ih(e,t);if(!n)throw new He(ji("Unknown data type: "+e));return n}function Hy(e){return!!Uy[e]}function Rs(e){return Uy[e]}class CL{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,title:t.title,type:t.type,url:t.url,kind:t.kind,description:TL(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=gp(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[gp(t,c.path)]=l;break}c=c.parent}if(!c){const u=gp(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),t.slicing&&!this.slicingContext&&this.enterSlice(t,n)}enterInnerType(t){var n,r,o;for(;this.backboneContext&&!Ws((n=this.backboneContext)==null?void 0:n.path,t.path);)this.innerTypes.push(this.backboneContext.type),this.backboneContext=this.backboneContext.parent;this.backboneContext={type:{name:bw(t),title:t.label,description:t.definition,elements:{},constraints:this.parseElementDefinition(t).constraints,innerTypes:[]},path:t.path??"",parent:Ws((r=this.backboneContext)==null?void 0:r.path,t.path)?this.backboneContext:(o=this.backboneContext)==null?void 0:o.parent}}enterSlice(t,n){var r,o,i,a;PL(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){var n;if(this.backboneContext&&!Ws(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&&!Ws(this.backboneContext.path,t==null?void 0:t.path));else this.innerTypes.push(this.backboneContext.type),this.backboneContext=void 0;this.slicingContext&&!Ws(this.slicingContext.path,t==null?void 0:t.path)&&((n=this.slicingContext)!=null&&n.current&&this.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext=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!!(Ws(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.slicingContext.field.slices.push(this.slicingContext.current),this.slicingContext.current={...this.parseElementDefinition(t),name:t.sliceName??"",definition:t.definition,elements:{}}}parseElementDefinitionType(t){return(t.type??[]).map(n=>{var o;let r;return(n.code==="BackboneElement"||n.code==="Element")&&(r=bw(t)),r||(r=(o=qc(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=pw(t.max),r=(i=t.base)!=null&&i.max?pw(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:mw(hn(o,"fixed[x]")),pattern:mw(hn(o,"pattern[x]")),binding:t.binding}}}function pw(e){return e==="*"?Number.POSITIVE_INFINITY:Number.parseInt(e,10)}function gp(e,t=""){return EL(e.path,t)}function EL(e,t){return e?t&&e.startsWith(t)?e.substring(t.length+1):e:""}function Ws(e,t){return!e||!t?!1:t.startsWith(e+".")||t===e}function mw(e){return Array.isArray(e)&&e.length>0?e[0]:zt(e)?void 0:e}function PL(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 TL(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 kL(e,t,n){if(e===void 0)return[void 0];if(t==="$this")return[e];const r=n!=null&&n.withPath?RL:hn,[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 RL(e,t,n){const r=e.path;return _L(hn(e,t,n),r,t)}function _L(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 eT={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 DL(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 qy(e,o.pattern);if(o.fixed)return Gc(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 Pe(e){return[{type:H.boolean,value:e}]}function fo(e){return e==null?{type:"undefined",value:void 0}:Number.isSafeInteger(e)?{type:H.integer,value:e}:typeof e=="number"?{type:H.decimal,value:e}:typeof e=="boolean"?{type:H.boolean,value:e}:typeof e=="string"?{type:H.string,value:e}:wr(e)?{type:H.Quantity,value:e}:qo(e)?{type:e.resourceType,value:e}:{type:H.BackboneElement,value:e}}function pi(e){return e.length===0?!1:!!e[0].value}function Ao(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 hn(e,t,n){if(!e.value)return;const r=Ds(e.type,t,n==null?void 0:n.profileUrl);return r?tT(e,t,r):IL(e,t)}function tT(e,t,n){const r=e.value,o=n.type;if(!o||o.length===0)return;let i,a="undefined",l;if(n.path.endsWith("[x]")){const c=n.path.split(".").pop().replace("[x]","");for(const u of o){const d=c+Wt(u.code);if(i=r[d],l=r["_"+d],i!==void 0||l!==void 0){a=u.code;break}}}else console.assert(o.length===1,"Expected single type",n.path),i=r[t],a=o[0].code,l=r["_"+t];if(l)if(Array.isArray(i)){i=i.slice();for(let c=0;c<Math.max(i.length,l.length);c++)i[c]=xw(i[c],l[c])}else i=xw(i,l);if(!zt(i))return(a==="Element"||a==="BackboneElement")&&(a=n.type[0].code),Array.isArray(i)?i.map(c=>gw(c,a)):gw(i,a)}function gw(e,t){return t==="Resource"&&qo(e)&&(t=e.resourceType),{type:t,value:e}}function IL(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 H){const i=t+Wt(o);if(i in n){r=n[i];break}}if(!zt(r))return Array.isArray(r)?r.map(fo):fo(r)}function nT(e){const t=[];for(const n of e){let r=!1;for(const o of t)if(pi(iT(n,o))){r=!0;break}r||t.push(n)}return t}function rT(e){return Pe(!pi(e))}function oT(e,t){return e.length===0||t.length===0?[]:e.length!==t.length?Pe(!1):Pe(e.every((n,r)=>pi(iT(n,t[r]))))}function iT(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"?Pe(Math.abs(n-r)<1e-8):wr(n)&&wr(r)?Pe(lT(n,r)):Pe(typeof n=="object"&&typeof r=="object"?Wy(e,t):n===r)}function sT(e,t){return e.length===0&&t.length===0?Pe(!0):e.length!==t.length?Pe(!1):(e.sort(vw),t.sort(vw),Pe(e.every((n,r)=>pi(AL(n,t[r])))))}function AL(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"?Pe(Math.abs(a-l)<.01):wr(a)&&wr(l)?Pe(lT(a,l)):Pe(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"?Wy({...a,id:void 0},{...l,id:void 0}):typeof a=="string"&&typeof l=="string"?a.toLowerCase()===l.toLowerCase():a===l)}function vw(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 aT(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 NL(n);case"DateTime":return Um(n);case"Time":return typeof n=="string"&&!!/^T\d/.exec(n);case"Period":return ML(n);case"Quantity":return wr(n);default:return typeof n=="object"&&(n==null?void 0:n.resourceType)===t}}function NL(e){return typeof e=="string"&&!!eT.date.exec(e)}function Um(e){return typeof e=="string"&&!!eT.dateTime.exec(e)}function ML(e){return!!(e&&typeof e=="object"&&("start"in e&&Um(e.start)||"end"in e&&Um(e.end)))}function wr(e){return!!(e&&typeof e=="object"&&"value"in e&&typeof e.value=="number")}function lT(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 Wy(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(yw(i)&&yw(a)){if(!Wy(i,a))return!1}else if(i!==a)return!1}return!0}function yw(e){return e!==null&&typeof e=="object"}function xw(e,t){if(t){if(typeof t!="object")throw new Error("Primitive extension must be an object");return OL(e??{},t)}return e}function OL(e,t){return delete t.__proto__,delete t.constructor,Object.assign(e,t)}function gt(e){const t=vt(e),n=No(e);return n===t?{reference:t}:{reference:t,display:n}}function vt(e){return Is(e)?e.reference:`${e.resourceType}/${e.id}`}function sh(e){if(e)return Is(e)?e.reference.split("/")[1]:e.id}function $L(e){return e.resourceType==="Patient"||e.resourceType==="Practitioner"||e.resourceType==="RelatedPerson"}function No(e){if($L(e)){const t=LL(e);if(t)return t}if(e.resourceType==="Device"){const t=FL(e);if(t)return t}if(e.resourceType==="MedicationRequest"){const t=e.medicationCodeableConcept;if(t)return Ri(t)}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]),KL(t))return Ri(t);if(YL(t))return t.text}return vt(e)}function LL(e){const t=e.name;if(t&&t.length>0)return Qc(t[0])}function FL(e){const t=e.deviceName;if(t&&t.length>0)return t[0].name}function zL(e){if(!("photo"in e))return;const t=e.photo;if(t)if(Array.isArray(t))for(const n of t){const r=ww(n);if(r)return r}else return ww(t)}function ww(e){var t;if(e.url&&((t=e.contentType)!=null&&t.startsWith("image/")))return e.url}function cT(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 VL(e,t){const{years:n,months:r,days:o}=cT(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 qc(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 sr(e,t){return JSON.stringify(e,BL,t?2:void 0)}function BL(e,t){return!UL(e)&&zt(t)?void 0:t}function UL(e){return!!/\d+$/.exec(e)}function zt(e){if(e==null)return!0;const t=typeof e;return t==="string"||t==="object"?!Ft(e):!1}function Ft(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 Gc(e,t,n){return e===t||zt(e)&&zt(t)?!0:zt(e)||zt(t)?!1:Array.isArray(e)&&Array.isArray(t)?HL(e,t):Array.isArray(e)||Array.isArray(t)?!1:Sn(e)&&Sn(t)?WL(e,t,n):(Sn(e)||Sn(t),!1)}function HL(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Gc(e[n],t[n]))return!1;return!0}function WL(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(!Gc(i,a,o))return!1}return!0}function qy(e,t){return zt(e)?!0:zt(t)?!1:Array.isArray(e)&&Array.isArray(t)?qL(e,t):Array.isArray(e)||Array.isArray(t)?!1:Sn(e)&&Sn(t)?GL(e,t):Sn(e)||Sn(t)?!1:e===t}function qL(e,t){return t.every(n=>e.some(r=>qy(r,n)))}function GL(e,t){return Object.entries(t).every(([n,r])=>n in e&&qy(e[n],r))}function ho(e){return e===void 0?e:JSON.parse(JSON.stringify(e))}function uT(e){return!!/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.exec(e)}function Sn(e){return e!==null&&typeof e=="object"}function QL(e){return Sn(e)&&"code"in e&&typeof e.code=="string"}function KL(e){return Sn(e)&&"coding"in e&&Array.isArray(e.coding)&&e.coding.every(QL)}function YL(e){return Sn(e)&&"text"in e&&typeof e.text=="string"}const dT=[];for(let e=0;e<256;e++)dT.push(e.toString(16).padStart(2,"0"));function XL(e){const t=new Uint8Array(e),n=new Array(t.length);for(let r=0;r<t.length;r++)n[r]=dT[t[r]];return n.join("")}function JL(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 Wt(e){return e?e.charAt(0).toUpperCase()+e.substring(1):""}function Gy(e){return e.length>0&&e.startsWith(e[0].toUpperCase())}function fc(e,t){const n=e+".";if(t.startsWith(n))return t.slice(n.length)}function ZL(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 e7(e){if(e)return Array.isArray(e)?e:[e]}const Sw=e=>new Promise(t=>{setTimeout(t,e)});function t7(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 n7(e){let t,n=!1;return function(){return n||(t=e(),n=!0),t}}function vl(e,t){return e?(e.push(t),e):[t]}function hc(e){return e.sort((t,n)=>t.localeCompare(n))}function fT(e){return e.endsWith("/")?e:e+"/"}function r7(e){return e.startsWith("/")?e.slice(1):e}function yo(e,t){return new URL(r7(t),fT(e.toString())).toString()}function o7(e,t){return yo(e,t).toString().replace("http://","ws://").replace("https://","wss://")}function i7(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 hT(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 s7(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 a7(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 Qc(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=mc(e.text);if(r)return r}return n.join(" ").trim()}function ah(e){return e instanceof Date&&!isNaN(e.getTime())}function l7(e,t,n){if(!e)return"";const r=new Date("2000-01-01T"+e+"Z");return ah(r)?r.toLocaleTimeString(t,n):""}function Nn(e,t,n){if(!e)return"";const r=new Date(e);return ah(r)?r.toLocaleString(t,n):""}function c7(e,t,n){return!e||!e.start&&!e.end?"":Nn(e.start,t,n)+" - "+Nn(e.end,t,n)}const u7={s:"every second",min:"every minute",h:"hourly",d:"daily",wk:"weekly",mo:"monthly",a:"annually"},d7={s:"second",min:"minute",h:"hour",d:"day",wk:"week",mo:"month",a:"year"},f7={s:"seconds",min:"minutes",h:"hours",d:"days",wk:"weeks",mo:"months",a:"years"};function pT(e){if(!e)return"";const t=[];return h7(t,e.repeat),e.event&&t.push(e.event.map(n=>Nn(n)).join(", ")),Wt(t.join(" ").trim())}function h7(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(u7[o]):(n===1?e.push("once"):e.push(n+" times"),r===1?e.push("per "+d7[o]):e.push("per "+r+" "+f7[o])),t.dayOfWeek&&e.push("on "+t.dayOfWeek.map(Wt).join(", ")),t.timeOfDay&&e.push("at "+t.timeOfDay.map(i=>l7(i)).join(", "))}function pc(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=g7(r.value,t),`> ${oi(r)}`):`>= ${oi(r)}`:(r==null?void 0:r.value)===void 0&&(o==null?void 0:o.value)!==void 0?n&&t!==void 0?(o.value=m7(o.value,t),`< ${oi(o)}`):`<= ${oi(o)}`:((r==null?void 0:r.unit)===(o==null?void 0:o.unit)&&(r==null||delete r.unit),`${oi(r)} - ${oi(o)}`)}function oi(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 p7(e){return(e==null?void 0:e.value)===void 0?"":e.value.toLocaleString(void 0,{style:"currency",currency:e.currency??"USD",currencyDisplay:"narrowSymbol"})}function Ri(e){if(!e)return"";const t=mc(e.text);return t||(e.coding?e.coding.map(n=>_s(n)).join(", "):"")}function _s(e){return mc(e==null?void 0:e.display)??mc(e==null?void 0:e.code)??""}function mT(e){if(!e)return"";const t=[];if(e.valueQuantity)t.push(oi(e.valueQuantity));else if(e.valueCodeableConcept)t.push(Ri(e.valueCodeableConcept));else{const n=mc(e.valueString);n&&t.push(n)}return"component"in e&&t.push(e.component.map(n=>mT(n)).join(" / ")),t.join(" / ").trim()}function mc(e){return typeof e=="string"?e:void 0}function m7(e,t,n=1){return(gT(e)+n)*Math.pow(10,-t)}function g7(e,t,n=1){return(gT(e)-n)*Math.pow(10,-t)}function gT(e,t){return e}const H={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 v7(e){for(const t of e.base??[]){let n=Mo.types[t];n||(n={searchParamsDetails:{}},Mo.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 bw(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"?y7((i=((o=e.base)==null?void 0:o.path)??e.path)==null?void 0:i.split(".")):t}function y7(e){return e.length===1?e[0]:e.map(Wt).join("")}function Qy(e){var t;return(t=Mo.types[e])==null?void 0:t.searchParams}function x7(e,t){var n,r;return(r=(n=Mo.types[e])==null?void 0:n.searchParams)==null?void 0:r[t]}function hs(e){const t=e.replaceAll("[x]","").split(".").pop();return vT(t)}function vT(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(S7).join(" ").replace("_"," ").replace(/\s+/g," ")}const w7=new Set(["ID","IP","PKCE","JWKS","URI","URL","OMB","UDI"]);function S7(e){const t=e.toUpperCase();return e===t?e:w7.has(t)?t:t.charAt(0)+e.slice(1)}function Ds(e,t,n){const r=ih(e,n);if(r)return b7(r.elements,t)}function b7(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 qo(e){return!!(e&&typeof e=="object"&&"resourceType"in e)}function Is(e){return!!(e&&typeof e=="object"&&"reference"in e&&typeof e.reference=="string")}const Mo={types:{}};function cd(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 yl=()=>[],Fn={empty:(e,t)=>Pe(t.length===0||t.every(n=>zt(n.value))),hasValue:(e,t)=>Pe(t.length!==0),exists:(e,t,n)=>Pe(n?t.filter(r=>pi(n.eval(e,[r]))).length>0:t.length>0&&t.every(r=>!zt(r.value))),all:(e,t,n)=>Pe(t.every(r=>pi(n.eval(e,[r])))),allTrue:(e,t)=>{for(const n of t)if(!n.value)return Pe(!1);return Pe(!0)},anyTrue:(e,t)=>{for(const n of t)if(n.value)return Pe(!0);return Pe(!1)},allFalse:(e,t)=>{for(const n of t)if(n.value)return Pe(!1);return Pe(!0)},anyFalse:(e,t)=>{for(const n of t)if(!n.value)return Pe(!0);return Pe(!1)},subsetOf:yl,supersetOf:yl,count:(e,t)=>[{type:H.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)=>Pe(t.length===Fn.distinct(e,t).length),where:(e,t,n)=>t.filter(r=>pi(n.eval({parent:e,variables:{$this:r}},[r]))),select:(e,t,n)=>t.map(r=>n.eval(e,[r])).flat(),repeat:yl,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,t),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,t),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,t);return nT([...t,...r])},combine:(e,t,n)=>{if(!n)return t;const r=n.eval(e,t);return[...t,...r]},htmlChecks:(e,t,n)=>[fo(!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 pi(i)?r.eval(e,t):o?o.eval(e,t):[]},toBoolean:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);if(typeof n=="boolean")return[{type:H.boolean,value:n}];if(typeof n=="number"&&(n===0||n===1))return Pe(!!n);if(typeof n=="string"){const r=n.toLowerCase();if(["true","t","yes","y","1","1.0"].includes(r))return Pe(!0);if(["false","f","no","n","0","0.0"].includes(r))return Pe(!1)}return[]},convertsToBoolean:(e,t)=>t.length===0?[]:Pe(Fn.toBoolean(e,t).length===1),toInteger:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return typeof n=="number"?[{type:H.integer,value:n}]:typeof n=="string"&&/^[+-]?\d+$/.exec(n)?[{type:H.integer,value:parseInt(n,10)}]:typeof n=="boolean"?[{type:H.integer,value:n?1:0}]:[]},convertsToInteger:(e,t)=>t.length===0?[]:Pe(Fn.toInteger(e,t).length===1),toDate:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:H.date,value:cd(n)}]:[]},convertsToDate:(e,t)=>t.length===0?[]:Pe(Fn.toDate(e,t).length===1),toDateTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return typeof n=="string"&&/^\d{4}(-\d{2}(-\d{2})?)?/.exec(n)?[{type:H.dateTime,value:cd(n)}]:[]},convertsToDateTime:(e,t)=>t.length===0?[]:Pe(Fn.toDateTime(e,t).length===1),toDecimal:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return typeof n=="number"?[{type:H.decimal,value:n}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?$/.exec(n)?[{type:H.decimal,value:parseFloat(n)}]:typeof n=="boolean"?[{type:H.decimal,value:n?1:0}]:[]},convertsToDecimal:(e,t)=>t.length===0?[]:Pe(Fn.toDecimal(e,t).length===1),toQuantity:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return wr(n)?[{type:H.Quantity,value:n}]:typeof n=="number"?[{type:H.Quantity,value:{value:n,unit:"1"}}]:typeof n=="string"&&/^-?\d{1,9}(\.\d{1,9})?/.exec(n)?[{type:H.Quantity,value:{value:parseFloat(n),unit:"1"}}]:typeof n=="boolean"?[{type:H.Quantity,value:{value:n?1:0,unit:"1"}}]:[]},convertsToQuantity:(e,t)=>t.length===0?[]:Pe(Fn.toQuantity(e,t).length===1),toString:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);return n==null?[]:wr(n)?[{type:H.string,value:`${n.value} '${n.unit}'`}]:[{type:H.string,value:n.toString()}]},convertsToString:(e,t)=>t.length===0?[]:Pe(Fn.toString(e,t).length===1),toTime:(e,t)=>{if(t.length===0)return[];const[{value:n}]=to(t,1);if(typeof n=="string"){const r=/^T?(\d{2}(:\d{2}(:\d{2})?)?)/.exec(n);if(r)return[{type:H.time,value:cd("T"+r[1])}]}return[]},convertsToTime:(e,t)=>t.length===0?[]:Pe(Fn.toTime(e,t).length===1),indexOf:(e,t,n)=>dr((r,o)=>r.indexOf(o),e,t,n),substring:(e,t,n,r)=>dr((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)=>dr((r,o)=>r.startsWith(o),e,t,n),endsWith:(e,t,n)=>dr((r,o)=>r.endsWith(o),e,t,n),contains:(e,t,n)=>dr((r,o)=>r.includes(o),e,t,n),upper:(e,t)=>dr(n=>n.toUpperCase(),e,t),lower:(e,t)=>dr(n=>n.toLowerCase(),e,t),replace:(e,t,n,r)=>dr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),matches:(e,t,n)=>dr((r,o)=>!!new RegExp(o).exec(r),e,t,n),replaceMatches:(e,t,n,r)=>dr((o,i,a)=>o.replaceAll(i,a),e,t,n,r),length:(e,t)=>dr(n=>n.length,e,t),toChars:(e,t)=>dr(n=>n?n.split(""):void 0,e,t),abs:(e,t)=>Jr(Math.abs,e,t),ceiling:(e,t)=>Jr(Math.ceil,e,t),exp:(e,t)=>Jr(Math.exp,e,t),floor:(e,t)=>Jr(Math.floor,e,t),ln:(e,t)=>Jr(Math.log,e,t),log:(e,t,n)=>Jr((r,o)=>Math.log(r)/Math.log(o),e,t,n),power:(e,t,n)=>Jr(Math.pow,e,t,n),round:(e,t)=>Jr(Math.round,e,t),sqrt:(e,t)=>Jr(Math.sqrt,e,t),truncate:(e,t)=>Jr(n=>n|0,e,t),children:yl,descendants:yl,trace:(e,t,n)=>t,now:()=>[{type:H.dateTime,value:new Date().toISOString()}],timeOfDay:()=>[{type:H.time,value:new Date().toISOString().substring(11)}],today:()=>[{type:H.date,value:new Date().toISOString().substring(0,10)}],between:(e,t,n,r,o)=>{var u;const i=Fn.toDateTime(e,n.eval(e,t));if(i.length===0)throw new Error("Invalid start date");const a=Fn.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=cT(i[0].value,a[0].value);return[{type:H.Quantity,value:{value:c[l],unit:l}}]},is:(e,t,n)=>{let r="";return n instanceof Ky?r=n.name:n instanceof Xy&&(r=n.left.name+"."+n.right.name),r?t.map(o=>({type:H.boolean,value:aT(o,r)})):[]},not:(e,t)=>Fn.toBoolean(e,t).map(n=>({type:H.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 fo(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:H.BackboneElement,value:void 0}}).filter(n=>!!n.value),as:(e,t)=>t,type:(e,t)=>t.map(({value:n})=>typeof n=="boolean"?{type:H.BackboneElement,value:{namespace:"System",name:"Boolean"}}:typeof n=="number"?{type:H.BackboneElement,value:{namespace:"System",name:"Integer"}}:qo(n)?{type:H.BackboneElement,value:{namespace:"FHIR",name:n.resourceType}}:{type:H.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:H.boolean,value:((a=i.value)==null?void 0:a.resourceType)===o}})}};function dr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=to(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(fo):[fo(i)]}function Jr(e,t,n,...r){if(n.length===0)return[];const[{value:o}]=to(n,1),i=wr(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?H.Quantity:n[0].type,u=i?{...o,value:l}:l;return[{type:c,value:u}]}function to(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}class j7{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}`)}}toString(){return this.child.toString()}}class qs{constructor(t){this.value=t}eval(){return[this.value]}toString(){const t=this.value.value;return typeof t=="string"?`'${t}'`:t.toString()}}class Ky{constructor(t){this.name=t}eval(t,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 qo(n)&&n.resourceType===this.name?t:hn(t,this.name)}toString(){return this.name}}class C7{eval(){return[]}toString(){return"{}"}}class E7 extends m${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 Yy extends Wc{constructor(t,n){super("as",t,n)}eval(t,n){return Fn.ofType(t,this.left.eval(t,n),this.right)}}class Xn extends Wc{}class Dr extends Xn{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=wr(i)?i.value:i,c=wr(a)?a.value:a,u=this.impl(l,c);return typeof u=="boolean"?Pe(u):wr(i)?[{type:H.Quantity,value:{...i,value:u}}]:[fo(u)]}}class P7 extends Wc{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:H.string,value:i.map(a=>a.value).join("")}]:i}}class T7 extends Xn{constructor(t,n){super("contains",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return Pe(r.some(i=>i.value===o[0].value))}}class k7 extends Xn{constructor(t,n){super("in",t,n)}eval(t,n){const r=Ao(this.left.eval(t,n)),o=this.right.eval(t,n);return r?Pe(o.some(i=>i.value===r.value)):[]}}class Xy extends Wc{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 yT extends Wc{constructor(t,n){super("|",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return nT([...r,...o])}}class R7 extends Xn{constructor(t,n){super("=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return oT(r,o)}}class _7 extends Xn{constructor(t,n){super("!=",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return rT(oT(r,o))}}class D7 extends Xn{constructor(t,n){super("~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return sT(r,o)}}class I7 extends Xn{constructor(t,n){super("!~",t,n)}eval(t,n){const r=this.left.eval(t,n),o=this.right.eval(t,n);return rT(sT(r,o))}}class Jy extends Xn{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 Pe(aT(r[0],o))}}class A7 extends Xn{constructor(t,n){super("and",t,n)}eval(t,n){const r=Ao(this.left.eval(t,n),"boolean"),o=Ao(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!0&&(o==null?void 0:o.value)===!0?Pe(!0):(r==null?void 0:r.value)===!1||(o==null?void 0:o.value)===!1?Pe(!1):[]}}class N7 extends Xn{constructor(t,n){super("or",t,n)}eval(t,n){const r=Ao(this.left.eval(t,n),"boolean"),o=Ao(this.right.eval(t,n),"boolean");return(r==null?void 0:r.value)===!1&&(o==null?void 0:o.value)===!1?Pe(!1):r!=null&&r.value||o!=null&&o.value?Pe(!0):[]}}class M7 extends Xn{constructor(t,n){super("xor",t,n)}eval(t,n){const r=Ao(this.left.eval(t,n),"boolean"),o=Ao(this.right.eval(t,n),"boolean");return!r||!o?[]:Pe(r.value!==o.value)}}class O7 extends Xn{constructor(t,n){super("implies",t,n)}eval(t,n){const r=Ao(this.left.eval(t,n),"boolean"),o=Ao(this.right.eval(t,n),"boolean");return(o==null?void 0:o.value)===!0||(r==null?void 0:r.value)===!1?Pe(!0):!r||!o?[]:Pe(!1)}}class Zy{constructor(t,n){this.name=t,this.args=n}eval(t,n){const r=Fn[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 ex{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 $7=["year","years","month","months","week","weeks","day","days","hour","hours","minute","minutes","second","seconds","millisecond","milliseconds"];class L7{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;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()))));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()===" "&&F7(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 F7(e){return!!(e&&(e.id==="String"||e.id==="Symbol"&&$7.includes(e.value)))}const z7=["true","false"],V7=["!=","!~","<=",">=","{}","->"];function B7(e){return new L7(e,z7,V7).tokenize()}const ot={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},U7={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}},H7={parse(e,t){const n=e.consumeAndParse();if(!e.match("]"))throw new Error("Parse error: expected `]`");return new ex(t,n)},precedence:ot.Indexer},W7={parse(e,t){if(!(t instanceof Ky))throw new Error("Unexpected parentheses");const n=[];for(;!e.match(")");)n.push(e.consumeAndParse()),e.match(",");return new Zy(t.name,n)},precedence:ot.FunctionCall};function q7(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 G7(){return new g$().registerPrefix("String",{parse:(e,t)=>new qs({type:H.string,value:t.value})}).registerPrefix("DateTime",{parse:(e,t)=>new qs({type:H.dateTime,value:cd(t.value)})}).registerPrefix("Quantity",{parse:(e,t)=>new qs({type:H.Quantity,value:q7(t.value)})}).registerPrefix("Number",{parse:(e,t)=>new qs({type:t.value.includes(".")?H.decimal:H.integer,value:parseFloat(t.value)})}).registerPrefix("true",{parse:()=>new qs({type:H.boolean,value:!0})}).registerPrefix("false",{parse:()=>new qs({type:H.boolean,value:!1})}).registerPrefix("Symbol",{parse:(e,t)=>new Ky(t.value)}).registerPrefix("{}",{parse:()=>new C7}).registerPrefix("(",U7).registerInfix("[",H7).registerInfix("(",W7).prefix("+",ot.UnaryAdd,(e,t)=>new E7("+",t,n=>n)).prefix("-",ot.UnarySubtract,(e,t)=>new Dr("-",t,t,(n,r)=>-r)).infixLeft(".",ot.Dot,(e,t,n)=>new Xy(e,n)).infixLeft("/",ot.Divide,(e,t,n)=>new Dr("/",e,n,(r,o)=>r/o)).infixLeft("*",ot.Multiply,(e,t,n)=>new Dr("*",e,n,(r,o)=>r*o)).infixLeft("+",ot.Add,(e,t,n)=>new Dr("+",e,n,(r,o)=>r+o)).infixLeft("-",ot.Subtract,(e,t,n)=>new Dr("-",e,n,(r,o)=>r-o)).infixLeft("|",ot.Union,(e,t,n)=>new yT(e,n)).infixLeft("=",ot.Equals,(e,t,n)=>new R7(e,n)).infixLeft("!=",ot.NotEquals,(e,t,n)=>new _7(e,n)).infixLeft("~",ot.Equivalent,(e,t,n)=>new D7(e,n)).infixLeft("!~",ot.NotEquivalent,(e,t,n)=>new I7(e,n)).infixLeft("<",ot.LessThan,(e,t,n)=>new Dr("<",e,n,(r,o)=>r<o)).infixLeft("<=",ot.LessThanOrEquals,(e,t,n)=>new Dr("<=",e,n,(r,o)=>r<=o)).infixLeft(">",ot.GreaterThan,(e,t,n)=>new Dr(">",e,n,(r,o)=>r>o)).infixLeft(">=",ot.GreaterThanOrEquals,(e,t,n)=>new Dr(">=",e,n,(r,o)=>r>=o)).infixLeft("&",ot.Ampersand,(e,t,n)=>new P7(e,n)).infixLeft("and",ot.And,(e,t,n)=>new A7(e,n)).infixLeft("as",ot.As,(e,t,n)=>new Yy(e,n)).infixLeft("contains",ot.Contains,(e,t,n)=>new T7(e,n)).infixLeft("div",ot.Divide,(e,t,n)=>new Dr("div",e,n,(r,o)=>r/o|0)).infixLeft("in",ot.In,(e,t,n)=>new k7(e,n)).infixLeft("is",ot.Is,(e,t,n)=>new Jy(e,n)).infixLeft("mod",ot.Modulo,(e,t,n)=>new Dr("mod",e,n,(r,o)=>r%o)).infixLeft("or",ot.Or,(e,t,n)=>new N7(e,n)).infixLeft("xor",ot.Xor,(e,t,n)=>new M7(e,n)).infixLeft("implies",ot.Implies,(e,t,n)=>new O7(e,n))}const Q7=G7();function xT(e){return new j7(e,Q7.construct(B7(e)).consumeAndParse())}function K7(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]=fo(n[r]))}return gc(e,n).map(r=>r.value)}function gc(e,t,n){const r=n??{};return xT(e).eval({variables:r},t).map(i=>{var a;return{type:i.type,value:(a=i.value)==null?void 0:a.valueOf()}})}var ii=(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))(ii||{});function lh(e,t){var r,o;let n=(o=(r=Mo.types[e])==null?void 0:r.searchParamsDetails)==null?void 0:o[t.code];return n||(n=X7(e,t)),n}function Y7(e,t,n){let r=Mo.types[e];r||(r={},Mo.types[e]=r),r.searchParamsDetails||(r.searchParamsDetails={}),r.searchParamsDetails[t]=n}function X7(e,t){const n=t.code,r=e6(n),o=n6(e,t.expression),i={elementDefinitions:[],propertyTypes:new Set,array:!1};for(const l of o){const c=Fl(l),u=n7(()=>c.join("."));c.length===1&&c[0]instanceof Xn?i.propertyTypes.add("boolean"):u().endsWith("extension.value.code")||u().endsWith("extension.value.coding.code")?(i.array=!0,i.propertyTypes.add("code")):wT(i,Fl(l),e,1),u().endsWith("extension.valueDateTime")&&(i.array=!1)}const a={columnName:r,type:t6(t,i.propertyTypes),elementDefinitions:i.elementDefinitions,array:i.array};return Y7(e,n,a),a}function wT(e,t,n,r){const o=t[r];if(o instanceof Yy){e.propertyTypes.add(o.right.toString());return}if(o instanceof Zy){J7(e,o);return}const i=o.toString(),a=Ds(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 ex&&(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;Z7(d)&&(d=a.type[0].code),wT(e,t,d,c)}}function J7(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 Jy){e.propertyTypes.add(t.args[0].right.toString());return}throw new Error(`Unhandled FHIRPath function: ${t.name}`)}function Z7(e){return e==="Element"||e==="BackboneElement"}function e6(e){return e.split("-").reduce((t,n,r)=>t+(r?Wt(n):n),"")}function t6(e,t){switch(e.type){case"date":return t.size===1&&t.has(H.date)?"DATE":"DATETIME";case"number":return"NUMBER";case"quantity":return"QUANTITY";case"reference":return t.has(H.canonical)?"CANONICAL":"REFERENCE";case"token":return t.size===1&&t.has(H.boolean)?"BOOLEAN":"TEXT";default:return"TEXT"}}function n6(e,t){const n=[],r=xT(t);return Hm(e,r.child,n),n}function Hm(e,t,n){t instanceof yT?(Hm(e,t.left,n),Hm(e,t.right,n)):t.toString().startsWith(e+".")&&n.push(t)}function Fl(e){if(e instanceof Yy||e instanceof ex)return[Fl(e.left),e].flat();if(e instanceof Xn)return[e];if(e instanceof Xy)return[Fl(e.left),Fl(e.right)].flat();if(e instanceof Zy){if(e.name==="where"&&!(e.args[0]instanceof Jy))return[];if(e.name==="last")return[]}return[e]}const ch=20;var ie=(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))(ie||{});const ST={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"},tx={eq:"eq",ne:"ne",lt:"lt",le:"le",gt:"gt",ge:"ge",sa:"sa",eb:"eb",ap:"ap"};function r6(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()),o6(o,i)}function o6(e,t){const n={resourceType:e};for(const[r,o]of t)i6(n,r,o);return n}function i6(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=vl(e.filters,{code:t,operator:"eq",value:n});return}switch(r){case"_sort":s6(e,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=jw(n);o==="iterate"&&(c.modifier="iterate"),e.include=vl(e.include,c);break}case"_revinclude":{const c=jw(n);o==="iterate"&&(c.modifier="iterate"),e.revInclude=vl(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=Mo.types[e.resourceType])==null?void 0:a.searchParams)==null?void 0:l[r];c?e.filters=vl(e.filters,a6(c,o,n)):e.filters=vl(e.filters,u6(r,o,n))}}}}function s6(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 a6(e,t,n){if(t==="missing")return{code:e.code,operator:"missing",value:n};switch(e.type){case"number":case"date":case"quantity":return l6(e,n);case"reference":case"string":case"token":case"uri":return c6(e,t,n);default:throw new Error("Unrecognized search parameter type: "+e.type)}}function l6(e,t){const{operator:n,value:r}=d6(t);return{code:e.code,operator:n,value:r}}function c6(e,t,n){return{code:e.code,operator:f6(t),value:n}}function u6(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 tx&&(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 d6(e){const t=e.substring(0,2),n=tx[t];return n?{operator:n,value:e.substring(2)}:{operator:"eq",value:e}}function f6(e){return ST[e]??"eq"}function jw(e){const t=e.split(":");if(t.includes("*"))throw new He(ji("'*' is not supported as a value for search inclusion parameters"));if(t.length===1)throw new He(ji(`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 He(ji(`Invalid include value '${e}'`))}function ua(e){const t=[];return e.fields&&t.push("_fields="+e.fields.join(",")),e.filters&&e.filters.forEach(n=>t.push(h6(n))),e.sortRules&&e.sortRules.length>0&&t.push(p6(e.sortRules)),e.offset!==void 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(Cw("_include",n))),e.revInclude&&e.revInclude.forEach(n=>t.push(Cw("_revinclude",n))),t.length===0?"":(hc(t),"?"+t.join("&"))}function h6(e){const t=e.operator in ST?":"+e.operator:"",n=e.operator!=="eq"&&e.operator in tx?e.operator:"";return`${e.code}${t}=${n}${encodeURIComponent(e.value)}`}function p6(e){return"_sort="+e.map(t=>t.descending?"-"+t.code:t.code).join(",")}function Cw(e,t){return e+"="+t.resourceType+":"+t.searchParam+(t.targetType?":"+t.targetType:"")}function m6(e){if(typeof window<"u")return window.atob(e);if(typeof Buffer<"u")return Buffer.from(e,"base64").toString("binary");throw new Error("Unable to decode base64")}function g6(e){if(typeof window<"u")return window.btoa(e);if(typeof Buffer<"u")return Buffer.from(e,"binary").toString("base64");throw new Error("Unable to encode base64")}function Ew(){const e=new Uint32Array(28);return crypto.getRandomValues(e),XL(e.buffer)}async function v6(e){return crypto.subtle.digest("SHA-256",new TextEncoder().encode(e))}function bT(){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 jT(e){var o,i,a;const t={};e=ho(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]=bT(),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)=>y6(l,c,t),2);return x6(JSON.parse(r))}function y6(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 x6(e){const t=S6(e),{sorted:n,cycles:r}=w6(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 w6(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 CT(e,t){for(const n in e)if(e[n]&&typeof e[n]=="object"){const r=e[n];if(Is(r)){const o=r.reference;o.startsWith("urn:uuid:")&&t(o)}else CT(r,t)}}function S6(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&&CT(n.resource,o=>{t[o]&&t[o].push(r)})}return t}class ET{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 Yt={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 PT{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 nx{constructor(){this.emitter=new PT}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 Wm={"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"},b6=["Patient","Encounter","ImagingStudy","DiagnosticReport","OperationOutcome","Bundle"],rx=["DiagnosticReport-update"];function j6(e){return rx.includes(e)}function C6(e){if(rx.includes(e))throw new He(jt(`'context.version' is required for '${e}'.`))}const E6={"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 P6(e){return b6.includes(e)}function TT(e){return!!e.endpoint}function Pw(e){if(!ox(e))throw new He(jt("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 TT(e)&&(i.endpoint=e.endpoint),new URLSearchParams(i).toString()}function ox(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(!Wm[i])return!1;return!(TT(e)&&!(typeof e.endpoint=="string"&&e.endpoint.startsWith("ws")))}function Tw(e,t,n,r){if(typeof t!="object")throw new He(jt(`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 He(jt(`context[${n}] is invalid. Resource must contain a valid string ID.`));if(!t.resourceType)throw new He(jt(`context[${n}] is invalid. Resource must contain a resource type. No resource type found.`));const o=r.resourceType;if(o!=="*"){if(!P6(t.resourceType))throw new He(jt(`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 He(jt(`context[${n}] is invalid. context[${n}] for the '${e}' event should contain resource of type ${o}.`))}}function T6(e,t,n,r,o){if(o.set(t.key,(o.get(t.key)??0)+1),!r.isArray)Tw(e,t.resource,n,r);else{const{resources:i}=t;if(!i)throw new He(jt(`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)Tw(e,a,n,r)}}function k6(e,t){const n=new Map,r=E6[e];for(let o=0;o<t.length;o++){const i=t[o].key;if(!r[i])throw new He(jt(`Key '${i}' not found for event '${e}'. Make sure to add only valid keys.`));T6(e,t[o],o,r[i],n)}for(const[o,i]of Object.entries(r)){if(!(i.optional||n.has(o)))throw new He(jt(`Missing required key '${o}' on context for '${e}' event.`));if(!i.manyAllowed&&(n.get(o)||0)>1)throw new He(jt(`${n.get(o)} context entries with key '${o}' found for the '${e}' event when schema only allows for 1.`))}}function kw(e,t,n,r){if(!(e&&typeof e=="string"))throw new He(jt("Must provide a topic."));if(!Wm[t])throw new He(jt(`Must provide a valid FHIRcast event name. Supported events: ${Object.keys(Wm).join(", ")}`));if(typeof n!="object")throw new He(jt("context must be a context object or array of context objects."));if(rx.includes(t)&&!r)throw new He(jt(`The '${t}' event must contain a 'context.versionId'.`));const o=Array.isArray(n)?n:[n];return k6(t,o),{timestamp:new Date().toISOString(),id:bT(),event:{"hub.topic":e,"hub.event":t,context:o,...r?{"context.versionId":r}:{}}}}class R6 extends nx{constructor(t){if(super(),this.subRequest=t,!t.endpoint)throw new He(jt("Subscription request should contain an endpoint."));if(!ox(t))throw new He(jt("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 _6(e){const t=e.replace(/-/g,"+").replace(/_/g,"/"),n=m6(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 D6(e){return e.split(".").length===3}function ix(e){const[t,n,r]=e.split(".");return _6(n)}function I6(e){try{return typeof ix(e).login_id=="string"}catch{return!1}}function A6(e){try{const n=ix(e).exp;return typeof n=="number"?n*1e3:void 0}catch{return}}class N6{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,Yt.TEXT)}async delete(t){await this.medplum.delete(`keyvalue/v1/${t}`)}}var kT;kT=Symbol.toStringTag;class Ir{constructor(t){this[kT]="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 M6{constructor(t){this.storage=t??(typeof localStorage<"u"?localStorage:new O6)}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?sr(n):void 0)}}class O6{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]}}class $6 extends nx{constructor(t){super(),this.bufferedAmount=-1/0,this.extensions="NOT_IMPLEMENTED",this.messageBuffer=[];const n=new WebSocket(t);n.addEventListener("open",()=>{if(this.messageBuffer.length){const r=this.messageBuffer;for(const o of r)n.send(o)}this.dispatchEvent(new Event("open"))}),n.addEventListener("error",r=>{this.dispatchEvent(r)}),n.addEventListener("message",r=>{this.dispatchEvent(r)}),n.addEventListener("close",r=>{this.dispatchEvent(r)}),this.ws=n}get readyState(){return this.ws.readyState}close(){this.ws.close()}send(t){if(this.ws.readyState!==WebSocket.OPEN){this.messageBuffer.push(t);return}try{this.ws.send(t)}catch(n){this.dispatchEvent(new ErrorEvent("error",{error:n,message:n.message})),this.messageBuffer.push(t)}}}class qm extends nx{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 L6{constructor(t){this.criteria=t,this.emitter=new qm(t),this.refCount=1}}class F6{constructor(t,n,r){if(!(t instanceof RT))throw new He(jt("First arg of constructor should be a `MedplumClient`"));let o;try{o=new URL(n).toString()}catch{throw new He(jt("Not a valid URL"))}const i=r!=null&&r.RobustWebSocket?new r.RobustWebSocket(o):new $6(o);this.medplum=t,this.ws=i,this.masterSubEmitter=new qm,this.criteriaEntries=new Map,this.criteriaEntriesBySubscriptionId=new Map,this.wsClosed=!1,this.setupWebSocketListeners()}setupWebSocketListeners(){const t=this.ws;t.addEventListener("message",n=>{var r,o,i,a,l;try{const c=JSON.parse(n.data),u=(o=(r=c==null?void 0:c.entry)==null?void 0:r[0])==null?void 0:o.resource;if(u.type==="heartbeat"){(i=this.masterSubEmitter)==null||i.dispatchEvent({type:"heartbeat",payload:c});return}(a=this.masterSubEmitter)==null||a.dispatchEvent({type:"message",payload:c});const d=this.criteriaEntriesBySubscriptionId.get(sh(u.subscription));if(!d){console.warn("Received notification for criteria the SubscriptionManager is not listening for");return}d.emitter.dispatchEvent({type:"message",payload:c})}catch(c){console.error(c);const u={type:"error",payload:c};(l=this.masterSubEmitter)==null||l.dispatchEvent(u);for(const{emitter:d}of this.criteriaEntries.values())d.dispatchEvent(u)}}),t.addEventListener("error",()=>{var r;const n={type:"error",payload:new He(T$(new Error("WebSocket error")))};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)}),t.addEventListener("close",()=>{var r;const n={type:"close"};this.wsClosed&&((r=this.masterSubEmitter)==null||r.dispatchEvent(n));for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)})}emitConnect(t){var r;const n={type:"connect",payload:{subscriptionId:t}};(r=this.masterSubEmitter)==null||r.dispatchEvent(n);for(const{emitter:o}of this.criteriaEntries.values())o.dispatchEvent(n)}emitError(t,n){var o,i,a;const r={type:"error",payload:n};(o=this.masterSubEmitter)==null||o.dispatchEvent(r),(a=(i=this.criteriaEntries.get(t))==null?void 0:i.emitter)==null||a.dispatchEvent(r)}async getTokenForCriteria(t){var a,l;let n=t==null?void 0:t.subscriptionId;n||(n=(await this.medplum.createResource({resourceType:"Subscription",status:"active",reason:`WebSocket subscription for ${vt(this.medplum.getProfile())}`,criteria:t.criteria,channel:{type:"websocket"}})).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 He(jt("Failed to get token"));if(!i)throw new He(jt("Failed to get URL from $get-ws-binding-token"));return[n,o]}addCriteria(t){this.masterSubEmitter&&this.masterSubEmitter._addCriteria(t);const n=this.criteriaEntries.get(t);if(n)return n.refCount+=1,n.emitter;const r=new L6(t);return this.criteriaEntries.set(t,r),this.getTokenForCriteria(r).then(([o,i])=>{r.subscriptionId=o,this.criteriaEntriesBySubscriptionId.set(o,r),this.emitConnect(o),this.ws.send(JSON.stringify({type:"bind-with-token",payload:{token:i}}))}).catch(o=>{console.error(o.message),this.emitError(t,o),this.criteriaEntries.delete(t)}),r.emitter}removeCriteria(t){var i,a,l;const n=this.criteriaEntries.get(t);if(!n){console.warn("Criteria not known to `SubscriptionManager`. Possibly called remove too many times.");return}if(n.refCount-=1,n.refCount>0)return;const r=(i=this.criteriaEntries.get(t))==null?void 0:i.subscriptionId,o={type:"disconnect",payload:{subscriptionId:r}};this.masterSubEmitter&&(this.masterSubEmitter._removeCriteria(t),this.masterSubEmitter.dispatchEvent(o)),(l=(a=this.criteriaEntries.get(t))==null?void 0:a.emitter)==null||l.dispatchEvent(o),this.criteriaEntries.delete(t),r&&this.criteriaEntriesBySubscriptionId.delete(r)}closeWebSocket(){this.wsClosed||(this.wsClosed=!0,this.ws.close())}getCriteriaCount(){return this.criteriaEntries.size}getMasterEmitter(){return this.masterSubEmitter||(this.masterSubEmitter=new qm(...Array.from(this.criteriaEntries.keys()))),this.masterSubEmitter}}const z6="3.1.6-ca2e13ea4",V6=Yt.FHIR_JSON+", */*; q=0.1",B6="https://api.medplum.com/",U6=1e3,H6=6e4,W6=0,q6="Binary/",Rw={resourceType:"Device",id:"system",deviceName:[{type:"model-name",name:"System"}]};class RT extends PT{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)??G6(),this.storage=(t==null?void 0:t.storage)??new M6,this.createPdfImpl=t==null?void 0:t.createPdf,this.baseUrl=fT((t==null?void 0:t.baseUrl)??B6),this.fhirBaseUrl=yo(this.baseUrl,(t==null?void 0:t.fhirUrlPath)??"fhir/R4"),this.authorizeUrl=yo(this.baseUrl,(t==null?void 0:t.authorizeUrl)??"oauth2/authorize"),this.tokenUrl=yo(this.baseUrl,(t==null?void 0:t.tokenUrl)??"oauth2/token"),this.logoutUrl=yo(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.cacheTime=(t==null?void 0:t.cacheTime)??(typeof window>"u"?W6:H6),this.cacheTime>0?this.requestCache=new ET((t==null?void 0:t.resourceCacheSize)??U6):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.initComplete=!1,this.initPromise=this.storage.getInitPromise(),this.initPromise.then(()=>{t!=null&&t.accessToken||this.attemptResumeActiveLogin().catch(console.error),this.initComplete=!0}).catch(console.error)),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=yo(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 Ir(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,Yt.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(yo(this.fhirBaseUrl,t.join("/")))}fhirSearchUrl(t,n){const r=this.fhirUrl(t);return n&&(r.search=i7(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 Ir((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 Ir(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 Ir(this.search(t,n,r).then(vp));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 vp(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 Rw;const[r,o]=n.split("/");if(!(!r||!o))return this.getCached(r,o)}readResource(t,n,r){return this.get(this.fhirUrl(t,n),r)}readReference(t,n){const r=t.reference;if(!r)return new Ir(Promise.reject(new Error("Missing reference")));if(r==="system")return new Ir(Promise.resolve(Rw));const[o,i]=r.split("/");return!o||!i?new Ir(Promise.reject(new Error("Invalid reference"))):this.readResource(o,i,n)}requestSchema(t){if(JP(t))return Promise.resolve();const n=t+"-requestSchema",r=this.getCacheEntry(n,void 0);if(r)return r.value;const o=new Ir((async()=>{const i=`{
|
|
94
|
+
StructureDefinitionList(name: "${t}") {
|
|
95
|
+
resourceType,
|
|
96
|
+
name,
|
|
97
|
+
kind,
|
|
98
|
+
description,
|
|
99
|
+
type,
|
|
100
|
+
snapshot {
|
|
101
|
+
element {
|
|
102
|
+
id,
|
|
103
|
+
path,
|
|
104
|
+
definition,
|
|
105
|
+
min,
|
|
106
|
+
max,
|
|
107
|
+
base {
|
|
108
|
+
path,
|
|
109
|
+
min,
|
|
110
|
+
max
|
|
111
|
+
},
|
|
112
|
+
contentReference,
|
|
113
|
+
type {
|
|
114
|
+
code,
|
|
115
|
+
profile,
|
|
116
|
+
targetProfile
|
|
117
|
+
},
|
|
118
|
+
binding {
|
|
119
|
+
strength,
|
|
120
|
+
valueSet
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
SearchParameterList(base: "${t}", _count: 100) {
|
|
126
|
+
base,
|
|
127
|
+
code,
|
|
128
|
+
type,
|
|
129
|
+
expression,
|
|
130
|
+
target
|
|
131
|
+
}
|
|
132
|
+
}`.replace(/\s+/g," "),a=await this.graphql(i);hw(a.data.StructureDefinitionList);for(const l of a.data.SearchParameterList)v7(l)})());return this.setCacheEntry(n,o),o}requestProfileSchema(t,n){if(!(n!=null&&n.expandProfile)&&Hy(t))return Promise.resolve([t]);const r=t+"-requestSchema"+(n!=null&&n.expandProfile?"-nested":""),o=this.getCacheEntry(r,void 0);if(o)return o.value;const i=new Ir((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(),{});return vp(l).map(c=>(XP(c,c.url),c.url))}else{const a=await this.searchOne("StructureDefinition",{url:t,_sort:"-_lastUpdated"});return a?(hw([a],t),[t]):(console.warn(`No StructureDefinition found for ${t}!`),[])}})());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=Iw(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=Iw(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 Error("Request aborted")),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 He(dt(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=Y6(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=gt(t),a=t.subject),t.resourceType==="ServiceRequest"&&(i=t.encounter,a=t.subject),t.resourceType==="Patient"&&(a=gt(t)),this.createResource({resourceType:"Communication",status:"completed",basedOn:[gt(t)],encounter:i,subject:a,sender:o?gt(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}patchResource(t,n,r,o){return this.invalidateSearches(t),this.patch(this.fhirUrl(t,n),r,o)}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,Yt.JSON,n)}graphql(t,n,r,o){return this.post(this.fhirUrl("$graphql"),{query:t,operationName:n,variables:r},Yt.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",sh(t),"$push"),{destination:typeof n=="string"?n:vt(n),body:r,contentType:o,waitForResponse:i},Yt.FHIR_JSON,a)}getActiveLogin(){return this.storage.getObject("activeLogin")}async setActiveLogin(t){var n,r;(!((n=this.sessionDetails)!=null&&n.profile)||vt(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.sessionDetails=void 0,this.accessTokenExpires=A6(t),this.medplumServer=I6(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").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)}).catch(n)}),this.profilePromise):Promise.resolve(void 0)}isLoading(){return!this.isInitialized||!!this.profilePromise}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(q6)&&(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=gt(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 N6(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 Ir(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 He(P$);const c=await this.parseBody(i,l);if(i.status===200&&r.followRedirectOnOk||i.status===201&&r.followRedirectOnCreated){const u=await Dw(i,c);if(u)return this.request("GET",u,{...r,body:void 0})}if(i.status===202&&r.pollStatusOnAccepted){const d=await Dw(i,c)??o.statusUrl;if(d)return this.pollStatus(d,r,o)}if(i.status>=400)throw new He(dt(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=yo(this.baseUrl,t));const r=3,o=200;let i;for(let a=0;a<r;a++){try{if(this.options.verbose&&this.logRequest(t,n),i=await this.fetch(t,n),this.options.verbose&&this.logResponse(i),i.status<500)return i}catch(l){this.retryCatch(a,r,l)}await Sw(o)}return i}logRequest(t,n){if(console.log(`> ${n.method} ${t}`),n.headers){const r=n.headers;for(const o of hc(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 Sw(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,yo(this.fhirBaseUrl,a.url),a.options))}catch(l){a.reject(new He(dt(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&&!GP(c.response.outcome)?l.reject(new He(c.response.outcome)):l.resolve(c==null?void 0:c.resource)}}addFetchOptionsDefaults(t){this.setRequestHeader(t,"X-Medplum","extended"),this.setRequestHeader(t,"Accept",V6,!0),t.body&&this.setRequestHeader(t,"Content-Type",Yt.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 Error("Unauthenticated")))}async startPkce(){const t=Ew();sessionStorage.setItem("pkceState",t);const n=Ew();sessionStorage.setItem("codeVerifier",n);const r=await v6(n),o=JL(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??_w()),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)??_w()),typeof sessionStorage<"u"){const o=sessionStorage.getItem("codeVerifier");o&&r.set("code_verifier",o)}return this.fetchTokens(r)}refreshIfExpired(){return!this.refreshPromise&&this.accessTokenExpires!==void 0&&this.accessTokenExpires<Date.now()&&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=g6(t+":"+n)}async fhircastSubscribe(t,n){if(!(typeof t=="string"&&t!==""))throw new He(jt("Invalid topic provided. Topic must be a valid string."));if(!(typeof n=="object"&&Array.isArray(n)&&n.length>0))throw new He(jt("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",Pw(r),Yt.FORM_URL_ENCODED))["hub.channel.endpoint"];if(!i)throw new Error("Invalid response!");return r.endpoint=i,r}async fhircastUnsubscribe(t){if(!ox(t))throw new He(jt("Invalid topic or subscriptionRequest. SubscriptionRequest must be an object."));if(!(t.endpoint&&typeof t.endpoint=="string"&&t.endpoint.startsWith("ws")))throw new He(jt("Provided subscription request must have an endpoint in order to unsubscribe."));t.mode="unsubscribe",await this.post("/fhircast/STU3",Pw(t),Yt.FORM_URL_ENCODED)}fhircastConnect(t){return new R6(t)}async fhircastPublish(t,n,r,o){return j6(n)?this.post(`/fhircast/STU3/${t}`,kw(t,n,r,o),Yt.JSON):(C6(n),this.post(`/fhircast/STU3/${t}`,kw(t,n,r),Yt.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":Yt.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 He(ji(a.error_description))}catch(a){throw new He(ji("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(D6(n)){const r=ix(n);if(Date.now()>=r.exp*1e3)throw this.clearActiveLogin(),new Error("Token expired");if(r.cid){if(r.cid!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}else if(this.clientId&&r.client_id!==this.clientId)throw this.clearActiveLogin(),new Error("Token was not issued for this audience")}return this.setActiveLogin({accessToken:n,refreshToken:t.refresh_token,project:t.project,profile:t.profile})}setupStorageListener(){try{window.addEventListener("storage",t=>{(t.key===null||t.key==="activeLogin")&&window.location.reload()})}catch{}}retryCatch(t,n,r){if(r.message==="Failed to fetch"&&t===1&&this.dispatchEvent({type:"offline"}),t>=n-1)throw r}getSubscriptionManager(){return this.subscriptionManager||(this.subscriptionManager=new F6(this,o7(this.baseUrl,"/ws/subscriptions-r4"))),this.subscriptionManager}subscribeToCriteria(t){return this.getSubscriptionManager().addCriteria(t)}unsubscribeFromCriteria(t){this.subscriptionManager&&(this.subscriptionManager.removeCriteria(t),this.subscriptionManager.getCriteriaCount()===0&&this.subscriptionManager.closeWebSocket())}getMasterSubscriptionEmitter(){return this.getSubscriptionManager().getMasterEmitter()}}function G6(){if(!globalThis.fetch)throw new Error("Fetch not available in this environment");return globalThis.fetch.bind(globalThis)}function _w(){return typeof window>"u"?"":window.location.protocol+"//"+window.location.host+"/"}async function Dw(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(oh(t)&&((i=(o=t.issue)==null?void 0:o[0])!=null&&i.diagnostics))return t.issue[0].diagnostics}function vp(e){var n;const t=((n=e.entry)==null?void 0:n.map(r=>r.resource))??[];return Object.assign(t,{bundle:e})}function Q6(e){return Sn(e)&&"data"in e&&"contentType"in e}function Iw(e,t,n,r){return Q6(e)?e:{data:e,filename:t,contentType:n,onProgress:r}}function K6(e){return Sn(e)&&"docDefinition"in e}function Y6(e,t,n,r){return K6(e)?e:{docDefinition:e,filename:t,tableLayouts:n,fonts:r}}function Oa({parentContext:e,path:t,elements:n,profileUrl:r,debugMode:o}){if(t===(e==null?void 0:e.path))return;const i=X6(t,n,e,!!o),a=Object.create(null);for(const[l,c]of Object.entries(i))a[t+"."+l]=c;return{path:t,elements:i,elementsByPath:a,profileUrl:r??(e==null?void 0:e.profileUrl),debugMode:o??(e==null?void 0:e.debugMode)??!1}}function X6(e,t,n,r){const o=Object.create(null);if(n)for(const[a,l]of Object.entries(n.elementsByPath)){const c=fc(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 _T(e){return e.type!==void 0&&e.type.length>0}function J6(e,t,n,r){var i;const o=kL(e,t.path,{profileUrl:r});if(o){const a=((i=n.typeSchema)==null?void 0:i.elements)??n.elements;return o.some(l=>DL(l,t,n,a))??!1}return console.assert(!1,"getNestedProperty[%s] in isDiscriminatorComponentMatch missed",t.path),!1}function DT(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.name)??((i=a.type)==null?void 0:i[0].code)};if(n.every(c=>{var u;return J6(l,c,a,((u=a.typeSchema)==null?void 0:u.url)??r)}))return a.name}}class Z6{constructor(t,n,r){if(t.type===void 0)throw new Error("schema must include a type");this.rootSchema=t;const o=Oa({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(!Ft(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=eF(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);Ft((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(!_T(l))continue;const c=(a=(i=l.type.find(u=>Ft(u.profile)))==null?void 0:i.profile)==null?void 0:a[0];if(Ft(c)){const u=Rs(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;Ft(a)&&(i=Oa({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 eF(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 yp="__sliceName";function tF(e,t){const n=new nF(e,e.resourceType,"resource");return new Z6(t,n).crawlResource(),n.getDefaultValue()}function Aw(e,t,n){for(const[r,o]of Object.entries(t)){if(n===void 0||n===r){Wd(e,r,o,t);continue}const i=fc(n,r);i!==void 0&&Wd(e,i,o,t)}return e}class nF{constructor(t,n,r){this.schemaStack=[],this.valueStack=[],this.rootValue=ho(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=fc(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){rF(d,a,n,r.elements),Wd(d,a,n,r.elements);const f=Qm(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=fc(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=Qm(a,i,n,r.elements);if(Array.isArray(l))for(let c=l.length-1;c>=0;c--){const u=l[c];Ft(u)||l.splice(c,1)}zt(l)&&Gm(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[yp]??DT(i,[n],r.discriminator,this.schema.url))===n.name&&o.push(i);for(let i=o.length;i<n.min;i++)if(Gy(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];yp in o&&delete o[yp]}}getDefaultValue(){return this.rootValue}}function rF(e,t,n,r){const o=Qm(e,t,n,r);n.min>0&&o===void 0&&Gy(n.type[0].code)&&(n.isArray?Gm(e,[Object.create(null)],t,n):Gm(e,Object.create(null),t,n))}function Gm(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]",Wt(i))}t===void 0?delete e[o]:e[o]=t}function Qm(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]",Wt(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(Sn(i)){if(i[c]===void 0)return;i=i[c]}else return}return a}function Wd(e,t,n,r){if(!(n.fixed||n.pattern))return e;if(Array.isArray(e))return e.map(l=>Wd(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]",Wt(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]=IT(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 IT(e,t){if(Array.isArray(t)&&(Array.isArray(e)||e===void 0))return((e==null?void 0:e.length)??0)>0?e:ho(t);if(Sn(t)&&(Sn(e)&&!Array.isArray(e)||e===void 0)){const n=ho(e)??Object.create(null);for(const r of Object.keys(t))n[r]=IT(n[r],t[r]);return n}return e}var AT=p.createContext(void 0);function uh(){return p.useContext(AT)}function oe(){return uh().medplum}function dh(){return uh().navigate}function fh(){return uh().profile}function oF(e){let t=e.medplum,n=e.navigate??iF,[r,o]=p.useState({profile:t.getProfile(),loading:!t.isInitialized});p.useEffect(()=>{t&&(t.isInitialized||(o(a=>({...a,loading:!0})),t.getInitPromise().then(()=>o(a=>({...a,loading:!1}))).catch(console.error)))},[t,t.isInitialized]),p.useEffect(()=>{function a(){o({...r,profile:t.getProfile()})}return t.addEventListener("change",a),()=>t.removeEventListener("change",a)},[t,r]);let i=p.useMemo(()=>({...r,medplum:t,navigate:n}),[r,t,n]);return s.jsx(AT.Provider,{value:i,children:e.children})}function iF(e){window.location.assign(e)}var Nw=new Map,NT=e=>p.useMemo(()=>{if(!e)return;let 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;let r=n.get("Expires");if(!r||r.length>13)return e;let o=Nw.get(t);if(o){let i=new URLSearchParams(new URL(o).search).get("Expires");if(i&&parseInt(i,10)*1e3-5e3>Date.now())return o}return Nw.set(t,e),e},[e]);function ft(e,t){let n=oe(),[r,o]=p.useState(Mw(n,e)),i=p.useCallback(a=>{Gc(a,r)||o(a)},[r,o]);return p.useEffect(()=>{i(Mw(n,e))},[n,e,i]),p.useEffect(()=>{let a=!0;return Is(e)&&n.readReference(e).then(l=>{a&&i(l)}).catch(l=>{a&&(i(void 0),t&&t(dt(l)))}),()=>a=!1},[n,r,e,i,t]),r}function Mw(e,t){if(t){if(qo(t))return t;if(Is(t))return e.getCachedReference(t)}}function sF(e,t){return MT("searchOne",e,t)}function $a(e,t){return MT("searchResources",e,t)}function MT(e,t,n){let r=oe(),[o,i]=p.useState(),[a,l]=p.useState(!1),[c,u]=p.useState(),[d,f]=p.useState();return p.useEffect(()=>{let h=r.fhirSearchUrl(t,n).toString();h!==o&&(i(h),r[e](t,n).then(m=>{l(!1),u(m),f(E$)}).catch(m=>{l(!1),u(void 0),f(dt(m))}))},[r,e,t,n,o]),[c,a,d]}function aF(e){const t=e.value;return t?s.jsx(s.Fragment,{children:a7(t)}):null}function Ow(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 lF(e){const[t,n]=p.useState(e.defaultValue||{}),r=p.useRef();r.current=t;function o(h){n(h),e.onChange&&e.onChange(h)}function i(h){o({...r.current,use:h})}function a(h){o({...r.current,type:h})}function l(h){o($w(r.current||{},0,h))}function c(h){o($w(r.current||{},1,h))}function u(h){o({...r.current,city:h})}function d(h){o({...r.current,state:h})}function f(h){o({...r.current,postalCode:h})}return s.jsxs(Z,{gap:"xs",wrap:"nowrap",grow:!0,children:[s.jsx(Et,{"data-testid":"address-use",defaultValue:t.use,onChange:h=>i(h.currentTarget.value),data:["","home","work","temp","old","billing"]}),s.jsx(Et,{"data-testid":"address-type",defaultValue:t.type,onChange:h=>a(h.currentTarget.value),data:["","postal","physical","both"]}),s.jsx(de,{placeholder:"Line 1",defaultValue:Ow(t,0),onChange:h=>l(h.currentTarget.value)}),s.jsx(de,{placeholder:"Line 2",defaultValue:Ow(t,1),onChange:h=>c(h.currentTarget.value)}),s.jsx(de,{placeholder:"City",defaultValue:t.city,onChange:h=>u(h.currentTarget.value)}),s.jsx(de,{placeholder:"State",defaultValue:t.state,onChange:h=>d(h.currentTarget.value)}),s.jsx(de,{placeholder:"Postal Code",defaultValue:t.postalCode,onChange:h=>f(h.currentTarget.value)})]})}function cF(e){const t=fh(),[n,r]=p.useState(e.defaultValue||{});function o(i){const a=i?{text:i,authorReference:t&>(t),time:new Date().toISOString()}:{};r(a),e.onChange&&e.onChange(a)}return s.jsx(de,{name:e.name,placeholder:"Annotation text",defaultValue:n.text,onChange:i=>o(i.currentTarget.value)})}/**
|
|
133
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
134
|
+
*
|
|
135
|
+
* This source code is licensed under the MIT license.
|
|
136
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
137
|
+
*/var uF={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"}};/**
|
|
138
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
139
|
+
*
|
|
140
|
+
* This source code is licensed under the MIT license.
|
|
141
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
142
|
+
*/const be=(e,t,n,r)=>{const o=p.forwardRef(({color:i="currentColor",size:a=24,stroke:l=2,className:c,children:u,...d},f)=>p.createElement("svg",{ref:f,...uF[e],width:a,height:a,className:["tabler-icon",`tabler-icon-${t}`,c].join(" "),...e==="filled"?{fill:i}:{strokeWidth:l,stroke:i},...d},[...r.map(([h,m])=>p.createElement(h,m)),...Array.isArray(u)?u:[u]]));return o.displayName=`${n}`,o};/**
|
|
143
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
144
|
+
*
|
|
145
|
+
* This source code is licensed under the MIT license.
|
|
146
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
147
|
+
*/var dF=be("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"}]]);/**
|
|
148
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
149
|
+
*
|
|
150
|
+
* This source code is licensed under the MIT license.
|
|
151
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
152
|
+
*/var Kc=be("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"}]]);/**
|
|
153
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
154
|
+
*
|
|
155
|
+
* This source code is licensed under the MIT license.
|
|
156
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
157
|
+
*/var fF=be("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"}]]);/**
|
|
158
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
159
|
+
*
|
|
160
|
+
* This source code is licensed under the MIT license.
|
|
161
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
162
|
+
*/var hF=be("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"}]]);/**
|
|
163
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
164
|
+
*
|
|
165
|
+
* This source code is licensed under the MIT license.
|
|
166
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
167
|
+
*/var pF=be("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"}]]);/**
|
|
168
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
169
|
+
*
|
|
170
|
+
* This source code is licensed under the MIT license.
|
|
171
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
172
|
+
*/var mF=be("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"}]]);/**
|
|
173
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
174
|
+
*
|
|
175
|
+
* This source code is licensed under the MIT license.
|
|
176
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
177
|
+
*/var gF=be("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"}]]);/**
|
|
178
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
179
|
+
*
|
|
180
|
+
* This source code is licensed under the MIT license.
|
|
181
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
182
|
+
*/var vF=be("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"}]]);/**
|
|
183
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
184
|
+
*
|
|
185
|
+
* This source code is licensed under the MIT license.
|
|
186
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
187
|
+
*/var yF=be("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"}]]);/**
|
|
188
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
189
|
+
*
|
|
190
|
+
* This source code is licensed under the MIT license.
|
|
191
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
192
|
+
*/var xF=be("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"}]]);/**
|
|
193
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
194
|
+
*
|
|
195
|
+
* This source code is licensed under the MIT license.
|
|
196
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
197
|
+
*/var wF=be("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"}]]);/**
|
|
198
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
199
|
+
*
|
|
200
|
+
* This source code is licensed under the MIT license.
|
|
201
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
202
|
+
*/var SF=be("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"}]]);/**
|
|
203
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
204
|
+
*
|
|
205
|
+
* This source code is licensed under the MIT license.
|
|
206
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
207
|
+
*/var zi=be("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"}]]);/**
|
|
208
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
209
|
+
*
|
|
210
|
+
* This source code is licensed under the MIT license.
|
|
211
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
212
|
+
*/var Yc=be("outline","check","IconCheck",[["path",{d:"M5 12l5 5l10 -10",key:"svg-0"}]]);/**
|
|
213
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
214
|
+
*
|
|
215
|
+
* This source code is licensed under the MIT license.
|
|
216
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
217
|
+
*/var bF=be("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"}]]);/**
|
|
218
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
219
|
+
*
|
|
220
|
+
* This source code is licensed under the MIT license.
|
|
221
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
222
|
+
*/var OT=be("outline","chevron-down","IconChevronDown",[["path",{d:"M6 9l6 6l6 -6",key:"svg-0"}]]);/**
|
|
223
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
224
|
+
*
|
|
225
|
+
* This source code is licensed under the MIT license.
|
|
226
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
227
|
+
*/var qd=be("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"}]]);/**
|
|
228
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
229
|
+
*
|
|
230
|
+
* This source code is licensed under the MIT license.
|
|
231
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
232
|
+
*/var Gd=be("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"}]]);/**
|
|
233
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
234
|
+
*
|
|
235
|
+
* This source code is licensed under the MIT license.
|
|
236
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
237
|
+
*/var sx=be("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"}]]);/**
|
|
238
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
239
|
+
*
|
|
240
|
+
* This source code is licensed under the MIT license.
|
|
241
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
242
|
+
*/var jF=be("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"}]]);/**
|
|
243
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
244
|
+
*
|
|
245
|
+
* This source code is licensed under the MIT license.
|
|
246
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
247
|
+
*/var $T=be("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"}]]);/**
|
|
248
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
249
|
+
*
|
|
250
|
+
* This source code is licensed under the MIT license.
|
|
251
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
252
|
+
*/var CF=be("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"}]]);/**
|
|
253
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
254
|
+
*
|
|
255
|
+
* This source code is licensed under the MIT license.
|
|
256
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
257
|
+
*/var EF=be("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"}]]);/**
|
|
258
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
259
|
+
*
|
|
260
|
+
* This source code is licensed under the MIT license.
|
|
261
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
262
|
+
*/var PF=be("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"}]]);/**
|
|
263
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
264
|
+
*
|
|
265
|
+
* This source code is licensed under the MIT license.
|
|
266
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
267
|
+
*/var TF=be("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"}]]);/**
|
|
268
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
269
|
+
*
|
|
270
|
+
* This source code is licensed under the MIT license.
|
|
271
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
272
|
+
*/var Xc=be("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"}]]);/**
|
|
273
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
274
|
+
*
|
|
275
|
+
* This source code is licensed under the MIT license.
|
|
276
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
277
|
+
*/var Jc=be("outline","equal","IconEqual",[["path",{d:"M5 10h14",key:"svg-0"}],["path",{d:"M5 14h14",key:"svg-1"}]]);/**
|
|
278
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
279
|
+
*
|
|
280
|
+
* This source code is licensed under the MIT license.
|
|
281
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
282
|
+
*/var Lw=be("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"}]]);/**
|
|
283
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
284
|
+
*
|
|
285
|
+
* This source code is licensed under the MIT license.
|
|
286
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
287
|
+
*/var kF=be("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"}]]);/**
|
|
288
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
289
|
+
*
|
|
290
|
+
* This source code is licensed under the MIT license.
|
|
291
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
292
|
+
*/var RF=be("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"}]]);/**
|
|
293
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
294
|
+
*
|
|
295
|
+
* This source code is licensed under the MIT license.
|
|
296
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
297
|
+
*/var _F=be("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"}]]);/**
|
|
298
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
299
|
+
*
|
|
300
|
+
* This source code is licensed under the MIT license.
|
|
301
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
302
|
+
*/var DF=be("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"}]]);/**
|
|
303
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
304
|
+
*
|
|
305
|
+
* This source code is licensed under the MIT license.
|
|
306
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
307
|
+
*/var IF=be("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"}]]);/**
|
|
308
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
309
|
+
*
|
|
310
|
+
* This source code is licensed under the MIT license.
|
|
311
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
312
|
+
*/var AF=be("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"}]]);/**
|
|
313
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
314
|
+
*
|
|
315
|
+
* This source code is licensed under the MIT license.
|
|
316
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
317
|
+
*/var NF=be("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"}]]);/**
|
|
318
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
319
|
+
*
|
|
320
|
+
* This source code is licensed under the MIT license.
|
|
321
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
322
|
+
*/var MF=be("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"}]]);/**
|
|
323
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
324
|
+
*
|
|
325
|
+
* This source code is licensed under the MIT license.
|
|
326
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
327
|
+
*/var LT=be("outline","math-greater","IconMathGreater",[["path",{d:"M5 18l14 -6l-14 -6",key:"svg-0"}]]);/**
|
|
328
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
329
|
+
*
|
|
330
|
+
* This source code is licensed under the MIT license.
|
|
331
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
332
|
+
*/var FT=be("outline","math-lower","IconMathLower",[["path",{d:"M19 18l-14 -6l14 -6",key:"svg-0"}]]);/**
|
|
333
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
334
|
+
*
|
|
335
|
+
* This source code is licensed under the MIT license.
|
|
336
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
337
|
+
*/var OF=be("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"}]]);/**
|
|
338
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
339
|
+
*
|
|
340
|
+
* This source code is licensed under the MIT license.
|
|
341
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
342
|
+
*/var $F=be("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"}]]);/**
|
|
343
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
344
|
+
*
|
|
345
|
+
* This source code is licensed under the MIT license.
|
|
346
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
347
|
+
*/var LF=be("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"}]]);/**
|
|
348
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
349
|
+
*
|
|
350
|
+
* This source code is licensed under the MIT license.
|
|
351
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
352
|
+
*/var FF=be("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"}]]);/**
|
|
353
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
354
|
+
*
|
|
355
|
+
* This source code is licensed under the MIT license.
|
|
356
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
357
|
+
*/var zF=be("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"}]]);/**
|
|
358
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
359
|
+
*
|
|
360
|
+
* This source code is licensed under the MIT license.
|
|
361
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
362
|
+
*/var VF=be("outline","player-play","IconPlayerPlay",[["path",{d:"M7 4v16l13 -8z",key:"svg-0"}]]);/**
|
|
363
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
364
|
+
*
|
|
365
|
+
* This source code is licensed under the MIT license.
|
|
366
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
367
|
+
*/var BF=be("outline","plus","IconPlus",[["path",{d:"M12 5l0 14",key:"svg-0"}],["path",{d:"M5 12l14 0",key:"svg-1"}]]);/**
|
|
368
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
369
|
+
*
|
|
370
|
+
* This source code is licensed under the MIT license.
|
|
371
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
372
|
+
*/var UF=be("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"}]]);/**
|
|
373
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
374
|
+
*
|
|
375
|
+
* This source code is licensed under the MIT license.
|
|
376
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
377
|
+
*/var HF=be("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"}]]);/**
|
|
378
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
379
|
+
*
|
|
380
|
+
* This source code is licensed under the MIT license.
|
|
381
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
382
|
+
*/var WF=be("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"}]]);/**
|
|
383
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
384
|
+
*
|
|
385
|
+
* This source code is licensed under the MIT license.
|
|
386
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
387
|
+
*/var qF=be("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"}]]);/**
|
|
388
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
389
|
+
*
|
|
390
|
+
* This source code is licensed under the MIT license.
|
|
391
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
392
|
+
*/var GF=be("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"}]]);/**
|
|
393
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
394
|
+
*
|
|
395
|
+
* This source code is licensed under the MIT license.
|
|
396
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
397
|
+
*/var Km=be("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"}]]);/**
|
|
398
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
399
|
+
*
|
|
400
|
+
* This source code is licensed under the MIT license.
|
|
401
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
402
|
+
*/var ax=be("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"}]]);/**
|
|
403
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
404
|
+
*
|
|
405
|
+
* This source code is licensed under the MIT license.
|
|
406
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
407
|
+
*/var lx=be("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"}]]);/**
|
|
408
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
409
|
+
*
|
|
410
|
+
* This source code is licensed under the MIT license.
|
|
411
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
412
|
+
*/var QF=be("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"}]]);/**
|
|
413
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
414
|
+
*
|
|
415
|
+
* This source code is licensed under the MIT license.
|
|
416
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
417
|
+
*/var KF=be("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"}]]);/**
|
|
418
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
419
|
+
*
|
|
420
|
+
* This source code is licensed under the MIT license.
|
|
421
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
422
|
+
*/var YF=be("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"}]]);/**
|
|
423
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
424
|
+
*
|
|
425
|
+
* This source code is licensed under the MIT license.
|
|
426
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
427
|
+
*/var XF=be("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"}]]);/**
|
|
428
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
429
|
+
*
|
|
430
|
+
* This source code is licensed under the MIT license.
|
|
431
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
432
|
+
*/var zT=be("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"}]]);/**
|
|
433
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
434
|
+
*
|
|
435
|
+
* This source code is licensed under the MIT license.
|
|
436
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
437
|
+
*/var Fw=be("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"}]]);/**
|
|
438
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
439
|
+
*
|
|
440
|
+
* This source code is licensed under the MIT license.
|
|
441
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
442
|
+
*/var JF=be("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"}]]);/**
|
|
443
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
444
|
+
*
|
|
445
|
+
* This source code is licensed under the MIT license.
|
|
446
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
447
|
+
*/var Qd=be("outline","x","IconX",[["path",{d:"M18 6l-12 12",key:"svg-0"}],["path",{d:"M6 6l12 12",key:"svg-1"}]]);/**
|
|
448
|
+
* @license @tabler/icons-react v3.4.0 - MIT
|
|
449
|
+
*
|
|
450
|
+
* This source code is licensed under the MIT license.
|
|
451
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
452
|
+
*/var ZF=be("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 VT 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(Es,{icon:s.jsx(Kc,{size:16}),title:"Something went wrong",color:"red",children:Ae(this.state.error)}):this.props.children}}function Ur(){return s.jsx(dn,{style:{width:"100%",height:"100vh"},children:s.jsx(Qn,{})})}const e8="_main_g2hyx_1",t8={main:e8};function at(e){e.preventDefault(),e.stopPropagation()}function BT(e){if(zw(e))return!0;if(e instanceof HTMLTableCellElement){const t=e.children;if(t.length===1&&zw(t[0]))return!0}return!1}function zw(e){return e instanceof HTMLInputElement&&e.type==="checkbox"}function We(e){const t=dh(),{to:n,suffix:r,label:o,onClick:i,children:a,...l}=e;let c=n8(n);return r&&(c+="/"+r),s.jsx(Je,{href:c,"aria-label":o,onClick:u=>{at(u),i?i(u):n&&t(c)},...l,children:a})}function n8(e){if(e){if(typeof e=="string")return r8(e);if(qo(e))return o8(e);if(Is(e))return i8(e)}return"#"}function r8(e){return e.startsWith("http://")||e.startsWith("https://")||e.startsWith("/")?e:"/"+e}function o8(e){return`/${e.resourceType}/${e.id}`}function i8(e){return`/${e.reference}`}function s8(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 Oi(e){const t=ft(e.value),n=t?No(t):e.alt??"",r=s8(n),o=(t&&zL(t))??e.src,i=NT(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(ds,{src:i,alt:n,radius:a,...l,children:r})}):s.jsx(ds,{src:i,alt:n,radius:a,...l,children:r})}const a8="_logoButton_189g3_1",l8="_user_189g3_11",c8="_userName_189g3_21",u8="_userActive_189g3_31",Vu={logoButton:a8,user:l8,userName:c8,userActive:u8};function cx(e){const t=e.value;return t?s.jsx(s.Fragment,{children:Qc(t,e.options)}):null}function d8(e){var c,u,d;const t=uh(),{medplum:n,profile:r,navigate:o}=t,i=n.getLogins(),{colorScheme:a,setColorScheme:l}=cD();return s.jsxs(s.Fragment,{children:[s.jsxs(De,{align:"center",p:"xl",children:[s.jsx(Oi,{size:"xl",radius:100,value:t.profile}),s.jsx(cx,{value:(u=(c=t.profile)==null?void 0:c.name)==null?void 0:u[0]}),s.jsx(ue,{c:"dimmed",size:"xs",children:(d=n.getActiveLogin())==null?void 0:d.project.display})]}),i.length>1&&s.jsx(ne.Divider,{}),i.map(f=>f.profile.reference!==vt(t.profile)&&s.jsx(ne.Item,{onClick:()=>{n.setActiveLogin(f).then(()=>window.location.reload()).catch(console.log)},children:s.jsxs(Z,{children:[s.jsx(ds,{radius:"xl"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(ue,{size:"sm",fw:500,children:f.profile.display}),s.jsx(ue,{c:"dimmed",size:"xs",children:f.project.display})]})]})},f.profile.reference)),s.jsx(ne.Divider,{}),s.jsx(Z,{justify:"center",children:s.jsx(Ry,{size:"xs",value:a,onChange:f=>l(f),data:[{label:"Light",value:"light"},{label:"Dark",value:"dark"},{label:"Auto",value:"auto"}]})}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(YF,{size:14,stroke:1.5}),onClick:()=>o("/signin"),children:"Add another account"}),s.jsx(ne.Item,{leftSection:s.jsx(Km,{size:14,stroke:1.5}),onClick:()=>o(`/${vt(r)}`),children:"Account settings"}),s.jsx(ne.Item,{leftSection:s.jsx(MF,{size:14,stroke:1.5}),onClick:async()=>{await n.signOut(),o("/signin")},children:"Sign out"}),s.jsx(ue,{size:"xs",c:"dimmed",ta:"center",children:e.version})]})}function ux(e){const t=Oc({onDropdownClose:()=>t.resetSelectedOption(),onDropdownOpen:()=>t.updateSelectedOptionIndex("active")}),{name:n,label:r,description:o,error:i,defaultValue:a,toOption:l,loadOptions:c,itemComponent:u,onChange:d,onCreate:f,creatable:h,clearable:m,required:g,placeholder:v,leftSection:S,maxValues:y,optionsDropdownMaxHeight:w=320,...x}=e,b=f8(a),[C,E]=p.useState(""),[j,P]=p.useState(),[_,R]=p.useState(),[M,D]=p.useState(),[N,A]=p.useState(b.map(l)),[L,I]=p.useState([]),k=u??h8,T=p.useRef();T.current=C;const $=p.useRef(),V=p.useRef(),U=p.useRef();U.current=j;const X=p.useRef();X.current=_;const Se=p.useRef();Se.current=M;const me=p.useRef();me.current=L;const xe=p.useCallback(()=>{if(P(void 0),T.current===V.current&&c===$.current)return;V.current=T.current,$.current=c;const ye=new AbortController;R(ye),c(T.current??"",ye.signal).then($e=>{ye.signal.aborted||(I($e.map(l)),R(void 0),Se.current?($e.length>0&&d($e.slice(0,1)),D(!1)):$e.length>0&&t.openDropdown())}).catch($e=>{ye.signal.aborted||$e.message.includes("aborted")||ve({color:"red",message:Ae($e)})})},[t,c,d,l]),Te=p.useCallback(ye=>{(L&&L.length>0||h)&&t.openDropdown(),t.updateSelectedOptionIndex(),E(ye.currentTarget.value),X.current&&(X.current.abort(),R(void 0)),U.current!==void 0&&window.clearTimeout(U.current);const $e=window.setTimeout(()=>xe(),100);P($e)},[t,L,h,xe]),je=p.useCallback(ye=>{const $e=[],Ie=[...N];let ee=L==null?void 0:L.find(Ee=>Ee.value===ye),te=ee==null?void 0:ee.resource;if(!te&&h!==!1&&f&&(te=f(ye),ee=l(te)),te&&$e.push(te),ee&&Ie.push(ee),y!==void 0)for(;Ie.length>y;)Ie.shift();d($e),A(Ie)},[h,L,N,y,d,f,l]),ae=ye=>{E(""),I([]),t.closeDropdown(),V.current=void 0,je(ye==="$create"?C:ye)},Be=p.useCallback(ye=>{const $e=N.filter(Ie=>Ie.value!==ye.value);d($e.map(Ie=>Ie.resource)),A($e)},[N,d]),St=p.useCallback(ye=>{ye.key==="Enter"?!j&&!_?(at(ye),L&&L.length>0&&(I(L.slice(0,1)),je(L[0].value))):D(!0):ye.key==="Backspace"&&C.length===0&&(at(ye),Be(N[N.length-1]))},[C,N,L,j,_,je,Be]);p.useEffect(()=>()=>{X.current&&X.current.abort()},[]);const st=m&&N.length>0&&s.jsx(_e.ClearButton,{title:"Clear all",size:16,onClear:()=>{E(""),A([]),d([]),t.closeDropdown()}});return s.jsxs(_e,{store:t,onOptionSubmit:ae,withinPortal:!0,shadow:"xl",...x,children:[s.jsx(_e.DropdownTarget,{children:s.jsx(Na,{label:r,description:o,error:i,className:e.className,leftSection:S,rightSection:_?s.jsx(Qn,{size:16}):st,required:g,children:s.jsxs(fs.Group,{children:[N.map(ye=>s.jsx(fs,{withRemoveButton:!0,onRemove:()=>Be(ye),children:ye.label},ye.value)),(y===void 0||y===0||N.length<y)&&s.jsx(_e.EventsTarget,{children:s.jsx(Na.Field,{role:"searchbox",name:n,value:C,placeholder:v,onFocus:Te,onBlur:()=>t.closeDropdown(),onKeyDown:St,onChange:Te})})]})})}),s.jsx(_e.Dropdown,{children:s.jsx(_e.Options,{children:s.jsxs(Rf,{type:"scroll",mah:w,children:[L.map(ye=>s.jsx(_e.Option,{value:ye.value,active:N.includes(ye),children:s.jsx(k,{...ye})},ye.value)),h&&C.trim().length>0&&s.jsxs(_e.Option,{value:"$create",children:["+ Create ",C]}),!h&&C.trim().length>0&&L.length===0&&s.jsx(_e.Empty,{children:"Nothing found"})]})})})]})}function f8(e){return e?Array.isArray(e)?e:[e]:[]}function h8(e){return s.jsx(Z,{gap:"sm",children:s.jsx("span",{children:e.label})})}const p8="_searchInput_dick8_1",m8={searchInput:p8};function g8(e){return{value:e.id,label:No(e),resource:e}}function v8(e){const t=dh(),n=oe(),r=p.useCallback(async(i,a)=>{const l=x8(i),c={signal:a},u=await n.graphql(l,void 0,void 0,c);return w8(u,i)},[n]),o=p.useCallback(i=>{i.length>0&&t(`/${vt(i[0])}`)},[t]);return s.jsx(ux,{size:"sm",radius:"md",className:m8.searchInput,leftSection:s.jsx(GF,{size:16}),placeholder:"Search",itemComponent:y8,toOption:g8,onChange:o,loadOptions:r,maxValues:0,clearable:!1},`${e.pathname}?${e.searchParams}`)}const y8=p.forwardRef(({resource:e,...t},n)=>{var o;let r;return e.resourceType==="Patient"?r=e.birthDate:e.resourceType==="ServiceRequest"&&(r=(o=e.subject)==null?void 0:o.display),s.jsx("div",{ref:n,...t,children:s.jsxs(Z,{wrap:"nowrap",children:[s.jsx(Oi,{value:e}),s.jsxs("div",{children:[s.jsx(ue,{children:No(e)}),s.jsx(ue,{size:"xs",c:"dimmed",children:r})]})]})})});function x8(e){const t=JSON.stringify(e);return uT(e)?`{
|
|
453
|
+
Patients1: PatientList(_id: ${t}, _count: 1) {
|
|
454
|
+
resourceType
|
|
455
|
+
id
|
|
456
|
+
identifier {
|
|
457
|
+
system
|
|
458
|
+
value
|
|
459
|
+
}
|
|
460
|
+
name {
|
|
461
|
+
given
|
|
462
|
+
family
|
|
463
|
+
}
|
|
464
|
+
birthDate
|
|
465
|
+
}
|
|
466
|
+
ServiceRequestList(_id: ${t}, _count: 1) {
|
|
467
|
+
resourceType
|
|
468
|
+
id
|
|
469
|
+
identifier {
|
|
470
|
+
system
|
|
471
|
+
value
|
|
472
|
+
}
|
|
473
|
+
subject {
|
|
474
|
+
display
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}`.replace(/\s+/g," "):`{
|
|
478
|
+
Patients1: PatientList(name: ${t}, _count: 5) {
|
|
479
|
+
resourceType
|
|
480
|
+
id
|
|
481
|
+
identifier {
|
|
482
|
+
system
|
|
483
|
+
value
|
|
484
|
+
}
|
|
485
|
+
name {
|
|
486
|
+
given
|
|
487
|
+
family
|
|
488
|
+
}
|
|
489
|
+
birthDate
|
|
490
|
+
}
|
|
491
|
+
Patients2: PatientList(identifier: ${t}, _count: 5) {
|
|
492
|
+
resourceType
|
|
493
|
+
id
|
|
494
|
+
identifier {
|
|
495
|
+
system
|
|
496
|
+
value
|
|
497
|
+
}
|
|
498
|
+
name {
|
|
499
|
+
given
|
|
500
|
+
family
|
|
501
|
+
}
|
|
502
|
+
birthDate
|
|
503
|
+
}
|
|
504
|
+
ServiceRequestList(identifier: ${t}, _count: 5) {
|
|
505
|
+
resourceType
|
|
506
|
+
id
|
|
507
|
+
identifier {
|
|
508
|
+
system
|
|
509
|
+
value
|
|
510
|
+
}
|
|
511
|
+
subject {
|
|
512
|
+
display
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}`.replace(/\s+/g," ")}function w8(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),b8(S8(n),t).slice(0,5)}function S8(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 b8(e,t){return e.sort((n,r)=>Vw(r,t)-Vw(n,t))}function Vw(e,t){let n=0;if(e.identifier)for(const r of e.identifier)n=Math.max(n,Bw(r.value,t));if(e.resourceType==="Patient"&&e.name)for(const r of e.name)n=Math.max(n,Bw(Qc(r),t));return n}function Bw(e,t){if(!e)return 0;const n=e.toLowerCase().indexOf(t.toLowerCase());return n<0?0:100-n}function j8(e){var o;const t=fh(),[n,r]=p.useState(!1);return s.jsx(Gn.Header,{p:8,style:{zIndex:101},children:s.jsxs(Z,{justify:"space-between",children:[s.jsxs(Z,{gap:"xs",children:[s.jsx(An,{className:Vu.logoButton,onClick:e.navbarToggle,children:e.logo}),!e.headerSearchDisabled&&s.jsx(v8,{pathname:e.pathname,searchParams:e.searchParams})]}),s.jsxs(Z,{gap:"lg",pr:"sm",children:[e.notifications,s.jsxs(ne,{width:260,shadow:"xl",position:"bottom-end",transitionProps:{transition:"pop-top-right"},opened:n,onClose:()=>r(!1),children:[s.jsx(ne.Target,{children:s.jsx(An,{className:nt(Vu.user,{[Vu.userActive]:n}),onClick:()=>r(i=>!i),children:s.jsxs(Z,{gap:7,children:[s.jsx(Oi,{value:t,radius:"xl",size:24}),s.jsx(ue,{size:"sm",className:Vu.userName,children:Qc((o=t==null?void 0:t.name)==null?void 0:o[0])}),s.jsx(OT,{size:12,stroke:1.5})]})})}),s.jsx(ne.Dropdown,{children:s.jsx(d8,{version:e.version})})]})]})]})})}function C8(e){const t={};for(const n of Array.from(e.elements))n instanceof HTMLInputElement?E8(t,n):n instanceof HTMLTextAreaElement?t[n.name]=n.value:n instanceof HTMLSelectElement&&P8(t,n);return t}function E8(e,t){t.disabled||(t.type==="checkbox"||t.type==="radio")&&!t.checked||(e[t.name]=t.value)}function P8(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=C8(t.target);e.onSubmit&&e.onSubmit(n)},children:e.children})}function T8(e){const t=oe(),n=t.getUserConfiguration();function r(o){var d,f;const{menuname:i,bookmarkname:a}=o,l=`${e.pathname}?${e.searchParams.toString()}`,c=ho(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"}),ve({color:"green",message:"Success"}),e.onOk()}).catch(h=>{ve({color:"red",message:Ae(h)})})}return s.jsx(Cn,{title:"Add Bookmark",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:e.onCancel,children:s.jsx(qe,{onSubmit:r,children:s.jsxs(De,{children:[s.jsx(k8,{config:n}),s.jsx(de,{label:"Bookmark Name",type:"text",name:"bookmarkname",placeholder:"Bookmark Name",withAsterisk:!0}),s.jsx(Z,{justify:"flex-end",children:s.jsx(re,{mt:"sm",type:"submit",children:"OK"})})]})})})}function k8(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(Et,{name:"menuname",defaultValue:n[0],label:"Select Menu Option",data:n,withAsterisk:!0})}function UT(e){return typeof e.code=="string"?e.code:JSON.stringify(e)}function R8(e){return typeof e.display=="string"?e.display:UT(e)}function _8(e){return{value:UT(e),label:R8(e),resource:e}}function D8(e){return{code:e,display:e}}function dx(e){const t=oe(),{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(ux,{...l,creatable:r??!0,clearable:o??!0,toOption:_8,loadOptions:c,onCreate:D8,itemComponent:a?I8:void 0})}const I8=p.forwardRef(({label:e,resource:t,...n},r)=>s.jsx("div",{ref:r,...n,children:s.jsx(Z,{wrap:"nowrap",children:s.jsxs("div",{children:[s.jsx(ue,{children:e}),s.jsx(ue,{size:"xs",c:"dimmed",children:`${t.system}#${t.code}`})]})})}));function HT(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=N8(u);a(d),n&&n(d)}return s.jsx(dx,{defaultValue:A8(i),onChange:l,withHelpText:r??!0,...o})}function A8(e){return e?{code:e}:void 0}function N8(e){return e==null?void 0:e.code}function fx(e){const[t,n]=p.useState(e.defaultValue),r=e.onChange,o=p.useCallback(i=>{n(i),r&&r(i)},[r]);return s.jsx(HT,{"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 M8="_menuTitle_9g6l5_1",O8="_link_9g6l5_9",$8="_linkActive_9g6l5_38",Ym={menuTitle:M8,link:O8,linkActive:$8};function L8(e){var l;const t=dh(),n=V8(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(Gn.Navbar,{children:s.jsxs(Pr,{p:"xs",children:[!e.resourceTypeSearchDisabled&&s.jsx(Gn.Section,{mb:"sm",children:s.jsx(fx,{name:"resourceType",placeholder:"Resource Type",maxValues:0,onChange:c=>a(c)},window.location.pathname)}),s.jsxs(Gn.Section,{grow:!0,children:[(l=e.menus)==null?void 0:l.map(c=>{var u;return s.jsxs(p.Fragment,{children:[s.jsx(ue,{className:Ym.menuTitle,children:c.title}),(u=c.links)==null?void 0:u.map(d=>s.jsxs(F8,{to:d.href,active:d.href===(n==null?void 0:n.href),onClick:f=>i(f,d.href),children:[s.jsx(z8,{to:d.href,icon:d.icon}),s.jsx("span",{children:d.label})]},d.href))]},`menu-${c.title}`)}),e.displayAddBookmark&&s.jsx(re,{variant:"subtle",size:"xs",mt:"xl",leftSection:s.jsx(BF,{size:"0.75rem"}),onClick:()=>o(!0),children:"Add Bookmark"})]})]})}),e.pathname&&e.searchParams&&s.jsx(T8,{pathname:e.pathname,searchParams:e.searchParams,visible:r,onOk:()=>o(!1),onCancel:()=>o(!1)})]})}function F8(e){return s.jsx(We,{onClick:e.onClick,to:e.to,className:nt(Ym.link,{[Ym.linkActive]:e.active}),children:e.children})}function z8(e){return e.icon?e.icon:s.jsx(rh,{w:30})}function V8(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=B8(e,t,a.href);l>o&&(o=l,r=a)}return r}function B8(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 U8(e){const[t,n]=p.useState(localStorage.navbarOpen==="true"),r=oe(),o=fh();p.useEffect(()=>{function c(){ve({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(Ur,{}):s.jsxs(Gn,{header:{height:60},navbar:{width:250,breakpoint:"sm",collapsed:{desktop:!o||!t,mobile:!o||!t}},padding:0,children:[o&&s.jsx(j8,{pathname:e.pathname,searchParams:e.searchParams,headerSearchDisabled:e.headerSearchDisabled,logo:e.logo,version:e.version,navbarToggle:l,notifications:e.notifications}),o&&t?s.jsx(L8,{pathname:e.pathname,searchParams:e.searchParams,menus:e.menus,closeNavbar:a,displayAddBookmark:e.displayAddBookmark,resourceTypeSearchDisabled:e.resourceTypeSearchDisabled}):void 0,s.jsx(Gn.Main,{className:t8.main,children:s.jsx(VT,{children:s.jsx(p.Suspense,{fallback:s.jsx(Ur,{}),children:e.children})})})]})}function Zc(e){const{contentType:t,url:n,title:r}=e.value??{},o=NT(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==="application/pdf"&&s.jsx("div",{"data-testid":"attachment-pdf",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(Je,{href:n,"data-testid":"attachment-details",target:"_blank",rel:"noopener noreferrer",download:H8(r),children:r||"Download"})})]}):null}function H8(e){return e!=null&&e.includes(".")?e:void 0}const W8="_root_17n8t_1",q8="_compact_17n8t_25",Uw={root:W8,compact:q8};function hx(e){const{children:t,compact:n}=e;return s.jsx("dl",{className:nt(Uw.root,{[Uw.compact]:n}),children:t})}function Eo(e){return s.jsxs(s.Fragment,{children:[s.jsx("dt",{children:e.term}),s.jsx("dd",{children:e.children})]})}function G8(e){var r;const t=(r=e.values)==null?void 0:r.map((o,i)=>s.jsx("div",{children:s.jsx(Zc,{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(!Ft(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const o=e.path.split(".").pop();n=s.jsx(Eo,{term:hs(o),children:t})}else n=s.jsx(s.Fragment,{children:t});return n}function px(e){const t=oe(),n=p.useRef(null);function r(a){var l;at(a),(l=n.current)==null||l.click()}function o(a){at(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(dt(c))}))}return s.jsxs(s.Fragment,{children:[s.jsx("input",{type:"file","data-testid":"upload-file-input",style:{display:"none"},ref:n,onChange:a=>o(a)}),e.children({onClick:r})]})}function Q8(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(Zc,{value:i,maxWidth:200})}),s.jsx("td",{children:s.jsx(Zt,{title:"Remove",variant:"subtle",size:"sm",color:"gray",onClick:l=>{at(l);const c=t.slice();c.splice(a,1),o(c)},children:s.jsx(qd,{})})})]},`${a}-${t.length}`)),s.jsxs("tr",{children:[s.jsx("td",{}),s.jsx("td",{children:s.jsx(px,{onUpload:i=>{o([...r.current,i])},children:i=>s.jsx(Zt,{...i,title:"Add",variant:"subtle",size:"sm",color:"green",children:s.jsx(sx,{})})})})]})]})]})}function WT(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(Zc,{value:t,maxWidth:200}),s.jsx(re,{onClick:o=>{at(o),r(void 0)},children:"Remove"})]}):s.jsx(px,{securityContext:e.securityContext,onUpload:r,children:o=>s.jsx(re,{...o,children:"Upload..."})})}const qT=["meta","implicitRules","contained","extension","modifierExtension"],GT=["language","text"];function lo(e){return s.jsx(s.Fragment,{children:Ri(e.value)})}function K8(e){return s.jsx(s.Fragment,{children:_s(e.value)})}function QT(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 Y8(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(QT,{value:r},`telecom-${t.name}-${r.value}`))]}):null}function X8(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 J8(e){return s.jsx(s.Fragment,{children:p7(e.value)})}function vc(e){return s.jsx(s.Fragment,{children:oi(e.value)})}function mx(e){return s.jsx(s.Fragment,{children:pc(e.value)})}function Z8(e){const t=e.value;return t?s.jsxs(s.Fragment,{children:[s.jsx(vc,{value:t.numerator})," / ",s.jsx(vc,{value:t.denominator})]}):null}function Kd(e){if(!e.value)return null;const t=e.value.display||e.value.reference||sr(e.value);return e.link!==!1&&e.value.reference?s.jsx(We,{to:e.value,children:t}):s.jsx(s.Fragment,{children:t})}const sn=p.createContext({path:"",profileUrl:void 0,elements:Object.create(null),elementsByPath:Object.create(null),debugMode:!1});sn.displayName="ElementsContext";const gx=["extension","modifierExtension"],ez=["id",...qT].filter(e=>!gx.includes(e));function tz(e){return Object.entries(e).filter(([n,r])=>{var o;return!Ft(r.type)||r.max===0||r.path.toLowerCase().endsWith("extension.url")&&r.fixed||gx.includes(n)&&!Ft((o=r.slicing)==null?void 0:o.slices)||ez.includes(n)?!1:!(GT.includes(n)&&r.path.split(".").length===2||n.includes("."))})}function KT(e,t,n,r){if(!Ft(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=DT(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 YT({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(!_T(u)){console.debug("Unsupported slice definition",u);continue}let d;Ft(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)):a.push(Promise.resolve([]))}Promise.all(a).then(()=>{for(let u=0;u<o.length;u++){const d=o[u],f=i[u];if(f){const h=Rs(f);d.typeSchema=h}}n(o)}).catch(r)})}function hh(e,t,n){return t!==void 0?s.jsx(e,{value:t,children:n}):n}function nz(e){var a,l;const{slice:t,property:n}=e,r=((a=t.typeSchema)==null?void 0:a.elements)??t.elements,o=p.useContext(sn),i=p.useMemo(()=>{var c;if(Ft(r))return Oa({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 hh(sn.Provider,i,s.jsx(s.Fragment,{children:e.value.map((c,u)=>s.jsx("div",{children:s.jsx(Hr,{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 rz(e){var g;const{property:t,propertyType:n}=e,r=oe(),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(sn);if(p.useEffect(()=>{YT({medplum:r,property:t}).then(v=>{c(v);const S=KT(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((y,w)=>s.jsx("div",{children:s.jsx(Hr,{path:e.path,arrayElement:!0,property:t,propertyType:n,value:y,ignoreMissingValues:e.ignoreMissingValues,link:e.link})},`${w}-${v.length}`));if(e.includeDescriptionListEntry){if(!Ft(e.path))throw new Error("props.path is required when includeDescriptionListEntry is true");const y=e.path.split(".").pop();h=s.jsx(Eo,{term:hs(y),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 y=s.jsx(nz,{path:e.path,slice:v,property:t,value:u[S],ignoreMissingValues:e.ignoreMissingValues,link:e.link},v.name);return e.includeDescriptionListEntry&&(y=s.jsx(Eo,{term:hs(v.name),children:y},v.name)),y}),h]})}function eu(e,t,n){const r=hn(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 oz(e,t,n){const r=tT(e,t,n);return r?Array.isArray(r)?[r.map(o=>o.value),r[0].type]:[r.value,r.type]:[void 0,"undefined"]}function iz(e){const{elementDefinitionType:t}=e,n=oe(),r=p.useContext(sn),[o,i]=p.useState(ZP("Extension")),a=p.useMemo(()=>{if(Ft(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=Rs(a);c(!1),f&&i(f)}).catch(f=>{c(!1),console.warn(f)}))},[n,a]),a&&(l||!Hy(a)))return s.jsx("div",{children:"Loading..."});const u=o.elements["value[x]"];if((u==null?void 0:u.max)!==0){const[f,h]=eu({type:"Extension",value:e.value},"value[x]",a??r.profileUrl);return s.jsx(Hr,{propertyType:h,value:f})}return s.jsx(Yd,{path:e.path,value:{type:o.name,value:e.value},compact:e.compact,ignoreMissingValues:e.ignoreMissingValues,link:e.link,profileUrl:a})}function Hr(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,!zt(r)&&s.jsx(nP,{value:r,timeout:2e3,children:({copied:a,copy:l})=>s.jsx(Za,{label:a?"Copied":"Copy",withArrow:!0,position:"right",children:s.jsx(Zt,{variant:"subtle",color:a?"teal":"gray",onClick:l,children:a?s.jsx(Yc,{size:"1rem"}):s.jsx($T,{size:"1rem"})})})})]});if(t&&(t.isArray||t.max>1)&&!e.arrayElement)return n===H.Attachment?s.jsx(G8,{values:r,maxWidth:e.maxWidth,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,property:t,path:e.path}):s.jsx(rz,{path:e.path,property:t,propertyType:n,values:r,includeDescriptionListEntry:e.includeArrayDescriptionListEntry,ignoreMissingValues:e.ignoreMissingValues,link:e.link});switch(n){case H.boolean:return s.jsx(s.Fragment,{children:r===void 0?"":(!!r).toString()});case H.SystemString:case H.string:return s.jsx("div",{style:{whiteSpace:"pre-wrap"},children:r});case H.code:case H.date:case H.decimal:case H.id:case H.integer:case H.positiveInt:case H.unsignedInt:case H.uri:case H.url:return s.jsx(s.Fragment,{children:r});case H.canonical:return s.jsx(Kd,{value:{reference:r},link:e.link});case H.dateTime:case H.instant:return s.jsx(s.Fragment,{children:Nn(r)});case H.markdown:return s.jsx("pre",{children:r});case H.Address:return s.jsx(aF,{value:r});case H.Annotation:return s.jsx(s.Fragment,{children:r==null?void 0:r.text});case H.Attachment:return s.jsx(Zc,{value:r,maxWidth:e.maxWidth});case H.CodeableConcept:return s.jsx(lo,{value:r});case H.Coding:return s.jsx(K8,{value:r});case H.ContactDetail:return s.jsx(Y8,{value:r});case H.ContactPoint:return s.jsx(QT,{value:r});case H.HumanName:return s.jsx(cx,{value:r});case H.Identifier:return s.jsx(X8,{value:r});case H.Money:return s.jsx(J8,{value:r});case H.Period:return s.jsx(s.Fragment,{children:c7(r)});case H.Quantity:case H.Duration:return s.jsx(vc,{value:r});case H.Range:return s.jsx(mx,{value:r});case H.Ratio:return s.jsx(Z8,{value:r});case H.Reference:return s.jsx(Kd,{value:r,link:e.link});case H.Timing:return s.jsx(s.Fragment,{children:pT(r)});case H.Dosage:case H.UsageContext:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(Yd,{path:e.path,value:{type:n,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues});case H.Extension:if(!e.path)throw Error(`Displaying property of type ${e.propertyType} requires path`);return s.jsx(iz,{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(Yd,{path:e.path,value:{type:t.type[0].code,value:r},compact:!0,ignoreMissingValues:e.ignoreMissingValues})}}const XT=["extension","modifierExtension"],sz=qT.filter(e=>!XT.includes(e));function Yd(e){const t=e.value,{value:n,type:r}=t,o=p.useContext(sn),i=e.profileUrl??(o==null?void 0:o.profileUrl),a=p.useMemo(()=>ih(r,i),[i,r]),l=p.useMemo(()=>{if(a)return Oa({parentContext:o,elements:a.elements,path:e.path,profileUrl:a.url})},[a,e.path,o]);if(zt(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 hh(sn.Provider,l,s.jsx(hx,{compact:e.compact,children:Object.entries(c.elements).map(([u,d])=>{var v;if(XT.includes(u)&&zt((v=d.slicing)==null?void 0:v.slices))return null;if(sz.includes(u))return null;if(GT.includes(u)&&d.path.split(".").length===2||u.includes("."))return null;const[f,h]=eu(t,u,c.profileUrl);if((e.ignoreMissingValues||d.max===0)&&zt(f)||e.path.endsWith(".extension")&&(u==="url"||u==="id"))return null;const m=d.max>1||d.isArray,g=s.jsx(Hr,{property:d,propertyType:h,path:e.path+"."+u,value:f,ignoreMissingValues:e.ignoreMissingValues,includeArrayDescriptionListEntry:m,link:e.link},u);return m?g:s.jsx(Eo,{term:hs(u),children:g},u)})}))}function JT(e){const{debugMode:t}=p.useContext(sn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,s.jsxs(Z,{wrap:"nowrap","data-testid":e.testId,children:[s.jsx("div",{children:e.children}),s.jsx("div",{children:s.jsx(_t.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,children:null})})]})}function Ye(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 ZT((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(`
|
|
516
|
+
`)}function tu(e,t){var n;return(n=e==null?void 0:e.issue)==null?void 0:n.filter(r=>{var o;return ZT((o=r.expression)==null?void 0:o[0],t)})}const Bu=/\[\d+\]/;function ZT(e,t){const n=typeof e=="string"&&Bu.test(e),r=typeof t=="string"&&Bu.test(t);if(n!==r&&(e=e==null?void 0:e.replace(Bu,""),t=t==null?void 0:t.replace(Bu,"")),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 ut(e){const{debugMode:t}=p.useContext(sn);let n;return t&&e.fhirPath?n=`${e.title} - ${e.fhirPath}`:n=e.title,s.jsx(_t.Wrapper,{id:e.htmlFor,label:n,description:e.description,withAsterisk:e.withAsterisk,error:Ye(e.outcome,e.errorExpression??e.htmlFor),"data-testid":e.testId,children:e.children})}function ek(e,t,n,r,o){const i=r.type;if(i.length>1)for(const a of i){const l=t.replace("[x]",Wt(a.code));l in e&&delete e[l]}return e[n]=o,e}function az(e){return!!e&&!zt(e.url)&&!zt(e.name)}function lz(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=uz(f);u(h),n&&n(h)}return s.jsx(dx,{defaultValue:c&&cz(c),onChange:d,withHelpText:r??!0,...l})}function cz(e){var t;return(t=e.coding)==null?void 0:t.map(n=>({system:n.system,code:n.code,display:n.display}))}function uz(e){if(e.length!==0)return{coding:e.map(t=>({system:t.system,code:t.code,display:t.display}))}}function tk(e){const{defaultValue:t,onChange:n,withHelpText:r,...o}=e,[i,a]=p.useState(t);function l(c){const u=c[0],d=u&&fz(u);a(d),n&&n(d)}return s.jsx(dx,{defaultValue:i&&dz(i),maxValues:1,onChange:l,withHelpText:r??!0,...o})}function dz(e){return{system:e.system,code:e.code,display:e.display}}function fz(e){return{system:e.system,code:e.code,display:e.display}}function nk(e){const{path:t,outcome:n}=e,{elementsByPath:r}=p.useContext(sn),[o,i]=p.useState(e.defaultValue),a=p.useRef();a.current=o;const[l,c,u]=p.useMemo(()=>["system","use","value"].map(v=>r[t+"."+v]),[r,t]);function d(v){v&&Object.keys(v).length===0&&(v=void 0),i(v),e.onChange&&e.onChange(v)}function f(v){const S={...a.current,system:v};v||delete S.system,d(S)}function h(v){const S={...a.current,use:v};v||delete S.use,d(S)}function m(v){const S={...a.current,value:v};v||delete S.value,d(S)}const g=e.valuePath??t;return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(Et,{"data-testid":"system",defaultValue:o==null?void 0:o.system,required:((l==null?void 0:l.min)??0)>0,onChange:v=>f(v.currentTarget.value),data:["","email","phone","fax","pager","sms","other"],error:Ye(n,g+".system")}),s.jsx(Et,{"data-testid":"use",defaultValue:o==null?void 0:o.use,required:((c==null?void 0:c.min)??0)>0,onChange:v=>h(v.currentTarget.value),data:["","home","work","temp","old","mobile"],error:Ye(n,g+".use")}),s.jsx(de,{placeholder:"Value",defaultValue:o==null?void 0:o.value,required:((u==null?void 0:u.min)??0)>0,onChange:v=>m(v.currentTarget.value),error:Ye(n,g+".value")})]})}function hz(e){var l;const[t,n]=p.useState(e.defaultValue),r=p.useRef();r.current=t;function o(c){n(c),e.onChange&&e.onChange(c)}function i(c){const u={...r.current,name:c};c||delete u.name,o(u)}function a(c){const u={...r.current,telecom:c&&[c]};c||delete u.telecom,o(u)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(de,{"data-testid":e.name+"-name",name:e.name+"-name",placeholder:"Name",style:{width:180},defaultValue:t==null?void 0:t.name,onChange:c=>i(c.currentTarget.value)}),s.jsx(nk,{name:e.name+"-telecom",path:e.path+".telecom",defaultValue:(l=t==null?void 0:t.telecom)==null?void 0:l[0],onChange:a,outcome:e.outcome})]})}function pz(e){if(!e)return"";const t=new Date(e);return ah(t)?t.toLocaleDateString("sv")+"T"+t.toLocaleTimeString("sv"):""}function rk(e){if(!e)return"";const t=new Date(e);return ah(t)?t.toISOString():""}var mz={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.1.6-ca2e13ea4",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function ps(e){return s.jsx(de,{id:e.name,name:e.name,label:e.label,"data-autofocus":e.autoFocus,"data-testid":e.name,placeholder:e.placeholder,required:e.required,type:gz(),defaultValue:pz(e.defaultValue),autoFocus:e.autoFocus,error:Ye(e.outcome,e.name),onChange:t=>{if(e.onChange){const n=t.currentTarget.value;e.onChange(rk(n))}}})}function gz(){return mz.NODE_ENV==="test"?"text":"datetime-local"}function vz(e){const{propertyType:t}=e,n=oe(),[r,o]=p.useState(),i=p.useMemo(()=>{if(Ft(t.profile))return t.profile[0]},[t]),[a,l]=p.useState(i!==void 0);return p.useEffect(()=>{i&&(l(!0),n.requestProfileSchema(i).then(()=>{const c=Rs(i);l(!1),o(c)}).catch(c=>{l(!1),console.warn(c)}))},[n,i]),i&&(a||!Hy(i))?s.jsx("div",{children:"Loading..."}):s.jsx(xx,{profileUrl:i,path:e.path,typeName:(r==null?void 0:r.name)??"Extension",defaultValue:e.defaultValue,onChange:e.onChange})}function yz(e){var h,m,g;const{outcome:t,path:n}=e,[r,o]=p.useState(e.defaultValue);function i(v){o(v),e.onChange&&e.onChange(v)}function a(v){i({...r,use:v||void 0})}function l(v){i({...r,prefix:v?v.split(" "):void 0})}function c(v){i({...r,given:v?v.split(" "):void 0})}function u(v){i({...r,family:v||void 0})}function d(v){i({...r,suffix:v?v.split(" "):void 0})}const f=e.valuePath??n;return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Et,{defaultValue:r==null?void 0:r.use,name:e.name+"-use","data-testid":"use",onChange:v=>a(v.currentTarget.value),data:["","temp","old","usual","official","nickname","anonymous","maiden"],error:Ye(t,f+".use")}),s.jsx(de,{placeholder:"Prefix",name:e.name+"-prefix",defaultValue:(h=r==null?void 0:r.prefix)==null?void 0:h.join(" "),onChange:v=>l(v.currentTarget.value),error:Ye(t,f+".prefix")}),s.jsx(de,{placeholder:"Given",name:e.name+"-given",defaultValue:(m=r==null?void 0:r.given)==null?void 0:m.join(" "),onChange:v=>c(v.currentTarget.value),error:Ye(t,f+".given")}),s.jsx(de,{name:e.name+"-family",placeholder:"Family",defaultValue:r==null?void 0:r.family,onChange:v=>u(v.currentTarget.value),error:Ye(t,f+".family")}),s.jsx(de,{placeholder:"Suffix",name:e.name+"-suffix",defaultValue:(g=r==null?void 0:r.suffix)==null?void 0:g.join(" "),onChange:v=>d(v.currentTarget.value),error:Ye(t,f+".suffix")})]})}function xz(e){const[t,n]=p.useState(e.defaultValue),{elementsByPath:r}=p.useContext(sn),[o,i]=p.useMemo(()=>["system","value"].map(c=>r[e.path+"."+c]),[r,e.path]);function a(c){n(c),e.onChange&&e.onChange(c)}const l=e.valuePath??e.path;return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(de,{placeholder:"System",required:((o==null?void 0:o.min)??0)>0,defaultValue:t==null?void 0:t.system,onChange:c=>a({...t,system:c.currentTarget.value}),error:Ye(e.outcome,l+".system")}),s.jsx(de,{placeholder:"Value",required:((i==null?void 0:i.min)??0)>0,defaultValue:t==null?void 0:t.value,onChange:c=>a({...t,value:c.currentTarget.value}),error:Ye(e.outcome,l+".value")})]})}const wz=["USD","EUR","CAD","GBP","AUD"];function Sz(e){var c;const{onChange:t}=e,[n,r]=p.useState(e.defaultValue),o=p.useCallback(u=>{r(u),t&&t(u)},[t]),i=p.useCallback(u=>{o({...n,currency:u.currentTarget.value})},[n,o]),a=p.useCallback(u=>{o({...n,value:u.currentTarget.valueAsNumber})},[n,o]),l=s.jsx(Et,{defaultValue:n==null?void 0:n.currency,data:wz,styles:{input:{fontWeight:500,borderTopLeftRadius:0,borderBottomLeftRadius:0,width:92}},onChange:i});return s.jsx(de,{type:"number",name:e.name,label:e.label,placeholder:e.placeholder??"Value",defaultValue:((c=n==null?void 0:n.value)==null?void 0:c.toString())??"USD",leftSection:s.jsx(CF,{size:14}),rightSection:l,rightSectionWidth:92,onChange:a})}function bz(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ps,{name:e.name+".start",placeholder:"Start",defaultValue:t==null?void 0:t.start,onChange:o=>r({...t,start:o})}),s.jsx(ps,{name:e.name+".end",placeholder:"End",defaultValue:t==null?void 0:t.end,onChange:o=>r({...t,end:o})})]})}function ms(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(Et,{style:{width:80},"data-testid":e.name+"-comparator",defaultValue:t==null?void 0:t.comparator,data:["","<","<=",">=",">"],onChange:o=>r({...t,comparator:o.currentTarget.value})}),s.jsx(de,{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:o=>{e.disableWheel&&o.currentTarget.blur()},onChange:o=>{r({...t,value:jz(o.currentTarget.value)})}}),s.jsx(de,{placeholder:"Unit","data-testid":e.name+"-unit",defaultValue:t==null?void 0:t.unit,onChange:o=>r({...t,unit:o.currentTarget.value})})]})}function jz(e){if(e)return parseFloat(e)}function vx(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ms,{name:e.name+"-low",defaultValue:t==null?void 0:t.low,onChange:o=>r({...t,low:o})}),s.jsx(ms,{name:e.name+"-high",defaultValue:t==null?void 0:t.high,onChange:o=>r({...t,high:o})})]})}function Cz(e){const[t,n]=p.useState(e.defaultValue);function r(o){n(o),e.onChange&&e.onChange(o)}return s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(ms,{name:e.name+"-numerator",defaultValue:t==null?void 0:t.numerator,onChange:o=>r({...t,numerator:o})}),s.jsx(ms,{name:e.name+"-denominator",defaultValue:t==null?void 0:t.denominator,onChange:o=>r({...t,denominator:o})})]})}const Ez={Device:"device-name",Observation:"code",User:"email:contains"},Pz=["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 Tz(e){return{value:vt(e),label:No(e),resource:e}}function tl(e){const t=oe(),{resourceType:n,searchCriteria:r}=e,[o,i]=p.useState(),a=ft(e.defaultValue,i),l=e.onChange,c=p.useCallback(async(d,f)=>{const h=Rz(n),m=new URLSearchParams({[h]:d??"",_count:"10",...r});return await t.searchResources(n,m,{signal:f})},[t,n,r]),u=p.useCallback(d=>{l&&l(d[0])},[l]);return Ft(e.defaultValue)&&!o&&!a?null:s.jsx(ux,{name:e.name,required:e.required,itemComponent:kz,defaultValue:a,placeholder:e.placeholder,maxValues:1,toOption:Tz,loadOptions:c,onChange:u,clearable:!0})}const kz=p.forwardRef(({label:e,resource:t,...n},r)=>s.jsx("div",{ref:r,...n,children:s.jsxs(Z,{wrap:"nowrap",children:[s.jsx(Oi,{value:t}),s.jsxs("div",{children:[s.jsx(ue,{children:e}),s.jsx(ue,{size:"xs",c:"dimmed",children:t.birthDate})]})]})}));function Rz(e){return Ez[e]??(Pz.includes(e)?"name":"_id")}function ph(e){const{onChange:t}=e,n=oe(),[r,o]=p.useState(e.defaultValue),[i,a]=p.useState(()=>_z(e.targetTypes)),[l,c]=p.useState(()=>Dz(e.defaultValue,i)),u=p.useRef(new ET),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(!Az(v))return Promise.resolve(v);m=!0;const S=v.value,y=u.current.get(S);if(y)return y;const w=Iz(n,v.value).then(b=>{const C={...v};return b?Ft(b.type)?(C.resourceType=b.type,C.name=b.name,C.title=b.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(b=>(console.error(b),{...v,error:b})),x=new Ir(w);return u.current.set(S,x),x});!g||!m||Promise.all(g).then(v=>{if(a(v),!l)return;const S=v.findIndex(y=>y.value===l.value||y.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?gt(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(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[i&&i.length>1&&s.jsx(Et,{"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(fx,{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(tl,{resourceType:l==null?void 0:l.resourceType,name:e.name+"-id",required:e.required,placeholder:e.placeholder,defaultValue:r,searchCriteria:d,onChange:f})]})}function _z(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 Dz(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 Iz(e,t){const n=Rs(t);if(n)return{type:n.type,name:n.name,title:n.title};const r=`{
|
|
517
|
+
StructureDefinitionList(url: "${t}", _sort: "_lastUpdated", _count: 1) {
|
|
518
|
+
type,
|
|
519
|
+
name,
|
|
520
|
+
title,
|
|
521
|
+
}
|
|
522
|
+
}`.replace(/\s+/g," ");return(await e.graphql(r)).data.StructureDefinitionList[0]}function Az(e){return e.type==="profile"&&!(e!=null&&e.error)&&zt(e.resourceType)}const Nz="_indented_ldk1d_1",ok={indented:Nz};function ik({propertyDisplayName:e,onClick:t,testId:n}){const r=e?`Add ${e}`:"Add";return e?s.jsx(re,{title:r,size:"sm",color:"green.6",variant:"subtle","data-testid":n,leftSection:s.jsx(Gd,{size:"1.25rem"}),onClick:t,children:r}):s.jsx(Zt,{title:r,color:"green.6","data-testid":n,onClick:t,children:s.jsx(Gd,{size:"1.25rem"})})}function sk({propertyDisplayName:e,onClick:t,testId:n}){return s.jsx(Zt,{title:e?`Remove ${e}`:"Remove",color:"red.5","data-testid":n,variant:"subtle",onClick:t,children:s.jsx(qd,{size:"1.25rem"})})}function Mz(e){var h,m;const{slice:t,property:n}=e,[r,o]=p.useState(e.defaultValue),i=((h=t.typeSchema)==null?void 0:h.elements)??t.elements,a=p.useContext(sn),l=p.useMemo(()=>{var g;if(Ft(i))return Oa({parentContext:a,elements:i,path:e.path,profileUrl:(g=t.typeSchema)==null?void 0:g.url})},[a,e.path,(m=t.typeSchema)==null?void 0:m.url,i]);function c(g){o(g),e.onChange&&e.onChange(g)}const u=t.min>0,d=zt(t.elements),f=vT(t.name);return hh(sn.Provider,l,s.jsx(ut,{title:f,description:t.definition,withAsterisk:u,fhirPath:`${n.path}:${t.name}`,testId:e.testId,children:s.jsxs(De,{className:d?ok.indented:void 0,children:[r.map((g,v)=>s.jsxs(Z,{wrap:"nowrap",children:[s.jsx("div",{style:{flexGrow:1},"data-testid":e.testId&&`${e.testId}-elements-${v}`,children:s.jsx(yx,{elementDefinitionType:t.type[0],name:t.name,defaultValue:g,onChange:S=>{const y=[...r];y[v]=S,c(y)},outcome:e.outcome,min:t.min,max:t.max,binding:t.binding,path:e.path,valuePath:void 0})}),r.length>t.min&&s.jsx(sk,{propertyDisplayName:f,testId:e.testId&&`${e.testId}-remove-${v}`,onClick:S=>{at(S);const y=[...r];y.splice(v,1),c(y)}})]},`${v}-${r.length}`)),r.length<t.max&&s.jsx(Z,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(ik,{propertyDisplayName:f,onClick:g=>{at(g);const v=[...r,void 0];c(v)},testId:e.testId&&`${e.testId}-add`})})]})}))}function Oz(e,t,n){return t===void 0?e:n===void 0?t:`${t}[${n}]`}function $z(e){var y;const{property:t}=e,n=oe(),[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(sn),f=(y=t.type[0])==null?void 0:y.code;p.useEffect(()=>{YT({medplum:n,property:t}).then(w=>{a(w);const x=KT(l,w,t.slicing,d.profileUrl);Lz(x,w),u(x),o(!1)}).catch(w=>{console.error(w),o(!1)})},[n,t,l,d.profileUrl,u]);function h(w,x){const b=[...c];if(b[x]=w,u(b),e.onChange){const C=b.flat().filter(E=>E!==void 0);e.onChange(C)}}if(r)return s.jsx("div",{children:"Loading..."});const m=i.length,g=c[m],v=!(e.hideNonSliceValues??(f==="Extension"&&i.length>0)),S=hs(t.path);return s.jsxs(De,{className:e.indent?ok.indented:void 0,children:[i.map((w,x)=>s.jsx(Mz,{slice:w,path:e.path,valuePath:e.valuePath,property:t,defaultValue:c[x],onChange:b=>{h(b,x)},testId:`slice-${w.name}`},w.name)),v&&g.map((w,x)=>s.jsxs(Z,{wrap:"nowrap",style:{flexGrow:1},children:[s.jsx("div",{style:{flexGrow:1},children:s.jsx(nl,{arrayElement:!0,property:e.property,name:e.name+"."+x,path:e.path,valuePath:Oz(e.path,e.valuePath,x),defaultValue:w,onChange:b=>{const C=[...g];C[x]=b,h(C,m)},defaultPropertyType:void 0,outcome:e.outcome})}),s.jsx(sk,{propertyDisplayName:S,testId:`nonsliced-remove-${x}`,onClick:b=>{at(b);const C=[...g];C.splice(x,1),h(C,m)}})]},`${x}-${g.length}`)),v&&c.flat().length<t.max&&s.jsx(Z,{wrap:"nowrap",style:{justifyContent:"flex-start"},children:s.jsx(ik,{propertyDisplayName:S,onClick:w=>{at(w);const x=[...g];x.push(void 0),h(x,m)},testId:"nonsliced-add"})})]})}function Lz(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 Fz(e){const[t,n]=p.useState(!1),r=fb(),o=p.useRef(null),i={...e.styles};return t||(i.input||(i.input={}),i.input.WebkitTextSecurity="disc"),s.jsxs(us,{gap:"xs",children:[s.jsx(Ps,{...e,styles:{...i,root:{...i.root??{},flexGrow:1}},ref:o,autosize:!0,minRows:1,onFocus:()=>n(!0),onBlur:()=>n(!1)}),s.jsx(Zt,{title:"Copy secret",onClick:()=>{var a;r.copy((a=o.current)==null?void 0:a.value),ve({color:"green",message:"Copied"})},children:s.jsx($T,{})})]})}const zz=["sun","mon","tue","wed","thu","fri","sat"];function Vz(e){const[t,n]=p.useState(e.defaultValue),[r,o]=p.useState(!1),i=p.useRef();return i.current=t,s.jsxs(s.Fragment,{children:[s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx("span",{children:pT(i.current)||"No repeat"}),s.jsx(re,{onClick:()=>o(!0),children:"Edit"})]}),s.jsx(Bz,{visible:r,defaultValue:i.current,onOk:a=>{e.onChange&&e.onChange(a),n(a),o(!1)},onCancel:()=>o(!1)})]})}const Hw={repeat:{period:1,periodUnit:"d"}};function Bz(e){const[t,n]=p.useState(e.defaultValue||Hw),r=p.useRef();r.current=t;function o(u){n({...r.current,event:[u]})}function i(u){n({...r.current,repeat:u})}function a(u){var d;i({...(d=r.current)==null?void 0:d.repeat,period:u})}function l(u){var d;i({...(d=r.current)==null?void 0:d.repeat,periodUnit:u})}function c(u){var d;i({...(d=r.current)==null?void 0:d.repeat,dayOfWeek:u})}return s.jsx(Cn,{title:"Timing",closeButtonProps:{"aria-label":"Close"},opened:e.visible,onClose:()=>e.onCancel(),children:s.jsxs(De,{children:[s.jsx(ut,{title:"Starts on",htmlFor:"timing-dialog-start",children:s.jsx(ps,{name:"timing-dialog-start",onChange:u=>o(u)})}),s.jsx(Bc,{label:"Repeat",checked:!!t.repeat,onChange:u=>i(u.currentTarget.checked?Hw.repeat:void 0)}),t.repeat&&s.jsxs(s.Fragment,{children:[s.jsx(ut,{title:"Repeat every",htmlFor:"timing-dialog-period",children:s.jsxs(Z,{gap:"xs",grow:!0,wrap:"nowrap",children:[s.jsx(de,{type:"number",step:1,id:"timing-dialog-period",name:"timing-dialog-period",defaultValue:t.repeat.period||1,onChange:u=>a(parseInt(u.currentTarget.value,10)||1)}),s.jsx(Et,{id:"timing-dialog-periodUnit",name:"timing-dialog-periodUnit",defaultValue:t.repeat.periodUnit,onChange:u=>l(u.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(ut,{title:"Repeat on",children:s.jsx(lc.Group,{multiple:!0,onChange:c,children:s.jsx(Z,{justify:"space-between",mt:"md",gap:"xs",children:zz.map(u=>s.jsx(lc,{value:u,size:"xs",radius:"xl",children:u.charAt(0).toUpperCase()},u))})})})]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(re,{onClick:()=>e.onOk(t),children:"OK"})})]})})}function nl(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===H.Attachment)return s.jsx(Q8,{name:n,defaultValue:o,onChange:r});const c=((l=a[0])==null?void 0:l.code)!==H.Extension;return s.jsx($z,{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(Uz,{elementDefinitionTypes:a,...e}):s.jsx(yx,{name:n,defaultValue:o,onChange:c=>{if(e.onChange){const u=e.name.replace("[x]",Wt(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})}function Uz(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(Z,{gap:"xs",grow:!0,wrap:"nowrap",align:"flex-start",children:[s.jsx(Et,{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(yx,{name:e.name,defaultValue:e.defaultValue,outcome:e.outcome,elementDefinitionType:r,onChange:i=>{e.onChange&&e.onChange(i,e.name.replace("[x]",Wt(r.code)))},min:e.property.min,max:e.property.max,binding:e.property.binding,path:e.property.path,valuePath:e.valuePath})]})}function yx(e){const{name:t,onChange:n,outcome:r,binding:o,path:i,valuePath:a}=e,l=e.min!==void 0&&e.min>0,c=e.elementDefinitionType.code,u=p.useContext(sn),d=p.useMemo(()=>{if(!Gy(c)||!zt(e.defaultValue))return e.defaultValue;const m=Object.create(null);if(u.path===e.path)Aw(m,u.elements);else{const g=fc(u.path,e.path);if(g===void 0)return e.defaultValue;Aw(m,u.elements,g)}return Ft(m)?m:e.defaultValue},[c,u.path,u.elements,e.path,e.defaultValue]);if(!c)return s.jsx("div",{children:"Property type not specified "});function f(){return{name:t,defaultValue:d,onChange:n,outcome:r,path:i,valuePath:a}}function h(){const m=Ye(e.outcome,a??i);return{id:t,name:t,"data-testid":t,defaultValue:d,required:l,error:m}}switch(c){case H.SystemString:case H.canonical:case H.string:case H.time:case H.uri:case H.url:return e.path==="Project.secret.value[x]"?s.jsx(Fz,{...h(),onChange:m=>{e.onChange&&e.onChange(m.currentTarget.value)}}):s.jsx(de,{...h(),onChange:m=>{n&&n(m.currentTarget.value)}});case H.date:return s.jsx(de,{...h(),type:"date",onChange:m=>{n&&n(m.currentTarget.value)}});case H.dateTime:case H.instant:return s.jsx(ps,{name:t,defaultValue:d,onChange:n,outcome:r});case H.decimal:case H.integer:case H.positiveInt:case H.unsignedInt:return s.jsx(de,{...h(),type:"number",step:c===H.decimal?"any":"1",onChange:m=>{if(n){const g=m.currentTarget.valueAsNumber;n(Number.isNaN(g)?void 0:g)}}});case H.code:return s.jsx(HT,{...h(),error:void 0,onChange:n,binding:o==null?void 0:o.valueSet});case H.boolean:return s.jsx(Cr,{...h(),defaultChecked:!!d,onChange:m=>{n&&n(m.currentTarget.checked)}});case H.base64Binary:case H.markdown:return s.jsx(Ps,{...h(),spellCheck:c!==H.base64Binary,onChange:m=>{n&&n(m.currentTarget.value)}});case H.Address:return s.jsx(lF,{...f()});case H.Annotation:return s.jsx(cF,{...f()});case H.Attachment:return s.jsx(WT,{...f()});case H.CodeableConcept:return s.jsx(lz,{binding:o==null?void 0:o.valueSet,...f()});case H.Coding:return s.jsx(tk,{binding:o==null?void 0:o.valueSet,...f()});case H.ContactDetail:return s.jsx(hz,{...f()});case H.ContactPoint:return s.jsx(nk,{...f()});case H.Extension:return s.jsx(vz,{...f(),propertyType:e.elementDefinitionType});case H.HumanName:return s.jsx(yz,{...f()});case H.Identifier:return s.jsx(xz,{...f()});case H.Money:return s.jsx(Sz,{...f()});case H.Period:return s.jsx(bz,{...f()});case H.Duration:case H.Quantity:return s.jsx(ms,{...f()});case H.Range:return s.jsx(vx,{...f()});case H.Ratio:return s.jsx(Cz,{...f()});case H.Reference:return s.jsx(ph,{...f(),targetTypes:Wz(e.elementDefinitionType)});case H.Timing:return s.jsx(Vz,{...f()});case H.Dosage:case H.UsageContext:default:return s.jsx(xx,{...f(),typeName:c})}}const Hz=[`${y$}/fhir/StructureDefinition/`,"https://medplum.com/fhir/StructureDefinition/"];function Wz(e){var t;return(t=e==null?void 0:e.targetProfile)==null?void 0:t.map(n=>{const r=Hz.find(o=>n.startsWith(o));return r?n.slice(r.length):n})}function qz(e){const[t,n]=p.useState(e.defaultValue??{}),r=p.useContext(sn),o=p.useMemo(()=>tz(r.elements),[r.elements]);function i(l){n(l),e.onChange&&e.onChange(l)}const a={type:e.type,value:t};return s.jsx(De,{style:{flexGrow:1},"data-testid":e.testId,children:o.map(([l,c])=>{const[u,d]=oz(a,l,c),f=c.min!==void 0&&c.min>0,h=e.valuePath?e.valuePath+"."+l:void 0,m=s.jsx(nl,{property:c,name:l,path:e.path+"."+l,valuePath:h,defaultValue:u,defaultPropertyType:d,onChange:(g,v)=>{i(ek({...t},l,v??l,c,g))},outcome:e.outcome},l);return e.type==="Extension"||gx.includes(l)?m:c.type.length===1&&c.type[0].code==="boolean"?s.jsx(JT,{title:hs(l),description:c.description,htmlFor:l,fhirPath:c.path,withAsterisk:f,children:m},l):s.jsx(ut,{title:hs(l),description:c.description,withAsterisk:f,htmlFor:l,outcome:e.outcome,fhirPath:c.path,errorExpression:h,children:m},l)})})}function xx(e){const[t]=p.useState(()=>e.defaultValue??{}),n=p.useContext(sn),r=e.profileUrl??(n==null?void 0:n.profileUrl),o=p.useMemo(()=>ih(e.typeName,r),[e.typeName,r]),i=(o==null?void 0:o.type)??e.typeName,a=p.useMemo(()=>{if(o)return Oa({parentContext:n,elements:o.elements,path:e.path,profileUrl:o.url})},[o,e.path,n]);return o?hh(sn.Provider,a,s.jsx(qz,{path:e.path,valuePath:e.valuePath,type:i,defaultValue:t,onChange:e.onChange,outcome:e.outcome})):s.jsxs("div",{children:[i," not implemented"]})}const Gz="_root_1vii2_1",Qz={root:Gz};function nu(e){const{children:t,...n}=e;return s.jsx(ly,{className:Qz.root,...n,children:t})}const Kz="_noteBody_10swh_1",Yz="_noteCite_10swh_5",Xz="_noteRoot_10swh_10",Ww={noteBody:Kz,noteCite:Yz,noteRoot:Xz};function ak({value:e}){return e?s.jsx(De,{justify:"flex-start",gap:"xs",children:e.map(t=>{var n;return t.text&&s.jsx(iy,{classNames:{cite:Ww.noteCite,root:Ww.noteRoot},cite:((n=t.authorReference)==null?void 0:n.display)||t.authorString,icon:null,children:t.text},`note-${t.text}`)})}):null}function rl(e){const{value:t,link:n,...r}=e,[o,i]=p.useState(),a=ft(t,i);let l;if(o&&!GP(o))l=`[${Ae(o)}]`;else if(a)l=No(a);else return null;return n?s.jsx(We,{to:t,...r,children:l}):s.jsx(ue,{component:"span",...r,children:l})}function ba(e){return s.jsxs(Z,{gap:"xs",children:[s.jsx(Oi,{size:24,radius:12,value:e.value,link:e.link}),s.jsx(rl,{value:e.value,link:e.link})]})}const Jz={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 wx(e){return s.jsx($c,{color:Jz[e.status],children:e.status})}const Zz="_table_pe9td_1",eV="_criticalRow_pe9td_12",tV="_noteBody_pe9td_23",nV="_noteCite_pe9td_27",rV="_noteRoot_pe9td_32",lk={table:Zz,criticalRow:eV,noteBody:tV,noteCite:nV,noteRoot:rV};Sx.defaultProps={hideObservationNotes:!1,hideSpecimenInfo:!1};function Sx(e){var a;const t=oe(),n=ft(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(De,{children:[s.jsx(ce,{children:"Diagnostic Report"}),s.jsx(oV,{value:n}),r&&!e.hideSpecimenInfo&&iV(r),n.result&&s.jsx(sV,{hideObservationNotes:e.hideObservationNotes,value:n.result}),i.length>0&&s.jsx(ak,{value:i})]})}function oV({value:e}){var t,n;return s.jsxs(Z,{mt:"md",gap:30,children:[e.subject&&s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Subject"}),s.jsx(ba,{value:e.subject,link:!0})]}),(t=e.resultsInterpreter)==null?void 0:t.map(r=>s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Interpreter"}),s.jsx(ba,{value:r,link:!0})]},r.reference)),(n=e.performer)==null?void 0:n.map(r=>s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Performer"}),s.jsx(ba,{value:r,link:!0})]},r.reference)),e.issued&&s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Issued"}),s.jsx(ue,{children:Nn(e.issued)})]}),e.status&&s.jsxs("div",{children:[s.jsx(ue,{size:"xs",tt:"uppercase",c:"dimmed",children:"Status"}),s.jsx(ue,{children:Wt(e.status)})]})]})}function iV(e){return s.jsxs(De,{gap:"xs",children:[s.jsx(ce,{order:2,size:"h6",children:"Specimens"}),s.jsx(Dn,{type:"ordered",children:e==null?void 0:e.map(t=>{var n;return s.jsx(Dn.Item,{ml:"sm",children:s.jsxs(Z,{gap:20,children:[s.jsxs(Z,{gap:5,children:[s.jsx(ue,{fw:500,children:"Collected:"})," ",Nn((n=t.collection)==null?void 0:n.collectedDateTime)]}),s.jsxs(Z,{gap:5,children:[s.jsx(ue,{fw:500,children:"Received:"})," ",Nn(t.receivedTime)]})]})},`specimen-${t.id}`)})})]})}function sV(e){return s.jsxs("table",{className:lk.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(ck,{value:e.value,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes})})]})}function ck(e){var t;return s.jsx(s.Fragment,{children:(t=e.value)==null?void 0:t.map(n=>s.jsx(aV,{value:n,ancestorIds:e.ancestorIds,hideObservationNotes:e.hideObservationNotes},`obs-${Is(n)?n.reference:n.id}`))})}function aV(e){var o,i;const t=ft(e.value);if(!t||(o=e.ancestorIds)!=null&&o.includes(t.id))return null;const n=!e.hideObservationNotes&&t.note,r=uV(t);return s.jsxs(s.Fragment,{children:[s.jsxs("tr",{className:nt({[lk.criticalRow]:r}),children:[s.jsx("td",{rowSpan:n?2:1,children:s.jsx(We,{to:t,children:s.jsx(lo,{value:t.code})})}),s.jsx("td",{children:s.jsx(lV,{value:t})}),s.jsx("td",{children:s.jsx(cV,{value:t.referenceRange})}),s.jsx("td",{children:t.interpretation&&t.interpretation.length>0&&s.jsx(lo,{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(lo,{value:a})},`category-${Ri(a)}`))})}),s.jsx("td",{children:(i=t.performer)==null?void 0:i.map(a=>s.jsx(Kd,{value:a},a.reference))}),s.jsx("td",{children:t.status&&s.jsx(wx,{status:t.status})})]}),t.hasMember&&s.jsx(ck,{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(ak,{value:t.note})})})]})}function lV(e){const t=e.value;return s.jsx(s.Fragment,{children:mT(t)})}function cV(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(mx,{value:t}):null}function uV(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 dV="_paper_1igaj_1",fV="_fill_1igaj_20",qw={paper:dV,fill:fV};function bx(e){const{width:t,fill:n,className:r,children:o,...i}=e,a=t?{maxWidth:t}:void 0;return s.jsx(Wn,{className:nt(qw.paper,n&&qw.fill,r),style:a,shadow:"sm",radius:"sm",withBorder:!0,...i,children:o})}var uk={},ru={};Object.defineProperty(ru,"__esModule",{value:!0});ru.Pointer=void 0;function hV(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function pV(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}var mV=function(){function e(t){t===void 0&&(t=[""]),this.tokens=t}return e.fromJSON=function(t){var n=t.split("/").map(hV);if(n[0]!=="")throw new Error("Invalid JSON Pointer: ".concat(t));return new e(n)},e.prototype.toString=function(){return this.tokens.map(pV).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}();ru.Pointer=mV;var $t={},jx={};(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})(jx);var _n={};Object.defineProperty(_n,"__esModule",{value:!0});_n.diffAny=_n.diffObjects=_n.diffArrays=_n.intersection=_n.subtract=_n.isDestructive=void 0;var yc=jx;function gV(e){var t=e.op;return t==="remove"||t==="replace"||t==="copy"||t==="move"}_n.isDestructive=gV;function Xm(e,t){var n={};for(var r in e)yc.hasOwnProperty.call(e,r)&&e[r]!==void 0&&(n[r]=1);for(var o in t)yc.hasOwnProperty.call(t,o)&&t[o]!==void 0&&delete n[o];return Object.keys(n)}_n.subtract=Xm;function dk(e){for(var t=e.length,n={},r=0;r<t;r++){var o=e[r];for(var i in o)yc.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)}_n.intersection=dk;function vV(e){return e.op==="add"}function yV(e){return e.op==="remove"}function xp(e,t){return{operations:e.operations.concat(t),cost:e.cost+1}}function fk(e,t,n,r){r===void 0&&(r=mh);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(xp(v,S))}if(f>0){var y=i(d,f-1),w={op:"add",index:d-1,value:t[f-1]};g.push(xp(y,w))}if(d>0&&f>0){var x=i(d-1,f-1),b={op:"replace",index:d-1,original:e[d-1],value:t[f-1]};g.push(xp(x,b))}var C=g.sort(function(E,j){return E.cost-j.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(vV(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(yV(f)){var S={op:f.op,path:n.add(String(f.index+m)).toString()};return[h.concat(S),m-1]}else{var y=n.add(String(f.index+m)),w=r(f.original,f.value,y);return[h.concat.apply(h,w),m]}},[[],0])[0];return u}_n.diffArrays=fk;function hk(e,t,n,r){r===void 0&&(r=mh);var o=[];return Xm(e,t).forEach(function(i){o.push({op:"remove",path:n.add(i).toString()})}),Xm(t,e).forEach(function(i){o.push({op:"add",path:n.add(i).toString(),value:t[i]})}),dk([e,t]).forEach(function(i){o.push.apply(o,r(e[i],t[i],n.add(i)))}),o}_n.diffObjects=hk;function mh(e,t,n,r){if(r===void 0&&(r=mh),e===t)return[];var o=(0,yc.objectType)(e),i=(0,yc.objectType)(t);return o=="array"&&i=="array"?fk(e,t,n,r):o=="object"&&i=="object"?hk(e,t,n,r):[{op:"replace",path:n.toString(),value:t}]}_n.diffAny=mh;var Cx=qx&&qx.__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($t,"__esModule",{value:!0});$t.apply=$t.InvalidOperationError=$t.test=$t.copy=$t.move=$t.replace=$t.remove=$t.add=$t.TestError=$t.MissingError=void 0;var Oo=ru,Ex=jx,xV=_n,co=function(e){Cx(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);$t.MissingError=co;var pk=function(e){Cx(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);$t.TestError=pk;function Px(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 mk(e,t){if(Array.isArray(e)){var n=parseInt(t,10);e.splice(n,1)}else delete e[t]}function gk(e,t){var n=Oo.Pointer.fromJSON(t.path).evaluate(e);return n.parent===void 0?new co(t.path):(Px(n.parent,n.key,(0,Ex.clone)(t.value)),null)}$t.add=gk;function vk(e,t){var n=Oo.Pointer.fromJSON(t.path).evaluate(e);return n.value===void 0?new co(t.path):(mk(n.parent,n.key),null)}$t.remove=vk;function yk(e,t){var n=Oo.Pointer.fromJSON(t.path).evaluate(e);if(n.parent===null)return new co(t.path);if(Array.isArray(n.parent)){if(parseInt(n.key,10)>=n.parent.length)return new co(t.path)}else if(n.value===void 0)return new co(t.path);return n.parent[n.key]=(0,Ex.clone)(t.value),null}$t.replace=yk;function xk(e,t){var n=Oo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new co(t.from);var r=Oo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new co(t.path):(mk(n.parent,n.key),Px(r.parent,r.key,n.value),null)}$t.move=xk;function wk(e,t){var n=Oo.Pointer.fromJSON(t.from).evaluate(e);if(n.value===void 0)return new co(t.from);var r=Oo.Pointer.fromJSON(t.path).evaluate(e);return r.parent===void 0?new co(t.path):(Px(r.parent,r.key,(0,Ex.clone)(n.value)),null)}$t.copy=wk;function Sk(e,t){var n=Oo.Pointer.fromJSON(t.path).evaluate(e);return(0,xV.diffAny)(n.value,t.value,new Oo.Pointer).length?new pk(n.value,t.value):null}$t.test=Sk;var bk=function(e){Cx(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);$t.InvalidOperationError=bk;function wV(e,t){switch(t.op){case"add":return gk(e,t);case"remove":return vk(e,t);case"replace":return yk(e,t);case"move":return xk(e,t);case"copy":return wk(e,t);case"test":return Sk(e,t)}return new bk(t)}$t.apply=wV;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createTests=e.createPatch=e.applyPatch=e.Pointer=void 0;var t=ru;Object.defineProperty(e,"Pointer",{enumerable:!0,get:function(){return t.Pointer}});var n=$t,r=_n;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})(uk);const SV="_root_w6lfx_1",bV="_removed_w6lfx_16",jV="_added_w6lfx_21",wp={root:SV,removed:bV,added:jV};function CV(e){const t=oe(),{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=[fo(n)],c=[fo(r)],u=[],d=EV(uk.createPatch(n,r));for(const f of d){const h=f.path,m=PV(h),g=TV(n.resourceType,m),v=f.op==="add"?void 0:gc(m,l),S=f.op==="remove"?void 0:gc(m,c);u.push({key:`op-${f.op}-${f.path}`,name:`${Wt(f.op)} ${m}`,path:(g==null?void 0:g.path)??n.resourceType+"."+m,property:g,originalValue:Gw(g,v),revisedValue:Gw(g,S)})}return u},[o,n,r]);return a?s.jsxs(le,{className:wp.root,children:[s.jsx(le.Thead,{children:s.jsxs(le.Tr,{children:[s.jsx(le.Th,{}),s.jsx(le.Th,{children:"Before"}),s.jsx(le.Th,{children:"After"})]})}),s.jsx(le.Tbody,{children:a.map(l=>s.jsxs(le.Tr,{children:[s.jsx(le.Td,{children:l.name}),s.jsx(le.Td,{className:wp.removed,children:l.originalValue&&s.jsx(Hr,{path:l.path,property:l.property,propertyType:l.originalValue.type,value:l.originalValue.value,ignoreMissingValues:!0})}),s.jsx(le.Td,{className:wp.added,children:l.revisedValue&&s.jsx(Hr,{path:l.path,property:l.property,propertyType:l.revisedValue.type,value:l.revisedValue.value,ignoreMissingValues:!0})})]},l.key))})]}):null}function EV(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 PV(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 TV(e,t){var r;const n=lh(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 Gw(e,t){return t&&{type:Array.isArray(t)?t[0].type:t.type,value:kV(t,!!(e!=null&&e.isArray))}}function kV(e,t){const n=e7(e).flatMap(r=>r.value);return t?n:n[0]}function Tx(e){const{profileUrl:t}=e,n=oe(),r=ft(e.value),[o,i]=p.useState();return p.useEffect(()=>{if(r)if(t)n.requestProfileSchema(t,{expandProfile:!0}).then(()=>{const a=Rs(t);a?i(a.name):console.error(`Schema not found for ${t}`)}).catch(a=>{console.error("Error in requestProfileSchema",a)});else{const a=r.resourceType;n.requestSchema(a).then(()=>{i(a)}).catch(console.error)}},[n,t,r]),!o||!r?null:s.jsx(Yd,{path:r.resourceType,value:{type:o,value:e.forceUseInput?e.value:r},profileUrl:t,ignoreMissingValues:e.ignoreMissingValues})}const RV="_item_5q6yx_1",_V="_itemPadding_5q6yx_5",Qw={item:RV,itemPadding:_V};function DV(e){return s.jsx(nu,{children:e.children})}function gs(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(bx,{"data-testid":"timeline-item",fill:!0,...i,children:[s.jsxs(Z,{justify:"space-between",gap:8,mx:"xs",my:"sm",children:[s.jsx(Oi,{value:a,link:!0,size:"md"}),s.jsxs("div",{style:{flex:1},children:[s.jsx(ue,{size:"sm",children:s.jsx(rl,{c:"dark",fw:500,value:a,link:!0})}),s.jsxs(ue,{size:"xs",children:[s.jsx(We,{c:"dimmed",to:e.resource,children:Nn(l)}),s.jsx(ue,{component:"span",c:"dimmed",mx:8,children:"·"}),s.jsx(We,{c:"dimmed",to:e.resource,children:e.resource.resourceType})]})]}),o&&s.jsxs(ne,{position:"bottom-end",shadow:"md",width:200,children:[s.jsx(ne.Target,{children:s.jsx(Zt,{color:"gray",variant:"subtle",radius:"xl","aria-label":`Actions for ${vt(e.resource)}`,children:s.jsx(PF,{})})}),o]})]}),s.jsx(VT,{children:s.jsx("div",{className:nt(Qw.item,{[Qw.itemPadding]:r}),children:e.children})})]})}function jk(e,t){e.sort((n,r)=>{const o=Kw(n,t),i=Kw(r,t);return o>i?1:o<i?-1:Yw(n,t)-Yw(r,t)})}function Kw(e,t){if(!Ck(e,t)){const n=e.priority;if(typeof n=="string")return{stat:4,asap:3,urgent:2}[n]??0}return 0}function Yw(e,t){var r;if(!Ck(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 Ck(e,t){return!!t&&e.resourceType===t.resourceType&&e.id===t.id}const IV="_pinnedComment_5uxzi_2",AV={pinnedComment:IV};function gh(e){const t=oe(),n=dh(),r=t.getProfile(),o=p.useRef(null),i=ft(e.value),[a,l]=p.useState(),[c,u]=p.useState([]),d=e.loadTimelineResources,f=p.useRef(c);f.current=c;const h=p.useCallback(D=>{jk(D,i),D.reverse(),u(D)},[i]),m=p.useCallback(D=>{const N=[];for(const A of D){if(A.status!=="fulfilled")continue;const L=A.value;if(L.type==="history"&&l(L),L.entry)for(const I of L.entry)N.push(I.resource)}h(N)},[h]),g=p.useCallback(D=>h([...f.current,D]),[h]),v=p.useCallback(()=>{var A;let D,N;"resourceType"in e.value?(D=e.value.resourceType,N=e.value.id):[D,N]=(A=e.value.reference)==null?void 0:A.split("/"),d(t,D,N).then(m).catch(console.error)},[t,e.value,d,m]);p.useEffect(()=>v(),[v]);function S(D){!i||!e.createCommunication||t.createResource(e.createCommunication(i,r,D)).then(N=>g(N)).catch(console.error)}function y(D){!i||!e.createMedia||t.createResource(e.createMedia(i,r,D)).then(N=>g(N)).then(()=>kl({id:"upload-notification",color:"teal",title:"Upload complete",message:"",icon:s.jsx(Yc,{size:16}),autoClose:2e3})).catch(N=>kl({id:"upload-notification",color:"red",title:"Upload error",message:Ae(N),icon:s.jsx(Lw,{size:16}),autoClose:2e3}))}function w(D,N){return t.updateResource({...D,priority:N})}function x(D){w(D,"stat").then(v).catch(console.error)}function b(D){w(D,"routine").then(v).catch(console.error)}function C(D){n(`/${D.resourceType}/${D.id}`)}function E(D){n(`/${D.resourceType}/${D.id}/edit`)}function j(D){n(`/${D.resourceType}/${D.id}/delete`)}function P(D){var N;n(`/${D.resourceType}/${D.id}/_history/${(N=D.meta)==null?void 0:N.versionId}`)}function _(){ve({id:"upload-notification",loading:!0,title:"Initializing upload...",message:"Please wait...",autoClose:!1,withCloseButton:!1})}function R(D){kl({id:"upload-notification",loading:!0,title:"Uploading...",message:zV(D),autoClose:!1,withCloseButton:!1})}function M(D){kl({id:"upload-notification",color:"red",title:"Upload error",message:Ae(D),icon:s.jsx(Lw,{size:16}),autoClose:2e3})}return i?s.jsxs(DV,{children:[e.createCommunication&&s.jsx(bx,{children:s.jsx(qe,{testid:"timeline-form",onSubmit:D=>{S(D.text);const N=o.current;N&&(N.value="",N.focus())},children:s.jsxs(Z,{gap:"xs",wrap:"nowrap",style:{width:"100%"},children:[s.jsx(Oi,{value:r}),s.jsx(de,{name:"text",ref:o,placeholder:"Add comment",style:{width:"100%",maxWidth:300}}),s.jsx(Zt,{type:"submit",radius:"xl",color:"blue",variant:"filled",children:s.jsx(OF,{size:16})}),s.jsx(px,{securityContext:gt(i),onUpload:y,onUploadStart:_,onUploadProgress:R,onUploadError:M,children:D=>s.jsx(Zt,{...D,radius:"xl",color:"blue",variant:"filled",children:s.jsx(sx,{size:16})})})]})})}),c.map(D=>{var A;if(!D)return null;const N=`${D.resourceType}/${D.id}/${(A=D.meta)==null?void 0:A.versionId}`;if(D.resourceType===i.resourceType&&D.id===i.id)return s.jsx(NV,{history:a,resource:D,onDetails:P},N);switch(D.resourceType){case"AuditEvent":return s.jsx(LV,{resource:D,onDetails:C},N);case"Communication":return s.jsx(OV,{resource:D,onPin:D.priority!=="stat"?x:void 0,onUnpin:D.priority==="stat"?b:void 0,onDetails:C,onEdit:E,onDelete:j},N);case"DiagnosticReport":return s.jsx(FV,{resource:D,onDetails:C,onEdit:E,onDelete:j},N);case"Media":return s.jsx($V,{resource:D,onDetails:C,onEdit:E,onDelete:j},N);default:return s.jsx(gs,{resource:D,padding:!0,children:s.jsx(Tx,{value:D,ignoreMissingValues:!0})},N)}})]}):s.jsx(dn,{style:{width:"100%",height:"100%"},children:s.jsx(Qn,{})})}function La(e){return s.jsxs(ne.Dropdown,{children:[s.jsx(ne.Label,{children:"Resource"}),e.onPin&&s.jsx(ne.Item,{leftSection:s.jsx(FF,{size:14}),onClick:()=>e.onPin(e.resource),"aria-label":`Pin ${vt(e.resource)}`,children:"Pin"}),e.onUnpin&&s.jsx(ne.Item,{leftSection:s.jsx(zF,{size:14}),onClick:()=>e.onUnpin(e.resource),"aria-label":`Unpin ${vt(e.resource)}`,children:"Unpin"}),e.onDetails&&s.jsx(ne.Item,{leftSection:s.jsx(IF,{size:14}),onClick:()=>e.onDetails(e.resource),"aria-label":`Details ${vt(e.resource)}`,children:"Details"}),e.onEdit&&s.jsx(ne.Item,{leftSection:s.jsx(TF,{size:14}),onClick:()=>e.onEdit(e.resource),"aria-label":`Edit ${vt(e.resource)}`,children:"Edit"}),e.onDelete&&s.jsxs(s.Fragment,{children:[s.jsx(ne.Divider,{}),s.jsx(ne.Label,{children:"Danger zone"}),s.jsx(ne.Item,{color:"red",leftSection:s.jsx(zT,{size:14}),onClick:()=>e.onDelete(e.resource),"aria-label":`Delete ${vt(e.resource)}`,children:"Delete"})]})]})}function NV(e){const t=MV(e.history,e.resource);return t?s.jsx(gs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(La,{...e}),children:s.jsx(CV,{original:t,revised:e.resource})}):s.jsxs(gs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(La,{...e}),children:[s.jsx("h3",{children:"Created"}),s.jsx(Tx,{value:e.resource,ignoreMissingValues:!0,forceUseInput:!0})]})}function MV(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 OV(e){var r,o;const n=!e.resource.priority||e.resource.priority==="routine"?void 0:AV.pinnedComment;return s.jsx(gs,{resource:e.resource,profile:e.resource.sender,dateTime:e.resource.sent,padding:!0,className:n,popupMenuItems:s.jsx(La,{...e}),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(gs,{resource:e.resource,padding:!!n,popupMenuItems:s.jsx(La,{...e}),children:s.jsx(Zc,{value:e.resource.content})})}function LV(e){return s.jsx(gs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(La,{...e}),children:s.jsx(Pr,{children:s.jsx("pre",{children:e.resource.outcomeDesc})})})}function FV(e){return s.jsx(gs,{resource:e.resource,padding:!0,popupMenuItems:s.jsx(La,{...e}),children:s.jsx(Sx,{value:e.resource})})}function zV(e){if(e.lengthComputable){const t=100*e.loaded/e.total;return`Uploaded: ${Sp(e.loaded)} / ${Sp(e.total)} ${t.toFixed(2)}%`}return`Uploaded: ${Sp(e.loaded)}`}function Sp(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 VV(e){return s.jsx(gh,{value:e.resource,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`;return Promise.allSettled([t.readHistory(n,r),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:100})])}})}function Re(e){const{children:t,...n}=e;return s.jsx(nu,{children:s.jsx(bx,{...n,children:t})})}function BV(e){return s.jsx(gh,{value:e.encounter,loadTimelineResources:async(t,n,r)=>Promise.allSettled([t.readHistory("Encounter",r),t.search("Communication","encounter=Encounter/"+r),t.search("Media","encounter=Encounter/"+r)]),createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",encounter:gt(t),subject:t.subject,sender:gt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",encounter:gt(t),subject:t.subject,operator:gt(n),issued:new Date().toISOString(),content:r})})}function UV(e){let t;try{t=K7(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(Hr,{value:t[0]||"",propertyType:e.propertyType})}function HV(e){return s.jsxs(Cn,{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(Xw,{text:"CSV",exportLogic:e.exportCsv,onCancel:e.onCancel}),e.exportTransactionBundle&&s.jsx(Xw,{text:"Transaction Bundle",exportLogic:e.exportTransactionBundle,onCancel:e.onCancel})]}),s.jsx(ue,{style:{marginTop:"10px",marginLeft:"2px"},children:"Limited to 1000 records"})]})}function Xw(e){return s.jsx(re,{onClick:()=>{e.exportLogic(),e.onCancel()},children:`Export as ${e.text}`})}const WV={string:[ie.EQUALS,ie.NOT,ie.CONTAINS,ie.EXACT],fulltext:[ie.EQUALS,ie.NOT,ie.CONTAINS,ie.EXACT],token:[ie.EQUALS,ie.NOT],reference:[ie.EQUALS,ie.NOT],numeric:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS],quantity:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS],date:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS,ie.STARTS_AFTER,ie.ENDS_BEFORE,ie.APPROXIMATELY],datetime:[ie.EQUALS,ie.NOT_EQUALS,ie.GREATER_THAN,ie.LESS_THAN,ie.GREATER_THAN_OR_EQUALS,ie.LESS_THAN_OR_EQUALS,ie.STARTS_AFTER,ie.ENDS_BEFORE,ie.APPROXIMATELY]},qV={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 kx(e,t){return{...e,filters:t,offset:0,name:void 0}}function Ek(e,t){return kx(e,(e.filters??[]).filter(n=>n.code!==t))}function vh(e,t,n,r,o){const i=[];return e.filters&&i.push(...e.filters),i.push({code:t,operator:n,value:r??""}),kx(e,i)}function GV(e,t){if(!e.filters)return e;const n=[...e.filters];return n.splice(t,1),{...e,filters:n,name:void 0}}function QV(e,t){return Rx(e,t,-1)}function KV(e,t){return Rx(e,t,0)}function YV(e,t){return Rx(e,t,1)}function Rx(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),Dx(e,t,r,o)}function XV(e,t){return _x(e,t,-1)}function JV(e,t){return _x(e,t,0)}function ZV(e,t){return _x(e,t,1)}function _x(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),Dx(e,t,r,o)}function eB(e,t){const n=new Date;return n.setMonth(0),n.setDate(1),n.setHours(0,0,0,0),Dx(e,t,n,new Date)}function Dx(e,t,n,r){return e=Ek(e,t),e=Jw(e,t,ie.GREATER_THAN_OR_EQUALS,n),e=Jw(e,t,ie.LESS_THAN_OR_EQUALS,r),e}function Jw(e,t,n,r){return vh(e,t,n,r.toISOString())}function Zw(e,t,n=!0){return vh(e,t,ie.MISSING,n.toString())}function tB(e,t){return e.offset===t?e:{...e,offset:t,name:void 0}}function nB(e,t){const n=e.count??ch,r=(t-1)*n;return tB(e,r)}function rB(e,t,n){return t===oB(e)&&n!==void 0&&n===iB(e)?e:{...e,sortRules:[{code:t,descending:!!n}],name:void 0}}function oB(e){const t=e.sortRules;if(!t||t.length===0)return;const n=t[0].code;return n.startsWith("-")?n.substr(1):n}function iB(e){const t=e.sortRules;return!t||t.length===0?!1:!!t[0].descending}function sB(e){return WV[e.type]}function Ix(e){return qV[e]??""}function _i(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(Wt).join(" "))}function aB(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"?Nn((o=e.meta)==null?void 0:o.lastUpdated):t.elementDefinition&&`${e.resourceType}.${t.name}`===t.elementDefinition.path?lB(e,t.elementDefinition):t.searchParams&&t.searchParams.length===1&&t.name===t.searchParams[0].code?cB(e,t.searchParams[0]):null}function lB(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]=eu({type:e.resourceType,value:e},n);return r?s.jsx(Hr,{path:t.path,property:t,propertyType:o,value:r,maxWidth:200,ignoreMissingValues:!0,link:!1}):null}function cB(e,t){const n=gc(t.expression,[{type:e.resourceType,value:e}]);return!n||n.length===0?null:s.jsx(s.Fragment,{children:n.map((r,o)=>s.jsx(Hr,{propertyType:r.type,value:r.value,maxWidth:200,ignoreMissingValues:!0,link:!1},`${o}-${n.length}`))})}function uB(e){const t=p.useRef(!1),[n,r]=p.useState({search:JSON.parse(sr(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=ZP(c),d=Qy(c);return hc(dB(u,d)).map(f=>({value:f,label:_i(f)}))},[e.visible,e.search.resourceType]);if(!e.visible)return null;function l(c){r({search:{...n.search,fields:c}})}return s.jsx(Cn,{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(De,{children:[s.jsx(Kf,{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(Z,{justify:"flex-end",children:s.jsx(re,{onClick:()=>e.onOk(n.search),children:"OK"})})]})})}function dB(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(_i(i));if(t)for(const i of Object.keys(t)){const a=_i(i);!r.has(i)&&!o.has(a)&&(n.push(i),r.add(i),o.add(a))}return n}function Pk(e){var o;const{resourceType:t,filter:n}=e,r=(o=Mo.types[t].searchParams)==null?void 0:o[n.code];if(r){if(r.type==="reference"&&(n.operator===ie.EQUALS||n.operator===ie.NOT_EQUALS))return s.jsx(rl,{value:{reference:n.value}});const i=lh(t,r);if(n.code==="_lastUpdated"||i.type===ii.DATETIME)return s.jsx(s.Fragment,{children:Nn(n.value)})}return s.jsx(s.Fragment,{children:n.value})}function Tk(e){const t=lh(e.resourceType,e.searchParam),n="filter-value";switch(t.type){case ii.REFERENCE:return s.jsx(ph,{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 ii.BOOLEAN:return s.jsx(Cr,{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 ii.DATE:return s.jsx(de,{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 ii.DATETIME:return s.jsx(ps,{name:n,defaultValue:e.defaultValue,autoFocus:e.autoFocus,onChange:e.onChange});case ii.NUMBER:return s.jsx(de,{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 ii.QUANTITY:return s.jsx(ms,{name:n,defaultValue:fB(e.defaultValue),autoFocus:e.autoFocus,onChange:r=>{r?e.onChange(`${r.value}`):e.onChange("")}});default:return s.jsx(de,{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 fB(e){if(e){const[t,n,r]=e.split("|");if(t)return{value:parseFloat(t),system:n,unit:r}}}function hB(e){const[t,n]=p.useState(JSON.parse(sr(e.search))),[r,o]=p.useState(-1),i=p.useRef(t);i.current=t,p.useEffect(()=>{n(JSON.parse(sr(e.search)))},[e.search]);function a(d){n(vh(i.current,d.code,d.operator,d.value))}if(!e.visible)return null;const l=e.search.resourceType,c=Qy(l)??{},u=t.filters||[];return s.jsxs(Cn,{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(eS,{resourceType:l,searchParams:c,defaultValue:d,okText:"Save",onOk:h=>{const m=[...u];m[f]=h,n(kx(i.current,m)),o(-1)},onCancel:()=>o(-1)},`filter-${d.code}-${d.operator}-${d.value}-input`):s.jsx(pB,{resourceType:l,filter:d,onEdit:()=>o(f),onDelete:()=>n(GV(i.current,f))},`filter-${d.code}-${d.operator}-${d.value}-display`)),s.jsx(eS,{resourceType:l,searchParams:c,okText:"Add",onOk:a})]})]})}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(re,{onClick:()=>e.onOk(i.current),children:"OK"})})]})}function pB(e){const{filter:t}=e;return s.jsxs("tr",{children:[s.jsx("td",{children:_i(t.code)}),s.jsx("td",{children:Ix(t.operator)}),s.jsx("td",{children:s.jsx(Pk,{resourceType:e.resourceType,filter:t})}),s.jsxs("td",{children:[s.jsx(re,{size:"compact-md",variant:"outline",onClick:e.onEdit,children:"Edit"}),s.jsx(re,{size:"compact-md",variant:"outline",onClick:e.onDelete,children:"Delete"})]})]})}function eS(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&&sB(l);return s.jsxs("tr",{children:[s.jsx("td",{children:s.jsx(Et,{"data-testid":"filter-field",defaultValue:r.current.code,onChange:u=>o(u.currentTarget.value),data:["",...Object.keys(e.searchParams).map(u=>({value:u,label:_i(u)}))]})}),s.jsx("td",{children:c&&s.jsx(Et,{"data-testid":"filter-operation",defaultValue:t.operator,onChange:u=>i(u.currentTarget.value),data:["",...c.map(u=>({value:u,label:Ix(u)}))]})}),s.jsx("td",{children:l&&t.operator&&s.jsx(Tk,{resourceType:e.resourceType,searchParam:l,defaultValue:t.value,onChange:a})}),s.jsxs("td",{children:[t.code&&t.operator&&s.jsx(re,{size:"compact-md",variant:"outline",onClick:()=>{e.onOk(r.current),n({})},children:e.okText}),e.onCancel&&s.jsx(re,{size:"compact-md",variant:"outline",onClick:e.onCancel,children:"Cancel"})]})]})}function mB(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(Cn,{title:e.title,size:"xl",opened:e.visible,onClose:e.onCancel,children:s.jsx(qe,{onSubmit:r,children:s.jsxs(nr,{children:[s.jsx(nr.Col,{span:10,children:s.jsx(Tk,{resourceType:e.resourceType,searchParam:e.searchParam,defaultValue:t,autoFocus:!0,onChange:n})}),s.jsx(nr.Col,{span:2,children:s.jsx(re,{onClick:r,fullWidth:!0,children:"OK"})})]})})})}function gB(e){if(!e.searchParams)return null;function t(i,a){o(rB(e.search,i.code,a))}function n(i){o(Ek(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(vB,{search:e.search,searchParam:e.searchParams[0],onSort:t,onPrompt:r,onChange:o,onClear:n}):s.jsx(ne.Dropdown,{children:e.searchParams.map(i=>s.jsx(ne.Item,{children:_i(i.code)},i.code))})}function vB(e){switch(e.searchParam.type){case"date":return s.jsx(yB,{...e});case"number":case"quantity":return s.jsx(xB,{...e});case"reference":return s.jsx(wB,{...e});case"string":return s.jsx(SB,{...e});case"token":case"uri":return s.jsx(bB,{...e});default:return s.jsxs(s.Fragment,{children:["Unknown search param type: ",e.searchParam.type]})}}function yB(e){const{searchParam:t}=e,n=t.code;return s.jsxs(ne.Dropdown,{children:[s.jsx(ne.Item,{leftSection:s.jsx(ax,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Oldest to Newest"}),s.jsx(ne.Item,{leftSection:s.jsx(lx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Newest to Oldest"}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(Jc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(ne.Item,{leftSection:s.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT_EQUALS),children:"Does not equal..."}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(FT,{size:14}),onClick:()=>e.onPrompt(t,ie.ENDS_BEFORE),children:"Before..."}),s.jsx(ne.Item,{leftSection:s.jsx(LT,{size:14}),onClick:()=>e.onPrompt(t,ie.STARTS_AFTER),children:"After..."}),s.jsx(ne.Item,{leftSection:s.jsx(vF,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Between..."}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(zi,{size:14}),onClick:()=>e.onChange(YV(e.search,n)),children:"Tomorrow"}),s.jsx(ne.Item,{leftSection:s.jsx(zi,{size:14}),onClick:()=>e.onChange(KV(e.search,n)),children:"Today"}),s.jsx(ne.Item,{leftSection:s.jsx(zi,{size:14}),onClick:()=>e.onChange(QV(e.search,n)),children:"Yesterday"}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(zi,{size:14}),onClick:()=>e.onChange(ZV(e.search,n)),children:"Next Month"}),s.jsx(ne.Item,{leftSection:s.jsx(zi,{size:14}),onClick:()=>e.onChange(JV(e.search,n)),children:"This Month"}),s.jsx(ne.Item,{leftSection:s.jsx(zi,{size:14}),onClick:()=>e.onChange(XV(e.search,n)),children:"Last Month"}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(zi,{size:14}),onClick:()=>e.onChange(eB(e.search,n)),children:"Year to date"}),s.jsx(ou,{...e})]})}function xB(e){const{searchParam:t}=e;return s.jsxs(ne.Dropdown,{children:[s.jsx(ne.Item,{leftSection:s.jsx(ax,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort Smallest to Largest"}),s.jsx(ne.Item,{leftSection:s.jsx(lx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Largest to Smallest"}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(Jc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(ne.Item,{leftSection:s.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT_EQUALS),children:"Does not equal..."}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(LT,{size:14}),onClick:()=>e.onPrompt(t,ie.GREATER_THAN),children:"Greater than..."}),s.jsx(ne.Item,{leftSection:s.jsx(Km,{size:14}),onClick:()=>e.onPrompt(t,ie.GREATER_THAN_OR_EQUALS),children:"Greater than or equal to..."}),s.jsx(ne.Item,{leftSection:s.jsx(FT,{size:14}),onClick:()=>e.onPrompt(t,ie.LESS_THAN),children:"Less than..."}),s.jsx(ne.Item,{leftSection:s.jsx(Km,{size:14}),onClick:()=>e.onPrompt(t,ie.LESS_THAN_OR_EQUALS),children:"Less than or equal to..."}),s.jsx(ou,{...e})]})}function wB(e){const{searchParam:t}=e;return s.jsxs(ne.Dropdown,{children:[s.jsx(ne.Item,{leftSection:s.jsx(Jc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(ne.Item,{leftSection:s.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),s.jsx(ou,{...e})]})}function SB(e){const{searchParam:t}=e;return s.jsxs(ne.Dropdown,{children:[s.jsx(ne.Item,{leftSection:s.jsx(ax,{size:14}),onClick:()=>e.onSort(t,!1),children:"Sort A to Z"}),s.jsx(ne.Item,{leftSection:s.jsx(lx,{size:14}),onClick:()=>e.onSort(t,!0),children:"Sort Z to A"}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(Jc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(ne.Item,{leftSection:s.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(wF,{size:14}),onClick:()=>e.onPrompt(t,ie.CONTAINS),children:"Contains..."}),s.jsx(ne.Item,{leftSection:s.jsx(xF,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Does not contain..."}),s.jsx(ou,{...e})]})}function bB(e){const{searchParam:t}=e;return s.jsxs(ne.Dropdown,{children:[s.jsx(ne.Item,{leftSection:s.jsx(Jc,{size:14}),onClick:()=>e.onPrompt(t,ie.EQUALS),children:"Equals..."}),s.jsx(ne.Item,{leftSection:s.jsx(Xc,{size:14}),onClick:()=>e.onPrompt(t,ie.NOT),children:"Does not equal..."}),s.jsx(ou,{...e})]})}function ou(e){const{searchParam:t}=e,n=t.code;return s.jsxs(s.Fragment,{children:[s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(mF,{size:14}),onClick:()=>e.onChange(Zw(e.search,n)),children:"Missing"}),s.jsx(ne.Item,{leftSection:s.jsx(pF,{size:14}),onClick:()=>e.onChange(Zw(e.search,n,!1)),children:"Not missing"}),s.jsx(ne.Divider,{}),s.jsx(ne.Item,{leftSection:s.jsx(Qd,{size:14}),onClick:()=>e.onClear(t),children:"Clear filters"})]})}const jB="_root_vlout_1",CB="_table_vlout_8",EB="_tr_vlout_12",PB="_th_vlout_18",TB="_control_vlout_22",kB="_icon_vlout_31",xl={root:jB,table:CB,tr:EB,th:PB,control:TB,icon:kB};function RB(e){const t=e.resourceType,n=[];for(const r of e.fields||["id","_lastUpdated"])n.push(_B(t,r));return n}function _B(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=Ds(e,t),r=x7(e,t.toLowerCase());if(n&&r)return{name:t,elementDefinition:n,searchParams:[r]};if(n){const i=Qy(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=lh(e,r);return{name:t,elementDefinition:(o=i.elementDefinitions)==null?void 0:o[0],searchParams:[r]}}return{name:t}}class DB extends Event{constructor(t){super("change"),this.definition=t}}class IB extends Event{constructor(t){super("load"),this.response=t}}class Xd extends Event{constructor(t,n){super("click"),this.resource=t,this.browserEvent=n}}function AB(e){var A,L,I;const t=oe(),[n,r]=p.useState(),[o,i]=p.useState(),{search:a,onLoad:l}=e,[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(k=>{i(void 0),t.search(a.resourceType,ua({...a,total:f,fields:void 0}),k).then(T=>{u({...d.current,searchResponse:T}),l&&l(new IB(T))}).catch(T=>{u({...d.current,searchResponse:void 0}),i(T)})},[t,a,f,l]),m=p.useCallback(()=>{u({...d.current,searchResponse:void 0}),h({cache:"reload"})},[h]);p.useEffect(()=>{h()},[h]);function g(k,T){k.stopPropagation();const V=k.target.checked,U={...d.current.selected};V?U[T]=!0:delete U[T],u({...d.current,selected:U})}function v(k){k.stopPropagation();const $=k.target.checked,V={},U=d.current.searchResponse;$&&(U!=null&&U.entry)&&U.entry.forEach(X=>{var Se;(Se=X.resource)!=null&&Se.id&&(V[X.resource.id]=!0)}),u({...d.current,selected:V})}function S(){var T,$;const k=d.current;if(!((T=k.searchResponse)!=null&&T.entry)||k.searchResponse.entry.length===0)return!1;for(const V of k.searchResponse.entry)if(($=V.resource)!=null&&$.id&&!k.selected[V.resource.id])return!1;return!0}function y(k){e.onChange&&e.onChange(new DB(k))}function w(k,T){if(BT(k.target)||k.button===2)return;at(k);const $=k.button===1||k.ctrlKey||k.metaKey;!$&&e.onClick&&e.onClick(new Xd(T,k)),$&&e.onAuxClick&&e.onAuxClick(new Xd(T,k))}function x(){return!!(e.onExport??e.onExportCsv??e.onExportTransactionBundle)}if(p.useEffect(()=>{r(e.search.resourceType),t.requestSchema(e.search.resourceType).catch(console.error).finally(()=>r(void 0))},[t,e.search.resourceType]),!JP(e.search.resourceType)||n===e.search.resourceType)return s.jsx(dn,{style:{width:"100%",height:"100%"},children:s.jsx(Qn,{})});const b=e.checkboxesEnabled,C=RB(a),E=a.resourceType,j=c.searchResponse,P=j==null?void 0:j.entry,_=P==null?void 0:P.map(k=>k.resource),R="subtle",M="gray",D=16,N=window.innerWidth<768;return s.jsxs("div",{className:xl.root,"data-testid":"search-control",children:[!e.hideToolbar&&s.jsxs(Z,{justify:"space-between",mb:"xl",children:[s.jsxs(Z,{gap:2,children:[s.jsx(re,{size:"compact-md",variant:R,color:M,leftSection:s.jsx(jF,{size:D}),onClick:()=>u({...d.current,fieldEditorVisible:!0}),children:"Fields"}),s.jsx(re,{size:"compact-md",variant:R,color:M,leftSection:s.jsx(RF,{size:D}),onClick:()=>u({...d.current,filterEditorVisible:!0}),children:"Filters"}),e.onNew&&s.jsx(re,{size:"compact-md",variant:R,color:M,leftSection:s.jsx(kF,{size:D}),onClick:e.onNew,children:"New..."}),!N&&x()&&s.jsx(re,{size:"compact-md",variant:R,color:M,leftSection:s.jsx(XF,{size:D}),onClick:e.onExport?e.onExport:()=>u({...d.current,exportDialogVisible:!0}),children:"Export..."}),!N&&e.onDelete&&s.jsx(re,{size:"compact-md",variant:R,color:M,leftSection:s.jsx(zT,{size:D}),onClick:()=>e.onDelete(Object.keys(c.selected)),children:"Delete..."}),!N&&e.onBulk&&s.jsx(re,{size:"compact-md",variant:R,color:M,leftSection:s.jsx(gF,{size:D}),onClick:()=>e.onBulk(Object.keys(c.selected)),children:"Bulk..."})]}),s.jsxs(Z,{gap:2,children:[j&&s.jsxs(ue,{size:"xs",c:"dimmed","data-testid":"count-display",children:[kk(a,j).toLocaleString(),"-",$B(a,j).toLocaleString(),j.total!==void 0&&` of ${a.total==="estimate"?"~":""}${(A=j.total)==null?void 0:A.toLocaleString()}`]}),s.jsx(Zt,{variant:R,color:M,title:"Refresh",onClick:m,children:s.jsx(HF,{size:D})})]})]}),s.jsxs(le,{className:xl.table,children:[s.jsxs(le.Thead,{children:[s.jsxs(le.Tr,{children:[b&&s.jsx(le.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:k=>v(k)})}),C.map(k=>s.jsx(le.Th,{children:s.jsxs(ne,{shadow:"md",width:240,position:"bottom-end",children:[s.jsx(ne.Target,{children:s.jsx(An,{className:xl.control,p:2,children:s.jsxs(Z,{justify:"space-between",wrap:"nowrap",children:[s.jsx(ue,{fw:500,children:_i(k.name)}),s.jsx(dn,{className:xl.icon,children:s.jsx(dF,{size:14,stroke:1.5})})]})})}),s.jsx(gB,{search:e.search,searchParams:k.searchParams,onPrompt:(T,$)=>{u({...d.current,filterDialogVisible:!0,filterDialogSearchParam:T,filterDialogFilter:$})},onChange:T=>{y(T)}})]})},k.name))]}),!e.hideFilters&&s.jsxs(le.Tr,{children:[b&&s.jsx(le.Th,{}),C.map(k=>s.jsx(le.Th,{children:k.searchParams&&s.jsx(NB,{resourceType:E,searchParams:k.searchParams,filters:e.search.filters})},k.name))]})]}),s.jsx(le.Tbody,{children:_==null?void 0:_.map(k=>k&&s.jsxs(le.Tr,{className:xl.tr,"data-testid":"search-control-row",onClick:T=>w(T,k),onAuxClick:T=>w(T,k),children:[b&&s.jsx(le.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${k.id}`,checked:!!c.selected[k.id],onChange:T=>g(T,k.id)})}),C.map(T=>s.jsx(le.Td,{children:aB(k,T)},T.name))]},k.id))})]}),(_==null?void 0:_.length)===0&&s.jsx(nu,{children:s.jsx(dn,{style:{height:150},children:s.jsx(ue,{size:"xl",c:"dimmed",children:"No results"})})}),j&&s.jsx(dn,{m:"md",p:"md",children:s.jsx(Gr,{value:MB(a),total:OB(a,j),onChange:k=>y(nB(a,k)),getControlProps:k=>{switch(k){case"previous":return{"aria-label":"Previous page"};case"next":return{"aria-label":"Next page"};default:return{}}}})}),o&&s.jsx("div",{"data-testid":"search-error",children:s.jsx("pre",{style:{textAlign:"left"},children:JSON.stringify(o,void 0,2)})}),s.jsx(uB,{search:e.search,visible:d.current.fieldEditorVisible,onOk:k=>{y(k),u({...d.current,fieldEditorVisible:!1})},onCancel:()=>{u({...d.current,fieldEditorVisible:!1})}}),s.jsx(hB,{search:e.search,visible:d.current.filterEditorVisible,onOk:k=>{y(k),u({...d.current,filterEditorVisible:!1})},onCancel:()=>{u({...d.current,filterEditorVisible:!1})}}),s.jsx(HV,{visible:d.current.exportDialogVisible,exportCsv:e.onExportCsv,exportTransactionBundle:e.onExportTransactionBundle,onCancel:()=>{u({...d.current,exportDialogVisible:!1})}}),s.jsx(mB,{visible:d.current.filterDialogVisible,title:(L=c.filterDialogSearchParam)!=null&&L.code?_i(c.filterDialogSearchParam.code):"",resourceType:E,searchParam:c.filterDialogSearchParam,filter:c.filterDialogFilter,defaultValue:"",onOk:k=>{y(vh(e.search,k.code,k.operator,k.value)),u({...d.current,filterDialogVisible:!1})},onCancel:()=>{u({...d.current,filterDialogVisible:!1})}},(I=c.filterDialogSearchParam)==null?void 0:I.code)]})}const iu=p.memo(AB);function NB(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:[Ix(n.operator)," ",s.jsx(Pk,{resourceType:e.resourceType,filter:n})]},`filter-${n.code}-${n.operator}-${n.value}`))})}function MB(e){return Math.floor((e.offset??0)/(e.count??ch))+1}function OB(e,t){const n=e.count??ch,r=Rk(e,t);return Math.ceil(r/n)}function kk(e,t){return Math.min(Rk(e,t),(e.offset??0)+1)}function $B(e,t){var n;return Math.max(kk(e,t)+(((n=t.entry)==null?void 0:n.length)??0)-1,0)}function Rk(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 LB(e){const t=oe(),[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(x=>i(dt(x)))},[t,a]);function g(x,b){x.stopPropagation();const E=x.target.checked,j={...m.current};E?j[b]=!0:delete j[b],f(j)}function v(x){var P;x.stopPropagation();const C=x.target.checked,E={},j=(P=h.current)==null?void 0:P.data.ResourceList;C&&j&&j.forEach(_=>{_.id&&(E[_.id]=!0)}),f(E)}function S(){var b;const x=(b=h.current)==null?void 0:b.data.ResourceList;if(!x||x.length===0)return!1;for(const C of x)if(C.id&&!m.current[C.id])return!1;return!0}function y(x,b){BT(x.target)||(at(x),x.button!==1&&e.onClick&&e.onClick(new Xd(b,x)),x.button===1&&e.onAuxClick&&e.onAuxClick(new Xd(b,x)))}if(p.useEffect(()=>{t.requestSchema(e.resourceType).then(()=>r(!0)).catch(console.log)},[t,e.resourceType]),!n)return s.jsx(Qn,{});const w=e.checkboxesEnabled;return s.jsxs("div",{onContextMenu:x=>at(x),"data-testid":"search-control",children:[s.jsxs(le,{children:[s.jsx(le.Thead,{children:s.jsxs(le.Tr,{children:[w&&s.jsx(le.Th,{children:s.jsx("input",{type:"checkbox",value:"checked","aria-label":"all-checkbox","data-testid":"all-checkbox",checked:S(),onChange:x=>v(x)})}),l.map(x=>s.jsx(le.Th,{children:x.name},x.name))]})}),s.jsx(le.Tbody,{children:c==null?void 0:c.data.ResourceList.map(x=>x&&s.jsxs(le.Tr,{"data-testid":"search-control-row",onClick:b=>y(b,x),onAuxClick:b=>y(b,x),children:[w&&s.jsx(le.Td,{children:s.jsx("input",{type:"checkbox",value:"checked","data-testid":"row-checkbox","aria-label":`Checkbox for ${x.id}`,checked:!!d[x.id],onChange:b=>g(b,x.id)})}),l.map(b=>s.jsx(le.Td,{children:s.jsx(UV,{propertyType:b.propertyType,path:b.fhirPath,resource:x})},b.name))]},x.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(re,{onClick:()=>e.onBulk(Object.keys(m.current)),children:"Bulk..."})]})}const FB=p.memo(LB);function Qr(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 zB(e){const{group:t}=e;return s.jsx(Wn,{withBorder:!0,radius:"md",p:"xs",display:"flex",style:{alignItems:"center",justifyContent:"center"},children:s.jsxs(Z,{children:[t.measureScore&&s.jsx(UB,{group:t}),!t.measureScore&&s.jsx(BB,{group:t})]})})}function VB(e){const{measure:t}=e;return s.jsxs(s.Fragment,{children:[s.jsx(ue,{fz:"md",fw:500,mb:8,children:t.title}),s.jsx(ue,{fz:"xs",c:"dimmed",mb:8,children:t.subtitle})]})}function BB(e){const{group:t}=e,n=t.population,r=n==null?void 0:n.find(c=>Ri(c.code)==="numerator"),o=n==null?void 0:n.find(c=>Ri(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(ce,{order:3,children:"Not Applicable"}),s.jsx(ue,{children:`Denominator: ${a}`})]});if(i===void 0||a===void 0)return s.jsxs(q,{children:[s.jsx(ce,{order:3,children:"Insufficient Data"}),s.jsx(ue,{children:`Numerator: ${i}`}),s.jsx(ue,{children:`Denominator: ${a}`})]});const l=i/a*100;return s.jsx(nh,{size:120,thickness:12,roundCaps:!0,sections:[{value:l,color:_k(l)}],label:s.jsx(us,{justify:"center",children:s.jsxs(ue,{fw:700,fz:18,children:[i," / ",a]})})})}function UB(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(nh,{size:120,thickness:12,roundCaps:!0,sections:[{value:HB(t),color:_k(((i=t==null?void 0:t.measureScore)==null?void 0:i.value)??0)}],label:s.jsx(us,{justify:"center",children:s.jsx(ue,{fw:700,fz:18,children:s.jsx(vc,{value:t.measureScore})})})}):s.jsx(us,{h:120,align:"center",children:s.jsx(ce,{order:3,children:s.jsx(vc,{value:t.measureScore})})})})}function HB(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 _k(e){return e<=33?"red":e<=67?"yellow":"green"}function WB(e){var r;const t=ft(e.measureReport),[n]=sF("Measure",{url:t==null?void 0:t.measure});return t?s.jsxs(q,{children:[n&&s.jsx(VB,{measure:n}),s.jsx(_y,{cols:{base:3,sm:1},spacing:{base:"md",sm:"sm"},children:(r=t.group)==null?void 0:r.map((o,i)=>s.jsx(zB,{group:o},o.id??i))})]}):null}function Kr(e){var n;const t=((n=e.outcome)==null?void 0:n.issue)||e.issues;return!t||t.length===0?null:s.jsx(Es,{icon:s.jsx(Kc,{size:16}),color:"red",children:t.map(r=>{var o;return s.jsx("div",{"data-testid":"text-field-error",children:KP(r)},(o=r.details)==null?void 0:o.text)})})}function qB(e){const t=p.useCallback((n,r,o)=>{const i=`${r}/${o}`,a=100;return Promise.allSettled([n.readHistory("Patient",o),n.search("Communication",{subject:i,_count:a}),n.search("Device",{patient:i,_count:a}),n.search("DeviceRequest",{patient:i,_count:a}),n.search("DiagnosticReport",{subject:i,_count:a}),n.search("Media",{subject:i,_count:a}),n.search("ServiceRequest",{subject:i,_count:a}),n.search("Task",{subject:i,_count:a})])},[]);return s.jsx(gh,{value:e.patient,loadTimelineResources:t,createCommunication:(n,r,o)=>({resourceType:"Communication",status:"completed",subject:gt(n),sender:gt(r),sent:new Date().toISOString(),payload:[{contentString:o}]}),createMedia:(n,r,o)=>({resourceType:"Media",status:"completed",subject:gt(n),operator:gt(r),issued:new Date().toISOString(),content:o})})}const GB="_section_14dzq_2",QB="_hovering_14dzq_11",KB="_editing_14dzq_15",YB="_bottomActions_14dzq_20",da={section:GB,hovering:QB,editing:KB,bottomActions:YB};function XB(e){const t=oe(),n=ft(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(rU(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(de,{label:"Plan Title",defaultValue:u.title,onChange:v=>g("title",v.currentTarget.value)}),s.jsx(Dk,{actions:u.action||[],selectedKey:i,setSelectedKey:a,hoverKey:l,setHoverKey:c,onChange:v=>g("action",v)}),s.jsx(re,{type:"submit",children:"Save"})]})})}function Dk(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:da.section,children:[e.actions.map(i=>s.jsx("div",{children:s.jsx(JB,{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:da.bottomActions,children:s.jsx(Je,{href:"#",onClick:i=>{at(i),r({id:Ak()})},children:"Add action"})})]})}function JB(e){const{action:t}=e,n=nU(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){at(c),e.setHoverKey(e.action.id)}const l=nt(da.section,{[da.editing]:r,[da.hovering]:o&&!r});return s.jsxs("div",{"data-testid":t.id,className:l,onClick:i,onMouseOver:a,onFocus:a,children:[r?s.jsx(eU,{action:t,actionType:n,onChange:e.onChange,selectedKey:e.selectedKey,setSelectedKey:e.setSelectedKey,hoverKey:e.hoverKey,setHoverKey:e.setHoverKey,onRemove:e.onRemove}):s.jsx(ZB,{action:t,actionType:n}),s.jsx("div",{className:da.bottomActions,children:s.jsx(Je,{href:"#",onClick:c=>{c.preventDefault(),e.onRemove()},children:"Remove"})})]})}const Jm={path:"PlanDefinition.action.timing[x]",min:0,max:1,description:"",isArray:!1,constraints:[],type:["dateTime","Period","Range","Timing"].map(e=>({code:e}))};function ZB(e){const{action:t,actionType:n}=e,[r,o]=Ik(t);return s.jsxs("div",{children:[s.jsxs("div",{children:[t.title||"Untitled"," ",n&&`(${n})`]}),t.definitionCanonical&&s.jsx("div",{children:s.jsx(Kd,{value:{reference:t.definitionCanonical}})}),r&&s.jsx("div",{children:s.jsx(Hr,{property:Jm,propertyType:o,value:r})})]})}function eU(e){const{action:t}=e,[n,r]=p.useState(e.actionType);function o(i,a){e.onChange({...t,[i]:a})}return s.jsxs(De,{gap:"xl",children:[s.jsx(de,{name:`actionTitle-${t.id}`,label:"Title",defaultValue:t.title,onChange:i=>o("title",i.currentTarget.value)}),s.jsx(de,{name:`actionDescription-${t.id}`,label:"Description",defaultValue:t.description,onChange:i=>o("description",i.currentTarget.value)}),s.jsx(Et,{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(Dk,{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(Uu,{title:"Appointment",description:"The subject must schedule an appointment from the schedule.",resourceType:"Schedule",action:t,onChange:e.onChange});case"lab":return s.jsx(Uu,{title:"Lab",description:"The subject must complete the following lab panel.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});case"questionnaire":return s.jsx(Uu,{title:"Questionnaire",description:"The subject must complete the selected questionnaire.",resourceType:"Questionnaire",action:t,onChange:e.onChange});case"task":return s.jsx(Uu,{title:"Task",description:"The subject must complete the following task.",resourceType:"ActivityDefinition",action:t,onChange:e.onChange});default:return null}})(),s.jsx(ut,{title:"Timing",description:"When the action should take place.",children:s.jsx(tU,{name:"timing-"+t.id,action:t,onChange:e.onChange})})]})}function Uu(e){const{id:t,definitionCanonical:n}=e.action,r=n!=null&&n.startsWith(e.resourceType+"/")?{reference:n}:void 0;return s.jsx(tl,{name:t,resourceType:e.resourceType,defaultValue:r,loadOnFocus:!0,onChange:o=>{o?e.onChange({...e.action,definitionCanonical:vt(o)}):e.onChange({...e.action,definitionCanonical:void 0})}})}function tU(e){const t=e.action,n="timing",[r,o]=Ik(t);return s.jsx(nl,{property:Jm,name:"timing[x]",path:"PlanDefinition.timing[x]",defaultValue:r,defaultPropertyType:o,onChange:(i,a)=>{e.onChange(ek(t,n,a??n,Jm,i))},outcome:void 0})}function nU(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 Ik(e){return eu({type:"PlanDefinitionAction",value:e},"timing")}let bp=1;function Ak(e){if(e){if(e.startsWith("id-")){const t=parseInt(e.substring(3),10);isNaN(t)||(bp=Math.max(bp,t+1))}return e}return"id-"+bp++}function rU(e){return{...e,action:Nk(e.action)}}function Nk(e){if(e)return e.map(t=>({...t,id:Ak(t.id),action:Nk(t.action)}))}var pt=(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))(pt||{});function oU(e){return e.type==="choice"||e.type==="open-choice"}function iU(e,t){if(!e.enableWhen)return!0;const n=e.enableBehavior??"any";for(const r of e.enableWhen){const o=Mk(t,r.question);if(r.operator==="exists"&&!r.answerBoolean&&!(o!=null&&o.length)){if(n==="any")return!0;continue}const{anyMatch:i,allMatch:a}=lU(r,o,n);if(n==="any"&&i)return!0;if(n==="all"&&!a)return!1}return n!=="any"}function sU(e,t,n){return e.map(r=>{var a;const o=(a=n.answerOption)==null?void 0:a.find(l=>_s(l.valueCoding)===r||l[t]===r),i=hn({type:"QuestionnaireItemAnswerOption",value:o},"value");return{[t]:i==null?void 0:i.value}})}function Mk(e,t){if(e)for(const n of e){if(n.linkId===t)return n.answer;if(n.item){const r=Mk(n.item,t);if(r)return r}}}function aU(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}]=gc(`%actualAnswer ${r} %expectedAnswer`,[e],{"%actualAnswer":e,"%expectedAnswer":t});return o}else return!1}function lU(e,t,n){const r=t||[],o=hn({type:"QuestionnaireItemEnableWhen",value:e},"answer[x]");let i=!1,a=!0;for(const l of r){const c=hn({type:"QuestionnaireResponseItemAnswer",value:l},"value[x]"),{operator:u}=e;if(aU(c,o,u)?i=!0:a=!1,n==="any"&&i)break}return{anyMatch:i,allMatch:a}}function Ok(e){var n,r;const t=qc(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 jp(e,t){var o;const n=ho(e);let r=qc(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 cU(e,t,n){const r=qc(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]=t7(l,"=",2);i[c]=u}return i}function uU(e){return{resourceType:"QuestionnaireResponse",questionnaire:vt(e),item:$k(e.item),status:"in-progress"}}function $k(e){return(e==null?void 0:e.map(Lk))??[]}function Lk(e){var t;return{id:fU(),linkId:e.linkId,text:e.text,item:$k(e.item),answer:((t=e.initial)==null?void 0:t.map(hU))??[]}}let dU=1;function fU(){return"id-"+dU++}function hU(e){return{...e}}function pU(e){return e.value.display||e.value.reference||sr(e.value)}function mU(e){var n,r,o,i;const t=(n=e==null?void 0:e.item)==null?void 0:n[0];if(t){const a=qc(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 Fk=p.createContext({});function Zm(e){const t=p.useContext(Fk),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,y)=>y===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=Ax(r,e.index)??hn({type:"QuestionnaireItemInitial",value:l},"value");switch(i){case pt.display:return s.jsx("p",{children:e.item.text},e.item.linkId);case pt.boolean:return s.jsx(JT,{title:e.item.text,htmlFor:e.item.linkId,children:s.jsx(Cr,{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 pt.decimal:return s.jsx(de,{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 pt.integer:return s.jsx(de,{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 pt.date:return s.jsx(de,{type:"date",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDate:u.currentTarget.value})});case pt.dateTime:return s.jsx(ps,{name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueDateTime:u})});case pt.time:return s.jsx(de,{type:"time",id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueTime:u.currentTarget.value})});case pt.string:case pt.url:return s.jsx(de,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case pt.text:return s.jsx(Ps,{id:a,name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueString:u.currentTarget.value})});case pt.attachment:return s.jsx(Z,{py:4,children:s.jsx(WT,{name:a,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueAttachment:u})})});case pt.reference:return s.jsx(ph,{name:a,required:n.required,targetTypes:Ok(n),searchCriteria:cU(n,t.subject,t.encounter),defaultValue:c==null?void 0:c.value,onChange:u=>o({valueReference:u})});case pt.quantity:return s.jsx(ms,{name:a,required:n.required,defaultValue:c==null?void 0:c.value,onChange:u=>o({valueQuantity:u}),disableWheel:!0});case pt.choice:case pt.openChoice:return SU(n)&&!n.answerValueSet?s.jsx(gU,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)}):s.jsx(vU,{name:a,item:n,initial:l,response:r,onChangeAnswer:u=>o(u)});default:return null}}function gU(e){var c;const{name:t,item:n,initial:r,response:o}=e;if(!((c=n.answerOption)!=null&&c.length))return s.jsx(zk,{});const i=hn({type:"QuestionnaireItemInitial",value:r},"value"),a=[""];for(const u of n.answerOption){const d=hn({type:"QuestionnaireItemAnswerOption",value:u},"value");a.push(tS(d))}const l=Ax(o)??i;if(n.repeats){const{propertyName:u,data:d}=bU(e.item),f=xU(o);return s.jsx(Kf,{data:d,placeholder:"Select items",searchable:!0,defaultValue:f||[tS(i)],onChange:h=>{const m=sU(h,u,n);e.onChangeAnswer(m)}})}return s.jsx(Et,{id:t,name:t,onChange:u=>{const d=u.currentTarget.selectedIndex;if(d===0){e.onChangeAnswer({});return}const f=n.answerOption[d-1],h=hn({type:"QuestionnaireItemAnswerOption",value:f},"value"),m="value"+Wt(h.type);e.onChangeAnswer({[m]:h.value})},defaultValue:_s(l==null?void 0:l.value)||(l==null?void 0:l.value),data:a})}function vU(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(zk,{}):n.answerValueSet?s.jsx(tk,{name:t,binding:n.answerValueSet,onChange:l=>o({valueCoding:l}),creatable:n.type===pt.openChoice}):s.jsx(yU,{name:(i==null?void 0:i.id)??t,item:n,initial:r,response:i,onChangeAnswer:o})}function yU(e){const{name:t,item:n,initial:r,onChangeAnswer:o,response:i}=e,a=Ds("QuestionnaireItemAnswerOption","value[x]"),l=hn({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=hn({type:"QuestionnaireItemAnswerOption",value:m},"value");v!=null&&v.value&&(l&&sr(v)===sr(l)&&(u=g),c.push([g,v]))}const d=Ax(i),f=wU(c,d);return s.jsx(dc.Group,{name:t,value:f??u,onChange:h=>{const m=c.find(g=>g[0]===h);if(m){const g=m[1],v="value"+Wt(g.type);o({[v]:g.value})}},children:c.map(([h,m])=>s.jsx(dc,{id:h,value:h,py:4,label:s.jsx(Hr,{property:a,propertyType:m.type,value:m.value})},h))})}function zk(){return s.jsx(de,{disabled:!0,placeholder:"No Answers Defined"})}function Vk(e){return hn({type:"QuestionnaireItemAnswer",value:e},"value")}function Ax(e,t=0){const n=e.answer;return Vk((n==null?void 0:n[t])??{})}function xU(e){const t=e.answer;return t?t.map(r=>Vk(r)).map(r=>_s(r==null?void 0:r.value)||(r==null?void 0:r.value)):[]}function wU(e,t){var n;return(n=e.find(r=>Gc(r[1].value,t==null?void 0:t.value)))==null?void 0:n[0]}function tS(e){if(e)return e.type==="CodeableConcept"?Ri(e.value):e.type==="Coding"?_s(e.value):e.type==="Reference"?pU(e):e.value.toString()}function SU(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 bU(e){var i;if(((i=e.answerOption)==null?void 0:i.length)===0)return{propertyName:"",data:[]};const t=e.answerOption[0],n=hn({type:"QuestionnaireItemAnswerOption",value:t},"value"),r="value"+Wt(n.type),o=(e.answerOption??[]).map(a=>({value:nS(a,r),label:nS(a,r)}));return{propertyName:r,data:o}}function nS(e,t){var n;return _s(e.valueCoding)||((n=e[t])==null?void 0:n.toString())}const jU="_section_cpwxo_1",CU="_hovering_cpwxo_10",EU="_editing_cpwxo_14",PU="_questionBody_cpwxo_19",TU="_topActions_cpwxo_23",kU="_bottomActions_cpwxo_32",RU="_movementActions_cpwxo_43",_U="_movementIcons_cpwxo_55",DU="_columnAlignment_cpwxo_59",IU="_linkIdInput_cpwxo_64",AU="_typeSelect_cpwxo_69",fr={section:jU,hovering:CU,editing:EU,questionBody:PU,topActions:TU,bottomActions:kU,movementActions:RU,movementIcons:_U,columnAlignment:DU,linkIdInput:IU,typeSelect:AU};function NU(e){const t=oe(),n=ft(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(LU(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(Bk,{item:i,selectedKey:l,setSelectedKey:c,hoverKey:u,setHoverKey:d,onChange:m}),s.jsx(re,{type:"submit",children:"Save"})]})})}function Bk(e){var x;const t=e.item,n=e.item,r=qo(e.item),o=r||n.type===pt.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(b){at(b),e.setSelectedKey(e.item.id)}function d(b){at(b),e.setHoverKey(e.item.id)}function f(b){var E;const C=c.current;e.onChange({...C,item:(E=C.item)==null?void 0:E.map(j=>j.id===b.id?b:j)})}function h(b,C){e.onChange({...e.item,item:[...e.item.item??[],b]},C)}function m(b){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.filter(E=>E!==b)})}function g(b,C){e.onChange({...c.current,[b]:C})}function v(b){e.onChange({...e.item,...b})}function S(b){var C;e.onChange({...e.item,item:(C=e.item.item)==null?void 0:C.map(E=>E===b?{...E,repeats:!E.repeats}:E)})}function y(b,C){const E=VU(e.item.item,b,C);e.onChange({...e.item,item:E})}const w=nt(fr.section,{[fr.editing]:a,[fr.hovering]:l&&!a});return s.jsxs("div",{"data-testid":n.linkId,className:w,onClick:u,onMouseOver:d,onFocus:d,children:[s.jsx("div",{className:fr.questionBody,children:a?s.jsxs(s.Fragment,{children:[r&&s.jsx(de,{size:"xl",defaultValue:t.title,onBlur:b=>g("title",b.currentTarget.value)}),!r&&s.jsx(Ps,{autosize:!0,minRows:2,defaultValue:n.text,onBlur:b=>g("text",b.currentTarget.value)}),n.type==="reference"&&s.jsx($U,{item:n,onChange:v}),oU(n)&&s.jsx(MU,{item:n,onChange:b=>v(b)})]}):s.jsxs(s.Fragment,{children:[t.title&&s.jsx(ce,{children:t.title}),n.text&&s.jsx("div",{children:n.text}),!o&&s.jsx(Zm,{item:n,index:0,onChange:()=>{},response:{linkId:n.linkId}})]})}),(x=n.item)==null?void 0:x.map((b,C)=>s.jsx("div",{children:s.jsx(Bk,{item:b,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(b),onRepeatable:S,onMoveUp:()=>y(C,-1),onMoveDown:()=>y(C,1)})},b.id)),!o&&s.jsx("div",{className:fr.topActions,children:a?s.jsxs(s.Fragment,{children:[s.jsx(de,{size:"xs",className:fr.linkIdInput,defaultValue:n.linkId,onBlur:b=>g("linkId",b.currentTarget.value)}),!o&&s.jsx(Et,{size:"xs",className:fr.typeSelect,defaultValue:n.type,onChange:b=>g("type",b.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:fr.movementActions,children:s.jsxs(q,{className:fr.columnAlignment,children:[!e.isFirst&&s.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveUp&&e.onMoveUp()},children:s.jsx(hF,{"data-testid":"up-button",size:15,className:fr.movementIcons})}),!e.isLast&&s.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onMoveDown&&e.onMoveDown()},children:s.jsx(fF,{"data-testid":"down-button",size:15,className:fr.movementIcons})})]})}),s.jsxs("div",{className:fr.bottomActions,children:[o&&s.jsxs(s.Fragment,{children:[s.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),h({id:vs(),linkId:ng("q"),type:"string",text:"Question"})},children:"Add item"}),s.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),h({id:vs(),linkId:ng("g"),type:"group",text:"Group"},!0)},children:"Add group"})]}),r&&s.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),h(zU(),!0)},children:"Add Page"}),a&&!r&&s.jsxs(s.Fragment,{children:[s.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onRepeatable&&e.onRepeatable(n)},children:n.repeats?"Remove Repeatable":"Make Repeatable"}),s.jsx(Je,{href:"#",onClick:b=>{b.preventDefault(),e.onRemove&&e.onRemove()},children:"Remove"})]})]})]})}function MU(e){const t=Ds("QuestionnaireItemAnswerOption","value[x]"),n=e.item.answerOption??[];return s.jsxs("div",{children:[e.item.answerValueSet!==void 0?s.jsx(de,{placeholder:"Enter Value Set",defaultValue:e.item.answerValueSet,onChange:r=>e.onChange({...e.item,answerValueSet:r.target.value})}):s.jsx(OU,{options:n,property:t,item:e.item,onChange:e.onChange}),s.jsxs(q,{display:"flex",children:[s.jsx(Je,{href:"#",onClick:r=>{at(r),e.onChange({...e.item,answerValueSet:void 0,answerOption:[...n,{id:vs()}]})},children:"Add choice"}),s.jsx(rh,{w:"lg"}),s.jsx(Je,{href:"#",onClick:r=>{at(r),e.onChange({...e.item,answerOption:[],answerValueSet:""})},children:"Add value set"})]})]})}function OU(e){return s.jsx("div",{children:e.options.map(t=>{const[n,r]=eu({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(nl,{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(Je,{href:"#",onClick:o=>{at(o),e.onChange({...e.item,answerOption:e.options.filter(i=>i.id!==t.id)})},children:"Remove"})})]},t.id)})})}function $U(e){const t=Ok(e.item)??[];return s.jsxs(s.Fragment,{children:[t.map((n,r)=>s.jsxs(Z,{children:[s.jsx(fx,{name:"resourceType",placeholder:"Resource Type",defaultValue:n,onChange:o=>{e.onChange(jp(e.item,t.map(i=>i===n?o:i)))}}),s.jsx(Je,{href:"#",onClick:o=>{at(o),e.onChange(jp(e.item,t.filter(i=>i!==n)))},children:"Remove"})]},`${n}-${r}`)),s.jsx(Je,{href:"#",onClick:n=>{at(n),e.onChange(jp(e.item,[...t,""]))},children:"Add Resource Type"})]})}let eg=1,tg=1;function ng(e){return e+eg++}function vs(){return"id-"+tg++}function LU(e){return{...e,id:e.id||vs(),item:Uk(e.item)}}function Uk(e){if(e)return e.forEach(t=>{var n,r;(n=t.id)!=null&&n.match(/^id-\d+$/)&&(tg=Math.max(tg,parseInt(t.id.substring(3),10)+1)),(r=t.linkId)!=null&&r.match(/^q\d+$/)&&(eg=Math.max(eg,parseInt(t.linkId.substring(1),10)+1))}),e.map(t=>({...t,id:t.id||vs(),item:Uk(t.item),answerOption:FU(t.answerOption)}))}function FU(e){if(e)return e.map(t=>({...t,id:t.id||vs()}))}function zU(){return{id:vs(),linkId:ng("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 VU(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 Hk(e){const{item:t,response:n,onChange:r}=e,[o,i]=p.useState(BU(t,n??{linkId:t.linkId}));if(!e.checkForQuestionEnabled(t)||!n)return null;if(t.type===pt.display)return s.jsx("p",{children:t.text},t.linkId);const a=(t==null?void 0:t.repeats)&&t.type!==pt.choice&&t.type!==pt.openChoice;return t.type===pt.boolean?s.jsx(Zm,{item:t,response:n,onChange:l=>r([l]),index:0},t.linkId):s.jsxs(ut,{htmlFor:e.item.linkId,title:e.item.text,withAsterisk:e.item.required,children:[[...Array(o)].map((l,c)=>s.jsx(Zm,{item:t,response:n,onChange:u=>r([u]),index:c},`${t.linkId}-${c}`)),a&&s.jsx(Je,{onClick:()=>i(l=>l+1),children:"Add Item"})]},e.item.linkId)}function BU(e,t){if(e.type===pt.choice||e.type===pt.openChoice)return 1;const n=t.answer;return n!=null&&n.length?n.length:1}function Wk(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=Lk(e.item);n([...t,i])}return s.jsxs(s.Fragment,{children:[t.map((i,a)=>s.jsx(qk,{item:e.item,response:i,checkForQuestionEnabled:e.checkForQuestionEnabled,onChange:l=>r(l,a)},i.id)),e.item.repeats&&s.jsx(Je,{onClick:o,children:`Add Group: ${e.item.text}`})]})}function qk(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(ce,{order:3,mb:"md",children:e.item.text}),s.jsx(De,{children:(i=e.item.item)==null?void 0:i.map(a=>{var l,c,u;return a.type===pt.group?a.repeats?s.jsx(Wk,{item:a,response:((l=t.item)==null?void 0:l.filter(d=>d.linkId===a.linkId))??[],checkForQuestionEnabled:n,onChange:o},a.linkId):s.jsx(qk,{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(Hk,{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 UU(e){const{items:t,response:n,activePage:r,onChange:o,nextStep:i,prevStep:a,numberOfPages:l,renderPages:c,submitButtonText:u,checkForQuestionEnabled:d}=e,f=t.map(h=>{var v;const m=((v=n==null?void 0:n.item)==null?void 0:v.filter(S=>S.linkId===h.linkId))??[],g=h.type===pt.group?s.jsx(Wk,{item:h,response:m,onChange:o,checkForQuestionEnabled:d},h.linkId):s.jsx(Hk,{item:h,response:m==null?void 0:m[0],onChange:o,checkForQuestionEnabled:d},h.linkId);return c?s.jsx(Ma.Step,{label:h.text,children:g},h.linkId):g});return s.jsxs(s.Fragment,{children:[c&&s.jsx(Ma,{active:r??0,allowNextStepsSelect:!1,p:6,children:f}),!c&&s.jsx(De,{children:f}),s.jsx(HU,{activePage:r??0,numberOfPages:l,nextStep:i,prevStep:a,submitButtonText:u})]})}function HU(e){const t=e.activePage>0,n=e.activePage<e.numberOfPages-1,r=e.activePage===e.numberOfPages-1;return s.jsxs(Z,{justify:"flex-end",mt:"xl",gap:"xs",children:[t&&s.jsx(re,{onClick:e.prevStep,children:"Back"}),n&&s.jsx(re,{onClick:o=>{o.currentTarget.closest("form").reportValidity()&&e.nextStep()},children:"Next"}),r&&s.jsx(re,{type:"submit",children:e.submitButtonText??"Submit"})]})}function Gk(e){const t=oe(),n=t.getProfile(),[r,o]=p.useState(!1),i=ft(e.questionnaire),[a,l]=p.useState(),[c,u]=p.useState(0);p.useEffect(()=>{t.requestSchema("Questionnaire").then(()=>t.requestSchema("QuestionnaireResponse")).then(()=>o(!0)).catch(console.log)},[t]),p.useEffect(()=>{l(i?uU(i):void 0)},[i]);function d(v){const S=(a==null?void 0:a.item)??[],w={resourceType:"QuestionnaireResponse",status:"in-progress",item:Qk(S,Array.isArray(v)?v:[v])};l(w)}function f(v){return iU(v,(a==null?void 0:a.item)??[])}if(!r||!i||!a)return null;const h=mU(i),m=()=>u(v=>v+1),g=()=>u(v=>v-1);return s.jsx(Fk.Provider,{value:{subject:e.subject,encounter:e.encounter},children:s.jsxs(qe,{testid:"questionnaire-form",onSubmit:()=>{e.onSubmit&&a&&e.onSubmit({...a,questionnaire:vt(i),subject:e.subject,source:gt(n),authored:new Date().toISOString(),status:"completed"})},children:[i.title&&s.jsx(ce,{children:i.title}),s.jsx(UU,{items:i.item??[],response:a,onChange:d,renderPages:h>1,activePage:c,numberOfPages:h,submitButtonText:e.submitButtonText,checkForQuestionEnabled:f,nextStep:m,prevStep:g})]})})}function WU(e,t){const n=Qk(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 Qk(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(WU(o,a)),r.add(a.id)):n.push(o)}for(const o of t)r.has(o.id)||n.push(o);return n}const qU="_section_4m5it_1",GU={section:qU},QU=["gender","age","gestationalAge","context","appliesTo","category"],KU={definition:{resourceType:"ObservationDefinition",code:{text:""}},onSubmit:()=>{}};function YU(e){e=Object.assign(KU,e);const t=e.definition,[n,r]=p.useState([]),[o,i]=p.useState(1),[a,l]=p.useState(1);return p.useEffect(()=>{const g=ZU(t,l);r(eH(g.qualifiedInterval||[],i))},[t]),s.jsxs(qe,{testid:"reference-range-editor",onSubmit:c,children:[s.jsx(De,{children:n.map(g=>{var v;return s.jsx(XU,{unit:nH((v=t.quantitativeDetails)==null?void 0:v.unit),onChange:f,onAdd:h,onRemove:m,onRemoveGroup:d,intervalGroup:g},`group-${g.id}`)})}),s.jsx(Zt,{title:"Add Group",variant:"subtle",size:"sm",onClick:g=>{at(g),u({id:`group-id-${o}`,filters:{},intervals:[]}),i(v=>v+1)},children:s.jsx(Gd,{})}),s.jsx(Z,{justify:"flex-end",children:s.jsx(re,{type:"submit",children:"Save"})})]});function c(){const g=n.flatMap(v=>v.intervals).filter(v=>!rH(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 y=S.find(x=>x.id===g),w=y==null?void 0:y.intervals.findIndex(x=>x.id===v.id);return w!==void 0&&(y!=null&&y.intervals[w])&&(y.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 y=S.findIndex(w=>w.id===g);if(y!==-1){const w={...S[y]};v={...v,...w.filters},w.intervals=[...w.intervals,v],S[y]=w}return S})}function m(g,v){r(S=>{S=[...S];const y=S.find(w=>w.id===g);return y&&(y.intervals=y.intervals.filter(w=>w.id!==v.id)),S})}}function XU(e){const{intervalGroup:t,unit:n}=e;return s.jsx(nu,{"data-testid":t.id,className:GU.section,children:s.jsxs(De,{gap:"lg",children:[s.jsx(Z,{justify:"flex-end",children:s.jsx(Zt,{title:"Remove Group",variant:"subtle","data-testid":`remove-group-button-${t.id}`,size:"sm",onClick:r=>{at(r),e.onRemoveGroup(t)},children:s.jsx(qd,{})},`remove-group-button-${t.id}`)}),s.jsx(JU,{intervalGroup:t,onChange:e.onChange}),s.jsx(en,{}),t.intervals.map(r=>s.jsxs(De,{gap:"xs",children:[s.jsxs(Z,{children:[s.jsx(de,{"data-testid":`condition-${r.id}`,defaultValue:r.condition,label:"Condition: ",size:"sm",onChange:o=>{at(o),e.onChange(t.id,{...r,condition:o.currentTarget.value.trim()})}},`condition-${r.id}`),s.jsx(Zt,{title:"Remove Interval",variant:"subtle",size:"sm","data-testid":`remove-interval-${r.id}`,onClick:o=>{at(o),e.onRemove(t.id,r)},children:s.jsx(qd,{})},`remove-interval-${r.id}`)]}),s.jsx(vx,{onChange:o=>{e.onChange(t.id,{...r,range:o})},name:`range-${r.id}`,defaultValue:r.range},`range-${r.id}`)]},`interval-${r.id}`)),s.jsx(Zt,{title:"Add Interval",variant:"subtle",size:"sm",onClick:r=>{at(r),e.onAdd(t.id,{range:{low:{unit:n},high:{unit:n}}})},children:s.jsx(Gd,{})})]})})}function JU(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(De,{style:{maxWidth:"50%"},children:[s.jsx(Z,{children:s.jsx(Et,{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(Z,{gap:"xs",children:[s.jsx(ue,{component:"label",htmlFor:`div-age-${t.id}`,children:"Age:"}),s.jsx("div",{id:`div-age-${t.id}`,children:s.jsx(vx,{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(Et,{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(Et,{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 ZU(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 eH(e,t){let n=1;const r={};for(const o of e){const i=tH(o);i in r||(r[i]={id:`group-id-${n++}`,filters:Object.fromEntries(QU.map(a=>[a,o[a]])),intervals:[]}),r[i].intervals.push(o)}return t(n),Object.values(r)}function tH(e){var n,r;return[`gender=${e.gender}`,`age=${pc(e.age)}`,`gestationalAge=${pc(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 nH(e){return e&&(ZL(e,"http://unitsofmeasure.org")||e.text)}function rH(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 oH(e){var u;const t=oe(),n=ft(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(nr,{children:(u=n.action)==null?void 0:u.map((d,f)=>{var v,S,y,w,x,b;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=(y=h==null?void 0:h.output)==null?void 0:y[0])==null?void 0:w.valueReference;return s.jsxs(p.Fragment,{children:[s.jsx(nr.Col,{span:1,p:"md",children:(h==null?void 0:h.status)==="completed"?s.jsx(bF,{}):s.jsx(QF,{color:"gray"})}),s.jsxs(nr.Col,{span:9,p:"xs",children:[s.jsx(ue,{fw:500,children:d.title}),d.description&&s.jsx("div",{children:d.description}),s.jsxs("div",{children:["Last edited by ",s.jsx(rl,{value:(x=h==null?void 0:h.meta)==null?void 0:x.author})," on ",Nn((b=h==null?void 0:h.meta)==null?void 0:b.lastUpdated)]}),s.jsxs("div",{children:["Status: ",s.jsx(wx,{status:(h==null?void 0:h.status)||"unknown"})]})]}),s.jsxs(nr.Col,{span:2,p:"md",children:[m&&!g&&s.jsx(re,{onClick:()=>e.onStart(h,m),children:"Start"}),m&&g&&s.jsx(re,{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===vt(f.resource))return f.resource}}function Kk(e,t){const n=iH(e,t);return sH(n,e,t)}function iH(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 y=S-u,w={i:S,j:y,prev:aH(v),snake:!1};for(;S<n&&y<r&&e[S]===t[y];)S++,y++;if(S>w.i&&(w={i:S,j:y,prev:w,snake:!0}),l[d]=w,S>=n&&y>=r)return l[d]}l[a+c-1]=void 0}}function sH(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 aH(e){return e&&!e.snake&&e.prev?e.prev:e}function lH(e){const t=e.entry.filter(r=>!!r.resource).map(r=>{var o;return{meta:(o=r.resource)==null?void 0:o.meta,lines:sr(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 cH(n,t),uH(n),n}function cH(e,t){for(let n=1;n<t.length;n++){const r=Kk(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 uH(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 dH="_container_1oj0p_1",fH="_root_1oj0p_5",hH="_startRow_1oj0p_20",pH="_normalRow_1oj0p_24",mH="_author_1oj0p_28",gH="_dateTime_1oj0p_32",vH="_lineNumber_1oj0p_37",yH="_line_1oj0p_37",xH="_pre_1oj0p_52",vo={container:dH,root:fH,startRow:hH,normalRow:pH,author:mH,dateTime:gH,lineNumber:vH,line:yH,pre:xH};function wH(e,t){return`/${e.resourceType}/${e.id}/_history/${t}`}function SH(e){const t=Math.floor((Date.now()-Date.parse(e))/1e3),n=Math.floor(t/31536e3);if(n>0)return Gs(n,"year");const r=Math.floor(t/2592e3);if(r>0)return Gs(r,"month");const o=Math.floor(t/86400);if(o>0)return Gs(o,"day");const i=Math.floor(t/3600);if(i>0)return Gs(i,"hour");const a=Math.floor(t/60);return a>0?Gs(a,"minute"):Gs(t,"second")}function Gs(e,t){return`${e} ${e===1?t:t+"s"} ago`}function bH(e){var a,l;const t=oe(),[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=lH(n);return s.jsx("div",{className:vo.container,children:s.jsx("table",{className:vo.root,children:s.jsx("tbody",{children:i.map((c,u)=>s.jsxs("tr",{className:c.span>0?vo.startRow:vo.normalRow,children:[c.span>0&&s.jsxs(s.Fragment,{children:[s.jsx("td",{className:vo.author,rowSpan:c.span,children:s.jsx(ba,{value:c.meta.author,link:!0})}),s.jsx("td",{className:vo.dateTime,rowSpan:c.span,children:s.jsx(We,{to:wH(o,c.meta.versionId),children:SH(c.meta.lastUpdated)})})]}),s.jsx("td",{className:vo.lineNumber,children:u+1}),s.jsx("td",{className:vo.line,children:s.jsx("pre",{className:vo.pre,children:c.value})})]},"row-"+u))})})})}const jH="_removed_mgz0k_2",CH="_added_mgz0k_7",rS={removed:jH,added:CH};function EH(e){let t=e.original,n=e.revised;e.ignoreMeta&&(t={...t,meta:void 0},n={...n,meta:void 0});const r=sr(t,!0).match(/[^\r\n]+/g),o=sr(n,!0).match(/[^\r\n]+/g),i=Kk(r,o);return s.jsx("pre",{style:{color:"gray"},children:i.map((a,l)=>s.jsx(PH,{delta:a},"delta"+l))})}function PH(e){return s.jsxs(s.Fragment,{children:["...",s.jsx("br",{}),e.delta.original.lines.length>0&&s.jsx("div",{className:rS.removed,children:e.delta.original.lines.join(`
|
|
523
|
+
`)}),e.delta.revised.lines.length>0&&s.jsx("div",{className:rS.added,children:e.delta.revised.lines.join(`
|
|
524
|
+
`)}),"...",s.jsx("br",{})]})}function Jd(e){const{outcome:t}=e,n=oe(),r=ft(e.defaultValue),[o,i]=p.useState(),[a,l]=p.useState();return p.useEffect(()=>{if(r)if(e.profileUrl){const c=e.profileUrl;n.requestProfileSchema(e.profileUrl,{expandProfile:!0}).then(()=>{const u=Rs(c);if(u){i(u.name);const d=tF(r,u);l(d)}else console.error(`Schema not found for ${c}`)}).catch(u=>{console.error("Error in requestProfileSchema",u)})}else{const c=e.schemaName??(r==null?void 0:r.resourceType);n.requestSchema(c).then(()=>{l(r),i(c)}).catch(console.log)}},[n,r,e.schemaName,e.profileUrl]),!o||!a?s.jsx("div",{children:"Loading..."}):s.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:c=>{c.preventDefault(),e.onSubmit&&e.onSubmit(a)},children:[s.jsxs(De,{mb:"xl",children:[s.jsx(ut,{title:"Resource Type",htmlFor:"resourceType",outcome:t,children:s.jsx(de,{name:"resourceType",defaultValue:a.resourceType,disabled:!0})}),s.jsx(ut,{title:"ID",htmlFor:"id",outcome:t,children:s.jsx(de,{name:"id",defaultValue:a.id,disabled:!0})})]}),s.jsx(xx,{path:a.resourceType,valuePath:a.resourceType,typeName:o,defaultValue:a,outcome:t,onChange:l,profileUrl:e.profileUrl}),s.jsxs(Z,{justify:"flex-end",mt:"xl",children:[s.jsx(re,{type:"submit",children:"OK"}),e.onDelete&&s.jsx(re,{variant:"outline",color:"red",type:"button",onClick:()=>{e.onDelete(a)},children:"Delete"})]})]})}function TH(e){var o;const t=oe(),[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(le,{withTableBorder:!0,withRowBorders:!0,withColumnBorders:!0,children:[s.jsx(le.Thead,{children:s.jsxs(le.Tr,{children:[s.jsx(le.Th,{children:"Author"}),s.jsx(le.Th,{children:"Date"}),s.jsx(le.Th,{children:"Version"})]})}),s.jsx(le.Tbody,{children:(o=n.entry)==null?void 0:o.map((i,a)=>s.jsx(kH,{entry:i},"entry-"+a))})]}):s.jsx("div",{children:"Loading..."})}function kH(e){var r,o,i;const{response:t,resource:n}=e.entry;return n?s.jsxs(le.Tr,{children:[s.jsx(le.Td,{children:s.jsx(ba,{value:(r=n.meta)==null?void 0:r.author,link:!0})}),s.jsx(le.Td,{children:Nn((o=n.meta)==null?void 0:o.lastUpdated)}),s.jsx(le.Td,{children:s.jsx(We,{to:RH(n),children:(i=n.meta)==null?void 0:i.versionId})})]}):s.jsx(le.Tr,{children:s.jsx(le.Td,{colSpan:3,children:Ae(t==null?void 0:t.outcome)})})}function RH(e){var t;return`/${e.resourceType}/${e.id}/_history/${(t=e.meta)==null?void 0:t.versionId}`}function _H(e){return s.jsx(gh,{value:e.serviceRequest,loadTimelineResources:async(t,n,r)=>{const o=`${n}/${r}`,i=100;return Promise.allSettled([t.readHistory("ServiceRequest",r),t.search("Communication",{"based-on":o,_count:i}),t.search("DiagnosticReport",{"based-on":o,_count:i}),t.search("Media",{"based-on":o,_count:i}),t.search("DocumentReference",{related:o,_count:i}),t.search("Task",{_filter:`based-on eq ${o} or focus eq ${o} or subject eq ${o}`,_count:i})])},createCommunication:(t,n,r)=>({resourceType:"Communication",status:"completed",basedOn:[gt(t)],subject:t.subject,sender:gt(n),sent:new Date().toISOString(),payload:[{contentString:r}]}),createMedia:(t,n,r)=>({resourceType:"Media",status:"completed",basedOn:[gt(t)],subject:t.subject,operator:gt(n),issued:new Date().toISOString(),content:r})})}function DH(e){const t=oe(),{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=>ve({color:"red",message:Ae(c),autoClose:!1}))}return s.jsx(Je,{onClick:()=>l(),...a,children:i})}function Yk(e){const t=oe(),[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(dt(i))}},children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Create project"})]}),s.jsxs(De,{gap:"xl",children:[s.jsx(de,{name:"projectName",label:"Project Name",placeholder:"My Project",required:!0,autoFocus:!0,error:Ye(n,"firstName")}),s.jsxs(ue,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Je,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Je,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]})]}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(re,{type:"submit",children:"Create project"})})]})}function Xk(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 Jk(e){const t=oe(),{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"){Xk("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}var IH={MEDPLUM_BASE_URL:"__MEDPLUM_BASE_URL__",MEDPLUM_CLIENT_ID:"__MEDPLUM_CLIENT_ID__",GOOGLE_CLIENT_ID:"__GOOGLE_CLIENT_ID__",RECAPTCHA_SITE_KEY:"__RECAPTCHA_SITE_KEY__",MEDPLUM_REGISTER_ENABLED:"__MEDPLUM_REGISTER_ENABLED__",MEDPLUM_VERSION:"3.1.6-ca2e13ea4",BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0,SSR:!1};function Zk(e){var t;if(e)return e;if(typeof window<"u"){const n=window.location.protocol+"//"+window.location.host;if((((t=IH.GOOGLE_AUTH_ORIGINS)==null?void 0:t.split(","))??[]).includes(n))return"__GOOGLE_CLIENT_ID__"}}function eR(e){typeof grecaptcha>"u"&&Xk("https://www.google.com/recaptcha/api.js?render="+e)}function tR(e){return new Promise((t,n)=>{grecaptcha.ready(async()=>{try{t(await grecaptcha.execute(e,{action:"submit"}))}catch(r){n(r)}})})}function AH(e){const t=Zk(e.googleClientId),n=e.recaptchaSiteKey,r=oe(),[o,i]=p.useState(),a=tu(o,void 0);return p.useEffect(()=>{n&&eR(n)},[n]),s.jsxs(qe,{onSubmit:async l=>{try{let c="";n&&(c=await tR(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(dt(c))}},children:[s.jsx(dn,{style:{flexDirection:"column"},children:e.children}),s.jsx(Kr,{issues:a}),t&&s.jsxs(s.Fragment,{children:[s.jsx(Z,{justify:"center",p:"xl",style:{height:70},children:s.jsx(Jk,{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(dt(c))}}})}),s.jsx(en,{label:"or",labelPosition:"center",my:"lg"})]}),s.jsxs(De,{gap:"xl",children:[s.jsx(de,{name:"firstName",type:"text",label:"First name",placeholder:"First name",required:!0,autoFocus:!0,error:Ye(o,"firstName")}),s.jsx(de,{name:"lastName",type:"text",label:"Last name",placeholder:"Last name",required:!0,error:Ye(o,"lastName")}),s.jsx(de,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,error:Ye(o,"email")}),s.jsx(zr,{name:"password",label:"Password",autoComplete:"off",required:!0,error:Ye(o,"password")}),s.jsxs(ue,{c:"dimmed",size:"xs",children:["By clicking submit you agree to the Medplum"," ",s.jsx(Je,{href:"https://www.medplum.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Je,{href:"https://www.medplum.com/terms",children:"Terms of Service"}),"."]}),s.jsxs(ue,{c:"dimmed",size:"xs",children:["This site is protected by reCAPTCHA and the Google"," ",s.jsx(Je,{href:"https://policies.google.com/privacy",children:"Privacy Policy"})," and ",s.jsx(Je,{href:"https://policies.google.com/terms",children:"Terms of Service"})," apply."]})]}),s.jsxs(Z,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Cr,{name:"remember",label:"Remember me",size:"xs"}),s.jsx(re,{type:"submit",children:"Create account"})]})]})}function NH(e){const{type:t,projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,onSuccess:a}=e,l=oe(),[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(dt(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(Re,{width:450,children:[d&&s.jsx("pre",{children:JSON.stringify(d,null,2)}),!c&&s.jsx(AH,{projectId:n,clientId:r,googleClientId:o,recaptchaSiteKey:i,handleAuthResponse:h,children:e.children}),c&&t==="project"&&s.jsx(Yk,{login:c,handleAuthResponse:h})]})}function MH(e){const[t,n]=p.useState();return t?s.jsx($H,{email:t,...e}):s.jsx(OH,{setEmail:n,...e})}function OH(e){const{setEmail:t,onRegister:n,handleAuthResponse:r,children:o,disableEmailAuth:i,...a}=e,l=oe(),c=!e.disableGoogleAuth&&Zk(e.googleClientId),[u,d]=p.useState(),f=tu(u,void 0),h=p.useCallback(async v=>{if(!v.authorizeUrl)return!1;const S=JSON.stringify({...await l.ensureCodeChallenge(a),domain:v.domain}),y=new URL(v.authorizeUrl);return y.searchParams.set("state",S),window.location.assign(y.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(dt(S))}},[l,a,h,r]);return s.jsxs(qe,{onSubmit:m,children:[s.jsx(dn,{style:{flexDirection:"column"},children:o}),s.jsx(Kr,{issues:f}),c&&s.jsxs(s.Fragment,{children:[s.jsx(Z,{justify:"center",p:"xl",style:{height:70},children:s.jsx(Jk,{googleClientId:c,handleGoogleCredential:g})}),!i&&s.jsx(en,{label:"or",labelPosition:"center",my:"lg"})]}),!i&&s.jsx(de,{name:"email",type:"email",label:"Email",placeholder:"name@domain.com",required:!0,autoFocus:!0,error:Ye(u,"email")}),s.jsxs(Z,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[s.jsx("div",{children:n&&s.jsx(Je,{component:"button",type:"button",color:"dimmed",onClick:n,size:"xs",children:"Register"})}),!i&&s.jsx(re,{type:"submit",children:"Next"})]})]})}function $H(e){const{onForgotPassword:t,handleAuthResponse:n,children:r,...o}=e,i=oe(),[a,l]=p.useState(),c=tu(a,void 0),u=p.useCallback(d=>{i.startLogin({...o,password:d.password,remember:d.remember==="on"}).then(n).catch(f=>l(dt(f)))},[i,o,n]);return s.jsxs(qe,{onSubmit:u,children:[s.jsx(dn,{style:{flexDirection:"column"},children:r}),s.jsx(Kr,{issues:c}),s.jsx(De,{gap:"xl",children:s.jsx(zr,{name:"password",label:"Password",autoComplete:"off",required:!0,autoFocus:!0,error:Ye(a,"password")})}),s.jsxs(Z,{justify:"space-between",mt:"xl",gap:0,wrap:"nowrap",children:[t&&s.jsx(Je,{component:"button",type:"button",c:"dimmed",onClick:t,size:"xs",children:"Forgot password"}),s.jsx(Cr,{id:"remember",name:"remember",label:"Remember me",size:"xs",style:{lineHeight:1}}),s.jsx(re,{type:"submit",children:"Sign in"})]})]})}function LH(e){const t=oe(),n=Oc(),[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(dt(h)))}const d=e.memberships.filter(c).slice(0,10).map(f=>s.jsx(_e.Option,{value:f.id,children:s.jsx(FH,{...f})},f.id));return s.jsxs(De,{children:[s.jsxs(us,{gap:"md",mb:"md",justify:"center",align:"center",direction:"column",wrap:"nowrap",children:[s.jsx(Qr,{size:32}),s.jsx(ce,{order:3,children:"Choose profile"})]}),s.jsx(Kr,{outcome:i}),s.jsxs(_e,{store:n,onOptionSubmit:u,children:[s.jsx(_e.EventsTarget,{children:s.jsx(de,{placeholder:"Search",value:r,onChange:f=>{o(f.currentTarget.value),n.updateSelectedOptionIndex()}})}),s.jsx("div",{children:s.jsx(_e.Options,{children:d.length>0?d:s.jsx(_e.Empty,{children:"Nothing found..."})})})]})]})}function FH(e){var t,n;return s.jsxs(Z,{children:[s.jsx(ds,{radius:"xl"}),s.jsxs("div",{children:[s.jsx(ue,{fz:"sm",fw:500,children:(t=e.profile)==null?void 0:t.display}),s.jsx(ue,{fz:"xs",opacity:.6,children:(n=e.project)==null?void 0:n.display})]})]})}function zH(e){const t=oe();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(De,{children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Choose scope"})]}),s.jsx(De,{children:(e.scope??"openid").split(" ").map(n=>s.jsx(Cr,{id:n,name:n,label:n,defaultChecked:!0},n))}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(re,{type:"submit",children:"Set scope"})})]})})}function VH(e){const t=oe(),[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(De,{children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Enter MFA code"})]}),n&&s.jsx(Es,{icon:s.jsx(Kc,{size:16}),title:"Error",color:"red",children:n}),s.jsx(De,{children:s.jsx(de,{name:"token",label:"MFA code",required:!0,autoFocus:!0})}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(re,{type:"submit",children:"Submit code"})})]})})}function nR(e){const{login:t,chooseScopes:n,onSuccess:r,onForgotPassword:o,onRegister:i,onCode:a,...l}=e,c=oe(),[u,d]=p.useState(),f=p.useRef(!1),[h,m]=p.useState(!1),[g,v]=p.useState(),S=p.useCallback(x=>{a?a(x):c.processCode(x).then(()=>{r&&r()}).catch(b=>ve({color:"red",message:Ae(b)}))},[c,a,r]),y=p.useCallback(x=>{m(!!x.mfaRequired),x.login&&d(x.login),x.memberships&&v(x.memberships),x.code&&(n?v(void 0):S(x.code))},[n,S]),w=p.useCallback(x=>{S(x.code)},[S]);return p.useEffect(()=>{t&&!f.current&&!u&&(f.current=!0,c.get("auth/login/"+t).then(y).catch(x=>ve({color:"red",message:Ae(x)})))},[c,t,f,u,y]),s.jsx(Re,{width:450,px:"sm",py:"md",children:u?h?s.jsx(VH,{login:u,handleAuthResponse:y}):g?s.jsx(LH,{login:u,memberships:g,handleAuthResponse:y}):e.projectId==="new"?s.jsx(Yk,{login:u,handleAuthResponse:y}):e.chooseScopes?s.jsx(zH,{login:u,scope:e.scope,handleAuthResponse:w}):s.jsx("div",{children:"Success"}):s.jsx(MH,{onForgotPassword:o,onRegister:i,handleAuthResponse:y,disableGoogleAuth:e.disableGoogleAuth,disableEmailAuth:e.disableEmailAuth,...l,children:e.children})})}var rR,oS=Dc;rR=oS.createRoot,oS.hydrateRoot;/**
|
|
525
|
+
* @remix-run/router v1.16.1
|
|
526
|
+
*
|
|
527
|
+
* Copyright (c) Remix Software Inc.
|
|
528
|
+
*
|
|
529
|
+
* This source code is licensed under the MIT license found in the
|
|
530
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
531
|
+
*
|
|
532
|
+
* @license MIT
|
|
533
|
+
*/function It(){return It=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},It.apply(this,arguments)}var Bt;(function(e){e.Pop="POP",e.Push="PUSH",e.Replace="REPLACE"})(Bt||(Bt={}));const iS="popstate";function BH(e){e===void 0&&(e={});function t(r,o){let{pathname:i,search:a,hash:l}=r.location;return xc("",{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:su(o)}return HH(t,n,null,e)}function Ue(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Fa(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function UH(){return Math.random().toString(36).substr(2,8)}function sS(e,t){return{usr:e.state,key:e.key,idx:t}}function xc(e,t,n,r){return n===void 0&&(n=null),It({pathname:typeof e=="string"?e:e.pathname,search:"",hash:""},typeof t=="string"?Go(t):t,{state:n,key:t&&t.key||r||UH()})}function su(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 Go(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 HH(e,t,n,r){r===void 0&&(r={});let{window:o=document.defaultView,v5Compat:i=!1}=r,a=o.history,l=Bt.Pop,c=null,u=d();u==null&&(u=0,a.replaceState(It({},a.state,{idx:u}),""));function d(){return(a.state||{idx:null}).idx}function f(){l=Bt.Pop;let S=d(),y=S==null?null:S-u;u=S,c&&c({action:l,location:v.location,delta:y})}function h(S,y){l=Bt.Push;let w=xc(v.location,S,y);u=d()+1;let x=sS(w,u),b=v.createHref(w);try{a.pushState(x,"",b)}catch(C){if(C instanceof DOMException&&C.name==="DataCloneError")throw C;o.location.assign(b)}i&&c&&c({action:l,location:v.location,delta:1})}function m(S,y){l=Bt.Replace;let w=xc(v.location,S,y);u=d();let x=sS(w,u),b=v.createHref(w);a.replaceState(x,"",b),i&&c&&c({action:l,location:v.location,delta:0})}function g(S){let y=o.location.origin!=="null"?o.location.origin:o.location.href,w=typeof S=="string"?S:su(S);return w=w.replace(/ $/,"%20"),Ue(y,"No window.location.(origin|href) available to create URL for href: "+w),new URL(w,y)}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(iS,f),c=S,()=>{o.removeEventListener(iS,f),c=null}},createHref(S){return t(o,S)},createURL:g,encodeLocation(S){let y=g(S);return{pathname:y.pathname,search:y.search,hash:y.hash}},push:h,replace:m,go(S){return a.go(S)}};return v}var Tt;(function(e){e.data="data",e.deferred="deferred",e.redirect="redirect",e.error="error"})(Tt||(Tt={}));const WH=new Set(["lazy","caseSensitive","path","id","index","children"]);function qH(e){return e.index===!0}function rg(e,t,n,r){return n===void 0&&(n=[]),r===void 0&&(r={}),e.map((o,i)=>{let a=[...n,i],l=typeof o.id=="string"?o.id:a.join("-");if(Ue(o.index!==!0||!o.children,"Cannot specify children on an index route"),Ue(!r[l],'Found a route id collision on id "'+l+`". Route id's must be globally unique within Data Router usages`),qH(o)){let c=It({},o,t(o),{id:l});return r[l]=c,c}else{let c=It({},o,t(o),{id:l,children:void 0});return r[l]=c,o.children&&(c.children=rg(o.children,t,a,r)),c}})}function fa(e,t,n){n===void 0&&(n="/");let r=typeof t=="string"?Go(t):t,o=au(r.pathname||"/",n);if(o==null)return null;let i=oR(e);QH(i);let a=null;for(let l=0;a==null&&l<i.length;++l){let c=sW(o);a=rW(i[l],c)}return a}function GH(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 oR(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("/")&&(Ue(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=Ci([r,c.relativePath]),d=n.concat(c);i.children&&i.children.length>0&&(Ue(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),oR(i.children,t,d,u)),!(i.path==null&&!i.index)&&t.push({path:u,score:tW(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 iR(i.path))o(i,a,c)}),t}function iR(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=iR(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 QH(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:nW(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const KH=/^:[\w-]+$/,YH=3,XH=2,JH=1,ZH=10,eW=-2,aS=e=>e==="*";function tW(e,t){let n=e.split("/"),r=n.length;return n.some(aS)&&(r+=eW),t&&(r+=XH),n.filter(o=>!aS(o)).reduce((o,i)=>o+(KH.test(i)?YH:i===""?JH:ZH),r)}function nW(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 rW(e,t){let{routesMeta:n}=e,r={},o="/",i=[];for(let a=0;a<n.length;++a){let l=n[a],c=a===n.length-1,u=o==="/"?t:t.slice(o.length)||"/",d=oW({path:l.relativePath,caseSensitive:l.caseSensitive,end:c},u);if(!d)return null;Object.assign(r,d.params);let f=l.route;i.push({params:r,pathname:Ci([o,d.pathname]),pathnameBase:cW(Ci([o,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(o=Ci([o,d.pathnameBase]))}return i}function oW(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=iW(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 iW(e,t,n){t===void 0&&(t=!1),n===void 0&&(n=!0),Fa(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 sW(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Fa(!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 au(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 aW(e,t){t===void 0&&(t="/");let{pathname:n,search:r="",hash:o=""}=typeof e=="string"?Go(e):e;return{pathname:n?n.startsWith("/")?n:lW(n,t):t,search:uW(r),hash:dW(o)}}function lW(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 Cp(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 sR(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function aR(e,t){let n=sR(e);return t?n.map((r,o)=>o===e.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function lR(e,t,n,r){r===void 0&&(r=!1);let o;typeof e=="string"?o=Go(e):(o=It({},e),Ue(!o.pathname||!o.pathname.includes("?"),Cp("?","pathname","search",o)),Ue(!o.pathname||!o.pathname.includes("#"),Cp("#","pathname","hash",o)),Ue(!o.search||!o.search.includes("#"),Cp("#","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=aW(o,l),u=a&&a!=="/"&&a.endsWith("/"),d=(i||a===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ci=e=>e.join("/").replace(/\/\/+/g,"/"),cW=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),uW=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,dW=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;class Nx{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 Mx(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}const cR=["post","put","patch","delete"],fW=new Set(cR),hW=["get",...cR],pW=new Set(hW),mW=new Set([301,302,303,307,308]),gW=new Set([307,308]),Ep={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},vW={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},wl={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},Ox=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,yW=e=>({hasErrorBoundary:!!e.hasErrorBoundary}),uR="remix-router-transitions";function xW(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;Ue(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 O=e.detectErrorBoundary;o=F=>({hasErrorBoundary:O(F)})}else o=yW;let i={},a=rg(e.routes,o,void 0,i),l,c=e.basename||"/",u=e.unstable_dataStrategy||jW,d=It({v7_fetcherPersist:!1,v7_normalizeFormMethod:!1,v7_partialHydration:!1,v7_prependBasename:!1,v7_relativeSplatPath:!1,unstable_skipActionErrorRevalidation:!1},e.future),f=null,h=new Set,m=null,g=null,v=null,S=e.hydrationData!=null,y=fa(a,e.history.location,c),w=null;if(y==null){let O=pr(404,{pathname:e.history.location.pathname}),{matches:F,route:W}=vS(a);y=F,w={[W.id]:O}}let x,b=y.some(O=>O.route.lazy),C=y.some(O=>O.route.loader);if(b)x=!1;else if(!C)x=!0;else if(d.v7_partialHydration){let O=e.hydrationData?e.hydrationData.loaderData:null,F=e.hydrationData?e.hydrationData.errors:null,W=Q=>Q.route.loader?typeof Q.route.loader=="function"&&Q.route.loader.hydrate===!0?!1:O&&O[Q.route.id]!==void 0||F&&F[Q.route.id]!==void 0:!0;if(F){let Q=y.findIndex(se=>F[se.route.id]!==void 0);x=y.slice(0,Q+1).every(W)}else x=y.every(W)}else x=e.hydrationData!=null;let E,j={historyAction:e.history.action,location:e.history.location,matches:y,initialized:x,navigation:Ep,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||w,fetchers:new Map,blockers:new Map},P=Bt.Pop,_=!1,R,M=!1,D=new Map,N=null,A=!1,L=!1,I=[],k=[],T=new Map,$=0,V=-1,U=new Map,X=new Set,Se=new Map,me=new Map,xe=new Set,Te=new Map,je=new Map,ae=!1;function Be(){if(f=e.history.listen(O=>{let{action:F,location:W,delta:Q}=O;if(ae){ae=!1;return}Fa(je.size===0||Q!=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 se=du({currentLocation:j.location,nextLocation:W,historyAction:F});if(se&&Q!=null){ae=!0,e.history.go(Q*-1),Yo(se,{state:"blocked",location:W,proceed(){Yo(se,{state:"proceeding",proceed:void 0,reset:void 0,location:W}),e.history.go(Q)},reset(){let Ne=new Map(j.blockers);Ne.set(se,wl),ye({blockers:Ne})}});return}return te(F,W)}),n){MW(t,D);let O=()=>OW(t,D);t.addEventListener("pagehide",O),N=()=>t.removeEventListener("pagehide",O)}return j.initialized||te(Bt.Pop,j.location,{initialHydration:!0}),E}function St(){f&&f(),N&&N(),h.clear(),R&&R.abort(),j.fetchers.forEach((O,F)=>gn(F)),j.blockers.forEach((O,F)=>cr(F))}function st(O){return h.add(O),()=>h.delete(O)}function ye(O,F){F===void 0&&(F={}),j=It({},j,O);let W=[],Q=[];d.v7_fetcherPersist&&j.fetchers.forEach((se,Ne)=>{se.state==="idle"&&(xe.has(Ne)?Q.push(Ne):W.push(Ne))}),[...h].forEach(se=>se(j,{deletedFetchers:Q,unstable_viewTransitionOpts:F.viewTransitionOpts,unstable_flushSync:F.flushSync===!0})),d.v7_fetcherPersist&&(W.forEach(se=>j.fetchers.delete(se)),Q.forEach(se=>gn(se)))}function $e(O,F,W){var Q,se;let{flushSync:Ne}=W===void 0?{}:W,Ce=j.actionData!=null&&j.navigation.formMethod!=null&&Mr(j.navigation.formMethod)&&j.navigation.state==="loading"&&((Q=O.state)==null?void 0:Q._isRedirect)!==!0,he;F.actionData?Object.keys(F.actionData).length>0?he=F.actionData:he=null:Ce?he=j.actionData:he=null;let Le=F.loaderData?mS(j.loaderData,F.loaderData,F.matches||[],F.errors):j.loaderData,Me=j.blockers;Me.size>0&&(Me=new Map(Me),Me.forEach((ke,lt)=>Me.set(lt,wl)));let Qt=_===!0||j.navigation.formMethod!=null&&Mr(j.navigation.formMethod)&&((se=O.state)==null?void 0:se._isRedirect)!==!0;l&&(a=l,l=void 0),A||P===Bt.Pop||(P===Bt.Push?e.history.push(O,O.state):P===Bt.Replace&&e.history.replace(O,O.state));let Kt;if(P===Bt.Pop){let ke=D.get(j.location.pathname);ke&&ke.has(O.pathname)?Kt={currentLocation:j.location,nextLocation:O}:D.has(O.pathname)&&(Kt={currentLocation:O,nextLocation:j.location})}else if(M){let ke=D.get(j.location.pathname);ke?ke.add(O.pathname):(ke=new Set([O.pathname]),D.set(j.location.pathname,ke)),Kt={currentLocation:j.location,nextLocation:O}}ye(It({},F,{actionData:he,loaderData:Le,historyAction:P,location:O,initialized:!0,navigation:Ep,revalidation:"idle",restoreScrollPosition:En(O,F.matches||j.matches),preventScrollReset:Qt,blockers:Me}),{viewTransitionOpts:Kt,flushSync:Ne===!0}),P=Bt.Pop,_=!1,M=!1,A=!1,L=!1,I=[],k=[]}async function Ie(O,F){if(typeof O=="number"){e.history.go(O);return}let W=og(j.location,j.matches,c,d.v7_prependBasename,O,d.v7_relativeSplatPath,F==null?void 0:F.fromRouteId,F==null?void 0:F.relative),{path:Q,submission:se,error:Ne}=lS(d.v7_normalizeFormMethod,!1,W,F),Ce=j.location,he=xc(j.location,Q,F&&F.state);he=It({},he,e.history.encodeLocation(he));let Le=F&&F.replace!=null?F.replace:void 0,Me=Bt.Push;Le===!0?Me=Bt.Replace:Le===!1||se!=null&&Mr(se.formMethod)&&se.formAction===j.location.pathname+j.location.search&&(Me=Bt.Replace);let Qt=F&&"preventScrollReset"in F?F.preventScrollReset===!0:void 0,Kt=(F&&F.unstable_flushSync)===!0,ke=du({currentLocation:Ce,nextLocation:he,historyAction:Me});if(ke){Yo(ke,{state:"blocked",location:he,proceed(){Yo(ke,{state:"proceeding",proceed:void 0,reset:void 0,location:he}),Ie(O,F)},reset(){let lt=new Map(j.blockers);lt.set(ke,wl),ye({blockers:lt})}});return}return await te(Me,he,{submission:se,pendingError:Ne,preventScrollReset:Qt,replace:F&&F.replace,enableViewTransition:F&&F.unstable_viewTransition,flushSync:Kt})}function ee(){if(Pt(),ye({revalidation:"loading"}),j.navigation.state!=="submitting"){if(j.navigation.state==="idle"){te(j.historyAction,j.location,{startUninterruptedRevalidation:!0});return}te(P||j.historyAction,j.navigation.location,{overrideNavigation:j.navigation})}}async function te(O,F,W){R&&R.abort(),R=null,P=O,A=(W&&W.startUninterruptedRevalidation)===!0,Xo(j.location,j.matches),_=(W&&W.preventScrollReset)===!0,M=(W&&W.enableViewTransition)===!0;let Q=l||a,se=W&&W.overrideNavigation,Ne=fa(Q,F,c),Ce=(W&&W.flushSync)===!0;if(!Ne){let ke=pr(404,{pathname:F.pathname}),{matches:lt,route:Ve}=vS(Q);Ms(),$e(F,{matches:lt,loaderData:{},errors:{[Ve.id]:ke}},{flushSync:Ce});return}if(j.initialized&&!L&&RW(j.location,F)&&!(W&&W.submission&&Mr(W.submission.formMethod))){$e(F,{matches:Ne},{flushSync:Ce});return}R=new AbortController;let he=Qs(e.history,F,R.signal,W&&W.submission),Le;if(W&&W.pendingError)Le=[zl(Ne).route.id,{type:Tt.error,error:W.pendingError}];else if(W&&W.submission&&Mr(W.submission.formMethod)){let ke=await Ee(he,F,W.submission,Ne,{replace:W.replace,flushSync:Ce});if(ke.shortCircuited)return;Le=ke.pendingActionResult,se=Pp(F,W.submission),Ce=!1,he=Qs(e.history,he.url,he.signal)}let{shortCircuited:Me,loaderData:Qt,errors:Kt}=await Qe(he,F,Ne,se,W&&W.submission,W&&W.fetcherSubmission,W&&W.replace,W&&W.initialHydration===!0,Ce,Le);Me||(R=null,$e(F,It({matches:Ne},gS(Le),{loaderData:Qt,errors:Kt})))}async function Ee(O,F,W,Q,se){se===void 0&&(se={}),Pt();let Ne=AW(F,W);ye({navigation:Ne},{flushSync:se.flushSync===!0});let Ce,he=sg(Q,F);if(!he.route.action&&!he.route.lazy)Ce={type:Tt.error,error:pr(405,{method:O.method,pathname:F.pathname,routeId:he.route.id})};else if(Ce=(await fe("action",O,[he],Q))[0],O.signal.aborted)return{shortCircuited:!0};if(es(Ce)){let Le;return se&&se.replace!=null?Le=se.replace:Le=fS(Ce.response.headers.get("Location"),new URL(O.url),c)===j.location.pathname+j.location.search,await G(O,Ce,{submission:W,replace:Le}),{shortCircuited:!0}}if(Zi(Ce))throw pr(400,{type:"defer-action"});if(vr(Ce)){let Le=zl(Q,he.route.id);return(se&&se.replace)!==!0&&(P=Bt.Push),{pendingActionResult:[Le.route.id,Ce]}}return{pendingActionResult:[he.route.id,Ce]}}async function Qe(O,F,W,Q,se,Ne,Ce,he,Le,Me){let Qt=Q||Pp(F,se),Kt=se||Ne||wS(Qt),ke=l||a,[lt,Ve]=cS(e.history,j,W,Kt,F,d.v7_partialHydration&&he===!0,d.unstable_skipActionErrorRevalidation,L,I,k,xe,Se,X,ke,c,Me);if(Ms(Xe=>!(W&&W.some(Pn=>Pn.route.id===Xe))||lt&<.some(Pn=>Pn.route.id===Xe)),V=++$,lt.length===0&&Ve.length===0){let Xe=Ns();return $e(F,It({matches:W,loaderData:{},errors:Me&&vr(Me[1])?{[Me[0]]:Me[1].error}:null},gS(Me),Xe?{fetchers:new Map(j.fetchers)}:{}),{flushSync:Le}),{shortCircuited:!0}}if(!A&&(!d.v7_partialHydration||!he)){Ve.forEach(Pn=>{let ur=j.fetchers.get(Pn.key),ln=Sl(void 0,ur?ur.data:void 0);j.fetchers.set(Pn.key,ln)});let Xe;Me&&!vr(Me[1])?Xe={[Me[0]]:Me[1].data}:j.actionData&&(Object.keys(j.actionData).length===0?Xe=null:Xe=j.actionData),ye(It({navigation:Qt},Xe!==void 0?{actionData:Xe}:{},Ve.length>0?{fetchers:new Map(j.fetchers)}:{}),{flushSync:Le})}Ve.forEach(Xe=>{T.has(Xe.key)&&an(Xe.key),Xe.controller&&T.set(Xe.key,Xe.controller)});let mo=()=>Ve.forEach(Xe=>an(Xe.key));R&&R.signal.addEventListener("abort",mo);let{loaderResults:Rr,fetcherResults:go}=await tt(j.matches,W,lt,Ve,O);if(O.signal.aborted)return{shortCircuited:!0};R&&R.signal.removeEventListener("abort",mo),Ve.forEach(Xe=>T.delete(Xe.key));let Jo=yS([...Rr,...go]);if(Jo){if(Jo.idx>=lt.length){let Xe=Ve[Jo.idx-lt.length].key;X.add(Xe)}return await G(O,Jo.result,{replace:Ce}),{shortCircuited:!0}}let{loaderData:$s,errors:Yr}=pS(j,W,lt,Rr,Me,Ve,go,Te);Te.forEach((Xe,Pn)=>{Xe.subscribe(ur=>{(ur||Xe.done)&&Te.delete(Pn)})}),d.v7_partialHydration&&he&&j.errors&&Object.entries(j.errors).filter(Xe=>{let[Pn]=Xe;return!lt.some(ur=>ur.route.id===Pn)}).forEach(Xe=>{let[Pn,ur]=Xe;Yr=Object.assign(Yr||{},{[Pn]:ur})});let fu=Ns(),hu=uu(V),pu=fu||hu||Ve.length>0;return It({loaderData:$s,errors:Yr},pu?{fetchers:new Map(j.fetchers)}:{})}function Ke(O,F,W,Q){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.");T.has(O)&&an(O);let se=(Q&&Q.unstable_flushSync)===!0,Ne=l||a,Ce=og(j.location,j.matches,c,d.v7_prependBasename,W,d.v7_relativeSplatPath,F,Q==null?void 0:Q.relative),he=fa(Ne,Ce,c);if(!he){Ot(O,F,pr(404,{pathname:Ce}),{flushSync:se});return}let{path:Le,submission:Me,error:Qt}=lS(d.v7_normalizeFormMethod,!0,Ce,Q);if(Qt){Ot(O,F,Qt,{flushSync:se});return}let Kt=sg(he,Le);if(_=(Q&&Q.preventScrollReset)===!0,Me&&Mr(Me.formMethod)){Fe(O,F,Le,Kt,he,se,Me);return}Se.set(O,{routeId:F,path:Le}),K(O,F,Le,Kt,he,se,Me)}async function Fe(O,F,W,Q,se,Ne,Ce){if(Pt(),Se.delete(O),!Q.route.action&&!Q.route.lazy){let ln=pr(405,{method:Ce.formMethod,pathname:W,routeId:F});Ot(O,F,ln,{flushSync:Ne});return}let he=j.fetchers.get(O);ht(O,NW(Ce,he),{flushSync:Ne});let Le=new AbortController,Me=Qs(e.history,W,Le.signal,Ce);T.set(O,Le);let Qt=$,ke=(await fe("action",Me,[Q],se))[0];if(Me.signal.aborted){T.get(O)===Le&&T.delete(O);return}if(d.v7_fetcherPersist&&xe.has(O)){if(es(ke)||vr(ke)){ht(O,ti(void 0));return}}else{if(es(ke))if(T.delete(O),V>Qt){ht(O,ti(void 0));return}else return X.add(O),ht(O,Sl(Ce)),G(Me,ke,{fetcherSubmission:Ce});if(vr(ke)){Ot(O,F,ke.error);return}}if(Zi(ke))throw pr(400,{type:"defer-action"});let lt=j.navigation.location||j.location,Ve=Qs(e.history,lt,Le.signal),mo=l||a,Rr=j.navigation.state!=="idle"?fa(mo,j.navigation.location,c):j.matches;Ue(Rr,"Didn't find any matches after fetcher action");let go=++$;U.set(O,go);let Jo=Sl(Ce,ke.data);j.fetchers.set(O,Jo);let[$s,Yr]=cS(e.history,j,Rr,Ce,lt,!1,d.unstable_skipActionErrorRevalidation,L,I,k,xe,Se,X,mo,c,[Q.route.id,ke]);Yr.filter(ln=>ln.key!==O).forEach(ln=>{let sl=ln.key,Wx=j.fetchers.get(sl),FR=Sl(void 0,Wx?Wx.data:void 0);j.fetchers.set(sl,FR),T.has(sl)&&an(sl),ln.controller&&T.set(sl,ln.controller)}),ye({fetchers:new Map(j.fetchers)});let fu=()=>Yr.forEach(ln=>an(ln.key));Le.signal.addEventListener("abort",fu);let{loaderResults:hu,fetcherResults:pu}=await tt(j.matches,Rr,$s,Yr,Ve);if(Le.signal.aborted)return;Le.signal.removeEventListener("abort",fu),U.delete(O),T.delete(O),Yr.forEach(ln=>T.delete(ln.key));let Xe=yS([...hu,...pu]);if(Xe){if(Xe.idx>=$s.length){let ln=Yr[Xe.idx-$s.length].key;X.add(ln)}return G(Ve,Xe.result)}let{loaderData:Pn,errors:ur}=pS(j,j.matches,$s,hu,void 0,Yr,pu,Te);if(j.fetchers.has(O)){let ln=ti(ke.data);j.fetchers.set(O,ln)}uu(go),j.navigation.state==="loading"&&go>V?(Ue(P,"Expected pending action"),R&&R.abort(),$e(j.navigation.location,{matches:Rr,loaderData:Pn,errors:ur,fetchers:new Map(j.fetchers)})):(ye({errors:ur,loaderData:mS(j.loaderData,Pn,Rr,ur),fetchers:new Map(j.fetchers)}),L=!1)}async function K(O,F,W,Q,se,Ne,Ce){let he=j.fetchers.get(O);ht(O,Sl(Ce,he?he.data:void 0),{flushSync:Ne});let Le=new AbortController,Me=Qs(e.history,W,Le.signal);T.set(O,Le);let Qt=$,ke=(await fe("loader",Me,[Q],se))[0];if(Zi(ke)&&(ke=await pR(ke,Me.signal,!0)||ke),T.get(O)===Le&&T.delete(O),!Me.signal.aborted){if(xe.has(O)){ht(O,ti(void 0));return}if(es(ke))if(V>Qt){ht(O,ti(void 0));return}else{X.add(O),await G(Me,ke);return}if(vr(ke)){Ot(O,F,ke.error);return}Ue(!Zi(ke),"Unhandled fetcher deferred data"),ht(O,ti(ke.data))}}async function G(O,F,W){let{submission:Q,fetcherSubmission:se,replace:Ne}=W===void 0?{}:W;F.response.headers.has("X-Remix-Revalidate")&&(L=!0);let Ce=F.response.headers.get("Location");Ue(Ce,"Expected a Location header on the redirect Response"),Ce=fS(Ce,new URL(O.url),c);let he=xc(j.location,Ce,{_isRedirect:!0});if(n){let lt=!1;if(F.response.headers.has("X-Remix-Reload-Document"))lt=!0;else if(Ox.test(Ce)){const Ve=e.history.createURL(Ce);lt=Ve.origin!==t.location.origin||au(Ve.pathname,c)==null}if(lt){Ne?t.location.replace(Ce):t.location.assign(Ce);return}}R=null;let Le=Ne===!0?Bt.Replace:Bt.Push,{formMethod:Me,formAction:Qt,formEncType:Kt}=j.navigation;!Q&&!se&&Me&&Qt&&Kt&&(Q=wS(j.navigation));let ke=Q||se;if(gW.has(F.response.status)&&ke&&Mr(ke.formMethod))await te(Le,he,{submission:It({},ke,{formAction:Ce}),preventScrollReset:_});else{let lt=Pp(he,Q);await te(Le,he,{overrideNavigation:lt,fetcherSubmission:se,preventScrollReset:_})}}async function fe(O,F,W,Q){try{let se=await CW(u,O,F,W,Q,i,o);return await Promise.all(se.map((Ne,Ce)=>{if(_W(Ne)){let he=Ne.result;return{type:Tt.redirect,response:TW(he,F,W[Ce].route.id,Q,c,d.v7_relativeSplatPath)}}return PW(Ne)}))}catch(se){return W.map(()=>({type:Tt.error,error:se}))}}async function tt(O,F,W,Q,se){let[Ne,...Ce]=await Promise.all([W.length?fe("loader",se,W,F):[],...Q.map(he=>{if(he.matches&&he.match&&he.controller){let Le=Qs(e.history,he.path,he.controller.signal);return fe("loader",Le,[he.match],he.matches).then(Me=>Me[0])}else return Promise.resolve({type:Tt.error,error:pr(404,{pathname:he.path})})})]);return await Promise.all([xS(O,W,Ne,Ne.map(()=>se.signal),!1,j.loaderData),xS(O,Q.map(he=>he.match),Ce,Q.map(he=>he.controller?he.controller.signal:null),!0)]),{loaderResults:Ne,fetcherResults:Ce}}function Pt(){L=!0,I.push(...Ms()),Se.forEach((O,F)=>{T.has(F)&&(k.push(F),an(F))})}function ht(O,F,W){W===void 0&&(W={}),j.fetchers.set(O,F),ye({fetchers:new Map(j.fetchers)},{flushSync:(W&&W.flushSync)===!0})}function Ot(O,F,W,Q){Q===void 0&&(Q={});let se=zl(j.matches,F);gn(O),ye({errors:{[se.route.id]:W},fetchers:new Map(j.fetchers)},{flushSync:(Q&&Q.flushSync)===!0})}function Gt(O){return d.v7_fetcherPersist&&(me.set(O,(me.get(O)||0)+1),xe.has(O)&&xe.delete(O)),j.fetchers.get(O)||vW}function gn(O){let F=j.fetchers.get(O);T.has(O)&&!(F&&F.state==="loading"&&U.has(O))&&an(O),Se.delete(O),U.delete(O),X.delete(O),xe.delete(O),j.fetchers.delete(O)}function po(O){if(d.v7_fetcherPersist){let F=(me.get(O)||0)-1;F<=0?(me.delete(O),xe.add(O)):me.set(O,F)}else gn(O);ye({fetchers:new Map(j.fetchers)})}function an(O){let F=T.get(O);Ue(F,"Expected fetch controller: "+O),F.abort(),T.delete(O)}function Ko(O){for(let F of O){let W=Gt(F),Q=ti(W.data);j.fetchers.set(F,Q)}}function Ns(){let O=[],F=!1;for(let W of X){let Q=j.fetchers.get(W);Ue(Q,"Expected fetcher: "+W),Q.state==="loading"&&(X.delete(W),O.push(W),F=!0)}return Ko(O),F}function uu(O){let F=[];for(let[W,Q]of U)if(Q<O){let se=j.fetchers.get(W);Ue(se,"Expected fetcher: "+W),se.state==="loading"&&(an(W),U.delete(W),F.push(W))}return Ko(F),F.length>0}function Eh(O,F){let W=j.blockers.get(O)||wl;return je.get(O)!==F&&je.set(O,F),W}function cr(O){j.blockers.delete(O),je.delete(O)}function Yo(O,F){let W=j.blockers.get(O)||wl;Ue(W.state==="unblocked"&&F.state==="blocked"||W.state==="blocked"&&F.state==="blocked"||W.state==="blocked"&&F.state==="proceeding"||W.state==="blocked"&&F.state==="unblocked"||W.state==="proceeding"&&F.state==="unblocked","Invalid blocker state transition: "+W.state+" -> "+F.state);let Q=new Map(j.blockers);Q.set(O,F),ye({blockers:Q})}function du(O){let{currentLocation:F,nextLocation:W,historyAction:Q}=O;if(je.size===0)return;je.size>1&&Fa(!1,"A router only supports one blocker at a time");let se=Array.from(je.entries()),[Ne,Ce]=se[se.length-1],he=j.blockers.get(Ne);if(!(he&&he.state==="proceeding")&&Ce({currentLocation:F,nextLocation:W,historyAction:Q}))return Ne}function Ms(O){let F=[];return Te.forEach((W,Q)=>{(!O||O(Q))&&(W.cancel(),F.push(Q),Te.delete(Q))}),F}function il(O,F,W){if(m=O,v=F,g=W||null,!S&&j.navigation===Ep){S=!0;let Q=En(j.location,j.matches);Q!=null&&ye({restoreScrollPosition:Q})}return()=>{m=null,v=null,g=null}}function Os(O,F){return g&&g(O,F.map(Q=>GH(Q,j.loaderData)))||O.key}function Xo(O,F){if(m&&v){let W=Os(O,F);m[W]=v()}}function En(O,F){if(m){let W=Os(O,F),Q=m[W];if(typeof Q=="number")return Q}return null}function Ph(O){i={},l=rg(O,o,void 0,i)}return E={get basename(){return c},get future(){return d},get state(){return j},get routes(){return a},get window(){return t},initialize:Be,subscribe:st,enableScrollRestoration:il,navigate:Ie,fetch:Ke,revalidate:ee,createHref:O=>e.history.createHref(O),encodeLocation:O=>e.history.encodeLocation(O),getFetcher:Gt,deleteFetcher:po,dispose:St,getBlocker:Eh,deleteBlocker:cr,_internalFetchControllers:T,_internalActiveDeferreds:Te,_internalSetRoutes:Ph},E}function wW(e){return e!=null&&("formData"in e&&e.formData!=null||"body"in e&&e.body!==void 0)}function og(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=lR(o||".",aR(c,i),au(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&&!$x(d.search)&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r&&n!=="/"&&(d.pathname=d.pathname==="/"?n:Ci([n,d.pathname])),su(d)}function lS(e,t,n,r){if(!r||!wW(r))return{path:n};if(r.formMethod&&!IW(r.formMethod))return{path:n,error:pr(405,{method:r.formMethod})};let o=()=>({path:n,error:pr(400,{type:"invalid-body"})}),i=r.formMethod||"get",a=e?i.toUpperCase():i.toLowerCase(),l=fR(n);if(r.body!==void 0){if(r.formEncType==="text/plain"){if(!Mr(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+`
|
|
534
|
+
`},""):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(!Mr(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()}}}Ue(typeof FormData=="function","FormData is not available in this environment");let c,u;if(r.formData)c=ig(r.formData),u=r.formData;else if(r.body instanceof FormData)c=ig(r.body),u=r.body;else if(r.body instanceof URLSearchParams)c=r.body,u=hS(c);else if(r.body==null)c=new URLSearchParams,u=new FormData;else try{c=new URLSearchParams(r.body),u=hS(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(Mr(d.formMethod))return{path:n,submission:d};let f=Go(n);return t&&f.search&&$x(f.search)&&c.append("index",""),f.search="?"+c,{path:su(f),submission:d}}function SW(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 cS(e,t,n,r,o,i,a,l,c,u,d,f,h,m,g,v){let S=v?vr(v[1])?v[1].error:v[1].data:void 0,y=e.createURL(t.location),w=e.createURL(o),x=v&&vr(v[1])?v[0]:void 0,b=x?SW(n,x):n,C=v?v[1].statusCode:void 0,E=a&&C&&C>=400,j=b.filter((_,R)=>{let{route:M}=_;if(M.lazy)return!0;if(M.loader==null)return!1;if(i)return typeof M.loader!="function"||M.loader.hydrate?!0:t.loaderData[M.id]===void 0&&(!t.errors||t.errors[M.id]===void 0);if(bW(t.loaderData,t.matches[R],_)||c.some(A=>A===_.route.id))return!0;let D=t.matches[R],N=_;return uS(_,It({currentUrl:y,currentParams:D.params,nextUrl:w,nextParams:N.params},r,{actionResult:S,unstable_actionStatus:C,defaultShouldRevalidate:E?!1:l||y.pathname+y.search===w.pathname+w.search||y.search!==w.search||dR(D,N)}))}),P=[];return f.forEach((_,R)=>{if(i||!n.some(L=>L.route.id===_.routeId)||d.has(R))return;let M=fa(m,_.path,g);if(!M){P.push({key:R,routeId:_.routeId,path:_.path,matches:null,match:null,controller:null});return}let D=t.fetchers.get(R),N=sg(M,_.path),A=!1;h.has(R)?A=!1:u.includes(R)?A=!0:D&&D.state!=="idle"&&D.data===void 0?A=l:A=uS(N,It({currentUrl:y,currentParams:t.matches[t.matches.length-1].params,nextUrl:w,nextParams:n[n.length-1].params},r,{actionResult:S,unstable_actionStatus:C,defaultShouldRevalidate:E?!1:l})),A&&P.push({key:R,routeId:_.routeId,path:_.path,matches:M,match:N,controller:new AbortController})}),[j,P]}function bW(e,t,n){let r=!t||n.route.id!==t.route.id,o=e[n.route.id]===void 0;return r||o}function dR(e,t){let n=e.route.path;return e.pathname!==t.pathname||n!=null&&n.endsWith("*")&&e.params["*"]!==t.params["*"]}function uS(e,t){if(e.route.shouldRevalidate){let n=e.route.shouldRevalidate(t);if(typeof n=="boolean")return n}return t.defaultShouldRevalidate}async function dS(e,t,n){if(!e.lazy)return;let r=await e.lazy();if(!e.lazy)return;let o=n[e.id];Ue(o,"No route found in manifest");let i={};for(let a in r){let c=o[a]!==void 0&&a!=="hasErrorBoundary";Fa(!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&&!WH.has(a)&&(i[a]=r[a])}Object.assign(o,i),Object.assign(o,It({},t(o),{lazy:void 0}))}function jW(e){return Promise.all(e.matches.map(t=>t.resolve()))}async function CW(e,t,n,r,o,i,a,l){let c=r.reduce((f,h)=>f.add(h.route.id),new Set),u=new Set,d=await e({matches:o.map(f=>{let h=c.has(f.route.id);return It({},f,{shouldLoad:h,resolve:g=>(u.add(f.route.id),h?EW(t,n,f,i,a,g,l):Promise.resolve({type:Tt.data,result:void 0}))})}),request:n,params:o[0].params,context:l});return o.forEach(f=>Ue(u.has(f.route.id),'`match.resolve()` was not called for route id "'+f.route.id+'". You must call `match.resolve()` on every match passed to `dataStrategy` to ensure all routes are properly loaded.')),d.filter((f,h)=>c.has(o[h].route.id))}async function EW(e,t,n,r,o,i,a){let l,c,u=d=>{let f,h=new Promise((v,S)=>f=S);c=()=>f(),t.signal.addEventListener("abort",c);let m=v=>typeof d!="function"?Promise.reject(new Error("You cannot call the handler for a route which defines a boolean "+('"'+e+'" [routeId: '+n.route.id+"]"))):d({request:t,params:n.params,context:a},...v!==void 0?[v]:[]),g;return i?g=i(v=>m(v)):g=(async()=>{try{return{type:"data",result:await m()}}catch(v){return{type:"error",result:v}}})(),Promise.race([g,h])};try{let d=n.route[e];if(n.route.lazy)if(d){let f,[h]=await Promise.all([u(d).catch(m=>{f=m}),dS(n.route,o,r)]);if(f!==void 0)throw f;l=h}else if(await dS(n.route,o,r),d=n.route[e],d)l=await u(d);else if(e==="action"){let f=new URL(t.url),h=f.pathname+f.search;throw pr(405,{method:t.method,pathname:h,routeId:n.route.id})}else return{type:Tt.data,result:void 0};else if(d)l=await u(d);else{let f=new URL(t.url),h=f.pathname+f.search;throw pr(404,{pathname:h})}Ue(l.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(d){return{type:Tt.error,result:d}}finally{c&&t.signal.removeEventListener("abort",c)}return l}async function PW(e){let{result:t,type:n,status:r}=e;if(hR(t)){let a;try{let l=t.headers.get("Content-Type");l&&/\bapplication\/json\b/.test(l)?t.body==null?a=null:a=await t.json():a=await t.text()}catch(l){return{type:Tt.error,error:l}}return n===Tt.error?{type:Tt.error,error:new Nx(t.status,t.statusText,a),statusCode:t.status,headers:t.headers}:{type:Tt.data,data:a,statusCode:t.status,headers:t.headers}}if(n===Tt.error)return{type:Tt.error,error:t,statusCode:Mx(t)?t.status:r};if(DW(t)){var o,i;return{type:Tt.deferred,deferredData:t,statusCode:(o=t.init)==null?void 0:o.status,headers:((i=t.init)==null?void 0:i.headers)&&new Headers(t.init.headers)}}return{type:Tt.data,data:t,statusCode:r}}function TW(e,t,n,r,o,i){let a=e.headers.get("Location");if(Ue(a,"Redirects returned/thrown from loaders/actions must have a Location header"),!Ox.test(a)){let l=r.slice(0,r.findIndex(c=>c.route.id===n)+1);a=og(new URL(t.url),l,o,!0,a,i),e.headers.set("Location",a)}return e}function fS(e,t,n){if(Ox.test(e)){let r=e,o=r.startsWith("//")?new URL(t.protocol+r):new URL(r),i=au(o.pathname,n)!=null;if(o.origin===t.origin&&i)return o.pathname+o.search+o.hash}return e}function Qs(e,t,n,r){let o=e.createURL(fR(t)).toString(),i={signal:n};if(r&&Mr(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=ig(r.formData):i.body=r.formData}return new Request(o,i)}function ig(e){let t=new URLSearchParams;for(let[n,r]of e.entries())t.append(n,typeof r=="string"?r:r.name);return t}function hS(e){let t=new FormData;for(let[n,r]of e.entries())t.append(n,r);return t}function kW(e,t,n,r,o,i){let a={},l=null,c,u=!1,d={},f=r&&vr(r[1])?r[1].error:void 0;return n.forEach((h,m)=>{let g=t[m].route.id;if(Ue(!es(h),"Cannot handle redirect results in processLoaderData"),vr(h)){let v=h.error;f!==void 0&&(v=f,f=void 0),l=l||{};{let S=zl(e,g);l[S.route.id]==null&&(l[S.route.id]=v)}a[g]=void 0,u||(u=!0,c=Mx(h.error)?h.error.status:500),h.headers&&(d[g]=h.headers)}else Zi(h)?(o.set(g,h.deferredData),a[g]=h.deferredData.data,h.statusCode!=null&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[g]=h.headers)):(a[g]=h.data,h.statusCode&&h.statusCode!==200&&!u&&(c=h.statusCode),h.headers&&(d[g]=h.headers))}),f!==void 0&&r&&(l={[r[0]]:f},a[r[0]]=void 0),{loaderData:a,errors:l,statusCode:c||200,loaderHeaders:d}}function pS(e,t,n,r,o,i,a,l){let{loaderData:c,errors:u}=kW(t,n,r,o,l);for(let d=0;d<i.length;d++){let{key:f,match:h,controller:m}=i[d];Ue(a!==void 0&&a[d]!==void 0,"Did not find corresponding fetcher result");let g=a[d];if(!(m&&m.signal.aborted))if(vr(g)){let v=zl(e.matches,h==null?void 0:h.route.id);u&&u[v.route.id]||(u=It({},u,{[v.route.id]:g.error})),e.fetchers.delete(f)}else if(es(g))Ue(!1,"Unhandled fetcher revalidation redirect");else if(Zi(g))Ue(!1,"Unhandled fetcher deferred data");else{let v=ti(g.data);e.fetchers.set(f,v)}}return{loaderData:c,errors:u}}function mS(e,t,n,r){let o=It({},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 gS(e){return e?vr(e[1])?{actionData:{}}:{actionData:{[e[0]]:e[1].data}}:{}}function zl(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 vS(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 pr(e,t){let{pathname:n,routeId:r,method:o,type:i}=t===void 0?{}:t,a="Unknown Server Error",l="Unknown @remix-run/router error";return e===400?(a="Bad Request",o&&n&&r?l="You made a "+o+' request to "'+n+'" but '+('did not provide a `loader` for route "'+r+'", ')+"so there is no way to handle the request.":i==="defer-action"?l="defer() is not supported in actions":i==="invalid-body"&&(l="Unable to encode submission body")):e===403?(a="Forbidden",l='Route "'+r+'" does not match URL "'+n+'"'):e===404?(a="Not Found",l='No route matches URL "'+n+'"'):e===405&&(a="Method Not Allowed",o&&n&&r?l="You made a "+o.toUpperCase()+' request to "'+n+'" but '+('did not provide an `action` for route "'+r+'", ')+"so there is no way to handle the request.":o&&(l='Invalid request method "'+o.toUpperCase()+'"')),new Nx(e||500,a,new Error(l),!0)}function yS(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(es(n))return{result:n,idx:t}}}function fR(e){let t=typeof e=="string"?Go(e):e;return su(It({},t,{hash:""}))}function RW(e,t){return e.pathname!==t.pathname||e.search!==t.search?!1:e.hash===""?t.hash!=="":e.hash===t.hash?!0:t.hash!==""}function _W(e){return hR(e.result)&&mW.has(e.result.status)}function Zi(e){return e.type===Tt.deferred}function vr(e){return e.type===Tt.error}function es(e){return(e&&e.type)===Tt.redirect}function DW(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 hR(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.headers=="object"&&typeof e.body<"u"}function IW(e){return pW.has(e.toLowerCase())}function Mr(e){return fW.has(e.toLowerCase())}async function xS(e,t,n,r,o,i){for(let a=0;a<n.length;a++){let l=n[a],c=t[a];if(!c)continue;let u=e.find(f=>f.route.id===c.route.id),d=u!=null&&!dR(u,c)&&(i&&i[c.route.id])!==void 0;if(Zi(l)&&(o||d)){let f=r[a];Ue(f,"Expected an AbortSignal for revalidating fetcher deferred result"),await pR(l,f,o).then(h=>{h&&(n[a]=h||n[a])})}}}async function pR(e,t,n){if(n===void 0&&(n=!1),!await e.deferredData.resolveData(t)){if(n)try{return{type:Tt.data,data:e.deferredData.unwrappedData}}catch(o){return{type:Tt.error,error:o}}return{type:Tt.data,data:e.deferredData.data}}}function $x(e){return new URLSearchParams(e).getAll("index").some(t=>t==="")}function sg(e,t){let n=typeof t=="string"?Go(t).search:t.search;if(e[e.length-1].route.index&&$x(n||""))return e[e.length-1];let r=sR(e);return r[r.length-1]}function wS(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 Pp(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 AW(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 Sl(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 NW(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 ti(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 MW(e,t){try{let n=e.sessionStorage.getItem(uR);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 OW(e,t){if(t.size>0){let n={};for(let[r,o]of t)n[r]=[...o];try{e.sessionStorage.setItem(uR,JSON.stringify(n))}catch(r){Fa(!1,"Failed to save applied view transitions in sessionStorage ("+r+").")}}}/**
|
|
535
|
+
* React Router v6.23.1
|
|
536
|
+
*
|
|
537
|
+
* Copyright (c) Remix Software Inc.
|
|
538
|
+
*
|
|
539
|
+
* This source code is licensed under the MIT license found in the
|
|
540
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
541
|
+
*
|
|
542
|
+
* @license MIT
|
|
543
|
+
*/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 yh=p.createContext(null),mR=p.createContext(null),xh=p.createContext(null),wh=p.createContext(null),$i=p.createContext({outlet:null,matches:[],isDataRoute:!1}),gR=p.createContext(null);function Sh(){return p.useContext(wh)!=null}function Qo(){return Sh()||Ue(!1),p.useContext(wh).location}function vR(e){p.useContext(xh).static||p.useLayoutEffect(e)}function Vt(){let{isDataRoute:e}=p.useContext($i);return e?YW():$W()}function $W(){Sh()||Ue(!1);let e=p.useContext(yh),{basename:t,future:n,navigator:r}=p.useContext(xh),{matches:o}=p.useContext($i),{pathname:i}=Qo(),a=JSON.stringify(aR(o,n.v7_relativeSplatPath)),l=p.useRef(!1);return vR(()=>{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=lR(u,JSON.parse(a),i,d.relative==="path");e==null&&t!=="/"&&(f.pathname=f.pathname==="/"?t:Ci([t,f.pathname])),(d.replace?r.replace:r.push)(f,d.state,d)},[t,r,a,i,e])}const LW=p.createContext(null);function FW(e){let t=p.useContext($i).outlet;return t&&p.createElement(LW.Provider,{value:e},t)}function rt(){let{matches:e}=p.useContext($i),t=e[e.length-1];return t?t.params:{}}function zW(e,t){return yR(e,t)}function yR(e,t,n,r){Sh()||Ue(!1);let{navigator:o}=p.useContext(xh),{matches:i}=p.useContext($i),a=i[i.length-1],l=a?a.params:{};a&&a.pathname;let c=a?a.pathnameBase:"/";a&&a.route;let u=Qo(),d;if(t){var f;let S=typeof t=="string"?Go(t):t;c==="/"||(f=S.pathname)!=null&&f.startsWith(c)||Ue(!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=fa(e,{pathname:m}),v=WW(g&&g.map(S=>Object.assign({},S,{params:Object.assign({},l,S.params),pathname:Ci([c,o.encodeLocation?o.encodeLocation(S.pathname).pathname:S.pathname]),pathnameBase:S.pathnameBase==="/"?c:Ci([c,o.encodeLocation?o.encodeLocation(S.pathnameBase).pathname:S.pathnameBase])})),i,n,r);return t&&v?p.createElement(wh.Provider,{value:{location:wc({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Bt.Pop}},v):v}function VW(){let e=KW(),t=Mx(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 BW=p.createElement(VW,null);class UW 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($i.Provider,{value:this.props.routeContext},p.createElement(gR.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function HW(e){let{routeContext:t,match:n,children:r}=e,o=p.useContext(yh);return o&&o.static&&o.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(o.staticContext._deepestRenderedBoundaryId=n.route.id),p.createElement($i.Provider,{value:t},r)}function WW(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((i=n)!=null&&i.errors)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||Ue(!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||BW,c&&(u<0&&h===0?(XW("route-fallback"),g=!0,S=null):u===h&&(g=!0,S=f.route.hydrateFallbackElement||null)));let y=t.concat(a.slice(0,h+1)),w=()=>{let x;return m?x=v:g?x=S:f.route.Component?x=p.createElement(f.route.Component,null):f.route.element?x=f.route.element:x=d,p.createElement(HW,{match:f,routeContext:{outlet:d,matches:y,isDataRoute:n!=null},children:x})};return n&&(f.route.ErrorBoundary||f.route.errorElement||h===0)?p.createElement(UW,{location:n.location,revalidation:n.revalidation,component:v,error:m,children:w(),routeContext:{outlet:null,matches:y,isDataRoute:!0}}):w()},null)}var xR=function(e){return e.UseBlocker="useBlocker",e.UseRevalidator="useRevalidator",e.UseNavigateStable="useNavigate",e}(xR||{}),Zd=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}(Zd||{});function qW(e){let t=p.useContext(yh);return t||Ue(!1),t}function GW(e){let t=p.useContext(mR);return t||Ue(!1),t}function QW(e){let t=p.useContext($i);return t||Ue(!1),t}function wR(e){let t=QW(),n=t.matches[t.matches.length-1];return n.route.id||Ue(!1),n.route.id}function KW(){var e;let t=p.useContext(gR),n=GW(Zd.UseRouteError),r=wR(Zd.UseRouteError);return t!==void 0?t:(e=n.errors)==null?void 0:e[r]}function YW(){let{router:e}=qW(xR.UseNavigateStable),t=wR(Zd.UseNavigateStable),n=p.useRef(!1);return vR(()=>{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 SS={};function XW(e,t,n){SS[e]||(SS[e]=!0)}function Lx(e){return FW(e.context)}function we(e){Ue(!1)}function JW(e){let{basename:t="/",children:n=null,location:r,navigationType:o=Bt.Pop,navigator:i,static:a=!1,future:l}=e;Sh()&&Ue(!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=Go(r));let{pathname:d="/",search:f="",hash:h="",state:m=null,key:g="default"}=r,v=p.useMemo(()=>{let S=au(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(xh.Provider,{value:u},p.createElement(wh.Provider,{children:n,value:v}))}function ZW(e){let{children:t,location:n}=e;return zW(ag(t),n)}new Promise(()=>{});function ag(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,ag(r.props.children,i));return}r.type!==we&&Ue(!1),!r.props.index||!r.props.children||Ue(!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=ag(r.props.children,i)),n.push(a)}),n}function eq(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}/**
|
|
544
|
+
* React Router DOM v6.23.1
|
|
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 ef(){return ef=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},ef.apply(this,arguments)}function lg(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 tq(e,t){let n=lg(e);return t&&t.forEach((r,o)=>{n.has(o)||t.getAll(o).forEach(i=>{n.append(o,i)})}),n}const nq="6";try{window.__reactRouterVersion=nq}catch{}function rq(e,t){return xW({basename:void 0,future:ef({},void 0,{v7_prependBasename:!0}),history:BH({window:void 0}),hydrationData:oq(),routes:e,mapRouteProperties:eq,unstable_dataStrategy:void 0,window:void 0}).initialize()}function oq(){var e;let t=(e=window)==null?void 0:e.__staticRouterHydrationData;return t&&t.errors&&(t=ef({},t,{errors:iq(t.errors)})),t}function iq(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 Nx(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 sq=p.createContext({isTransitioning:!1}),aq=p.createContext(new Map),lq="startTransition",bS=ZS[lq],cq="flushSync",jS=IA[cq];function uq(e){bS?bS(e):e()}function bl(e){jS?jS(e):e()}class dq{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 fq(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:y}=r||{},w=p.useCallback(j=>{y?uq(j):j()},[y]),x=p.useCallback((j,P)=>{let{deletedFetchers:_,unstable_flushSync:R,unstable_viewTransitionOpts:M}=P;_.forEach(N=>S.current.delete(N)),j.fetchers.forEach((N,A)=>{N.data!==void 0&&S.current.set(A,N.data)});let D=n.window==null||n.window.document==null||typeof n.window.document.startViewTransition!="function";if(!M||D){R?bl(()=>i(j)):w(()=>i(j));return}if(R){bl(()=>{h&&(d&&d.resolve(),h.skipTransition()),u({isTransitioning:!0,flushSync:!0,currentLocation:M.currentLocation,nextLocation:M.nextLocation})});let N=n.window.document.startViewTransition(()=>{bl(()=>i(j))});N.finished.finally(()=>{bl(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})})}),bl(()=>m(N));return}h?(d&&d.resolve(),h.skipTransition(),v({state:j,currentLocation:M.currentLocation,nextLocation:M.nextLocation})):(l(j),u({isTransitioning:!0,flushSync:!1,currentLocation:M.currentLocation,nextLocation:M.nextLocation}))},[n.window,h,d,S,w]);p.useLayoutEffect(()=>n.subscribe(x),[n,x]),p.useEffect(()=>{c.isTransitioning&&!c.flushSync&&f(new dq)},[c]),p.useEffect(()=>{if(d&&a&&n.window){let j=a,P=d.promise,_=n.window.document.startViewTransition(async()=>{w(()=>i(j)),await P});_.finished.finally(()=>{f(void 0),m(void 0),l(void 0),u({isTransitioning:!1})}),m(_)}},[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 b=p.useMemo(()=>({createHref:n.createHref,encodeLocation:n.encodeLocation,go:j=>n.navigate(j),push:(j,P,_)=>n.navigate(j,{state:P,preventScrollReset:_==null?void 0:_.preventScrollReset}),replace:(j,P,_)=>n.navigate(j,{replace:!0,state:P,preventScrollReset:_==null?void 0:_.preventScrollReset})}),[n]),C=n.basename||"/",E=p.useMemo(()=>({router:n,navigator:b,static:!1,basename:C}),[n,b,C]);return p.createElement(p.Fragment,null,p.createElement(yh.Provider,{value:E},p.createElement(mR.Provider,{value:o},p.createElement(aq.Provider,{value:S.current},p.createElement(sq.Provider,{value:c},p.createElement(JW,{basename:C,location:o.location,navigationType:o.historyAction,navigator:b,future:{v7_relativeSplatPath:n.future.v7_relativeSplatPath}},o.initialized||n.future.v7_partialHydration?p.createElement(hq,{routes:n.routes,future:n.future,state:o}):t))))),null)}function hq(e){let{routes:t,future:n,state:r}=e;return yR(t,void 0,r,n)}var CS;(function(e){e.UseScrollRestoration="useScrollRestoration",e.UseSubmit="useSubmit",e.UseSubmitFetcher="useSubmitFetcher",e.UseFetcher="useFetcher",e.useViewTransitionState="useViewTransitionState"})(CS||(CS={}));var ES;(function(e){e.UseFetcher="useFetcher",e.UseFetchers="useFetchers",e.UseScrollRestoration="useScrollRestoration"})(ES||(ES={}));function Fx(e){let t=p.useRef(lg(e)),n=p.useRef(!1),r=Qo(),o=p.useMemo(()=>tq(r.search,n.current?null:t.current),[r.search]),i=Vt(),a=p.useCallback((l,c)=>{const u=lg(typeof l=="function"?l(o):l);n.current=!0,i("?"+u,c)},[i,o]);return[o,a]}const pq=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 lu(e,t){const n=mq(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 mq(e){const{name:t}=e;if(t&&t.lastIndexOf(".")!==-1&&!e.type){const r=t.split(".").pop().toLowerCase(),o=pq.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}var ol=(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 gq=[".DS_Store","Thumbs.db"];function vq(e){return ol(this,null,function*(){return tf(e)&&yq(e.dataTransfer)?bq(e.dataTransfer,e.type):xq(e)?wq(e):Array.isArray(e)&&e.every(t=>"getFile"in t&&typeof t.getFile=="function")?Sq(e):[]})}function yq(e){return tf(e)}function xq(e){return tf(e)&&tf(e.target)}function tf(e){return typeof e=="object"&&e!==null}function wq(e){return cg(e.target.files).map(t=>lu(t))}function Sq(e){return ol(this,null,function*(){return(yield Promise.all(e.map(n=>n.getFile()))).map(n=>lu(n))})}function bq(e,t){return ol(this,null,function*(){if(e.items){const n=cg(e.items).filter(o=>o.kind==="file");if(t!=="drop")return n;const r=yield Promise.all(n.map(jq));return PS(SR(r))}return PS(cg(e.files).map(n=>lu(n)))})}function PS(e){return e.filter(t=>gq.indexOf(t.name)===-1)}function cg(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 jq(e){if(typeof e.webkitGetAsEntry!="function")return TS(e);const t=e.webkitGetAsEntry();return t&&t.isDirectory?bR(t):TS(e)}function SR(e){return e.reduce((t,n)=>[...t,...Array.isArray(n)?SR(n):[n]],[])}function TS(e){const t=e.getAsFile();if(!t)return Promise.reject(`${e} is not a File`);const n=lu(t);return Promise.resolve(n)}function Cq(e){return ol(this,null,function*(){return e.isDirectory?bR(e):Eq(e)})}function bR(e){const t=e.createReader();return new Promise((n,r)=>{const o=[];function i(){t.readEntries(a=>ol(this,null,function*(){if(a.length){const l=Promise.all(a.map(Cq));o.push(l),i()}else try{const l=yield Promise.all(o);n(l)}catch(l){r(l)}}),a=>{r(a)})}i()})}function Eq(e){return ol(this,null,function*(){return new Promise((t,n)=>{e.file(r=>{const o=lu(r,e.fullPath);t(o)},r=>{n(r)})})})}function Pq(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,kq=Object.defineProperties,Rq=Object.getOwnPropertyDescriptors,kS=Object.getOwnPropertySymbols,_q=Object.prototype.hasOwnProperty,Dq=Object.prototype.propertyIsEnumerable,RS=(e,t,n)=>t in e?Tq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iq=(e,t)=>{for(var n in t||(t={}))_q.call(t,n)&&RS(e,n,t[n]);if(kS)for(var n of kS(t))Dq.call(t,n)&&RS(e,n,t[n]);return e},Aq=(e,t)=>kq(e,Rq(t));const Nq="file-invalid-type",Mq="file-too-large",Oq="file-too-small",$q="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:Nq,message:`File type must be ${t}`}},_S=e=>({code:Mq,message:`File is larger than ${e} ${e===1?"byte":"bytes"}`}),DS=e=>({code:Oq,message:`File is smaller than ${e} ${e===1?"byte":"bytes"}`}),Fq={code:$q,message:"Too many files"};function jR(e,t){const n=e.type==="application/x-moz-file"||Pq(e,t);return[n,n?null:Lq(t)]}function CR(e,t,n){if(Gi(e.size))if(Gi(t)&&Gi(n)){if(e.size>n)return[!1,_S(n)];if(e.size<t)return[!1,DS(t)]}else{if(Gi(t)&&e.size<t)return[!1,DS(t)];if(Gi(n)&&e.size>n)return[!1,_S(n)]}return[!0,null]}function Gi(e){return e!=null}function zq({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]=jR(l,t),[u]=CR(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 Hu(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 IS(e){e.preventDefault()}function Vq(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 Vq(e)||Bq(e)}function Zr(...e){return(t,...n)=>e.some(r=>(!nf(t)&&r&&r(t,...n),nf(t)))}function Hq(){return"showOpenFilePicker"in window}function Wq(e){return Gi(e)?[{description:"Files",accept:Object.entries(e).filter(([n,r])=>{let o=!0;return ER(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(PR))&&(console.warn(`Skipped "${n}" because an invalid file extension was provided.`),o=!1),o}).reduce((n,[r,o])=>Aq(Iq({},n),{[r]:o}),{})}]:e}function qq(e){if(Gi(e))return Object.entries(e).reduce((t,[n,r])=>[...t,n,...r],[]).filter(t=>ER(t)||PR(t)).join(",")}function Gq(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function Qq(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function ER(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||/\w+\/[-+.\w]+/g.test(e)}function PR(e){return/^.*\.[\w]+$/.test(e)}var Kq=Object.defineProperty,Yq=Object.defineProperties,Xq=Object.getOwnPropertyDescriptors,rf=Object.getOwnPropertySymbols,TR=Object.prototype.hasOwnProperty,kR=Object.prototype.propertyIsEnumerable,AS=(e,t,n)=>t in e?Kq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Rn=(e,t)=>{for(var n in t||(t={}))TR.call(t,n)&&AS(e,n,t[n]);if(rf)for(var n of rf(t))kR.call(t,n)&&AS(e,n,t[n]);return e},si=(e,t)=>Yq(e,Xq(t)),of=(e,t)=>{var n={};for(var r in e)TR.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&rf)for(var r of rf(e))t.indexOf(r)<0&&kR.call(e,r)&&(n[r]=e[r]);return n};const zx=p.forwardRef((e,t)=>{var n=e,{children:r}=n,o=of(n,["children"]);const i=_R(o),{open:a}=i,l=of(i,["open"]);return p.useImperativeHandle(t,()=>({open:a}),[a]),nn.createElement(p.Fragment,null,r(si(Rn({},l),{open:a})))});zx.displayName="Dropzone";const RR={disabled:!1,getFilesFromEvent:vq,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};zx.defaultProps=RR;zx.propTypes={children:ct.func,accept:ct.objectOf(ct.arrayOf(ct.string)),multiple:ct.bool,preventDropOnDocument:ct.bool,noClick:ct.bool,noKeyboard:ct.bool,noDrag:ct.bool,noDragEventsBubbling:ct.bool,minSize:ct.number,maxSize:ct.number,maxFiles:ct.number,disabled:ct.bool,getFilesFromEvent:ct.func,onFileDialogCancel:ct.func,onFileDialogOpen:ct.func,useFsAccessApi:ct.bool,autoFocus:ct.bool,onDragEnter:ct.func,onDragLeave:ct.func,onDragOver:ct.func,onDrop:ct.func,onDropAccepted:ct.func,onDropRejected:ct.func,onError:ct.func,validator:ct.func};const ug={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,acceptedFiles:[],fileRejections:[]};function _R(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:y,preventDropOnDocument:w,noClick:x,noKeyboard:b,noDrag:C,noDragEventsBubbling:E,onError:j,validator:P}=Rn(Rn({},RR),e),_=p.useMemo(()=>qq(t),[t]),R=p.useMemo(()=>Wq(t),[t]),M=p.useMemo(()=>typeof v=="function"?v:NS,[v]),D=p.useMemo(()=>typeof g=="function"?g:NS,[g]),N=p.useRef(null),A=p.useRef(null),[L,I]=p.useReducer(Jq,ug),{isFocused:k,isFileDialogActive:T}=L,$=p.useRef(typeof window<"u"&&window.isSecureContext&&S&&Hq()),V=()=>{!$.current&&T&&setTimeout(()=>{if(A.current){const{files:K}=A.current;K.length||(I({type:"closeDialog"}),D())}},300)};p.useEffect(()=>(window.addEventListener("focus",V,!1),()=>{window.removeEventListener("focus",V,!1)}),[A,T,D,$]);const U=p.useRef([]),X=K=>{N.current&&N.current.contains(K.target)||(K.preventDefault(),U.current=[])};p.useEffect(()=>(w&&(document.addEventListener("dragover",IS,!1),document.addEventListener("drop",X,!1)),()=>{w&&(document.removeEventListener("dragover",IS),document.removeEventListener("drop",X))}),[N,w]),p.useEffect(()=>(!n&&y&&N.current&&N.current.focus(),()=>{}),[N,y,n]);const Se=p.useCallback(K=>{j?j(K):console.error(K)},[j]),me=p.useCallback(K=>{K.preventDefault(),K.persist(),Ee(K),U.current=[...U.current,K.target],Hu(K)&&Promise.resolve(r(K)).then(G=>{if(nf(K)&&!E)return;const fe=G.length,tt=fe>0&&zq({files:G,accept:_,minSize:i,maxSize:o,multiple:a,maxFiles:l,validator:P}),Pt=fe>0&&!tt;I({isDragAccept:tt,isDragReject:Pt,isDragActive:!0,type:"setDraggedFiles"}),c&&c(K)}).catch(G=>Se(G))},[r,c,Se,E,_,i,o,a,l,P]),xe=p.useCallback(K=>{K.preventDefault(),K.persist(),Ee(K);const G=Hu(K);if(G&&K.dataTransfer)try{K.dataTransfer.dropEffect="copy"}catch{}return G&&d&&d(K),!1},[d,E]),Te=p.useCallback(K=>{K.preventDefault(),K.persist(),Ee(K);const G=U.current.filter(tt=>N.current&&N.current.contains(tt)),fe=G.indexOf(K.target);fe!==-1&&G.splice(fe,1),U.current=G,!(G.length>0)&&(I({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),Hu(K)&&u&&u(K))},[N,u,E]),je=p.useCallback((K,G)=>{const fe=[],tt=[];K.forEach(Pt=>{const[ht,Ot]=jR(Pt,_),[Gt,gn]=CR(Pt,i,o),po=P?P(Pt):null;if(ht&&Gt&&!po)fe.push(Pt);else{let an=[Ot,gn];po&&(an=an.concat(po)),tt.push({file:Pt,errors:an.filter(Ko=>Ko)})}}),(!a&&fe.length>1||a&&l>=1&&fe.length>l)&&(fe.forEach(Pt=>{tt.push({file:Pt,errors:[Fq]})}),fe.splice(0)),I({acceptedFiles:fe,fileRejections:tt,type:"setFiles"}),f&&f(fe,tt,G),tt.length>0&&m&&m(tt,G),fe.length>0&&h&&h(fe,G)},[I,a,_,i,o,l,f,h,m,P]),ae=p.useCallback(K=>{K.preventDefault(),K.persist(),Ee(K),U.current=[],Hu(K)&&Promise.resolve(r(K)).then(G=>{nf(K)&&!E||je(G,K)}).catch(G=>Se(G)),I({type:"reset"})},[r,je,Se,E]),Be=p.useCallback(()=>{if($.current){I({type:"openDialog"}),M();const K={multiple:a,types:R};window.showOpenFilePicker(K).then(G=>r(G)).then(G=>{je(G,null),I({type:"closeDialog"})}).catch(G=>{Gq(G)?(D(G),I({type:"closeDialog"})):Qq(G)?($.current=!1,A.current?(A.current.value=null,A.current.click()):Se(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."))):Se(G)});return}A.current&&(I({type:"openDialog"}),M(),A.current.value=null,A.current.click())},[I,M,D,S,je,Se,R,a]),St=p.useCallback(K=>{!N.current||!N.current.isEqualNode(K.target)||(K.key===" "||K.key==="Enter"||K.keyCode===32||K.keyCode===13)&&(K.preventDefault(),Be())},[N,Be]),st=p.useCallback(()=>{I({type:"focus"})},[]),ye=p.useCallback(()=>{I({type:"blur"})},[]),$e=p.useCallback(()=>{x||(Uq()?setTimeout(Be,0):Be())},[x,Be]),Ie=K=>n?null:K,ee=K=>b?null:Ie(K),te=K=>C?null:Ie(K),Ee=K=>{E&&K.stopPropagation()},Qe=p.useMemo(()=>(K={})=>{var G=K,{refKey:fe="ref",role:tt,onKeyDown:Pt,onFocus:ht,onBlur:Ot,onClick:Gt,onDragEnter:gn,onDragOver:po,onDragLeave:an,onDrop:Ko}=G,Ns=of(G,["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"]);return Rn(Rn({onKeyDown:ee(Zr(Pt,St)),onFocus:ee(Zr(ht,st)),onBlur:ee(Zr(Ot,ye)),onClick:Ie(Zr(Gt,$e)),onDragEnter:te(Zr(gn,me)),onDragOver:te(Zr(po,xe)),onDragLeave:te(Zr(an,Te)),onDrop:te(Zr(Ko,ae)),role:typeof tt=="string"&&tt!==""?tt:"presentation",[fe]:N},!n&&!b?{tabIndex:0}:{}),Ns)},[N,St,st,ye,$e,me,xe,Te,ae,b,C,n]),Ke=p.useCallback(K=>{K.stopPropagation()},[]),Fe=p.useMemo(()=>(K={})=>{var G=K,{refKey:fe="ref",onChange:tt,onClick:Pt}=G,ht=of(G,["refKey","onChange","onClick"]);const Ot={accept:_,multiple:a,type:"file",style:{display:"none"},onChange:Ie(Zr(tt,ae)),onClick:Ie(Zr(Pt,Ke)),tabIndex:-1,[fe]:A};return Rn(Rn({},Ot),ht)},[A,t,a,ae,n]);return si(Rn({},L),{isFocused:k&&!n,getRootProps:Qe,getInputProps:Fe,rootRef:N,inputRef:A,open:Ie(Be)})}function Jq(e,t){switch(t.type){case"focus":return si(Rn({},e),{isFocused:!0});case"blur":return si(Rn({},e),{isFocused:!1});case"openDialog":return si(Rn({},ug),{isFileDialogActive:!0});case"closeDialog":return si(Rn({},e),{isFileDialogActive:!1});case"setDraggedFiles":return si(Rn({},e),{isDragActive:t.isDragActive,isDragAccept:t.isDragAccept,isDragReject:t.isDragReject});case"setFiles":return si(Rn({},e),{acceptedFiles:t.acceptedFiles,fileRejections:t.fileRejections});case"reset":return Rn({},ug);default:return e}}function NS(){}const[Zq,eG]=On("Dropzone component was not found in tree");function Vx(e){const t=n=>{const{children:r,...o}=B(`Dropzone${n0(e)}`,{},n),i=eG(),a=$o(r)?r:s.jsx("span",{children:r});return i[e]?p.cloneElement(a,o):null};return t.displayName=`@mantine/dropzone/${n0(e)}`,t}const tG=Vx("accept"),nG=Vx("reject"),rG=Vx("idle");var Sc={root:"m_d46a4834",inner:"m_b85f7144",fullScreen:"m_96f6e9ad",dropzone:"m_7946116d"};const oG={loading:!1,multiple:!0,maxSize:1/0,autoFocus:!1,activateOnClick:!0,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,useFsAccessApi:!0,variant:"light",rejectColor:"red"},iG=(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":wt(t),"--dropzone-accept-color":i.color,"--dropzone-accept-bg":i.background,"--dropzone-reject-color":a.color,"--dropzone-reject-bg":a.background}}},Li=Y((e,t)=>{const n=B("Dropzone",oG,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:y,onReject:w,openRef:x,name:b,maxFiles:C,autoFocus:E,activateOnClick:j,activateOnDrag:P,dragEventsBubbling:_,activateOnKeyboard:R,onDragEnter:M,onDragLeave:D,onDragOver:N,onFileDialogCancel:A,onFileDialogOpen:L,preventDropOnDocument:I,useFsAccessApi:k,getFilesFromEvent:T,validator:$,rejectColor:V,acceptColor:U,enablePointerEvents:X,loaderProps:Se,inputProps:me,mod:xe,...Te}=n,je=pe({name:"Dropzone",classes:Sc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,vars:c,varsResolver:iG}),{getRootProps:ae,getInputProps:Be,isDragAccept:St,isDragReject:st,open:ye}=_R({onDrop:S,onDropAccepted:y,onDropRejected:w,disabled:d||f,accept:Array.isArray(g)?g.reduce((Ie,ee)=>({...Ie,[ee]:[]}),{}):g,multiple:h,maxSize:m,maxFiles:C,autoFocus:E,noClick:!j,noDrag:!P,noDragEventsBubbling:!_,noKeyboard:!R,onDragEnter:M,onDragLeave:D,onDragOver:N,onFileDialogCancel:A,onFileDialogOpen:L,preventDropOnDocument:I,useFsAccessApi:k,validator:$,...T?{getFilesFromEvent:T}:null});uf(x,ye);const $e=!St&&!st;return s.jsx(Zq,{value:{accept:St,reject:st,idle:$e},children:s.jsxs(q,{...ae(),...je("root",{focusable:!0}),...Te,mod:[{accept:St,reject:st,idle:$e,loading:f,"activate-on-click":j},xe],children:[s.jsx(py,{visible:f,overlayProps:{radius:u},unstyled:l,loaderProps:Se}),s.jsx("input",{...Be(me),name:b}),s.jsx("div",{...je("inner"),ref:t,"data-enable-pointer-events":X||void 0,children:v})]})})});Li.classes=Sc;Li.displayName="@mantine/dropzone/Dropzone";Li.Accept=tG;Li.Idle=rG;Li.Reject=nG;const sG={loading:!1,maxSize:1/0,activateOnClick:!1,activateOnDrag:!0,dragEventsBubbling:!0,activateOnKeyboard:!0,active:!0,zIndex:Wr("max"),withinPortal:!0},Bx=Y((e,t)=>{const n=B("DropzoneFullScreen",sG,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=pe({name:"DropzoneFullScreen",classes:Sc,props:n,className:o,style:i,classNames:r,styles:a,unstyled:l,rootSelector:"fullScreen"}),{resolvedClassNames:y,resolvedStyles:w}=Cc({classNames:r,styles:a,props:n}),[x,b]=p.useState(0),[C,{open:E,close:j}]=xb(!1),P=R=>{var M;(M=R.dataTransfer)!=null&&M.types.includes("Files")&&(b(D=>D+1),E())},_=()=>{b(R=>R-1)};return p.useEffect(()=>{x===0&&j()},[x]),p.useEffect(()=>{if(u)return document.addEventListener("dragenter",P,!1),document.addEventListener("dragleave",_,!1),()=>{document.removeEventListener("dragenter",P,!1),document.removeEventListener("dragleave",_,!1)}},[u]),s.jsx(js,{...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(Li,{...v,classNames:y,styles:w,unstyled:l,className:Sc.dropzone,onDrop:R=>{d==null||d(R),j(),b(0)},onReject:R=>{f==null||f(R),j(),b(0)}})})})});Bx.classes=Sc;Bx.displayName="@mantine/dropzone/DropzoneFullScreen";Li.FullScreen=Bx;const Wu=Li,aG='{"resourceType": "Bundle"}';function Tp({id:e,title:t,message:n,color:r,icon:o,withCloseButton:i=!1,method:a="show",loading:l}){ao[a]({id:e,loading:l,title:t,message:n,color:r,icon:o,withCloseButton:i,autoClose:!1})}function lG(){const e=Dt(),t=oe(),[n,r]=p.useState({}),o=p.useCallback(async(l,c)=>{const u="batch-upload";Tp({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=jT(d));const f=await t.executeBatch(d);r(h=>({...h,[c]:f})),Tp({id:u,title:"Batch Upload Successful",message:"Your batch data was successfully uploaded.",color:"green",method:"update",icon:s.jsx(Yc,{size:"1rem"}),withCloseButton:!0})}catch(d){Tp({id:u,title:"Batch Upload Failed",color:"red",message:Ae(d),method:"update",icon:s.jsx(Qd,{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(Re,{children:[s.jsx(ce,{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(Ze,{defaultValue:"upload",children:[s.jsxs(Ze.List,{children:[s.jsx(Ze.Tab,{value:"upload",children:"File Upload"}),s.jsx(Ze.Tab,{value:"json",children:"JSON"})]}),s.jsx(Ze.Panel,{value:"upload",pt:"xs",children:s.jsx(Wu,{onDrop:i,accept:["application/json"],children:s.jsxs(Z,{justify:"center",gap:"xl",style:{minHeight:220,pointerEvents:"none"},children:[s.jsx(Wu.Accept,{children:s.jsx(Fw,{size:50,stroke:1.5,color:e.colors[e.primaryColor][5]})}),s.jsx(Wu.Reject,{children:s.jsx(Qd,{size:50,stroke:1.5,color:e.colors.red[5]})}),s.jsx(Wu.Idle,{children:s.jsx(Fw,{size:50,stroke:1.5})}),s.jsxs("div",{children:[s.jsx(ue,{size:"xl",inline:!0,children:"Drag files here or click to select files"}),s.jsx(ue,{size:"sm",color:"dimmed",inline:!0,mt:7,children:"Attach as many files as you like"})]})]})})}),s.jsx(Ze.Panel,{value:"json",pt:"xs",children:s.jsxs(qe,{onSubmit:a,children:[s.jsx(Ya,{"data-testid":"batch-input",name:"input",autosize:!0,minRows:20,defaultValue:aG,deserialize:JSON.parse}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(re,{type:"submit",children:"Submit"})})]})})]})]}),Object.keys(n).length>0&&s.jsxs(s.Fragment,{children:[s.jsx("h3",{children:"Output"}),s.jsxs(Ze,{defaultValue:Object.keys(n)[0],children:[s.jsx(Ze.List,{children:Object.keys(n).map(l=>s.jsx(Ze.Tab,{value:l,children:l},l))}),Object.keys(n).map(l=>s.jsx(Ze.Panel,{value:l,children:s.jsx("pre",{style:{border:"1px solid #888"},children:JSON.stringify(n[l],void 0,2)})},l))]}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(re,{onClick:()=>r({}),children:"Start over"})})]})]})}function cG(){const{resourceType:e}=rt(),n=(Object.fromEntries(new URLSearchParams(location.search).entries()).ids||"").split(",").filter(o=>!!o),[r]=$a("Questionnaire",`subject-type=${e}`);return r?r.length===0?s.jsxs(Re,{children:[s.jsxs(ce,{children:["No apps for ",e]}),s.jsx(We,{to:`/${e}`,children:"Return to search page"})]}):s.jsx(Re,{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(Ur,{})}function uG(){const e=oe(),[t,n]=p.useState(),[r,o]=p.useState(!1);return s.jsx(Re,{width:450,children:s.jsxs(qe,{onSubmit:i=>{n(void 0),e.post("auth/changepassword",i).then(()=>o(!0)).catch(a=>n(dt(a)))},children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Change password"})]}),!r&&s.jsxs(De,{gap:"xl",mt:"xl",children:[s.jsx(zr,{name:"oldPassword",label:"Old password",required:!0,autoFocus:!0,error:Ye(t,"oldPassword")}),s.jsx(zr,{name:"newPassword",label:"New password",required:!0,error:Ye(t,"newPassword")}),s.jsx(zr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ye(t,"confirmPassword")}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(re,{type:"submit",children:"Change password"})})]}),r&&s.jsx("div",{"data-testid":"success",children:"Password changed successfully"})]})})}const dg=["Form","JSON","Profiles"],dG=["Profiles"],kp=dg[0].toLowerCase();function fG(){const e=Vt(),t=Dt(),{resourceType:n}=rt(),[r,o]=p.useState(()=>{const a=window.location.pathname.split("/").pop();return a&&dg.map(l=>l.toLowerCase()).includes(a)?a:kp});function i(a){a||(a=kp),o(a),e(`/${n}/new/${a}`)}return s.jsxs(s.Fragment,{children:[s.jsxs(Wn,{children:[s.jsxs(ue,{p:"md",fw:500,children:["New ",n]}),s.jsx(Pr,{children:s.jsx(Ze,{defaultValue:kp,value:r,onChange:i,children:s.jsx(Ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:dg.map(a=>s.jsx(Ze.Tab,{value:a.toLowerCase(),px:"md",children:dG.includes(a)?s.jsxs(Z,{gap:"xs",wrap:"nowrap",children:[a,s.jsx($c,{color:t.primaryColor,size:"sm",children:"Beta"})]}):a},a))})})})]}),s.jsx(Lx,{})]})}function hG(){return s.jsx(Re,{children:s.jsxs(De,{children:[s.jsx(ce,{order:1,children:"Unexpected Error"}),s.jsx(ue,{children:"We're sorry, something went wrong."}),s.jsxs(ue,{children:["Please contact ",s.jsx(Je,{href:"mailto:support@medplum.com",children:"support"})," for assistance."]})]})})}const pG="_root_1fbwr_1",mG="_entry_1fbwr_8",gG="_key_1fbwr_13",vG="_value_1fbwr_20",bh={root:pG,entry:mG,key:gG,value:vG};function ze(e){return s.jsx(Pr,{children:s.jsx("div",{className:bh.root,children:e.children})})}ze.Entry=function(t){return s.jsx("div",{className:bh.entry,children:t.children})};ze.Key=function(t){return s.jsx("div",{className:bh.key,children:t.children})};ze.Value=function(t){return s.jsx("div",{className:bh.value,children:t.children})};function yG(e){if(e.gender==="male")return"blue";if(e.gender==="female")return"pink"}function DR(e){var n,r;const t=ft(e.patient);return t?s.jsxs(ze,{children:[s.jsx(Oi,{value:t,size:"lg",color:yG(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(cx,{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:VL(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 IR(e){const t=ft(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=No(t);a!==vt(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 Ux(e){if(e.resourceType==="Patient")return e;if(e.resourceType==="DiagnosticReport"||e.resourceType==="Encounter"||e.resourceType==="Observation"||e.resourceType==="ServiceRequest")return e.subject}function xG(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 ud(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 Fi(e){var t;return sh((t=e.getActiveLogin())==null?void 0:t.project)}function wG(e,t){const n=new Blob([e],{type:Yt.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 SG(){const{id:e}=rt(),t=Qo(),r=Object.fromEntries(new URLSearchParams(t.search).entries()).subject,o=oe(),[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 x={resourceType:"Bundle",type:"batch",entry:[{request:{method:"GET",url:`Questionnaire/${e}`}}]};if(r){const b=r.split(",").filter(C=>!!C);b.length===1&&x.entry.push({request:{method:"GET",url:b[0]}}),d(b)}o.executeBatch(x).then(b=>{var C,E,j,P,_,R,M,D;((j=(E=(C=b.entry)==null?void 0:C[0])==null?void 0:E.response)==null?void 0:j.status)!=="200"?g((R=(_=(P=b.entry)==null?void 0:P[0])==null?void 0:_.response)==null?void 0:R.outcome):(c((M=b.entry[0])==null?void 0:M.resource),h((D=b.entry[1])==null?void 0:D.resource)),a(!1)}).catch(b=>{g(b),a(!1)})},[o,e,r]),m)return s.jsx(Re,{children:s.jsx("pre",{"data-testid":"error",children:JSON.stringify(m,void 0,2)})});if(v)return s.jsxs(Re,{children:[s.jsx(ce,{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(x=>s.jsx("li",{children:s.jsx(We,{to:x,children:vt(x)})},x.id))})]}),f&&s.jsx("li",{children:s.jsxs(We,{to:f,children:["Back to ",No(f)]})}),s.jsx("li",{children:s.jsx(We,{to:"/",children:"Go back home"})})]})]});if(i||!l)return s.jsx(Ur,{});const y=f&&Ux(f);return s.jsxs(s.Fragment,{children:[s.jsxs(Wn,{shadow:"xs",radius:0,children:[y&&s.jsx(DR,{patient:y}),f&&f.resourceType!=="Patient"&&s.jsx(IR,{resource:f}),s.jsx(q,{px:"xl",py:"md",children:s.jsxs(ue,{children:[No(l),u&&u.length>1&&s.jsxs(s.Fragment,{children:[" (for ",u.length," resources)"]})]})})]}),s.jsx(Re,{children:s.jsx(Gk,{questionnaire:l,subject:f&>(f),onSubmit:w})})]});async function w(x){const b=[];if(!u||u.length===0)b.push(await o.createResource(x));else for(const C of u)b.push(await o.createResource({...x,subject:{reference:C}}));S(b)}}const bG="_paper_unw9o_1",jG={paper:bG},CG={Bot:"/admin/bots/new",ClientApplication:"/admin/clients/new"};function AR(e,t){const n=e.resourceType||EG(t),r=e.fields??PG(n),o=e.filters??(e.resourceType?void 0:TG(n)),i=e.sortRules??kG(n),a=e.offset??0,l=e.count??ch;return{...e,resourceType:n,fields:r,filters:o,sortRules:i,offset:a,count:l}}function EG(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 PG(e){const t=Hx(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 TG(e){var t;return(t=Hx(e))==null?void 0:t.filters}function kG(e){const t=Hx(e);return t!=null&&t.sortRules?t.sortRules:[{code:"_lastUpdated",descending:!0}]}function Hx(e){const t=localStorage.getItem(e+"-defaultSearch");return t?JSON.parse(t):void 0}function RG(e){localStorage.setItem("defaultResourceType",e.resourceType),localStorage.setItem(e.resourceType+"-defaultSearch",JSON.stringify(e))}async function _G(e,t){const n={resourceType:e.resourceType,count:1e3,offset:0,filters:e.filters},r=AR(n,t.getUserConfiguration()),o=await t.search(r.resourceType,ua({...r,total:"accurate",fields:void 0}));return jT(o)}function MS(){const e=oe(),t=Vt(),n=Qo(),[r,o]=p.useState();return p.useEffect(()=>{const i=r6(n.pathname+n.search),a=AR(i,e.getUserConfiguration());n.pathname===`/${a.resourceType}`&&n.search===ua(a)?(RG(a),o(a)):t(`/${a.resourceType}${ua(a)}`)},[e,t,n]),!(r!=null&&r.resourceType)||!r.fields||r.fields.length===0?s.jsx(Ur,{}):s.jsx(Wn,{shadow:"xs",m:"md",p:"xs",className:jG.paper,children:s.jsx(iu,{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}${ua(i.definition)}`)},onNew:()=>{t(CG[r.resourceType]??`/${r.resourceType}/new`)},onExportCsv:()=>{const i=e.fhirUrl(r.resourceType,"$csv")+ua(r);e.download(i).then(a=>{window.open(window.URL.createObjectURL(a),"_blank")}).catch(a=>ve({color:"red",message:Ae(a),autoClose:!1}))},onExportTransactionBundle:async()=>{_G(r,e).then(i=>wG(JSON.stringify(i,void 0,2))).catch(i=>ve({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=>ve({color:"red",message:Ae(a),autoClose:!1})))},onBulk:i=>{t(`/bulk/${r.resourceType}?ids=${i.join(",")}`)}})})}function DG(){const e=oe(),[t,n]=p.useState(),[r,o]=p.useState(void 0);p.useEffect(()=>{e.get("auth/mfa/status").then(l=>{const c=new URL("https://chart.googleapis.com/chart");c.searchParams.set("chs","300x300"),c.searchParams.set("cht","qr"),c.searchParams.set("chl",l.enrollUri),c.searchParams.set("choe","UTF-8"),n(c.toString()),o(l.enrolled)}).catch(l=>ve({color:"red",message:Ae(l),autoClose:!1}))},[e]);const i=p.useCallback(l=>{e.post("auth/mfa/enroll",l).then(()=>{o(!0),ve({color:"green",message:"Success"})}).catch(c=>ve({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(Re,{children:s.jsxs(Z,{children:[s.jsx(ce,{children:"MFA is enabled"}),s.jsx(re,{onClick:a,children:"Disable MFA"})]})}):s.jsx(Re,{width:400,children:s.jsxs(qe,{onSubmit:i,children:[s.jsx(ce,{children:"Multi Factor Auth Setup"}),s.jsx(dn,{children:s.jsx("img",{src:t})}),s.jsx(de,{name:"token",label:"Code"}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(re,{type:"submit",children:"Enroll"})})]})})}const fg={baseUrl:"__MEDPLUM_BASE_URL__",clientId:"__MEDPLUM_CLIENT_ID__",googleClientId:"__GOOGLE_CLIENT_ID__",recaptchaSiteKey:"__RECAPTCHA_SITE_KEY__",registerEnabled:"__MEDPLUM_REGISTER_ENABLED__"};function cu(){return fg}function NR(){try{return fg.registerEnabled!==!1&&fg.registerEnabled!=="false"}catch{return!0}}function IG(){const e=Vt(),[t]=Fx(),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(nR,{onCode:o,onForgotPassword:()=>e("/resetpassword"),onRegister:()=>e("/register"),googleClientId:cu().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(Qr,{size:32}),s.jsx(ce,{children:"Sign in to Medplum"})]})}function AG(){const e=oe(),t=Vt(),n=cu();return p.useEffect(()=>{e.getProfile()&&t("/signin?project=new")},[e,t]),NR()?s.jsxs(NH,{type:"project",projectId:"new",onSuccess:()=>t("/"),googleClientId:n.googleClientId,recaptchaSiteKey:n.recaptchaSiteKey,children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Create a new account"})]}):s.jsx(Re,{width:450,children:s.jsx(Es,{icon:s.jsx(Kc,{size:16}),title:"New projects disabled",color:"red",children:"New projects are disabled on this server."})})}function NG(){const e=Vt(),t=oe(),[n,r]=p.useState(),[o,i]=p.useState(!1),a=cu().recaptchaSiteKey;return p.useEffect(()=>{eR(a)},[a]),s.jsx(Re,{width:450,children:s.jsxs(qe,{onSubmit:async l=>{let c="";c=await tR(a),t.post("auth/resetpassword",{...l,recaptchaToken:c}).then(()=>i(!0)).catch(u=>r(dt(u)))},children:[s.jsxs(De,{gap:"lg",mb:"xl",align:"center",children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Medplum Password Reset"})]}),s.jsxs(De,{gap:"xl",children:[s.jsx(Kr,{issues:tu(n,void 0)}),!o&&s.jsxs(s.Fragment,{children:[s.jsx(de,{name:"email",type:"email",label:"Email",required:!0,autoFocus:!0,error:Ye(n,"email")}),s.jsxs(Z,{justify:"space-between",mt:"xl",wrap:"nowrap",children:[s.jsx(Je,{component:"button",type:"button",color:"dimmed",onClick:()=>e("/register"),size:"xs",children:"Register"}),s.jsx(re,{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 MG(){var i;const e=Vt(),t=oe(),[n,r]=p.useState();p.useEffect(()=>{t.get("auth/me").then(r).catch(a=>ve({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(()=>ve({color:"green",message:"Login revoked"})).catch(l=>ve({color:"red",message:Ae(l),autoClose:!1}))}return n?s.jsxs(s.Fragment,{children:[s.jsxs(Re,{children:[s.jsx(ce,{children:"Security"}),s.jsxs(hx,{children:[s.jsx(Eo,{term:"ID",children:s.jsx(Je,{href:`/${vt(n.profile)}`,children:n.profile.id})}),s.jsx(Eo,{term:"Resource Type",children:n.profile.resourceType}),s.jsx(Eo,{term:"Name",children:Qc((i=n.profile.name)==null?void 0:i[0])})]})]}),s.jsxs(Re,{children:[s.jsx(ce,{children:"Sessions"}),s.jsxs(le,{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:Nn(a.lastUpdated)}),s.jsx("td",{children:s.jsx(Je,{href:"#",onClick:()=>o(a.id),children:"Revoke"})})]},a.id))})]})]}),s.jsxs(Re,{children:[s.jsx(ce,{children:"Password"}),s.jsx(re,{onClick:()=>e("/changepassword"),children:"Change password"})]}),s.jsxs(Re,{children:[s.jsx(ce,{children:"Multi Factor Auth"}),s.jsxs("p",{children:["Enrolled: ",n.security.mfaEnrolled.toString()]}),!n.security.mfaEnrolled&&s.jsx(re,{onClick:()=>e("/mfa"),children:"Enroll"})]})]}):null}function OG(){const{id:e,secret:t}=rt(),n=oe(),[r,o]=p.useState(),[i,a]=p.useState(!1),l=tu(r,void 0);return s.jsxs(Re,{width:450,children:[s.jsx(Kr,{issues:l}),s.jsxs(qe,{onSubmit:c=>{if(c.password!==c.confirmPassword){o(ji("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(dt(d)))},children:[s.jsxs(dn,{style:{flexDirection:"column"},children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Set password"})]}),!i&&s.jsxs(De,{children:[s.jsx(zr,{name:"password",label:"New password",required:!0,error:Ye(r,"password")}),s.jsx(zr,{name:"confirmPassword",label:"Confirm new password",required:!0,error:Ye(r,"confirmPassword")}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(re,{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 $G(){const e=fh(),t=Vt(),[n]=Fx(),r=cu(),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(nR,{onSuccess:()=>o(),onForgotPassword:()=>t("/resetpassword"),onRegister:NR()?()=>t("/register"):void 0,googleClientId:r.googleClientId,login:n.get("login")||void 0,projectId:n.get("project")||void 0,children:[s.jsx(Qr,{size:32}),s.jsx(ce,{children:"Sign in to Medplum"}),n.get("project")==="new"&&s.jsx("div",{children:"Sign in again to create a new project"})]})}function LG(){const e=Vt(),t=Qo(),[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(FB,{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 jh(e){const t=oe(),n=Fi(t),r=Vt(),[o,i]=p.useState({resourceType:"ProjectMembership",filters:[{code:"project",operator:ie.EQUALS,value:"Project/"+n},{code:"profile-type",operator:ie.EQUALS,value:e.resourceType}],fields:e.fields,count:100});return s.jsx(iu,{search:o,onClick:a=>r(`/admin/members/${a.resource.id}`),onChange:a=>i(a.definition),hideFilters:!0,hideToolbar:!0})}function FG(){return s.jsxs(s.Fragment,{children:[s.jsx(ce,{children:"Bots"}),s.jsx(jh,{resourceType:"Bot",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(We,{to:"/admin/bots/new",children:"Create new bot"})})]})}function zG(){return s.jsxs(s.Fragment,{children:[s.jsx(ce,{children:"Clients"}),s.jsx(jh,{resourceType:"ClientApplication",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(We,{to:"/admin/clients/new",children:"Create new client"})})]})}function Ch(e){return s.jsx(tl,{resourceType:"AccessPolicy",name:"accessPolicy",defaultValue:e.defaultValue,placeholder:"Access Policy",onChange:t=>{qo(t)?e.onChange(gt(t)):e.onChange(void 0)}})}function VG(){const e=oe(),t=Fi(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(ce,{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),ve({color:"green",message:"Bot created"})}).catch(m=>{ve({color:"red",message:Ae(m),autoClose:!1}),u(dt(m))})},children:[!d&&s.jsxs(De,{children:[s.jsx(ut,{title:"Name",htmlFor:"name",outcome:c,children:s.jsx(de,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:h=>r(h.currentTarget.value),error:Ye(c,"name")})}),s.jsx(ut,{title:"Description",htmlFor:"description",outcome:c,children:s.jsx(de,{id:"description",name:"description",onChange:h=>i(h.currentTarget.value),error:Ye(c,"description")})}),s.jsx(ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:c,children:s.jsx(Ch,{name:"accessPolicy",onChange:l})}),s.jsx(Z,{justify:"flex-end",children:s.jsx(re,{type:"submit",children:"Create Bot"})})]}),d&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(ue,{children:"Bot created"}),s.jsxs(Dn,{children:[s.jsx(Dn.Item,{children:s.jsx(We,{to:d,children:"Go to new bot"})}),s.jsx(Dn.Item,{children:s.jsx(We,{to:"/admin/bots",children:"Back to bots list"})})]})]})]})]})}function BG(){const e=oe(),t=Fi(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(ce,{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),ve({color:"green",message:"Client created"})}).catch(v=>{ve({color:"red",message:Ae(v),autoClose:!1}),f(dt(v))})},children:[!h&&s.jsxs(De,{children:[s.jsx(ut,{title:"Name",htmlFor:"name",outcome:d,children:s.jsx(de,{id:"name",name:"name",required:!0,autoFocus:!0,onChange:g=>r(g.currentTarget.value),error:Ye(d,"name")})}),s.jsx(ut,{title:"Description",htmlFor:"description",outcome:d,children:s.jsx(de,{id:"description",name:"description",onChange:g=>i(g.currentTarget.value),error:Ye(d,"description")})}),s.jsx(ut,{title:"Redirect URI",htmlFor:"redirectUri",outcome:d,children:s.jsx(de,{id:"redirectUri",name:"redirectUri",onChange:g=>l(g.currentTarget.value),error:Ye(d,"redirectUri")})}),s.jsx(ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:d,children:s.jsx(Ch,{name:"accessPolicy",onChange:u})}),s.jsx(Z,{justify:"flex-end",children:s.jsx(re,{type:"submit",children:"Create Client"})})]}),h&&s.jsxs("div",{"data-testid":"success",children:[s.jsx(ue,{children:"Client created"}),s.jsxs(Dn,{children:[s.jsx(Dn.Item,{children:s.jsx(We,{to:h,children:"Go to new client"})}),s.jsx(Dn.Item,{children:s.jsx(We,{to:"/admin/clients",children:"Back to clients list"})})]})]})]})]})}function UG(e){return s.jsx(tl,{resourceType:"UserConfiguration",name:"userConfiguration",defaultValue:e.defaultValue,placeholder:"User Configuration",onChange:t=>{qo(t)?e.onChange(gt(t)):e.onChange(void 0)}})}function HG(){const{membershipId:e}=rt(),t=oe(),n=Fi(t),r=Vt(),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(dt(S)))}return s.jsxs(s.Fragment,{children:[s.jsx(ce,{children:"Edit membership"}),s.jsx("h3",{children:s.jsx(ba,{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(y=>h(dt(y)))},children:[!m&&s.jsxs(De,{children:[s.jsx(ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:f,children:s.jsx(Ch,{name:"accessPolicy",defaultValue:i,onChange:a})}),s.jsx(ut,{title:"User Configuration",htmlFor:"userConfiguration",outcome:f,children:s.jsx(UG,{name:"userConfiguration",defaultValue:l,onChange:c})}),s.jsx(ut,{title:"Admin",htmlFor:"admin",outcome:f,children:s.jsx(Cr,{id:"admin",name:"admin",defaultChecked:u,onChange:S=>d(S.currentTarget.checked)})}),s.jsxs(Z,{justify:"flex-end",mt:"xl",children:[s.jsx(re,{type:"submit",children:"Save"}),s.jsx(re,{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 WG(){const e=oe(),[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"),oh(g)?a(g):d(g),c(m.sendEmail??!1),ve({color:"green",message:"Invite success"})}).catch(g=>{ve({color:"red",message:Ae(g),autoClose:!1}),a(dt(g))})},[e,t,r]);return s.jsxs(qe,{onSubmit:f,children:[!u&&!i&&s.jsxs(De,{children:[s.jsx(ce,{children:"Invite new member"}),e.isSuperAdmin()&&s.jsx(ut,{title:"Project",htmlFor:"project",outcome:i,children:s.jsx(tl,{resourceType:"Project",name:"project",defaultValue:t,onChange:n})}),s.jsx(Et,{name:"resourceType",label:"Role",defaultValue:"Practitioner",data:["Practitioner","Patient","RelatedPerson"],error:Ye(i,"resourceType")}),s.jsx(de,{name:"firstName",label:"First Name",required:!0,autoFocus:!0,error:Ye(i,"firstName")}),s.jsx(de,{name:"lastName",label:"Last Name",required:!0,error:Ye(i,"lastName")}),s.jsx(de,{name:"email",type:"email",label:"Email",required:!0,error:Ye(i,"email")}),s.jsx(ut,{title:"Access Policy",htmlFor:"accessPolicy",outcome:i,children:s.jsx(Ch,{name:"accessPolicy",onChange:o})}),s.jsx(Cr,{name:"sendEmail",label:"Send email",defaultChecked:!0}),s.jsx(Cr,{name:"isAdmin",label:"Admin"}),s.jsx(Z,{justify:"flex-end",children:s.jsx(re,{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(ue,{children:"User created"}),l&&s.jsx(ue,{children:"Email sent"}),s.jsxs(Dn,{children:[s.jsx(Dn.Item,{children:s.jsx(We,{to:u,children:"Go to new membership"})}),s.jsx(Dn.Item,{children:s.jsx(We,{to:u.profile,children:"Go to new profile"})}),s.jsx(Dn.Item,{children:s.jsx(We,{to:"/admin/users",children:"Back to users list"})})]})]})]})}function qG(){return s.jsxs(s.Fragment,{children:[s.jsx(ce,{children:"Patients"}),s.jsx(jh,{resourceType:"Patient",fields:["user","profile","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(We,{to:"/admin/invite",children:"Invite new patient"})})]})}function GG(){const e=oe();if(!e.isLoading()&&!e.isProjectAdmin())return s.jsx(Kr,{outcome:qP});function t(n){e.post("admin/projects/setpassword",n).then(()=>ve({color:"green",message:"Done"})).catch(r=>ve({color:"red",message:Ae(r),autoClose:!1}))}return s.jsxs(Re,{width:600,children:[s.jsx(ce,{order:1,children:"Project Admin"}),s.jsx(en,{my:"lg"}),s.jsx(ce,{order:2,children:"Force Set Password"}),s.jsx(ue,{children:"Sets the password for the specified user in this project."}),s.jsx(ue,{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(De,{children:[s.jsx(de,{name:"email",label:"Email",required:!0}),s.jsx(zr,{name:"password",label:"Password",required:!0}),s.jsx(re,{type:"submit",children:"Force Set Password"})]})})]})}function OS(){const e=oe(),t=Fi(e),n=e.get(`admin/projects/${t}`).read();return s.jsxs(s.Fragment,{children:[s.jsx(ce,{children:"Details"}),s.jsxs(hx,{children:[s.jsx(Eo,{term:"ID",children:n.project.id}),s.jsx(Eo,{term:"Name",children:n.project.name})]})]})}const $S=["Details","Users","Patients","Clients","Bots","Secrets","Sites"];function QG(){const e=Vt(),n=Qo().pathname.replace("/admin/","")||$S[0],r=oe(),o=Fi(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(Wn,{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(Pr,{children:s.jsx(Ze,{value:n.toLowerCase(),onChange:a,children:s.jsx(Ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:$S.map(l=>s.jsx(Ze.Tab,{value:l.toLowerCase(),children:l},l))})})})]}),s.jsx(Re,{children:s.jsx(Lx,{})})]})}function KG(){const e=oe(),t=Fi(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(ho(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(()=>ve({color:"green",message:"Saved"})).catch(console.log)},children:[s.jsx(ce,{children:"Project Secrets"}),s.jsx("p",{children:"Use project secrets to store sensitive information such as API keys or other access credentials."}),s.jsx(nl,{property:Ds("Project","secret"),name:"secret",path:"Project.secret",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(re,{type:"submit",children:"Save"})]})}function YG(){const e=oe(),t=Fi(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(ho(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(()=>ve({color:"green",message:"Saved"})).catch(c=>{var d,f,h,m;const u=dt(c);ve({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(ce,{children:"Project Sites"}),s.jsx("p",{children:"Use project sites configure your project on a separate domain."}),s.jsx(nl,{property:Ds("Project","site"),name:"site",path:"Project.site",defaultValue:i,onChange:a,outcome:void 0}),s.jsx(re,{type:"submit",children:"Save"})]})}function XG(){const e=oe(),[t,{open:n,close:r}]=xb(!1),[o,i]=p.useState(""),[a,l]=p.useState();if(!e.isLoading()&&!e.isSuperAdmin())return s.jsx(Kr,{outcome:qP});function c(){jl(e,"Rebuilding Structure Definitions","admin/super/structuredefinitions")}function u(){jl(e,"Rebuilding Search Parameters","admin/super/searchparameters")}function d(){jl(e,"Rebuilding Value Sets","admin/super/valuesets")}function f(y){jl(e,"Reindexing Resources","admin/super/reindex",y)}function h(y){jl(e,"Rebuilding Compartments","admin/super/compartments",y)}function m(y){e.post("admin/super/removebotidjobsfromqueue",y).then(()=>ve({color:"green",message:"Done"})).catch(w=>ve({color:"red",message:Ae(w),autoClose:!1}))}function g(y){e.post("admin/super/purge",{...y,before:rk(y.before)}).then(()=>ve({color:"green",message:"Done"})).catch(w=>ve({color:"red",message:Ae(w),autoClose:!1}))}function v(y){e.post("admin/super/setpassword",y).then(()=>ve({color:"green",message:"Done"})).catch(w=>ve({color:"red",message:Ae(w),autoClose:!1}))}function S(){e.post("fhir/R4/$db-stats",{}).then(y=>{var w,x;i("Database Stats"),l(s.jsx("pre",{children:(x=(w=y.parameter)==null?void 0:w.find(b=>b.name==="tableString"))==null?void 0:x.valueString})),n()}).catch(y=>ve({color:"red",message:Ae(y),autoClose:!1}))}return s.jsxs(Re,{width:600,children:[s.jsx(ce,{order:1,children:"Super Admin"}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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(re,{onClick:c,children:"Rebuild StructureDefinitions"})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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(re,{onClick:u,children:"Rebuild SearchParameters"})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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(re,{onClick:d,children:"Rebuild ValueSets"})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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(De,{children:[s.jsx(ut,{title:"Resource Type",children:s.jsx(de,{name:"resourceType",placeholder:"Reindex Resource Type"})}),s.jsx(re,{type:"submit",children:"Reindex"})]})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{order:2,children:"Rebuild Compartments"}),s.jsx("p",{children:"When Medplum changes how resource compartments are derived, the system may require a rebuild for old resources to take effect."}),s.jsx(qe,{onSubmit:h,children:s.jsxs(De,{children:[s.jsx(ut,{title:"Resource Type",children:s.jsx(de,{name:"resourceType",placeholder:"Compartments Resource Type"})}),s.jsx(re,{type:"submit",children:"Rebuild Compartments"})]})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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:g,children:s.jsxs(De,{children:[s.jsx(ut,{title:"Purge Resource Type",htmlFor:"purgeResourceType",children:s.jsx(Et,{id:"purgeResourceType",name:"resourceType",data:["","AuditEvent","Login"]})}),s.jsx(ut,{title:"Purge Before",htmlFor:"before",children:s.jsx(ps,{name:"before",placeholder:"Before Date"})}),s.jsx(re,{type:"submit",children:"Purge"})]})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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:m,children:s.jsxs(De,{children:[s.jsx(ut,{title:"Bot ID",children:s.jsx(de,{name:"botId",placeholder:"Bot Id"})}),s.jsx(re,{type:"submit",children:"Remove Jobs by Bot ID"})]})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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:v,children:s.jsxs(De,{children:[s.jsx(de,{name:"email",label:"Email",required:!0}),s.jsx(zr,{name:"password",label:"Password",required:!0}),s.jsx(de,{name:"projectId",label:"Project ID"}),s.jsx(re,{type:"submit",children:"Force Set Password"})]})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{order:2,children:"Database Stats"}),s.jsx("p",{children:"Query current table statistics from the database."}),s.jsx(qe,{onSubmit:S,children:s.jsx(re,{type:"submit",children:"Get Database Stats"})}),s.jsx(Cn,{opened:t,onClose:r,title:o,centered:!0,children:a})]})}function jl(e,t,n,r){ao.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(()=>{ao.update({id:n,color:"green",title:t,message:"Done",icon:s.jsx(Yc,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})}).catch(i=>{ao.update({id:n,color:"red",title:t,message:Ae(i),icon:s.jsx(Qd,{size:"1rem"}),loading:!1,autoClose:!1,withCloseButton:!0})})}function JG(){return s.jsxs(s.Fragment,{children:[s.jsx(ce,{children:"Users"}),s.jsx(jh,{resourceType:"Practitioner",fields:["user","profile","admin","_lastUpdated"]}),s.jsx(Z,{justify:"flex-end",children:s.jsx(We,{to:"/admin/invite",children:"Invite new user"})})]})}function ZG(){const[e]=$a("ObservationDefinition","_count=100");return e?s.jsxs(le,{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(lo,{value:(n=t.category)==null?void 0:n[0]})}),s.jsx("td",{children:s.jsx(lo,{value:t.code})}),s.jsx("td",{children:s.jsx(lo,{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(hg,{ranges:t.qualifiedInterval})})]},t.id)})})]}):s.jsx(Ur,{})}function hg(e){const{ranges:t}=e;if(!t)return null;const n=LS(t.map(o=>o.gender));if(n.length>1)return hc(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:Wt(o)})}),s.jsx(hg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>a.gender===o)})]},o)})});const r=LS(t.map(o=>o.age&&pc(o.age)));return r.length>1?(hc(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:Wt(o)})}),s.jsx(hg,{ranges:(i=e.ranges)==null?void 0:i.filter(a=>pc(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(mx,{value:o.range})})]})})},`range-${o.condition}`))})}function LS(e){return[...new Set(e.filter(t=>!!t))]}function eQ(){const[e]=$a("ActivityDefinition","_count=100"),[t]=$a("ObservationDefinition","_count=100");return!e||!t?s.jsx(Ur,{}):s.jsxs(le,{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(lo,{value:(r=n.category)==null?void 0:r[0]})}),s.jsx("td",{children:s.jsx(lo,{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 tQ(e){var a;const t=oe(),[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",valueReference:n}]}).then(i).catch(console.log)},children:s.jsxs(De,{children:[s.jsxs(ce,{children:['Start "',e.planDefinition.title,'"']}),s.jsxs(ue,{children:["Use the ",s.jsx("strong",{children:"Apply"})," operation to create a group of tasks for a workflow."]}),s.jsx(ue,{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(lo,{value:l.code[0]})]},`action-${c}`)})}),s.jsx(ut,{title:"Subject",children:s.jsx(ph,{name:"subject",targetTypes:["Patient","Practitioner"],defaultValue:n,onChange:r})}),s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(re,{type:"submit",children:"Go"})})]})})}function nQ(){const{resourceType:e,id:t}=rt(),n=ft({reference:e+"/"+t});return n?s.jsx(Re,{children:s.jsx(tQ,{planDefinition:n})}):null}function rQ(){const{resourceType:e,id:t}=rt(),n=ft({reference:e+"/"+t}),[r,o]=$a("Questionnaire","subject-type="+e),[i,a]=$a("ClientApplication",{_count:1e3});if(!n||o||a)return s.jsx(Ur,{});const l=i==null?void 0:i.filter(d=>oQ(e)&&!!d.launchUri);if((!r||r.length===0)&&(!l||l.length===0))return s.jsxs(Re,{children:[s.jsx(ce,{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=gt(n):n.resourceType==="Encounter"&&(c=n.subject,u=gt(n)),s.jsxs(Re,{children:[r==null?void 0:r.map(d=>s.jsxs("div",{children:[s.jsx(ce,{order:3,children:s.jsx(We,{to:`/forms/${d.id}?subject=${vt(n)}`,children:d.title||d.name})}),s.jsx(ue,{children:d.description})]},d.id)),l==null?void 0:l.map(d=>s.jsxs("div",{children:[s.jsx(ce,{order:3,children:s.jsx(DH,{client:d,patient:c,encounter:u,children:d.name})}),s.jsx(ue,{children:d.description})]},d.id))]})}function oQ(e){return e==="Patient"||e==="Encounter"}function iQ(){const{resourceType:e,id:t}=rt(),n=Vt(),[r,o]=p.useState({resourceType:"AuditEvent",filters:[{code:"entity",operator:ie.EQUALS,value:`${e}/${t}`}],fields:["id","outcome","outcomeDesc","_lastUpdated"],sortRules:[{code:"-_lastUpdated"}],count:20});return s.jsx(Re,{children:s.jsx(iu,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function sQ(){const e=oe(),{resourceType:t,id:n}=rt(),r=e.readHistory(t,n).read();return s.jsx(Re,{children:s.jsx(bH,{history:r})})}const aQ="_hl7Input_k5xm3_1",lQ={hl7Input:aQ};function cQ(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 uQ(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=>{ud(r.currentTarget,{command:"setValue",value:t}).catch(console.error)}})}const dQ=`{
|
|
553
|
+
"resourceType": "Patient",
|
|
554
|
+
"name": [
|
|
555
|
+
{
|
|
556
|
+
"given": [
|
|
557
|
+
"Alice"
|
|
558
|
+
],
|
|
559
|
+
"family": "Smith"
|
|
560
|
+
}
|
|
561
|
+
]
|
|
562
|
+
}`,fQ="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 hQ(){const e=oe(),{id:t}=rt(),[n,r]=p.useState(),[o,i]=p.useState(),[a,l]=p.useState(dQ),[c,u]=p.useState(fQ),[d,f]=p.useState(Yt.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 pQ(e,E))}).catch(E=>ve({color:"red",message:Ae(E),autoClose:!1}))},[e,t]);const S=p.useCallback(()=>ud(h.current,{command:"getValue"}),[]),y=p.useCallback(()=>ud(h.current,{command:"getOutput"}),[]),w=p.useCallback(async()=>d===Yt.FHIR_JSON?JSON.parse(a):c,[d,a,c]),x=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const j=await S(),P=await e.createAttachment(j,"index.ts","text/typescript"),_=[];n!=null&&n.sourceCode?_.push({op:"replace",path:"/sourceCode",value:P}):_.push({op:"add",path:"/sourceCode",value:P}),await e.patchResource("Bot",t,_),ve({color:"green",message:"Saved"})}catch(j){ve({color:"red",message:Ae(j),autoClose:!1})}finally{v(!1)}},[e,t,n,S]),b=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const j=await y();await e.post(e.fhirUrl("Bot",t,"$deploy"),{code:j}),ve({color:"green",message:"Deployed"})}catch(j){ve({color:"red",message:Ae(j),autoClose:!1})}finally{v(!1)}},[e,t,y]),C=p.useCallback(async E=>{E.preventDefault(),E.stopPropagation(),v(!0);try{const j=await w(),P=await e.post(e.fhirUrl("Bot",t,"$execute"),j,d);await ud(m.current,{command:"setValue",value:P}),ve({color:"green",message:"Success"})}catch(j){ve({color:"red",message:Ae(j),autoClose:!1})}finally{v(!1)}},[e,t,w,d]);return!n||o===void 0?null:s.jsxs(nr,{m:0,gutter:0,style:{overflow:"hidden"},children:[s.jsx(nr.Col,{span:8,children:s.jsxs(Wn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",mih:400,children:[s.jsx(uQ,{iframeRef:h,language:"typescript",module:"commonjs",testId:"code-frame",defaultValue:o,minHeight:"528px"}),s.jsxs(Z,{justify:"flex-end",gap:"xs",children:[s.jsx(re,{type:"button",onClick:x,loading:g,leftSection:s.jsx(EF,{size:"1rem"}),children:"Save"}),s.jsx(re,{type:"button",onClick:b,loading:g,leftSection:s.jsx(sx,{size:"1rem"}),children:"Deploy"}),s.jsx(re,{type:"button",onClick:C,loading:g,leftSection:s.jsx(VF,{size:"1rem"}),children:"Execute"})]})]})}),s.jsxs(nr.Col,{span:4,children:[s.jsxs(Wn,{m:2,pb:"xs",pr:"xs",pt:"xs",shadow:"md",children:[s.jsx(Et,{data:[{label:"FHIR",value:Yt.FHIR_JSON},{label:"HL7",value:Yt.HL7_V2}],onChange:E=>f(E.currentTarget.value)}),d===Yt.FHIR_JSON?s.jsx(Ya,{value:a,onChange:E=>l(E),autosize:!0,minRows:15}):s.jsx("textarea",{className:lQ.hl7Input,value:c,onChange:E=>u(E.currentTarget.value),rows:15})]}),s.jsx(Wn,{m:2,p:"xs",shadow:"md",children:s.jsx(cQ,{iframeRef:m,className:"medplum-bot-output-frame",testId:"output-frame",minHeight:"200px"})})]})]})}async function pQ(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(uT);return(await e.download(e.fhirUrl("Binary",i))).text()}return t.code??""}function As(e){let t=e.meta;return t&&(t={...t,lastUpdated:void 0,versionId:void 0,author:void 0}),{...e,meta:t}}function mQ(){const e=oe(),{resourceType:t,id:n}=rt(),r={reference:t+"/"+n},o=p.useCallback(i=>{e.updateResource(As(i)).then(()=>{ve({color:"green",message:"Success"})}).catch(a=>{ve({color:"red",message:Ae(a),autoClose:!1})})},[e]);switch(t){case"PlanDefinition":return s.jsx(Re,{children:s.jsx(XB,{value:r,onSubmit:o})});case"Questionnaire":return s.jsx(Re,{children:s.jsx(NU,{questionnaire:r,onSubmit:o})});default:return null}}function gQ(){const{resourceType:e,id:t}=rt(),n=ft({reference:e+"/"+t}),r=Vt();return n?s.jsx(Re,{children:s.jsx(oH,{value:n,onStart:(o,i)=>r(`/forms/${sh(i)}`),onEdit:(o,i,a)=>r(`/${a.reference}}`)})}):null}function vQ(){const e=oe(),{resourceType:t,id:n}=rt(),r=Vt();return s.jsxs(Re,{children:[s.jsxs("p",{children:["Are you sure you want to delete this ",t,"?"]}),s.jsx(re,{color:"red",onClick:()=>{e.deleteResource(t,n).then(()=>r(`/${t}`)).catch(o=>ve({color:"red",message:Ae(o),autoClose:!1}))},children:"Delete"})]})}const yQ="_selectProfileBtn_tbaz6_1",xQ="_chevron_tbaz6_13",FS={selectProfileBtn:yQ,chevron:xQ};function wQ(){var c,u;const{resourceType:e,id:t}=rt(),n=ft({reference:e+"/"+t}),[r,o]=p.useState(),i=Oc({onDropdownClose:()=>i.resetSelectedOption()}),a=p.useMemo(()=>{var d;if(Ft((d=n==null?void 0:n.meta)==null?void 0:d.profile))return[s.jsx(_e.Option,{value:"",children:"None"},""),...n.meta.profile.map(f=>s.jsx(_e.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 Ft(a)&&(l=s.jsx(Z,{justify:"flex-end",children:s.jsxs(De,{align:"flex-end",gap:"xs",children:[s.jsxs(_e,{store:i,width:250,position:"bottom-end",withinPortal:!1,onOptionSubmit:d=>{o(d),i.closeDropdown()},children:[s.jsx(_e.Target,{children:s.jsx(An,{onClick:()=>i.toggleDropdown(),children:s.jsxs(ay,{fw:"bold",fs:"sm",className:FS.selectProfileBtn,children:[s.jsx("span",{children:"Pick profile"}),s.jsx(OT,{stroke:1.5,className:FS.chevron})]})})}),s.jsx(_e.Dropdown,{w:"max-content",children:s.jsx(_e.Options,{children:a})})]}),s.jsx(q,{children:r?s.jsxs(s.Fragment,{children:[s.jsx(ue,{span:!0,size:"sm",c:"dimmed",children:"Displaying profile: "}),s.jsx(ue,{span:!0,size:"sm",children:r||"Nothing selected"})]}):s.jsx(ue,{span:!0,size:"sm",c:"dimmed",children:"No profile displayed"})})]})})),s.jsx(Re,{children:s.jsxs(De,{gap:"xl",children:[l,s.jsx(Tx,{value:n,profileUrl:r})]})})}function SQ(){const e=oe(),{resourceType:t,id:n}=rt(),[r,o]=p.useState(),i=Vt(),[a,l]=p.useState();p.useEffect(()=>{e.readResource(t,n).then(d=>o(ho(d))).catch(d=>{l(dt(d)),ve({color:"red",message:Ae(d),autoClose:!1})})},[e,t,n]);const c=p.useCallback(d=>{l(void 0),e.updateResource(As(d)).then(()=>{i(`/${t}/${n}/details`),ve({color:"green",message:"Success"})}).catch(f=>{l(dt(f)),ve({color:"red",message:Ae(f),autoClose:!1})})},[e,t,n,i]),u=p.useCallback(()=>i(`/${t}/${n}/delete`),[i,t,n]);return r?s.jsx(Re,{children:s.jsx(Jd,{defaultValue:r,onSubmit:c,onDelete:u,outcome:a})}):null}function MR({resource:e,currentProfile:t,onChange:n}){const r=e.resourceType,o=oe(),[i,a]=p.useState();return p.useEffect(()=>{o.searchResources("StructureDefinition",{type:r,derivation:"constraint",_count:50}).then(l=>{a(l.filter(az))}).catch(console.error)},[o,n,r]),s.jsx(Ze,{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(Ze.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(Ze.Tab,{value:l.url,title:u,rightSection:c&&s.jsx(zy,{variant:"outline",color:"green",size:"xs",style:{borderStyle:"none"},children:s.jsx(ZF,{size:"90%"})}),children:l.title||l.name},l.url)})})})}function OR(e,t){const n=oe(),r=Vt();return{defaultValue:{resourceType:e},handleSubmit:a=>{t&&t(void 0),n.createResource(a).then(l=>r("/"+l.resourceType+"/"+l.id)).catch(l=>{t&&t(dt(l)),ve({color:"red",message:Ae(l),autoClose:!1,styles:{description:{whiteSpace:"pre-line"}}})})}}}function Rp(){const{resourceType:e}=rt(),t=Qo(),[n,r]=p.useState(),{defaultValue:o,handleSubmit:i}=OR(e,r),[a,l]=p.useState(),c=t.pathname.toLowerCase().endsWith("profiles"),u=p.useCallback(d=>{const f=As(d);a&&hT(f,a.url),i(f)},[a,i]);return c?s.jsx(Re,{children:s.jsxs(De,{children:[s.jsx(MR,{resource:o,currentProfile:a,onChange:l}),a?s.jsx(Jd,{defaultValue:o,onSubmit:u,outcome:n,profileUrl:a.url},a.url):s.jsx(ue,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})}):s.jsx(Re,{children:s.jsx(Jd,{defaultValue:o,onSubmit:i,outcome:n})})}function bQ(){const e=oe(),{resourceType:t,id:n}=rt(),r=e.readHistory(t,n).read();return s.jsx(Re,{children:s.jsx(TH,{history:r})})}function jQ(){const{resourceType:e}=rt(),[t,n]=p.useState(),{defaultValue:r,handleSubmit:o}=OR(e,n),i=p.useCallback(a=>{o(JSON.parse(a["new-resource"]))},[o]);return s.jsxs(Re,{children:[t&&s.jsx(Kr,{outcome:t}),s.jsxs(qe,{onSubmit:i,children:[s.jsx(Ya,{name:"new-resource","data-testid":"create-resource-json",autosize:!0,minRows:24,defaultValue:sr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(re,{type:"submit",children:"OK"})})]})]})}function CQ(){const e=oe(),{resourceType:t,id:n}=rt(),r=ft({reference:t+"/"+n}),o=Vt(),[i,a]=p.useState(),l=p.useCallback(c=>{e.updateResource(As(JSON.parse(c.resource))).then(()=>{a(void 0),o(`/${t}/${n}/details`),ve({color:"green",message:"Success"})}).catch(u=>{ve({color:"red",message:Ae(u),autoClose:!1})})},[e,t,n,o]);return r?s.jsxs(Re,{children:[i&&s.jsx(Kr,{outcome:i}),s.jsxs(qe,{onSubmit:l,children:[s.jsx(Ya,{name:"resource","data-testid":"resource-json",autosize:!0,minRows:24,defaultValue:sr(r,!0),formatOnBlur:!0,deserialize:JSON.parse}),s.jsx(Z,{justify:"flex-end",mt:"xl",wrap:"nowrap",children:s.jsx(re,{type:"submit",children:"OK"})})]})]}):null}function EQ(){const{resourceType:e,id:t}=rt();return ft({reference:e+"/"+t})?s.jsxs(Re,{children:[s.jsxs(Es,{icon:s.jsx(Kc,{size:16}),mb:"xl",children:["This is just a preview! Access your form here:",s.jsx("br",{}),s.jsx(Je,{href:`/forms/${t}`,children:`/forms/${t}`})]}),s.jsx(Gk,{questionnaire:{reference:e+"/"+t},onSubmit:()=>alert("You submitted the preview")})]}):null}function PQ(){const e=oe(),{resourceType:t,id:n}=rt(),[r,o]=p.useState(),[i,a]=p.useState();return p.useEffect(()=>{e.readResource(t,n).then(l=>o(ho(l))).catch(l=>{ve({color:"red",message:Ae(l)})})},[e,t,n]),r?s.jsxs(Re,{children:[s.jsxs(ce,{order:2,children:["Available ",t," profiles"]}),s.jsx(De,{children:s.jsxs(s.Fragment,{children:[s.jsx(MR,{resource:r,currentProfile:i,onChange:a}),i?s.jsx(TQ,{profile:i,resource:r,onResourceUpdated:l=>o(l)},i.url):s.jsx(ue,{my:"lg",fz:"lg",fs:"italic",ta:"center",children:"Select a profile above"})]})})]}):null}const TQ=({profile:e,resource:t,onResourceUpdated:n})=>{const r=oe(),[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=As(u);a?hT(d,e.url):s7(d,e.url),r.updateResource(d).then(f=>{n(f),ve({color:"green",message:"Success"})}).catch(f=>{i(dt(f)),ve({color:"red",message:Ae(f),autoClose:!1})})},[r,e.url,n,a]);return s.jsxs(De,{children:[s.jsx(Bc,{size:"md",checked:a,label:`Conform resource to ${e.title}`,onChange:u=>l(u.currentTarget.checked),"data-testid":"profile-toggle"}),a?s.jsx(Jd,{profileUrl:e.url,defaultValue:t,onSubmit:c,outcome:o}):s.jsx("form",{noValidate:!0,onSubmit:u=>{u.preventDefault(),c(t)},children:s.jsx(Z,{justify:"flex-end",mt:"xl",children:s.jsx(re,{type:"submit",children:"OK"})})})]})};function kQ(){const e=oe(),{id:t}=rt(),[n,r]=p.useState(),[o,i]=p.useState(0),a=e.searchResources("Subscription","status=active&_count=100").read().filter(c=>RQ(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:vt(n)}}).then(()=>{r(void 0),i(Date.now()),e.invalidateSearches("Subscription"),ve({color:"green",message:"Success"})}).catch(c=>ve({color:"red",message:Ae(c),autoClose:!1}))}return s.jsxs(Re,{children:[s.jsx(ce,{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(rl,{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(ce,{children:"Connect to bot"}),s.jsxs(Z,{children:[s.jsx(tl,{name:"bot",resourceType:"Bot",onChange:c=>r(c)}),s.jsx(re,{onClick:l,children:"Connect"})]}),s.jsx("div",{style:{display:"none"},children:o})]})}function RQ(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 _Q(){const{id:e}=rt(),t=Vt(),[n,r]=p.useState({resourceType:"QuestionnaireResponse",filters:[{code:"questionnaire",operator:ie.EQUALS,value:"Questionnaire/"+e}],fields:["id","_lastUpdated"]});return s.jsx(Re,{children:s.jsx(iu,{search:n,onClick:o=>t(`/${o.resource.resourceType}/${o.resource.id}`),onChange:o=>r(o.definition),hideFilters:!0,hideToolbar:!0})})}function DQ(){const e=oe(),{resourceType:t,id:n}=rt(),r=ft({reference:t+"/"+n}),o=p.useCallback(i=>{e.updateResource(As(i)).then(()=>{ve({color:"green",message:"Success"})}).catch(a=>{ve({color:"red",message:Ae(a),autoClose:!1})})},[e]);return r?s.jsx(Re,{children:s.jsx(YU,{onSubmit:o,definition:r})}):null}function IQ(){const{resourceType:e,id:t}=rt(),n=ft({reference:e+"/"+t});return n?s.jsx(Re,{children:e==="MeasureReport"?s.jsx(WB,{measureReport:n}):s.jsx(Sx,{value:n})}):null}const AQ="_container_1ue98_1",NQ="_entry_1ue98_14",MQ="_active_1ue98_21",_p={container:AQ,entry:NQ,active:MQ};function OQ(e){const t=oe(),n=ft(e.value),[r,o]=p.useState();return p.useEffect(()=>{if(!n)return;const i=Ux(n);if(!i)return;const a="reference"in i?i.reference:vt(i);t.search("ServiceRequest","subject="+a).then(l=>{const u=l.entry.map(d=>d.resource);jk(u),u.reverse(),o(u)}).catch(l=>ve({color:"red",message:Ae(l),autoClose:!1}))},[t,n]),r?s.jsx("div",{"data-testid":"quick-service-requests",className:_p.container,children:r.map(i=>{var a,l,c,u,d,f,h;return s.jsxs("div",{className:nt(_p.entry,{[_p.active]:i.id===(n==null?void 0:n.id)}),children:[s.jsx("p",{children:s.jsx(We,{to:i,children:$Q(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:LQ(i)})]},i.id)})}):null}function $Q(e){if(e.identifier){for(const t of e.identifier)if(t.value)return t.value}return e.id||""}function LQ(e){var t;return e.authoredOn?e.authoredOn.substring(0,10):(t=e.meta)!=null&&t.lastUpdated?e.meta.lastUpdated.substring(0,10):""}const FQ="_container_1l2dh_1",zQ={container:FQ};function VQ(e){var o,i,a,l;const t=ft(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:zQ.container,children:s.jsx(Et,{defaultValue:e.defaultValue,onChange:c=>e.onChange(c.currentTarget.value),data:n})})}function BQ(e){var n,r;const t=ft(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:Nn((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:UQ(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:HQ(t)})]}):s.jsx(s.Fragment,{})]}):null}function UQ(e){var o;const t=(o=e.collection)==null?void 0:o.collectedDateTime;if(!t)return;const n=new Date(t);return $R(LR(n,new Date))}function HQ(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 $R(LR(t,n))}function $R(e){return e.toString().padStart(3,"0")+"D"}function LR(e,t){const n=t.getTime()-e.getTime();return Math.floor(n/(1e3*3600*24))}function WQ(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 qQ=["Profiles"];function GQ(){var x,b,C,E,j,P,_;const e=oe(),{resourceType:t,id:n}=rt(),r={reference:t+"/"+n},o=Vt(),[i,a]=p.useState(),l=ft(r,a),c=WQ(t),[u,d]=p.useState(()=>{const R=window.location.pathname.split("/").pop();return R&&c.map(M=>M.toLowerCase()).includes(R)?R:c[0].toLowerCase()}),f=Dt();async function h(){var D,N;const M=(N=(D=(await e.readHistory(t,n)).entry)==null?void 0:D.find(A=>!!A.resource))==null?void 0:N.resource;M?m(M):ve({color:"red",message:"No history to restore",autoClose:!1})}function m(R){e.updateResource(As(R)).then(()=>{a(void 0),ve({color:"green",message:"Success"})}).catch(M=>{ve({color:"red",message:Ae(M),autoClose:!1})})}if(i)return k$(i)?s.jsxs(Re,{children:[s.jsx(ce,{children:"Deleted"}),s.jsx("p",{children:"The resource was deleted."}),s.jsx(re,{color:"red",onClick:h,children:"Restore"})]}):s.jsx(Kr,{outcome:i});function g(R){R||(R=c[0].toLowerCase()),d(R),o(`/${t}/${n}/${R}`)}function v(R){const M=l,D=M.orderDetail||[];D.length===0&&D.push({}),D[0].text!==R&&(D[0].text=R,m({...M,orderDetail:D}))}const S=l&&Ux(l),y=l&&xG(l),w=(C=(b=(x=e.getUserConfiguration())==null?void 0:x.option)==null?void 0:b.find(R=>R.id==="statusValueSet"))==null?void 0:C.valueString;return s.jsxs(s.Fragment,{children:[(l==null?void 0:l.resourceType)==="ServiceRequest"&&w&&s.jsx(VQ,{valueSet:{reference:w},defaultValue:(j=(E=l.orderDetail)==null?void 0:E[0])==null?void 0:j.text,onChange:v},vt(l)+"-"+((_=(P=l.orderDetail)==null?void 0:P[0])==null?void 0:_.text)),l&&s.jsx(OQ,{value:l}),l&&s.jsxs(Wn,{children:[S&&s.jsx(DR,{patient:S}),y&&s.jsx(BQ,{specimen:y}),t!=="Patient"&&s.jsx(IR,{resource:r}),s.jsx(Pr,{children:s.jsx(Ze,{value:u.toLowerCase(),onChange:g,children:s.jsx(Ze.List,{style:{whiteSpace:"nowrap",flexWrap:"nowrap"},children:c.map(R=>s.jsx(Ze.Tab,{value:R.toLowerCase(),children:qQ.includes(R)?s.jsxs(Z,{gap:"xs",wrap:"nowrap",children:[R,s.jsx($c,{color:f.primaryColor,size:"sm",children:"Beta"})]}):R},R))})})})]}),s.jsx(Lx,{})]})}function zS(){var y,w,x,b;const e=Vt(),{resourceType:t,id:n,versionId:r,tab:o}=rt(),i=oe(),[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(Ur,{});if(!c)return s.jsxs(Re,{children:[s.jsx(ce,{children:"Resource not found"}),s.jsx(We,{to:`/${t}`,children:"Return to search page"})]});const h=c.entry,m=h.findIndex(C=>{var E,j;return((j=(E=C.resource)==null?void 0:E.meta)==null?void 0:j.versionId)===r});if(m===-1)return s.jsxs(Re,{children:[s.jsx(ce,{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(Ze,{value:o||S,onChange:C=>e(`/${t}/${n}/_history/${r}/${C||S}`),children:[s.jsxs(Wn,{children:[s.jsx(nu,{fluid:!0,p:"md",children:s.jsx(ue,{children:`${t} ${n}`})}),s.jsxs(Ze.List,{children:[s.jsx(Ze.Tab,{value:"diff",children:"Diff"}),s.jsx(Ze.Tab,{value:"raw",children:"Raw"})]})]}),s.jsxs(Re,{children:[d&&s.jsx("pre",{"data-testid":"error",children:JSON.stringify(d,void 0,2)}),s.jsx(Ze.Panel,{value:"diff",children:v?s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(y=g.meta)==null?void 0:y.versionId]}),s.jsxs("li",{children:["Previous:"," ",s.jsx(We,{to:`/${t}/${n}/_history/${(w=v.meta)==null?void 0:w.versionId}`,children:(x=v.meta)==null?void 0:x.versionId})]})]}),s.jsx(EH,{original:v,revised:g})]}):s.jsxs(s.Fragment,{children:[s.jsxs("ul",{children:[s.jsxs("li",{children:["Current: ",(b=g.meta)==null?void 0:b.versionId]}),s.jsx("li",{children:"Previous: (none)"})]}),s.jsx("pre",{children:JSON.stringify(g,void 0,2)})]})}),s.jsx(Ze.Panel,{value:"raw",children:s.jsx("pre",{children:JSON.stringify(g,void 0,2)})})]})]})}function QQ(){const{resourceType:e,id:t}=rt(),n=Vt(),[r,o]=p.useState({resourceType:"Subscription",filters:[{code:"url",operator:ie.EQUALS,value:`${e}/${t}`}],fields:["id","criteria","status","_lastUpdated"]});return s.jsx(Re,{children:s.jsx(iu,{search:r,onClick:i=>n(`/${i.resource.resourceType}/${i.resource.id}`),onChange:i=>o(i.definition),hideFilters:!0})})}function VS(){const{resourceType:e,id:t}=rt(),n={reference:e+"/"+t};switch(e){case"Encounter":return s.jsx(BV,{encounter:n});case"Patient":return s.jsx(qB,{patient:n});case"ServiceRequest":return s.jsx(_H,{serviceRequest:n});default:return s.jsx(VV,{resource:n})}}function KQ(){const e=oe(),{id:t}=rt(),n=p.useMemo(()=>({reference:"Agent/"+t}),[t]),[r,o]=p.useState(!1),[i,a]=p.useState(!1),[l,c]=p.useState(),[u,d]=p.useState(),[f,h]=p.useState(),[m,g]=p.useState(),[v,S]=p.useState(!1),y=p.useCallback(()=>{o(!0),e.get(e.fhirUrl("Agent",t,"$status"),{cache:"reload"}).then(E=>{var j,P,_,R,M,D;c((P=(j=E.parameter)==null?void 0:j.find(N=>N.name==="status"))==null?void 0:P.valueCode),d((R=(_=E.parameter)==null?void 0:_.find(N=>N.name==="version"))==null?void 0:R.valueString),h((D=(M=E.parameter)==null?void 0:M.find(N=>N.name==="lastUpdated"))==null?void 0:D.valueInstant)}).catch(E=>C(Ae(E))).finally(()=>o(!1))},[e,t]),w=p.useCallback(E=>{const j=E.host,P=E.pingCount||1;j&&(S(!0),e.pushToAgent(n,j,`PING ${P}`,Yt.PING,!0).then(_=>g(_)).catch(_=>C(Ae(_))).finally(()=>S(!1)))},[e,n]),x=p.useCallback(()=>{a(!0),e.get(e.fhirUrl("Agent",t,"$reload-config"),{cache:"reload"}).then(E=>{b("Agent config reloaded successfully.")}).catch(E=>C(Ae(E))).finally(()=>a(!1))},[e,t]);function b(E){ve({color:"green",title:"Success",icon:s.jsx(Yc,{size:"1rem"}),message:E})}function C(E){ve({color:"red",title:"Error",message:E,autoClose:!1})}return s.jsxs(Re,{children:[s.jsx(ce,{order:1,children:"Agent Tools"}),s.jsxs("div",{style:{marginBottom:10},children:["Agent: ",s.jsx(rl,{value:n,link:!0})]}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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(re,{onClick:y,loading:r,children:"Get Status"}),!r&&l&&s.jsx(le,{children:s.jsxs(le.Tbody,{children:[s.jsxs(le.Tr,{children:[s.jsx(le.Td,{children:"Status"}),s.jsx(le.Td,{children:s.jsx(wx,{status:l})})]}),s.jsxs(le.Tr,{children:[s.jsx(le.Td,{children:"Version"}),s.jsx(le.Td,{children:u})]}),s.jsxs(le.Tr,{children:[s.jsx(le.Td,{children:"Last Updated"}),s.jsx(le.Td,{children:Nn(f,void 0,{timeZoneName:"longOffset"})})]})]})}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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(re,{onClick:x,loading:i,"aria-label":"Reload config",children:"Reload Config"}),s.jsx(en,{my:"lg"}),s.jsx(ce,{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:w,children:s.jsxs(Z,{children:[s.jsx(de,{id:"host",name:"host",placeholder:"ex. 127.0.0.1",label:"IP Address / Hostname",rightSection:s.jsx(Zt,{size:24,radius:"xl",variant:"filled",type:"submit","aria-label":"Ping",loading:v,children:s.jsx(qF,{style:{width:"1rem",height:"1rem"},stroke:1.5})})}),s.jsx(Ey,{id:"pingCount",name:"pingCount",placeholder:"1",label:"Ping Count"})]})}),!v&&m&&s.jsxs(s.Fragment,{children:[s.jsx(ce,{order:5,mt:"sm",mb:0,children:"Last Ping"}),s.jsx("pre",{children:m})]})]})}function YQ(){return s.jsx(ZW,{children:s.jsxs(we,{errorElement:s.jsx(hG,{}),children:[s.jsx(we,{path:"/signin",element:s.jsx($G,{})}),s.jsx(we,{path:"/oauth",element:s.jsx(IG,{})}),s.jsx(we,{path:"/resetpassword",element:s.jsx(NG,{})}),s.jsx(we,{path:"/setpassword/:id/:secret",element:s.jsx(OG,{})}),s.jsx(we,{path:"/register",element:s.jsx(AG,{})}),s.jsx(we,{path:"/changepassword",element:s.jsx(uG,{})}),s.jsx(we,{path:"/security",element:s.jsx(MG,{})}),s.jsx(we,{path:"/mfa",element:s.jsx(DG,{})}),s.jsx(we,{path:"/batch",element:s.jsx(lG,{})}),s.jsx(we,{path:"/bulk/:resourceType",element:s.jsx(cG,{})}),s.jsx(we,{path:"/smart",element:s.jsx(LG,{})}),s.jsx(we,{path:"/forms/:id",element:s.jsx(SG,{})}),s.jsx(we,{path:"/admin/super",element:s.jsx(XG,{})}),s.jsx(we,{path:"/admin/config",element:s.jsx(GG,{})}),s.jsxs(we,{path:"/admin",element:s.jsx(QG,{}),children:[s.jsx(we,{path:"patients",element:s.jsx(qG,{})}),s.jsx(we,{path:"bots/new",element:s.jsx(VG,{})}),s.jsx(we,{path:"bots",element:s.jsx(FG,{})}),s.jsx(we,{path:"clients/new",element:s.jsx(BG,{})}),s.jsx(we,{path:"clients",element:s.jsx(zG,{})}),s.jsx(we,{path:"details",element:s.jsx(OS,{})}),s.jsx(we,{path:"invite",element:s.jsx(WG,{})}),s.jsx(we,{path:"users",element:s.jsx(JG,{})}),s.jsx(we,{path:"project",element:s.jsx(OS,{})}),s.jsx(we,{path:"secrets",element:s.jsx(KG,{})}),s.jsx(we,{path:"sites",element:s.jsx(YG,{})}),s.jsx(we,{path:"members/:membershipId",element:s.jsx(HG,{})})]}),s.jsx(we,{path:"/lab/assays",element:s.jsx(ZG,{})}),s.jsx(we,{path:"/lab/panels",element:s.jsx(eQ,{})}),s.jsx(we,{path:"/:resourceType/:id/_history/:versionId/:tab",element:s.jsx(zS,{})}),s.jsx(we,{path:"/:resourceType/:id/_history/:versionId",element:s.jsx(zS,{})}),s.jsxs(we,{path:"/:resourceType/new",element:s.jsx(fG,{}),children:[s.jsx(we,{index:!0,element:s.jsx(Rp,{})}),s.jsx(we,{path:"form",element:s.jsx(Rp,{})}),s.jsx(we,{path:"json",element:s.jsx(jQ,{})}),s.jsx(we,{path:"profiles",element:s.jsx(Rp,{})})]}),s.jsxs(we,{path:"/:resourceType/:id",element:s.jsx(GQ,{}),children:[s.jsx(we,{index:!0,element:s.jsx(VS,{})}),s.jsx(we,{path:"apply",element:s.jsx(nQ,{})}),s.jsx(we,{path:"apps",element:s.jsx(rQ,{})}),s.jsx(we,{path:"event",element:s.jsx(iQ,{})}),s.jsx(we,{path:"blame",element:s.jsx(sQ,{})}),s.jsx(we,{path:"bots",element:s.jsx(kQ,{})}),s.jsx(we,{path:"builder",element:s.jsx(mQ,{})}),s.jsx(we,{path:"checklist",element:s.jsx(gQ,{})}),s.jsx(we,{path:"delete",element:s.jsx(vQ,{})}),s.jsx(we,{path:"details",element:s.jsx(wQ,{})}),s.jsx(we,{path:"edit",element:s.jsx(SQ,{})}),s.jsx(we,{path:"editor",element:s.jsx(hQ,{})}),s.jsx(we,{path:"history",element:s.jsx(bQ,{})}),s.jsx(we,{path:"json",element:s.jsx(CQ,{})}),s.jsx(we,{path:"preview",element:s.jsx(EQ,{})}),s.jsx(we,{path:"responses",element:s.jsx(_Q,{})}),s.jsx(we,{path:"report",element:s.jsx(IQ,{})}),s.jsx(we,{path:"ranges",element:s.jsx(DQ,{})}),s.jsx(we,{path:"subscriptions",element:s.jsx(QQ,{})}),s.jsx(we,{path:"timeline",element:s.jsx(VS,{})}),s.jsx(we,{path:"tools",element:s.jsx(KQ,{})}),s.jsx(we,{path:"profiles",element:s.jsx(PQ,{})})]}),s.jsx(we,{path:"/:resourceType",element:s.jsx(MS,{})}),s.jsx(we,{path:"/",element:s.jsx(MS,{})})]})})}function XQ(){const e=oe(),t=e.getUserConfiguration(),n=Qo(),[r]=Fx();return e.isLoading()?s.jsx(Ur,{}):s.jsx(U8,{logo:s.jsx(Qr,{size:24}),pathname:n.pathname,searchParams:r,version:z6,menus:JQ(t),displayAddBookmark:!!(t!=null&&t.id),children:s.jsx(p.Suspense,{fallback:s.jsx(Ur,{}),children:s.jsx(YQ,{})})})}function JQ(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:ZQ(i.target)})))||[]}}))||[];return t.push({title:"Settings",links:[{label:"Security",href:"/security",icon:s.jsx(NF,{})}]}),t}const BS={Patient:KF,Practitioner:DF,Organization:SF,ServiceRequest:UF,DiagnosticReport:WF,Questionnaire:_F,admin:yF,AccessPolicy:AF,Subscription:JF,batch:LF,Observation:$F};function ZQ(e){try{const t=new URL(e,"https://app.medplum.com").pathname.split("/")[1];if(t in BS){const n=BS[t];return s.jsx(n,{})}}catch{}return s.jsx(rh,{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 eK(){const e=cu(),t=new RT({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=rq([{path:"*",element:s.jsx(XQ,{})}]),o=a=>r.navigate(a);rR(document.getElementById("root")).render(s.jsx(p.StrictMode,{children:s.jsx(oF,{medplum:t,navigate:o,children:s.jsxs(Eb,{theme:n,children:[s.jsx(Wo,{position:"bottom-right"}),s.jsx(fq,{router:r})]})})}))}eK().catch(console.error);
|
|
563
|
+
//# sourceMappingURL=index-D9zfKRAQ.js.map
|